@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
|
@@ -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/actor.d.ts
CHANGED
|
@@ -53,12 +53,28 @@ export interface ActorCustomer {
|
|
|
53
53
|
* that requires an Organization asserts it (`customerContextResolver`).
|
|
54
54
|
*/
|
|
55
55
|
organizationId: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The member's organization role (`specs/170-organization-roles/`, research
|
|
58
|
+
* R-15). The auth hook reads the account behind the session once per request
|
|
59
|
+
* and stamps the role id it holds, so a permission check on the cart path
|
|
60
|
+
* costs no read of its own. `null` (or absent) when the resolver answers none
|
|
61
|
+
* — the permission port then reads the account itself.
|
|
62
|
+
*/
|
|
63
|
+
organizationRoleId?: string | null;
|
|
56
64
|
/** Non-null when a Supplier employee is acting on behalf of this Customer. */
|
|
57
65
|
impersonatorAdminUserId: string | null;
|
|
58
66
|
}
|
|
59
67
|
export interface ActorAdmin {
|
|
60
68
|
kind: 'admin';
|
|
61
69
|
adminUserId: string;
|
|
70
|
+
/**
|
|
71
|
+
* Issue #349, E-349-1 — the id of the session the actor was resolved from,
|
|
72
|
+
* when it was resolved from one. A write that ends other administrators'
|
|
73
|
+
* sessions spares this one; a write that reaches that consequence through an
|
|
74
|
+
* event names it there, because the cookie it came from is a credential and
|
|
75
|
+
* the id alone is not. Absent for an actor not resolved from a session.
|
|
76
|
+
*/
|
|
77
|
+
sessionId?: string;
|
|
62
78
|
}
|
|
63
79
|
/**
|
|
64
80
|
* An integration authenticated by a bearer key (feature 062). All three binding
|
package/dist/addresses.d.ts
CHANGED
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
* customer-facing address routes over this module's table.
|
|
14
14
|
*/
|
|
15
15
|
export type AddressKindValue = 'delivery' | 'billing';
|
|
16
|
+
/**
|
|
17
|
+
* The codes a redacted `address` audit row keeps (issue #844).
|
|
18
|
+
*
|
|
19
|
+
* Owner: `addresses`; **codes only** — see `CUSTOMER_ACCOUNT_AUDIT_KEEP_KEYS`
|
|
20
|
+
* for the rule they extend. The anonymisation scrub keeps an address's country,
|
|
21
|
+
* so its history may keep the country code too.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ADDRESS_AUDIT_KEEP_KEYS: readonly string[];
|
|
16
24
|
/**
|
|
17
25
|
* An address as it crosses a module boundary — a plain shape, never the ORM
|
|
18
26
|
* entity (FR-011).
|
|
@@ -97,6 +105,17 @@ export interface AddressReadPort {
|
|
|
97
105
|
listForOrganization(organizationId: string, kind?: AddressKindValue): Promise<AddressRecord[]>;
|
|
98
106
|
/** The organisation's default address of that kind, or `null`. */
|
|
99
107
|
findDefault(organizationId: string, kind: AddressKindValue): Promise<AddressRecord | null>;
|
|
108
|
+
/**
|
|
109
|
+
* The ids of the organisation's addresses, oldest first — live ones only
|
|
110
|
+
* unless `includeDeleted` is `true`, which adds every soft-deleted row
|
|
111
|
+
* (issue #927). Ids only: a caller that needs to name the rows an
|
|
112
|
+
* anonymised subject ever had (`customers`' retention sweep, #844) asks for
|
|
113
|
+
* the deleted ones too, and needs none of their content. Never another
|
|
114
|
+
* organisation's rows.
|
|
115
|
+
*/
|
|
116
|
+
listIdsForOrganization(organizationId: string, options?: {
|
|
117
|
+
includeDeleted?: boolean;
|
|
118
|
+
}): Promise<string[]>;
|
|
100
119
|
}
|
|
101
120
|
/**
|
|
102
121
|
* Container name: `addressServicePort`. Owner: `addresses`.
|
|
@@ -130,5 +149,21 @@ export interface AddressServicePort {
|
|
|
130
149
|
createAddress(organizationId: string, input: CreateAddressInput): Promise<AddressRecord>;
|
|
131
150
|
updateAddress(organizationId: string, addressId: string, patch: UpdateAddressInput): Promise<AddressRecord>;
|
|
132
151
|
deleteAddress(organizationId: string, addressId: string): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Clear **and** blank every address of the Organization
|
|
154
|
+
* (`specs/173-b2c-address-book-merge/` OD-7): `recipientName`, `street`,
|
|
155
|
+
* `city` and `postalCode` become `'-'`, `phone` `null`, `isDefault` `false`,
|
|
156
|
+
* the country stays and the row is soft-deleted. **Every** row, the ones
|
|
157
|
+
* already soft-deleted included (issue #927): an address the customer
|
|
158
|
+
* deleted still holds their data, and it keeps its own `deletedAt`. A row
|
|
159
|
+
* already fully scrubbed is not selected, so a repeat call writes nothing.
|
|
160
|
+
* One `address.anonymized` audit entry per row scrubbed, with a null actor
|
|
161
|
+
* and no personal data — `stateBefore` names the organisation, the kind and
|
|
162
|
+
* `wasDeleted`. Answers how many rows it scrubbed.
|
|
163
|
+
*
|
|
164
|
+
* The retention sweep's call, for a personal Organization it has just
|
|
165
|
+
* anonymized; order snapshots are copies on `orders`' rows and are untouched.
|
|
166
|
+
*/
|
|
167
|
+
anonymizeForOrganization(organizationId: string): Promise<number>;
|
|
133
168
|
}
|
|
134
169
|
//# sourceMappingURL=addresses.d.ts.map
|
package/dist/addresses.js
CHANGED
|
@@ -12,5 +12,12 @@
|
|
|
12
12
|
* shapes are `organizations.ts`' business, because that module serves the
|
|
13
13
|
* customer-facing address routes over this module's table.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The codes a redacted `address` audit row keeps (issue #844).
|
|
17
|
+
*
|
|
18
|
+
* Owner: `addresses`; **codes only** — see `CUSTOMER_ACCOUNT_AUDIT_KEEP_KEYS`
|
|
19
|
+
* for the rule they extend. The anonymisation scrub keeps an address's country,
|
|
20
|
+
* so its history may keep the country code too.
|
|
21
|
+
*/
|
|
22
|
+
export const ADDRESS_AUDIT_KEEP_KEYS = ['countryCode'];
|
|
16
23
|
//# sourceMappingURL=addresses.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
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
* the `AdminRouteDeclaration` interface.
|
|
28
28
|
*/
|
|
29
29
|
import { z } from 'zod';
|
|
30
|
+
import type { ScopeRef } from './product-scope-model.js';
|
|
31
|
+
import type { ScopedValuesData } from './product-scoped-values.js';
|
|
32
|
+
import type { ScopedWriteOp } from './scoped-write-encoding.js';
|
|
30
33
|
import type { InvoiceKind } from './invoices.js';
|
|
31
34
|
import type { ShipmentStatus } from './shipping-methods.js';
|
|
32
35
|
/**
|
|
@@ -49,18 +52,18 @@ export type PermissionRequirement = z.infer<typeof PermissionRequirementSchema>;
|
|
|
49
52
|
* two headings of one each and the operator reads it as two features.
|
|
50
53
|
*/
|
|
51
54
|
export declare const AdminNavSectionNameSchema: z.ZodEnum<{
|
|
55
|
+
catalog: "catalog";
|
|
56
|
+
crm: "crm";
|
|
57
|
+
channels: "channels";
|
|
52
58
|
content: "content";
|
|
53
59
|
system: "system";
|
|
54
60
|
newsletter: "newsletter";
|
|
55
61
|
main: "main";
|
|
56
62
|
sales: "sales";
|
|
57
|
-
crm: "crm";
|
|
58
63
|
work: "work";
|
|
59
|
-
catalog: "catalog";
|
|
60
64
|
inventory: "inventory";
|
|
61
65
|
pricing: "pricing";
|
|
62
66
|
customers: "customers";
|
|
63
|
-
channels: "channels";
|
|
64
67
|
messaging: "messaging";
|
|
65
68
|
analyticsAds: "analyticsAds";
|
|
66
69
|
}>;
|
|
@@ -107,7 +110,7 @@ export declare const AdminZoneNameSchema: z.ZodEnum<{
|
|
|
107
110
|
"category.editor.after": "category.editor.after";
|
|
108
111
|
"product.editor.pricing.after": "product.editor.pricing.after";
|
|
109
112
|
"product.editor.channels": "product.editor.channels";
|
|
110
|
-
"product.editor.seo
|
|
113
|
+
"product.editor.seo": "product.editor.seo";
|
|
111
114
|
"sales_channel.editor.after": "sales_channel.editor.after";
|
|
112
115
|
"organization.detail.after": "organization.detail.after";
|
|
113
116
|
"customer.detail.after": "customer.detail.after";
|
|
@@ -120,13 +123,60 @@ export declare const AdminZoneNameSchema: z.ZodEnum<{
|
|
|
120
123
|
"order.entry.tabs": "order.entry.tabs";
|
|
121
124
|
"ledger.section.tabs": "ledger.section.tabs";
|
|
122
125
|
"category.content.editor": "category.content.editor";
|
|
126
|
+
"product.content.editor": "product.content.editor";
|
|
123
127
|
"settings.setting.after": "settings.setting.after";
|
|
124
128
|
"task.detail.after": "task.detail.after";
|
|
125
129
|
}>;
|
|
126
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
|
+
}
|
|
127
150
|
/** A zone mounted once per product editor. */
|
|
128
151
|
export interface ProductEditorZoneProps {
|
|
129
152
|
readonly productId: string;
|
|
153
|
+
/** Feature 180 — the product editor's one Save (FR-002). */
|
|
154
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The product editor's SEO zone (feature 174, `contracts/editor-ui.md` §5): the editor scope,
|
|
158
|
+
* the SEO block of the scoped-values read, and the staging callback into catalog's one Save.
|
|
159
|
+
*/
|
|
160
|
+
export interface ProductEditorSeoZoneProps {
|
|
161
|
+
readonly productId: string;
|
|
162
|
+
readonly scope: ScopeRef;
|
|
163
|
+
/** "Global", "<channel>" or "<channel> · <language>", already translated. */
|
|
164
|
+
readonly scopeLabel: string;
|
|
165
|
+
/** The scope one level up, already translated; `null` at Global. */
|
|
166
|
+
readonly parentScopeLabel: string | null;
|
|
167
|
+
readonly view: ScopedValuesData['seo'];
|
|
168
|
+
/** The staged SEO cells, keyed by field (`title`, `description`, …). */
|
|
169
|
+
readonly staged: ReadonlyMap<string, ScopedWriteOp<string>>;
|
|
170
|
+
onStage(field: string, op: ScopedWriteOp<string> | undefined): void;
|
|
171
|
+
readonly readOnly: boolean;
|
|
172
|
+
/** Field → translated error message from the last save. */
|
|
173
|
+
readonly errors: Readonly<Record<string, string>>;
|
|
174
|
+
/**
|
|
175
|
+
* The product's scope version (`scoped-values-api.md` R7) of the editor's last read, Save or
|
|
176
|
+
* copy; `null` before the first read. A change means saved values moved, so the zone re-reads
|
|
177
|
+
* what it derives from them.
|
|
178
|
+
*/
|
|
179
|
+
readonly version: string | null;
|
|
130
180
|
}
|
|
131
181
|
/**
|
|
132
182
|
* A zone mounted once on the delivery-methods list, carrying nothing.
|
|
@@ -160,7 +210,8 @@ export interface InvoiceDetailZoneProps {
|
|
|
160
210
|
readonly ksefReferenceNumber: string | null;
|
|
161
211
|
}
|
|
162
212
|
/**
|
|
163
|
-
* 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).
|
|
164
215
|
*
|
|
165
216
|
* The entity's own id and nothing else, which is what the one contribution
|
|
166
217
|
* reads: `DisplayModeOverrideRow` takes a scope and a target id, and the scope
|
|
@@ -169,6 +220,8 @@ export interface InvoiceDetailZoneProps {
|
|
|
169
220
|
*/
|
|
170
221
|
export interface CategoryEditorZoneProps {
|
|
171
222
|
readonly categoryId: string;
|
|
223
|
+
/** Feature 180 — the category editor's Save (FR-002, FR-050). */
|
|
224
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
172
225
|
}
|
|
173
226
|
/**
|
|
174
227
|
* A zone mounted once on the category content screen, around one language's
|
|
@@ -190,6 +243,25 @@ export interface CategoryContentEditorZoneProps {
|
|
|
190
243
|
/** Reports the edited document. The host saves; the contributor never does. */
|
|
191
244
|
readonly onChange: (data: unknown) => void;
|
|
192
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* A zone mounted once on the product content screen, around one content
|
|
248
|
+
* attribute's Page Builder document in one language.
|
|
249
|
+
*
|
|
250
|
+
* {@link CategoryContentEditorZoneProps}' terms: the document is `unknown` on
|
|
251
|
+
* both sides of the seam, the host re-mounts the zone per language, and the
|
|
252
|
+
* contributor reports every edit through `onChange` and never saves.
|
|
253
|
+
*/
|
|
254
|
+
export interface ProductContentEditorZoneProps {
|
|
255
|
+
readonly productId: string;
|
|
256
|
+
/** The content attribute being edited (its immutable key). */
|
|
257
|
+
readonly attributeKey: string;
|
|
258
|
+
/** The content language being edited — a key of the stored envelope. */
|
|
259
|
+
readonly language: string;
|
|
260
|
+
/** That language's Page Builder document, or `null` when none is stored. */
|
|
261
|
+
readonly data: unknown;
|
|
262
|
+
/** Reports the edited document. The host saves; the contributor never does. */
|
|
263
|
+
readonly onChange: (data: unknown) => void;
|
|
264
|
+
}
|
|
193
265
|
/**
|
|
194
266
|
* A zone mounted once below the sales-channel editor's identity form.
|
|
195
267
|
*
|
|
@@ -199,6 +271,8 @@ export interface CategoryContentEditorZoneProps {
|
|
|
199
271
|
*/
|
|
200
272
|
export interface SalesChannelEditorZoneProps {
|
|
201
273
|
readonly channelId: string;
|
|
274
|
+
/** Feature 180 — the identity form's Save (FR-002, FR-070). */
|
|
275
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
202
276
|
}
|
|
203
277
|
/**
|
|
204
278
|
* A zone mounted once at the end of an organization's detail screen.
|
|
@@ -212,6 +286,8 @@ export interface SalesChannelEditorZoneProps {
|
|
|
212
286
|
*/
|
|
213
287
|
export interface OrganizationDetailZoneProps {
|
|
214
288
|
readonly organizationId: string;
|
|
289
|
+
/** Feature 180 — the organization screen's one Save (FR-002, FR-060). */
|
|
290
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
215
291
|
}
|
|
216
292
|
/**
|
|
217
293
|
* A zone mounted once at the end of a customer's detail screen.
|
|
@@ -223,6 +299,8 @@ export interface OrganizationDetailZoneProps {
|
|
|
223
299
|
*/
|
|
224
300
|
export interface CustomerDetailZoneProps {
|
|
225
301
|
readonly customerId: string;
|
|
302
|
+
/** Feature 180 — the customer screen's one Save (FR-002, FR-060). */
|
|
303
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
226
304
|
}
|
|
227
305
|
/**
|
|
228
306
|
* A zone mounted once as the body of the order detail's Payment tab.
|
|
@@ -361,9 +439,14 @@ export interface ProductEditorFieldZoneProps {
|
|
|
361
439
|
* `attributeValues.<key>`.
|
|
362
440
|
*/
|
|
363
441
|
readonly fieldPath: string;
|
|
442
|
+
/**
|
|
443
|
+
* Feature 174 (FR-106) — the editor scope the field is shown at. Optional: a contributor
|
|
444
|
+
* that ignores it keeps working.
|
|
445
|
+
*/
|
|
446
|
+
readonly scope?: ScopeRef;
|
|
364
447
|
/**
|
|
365
448
|
* The locales this field is edited in, or `null` for a field that is not
|
|
366
|
-
* language-scoped.
|
|
449
|
+
* language-scoped. Feature 174: the host passes `null` (protection is whole-field, FR-046).
|
|
367
450
|
*
|
|
368
451
|
* The host passes the set; a contributor that wants one control per locale
|
|
369
452
|
* fans out over it. That is what collapses the two `LOCALES.map(...)` loops
|
|
@@ -373,6 +456,8 @@ export interface ProductEditorFieldZoneProps {
|
|
|
373
456
|
* {@link AdminZoneNameSchema}'s contract.
|
|
374
457
|
*/
|
|
375
458
|
readonly languageCodes: readonly string[] | null;
|
|
459
|
+
/** Feature 180 — the product editor's one Save (FR-002). */
|
|
460
|
+
readonly saveSession: EditorSaveSessionHandle;
|
|
376
461
|
}
|
|
377
462
|
/**
|
|
378
463
|
* The props each zone carries, and the contract both ends are checked against.
|
|
@@ -403,7 +488,7 @@ export interface AdminZonePropsMap extends Record<AdminZoneName, object> {
|
|
|
403
488
|
'category.editor.after': CategoryEditorZoneProps;
|
|
404
489
|
'product.editor.pricing.after': ProductEditorZoneProps;
|
|
405
490
|
'product.editor.channels': ProductEditorZoneProps;
|
|
406
|
-
'product.editor.seo
|
|
491
|
+
'product.editor.seo': ProductEditorSeoZoneProps;
|
|
407
492
|
'sales_channel.editor.after': SalesChannelEditorZoneProps;
|
|
408
493
|
'organization.detail.after': OrganizationDetailZoneProps;
|
|
409
494
|
'customer.detail.after': CustomerDetailZoneProps;
|
|
@@ -416,6 +501,7 @@ export interface AdminZonePropsMap extends Record<AdminZoneName, object> {
|
|
|
416
501
|
'order.entry.tabs': OrderEntryTabsZoneProps;
|
|
417
502
|
'ledger.section.tabs': LedgerSectionTabsZoneProps;
|
|
418
503
|
'category.content.editor': CategoryContentEditorZoneProps;
|
|
504
|
+
'product.content.editor': ProductContentEditorZoneProps;
|
|
419
505
|
'settings.setting.after': SettingsSettingAfterZoneProps;
|
|
420
506
|
'task.detail.after': TaskDetailZoneProps;
|
|
421
507
|
}
|
|
@@ -509,18 +595,18 @@ export declare const AdminNavDeclarationSchema: z.ZodObject<{
|
|
|
509
595
|
CalendarDays: "CalendarDays";
|
|
510
596
|
}>;
|
|
511
597
|
section: z.ZodEnum<{
|
|
598
|
+
catalog: "catalog";
|
|
599
|
+
crm: "crm";
|
|
600
|
+
channels: "channels";
|
|
512
601
|
content: "content";
|
|
513
602
|
system: "system";
|
|
514
603
|
newsletter: "newsletter";
|
|
515
604
|
main: "main";
|
|
516
605
|
sales: "sales";
|
|
517
|
-
crm: "crm";
|
|
518
606
|
work: "work";
|
|
519
|
-
catalog: "catalog";
|
|
520
607
|
inventory: "inventory";
|
|
521
608
|
pricing: "pricing";
|
|
522
609
|
customers: "customers";
|
|
523
|
-
channels: "channels";
|
|
524
610
|
messaging: "messaging";
|
|
525
611
|
analyticsAds: "analyticsAds";
|
|
526
612
|
}>;
|
|
@@ -545,7 +631,7 @@ export declare const AdminZoneContributionSchema: z.ZodObject<{
|
|
|
545
631
|
"category.editor.after": "category.editor.after";
|
|
546
632
|
"product.editor.pricing.after": "product.editor.pricing.after";
|
|
547
633
|
"product.editor.channels": "product.editor.channels";
|
|
548
|
-
"product.editor.seo
|
|
634
|
+
"product.editor.seo": "product.editor.seo";
|
|
549
635
|
"sales_channel.editor.after": "sales_channel.editor.after";
|
|
550
636
|
"organization.detail.after": "organization.detail.after";
|
|
551
637
|
"customer.detail.after": "customer.detail.after";
|
|
@@ -558,6 +644,7 @@ export declare const AdminZoneContributionSchema: z.ZodObject<{
|
|
|
558
644
|
"order.entry.tabs": "order.entry.tabs";
|
|
559
645
|
"ledger.section.tabs": "ledger.section.tabs";
|
|
560
646
|
"category.content.editor": "category.content.editor";
|
|
647
|
+
"product.content.editor": "product.content.editor";
|
|
561
648
|
"settings.setting.after": "settings.setting.after";
|
|
562
649
|
"task.detail.after": "task.detail.after";
|
|
563
650
|
}>;
|
|
@@ -586,8 +673,8 @@ export declare const AdminZoneContributionSchema: z.ZodObject<{
|
|
|
586
673
|
export declare const AdminBlockContributionSchema: z.ZodObject<{
|
|
587
674
|
name: z.ZodString;
|
|
588
675
|
context: z.ZodEnum<{
|
|
589
|
-
cms: "cms";
|
|
590
676
|
email: "email";
|
|
677
|
+
cms: "cms";
|
|
591
678
|
document: "document";
|
|
592
679
|
}>;
|
|
593
680
|
}, z.core.$strip>;
|
|
@@ -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
|
|
@@ -252,16 +259,14 @@ export const AdminZoneNameSchema = z.enum([
|
|
|
252
259
|
*/
|
|
253
260
|
'product.editor.channels',
|
|
254
261
|
/**
|
|
255
|
-
* The
|
|
256
|
-
*
|
|
257
|
-
* Mounted **once** per editor. Props: {@link ProductEditorZoneProps}.
|
|
262
|
+
* The product editor's SEO section at the editor scope (feature 174, FR-090…FR-092,
|
|
263
|
+
* `contracts/editor-ui.md` §5). Replaces 163's `product.editor.seo.after`.
|
|
258
264
|
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* The product id travels so a contribution can address the product itself.
|
|
265
|
+
* Mounted **once** per editor. Props: {@link ProductEditorSeoZoneProps}. `seo` contributes
|
|
266
|
+
* its fields here, staged into catalog's one Save; `catalog` renders the SEO tab only when the
|
|
267
|
+
* zone has a contributor, so with `seo` off there is no tab, no request and no error.
|
|
263
268
|
*/
|
|
264
|
-
'product.editor.seo
|
|
269
|
+
'product.editor.seo',
|
|
265
270
|
/**
|
|
266
271
|
* Below the sales-channel editor's identity form.
|
|
267
272
|
*
|
|
@@ -499,6 +504,27 @@ export const AdminZoneNameSchema = z.enum([
|
|
|
499
504
|
* stored stays stored and keeps rendering.
|
|
500
505
|
*/
|
|
501
506
|
'category.content.editor',
|
|
507
|
+
/**
|
|
508
|
+
* The editor of one product content attribute's Page Builder document, one
|
|
509
|
+
* language at a time (`specs/172-product-content-attributes/`).
|
|
510
|
+
*
|
|
511
|
+
* Mounted **once** on `catalog`'s product content screen
|
|
512
|
+
* (`ProductContentPage.tsx`), named from the host's own words for the place
|
|
513
|
+
* (Z14): the screen is the product's *content*, the place is its *editor*.
|
|
514
|
+
* Props: {@link ProductContentEditorZoneProps}.
|
|
515
|
+
*
|
|
516
|
+
* **The direction is inverted, as on `category.content.editor` and for the
|
|
517
|
+
* same reason.** `catalog` is `nonDeactivatable` and `cms` is switchable, so
|
|
518
|
+
* `catalog` can neither declare an edge to the Page Builder's owner (it would
|
|
519
|
+
* make `cms.enabled` a dead switch) nor import it undeclared. The host owns
|
|
520
|
+
* the document, its storage and its save; whoever owns a Page Builder
|
|
521
|
+
* contributes the canvas and reports edits through `onChange`. `catalog`
|
|
522
|
+
* names no module. A platform with no contributor shows the host's own
|
|
523
|
+
* notice (Z15) and offers no save, and the stored content stays stored —
|
|
524
|
+
* unlike category content it is not rendered on the storefront while the
|
|
525
|
+
* CMS is off (spec FR-051, owner ruling OR-7).
|
|
526
|
+
*/
|
|
527
|
+
'product.content.editor',
|
|
502
528
|
/**
|
|
503
529
|
* Below the field of one setting on the Settings screen.
|
|
504
530
|
*
|
package/dist/admin-roles.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ export interface AdminRoleRecord {
|
|
|
22
22
|
name: string;
|
|
23
23
|
/** Permission codes granted by this role. */
|
|
24
24
|
permissions: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Holders must sign in with a second factor. Read by `mfa` at sign-in
|
|
27
|
+
* (`MfaPolicyResolver`), beside the platform-wide `mfa.admin.totp_enforced`;
|
|
28
|
+
* no effect while `mfa` is absent (D-96).
|
|
29
|
+
*/
|
|
25
30
|
requiresTwoFactor: boolean;
|
|
26
31
|
createdAt: Date;
|
|
27
32
|
updatedAt: Date;
|
|
@@ -72,8 +77,9 @@ export declare function permissionsNotHeld(requested: readonly string[], held: r
|
|
|
72
77
|
* Nothing in the tree ever did — `admin_users` resolves `adminRolePort` — but the
|
|
73
78
|
* comment was a standing invitation to.)
|
|
74
79
|
*
|
|
75
|
-
* `admin_users` reads a role to render it beside its user
|
|
76
|
-
* role's
|
|
80
|
+
* `admin_users` reads a role to render it beside its user; `mfa` reads the
|
|
81
|
+
* role's two-factor flag through {@link PermissionReadPort.resolveRole} at
|
|
82
|
+
* sign-in (issue #349). `remove` refuses a role whose code was
|
|
77
83
|
* registered as system-protected (feature 016 FR-025), and that refusal stays
|
|
78
84
|
* on this side of the port. So does the grant ceiling `upsertByCode` applies
|
|
79
85
|
* when it is given a grantor — see {@link UpsertAdminRoleOptions}.
|
|
@@ -162,6 +168,15 @@ export interface PermissionReadPort {
|
|
|
162
168
|
* failing there. It is a 403 `ADMIN_ROLE_REQUIRED`.
|
|
163
169
|
*/
|
|
164
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>>;
|
|
165
180
|
}
|
|
166
181
|
/** What {@link PermissionReadPort.resolveRole} answers: a role, or the refusal. */
|
|
167
182
|
export type AdminRoleResolution = {
|
package/dist/admin-users.d.ts
CHANGED
|
@@ -30,6 +30,10 @@ export interface AdminUserRecord {
|
|
|
30
30
|
lastLoginAt: Date | null;
|
|
31
31
|
/** Admin-UI language override, or `null` to follow the platform default. */
|
|
32
32
|
preferredLanguage: string | null;
|
|
33
|
+
/** Feature 171 (US6) — the author avatar, a library asset id. */
|
|
34
|
+
avatarAssetId: string | null;
|
|
35
|
+
/** Feature 171 (US6) — the author biography per language. */
|
|
36
|
+
bio: Record<string, string> | null;
|
|
33
37
|
createdAt: Date;
|
|
34
38
|
updatedAt: Date;
|
|
35
39
|
deletedAt: Date | null;
|
|
@@ -61,6 +65,11 @@ export interface AdminUserReadPort {
|
|
|
61
65
|
listAll(options?: AdminUserLookupOptions): Promise<AdminUserRecord[]>;
|
|
62
66
|
/** Admins holding a given role — the guard against deleting a role in use. */
|
|
63
67
|
listByRoleId(adminRoleId: string): Promise<AdminUserRecord[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Feature 171 (US6) — the non-deleted admins whose avatar is one of these assets:
|
|
70
|
+
* the library's "is this asset in use?" question.
|
|
71
|
+
*/
|
|
72
|
+
findByAvatarAssetIds(assetIds: readonly string[]): Promise<AdminUserRecord[]>;
|
|
64
73
|
}
|
|
65
74
|
/**
|
|
66
75
|
* Container name: `adminUserPreferencePort`. Owner: `admin_users`.
|