@endora-commerce/contracts 0.110.0 → 0.111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accept-language.d.ts +31 -0
- package/dist/accept-language.js +64 -0
- package/dist/admin-actions.d.ts +2 -0
- package/dist/admin-actions.js +18 -0
- package/dist/admin-contributions.d.ts +37 -5
- package/dist/admin-contributions.js +9 -2
- package/dist/admin-roles.d.ts +9 -0
- package/dist/admin.d.ts +37 -0
- package/dist/admin.js +19 -0
- package/dist/api-keys.d.ts +22 -0
- package/dist/api-keys.js +4 -0
- package/dist/assets-library.d.ts +19 -0
- package/dist/assets-library.js +14 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.js +9 -0
- package/dist/carts.d.ts +30 -1
- package/dist/carts.js +20 -5
- package/dist/catalog.d.ts +61 -22
- package/dist/catalog.js +32 -6
- package/dist/cms.d.ts +33 -3
- package/dist/cms.js +15 -0
- package/dist/command-hooks.d.ts +301 -0
- package/dist/command-hooks.js +248 -0
- package/dist/comparisons.d.ts +14 -14
- package/dist/credit-limits.d.ts +21 -0
- package/dist/credit-limits.js +21 -0
- package/dist/crm.d.ts +81 -55
- package/dist/crm.js +15 -5
- package/dist/custom-fields.d.ts +403 -49
- package/dist/custom-fields.js +127 -0
- package/dist/customer-accounts.d.ts +138 -0
- package/dist/customer-accounts.js +4 -0
- package/dist/customer-notifications.d.ts +143 -0
- package/dist/customer-notifications.js +41 -0
- package/dist/customers.d.ts +52 -0
- package/dist/customers.js +53 -0
- package/dist/dictionary.d.ts +53 -0
- package/dist/dictionary.js +25 -0
- package/dist/document-templates.d.ts +4 -4
- package/dist/email.d.ts +34 -0
- package/dist/email.js +6 -0
- package/dist/errors.d.ts +312 -2
- package/dist/errors.js +377 -2
- package/dist/forms.d.ts +88 -88
- package/dist/i18n.d.ts +34 -0
- package/dist/i18n.js +15 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +12 -1
- package/dist/invoice-ledger.d.ts +6 -6
- package/dist/invoices.d.ts +126 -0
- package/dist/invoices.js +49 -0
- package/dist/line-bounds.d.ts +53 -0
- package/dist/line-bounds.js +65 -0
- package/dist/megamenu.d.ts +27 -27
- package/dist/mfa.d.ts +86 -0
- package/dist/mfa.js +90 -0
- package/dist/modules.d.ts +21 -5
- package/dist/modules.js +60 -3
- package/dist/orders.d.ts +141 -0
- package/dist/orders.js +80 -3
- package/dist/organization-hooks.d.ts +99 -0
- package/dist/organization-hooks.js +22 -0
- package/dist/organization-registry-lookup.d.ts +5 -5
- package/dist/organization-roles.d.ts +1 -0
- package/dist/organization-roles.js +7 -0
- package/dist/organizations.d.ts +954 -17
- package/dist/organizations.js +229 -8
- package/dist/price-books.d.ts +173 -25
- package/dist/price-books.js +41 -0
- package/dist/price-lists.d.ts +5 -2
- package/dist/product-feeds.d.ts +157 -8
- package/dist/product-feeds.js +41 -2
- package/dist/product-scopes.d.ts +17 -0
- package/dist/product-scopes.js +31 -5
- package/dist/projects.d.ts +61 -28
- package/dist/projects.js +47 -9
- package/dist/promotions.d.ts +157 -5
- package/dist/promotions.js +23 -1
- package/dist/pwa.d.ts +39 -0
- package/dist/quick-order.d.ts +9 -3
- package/dist/quick-order.js +4 -3
- package/dist/quote-requests.d.ts +168 -5
- package/dist/quote-requests.js +69 -8
- package/dist/record-references.d.ts +15 -15
- package/dist/returns.d.ts +6 -0
- package/dist/returns.js +4 -2
- package/dist/sales-channels.d.ts +34 -3
- package/dist/sales-channels.js +16 -1
- package/dist/schema-extensions.d.ts +36 -0
- package/dist/schema-extensions.js +29 -0
- package/dist/seo.d.ts +2 -2
- package/dist/settings.d.ts +44 -2
- package/dist/settings.js +17 -2
- package/dist/shopping-lists.d.ts +39 -1
- package/dist/shopping-lists.js +37 -3
- package/dist/storefront-cache-tags.d.ts +10 -0
- package/dist/tasks.d.ts +21 -21
- package/dist/taxes.d.ts +27 -0
- package/dist/taxes.js +4 -0
- package/dist/transactional-emails.d.ts +39 -13
- package/dist/webhooks.d.ts +75 -0
- package/dist/webhooks.js +24 -0
- package/package.json +4 -2
- package/dist/actor.d.ts.map +0 -1
- package/dist/actor.js.map +0 -1
- package/dist/addresses.d.ts.map +0 -1
- package/dist/addresses.js.map +0 -1
- package/dist/admin-actions.d.ts.map +0 -1
- package/dist/admin-actions.js.map +0 -1
- package/dist/admin-contributions.d.ts.map +0 -1
- package/dist/admin-contributions.js.map +0 -1
- package/dist/admin-feedback.d.ts.map +0 -1
- package/dist/admin-feedback.js.map +0 -1
- package/dist/admin-i18n.d.ts.map +0 -1
- package/dist/admin-i18n.js.map +0 -1
- package/dist/admin-name.d.ts.map +0 -1
- package/dist/admin-name.js.map +0 -1
- package/dist/admin-notifications.d.ts.map +0 -1
- package/dist/admin-notifications.js.map +0 -1
- package/dist/admin-preferences.d.ts.map +0 -1
- package/dist/admin-preferences.js.map +0 -1
- package/dist/admin-roles.d.ts.map +0 -1
- package/dist/admin-roles.js.map +0 -1
- package/dist/admin-search.d.ts.map +0 -1
- package/dist/admin-search.js.map +0 -1
- package/dist/admin-users.d.ts.map +0 -1
- package/dist/admin-users.js.map +0 -1
- package/dist/admin.d.ts.map +0 -1
- package/dist/admin.js.map +0 -1
- package/dist/analytics.d.ts.map +0 -1
- package/dist/analytics.js.map +0 -1
- package/dist/api-keys.d.ts.map +0 -1
- package/dist/api-keys.js.map +0 -1
- package/dist/assets-library.d.ts.map +0 -1
- package/dist/assets-library.js.map +0 -1
- package/dist/audit-logs.d.ts.map +0 -1
- package/dist/audit-logs.js.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/blog.d.ts.map +0 -1
- package/dist/blog.js.map +0 -1
- package/dist/capabilities.d.ts.map +0 -1
- package/dist/capabilities.js.map +0 -1
- package/dist/carts.d.ts.map +0 -1
- package/dist/carts.js.map +0 -1
- package/dist/catalog.d.ts.map +0 -1
- package/dist/catalog.js.map +0 -1
- package/dist/cms-brand.d.ts.map +0 -1
- package/dist/cms-brand.js.map +0 -1
- package/dist/cms-contact-form.d.ts.map +0 -1
- package/dist/cms-contact-form.js.map +0 -1
- package/dist/cms.d.ts.map +0 -1
- package/dist/cms.js.map +0 -1
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js.map +0 -1
- package/dist/comparisons.d.ts.map +0 -1
- package/dist/comparisons.js.map +0 -1
- package/dist/credentials.d.ts.map +0 -1
- package/dist/credentials.js.map +0 -1
- package/dist/credit-limits.d.ts.map +0 -1
- package/dist/credit-limits.js.map +0 -1
- package/dist/crm-rich-text.d.ts.map +0 -1
- package/dist/crm-rich-text.js.map +0 -1
- package/dist/crm.d.ts.map +0 -1
- package/dist/crm.js.map +0 -1
- package/dist/currencies.d.ts.map +0 -1
- package/dist/currencies.js.map +0 -1
- package/dist/custom-fields.d.ts.map +0 -1
- package/dist/custom-fields.js.map +0 -1
- package/dist/customer-accounts.d.ts.map +0 -1
- package/dist/customer-accounts.js.map +0 -1
- package/dist/customers.d.ts.map +0 -1
- package/dist/customers.js.map +0 -1
- package/dist/dictionary.d.ts.map +0 -1
- package/dist/dictionary.js.map +0 -1
- package/dist/document-templates.d.ts.map +0 -1
- package/dist/document-templates.js.map +0 -1
- package/dist/document-values.d.ts.map +0 -1
- package/dist/document-values.js.map +0 -1
- package/dist/email-address.d.ts.map +0 -1
- package/dist/email-address.js.map +0 -1
- package/dist/email.d.ts.map +0 -1
- package/dist/email.js.map +0 -1
- package/dist/envelopes.d.ts.map +0 -1
- package/dist/envelopes.js.map +0 -1
- package/dist/environment-inputs.d.ts.map +0 -1
- package/dist/environment-inputs.js.map +0 -1
- package/dist/erp-connector.d.ts.map +0 -1
- package/dist/erp-connector.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/forms-logic.d.ts.map +0 -1
- package/dist/forms-logic.fixtures.d.ts.map +0 -1
- package/dist/forms-logic.fixtures.js.map +0 -1
- package/dist/forms-logic.js.map +0 -1
- package/dist/forms.d.ts.map +0 -1
- package/dist/forms.js.map +0 -1
- package/dist/google-analytics.d.ts.map +0 -1
- package/dist/google-analytics.js.map +0 -1
- package/dist/google-tag-manager.d.ts.map +0 -1
- package/dist/google-tag-manager.js.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/i18n.js.map +0 -1
- package/dist/import-export.d.ts.map +0 -1
- package/dist/import-export.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inventory.d.ts.map +0 -1
- package/dist/inventory.js.map +0 -1
- package/dist/invoice-ledger.d.ts.map +0 -1
- package/dist/invoice-ledger.js.map +0 -1
- package/dist/invoices.d.ts.map +0 -1
- package/dist/invoices.js.map +0 -1
- package/dist/kernel.d.ts.map +0 -1
- package/dist/kernel.js.map +0 -1
- package/dist/languages.d.ts.map +0 -1
- package/dist/languages.js.map +0 -1
- package/dist/line-groups.d.ts.map +0 -1
- package/dist/line-groups.js.map +0 -1
- package/dist/linkedin-ads.d.ts.map +0 -1
- package/dist/linkedin-ads.js.map +0 -1
- package/dist/localized-name.d.ts.map +0 -1
- package/dist/localized-name.js.map +0 -1
- package/dist/megamenu.d.ts.map +0 -1
- package/dist/megamenu.js.map +0 -1
- package/dist/meta-ads.d.ts.map +0 -1
- package/dist/meta-ads.js.map +0 -1
- package/dist/mfa.d.ts.map +0 -1
- package/dist/mfa.js.map +0 -1
- package/dist/modules.d.ts.map +0 -1
- package/dist/modules.js.map +0 -1
- package/dist/money-decimal.d.ts.map +0 -1
- package/dist/money-decimal.js.map +0 -1
- package/dist/money-input.d.ts.map +0 -1
- package/dist/money-input.js.map +0 -1
- package/dist/newsletter.d.ts.map +0 -1
- package/dist/newsletter.js.map +0 -1
- package/dist/order-minimums.d.ts.map +0 -1
- package/dist/order-minimums.js.map +0 -1
- package/dist/orders.d.ts.map +0 -1
- package/dist/orders.js.map +0 -1
- package/dist/organization-registry-lookup.d.ts.map +0 -1
- package/dist/organization-registry-lookup.js.map +0 -1
- package/dist/organization-roles.d.ts.map +0 -1
- package/dist/organization-roles.js.map +0 -1
- package/dist/organizations.d.ts.map +0 -1
- package/dist/organizations.js.map +0 -1
- package/dist/page-builder-props.d.ts.map +0 -1
- package/dist/page-builder-props.js.map +0 -1
- package/dist/page-builder-values.d.ts.map +0 -1
- package/dist/page-builder-values.js.map +0 -1
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js.map +0 -1
- package/dist/payment-methods.d.ts.map +0 -1
- package/dist/payment-methods.js.map +0 -1
- package/dist/payment-return-url.d.ts.map +0 -1
- package/dist/payment-return-url.js.map +0 -1
- package/dist/payments.d.ts.map +0 -1
- package/dist/payments.js.map +0 -1
- package/dist/pim-connector.d.ts.map +0 -1
- package/dist/pim-connector.js.map +0 -1
- package/dist/pim-field-path.d.ts.map +0 -1
- package/dist/pim-field-path.js.map +0 -1
- package/dist/pim-locale-mapping.d.ts.map +0 -1
- package/dist/pim-locale-mapping.js.map +0 -1
- package/dist/platform-info.d.ts.map +0 -1
- package/dist/platform-info.js.map +0 -1
- package/dist/platform-language.d.ts.map +0 -1
- package/dist/platform-language.js.map +0 -1
- package/dist/price-book-decimal.d.ts.map +0 -1
- package/dist/price-book-decimal.js.map +0 -1
- package/dist/price-books.d.ts.map +0 -1
- package/dist/price-books.js.map +0 -1
- package/dist/price-lists.d.ts.map +0 -1
- package/dist/price-lists.js.map +0 -1
- package/dist/product-feeds.d.ts.map +0 -1
- package/dist/product-feeds.js.map +0 -1
- package/dist/product-scope-model.d.ts.map +0 -1
- package/dist/product-scope-model.js.map +0 -1
- package/dist/product-scope-overrides.d.ts.map +0 -1
- package/dist/product-scope-overrides.js.map +0 -1
- package/dist/product-scoped-values.d.ts.map +0 -1
- package/dist/product-scoped-values.js.map +0 -1
- package/dist/product-scopes.d.ts.map +0 -1
- package/dist/product-scopes.js.map +0 -1
- package/dist/product-summary-text.d.ts.map +0 -1
- package/dist/product-summary-text.js.map +0 -1
- package/dist/product-tax-rates.d.ts.map +0 -1
- package/dist/product-tax-rates.js.map +0 -1
- package/dist/product-url-keys.d.ts.map +0 -1
- package/dist/product-url-keys.js.map +0 -1
- package/dist/product-value-resolver.d.ts.map +0 -1
- package/dist/product-value-resolver.js.map +0 -1
- package/dist/projects.d.ts.map +0 -1
- package/dist/projects.js.map +0 -1
- package/dist/promotions.d.ts.map +0 -1
- package/dist/promotions.js.map +0 -1
- package/dist/prompt-actions.d.ts.map +0 -1
- package/dist/prompt-actions.js.map +0 -1
- package/dist/pwa.d.ts.map +0 -1
- package/dist/pwa.js.map +0 -1
- package/dist/quick-order.d.ts.map +0 -1
- package/dist/quick-order.js.map +0 -1
- package/dist/quote-requests.d.ts.map +0 -1
- package/dist/quote-requests.js.map +0 -1
- package/dist/record-references.d.ts.map +0 -1
- package/dist/record-references.js.map +0 -1
- package/dist/record-rich-text.d.ts.map +0 -1
- package/dist/record-rich-text.js.map +0 -1
- package/dist/returns.d.ts.map +0 -1
- package/dist/returns.js.map +0 -1
- package/dist/sales-channels.d.ts.map +0 -1
- package/dist/sales-channels.js.map +0 -1
- package/dist/saved-list-views.d.ts.map +0 -1
- package/dist/saved-list-views.js.map +0 -1
- package/dist/scope-notice.d.ts.map +0 -1
- package/dist/scope-notice.js.map +0 -1
- package/dist/scoped-write-encoding.d.ts.map +0 -1
- package/dist/scoped-write-encoding.js.map +0 -1
- package/dist/search.d.ts.map +0 -1
- package/dist/search.js.map +0 -1
- package/dist/seo.d.ts.map +0 -1
- package/dist/seo.js.map +0 -1
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js.map +0 -1
- package/dist/shipments.d.ts.map +0 -1
- package/dist/shipments.js.map +0 -1
- package/dist/shipping-methods.d.ts.map +0 -1
- package/dist/shipping-methods.js.map +0 -1
- package/dist/shopping-lists.d.ts.map +0 -1
- package/dist/shopping-lists.js.map +0 -1
- package/dist/storefront-cache-tags.d.ts.map +0 -1
- package/dist/storefront-cache-tags.js.map +0 -1
- package/dist/storefront-language-path.d.ts.map +0 -1
- package/dist/storefront-language-path.js.map +0 -1
- package/dist/storefront-value-overrides.d.ts.map +0 -1
- package/dist/storefront-value-overrides.js.map +0 -1
- package/dist/tasks.d.ts.map +0 -1
- package/dist/tasks.js.map +0 -1
- package/dist/taxes.d.ts.map +0 -1
- package/dist/taxes.js.map +0 -1
- package/dist/text-normalization.d.ts.map +0 -1
- package/dist/text-normalization.js.map +0 -1
- package/dist/transactional-emails.d.ts.map +0 -1
- package/dist/transactional-emails.js.map +0 -1
- package/dist/webhooks.d.ts.map +0 -1
- package/dist/webhooks.js.map +0 -1
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,16 +12,84 @@ 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>;
|
|
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
|
+
};
|
|
24
93
|
/**
|
|
25
94
|
* The set of runtime value types. `text` is stored as a string; `select` stores one option value; `multiselect` an array.
|
|
26
95
|
*
|
|
@@ -35,8 +104,8 @@ export declare const customFieldValueTypeSchema: z.ZodEnum<{
|
|
|
35
104
|
boolean: "boolean";
|
|
36
105
|
date: "date";
|
|
37
106
|
text: "text";
|
|
38
|
-
multiselect: "multiselect";
|
|
39
107
|
select: "select";
|
|
108
|
+
multiselect: "multiselect";
|
|
40
109
|
page_builder: "page_builder";
|
|
41
110
|
}>;
|
|
42
111
|
export type CustomFieldValueType = z.infer<typeof customFieldValueTypeSchema>;
|
|
@@ -58,6 +127,31 @@ export declare const customFieldAudienceSchema: z.ZodEnum<{
|
|
|
58
127
|
internal: "internal";
|
|
59
128
|
}>;
|
|
60
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>;
|
|
61
155
|
export declare const localizedLabelSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
62
156
|
export type LocalizedLabel = z.infer<typeof localizedLabelSchema>;
|
|
63
157
|
/** A select/multiselect option. `id` absent on create. */
|
|
@@ -98,28 +192,28 @@ export declare const CUSTOM_FIELD_CARRY_MAX_TARGETS = 2;
|
|
|
98
192
|
*/
|
|
99
193
|
export declare const customFieldCarryToSchema: z.ZodArray<z.ZodEnum<{
|
|
100
194
|
customer: "customer";
|
|
101
|
-
product: "product";
|
|
102
195
|
category: "category";
|
|
103
196
|
order: "order";
|
|
104
197
|
organization: "organization";
|
|
105
198
|
quote_request: "quote_request";
|
|
106
|
-
|
|
199
|
+
product: "product";
|
|
107
200
|
opportunity: "opportunity";
|
|
108
201
|
project: "project";
|
|
202
|
+
task: "task";
|
|
109
203
|
}>>;
|
|
110
204
|
/** A full custom-field definition, options embedded. */
|
|
111
205
|
export declare const customFieldDefinitionSchema: z.ZodObject<{
|
|
112
206
|
id: z.ZodString;
|
|
113
207
|
entityType: z.ZodEnum<{
|
|
114
208
|
customer: "customer";
|
|
115
|
-
product: "product";
|
|
116
209
|
category: "category";
|
|
117
210
|
order: "order";
|
|
118
211
|
organization: "organization";
|
|
119
212
|
quote_request: "quote_request";
|
|
120
|
-
|
|
213
|
+
product: "product";
|
|
121
214
|
opportunity: "opportunity";
|
|
122
215
|
project: "project";
|
|
216
|
+
task: "task";
|
|
123
217
|
}>;
|
|
124
218
|
key: z.ZodString;
|
|
125
219
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
@@ -129,8 +223,8 @@ export declare const customFieldDefinitionSchema: z.ZodObject<{
|
|
|
129
223
|
boolean: "boolean";
|
|
130
224
|
date: "date";
|
|
131
225
|
text: "text";
|
|
132
|
-
multiselect: "multiselect";
|
|
133
226
|
select: "select";
|
|
227
|
+
multiselect: "multiselect";
|
|
134
228
|
page_builder: "page_builder";
|
|
135
229
|
}>;
|
|
136
230
|
required: z.ZodBoolean;
|
|
@@ -143,15 +237,23 @@ export declare const customFieldDefinitionSchema: z.ZodObject<{
|
|
|
143
237
|
listFilter: z.ZodBoolean;
|
|
144
238
|
carryTo: z.ZodArray<z.ZodEnum<{
|
|
145
239
|
customer: "customer";
|
|
146
|
-
product: "product";
|
|
147
240
|
category: "category";
|
|
148
241
|
order: "order";
|
|
149
242
|
organization: "organization";
|
|
150
243
|
quote_request: "quote_request";
|
|
151
|
-
|
|
244
|
+
product: "product";
|
|
152
245
|
opportunity: "opportunity";
|
|
153
246
|
project: "project";
|
|
247
|
+
task: "task";
|
|
248
|
+
}>>;
|
|
249
|
+
customerInput: z.ZodArray<z.ZodEnum<{
|
|
250
|
+
"organization.register": "organization.register";
|
|
154
251
|
}>>;
|
|
252
|
+
adminAccess: z.ZodEnum<{
|
|
253
|
+
hidden: "hidden";
|
|
254
|
+
edit: "edit";
|
|
255
|
+
read: "read";
|
|
256
|
+
}>;
|
|
155
257
|
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
156
258
|
id: z.ZodOptional<z.ZodString>;
|
|
157
259
|
value: z.ZodString;
|
|
@@ -164,6 +266,76 @@ export declare const customFieldDefinitionSchema: z.ZodObject<{
|
|
|
164
266
|
updatedAt: z.ZodString;
|
|
165
267
|
}, z.core.$strip>;
|
|
166
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>;
|
|
167
339
|
/** Create a definition. `entityType` + `key` are immutable after create. */
|
|
168
340
|
export declare const createCustomFieldDefinitionSchema: z.ZodObject<{
|
|
169
341
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
@@ -172,34 +344,34 @@ export declare const createCustomFieldDefinitionSchema: z.ZodObject<{
|
|
|
172
344
|
sortOrder: z.ZodNumber;
|
|
173
345
|
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
174
346
|
labelDefault: z.ZodString;
|
|
175
|
-
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
176
|
-
id: z.ZodOptional<z.ZodString>;
|
|
177
|
-
value: z.ZodString;
|
|
178
|
-
label: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
179
|
-
labelDefault: z.ZodString;
|
|
180
|
-
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
181
|
-
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
182
|
-
}, z.core.$strip>>>;
|
|
183
|
-
valueType: z.ZodEnum<{
|
|
184
|
-
number: "number";
|
|
185
|
-
boolean: "boolean";
|
|
186
|
-
date: "date";
|
|
187
|
-
text: "text";
|
|
188
|
-
multiselect: "multiselect";
|
|
189
|
-
select: "select";
|
|
190
|
-
page_builder: "page_builder";
|
|
191
|
-
}>;
|
|
192
347
|
entityType: z.ZodEnum<{
|
|
193
348
|
customer: "customer";
|
|
194
|
-
product: "product";
|
|
195
349
|
category: "category";
|
|
196
350
|
order: "order";
|
|
197
351
|
organization: "organization";
|
|
198
352
|
quote_request: "quote_request";
|
|
199
|
-
|
|
353
|
+
product: "product";
|
|
200
354
|
opportunity: "opportunity";
|
|
201
355
|
project: "project";
|
|
356
|
+
task: "task";
|
|
202
357
|
}>;
|
|
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>>>;
|
|
203
375
|
audience: z.ZodDefault<z.ZodEnum<{
|
|
204
376
|
customer: "customer";
|
|
205
377
|
internal: "internal";
|
|
@@ -207,15 +379,23 @@ export declare const createCustomFieldDefinitionSchema: z.ZodObject<{
|
|
|
207
379
|
listFilter: z.ZodOptional<z.ZodBoolean>;
|
|
208
380
|
carryTo: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
209
381
|
customer: "customer";
|
|
210
|
-
product: "product";
|
|
211
382
|
category: "category";
|
|
212
383
|
order: "order";
|
|
213
384
|
organization: "organization";
|
|
214
385
|
quote_request: "quote_request";
|
|
215
|
-
|
|
386
|
+
product: "product";
|
|
216
387
|
opportunity: "opportunity";
|
|
217
388
|
project: "project";
|
|
389
|
+
task: "task";
|
|
218
390
|
}>>>;
|
|
391
|
+
customerInput: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
392
|
+
"organization.register": "organization.register";
|
|
393
|
+
}>>>;
|
|
394
|
+
adminAccess: z.ZodDefault<z.ZodEnum<{
|
|
395
|
+
hidden: "hidden";
|
|
396
|
+
edit: "edit";
|
|
397
|
+
read: "read";
|
|
398
|
+
}>>;
|
|
219
399
|
}, z.core.$strip>;
|
|
220
400
|
export type CreateCustomFieldDefinitionRequest = z.infer<typeof createCustomFieldDefinitionSchema>;
|
|
221
401
|
/** Patch a definition. `entityType` and `key` cannot change once records may hold values. */
|
|
@@ -224,23 +404,23 @@ export declare const updateCustomFieldDefinitionSchema: z.ZodObject<{
|
|
|
224
404
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
225
405
|
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
226
406
|
labelDefault: z.ZodOptional<z.ZodString>;
|
|
227
|
-
options: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
228
|
-
id: z.ZodOptional<z.ZodString>;
|
|
229
|
-
value: z.ZodString;
|
|
230
|
-
label: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
231
|
-
labelDefault: z.ZodString;
|
|
232
|
-
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
233
|
-
sortOrder: z.ZodDefault<z.ZodNumber>;
|
|
234
|
-
}, z.core.$strip>>>>;
|
|
235
407
|
valueType: z.ZodOptional<z.ZodEnum<{
|
|
236
408
|
number: "number";
|
|
237
409
|
boolean: "boolean";
|
|
238
410
|
date: "date";
|
|
239
411
|
text: "text";
|
|
240
|
-
multiselect: "multiselect";
|
|
241
412
|
select: "select";
|
|
413
|
+
multiselect: "multiselect";
|
|
242
414
|
page_builder: "page_builder";
|
|
243
415
|
}>>;
|
|
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>>>>;
|
|
244
424
|
audience: z.ZodOptional<z.ZodEnum<{
|
|
245
425
|
customer: "customer";
|
|
246
426
|
internal: "internal";
|
|
@@ -249,15 +429,23 @@ export declare const updateCustomFieldDefinitionSchema: z.ZodObject<{
|
|
|
249
429
|
listFilter: z.ZodOptional<z.ZodBoolean>;
|
|
250
430
|
carryTo: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
251
431
|
customer: "customer";
|
|
252
|
-
product: "product";
|
|
253
432
|
category: "category";
|
|
254
433
|
order: "order";
|
|
255
434
|
organization: "organization";
|
|
256
435
|
quote_request: "quote_request";
|
|
257
|
-
|
|
436
|
+
product: "product";
|
|
258
437
|
opportunity: "opportunity";
|
|
259
438
|
project: "project";
|
|
439
|
+
task: "task";
|
|
440
|
+
}>>>;
|
|
441
|
+
customerInput: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
442
|
+
"organization.register": "organization.register";
|
|
260
443
|
}>>>;
|
|
444
|
+
adminAccess: z.ZodOptional<z.ZodEnum<{
|
|
445
|
+
hidden: "hidden";
|
|
446
|
+
edit: "edit";
|
|
447
|
+
read: "read";
|
|
448
|
+
}>>;
|
|
261
449
|
}, z.core.$strip>;
|
|
262
450
|
export type UpdateCustomFieldDefinitionRequest = z.infer<typeof updateCustomFieldDefinitionSchema>;
|
|
263
451
|
/**
|
|
@@ -270,14 +458,14 @@ export type UpdateCustomFieldDefinitionRequest = z.infer<typeof updateCustomFiel
|
|
|
270
458
|
export declare const customFieldEntityTypeInfoSchema: z.ZodObject<{
|
|
271
459
|
entityType: z.ZodEnum<{
|
|
272
460
|
customer: "customer";
|
|
273
|
-
product: "product";
|
|
274
461
|
category: "category";
|
|
275
462
|
order: "order";
|
|
276
463
|
organization: "organization";
|
|
277
464
|
quote_request: "quote_request";
|
|
278
|
-
|
|
465
|
+
product: "product";
|
|
279
466
|
opportunity: "opportunity";
|
|
280
467
|
project: "project";
|
|
468
|
+
task: "task";
|
|
281
469
|
}>;
|
|
282
470
|
labelKey: z.ZodString;
|
|
283
471
|
managedBy: z.ZodOptional<z.ZodObject<{
|
|
@@ -288,17 +476,58 @@ export declare const customFieldEntityTypeInfoSchema: z.ZodObject<{
|
|
|
288
476
|
listFilter: z.ZodBoolean;
|
|
289
477
|
carryTargets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
290
478
|
customer: "customer";
|
|
291
|
-
product: "product";
|
|
292
479
|
category: "category";
|
|
293
480
|
order: "order";
|
|
294
481
|
organization: "organization";
|
|
295
482
|
quote_request: "quote_request";
|
|
296
|
-
|
|
483
|
+
product: "product";
|
|
297
484
|
opportunity: "opportunity";
|
|
298
485
|
project: "project";
|
|
486
|
+
task: "task";
|
|
487
|
+
}>>>;
|
|
488
|
+
customerInputSurfaces: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
489
|
+
"organization.register": "organization.register";
|
|
299
490
|
}>>>;
|
|
300
491
|
}, z.core.$strip>;
|
|
301
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>;
|
|
302
531
|
/** A validated value bag keyed by definition `key`. Values are typed by their definition's `valueType`. */
|
|
303
532
|
export declare const customFieldValuesSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
304
533
|
export type CustomFieldValues = z.infer<typeof customFieldValuesSchema>;
|
|
@@ -311,6 +540,8 @@ export declare const customFieldValidationErrorSchema: z.ZodObject<{
|
|
|
311
540
|
unknown_option: "unknown_option";
|
|
312
541
|
out_of_range: "out_of_range";
|
|
313
542
|
duplicate_option: "duplicate_option";
|
|
543
|
+
not_open_for_input: "not_open_for_input";
|
|
544
|
+
too_many_keys: "too_many_keys";
|
|
314
545
|
}>;
|
|
315
546
|
message: z.ZodString;
|
|
316
547
|
}, z.core.$strip>;
|
|
@@ -404,8 +635,8 @@ export declare const customFieldListFilterFieldSchema: z.ZodObject<{
|
|
|
404
635
|
boolean: "boolean";
|
|
405
636
|
date: "date";
|
|
406
637
|
text: "text";
|
|
407
|
-
multiselect: "multiselect";
|
|
408
638
|
select: "select";
|
|
639
|
+
multiselect: "multiselect";
|
|
409
640
|
page_builder: "page_builder";
|
|
410
641
|
}>;
|
|
411
642
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
@@ -417,6 +648,71 @@ export declare const customFieldListFilterFieldSchema: z.ZodObject<{
|
|
|
417
648
|
}, z.core.$strip>>;
|
|
418
649
|
}, z.core.$strict>;
|
|
419
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>;
|
|
420
716
|
export declare const customFieldListFilterFieldsResponseSchema: z.ZodObject<{
|
|
421
717
|
data: z.ZodArray<z.ZodObject<{
|
|
422
718
|
key: z.ZodString;
|
|
@@ -425,8 +721,8 @@ export declare const customFieldListFilterFieldsResponseSchema: z.ZodObject<{
|
|
|
425
721
|
boolean: "boolean";
|
|
426
722
|
date: "date";
|
|
427
723
|
text: "text";
|
|
428
|
-
multiselect: "multiselect";
|
|
429
724
|
select: "select";
|
|
725
|
+
multiselect: "multiselect";
|
|
430
726
|
page_builder: "page_builder";
|
|
431
727
|
}>;
|
|
432
728
|
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
@@ -466,7 +762,7 @@ export declare function isCustomFieldValidationFailure(error: unknown): error is
|
|
|
466
762
|
* `err instanceof CustomFieldDefinitionError`, which meant importing a
|
|
467
763
|
* constructor out of another module to read a string field off it.
|
|
468
764
|
*/
|
|
469
|
-
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"];
|
|
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"];
|
|
470
766
|
export type CustomFieldDefinitionErrorCode = (typeof CUSTOM_FIELD_DEFINITION_ERROR_CODES)[number];
|
|
471
767
|
/** A refused definition or option write, as a host outside `custom_fields` sees it. */
|
|
472
768
|
export interface CustomFieldDefinitionFailure {
|
|
@@ -497,6 +793,10 @@ export interface CustomFieldDefinitionRecord {
|
|
|
497
793
|
listFilter: boolean;
|
|
498
794
|
/** Feature 162 — see {@link customFieldCarryToSchema}. */
|
|
499
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;
|
|
500
800
|
createdAt: Date;
|
|
501
801
|
updatedAt: Date;
|
|
502
802
|
}
|
|
@@ -618,7 +918,61 @@ export interface CustomFieldValuePort {
|
|
|
618
918
|
* cache, so calling it once per row of a list costs no query per row.
|
|
619
919
|
*/
|
|
620
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>>;
|
|
621
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
|
+
};
|
|
622
976
|
/**
|
|
623
977
|
* Container name: `customFieldListFilterPort`. Owner: `custom_fields`
|
|
624
978
|
* (feature 157).
|