@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
|
@@ -0,0 +1,1089 @@
|
|
|
1
|
+
import { createPage, PLATFORM_PASSTHROUGH_KEYS, readRestPage, ValidationError, } from '@sixtyninecommerce/core';
|
|
2
|
+
import { fieldOf } from '../catalog/types.js';
|
|
3
|
+
import { isUnknownFieldRejection } from '../payments/store-credit-fields.js';
|
|
4
|
+
/** The most sync-log rows one {@link ExactOnlineSyncModule.logs} read answers. */
|
|
5
|
+
export const EXACT_ONLINE_SYNC_LOG_LIMIT = 100;
|
|
6
|
+
const SYNC_WINDOW_FIELDS = /* GraphQL */ `enabled intervalMinutes`;
|
|
7
|
+
const CONFIG_FIELDS = /* GraphQL */ `
|
|
8
|
+
id
|
|
9
|
+
enabled
|
|
10
|
+
connected
|
|
11
|
+
region
|
|
12
|
+
division
|
|
13
|
+
companyName
|
|
14
|
+
clientId
|
|
15
|
+
hasCustomCredentials
|
|
16
|
+
hasWebhookSecret
|
|
17
|
+
lastConnectedAt
|
|
18
|
+
lastRefreshedAt
|
|
19
|
+
accessTokenExpiresAt
|
|
20
|
+
shippingItemCode
|
|
21
|
+
discountItemCode
|
|
22
|
+
externalLineItemCode
|
|
23
|
+
pushSurcharges
|
|
24
|
+
surchargeItemCode
|
|
25
|
+
negativeSurchargeItemCode
|
|
26
|
+
pushSurchargesWarning
|
|
27
|
+
autoPush { enabled defaultTrigger rules { customerGroupId trigger } }
|
|
28
|
+
customerSync {
|
|
29
|
+
enabled
|
|
30
|
+
webhookEnabled
|
|
31
|
+
pushEnabled
|
|
32
|
+
accountFilter
|
|
33
|
+
overwritePolicy
|
|
34
|
+
fields { name email address }
|
|
35
|
+
}
|
|
36
|
+
paymentTerms {
|
|
37
|
+
enabled
|
|
38
|
+
synchronizationEnabled
|
|
39
|
+
newAccountPaymentConditionCode
|
|
40
|
+
paymentMethodConditions { paymentMethodId conditionCode }
|
|
41
|
+
}
|
|
42
|
+
deliveryTerms {
|
|
43
|
+
enabled
|
|
44
|
+
synchronizationEnabled
|
|
45
|
+
forwardRequestedDeliveryDate
|
|
46
|
+
sendDeliveryAddress
|
|
47
|
+
newAccountShippingMethodId
|
|
48
|
+
newAccountIncotermCode
|
|
49
|
+
newAccountIncotermVersion
|
|
50
|
+
newAccountIncotermAddress
|
|
51
|
+
newAccountShippingLeadDays
|
|
52
|
+
newAccountDeliveryAdvice
|
|
53
|
+
}
|
|
54
|
+
syncSchedule {
|
|
55
|
+
delta { ${SYNC_WINDOW_FIELDS} }
|
|
56
|
+
full { ${SYNC_WINDOW_FIELDS} }
|
|
57
|
+
order { ${SYNC_WINDOW_FIELDS} }
|
|
58
|
+
purchaseOrders { ${SYNC_WINDOW_FIELDS} }
|
|
59
|
+
purchaseOrdersReconcile { ${SYNC_WINDOW_FIELDS} }
|
|
60
|
+
customers { ${SYNC_WINDOW_FIELDS} }
|
|
61
|
+
priceLists { ${SYNC_WINDOW_FIELDS} }
|
|
62
|
+
dailyCallBudget
|
|
63
|
+
}
|
|
64
|
+
catalogueImportPolicy {
|
|
65
|
+
requireWebshopFlag
|
|
66
|
+
nonStockItems
|
|
67
|
+
unpricedItems
|
|
68
|
+
priceBasis
|
|
69
|
+
pictures
|
|
70
|
+
stockBasis
|
|
71
|
+
}
|
|
72
|
+
deltaLastEnqueuedAt
|
|
73
|
+
fullLastEnqueuedAt
|
|
74
|
+
orderLastEnqueuedAt
|
|
75
|
+
purchaseOrderLastEnqueuedAt
|
|
76
|
+
purchaseOrderReconcileLastEnqueuedAt
|
|
77
|
+
customerLastEnqueuedAt
|
|
78
|
+
priceListLastEnqueuedAt
|
|
79
|
+
`;
|
|
80
|
+
/**
|
|
81
|
+
* `updateExactOnlineConfig`'s inline arguments, each with its GraphQL type: the SDK takes one
|
|
82
|
+
* object, the wire keeps the arguments (adding an input type would be a second door to keep).
|
|
83
|
+
*/
|
|
84
|
+
export const EXACT_ONLINE_CONFIG_ARGUMENTS = {
|
|
85
|
+
region: 'String',
|
|
86
|
+
enabled: 'Boolean',
|
|
87
|
+
shippingItemCode: 'String',
|
|
88
|
+
discountItemCode: 'String',
|
|
89
|
+
externalLineItemCode: 'String',
|
|
90
|
+
pushSurcharges: 'Boolean',
|
|
91
|
+
surchargeItemCode: 'String',
|
|
92
|
+
negativeSurchargeItemCode: 'String',
|
|
93
|
+
autoPush: 'ExactAutoPushConfigInput',
|
|
94
|
+
customerSync: 'ExactCustomerSyncConfigInput',
|
|
95
|
+
paymentTerms: 'ExactPaymentTermsConfigInput',
|
|
96
|
+
deliveryTerms: 'ExactDeliveryTermsConfigInput',
|
|
97
|
+
syncSchedule: 'ExactSyncScheduleInput',
|
|
98
|
+
catalogueImportPolicy: 'ExactCatalogueImportPolicyInput',
|
|
99
|
+
};
|
|
100
|
+
/** The keys the engine cannot store as `null` (a not-null column, a `.trim()`, a section read). */
|
|
101
|
+
const NEVER_NULL_CONFIG_KEYS = [
|
|
102
|
+
'region',
|
|
103
|
+
'enabled',
|
|
104
|
+
'shippingItemCode',
|
|
105
|
+
'discountItemCode',
|
|
106
|
+
'paymentTerms',
|
|
107
|
+
'deliveryTerms',
|
|
108
|
+
];
|
|
109
|
+
export const EXACT_ONLINE_CONFIG_QUERY = /* GraphQL */ `
|
|
110
|
+
query ExactOnlineConfig {
|
|
111
|
+
exactOnlineConfig { ${CONFIG_FIELDS} }
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
// The variable list and the arguments are written out, never spliced in from
|
|
115
|
+
// EXACT_ONLINE_CONFIG_ARGUMENTS: the package's coverage specs parse every document literal with
|
|
116
|
+
// each `${…}` read as a field name, so an interpolated variable list fails them. The SDK spec
|
|
117
|
+
// pins the variables against the map and the engine's arguments.
|
|
118
|
+
export const UPDATE_EXACT_ONLINE_CONFIG_MUTATION = /* GraphQL */ `
|
|
119
|
+
mutation UpdateExactOnlineConfig(
|
|
120
|
+
$region: String
|
|
121
|
+
$enabled: Boolean
|
|
122
|
+
$shippingItemCode: String
|
|
123
|
+
$discountItemCode: String
|
|
124
|
+
$externalLineItemCode: String
|
|
125
|
+
$pushSurcharges: Boolean
|
|
126
|
+
$surchargeItemCode: String
|
|
127
|
+
$negativeSurchargeItemCode: String
|
|
128
|
+
$autoPush: ExactAutoPushConfigInput
|
|
129
|
+
$customerSync: ExactCustomerSyncConfigInput
|
|
130
|
+
$paymentTerms: ExactPaymentTermsConfigInput
|
|
131
|
+
$deliveryTerms: ExactDeliveryTermsConfigInput
|
|
132
|
+
$syncSchedule: ExactSyncScheduleInput
|
|
133
|
+
$catalogueImportPolicy: ExactCatalogueImportPolicyInput
|
|
134
|
+
) {
|
|
135
|
+
updateExactOnlineConfig(
|
|
136
|
+
region: $region
|
|
137
|
+
enabled: $enabled
|
|
138
|
+
shippingItemCode: $shippingItemCode
|
|
139
|
+
discountItemCode: $discountItemCode
|
|
140
|
+
externalLineItemCode: $externalLineItemCode
|
|
141
|
+
pushSurcharges: $pushSurcharges
|
|
142
|
+
surchargeItemCode: $surchargeItemCode
|
|
143
|
+
negativeSurchargeItemCode: $negativeSurchargeItemCode
|
|
144
|
+
autoPush: $autoPush
|
|
145
|
+
customerSync: $customerSync
|
|
146
|
+
paymentTerms: $paymentTerms
|
|
147
|
+
deliveryTerms: $deliveryTerms
|
|
148
|
+
syncSchedule: $syncSchedule
|
|
149
|
+
catalogueImportPolicy: $catalogueImportPolicy
|
|
150
|
+
) {
|
|
151
|
+
${CONFIG_FIELDS}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`;
|
|
155
|
+
export const SET_EXACT_ONLINE_CREDENTIALS_MUTATION = /* GraphQL */ `
|
|
156
|
+
mutation SetExactOnlineCredentials(
|
|
157
|
+
$clientId: String!
|
|
158
|
+
$clientSecret: String
|
|
159
|
+
$webhookSecret: String
|
|
160
|
+
) {
|
|
161
|
+
setExactOnlineCredentials(
|
|
162
|
+
clientId: $clientId
|
|
163
|
+
clientSecret: $clientSecret
|
|
164
|
+
webhookSecret: $webhookSecret
|
|
165
|
+
) {
|
|
166
|
+
${CONFIG_FIELDS}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
`;
|
|
170
|
+
export const EXACT_ONLINE_AUTHORIZATION_URL_MUTATION = /* GraphQL */ `
|
|
171
|
+
mutation ExactOnlineAuthorizationUrl($region: String) {
|
|
172
|
+
exactOnlineAuthorizationUrl(region: $region)
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
export const DISCONNECT_EXACT_ONLINE_MUTATION = /* GraphQL */ `
|
|
176
|
+
mutation DisconnectExactOnline {
|
|
177
|
+
disconnectExactOnline
|
|
178
|
+
}
|
|
179
|
+
`;
|
|
180
|
+
export const EXACT_ONLINE_SAMPLE_ACCOUNTS_QUERY = /* GraphQL */ `
|
|
181
|
+
query ExactOnlineSampleAccounts($limit: Int) {
|
|
182
|
+
exactOnlineSampleAccounts(limit: $limit) { id code name city country email status }
|
|
183
|
+
}
|
|
184
|
+
`;
|
|
185
|
+
export const EXACT_ONLINE_SAMPLE_ITEMS_QUERY = /* GraphQL */ `
|
|
186
|
+
query ExactOnlineSampleItems($limit: Int) {
|
|
187
|
+
exactOnlineSampleItems(limit: $limit) { id code description isSalesItem isStockItem }
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
export const EXACT_ONLINE_CATALOGUE_STRUCTURE_QUERY = /* GraphQL */ `
|
|
191
|
+
query ExactOnlineCatalogueStructure($sample: Int) {
|
|
192
|
+
exactOnlineCatalogueStructure(sample: $sample) {
|
|
193
|
+
sampledCount
|
|
194
|
+
distinctItemGroupCount
|
|
195
|
+
topItemGroups { code description itemCount }
|
|
196
|
+
classFields { field nonEmptyCount distinctCount }
|
|
197
|
+
rows { code description itemGroup }
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
`;
|
|
201
|
+
export const EXACT_ONLINE_CUSTOMER_STRUCTURE_QUERY = /* GraphQL */ `
|
|
202
|
+
query ExactOnlineCustomerStructure($sample: Int) {
|
|
203
|
+
exactOnlineCustomerStructure(sample: $sample) {
|
|
204
|
+
sampledCount
|
|
205
|
+
withEmail
|
|
206
|
+
withoutEmail
|
|
207
|
+
withAddress
|
|
208
|
+
resellerCount
|
|
209
|
+
dimensions {
|
|
210
|
+
sequence
|
|
211
|
+
name
|
|
212
|
+
slotField
|
|
213
|
+
populatedCount
|
|
214
|
+
distinctCount
|
|
215
|
+
values { id code description accountCount }
|
|
216
|
+
}
|
|
217
|
+
priceLists { id code description accountCount }
|
|
218
|
+
rows { code name email city country isReseller classifications priceList }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
`;
|
|
222
|
+
export const EXACT_ONLINE_PRICING_STRUCTURE_QUERY = /* GraphQL */ `
|
|
223
|
+
query ExactOnlinePricingStructure {
|
|
224
|
+
exactOnlinePricingStructure {
|
|
225
|
+
priceLists { id code description currency }
|
|
226
|
+
priceListItemPriceCount
|
|
227
|
+
priceListItemSamples {
|
|
228
|
+
itemCode
|
|
229
|
+
itemDescription
|
|
230
|
+
quantity
|
|
231
|
+
newPrice
|
|
232
|
+
discount
|
|
233
|
+
entryMethod
|
|
234
|
+
basePrice
|
|
235
|
+
}
|
|
236
|
+
accountsWithDefaultPriceList
|
|
237
|
+
customerPriceCount
|
|
238
|
+
customerPriceDistinctAccounts
|
|
239
|
+
customerPriceDistinctItems
|
|
240
|
+
customerPriceSamples { itemCode accountName price quantity currency }
|
|
241
|
+
sampled
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
`;
|
|
245
|
+
export const EXACT_ONLINE_WEBHOOK_STATUS_QUERY = /* GraphQL */ `
|
|
246
|
+
query ExactOnlineWebhookStatus {
|
|
247
|
+
exactOnlineWebhookStatus {
|
|
248
|
+
supported
|
|
249
|
+
registered
|
|
250
|
+
subscriptions { topic subscriptionId callbackUrl }
|
|
251
|
+
checkedAt
|
|
252
|
+
error
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
`;
|
|
256
|
+
export const SYNC_EXACT_ONLINE_WEBHOOKS_MUTATION = /* GraphQL */ `
|
|
257
|
+
mutation SyncExactOnlineWebhooks {
|
|
258
|
+
syncExactOnlineWebhooks
|
|
259
|
+
}
|
|
260
|
+
`;
|
|
261
|
+
const SWEEP_ESTIMATE_FIELDS = /* GraphQL */ `
|
|
262
|
+
enabled
|
|
263
|
+
intervalMinutes
|
|
264
|
+
minIntervalMinutes
|
|
265
|
+
maxIntervalMinutes
|
|
266
|
+
callsPerRun
|
|
267
|
+
runsPerDay
|
|
268
|
+
callsPerDay
|
|
269
|
+
`;
|
|
270
|
+
export const EXACT_ONLINE_SYNC_ESTIMATE_QUERY = /* GraphQL */ `
|
|
271
|
+
query ExactOnlineSyncEstimate($schedule: ExactSyncScheduleInput!) {
|
|
272
|
+
exactOnlineSyncEstimate(schedule: $schedule) {
|
|
273
|
+
delta { ${SWEEP_ESTIMATE_FIELDS} }
|
|
274
|
+
full { ${SWEEP_ESTIMATE_FIELDS} }
|
|
275
|
+
order { ${SWEEP_ESTIMATE_FIELDS} }
|
|
276
|
+
purchaseOrders { ${SWEEP_ESTIMATE_FIELDS} }
|
|
277
|
+
purchaseOrdersReconcile { ${SWEEP_ESTIMATE_FIELDS} }
|
|
278
|
+
customers { ${SWEEP_ESTIMATE_FIELDS} }
|
|
279
|
+
priceLists { ${SWEEP_ESTIMATE_FIELDS} }
|
|
280
|
+
total
|
|
281
|
+
dailyCallBudget
|
|
282
|
+
overBudget
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
`;
|
|
286
|
+
const SYNC_LOG_FIELDS = /* GraphQL */ `
|
|
287
|
+
id
|
|
288
|
+
entity
|
|
289
|
+
mode
|
|
290
|
+
status
|
|
291
|
+
createdCount
|
|
292
|
+
updatedCount
|
|
293
|
+
skippedCount
|
|
294
|
+
failedCount
|
|
295
|
+
detachedCount
|
|
296
|
+
error
|
|
297
|
+
durationMs
|
|
298
|
+
createdAt
|
|
299
|
+
catalogueExclusions { inactive notWebshop nonStock unpriced total absent }
|
|
300
|
+
`;
|
|
301
|
+
export const EXACT_ONLINE_SYNC_LOGS_QUERY = /* GraphQL */ `
|
|
302
|
+
query ExactOnlineSyncLogs($limit: Int, $entity: String) {
|
|
303
|
+
exactOnlineSyncLogs(limit: $limit, entity: $entity) { ${SYNC_LOG_FIELDS} }
|
|
304
|
+
}
|
|
305
|
+
`;
|
|
306
|
+
const RUN_SUMMARY_FIELDS = /* GraphQL */ `lastRunAt status error lastSuccessAt`;
|
|
307
|
+
export const EXACT_ONLINE_SYNC_HEALTH_QUERY = /* GraphQL */ `
|
|
308
|
+
query ExactOnlineSyncHealth {
|
|
309
|
+
exactOnlineSyncHealth {
|
|
310
|
+
customers { ${RUN_SUMMARY_FIELDS} }
|
|
311
|
+
catalogue { ${RUN_SUMMARY_FIELDS} }
|
|
312
|
+
orders { ${RUN_SUMMARY_FIELDS} }
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
`;
|
|
316
|
+
export const RUN_EXACT_ONLINE_CATALOGUE_SYNC_MUTATION = /* GraphQL */ `
|
|
317
|
+
mutation RunExactOnlineCatalogueSync {
|
|
318
|
+
runExactOnlineCatalogueSync
|
|
319
|
+
}
|
|
320
|
+
`;
|
|
321
|
+
export const RUN_EXACT_ONLINE_CUSTOMER_SYNC_MUTATION = /* GraphQL */ `
|
|
322
|
+
mutation RunExactOnlineCustomerSync {
|
|
323
|
+
runExactOnlineCustomerSync
|
|
324
|
+
}
|
|
325
|
+
`;
|
|
326
|
+
export const RUN_EXACT_ONLINE_PRICE_LIST_SYNC_MUTATION = /* GraphQL */ `
|
|
327
|
+
mutation RunExactOnlinePriceListSync {
|
|
328
|
+
runExactOnlinePriceListSync
|
|
329
|
+
}
|
|
330
|
+
`;
|
|
331
|
+
export const REIMPORT_EXACT_ONLINE_ITEM_PICTURES_MUTATION = /* GraphQL */ `
|
|
332
|
+
mutation ReimportExactOnlineItemPictures {
|
|
333
|
+
reimportExactOnlineItemPictures
|
|
334
|
+
}
|
|
335
|
+
`;
|
|
336
|
+
export const EXACT_ONLINE_SYNC_CURSORS_QUERY = /* GraphQL */ `
|
|
337
|
+
query ExactOnlineSyncCursors {
|
|
338
|
+
exactOnlineSyncCursors { entity cursor }
|
|
339
|
+
}
|
|
340
|
+
`;
|
|
341
|
+
export const RESET_EXACT_ONLINE_SYNC_CURSOR_MUTATION = /* GraphQL */ `
|
|
342
|
+
mutation ResetExactOnlineSyncCursor($entity: String!) {
|
|
343
|
+
resetExactOnlineSyncCursor(entity: $entity)
|
|
344
|
+
}
|
|
345
|
+
`;
|
|
346
|
+
export const EXACT_ONLINE_WAREHOUSE_LINKS_QUERY = /* GraphQL */ `
|
|
347
|
+
query ExactOnlineWarehouseLinks {
|
|
348
|
+
exactOnlineWarehouseLinks { stockLocationId stockLocationName exactWarehouseId }
|
|
349
|
+
}
|
|
350
|
+
`;
|
|
351
|
+
const SHIPPING_MAPPING_FIELDS = /* GraphQL */ `
|
|
352
|
+
vendureShippingMethodId
|
|
353
|
+
vendureCode
|
|
354
|
+
vendureName
|
|
355
|
+
exactShippingMethodId
|
|
356
|
+
exactManaged
|
|
357
|
+
status
|
|
358
|
+
`;
|
|
359
|
+
export const EXACT_ONLINE_SHIPPING_METHODS_QUERY = /* GraphQL */ `
|
|
360
|
+
query ExactOnlineShippingMethods {
|
|
361
|
+
exactOnlineShippingMethods {
|
|
362
|
+
mappings { ${SHIPPING_MAPPING_FIELDS} }
|
|
363
|
+
exact { id code description active amount linked }
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
`;
|
|
367
|
+
export const RUN_EXACT_ONLINE_SHIPPING_METHOD_SYNC_MUTATION = /* GraphQL */ `
|
|
368
|
+
mutation RunExactOnlineShippingMethodSync {
|
|
369
|
+
runExactOnlineShippingMethodSync
|
|
370
|
+
}
|
|
371
|
+
`;
|
|
372
|
+
export const IMPORT_EXACT_ONLINE_SHIPPING_METHOD_MUTATION = /* GraphQL */ `
|
|
373
|
+
mutation ImportExactOnlineShippingMethod($exactShippingMethodId: String!) {
|
|
374
|
+
importExactOnlineShippingMethod(exactShippingMethodId: $exactShippingMethodId) {
|
|
375
|
+
${SHIPPING_MAPPING_FIELDS}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
`;
|
|
379
|
+
export const SET_EXACT_ONLINE_SHIPPING_METHOD_MAPPING_MUTATION = /* GraphQL */ `
|
|
380
|
+
mutation SetExactOnlineShippingMethodMapping(
|
|
381
|
+
$vendureShippingMethodId: ID!
|
|
382
|
+
$exactShippingMethodId: String
|
|
383
|
+
) {
|
|
384
|
+
setExactOnlineShippingMethodMapping(
|
|
385
|
+
vendureShippingMethodId: $vendureShippingMethodId
|
|
386
|
+
exactShippingMethodId: $exactShippingMethodId
|
|
387
|
+
) {
|
|
388
|
+
${SHIPPING_MAPPING_FIELDS}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
`;
|
|
392
|
+
export const CONVERT_EXACT_ONLINE_SHIPPING_METHOD_TO_MAPPING_MUTATION = /* GraphQL */ `
|
|
393
|
+
mutation ConvertExactOnlineShippingMethodToMapping(
|
|
394
|
+
$exactShippingMethodId: String!
|
|
395
|
+
$vendureShippingMethodId: ID!
|
|
396
|
+
) {
|
|
397
|
+
convertExactOnlineShippingMethodToMapping(
|
|
398
|
+
exactShippingMethodId: $exactShippingMethodId
|
|
399
|
+
vendureShippingMethodId: $vendureShippingMethodId
|
|
400
|
+
) {
|
|
401
|
+
${SHIPPING_MAPPING_FIELDS}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
`;
|
|
405
|
+
export const RETIRE_EXACT_ONLINE_IMPORTED_SHIPPING_METHOD_MUTATION = /* GraphQL */ `
|
|
406
|
+
mutation RetireExactOnlineImportedShippingMethod($exactShippingMethodId: String!) {
|
|
407
|
+
retireExactOnlineImportedShippingMethod(exactShippingMethodId: $exactShippingMethodId)
|
|
408
|
+
}
|
|
409
|
+
`;
|
|
410
|
+
// ── Payment and delivery terms (W10-57) ──
|
|
411
|
+
const PAYMENT_CONDITION_DISTRIBUTION_FIELDS = /* GraphQL */ `code description customerCount`;
|
|
412
|
+
const UNRESOLVED_PAYMENT_CONDITION_FIELDS = /* GraphQL */ `code customerCount`;
|
|
413
|
+
const DRY_RUN_RESOURCE_FIELDS = /* GraphQL */ `resource ok permissionWarning error`;
|
|
414
|
+
export const EXACT_ONLINE_PAYMENT_CONDITIONS_QUERY = /* GraphQL */ `
|
|
415
|
+
query ExactOnlinePaymentConditions {
|
|
416
|
+
exactOnlinePaymentConditions {
|
|
417
|
+
exactId
|
|
418
|
+
code
|
|
419
|
+
description
|
|
420
|
+
summary
|
|
421
|
+
classification
|
|
422
|
+
paymentDays
|
|
423
|
+
paymentEndOfMonths
|
|
424
|
+
paymentMethod
|
|
425
|
+
percentage
|
|
426
|
+
discountPaymentDays
|
|
427
|
+
discountPercentage
|
|
428
|
+
paymentDiscountType
|
|
429
|
+
active
|
|
430
|
+
syncedAt
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
`;
|
|
434
|
+
export const EXACT_ONLINE_PAYMENT_TERMS_DIAGNOSTICS_QUERY = /* GraphQL */ `
|
|
435
|
+
query ExactOnlinePaymentTermsDiagnostics {
|
|
436
|
+
exactOnlinePaymentTermsDiagnostics {
|
|
437
|
+
totalCustomers
|
|
438
|
+
assignedCount
|
|
439
|
+
unassignedCount
|
|
440
|
+
unresolvedCount
|
|
441
|
+
staleCount
|
|
442
|
+
lastSyncedAt
|
|
443
|
+
error
|
|
444
|
+
permissionWarning
|
|
445
|
+
distribution { ${PAYMENT_CONDITION_DISTRIBUTION_FIELDS} }
|
|
446
|
+
unresolvedCodes { ${UNRESOLVED_PAYMENT_CONDITION_FIELDS} }
|
|
447
|
+
lastReconciliation {
|
|
448
|
+
mode
|
|
449
|
+
status
|
|
450
|
+
createdCount
|
|
451
|
+
updatedCount
|
|
452
|
+
deactivatedCount
|
|
453
|
+
failedCount
|
|
454
|
+
at
|
|
455
|
+
error
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
`;
|
|
460
|
+
const DRY_RUN_CONDITION_FIELDS = /* GraphQL */ `code description summary classification scheduleCount`;
|
|
461
|
+
export const EXACT_ONLINE_PAYMENT_TERMS_DRY_RUN_QUERY = /* GraphQL */ `
|
|
462
|
+
query ExactOnlinePaymentTermsDryRun {
|
|
463
|
+
exactOnlinePaymentTermsDryRun {
|
|
464
|
+
division
|
|
465
|
+
generatedAt
|
|
466
|
+
complete
|
|
467
|
+
permissionWarning
|
|
468
|
+
catalogRowCount
|
|
469
|
+
catalogCodeCount
|
|
470
|
+
accountCount
|
|
471
|
+
assignedCount
|
|
472
|
+
unassignedCount
|
|
473
|
+
unresolvedCount
|
|
474
|
+
uncheckedCount
|
|
475
|
+
distribution { ${PAYMENT_CONDITION_DISTRIBUTION_FIELDS} }
|
|
476
|
+
duplicateConditions { ${DRY_RUN_CONDITION_FIELDS} }
|
|
477
|
+
complexConditions { ${DRY_RUN_CONDITION_FIELDS} }
|
|
478
|
+
unresolvedCodes { ${UNRESOLVED_PAYMENT_CONDITION_FIELDS} }
|
|
479
|
+
assignmentIssues { accountId accountCode conditionCode conditionDescription status }
|
|
480
|
+
resources { ${DRY_RUN_RESOURCE_FIELDS} }
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
`;
|
|
484
|
+
export const EXACT_ONLINE_INCOTERMS_QUERY = /* GraphQL */ `
|
|
485
|
+
query ExactOnlineIncoterms {
|
|
486
|
+
exactOnlineIncoterms {
|
|
487
|
+
exactId
|
|
488
|
+
code
|
|
489
|
+
version
|
|
490
|
+
description
|
|
491
|
+
catalogAvailable
|
|
492
|
+
stale
|
|
493
|
+
lastSyncedAt
|
|
494
|
+
error
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
`;
|
|
498
|
+
export const EXACT_ONLINE_DELIVERY_TERMS_DIAGNOSTICS_QUERY = /* GraphQL */ `
|
|
499
|
+
query ExactOnlineDeliveryTermsDiagnostics {
|
|
500
|
+
exactOnlineDeliveryTermsDiagnostics {
|
|
501
|
+
reconciliationRequired
|
|
502
|
+
accountSyncStatus
|
|
503
|
+
totalCustomers
|
|
504
|
+
assignedCount
|
|
505
|
+
unassignedCount
|
|
506
|
+
unresolvedCount
|
|
507
|
+
staleCount
|
|
508
|
+
mappedMethodCount
|
|
509
|
+
usableShippingMappingCount
|
|
510
|
+
unmappedMethodCount
|
|
511
|
+
inactiveMethodCount
|
|
512
|
+
unavailableMethodCount
|
|
513
|
+
nullAmountCount
|
|
514
|
+
invalidIncotermCount
|
|
515
|
+
lastSyncedAt
|
|
516
|
+
error
|
|
517
|
+
permissionWarning
|
|
518
|
+
shippingMethodDistribution { exactId code description customerCount }
|
|
519
|
+
incotermDistribution { code version description customerCount }
|
|
520
|
+
warnings
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
`;
|
|
524
|
+
export const EXACT_ONLINE_DELIVERY_TERMS_DRY_RUN_QUERY = /* GraphQL */ `
|
|
525
|
+
query ExactOnlineDeliveryTermsDryRun {
|
|
526
|
+
exactOnlineDeliveryTermsDryRun {
|
|
527
|
+
division
|
|
528
|
+
generatedAt
|
|
529
|
+
complete
|
|
530
|
+
permissionWarning
|
|
531
|
+
shippingMethodCount
|
|
532
|
+
activeShippingMethodCount
|
|
533
|
+
mappingCount
|
|
534
|
+
unmappedCatalogMethodCount
|
|
535
|
+
nullAmountCount
|
|
536
|
+
zeroAmountCount
|
|
537
|
+
incotermCount
|
|
538
|
+
accountCount
|
|
539
|
+
assignedShippingMethodCount
|
|
540
|
+
mappedAssignedShippingMethodCount
|
|
541
|
+
unmappedAssignedShippingMethodCount
|
|
542
|
+
unassignedShippingMethodCount
|
|
543
|
+
unresolvedShippingMethodCount
|
|
544
|
+
assignedIncotermCount
|
|
545
|
+
unassignedIncotermCount
|
|
546
|
+
unresolvedIncotermCount
|
|
547
|
+
invalidPolicyCount
|
|
548
|
+
shippingMethodDistribution { exactId customerCount }
|
|
549
|
+
incotermDistribution { code version customerCount }
|
|
550
|
+
assignmentIssues {
|
|
551
|
+
accountId
|
|
552
|
+
accountCode
|
|
553
|
+
shippingMethodId
|
|
554
|
+
incotermCode
|
|
555
|
+
incotermVersion
|
|
556
|
+
status
|
|
557
|
+
message
|
|
558
|
+
}
|
|
559
|
+
resources { ${DRY_RUN_RESOURCE_FIELDS} }
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
`;
|
|
563
|
+
// ── The customer, order and product cards (W10-57) ──
|
|
564
|
+
export const EXACT_ONLINE_CUSTOMER_PAYMENT_TERMS_QUERY = /* GraphQL */ `
|
|
565
|
+
query ExactOnlineCustomerPaymentTerms($customerId: ID!) {
|
|
566
|
+
exactOnlineCustomerPaymentTerms(customerId: $customerId) {
|
|
567
|
+
customerId
|
|
568
|
+
source
|
|
569
|
+
managedExternally
|
|
570
|
+
linkedExternally
|
|
571
|
+
status
|
|
572
|
+
stale
|
|
573
|
+
exactAccountId
|
|
574
|
+
exactAccountCode
|
|
575
|
+
conditionCode
|
|
576
|
+
conditionDescription
|
|
577
|
+
summary
|
|
578
|
+
classification
|
|
579
|
+
paymentDays
|
|
580
|
+
paymentEndOfMonths
|
|
581
|
+
paymentMethod
|
|
582
|
+
percentage
|
|
583
|
+
discountPaymentDays
|
|
584
|
+
discountPercentage
|
|
585
|
+
paymentDiscountType
|
|
586
|
+
syncedAt
|
|
587
|
+
lastCheckedAt
|
|
588
|
+
error
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
`;
|
|
592
|
+
export const EXACT_ONLINE_CUSTOMER_DELIVERY_TERMS_QUERY = /* GraphQL */ `
|
|
593
|
+
query ExactOnlineCustomerDeliveryTerms($customerId: ID!) {
|
|
594
|
+
exactOnlineCustomerDeliveryTerms(customerId: $customerId) {
|
|
595
|
+
customerId
|
|
596
|
+
source
|
|
597
|
+
managedExternally
|
|
598
|
+
linkedExternally
|
|
599
|
+
status
|
|
600
|
+
shippingMethodStatus
|
|
601
|
+
policyStatus
|
|
602
|
+
summary
|
|
603
|
+
exactAccountId
|
|
604
|
+
exactAccountCode
|
|
605
|
+
preferredShippingMethodId
|
|
606
|
+
preferredShippingMethodCode
|
|
607
|
+
preferredShippingMethodName
|
|
608
|
+
preferredShippingMethodAvailable
|
|
609
|
+
eligibleShippingMethodIds
|
|
610
|
+
incotermStatus
|
|
611
|
+
incotermCode
|
|
612
|
+
incotermVersion
|
|
613
|
+
incotermAddress
|
|
614
|
+
incotermDescription
|
|
615
|
+
shippingLeadDays
|
|
616
|
+
deliveryAdvice
|
|
617
|
+
stale
|
|
618
|
+
syncedAt
|
|
619
|
+
lastCheckedAt
|
|
620
|
+
error
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
`;
|
|
624
|
+
export const EXACT_ONLINE_CUSTOMER_PRICE_LIST_QUERY = /* GraphQL */ `
|
|
625
|
+
query ExactOnlineCustomerPriceList($customerId: ID!) {
|
|
626
|
+
exactOnlineCustomerPriceList(customerId: $customerId) {
|
|
627
|
+
customerId
|
|
628
|
+
exactAccountId
|
|
629
|
+
exactAccountCode
|
|
630
|
+
exactPriceListId
|
|
631
|
+
groupId
|
|
632
|
+
groupName
|
|
633
|
+
priceListId
|
|
634
|
+
priceListName
|
|
635
|
+
status
|
|
636
|
+
lastReconciledAt
|
|
637
|
+
lastError
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
`;
|
|
641
|
+
export const EXACT_ONLINE_ORDER_STATE_QUERY = /* GraphQL */ `
|
|
642
|
+
query ExactOnlineOrderState($orderId: ID!) {
|
|
643
|
+
exactOnlineOrderState(orderId: $orderId) {
|
|
644
|
+
pushed
|
|
645
|
+
origin
|
|
646
|
+
salesOrderId
|
|
647
|
+
salesOrderNumber
|
|
648
|
+
pushedAt
|
|
649
|
+
hasCustomer
|
|
650
|
+
customerLinked
|
|
651
|
+
unmappedSkus
|
|
652
|
+
warnings
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
`;
|
|
656
|
+
export const EXACT_ONLINE_ORDER_SYNC_STATE_QUERY = /* GraphQL */ `
|
|
657
|
+
query ExactOnlineOrderSyncState($orderId: ID!) {
|
|
658
|
+
exactOnlineOrderSyncState(orderId: $orderId) {
|
|
659
|
+
exactSalesOrderId
|
|
660
|
+
exactOrderNumber
|
|
661
|
+
revision
|
|
662
|
+
lastSyncedAt
|
|
663
|
+
driftDetected
|
|
664
|
+
exactDeletedAt
|
|
665
|
+
unmappedSkus
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
`;
|
|
669
|
+
export const PUSH_ORDER_TO_EXACT_ONLINE_MUTATION = /* GraphQL */ `
|
|
670
|
+
mutation PushOrderToExactOnline($orderId: ID!) {
|
|
671
|
+
pushOrderToExactOnline(orderId: $orderId) {
|
|
672
|
+
success
|
|
673
|
+
alreadyPushed
|
|
674
|
+
salesOrderId
|
|
675
|
+
salesOrderNumber
|
|
676
|
+
error
|
|
677
|
+
errorCode
|
|
678
|
+
warnings
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
`;
|
|
682
|
+
/**
|
|
683
|
+
* {@link EXACT_ONLINE_ORDER_STATE_QUERY} without `warnings`, for an engine that predates the field
|
|
684
|
+
* (#1925): services deploy separately, and GraphQL refuses the whole document over one unknown
|
|
685
|
+
* field. Drop it once every engine serves `warnings` (orchestrator probe 2026-10-16: production
|
|
686
|
+
* did not yet).
|
|
687
|
+
*/
|
|
688
|
+
export const EXACT_ONLINE_ORDER_STATE_LEGACY_QUERY = /* GraphQL */ `
|
|
689
|
+
query ExactOnlineOrderState($orderId: ID!) {
|
|
690
|
+
exactOnlineOrderState(orderId: $orderId) {
|
|
691
|
+
pushed
|
|
692
|
+
origin
|
|
693
|
+
salesOrderId
|
|
694
|
+
salesOrderNumber
|
|
695
|
+
pushedAt
|
|
696
|
+
hasCustomer
|
|
697
|
+
customerLinked
|
|
698
|
+
unmappedSkus
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
`;
|
|
702
|
+
/**
|
|
703
|
+
* {@link PUSH_ORDER_TO_EXACT_ONLINE_MUTATION} without `warnings`, for an engine that predates the
|
|
704
|
+
* field. Safe to send after the current document was refused: an unknown field fails validation,
|
|
705
|
+
* before the push runs, so nothing reached Exact. Drop it with the state read's.
|
|
706
|
+
*/
|
|
707
|
+
export const PUSH_ORDER_TO_EXACT_ONLINE_LEGACY_MUTATION = /* GraphQL */ `
|
|
708
|
+
mutation PushOrderToExactOnline($orderId: ID!) {
|
|
709
|
+
pushOrderToExactOnline(orderId: $orderId) {
|
|
710
|
+
success
|
|
711
|
+
alreadyPushed
|
|
712
|
+
salesOrderId
|
|
713
|
+
salesOrderNumber
|
|
714
|
+
error
|
|
715
|
+
errorCode
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
`;
|
|
719
|
+
export const REPRICE_EXACT_ONLINE_ORDER_MUTATION = /* GraphQL */ `
|
|
720
|
+
mutation RepriceExactOnlineOrder($orderId: ID!) {
|
|
721
|
+
repriceExactOnlineOrder(orderId: $orderId) {
|
|
722
|
+
success
|
|
723
|
+
changed
|
|
724
|
+
linesRepriced
|
|
725
|
+
error
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
`;
|
|
729
|
+
export const REPRICE_ALL_EXACT_ONLINE_IMPORTED_ORDERS_MUTATION = /* GraphQL */ `
|
|
730
|
+
mutation RepriceAllExactOnlineImportedOrders {
|
|
731
|
+
repriceAllExactOnlineImportedOrders {
|
|
732
|
+
total
|
|
733
|
+
repriced
|
|
734
|
+
skipped
|
|
735
|
+
failed
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
`;
|
|
739
|
+
export const RUN_EXACT_ONLINE_ORDER_SYNC_MUTATION = /* GraphQL */ `
|
|
740
|
+
mutation RunExactOnlineOrderSync {
|
|
741
|
+
runExactOnlineOrderSync
|
|
742
|
+
}
|
|
743
|
+
`;
|
|
744
|
+
export const RUN_EXACT_ONLINE_ORDER_BACKFILL_MUTATION = /* GraphQL */ `
|
|
745
|
+
mutation RunExactOnlineOrderBackfill {
|
|
746
|
+
runExactOnlineOrderBackfill
|
|
747
|
+
}
|
|
748
|
+
`;
|
|
749
|
+
export const EXACT_PRODUCT_STATUS_QUERY = /* GraphQL */ `
|
|
750
|
+
query ExactProductStatus($id: ID!) {
|
|
751
|
+
product(id: $id) {
|
|
752
|
+
id
|
|
753
|
+
customFields {
|
|
754
|
+
exactManaged
|
|
755
|
+
exactItemId
|
|
756
|
+
exactItemGroupId
|
|
757
|
+
exactDisabledReason
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
`;
|
|
762
|
+
/** The plugins service's Exact connection-log routes (force-scoped to the caller's store). */
|
|
763
|
+
const CONNECTION_LOGS = '/exact-online/logs';
|
|
764
|
+
/** How long a connection-log export may stream before the call gives up, unless said otherwise. */
|
|
765
|
+
export const EXACT_ONLINE_LOG_EXPORT_TIMEOUT_MS = 120_000;
|
|
766
|
+
const CONNECTION_LOG_KINDS = ['calls', 'events'];
|
|
767
|
+
const invalidInput = (message, field) => new ValidationError({
|
|
768
|
+
code: 'INVALID_EXACT_ONLINE_INPUT',
|
|
769
|
+
message,
|
|
770
|
+
status: 400,
|
|
771
|
+
service: 'vendure',
|
|
772
|
+
...(field ? { details: [{ field, code: 'INVALID_EXACT_ONLINE_INPUT', message }] } : {}),
|
|
773
|
+
});
|
|
774
|
+
const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
775
|
+
function requireObject(value, method) {
|
|
776
|
+
if (!isObject(value))
|
|
777
|
+
throw invalidInput(`${method} takes an input object.`);
|
|
778
|
+
return value;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* The input as the mutation's variables, as given: a key left out stays out, so the engine keeps
|
|
782
|
+
* the stored value. A key the engine has no argument for is refused here: GraphQL ignores a
|
|
783
|
+
* variable the operation does not declare, so it would otherwise be dropped silently.
|
|
784
|
+
*/
|
|
785
|
+
function configVariables(input) {
|
|
786
|
+
const variables = requireObject(input, 'config.update');
|
|
787
|
+
for (const key of Object.keys(variables)) {
|
|
788
|
+
if (!Object.hasOwn(EXACT_ONLINE_CONFIG_ARGUMENTS, key)) {
|
|
789
|
+
throw invalidInput(`${key} is not an Exact Online setting.`, key);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
for (const key of NEVER_NULL_CONFIG_KEYS) {
|
|
793
|
+
if (Object.hasOwn(variables, key) && variables[key] === null) {
|
|
794
|
+
throw invalidInput(`${key} cannot be null: leave it out to keep the stored value.`, key);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
return variables;
|
|
798
|
+
}
|
|
799
|
+
/** A sync-log read's variables: only what was given, after the checks the engine would skip. */
|
|
800
|
+
function syncLogVariables(options) {
|
|
801
|
+
const { entity, limit } = options;
|
|
802
|
+
if (limit !== undefined &&
|
|
803
|
+
(!Number.isInteger(limit) || limit < 1 || limit > EXACT_ONLINE_SYNC_LOG_LIMIT)) {
|
|
804
|
+
throw invalidInput(`limit must be a whole number from 1 to ${String(EXACT_ONLINE_SYNC_LOG_LIMIT)}.`, 'limit');
|
|
805
|
+
}
|
|
806
|
+
if (entity !== undefined && (typeof entity !== 'string' || entity.trim() === '')) {
|
|
807
|
+
throw invalidInput('entity must name a sync entity, such as "items".', 'entity');
|
|
808
|
+
}
|
|
809
|
+
return {
|
|
810
|
+
...(limit === undefined ? {} : { limit }),
|
|
811
|
+
...(entity === undefined ? {} : { entity }),
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
/** An id the call is about, refused before sending when it is not a non-blank string. */
|
|
815
|
+
function requireId(id, field, method) {
|
|
816
|
+
if (typeof id !== 'string' || id.trim() === '') {
|
|
817
|
+
throw invalidInput(`${method} needs the ${field}.`, field);
|
|
818
|
+
}
|
|
819
|
+
return id;
|
|
820
|
+
}
|
|
821
|
+
function requireEntity(entity) {
|
|
822
|
+
if (typeof entity !== 'string' || entity.trim() === '') {
|
|
823
|
+
throw invalidInput('resetCursor needs the entity stream whose cursor to drop.', 'entity');
|
|
824
|
+
}
|
|
825
|
+
return entity;
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* A connection-log filter as the route's query. The wire cursor is `?before=` (the rows run
|
|
829
|
+
* newest first); the SDK's name for "the cursor the previous page handed me" is `after`, as on
|
|
830
|
+
* every list. An undefined value is left out of the query.
|
|
831
|
+
*/
|
|
832
|
+
function connectionLogQuery(filter) {
|
|
833
|
+
return {
|
|
834
|
+
before: filter.after,
|
|
835
|
+
limit: filter.limit,
|
|
836
|
+
category: filter.category,
|
|
837
|
+
outcome: filter.outcome,
|
|
838
|
+
status_code: filter.statusCode,
|
|
839
|
+
q: filter.q,
|
|
840
|
+
date_from: filter.dateFrom,
|
|
841
|
+
date_to: filter.dateTo,
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
/** The per-call options of a filter object (`signal`, `tenant`, `idempotencyKey`). */
|
|
845
|
+
function callOf(filter) {
|
|
846
|
+
if (!filter)
|
|
847
|
+
return {};
|
|
848
|
+
const { signal, tenant, idempotencyKey } = filter;
|
|
849
|
+
return {
|
|
850
|
+
...(signal === undefined ? {} : { signal }),
|
|
851
|
+
...(tenant === undefined ? {} : { tenant }),
|
|
852
|
+
...(idempotencyKey === undefined ? {} : { idempotencyKey }),
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
export function createExactOnlineModule(transport) {
|
|
856
|
+
const read = (document, field, options, variables = {}) => fieldOf(transport, document, field, variables, options);
|
|
857
|
+
async function connectionLogCalls(filter) {
|
|
858
|
+
const body = await transport.rest('plugins', { method: 'GET', path: `${CONNECTION_LOGS}/calls`, query: connectionLogQuery(filter ?? {}) }, { ...callOf(filter), preserveKeys: PLATFORM_PASSTHROUGH_KEYS });
|
|
859
|
+
const { items, meta } = readRestPage(body);
|
|
860
|
+
return createPage(items, meta, (cursor) => connectionLogCalls({ ...filter, after: cursor }));
|
|
861
|
+
}
|
|
862
|
+
async function connectionLogEvents(filter) {
|
|
863
|
+
const body = await transport.rest('plugins', { method: 'GET', path: `${CONNECTION_LOGS}/events`, query: connectionLogQuery(filter ?? {}) }, { ...callOf(filter), preserveKeys: PLATFORM_PASSTHROUGH_KEYS });
|
|
864
|
+
const { items, meta } = readRestPage(body);
|
|
865
|
+
return createPage(items, meta, (cursor) => connectionLogEvents({ ...filter, after: cursor }));
|
|
866
|
+
}
|
|
867
|
+
return {
|
|
868
|
+
config: {
|
|
869
|
+
async get(options) {
|
|
870
|
+
return ((await read(EXACT_ONLINE_CONFIG_QUERY, 'exactOnlineConfig', options)) ?? null);
|
|
871
|
+
},
|
|
872
|
+
async update(input, options) {
|
|
873
|
+
return read(UPDATE_EXACT_ONLINE_CONFIG_MUTATION, 'updateExactOnlineConfig', options, configVariables(input));
|
|
874
|
+
},
|
|
875
|
+
},
|
|
876
|
+
credentials: {
|
|
877
|
+
async set(input, options) {
|
|
878
|
+
const { clientId, clientSecret, webhookSecret } = requireObject(input, 'credentials.set');
|
|
879
|
+
if (typeof clientId !== 'string') {
|
|
880
|
+
throw invalidInput('credentials.set needs the Exact app client id.', 'clientId');
|
|
881
|
+
}
|
|
882
|
+
return read(SET_EXACT_ONLINE_CREDENTIALS_MUTATION, 'setExactOnlineCredentials', options, { clientId, clientSecret, webhookSecret });
|
|
883
|
+
},
|
|
884
|
+
},
|
|
885
|
+
authorizationUrl(region, options) {
|
|
886
|
+
return read(EXACT_ONLINE_AUTHORIZATION_URL_MUTATION, 'exactOnlineAuthorizationUrl', options, region === undefined ? {} : { region });
|
|
887
|
+
},
|
|
888
|
+
async disconnect(options) {
|
|
889
|
+
return ((await read(DISCONNECT_EXACT_ONLINE_MUTATION, 'disconnectExactOnline', options)) === true);
|
|
890
|
+
},
|
|
891
|
+
samples: {
|
|
892
|
+
accounts(options) {
|
|
893
|
+
const { limit, ...call } = options ?? {};
|
|
894
|
+
return read(EXACT_ONLINE_SAMPLE_ACCOUNTS_QUERY, 'exactOnlineSampleAccounts', call, limit === undefined ? {} : { limit });
|
|
895
|
+
},
|
|
896
|
+
items(options) {
|
|
897
|
+
const { limit, ...call } = options ?? {};
|
|
898
|
+
return read(EXACT_ONLINE_SAMPLE_ITEMS_QUERY, 'exactOnlineSampleItems', call, limit === undefined ? {} : { limit });
|
|
899
|
+
},
|
|
900
|
+
},
|
|
901
|
+
structure: {
|
|
902
|
+
catalogue(options) {
|
|
903
|
+
const { sample, ...call } = options ?? {};
|
|
904
|
+
return read(EXACT_ONLINE_CATALOGUE_STRUCTURE_QUERY, 'exactOnlineCatalogueStructure', call, sample === undefined ? {} : { sample });
|
|
905
|
+
},
|
|
906
|
+
customers(options) {
|
|
907
|
+
const { sample, ...call } = options ?? {};
|
|
908
|
+
return read(EXACT_ONLINE_CUSTOMER_STRUCTURE_QUERY, 'exactOnlineCustomerStructure', call, sample === undefined ? {} : { sample });
|
|
909
|
+
},
|
|
910
|
+
pricing(options) {
|
|
911
|
+
return read(EXACT_ONLINE_PRICING_STRUCTURE_QUERY, 'exactOnlinePricingStructure', options);
|
|
912
|
+
},
|
|
913
|
+
},
|
|
914
|
+
webhooks: {
|
|
915
|
+
status(options) {
|
|
916
|
+
return read(EXACT_ONLINE_WEBHOOK_STATUS_QUERY, 'exactOnlineWebhookStatus', options);
|
|
917
|
+
},
|
|
918
|
+
async sync(options) {
|
|
919
|
+
return ((await read(SYNC_EXACT_ONLINE_WEBHOOKS_MUTATION, 'syncExactOnlineWebhooks', options)) === true);
|
|
920
|
+
},
|
|
921
|
+
},
|
|
922
|
+
async syncEstimate(schedule, options) {
|
|
923
|
+
return read(EXACT_ONLINE_SYNC_ESTIMATE_QUERY, 'exactOnlineSyncEstimate', options, { schedule: requireObject(schedule, 'syncEstimate') });
|
|
924
|
+
},
|
|
925
|
+
sync: {
|
|
926
|
+
async logs(options) {
|
|
927
|
+
const { entity, limit, ...call } = options ?? {};
|
|
928
|
+
return read(EXACT_ONLINE_SYNC_LOGS_QUERY, 'exactOnlineSyncLogs', call, syncLogVariables({ entity, limit }));
|
|
929
|
+
},
|
|
930
|
+
health(options) {
|
|
931
|
+
return read(EXACT_ONLINE_SYNC_HEALTH_QUERY, 'exactOnlineSyncHealth', options);
|
|
932
|
+
},
|
|
933
|
+
async runCatalogue(options) {
|
|
934
|
+
return ((await read(RUN_EXACT_ONLINE_CATALOGUE_SYNC_MUTATION, 'runExactOnlineCatalogueSync', options)) === true);
|
|
935
|
+
},
|
|
936
|
+
async runCustomers(options) {
|
|
937
|
+
return ((await read(RUN_EXACT_ONLINE_CUSTOMER_SYNC_MUTATION, 'runExactOnlineCustomerSync', options)) === true);
|
|
938
|
+
},
|
|
939
|
+
async runPriceLists(options) {
|
|
940
|
+
return ((await read(RUN_EXACT_ONLINE_PRICE_LIST_SYNC_MUTATION, 'runExactOnlinePriceListSync', options)) === true);
|
|
941
|
+
},
|
|
942
|
+
reimportPictures(options) {
|
|
943
|
+
return read(REIMPORT_EXACT_ONLINE_ITEM_PICTURES_MUTATION, 'reimportExactOnlineItemPictures', options);
|
|
944
|
+
},
|
|
945
|
+
cursors(options) {
|
|
946
|
+
return read(EXACT_ONLINE_SYNC_CURSORS_QUERY, 'exactOnlineSyncCursors', options);
|
|
947
|
+
},
|
|
948
|
+
async resetCursor(entity, options) {
|
|
949
|
+
return ((await read(RESET_EXACT_ONLINE_SYNC_CURSOR_MUTATION, 'resetExactOnlineSyncCursor', options, { entity: requireEntity(entity) })) === true);
|
|
950
|
+
},
|
|
951
|
+
},
|
|
952
|
+
warehouseLinks(options) {
|
|
953
|
+
return read(EXACT_ONLINE_WAREHOUSE_LINKS_QUERY, 'exactOnlineWarehouseLinks', options);
|
|
954
|
+
},
|
|
955
|
+
shipping: {
|
|
956
|
+
methods(options) {
|
|
957
|
+
return read(EXACT_ONLINE_SHIPPING_METHODS_QUERY, 'exactOnlineShippingMethods', options);
|
|
958
|
+
},
|
|
959
|
+
async runSync(options) {
|
|
960
|
+
return ((await read(RUN_EXACT_ONLINE_SHIPPING_METHOD_SYNC_MUTATION, 'runExactOnlineShippingMethodSync', options)) === true);
|
|
961
|
+
},
|
|
962
|
+
import(exactShippingMethodId, options) {
|
|
963
|
+
return read(IMPORT_EXACT_ONLINE_SHIPPING_METHOD_MUTATION, 'importExactOnlineShippingMethod', options, { exactShippingMethodId });
|
|
964
|
+
},
|
|
965
|
+
async setMapping(input, options) {
|
|
966
|
+
const { vendureShippingMethodId, exactShippingMethodId } = requireObject(input, 'shipping.setMapping');
|
|
967
|
+
// GraphQL reads a missing argument as null, and the engine trims a blank id to null: a
|
|
968
|
+
// forgotten key or an emptied field would CLEAR the mapping. Only `null` clears.
|
|
969
|
+
if (exactShippingMethodId !== null &&
|
|
970
|
+
(typeof exactShippingMethodId !== 'string' || exactShippingMethodId.trim() === '')) {
|
|
971
|
+
throw invalidInput('shipping.setMapping needs exactShippingMethodId: an Exact method, or null to clear the mapping.', 'exactShippingMethodId');
|
|
972
|
+
}
|
|
973
|
+
return read(SET_EXACT_ONLINE_SHIPPING_METHOD_MAPPING_MUTATION, 'setExactOnlineShippingMethodMapping', options, { vendureShippingMethodId, exactShippingMethodId });
|
|
974
|
+
},
|
|
975
|
+
async convertToMapping(input, options) {
|
|
976
|
+
const { exactShippingMethodId, vendureShippingMethodId } = requireObject(input, 'shipping.convertToMapping');
|
|
977
|
+
return read(CONVERT_EXACT_ONLINE_SHIPPING_METHOD_TO_MAPPING_MUTATION, 'convertExactOnlineShippingMethodToMapping', options, { exactShippingMethodId, vendureShippingMethodId });
|
|
978
|
+
},
|
|
979
|
+
async retireImported(exactShippingMethodId, options) {
|
|
980
|
+
return ((await read(RETIRE_EXACT_ONLINE_IMPORTED_SHIPPING_METHOD_MUTATION, 'retireExactOnlineImportedShippingMethod', options, { exactShippingMethodId })) === true);
|
|
981
|
+
},
|
|
982
|
+
},
|
|
983
|
+
terms: {
|
|
984
|
+
paymentConditions(options) {
|
|
985
|
+
return read(EXACT_ONLINE_PAYMENT_CONDITIONS_QUERY, 'exactOnlinePaymentConditions', options);
|
|
986
|
+
},
|
|
987
|
+
paymentDiagnostics(options) {
|
|
988
|
+
return read(EXACT_ONLINE_PAYMENT_TERMS_DIAGNOSTICS_QUERY, 'exactOnlinePaymentTermsDiagnostics', options);
|
|
989
|
+
},
|
|
990
|
+
paymentDryRun(options) {
|
|
991
|
+
return read(EXACT_ONLINE_PAYMENT_TERMS_DRY_RUN_QUERY, 'exactOnlinePaymentTermsDryRun', options);
|
|
992
|
+
},
|
|
993
|
+
incoterms(options) {
|
|
994
|
+
return read(EXACT_ONLINE_INCOTERMS_QUERY, 'exactOnlineIncoterms', options);
|
|
995
|
+
},
|
|
996
|
+
deliveryDiagnostics(options) {
|
|
997
|
+
return read(EXACT_ONLINE_DELIVERY_TERMS_DIAGNOSTICS_QUERY, 'exactOnlineDeliveryTermsDiagnostics', options);
|
|
998
|
+
},
|
|
999
|
+
deliveryDryRun(options) {
|
|
1000
|
+
return read(EXACT_ONLINE_DELIVERY_TERMS_DRY_RUN_QUERY, 'exactOnlineDeliveryTermsDryRun', options);
|
|
1001
|
+
},
|
|
1002
|
+
},
|
|
1003
|
+
customers: {
|
|
1004
|
+
async paymentTerms(customerId, options) {
|
|
1005
|
+
return ((await read(EXACT_ONLINE_CUSTOMER_PAYMENT_TERMS_QUERY, 'exactOnlineCustomerPaymentTerms', options, { customerId: requireId(customerId, 'customerId', 'customers.paymentTerms') })) ?? null);
|
|
1006
|
+
},
|
|
1007
|
+
async deliveryTerms(customerId, options) {
|
|
1008
|
+
return ((await read(EXACT_ONLINE_CUSTOMER_DELIVERY_TERMS_QUERY, 'exactOnlineCustomerDeliveryTerms', options, { customerId: requireId(customerId, 'customerId', 'customers.deliveryTerms') })) ?? null);
|
|
1009
|
+
},
|
|
1010
|
+
async priceList(customerId, options) {
|
|
1011
|
+
return read(EXACT_ONLINE_CUSTOMER_PRICE_LIST_QUERY, 'exactOnlineCustomerPriceList', options, { customerId: requireId(customerId, 'customerId', 'customers.priceList') });
|
|
1012
|
+
},
|
|
1013
|
+
},
|
|
1014
|
+
orders: {
|
|
1015
|
+
async state(orderId, options) {
|
|
1016
|
+
const variables = { orderId: requireId(orderId, 'orderId', 'orders.state') };
|
|
1017
|
+
try {
|
|
1018
|
+
return await read(EXACT_ONLINE_ORDER_STATE_QUERY, 'exactOnlineOrderState', options, variables);
|
|
1019
|
+
}
|
|
1020
|
+
catch (error) {
|
|
1021
|
+
if (!isUnknownFieldRejection(error))
|
|
1022
|
+
throw error;
|
|
1023
|
+
const state = await read(EXACT_ONLINE_ORDER_STATE_LEGACY_QUERY, 'exactOnlineOrderState', options, variables);
|
|
1024
|
+
return { ...state, warnings: [] };
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
async syncState(orderId, options) {
|
|
1028
|
+
return ((await read(EXACT_ONLINE_ORDER_SYNC_STATE_QUERY, 'exactOnlineOrderSyncState', options, { orderId: requireId(orderId, 'orderId', 'orders.syncState') })) ?? null);
|
|
1029
|
+
},
|
|
1030
|
+
async push(orderId, options) {
|
|
1031
|
+
const variables = { orderId: requireId(orderId, 'orderId', 'orders.push') };
|
|
1032
|
+
try {
|
|
1033
|
+
return await read(PUSH_ORDER_TO_EXACT_ONLINE_MUTATION, 'pushOrderToExactOnline', options, variables);
|
|
1034
|
+
}
|
|
1035
|
+
catch (error) {
|
|
1036
|
+
// Only a document the engine refused before running it is sent again (see the legacy
|
|
1037
|
+
// mutation's comment): any other failure may have reached Exact and is thrown as is.
|
|
1038
|
+
if (!isUnknownFieldRejection(error))
|
|
1039
|
+
throw error;
|
|
1040
|
+
const result = await read(PUSH_ORDER_TO_EXACT_ONLINE_LEGACY_MUTATION, 'pushOrderToExactOnline', options, variables);
|
|
1041
|
+
return { ...result, warnings: null };
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
async reprice(orderId, options) {
|
|
1045
|
+
return read(REPRICE_EXACT_ONLINE_ORDER_MUTATION, 'repriceExactOnlineOrder', options, { orderId: requireId(orderId, 'orderId', 'orders.reprice') });
|
|
1046
|
+
},
|
|
1047
|
+
repriceAll(options) {
|
|
1048
|
+
return read(REPRICE_ALL_EXACT_ONLINE_IMPORTED_ORDERS_MUTATION, 'repriceAllExactOnlineImportedOrders', options);
|
|
1049
|
+
},
|
|
1050
|
+
async runSync(options) {
|
|
1051
|
+
return ((await read(RUN_EXACT_ONLINE_ORDER_SYNC_MUTATION, 'runExactOnlineOrderSync', options)) === true);
|
|
1052
|
+
},
|
|
1053
|
+
async runBackfill(options) {
|
|
1054
|
+
return ((await read(RUN_EXACT_ONLINE_ORDER_BACKFILL_MUTATION, 'runExactOnlineOrderBackfill', options)) === true);
|
|
1055
|
+
},
|
|
1056
|
+
},
|
|
1057
|
+
products: {
|
|
1058
|
+
async status(productId, options) {
|
|
1059
|
+
const product = await read(EXACT_PRODUCT_STATUS_QUERY, 'product', options, { id: requireId(productId, 'productId', 'products.status') });
|
|
1060
|
+
if (!product)
|
|
1061
|
+
return null;
|
|
1062
|
+
const fields = product.customFields;
|
|
1063
|
+
return {
|
|
1064
|
+
exactManaged: fields?.exactManaged ?? null,
|
|
1065
|
+
exactItemId: fields?.exactItemId ?? null,
|
|
1066
|
+
exactItemGroupId: fields?.exactItemGroupId ?? null,
|
|
1067
|
+
exactDisabledReason: fields?.exactDisabledReason ?? null,
|
|
1068
|
+
};
|
|
1069
|
+
},
|
|
1070
|
+
},
|
|
1071
|
+
connectionLogs: {
|
|
1072
|
+
calls: connectionLogCalls,
|
|
1073
|
+
events: connectionLogEvents,
|
|
1074
|
+
async export(kind, filter, options) {
|
|
1075
|
+
if (!CONNECTION_LOG_KINDS.includes(kind)) {
|
|
1076
|
+
throw invalidInput('kind must be "calls" or "events".', 'kind');
|
|
1077
|
+
}
|
|
1078
|
+
// A CSV body, never JSON: `blob` keeps the transport from parsing or case-converting it.
|
|
1079
|
+
const answer = await transport.rest('plugins', {
|
|
1080
|
+
method: 'GET',
|
|
1081
|
+
path: `${CONNECTION_LOGS}/${kind}/export`,
|
|
1082
|
+
query: connectionLogQuery(requireObject(filter, 'connectionLogs.export')),
|
|
1083
|
+
expect: 'blob',
|
|
1084
|
+
}, { timeoutMs: EXACT_ONLINE_LOG_EXPORT_TIMEOUT_MS, ...options });
|
|
1085
|
+
return answer.blob.text();
|
|
1086
|
+
},
|
|
1087
|
+
},
|
|
1088
|
+
};
|
|
1089
|
+
}
|