From 41f54a876685c9a45c2dc411f9554c5726d44e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Osorio?= Date: Wed, 17 Apr 2024 01:22:19 +0000 Subject: [PATCH] Add in store pickup targets's API definition --- .../ui-extensions/src/surfaces/admin/api.ts | 1 + .../admin/api/in-store-pickup/data.ts | 5 ++++ .../api/in-store-pickup/in-store-pickup.ts | 11 +++++++++ .../src/surfaces/admin/extension-targets.ts | 23 +++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 packages/ui-extensions/src/surfaces/admin/api/in-store-pickup/data.ts create mode 100644 packages/ui-extensions/src/surfaces/admin/api/in-store-pickup/in-store-pickup.ts diff --git a/packages/ui-extensions/src/surfaces/admin/api.ts b/packages/ui-extensions/src/surfaces/admin/api.ts index 838c4a8b8..b591f640e 100644 --- a/packages/ui-extensions/src/surfaces/admin/api.ts +++ b/packages/ui-extensions/src/surfaces/admin/api.ts @@ -8,3 +8,4 @@ export type {ProductDetailsConfigurationApi} from './api/product-configuration/p export type {ProductVariantDetailsConfigurationApi} from './api/product-configuration/product-variant-details-configuration'; export type {OrderRoutingRuleApi} from './api/order-routing-rule/order-routing-rule'; export type {ValidationSettingsApi} from './api/checkout-rules/validation-settings'; +export type {InStorePickUpApi} from './api/in-store-pickup/in-store-pickup'; diff --git a/packages/ui-extensions/src/surfaces/admin/api/in-store-pickup/data.ts b/packages/ui-extensions/src/surfaces/admin/api/in-store-pickup/data.ts new file mode 100644 index 000000000..1341569a9 --- /dev/null +++ b/packages/ui-extensions/src/surfaces/admin/api/in-store-pickup/data.ts @@ -0,0 +1,5 @@ +import type {Metafield} from '../shared'; + +export interface Data { + metafields: Metafield[]; +} diff --git a/packages/ui-extensions/src/surfaces/admin/api/in-store-pickup/in-store-pickup.ts b/packages/ui-extensions/src/surfaces/admin/api/in-store-pickup/in-store-pickup.ts new file mode 100644 index 000000000..17eea0073 --- /dev/null +++ b/packages/ui-extensions/src/surfaces/admin/api/in-store-pickup/in-store-pickup.ts @@ -0,0 +1,11 @@ +import type {StandardApi} from '../standard/standard'; +import type {ExtensionTarget as AnyExtensionTarget} from '../../extension-targets'; + +import {ApplyMetafieldsChange} from '../shared'; +import {Data} from './data'; + +export interface InStorePickUpApi + extends StandardApi { + applyMetafieldsChange: ApplyMetafieldsChange; + data: Data; +} diff --git a/packages/ui-extensions/src/surfaces/admin/extension-targets.ts b/packages/ui-extensions/src/surfaces/admin/extension-targets.ts index 51349af57..bbafe30bf 100644 --- a/packages/ui-extensions/src/surfaces/admin/extension-targets.ts +++ b/packages/ui-extensions/src/surfaces/admin/extension-targets.ts @@ -9,6 +9,7 @@ import type { ProductDetailsConfigurationApi, ProductVariantDetailsConfigurationApi, OrderRoutingRuleApi, + InStorePickUpApi, ValidationSettingsApi, } from './api'; import {AnyComponentBuilder} from '../../shared'; @@ -378,6 +379,28 @@ export interface ExtensionTargets { AllComponents >; + /** + * Renders In Store Pickup Configuration on in store pick up settings (general and per location). + * + * See the [list of available components](/docs/api/admin-extensions/components). + */ + 'admin.settings.in-store-pickup.render': RenderExtension< + InStorePickUpApi<'admin.settings.in-store-pickup.render'>, + AllComponents + >; + 'admin.settings.internal-in-store-pickup.render': RenderExtension< + InStorePickUpApi<'admin.settings.internal-in-store-pickup.render'>, + AllComponents + >; + 'admin.settings.in-store-pickup-location.render': RenderExtension< + InStorePickUpApi<'admin.settings.in-store-pickup-location.render'>, + AllComponents + >; + 'admin.settings.internal-in-store-pickup-location.render': RenderExtension< + InStorePickUpApi<'admin.settings.internal-in-store-pickup-location.render'>, + AllComponents + >; + /** * Renders Validation Settings within a given validation's add and edit views. *