@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/settings.d.ts
CHANGED
|
@@ -99,6 +99,33 @@ export declare const SettingValueByChannelSchema: z.ZodObject<{
|
|
|
99
99
|
isSet: z.ZodOptional<z.ZodBoolean>;
|
|
100
100
|
updatedAt: z.ZodISODateTime;
|
|
101
101
|
}, z.core.$strip>;
|
|
102
|
+
/**
|
|
103
|
+
* Issue #930 — the module that declared a setting says that what is stored is
|
|
104
|
+
* not what is in force, so the Settings screen does not show a setting as "on"
|
|
105
|
+
* while it does nothing. `code` is a token the screen looks up in the owner's
|
|
106
|
+
* bundle (`settingLabels.<setting code>.notice.<code>`); `message` is the
|
|
107
|
+
* English sentence it falls back to.
|
|
108
|
+
*/
|
|
109
|
+
export declare const SettingNoticeSchema: z.ZodObject<{
|
|
110
|
+
code: z.ZodString;
|
|
111
|
+
message: z.ZodString;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export type SettingNotice = z.infer<typeof SettingNoticeSchema>;
|
|
114
|
+
/**
|
|
115
|
+
* Issue #349, E-349-1 — the module that declared a setting says what writing
|
|
116
|
+
* `whenValue` would do, so the Settings screen asks before it saves that value:
|
|
117
|
+
* switching `mfa.admin.totp_enforced` on signs out every administrator without
|
|
118
|
+
* a second factor. `code` is a token the screen looks up in the owner's bundle
|
|
119
|
+
* (`settingLabels.<setting code>.confirmation.<code>`), interpolated with
|
|
120
|
+
* `params`; `message` is the English sentence it falls back to.
|
|
121
|
+
*/
|
|
122
|
+
export declare const SettingWriteConfirmationSchema: z.ZodObject<{
|
|
123
|
+
whenValue: z.ZodUnknown;
|
|
124
|
+
code: z.ZodString;
|
|
125
|
+
message: z.ZodString;
|
|
126
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
export type SettingWriteConfirmation = z.infer<typeof SettingWriteConfirmationSchema>;
|
|
102
129
|
export declare const SettingDtoSchema: z.ZodObject<{
|
|
103
130
|
id: z.ZodUUID;
|
|
104
131
|
code: z.ZodString;
|
|
@@ -131,6 +158,16 @@ export declare const SettingDtoSchema: z.ZodObject<{
|
|
|
131
158
|
version: z.ZodISODateTime;
|
|
132
159
|
editable: z.ZodOptional<z.ZodBoolean>;
|
|
133
160
|
activationControl: z.ZodOptional<z.ZodBoolean>;
|
|
161
|
+
notice: z.ZodOptional<z.ZodObject<{
|
|
162
|
+
code: z.ZodString;
|
|
163
|
+
message: z.ZodString;
|
|
164
|
+
}, z.core.$strip>>;
|
|
165
|
+
confirmation: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
whenValue: z.ZodUnknown;
|
|
167
|
+
code: z.ZodString;
|
|
168
|
+
message: z.ZodString;
|
|
169
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
170
|
+
}, z.core.$strip>>;
|
|
134
171
|
}, z.core.$strip>;
|
|
135
172
|
export type SettingDto = z.infer<typeof SettingDtoSchema>;
|
|
136
173
|
export declare const SettingGroupDtoSchema: z.ZodObject<{
|
|
@@ -172,6 +209,16 @@ export declare const SettingGroupDtoSchema: z.ZodObject<{
|
|
|
172
209
|
version: z.ZodISODateTime;
|
|
173
210
|
editable: z.ZodOptional<z.ZodBoolean>;
|
|
174
211
|
activationControl: z.ZodOptional<z.ZodBoolean>;
|
|
212
|
+
notice: z.ZodOptional<z.ZodObject<{
|
|
213
|
+
code: z.ZodString;
|
|
214
|
+
message: z.ZodString;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
confirmation: z.ZodOptional<z.ZodObject<{
|
|
217
|
+
whenValue: z.ZodUnknown;
|
|
218
|
+
code: z.ZodString;
|
|
219
|
+
message: z.ZodString;
|
|
220
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
221
|
+
}, z.core.$strip>>;
|
|
175
222
|
}, z.core.$strip>>;
|
|
176
223
|
}, z.core.$strip>;
|
|
177
224
|
export type SettingGroupDto = z.infer<typeof SettingGroupDtoSchema>;
|
|
@@ -215,9 +262,60 @@ export declare const SettingsListResponseSchema: z.ZodObject<{
|
|
|
215
262
|
version: z.ZodISODateTime;
|
|
216
263
|
editable: z.ZodOptional<z.ZodBoolean>;
|
|
217
264
|
activationControl: z.ZodOptional<z.ZodBoolean>;
|
|
265
|
+
notice: z.ZodOptional<z.ZodObject<{
|
|
266
|
+
code: z.ZodString;
|
|
267
|
+
message: z.ZodString;
|
|
268
|
+
}, z.core.$strip>>;
|
|
269
|
+
confirmation: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
whenValue: z.ZodUnknown;
|
|
271
|
+
code: z.ZodString;
|
|
272
|
+
message: z.ZodString;
|
|
273
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
274
|
+
}, z.core.$strip>>;
|
|
218
275
|
}, z.core.$strip>>;
|
|
219
276
|
}, z.core.$strip>>;
|
|
220
277
|
}, z.core.$strip>;
|
|
278
|
+
export type SettingsListResponse = z.infer<typeof SettingsListResponseSchema>;
|
|
279
|
+
/**
|
|
280
|
+
* A setting group without its settings — the reply to `POST
|
|
281
|
+
* /api/v1/admin/settings/groups` and `PATCH /api/v1/admin/settings/groups/:code`
|
|
282
|
+
* (issue #599).
|
|
283
|
+
*/
|
|
284
|
+
export declare const SettingGroupSummaryDtoSchema: z.ZodObject<{
|
|
285
|
+
id: z.ZodUUID;
|
|
286
|
+
code: z.ZodString;
|
|
287
|
+
name: z.ZodString;
|
|
288
|
+
ownerModule: z.ZodString;
|
|
289
|
+
salesChannelCodes: z.ZodArray<z.ZodString>;
|
|
290
|
+
isSystemProtected: z.ZodBoolean;
|
|
291
|
+
}, z.core.$strip>;
|
|
292
|
+
export type SettingGroupSummaryDto = z.infer<typeof SettingGroupSummaryDtoSchema>;
|
|
293
|
+
/** One row of `GET /api/v1/admin/settings/groups`: the group, how many settings it holds, and when it last changed. */
|
|
294
|
+
export declare const SettingGroupRowDtoSchema: z.ZodObject<{
|
|
295
|
+
id: z.ZodUUID;
|
|
296
|
+
code: z.ZodString;
|
|
297
|
+
name: z.ZodString;
|
|
298
|
+
ownerModule: z.ZodString;
|
|
299
|
+
salesChannelCodes: z.ZodArray<z.ZodString>;
|
|
300
|
+
isSystemProtected: z.ZodBoolean;
|
|
301
|
+
settingCount: z.ZodNumber;
|
|
302
|
+
updatedAt: z.ZodISODateTime;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
export type SettingGroupRowDto = z.infer<typeof SettingGroupRowDtoSchema>;
|
|
305
|
+
/** `GET /api/v1/admin/settings/groups` — every group, without its settings (issue #599). */
|
|
306
|
+
export declare const SettingGroupRowsResponseSchema: z.ZodObject<{
|
|
307
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
308
|
+
id: z.ZodUUID;
|
|
309
|
+
code: z.ZodString;
|
|
310
|
+
name: z.ZodString;
|
|
311
|
+
ownerModule: z.ZodString;
|
|
312
|
+
salesChannelCodes: z.ZodArray<z.ZodString>;
|
|
313
|
+
isSystemProtected: z.ZodBoolean;
|
|
314
|
+
settingCount: z.ZodNumber;
|
|
315
|
+
updatedAt: z.ZodISODateTime;
|
|
316
|
+
}, z.core.$strip>>;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
export type SettingGroupRowsResponse = z.infer<typeof SettingGroupRowsResponseSchema>;
|
|
221
319
|
export declare const SettingsListQuerySchema: z.ZodObject<{
|
|
222
320
|
groupCode: z.ZodOptional<z.ZodString>;
|
|
223
321
|
}, z.core.$strip>;
|
|
@@ -283,7 +381,18 @@ export declare const SettingDetailResponseSchema: z.ZodObject<{
|
|
|
283
381
|
version: z.ZodISODateTime;
|
|
284
382
|
editable: z.ZodOptional<z.ZodBoolean>;
|
|
285
383
|
activationControl: z.ZodOptional<z.ZodBoolean>;
|
|
384
|
+
notice: z.ZodOptional<z.ZodObject<{
|
|
385
|
+
code: z.ZodString;
|
|
386
|
+
message: z.ZodString;
|
|
387
|
+
}, z.core.$strip>>;
|
|
388
|
+
confirmation: z.ZodOptional<z.ZodObject<{
|
|
389
|
+
whenValue: z.ZodUnknown;
|
|
390
|
+
code: z.ZodString;
|
|
391
|
+
message: z.ZodString;
|
|
392
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
393
|
+
}, z.core.$strip>>;
|
|
286
394
|
}, z.core.$strip>;
|
|
395
|
+
export type SettingDetailResponse = z.infer<typeof SettingDetailResponseSchema>;
|
|
287
396
|
/**
|
|
288
397
|
* Public shop / company contact information resolved for the active sales
|
|
289
398
|
* channel. Backs the storefront footer, the 404 "need help?" block and the
|
|
@@ -372,8 +481,8 @@ export type HomepageConfigResponse = z.infer<typeof HomepageConfigResponseSchema
|
|
|
372
481
|
/**
|
|
373
482
|
* The reporting time zone: the calendar in which a report counts a day, a
|
|
374
483
|
* month or any other range of days. A setting of the `analytics` module, so
|
|
375
|
-
* that no single reporting module owns it — Projects
|
|
376
|
-
*
|
|
484
|
+
* that no single reporting module owns it — Projects and CRM analytics read
|
|
485
|
+
* it (#474). An IANA name; default `UTC`. Read it through
|
|
377
486
|
* {@link ReportingTimeZonePort}, never by code: `analytics` can be switched
|
|
378
487
|
* off, and a reader then counts in `UTC`.
|
|
379
488
|
*/
|
|
@@ -486,6 +595,68 @@ export interface SettingWriteValidator {
|
|
|
486
595
|
/** Throws an `HttpError` to refuse. Resolving is acceptance. */
|
|
487
596
|
validate(input: SettingWriteValidationInput): Promise<void>;
|
|
488
597
|
}
|
|
598
|
+
export interface SettingNoticeInput {
|
|
599
|
+
readonly code: string;
|
|
600
|
+
/** The module that declared the setting. */
|
|
601
|
+
readonly ownerModuleId: string;
|
|
602
|
+
/**
|
|
603
|
+
* The platform-wide value in force before any per-channel row: the stored
|
|
604
|
+
* global value, else the manifest default. `null` for a `secret` setting,
|
|
605
|
+
* whose value never leaves `settings`.
|
|
606
|
+
*/
|
|
607
|
+
readonly value: unknown;
|
|
608
|
+
}
|
|
609
|
+
export interface SettingNoticeProvider {
|
|
610
|
+
/** The module contributing the provider — used for the presence filter. */
|
|
611
|
+
readonly contributorModuleId: string;
|
|
612
|
+
/** Exact setting codes, for the reason {@link SettingWriteValidator.codes} gives. */
|
|
613
|
+
readonly codes: readonly string[];
|
|
614
|
+
/** A notice to show beside the setting, or `null` when there is nothing to say. */
|
|
615
|
+
notice(input: SettingNoticeInput): Promise<SettingNotice | null>;
|
|
616
|
+
/**
|
|
617
|
+
* Issue #349, E-349-1 — what to ask before a write, given the value in force
|
|
618
|
+
* now, or `null` when there is nothing to ask. Optional: most providers only
|
|
619
|
+
* comment on what is stored.
|
|
620
|
+
*/
|
|
621
|
+
confirmation?(input: SettingNoticeInput): Promise<SettingWriteConfirmation | null>;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Container name: `settingNoticeRegistry`. Owner: `settings`. A contribution
|
|
625
|
+
* seam like {@link SettingWriteValidatorRegistryPort}: pushed into once from a
|
|
626
|
+
* boot hook, and filtered by contributor presence.
|
|
627
|
+
*/
|
|
628
|
+
export interface SettingNoticeRegistryPort {
|
|
629
|
+
register(provider: SettingNoticeProvider): void;
|
|
630
|
+
/** Providers for `code`, filtered by contributor presence. */
|
|
631
|
+
forCode(code: string): readonly SettingNoticeProvider[];
|
|
632
|
+
/** The first notice a present provider gives for the setting, or `null`. */
|
|
633
|
+
noticeFor(input: SettingNoticeInput): Promise<SettingNotice | null>;
|
|
634
|
+
/** The first write confirmation a present provider gives for the setting, or `null`. */
|
|
635
|
+
confirmationFor(input: SettingNoticeInput): Promise<SettingWriteConfirmation | null>;
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* The payload `settings` emits as `settings.value_changed`, after a value
|
|
639
|
+
* write or reset has committed. In-process and best-effort, like every
|
|
640
|
+
* EventBus event.
|
|
641
|
+
*/
|
|
642
|
+
export interface SettingsValueChangedPayload {
|
|
643
|
+
readonly eventId: string;
|
|
644
|
+
readonly occurredAt: string;
|
|
645
|
+
readonly settingCode: string;
|
|
646
|
+
/** Channels whose own row the write set or reset; empty for a platform-wide write. */
|
|
647
|
+
readonly salesChannelIds: readonly string[];
|
|
648
|
+
/** Whether the platform-wide value was set or reset. */
|
|
649
|
+
readonly globalValueUpdated: boolean;
|
|
650
|
+
readonly valueType: string;
|
|
651
|
+
/**
|
|
652
|
+
* Issue #349, E-349-1 — the administrator who made the write, and the id of
|
|
653
|
+
* the session they made it from, so a consequence that ends other sessions
|
|
654
|
+
* can spare that one. `null` / absent for a write with no administrator
|
|
655
|
+
* behind it (a boot reconciler, a seed).
|
|
656
|
+
*/
|
|
657
|
+
readonly actorAdminUserId?: string | null;
|
|
658
|
+
readonly actorSessionId?: string | null;
|
|
659
|
+
}
|
|
489
660
|
/**
|
|
490
661
|
* Container name: `settingWriteValidatorRegistry`. Owner: `settings`.
|
|
491
662
|
*
|
package/dist/settings.js
CHANGED
|
@@ -177,6 +177,31 @@ export const SettingValueByChannelSchema = z.object({
|
|
|
177
177
|
isSet: z.boolean().optional(),
|
|
178
178
|
updatedAt: z.iso.datetime(),
|
|
179
179
|
});
|
|
180
|
+
/**
|
|
181
|
+
* Issue #930 — the module that declared a setting says that what is stored is
|
|
182
|
+
* not what is in force, so the Settings screen does not show a setting as "on"
|
|
183
|
+
* while it does nothing. `code` is a token the screen looks up in the owner's
|
|
184
|
+
* bundle (`settingLabels.<setting code>.notice.<code>`); `message` is the
|
|
185
|
+
* English sentence it falls back to.
|
|
186
|
+
*/
|
|
187
|
+
export const SettingNoticeSchema = z.object({
|
|
188
|
+
code: z.string().min(1),
|
|
189
|
+
message: z.string().min(1),
|
|
190
|
+
});
|
|
191
|
+
/**
|
|
192
|
+
* Issue #349, E-349-1 — the module that declared a setting says what writing
|
|
193
|
+
* `whenValue` would do, so the Settings screen asks before it saves that value:
|
|
194
|
+
* switching `mfa.admin.totp_enforced` on signs out every administrator without
|
|
195
|
+
* a second factor. `code` is a token the screen looks up in the owner's bundle
|
|
196
|
+
* (`settingLabels.<setting code>.confirmation.<code>`), interpolated with
|
|
197
|
+
* `params`; `message` is the English sentence it falls back to.
|
|
198
|
+
*/
|
|
199
|
+
export const SettingWriteConfirmationSchema = z.object({
|
|
200
|
+
whenValue: z.unknown(),
|
|
201
|
+
code: z.string().min(1),
|
|
202
|
+
message: z.string().min(1),
|
|
203
|
+
params: z.record(z.string(), z.union([z.string(), z.number()])).optional(),
|
|
204
|
+
});
|
|
180
205
|
export const SettingDtoSchema = z.object({
|
|
181
206
|
id: z.uuid(),
|
|
182
207
|
code: z.string(),
|
|
@@ -244,6 +269,17 @@ export const SettingDtoSchema = z.object({
|
|
|
244
269
|
* setting the ordinary write path refuses (the audited Command owns it).
|
|
245
270
|
*/
|
|
246
271
|
activationControl: z.boolean().optional(),
|
|
272
|
+
/**
|
|
273
|
+
* Issue #930 — present only while the owning module says the stored value is
|
|
274
|
+
* not in force (see {@link SettingNoticeSchema}). Absent otherwise.
|
|
275
|
+
*/
|
|
276
|
+
notice: SettingNoticeSchema.optional(),
|
|
277
|
+
/**
|
|
278
|
+
* Issue #349, E-349-1 — present only while the owning module asks for a
|
|
279
|
+
* confirmation before a write of `whenValue` (see
|
|
280
|
+
* {@link SettingWriteConfirmationSchema}). Absent otherwise.
|
|
281
|
+
*/
|
|
282
|
+
confirmation: SettingWriteConfirmationSchema.optional(),
|
|
247
283
|
});
|
|
248
284
|
export const SettingGroupDtoSchema = z.object({
|
|
249
285
|
id: z.uuid(),
|
|
@@ -257,6 +293,21 @@ export const SettingGroupDtoSchema = z.object({
|
|
|
257
293
|
export const SettingsListResponseSchema = z.object({
|
|
258
294
|
groups: z.array(SettingGroupDtoSchema),
|
|
259
295
|
});
|
|
296
|
+
/**
|
|
297
|
+
* A setting group without its settings — the reply to `POST
|
|
298
|
+
* /api/v1/admin/settings/groups` and `PATCH /api/v1/admin/settings/groups/:code`
|
|
299
|
+
* (issue #599).
|
|
300
|
+
*/
|
|
301
|
+
export const SettingGroupSummaryDtoSchema = SettingGroupDtoSchema.omit({ settings: true });
|
|
302
|
+
/** One row of `GET /api/v1/admin/settings/groups`: the group, how many settings it holds, and when it last changed. */
|
|
303
|
+
export const SettingGroupRowDtoSchema = SettingGroupSummaryDtoSchema.extend({
|
|
304
|
+
settingCount: z.number().int().nonnegative(),
|
|
305
|
+
updatedAt: z.iso.datetime(),
|
|
306
|
+
});
|
|
307
|
+
/** `GET /api/v1/admin/settings/groups` — every group, without its settings (issue #599). */
|
|
308
|
+
export const SettingGroupRowsResponseSchema = z.object({
|
|
309
|
+
groups: z.array(SettingGroupRowDtoSchema),
|
|
310
|
+
});
|
|
260
311
|
export const SettingsListQuerySchema = z.object({
|
|
261
312
|
groupCode: z.string().optional(),
|
|
262
313
|
});
|
|
@@ -365,8 +416,8 @@ export const HomepageConfigResponseSchema = z.object({ data: HomepageConfigSchem
|
|
|
365
416
|
/**
|
|
366
417
|
* The reporting time zone: the calendar in which a report counts a day, a
|
|
367
418
|
* month or any other range of days. A setting of the `analytics` module, so
|
|
368
|
-
* that no single reporting module owns it — Projects
|
|
369
|
-
*
|
|
419
|
+
* that no single reporting module owns it — Projects and CRM analytics read
|
|
420
|
+
* it (#474). An IANA name; default `UTC`. Read it through
|
|
370
421
|
* {@link ReportingTimeZonePort}, never by code: `analytics` can be switched
|
|
371
422
|
* off, and a reader then counts in `UTC`.
|
|
372
423
|
*/
|
package/dist/shopping-lists.d.ts
CHANGED
|
@@ -44,6 +44,50 @@ export declare const shoppingListSchema: z.ZodObject<{
|
|
|
44
44
|
updatedAt: z.ZodString;
|
|
45
45
|
}, z.core.$strip>;
|
|
46
46
|
export type ShoppingList = z.infer<typeof shoppingListSchema>;
|
|
47
|
+
/** `GET /api/v1/shopping-lists` — the signed-in customer's lists, each with its items (issue #599). */
|
|
48
|
+
export declare const shoppingListListResponseSchema: z.ZodObject<{
|
|
49
|
+
data: z.ZodArray<z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
organizationId: z.ZodString;
|
|
52
|
+
customerAccountId: z.ZodString;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
isDefault: z.ZodBoolean;
|
|
55
|
+
items: z.ZodArray<z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
shoppingListId: z.ZodString;
|
|
58
|
+
productId: z.ZodString;
|
|
59
|
+
variantId: z.ZodNullable<z.ZodString>;
|
|
60
|
+
quantity: z.ZodNumber;
|
|
61
|
+
note: z.ZodNullable<z.ZodString>;
|
|
62
|
+
createdAt: z.ZodString;
|
|
63
|
+
updatedAt: z.ZodString;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
createdAt: z.ZodString;
|
|
66
|
+
updatedAt: z.ZodString;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type ShoppingListListResponse = z.infer<typeof shoppingListListResponseSchema>;
|
|
70
|
+
/**
|
|
71
|
+
* The name `shopping_lists` stores on the default list it creates for every
|
|
72
|
+
* customer (at registration, or on the first default-list read). It is data,
|
|
73
|
+
* written in no language in particular (issue #751).
|
|
74
|
+
*/
|
|
75
|
+
export declare const SHOPPING_LIST_AUTO_DEFAULT_NAME = "Default";
|
|
76
|
+
/**
|
|
77
|
+
* Whether `list` is the default list the platform created and nobody renamed —
|
|
78
|
+
* the list a storefront names in the shop language rather than by its stored
|
|
79
|
+
* name (owner ruling on PR #760, issue #751).
|
|
80
|
+
*
|
|
81
|
+
* No column records "never renamed", so the marker is the default flag and the
|
|
82
|
+
* stored name together, matched exactly. A list the customer renamed is theirs;
|
|
83
|
+
* a list named `Default` that is not the default one is a name like any other.
|
|
84
|
+
* The cost of not adding a column: a customer who types exactly `Default` as the
|
|
85
|
+
* default list's name sees it in the shop language — the same word.
|
|
86
|
+
*/
|
|
87
|
+
export declare function isAutoDefaultShoppingList(list: {
|
|
88
|
+
readonly name: string;
|
|
89
|
+
readonly isDefault: boolean;
|
|
90
|
+
}): boolean;
|
|
47
91
|
/** Lightweight default-list view for the storefront header heart badge. */
|
|
48
92
|
export declare const defaultShoppingListSummarySchema: z.ZodObject<{
|
|
49
93
|
id: z.ZodString;
|
|
@@ -59,6 +103,21 @@ export declare const renameShoppingListRequestSchema: z.ZodObject<{
|
|
|
59
103
|
name: z.ZodString;
|
|
60
104
|
}, z.core.$strict>;
|
|
61
105
|
export type RenameShoppingListRequest = z.infer<typeof renameShoppingListRequestSchema>;
|
|
106
|
+
/**
|
|
107
|
+
* Issue #1251 — `PATCH /api/v1/shopping-lists/:id`: the list's name, the quantities of any of
|
|
108
|
+
* its lines, or both, written together or not at all — the one *Save changes* of the
|
|
109
|
+
* storefront list page. Every body {@link renameShoppingListRequestSchema} accepts is accepted
|
|
110
|
+
* here. A line appears once, at most {@link REQUEST_LINE_ITEMS_MAX} of them; a line that is
|
|
111
|
+
* not on the list refuses the whole write.
|
|
112
|
+
*/
|
|
113
|
+
export declare const updateShoppingListRequestSchema: z.ZodObject<{
|
|
114
|
+
name: z.ZodOptional<z.ZodString>;
|
|
115
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
quantity: z.ZodNumber;
|
|
118
|
+
}, z.core.$strict>>>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
export type UpdateShoppingListRequest = z.infer<typeof updateShoppingListRequestSchema>;
|
|
62
121
|
export declare const addShoppingListItemRequestSchema: z.ZodObject<{
|
|
63
122
|
productId: z.ZodString;
|
|
64
123
|
variantId: z.ZodOptional<z.ZodString>;
|
|
@@ -84,8 +143,8 @@ export declare const conversionSkipSchema: z.ZodObject<{
|
|
|
84
143
|
itemId: z.ZodString;
|
|
85
144
|
productId: z.ZodString;
|
|
86
145
|
reason: z.ZodEnum<{
|
|
87
|
-
below_minimum: "below_minimum";
|
|
88
146
|
product_not_found: "product_not_found";
|
|
147
|
+
below_minimum: "below_minimum";
|
|
89
148
|
product_archived: "product_archived";
|
|
90
149
|
variant_unavailable: "variant_unavailable";
|
|
91
150
|
}>;
|
|
@@ -117,8 +176,8 @@ export declare const convertToCartResponseSchema: z.ZodObject<{
|
|
|
117
176
|
itemId: z.ZodString;
|
|
118
177
|
productId: z.ZodString;
|
|
119
178
|
reason: z.ZodEnum<{
|
|
120
|
-
below_minimum: "below_minimum";
|
|
121
179
|
product_not_found: "product_not_found";
|
|
180
|
+
below_minimum: "below_minimum";
|
|
122
181
|
product_archived: "product_archived";
|
|
123
182
|
variant_unavailable: "variant_unavailable";
|
|
124
183
|
}>;
|
|
@@ -128,14 +187,14 @@ export declare const convertToCartResponseSchema: z.ZodObject<{
|
|
|
128
187
|
export type ConvertToCartResponse = z.infer<typeof convertToCartResponseSchema>;
|
|
129
188
|
export declare const convertToRfqResponseSchema: z.ZodObject<{
|
|
130
189
|
shoppingListId: z.ZodString;
|
|
131
|
-
rfqId: z.ZodString
|
|
190
|
+
rfqId: z.ZodNullable<z.ZodString>;
|
|
132
191
|
added: z.ZodNumber;
|
|
133
192
|
skipped: z.ZodArray<z.ZodObject<{
|
|
134
193
|
itemId: z.ZodString;
|
|
135
194
|
productId: z.ZodString;
|
|
136
195
|
reason: z.ZodEnum<{
|
|
137
|
-
below_minimum: "below_minimum";
|
|
138
196
|
product_not_found: "product_not_found";
|
|
197
|
+
below_minimum: "below_minimum";
|
|
139
198
|
product_archived: "product_archived";
|
|
140
199
|
variant_unavailable: "variant_unavailable";
|
|
141
200
|
}>;
|
package/dist/shopping-lists.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { isoDateTimeSchema, uuidSchema } from './common.js';
|
|
3
|
+
import { REQUEST_LINE_ITEMS_MAX, lineQuantitySchema } from './line-bounds.js';
|
|
3
4
|
/**
|
|
4
5
|
* Shopping list contracts (T202 / FR-031..FR-033).
|
|
5
6
|
*
|
|
@@ -35,6 +36,30 @@ export const shoppingListSchema = z.object({
|
|
|
35
36
|
createdAt: isoDateTimeSchema,
|
|
36
37
|
updatedAt: isoDateTimeSchema,
|
|
37
38
|
});
|
|
39
|
+
/** `GET /api/v1/shopping-lists` — the signed-in customer's lists, each with its items (issue #599). */
|
|
40
|
+
export const shoppingListListResponseSchema = z.object({
|
|
41
|
+
data: z.array(shoppingListSchema),
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* The name `shopping_lists` stores on the default list it creates for every
|
|
45
|
+
* customer (at registration, or on the first default-list read). It is data,
|
|
46
|
+
* written in no language in particular (issue #751).
|
|
47
|
+
*/
|
|
48
|
+
export const SHOPPING_LIST_AUTO_DEFAULT_NAME = 'Default';
|
|
49
|
+
/**
|
|
50
|
+
* Whether `list` is the default list the platform created and nobody renamed —
|
|
51
|
+
* the list a storefront names in the shop language rather than by its stored
|
|
52
|
+
* name (owner ruling on PR #760, issue #751).
|
|
53
|
+
*
|
|
54
|
+
* No column records "never renamed", so the marker is the default flag and the
|
|
55
|
+
* stored name together, matched exactly. A list the customer renamed is theirs;
|
|
56
|
+
* a list named `Default` that is not the default one is a name like any other.
|
|
57
|
+
* The cost of not adding a column: a customer who types exactly `Default` as the
|
|
58
|
+
* default list's name sees it in the shop language — the same word.
|
|
59
|
+
*/
|
|
60
|
+
export function isAutoDefaultShoppingList(list) {
|
|
61
|
+
return list.isDefault && list.name === SHOPPING_LIST_AUTO_DEFAULT_NAME;
|
|
62
|
+
}
|
|
38
63
|
/** Lightweight default-list view for the storefront header heart badge. */
|
|
39
64
|
export const defaultShoppingListSummarySchema = z.object({
|
|
40
65
|
id: uuidSchema,
|
|
@@ -50,15 +75,43 @@ export const renameShoppingListRequestSchema = z
|
|
|
50
75
|
name: z.string().min(1).max(160),
|
|
51
76
|
})
|
|
52
77
|
.strict();
|
|
78
|
+
/**
|
|
79
|
+
* Issue #1251 — `PATCH /api/v1/shopping-lists/:id`: the list's name, the quantities of any of
|
|
80
|
+
* its lines, or both, written together or not at all — the one *Save changes* of the
|
|
81
|
+
* storefront list page. Every body {@link renameShoppingListRequestSchema} accepts is accepted
|
|
82
|
+
* here. A line appears once, at most {@link REQUEST_LINE_ITEMS_MAX} of them; a line that is
|
|
83
|
+
* not on the list refuses the whole write.
|
|
84
|
+
*/
|
|
85
|
+
export const updateShoppingListRequestSchema = z
|
|
86
|
+
.object({
|
|
87
|
+
name: z.string().min(1).max(160).optional(),
|
|
88
|
+
items: z
|
|
89
|
+
.array(z
|
|
90
|
+
.object({
|
|
91
|
+
id: uuidSchema,
|
|
92
|
+
quantity: lineQuantitySchema,
|
|
93
|
+
})
|
|
94
|
+
.strict())
|
|
95
|
+
.min(1)
|
|
96
|
+
.max(REQUEST_LINE_ITEMS_MAX)
|
|
97
|
+
.refine((items) => new Set(items.map((item) => item.id)).size === items.length, {
|
|
98
|
+
message: 'A line may be listed once.',
|
|
99
|
+
})
|
|
100
|
+
.optional(),
|
|
101
|
+
})
|
|
102
|
+
.strict()
|
|
103
|
+
.refine((body) => body.name !== undefined || body.items !== undefined, {
|
|
104
|
+
message: 'Send a name, lines, or both.',
|
|
105
|
+
});
|
|
53
106
|
export const addShoppingListItemRequestSchema = z.object({
|
|
54
107
|
productId: uuidSchema,
|
|
55
108
|
variantId: uuidSchema.optional(),
|
|
56
|
-
quantity:
|
|
109
|
+
quantity: lineQuantitySchema,
|
|
57
110
|
note: z.string().max(2000).optional(),
|
|
58
111
|
});
|
|
59
112
|
export const updateShoppingListItemRequestSchema = z
|
|
60
113
|
.object({
|
|
61
|
-
quantity:
|
|
114
|
+
quantity: lineQuantitySchema.optional(),
|
|
62
115
|
note: z.string().max(2000).nullable().optional(),
|
|
63
116
|
})
|
|
64
117
|
.strict();
|
|
@@ -104,7 +157,8 @@ export const convertToCartResponseSchema = z.object({
|
|
|
104
157
|
});
|
|
105
158
|
export const convertToRfqResponseSchema = z.object({
|
|
106
159
|
shoppingListId: uuidSchema,
|
|
107
|
-
|
|
160
|
+
/** `null` when no item converted — every selected item was skipped, or none was selected; no quote request was created or changed. */
|
|
161
|
+
rfqId: uuidSchema.nullable(),
|
|
108
162
|
added: z.number().int().nonnegative(),
|
|
109
163
|
skipped: z.array(conversionSkipSchema),
|
|
110
164
|
});
|
|
@@ -57,6 +57,18 @@ export declare const CATALOG_PRODUCT_STOREFRONT_CACHE_TAGS: {
|
|
|
57
57
|
/** Next drops a tag longer than this. */
|
|
58
58
|
readonly maxLength: 256;
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Feature 170 (research R-21, FR-063) — the storefront's read of one public form definition.
|
|
62
|
+
* `forms` drops it after a committed publish, close, reopen or delete. Every state of that read is
|
|
63
|
+
* a `200` (`unavailable` included), so the 60 s revalidation bounds staleness even when the drop
|
|
64
|
+
* by tag is lost.
|
|
65
|
+
*/
|
|
66
|
+
export declare const FORMS_STOREFRONT_CACHE_TAGS: {
|
|
67
|
+
/** One form's reads, on every channel and language. */
|
|
68
|
+
readonly form: (formId: string) => string;
|
|
69
|
+
/** Next drops a tag longer than this. */
|
|
70
|
+
readonly maxLength: 256;
|
|
71
|
+
};
|
|
60
72
|
/** The resolved megamenu of a channel and language — it inlines CMS blocks. */
|
|
61
73
|
export declare const MEGAMENU_STOREFRONT_CACHE_TAG = "megamenu";
|
|
62
74
|
/**
|
|
@@ -90,5 +102,15 @@ export type CmsContentChange = {
|
|
|
90
102
|
} | {
|
|
91
103
|
readonly kind: 'hook';
|
|
92
104
|
readonly codes: readonly string[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Issue #363 — an asset a page, a block or a hook may embed was written
|
|
108
|
+
* (`assets_library`'s `ASSET_CHANGED_EVENT`). Every CMS answer carries the
|
|
109
|
+
* URLs of the assets it embeds, and nothing records which answer embeds
|
|
110
|
+
* which asset, so every page, block and hook read is stale.
|
|
111
|
+
*/
|
|
112
|
+
| {
|
|
113
|
+
readonly kind: 'assets';
|
|
114
|
+
readonly assetIds: readonly string[];
|
|
93
115
|
};
|
|
94
116
|
//# sourceMappingURL=storefront-cache-tags.d.ts.map
|
|
@@ -57,6 +57,18 @@ export const CATALOG_PRODUCT_STOREFRONT_CACHE_TAGS = {
|
|
|
57
57
|
/** Next drops a tag longer than this. */
|
|
58
58
|
maxLength: 256,
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Feature 170 (research R-21, FR-063) — the storefront's read of one public form definition.
|
|
62
|
+
* `forms` drops it after a committed publish, close, reopen or delete. Every state of that read is
|
|
63
|
+
* a `200` (`unavailable` included), so the 60 s revalidation bounds staleness even when the drop
|
|
64
|
+
* by tag is lost.
|
|
65
|
+
*/
|
|
66
|
+
export const FORMS_STOREFRONT_CACHE_TAGS = {
|
|
67
|
+
/** One form's reads, on every channel and language. */
|
|
68
|
+
form: (formId) => `forms:form:${formId}`,
|
|
69
|
+
/** Next drops a tag longer than this. */
|
|
70
|
+
maxLength: 256,
|
|
71
|
+
};
|
|
60
72
|
/** The resolved megamenu of a channel and language — it inlines CMS blocks. */
|
|
61
73
|
export const MEGAMENU_STOREFRONT_CACHE_TAG = 'megamenu';
|
|
62
74
|
/**
|
|
@@ -1,67 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ScopeLevel } from './product-scope-model.js';
|
|
2
|
+
import { type OverrideRow } from './product-value-resolver.js';
|
|
2
3
|
/**
|
|
3
|
-
* Issue #384
|
|
4
|
-
* a storefront read shows
|
|
4
|
+
* Issue #384, rewritten by feature 174 (research R1) — the effective Name, Description or
|
|
5
|
+
* attribute a storefront read shows at the request's (channel, language), given the override
|
|
6
|
+
* rows it already holds.
|
|
5
7
|
*
|
|
6
|
-
* Shared by every storefront read that shows a product's
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* **Only the override slots are taken from the resolver.** The fallback chain
|
|
11
|
-
* is {@link resolveAttribute}, and this file adds no second implementation of
|
|
12
|
-
* it. What it deliberately does *not* take from the resolver is the baseline
|
|
13
|
-
* leg: the storefront reads have always walked their own language fallback
|
|
14
|
-
* over the baseline JSONB (`preferred` → the channel's default language →
|
|
15
|
-
* `en-US` → `en` → first key), which differs from the resolver's
|
|
16
|
-
* (`languageCode` → primary language → first sorted key) in its edges.
|
|
17
|
-
* Replacing it would change what every product *without* an override shows,
|
|
18
|
-
* so an override answers here only when the resolver says a channel slot
|
|
19
|
-
* produced the value, and the caller's existing baseline pick answers
|
|
20
|
-
* otherwise. The baseline is still read for one thing — where that pick
|
|
21
|
-
* stops — so an override never answers for a later language than the one
|
|
22
|
-
* whose baseline text the page would show.
|
|
8
|
+
* Shared by every storefront read that shows a product's text — `catalog`'s product page and
|
|
9
|
+
* listing cards, and `search`'s result cards — so one product cannot show two names depending on
|
|
10
|
+
* which module answered. The chain is {@link resolveAttribute}'s (C×L → C → G); there is no
|
|
11
|
+
* per-language baseline walk any more: the Global value is one string (FR-014).
|
|
23
12
|
*/
|
|
24
|
-
/** The request's resolution context
|
|
13
|
+
/** The request's resolution context: the resolved channel and its content language. */
|
|
25
14
|
export interface StorefrontOverrideContext {
|
|
26
15
|
channelId: string;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
* {@link overrideLanguages}. A (channel, language) override is looked up at
|
|
30
|
-
* each leg until the baseline has a value for one; the pick's first-key tail
|
|
31
|
-
* is derived from the baseline itself. Empty when nothing is known: only the
|
|
32
|
-
* baseline's first key and the channel-only slot can answer.
|
|
33
|
-
*/
|
|
34
|
-
languages: readonly string[];
|
|
16
|
+
/** Already resolved against the channel; `null` = the channel scope only. */
|
|
17
|
+
languageCode: string | null;
|
|
35
18
|
}
|
|
36
19
|
/**
|
|
37
|
-
* The
|
|
38
|
-
*
|
|
39
|
-
* `en`. A caller whose pick has no channel-default leg passes `undefined` for
|
|
40
|
-
* it, so the override walk mirrors exactly the pick it sits on.
|
|
41
|
-
*/
|
|
42
|
-
export declare function overrideLanguages(preferredLanguage: string | undefined, channelDefaultLanguage: string | undefined): string[];
|
|
43
|
-
/**
|
|
44
|
-
* The override value for one attribute in this context, or `undefined` when no
|
|
45
|
-
* channel slot applies and the caller's baseline should stand.
|
|
46
|
-
*
|
|
47
|
-
* The walk is the baseline pick's own, with the override slot looked at first
|
|
48
|
-
* at every leg: for each language L of `ctx.languages`, a (channel, L)
|
|
49
|
-
* override answers; else, if the baseline has a value for L, the walk stops
|
|
50
|
-
* there. When no leg stopped it and the baseline is a per-language record, its
|
|
51
|
-
* first key — the pick's tail — is the last leg. So an override for a later
|
|
52
|
-
* language never beats a baseline value for an earlier one. Whatever the walk
|
|
53
|
-
* stopped on, the channel-only slot is asked last, exactly as it always was.
|
|
54
|
-
*
|
|
55
|
-
* `baseline` is the raw value the caller's pick reads: `products.name` /
|
|
56
|
-
* `products.description` for the system text, `attributeValues[key]` for a
|
|
57
|
-
* user attribute.
|
|
20
|
+
* The effective value of one field at `ctx`: the C×L row, else the C row, else `global`; an
|
|
21
|
+
* empty override answers `null`.
|
|
58
22
|
*/
|
|
59
|
-
export declare function
|
|
23
|
+
export declare function effectiveScopedValue(overrides: readonly OverrideRow[] | undefined, attributeKey: string, levels: readonly ScopeLevel[], ctx: StorefrontOverrideContext, global: unknown): unknown;
|
|
60
24
|
/**
|
|
61
|
-
* The effective Name or Description
|
|
62
|
-
*
|
|
63
|
-
* language pick over `baseline`, the JSONB it picked from. The pick is kept
|
|
64
|
-
* the caller's so a product without overrides shows byte-identical text.
|
|
25
|
+
* The effective Name or Description at `ctx`: `null` when the answer is an empty override (a
|
|
26
|
+
* description deliberately left empty) or there is no value at all.
|
|
65
27
|
*/
|
|
66
|
-
export declare function effectiveSystemText(overrides: readonly OverrideRow[] | undefined, attributeKey: 'name' | 'description', ctx: StorefrontOverrideContext,
|
|
28
|
+
export declare function effectiveSystemText(overrides: readonly OverrideRow[] | undefined, attributeKey: 'name' | 'description', ctx: StorefrontOverrideContext, global: string | null): string | null;
|
|
67
29
|
//# sourceMappingURL=storefront-value-overrides.d.ts.map
|