@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
@@ -27,9 +27,9 @@ export declare const quickOrderUploadFileSchema: z.ZodObject<{
27
27
  }, z.core.$strip>;
28
28
  export type QuickOrderUploadFile = z.infer<typeof quickOrderUploadFileSchema>;
29
29
  export declare const quickOrderRejectionReasonSchema: z.ZodEnum<{
30
- below_minimum: "below_minimum";
31
30
  product_not_found: "product_not_found";
32
31
  malformed_row: "malformed_row";
32
+ below_minimum: "below_minimum";
33
33
  product_archived: "product_archived";
34
34
  sku_missing: "sku_missing";
35
35
  quantity_invalid: "quantity_invalid";
@@ -73,9 +73,9 @@ export declare const rejectedQuickOrderItemSchema: z.ZodObject<{
73
73
  line: z.ZodNumber;
74
74
  raw: z.ZodString;
75
75
  reason: z.ZodEnum<{
76
- below_minimum: "below_minimum";
77
76
  product_not_found: "product_not_found";
78
77
  malformed_row: "malformed_row";
78
+ below_minimum: "below_minimum";
79
79
  product_archived: "product_archived";
80
80
  sku_missing: "sku_missing";
81
81
  quantity_invalid: "quantity_invalid";
@@ -114,9 +114,9 @@ export declare const quickOrderImportResponseSchema: z.ZodObject<{
114
114
  line: z.ZodNumber;
115
115
  raw: z.ZodString;
116
116
  reason: z.ZodEnum<{
117
- below_minimum: "below_minimum";
118
117
  product_not_found: "product_not_found";
119
118
  malformed_row: "malformed_row";
119
+ below_minimum: "below_minimum";
120
120
  product_archived: "product_archived";
121
121
  sku_missing: "sku_missing";
122
122
  quantity_invalid: "quantity_invalid";
@@ -136,6 +136,134 @@ export declare const quickOrderImportResponseSchema: z.ZodObject<{
136
136
  }, z.core.$strip>;
137
137
  }, z.core.$strip>;
138
138
  export type QuickOrderImportResponse = z.infer<typeof quickOrderImportResponseSchema>;
139
+ /**
140
+ * Issue #809 — the hard maximum of a preview's line cap: the ceiling `quick_order.import_max_rows`
141
+ * is clamped to. The cap itself is that setting's effective value, read when the preview is
142
+ * written (PO ruling of 2026-11-08 on PR #942), and it counts the rows the import read —
143
+ * recognised and rejected — never the rows past its limit, which the preview keeps as one
144
+ * `summary.overflowCount`. So an import never exceeds it; it bounds what adding from search can
145
+ * grow, and a write that adds no line is accepted even above a cap lowered since. Enforced by
146
+ * `PUT /api/v1/quick-order/preview` as `422 VALIDATION_FAILED`,
147
+ * `details: { code: 'too_many_lines', maximum }` (`maximum` = the setting), deliberately not by a
148
+ * schema `.max()`, which would answer 400 — the same shape as {@link QUICK_ORDER_BUILD_MAX_ITEMS}.
149
+ */
150
+ export declare const QUICK_ORDER_PREVIEW_MAX_LINES = 10000;
151
+ /**
152
+ * The largest preview body `PUT /api/v1/quick-order/preview` reads, in bytes; a larger one is
153
+ * refused `413 VALIDATION_FAILED` before it is parsed. A rejected line's raw CSV text is not
154
+ * bounded by the line cap, so the line cap alone does not bound what one buyer may store.
155
+ */
156
+ export declare const QUICK_ORDER_PREVIEW_MAX_BYTES: number;
157
+ /**
158
+ * How long a preview is kept after it was last written, in seconds. A write (`PUT`) starts the
159
+ * window again; a read does not, so a page left open does not keep the buyer's file alive.
160
+ */
161
+ export declare const QUICK_ORDER_PREVIEW_TTL_SECONDS: number;
162
+ /**
163
+ * After a partial cart build (feature 155, FR-011 (b)): why the cart did not take a line, with
164
+ * the build's product and unit names. The storefront writes it; nothing else reads it.
165
+ */
166
+ export declare const quickOrderPreviewNotAddedSchema: z.ZodObject<{
167
+ kind: z.ZodEnum<{
168
+ pieces: "pieces";
169
+ packaging_unit: "packaging_unit";
170
+ }>;
171
+ minimum: z.ZodNumber;
172
+ productName: z.ZodString;
173
+ packagingUnitName: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>;
175
+ export type QuickOrderPreviewNotAdded = z.infer<typeof quickOrderPreviewNotAddedSchema>;
176
+ export declare const quickOrderPreviewRecognizedItemSchema: z.ZodObject<{
177
+ productId: z.ZodString;
178
+ variantId: z.ZodNullable<z.ZodString>;
179
+ sku: z.ZodString;
180
+ quantity: z.ZodNumber;
181
+ line: z.ZodNumber;
182
+ resolvedVariantSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
183
+ mergedFromLines: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
184
+ notAdded: z.ZodOptional<z.ZodObject<{
185
+ kind: z.ZodEnum<{
186
+ pieces: "pieces";
187
+ packaging_unit: "packaging_unit";
188
+ }>;
189
+ minimum: z.ZodNumber;
190
+ productName: z.ZodString;
191
+ packagingUnitName: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strip>>;
193
+ }, z.core.$strip>;
194
+ export type QuickOrderPreviewRecognizedItem = z.infer<typeof quickOrderPreviewRecognizedItemSchema>;
195
+ /**
196
+ * Issue #809 — the buyer's quick-order preview, as `quick_order` keeps it: one per buyer session,
197
+ * scoped to the buyer's Organization, for {@link QUICK_ORDER_PREVIEW_TTL_SECONDS}. It is the
198
+ * import's response (`quickOrderImportResponseSchema`) as the buyer has since edited it.
199
+ *
200
+ * `GET /api/v1/quick-order/preview` answers `{ data: QuickOrderPreview | null }` (`null`: none,
201
+ * or expired), `PUT` replaces it and answers `{ data: QuickOrderPreview }`, `DELETE` drops it and
202
+ * answers 204. All three need a signed-in buyer, and the session that wrote a preview is the only
203
+ * one that reads it; no preview id travels anywhere.
204
+ */
205
+ /**
206
+ * The import's summary, plus what the preview keeps of the rows past the import's limit: how many
207
+ * there were (`overflowCount`) and the limit they were past (`rowLimit`, stamped by the backend
208
+ * when it is absent). The rows themselves are not kept.
209
+ */
210
+ export declare const quickOrderPreviewSummarySchema: z.ZodObject<{
211
+ recognizedCount: z.ZodNumber;
212
+ rejectedCount: z.ZodNumber;
213
+ mergedCount: z.ZodNumber;
214
+ truncated: z.ZodBoolean;
215
+ warningCount: z.ZodOptional<z.ZodNumber>;
216
+ overflowCount: z.ZodOptional<z.ZodNumber>;
217
+ rowLimit: z.ZodOptional<z.ZodNumber>;
218
+ }, z.core.$strip>;
219
+ export type QuickOrderPreviewSummary = z.infer<typeof quickOrderPreviewSummarySchema>;
220
+ export declare const quickOrderPreviewSchema: z.ZodObject<{
221
+ recognized: z.ZodArray<z.ZodObject<{
222
+ productId: z.ZodString;
223
+ variantId: z.ZodNullable<z.ZodString>;
224
+ sku: z.ZodString;
225
+ quantity: z.ZodNumber;
226
+ line: z.ZodNumber;
227
+ resolvedVariantSku: z.ZodOptional<z.ZodNullable<z.ZodString>>;
228
+ mergedFromLines: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
229
+ notAdded: z.ZodOptional<z.ZodObject<{
230
+ kind: z.ZodEnum<{
231
+ pieces: "pieces";
232
+ packaging_unit: "packaging_unit";
233
+ }>;
234
+ minimum: z.ZodNumber;
235
+ productName: z.ZodString;
236
+ packagingUnitName: z.ZodOptional<z.ZodString>;
237
+ }, z.core.$strip>>;
238
+ }, z.core.$strip>>;
239
+ rejected: z.ZodArray<z.ZodObject<{
240
+ line: z.ZodNumber;
241
+ raw: z.ZodString;
242
+ reason: z.ZodEnum<{
243
+ product_not_found: "product_not_found";
244
+ malformed_row: "malformed_row";
245
+ below_minimum: "below_minimum";
246
+ product_archived: "product_archived";
247
+ sku_missing: "sku_missing";
248
+ quantity_invalid: "quantity_invalid";
249
+ variant_not_resolved: "variant_not_resolved";
250
+ variant_ambiguous: "variant_ambiguous";
251
+ row_limit_exceeded: "row_limit_exceeded";
252
+ }>;
253
+ minimum: z.ZodOptional<z.ZodNumber>;
254
+ productTotal: z.ZodOptional<z.ZodNumber>;
255
+ }, z.core.$strip>>;
256
+ summary: z.ZodObject<{
257
+ recognizedCount: z.ZodNumber;
258
+ rejectedCount: z.ZodNumber;
259
+ mergedCount: z.ZodNumber;
260
+ truncated: z.ZodBoolean;
261
+ warningCount: z.ZodOptional<z.ZodNumber>;
262
+ overflowCount: z.ZodOptional<z.ZodNumber>;
263
+ rowLimit: z.ZodOptional<z.ZodNumber>;
264
+ }, z.core.$strip>;
265
+ }, z.core.$strip>;
266
+ export type QuickOrderPreview = z.infer<typeof quickOrderPreviewSchema>;
139
267
  export declare const quickOrderTargetSchema: z.ZodEnum<{
140
268
  quote_request: "quote_request";
141
269
  cart: "cart";
@@ -282,9 +410,18 @@ export declare const quickOrderResolvedDefaultsSchema: z.ZodObject<{
282
410
  }, z.core.$strip>;
283
411
  }, z.core.$strip>;
284
412
  export type QuickOrderResolvedDefaults = z.infer<typeof quickOrderResolvedDefaultsSchema>;
413
+ /**
414
+ * Why one-click buy is not offered. `permission_required` and
415
+ * `cart_approval_required` (`specs/170-organization-roles/`, FR-050, R-6) are
416
+ * the member's role — no `quick_order.one_click`, or no
417
+ * `carts.order_without_approval` — and are judged first, in that order, before
418
+ * the setting and the defaults.
419
+ */
285
420
  export declare const quickOrderOneClickEligibilitySchema: z.ZodObject<{
286
421
  enabled: z.ZodBoolean;
287
422
  reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
423
+ permission_required: "permission_required";
424
+ cart_approval_required: "cart_approval_required";
288
425
  setting_disabled: "setting_disabled";
289
426
  missing_defaults: "missing_defaults";
290
427
  ineligible_default: "ineligible_default";
@@ -337,8 +474,8 @@ export interface PreferenceAuditContext {
337
474
  * Who is writing the preference.
338
475
  *
339
476
  * A discriminated union, not a bag of optional ids, and that is the point: a
340
- * buyer editing their own defaults, an org admin editing a member's, a
341
- * salesperson editing an assigned organisation's and a platform admin editing
477
+ * buyer editing their own defaults, an Organization administrator editing a member's, a
478
+ * salesperson editing an organisation in their reach and a platform admin editing
342
479
  * anybody's are four different authorisations, and each carries exactly the
343
480
  * one identifier its rule needs. A shape with four optional fields has twelve
344
481
  * states the rules cannot answer for.
@@ -348,12 +485,25 @@ export interface PreferenceAuditContext {
348
485
  export type PreferenceActor = {
349
486
  kind: 'customer';
350
487
  customerAccountId: string;
351
- } | {
352
- kind: 'org_admin';
488
+ }
489
+ /**
490
+ * A member holding the Organization's *Administrator* role — a buyer, not
491
+ * the operator's `platform_admin`. Managing others' defaults is a reserved
492
+ * capability, not a permission (`specs/170-organization-roles/` FR-012),
493
+ * asked of `organizationPermissionPort.isAdministrator`.
494
+ */
495
+ | {
496
+ kind: 'administrator';
353
497
  organizationId: string;
354
- } | {
498
+ }
499
+ /**
500
+ * A sales representative. Issue #305: their reach is every organisation
501
+ * nobody else governs — assigned, roll-up and unassigned — which no list of
502
+ * ids names, so the actor carries the question rather than an answer.
503
+ */
504
+ | {
355
505
  kind: 'salesperson';
356
- assignedOrganizationIds: string[];
506
+ reaches: (organizationId: string) => Promise<boolean>;
357
507
  } | {
358
508
  kind: 'platform_admin';
359
509
  };
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { uuidSchema } from './common.js';
3
3
  import { nextActionSchema } from './orders.js';
4
+ import { lineQuantitySchema, REQUEST_LINE_ITEMS_MAX } from './line-bounds.js';
4
5
  /**
5
6
  * Quick-order contracts (feature 039). The quick-order page lets buyers
6
7
  * build a Cart or a Quote Request from a CSV / Excel file (`sku,quantity`
@@ -97,12 +98,73 @@ export const quickOrderImportResponseSchema = z.object({
97
98
  rejected: z.array(rejectedQuickOrderItemSchema),
98
99
  summary: quickOrderImportSummarySchema,
99
100
  });
101
+ // --- Preview (the buyer's import, held between the import and the build) ---
102
+ /**
103
+ * Issue #809 — the hard maximum of a preview's line cap: the ceiling `quick_order.import_max_rows`
104
+ * is clamped to. The cap itself is that setting's effective value, read when the preview is
105
+ * written (PO ruling of 2026-11-08 on PR #942), and it counts the rows the import read —
106
+ * recognised and rejected — never the rows past its limit, which the preview keeps as one
107
+ * `summary.overflowCount`. So an import never exceeds it; it bounds what adding from search can
108
+ * grow, and a write that adds no line is accepted even above a cap lowered since. Enforced by
109
+ * `PUT /api/v1/quick-order/preview` as `422 VALIDATION_FAILED`,
110
+ * `details: { code: 'too_many_lines', maximum }` (`maximum` = the setting), deliberately not by a
111
+ * schema `.max()`, which would answer 400 — the same shape as {@link QUICK_ORDER_BUILD_MAX_ITEMS}.
112
+ */
113
+ export const QUICK_ORDER_PREVIEW_MAX_LINES = 10_000;
114
+ /**
115
+ * The largest preview body `PUT /api/v1/quick-order/preview` reads, in bytes; a larger one is
116
+ * refused `413 VALIDATION_FAILED` before it is parsed. A rejected line's raw CSV text is not
117
+ * bounded by the line cap, so the line cap alone does not bound what one buyer may store.
118
+ */
119
+ export const QUICK_ORDER_PREVIEW_MAX_BYTES = 2 * 1024 * 1024;
120
+ /**
121
+ * How long a preview is kept after it was last written, in seconds. A write (`PUT`) starts the
122
+ * window again; a read does not, so a page left open does not keep the buyer's file alive.
123
+ */
124
+ export const QUICK_ORDER_PREVIEW_TTL_SECONDS = 60 * 60;
125
+ /**
126
+ * After a partial cart build (feature 155, FR-011 (b)): why the cart did not take a line, with
127
+ * the build's product and unit names. The storefront writes it; nothing else reads it.
128
+ */
129
+ export const quickOrderPreviewNotAddedSchema = z.object({
130
+ kind: z.enum(['pieces', 'packaging_unit']),
131
+ minimum: z.number().int().positive(),
132
+ productName: z.string().max(255),
133
+ packagingUnitName: z.string().max(255).optional(),
134
+ });
135
+ export const quickOrderPreviewRecognizedItemSchema = recognizedQuickOrderItemSchema
136
+ .omit({ warning: true })
137
+ .extend({ notAdded: quickOrderPreviewNotAddedSchema.optional() });
138
+ /**
139
+ * Issue #809 — the buyer's quick-order preview, as `quick_order` keeps it: one per buyer session,
140
+ * scoped to the buyer's Organization, for {@link QUICK_ORDER_PREVIEW_TTL_SECONDS}. It is the
141
+ * import's response (`quickOrderImportResponseSchema`) as the buyer has since edited it.
142
+ *
143
+ * `GET /api/v1/quick-order/preview` answers `{ data: QuickOrderPreview | null }` (`null`: none,
144
+ * or expired), `PUT` replaces it and answers `{ data: QuickOrderPreview }`, `DELETE` drops it and
145
+ * answers 204. All three need a signed-in buyer, and the session that wrote a preview is the only
146
+ * one that reads it; no preview id travels anywhere.
147
+ */
148
+ /**
149
+ * The import's summary, plus what the preview keeps of the rows past the import's limit: how many
150
+ * there were (`overflowCount`) and the limit they were past (`rowLimit`, stamped by the backend
151
+ * when it is absent). The rows themselves are not kept.
152
+ */
153
+ export const quickOrderPreviewSummarySchema = quickOrderImportSummarySchema.extend({
154
+ overflowCount: z.number().int().nonnegative().optional(),
155
+ rowLimit: z.number().int().positive().optional(),
156
+ });
157
+ export const quickOrderPreviewSchema = z.object({
158
+ recognized: z.array(quickOrderPreviewRecognizedItemSchema),
159
+ rejected: z.array(rejectedQuickOrderItemSchema),
160
+ summary: quickOrderPreviewSummarySchema,
161
+ });
100
162
  // --- Build (confirmed import → Cart or Quote Request) ----------------------
101
163
  export const quickOrderTargetSchema = z.enum(['cart', 'quote_request']);
102
164
  export const quickOrderBuildLineSchema = z.object({
103
165
  productId: uuidSchema,
104
166
  variantId: uuidSchema.nullable().optional(),
105
- quantity: z.number().int().positive(),
167
+ quantity: lineQuantitySchema,
106
168
  });
107
169
  /**
108
170
  * Feature 155 (FR-038, research R20) — the most items a build accepts, either target.
@@ -110,7 +172,7 @@ export const quickOrderBuildLineSchema = z.object({
110
172
  * `details: { code: 'too_many_items', maximum }`), deliberately not by a schema `.max()`,
111
173
  * which would answer 400.
112
174
  */
113
- export const QUICK_ORDER_BUILD_MAX_ITEMS = 200;
175
+ export const QUICK_ORDER_BUILD_MAX_ITEMS = REQUEST_LINE_ITEMS_MAX;
114
176
  export const quickOrderBuildRequestSchema = z.object({
115
177
  target: quickOrderTargetSchema,
116
178
  items: z.array(quickOrderBuildLineSchema).min(1),
@@ -194,17 +256,30 @@ export const quickOrderResolvedDefaultsSchema = z.object({
194
256
  }),
195
257
  });
196
258
  // --- One-click buy ---------------------------------------------------------
259
+ /**
260
+ * Why one-click buy is not offered. `permission_required` and
261
+ * `cart_approval_required` (`specs/170-organization-roles/`, FR-050, R-6) are
262
+ * the member's role — no `quick_order.one_click`, or no
263
+ * `carts.order_without_approval` — and are judged first, in that order, before
264
+ * the setting and the defaults.
265
+ */
197
266
  export const quickOrderOneClickEligibilitySchema = z.object({
198
267
  enabled: z.boolean(),
199
268
  reason: z
200
- .enum(['setting_disabled', 'missing_defaults', 'ineligible_default'])
269
+ .enum([
270
+ 'permission_required',
271
+ 'cart_approval_required',
272
+ 'setting_disabled',
273
+ 'missing_defaults',
274
+ 'ineligible_default',
275
+ ])
201
276
  .nullable()
202
277
  .optional(),
203
278
  });
204
279
  export const quickOrderOneClickRequestSchema = z.object({
205
280
  productId: uuidSchema,
206
281
  variantId: uuidSchema.nullable().optional(),
207
- quantity: z.number().int().positive().optional(),
282
+ quantity: lineQuantitySchema.optional(),
208
283
  idempotencyKey: z.string().max(200).optional(),
209
284
  });
210
285
  export const quickOrderOneClickResponseSchema = z.object({