@endora-commerce/contracts 0.110.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/admin-actions.d.ts +2 -0
- package/dist/admin-actions.js +18 -0
- package/dist/admin-contributions.d.ts +37 -5
- package/dist/admin-contributions.js +9 -2
- package/dist/admin-roles.d.ts +9 -0
- package/dist/admin.d.ts +37 -0
- package/dist/admin.js +19 -0
- package/dist/api-keys.d.ts +22 -0
- package/dist/api-keys.js +4 -0
- package/dist/assets-library.d.ts +19 -0
- package/dist/assets-library.js +14 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.js +9 -0
- package/dist/carts.d.ts +30 -1
- package/dist/carts.js +20 -5
- package/dist/catalog.d.ts +61 -22
- package/dist/catalog.js +32 -6
- package/dist/cms.d.ts +33 -3
- package/dist/cms.js +15 -0
- package/dist/command-hooks.d.ts +301 -0
- package/dist/command-hooks.js +248 -0
- package/dist/comparisons.d.ts +14 -14
- package/dist/credit-limits.d.ts +21 -0
- package/dist/credit-limits.js +21 -0
- package/dist/crm.d.ts +81 -55
- package/dist/crm.js +15 -5
- package/dist/custom-fields.d.ts +403 -49
- package/dist/custom-fields.js +127 -0
- package/dist/customer-accounts.d.ts +138 -0
- package/dist/customer-accounts.js +4 -0
- package/dist/customer-notifications.d.ts +143 -0
- package/dist/customer-notifications.js +41 -0
- package/dist/customers.d.ts +52 -0
- package/dist/customers.js +53 -0
- package/dist/dictionary.d.ts +53 -0
- package/dist/dictionary.js +25 -0
- package/dist/document-templates.d.ts +4 -4
- package/dist/email.d.ts +34 -0
- package/dist/email.js +6 -0
- package/dist/errors.d.ts +312 -2
- package/dist/errors.js +377 -2
- package/dist/forms.d.ts +88 -88
- package/dist/i18n.d.ts +34 -0
- package/dist/i18n.js +15 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +12 -1
- package/dist/invoice-ledger.d.ts +6 -6
- package/dist/invoices.d.ts +126 -0
- package/dist/invoices.js +49 -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 +86 -0
- package/dist/mfa.js +90 -0
- package/dist/modules.d.ts +21 -5
- package/dist/modules.js +60 -3
- package/dist/orders.d.ts +141 -0
- package/dist/orders.js +80 -3
- package/dist/organization-hooks.d.ts +99 -0
- package/dist/organization-hooks.js +22 -0
- package/dist/organization-registry-lookup.d.ts +5 -5
- package/dist/organization-roles.d.ts +1 -0
- package/dist/organization-roles.js +7 -0
- package/dist/organizations.d.ts +954 -17
- package/dist/organizations.js +229 -8
- package/dist/price-books.d.ts +173 -25
- package/dist/price-books.js +41 -0
- package/dist/price-lists.d.ts +5 -2
- package/dist/product-feeds.d.ts +157 -8
- package/dist/product-feeds.js +41 -2
- package/dist/product-scopes.d.ts +17 -0
- package/dist/product-scopes.js +31 -5
- package/dist/projects.d.ts +61 -28
- package/dist/projects.js +47 -9
- package/dist/promotions.d.ts +157 -5
- package/dist/promotions.js +23 -1
- package/dist/pwa.d.ts +39 -0
- package/dist/quick-order.d.ts +9 -3
- package/dist/quick-order.js +4 -3
- package/dist/quote-requests.d.ts +168 -5
- package/dist/quote-requests.js +69 -8
- package/dist/record-references.d.ts +15 -15
- package/dist/returns.d.ts +6 -0
- package/dist/returns.js +4 -2
- package/dist/sales-channels.d.ts +34 -3
- package/dist/sales-channels.js +16 -1
- package/dist/schema-extensions.d.ts +36 -0
- package/dist/schema-extensions.js +29 -0
- package/dist/seo.d.ts +2 -2
- package/dist/settings.d.ts +44 -2
- package/dist/settings.js +17 -2
- package/dist/shopping-lists.d.ts +39 -1
- package/dist/shopping-lists.js +37 -3
- package/dist/storefront-cache-tags.d.ts +10 -0
- package/dist/tasks.d.ts +21 -21
- package/dist/taxes.d.ts +27 -0
- package/dist/taxes.js +4 -0
- package/dist/transactional-emails.d.ts +39 -13
- package/dist/webhooks.d.ts +75 -0
- package/dist/webhooks.js +24 -0
- package/package.json +4 -2
- 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/forms-logic.d.ts.map +0 -1
- package/dist/forms-logic.fixtures.d.ts.map +0 -1
- package/dist/forms-logic.fixtures.js.map +0 -1
- package/dist/forms-logic.js.map +0 -1
- package/dist/forms.d.ts.map +0 -1
- package/dist/forms.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/organization-registry-lookup.d.ts.map +0 -1
- package/dist/organization-registry-lookup.js.map +0 -1
- package/dist/organization-roles.d.ts.map +0 -1
- package/dist/organization-roles.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/pim-locale-mapping.d.ts.map +0 -1
- package/dist/pim-locale-mapping.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-model.d.ts.map +0 -1
- package/dist/product-scope-model.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-scoped-values.d.ts.map +0 -1
- package/dist/product-scoped-values.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-tax-rates.d.ts.map +0 -1
- package/dist/product-tax-rates.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-write-encoding.d.ts.map +0 -1
- package/dist/scoped-write-encoding.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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Accept-Language` as an ordered list of tags, heaviest `q` first.
|
|
3
|
+
*
|
|
4
|
+
* RFC 9110 makes the header a q-weighted list, so `split(',')[0]` reads
|
|
5
|
+
* `en;q=0.2,pl;q=0.9` as English. This is the one parse: the platform's
|
|
6
|
+
* prose-language ladder (`kernel/i18n/request-language.ts`) and the channel
|
|
7
|
+
* content-language rule (`requestScopeLanguage`, `product-scopes.ts`) both read
|
|
8
|
+
* the header through it (feature 083 R9; moved here from the kernel by
|
|
9
|
+
* issue #397 so a module can reach it).
|
|
10
|
+
*
|
|
11
|
+
* Bounded twice, because the header is attacker-controlled on every request:
|
|
12
|
+
* to {@link MAX_HEADER_LENGTH} characters and, after weighting, to
|
|
13
|
+
* {@link MAX_TAGS} tags. Exceeding either is not an error — the remainder is
|
|
14
|
+
* simply not read. A malformed `q` drops its tag rather than guessing a weight.
|
|
15
|
+
* `*` is returned as an ordinary tag; no consumer matches it to a language.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseAcceptLanguage(header: string | readonly string[] | undefined): string[];
|
|
18
|
+
/** One element of a parsed `Accept-Language` header: the tag and its weight. */
|
|
19
|
+
export interface WeightedLanguageTag {
|
|
20
|
+
tag: string;
|
|
21
|
+
/** The `q` parameter as written, `1` when absent. Not clamped: `0` and below are kept. */
|
|
22
|
+
q: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* {@link parseAcceptLanguage} with the weights kept, in the same order and under the same
|
|
26
|
+
* bounds. For a consumer that has to tell a tag at `q=0` — "not acceptable" (RFC 9110) — from
|
|
27
|
+
* an ordinary one, as the storefront's locale redirect does (issue #1011); every other reader
|
|
28
|
+
* takes {@link parseAcceptLanguage}.
|
|
29
|
+
*/
|
|
30
|
+
export declare function weightedAcceptLanguage(header: string | readonly string[] | undefined): WeightedLanguageTag[];
|
|
31
|
+
//# sourceMappingURL=accept-language.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Bound on the header read — the parse half of the security bound (D-139 § 8.1). */
|
|
2
|
+
const MAX_HEADER_LENGTH = 512;
|
|
3
|
+
/** Bound on how many tags are considered, applied **after** q-sorting. */
|
|
4
|
+
const MAX_TAGS = 10;
|
|
5
|
+
/**
|
|
6
|
+
* `Accept-Language` as an ordered list of tags, heaviest `q` first.
|
|
7
|
+
*
|
|
8
|
+
* RFC 9110 makes the header a q-weighted list, so `split(',')[0]` reads
|
|
9
|
+
* `en;q=0.2,pl;q=0.9` as English. This is the one parse: the platform's
|
|
10
|
+
* prose-language ladder (`kernel/i18n/request-language.ts`) and the channel
|
|
11
|
+
* content-language rule (`requestScopeLanguage`, `product-scopes.ts`) both read
|
|
12
|
+
* the header through it (feature 083 R9; moved here from the kernel by
|
|
13
|
+
* issue #397 so a module can reach it).
|
|
14
|
+
*
|
|
15
|
+
* Bounded twice, because the header is attacker-controlled on every request:
|
|
16
|
+
* to {@link MAX_HEADER_LENGTH} characters and, after weighting, to
|
|
17
|
+
* {@link MAX_TAGS} tags. Exceeding either is not an error — the remainder is
|
|
18
|
+
* simply not read. A malformed `q` drops its tag rather than guessing a weight.
|
|
19
|
+
* `*` is returned as an ordinary tag; no consumer matches it to a language.
|
|
20
|
+
*/
|
|
21
|
+
export function parseAcceptLanguage(header) {
|
|
22
|
+
return weightedAcceptLanguage(header).map((entry) => entry.tag);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* {@link parseAcceptLanguage} with the weights kept, in the same order and under the same
|
|
26
|
+
* bounds. For a consumer that has to tell a tag at `q=0` — "not acceptable" (RFC 9110) — from
|
|
27
|
+
* an ordinary one, as the storefront's locale redirect does (issue #1011); every other reader
|
|
28
|
+
* takes {@link parseAcceptLanguage}.
|
|
29
|
+
*/
|
|
30
|
+
export function weightedAcceptLanguage(header) {
|
|
31
|
+
const raw = typeof header === 'string' ? header : header?.[0];
|
|
32
|
+
if (!raw)
|
|
33
|
+
return [];
|
|
34
|
+
const weighted = [];
|
|
35
|
+
for (const part of raw.slice(0, MAX_HEADER_LENGTH).split(',')) {
|
|
36
|
+
const [tagPart, ...parameters] = part.split(';');
|
|
37
|
+
const tag = tagPart?.trim() ?? '';
|
|
38
|
+
if (tag.length === 0)
|
|
39
|
+
continue;
|
|
40
|
+
const weight = readWeight(parameters);
|
|
41
|
+
if (weight === null)
|
|
42
|
+
continue;
|
|
43
|
+
weighted.push({ tag, weight, order: weighted.length });
|
|
44
|
+
}
|
|
45
|
+
weighted.sort((a, b) => b.weight - a.weight || a.order - b.order);
|
|
46
|
+
return weighted.slice(0, MAX_TAGS).map((entry) => ({ tag: entry.tag, q: entry.weight }));
|
|
47
|
+
}
|
|
48
|
+
/** The `q` parameter of one list element: its weight, `1` by default, or `null` if malformed. */
|
|
49
|
+
function readWeight(parameters) {
|
|
50
|
+
for (const parameter of parameters) {
|
|
51
|
+
const separator = parameter.indexOf('=');
|
|
52
|
+
if (separator < 0)
|
|
53
|
+
continue;
|
|
54
|
+
if (parameter.slice(0, separator).trim().toLowerCase() !== 'q')
|
|
55
|
+
continue;
|
|
56
|
+
const value = parameter.slice(separator + 1).trim();
|
|
57
|
+
const parsed = Number(value);
|
|
58
|
+
if (value.length === 0 || !Number.isFinite(parsed))
|
|
59
|
+
return null;
|
|
60
|
+
return parsed;
|
|
61
|
+
}
|
|
62
|
+
return 1;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=accept-language.js.map
|
package/dist/admin-actions.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ export declare const ModuleActionSchema: z.ZodObject<{
|
|
|
126
126
|
}>;
|
|
127
127
|
targetRoute: z.ZodString;
|
|
128
128
|
requiredPermission: z.ZodOptional<z.ZodString>;
|
|
129
|
+
entryApiRoute: z.ZodOptional<z.ZodString>;
|
|
129
130
|
keywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
130
131
|
keywordsKey: z.ZodOptional<z.ZodString>;
|
|
131
132
|
weight: z.ZodDefault<z.ZodNumber>;
|
|
@@ -208,6 +209,7 @@ export declare const ModuleActionsManifestSchema: z.ZodArray<z.ZodObject<{
|
|
|
208
209
|
}>;
|
|
209
210
|
targetRoute: z.ZodString;
|
|
210
211
|
requiredPermission: z.ZodOptional<z.ZodString>;
|
|
212
|
+
entryApiRoute: z.ZodOptional<z.ZodString>;
|
|
211
213
|
keywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
212
214
|
keywordsKey: z.ZodOptional<z.ZodString>;
|
|
213
215
|
weight: z.ZodDefault<z.ZodNumber>;
|
package/dist/admin-actions.js
CHANGED
|
@@ -195,6 +195,8 @@ export const KnownIconNameSchema = z.enum([
|
|
|
195
195
|
const actionIdRe = /^[a-z][a-z0-9-]*$/;
|
|
196
196
|
const translationKeyRe = /^[a-z][a-zA-Z0-9_]*(\.[a-z][a-zA-Z0-9_]*)*$/;
|
|
197
197
|
const adminRouteRe = /^\/[A-Za-z0-9/_-]*$/;
|
|
198
|
+
/** A registered admin API path, `:param` segments included — never the bare prefix. */
|
|
199
|
+
const entryApiRouteRe = /^\/api\/v1\/admin(\/[A-Za-z0-9_:.-]+)+$/;
|
|
198
200
|
// ---------------------------------------------------------------------------
|
|
199
201
|
// Manifest-side action declaration
|
|
200
202
|
// ---------------------------------------------------------------------------
|
|
@@ -222,6 +224,22 @@ export const ModuleActionSchema = z.object({
|
|
|
222
224
|
* codebase mixes colon and dot notation; both are accepted by design.
|
|
223
225
|
*/
|
|
224
226
|
requiredPermission: z.string().min(1).max(64).optional(),
|
|
227
|
+
/**
|
|
228
|
+
* Issue #1088 — the admin API route the target screen **opens on**, the
|
|
229
|
+
* request whose gate decides whether the screen renders at all. Declared only
|
|
230
|
+
* where the SPA placement does not name it: the outbox is a tab of
|
|
231
|
+
* `/platform/command-hooks`, and its entry request is
|
|
232
|
+
* `GET /api/v1/admin/command-outbox`. Nothing reads it at runtime —
|
|
233
|
+
* `check:action-route-permissions` compares `requiredPermission` against this
|
|
234
|
+
* route instead of reconstructing one from `targetRoute`, and reports a
|
|
235
|
+
* declaration no registration answers. The method follows the target: GET,
|
|
236
|
+
* or the write verbs for a `/new` create form.
|
|
237
|
+
*/
|
|
238
|
+
entryApiRoute: z
|
|
239
|
+
.string()
|
|
240
|
+
.max(255)
|
|
241
|
+
.regex(entryApiRouteRe, 'Entry API route must be a path under /api/v1/admin/')
|
|
242
|
+
.optional(),
|
|
225
243
|
/**
|
|
226
244
|
* Search words matched in **every** admin language. English, like every
|
|
227
245
|
* other default a manifest carries; a word an operator types in their own
|
|
@@ -52,15 +52,15 @@ export type PermissionRequirement = z.infer<typeof PermissionRequirementSchema>;
|
|
|
52
52
|
* two headings of one each and the operator reads it as two features.
|
|
53
53
|
*/
|
|
54
54
|
export declare const AdminNavSectionNameSchema: z.ZodEnum<{
|
|
55
|
+
catalog: "catalog";
|
|
56
|
+
crm: "crm";
|
|
55
57
|
channels: "channels";
|
|
56
58
|
content: "content";
|
|
57
59
|
system: "system";
|
|
58
60
|
newsletter: "newsletter";
|
|
59
61
|
main: "main";
|
|
60
62
|
sales: "sales";
|
|
61
|
-
crm: "crm";
|
|
62
63
|
work: "work";
|
|
63
|
-
catalog: "catalog";
|
|
64
64
|
inventory: "inventory";
|
|
65
65
|
pricing: "pricing";
|
|
66
66
|
customers: "customers";
|
|
@@ -128,9 +128,30 @@ export declare const AdminZoneNameSchema: z.ZodEnum<{
|
|
|
128
128
|
"task.detail.after": "task.detail.after";
|
|
129
129
|
}>;
|
|
130
130
|
export type AdminZoneName = z.infer<typeof AdminZoneNameSchema>;
|
|
131
|
+
/**
|
|
132
|
+
* The host editor's save session, as a zone contribution sees it (feature 180,
|
|
133
|
+
* `specs/180-one-save-zone-editors/contracts/save-participation.md` §1, FR-002).
|
|
134
|
+
*
|
|
135
|
+
* **Opaque, and carrying no function, on purpose.** The host's
|
|
136
|
+
* `SaveSessionProvider` (`@endora-commerce/admin-kit/lib`) creates it, keeps it
|
|
137
|
+
* stable for the session's life — so `AdminZone`'s per-factory lazy components
|
|
138
|
+
* do not remount — and resolves it back to the live session when a
|
|
139
|
+
* contribution calls `useSaveParticipant(handle, …)`. A function-typed member
|
|
140
|
+
* here would pull React's types into this package.
|
|
141
|
+
*
|
|
142
|
+
* It is a prop of exactly the zones whose host editor has one Save covering its
|
|
143
|
+
* panels (`spec.md` § *Editors that adopt the one Save*). A zone without it
|
|
144
|
+
* offers no session, so a contribution there that tries to take part is a
|
|
145
|
+
* `tsc` error rather than a draft nothing ever saves.
|
|
146
|
+
*/
|
|
147
|
+
export interface EditorSaveSessionHandle {
|
|
148
|
+
readonly sessionId: string;
|
|
149
|
+
}
|
|
131
150
|
/** A zone mounted once per product editor. */
|
|
132
151
|
export interface ProductEditorZoneProps {
|
|
133
152
|
readonly productId: string;
|
|
153
|
+
/** Feature 180 — the product editor's one Save (FR-002). */
|
|
154
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
134
155
|
}
|
|
135
156
|
/**
|
|
136
157
|
* The product editor's SEO zone (feature 174, `contracts/editor-ui.md` §5): the editor scope,
|
|
@@ -189,7 +210,8 @@ export interface InvoiceDetailZoneProps {
|
|
|
189
210
|
readonly ksefReferenceNumber: string | null;
|
|
190
211
|
}
|
|
191
212
|
/**
|
|
192
|
-
* A zone mounted once at the end of the category editor's form
|
|
213
|
+
* A zone mounted once at the end of the category editor's form, before its save
|
|
214
|
+
* row (feature 180, FR-052).
|
|
193
215
|
*
|
|
194
216
|
* The entity's own id and nothing else, which is what the one contribution
|
|
195
217
|
* reads: `DisplayModeOverrideRow` takes a scope and a target id, and the scope
|
|
@@ -198,6 +220,8 @@ export interface InvoiceDetailZoneProps {
|
|
|
198
220
|
*/
|
|
199
221
|
export interface CategoryEditorZoneProps {
|
|
200
222
|
readonly categoryId: string;
|
|
223
|
+
/** Feature 180 — the category editor's Save (FR-002, FR-050). */
|
|
224
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
201
225
|
}
|
|
202
226
|
/**
|
|
203
227
|
* A zone mounted once on the category content screen, around one language's
|
|
@@ -247,6 +271,8 @@ export interface ProductContentEditorZoneProps {
|
|
|
247
271
|
*/
|
|
248
272
|
export interface SalesChannelEditorZoneProps {
|
|
249
273
|
readonly channelId: string;
|
|
274
|
+
/** Feature 180 — the identity form's Save (FR-002, FR-070). */
|
|
275
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
250
276
|
}
|
|
251
277
|
/**
|
|
252
278
|
* A zone mounted once at the end of an organization's detail screen.
|
|
@@ -260,6 +286,8 @@ export interface SalesChannelEditorZoneProps {
|
|
|
260
286
|
*/
|
|
261
287
|
export interface OrganizationDetailZoneProps {
|
|
262
288
|
readonly organizationId: string;
|
|
289
|
+
/** Feature 180 — the organization screen's one Save (FR-002, FR-060). */
|
|
290
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
263
291
|
}
|
|
264
292
|
/**
|
|
265
293
|
* A zone mounted once at the end of a customer's detail screen.
|
|
@@ -271,6 +299,8 @@ export interface OrganizationDetailZoneProps {
|
|
|
271
299
|
*/
|
|
272
300
|
export interface CustomerDetailZoneProps {
|
|
273
301
|
readonly customerId: string;
|
|
302
|
+
/** Feature 180 — the customer screen's one Save (FR-002, FR-060). */
|
|
303
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
274
304
|
}
|
|
275
305
|
/**
|
|
276
306
|
* A zone mounted once as the body of the order detail's Payment tab.
|
|
@@ -426,6 +456,8 @@ export interface ProductEditorFieldZoneProps {
|
|
|
426
456
|
* {@link AdminZoneNameSchema}'s contract.
|
|
427
457
|
*/
|
|
428
458
|
readonly languageCodes: readonly string[] | null;
|
|
459
|
+
/** Feature 180 — the product editor's one Save (FR-002). */
|
|
460
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
429
461
|
}
|
|
430
462
|
/**
|
|
431
463
|
* The props each zone carries, and the contract both ends are checked against.
|
|
@@ -563,15 +595,15 @@ export declare const AdminNavDeclarationSchema: z.ZodObject<{
|
|
|
563
595
|
CalendarDays: "CalendarDays";
|
|
564
596
|
}>;
|
|
565
597
|
section: z.ZodEnum<{
|
|
598
|
+
catalog: "catalog";
|
|
599
|
+
crm: "crm";
|
|
566
600
|
channels: "channels";
|
|
567
601
|
content: "content";
|
|
568
602
|
system: "system";
|
|
569
603
|
newsletter: "newsletter";
|
|
570
604
|
main: "main";
|
|
571
605
|
sales: "sales";
|
|
572
|
-
crm: "crm";
|
|
573
606
|
work: "work";
|
|
574
|
-
catalog: "catalog";
|
|
575
607
|
inventory: "inventory";
|
|
576
608
|
pricing: "pricing";
|
|
577
609
|
customers: "customers";
|
|
@@ -213,11 +213,18 @@ export const AdminZoneNameSchema = z.enum([
|
|
|
213
213
|
*/
|
|
214
214
|
'invoice.detail.after',
|
|
215
215
|
/**
|
|
216
|
-
* The end of the category editor's form,
|
|
216
|
+
* The end of the category editor's form, before its save row.
|
|
217
|
+
*
|
|
218
|
+
* Feature 180 (FR-052) places the mount above the Save / Cancel row, so what
|
|
219
|
+
* the Save covers sits above it; the name is kept. Until the category editor
|
|
220
|
+
* adopts the one Save (WP-6), `CategoriesTree.tsx` still renders it after the
|
|
221
|
+
* row.
|
|
217
222
|
*
|
|
218
223
|
* Mounted **once** per open category, and named from the host's own word for
|
|
219
224
|
* the place (Z14): `catalog`'s `CategoriesTree.tsx` is the editor, and the
|
|
220
|
-
* place is
|
|
225
|
+
* place is the end of its form, after the editor's own fields and before its
|
|
226
|
+
* Save row — what the Save covers sits above it (feature 180, FR-052; the
|
|
227
|
+
* name predates the move and was kept). Props:
|
|
221
228
|
* {@link CategoryEditorZoneProps}.
|
|
222
229
|
*
|
|
223
230
|
* The first member whose contributor is `price_lists`. `catalog` imported
|
package/dist/admin-roles.d.ts
CHANGED
|
@@ -168,6 +168,15 @@ export interface PermissionReadPort {
|
|
|
168
168
|
* failing there. It is a 403 `ADMIN_ROLE_REQUIRED`.
|
|
169
169
|
*/
|
|
170
170
|
resolveRole(adminUserId: string): Promise<AdminRoleResolution>;
|
|
171
|
+
/**
|
|
172
|
+
* {@link resolveRole} for many administrators at once, in a fixed number of
|
|
173
|
+
* reads: every id asked has an entry, the role or the same refusal
|
|
174
|
+
* `resolveRole` answers for it.
|
|
175
|
+
*
|
|
176
|
+
* Added for issue #461: the Projects `@` list asked `resolveRole` (through
|
|
177
|
+
* `adminTenantScopePort`) and `listPermissions` once per candidate.
|
|
178
|
+
*/
|
|
179
|
+
resolveRoles(adminUserIds: readonly string[]): Promise<Map<string, AdminRoleResolution>>;
|
|
171
180
|
}
|
|
172
181
|
/** What {@link PermissionReadPort.resolveRole} answers: a role, or the refusal. */
|
|
173
182
|
export type AdminRoleResolution = {
|
package/dist/admin.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const adminUserSchema: z.ZodObject<{
|
|
|
21
21
|
lastLoginAt: z.ZodNullable<z.ZodString>;
|
|
22
22
|
createdAt: z.ZodString;
|
|
23
23
|
updatedAt: z.ZodString;
|
|
24
|
+
preferredLanguage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
25
|
avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
26
|
bio: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
26
27
|
}, z.core.$strip>;
|
|
@@ -85,6 +86,7 @@ export declare const adminMeResponseSchema: z.ZodObject<{
|
|
|
85
86
|
lastLoginAt: z.ZodNullable<z.ZodString>;
|
|
86
87
|
createdAt: z.ZodString;
|
|
87
88
|
updatedAt: z.ZodString;
|
|
89
|
+
preferredLanguage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
90
|
avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
91
|
bio: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
90
92
|
}, z.core.$strip>;
|
|
@@ -116,6 +118,41 @@ export declare const adminLoginRequestSchema: z.ZodObject<{
|
|
|
116
118
|
email: z.ZodString;
|
|
117
119
|
password: z.ZodString;
|
|
118
120
|
}, z.core.$strip>;
|
|
121
|
+
/**
|
|
122
|
+
* `POST /api/v1/auth/admin/login` — the first sign-in step (issue #599). Only
|
|
123
|
+
* `authenticated` sets the session cookie and names the administrator; the
|
|
124
|
+
* other two arms hand the client the opaque ticket its second step takes.
|
|
125
|
+
*/
|
|
126
|
+
export declare const adminLoginResponseSchema: z.ZodObject<{
|
|
127
|
+
data: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
128
|
+
status: z.ZodLiteral<"authenticated">;
|
|
129
|
+
adminUser: z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
email: z.ZodString;
|
|
132
|
+
firstName: z.ZodString;
|
|
133
|
+
lastName: z.ZodString;
|
|
134
|
+
adminRoleId: z.ZodNullable<z.ZodString>;
|
|
135
|
+
twoFactorEnabled: z.ZodBoolean;
|
|
136
|
+
status: z.ZodEnum<{
|
|
137
|
+
active: "active";
|
|
138
|
+
inactive: "inactive";
|
|
139
|
+
}>;
|
|
140
|
+
lastLoginAt: z.ZodNullable<z.ZodString>;
|
|
141
|
+
createdAt: z.ZodString;
|
|
142
|
+
updatedAt: z.ZodString;
|
|
143
|
+
preferredLanguage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
+
bio: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
+
status: z.ZodLiteral<"mfaRequired">;
|
|
149
|
+
challengeId: z.ZodString;
|
|
150
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
151
|
+
status: z.ZodLiteral<"mfaSetupRequired">;
|
|
152
|
+
setupTicket: z.ZodString;
|
|
153
|
+
}, z.core.$strip>], "status">;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export type AdminLoginResponse = z.infer<typeof adminLoginResponseSchema>;
|
|
119
156
|
export declare const impersonationRequestSchema: z.ZodObject<{
|
|
120
157
|
customerAccountId: z.ZodString;
|
|
121
158
|
reason: z.ZodOptional<z.ZodString>;
|
package/dist/admin.js
CHANGED
|
@@ -21,6 +21,13 @@ export const adminUserSchema = z.object({
|
|
|
21
21
|
lastLoginAt: isoDateTimeSchema.nullable(),
|
|
22
22
|
createdAt: isoDateTimeSchema,
|
|
23
23
|
updatedAt: isoDateTimeSchema,
|
|
24
|
+
/**
|
|
25
|
+
* Feature 019 — the administrator's Admin UI language, `null` when none is
|
|
26
|
+
* saved (the UI then opens in its default). Answered by every admin-user read
|
|
27
|
+
* since 019 and declared here only by issue #599; optional for a client that
|
|
28
|
+
* predates it.
|
|
29
|
+
*/
|
|
30
|
+
preferredLanguage: z.string().nullable().optional(),
|
|
24
31
|
/** Feature 171 (US6) — the author avatar, a library asset. Optional for clients that predate it. */
|
|
25
32
|
avatarAssetId: uuidSchema.nullable().optional(),
|
|
26
33
|
/** Feature 171 (US6) — the author biography per language. */
|
|
@@ -96,6 +103,18 @@ export const adminLoginRequestSchema = z.object({
|
|
|
96
103
|
email: z.string().email(),
|
|
97
104
|
password: z.string(),
|
|
98
105
|
});
|
|
106
|
+
/**
|
|
107
|
+
* `POST /api/v1/auth/admin/login` — the first sign-in step (issue #599). Only
|
|
108
|
+
* `authenticated` sets the session cookie and names the administrator; the
|
|
109
|
+
* other two arms hand the client the opaque ticket its second step takes.
|
|
110
|
+
*/
|
|
111
|
+
export const adminLoginResponseSchema = z.object({
|
|
112
|
+
data: z.discriminatedUnion('status', [
|
|
113
|
+
z.object({ status: z.literal('authenticated'), adminUser: adminUserSchema }),
|
|
114
|
+
z.object({ status: z.literal('mfaRequired'), challengeId: z.string().min(1) }),
|
|
115
|
+
z.object({ status: z.literal('mfaSetupRequired'), setupTicket: z.string().min(1) }),
|
|
116
|
+
]),
|
|
117
|
+
});
|
|
99
118
|
export const impersonationRequestSchema = z.object({
|
|
100
119
|
customerAccountId: uuidSchema,
|
|
101
120
|
reason: z.string().max(2000).optional(),
|
package/dist/api-keys.d.ts
CHANGED
|
@@ -61,6 +61,28 @@ export declare const apiKeySchema: z.ZodObject<{
|
|
|
61
61
|
expiresAt: z.ZodNullable<z.ZodString>;
|
|
62
62
|
}, z.core.$strip>;
|
|
63
63
|
export type ApiKey = z.infer<typeof apiKeySchema>;
|
|
64
|
+
/** `GET /api/v1/admin/api-keys` — every key, revoked ones included, newest first (issue #599). */
|
|
65
|
+
export declare const apiKeyListResponseSchema: z.ZodObject<{
|
|
66
|
+
data: z.ZodArray<z.ZodObject<{
|
|
67
|
+
id: z.ZodString;
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
lastFour: z.ZodString;
|
|
70
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
71
|
+
status: z.ZodEnum<{
|
|
72
|
+
active: "active";
|
|
73
|
+
revoked: "revoked";
|
|
74
|
+
}>;
|
|
75
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
76
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
77
|
+
createdAt: z.ZodString;
|
|
78
|
+
updatedAt: z.ZodString;
|
|
79
|
+
organizationId: z.ZodNullable<z.ZodString>;
|
|
80
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
81
|
+
customerAccountId: z.ZodNullable<z.ZodString>;
|
|
82
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export type ApiKeyListResponse = z.infer<typeof apiKeyListResponseSchema>;
|
|
64
86
|
export declare const createApiKeyRequestSchema: z.ZodObject<{
|
|
65
87
|
name: z.ZodString;
|
|
66
88
|
scopes: z.ZodArray<z.ZodEnum<{
|
package/dist/api-keys.js
CHANGED
|
@@ -55,6 +55,10 @@ export const apiKeySchema = z.object({
|
|
|
55
55
|
customerAccountId: uuidSchema.nullable(),
|
|
56
56
|
expiresAt: isoDateTimeSchema.nullable(),
|
|
57
57
|
});
|
|
58
|
+
/** `GET /api/v1/admin/api-keys` — every key, revoked ones included, newest first (issue #599). */
|
|
59
|
+
export const apiKeyListResponseSchema = z.object({
|
|
60
|
+
data: z.array(apiKeySchema),
|
|
61
|
+
});
|
|
58
62
|
export const createApiKeyRequestSchema = z.object({
|
|
59
63
|
name: z.string().min(1).max(160),
|
|
60
64
|
scopes: z.array(apiKeyScopeSchema).min(1),
|
package/dist/assets-library.d.ts
CHANGED
|
@@ -496,6 +496,25 @@ export interface AssetRecord {
|
|
|
496
496
|
/** Operator-chosen alias, or null. */
|
|
497
497
|
permalink: string | null;
|
|
498
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* The event `assets_library` publishes on the in-process EventBus after a
|
|
501
|
+
* committed write that changes what an embedded asset renders as — its bytes
|
|
502
|
+
* (a replace, a restore of the previous version, and with them the
|
|
503
|
+
* `?v=<contentVersion>` marker), its URL (a permalink set or removed, a
|
|
504
|
+
* visibility change), its rendered details (filename, label, alt text, MIME
|
|
505
|
+
* type), or whether it is live at all (a soft delete, a restore). Issue #363.
|
|
506
|
+
*
|
|
507
|
+
* It exists for whoever caches an answer that **embeds** an asset — `cms`
|
|
508
|
+
* caches resolved pages, blocks and hooks — because such a cache cannot
|
|
509
|
+
* otherwise learn that the embedded asset moved. The owner names no consumer:
|
|
510
|
+
* a subscriber that is absent or switched off simply hears nothing.
|
|
511
|
+
*/
|
|
512
|
+
export declare const ASSET_CHANGED_EVENT = "assets_library.asset_changed.v1";
|
|
513
|
+
/** The payload of {@link ASSET_CHANGED_EVENT}, beside the bus's `eventId` / `occurredAt`. */
|
|
514
|
+
export interface AssetChangedEvent {
|
|
515
|
+
/** The assets the write changed — at least one. */
|
|
516
|
+
readonly assetIds: readonly string[];
|
|
517
|
+
}
|
|
499
518
|
/**
|
|
500
519
|
* Container name: `assetReadPort`. Owner: `assets_library`.
|
|
501
520
|
*
|
package/dist/assets-library.js
CHANGED
|
@@ -277,4 +277,18 @@ export const assetEmbedResolutionSchema = z.object({
|
|
|
277
277
|
label: z.string().nullable(),
|
|
278
278
|
visibility: assetVisibilitySchema,
|
|
279
279
|
});
|
|
280
|
+
/**
|
|
281
|
+
* The event `assets_library` publishes on the in-process EventBus after a
|
|
282
|
+
* committed write that changes what an embedded asset renders as — its bytes
|
|
283
|
+
* (a replace, a restore of the previous version, and with them the
|
|
284
|
+
* `?v=<contentVersion>` marker), its URL (a permalink set or removed, a
|
|
285
|
+
* visibility change), its rendered details (filename, label, alt text, MIME
|
|
286
|
+
* type), or whether it is live at all (a soft delete, a restore). Issue #363.
|
|
287
|
+
*
|
|
288
|
+
* It exists for whoever caches an answer that **embeds** an asset — `cms`
|
|
289
|
+
* caches resolved pages, blocks and hooks — because such a cache cannot
|
|
290
|
+
* otherwise learn that the embedded asset moved. The owner names no consumer:
|
|
291
|
+
* a subscriber that is absent or switched off simply hears nothing.
|
|
292
|
+
*/
|
|
293
|
+
export const ASSET_CHANGED_EVENT = 'assets_library.asset_changed.v1';
|
|
280
294
|
//# sourceMappingURL=assets-library.js.map
|
package/dist/auth.d.ts
CHANGED
|
@@ -32,6 +32,15 @@ export declare const ADMIN_SESSION_COOKIE_NAME = "b2b_admin_session";
|
|
|
32
32
|
* minutes, never in a URL.
|
|
33
33
|
*/
|
|
34
34
|
export declare const MFA_CHALLENGE_COOKIE_NAME = "b2b_mfa_challenge";
|
|
35
|
+
/**
|
|
36
|
+
* The storefront's one-render "your basket was carried over" notice: `adopted`
|
|
37
|
+
* or `merged`, read and cleared by the next page render. Two writers, one
|
|
38
|
+
* reader, as {@link MFA_CHALLENGE_COOKIE_NAME}: the storefront's sign-in
|
|
39
|
+
* actions set it, and so does `mfa`'s federated callback, which signs the
|
|
40
|
+
* customer in with no storefront action in between (issue #1188). `httpOnly`,
|
|
41
|
+
* path `/`, thirty seconds.
|
|
42
|
+
*/
|
|
43
|
+
export declare const CART_MERGE_FLASH_COOKIE_NAME = "b2b_cart_merge_flash";
|
|
35
44
|
/**
|
|
36
45
|
* The cookie a completed administrator sign-in leaves on the device, so that
|
|
37
46
|
* the device is recognised as one the account has been used from.
|
package/dist/auth.js
CHANGED
|
@@ -33,6 +33,15 @@ export const ADMIN_SESSION_COOKIE_NAME = 'b2b_admin_session';
|
|
|
33
33
|
* minutes, never in a URL.
|
|
34
34
|
*/
|
|
35
35
|
export const MFA_CHALLENGE_COOKIE_NAME = 'b2b_mfa_challenge';
|
|
36
|
+
/**
|
|
37
|
+
* The storefront's one-render "your basket was carried over" notice: `adopted`
|
|
38
|
+
* or `merged`, read and cleared by the next page render. Two writers, one
|
|
39
|
+
* reader, as {@link MFA_CHALLENGE_COOKIE_NAME}: the storefront's sign-in
|
|
40
|
+
* actions set it, and so does `mfa`'s federated callback, which signs the
|
|
41
|
+
* customer in with no storefront action in between (issue #1188). `httpOnly`,
|
|
42
|
+
* path `/`, thirty seconds.
|
|
43
|
+
*/
|
|
44
|
+
export const CART_MERGE_FLASH_COOKIE_NAME = 'b2b_cart_merge_flash';
|
|
36
45
|
/**
|
|
37
46
|
* The cookie a completed administrator sign-in leaves on the device, so that
|
|
38
47
|
* the device is recognised as one the account has been used from.
|
package/dist/carts.d.ts
CHANGED
|
@@ -86,6 +86,11 @@ export declare const updateCartItemRequestStrictSchema: z.ZodObject<{
|
|
|
86
86
|
quantity: z.ZodNumber;
|
|
87
87
|
}, z.core.$strip>;
|
|
88
88
|
export type UpdateCartItemRequestStrict = z.infer<typeof updateCartItemRequestStrictSchema>;
|
|
89
|
+
/**
|
|
90
|
+
* `0` removes the line; anything else up to `LINE_QUANTITY_MAX` (issue #351,
|
|
91
|
+
* architect ruling R3 — it stopped at 999, below what the add path accepts, so a
|
|
92
|
+
* buyer could add a line they could then not edit).
|
|
93
|
+
*/
|
|
89
94
|
export declare const updateCartItemRequestSchema: z.ZodObject<{
|
|
90
95
|
quantity: z.ZodNumber;
|
|
91
96
|
}, z.core.$strip>;
|
|
@@ -858,6 +863,13 @@ export declare const cartAuditFeedEntrySchema: z.ZodObject<{
|
|
|
858
863
|
reason: z.ZodNullable<z.ZodString>;
|
|
859
864
|
}, z.core.$strip>;
|
|
860
865
|
export type CartAuditFeedEntry = z.infer<typeof cartAuditFeedEntrySchema>;
|
|
866
|
+
/**
|
|
867
|
+
* @deprecated Since issue #657 — not the shape of `GET
|
|
868
|
+
* /api/v1/organization/carts/:id`, and never was: the route has never answered
|
|
869
|
+
* `cartFullPayloadSchema`'s fields or `auditEntries`, so a real reply fails
|
|
870
|
+
* this schema. Use {@link orgCartDetailViewSchema}, which the route is typed
|
|
871
|
+
* against. Kept, unchanged, until the next breaking-change release removes it.
|
|
872
|
+
*/
|
|
861
873
|
export declare const orgCartDetailPayloadSchema: z.ZodObject<{
|
|
862
874
|
id: z.ZodNullable<z.ZodString>;
|
|
863
875
|
customerAccountId: z.ZodNullable<z.ZodString>;
|
|
@@ -1019,7 +1031,9 @@ export declare const orgCartDetailPayloadSchema: z.ZodObject<{
|
|
|
1019
1031
|
reason: z.ZodNullable<z.ZodString>;
|
|
1020
1032
|
}, z.core.$strip>>;
|
|
1021
1033
|
}, z.core.$strip>;
|
|
1034
|
+
/** @deprecated Since issue #657 — use {@link OrgCartDetailView}. */
|
|
1022
1035
|
export type OrgCartDetailPayload = z.infer<typeof orgCartDetailPayloadSchema>;
|
|
1036
|
+
/** @deprecated Since issue #657 — use {@link orgCartDetailViewResponseSchema}. */
|
|
1023
1037
|
export declare const orgCartDetailResponseSchema: z.ZodObject<{
|
|
1024
1038
|
data: z.ZodObject<{
|
|
1025
1039
|
id: z.ZodNullable<z.ZodString>;
|
|
@@ -1183,6 +1197,7 @@ export declare const orgCartDetailResponseSchema: z.ZodObject<{
|
|
|
1183
1197
|
}, z.core.$strip>>;
|
|
1184
1198
|
}, z.core.$strip>;
|
|
1185
1199
|
}, z.core.$strip>;
|
|
1200
|
+
/** @deprecated Since issue #657 — use {@link OrgCartDetailViewResponse}. */
|
|
1186
1201
|
export type OrgCartDetailResponse = z.infer<typeof orgCartDetailResponseSchema>;
|
|
1187
1202
|
/**
|
|
1188
1203
|
* Issue #650 — one line of {@link orgCartDetailViewSchema}: what the
|
|
@@ -1212,7 +1227,7 @@ export type OrgCartDetailLine = z.infer<typeof orgCartDetailLineSchema>;
|
|
|
1212
1227
|
* {@link orgCartDetailPayloadSchema} above is not this route's shape and never
|
|
1213
1228
|
* was: the route has answered the summary fields plus the approval timestamps
|
|
1214
1229
|
* since feature 027. It is left as published rather than changed under its
|
|
1215
|
-
* consumers.
|
|
1230
|
+
* consumers, and deprecated since issue #657.
|
|
1216
1231
|
*/
|
|
1217
1232
|
export declare const orgCartDetailViewSchema: z.ZodObject<{
|
|
1218
1233
|
id: z.ZodString;
|
|
@@ -1929,6 +1944,19 @@ export interface CartWritePort {
|
|
|
1929
1944
|
*
|
|
1930
1945
|
* `language` names a refused product — the language the response is answered
|
|
1931
1946
|
* in (`request.responseLanguage()`); absent, the record's own fallback chain.
|
|
1947
|
+
* A message language only: it never decides which (channel, language) a line
|
|
1948
|
+
* is asked about.
|
|
1949
|
+
*
|
|
1950
|
+
* `languageTag` (issue #1293) — the buyer request's scope language: the
|
|
1951
|
+
* channel language its `Accept-Language` asks for (`requestScopeLanguage`).
|
|
1952
|
+
* Every line is judged for availability, and a below-minimum line named, at
|
|
1953
|
+
* the basket's (channel, `languageTag` resolved against the channel's own
|
|
1954
|
+
* languages), exactly as `POST /cart/items` judges a line of the same
|
|
1955
|
+
* request. Absent: the channel's default language, as before — the answer
|
|
1956
|
+
* for a caller with no storefront request (an API-key order, an operator
|
|
1957
|
+
* naming a customer's channel). Honoured only while the basket's channel is
|
|
1958
|
+
* the request's resolved one; any other basket is asked about at its
|
|
1959
|
+
* channel's default language.
|
|
1932
1960
|
*/
|
|
1933
1961
|
addItems(actor: {
|
|
1934
1962
|
customer?: CartCustomerContext;
|
|
@@ -1939,6 +1967,7 @@ export interface CartWritePort {
|
|
|
1939
1967
|
workingBasket?: boolean;
|
|
1940
1968
|
keepRepeatedLines?: boolean;
|
|
1941
1969
|
language?: string;
|
|
1970
|
+
languageTag?: string;
|
|
1942
1971
|
}): Promise<CartWithItems & {
|
|
1943
1972
|
outcomes: CartBatchLineOutcome[];
|
|
1944
1973
|
}>;
|
package/dist/carts.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { isoDateTimeSchema, moneySchema, uuidSchema } from './common.js';
|
|
3
|
+
import { boundedLineQuantity, lineQuantitySchema } from './line-bounds.js';
|
|
3
4
|
/**
|
|
4
5
|
* Cart + CartItem contracts. The Cart can be anonymous (cookie-held) or
|
|
5
6
|
* logged-in; `mergeAnonymousOnLogin` merges the anonymous basket into the
|
|
@@ -54,9 +55,10 @@ export const addCartItemRequestSchema = z.object({
|
|
|
54
55
|
/**
|
|
55
56
|
* Without `packagingUnitId` this is the number of base pieces. With
|
|
56
57
|
* `packagingUnitId` it is the number of packaging units, and the resulting
|
|
57
|
-
* line quantity is `unit.baseQuantity × quantity` (feature 043).
|
|
58
|
+
* line quantity is `unit.baseQuantity × quantity` (feature 043). At most
|
|
59
|
+
* `LINE_QUANTITY_MAX` (issue #351).
|
|
58
60
|
*/
|
|
59
|
-
quantity:
|
|
61
|
+
quantity: lineQuantitySchema,
|
|
60
62
|
/** Feature 043 — order by a packaging unit (e.g. a pallet) of this product. */
|
|
61
63
|
packagingUnitId: uuidSchema.optional(),
|
|
62
64
|
});
|
|
@@ -66,10 +68,15 @@ export const addCartItemRequestSchema = z.object({
|
|
|
66
68
|
// is kept as `updateCartItemRequestStrictSchema` for any caller that still
|
|
67
69
|
// needs the positive-only check.
|
|
68
70
|
export const updateCartItemRequestStrictSchema = z.object({
|
|
69
|
-
quantity:
|
|
71
|
+
quantity: lineQuantitySchema,
|
|
70
72
|
});
|
|
73
|
+
/**
|
|
74
|
+
* `0` removes the line; anything else up to `LINE_QUANTITY_MAX` (issue #351,
|
|
75
|
+
* architect ruling R3 — it stopped at 999, below what the add path accepts, so a
|
|
76
|
+
* buyer could add a line they could then not edit).
|
|
77
|
+
*/
|
|
71
78
|
export const updateCartItemRequestSchema = z.object({
|
|
72
|
-
quantity: z.number().int().min(0)
|
|
79
|
+
quantity: boundedLineQuantity(z.number().int().min(0)),
|
|
73
80
|
});
|
|
74
81
|
// ────────────────────────────────────────────────────────────────────────
|
|
75
82
|
// Feature 027 — status & approval enums (shared across surfaces)
|
|
@@ -462,11 +469,19 @@ export const cartAuditFeedEntrySchema = z.object({
|
|
|
462
469
|
toState: z.string().nullable(),
|
|
463
470
|
reason: z.string().nullable(),
|
|
464
471
|
});
|
|
472
|
+
/**
|
|
473
|
+
* @deprecated Since issue #657 — not the shape of `GET
|
|
474
|
+
* /api/v1/organization/carts/:id`, and never was: the route has never answered
|
|
475
|
+
* `cartFullPayloadSchema`'s fields or `auditEntries`, so a real reply fails
|
|
476
|
+
* this schema. Use {@link orgCartDetailViewSchema}, which the route is typed
|
|
477
|
+
* against. Kept, unchanged, until the next breaking-change release removes it.
|
|
478
|
+
*/
|
|
465
479
|
export const orgCartDetailPayloadSchema = cartFullPayloadSchema.extend({
|
|
466
480
|
ownerCustomerAccountId: uuidSchema,
|
|
467
481
|
ownerDisplayName: z.string(),
|
|
468
482
|
auditEntries: z.array(cartAuditFeedEntrySchema),
|
|
469
483
|
});
|
|
484
|
+
/** @deprecated Since issue #657 — use {@link orgCartDetailViewResponseSchema}. */
|
|
470
485
|
export const orgCartDetailResponseSchema = z.object({ data: orgCartDetailPayloadSchema });
|
|
471
486
|
/**
|
|
472
487
|
* Issue #650 — one line of {@link orgCartDetailViewSchema}: what the
|
|
@@ -490,7 +505,7 @@ export const orgCartDetailLineSchema = z.object({
|
|
|
490
505
|
* {@link orgCartDetailPayloadSchema} above is not this route's shape and never
|
|
491
506
|
* was: the route has answered the summary fields plus the approval timestamps
|
|
492
507
|
* since feature 027. It is left as published rather than changed under its
|
|
493
|
-
* consumers.
|
|
508
|
+
* consumers, and deprecated since issue #657.
|
|
494
509
|
*/
|
|
495
510
|
export const orgCartDetailViewSchema = orgCartSummarySchema.extend({
|
|
496
511
|
ownerCustomerAccountId: uuidSchema.nullable(),
|