@endora-commerce/contracts 0.109.0 → 0.111.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/dist/accept-language.d.ts +31 -0
- package/dist/accept-language.js +64 -0
- package/dist/actor.d.ts +16 -0
- package/dist/addresses.d.ts +35 -0
- package/dist/addresses.js +8 -1
- package/dist/admin-actions.d.ts +2 -0
- package/dist/admin-actions.js +18 -0
- package/dist/admin-contributions.d.ts +99 -12
- package/dist/admin-contributions.js +36 -10
- package/dist/admin-roles.d.ts +17 -2
- package/dist/admin-users.d.ts +9 -0
- package/dist/admin.d.ts +114 -4
- package/dist/admin.js +98 -3
- package/dist/api-keys.d.ts +22 -0
- package/dist/api-keys.js +4 -0
- package/dist/assets-library.d.ts +45 -0
- package/dist/assets-library.js +20 -3
- package/dist/audit-logs.d.ts +12 -0
- package/dist/audit-logs.js +12 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.js +9 -0
- package/dist/blog.d.ts +382 -22
- package/dist/blog.js +199 -17
- package/dist/carts.d.ts +423 -36
- package/dist/carts.js +150 -12
- package/dist/catalog.d.ts +379 -208
- package/dist/catalog.js +241 -163
- package/dist/cms-brand.d.ts +14 -14
- package/dist/cms.d.ts +71 -16
- package/dist/cms.js +15 -0
- package/dist/command-hooks.d.ts +301 -0
- package/dist/command-hooks.js +248 -0
- package/dist/common.d.ts +23 -6
- package/dist/common.js +25 -2
- package/dist/comparisons.d.ts +21 -14
- package/dist/comparisons.js +2 -1
- package/dist/credit-limits.d.ts +22 -0
- package/dist/credit-limits.js +35 -0
- package/dist/crm.d.ts +134 -78
- package/dist/crm.js +21 -5
- package/dist/custom-fields.d.ts +417 -49
- package/dist/custom-fields.js +142 -1
- package/dist/customer-accounts.d.ts +324 -22
- package/dist/customer-accounts.js +43 -0
- package/dist/customer-notifications.d.ts +143 -0
- package/dist/customer-notifications.js +41 -0
- package/dist/customers.d.ts +92 -73
- package/dist/customers.js +98 -10
- package/dist/dictionary.d.ts +53 -0
- package/dist/dictionary.js +25 -0
- package/dist/document-templates.d.ts +12 -12
- package/dist/email.d.ts +34 -0
- package/dist/email.js +6 -0
- package/dist/errors.d.ts +431 -3
- package/dist/errors.js +523 -3
- package/dist/forms-logic.d.ts +79 -0
- package/dist/forms-logic.fixtures.d.ts +52 -0
- package/dist/forms-logic.fixtures.js +610 -0
- package/dist/forms-logic.js +699 -0
- package/dist/forms.d.ts +9833 -0
- package/dist/forms.js +827 -0
- package/dist/i18n.d.ts +34 -0
- package/dist/i18n.js +15 -0
- package/dist/import-export.d.ts +180 -0
- package/dist/import-export.js +60 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +30 -1
- package/dist/inventory.d.ts +9 -9
- package/dist/invoice-ledger.d.ts +13 -13
- package/dist/invoices.d.ts +126 -0
- package/dist/invoices.js +53 -0
- package/dist/line-bounds.d.ts +53 -0
- package/dist/line-bounds.js +65 -0
- package/dist/megamenu.d.ts +27 -27
- package/dist/mfa.d.ts +210 -4
- package/dist/mfa.js +136 -0
- package/dist/modules.d.ts +56 -8
- package/dist/modules.js +128 -3
- package/dist/money-decimal.d.ts +54 -0
- package/dist/money-decimal.js +95 -0
- package/dist/newsletter.d.ts +4 -4
- package/dist/orders.d.ts +246 -12
- package/dist/orders.js +140 -7
- package/dist/organization-hooks.d.ts +99 -0
- package/dist/organization-hooks.js +22 -0
- package/dist/organization-registry-lookup.d.ts +362 -0
- package/dist/organization-registry-lookup.js +196 -0
- package/dist/organization-roles.d.ts +341 -0
- package/dist/organization-roles.js +218 -0
- package/dist/organizations.d.ts +1074 -103
- package/dist/organizations.js +293 -28
- package/dist/page-builder-props.d.ts +56 -56
- package/dist/pim-connector.d.ts +7 -3
- package/dist/pim-connector.js +6 -2
- package/dist/pim-field-path.d.ts +5 -1
- package/dist/pim-field-path.js +37 -81
- package/dist/pim-locale-mapping.d.ts +131 -0
- package/dist/pim-locale-mapping.js +193 -0
- package/dist/price-books.d.ts +215 -63
- package/dist/price-books.js +47 -2
- package/dist/price-lists.d.ts +13 -10
- package/dist/product-feeds.d.ts +249 -100
- package/dist/product-feeds.js +46 -2
- package/dist/product-scope-model.d.ts +161 -0
- package/dist/product-scope-model.js +161 -0
- package/dist/product-scope-overrides.d.ts +0 -103
- package/dist/product-scope-overrides.js +0 -54
- package/dist/product-scoped-values.d.ts +2610 -0
- package/dist/product-scoped-values.js +425 -0
- package/dist/product-scopes.d.ts +199 -64
- package/dist/product-scopes.js +120 -23
- package/dist/product-tax-rates.d.ts +38 -0
- package/dist/product-tax-rates.js +45 -0
- package/dist/product-url-keys.d.ts +51 -45
- package/dist/product-url-keys.js +73 -39
- package/dist/product-value-resolver.d.ts +37 -60
- package/dist/product-value-resolver.js +36 -96
- package/dist/projects.d.ts +76 -28
- package/dist/projects.js +53 -9
- package/dist/promotions.d.ts +163 -11
- package/dist/promotions.js +23 -1
- package/dist/pwa.d.ts +41 -2
- package/dist/quick-order.d.ts +159 -9
- package/dist/quick-order.js +79 -4
- package/dist/quote-requests.d.ts +231 -17
- package/dist/quote-requests.js +111 -9
- package/dist/record-references.d.ts +15 -15
- package/dist/record-references.js +2 -3
- package/dist/record-rich-text.js +2 -1
- package/dist/returns.d.ts +214 -52
- package/dist/returns.js +143 -28
- package/dist/sales-channels.d.ts +34 -3
- package/dist/sales-channels.js +16 -1
- package/dist/saved-list-views.d.ts +28 -0
- package/dist/saved-list-views.js +14 -1
- package/dist/schema-extensions.d.ts +36 -0
- package/dist/schema-extensions.js +29 -0
- package/dist/scoped-write-encoding.d.ts +100 -0
- package/dist/scoped-write-encoding.js +135 -0
- package/dist/search.d.ts +18 -16
- package/dist/seo.d.ts +83 -30
- package/dist/seo.js +8 -1
- package/dist/settings.d.ts +173 -2
- package/dist/settings.js +53 -2
- package/dist/shopping-lists.d.ts +63 -4
- package/dist/shopping-lists.js +57 -3
- package/dist/storefront-cache-tags.d.ts +22 -0
- package/dist/storefront-cache-tags.js +12 -0
- package/dist/storefront-value-overrides.d.ts +18 -56
- package/dist/storefront-value-overrides.js +11 -86
- package/dist/tasks.d.ts +27 -27
- package/dist/taxes.d.ts +27 -0
- package/dist/taxes.js +4 -0
- package/dist/transactional-emails.d.ts +48 -22
- package/dist/webhooks.d.ts +75 -0
- package/dist/webhooks.js +24 -0
- package/package.json +5 -3
- package/dist/actor.d.ts.map +0 -1
- package/dist/actor.js.map +0 -1
- package/dist/addresses.d.ts.map +0 -1
- package/dist/addresses.js.map +0 -1
- package/dist/admin-actions.d.ts.map +0 -1
- package/dist/admin-actions.js.map +0 -1
- package/dist/admin-contributions.d.ts.map +0 -1
- package/dist/admin-contributions.js.map +0 -1
- package/dist/admin-feedback.d.ts.map +0 -1
- package/dist/admin-feedback.js.map +0 -1
- package/dist/admin-i18n.d.ts.map +0 -1
- package/dist/admin-i18n.js.map +0 -1
- package/dist/admin-name.d.ts.map +0 -1
- package/dist/admin-name.js.map +0 -1
- package/dist/admin-notifications.d.ts.map +0 -1
- package/dist/admin-notifications.js.map +0 -1
- package/dist/admin-preferences.d.ts.map +0 -1
- package/dist/admin-preferences.js.map +0 -1
- package/dist/admin-roles.d.ts.map +0 -1
- package/dist/admin-roles.js.map +0 -1
- package/dist/admin-search.d.ts.map +0 -1
- package/dist/admin-search.js.map +0 -1
- package/dist/admin-users.d.ts.map +0 -1
- package/dist/admin-users.js.map +0 -1
- package/dist/admin.d.ts.map +0 -1
- package/dist/admin.js.map +0 -1
- package/dist/analytics.d.ts.map +0 -1
- package/dist/analytics.js.map +0 -1
- package/dist/api-keys.d.ts.map +0 -1
- package/dist/api-keys.js.map +0 -1
- package/dist/assets-library.d.ts.map +0 -1
- package/dist/assets-library.js.map +0 -1
- package/dist/audit-logs.d.ts.map +0 -1
- package/dist/audit-logs.js.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/blog.d.ts.map +0 -1
- package/dist/blog.js.map +0 -1
- package/dist/capabilities.d.ts.map +0 -1
- package/dist/capabilities.js.map +0 -1
- package/dist/carts.d.ts.map +0 -1
- package/dist/carts.js.map +0 -1
- package/dist/catalog.d.ts.map +0 -1
- package/dist/catalog.js.map +0 -1
- package/dist/cms-brand.d.ts.map +0 -1
- package/dist/cms-brand.js.map +0 -1
- package/dist/cms-contact-form.d.ts.map +0 -1
- package/dist/cms-contact-form.js.map +0 -1
- package/dist/cms.d.ts.map +0 -1
- package/dist/cms.js.map +0 -1
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js.map +0 -1
- package/dist/comparisons.d.ts.map +0 -1
- package/dist/comparisons.js.map +0 -1
- package/dist/credentials.d.ts.map +0 -1
- package/dist/credentials.js.map +0 -1
- package/dist/credit-limits.d.ts.map +0 -1
- package/dist/credit-limits.js.map +0 -1
- package/dist/crm-rich-text.d.ts.map +0 -1
- package/dist/crm-rich-text.js.map +0 -1
- package/dist/crm.d.ts.map +0 -1
- package/dist/crm.js.map +0 -1
- package/dist/currencies.d.ts.map +0 -1
- package/dist/currencies.js.map +0 -1
- package/dist/custom-fields.d.ts.map +0 -1
- package/dist/custom-fields.js.map +0 -1
- package/dist/customer-accounts.d.ts.map +0 -1
- package/dist/customer-accounts.js.map +0 -1
- package/dist/customers.d.ts.map +0 -1
- package/dist/customers.js.map +0 -1
- package/dist/dictionary.d.ts.map +0 -1
- package/dist/dictionary.js.map +0 -1
- package/dist/document-templates.d.ts.map +0 -1
- package/dist/document-templates.js.map +0 -1
- package/dist/document-values.d.ts.map +0 -1
- package/dist/document-values.js.map +0 -1
- package/dist/email-address.d.ts.map +0 -1
- package/dist/email-address.js.map +0 -1
- package/dist/email.d.ts.map +0 -1
- package/dist/email.js.map +0 -1
- package/dist/envelopes.d.ts.map +0 -1
- package/dist/envelopes.js.map +0 -1
- package/dist/environment-inputs.d.ts.map +0 -1
- package/dist/environment-inputs.js.map +0 -1
- package/dist/erp-connector.d.ts.map +0 -1
- package/dist/erp-connector.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/google-analytics.d.ts.map +0 -1
- package/dist/google-analytics.js.map +0 -1
- package/dist/google-tag-manager.d.ts.map +0 -1
- package/dist/google-tag-manager.js.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.js.map +0 -1
- package/dist/import-export.d.ts.map +0 -1
- package/dist/import-export.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inventory.d.ts.map +0 -1
- package/dist/inventory.js.map +0 -1
- package/dist/invoice-ledger.d.ts.map +0 -1
- package/dist/invoice-ledger.js.map +0 -1
- package/dist/invoices.d.ts.map +0 -1
- package/dist/invoices.js.map +0 -1
- package/dist/kernel.d.ts.map +0 -1
- package/dist/kernel.js.map +0 -1
- package/dist/languages.d.ts.map +0 -1
- package/dist/languages.js.map +0 -1
- package/dist/line-groups.d.ts.map +0 -1
- package/dist/line-groups.js.map +0 -1
- package/dist/linkedin-ads.d.ts.map +0 -1
- package/dist/linkedin-ads.js.map +0 -1
- package/dist/localized-name.d.ts.map +0 -1
- package/dist/localized-name.js.map +0 -1
- package/dist/megamenu.d.ts.map +0 -1
- package/dist/megamenu.js.map +0 -1
- package/dist/meta-ads.d.ts.map +0 -1
- package/dist/meta-ads.js.map +0 -1
- package/dist/mfa.d.ts.map +0 -1
- package/dist/mfa.js.map +0 -1
- package/dist/modules.d.ts.map +0 -1
- package/dist/modules.js.map +0 -1
- package/dist/money-decimal.d.ts.map +0 -1
- package/dist/money-decimal.js.map +0 -1
- package/dist/money-input.d.ts.map +0 -1
- package/dist/money-input.js.map +0 -1
- package/dist/newsletter.d.ts.map +0 -1
- package/dist/newsletter.js.map +0 -1
- package/dist/order-minimums.d.ts.map +0 -1
- package/dist/order-minimums.js.map +0 -1
- package/dist/orders.d.ts.map +0 -1
- package/dist/orders.js.map +0 -1
- package/dist/organizations.d.ts.map +0 -1
- package/dist/organizations.js.map +0 -1
- package/dist/page-builder-props.d.ts.map +0 -1
- package/dist/page-builder-props.js.map +0 -1
- package/dist/page-builder-values.d.ts.map +0 -1
- package/dist/page-builder-values.js.map +0 -1
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js.map +0 -1
- package/dist/payment-methods.d.ts.map +0 -1
- package/dist/payment-methods.js.map +0 -1
- package/dist/payment-return-url.d.ts.map +0 -1
- package/dist/payment-return-url.js.map +0 -1
- package/dist/payments.d.ts.map +0 -1
- package/dist/payments.js.map +0 -1
- package/dist/pim-connector.d.ts.map +0 -1
- package/dist/pim-connector.js.map +0 -1
- package/dist/pim-field-path.d.ts.map +0 -1
- package/dist/pim-field-path.js.map +0 -1
- package/dist/platform-info.d.ts.map +0 -1
- package/dist/platform-info.js.map +0 -1
- package/dist/platform-language.d.ts.map +0 -1
- package/dist/platform-language.js.map +0 -1
- package/dist/price-book-decimal.d.ts.map +0 -1
- package/dist/price-book-decimal.js.map +0 -1
- package/dist/price-books.d.ts.map +0 -1
- package/dist/price-books.js.map +0 -1
- package/dist/price-lists.d.ts.map +0 -1
- package/dist/price-lists.js.map +0 -1
- package/dist/product-feeds.d.ts.map +0 -1
- package/dist/product-feeds.js.map +0 -1
- package/dist/product-scope-overrides.d.ts.map +0 -1
- package/dist/product-scope-overrides.js.map +0 -1
- package/dist/product-scopes.d.ts.map +0 -1
- package/dist/product-scopes.js.map +0 -1
- package/dist/product-summary-text.d.ts.map +0 -1
- package/dist/product-summary-text.js.map +0 -1
- package/dist/product-url-keys.d.ts.map +0 -1
- package/dist/product-url-keys.js.map +0 -1
- package/dist/product-value-resolver.d.ts.map +0 -1
- package/dist/product-value-resolver.js.map +0 -1
- package/dist/projects.d.ts.map +0 -1
- package/dist/projects.js.map +0 -1
- package/dist/promotions.d.ts.map +0 -1
- package/dist/promotions.js.map +0 -1
- package/dist/prompt-actions.d.ts.map +0 -1
- package/dist/prompt-actions.js.map +0 -1
- package/dist/pwa.d.ts.map +0 -1
- package/dist/pwa.js.map +0 -1
- package/dist/quick-order.d.ts.map +0 -1
- package/dist/quick-order.js.map +0 -1
- package/dist/quote-requests.d.ts.map +0 -1
- package/dist/quote-requests.js.map +0 -1
- package/dist/record-references.d.ts.map +0 -1
- package/dist/record-references.js.map +0 -1
- package/dist/record-rich-text.d.ts.map +0 -1
- package/dist/record-rich-text.js.map +0 -1
- package/dist/returns.d.ts.map +0 -1
- package/dist/returns.js.map +0 -1
- package/dist/sales-channels.d.ts.map +0 -1
- package/dist/sales-channels.js.map +0 -1
- package/dist/saved-list-views.d.ts.map +0 -1
- package/dist/saved-list-views.js.map +0 -1
- package/dist/scope-notice.d.ts.map +0 -1
- package/dist/scope-notice.js.map +0 -1
- package/dist/scoped-translations.d.ts +0 -48
- package/dist/scoped-translations.d.ts.map +0 -1
- package/dist/scoped-translations.js +0 -78
- package/dist/scoped-translations.js.map +0 -1
- package/dist/search.d.ts.map +0 -1
- package/dist/search.js.map +0 -1
- package/dist/seo.d.ts.map +0 -1
- package/dist/seo.js.map +0 -1
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js.map +0 -1
- package/dist/shipments.d.ts.map +0 -1
- package/dist/shipments.js.map +0 -1
- package/dist/shipping-methods.d.ts.map +0 -1
- package/dist/shipping-methods.js.map +0 -1
- package/dist/shopping-lists.d.ts.map +0 -1
- package/dist/shopping-lists.js.map +0 -1
- package/dist/storefront-cache-tags.d.ts.map +0 -1
- package/dist/storefront-cache-tags.js.map +0 -1
- package/dist/storefront-language-path.d.ts.map +0 -1
- package/dist/storefront-language-path.js.map +0 -1
- package/dist/storefront-value-overrides.d.ts.map +0 -1
- package/dist/storefront-value-overrides.js.map +0 -1
- package/dist/tasks.d.ts.map +0 -1
- package/dist/tasks.js.map +0 -1
- package/dist/taxes.d.ts.map +0 -1
- package/dist/taxes.js.map +0 -1
- package/dist/text-normalization.d.ts.map +0 -1
- package/dist/text-normalization.js.map +0 -1
- package/dist/transactional-emails.d.ts.map +0 -1
- package/dist/transactional-emails.js.map +0 -1
- package/dist/webhooks.d.ts.map +0 -1
- package/dist/webhooks.js.map +0 -1
package/dist/quick-order.d.ts
CHANGED
|
@@ -27,9 +27,9 @@ export declare const quickOrderUploadFileSchema: z.ZodObject<{
|
|
|
27
27
|
}, z.core.$strip>;
|
|
28
28
|
export type QuickOrderUploadFile = z.infer<typeof quickOrderUploadFileSchema>;
|
|
29
29
|
export declare const quickOrderRejectionReasonSchema: z.ZodEnum<{
|
|
30
|
-
below_minimum: "below_minimum";
|
|
31
30
|
product_not_found: "product_not_found";
|
|
32
31
|
malformed_row: "malformed_row";
|
|
32
|
+
below_minimum: "below_minimum";
|
|
33
33
|
product_archived: "product_archived";
|
|
34
34
|
sku_missing: "sku_missing";
|
|
35
35
|
quantity_invalid: "quantity_invalid";
|
|
@@ -73,9 +73,9 @@ export declare const rejectedQuickOrderItemSchema: z.ZodObject<{
|
|
|
73
73
|
line: z.ZodNumber;
|
|
74
74
|
raw: z.ZodString;
|
|
75
75
|
reason: z.ZodEnum<{
|
|
76
|
-
below_minimum: "below_minimum";
|
|
77
76
|
product_not_found: "product_not_found";
|
|
78
77
|
malformed_row: "malformed_row";
|
|
78
|
+
below_minimum: "below_minimum";
|
|
79
79
|
product_archived: "product_archived";
|
|
80
80
|
sku_missing: "sku_missing";
|
|
81
81
|
quantity_invalid: "quantity_invalid";
|
|
@@ -114,9 +114,9 @@ export declare const quickOrderImportResponseSchema: z.ZodObject<{
|
|
|
114
114
|
line: z.ZodNumber;
|
|
115
115
|
raw: z.ZodString;
|
|
116
116
|
reason: z.ZodEnum<{
|
|
117
|
-
below_minimum: "below_minimum";
|
|
118
117
|
product_not_found: "product_not_found";
|
|
119
118
|
malformed_row: "malformed_row";
|
|
119
|
+
below_minimum: "below_minimum";
|
|
120
120
|
product_archived: "product_archived";
|
|
121
121
|
sku_missing: "sku_missing";
|
|
122
122
|
quantity_invalid: "quantity_invalid";
|
|
@@ -136,6 +136,134 @@ export declare const quickOrderImportResponseSchema: z.ZodObject<{
|
|
|
136
136
|
}, z.core.$strip>;
|
|
137
137
|
}, z.core.$strip>;
|
|
138
138
|
export type QuickOrderImportResponse = z.infer<typeof quickOrderImportResponseSchema>;
|
|
139
|
+
/**
|
|
140
|
+
* Issue #809 — the hard maximum of a preview's line cap: the ceiling `quick_order.import_max_rows`
|
|
141
|
+
* is clamped to. The cap itself is that setting's effective value, read when the preview is
|
|
142
|
+
* written (PO ruling of 2026-11-08 on PR #942), and it counts the rows the import read —
|
|
143
|
+
* recognised and rejected — never the rows past its limit, which the preview keeps as one
|
|
144
|
+
* `summary.overflowCount`. So an import never exceeds it; it bounds what adding from search can
|
|
145
|
+
* grow, and a write that adds no line is accepted even above a cap lowered since. Enforced by
|
|
146
|
+
* `PUT /api/v1/quick-order/preview` as `422 VALIDATION_FAILED`,
|
|
147
|
+
* `details: { code: 'too_many_lines', maximum }` (`maximum` = the setting), deliberately not by a
|
|
148
|
+
* schema `.max()`, which would answer 400 — the same shape as {@link QUICK_ORDER_BUILD_MAX_ITEMS}.
|
|
149
|
+
*/
|
|
150
|
+
export declare const QUICK_ORDER_PREVIEW_MAX_LINES = 10000;
|
|
151
|
+
/**
|
|
152
|
+
* The largest preview body `PUT /api/v1/quick-order/preview` reads, in bytes; a larger one is
|
|
153
|
+
* refused `413 VALIDATION_FAILED` before it is parsed. A rejected line's raw CSV text is not
|
|
154
|
+
* bounded by the line cap, so the line cap alone does not bound what one buyer may store.
|
|
155
|
+
*/
|
|
156
|
+
export declare const QUICK_ORDER_PREVIEW_MAX_BYTES: number;
|
|
157
|
+
/**
|
|
158
|
+
* How long a preview is kept after it was last written, in seconds. A write (`PUT`) starts the
|
|
159
|
+
* window again; a read does not, so a page left open does not keep the buyer's file alive.
|
|
160
|
+
*/
|
|
161
|
+
export declare const QUICK_ORDER_PREVIEW_TTL_SECONDS: number;
|
|
162
|
+
/**
|
|
163
|
+
* After a partial cart build (feature 155, FR-011 (b)): why the cart did not take a line, with
|
|
164
|
+
* the build's product and unit names. The storefront writes it; nothing else reads it.
|
|
165
|
+
*/
|
|
166
|
+
export declare const quickOrderPreviewNotAddedSchema: z.ZodObject<{
|
|
167
|
+
kind: z.ZodEnum<{
|
|
168
|
+
pieces: "pieces";
|
|
169
|
+
packaging_unit: "packaging_unit";
|
|
170
|
+
}>;
|
|
171
|
+
minimum: z.ZodNumber;
|
|
172
|
+
productName: z.ZodString;
|
|
173
|
+
packagingUnitName: z.ZodOptional<z.ZodString>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
export type QuickOrderPreviewNotAdded = z.infer<typeof quickOrderPreviewNotAddedSchema>;
|
|
176
|
+
export declare const quickOrderPreviewRecognizedItemSchema: z.ZodObject<{
|
|
177
|
+
productId: z.ZodString;
|
|
178
|
+
variantId: z.ZodNullable<z.ZodString>;
|
|
179
|
+
sku: z.ZodString;
|
|
180
|
+
quantity: z.ZodNumber;
|
|
181
|
+
line: z.ZodNumber;
|
|
182
|
+
resolvedVariantSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
mergedFromLines: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
184
|
+
notAdded: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
kind: z.ZodEnum<{
|
|
186
|
+
pieces: "pieces";
|
|
187
|
+
packaging_unit: "packaging_unit";
|
|
188
|
+
}>;
|
|
189
|
+
minimum: z.ZodNumber;
|
|
190
|
+
productName: z.ZodString;
|
|
191
|
+
packagingUnitName: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
export type QuickOrderPreviewRecognizedItem = z.infer<typeof quickOrderPreviewRecognizedItemSchema>;
|
|
195
|
+
/**
|
|
196
|
+
* Issue #809 — the buyer's quick-order preview, as `quick_order` keeps it: one per buyer session,
|
|
197
|
+
* scoped to the buyer's Organization, for {@link QUICK_ORDER_PREVIEW_TTL_SECONDS}. It is the
|
|
198
|
+
* import's response (`quickOrderImportResponseSchema`) as the buyer has since edited it.
|
|
199
|
+
*
|
|
200
|
+
* `GET /api/v1/quick-order/preview` answers `{ data: QuickOrderPreview | null }` (`null`: none,
|
|
201
|
+
* or expired), `PUT` replaces it and answers `{ data: QuickOrderPreview }`, `DELETE` drops it and
|
|
202
|
+
* answers 204. All three need a signed-in buyer, and the session that wrote a preview is the only
|
|
203
|
+
* one that reads it; no preview id travels anywhere.
|
|
204
|
+
*/
|
|
205
|
+
/**
|
|
206
|
+
* The import's summary, plus what the preview keeps of the rows past the import's limit: how many
|
|
207
|
+
* there were (`overflowCount`) and the limit they were past (`rowLimit`, stamped by the backend
|
|
208
|
+
* when it is absent). The rows themselves are not kept.
|
|
209
|
+
*/
|
|
210
|
+
export declare const quickOrderPreviewSummarySchema: z.ZodObject<{
|
|
211
|
+
recognizedCount: z.ZodNumber;
|
|
212
|
+
rejectedCount: z.ZodNumber;
|
|
213
|
+
mergedCount: z.ZodNumber;
|
|
214
|
+
truncated: z.ZodBoolean;
|
|
215
|
+
warningCount: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
overflowCount: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
rowLimit: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
export type QuickOrderPreviewSummary = z.infer<typeof quickOrderPreviewSummarySchema>;
|
|
220
|
+
export declare const quickOrderPreviewSchema: z.ZodObject<{
|
|
221
|
+
recognized: z.ZodArray<z.ZodObject<{
|
|
222
|
+
productId: z.ZodString;
|
|
223
|
+
variantId: z.ZodNullable<z.ZodString>;
|
|
224
|
+
sku: z.ZodString;
|
|
225
|
+
quantity: z.ZodNumber;
|
|
226
|
+
line: z.ZodNumber;
|
|
227
|
+
resolvedVariantSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
mergedFromLines: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
229
|
+
notAdded: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
kind: z.ZodEnum<{
|
|
231
|
+
pieces: "pieces";
|
|
232
|
+
packaging_unit: "packaging_unit";
|
|
233
|
+
}>;
|
|
234
|
+
minimum: z.ZodNumber;
|
|
235
|
+
productName: z.ZodString;
|
|
236
|
+
packagingUnitName: z.ZodOptional<z.ZodString>;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
}, z.core.$strip>>;
|
|
239
|
+
rejected: z.ZodArray<z.ZodObject<{
|
|
240
|
+
line: z.ZodNumber;
|
|
241
|
+
raw: z.ZodString;
|
|
242
|
+
reason: z.ZodEnum<{
|
|
243
|
+
product_not_found: "product_not_found";
|
|
244
|
+
malformed_row: "malformed_row";
|
|
245
|
+
below_minimum: "below_minimum";
|
|
246
|
+
product_archived: "product_archived";
|
|
247
|
+
sku_missing: "sku_missing";
|
|
248
|
+
quantity_invalid: "quantity_invalid";
|
|
249
|
+
variant_not_resolved: "variant_not_resolved";
|
|
250
|
+
variant_ambiguous: "variant_ambiguous";
|
|
251
|
+
row_limit_exceeded: "row_limit_exceeded";
|
|
252
|
+
}>;
|
|
253
|
+
minimum: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
productTotal: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
summary: z.ZodObject<{
|
|
257
|
+
recognizedCount: z.ZodNumber;
|
|
258
|
+
rejectedCount: z.ZodNumber;
|
|
259
|
+
mergedCount: z.ZodNumber;
|
|
260
|
+
truncated: z.ZodBoolean;
|
|
261
|
+
warningCount: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
overflowCount: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
rowLimit: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
}, z.core.$strip>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
export type QuickOrderPreview = z.infer<typeof quickOrderPreviewSchema>;
|
|
139
267
|
export declare const quickOrderTargetSchema: z.ZodEnum<{
|
|
140
268
|
quote_request: "quote_request";
|
|
141
269
|
cart: "cart";
|
|
@@ -282,9 +410,18 @@ export declare const quickOrderResolvedDefaultsSchema: z.ZodObject<{
|
|
|
282
410
|
}, z.core.$strip>;
|
|
283
411
|
}, z.core.$strip>;
|
|
284
412
|
export type QuickOrderResolvedDefaults = z.infer<typeof quickOrderResolvedDefaultsSchema>;
|
|
413
|
+
/**
|
|
414
|
+
* Why one-click buy is not offered. `permission_required` and
|
|
415
|
+
* `cart_approval_required` (`specs/170-organization-roles/`, FR-050, R-6) are
|
|
416
|
+
* the member's role — no `quick_order.one_click`, or no
|
|
417
|
+
* `carts.order_without_approval` — and are judged first, in that order, before
|
|
418
|
+
* the setting and the defaults.
|
|
419
|
+
*/
|
|
285
420
|
export declare const quickOrderOneClickEligibilitySchema: z.ZodObject<{
|
|
286
421
|
enabled: z.ZodBoolean;
|
|
287
422
|
reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
423
|
+
permission_required: "permission_required";
|
|
424
|
+
cart_approval_required: "cart_approval_required";
|
|
288
425
|
setting_disabled: "setting_disabled";
|
|
289
426
|
missing_defaults: "missing_defaults";
|
|
290
427
|
ineligible_default: "ineligible_default";
|
|
@@ -337,8 +474,8 @@ export interface PreferenceAuditContext {
|
|
|
337
474
|
* Who is writing the preference.
|
|
338
475
|
*
|
|
339
476
|
* A discriminated union, not a bag of optional ids, and that is the point: a
|
|
340
|
-
* buyer editing their own defaults, an
|
|
341
|
-
* salesperson editing an
|
|
477
|
+
* buyer editing their own defaults, an Organization administrator editing a member's, a
|
|
478
|
+
* salesperson editing an organisation in their reach and a platform admin editing
|
|
342
479
|
* anybody's are four different authorisations, and each carries exactly the
|
|
343
480
|
* one identifier its rule needs. A shape with four optional fields has twelve
|
|
344
481
|
* states the rules cannot answer for.
|
|
@@ -348,12 +485,25 @@ export interface PreferenceAuditContext {
|
|
|
348
485
|
export type PreferenceActor = {
|
|
349
486
|
kind: 'customer';
|
|
350
487
|
customerAccountId: string;
|
|
351
|
-
}
|
|
352
|
-
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* A member holding the Organization's *Administrator* role — a buyer, not
|
|
491
|
+
* the operator's `platform_admin`. Managing others' defaults is a reserved
|
|
492
|
+
* capability, not a permission (`specs/170-organization-roles/` FR-012),
|
|
493
|
+
* asked of `organizationPermissionPort.isAdministrator`.
|
|
494
|
+
*/
|
|
495
|
+
| {
|
|
496
|
+
kind: 'administrator';
|
|
353
497
|
organizationId: string;
|
|
354
|
-
}
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* A sales representative. Issue #305: their reach is every organisation
|
|
501
|
+
* nobody else governs — assigned, roll-up and unassigned — which no list of
|
|
502
|
+
* ids names, so the actor carries the question rather than an answer.
|
|
503
|
+
*/
|
|
504
|
+
| {
|
|
355
505
|
kind: 'salesperson';
|
|
356
|
-
|
|
506
|
+
reaches: (organizationId: string) => Promise<boolean>;
|
|
357
507
|
} | {
|
|
358
508
|
kind: 'platform_admin';
|
|
359
509
|
};
|
package/dist/quick-order.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { uuidSchema } from './common.js';
|
|
3
3
|
import { nextActionSchema } from './orders.js';
|
|
4
|
+
import { lineQuantitySchema, REQUEST_LINE_ITEMS_MAX } from './line-bounds.js';
|
|
4
5
|
/**
|
|
5
6
|
* Quick-order contracts (feature 039). The quick-order page lets buyers
|
|
6
7
|
* build a Cart or a Quote Request from a CSV / Excel file (`sku,quantity`
|
|
@@ -97,12 +98,73 @@ export const quickOrderImportResponseSchema = z.object({
|
|
|
97
98
|
rejected: z.array(rejectedQuickOrderItemSchema),
|
|
98
99
|
summary: quickOrderImportSummarySchema,
|
|
99
100
|
});
|
|
101
|
+
// --- Preview (the buyer's import, held between the import and the build) ---
|
|
102
|
+
/**
|
|
103
|
+
* Issue #809 — the hard maximum of a preview's line cap: the ceiling `quick_order.import_max_rows`
|
|
104
|
+
* is clamped to. The cap itself is that setting's effective value, read when the preview is
|
|
105
|
+
* written (PO ruling of 2026-11-08 on PR #942), and it counts the rows the import read —
|
|
106
|
+
* recognised and rejected — never the rows past its limit, which the preview keeps as one
|
|
107
|
+
* `summary.overflowCount`. So an import never exceeds it; it bounds what adding from search can
|
|
108
|
+
* grow, and a write that adds no line is accepted even above a cap lowered since. Enforced by
|
|
109
|
+
* `PUT /api/v1/quick-order/preview` as `422 VALIDATION_FAILED`,
|
|
110
|
+
* `details: { code: 'too_many_lines', maximum }` (`maximum` = the setting), deliberately not by a
|
|
111
|
+
* schema `.max()`, which would answer 400 — the same shape as {@link QUICK_ORDER_BUILD_MAX_ITEMS}.
|
|
112
|
+
*/
|
|
113
|
+
export const QUICK_ORDER_PREVIEW_MAX_LINES = 10_000;
|
|
114
|
+
/**
|
|
115
|
+
* The largest preview body `PUT /api/v1/quick-order/preview` reads, in bytes; a larger one is
|
|
116
|
+
* refused `413 VALIDATION_FAILED` before it is parsed. A rejected line's raw CSV text is not
|
|
117
|
+
* bounded by the line cap, so the line cap alone does not bound what one buyer may store.
|
|
118
|
+
*/
|
|
119
|
+
export const QUICK_ORDER_PREVIEW_MAX_BYTES = 2 * 1024 * 1024;
|
|
120
|
+
/**
|
|
121
|
+
* How long a preview is kept after it was last written, in seconds. A write (`PUT`) starts the
|
|
122
|
+
* window again; a read does not, so a page left open does not keep the buyer's file alive.
|
|
123
|
+
*/
|
|
124
|
+
export const QUICK_ORDER_PREVIEW_TTL_SECONDS = 60 * 60;
|
|
125
|
+
/**
|
|
126
|
+
* After a partial cart build (feature 155, FR-011 (b)): why the cart did not take a line, with
|
|
127
|
+
* the build's product and unit names. The storefront writes it; nothing else reads it.
|
|
128
|
+
*/
|
|
129
|
+
export const quickOrderPreviewNotAddedSchema = z.object({
|
|
130
|
+
kind: z.enum(['pieces', 'packaging_unit']),
|
|
131
|
+
minimum: z.number().int().positive(),
|
|
132
|
+
productName: z.string().max(255),
|
|
133
|
+
packagingUnitName: z.string().max(255).optional(),
|
|
134
|
+
});
|
|
135
|
+
export const quickOrderPreviewRecognizedItemSchema = recognizedQuickOrderItemSchema
|
|
136
|
+
.omit({ warning: true })
|
|
137
|
+
.extend({ notAdded: quickOrderPreviewNotAddedSchema.optional() });
|
|
138
|
+
/**
|
|
139
|
+
* Issue #809 — the buyer's quick-order preview, as `quick_order` keeps it: one per buyer session,
|
|
140
|
+
* scoped to the buyer's Organization, for {@link QUICK_ORDER_PREVIEW_TTL_SECONDS}. It is the
|
|
141
|
+
* import's response (`quickOrderImportResponseSchema`) as the buyer has since edited it.
|
|
142
|
+
*
|
|
143
|
+
* `GET /api/v1/quick-order/preview` answers `{ data: QuickOrderPreview | null }` (`null`: none,
|
|
144
|
+
* or expired), `PUT` replaces it and answers `{ data: QuickOrderPreview }`, `DELETE` drops it and
|
|
145
|
+
* answers 204. All three need a signed-in buyer, and the session that wrote a preview is the only
|
|
146
|
+
* one that reads it; no preview id travels anywhere.
|
|
147
|
+
*/
|
|
148
|
+
/**
|
|
149
|
+
* The import's summary, plus what the preview keeps of the rows past the import's limit: how many
|
|
150
|
+
* there were (`overflowCount`) and the limit they were past (`rowLimit`, stamped by the backend
|
|
151
|
+
* when it is absent). The rows themselves are not kept.
|
|
152
|
+
*/
|
|
153
|
+
export const quickOrderPreviewSummarySchema = quickOrderImportSummarySchema.extend({
|
|
154
|
+
overflowCount: z.number().int().nonnegative().optional(),
|
|
155
|
+
rowLimit: z.number().int().positive().optional(),
|
|
156
|
+
});
|
|
157
|
+
export const quickOrderPreviewSchema = z.object({
|
|
158
|
+
recognized: z.array(quickOrderPreviewRecognizedItemSchema),
|
|
159
|
+
rejected: z.array(rejectedQuickOrderItemSchema),
|
|
160
|
+
summary: quickOrderPreviewSummarySchema,
|
|
161
|
+
});
|
|
100
162
|
// --- Build (confirmed import → Cart or Quote Request) ----------------------
|
|
101
163
|
export const quickOrderTargetSchema = z.enum(['cart', 'quote_request']);
|
|
102
164
|
export const quickOrderBuildLineSchema = z.object({
|
|
103
165
|
productId: uuidSchema,
|
|
104
166
|
variantId: uuidSchema.nullable().optional(),
|
|
105
|
-
quantity:
|
|
167
|
+
quantity: lineQuantitySchema,
|
|
106
168
|
});
|
|
107
169
|
/**
|
|
108
170
|
* Feature 155 (FR-038, research R20) — the most items a build accepts, either target.
|
|
@@ -110,7 +172,7 @@ export const quickOrderBuildLineSchema = z.object({
|
|
|
110
172
|
* `details: { code: 'too_many_items', maximum }`), deliberately not by a schema `.max()`,
|
|
111
173
|
* which would answer 400.
|
|
112
174
|
*/
|
|
113
|
-
export const QUICK_ORDER_BUILD_MAX_ITEMS =
|
|
175
|
+
export const QUICK_ORDER_BUILD_MAX_ITEMS = REQUEST_LINE_ITEMS_MAX;
|
|
114
176
|
export const quickOrderBuildRequestSchema = z.object({
|
|
115
177
|
target: quickOrderTargetSchema,
|
|
116
178
|
items: z.array(quickOrderBuildLineSchema).min(1),
|
|
@@ -194,17 +256,30 @@ export const quickOrderResolvedDefaultsSchema = z.object({
|
|
|
194
256
|
}),
|
|
195
257
|
});
|
|
196
258
|
// --- One-click buy ---------------------------------------------------------
|
|
259
|
+
/**
|
|
260
|
+
* Why one-click buy is not offered. `permission_required` and
|
|
261
|
+
* `cart_approval_required` (`specs/170-organization-roles/`, FR-050, R-6) are
|
|
262
|
+
* the member's role — no `quick_order.one_click`, or no
|
|
263
|
+
* `carts.order_without_approval` — and are judged first, in that order, before
|
|
264
|
+
* the setting and the defaults.
|
|
265
|
+
*/
|
|
197
266
|
export const quickOrderOneClickEligibilitySchema = z.object({
|
|
198
267
|
enabled: z.boolean(),
|
|
199
268
|
reason: z
|
|
200
|
-
.enum([
|
|
269
|
+
.enum([
|
|
270
|
+
'permission_required',
|
|
271
|
+
'cart_approval_required',
|
|
272
|
+
'setting_disabled',
|
|
273
|
+
'missing_defaults',
|
|
274
|
+
'ineligible_default',
|
|
275
|
+
])
|
|
201
276
|
.nullable()
|
|
202
277
|
.optional(),
|
|
203
278
|
});
|
|
204
279
|
export const quickOrderOneClickRequestSchema = z.object({
|
|
205
280
|
productId: uuidSchema,
|
|
206
281
|
variantId: uuidSchema.nullable().optional(),
|
|
207
|
-
quantity:
|
|
282
|
+
quantity: lineQuantitySchema.optional(),
|
|
208
283
|
idempotencyKey: z.string().max(200).optional(),
|
|
209
284
|
});
|
|
210
285
|
export const quickOrderOneClickResponseSchema = z.object({
|