@sixtyninecommerce/admin 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5772 -118
- package/dist/auth/index.d.ts +7 -1
- package/dist/auth/index.js +8 -1
- package/dist/catalog/assets.d.ts +120 -8
- package/dist/catalog/assets.js +98 -12
- package/dist/catalog/collections.d.ts +279 -14
- package/dist/catalog/collections.js +246 -15
- package/dist/catalog/documents.d.ts +142 -0
- package/dist/catalog/documents.js +114 -0
- package/dist/catalog/index.d.ts +54 -6
- package/dist/catalog/index.js +10 -1
- package/dist/catalog/metadata.d.ts +244 -0
- package/dist/catalog/metadata.js +220 -0
- package/dist/catalog/products.d.ts +159 -19
- package/dist/catalog/products.js +88 -13
- package/dist/catalog/properties.d.ts +140 -14
- package/dist/catalog/properties.js +65 -1
- package/dist/catalog/recommendations.d.ts +288 -0
- package/dist/catalog/recommendations.js +237 -0
- package/dist/catalog/reviews.d.ts +381 -0
- package/dist/catalog/reviews.js +325 -0
- package/dist/catalog/types.d.ts +17 -1
- package/dist/catalog/types.js +10 -0
- package/dist/catalog/variant-find.d.ts +136 -0
- package/dist/catalog/variant-find.js +239 -0
- package/dist/catalog/variants.d.ts +293 -26
- package/dist/catalog/variants.js +164 -7
- package/dist/catalog/visibility.d.ts +38 -7
- package/dist/catalog/visibility.js +19 -1
- package/dist/client.d.ts +121 -9
- package/dist/client.js +53 -14
- package/dist/content/assets.d.ts +285 -0
- package/dist/content/assets.js +181 -0
- package/dist/content/forms.d.ts +332 -1
- package/dist/content/forms.js +140 -4
- package/dist/content/items.d.ts +292 -0
- package/dist/content/items.js +170 -0
- package/dist/content/menus.d.ts +254 -0
- package/dist/content/menus.js +70 -0
- package/dist/content/strings.d.ts +137 -0
- package/dist/content/strings.js +82 -0
- package/dist/content/types.d.ts +282 -0
- package/dist/content/types.js +100 -0
- package/dist/customers/age-verification.d.ts +66 -0
- package/dist/customers/age-verification.js +79 -0
- package/dist/customers/credit.d.ts +263 -0
- package/dist/customers/credit.js +244 -0
- package/dist/customers/delivery-preferences.d.ts +120 -0
- package/dist/customers/delivery-preferences.js +97 -0
- package/dist/customers/delivery-terms.d.ts +44 -0
- package/dist/customers/delivery-terms.js +32 -0
- package/dist/customers/groups.d.ts +207 -0
- package/dist/customers/groups.js +438 -0
- package/dist/customers/index.d.ts +462 -37
- package/dist/customers/index.js +317 -40
- package/dist/customers/invitation-status.d.ts +57 -0
- package/dist/customers/invitation-status.js +21 -0
- package/dist/customers/notes.d.ts +67 -0
- package/dist/customers/notes.js +51 -0
- package/dist/customers/notification-recipients.d.ts +97 -0
- package/dist/customers/notification-recipients.js +84 -0
- package/dist/customers/saved-lists.d.ts +42 -0
- package/dist/customers/saved-lists.js +61 -0
- package/dist/customers/vat.d.ts +83 -0
- package/dist/customers/vat.js +46 -0
- package/dist/customers/wire.d.ts +20 -0
- package/dist/customers/wire.js +35 -0
- package/dist/documents/ar.d.ts +307 -0
- package/dist/documents/ar.js +254 -0
- package/dist/documents/emails.d.ts +150 -0
- package/dist/documents/emails.js +220 -0
- package/dist/documents/index.d.ts +744 -21
- package/dist/documents/index.js +438 -24
- package/dist/documents/pdf.d.ts +2 -0
- package/dist/documents/pdf.js +11 -0
- package/dist/fulfillments/create.d.ts +167 -0
- package/dist/fulfillments/create.js +216 -0
- package/dist/fulfillments/index.d.ts +163 -11
- package/dist/fulfillments/index.js +135 -6
- package/dist/fulfillments/payment-policy.d.ts +64 -0
- package/dist/fulfillments/payment-policy.js +140 -0
- package/dist/fulfillments/warehouse.d.ts +724 -0
- package/dist/fulfillments/warehouse.js +914 -0
- package/dist/geo/index.d.ts +119 -0
- package/dist/geo/index.js +107 -0
- package/dist/index.d.ts +147 -39
- package/dist/index.js +51 -12
- package/dist/integrations/afas-actions.d.ts +234 -0
- package/dist/integrations/afas-actions.js +310 -0
- package/dist/integrations/afas-types.d.ts +483 -0
- package/dist/integrations/afas-types.js +5 -0
- package/dist/integrations/afas.d.ts +234 -0
- package/dist/integrations/afas.js +290 -0
- package/dist/integrations/connections.d.ts +103 -0
- package/dist/integrations/connections.js +55 -0
- package/dist/integrations/esp.d.ts +313 -0
- package/dist/integrations/esp.js +169 -0
- package/dist/integrations/exact-online-types.d.ts +965 -0
- package/dist/integrations/exact-online-types.js +6 -0
- package/dist/integrations/exact-online.d.ts +784 -0
- package/dist/integrations/exact-online.js +1089 -0
- package/dist/integrations/index.d.ts +44 -3
- package/dist/integrations/index.js +23 -3
- package/dist/integrations/pipeline-discoveries.d.ts +65 -0
- package/dist/integrations/pipeline-discoveries.js +65 -0
- package/dist/integrations/pipeline-keys.d.ts +13 -0
- package/dist/integrations/pipeline-keys.js +22 -0
- package/dist/integrations/pipeline-runs.d.ts +119 -0
- package/dist/integrations/pipeline-runs.js +87 -0
- package/dist/integrations/pipelines.d.ts +87 -15
- package/dist/integrations/pipelines.js +41 -22
- package/dist/integrations/price-import.d.ts +223 -0
- package/dist/integrations/price-import.js +124 -0
- package/dist/integrations/types.d.ts +367 -3
- package/dist/integrations/types.js +4 -3
- package/dist/locations/index.d.ts +66 -0
- package/dist/locations/index.js +31 -0
- package/dist/meta/index.d.ts +172 -0
- package/dist/metafields/index.d.ts +8 -1
- package/dist/metafields/index.js +10 -0
- package/dist/orders/cancel-with-money.d.ts +237 -0
- package/dist/orders/cancel-with-money.js +155 -0
- package/dist/orders/commit-edit.d.ts +23 -1
- package/dist/orders/commit-edit.js +19 -2
- package/dist/orders/deposit-policy.d.ts +3 -1
- package/dist/orders/drafts.d.ts +800 -0
- package/dist/orders/drafts.js +771 -0
- package/dist/orders/fields.d.ts +245 -0
- package/dist/orders/fields.js +188 -0
- package/dist/orders/get.d.ts +29 -19
- package/dist/orders/get.js +17 -8
- package/dist/orders/index.d.ts +66 -15
- package/dist/orders/index.js +25 -2
- package/dist/orders/lifecycle.d.ts +128 -0
- package/dist/orders/lifecycle.js +158 -0
- package/dist/orders/line-price-preview.d.ts +7 -2
- package/dist/orders/list.d.ts +243 -0
- package/dist/orders/list.js +487 -0
- package/dist/orders/manual-discounts.d.ts +13 -5
- package/dist/orders/manual-pricing.d.ts +5 -0
- package/dist/orders/money-view.d.ts +149 -0
- package/dist/orders/money-view.js +99 -0
- package/dist/orders/order-entry.d.ts +20 -7
- package/dist/orders/plan-edit.d.ts +34 -2
- package/dist/orders/plan-edit.js +112 -11
- package/dist/orders/settings.d.ts +201 -0
- package/dist/orders/settings.js +325 -0
- package/dist/orders/status.d.ts +159 -13
- package/dist/orders/status.js +21 -0
- package/dist/orders/surcharges.d.ts +20 -1
- package/dist/orders/surcharges.js +37 -11
- package/dist/payments/account-credit.d.ts +46 -0
- package/dist/payments/account-credit.js +42 -0
- package/dist/payments/ar.d.ts +292 -0
- package/dist/payments/ar.js +223 -0
- package/dist/payments/connected-account.d.ts +47 -0
- package/dist/payments/connected-account.js +61 -0
- package/dist/payments/credit-noted-fields.d.ts +19 -0
- package/dist/payments/credit-noted-fields.js +69 -0
- package/dist/payments/customer-consent.d.ts +30 -0
- package/dist/payments/customer-consent.js +49 -0
- package/dist/payments/index.d.ts +340 -19
- package/dist/payments/index.js +151 -1
- package/dist/payments/methods.d.ts +303 -8
- package/dist/payments/methods.js +337 -7
- package/dist/payments/mollie-methods.d.ts +159 -0
- package/dist/payments/mollie-methods.js +141 -0
- package/dist/payments/payment-links.d.ts +180 -0
- package/dist/payments/payment-links.js +97 -0
- package/dist/payments/provider-keys.d.ts +150 -0
- package/dist/payments/provider-keys.js +118 -0
- package/dist/payments/providers.d.ts +86 -11
- package/dist/payments/providers.js +29 -0
- package/dist/payments/requests.d.ts +147 -0
- package/dist/payments/requests.js +93 -0
- package/dist/payments/store-credit-fields.d.ts +15 -0
- package/dist/payments/store-credit-fields.js +51 -0
- package/dist/pickups/index.d.ts +106 -0
- package/dist/pickups/index.js +108 -0
- package/dist/platform/channels.d.ts +132 -0
- package/dist/platform/channels.js +128 -0
- package/dist/platform/email-gateways.d.ts +165 -0
- package/dist/platform/email-gateways.js +78 -0
- package/dist/platform/geo.d.ts +123 -0
- package/dist/platform/geo.js +144 -0
- package/dist/platform/tax.d.ts +162 -0
- package/dist/platform/tax.js +169 -0
- package/dist/pos/anomalies.d.ts +158 -0
- package/dist/pos/anomalies.js +64 -0
- package/dist/pos/assisted-selling.d.ts +79 -0
- package/dist/pos/assisted-selling.js +38 -0
- package/dist/pos/exchanges.d.ts +108 -0
- package/dist/pos/exchanges.js +22 -0
- package/dist/pos/gift-cards.d.ts +135 -0
- package/dist/pos/gift-cards.js +47 -0
- package/dist/pos/index.d.ts +2370 -58
- package/dist/pos/index.js +854 -7
- package/dist/pos/no-receipt.d.ts +94 -0
- package/dist/pos/no-receipt.js +25 -0
- package/dist/pos/offline-sales.d.ts +228 -0
- package/dist/pos/offline-sales.js +170 -0
- package/dist/pos/pay-by-link.d.ts +143 -0
- package/dist/pos/pay-by-link.js +57 -0
- package/dist/pos/quick-keys.d.ts +103 -0
- package/dist/pos/quick-keys.js +45 -0
- package/dist/pos/reports.d.ts +360 -0
- package/dist/pos/reports.js +62 -0
- package/dist/pos/returns.d.ts +244 -0
- package/dist/pos/returns.js +83 -0
- package/dist/pricing/bulk-coupons.d.ts +139 -0
- package/dist/pricing/bulk-coupons.js +112 -0
- package/dist/pricing/index.d.ts +174 -4
- package/dist/pricing/index.js +174 -1
- package/dist/pricing/price-lists.d.ts +606 -0
- package/dist/pricing/price-lists.js +600 -0
- package/dist/purchasing/alerts.d.ts +104 -0
- package/dist/purchasing/alerts.js +88 -0
- package/dist/purchasing/backorders.d.ts +61 -0
- package/dist/purchasing/backorders.js +92 -0
- package/dist/purchasing/cost.d.ts +110 -0
- package/dist/purchasing/cost.js +86 -0
- package/dist/purchasing/index.d.ts +54 -0
- package/dist/purchasing/index.js +24 -0
- package/dist/purchasing/links.d.ts +263 -0
- package/dist/purchasing/links.js +192 -0
- package/dist/purchasing/purchase-orders.d.ts +551 -0
- package/dist/purchasing/purchase-orders.js +491 -0
- package/dist/purchasing/receipts.d.ts +396 -0
- package/dist/purchasing/receipts.js +287 -0
- package/dist/purchasing/replenishment.d.ts +281 -0
- package/dist/purchasing/replenishment.js +240 -0
- package/dist/purchasing/returns.d.ts +273 -0
- package/dist/purchasing/returns.js +229 -0
- package/dist/purchasing/settings.d.ts +152 -0
- package/dist/purchasing/settings.js +181 -0
- package/dist/purchasing/suppliers.d.ts +476 -0
- package/dist/purchasing/suppliers.js +438 -0
- package/dist/quotes/index.d.ts +518 -0
- package/dist/quotes/index.js +439 -0
- package/dist/reports/index.d.ts +71 -8
- package/dist/reports/index.js +74 -11
- package/dist/returns/index.d.ts +675 -21
- package/dist/returns/index.js +756 -11
- package/dist/search/index.d.ts +76 -1
- package/dist/search/index.js +63 -0
- package/dist/seo/config.d.ts +128 -0
- package/dist/seo/config.js +95 -0
- package/dist/seo/redirects.d.ts +125 -0
- package/dist/seo/redirects.js +60 -1
- package/dist/seo/settings.d.ts +147 -0
- package/dist/seo/settings.js +209 -0
- package/dist/shipping/definitions.d.ts +29 -0
- package/dist/shipping/definitions.js +47 -0
- package/dist/shipping/fulfillment-profiles.d.ts +174 -0
- package/dist/shipping/fulfillment-profiles.js +104 -0
- package/dist/shipping/hendriks.d.ts +97 -0
- package/dist/shipping/hendriks.js +50 -0
- package/dist/shipping/index.d.ts +54 -0
- package/dist/shipping/index.js +27 -0
- package/dist/shipping/methods.d.ts +205 -0
- package/dist/shipping/methods.js +240 -0
- package/dist/shipping/myparcel.d.ts +668 -0
- package/dist/shipping/myparcel.js +466 -0
- package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
- package/dist/shipping/parcel-rule.d.ts +6 -5
- package/dist/shipping/parcel-rule.js +21 -23
- package/dist/shipping/rate-tables.d.ts +324 -0
- package/dist/shipping/rate-tables.js +390 -0
- package/dist/shipping/ship-to-countries.d.ts +75 -0
- package/dist/shipping/ship-to-countries.js +47 -0
- package/dist/stock/by-location.d.ts +86 -0
- package/dist/stock/by-location.js +94 -0
- package/dist/stock/index.d.ts +18 -4
- package/dist/stock/index.js +7 -0
- package/dist/stock/locations.d.ts +144 -0
- package/dist/stock/locations.js +168 -0
- package/dist/stock/settings.d.ts +106 -0
- package/dist/stock/settings.js +103 -0
- package/dist/stock/transfers.d.ts +386 -52
- package/dist/stock/transfers.js +222 -17
- package/dist/stored-value/index.d.ts +312 -11
- package/dist/stored-value/index.js +223 -4
- package/dist/subscriptions/index.d.ts +682 -0
- package/dist/subscriptions/index.js +815 -0
- package/dist/tax/display-policy.d.ts +105 -0
- package/dist/tax/display-policy.js +84 -0
- package/dist/tax/index.d.ts +79 -1
- package/dist/tax/index.js +52 -0
- package/dist/tenant/email-style.d.ts +102 -0
- package/dist/tenant/email-style.js +72 -0
- package/dist/tenant/email-templates.d.ts +287 -0
- package/dist/tenant/email-templates.js +271 -0
- package/dist/tenant/notifications.d.ts +23 -17
- package/dist/tenant/settings-sources.d.ts +1 -1
- package/dist/tenant/time-zone.d.ts +17 -0
- package/dist/tenant/time-zone.js +11 -0
- package/dist/types.d.ts +50 -3
- package/dist/users/index.d.ts +3 -0
- package/dist/users/index.js +2 -0
- package/dist/users/warehouses.d.ts +50 -0
- package/dist/users/warehouses.js +51 -0
- package/package.json +2 -2
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The shapes of `admin.integrations.pipelines` (headless spec §7 `pipelines.drafts
|
|
2
|
+
* The shapes of `admin.integrations.pipelines` (headless spec §7 `pipelines.drafts`, §9.2
|
|
3
|
+
* `integrations`).
|
|
3
4
|
*
|
|
4
5
|
* Kept verbatim (stored data, never renamed): `triggerFilter`'s keys (reader field names such as
|
|
5
|
-
* `toState`), `siteAnalysis` and `publicCredentials` (the connector's own
|
|
6
|
-
* map's `sourceSchema`, `targetSchema` and `subCounts`.
|
|
6
|
+
* `toState`), a pipeline's `config`, `siteAnalysis` and `publicCredentials` (the connector's own
|
|
7
|
+
* keys), and a schema map's `sourceSchema`, `targetSchema` and `subCounts`.
|
|
7
8
|
*/
|
|
9
|
+
import type { ProgressStreamOptions } from '@sixtyninecommerce/core';
|
|
10
|
+
import type { ListOptions } from '../types.js';
|
|
8
11
|
export type PipelineDirection = 'import' | 'export';
|
|
9
12
|
/** The wizard's steps before a commit; `import`/`done` come after one, when no draft exists. */
|
|
10
13
|
export type PipelineDraftStep = 'direction' | 'connector' | 'credentials' | 'discovery' | 'review' | 'entities' | 'trigger' | 'configure' | 'preview';
|
|
@@ -174,3 +177,364 @@ export interface CommittedPipelineDraft {
|
|
|
174
177
|
message: string;
|
|
175
178
|
} | null;
|
|
176
179
|
}
|
|
180
|
+
/** A field of a connector's credentials form, as the connector declares it. */
|
|
181
|
+
export interface PipelineConnectorCredentialField {
|
|
182
|
+
/** The key to send in `credentials`, in the connector's own spelling (`consumerKey`, `sftpHost`). */
|
|
183
|
+
key: string;
|
|
184
|
+
label: string;
|
|
185
|
+
/**
|
|
186
|
+
* `password` marks a secret: it is never read back (`publicCredentials` leaves it out), and on
|
|
187
|
+
* `connections.update` a blank one keeps the stored secret.
|
|
188
|
+
*/
|
|
189
|
+
type: 'text' | 'password' | 'url';
|
|
190
|
+
placeholder: string;
|
|
191
|
+
required: boolean;
|
|
192
|
+
helpText?: string;
|
|
193
|
+
/** A heading the form groups the field under (`sftp`, `paths`, `edi`, `warehouse`, `sender`). */
|
|
194
|
+
group?: string;
|
|
195
|
+
}
|
|
196
|
+
/** One credential field that names where the connector sends its secrets. */
|
|
197
|
+
export interface PipelineCredentialBindingField {
|
|
198
|
+
key: string;
|
|
199
|
+
role: 'host' | 'port' | 'user';
|
|
200
|
+
/** The port a blank `port` field means. */
|
|
201
|
+
defaultPort?: number;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* What a connection's stored secrets are bound to: its source URL (scheme, host, port and path),
|
|
205
|
+
* or the named credential fields (an SFTP login). A `connections.update` that moves it must carry
|
|
206
|
+
* every required secret afresh, or it is refused `PIPELINE_HOST_CHANGE_REQUIRES_CREDENTIALS`.
|
|
207
|
+
*/
|
|
208
|
+
export type PipelineCredentialBinding = {
|
|
209
|
+
kind: 'source-url';
|
|
210
|
+
} | {
|
|
211
|
+
kind: 'credential-fields';
|
|
212
|
+
fields: PipelineCredentialBindingField[];
|
|
213
|
+
};
|
|
214
|
+
/** A connector this deployment offers (`integrations.pipelines.connectors()`). */
|
|
215
|
+
export interface PipelineConnector {
|
|
216
|
+
/** `woocommerce`, `blujay_wms`, … : a connection's `connectorType`. */
|
|
217
|
+
type: string;
|
|
218
|
+
name: string;
|
|
219
|
+
description: string;
|
|
220
|
+
logoUrl: string;
|
|
221
|
+
/** A `coming_soon` connector is listed but cannot be connected yet. */
|
|
222
|
+
status: 'active' | 'coming_soon';
|
|
223
|
+
credentialFields: PipelineConnectorCredentialField[];
|
|
224
|
+
/** Absent from a plugins service deployed before it existed; the server still refuses a move. */
|
|
225
|
+
credentialBinding?: PipelineCredentialBinding;
|
|
226
|
+
/** What an import over it can read; empty when it imports nothing. */
|
|
227
|
+
supportedEntityTypes: string[];
|
|
228
|
+
/** What an export over it can write; absent when it exports nothing. */
|
|
229
|
+
supportedExportEntityTypes?: string[];
|
|
230
|
+
/** It brings its own schema maps, so an import needs no discovery. */
|
|
231
|
+
fixedSchema?: boolean;
|
|
232
|
+
}
|
|
233
|
+
/** A credential the source checks apart from the main login (WooCommerce's companion plugin). */
|
|
234
|
+
export interface PipelineAuthCheck {
|
|
235
|
+
id: string;
|
|
236
|
+
label: string;
|
|
237
|
+
ok: boolean;
|
|
238
|
+
/** Why it failed; absent when `ok`. */
|
|
239
|
+
message?: string;
|
|
240
|
+
}
|
|
241
|
+
/** What a probe of the source reported (`test`, `retest`, and a connection's `siteAnalysis`). */
|
|
242
|
+
export interface PipelineSiteAnalysis {
|
|
243
|
+
platform: string;
|
|
244
|
+
version: string;
|
|
245
|
+
/**
|
|
246
|
+
* Records per entity type, keyed by the source's own names (a WordPress post type such as
|
|
247
|
+
* `product_brand` too): kept verbatim, never camelCased.
|
|
248
|
+
*/
|
|
249
|
+
entityCounts: Record<string, number>;
|
|
250
|
+
languages: string[];
|
|
251
|
+
plugins: string[];
|
|
252
|
+
currency: string;
|
|
253
|
+
capabilities: string[];
|
|
254
|
+
authChecks?: PipelineAuthCheck[];
|
|
255
|
+
/** Whether the source's prices include tax; absent when the connector could not tell. */
|
|
256
|
+
sourcePricesIncludeTax?: boolean;
|
|
257
|
+
}
|
|
258
|
+
/** A pipeline that runs over a connection. Only the store's own are listed. */
|
|
259
|
+
export interface PipelineConnectionUsage {
|
|
260
|
+
id: string;
|
|
261
|
+
name: string;
|
|
262
|
+
direction: PipelineDirection;
|
|
263
|
+
isActive: boolean;
|
|
264
|
+
}
|
|
265
|
+
export type PipelineConnectionStatus = 'pending' | 'connected' | 'error';
|
|
266
|
+
/** The throttles a connection may wait between two requests to its source, in milliseconds. */
|
|
267
|
+
export type PipelineRequestDelayMs = 50 | 100 | 200 | 300 | 500;
|
|
268
|
+
/**
|
|
269
|
+
* A source connection of the store. Never a secret: `publicCredentials` holds the fields its
|
|
270
|
+
* connector does not mark `password`, and is absent when they cannot be read.
|
|
271
|
+
*/
|
|
272
|
+
export interface PipelineConnection {
|
|
273
|
+
id: string;
|
|
274
|
+
connectorType: string;
|
|
275
|
+
name: string;
|
|
276
|
+
sourceUrl: string;
|
|
277
|
+
/** As of the last probe: a failed re-test sets `error`. */
|
|
278
|
+
status: PipelineConnectionStatus;
|
|
279
|
+
/** `null`: no throttle. */
|
|
280
|
+
requestDelayMs: number | null;
|
|
281
|
+
/** Old hostnames whose image URLs an import rewrites to `sourceUrl`'s host. */
|
|
282
|
+
legacyAssetHosts: string[] | null;
|
|
283
|
+
/** What the last successful probe reported; stored data, kept verbatim. */
|
|
284
|
+
siteAnalysis: PipelineSiteAnalysis | null;
|
|
285
|
+
lastTestedAt: string | null;
|
|
286
|
+
createdAt: string;
|
|
287
|
+
updatedAt: string;
|
|
288
|
+
publicCredentials?: Record<string, string>;
|
|
289
|
+
/** The pipelines that run over it; one in the list blocks `connections.delete`. */
|
|
290
|
+
pipelineUsage: PipelineConnectionUsage[];
|
|
291
|
+
}
|
|
292
|
+
export interface CreatePipelineConnectionInput {
|
|
293
|
+
/** A connector's `type` (`connectors()`). */
|
|
294
|
+
connectorType: string;
|
|
295
|
+
name: string;
|
|
296
|
+
/** The source's address: `https://…` for a shop, `sftp://host:port` for an SFTP connector. */
|
|
297
|
+
sourceUrl: string;
|
|
298
|
+
/** The connector's `credentialFields`, by `key`. Stored encrypted; never read back. */
|
|
299
|
+
credentials: Record<string, string>;
|
|
300
|
+
requestDelayMs?: PipelineRequestDelayMs;
|
|
301
|
+
legacyAssetHosts?: string[];
|
|
302
|
+
}
|
|
303
|
+
/** Every field optional: one left out stays as stored. */
|
|
304
|
+
export interface UpdatePipelineConnectionInput {
|
|
305
|
+
name?: string;
|
|
306
|
+
sourceUrl?: string;
|
|
307
|
+
/**
|
|
308
|
+
* MERGED over the stored set: a `password` field sent blank (or left out) keeps the stored
|
|
309
|
+
* secret while the connection keeps its recipient (`PipelineCredentialBinding`); a non-secret
|
|
310
|
+
* field sent blank is cleared.
|
|
311
|
+
*/
|
|
312
|
+
credentials?: Record<string, string>;
|
|
313
|
+
/** `null` removes the throttle. */
|
|
314
|
+
requestDelayMs?: PipelineRequestDelayMs | null;
|
|
315
|
+
legacyAssetHosts?: string[];
|
|
316
|
+
}
|
|
317
|
+
export interface TestPipelineConnectionInput {
|
|
318
|
+
connectorType: string;
|
|
319
|
+
sourceUrl: string;
|
|
320
|
+
credentials: Record<string, string>;
|
|
321
|
+
}
|
|
322
|
+
export interface DetectPipelineConnectionConfigInput {
|
|
323
|
+
connectorType: string;
|
|
324
|
+
credentials: Record<string, string>;
|
|
325
|
+
}
|
|
326
|
+
/** The connection a pipeline runs over, as a pipeline read embeds it. Never a credential. */
|
|
327
|
+
export interface PipelineConnectionSummary {
|
|
328
|
+
id: string;
|
|
329
|
+
connectorType: string;
|
|
330
|
+
name: string;
|
|
331
|
+
sourceUrl: string;
|
|
332
|
+
/** As of the connection's last probe. */
|
|
333
|
+
status: PipelineConnectionStatus;
|
|
334
|
+
/** `null`: no throttle. */
|
|
335
|
+
requestDelayMs: number | null;
|
|
336
|
+
/** Old hostnames whose image URLs an import rewrites to `sourceUrl`'s host. */
|
|
337
|
+
legacyAssetHosts: string[] | null;
|
|
338
|
+
lastTestedAt: string | null;
|
|
339
|
+
/**
|
|
340
|
+
* Set when the connection was deleted while this pipeline still ran over it (possible only
|
|
341
|
+
* before deleting a used connection was refused): the pipeline keeps running over it.
|
|
342
|
+
*/
|
|
343
|
+
removedAt: string | null;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* An export pipeline's settings: what it exports, and how a scheduled or "Run now" read is
|
|
347
|
+
* narrowed.
|
|
348
|
+
*/
|
|
349
|
+
export interface ExportPipelineConfig {
|
|
350
|
+
/** `orders`: the entity types this deployment can export (`connectors()`'s `supportedExportEntityTypes`). */
|
|
351
|
+
entityTypes: string[];
|
|
352
|
+
/**
|
|
353
|
+
* Keyed by the reader's own field names (`toState`), kept verbatim. The keys and values a
|
|
354
|
+
* filter may name are one shared list (the orders reader's: `toState` and the order states); a
|
|
355
|
+
* save naming anything else is refused (`PIPELINE_EXPORT_FILTER_*`).
|
|
356
|
+
*/
|
|
357
|
+
triggerFilter?: Record<string, string>;
|
|
358
|
+
}
|
|
359
|
+
/** An import pipeline's settings. */
|
|
360
|
+
export interface ImportPipelineConfig {
|
|
361
|
+
/** Where a stock import writes its levels: one of the store's stock locations. */
|
|
362
|
+
stockLocationId?: string;
|
|
363
|
+
/** Import the source's Yoast SEO fields (WooCommerce); `true` unless set. */
|
|
364
|
+
importYoastSeo?: boolean;
|
|
365
|
+
/** The language the source writes its names in; the store's default unless set. */
|
|
366
|
+
sourceLanguageCode?: string;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* A data pipeline of the store: an import from, or an export to, another system over one of its
|
|
370
|
+
* connections, run by hand or on a schedule.
|
|
371
|
+
*/
|
|
372
|
+
export interface Pipeline {
|
|
373
|
+
id: string;
|
|
374
|
+
name: string;
|
|
375
|
+
direction: PipelineDirection;
|
|
376
|
+
connectionId: string;
|
|
377
|
+
/** The discovery whose schema maps an import reads; `null` for an export. */
|
|
378
|
+
discoveryId: string | null;
|
|
379
|
+
/** Whether an import overwrites the store's own edits (`always_source`) or keeps them. */
|
|
380
|
+
syncPolicy: PipelineSyncPolicy;
|
|
381
|
+
/**
|
|
382
|
+
* `one_time`: runs only when started (by hand, or by a commerce plugin for an export). `daily`:
|
|
383
|
+
* every day at 03:00 in `timezone`; `weekly`: Mondays at 03:00 in `timezone`; `custom`: on
|
|
384
|
+
* `cronExpression` in `timezone`. A wall-clock time in that zone, so it follows its daylight
|
|
385
|
+
* saving changes.
|
|
386
|
+
*/
|
|
387
|
+
scheduleType: PipelineScheduleType;
|
|
388
|
+
/** A 5-part cron for a `custom` schedule; `null` otherwise. */
|
|
389
|
+
cronExpression: string | null;
|
|
390
|
+
/** The IANA zone the schedule is read in. A pipeline made before zones were asked for holds `UTC`. */
|
|
391
|
+
timezone: string;
|
|
392
|
+
/**
|
|
393
|
+
* `false`: paused. A paused pipeline's schedule is unregistered and a commerce plugin's export
|
|
394
|
+
* through it is refused; starting a run by hand still works.
|
|
395
|
+
*/
|
|
396
|
+
isActive: boolean;
|
|
397
|
+
/** Whether the source's prices include tax (an import). */
|
|
398
|
+
sourcePricesIncludeTax: boolean;
|
|
399
|
+
/** As stored, kept verbatim. */
|
|
400
|
+
config: ExportPipelineConfig | ImportPipelineConfig | null;
|
|
401
|
+
createdAt: string;
|
|
402
|
+
updatedAt: string;
|
|
403
|
+
connection: PipelineConnectionSummary;
|
|
404
|
+
}
|
|
405
|
+
export interface ListPipelinesOptions extends ListOptions {
|
|
406
|
+
/** Only imports, or only exports. */
|
|
407
|
+
direction?: PipelineDirection;
|
|
408
|
+
}
|
|
409
|
+
/** Every field optional: one left out stays as stored. */
|
|
410
|
+
export interface UpdatePipelineInput {
|
|
411
|
+
name?: string;
|
|
412
|
+
syncPolicy?: PipelineSyncPolicy;
|
|
413
|
+
scheduleType?: PipelineScheduleType;
|
|
414
|
+
/** A 5-part cron (`*\/30 * * * *`), required when `scheduleType` is `custom`. */
|
|
415
|
+
cronExpression?: string;
|
|
416
|
+
/** An IANA zone (`Europe/Amsterdam`). */
|
|
417
|
+
timezone?: string;
|
|
418
|
+
/** `false` pauses the pipeline, `true` resumes it. */
|
|
419
|
+
isActive?: boolean;
|
|
420
|
+
sourcePricesIncludeTax?: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* An export's filter. MERGED over the stored settings at the top level, so the entity types
|
|
423
|
+
* stay; `triggerFilter: {}` removes the filter (every order not yet sent is exported).
|
|
424
|
+
*/
|
|
425
|
+
config?: {
|
|
426
|
+
triggerFilter: Record<string, string>;
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* `pending`: queued, not started yet; `running`; `paused` (by an operator, resumable); and the
|
|
431
|
+
* ends: `completed`, `failed`, `cancelled`.
|
|
432
|
+
*/
|
|
433
|
+
export type PipelineRunStatus = 'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled';
|
|
434
|
+
/** `manual`: started by hand (`runs.start`, a set-up's commit); `scheduled`; `event`: a commerce plugin's single-order export. */
|
|
435
|
+
export type PipelineRunTrigger = 'manual' | 'scheduled' | 'event';
|
|
436
|
+
/**
|
|
437
|
+
* How an import run folds its product→collection assignments into each collection: `merge`
|
|
438
|
+
* (previous ∪ this run, the default and every scheduled run's), `replace_dry_run` (a `merge` run
|
|
439
|
+
* that also logs what `replace` would change, `entityType: 'collection_assignments'`), `replace`
|
|
440
|
+
* (each collection the pipeline maps gets exactly what this run assigned; SuperAdmin only).
|
|
441
|
+
*/
|
|
442
|
+
export type PipelineCollectionAssignmentMode = 'merge' | 'replace_dry_run' | 'replace';
|
|
443
|
+
/** One entity type's counts in a run. */
|
|
444
|
+
export interface PipelineRunEntityProgress {
|
|
445
|
+
/** How many the source holds (an estimate until the run has read them all). */
|
|
446
|
+
total: number;
|
|
447
|
+
created: number;
|
|
448
|
+
updated: number;
|
|
449
|
+
skipped: number;
|
|
450
|
+
errored: number;
|
|
451
|
+
/** Sent to the target system (an export). */
|
|
452
|
+
exported: number;
|
|
453
|
+
}
|
|
454
|
+
/** One run of a pipeline: an import from, or an export to, the other system. */
|
|
455
|
+
export interface PipelineRun {
|
|
456
|
+
id: string;
|
|
457
|
+
pipelineId: string;
|
|
458
|
+
trigger: PipelineRunTrigger;
|
|
459
|
+
status: PipelineRunStatus;
|
|
460
|
+
/** Keyed by the entity type as the pipeline names it (`product_variants`, `orders`), verbatim. */
|
|
461
|
+
progress: Record<string, PipelineRunEntityProgress>;
|
|
462
|
+
/**
|
|
463
|
+
* Why it failed, in the operator's words. Also set on a run its pipeline's deletion cancelled,
|
|
464
|
+
* saying so ("The pipeline was deleted, so this run stopped after the batch it was working on.
|
|
465
|
+
* Nothing more was sent."); `null` on a run cancelled by hand.
|
|
466
|
+
*/
|
|
467
|
+
errorMessage: string | null;
|
|
468
|
+
/** The sync policy this run imports with: the pipeline's, or the one `start` named. */
|
|
469
|
+
syncPolicy: PipelineSyncPolicy;
|
|
470
|
+
collectionAssignmentMode: PipelineCollectionAssignmentMode;
|
|
471
|
+
/** When it first started (kept across a pause and a resume); `null` while queued. */
|
|
472
|
+
startedAt: string | null;
|
|
473
|
+
completedAt: string | null;
|
|
474
|
+
createdAt: string;
|
|
475
|
+
updatedAt: string;
|
|
476
|
+
}
|
|
477
|
+
export interface StartPipelineRunInput {
|
|
478
|
+
/** This run only: whether an import overwrites the store's own edits. The pipeline's otherwise. */
|
|
479
|
+
syncPolicy?: PipelineSyncPolicy;
|
|
480
|
+
/** An import only; `merge` unless set. `replace` needs SuperAdmin. Such a run cannot be resumed. */
|
|
481
|
+
collectionAssignments?: PipelineCollectionAssignmentMode;
|
|
482
|
+
}
|
|
483
|
+
/** What a run did with one record. */
|
|
484
|
+
export type PipelineRunLogResult = 'created' | 'updated' | 'skipped' | 'errored' | 'exported';
|
|
485
|
+
/** One record a run handled, and what became of it. */
|
|
486
|
+
export interface PipelineRunLog {
|
|
487
|
+
id: string;
|
|
488
|
+
runId: string;
|
|
489
|
+
entityType: string;
|
|
490
|
+
/** The record's id in the system it came from. */
|
|
491
|
+
sourceId: string | null;
|
|
492
|
+
/** Its id (an import) or remote path (an export) in the system it went to. */
|
|
493
|
+
targetId: string | null;
|
|
494
|
+
result: PipelineRunLogResult;
|
|
495
|
+
/** Why it was skipped or errored, in the operator's words. */
|
|
496
|
+
message: string | null;
|
|
497
|
+
createdAt: string;
|
|
498
|
+
}
|
|
499
|
+
export interface ListPipelineRunLogsOptions extends ListOptions {
|
|
500
|
+
/** One entity type's records (`orders`, `products`). */
|
|
501
|
+
entityType?: string;
|
|
502
|
+
/** Only the records with this outcome: the errors, or the skipped ones. */
|
|
503
|
+
result?: PipelineRunLogResult;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* How to follow a run or a discovery as it happens (`runs.watch`, `discoveries.watch`).
|
|
507
|
+
*
|
|
508
|
+
* - `signal` closes the connection; the iteration then throws `REQUEST_ABORTED`.
|
|
509
|
+
* - `idleTimeoutMs` (default 45 s, three of the server's keepalives): silence this long counts as
|
|
510
|
+
* a dropped connection.
|
|
511
|
+
* - `connectTimeoutMs`: the deadline for the response headers (the client's own by default).
|
|
512
|
+
* - `maxReconnects` (default 5; 0 never): how many times in a row a connection that closed, broke,
|
|
513
|
+
* stalled or could not open (a network error, 5xx, 429) is reopened before the iteration throws.
|
|
514
|
+
* An event received resets the count. A refusal (401, 403, 404) is never retried.
|
|
515
|
+
* - `reconnectDelayMs` (default 1000): the first reopen's delay, doubling up to 30 s.
|
|
516
|
+
* - `onReconnect`: told before each reopen (attempt, delay, and the error that ended it).
|
|
517
|
+
*/
|
|
518
|
+
export type PipelineWatchOptions = ProgressStreamOptions;
|
|
519
|
+
/** A discovery of a connection's source. */
|
|
520
|
+
export interface PipelineDiscovery {
|
|
521
|
+
id: string;
|
|
522
|
+
connectionId: string;
|
|
523
|
+
/** `pending` → `running` → `completed` | `failed`. */
|
|
524
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
525
|
+
/** `ai`: the AI proposed the maps; `connector_default`: a fixed-schema connector brought them. */
|
|
526
|
+
source: 'ai' | 'connector_default';
|
|
527
|
+
/** Why it failed, in the operator's words. */
|
|
528
|
+
errorMessage: string | null;
|
|
529
|
+
/** What the merchant should know about the source; empty until it completes. */
|
|
530
|
+
warnings: string[];
|
|
531
|
+
/** The source's plugins it recognised; empty until it completes. */
|
|
532
|
+
detectedPlugins: string[];
|
|
533
|
+
startedAt: string | null;
|
|
534
|
+
completedAt: string | null;
|
|
535
|
+
createdAt: string;
|
|
536
|
+
}
|
|
537
|
+
/** A discovery's proposal for one kind of record, as stored. */
|
|
538
|
+
export interface PipelineSchemaMap extends PipelineDraftSchemaMap {
|
|
539
|
+
discoveryId: string;
|
|
540
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The shapes of `admin.integrations.pipelines` (headless spec §7 `pipelines.drafts
|
|
2
|
+
* The shapes of `admin.integrations.pipelines` (headless spec §7 `pipelines.drafts`, §9.2
|
|
3
|
+
* `integrations`).
|
|
3
4
|
*
|
|
4
5
|
* Kept verbatim (stored data, never renamed): `triggerFilter`'s keys (reader field names such as
|
|
5
|
-
* `toState`), `siteAnalysis` and `publicCredentials` (the connector's own
|
|
6
|
-
* map's `sourceSchema`, `targetSchema` and `subCounts`.
|
|
6
|
+
* `toState`), a pipeline's `config`, `siteAnalysis` and `publicCredentials` (the connector's own
|
|
7
|
+
* keys), and a schema map's `sourceSchema`, `targetSchema` and `subCounts`.
|
|
7
8
|
*/
|
|
8
9
|
export {};
|
|
@@ -94,6 +94,46 @@ export interface UpsertLocationProfileInput {
|
|
|
94
94
|
openingHours?: OpeningHours | null;
|
|
95
95
|
address?: StockLocationAddressInput | null;
|
|
96
96
|
}
|
|
97
|
+
/** Hold days a ready store pickup may be set to: 1 to 60, 7 when a location never set them (D15). */
|
|
98
|
+
export declare const STORE_PICKUP_HOLD_DAYS: {
|
|
99
|
+
readonly min: 1;
|
|
100
|
+
readonly max: 60;
|
|
101
|
+
readonly default: 7;
|
|
102
|
+
};
|
|
103
|
+
/** The longest store pickup instructions a location may carry, in characters (D15). */
|
|
104
|
+
export declare const STORE_PICKUP_INSTRUCTIONS_MAX_LENGTH = 500;
|
|
105
|
+
/**
|
|
106
|
+
* A stock location's store pickup settings (C1/33). A location that never set them reads as not
|
|
107
|
+
* enabled, {@link STORE_PICKUP_HOLD_DAYS} `default` hold days and no instructions.
|
|
108
|
+
*/
|
|
109
|
+
export interface StockLocationPickup {
|
|
110
|
+
stockLocationId: string;
|
|
111
|
+
/** Shoppers may choose this location at checkout, and its till hands the order over. */
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
/** Days a ready pickup is held before its stock goes back on sale (1 to 60). */
|
|
114
|
+
holdDays: number;
|
|
115
|
+
/** Shown to shoppers at checkout and in the ready email; null when none. */
|
|
116
|
+
instructions: string | null;
|
|
117
|
+
/**
|
|
118
|
+
* What ENABLING needs, answered now: the location's address (its location profile) and an
|
|
119
|
+
* active POS register at the location, because the hand-over happens at a till. Turning on a
|
|
120
|
+
* location that lacks one is refused; a location already on keeps working.
|
|
121
|
+
*/
|
|
122
|
+
hasAddress: boolean;
|
|
123
|
+
hasTill: boolean;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The WHOLE settings, not a patch: an omitted `instructions` clears them. Instructions are
|
|
127
|
+
* trimmed, and blank is none.
|
|
128
|
+
*/
|
|
129
|
+
export interface SetStockLocationPickupInput {
|
|
130
|
+
stockLocationId: string;
|
|
131
|
+
enabled: boolean;
|
|
132
|
+
/** A whole number from 1 to 60. */
|
|
133
|
+
holdDays: number;
|
|
134
|
+
/** At most 500 characters, no control characters (a line break is fine). */
|
|
135
|
+
instructions?: string | null;
|
|
136
|
+
}
|
|
97
137
|
/**
|
|
98
138
|
* Location profiles for the active channel (spec §8.7).
|
|
99
139
|
*
|
|
@@ -134,9 +174,35 @@ export interface LocationsModule {
|
|
|
134
174
|
upsert(input: UpsertLocationProfileInput, options?: Call): Promise<LocationProfile>;
|
|
135
175
|
/** True when a profile was removed, false when there was none. The stock location survives. */
|
|
136
176
|
delete(stockLocationId: string, options?: Call): Promise<boolean>;
|
|
177
|
+
/**
|
|
178
|
+
* The location's store pickup settings, with what enabling needs (`hasAddress`, `hasTill`).
|
|
179
|
+
* Needs `ReadStockLocation`. Refused `LOCATION_NOT_FOUND` (`NotFoundError`) for a location that
|
|
180
|
+
* is not this store's.
|
|
181
|
+
*
|
|
182
|
+
* @effect read
|
|
183
|
+
*/
|
|
184
|
+
pickup(stockLocationId: string, options?: Call): Promise<StockLocationPickup>;
|
|
185
|
+
/**
|
|
186
|
+
* Set the location's store pickup settings (C1/33). Needs `UpdateStockLocation`. The store's
|
|
187
|
+
* first enabled location creates its `store-pickup` shipping method, which then appears among
|
|
188
|
+
* the store's shipping methods (rename or disable it there). Sending the stored settings back
|
|
189
|
+
* writes nothing.
|
|
190
|
+
*
|
|
191
|
+
* Refused: `STORE_PICKUP_SETTINGS_INVALID` (`ValidationError`) for hold days outside 1-60 or
|
|
192
|
+
* instructions over 500 characters or with a control character; turning pickup ON at a
|
|
193
|
+
* location without an address, `STORE_PICKUP_ADDRESS_REQUIRED`, or without an active POS
|
|
194
|
+
* register, `STORE_PICKUP_TILL_REQUIRED` (both `BusinessRuleError`); `LOCATION_NOT_FOUND`
|
|
195
|
+
* (`NotFoundError`); and `LOCATION_NOT_ALLOWED` (`PermissionDeniedError`) for a credential
|
|
196
|
+
* restricted with `locationIds` that does not hold the location.
|
|
197
|
+
*
|
|
198
|
+
* @effect write
|
|
199
|
+
*/
|
|
200
|
+
setPickup(input: SetStockLocationPickupInput, options?: Call): Promise<StockLocationPickup>;
|
|
137
201
|
}
|
|
138
202
|
export declare const LOCATION_PROFILES_QUERY = "\n query LocationProfiles {\n locationProfiles { \n stockLocationId\n code\n name\n timezone\n phone\n openingHours\n address {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n stockLocation {\n id\n name\n description\n }\n }\n }\n";
|
|
139
203
|
export declare const LOCATION_PROFILE_QUERY = "\n query LocationProfile($stockLocationId: ID!) {\n locationProfile(stockLocationId: $stockLocationId) { \n stockLocationId\n code\n name\n timezone\n phone\n openingHours\n address {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n stockLocation {\n id\n name\n description\n }\n }\n }\n";
|
|
140
204
|
export declare const UPSERT_LOCATION_PROFILE_MUTATION = "\n mutation UpsertLocationProfile($input: UpsertLocationProfileInput!) {\n upsertLocationProfile(input: $input) { \n stockLocationId\n code\n name\n timezone\n phone\n openingHours\n address {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n stockLocation {\n id\n name\n description\n }\n }\n }\n";
|
|
141
205
|
export declare const DELETE_LOCATION_PROFILE_MUTATION = "\n mutation DeleteLocationProfile($stockLocationId: ID!) {\n deleteLocationProfile(stockLocationId: $stockLocationId)\n }\n";
|
|
206
|
+
export declare const STOCK_LOCATION_PICKUP_QUERY = "\n query StockLocationPickup($stockLocationId: ID!) {\n stockLocationPickup(stockLocationId: $stockLocationId) { \n stockLocationId\n enabled\n holdDays\n instructions\n hasAddress\n hasTill\n }\n }\n";
|
|
207
|
+
export declare const SET_STOCK_LOCATION_PICKUP_MUTATION = "\n mutation SetStockLocationPickup($input: SetStockLocationPickupInput!) {\n setStockLocationPickup(input: $input) { \n stockLocationId\n enabled\n holdDays\n instructions\n hasAddress\n hasTill\n }\n }\n";
|
|
142
208
|
export declare function createLocationsModule(transport: Transport): LocationsModule;
|
package/dist/locations/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { createPage } from '@sixtyninecommerce/core';
|
|
2
2
|
/** `openingHours` keys: lowercase, three letters, Monday first. */
|
|
3
3
|
export const OPENING_HOURS_DAYS = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
|
|
4
|
+
// ── Store pickup (POS C1/33) ──
|
|
5
|
+
/** Hold days a ready store pickup may be set to: 1 to 60, 7 when a location never set them (D15). */
|
|
6
|
+
export const STORE_PICKUP_HOLD_DAYS = { min: 1, max: 60, default: 7 };
|
|
7
|
+
/** The longest store pickup instructions a location may carry, in characters (D15). */
|
|
8
|
+
export const STORE_PICKUP_INSTRUCTIONS_MAX_LENGTH = 500;
|
|
4
9
|
const LOCATION_PROFILE_FIELDS = /* GraphQL */ `
|
|
5
10
|
stockLocationId
|
|
6
11
|
code
|
|
@@ -45,6 +50,24 @@ export const DELETE_LOCATION_PROFILE_MUTATION = /* GraphQL */ `
|
|
|
45
50
|
deleteLocationProfile(stockLocationId: $stockLocationId)
|
|
46
51
|
}
|
|
47
52
|
`;
|
|
53
|
+
const STOCK_LOCATION_PICKUP_FIELDS = /* GraphQL */ `
|
|
54
|
+
stockLocationId
|
|
55
|
+
enabled
|
|
56
|
+
holdDays
|
|
57
|
+
instructions
|
|
58
|
+
hasAddress
|
|
59
|
+
hasTill
|
|
60
|
+
`;
|
|
61
|
+
export const STOCK_LOCATION_PICKUP_QUERY = /* GraphQL */ `
|
|
62
|
+
query StockLocationPickup($stockLocationId: ID!) {
|
|
63
|
+
stockLocationPickup(stockLocationId: $stockLocationId) { ${STOCK_LOCATION_PICKUP_FIELDS} }
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
export const SET_STOCK_LOCATION_PICKUP_MUTATION = /* GraphQL */ `
|
|
67
|
+
mutation SetStockLocationPickup($input: SetStockLocationPickupInput!) {
|
|
68
|
+
setStockLocationPickup(input: $input) { ${STOCK_LOCATION_PICKUP_FIELDS} }
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
48
71
|
export function createLocationsModule(transport) {
|
|
49
72
|
return {
|
|
50
73
|
async list(options) {
|
|
@@ -68,5 +91,13 @@ export function createLocationsModule(transport) {
|
|
|
68
91
|
const data = await transport.graphql({ api: 'admin', query: DELETE_LOCATION_PROFILE_MUTATION, variables: { stockLocationId } }, options);
|
|
69
92
|
return data.deleteLocationProfile;
|
|
70
93
|
},
|
|
94
|
+
async pickup(stockLocationId, options) {
|
|
95
|
+
const data = await transport.graphql({ api: 'admin', query: STOCK_LOCATION_PICKUP_QUERY, variables: { stockLocationId } }, options);
|
|
96
|
+
return data.stockLocationPickup;
|
|
97
|
+
},
|
|
98
|
+
async setPickup(input, options) {
|
|
99
|
+
const data = await transport.graphql({ api: 'admin', query: SET_STOCK_LOCATION_PICKUP_MUTATION, variables: { input } }, options);
|
|
100
|
+
return data.setStockLocationPickup;
|
|
101
|
+
},
|
|
71
102
|
};
|
|
72
103
|
}
|