diff --git a/packages/ui-extensions/src/surfaces/point-of-sale.ts b/packages/ui-extensions/src/surfaces/point-of-sale.ts index 7aff76514..3cdd85c23 100644 --- a/packages/ui-extensions/src/surfaces/point-of-sale.ts +++ b/packages/ui-extensions/src/surfaces/point-of-sale.ts @@ -1,8 +1,6 @@ export * from './point-of-sale/api'; export * from './point-of-sale/components'; export * from './point-of-sale/targets'; -export * from './point-of-sale/event/targets'; -export * from './point-of-sale/event/extension'; export * from './point-of-sale/extension'; export * from './point-of-sale/shared'; export * from './point-of-sale/globals'; diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/event/extension.ts b/packages/ui-extensions/src/surfaces/point-of-sale/event/extension.ts deleted file mode 100644 index 80bd7cff5..000000000 --- a/packages/ui-extensions/src/surfaces/point-of-sale/event/extension.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createExtensionRegistrationFunction} from './registration'; -import {EventExtensionTargets} from './targets'; - -export const eventExtension = - createExtensionRegistrationFunction(); diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/event/input/PurchaseCompleteInput.ts b/packages/ui-extensions/src/surfaces/point-of-sale/event/input/PurchaseCompleteInput.ts deleted file mode 100644 index e907c3202..000000000 --- a/packages/ui-extensions/src/surfaces/point-of-sale/event/input/PurchaseCompleteInput.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {BaseInput} from './BaseInput'; - -export interface PurchaseCompleteInput extends BaseInput { - lineItems: any[]; - discounts: any[]; - attributedStaff: any; - orderId: any; - draftCheckoutId: any; - taxLines: any[]; - shippingLines: any[]; -} diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/event/registration.ts b/packages/ui-extensions/src/surfaces/point-of-sale/event/registration.ts deleted file mode 100644 index b4806d6bb..000000000 --- a/packages/ui-extensions/src/surfaces/point-of-sale/event/registration.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface ExtensionRegistrationFunction { - ( - target: Target, - callback: ExtensionPoints[Target], - ): ExtensionPoints[Target]; -} - -export function createExtensionRegistrationFunction< - ExtensionPoints, ->(): ExtensionRegistrationFunction { - const extensionWrapper: ExtensionRegistrationFunction = ( - target, - callback, - ) => { - (globalThis as any).shopify?.extend(target, callback); - return callback; - }; - - return extensionWrapper; -} diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts b/packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts deleted file mode 100644 index d98dc9f51..000000000 --- a/packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {BaseIntent} from '../intent'; -import {PurchaseCompleteInput} from './input/PurchaseCompleteInput'; - -export interface EventExtensionTargets { - 'pos.purchase-complete.observe': (input: PurchaseCompleteInput) => BaseIntent; -} - -export type EventExtensionTarget = keyof EventExtensionTargets; diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/input.ts b/packages/ui-extensions/src/surfaces/point-of-sale/input.ts index bf496d9f8..a320ce779 100644 --- a/packages/ui-extensions/src/surfaces/point-of-sale/input.ts +++ b/packages/ui-extensions/src/surfaces/point-of-sale/input.ts @@ -1,4 +1,3 @@ -export type {BaseInput} from './event/input/BaseInput'; -export type {PurchaseCompleteInput} from './event/input/PurchaseCompleteInput'; +export type {BaseInput} from './run/input/BaseInput'; export type {Device} from './types/device'; diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/intent.ts b/packages/ui-extensions/src/surfaces/point-of-sale/intent.ts index 66ab0e018..142e1fd66 100644 --- a/packages/ui-extensions/src/surfaces/point-of-sale/intent.ts +++ b/packages/ui-extensions/src/surfaces/point-of-sale/intent.ts @@ -1 +1 @@ -export type {BaseIntent} from './event/intent/BaseIntent'; +export type {BaseIntent} from './run/intent/BaseIntent'; diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/event/input/BaseInput.ts b/packages/ui-extensions/src/surfaces/point-of-sale/run/input/BaseInput.ts similarity index 100% rename from packages/ui-extensions/src/surfaces/point-of-sale/event/input/BaseInput.ts rename to packages/ui-extensions/src/surfaces/point-of-sale/run/input/BaseInput.ts diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/event/intent/BaseIntent.ts b/packages/ui-extensions/src/surfaces/point-of-sale/run/intent/BaseIntent.ts similarity index 100% rename from packages/ui-extensions/src/surfaces/point-of-sale/event/intent/BaseIntent.ts rename to packages/ui-extensions/src/surfaces/point-of-sale/run/intent/BaseIntent.ts