@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.
Files changed (347) hide show
  1. package/dist/accept-language.d.ts +31 -0
  2. package/dist/accept-language.js +64 -0
  3. package/dist/admin-actions.d.ts +2 -0
  4. package/dist/admin-actions.js +18 -0
  5. package/dist/admin-contributions.d.ts +37 -5
  6. package/dist/admin-contributions.js +9 -2
  7. package/dist/admin-roles.d.ts +9 -0
  8. package/dist/admin.d.ts +37 -0
  9. package/dist/admin.js +19 -0
  10. package/dist/api-keys.d.ts +22 -0
  11. package/dist/api-keys.js +4 -0
  12. package/dist/assets-library.d.ts +19 -0
  13. package/dist/assets-library.js +14 -0
  14. package/dist/auth.d.ts +9 -0
  15. package/dist/auth.js +9 -0
  16. package/dist/carts.d.ts +30 -1
  17. package/dist/carts.js +20 -5
  18. package/dist/catalog.d.ts +61 -22
  19. package/dist/catalog.js +32 -6
  20. package/dist/cms.d.ts +33 -3
  21. package/dist/cms.js +15 -0
  22. package/dist/command-hooks.d.ts +301 -0
  23. package/dist/command-hooks.js +248 -0
  24. package/dist/comparisons.d.ts +14 -14
  25. package/dist/credit-limits.d.ts +21 -0
  26. package/dist/credit-limits.js +21 -0
  27. package/dist/crm.d.ts +81 -55
  28. package/dist/crm.js +15 -5
  29. package/dist/custom-fields.d.ts +403 -49
  30. package/dist/custom-fields.js +127 -0
  31. package/dist/customer-accounts.d.ts +138 -0
  32. package/dist/customer-accounts.js +4 -0
  33. package/dist/customer-notifications.d.ts +143 -0
  34. package/dist/customer-notifications.js +41 -0
  35. package/dist/customers.d.ts +52 -0
  36. package/dist/customers.js +53 -0
  37. package/dist/dictionary.d.ts +53 -0
  38. package/dist/dictionary.js +25 -0
  39. package/dist/document-templates.d.ts +4 -4
  40. package/dist/email.d.ts +34 -0
  41. package/dist/email.js +6 -0
  42. package/dist/errors.d.ts +312 -2
  43. package/dist/errors.js +377 -2
  44. package/dist/forms.d.ts +88 -88
  45. package/dist/i18n.d.ts +34 -0
  46. package/dist/i18n.js +15 -0
  47. package/dist/index.d.ts +7 -1
  48. package/dist/index.js +12 -1
  49. package/dist/invoice-ledger.d.ts +6 -6
  50. package/dist/invoices.d.ts +126 -0
  51. package/dist/invoices.js +49 -0
  52. package/dist/line-bounds.d.ts +53 -0
  53. package/dist/line-bounds.js +65 -0
  54. package/dist/megamenu.d.ts +27 -27
  55. package/dist/mfa.d.ts +86 -0
  56. package/dist/mfa.js +90 -0
  57. package/dist/modules.d.ts +21 -5
  58. package/dist/modules.js +60 -3
  59. package/dist/orders.d.ts +141 -0
  60. package/dist/orders.js +80 -3
  61. package/dist/organization-hooks.d.ts +99 -0
  62. package/dist/organization-hooks.js +22 -0
  63. package/dist/organization-registry-lookup.d.ts +5 -5
  64. package/dist/organization-roles.d.ts +1 -0
  65. package/dist/organization-roles.js +7 -0
  66. package/dist/organizations.d.ts +954 -17
  67. package/dist/organizations.js +229 -8
  68. package/dist/price-books.d.ts +173 -25
  69. package/dist/price-books.js +41 -0
  70. package/dist/price-lists.d.ts +5 -2
  71. package/dist/product-feeds.d.ts +157 -8
  72. package/dist/product-feeds.js +41 -2
  73. package/dist/product-scopes.d.ts +17 -0
  74. package/dist/product-scopes.js +31 -5
  75. package/dist/projects.d.ts +61 -28
  76. package/dist/projects.js +47 -9
  77. package/dist/promotions.d.ts +157 -5
  78. package/dist/promotions.js +23 -1
  79. package/dist/pwa.d.ts +39 -0
  80. package/dist/quick-order.d.ts +9 -3
  81. package/dist/quick-order.js +4 -3
  82. package/dist/quote-requests.d.ts +168 -5
  83. package/dist/quote-requests.js +69 -8
  84. package/dist/record-references.d.ts +15 -15
  85. package/dist/returns.d.ts +6 -0
  86. package/dist/returns.js +4 -2
  87. package/dist/sales-channels.d.ts +34 -3
  88. package/dist/sales-channels.js +16 -1
  89. package/dist/schema-extensions.d.ts +36 -0
  90. package/dist/schema-extensions.js +29 -0
  91. package/dist/seo.d.ts +2 -2
  92. package/dist/settings.d.ts +44 -2
  93. package/dist/settings.js +17 -2
  94. package/dist/shopping-lists.d.ts +39 -1
  95. package/dist/shopping-lists.js +37 -3
  96. package/dist/storefront-cache-tags.d.ts +10 -0
  97. package/dist/tasks.d.ts +21 -21
  98. package/dist/taxes.d.ts +27 -0
  99. package/dist/taxes.js +4 -0
  100. package/dist/transactional-emails.d.ts +39 -13
  101. package/dist/webhooks.d.ts +75 -0
  102. package/dist/webhooks.js +24 -0
  103. package/package.json +4 -2
  104. package/dist/actor.d.ts.map +0 -1
  105. package/dist/actor.js.map +0 -1
  106. package/dist/addresses.d.ts.map +0 -1
  107. package/dist/addresses.js.map +0 -1
  108. package/dist/admin-actions.d.ts.map +0 -1
  109. package/dist/admin-actions.js.map +0 -1
  110. package/dist/admin-contributions.d.ts.map +0 -1
  111. package/dist/admin-contributions.js.map +0 -1
  112. package/dist/admin-feedback.d.ts.map +0 -1
  113. package/dist/admin-feedback.js.map +0 -1
  114. package/dist/admin-i18n.d.ts.map +0 -1
  115. package/dist/admin-i18n.js.map +0 -1
  116. package/dist/admin-name.d.ts.map +0 -1
  117. package/dist/admin-name.js.map +0 -1
  118. package/dist/admin-notifications.d.ts.map +0 -1
  119. package/dist/admin-notifications.js.map +0 -1
  120. package/dist/admin-preferences.d.ts.map +0 -1
  121. package/dist/admin-preferences.js.map +0 -1
  122. package/dist/admin-roles.d.ts.map +0 -1
  123. package/dist/admin-roles.js.map +0 -1
  124. package/dist/admin-search.d.ts.map +0 -1
  125. package/dist/admin-search.js.map +0 -1
  126. package/dist/admin-users.d.ts.map +0 -1
  127. package/dist/admin-users.js.map +0 -1
  128. package/dist/admin.d.ts.map +0 -1
  129. package/dist/admin.js.map +0 -1
  130. package/dist/analytics.d.ts.map +0 -1
  131. package/dist/analytics.js.map +0 -1
  132. package/dist/api-keys.d.ts.map +0 -1
  133. package/dist/api-keys.js.map +0 -1
  134. package/dist/assets-library.d.ts.map +0 -1
  135. package/dist/assets-library.js.map +0 -1
  136. package/dist/audit-logs.d.ts.map +0 -1
  137. package/dist/audit-logs.js.map +0 -1
  138. package/dist/auth.d.ts.map +0 -1
  139. package/dist/auth.js.map +0 -1
  140. package/dist/blog.d.ts.map +0 -1
  141. package/dist/blog.js.map +0 -1
  142. package/dist/capabilities.d.ts.map +0 -1
  143. package/dist/capabilities.js.map +0 -1
  144. package/dist/carts.d.ts.map +0 -1
  145. package/dist/carts.js.map +0 -1
  146. package/dist/catalog.d.ts.map +0 -1
  147. package/dist/catalog.js.map +0 -1
  148. package/dist/cms-brand.d.ts.map +0 -1
  149. package/dist/cms-brand.js.map +0 -1
  150. package/dist/cms-contact-form.d.ts.map +0 -1
  151. package/dist/cms-contact-form.js.map +0 -1
  152. package/dist/cms.d.ts.map +0 -1
  153. package/dist/cms.js.map +0 -1
  154. package/dist/common.d.ts.map +0 -1
  155. package/dist/common.js.map +0 -1
  156. package/dist/comparisons.d.ts.map +0 -1
  157. package/dist/comparisons.js.map +0 -1
  158. package/dist/credentials.d.ts.map +0 -1
  159. package/dist/credentials.js.map +0 -1
  160. package/dist/credit-limits.d.ts.map +0 -1
  161. package/dist/credit-limits.js.map +0 -1
  162. package/dist/crm-rich-text.d.ts.map +0 -1
  163. package/dist/crm-rich-text.js.map +0 -1
  164. package/dist/crm.d.ts.map +0 -1
  165. package/dist/crm.js.map +0 -1
  166. package/dist/currencies.d.ts.map +0 -1
  167. package/dist/currencies.js.map +0 -1
  168. package/dist/custom-fields.d.ts.map +0 -1
  169. package/dist/custom-fields.js.map +0 -1
  170. package/dist/customer-accounts.d.ts.map +0 -1
  171. package/dist/customer-accounts.js.map +0 -1
  172. package/dist/customers.d.ts.map +0 -1
  173. package/dist/customers.js.map +0 -1
  174. package/dist/dictionary.d.ts.map +0 -1
  175. package/dist/dictionary.js.map +0 -1
  176. package/dist/document-templates.d.ts.map +0 -1
  177. package/dist/document-templates.js.map +0 -1
  178. package/dist/document-values.d.ts.map +0 -1
  179. package/dist/document-values.js.map +0 -1
  180. package/dist/email-address.d.ts.map +0 -1
  181. package/dist/email-address.js.map +0 -1
  182. package/dist/email.d.ts.map +0 -1
  183. package/dist/email.js.map +0 -1
  184. package/dist/envelopes.d.ts.map +0 -1
  185. package/dist/envelopes.js.map +0 -1
  186. package/dist/environment-inputs.d.ts.map +0 -1
  187. package/dist/environment-inputs.js.map +0 -1
  188. package/dist/erp-connector.d.ts.map +0 -1
  189. package/dist/erp-connector.js.map +0 -1
  190. package/dist/errors.d.ts.map +0 -1
  191. package/dist/errors.js.map +0 -1
  192. package/dist/forms-logic.d.ts.map +0 -1
  193. package/dist/forms-logic.fixtures.d.ts.map +0 -1
  194. package/dist/forms-logic.fixtures.js.map +0 -1
  195. package/dist/forms-logic.js.map +0 -1
  196. package/dist/forms.d.ts.map +0 -1
  197. package/dist/forms.js.map +0 -1
  198. package/dist/google-analytics.d.ts.map +0 -1
  199. package/dist/google-analytics.js.map +0 -1
  200. package/dist/google-tag-manager.d.ts.map +0 -1
  201. package/dist/google-tag-manager.js.map +0 -1
  202. package/dist/i18n.d.ts.map +0 -1
  203. package/dist/i18n.js.map +0 -1
  204. package/dist/import-export.d.ts.map +0 -1
  205. package/dist/import-export.js.map +0 -1
  206. package/dist/index.d.ts.map +0 -1
  207. package/dist/index.js.map +0 -1
  208. package/dist/inventory.d.ts.map +0 -1
  209. package/dist/inventory.js.map +0 -1
  210. package/dist/invoice-ledger.d.ts.map +0 -1
  211. package/dist/invoice-ledger.js.map +0 -1
  212. package/dist/invoices.d.ts.map +0 -1
  213. package/dist/invoices.js.map +0 -1
  214. package/dist/kernel.d.ts.map +0 -1
  215. package/dist/kernel.js.map +0 -1
  216. package/dist/languages.d.ts.map +0 -1
  217. package/dist/languages.js.map +0 -1
  218. package/dist/line-groups.d.ts.map +0 -1
  219. package/dist/line-groups.js.map +0 -1
  220. package/dist/linkedin-ads.d.ts.map +0 -1
  221. package/dist/linkedin-ads.js.map +0 -1
  222. package/dist/localized-name.d.ts.map +0 -1
  223. package/dist/localized-name.js.map +0 -1
  224. package/dist/megamenu.d.ts.map +0 -1
  225. package/dist/megamenu.js.map +0 -1
  226. package/dist/meta-ads.d.ts.map +0 -1
  227. package/dist/meta-ads.js.map +0 -1
  228. package/dist/mfa.d.ts.map +0 -1
  229. package/dist/mfa.js.map +0 -1
  230. package/dist/modules.d.ts.map +0 -1
  231. package/dist/modules.js.map +0 -1
  232. package/dist/money-decimal.d.ts.map +0 -1
  233. package/dist/money-decimal.js.map +0 -1
  234. package/dist/money-input.d.ts.map +0 -1
  235. package/dist/money-input.js.map +0 -1
  236. package/dist/newsletter.d.ts.map +0 -1
  237. package/dist/newsletter.js.map +0 -1
  238. package/dist/order-minimums.d.ts.map +0 -1
  239. package/dist/order-minimums.js.map +0 -1
  240. package/dist/orders.d.ts.map +0 -1
  241. package/dist/orders.js.map +0 -1
  242. package/dist/organization-registry-lookup.d.ts.map +0 -1
  243. package/dist/organization-registry-lookup.js.map +0 -1
  244. package/dist/organization-roles.d.ts.map +0 -1
  245. package/dist/organization-roles.js.map +0 -1
  246. package/dist/organizations.d.ts.map +0 -1
  247. package/dist/organizations.js.map +0 -1
  248. package/dist/page-builder-props.d.ts.map +0 -1
  249. package/dist/page-builder-props.js.map +0 -1
  250. package/dist/page-builder-values.d.ts.map +0 -1
  251. package/dist/page-builder-values.js.map +0 -1
  252. package/dist/pagination.d.ts.map +0 -1
  253. package/dist/pagination.js.map +0 -1
  254. package/dist/payment-methods.d.ts.map +0 -1
  255. package/dist/payment-methods.js.map +0 -1
  256. package/dist/payment-return-url.d.ts.map +0 -1
  257. package/dist/payment-return-url.js.map +0 -1
  258. package/dist/payments.d.ts.map +0 -1
  259. package/dist/payments.js.map +0 -1
  260. package/dist/pim-connector.d.ts.map +0 -1
  261. package/dist/pim-connector.js.map +0 -1
  262. package/dist/pim-field-path.d.ts.map +0 -1
  263. package/dist/pim-field-path.js.map +0 -1
  264. package/dist/pim-locale-mapping.d.ts.map +0 -1
  265. package/dist/pim-locale-mapping.js.map +0 -1
  266. package/dist/platform-info.d.ts.map +0 -1
  267. package/dist/platform-info.js.map +0 -1
  268. package/dist/platform-language.d.ts.map +0 -1
  269. package/dist/platform-language.js.map +0 -1
  270. package/dist/price-book-decimal.d.ts.map +0 -1
  271. package/dist/price-book-decimal.js.map +0 -1
  272. package/dist/price-books.d.ts.map +0 -1
  273. package/dist/price-books.js.map +0 -1
  274. package/dist/price-lists.d.ts.map +0 -1
  275. package/dist/price-lists.js.map +0 -1
  276. package/dist/product-feeds.d.ts.map +0 -1
  277. package/dist/product-feeds.js.map +0 -1
  278. package/dist/product-scope-model.d.ts.map +0 -1
  279. package/dist/product-scope-model.js.map +0 -1
  280. package/dist/product-scope-overrides.d.ts.map +0 -1
  281. package/dist/product-scope-overrides.js.map +0 -1
  282. package/dist/product-scoped-values.d.ts.map +0 -1
  283. package/dist/product-scoped-values.js.map +0 -1
  284. package/dist/product-scopes.d.ts.map +0 -1
  285. package/dist/product-scopes.js.map +0 -1
  286. package/dist/product-summary-text.d.ts.map +0 -1
  287. package/dist/product-summary-text.js.map +0 -1
  288. package/dist/product-tax-rates.d.ts.map +0 -1
  289. package/dist/product-tax-rates.js.map +0 -1
  290. package/dist/product-url-keys.d.ts.map +0 -1
  291. package/dist/product-url-keys.js.map +0 -1
  292. package/dist/product-value-resolver.d.ts.map +0 -1
  293. package/dist/product-value-resolver.js.map +0 -1
  294. package/dist/projects.d.ts.map +0 -1
  295. package/dist/projects.js.map +0 -1
  296. package/dist/promotions.d.ts.map +0 -1
  297. package/dist/promotions.js.map +0 -1
  298. package/dist/prompt-actions.d.ts.map +0 -1
  299. package/dist/prompt-actions.js.map +0 -1
  300. package/dist/pwa.d.ts.map +0 -1
  301. package/dist/pwa.js.map +0 -1
  302. package/dist/quick-order.d.ts.map +0 -1
  303. package/dist/quick-order.js.map +0 -1
  304. package/dist/quote-requests.d.ts.map +0 -1
  305. package/dist/quote-requests.js.map +0 -1
  306. package/dist/record-references.d.ts.map +0 -1
  307. package/dist/record-references.js.map +0 -1
  308. package/dist/record-rich-text.d.ts.map +0 -1
  309. package/dist/record-rich-text.js.map +0 -1
  310. package/dist/returns.d.ts.map +0 -1
  311. package/dist/returns.js.map +0 -1
  312. package/dist/sales-channels.d.ts.map +0 -1
  313. package/dist/sales-channels.js.map +0 -1
  314. package/dist/saved-list-views.d.ts.map +0 -1
  315. package/dist/saved-list-views.js.map +0 -1
  316. package/dist/scope-notice.d.ts.map +0 -1
  317. package/dist/scope-notice.js.map +0 -1
  318. package/dist/scoped-write-encoding.d.ts.map +0 -1
  319. package/dist/scoped-write-encoding.js.map +0 -1
  320. package/dist/search.d.ts.map +0 -1
  321. package/dist/search.js.map +0 -1
  322. package/dist/seo.d.ts.map +0 -1
  323. package/dist/seo.js.map +0 -1
  324. package/dist/settings.d.ts.map +0 -1
  325. package/dist/settings.js.map +0 -1
  326. package/dist/shipments.d.ts.map +0 -1
  327. package/dist/shipments.js.map +0 -1
  328. package/dist/shipping-methods.d.ts.map +0 -1
  329. package/dist/shipping-methods.js.map +0 -1
  330. package/dist/shopping-lists.d.ts.map +0 -1
  331. package/dist/shopping-lists.js.map +0 -1
  332. package/dist/storefront-cache-tags.d.ts.map +0 -1
  333. package/dist/storefront-cache-tags.js.map +0 -1
  334. package/dist/storefront-language-path.d.ts.map +0 -1
  335. package/dist/storefront-language-path.js.map +0 -1
  336. package/dist/storefront-value-overrides.d.ts.map +0 -1
  337. package/dist/storefront-value-overrides.js.map +0 -1
  338. package/dist/tasks.d.ts.map +0 -1
  339. package/dist/tasks.js.map +0 -1
  340. package/dist/taxes.d.ts.map +0 -1
  341. package/dist/taxes.js.map +0 -1
  342. package/dist/text-normalization.d.ts.map +0 -1
  343. package/dist/text-normalization.js.map +0 -1
  344. package/dist/transactional-emails.d.ts.map +0 -1
  345. package/dist/transactional-emails.js.map +0 -1
  346. package/dist/webhooks.d.ts.map +0 -1
  347. package/dist/webhooks.js.map +0 -1
@@ -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
- task: "task";
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
- task: "task";
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
- task: "task";
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
- task: "task";
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
- task: "task";
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
- task: "task";
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
- task: "task";
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
- task: "task";
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
- task: "task";
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).