@endora-commerce/contracts 0.109.0 → 0.111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accept-language.d.ts +31 -0
- package/dist/accept-language.js +64 -0
- package/dist/actor.d.ts +16 -0
- package/dist/addresses.d.ts +35 -0
- package/dist/addresses.js +8 -1
- package/dist/admin-actions.d.ts +2 -0
- package/dist/admin-actions.js +18 -0
- package/dist/admin-contributions.d.ts +99 -12
- package/dist/admin-contributions.js +36 -10
- package/dist/admin-roles.d.ts +17 -2
- package/dist/admin-users.d.ts +9 -0
- package/dist/admin.d.ts +114 -4
- package/dist/admin.js +98 -3
- package/dist/api-keys.d.ts +22 -0
- package/dist/api-keys.js +4 -0
- package/dist/assets-library.d.ts +45 -0
- package/dist/assets-library.js +20 -3
- package/dist/audit-logs.d.ts +12 -0
- package/dist/audit-logs.js +12 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.js +9 -0
- package/dist/blog.d.ts +382 -22
- package/dist/blog.js +199 -17
- package/dist/carts.d.ts +423 -36
- package/dist/carts.js +150 -12
- package/dist/catalog.d.ts +379 -208
- package/dist/catalog.js +241 -163
- package/dist/cms-brand.d.ts +14 -14
- package/dist/cms.d.ts +71 -16
- package/dist/cms.js +15 -0
- package/dist/command-hooks.d.ts +301 -0
- package/dist/command-hooks.js +248 -0
- package/dist/common.d.ts +23 -6
- package/dist/common.js +25 -2
- package/dist/comparisons.d.ts +21 -14
- package/dist/comparisons.js +2 -1
- package/dist/credit-limits.d.ts +22 -0
- package/dist/credit-limits.js +35 -0
- package/dist/crm.d.ts +134 -78
- package/dist/crm.js +21 -5
- package/dist/custom-fields.d.ts +417 -49
- package/dist/custom-fields.js +142 -1
- package/dist/customer-accounts.d.ts +324 -22
- package/dist/customer-accounts.js +43 -0
- package/dist/customer-notifications.d.ts +143 -0
- package/dist/customer-notifications.js +41 -0
- package/dist/customers.d.ts +92 -73
- package/dist/customers.js +98 -10
- package/dist/dictionary.d.ts +53 -0
- package/dist/dictionary.js +25 -0
- package/dist/document-templates.d.ts +12 -12
- package/dist/email.d.ts +34 -0
- package/dist/email.js +6 -0
- package/dist/errors.d.ts +431 -3
- package/dist/errors.js +523 -3
- package/dist/forms-logic.d.ts +79 -0
- package/dist/forms-logic.fixtures.d.ts +52 -0
- package/dist/forms-logic.fixtures.js +610 -0
- package/dist/forms-logic.js +699 -0
- package/dist/forms.d.ts +9833 -0
- package/dist/forms.js +827 -0
- package/dist/i18n.d.ts +34 -0
- package/dist/i18n.js +15 -0
- package/dist/import-export.d.ts +180 -0
- package/dist/import-export.js +60 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +30 -1
- package/dist/inventory.d.ts +9 -9
- package/dist/invoice-ledger.d.ts +13 -13
- package/dist/invoices.d.ts +126 -0
- package/dist/invoices.js +53 -0
- package/dist/line-bounds.d.ts +53 -0
- package/dist/line-bounds.js +65 -0
- package/dist/megamenu.d.ts +27 -27
- package/dist/mfa.d.ts +210 -4
- package/dist/mfa.js +136 -0
- package/dist/modules.d.ts +56 -8
- package/dist/modules.js +128 -3
- package/dist/money-decimal.d.ts +54 -0
- package/dist/money-decimal.js +95 -0
- package/dist/newsletter.d.ts +4 -4
- package/dist/orders.d.ts +246 -12
- package/dist/orders.js +140 -7
- package/dist/organization-hooks.d.ts +99 -0
- package/dist/organization-hooks.js +22 -0
- package/dist/organization-registry-lookup.d.ts +362 -0
- package/dist/organization-registry-lookup.js +196 -0
- package/dist/organization-roles.d.ts +341 -0
- package/dist/organization-roles.js +218 -0
- package/dist/organizations.d.ts +1074 -103
- package/dist/organizations.js +293 -28
- package/dist/page-builder-props.d.ts +56 -56
- package/dist/pim-connector.d.ts +7 -3
- package/dist/pim-connector.js +6 -2
- package/dist/pim-field-path.d.ts +5 -1
- package/dist/pim-field-path.js +37 -81
- package/dist/pim-locale-mapping.d.ts +131 -0
- package/dist/pim-locale-mapping.js +193 -0
- package/dist/price-books.d.ts +215 -63
- package/dist/price-books.js +47 -2
- package/dist/price-lists.d.ts +13 -10
- package/dist/product-feeds.d.ts +249 -100
- package/dist/product-feeds.js +46 -2
- package/dist/product-scope-model.d.ts +161 -0
- package/dist/product-scope-model.js +161 -0
- package/dist/product-scope-overrides.d.ts +0 -103
- package/dist/product-scope-overrides.js +0 -54
- package/dist/product-scoped-values.d.ts +2610 -0
- package/dist/product-scoped-values.js +425 -0
- package/dist/product-scopes.d.ts +199 -64
- package/dist/product-scopes.js +120 -23
- package/dist/product-tax-rates.d.ts +38 -0
- package/dist/product-tax-rates.js +45 -0
- package/dist/product-url-keys.d.ts +51 -45
- package/dist/product-url-keys.js +73 -39
- package/dist/product-value-resolver.d.ts +37 -60
- package/dist/product-value-resolver.js +36 -96
- package/dist/projects.d.ts +76 -28
- package/dist/projects.js +53 -9
- package/dist/promotions.d.ts +163 -11
- package/dist/promotions.js +23 -1
- package/dist/pwa.d.ts +41 -2
- package/dist/quick-order.d.ts +159 -9
- package/dist/quick-order.js +79 -4
- package/dist/quote-requests.d.ts +231 -17
- package/dist/quote-requests.js +111 -9
- package/dist/record-references.d.ts +15 -15
- package/dist/record-references.js +2 -3
- package/dist/record-rich-text.js +2 -1
- package/dist/returns.d.ts +214 -52
- package/dist/returns.js +143 -28
- package/dist/sales-channels.d.ts +34 -3
- package/dist/sales-channels.js +16 -1
- package/dist/saved-list-views.d.ts +28 -0
- package/dist/saved-list-views.js +14 -1
- package/dist/schema-extensions.d.ts +36 -0
- package/dist/schema-extensions.js +29 -0
- package/dist/scoped-write-encoding.d.ts +100 -0
- package/dist/scoped-write-encoding.js +135 -0
- package/dist/search.d.ts +18 -16
- package/dist/seo.d.ts +83 -30
- package/dist/seo.js +8 -1
- package/dist/settings.d.ts +173 -2
- package/dist/settings.js +53 -2
- package/dist/shopping-lists.d.ts +63 -4
- package/dist/shopping-lists.js +57 -3
- package/dist/storefront-cache-tags.d.ts +22 -0
- package/dist/storefront-cache-tags.js +12 -0
- package/dist/storefront-value-overrides.d.ts +18 -56
- package/dist/storefront-value-overrides.js +11 -86
- package/dist/tasks.d.ts +27 -27
- package/dist/taxes.d.ts +27 -0
- package/dist/taxes.js +4 -0
- package/dist/transactional-emails.d.ts +48 -22
- package/dist/webhooks.d.ts +75 -0
- package/dist/webhooks.js +24 -0
- package/package.json +5 -3
- package/dist/actor.d.ts.map +0 -1
- package/dist/actor.js.map +0 -1
- package/dist/addresses.d.ts.map +0 -1
- package/dist/addresses.js.map +0 -1
- package/dist/admin-actions.d.ts.map +0 -1
- package/dist/admin-actions.js.map +0 -1
- package/dist/admin-contributions.d.ts.map +0 -1
- package/dist/admin-contributions.js.map +0 -1
- package/dist/admin-feedback.d.ts.map +0 -1
- package/dist/admin-feedback.js.map +0 -1
- package/dist/admin-i18n.d.ts.map +0 -1
- package/dist/admin-i18n.js.map +0 -1
- package/dist/admin-name.d.ts.map +0 -1
- package/dist/admin-name.js.map +0 -1
- package/dist/admin-notifications.d.ts.map +0 -1
- package/dist/admin-notifications.js.map +0 -1
- package/dist/admin-preferences.d.ts.map +0 -1
- package/dist/admin-preferences.js.map +0 -1
- package/dist/admin-roles.d.ts.map +0 -1
- package/dist/admin-roles.js.map +0 -1
- package/dist/admin-search.d.ts.map +0 -1
- package/dist/admin-search.js.map +0 -1
- package/dist/admin-users.d.ts.map +0 -1
- package/dist/admin-users.js.map +0 -1
- package/dist/admin.d.ts.map +0 -1
- package/dist/admin.js.map +0 -1
- package/dist/analytics.d.ts.map +0 -1
- package/dist/analytics.js.map +0 -1
- package/dist/api-keys.d.ts.map +0 -1
- package/dist/api-keys.js.map +0 -1
- package/dist/assets-library.d.ts.map +0 -1
- package/dist/assets-library.js.map +0 -1
- package/dist/audit-logs.d.ts.map +0 -1
- package/dist/audit-logs.js.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/blog.d.ts.map +0 -1
- package/dist/blog.js.map +0 -1
- package/dist/capabilities.d.ts.map +0 -1
- package/dist/capabilities.js.map +0 -1
- package/dist/carts.d.ts.map +0 -1
- package/dist/carts.js.map +0 -1
- package/dist/catalog.d.ts.map +0 -1
- package/dist/catalog.js.map +0 -1
- package/dist/cms-brand.d.ts.map +0 -1
- package/dist/cms-brand.js.map +0 -1
- package/dist/cms-contact-form.d.ts.map +0 -1
- package/dist/cms-contact-form.js.map +0 -1
- package/dist/cms.d.ts.map +0 -1
- package/dist/cms.js.map +0 -1
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js.map +0 -1
- package/dist/comparisons.d.ts.map +0 -1
- package/dist/comparisons.js.map +0 -1
- package/dist/credentials.d.ts.map +0 -1
- package/dist/credentials.js.map +0 -1
- package/dist/credit-limits.d.ts.map +0 -1
- package/dist/credit-limits.js.map +0 -1
- package/dist/crm-rich-text.d.ts.map +0 -1
- package/dist/crm-rich-text.js.map +0 -1
- package/dist/crm.d.ts.map +0 -1
- package/dist/crm.js.map +0 -1
- package/dist/currencies.d.ts.map +0 -1
- package/dist/currencies.js.map +0 -1
- package/dist/custom-fields.d.ts.map +0 -1
- package/dist/custom-fields.js.map +0 -1
- package/dist/customer-accounts.d.ts.map +0 -1
- package/dist/customer-accounts.js.map +0 -1
- package/dist/customers.d.ts.map +0 -1
- package/dist/customers.js.map +0 -1
- package/dist/dictionary.d.ts.map +0 -1
- package/dist/dictionary.js.map +0 -1
- package/dist/document-templates.d.ts.map +0 -1
- package/dist/document-templates.js.map +0 -1
- package/dist/document-values.d.ts.map +0 -1
- package/dist/document-values.js.map +0 -1
- package/dist/email-address.d.ts.map +0 -1
- package/dist/email-address.js.map +0 -1
- package/dist/email.d.ts.map +0 -1
- package/dist/email.js.map +0 -1
- package/dist/envelopes.d.ts.map +0 -1
- package/dist/envelopes.js.map +0 -1
- package/dist/environment-inputs.d.ts.map +0 -1
- package/dist/environment-inputs.js.map +0 -1
- package/dist/erp-connector.d.ts.map +0 -1
- package/dist/erp-connector.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/google-analytics.d.ts.map +0 -1
- package/dist/google-analytics.js.map +0 -1
- package/dist/google-tag-manager.d.ts.map +0 -1
- package/dist/google-tag-manager.js.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.js.map +0 -1
- package/dist/import-export.d.ts.map +0 -1
- package/dist/import-export.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inventory.d.ts.map +0 -1
- package/dist/inventory.js.map +0 -1
- package/dist/invoice-ledger.d.ts.map +0 -1
- package/dist/invoice-ledger.js.map +0 -1
- package/dist/invoices.d.ts.map +0 -1
- package/dist/invoices.js.map +0 -1
- package/dist/kernel.d.ts.map +0 -1
- package/dist/kernel.js.map +0 -1
- package/dist/languages.d.ts.map +0 -1
- package/dist/languages.js.map +0 -1
- package/dist/line-groups.d.ts.map +0 -1
- package/dist/line-groups.js.map +0 -1
- package/dist/linkedin-ads.d.ts.map +0 -1
- package/dist/linkedin-ads.js.map +0 -1
- package/dist/localized-name.d.ts.map +0 -1
- package/dist/localized-name.js.map +0 -1
- package/dist/megamenu.d.ts.map +0 -1
- package/dist/megamenu.js.map +0 -1
- package/dist/meta-ads.d.ts.map +0 -1
- package/dist/meta-ads.js.map +0 -1
- package/dist/mfa.d.ts.map +0 -1
- package/dist/mfa.js.map +0 -1
- package/dist/modules.d.ts.map +0 -1
- package/dist/modules.js.map +0 -1
- package/dist/money-decimal.d.ts.map +0 -1
- package/dist/money-decimal.js.map +0 -1
- package/dist/money-input.d.ts.map +0 -1
- package/dist/money-input.js.map +0 -1
- package/dist/newsletter.d.ts.map +0 -1
- package/dist/newsletter.js.map +0 -1
- package/dist/order-minimums.d.ts.map +0 -1
- package/dist/order-minimums.js.map +0 -1
- package/dist/orders.d.ts.map +0 -1
- package/dist/orders.js.map +0 -1
- package/dist/organizations.d.ts.map +0 -1
- package/dist/organizations.js.map +0 -1
- package/dist/page-builder-props.d.ts.map +0 -1
- package/dist/page-builder-props.js.map +0 -1
- package/dist/page-builder-values.d.ts.map +0 -1
- package/dist/page-builder-values.js.map +0 -1
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js.map +0 -1
- package/dist/payment-methods.d.ts.map +0 -1
- package/dist/payment-methods.js.map +0 -1
- package/dist/payment-return-url.d.ts.map +0 -1
- package/dist/payment-return-url.js.map +0 -1
- package/dist/payments.d.ts.map +0 -1
- package/dist/payments.js.map +0 -1
- package/dist/pim-connector.d.ts.map +0 -1
- package/dist/pim-connector.js.map +0 -1
- package/dist/pim-field-path.d.ts.map +0 -1
- package/dist/pim-field-path.js.map +0 -1
- package/dist/platform-info.d.ts.map +0 -1
- package/dist/platform-info.js.map +0 -1
- package/dist/platform-language.d.ts.map +0 -1
- package/dist/platform-language.js.map +0 -1
- package/dist/price-book-decimal.d.ts.map +0 -1
- package/dist/price-book-decimal.js.map +0 -1
- package/dist/price-books.d.ts.map +0 -1
- package/dist/price-books.js.map +0 -1
- package/dist/price-lists.d.ts.map +0 -1
- package/dist/price-lists.js.map +0 -1
- package/dist/product-feeds.d.ts.map +0 -1
- package/dist/product-feeds.js.map +0 -1
- package/dist/product-scope-overrides.d.ts.map +0 -1
- package/dist/product-scope-overrides.js.map +0 -1
- package/dist/product-scopes.d.ts.map +0 -1
- package/dist/product-scopes.js.map +0 -1
- package/dist/product-summary-text.d.ts.map +0 -1
- package/dist/product-summary-text.js.map +0 -1
- package/dist/product-url-keys.d.ts.map +0 -1
- package/dist/product-url-keys.js.map +0 -1
- package/dist/product-value-resolver.d.ts.map +0 -1
- package/dist/product-value-resolver.js.map +0 -1
- package/dist/projects.d.ts.map +0 -1
- package/dist/projects.js.map +0 -1
- package/dist/promotions.d.ts.map +0 -1
- package/dist/promotions.js.map +0 -1
- package/dist/prompt-actions.d.ts.map +0 -1
- package/dist/prompt-actions.js.map +0 -1
- package/dist/pwa.d.ts.map +0 -1
- package/dist/pwa.js.map +0 -1
- package/dist/quick-order.d.ts.map +0 -1
- package/dist/quick-order.js.map +0 -1
- package/dist/quote-requests.d.ts.map +0 -1
- package/dist/quote-requests.js.map +0 -1
- package/dist/record-references.d.ts.map +0 -1
- package/dist/record-references.js.map +0 -1
- package/dist/record-rich-text.d.ts.map +0 -1
- package/dist/record-rich-text.js.map +0 -1
- package/dist/returns.d.ts.map +0 -1
- package/dist/returns.js.map +0 -1
- package/dist/sales-channels.d.ts.map +0 -1
- package/dist/sales-channels.js.map +0 -1
- package/dist/saved-list-views.d.ts.map +0 -1
- package/dist/saved-list-views.js.map +0 -1
- package/dist/scope-notice.d.ts.map +0 -1
- package/dist/scope-notice.js.map +0 -1
- package/dist/scoped-translations.d.ts +0 -48
- package/dist/scoped-translations.d.ts.map +0 -1
- package/dist/scoped-translations.js +0 -78
- package/dist/scoped-translations.js.map +0 -1
- package/dist/search.d.ts.map +0 -1
- package/dist/search.js.map +0 -1
- package/dist/seo.d.ts.map +0 -1
- package/dist/seo.js.map +0 -1
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js.map +0 -1
- package/dist/shipments.d.ts.map +0 -1
- package/dist/shipments.js.map +0 -1
- package/dist/shipping-methods.d.ts.map +0 -1
- package/dist/shipping-methods.js.map +0 -1
- package/dist/shopping-lists.d.ts.map +0 -1
- package/dist/shopping-lists.js.map +0 -1
- package/dist/storefront-cache-tags.d.ts.map +0 -1
- package/dist/storefront-cache-tags.js.map +0 -1
- package/dist/storefront-language-path.d.ts.map +0 -1
- package/dist/storefront-language-path.js.map +0 -1
- package/dist/storefront-value-overrides.d.ts.map +0 -1
- package/dist/storefront-value-overrides.js.map +0 -1
- package/dist/tasks.d.ts.map +0 -1
- package/dist/tasks.js.map +0 -1
- package/dist/taxes.d.ts.map +0 -1
- package/dist/taxes.js.map +0 -1
- package/dist/text-normalization.d.ts.map +0 -1
- package/dist/text-normalization.js.map +0 -1
- package/dist/transactional-emails.d.ts.map +0 -1
- package/dist/transactional-emails.js.map +0 -1
- package/dist/webhooks.d.ts.map +0 -1
- package/dist/webhooks.js.map +0 -1
package/dist/custom-fields.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { SupportedLanguage } from './platform-language.js';
|
|
2
3
|
/**
|
|
3
4
|
* Custom Fields Layer (feature 055) — entity-agnostic runtime custom fields
|
|
4
5
|
* on core entities (Category, Order, Organization, Customer, QuoteRequest).
|
|
@@ -11,17 +12,93 @@ import { z } from 'zod';
|
|
|
11
12
|
/** The host entity types custom fields may attach to at launch. Extensible via the backend registry. */
|
|
12
13
|
export declare const supportedEntityTypeSchema: z.ZodEnum<{
|
|
13
14
|
customer: "customer";
|
|
14
|
-
product: "product";
|
|
15
15
|
category: "category";
|
|
16
16
|
order: "order";
|
|
17
17
|
organization: "organization";
|
|
18
18
|
quote_request: "quote_request";
|
|
19
|
-
|
|
19
|
+
product: "product";
|
|
20
20
|
opportunity: "opportunity";
|
|
21
21
|
project: "project";
|
|
22
|
+
task: "task";
|
|
22
23
|
}>;
|
|
23
24
|
export type SupportedEntityType = z.infer<typeof supportedEntityTypeSchema>;
|
|
24
|
-
/**
|
|
25
|
+
/** Where one host entity type keeps its custom-field values, and which module owns that table. */
|
|
26
|
+
export interface CustomFieldHostBinding {
|
|
27
|
+
/** The host table. For `product` the value bag is a column, so the table is `products` itself. */
|
|
28
|
+
readonly table: string;
|
|
29
|
+
/** The column on {@link table} that holds the value bag. */
|
|
30
|
+
readonly valueColumn: string;
|
|
31
|
+
/** The module whose entity maps {@link table}. */
|
|
32
|
+
readonly ownerModuleId: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The one custom-field host binding registry (`specs/178-extensible-columns/`
|
|
36
|
+
* FR-010, research R-8).
|
|
37
|
+
*
|
|
38
|
+
* Moved here from `custom_fields`' module-internal storage binding so that two
|
|
39
|
+
* readers can share one answer: `custom_fields` reads it for the table and the
|
|
40
|
+
* value column its host probes and list filters build against, and the platform
|
|
41
|
+
* derives its extensible host list from it — every custom-field host table is
|
|
42
|
+
* extensible (OD-15), so a second list of them would be a second answer waiting
|
|
43
|
+
* to disagree. Purely a storage binding: no host logic lives here, and neither
|
|
44
|
+
* the table nor the column ever comes from a caller.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CUSTOM_FIELD_HOST_BINDINGS: {
|
|
47
|
+
readonly category: {
|
|
48
|
+
readonly table: "categories";
|
|
49
|
+
readonly valueColumn: "custom_field_values";
|
|
50
|
+
readonly ownerModuleId: "catalog";
|
|
51
|
+
};
|
|
52
|
+
readonly order: {
|
|
53
|
+
readonly table: "orders";
|
|
54
|
+
readonly valueColumn: "custom_field_values";
|
|
55
|
+
readonly ownerModuleId: "orders";
|
|
56
|
+
};
|
|
57
|
+
readonly organization: {
|
|
58
|
+
readonly table: "organizations";
|
|
59
|
+
readonly valueColumn: "custom_field_values";
|
|
60
|
+
readonly ownerModuleId: "organizations";
|
|
61
|
+
};
|
|
62
|
+
readonly customer: {
|
|
63
|
+
readonly table: "customer_accounts";
|
|
64
|
+
readonly valueColumn: "custom_field_values";
|
|
65
|
+
readonly ownerModuleId: "customer_accounts";
|
|
66
|
+
};
|
|
67
|
+
readonly quote_request: {
|
|
68
|
+
readonly table: "quote_requests";
|
|
69
|
+
readonly valueColumn: "custom_field_values";
|
|
70
|
+
readonly ownerModuleId: "quote_requests";
|
|
71
|
+
};
|
|
72
|
+
readonly product: {
|
|
73
|
+
readonly table: "products";
|
|
74
|
+
readonly valueColumn: "attribute_values";
|
|
75
|
+
readonly ownerModuleId: "catalog";
|
|
76
|
+
};
|
|
77
|
+
readonly opportunity: {
|
|
78
|
+
readonly table: "crm_opportunities";
|
|
79
|
+
readonly valueColumn: "custom_field_values";
|
|
80
|
+
readonly ownerModuleId: "crm";
|
|
81
|
+
};
|
|
82
|
+
readonly project: {
|
|
83
|
+
readonly table: "projects";
|
|
84
|
+
readonly valueColumn: "custom_field_values";
|
|
85
|
+
readonly ownerModuleId: "projects";
|
|
86
|
+
};
|
|
87
|
+
readonly task: {
|
|
88
|
+
readonly table: "tasks";
|
|
89
|
+
readonly valueColumn: "custom_field_values";
|
|
90
|
+
readonly ownerModuleId: "tasks";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* The set of runtime value types. `text` is stored as a string; `select` stores one option value; `multiselect` an array.
|
|
95
|
+
*
|
|
96
|
+
* `page_builder` (feature 172) is a Page Builder document per language. It is
|
|
97
|
+
* never a field value: the generic value path refuses it, no list filter
|
|
98
|
+
* applies to it, and a definition may take it only on an entity type whose
|
|
99
|
+
* registry entry offers it (`product` alone) — the document lives in its
|
|
100
|
+
* host's own storage.
|
|
101
|
+
*/
|
|
25
102
|
export declare const customFieldValueTypeSchema: z.ZodEnum<{
|
|
26
103
|
number: "number";
|
|
27
104
|
boolean: "boolean";
|
|
@@ -29,6 +106,7 @@ export declare const customFieldValueTypeSchema: z.ZodEnum<{
|
|
|
29
106
|
text: "text";
|
|
30
107
|
select: "select";
|
|
31
108
|
multiselect: "multiselect";
|
|
109
|
+
page_builder: "page_builder";
|
|
32
110
|
}>;
|
|
33
111
|
export type CustomFieldValueType = z.infer<typeof customFieldValueTypeSchema>;
|
|
34
112
|
/** Per-locale label map (BCP-47-keyed). Empty is allowed when only `labelDefault` is filled. */
|
|
@@ -49,6 +127,31 @@ export declare const customFieldAudienceSchema: z.ZodEnum<{
|
|
|
49
127
|
internal: "internal";
|
|
50
128
|
}>;
|
|
51
129
|
export type CustomFieldAudience = z.infer<typeof customFieldAudienceSchema>;
|
|
130
|
+
/**
|
|
131
|
+
* Feature 175 — the forms on which a BUYER may supply a custom-field value
|
|
132
|
+
* (`specs/175-buyer-input-custom-fields/`, OD-3). A closed vocabulary: the
|
|
133
|
+
* next surface is a release, not data an operator types. A definition names
|
|
134
|
+
* the surfaces it is open on (`customerInput`); an entity type's registry entry
|
|
135
|
+
* names the surfaces it offers at all.
|
|
136
|
+
*/
|
|
137
|
+
export declare const customFieldInputSurfaceSchema: z.ZodEnum<{
|
|
138
|
+
"organization.register": "organization.register";
|
|
139
|
+
}>;
|
|
140
|
+
export type CustomFieldInputSurface = z.infer<typeof customFieldInputSurfaceSchema>;
|
|
141
|
+
/**
|
|
142
|
+
* Feature 175 — how the admin custom-field panel offers a field: `edit`
|
|
143
|
+
* (an input), `read` (the value, no input) or `hidden` (not rendered).
|
|
144
|
+
*
|
|
145
|
+
* **A panel convenience, not access control** (OD-8, FR-007): no API endpoint
|
|
146
|
+
* reads it, so what the admin API accepts, answers, filters, exports and
|
|
147
|
+
* audits is the same at every level. A `required` field is always `edit`.
|
|
148
|
+
*/
|
|
149
|
+
export declare const customFieldAdminAccessSchema: z.ZodEnum<{
|
|
150
|
+
hidden: "hidden";
|
|
151
|
+
edit: "edit";
|
|
152
|
+
read: "read";
|
|
153
|
+
}>;
|
|
154
|
+
export type CustomFieldAdminAccess = z.infer<typeof customFieldAdminAccessSchema>;
|
|
52
155
|
export declare const localizedLabelSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
53
156
|
export type LocalizedLabel = z.infer<typeof localizedLabelSchema>;
|
|
54
157
|
/** A select/multiselect option. `id` absent on create. */
|
|
@@ -89,28 +192,28 @@ export declare const CUSTOM_FIELD_CARRY_MAX_TARGETS = 2;
|
|
|
89
192
|
*/
|
|
90
193
|
export declare const customFieldCarryToSchema: z.ZodArray<z.ZodEnum<{
|
|
91
194
|
customer: "customer";
|
|
92
|
-
product: "product";
|
|
93
195
|
category: "category";
|
|
94
196
|
order: "order";
|
|
95
197
|
organization: "organization";
|
|
96
198
|
quote_request: "quote_request";
|
|
97
|
-
|
|
199
|
+
product: "product";
|
|
98
200
|
opportunity: "opportunity";
|
|
99
201
|
project: "project";
|
|
202
|
+
task: "task";
|
|
100
203
|
}>>;
|
|
101
204
|
/** A full custom-field definition, options embedded. */
|
|
102
205
|
export declare const customFieldDefinitionSchema: z.ZodObject<{
|
|
103
206
|
id: z.ZodString;
|
|
104
207
|
entityType: z.ZodEnum<{
|
|
105
208
|
customer: "customer";
|
|
106
|
-
product: "product";
|
|
107
209
|
category: "category";
|
|
108
210
|
order: "order";
|
|
109
211
|
organization: "organization";
|
|
110
212
|
quote_request: "quote_request";
|
|
111
|
-
|
|
213
|
+
product: "product";
|
|
112
214
|
opportunity: "opportunity";
|
|
113
215
|
project: "project";
|
|
216
|
+
task: "task";
|
|
114
217
|
}>;
|
|
115
218
|
key: z.ZodString;
|
|
116
219
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
@@ -122,6 +225,7 @@ export declare const customFieldDefinitionSchema: z.ZodObject<{
|
|
|
122
225
|
text: "text";
|
|
123
226
|
select: "select";
|
|
124
227
|
multiselect: "multiselect";
|
|
228
|
+
page_builder: "page_builder";
|
|
125
229
|
}>;
|
|
126
230
|
required: z.ZodBoolean;
|
|
127
231
|
audience: z.ZodEnum<{
|
|
@@ -133,15 +237,23 @@ export declare const customFieldDefinitionSchema: z.ZodObject<{
|
|
|
133
237
|
listFilter: z.ZodBoolean;
|
|
134
238
|
carryTo: z.ZodArray<z.ZodEnum<{
|
|
135
239
|
customer: "customer";
|
|
136
|
-
product: "product";
|
|
137
240
|
category: "category";
|
|
138
241
|
order: "order";
|
|
139
242
|
organization: "organization";
|
|
140
243
|
quote_request: "quote_request";
|
|
141
|
-
|
|
244
|
+
product: "product";
|
|
142
245
|
opportunity: "opportunity";
|
|
143
246
|
project: "project";
|
|
247
|
+
task: "task";
|
|
144
248
|
}>>;
|
|
249
|
+
customerInput: z.ZodArray<z.ZodEnum<{
|
|
250
|
+
"organization.register": "organization.register";
|
|
251
|
+
}>>;
|
|
252
|
+
adminAccess: z.ZodEnum<{
|
|
253
|
+
hidden: "hidden";
|
|
254
|
+
edit: "edit";
|
|
255
|
+
read: "read";
|
|
256
|
+
}>;
|
|
145
257
|
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
146
258
|
id: z.ZodOptional<z.ZodString>;
|
|
147
259
|
value: z.ZodString;
|
|
@@ -154,41 +266,112 @@ export declare const customFieldDefinitionSchema: z.ZodObject<{
|
|
|
154
266
|
updatedAt: z.ZodString;
|
|
155
267
|
}, z.core.$strip>;
|
|
156
268
|
export type CustomFieldDefinitionDto = z.infer<typeof customFieldDefinitionSchema>;
|
|
269
|
+
/**
|
|
270
|
+
* `GET /api/v1/admin/custom-fields/definitions` — the definitions, optionally of
|
|
271
|
+
* one entity type, whose type's owner module is present (issue #599).
|
|
272
|
+
*/
|
|
273
|
+
export declare const customFieldDefinitionListResponseSchema: z.ZodObject<{
|
|
274
|
+
data: z.ZodArray<z.ZodObject<{
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
entityType: z.ZodEnum<{
|
|
277
|
+
customer: "customer";
|
|
278
|
+
category: "category";
|
|
279
|
+
order: "order";
|
|
280
|
+
organization: "organization";
|
|
281
|
+
quote_request: "quote_request";
|
|
282
|
+
product: "product";
|
|
283
|
+
opportunity: "opportunity";
|
|
284
|
+
project: "project";
|
|
285
|
+
task: "task";
|
|
286
|
+
}>;
|
|
287
|
+
key: z.ZodString;
|
|
288
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
289
|
+
labelDefault: z.ZodString;
|
|
290
|
+
valueType: z.ZodEnum<{
|
|
291
|
+
number: "number";
|
|
292
|
+
boolean: "boolean";
|
|
293
|
+
date: "date";
|
|
294
|
+
text: "text";
|
|
295
|
+
select: "select";
|
|
296
|
+
multiselect: "multiselect";
|
|
297
|
+
page_builder: "page_builder";
|
|
298
|
+
}>;
|
|
299
|
+
required: z.ZodBoolean;
|
|
300
|
+
audience: z.ZodEnum<{
|
|
301
|
+
customer: "customer";
|
|
302
|
+
internal: "internal";
|
|
303
|
+
}>;
|
|
304
|
+
sortOrder: z.ZodNumber;
|
|
305
|
+
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
306
|
+
listFilter: z.ZodBoolean;
|
|
307
|
+
carryTo: z.ZodArray<z.ZodEnum<{
|
|
308
|
+
customer: "customer";
|
|
309
|
+
category: "category";
|
|
310
|
+
order: "order";
|
|
311
|
+
organization: "organization";
|
|
312
|
+
quote_request: "quote_request";
|
|
313
|
+
product: "product";
|
|
314
|
+
opportunity: "opportunity";
|
|
315
|
+
project: "project";
|
|
316
|
+
task: "task";
|
|
317
|
+
}>>;
|
|
318
|
+
customerInput: z.ZodArray<z.ZodEnum<{
|
|
319
|
+
"organization.register": "organization.register";
|
|
320
|
+
}>>;
|
|
321
|
+
adminAccess: z.ZodEnum<{
|
|
322
|
+
hidden: "hidden";
|
|
323
|
+
edit: "edit";
|
|
324
|
+
read: "read";
|
|
325
|
+
}>;
|
|
326
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
327
|
+
id: z.ZodOptional<z.ZodString>;
|
|
328
|
+
value: z.ZodString;
|
|
329
|
+
label: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
330
|
+
labelDefault: z.ZodString;
|
|
331
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
332
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
333
|
+
}, z.core.$strip>>>;
|
|
334
|
+
createdAt: z.ZodString;
|
|
335
|
+
updatedAt: z.ZodString;
|
|
336
|
+
}, z.core.$strip>>;
|
|
337
|
+
}, z.core.$strip>;
|
|
338
|
+
export type CustomFieldDefinitionListResponse = z.infer<typeof customFieldDefinitionListResponseSchema>;
|
|
157
339
|
/** Create a definition. `entityType` + `key` are immutable after create. */
|
|
158
340
|
export declare const createCustomFieldDefinitionSchema: z.ZodObject<{
|
|
159
341
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
160
342
|
key: z.ZodString;
|
|
161
343
|
required: z.ZodBoolean;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
label: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
166
|
-
labelDefault: z.ZodString;
|
|
167
|
-
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
168
|
-
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
169
|
-
}, z.core.$strip>>>;
|
|
170
|
-
valueType: z.ZodEnum<{
|
|
171
|
-
number: "number";
|
|
172
|
-
boolean: "boolean";
|
|
173
|
-
date: "date";
|
|
174
|
-
text: "text";
|
|
175
|
-
select: "select";
|
|
176
|
-
multiselect: "multiselect";
|
|
177
|
-
}>;
|
|
344
|
+
sortOrder: z.ZodNumber;
|
|
345
|
+
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
346
|
+
labelDefault: z.ZodString;
|
|
178
347
|
entityType: z.ZodEnum<{
|
|
179
348
|
customer: "customer";
|
|
180
|
-
product: "product";
|
|
181
349
|
category: "category";
|
|
182
350
|
order: "order";
|
|
183
351
|
organization: "organization";
|
|
184
352
|
quote_request: "quote_request";
|
|
185
|
-
|
|
353
|
+
product: "product";
|
|
186
354
|
opportunity: "opportunity";
|
|
187
355
|
project: "project";
|
|
356
|
+
task: "task";
|
|
188
357
|
}>;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
358
|
+
valueType: z.ZodEnum<{
|
|
359
|
+
number: "number";
|
|
360
|
+
boolean: "boolean";
|
|
361
|
+
date: "date";
|
|
362
|
+
text: "text";
|
|
363
|
+
select: "select";
|
|
364
|
+
multiselect: "multiselect";
|
|
365
|
+
page_builder: "page_builder";
|
|
366
|
+
}>;
|
|
367
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
368
|
+
id: z.ZodOptional<z.ZodString>;
|
|
369
|
+
value: z.ZodString;
|
|
370
|
+
label: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
371
|
+
labelDefault: z.ZodString;
|
|
372
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
373
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
374
|
+
}, z.core.$strip>>>;
|
|
192
375
|
audience: z.ZodDefault<z.ZodEnum<{
|
|
193
376
|
customer: "customer";
|
|
194
377
|
internal: "internal";
|
|
@@ -196,29 +379,31 @@ export declare const createCustomFieldDefinitionSchema: z.ZodObject<{
|
|
|
196
379
|
listFilter: z.ZodOptional<z.ZodBoolean>;
|
|
197
380
|
carryTo: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
198
381
|
customer: "customer";
|
|
199
|
-
product: "product";
|
|
200
382
|
category: "category";
|
|
201
383
|
order: "order";
|
|
202
384
|
organization: "organization";
|
|
203
385
|
quote_request: "quote_request";
|
|
204
|
-
|
|
386
|
+
product: "product";
|
|
205
387
|
opportunity: "opportunity";
|
|
206
388
|
project: "project";
|
|
389
|
+
task: "task";
|
|
390
|
+
}>>>;
|
|
391
|
+
customerInput: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
392
|
+
"organization.register": "organization.register";
|
|
207
393
|
}>>>;
|
|
394
|
+
adminAccess: z.ZodDefault<z.ZodEnum<{
|
|
395
|
+
hidden: "hidden";
|
|
396
|
+
edit: "edit";
|
|
397
|
+
read: "read";
|
|
398
|
+
}>>;
|
|
208
399
|
}, z.core.$strip>;
|
|
209
400
|
export type CreateCustomFieldDefinitionRequest = z.infer<typeof createCustomFieldDefinitionSchema>;
|
|
210
401
|
/** Patch a definition. `entityType` and `key` cannot change once records may hold values. */
|
|
211
402
|
export declare const updateCustomFieldDefinitionSchema: z.ZodObject<{
|
|
212
403
|
label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
213
404
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
value: z.ZodString;
|
|
217
|
-
label: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
218
|
-
labelDefault: z.ZodString;
|
|
219
|
-
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
220
|
-
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
221
|
-
}, z.core.$strip>>>>;
|
|
405
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
406
|
+
labelDefault: z.ZodOptional<z.ZodString>;
|
|
222
407
|
valueType: z.ZodOptional<z.ZodEnum<{
|
|
223
408
|
number: "number";
|
|
224
409
|
boolean: "boolean";
|
|
@@ -226,9 +411,16 @@ export declare const updateCustomFieldDefinitionSchema: z.ZodObject<{
|
|
|
226
411
|
text: "text";
|
|
227
412
|
select: "select";
|
|
228
413
|
multiselect: "multiselect";
|
|
414
|
+
page_builder: "page_builder";
|
|
229
415
|
}>>;
|
|
230
|
-
|
|
231
|
-
|
|
416
|
+
options: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
417
|
+
id: z.ZodOptional<z.ZodString>;
|
|
418
|
+
value: z.ZodString;
|
|
419
|
+
label: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
420
|
+
labelDefault: z.ZodString;
|
|
421
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
422
|
+
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
423
|
+
}, z.core.$strip>>>>;
|
|
232
424
|
audience: z.ZodOptional<z.ZodEnum<{
|
|
233
425
|
customer: "customer";
|
|
234
426
|
internal: "internal";
|
|
@@ -237,15 +429,23 @@ export declare const updateCustomFieldDefinitionSchema: z.ZodObject<{
|
|
|
237
429
|
listFilter: z.ZodOptional<z.ZodBoolean>;
|
|
238
430
|
carryTo: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
239
431
|
customer: "customer";
|
|
240
|
-
product: "product";
|
|
241
432
|
category: "category";
|
|
242
433
|
order: "order";
|
|
243
434
|
organization: "organization";
|
|
244
435
|
quote_request: "quote_request";
|
|
245
|
-
|
|
436
|
+
product: "product";
|
|
246
437
|
opportunity: "opportunity";
|
|
247
438
|
project: "project";
|
|
439
|
+
task: "task";
|
|
440
|
+
}>>>;
|
|
441
|
+
customerInput: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
442
|
+
"organization.register": "organization.register";
|
|
248
443
|
}>>>;
|
|
444
|
+
adminAccess: z.ZodOptional<z.ZodEnum<{
|
|
445
|
+
hidden: "hidden";
|
|
446
|
+
edit: "edit";
|
|
447
|
+
read: "read";
|
|
448
|
+
}>>;
|
|
249
449
|
}, z.core.$strip>;
|
|
250
450
|
export type UpdateCustomFieldDefinitionRequest = z.infer<typeof updateCustomFieldDefinitionSchema>;
|
|
251
451
|
/**
|
|
@@ -258,14 +458,14 @@ export type UpdateCustomFieldDefinitionRequest = z.infer<typeof updateCustomFiel
|
|
|
258
458
|
export declare const customFieldEntityTypeInfoSchema: z.ZodObject<{
|
|
259
459
|
entityType: z.ZodEnum<{
|
|
260
460
|
customer: "customer";
|
|
261
|
-
product: "product";
|
|
262
461
|
category: "category";
|
|
263
462
|
order: "order";
|
|
264
463
|
organization: "organization";
|
|
265
464
|
quote_request: "quote_request";
|
|
266
|
-
|
|
465
|
+
product: "product";
|
|
267
466
|
opportunity: "opportunity";
|
|
268
467
|
project: "project";
|
|
468
|
+
task: "task";
|
|
269
469
|
}>;
|
|
270
470
|
labelKey: z.ZodString;
|
|
271
471
|
managedBy: z.ZodOptional<z.ZodObject<{
|
|
@@ -276,17 +476,58 @@ export declare const customFieldEntityTypeInfoSchema: z.ZodObject<{
|
|
|
276
476
|
listFilter: z.ZodBoolean;
|
|
277
477
|
carryTargets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
278
478
|
customer: "customer";
|
|
279
|
-
product: "product";
|
|
280
479
|
category: "category";
|
|
281
480
|
order: "order";
|
|
282
481
|
organization: "organization";
|
|
283
482
|
quote_request: "quote_request";
|
|
284
|
-
|
|
483
|
+
product: "product";
|
|
285
484
|
opportunity: "opportunity";
|
|
286
485
|
project: "project";
|
|
486
|
+
task: "task";
|
|
487
|
+
}>>>;
|
|
488
|
+
customerInputSurfaces: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
489
|
+
"organization.register": "organization.register";
|
|
287
490
|
}>>>;
|
|
288
491
|
}, z.core.$strip>;
|
|
289
492
|
export type CustomFieldEntityTypeInfo = z.infer<typeof customFieldEntityTypeInfoSchema>;
|
|
493
|
+
/** `GET /api/v1/admin/custom-fields/entity-types` — the served entity types (issue #599). */
|
|
494
|
+
export declare const customFieldEntityTypeListResponseSchema: z.ZodObject<{
|
|
495
|
+
data: z.ZodArray<z.ZodObject<{
|
|
496
|
+
entityType: z.ZodEnum<{
|
|
497
|
+
customer: "customer";
|
|
498
|
+
category: "category";
|
|
499
|
+
order: "order";
|
|
500
|
+
organization: "organization";
|
|
501
|
+
quote_request: "quote_request";
|
|
502
|
+
product: "product";
|
|
503
|
+
opportunity: "opportunity";
|
|
504
|
+
project: "project";
|
|
505
|
+
task: "task";
|
|
506
|
+
}>;
|
|
507
|
+
labelKey: z.ZodString;
|
|
508
|
+
managedBy: z.ZodOptional<z.ZodObject<{
|
|
509
|
+
moduleId: z.ZodString;
|
|
510
|
+
labelKey: z.ZodString;
|
|
511
|
+
route: z.ZodString;
|
|
512
|
+
}, z.core.$strip>>;
|
|
513
|
+
listFilter: z.ZodBoolean;
|
|
514
|
+
carryTargets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
515
|
+
customer: "customer";
|
|
516
|
+
category: "category";
|
|
517
|
+
order: "order";
|
|
518
|
+
organization: "organization";
|
|
519
|
+
quote_request: "quote_request";
|
|
520
|
+
product: "product";
|
|
521
|
+
opportunity: "opportunity";
|
|
522
|
+
project: "project";
|
|
523
|
+
task: "task";
|
|
524
|
+
}>>>;
|
|
525
|
+
customerInputSurfaces: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
526
|
+
"organization.register": "organization.register";
|
|
527
|
+
}>>>;
|
|
528
|
+
}, z.core.$strip>>;
|
|
529
|
+
}, z.core.$strip>;
|
|
530
|
+
export type CustomFieldEntityTypeListResponse = z.infer<typeof customFieldEntityTypeListResponseSchema>;
|
|
290
531
|
/** A validated value bag keyed by definition `key`. Values are typed by their definition's `valueType`. */
|
|
291
532
|
export declare const customFieldValuesSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
292
533
|
export type CustomFieldValues = z.infer<typeof customFieldValuesSchema>;
|
|
@@ -299,6 +540,8 @@ export declare const customFieldValidationErrorSchema: z.ZodObject<{
|
|
|
299
540
|
unknown_option: "unknown_option";
|
|
300
541
|
out_of_range: "out_of_range";
|
|
301
542
|
duplicate_option: "duplicate_option";
|
|
543
|
+
not_open_for_input: "not_open_for_input";
|
|
544
|
+
too_many_keys: "too_many_keys";
|
|
302
545
|
}>;
|
|
303
546
|
message: z.ZodString;
|
|
304
547
|
}, z.core.$strip>;
|
|
@@ -394,6 +637,7 @@ export declare const customFieldListFilterFieldSchema: z.ZodObject<{
|
|
|
394
637
|
text: "text";
|
|
395
638
|
select: "select";
|
|
396
639
|
multiselect: "multiselect";
|
|
640
|
+
page_builder: "page_builder";
|
|
397
641
|
}>;
|
|
398
642
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
399
643
|
labelDefault: z.ZodString;
|
|
@@ -404,6 +648,71 @@ export declare const customFieldListFilterFieldSchema: z.ZodObject<{
|
|
|
404
648
|
}, z.core.$strip>>;
|
|
405
649
|
}, z.core.$strict>;
|
|
406
650
|
export type CustomFieldListFilterField = z.infer<typeof customFieldListFilterFieldSchema>;
|
|
651
|
+
/**
|
|
652
|
+
* Feature 175 — one field open on a buyer input surface, as the public read
|
|
653
|
+
* `GET /api/v1/custom-fields/input-surfaces/:surface` answers it
|
|
654
|
+
* (`specs/175-buyer-input-custom-fields/contracts/input-surface-read.md`).
|
|
655
|
+
* Labels are resolved in the request's language with `labelDefault` as the
|
|
656
|
+
* fallback. Never a stored value, the audience, the admin access level or
|
|
657
|
+
* `config`; never a `page_builder` field.
|
|
658
|
+
*/
|
|
659
|
+
export declare const inputSurfaceFieldSchema: z.ZodObject<{
|
|
660
|
+
key: z.ZodString;
|
|
661
|
+
valueType: z.ZodEnum<{
|
|
662
|
+
number: "number";
|
|
663
|
+
boolean: "boolean";
|
|
664
|
+
date: "date";
|
|
665
|
+
text: "text";
|
|
666
|
+
select: "select";
|
|
667
|
+
multiselect: "multiselect";
|
|
668
|
+
}>;
|
|
669
|
+
required: z.ZodBoolean;
|
|
670
|
+
label: z.ZodString;
|
|
671
|
+
options: z.ZodArray<z.ZodObject<{
|
|
672
|
+
value: z.ZodString;
|
|
673
|
+
label: z.ZodString;
|
|
674
|
+
}, z.core.$strip>>;
|
|
675
|
+
sortOrder: z.ZodNumber;
|
|
676
|
+
}, z.core.$strip>;
|
|
677
|
+
export type InputSurfaceField = z.infer<typeof inputSurfaceFieldSchema>;
|
|
678
|
+
/**
|
|
679
|
+
* The fields open on one surface, per entity type in display order. An
|
|
680
|
+
* unknown surface, or one no entity type declares, answers `entities: {}`.
|
|
681
|
+
*/
|
|
682
|
+
export declare const inputSurfaceFieldsResponseSchema: z.ZodObject<{
|
|
683
|
+
data: z.ZodObject<{
|
|
684
|
+
surface: z.ZodString;
|
|
685
|
+
entities: z.ZodRecord<z.ZodEnum<{
|
|
686
|
+
customer: "customer";
|
|
687
|
+
category: "category";
|
|
688
|
+
order: "order";
|
|
689
|
+
organization: "organization";
|
|
690
|
+
quote_request: "quote_request";
|
|
691
|
+
product: "product";
|
|
692
|
+
opportunity: "opportunity";
|
|
693
|
+
project: "project";
|
|
694
|
+
task: "task";
|
|
695
|
+
}> & z.core.$partial, z.ZodArray<z.ZodObject<{
|
|
696
|
+
key: z.ZodString;
|
|
697
|
+
valueType: z.ZodEnum<{
|
|
698
|
+
number: "number";
|
|
699
|
+
boolean: "boolean";
|
|
700
|
+
date: "date";
|
|
701
|
+
text: "text";
|
|
702
|
+
select: "select";
|
|
703
|
+
multiselect: "multiselect";
|
|
704
|
+
}>;
|
|
705
|
+
required: z.ZodBoolean;
|
|
706
|
+
label: z.ZodString;
|
|
707
|
+
options: z.ZodArray<z.ZodObject<{
|
|
708
|
+
value: z.ZodString;
|
|
709
|
+
label: z.ZodString;
|
|
710
|
+
}, z.core.$strip>>;
|
|
711
|
+
sortOrder: z.ZodNumber;
|
|
712
|
+
}, z.core.$strip>>>;
|
|
713
|
+
}, z.core.$strip>;
|
|
714
|
+
}, z.core.$strip>;
|
|
715
|
+
export type InputSurfaceFieldsResponse = z.infer<typeof inputSurfaceFieldsResponseSchema>;
|
|
407
716
|
export declare const customFieldListFilterFieldsResponseSchema: z.ZodObject<{
|
|
408
717
|
data: z.ZodArray<z.ZodObject<{
|
|
409
718
|
key: z.ZodString;
|
|
@@ -414,6 +723,7 @@ export declare const customFieldListFilterFieldsResponseSchema: z.ZodObject<{
|
|
|
414
723
|
text: "text";
|
|
415
724
|
select: "select";
|
|
416
725
|
multiselect: "multiselect";
|
|
726
|
+
page_builder: "page_builder";
|
|
417
727
|
}>;
|
|
418
728
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
419
729
|
labelDefault: z.ZodString;
|
|
@@ -452,7 +762,7 @@ export declare function isCustomFieldValidationFailure(error: unknown): error is
|
|
|
452
762
|
* `err instanceof CustomFieldDefinitionError`, which meant importing a
|
|
453
763
|
* constructor out of another module to read a string field off it.
|
|
454
764
|
*/
|
|
455
|
-
export declare const CUSTOM_FIELD_DEFINITION_ERROR_CODES: readonly ["not_found", "duplicate_key", "options_required", "options_forbidden", "entity_type_unknown", "value_type_locked", "option_in_use", "list_filter_unsupported", "carry_incompatible"];
|
|
765
|
+
export declare const CUSTOM_FIELD_DEFINITION_ERROR_CODES: readonly ["not_found", "duplicate_key", "options_required", "options_forbidden", "entity_type_unknown", "value_type_locked", "option_in_use", "list_filter_unsupported", "carry_incompatible", "value_type_unsupported", "customer_input_unsupported", "customer_input_audience", "customer_input_value_type", "admin_access_required"];
|
|
456
766
|
export type CustomFieldDefinitionErrorCode = (typeof CUSTOM_FIELD_DEFINITION_ERROR_CODES)[number];
|
|
457
767
|
/** A refused definition or option write, as a host outside `custom_fields` sees it. */
|
|
458
768
|
export interface CustomFieldDefinitionFailure {
|
|
@@ -483,6 +793,10 @@ export interface CustomFieldDefinitionRecord {
|
|
|
483
793
|
listFilter: boolean;
|
|
484
794
|
/** Feature 162 — see {@link customFieldCarryToSchema}. */
|
|
485
795
|
carryTo: SupportedEntityType[];
|
|
796
|
+
/** Feature 175 — the input surfaces a buyer may supply the value on. */
|
|
797
|
+
customerInput: CustomFieldInputSurface[];
|
|
798
|
+
/** Feature 175 — see {@link customFieldAdminAccessSchema}. */
|
|
799
|
+
adminAccess: CustomFieldAdminAccess;
|
|
486
800
|
createdAt: Date;
|
|
487
801
|
updatedAt: Date;
|
|
488
802
|
}
|
|
@@ -604,7 +918,61 @@ export interface CustomFieldValuePort {
|
|
|
604
918
|
* cache, so calling it once per row of a list costs no query per row.
|
|
605
919
|
*/
|
|
606
920
|
projectForCustomer(entityType: SupportedEntityType, bag: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
921
|
+
/**
|
|
922
|
+
* Feature 175 — values a BUYER supplies on a declared input surface, for a record
|
|
923
|
+
* being created. Refuses (never drops) any key not open on `surface`; enforces
|
|
924
|
+
* `required` only among open definitions; text ≤ 1 000 chars after trimming,
|
|
925
|
+
* whitespace-only = empty; ≤ 50 keys, refused before any definition is read.
|
|
926
|
+
* Returns the bag to store. Throws the CustomFieldValidationError family.
|
|
927
|
+
*
|
|
928
|
+
* The administrator's {@link validateAndMerge} is a different rule set and is
|
|
929
|
+
* never the one a buyer-facing route calls: it drops unknown keys and
|
|
930
|
+
* enforces `required` across every definition of the type.
|
|
931
|
+
*
|
|
932
|
+
* Each refusal's `message` is a sentence a buyer can read beside the field —
|
|
933
|
+
* it never names the key or echoes the value. Given `language` (the
|
|
934
|
+
* request's, `request.responseLanguage()`), it is worded in that language by
|
|
935
|
+
* the owning module (`specs/conventions/module-i18n.md`: an HTTP response is
|
|
936
|
+
* translated by the backend, and `code` stays on the wire beside it).
|
|
937
|
+
*/
|
|
938
|
+
validateForCustomerInput(entityType: SupportedEntityType, values: Record<string, unknown> | undefined, surface: CustomFieldInputSurface, language?: SupportedLanguage): Promise<Record<string, unknown>>;
|
|
607
939
|
}
|
|
940
|
+
/**
|
|
941
|
+
* Feature 175 (research R-11) — one admin write path of a custom-field host,
|
|
942
|
+
* as the host declares it in the `customFieldWrites` export beside its
|
|
943
|
+
* manifest. Read as literal source by `check:custom-field-writes`; typed here
|
|
944
|
+
* so `tsc` checks the export too.
|
|
945
|
+
*
|
|
946
|
+
* - `create` / `update` / `values` — the route (`method` + `path`) and the
|
|
947
|
+
* name of the `@endora-commerce/contracts` export validating its body, which
|
|
948
|
+
* must carry `customFieldValues` (a `values` body is the value-bag schema
|
|
949
|
+
* itself).
|
|
950
|
+
* - an exemption — a `create` or `update` the host does not offer values on,
|
|
951
|
+
* with the non-empty reason why.
|
|
952
|
+
* - `buyer-input` — a route on which a buyer supplies values for an input
|
|
953
|
+
* `surface`; `at` is the dotted path of the bag inside `body`, and `test`
|
|
954
|
+
* the file proving its refusals.
|
|
955
|
+
*/
|
|
956
|
+
export type CustomFieldWriteDeclaration = {
|
|
957
|
+
readonly entityType: SupportedEntityType;
|
|
958
|
+
readonly kind: 'create' | 'update' | 'values';
|
|
959
|
+
readonly method: 'POST' | 'PATCH' | 'PUT';
|
|
960
|
+
readonly path: string;
|
|
961
|
+
readonly body: string;
|
|
962
|
+
} | {
|
|
963
|
+
readonly entityType: SupportedEntityType;
|
|
964
|
+
readonly kind: 'create' | 'update';
|
|
965
|
+
readonly exempt: string;
|
|
966
|
+
} | {
|
|
967
|
+
readonly entityType: SupportedEntityType;
|
|
968
|
+
readonly kind: 'buyer-input';
|
|
969
|
+
readonly surface: CustomFieldInputSurface;
|
|
970
|
+
readonly method: 'POST';
|
|
971
|
+
readonly path: string;
|
|
972
|
+
readonly body: string;
|
|
973
|
+
readonly at: string;
|
|
974
|
+
readonly test: string;
|
|
975
|
+
};
|
|
608
976
|
/**
|
|
609
977
|
* Container name: `customFieldListFilterPort`. Owner: `custom_fields`
|
|
610
978
|
* (feature 157).
|