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