@sixtyninecommerce/admin 0.10.0 → 0.11.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 +4347 -171
- 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/index.d.ts +9 -2
- package/dist/catalog/index.js +4 -0
- package/dist/catalog/products.d.ts +159 -19
- package/dist/catalog/products.js +88 -13
- package/dist/catalog/properties.d.ts +102 -14
- package/dist/catalog/properties.js +13 -0
- package/dist/catalog/recommendations.d.ts +261 -0
- package/dist/catalog/recommendations.js +145 -0
- package/dist/catalog/reviews.d.ts +368 -0
- package/dist/catalog/reviews.js +318 -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 +233 -26
- package/dist/catalog/variants.js +125 -7
- package/dist/catalog/visibility.d.ts +20 -5
- package/dist/catalog/visibility.js +19 -1
- package/dist/client.d.ts +95 -9
- package/dist/client.js +35 -7
- package/dist/content/assets.d.ts +286 -0
- package/dist/content/assets.js +181 -0
- package/dist/content/items.d.ts +269 -0
- package/dist/content/items.js +170 -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/groups.d.ts +207 -0
- package/dist/customers/groups.js +438 -0
- package/dist/customers/index.d.ts +447 -37
- package/dist/customers/index.js +313 -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/index.d.ts +731 -21
- package/dist/documents/index.js +436 -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 +44 -10
- package/dist/fulfillments/index.js +11 -2
- 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 +123 -35
- package/dist/index.js +45 -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 +423 -0
- package/dist/integrations/exact-online-types.js +6 -0
- package/dist/integrations/exact-online.d.ts +248 -0
- package/dist/integrations/exact-online.js +376 -0
- package/dist/integrations/index.d.ts +29 -3
- package/dist/integrations/index.js +18 -3
- package/dist/integrations/pipeline-keys.d.ts +13 -0
- package/dist/integrations/pipeline-keys.js +22 -0
- package/dist/integrations/pipelines.d.ts +15 -14
- package/dist/integrations/pipelines.js +6 -22
- package/dist/integrations/types.d.ts +146 -0
- package/dist/locations/index.d.ts +66 -0
- package/dist/locations/index.js +31 -0
- package/dist/meta/index.d.ts +162 -0
- package/dist/orders/cancel-with-money.d.ts +227 -0
- package/dist/orders/cancel-with-money.js +153 -0
- package/dist/orders/commit-edit.d.ts +7 -1
- package/dist/orders/commit-edit.js +5 -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 +49 -9
- package/dist/orders/index.js +22 -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 +222 -0
- package/dist/orders/list.js +377 -0
- package/dist/orders/manual-pricing.d.ts +5 -0
- package/dist/orders/order-entry.d.ts +20 -7
- package/dist/orders/plan-edit.d.ts +1 -1
- package/dist/orders/plan-edit.js +4 -1
- 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 +8 -1
- package/dist/orders/surcharges.js +3 -2
- package/dist/payments/account-credit.d.ts +30 -0
- package/dist/payments/account-credit.js +19 -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 +12 -0
- package/dist/payments/credit-noted-fields.js +37 -0
- package/dist/payments/index.d.ts +257 -11
- package/dist/payments/index.js +131 -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 +144 -0
- package/dist/payments/requests.js +92 -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 +104 -0
- package/dist/pickups/index.js +105 -0
- package/dist/platform/channels.d.ts +132 -0
- package/dist/platform/channels.js +128 -0
- package/dist/platform/geo.d.ts +123 -0
- package/dist/platform/geo.js +144 -0
- package/dist/platform/tax.d.ts +154 -0
- package/dist/platform/tax.js +139 -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 +103 -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 +2125 -32
- package/dist/pos/index.js +742 -4
- package/dist/pos/no-receipt.d.ts +94 -0
- package/dist/pos/no-receipt.js +25 -0
- package/dist/pos/offline-sales.d.ts +187 -0
- package/dist/pos/offline-sales.js +116 -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 +217 -0
- package/dist/pos/returns.js +53 -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 +604 -0
- package/dist/pricing/price-lists.js +600 -0
- package/dist/purchasing/alerts.d.ts +89 -0
- package/dist/purchasing/alerts.js +62 -0
- package/dist/purchasing/cost.d.ts +110 -0
- package/dist/purchasing/cost.js +86 -0
- package/dist/purchasing/index.d.ts +36 -0
- package/dist/purchasing/index.js +16 -0
- package/dist/purchasing/purchase-orders.d.ts +548 -0
- package/dist/purchasing/purchase-orders.js +491 -0
- package/dist/purchasing/replenishment.d.ts +281 -0
- package/dist/purchasing/replenishment.js +240 -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 +501 -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 +614 -21
- package/dist/returns/index.js +695 -11
- package/dist/search/index.d.ts +76 -1
- package/dist/search/index.js +63 -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 +48 -0
- package/dist/shipping/index.js +25 -0
- package/dist/shipping/methods.d.ts +198 -0
- package/dist/shipping/methods.js +240 -0
- package/dist/shipping/myparcel.d.ts +254 -0
- package/dist/shipping/myparcel.js +178 -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 +179 -0
- package/dist/shipping/rate-tables.js +184 -0
- package/dist/stock/index.d.ts +10 -3
- package/dist/stock/index.js +3 -0
- package/dist/stock/locations.d.ts +144 -0
- package/dist/stock/locations.js +168 -0
- package/dist/stock/transfers.d.ts +216 -43
- package/dist/stock/transfers.js +140 -13
- package/dist/stored-value/index.d.ts +214 -4
- package/dist/stored-value/index.js +152 -0
- package/dist/subscriptions/index.d.ts +682 -0
- package/dist/subscriptions/index.js +815 -0
- package/dist/tax/index.d.ts +76 -1
- package/dist/tax/index.js +50 -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 +66 -0
- package/dist/tenant/email-templates.js +54 -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,14 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Integrations (headless spec §9.2): the store's connections to other systems.
|
|
3
|
-
* pipelines' import and export set-ups
|
|
2
|
+
* Integrations (headless spec §9.2): the store's connections to other systems. The data
|
|
3
|
+
* pipelines' source connections, connectors and import and export set-ups, the e-mail marketing
|
|
4
|
+
* connection (`esp`), the AFAS Profit connection with what is sent to it (`afas`) and the Exact
|
|
5
|
+
* Online connection with its settings (`exactOnline`); the pipelines themselves, their runs and
|
|
6
|
+
* their progress streams follow in phase 7.
|
|
4
7
|
*/
|
|
5
8
|
import type { Transport } from '@sixtyninecommerce/core';
|
|
9
|
+
import { type AfasModule } from './afas.js';
|
|
10
|
+
import { type EspModule } from './esp.js';
|
|
11
|
+
import { type ExactOnlineModule } from './exact-online.js';
|
|
6
12
|
import { type IntegrationPipelinesModule } from './pipelines.js';
|
|
13
|
+
export type { AfasConfigModule, AfasModule, AfasPaymentTermsModule, AfasWarehouseMappingsModule, } from './afas.js';
|
|
14
|
+
export { AFAS_SYNC_LOG_PAGE_LIMIT } from './afas.js';
|
|
15
|
+
export type { AfasCustomersModule, AfasOrdersModule, AfasStockTransfersModule, } from './afas-actions.js';
|
|
16
|
+
export { AFAS_CUSTOMER_SEARCH_LIMIT } from './afas-actions.js';
|
|
17
|
+
export type * from './afas-types.js';
|
|
18
|
+
export type { PipelineConnectionsModule } from './connections.js';
|
|
19
|
+
export { PIPELINE_CONNECTION_PRESERVE_KEYS } from './connections.js';
|
|
20
|
+
export type { ConnectEspWithTokenInput, EspBackfillResource, EspConnection, EspConnectionTestResult, EspConnectMetadata, EspCredentialsPushState, EspInboundWebhookState, EspModule, EspSyncLog, EspSyncLogFilter, UpdateEspConnectionInput, } from './esp.js';
|
|
21
|
+
export { ESP_BACKFILL_RESOURCES, ESP_SYNC_LOG_PAGE_LIMIT } from './esp.js';
|
|
22
|
+
export type { ExactOnlineConfigModule, ExactOnlineCredentialsModule, ExactOnlineModule, ExactOnlineSamplesModule, ExactOnlineStructureModule, ExactOnlineWebhooksModule, } from './exact-online.js';
|
|
23
|
+
export type * from './exact-online-types.js';
|
|
7
24
|
export type { IntegrationPipelinesModule, PipelineDraftsModule } from './pipelines.js';
|
|
8
25
|
export { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS } from './pipelines.js';
|
|
9
26
|
export type * from './types.js';
|
|
10
27
|
export interface IntegrationsModule {
|
|
11
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Data pipelines: the source connections (`connections`), the connectors, and the import and
|
|
30
|
+
* export set-ups kept on the server (`drafts`).
|
|
31
|
+
*/
|
|
12
32
|
pipelines: IntegrationPipelinesModule;
|
|
33
|
+
/** The store's e-mail marketing connection (sixtynine.email). See {@link EspModule}. */
|
|
34
|
+
esp: EspModule;
|
|
35
|
+
/** The store's AFAS Profit connection and its settings. See {@link AfasModule}. */
|
|
36
|
+
afas: AfasModule;
|
|
37
|
+
/** The store's Exact Online connection and its settings. See {@link ExactOnlineModule}. */
|
|
38
|
+
exactOnline: ExactOnlineModule;
|
|
13
39
|
}
|
|
14
40
|
export declare function createIntegrationsModule(transport: Transport): IntegrationsModule;
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Integrations (headless spec §9.2): the store's connections to other systems.
|
|
3
|
-
* pipelines' import and export set-ups
|
|
2
|
+
* Integrations (headless spec §9.2): the store's connections to other systems. The data
|
|
3
|
+
* pipelines' source connections, connectors and import and export set-ups, the e-mail marketing
|
|
4
|
+
* connection (`esp`), the AFAS Profit connection with what is sent to it (`afas`) and the Exact
|
|
5
|
+
* Online connection with its settings (`exactOnline`); the pipelines themselves, their runs and
|
|
6
|
+
* their progress streams follow in phase 7.
|
|
4
7
|
*/
|
|
8
|
+
import { createAfasModule } from './afas.js';
|
|
9
|
+
import { createEspModule } from './esp.js';
|
|
10
|
+
import { createExactOnlineModule } from './exact-online.js';
|
|
5
11
|
import { createIntegrationPipelinesModule } from './pipelines.js';
|
|
12
|
+
export { AFAS_SYNC_LOG_PAGE_LIMIT } from './afas.js';
|
|
13
|
+
export { AFAS_CUSTOMER_SEARCH_LIMIT } from './afas-actions.js';
|
|
14
|
+
export { PIPELINE_CONNECTION_PRESERVE_KEYS } from './connections.js';
|
|
15
|
+
export { ESP_BACKFILL_RESOURCES, ESP_SYNC_LOG_PAGE_LIMIT } from './esp.js';
|
|
6
16
|
export { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS } from './pipelines.js';
|
|
7
17
|
export function createIntegrationsModule(transport) {
|
|
8
|
-
return {
|
|
18
|
+
return {
|
|
19
|
+
pipelines: createIntegrationPipelinesModule(transport),
|
|
20
|
+
esp: createEspModule(transport),
|
|
21
|
+
afas: createAfasModule(transport),
|
|
22
|
+
exactOnline: createExactOnlineModule(transport),
|
|
23
|
+
};
|
|
9
24
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every key whose VALUE is stored data, not DTO shape: the platform's passthrough set
|
|
3
|
+
* (`credentials`, `public_credentials`, `site_analysis`, `trigger_filter`, …) plus a schema map's
|
|
4
|
+
* jsonb columns, which carry the source's own field names and sample records. Converting them
|
|
5
|
+
* would rename a sample's `date_created` to `dateCreated`, and a `triggerFilter`'s `toState` would
|
|
6
|
+
* reach the reader as `to_state`, which it ignores.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PIPELINE_DRAFT_PRESERVE_KEYS: ReadonlySet<string>;
|
|
9
|
+
/**
|
|
10
|
+
* A creation probes the source over the network, and a commit creates the pipeline and may start
|
|
11
|
+
* its run: both outlast the SDK's 15-second default on a slow source.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PIPELINE_DRAFT_SLOW_TIMEOUT_MS = 60000;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PLATFORM_PASSTHROUGH_KEYS } from '@sixtyninecommerce/core';
|
|
2
|
+
/**
|
|
3
|
+
* Every key whose VALUE is stored data, not DTO shape: the platform's passthrough set
|
|
4
|
+
* (`credentials`, `public_credentials`, `site_analysis`, `trigger_filter`, …) plus a schema map's
|
|
5
|
+
* jsonb columns, which carry the source's own field names and sample records. Converting them
|
|
6
|
+
* would rename a sample's `date_created` to `dateCreated`, and a `triggerFilter`'s `toState` would
|
|
7
|
+
* reach the reader as `to_state`, which it ignores.
|
|
8
|
+
*/
|
|
9
|
+
export const PIPELINE_DRAFT_PRESERVE_KEYS = new Set([
|
|
10
|
+
...PLATFORM_PASSTHROUGH_KEYS,
|
|
11
|
+
'source_schema',
|
|
12
|
+
'sourceSchema',
|
|
13
|
+
'target_schema',
|
|
14
|
+
'targetSchema',
|
|
15
|
+
'sub_counts',
|
|
16
|
+
'subCounts',
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* A creation probes the source over the network, and a commit creates the pipeline and may start
|
|
20
|
+
* its run: both outlast the SDK's 15-second default on a slow source.
|
|
21
|
+
*/
|
|
22
|
+
export const PIPELINE_DRAFT_SLOW_TIMEOUT_MS = 60_000;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import { type Page, type Transport } from '@sixtyninecommerce/core';
|
|
2
2
|
import type { Call, ListOptions } from '../types.js';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* (`credentials`, `public_credentials`, `site_analysis`, `trigger_filter`, …) plus a schema map's
|
|
7
|
-
* jsonb columns, which carry the source's own field names and sample records. Converting them
|
|
8
|
-
* would rename a sample's `date_created` to `dateCreated`, and a `triggerFilter`'s `toState` would
|
|
9
|
-
* reach the reader as `to_state`, which it ignores.
|
|
10
|
-
*/
|
|
11
|
-
export declare const PIPELINE_DRAFT_PRESERVE_KEYS: ReadonlySet<string>;
|
|
12
|
-
/**
|
|
13
|
-
* A creation probes the source over the network, and a commit creates the pipeline and may start
|
|
14
|
-
* its run: both outlast the SDK's 15-second default on a slow source.
|
|
15
|
-
*/
|
|
16
|
-
export declare const PIPELINE_DRAFT_SLOW_TIMEOUT_MS = 60000;
|
|
3
|
+
import { type PipelineConnectionsModule } from './connections.js';
|
|
4
|
+
import type { CommittedPipelineDraft, ImportDependency, PipelineConnector, PipelineDirection, PipelineDraft, PipelineDraftSummary, UpdatePipelineDraftInput, UpdatePipelineDraftSchemaMapInput } from './types.js';
|
|
5
|
+
export { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS } from './pipeline-keys.js';
|
|
17
6
|
/**
|
|
18
7
|
* Half-finished import and export set-ups, kept on the server for the store (headless spec §7).
|
|
19
8
|
*
|
|
@@ -104,9 +93,21 @@ export interface PipelineDraftsModule {
|
|
|
104
93
|
/** Data pipelines (imports and exports between the store and another system). */
|
|
105
94
|
export interface IntegrationPipelinesModule {
|
|
106
95
|
drafts: PipelineDraftsModule;
|
|
96
|
+
/** The store's source connections. See {@link PipelineConnectionsModule}. */
|
|
97
|
+
connections: PipelineConnectionsModule;
|
|
98
|
+
/**
|
|
99
|
+
* The connectors this deployment offers, `coming_soon` ones included: each one's credential
|
|
100
|
+
* form (`credentialFields`), what its stored secrets are bound to (`credentialBinding`) and
|
|
101
|
+
* what it can import and export. Needs `ReadCatalog`.
|
|
102
|
+
*
|
|
103
|
+
* @effect read
|
|
104
|
+
*/
|
|
105
|
+
connectors(options?: Call): Promise<PipelineConnector[]>;
|
|
107
106
|
/**
|
|
108
107
|
* What each importable entity type needs imported first, from the import writers themselves
|
|
109
108
|
* (the warnings' data; the words are yours).
|
|
109
|
+
*
|
|
110
|
+
* @effect read
|
|
110
111
|
*/
|
|
111
112
|
importDependencies(options?: Call): Promise<ImportDependency[]>;
|
|
112
113
|
}
|
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
import { createPage,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* jsonb columns, which carry the source's own field names and sample records. Converting them
|
|
6
|
-
* would rename a sample's `date_created` to `dateCreated`, and a `triggerFilter`'s `toState` would
|
|
7
|
-
* reach the reader as `to_state`, which it ignores.
|
|
8
|
-
*/
|
|
9
|
-
export const PIPELINE_DRAFT_PRESERVE_KEYS = new Set([
|
|
10
|
-
...PLATFORM_PASSTHROUGH_KEYS,
|
|
11
|
-
'source_schema',
|
|
12
|
-
'sourceSchema',
|
|
13
|
-
'target_schema',
|
|
14
|
-
'targetSchema',
|
|
15
|
-
'sub_counts',
|
|
16
|
-
'subCounts',
|
|
17
|
-
]);
|
|
18
|
-
/**
|
|
19
|
-
* A creation probes the source over the network, and a commit creates the pipeline and may start
|
|
20
|
-
* its run: both outlast the SDK's 15-second default on a slow source.
|
|
21
|
-
*/
|
|
22
|
-
export const PIPELINE_DRAFT_SLOW_TIMEOUT_MS = 60_000;
|
|
1
|
+
import { createPage, readRestPage } from '@sixtyninecommerce/core';
|
|
2
|
+
import { createPipelineConnectionsModule, listPipelineConnectors, } from './connections.js';
|
|
3
|
+
import { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS } from './pipeline-keys.js';
|
|
4
|
+
export { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS } from './pipeline-keys.js';
|
|
23
5
|
const DRAFTS = '/pipelines/drafts';
|
|
24
6
|
const segment = (value) => encodeURIComponent(value);
|
|
25
7
|
export function createIntegrationPipelinesModule(transport) {
|
|
@@ -54,6 +36,8 @@ export function createIntegrationPipelinesModule(transport) {
|
|
|
54
36
|
};
|
|
55
37
|
return {
|
|
56
38
|
drafts,
|
|
39
|
+
connections: createPipelineConnectionsModule(transport),
|
|
40
|
+
connectors: (options) => listPipelineConnectors(transport, options),
|
|
57
41
|
async importDependencies(options) {
|
|
58
42
|
const body = await read('/pipelines/import-dependencies', options);
|
|
59
43
|
return body.data;
|
|
@@ -174,3 +174,149 @@ export interface CommittedPipelineDraft {
|
|
|
174
174
|
message: string;
|
|
175
175
|
} | null;
|
|
176
176
|
}
|
|
177
|
+
/** A field of a connector's credentials form, as the connector declares it. */
|
|
178
|
+
export interface PipelineConnectorCredentialField {
|
|
179
|
+
/** The key to send in `credentials`, in the connector's own spelling (`consumerKey`, `sftpHost`). */
|
|
180
|
+
key: string;
|
|
181
|
+
label: string;
|
|
182
|
+
/**
|
|
183
|
+
* `password` marks a secret: it is never read back (`publicCredentials` leaves it out), and on
|
|
184
|
+
* `connections.update` a blank one keeps the stored secret.
|
|
185
|
+
*/
|
|
186
|
+
type: 'text' | 'password' | 'url';
|
|
187
|
+
placeholder: string;
|
|
188
|
+
required: boolean;
|
|
189
|
+
helpText?: string;
|
|
190
|
+
/** A heading the form groups the field under (`sftp`, `paths`, `edi`, `warehouse`, `sender`). */
|
|
191
|
+
group?: string;
|
|
192
|
+
}
|
|
193
|
+
/** One credential field that names where the connector sends its secrets. */
|
|
194
|
+
export interface PipelineCredentialBindingField {
|
|
195
|
+
key: string;
|
|
196
|
+
role: 'host' | 'port' | 'user';
|
|
197
|
+
/** The port a blank `port` field means. */
|
|
198
|
+
defaultPort?: number;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* What a connection's stored secrets are bound to: its source URL (scheme, host, port and path),
|
|
202
|
+
* or the named credential fields (an SFTP login). A `connections.update` that moves it must carry
|
|
203
|
+
* every required secret afresh, or it is refused `PIPELINE_HOST_CHANGE_REQUIRES_CREDENTIALS`.
|
|
204
|
+
*/
|
|
205
|
+
export type PipelineCredentialBinding = {
|
|
206
|
+
kind: 'source-url';
|
|
207
|
+
} | {
|
|
208
|
+
kind: 'credential-fields';
|
|
209
|
+
fields: PipelineCredentialBindingField[];
|
|
210
|
+
};
|
|
211
|
+
/** A connector this deployment offers (`integrations.pipelines.connectors()`). */
|
|
212
|
+
export interface PipelineConnector {
|
|
213
|
+
/** `woocommerce`, `blujay_wms`, … : a connection's `connectorType`. */
|
|
214
|
+
type: string;
|
|
215
|
+
name: string;
|
|
216
|
+
description: string;
|
|
217
|
+
logoUrl: string;
|
|
218
|
+
/** A `coming_soon` connector is listed but cannot be connected yet. */
|
|
219
|
+
status: 'active' | 'coming_soon';
|
|
220
|
+
credentialFields: PipelineConnectorCredentialField[];
|
|
221
|
+
/** Absent from a plugins service deployed before it existed; the server still refuses a move. */
|
|
222
|
+
credentialBinding?: PipelineCredentialBinding;
|
|
223
|
+
/** What an import over it can read; empty when it imports nothing. */
|
|
224
|
+
supportedEntityTypes: string[];
|
|
225
|
+
/** What an export over it can write; absent when it exports nothing. */
|
|
226
|
+
supportedExportEntityTypes?: string[];
|
|
227
|
+
/** It brings its own schema maps, so an import needs no discovery. */
|
|
228
|
+
fixedSchema?: boolean;
|
|
229
|
+
}
|
|
230
|
+
/** A credential the source checks apart from the main login (WooCommerce's companion plugin). */
|
|
231
|
+
export interface PipelineAuthCheck {
|
|
232
|
+
id: string;
|
|
233
|
+
label: string;
|
|
234
|
+
ok: boolean;
|
|
235
|
+
/** Why it failed; absent when `ok`. */
|
|
236
|
+
message?: string;
|
|
237
|
+
}
|
|
238
|
+
/** What a probe of the source reported (`test`, `retest`, and a connection's `siteAnalysis`). */
|
|
239
|
+
export interface PipelineSiteAnalysis {
|
|
240
|
+
platform: string;
|
|
241
|
+
version: string;
|
|
242
|
+
/**
|
|
243
|
+
* Records per entity type, keyed by the source's own names (a WordPress post type such as
|
|
244
|
+
* `product_brand` too): kept verbatim, never camelCased.
|
|
245
|
+
*/
|
|
246
|
+
entityCounts: Record<string, number>;
|
|
247
|
+
languages: string[];
|
|
248
|
+
plugins: string[];
|
|
249
|
+
currency: string;
|
|
250
|
+
capabilities: string[];
|
|
251
|
+
authChecks?: PipelineAuthCheck[];
|
|
252
|
+
/** Whether the source's prices include tax; absent when the connector could not tell. */
|
|
253
|
+
sourcePricesIncludeTax?: boolean;
|
|
254
|
+
}
|
|
255
|
+
/** A pipeline that runs over a connection. Only the store's own are listed. */
|
|
256
|
+
export interface PipelineConnectionUsage {
|
|
257
|
+
id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
direction: PipelineDirection;
|
|
260
|
+
isActive: boolean;
|
|
261
|
+
}
|
|
262
|
+
export type PipelineConnectionStatus = 'pending' | 'connected' | 'error';
|
|
263
|
+
/** The throttles a connection may wait between two requests to its source, in milliseconds. */
|
|
264
|
+
export type PipelineRequestDelayMs = 50 | 100 | 200 | 300 | 500;
|
|
265
|
+
/**
|
|
266
|
+
* A source connection of the store. Never a secret: `publicCredentials` holds the fields its
|
|
267
|
+
* connector does not mark `password`, and is absent when they cannot be read.
|
|
268
|
+
*/
|
|
269
|
+
export interface PipelineConnection {
|
|
270
|
+
id: string;
|
|
271
|
+
connectorType: string;
|
|
272
|
+
name: string;
|
|
273
|
+
sourceUrl: string;
|
|
274
|
+
/** As of the last probe: a failed re-test sets `error`. */
|
|
275
|
+
status: PipelineConnectionStatus;
|
|
276
|
+
/** `null`: no throttle. */
|
|
277
|
+
requestDelayMs: number | null;
|
|
278
|
+
/** Old hostnames whose image URLs an import rewrites to `sourceUrl`'s host. */
|
|
279
|
+
legacyAssetHosts: string[] | null;
|
|
280
|
+
/** What the last successful probe reported; stored data, kept verbatim. */
|
|
281
|
+
siteAnalysis: PipelineSiteAnalysis | null;
|
|
282
|
+
lastTestedAt: string | null;
|
|
283
|
+
createdAt: string;
|
|
284
|
+
updatedAt: string;
|
|
285
|
+
publicCredentials?: Record<string, string>;
|
|
286
|
+
/** The pipelines that run over it; one in the list blocks `connections.delete`. */
|
|
287
|
+
pipelineUsage: PipelineConnectionUsage[];
|
|
288
|
+
}
|
|
289
|
+
export interface CreatePipelineConnectionInput {
|
|
290
|
+
/** A connector's `type` (`connectors()`). */
|
|
291
|
+
connectorType: string;
|
|
292
|
+
name: string;
|
|
293
|
+
/** The source's address: `https://…` for a shop, `sftp://host:port` for an SFTP connector. */
|
|
294
|
+
sourceUrl: string;
|
|
295
|
+
/** The connector's `credentialFields`, by `key`. Stored encrypted; never read back. */
|
|
296
|
+
credentials: Record<string, string>;
|
|
297
|
+
requestDelayMs?: PipelineRequestDelayMs;
|
|
298
|
+
legacyAssetHosts?: string[];
|
|
299
|
+
}
|
|
300
|
+
/** Every field optional: one left out stays as stored. */
|
|
301
|
+
export interface UpdatePipelineConnectionInput {
|
|
302
|
+
name?: string;
|
|
303
|
+
sourceUrl?: string;
|
|
304
|
+
/**
|
|
305
|
+
* MERGED over the stored set: a `password` field sent blank (or left out) keeps the stored
|
|
306
|
+
* secret while the connection keeps its recipient (`PipelineCredentialBinding`); a non-secret
|
|
307
|
+
* field sent blank is cleared.
|
|
308
|
+
*/
|
|
309
|
+
credentials?: Record<string, string>;
|
|
310
|
+
/** `null` removes the throttle. */
|
|
311
|
+
requestDelayMs?: PipelineRequestDelayMs | null;
|
|
312
|
+
legacyAssetHosts?: string[];
|
|
313
|
+
}
|
|
314
|
+
export interface TestPipelineConnectionInput {
|
|
315
|
+
connectorType: string;
|
|
316
|
+
sourceUrl: string;
|
|
317
|
+
credentials: Record<string, string>;
|
|
318
|
+
}
|
|
319
|
+
export interface DetectPipelineConnectionConfigInput {
|
|
320
|
+
connectorType: string;
|
|
321
|
+
credentials: Record<string, string>;
|
|
322
|
+
}
|
|
@@ -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
|
}
|