@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
@@ -0,0 +1,301 @@
1
+ import { z } from 'zod';
2
+ /** When a hook runs relative to the Command's commit. */
3
+ export type CommandHookPhase = 'beforeCommit' | 'afterCommit';
4
+ export declare const COMMAND_HOOK_PHASES: readonly ["beforeCommit", "afterCommit"];
5
+ /**
6
+ * A scalar allowed in outbox data: `specs/conventions/audit-state.md` list 1
7
+ * only — ids, codes, booleans, counts and dates. Never free text, money,
8
+ * personal data or a custom-field value (FR-031).
9
+ */
10
+ export type OutboxScalar = string | number | boolean | null;
11
+ /** The data an `afterCommit` row carries. Stored in `command_outbox` (P3). */
12
+ export type OutboxData = Readonly<Record<string, OutboxScalar | readonly OutboxScalar[]>>;
13
+ /**
14
+ * The longest string an outbox value may be. Long enough for a UUID, an ISO
15
+ * timestamp, a dictionary code and a dotted field name
16
+ * (`extensions.<moduleId>.changedFields`); short of anything a sentence needs.
17
+ */
18
+ export declare const OUTBOX_STRING_MAX_LENGTH = 128;
19
+ /** One outbox data key that is not `audit-state.md` list 1, and why. Never carries the value. */
20
+ export interface OutboxDataViolation {
21
+ readonly key: string;
22
+ readonly issue: 'nested' | 'too-long' | 'not-code-shaped' | 'not-finite' | 'not-a-scalar';
23
+ }
24
+ /**
25
+ * The keys of `data` that an outbox row may not store (FR-031): a nested
26
+ * object, a string longer than {@link OUTBOX_STRING_MAX_LENGTH} or with
27
+ * whitespace or an `@` in it, a non-finite number, anything that is not a scalar. An
28
+ * array is allowed when every member is. Sorted by key, and the value is never
29
+ * repeated: the answer is what an error message may print.
30
+ *
31
+ * A **structural** guard — it cannot tell a one-word name from a code, and the
32
+ * owner's `outboxData` remains the place list 1 is decided. What it refuses is
33
+ * the shape free text, an address or a snapshot has, so the common mistake
34
+ * fails the Command (and the owner's `expectHookableCommand`) instead of
35
+ * landing in a platform-global table.
36
+ */
37
+ export declare function outboxDataViolations(data: Readonly<Record<string, unknown>>): OutboxDataViolation[];
38
+ /**
39
+ * A hookable action, published by the module that owns the Command.
40
+ *
41
+ * `TData` is what a `beforeCommit` hook receives (in memory, never stored);
42
+ * `TOutbox` is what an `afterCommit` handler receives (stored, list 1 only).
43
+ * Both are carried by the phantom `__types` member, which is never set at run
44
+ * time — it exists so a hook registered with this ref is typed by it.
45
+ */
46
+ export interface HookableActionRef<TData = unknown, TOutbox extends OutboxData = OutboxData> {
47
+ /** The Command's audit action, e.g. `organization.create`. */
48
+ readonly action: string;
49
+ /** The Command's audit object type, e.g. `organization`. */
50
+ readonly objectType: string;
51
+ /** The phases the owner offers. A hook for any other phase fails composition. */
52
+ readonly phases: readonly CommandHookPhase[];
53
+ /** Phantom carrier for the two data types; never set at run time. */
54
+ readonly __types?: {
55
+ readonly data: TData;
56
+ readonly outbox: TOutbox;
57
+ };
58
+ }
59
+ /** A Command action: dot-separated lower-case segments, at least two. */
60
+ export declare const hookableActionRe: RegExp;
61
+ /**
62
+ * Declare a hookable action. The owner calls this once per action, in
63
+ * `@endora-commerce/contracts`, and exports the result.
64
+ *
65
+ * Refuses a malformed action or object type, and an empty or repeated phase
66
+ * list, at module load — a ref is a public contract and is never built at run
67
+ * time from data.
68
+ */
69
+ export declare function hookableAction<TData, TOutbox extends OutboxData = OutboxData>(action: string, objectType: string, phases: readonly CommandHookPhase[]): HookableActionRef<TData, TOutbox>;
70
+ /** The manifest entry for one hookable action, derived from its ref. */
71
+ export declare const HookableActionDeclarationSchema: z.ZodObject<{
72
+ action: z.ZodString;
73
+ objectType: z.ZodString;
74
+ phases: z.ZodArray<z.ZodEnum<{
75
+ beforeCommit: "beforeCommit";
76
+ afterCommit: "afterCommit";
77
+ }>>;
78
+ }, z.core.$strict>;
79
+ export type HookableActionDeclaration = z.infer<typeof HookableActionDeclarationSchema>;
80
+ /** What an owner writes in its manifest's `hookableActions`. */
81
+ export declare function toHookableActionDeclaration(ref: HookableActionRef<unknown, OutboxData>): HookableActionDeclaration;
82
+ /**
83
+ * The codes the platform answers a command-hook misuse with. Owned by the
84
+ * platform vocabulary (`_i18n`, translated pl + en under `errors.<CODE>`).
85
+ *
86
+ * - `COMMAND_EXTENSION_UNCLAIMED` (422) — a Command's `extensions` carries a
87
+ * key no present hook module on that action claims; refused before any
88
+ * write, `details: [{ path: 'extensions.<key>', issue }]` (FR-019).
89
+ * - `COMMAND_HOOK_CYCLE` (500) — a hookable action reappears in its own
90
+ * ancestor chain, or hook-induced nesting passed its bound (FR-022).
91
+ * - `COMMAND_HOOK_DATA_MISSING` (500) — a Command declared hookable did not
92
+ * supply its hook data (FR-023).
93
+ */
94
+ export declare const COMMAND_HOOK_ERROR_CODES: {
95
+ readonly EXTENSION_UNCLAIMED: "COMMAND_EXTENSION_UNCLAIMED";
96
+ readonly CYCLE: "COMMAND_HOOK_CYCLE";
97
+ readonly DATA_MISSING: "COMMAND_HOOK_DATA_MISSING";
98
+ };
99
+ /** How deep hook-induced Command nesting may go: the ninth Command in one chain is refused. */
100
+ export declare const COMMAND_HOOK_MAX_DEPTH = 8;
101
+ /**
102
+ * One registered hook. A `beforeCommit` hook carries its position in its
103
+ * action's execution order; an `afterCommit` handler carries `null`, because
104
+ * each one is an outbox row of its own and the outbox promises no order across
105
+ * rows (`contracts/outbox-and-admin-api.md`, amendment 3). Handlers are listed
106
+ * by module id, then registration order — for a stable screen, not a sequence.
107
+ */
108
+ export declare const CommandHookPlanItemSchema: z.ZodObject<{
109
+ action: z.ZodString;
110
+ phase: z.ZodEnum<{
111
+ beforeCommit: "beforeCommit";
112
+ afterCommit: "afterCommit";
113
+ }>;
114
+ position: z.ZodNullable<z.ZodNumber>;
115
+ module: z.ZodString;
116
+ id: z.ZodString;
117
+ moduleEnabled: z.ZodBoolean;
118
+ }, z.core.$strip>;
119
+ export type CommandHookPlanItem = z.infer<typeof CommandHookPlanItemSchema>;
120
+ /** One action some module declares hookable, whether or not anything hooks it. */
121
+ export declare const CommandHookPlanActionSchema: z.ZodObject<{
122
+ action: z.ZodString;
123
+ objectType: z.ZodString;
124
+ owner: z.ZodString;
125
+ phases: z.ZodArray<z.ZodEnum<{
126
+ beforeCommit: "beforeCommit";
127
+ afterCommit: "afterCommit";
128
+ }>>;
129
+ }, z.core.$strip>;
130
+ export type CommandHookPlanAction = z.infer<typeof CommandHookPlanActionSchema>;
131
+ export declare const CommandHookPlanResponseSchema: z.ZodObject<{
132
+ actions: z.ZodArray<z.ZodObject<{
133
+ action: z.ZodString;
134
+ objectType: z.ZodString;
135
+ owner: z.ZodString;
136
+ phases: z.ZodArray<z.ZodEnum<{
137
+ beforeCommit: "beforeCommit";
138
+ afterCommit: "afterCommit";
139
+ }>>;
140
+ }, z.core.$strip>>;
141
+ items: z.ZodArray<z.ZodObject<{
142
+ action: z.ZodString;
143
+ phase: z.ZodEnum<{
144
+ beforeCommit: "beforeCommit";
145
+ afterCommit: "afterCommit";
146
+ }>;
147
+ position: z.ZodNullable<z.ZodNumber>;
148
+ module: z.ZodString;
149
+ id: z.ZodString;
150
+ moduleEnabled: z.ZodBoolean;
151
+ }, z.core.$strip>>;
152
+ }, z.core.$strip>;
153
+ export type CommandHookPlanResponse = z.infer<typeof CommandHookPlanResponseSchema>;
154
+ /** Where an outbox row is in its delivery (`data-model.md` §4). */
155
+ export declare const COMMAND_OUTBOX_STATUSES: readonly ["pending", "in_flight", "delivered", "dead"];
156
+ export declare const CommandOutboxStatusSchema: z.ZodEnum<{
157
+ pending: "pending";
158
+ in_flight: "in_flight";
159
+ delivered: "delivered";
160
+ dead: "dead";
161
+ }>;
162
+ export type CommandOutboxStatus = z.infer<typeof CommandOutboxStatusSchema>;
163
+ /**
164
+ * The statuses an operator lists. A delivered row needs nobody's attention and
165
+ * is purged after seven days, so the list does not offer it.
166
+ */
167
+ export declare const COMMAND_OUTBOX_LISTED_STATUSES: readonly ["dead", "pending", "in_flight"];
168
+ /** The largest page `GET /api/v1/admin/command-outbox` serves. */
169
+ export declare const COMMAND_OUTBOX_PAGE_MAX = 100;
170
+ /**
171
+ * `GET /api/v1/admin/command-outbox` — filtered by status (dead rows by
172
+ * default: they are the ones an operator acts on), keyset-paginated by the
173
+ * row's `sequence`, newest first. `cursor` is the previous page's
174
+ * `nextCursor`, opaque to the client.
175
+ */
176
+ export declare const CommandOutboxListQuerySchema: z.ZodObject<{
177
+ status: z.ZodDefault<z.ZodEnum<{
178
+ pending: "pending";
179
+ in_flight: "in_flight";
180
+ dead: "dead";
181
+ }>>;
182
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
183
+ cursor: z.ZodOptional<z.ZodString>;
184
+ }, z.core.$strip>;
185
+ export type CommandOutboxListQuery = z.infer<typeof CommandOutboxListQuerySchema>;
186
+ /**
187
+ * One outbox row as an operator sees it: names, ids, codes, counts and dates
188
+ * only. The row's `data` is **never** served, and neither is anything a
189
+ * failure said — only its code and the error's class are stored — so this list
190
+ * shows nothing the audit log would not (FR-040).
191
+ *
192
+ * `lastErrorCode` is the raw stored string; the screen translates it when the
193
+ * hook module or the platform has a sentence for it, and shows it as it is
194
+ * otherwise.
195
+ */
196
+ export declare const CommandOutboxListItemSchema: z.ZodObject<{
197
+ id: z.ZodString;
198
+ action: z.ZodString;
199
+ objectType: z.ZodString;
200
+ objectId: z.ZodString;
201
+ organizationId: z.ZodNullable<z.ZodString>;
202
+ hookModule: z.ZodString;
203
+ hookId: z.ZodString;
204
+ status: z.ZodEnum<{
205
+ pending: "pending";
206
+ in_flight: "in_flight";
207
+ delivered: "delivered";
208
+ dead: "dead";
209
+ }>;
210
+ attempts: z.ZodNumber;
211
+ lastErrorCode: z.ZodNullable<z.ZodString>;
212
+ lastErrorClass: z.ZodNullable<z.ZodString>;
213
+ createdAt: z.ZodString;
214
+ availableAt: z.ZodString;
215
+ deadAt: z.ZodNullable<z.ZodString>;
216
+ }, z.core.$strip>;
217
+ export type CommandOutboxListItem = z.infer<typeof CommandOutboxListItemSchema>;
218
+ /** One page; `nextCursor` is `null` on the last. */
219
+ export declare const CommandOutboxListResponseSchema: z.ZodObject<{
220
+ items: z.ZodArray<z.ZodObject<{
221
+ id: z.ZodString;
222
+ action: z.ZodString;
223
+ objectType: z.ZodString;
224
+ objectId: z.ZodString;
225
+ organizationId: z.ZodNullable<z.ZodString>;
226
+ hookModule: z.ZodString;
227
+ hookId: z.ZodString;
228
+ status: z.ZodEnum<{
229
+ pending: "pending";
230
+ in_flight: "in_flight";
231
+ delivered: "delivered";
232
+ dead: "dead";
233
+ }>;
234
+ attempts: z.ZodNumber;
235
+ lastErrorCode: z.ZodNullable<z.ZodString>;
236
+ lastErrorClass: z.ZodNullable<z.ZodString>;
237
+ createdAt: z.ZodString;
238
+ availableAt: z.ZodString;
239
+ deadAt: z.ZodNullable<z.ZodString>;
240
+ }, z.core.$strip>>;
241
+ nextCursor: z.ZodNullable<z.ZodString>;
242
+ }, z.core.$strip>;
243
+ export type CommandOutboxListResponse = z.infer<typeof CommandOutboxListResponseSchema>;
244
+ /**
245
+ * `POST /api/v1/admin/command-outbox/:id/retry` — the path parameter. Any
246
+ * string, on purpose: a value that is not a uuid names no row, so the route
247
+ * answers it with the same `404` as an unknown id (issue #781, owner ruling of
248
+ * 2026-11-05), where a uuid params schema would answer `400` (issue #1269).
249
+ */
250
+ export declare const CommandOutboxRetryParamsSchema: z.ZodObject<{
251
+ id: z.ZodString;
252
+ }, z.core.$strip>;
253
+ /** `POST /api/v1/admin/command-outbox/:id/retry` — the row, now pending. */
254
+ export declare const CommandOutboxRetryResponseSchema: z.ZodObject<{
255
+ item: z.ZodObject<{
256
+ id: z.ZodString;
257
+ action: z.ZodString;
258
+ objectType: z.ZodString;
259
+ objectId: z.ZodString;
260
+ organizationId: z.ZodNullable<z.ZodString>;
261
+ hookModule: z.ZodString;
262
+ hookId: z.ZodString;
263
+ status: z.ZodEnum<{
264
+ pending: "pending";
265
+ in_flight: "in_flight";
266
+ delivered: "delivered";
267
+ dead: "dead";
268
+ }>;
269
+ attempts: z.ZodNumber;
270
+ lastErrorCode: z.ZodNullable<z.ZodString>;
271
+ lastErrorClass: z.ZodNullable<z.ZodString>;
272
+ createdAt: z.ZodString;
273
+ availableAt: z.ZodString;
274
+ deadAt: z.ZodNullable<z.ZodString>;
275
+ }, z.core.$strip>;
276
+ }, z.core.$strip>;
277
+ export type CommandOutboxRetryResponse = z.infer<typeof CommandOutboxRetryResponseSchema>;
278
+ /**
279
+ * The failure codes the platform's own drain stores in `last_error_code`
280
+ * (`contracts/outbox-and-admin-api.md`, amendment 4). Lower-kebab, because
281
+ * they are delivery outcomes and not HTTP error codes; translated by the
282
+ * platform vocabulary under {@link commandOutboxFailureKey}.
283
+ */
284
+ export declare const COMMAND_OUTBOX_FAILURE_CODES: {
285
+ readonly HOOK_UNREGISTERED: "hook-unregistered";
286
+ readonly PERMANENT_FAILURE: "permanent-failure";
287
+ readonly HANDLER_FAILED: "handler-failed";
288
+ };
289
+ /**
290
+ * The bundle key a stored failure code may be translated under, besides
291
+ * `errors.<CODE>`: `commandOutbox.failure.<code>`, the code verbatim.
292
+ *
293
+ * Two families because a stored code has two shapes. An `HttpError`'s code is
294
+ * SCREAMING_SNAKE and already has its `errors.<CODE>` sentence wherever it is
295
+ * declared; a `PermanentOutboxFailure` code may be any code-shaped string
296
+ * (`acme-erp-rejected`), which `errors.*` cannot hold — that family is read by
297
+ * the error envelope and refuses any other key grammar
298
+ * (`check-error-translations`, `malformed-key`).
299
+ */
300
+ export declare function commandOutboxFailureKey(code: string): string;
301
+ //# sourceMappingURL=command-hooks.d.ts.map
@@ -0,0 +1,248 @@
1
+ // Command hooks — `specs/176-command-hooks-outbox/` P2 (US2),
2
+ // `contracts/command-hooks-api.md` §1.
3
+ //
4
+ // The platform-free half of the command-hook API: the typed reference an owner
5
+ // publishes for each Command action it opens to hooks, the manifest
6
+ // declaration derived from it, and the error codes the platform answers a
7
+ // misuse with. The platform half — `ctx.commandHooks`, the bus dispatch, the
8
+ // hook context — is `@endora-commerce/platform/commands` and `./kernel`.
9
+ //
10
+ // One constant serves both readers (FR-010): the owner lists the ref in its
11
+ // manifest through `toHookableActionDeclaration`, and a hook author imports the
12
+ // same ref so the hook's `data` is typed by the owner's declaration.
13
+ import { z } from 'zod';
14
+ export const COMMAND_HOOK_PHASES = ['beforeCommit', 'afterCommit'];
15
+ /**
16
+ * The longest string an outbox value may be. Long enough for a UUID, an ISO
17
+ * timestamp, a dictionary code and a dotted field name
18
+ * (`extensions.<moduleId>.changedFields`); short of anything a sentence needs.
19
+ */
20
+ export const OUTBOX_STRING_MAX_LENGTH = 128;
21
+ /**
22
+ * Printable ASCII without a space and without `@`: what an id, a code, a date
23
+ * and a field name are made of. `@` is refused because an e-mail address is the
24
+ * one personal datum that otherwise has a code's shape.
25
+ */
26
+ const OUTBOX_STRING_RE = /^[\x21-\x3f\x41-\x7e]*$/;
27
+ function scalarIssue(value) {
28
+ if (value === null || typeof value === 'boolean')
29
+ return null;
30
+ if (typeof value === 'number')
31
+ return Number.isFinite(value) ? null : 'not-finite';
32
+ if (typeof value === 'string') {
33
+ if (value.length > OUTBOX_STRING_MAX_LENGTH)
34
+ return 'too-long';
35
+ return OUTBOX_STRING_RE.test(value) ? null : 'not-code-shaped';
36
+ }
37
+ if (typeof value === 'object')
38
+ return 'nested';
39
+ return 'not-a-scalar';
40
+ }
41
+ /**
42
+ * The keys of `data` that an outbox row may not store (FR-031): a nested
43
+ * object, a string longer than {@link OUTBOX_STRING_MAX_LENGTH} or with
44
+ * whitespace or an `@` in it, a non-finite number, anything that is not a scalar. An
45
+ * array is allowed when every member is. Sorted by key, and the value is never
46
+ * repeated: the answer is what an error message may print.
47
+ *
48
+ * A **structural** guard — it cannot tell a one-word name from a code, and the
49
+ * owner's `outboxData` remains the place list 1 is decided. What it refuses is
50
+ * the shape free text, an address or a snapshot has, so the common mistake
51
+ * fails the Command (and the owner's `expectHookableCommand`) instead of
52
+ * landing in a platform-global table.
53
+ */
54
+ export function outboxDataViolations(data) {
55
+ const violations = [];
56
+ for (const key of Object.keys(data).sort()) {
57
+ const value = data[key];
58
+ const issue = Array.isArray(value)
59
+ ? (value.map(scalarIssue).find((found) => found !== null) ?? null)
60
+ : scalarIssue(value);
61
+ if (issue !== null)
62
+ violations.push({ key, issue });
63
+ }
64
+ return violations;
65
+ }
66
+ /** A Command action: dot-separated lower-case segments, at least two. */
67
+ export const hookableActionRe = /^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$/;
68
+ const objectTypeRe = /^[a-z][a-z0-9_]*$/;
69
+ /**
70
+ * Declare a hookable action. The owner calls this once per action, in
71
+ * `@endora-commerce/contracts`, and exports the result.
72
+ *
73
+ * Refuses a malformed action or object type, and an empty or repeated phase
74
+ * list, at module load — a ref is a public contract and is never built at run
75
+ * time from data.
76
+ */
77
+ export function hookableAction(action, objectType, phases) {
78
+ const parsed = HookableActionDeclarationSchema.parse({ action, objectType, phases: [...phases] });
79
+ return Object.freeze({
80
+ action: parsed.action,
81
+ objectType: parsed.objectType,
82
+ phases: Object.freeze([...parsed.phases]),
83
+ });
84
+ }
85
+ /** The manifest entry for one hookable action, derived from its ref. */
86
+ export const HookableActionDeclarationSchema = z
87
+ .object({
88
+ action: z.string().regex(hookableActionRe),
89
+ objectType: z.string().regex(objectTypeRe),
90
+ phases: z.array(z.enum(COMMAND_HOOK_PHASES)).min(1),
91
+ })
92
+ .strict()
93
+ .superRefine((value, ctx) => {
94
+ if (new Set(value.phases).size !== value.phases.length) {
95
+ ctx.addIssue({
96
+ code: 'custom',
97
+ path: ['phases'],
98
+ message: `hookable action "${value.action}" lists a phase twice`,
99
+ });
100
+ }
101
+ });
102
+ /** What an owner writes in its manifest's `hookableActions`. */
103
+ export function toHookableActionDeclaration(ref) {
104
+ return { action: ref.action, objectType: ref.objectType, phases: [...ref.phases] };
105
+ }
106
+ /**
107
+ * The codes the platform answers a command-hook misuse with. Owned by the
108
+ * platform vocabulary (`_i18n`, translated pl + en under `errors.<CODE>`).
109
+ *
110
+ * - `COMMAND_EXTENSION_UNCLAIMED` (422) — a Command's `extensions` carries a
111
+ * key no present hook module on that action claims; refused before any
112
+ * write, `details: [{ path: 'extensions.<key>', issue }]` (FR-019).
113
+ * - `COMMAND_HOOK_CYCLE` (500) — a hookable action reappears in its own
114
+ * ancestor chain, or hook-induced nesting passed its bound (FR-022).
115
+ * - `COMMAND_HOOK_DATA_MISSING` (500) — a Command declared hookable did not
116
+ * supply its hook data (FR-023).
117
+ */
118
+ export const COMMAND_HOOK_ERROR_CODES = {
119
+ EXTENSION_UNCLAIMED: 'COMMAND_EXTENSION_UNCLAIMED',
120
+ CYCLE: 'COMMAND_HOOK_CYCLE',
121
+ DATA_MISSING: 'COMMAND_HOOK_DATA_MISSING',
122
+ };
123
+ /** How deep hook-induced Command nesting may go: the ninth Command in one chain is refused. */
124
+ export const COMMAND_HOOK_MAX_DEPTH = 8;
125
+ // ---------------------------------------------------------------------------
126
+ // The read-only execution plan (`GET /api/v1/admin/command-hooks`, FR-026/FR-040)
127
+ // ---------------------------------------------------------------------------
128
+ /**
129
+ * One registered hook. A `beforeCommit` hook carries its position in its
130
+ * action's execution order; an `afterCommit` handler carries `null`, because
131
+ * each one is an outbox row of its own and the outbox promises no order across
132
+ * rows (`contracts/outbox-and-admin-api.md`, amendment 3). Handlers are listed
133
+ * by module id, then registration order — for a stable screen, not a sequence.
134
+ */
135
+ export const CommandHookPlanItemSchema = z.object({
136
+ action: z.string(),
137
+ phase: z.enum(COMMAND_HOOK_PHASES),
138
+ /** 1-based position within the action's `beforeCommit` hooks; `null` for an `afterCommit` handler. */
139
+ position: z.number().int().positive().nullable(),
140
+ module: z.string(),
141
+ id: z.string(),
142
+ /** Whether the hook's module is present on the effective state right now. */
143
+ moduleEnabled: z.boolean(),
144
+ });
145
+ /** One action some module declares hookable, whether or not anything hooks it. */
146
+ export const CommandHookPlanActionSchema = z.object({
147
+ action: z.string(),
148
+ objectType: z.string(),
149
+ owner: z.string(),
150
+ phases: z.array(z.enum(COMMAND_HOOK_PHASES)),
151
+ });
152
+ export const CommandHookPlanResponseSchema = z.object({
153
+ actions: z.array(CommandHookPlanActionSchema),
154
+ items: z.array(CommandHookPlanItemSchema),
155
+ });
156
+ // ---------------------------------------------------------------------------
157
+ // The command outbox operator API (`specs/176-command-hooks-outbox/` P4, FR-040)
158
+ // ---------------------------------------------------------------------------
159
+ /** Where an outbox row is in its delivery (`data-model.md` §4). */
160
+ export const COMMAND_OUTBOX_STATUSES = ['pending', 'in_flight', 'delivered', 'dead'];
161
+ export const CommandOutboxStatusSchema = z.enum(COMMAND_OUTBOX_STATUSES);
162
+ /**
163
+ * The statuses an operator lists. A delivered row needs nobody's attention and
164
+ * is purged after seven days, so the list does not offer it.
165
+ */
166
+ export const COMMAND_OUTBOX_LISTED_STATUSES = ['dead', 'pending', 'in_flight'];
167
+ /** The largest page `GET /api/v1/admin/command-outbox` serves. */
168
+ export const COMMAND_OUTBOX_PAGE_MAX = 100;
169
+ /**
170
+ * `GET /api/v1/admin/command-outbox` — filtered by status (dead rows by
171
+ * default: they are the ones an operator acts on), keyset-paginated by the
172
+ * row's `sequence`, newest first. `cursor` is the previous page's
173
+ * `nextCursor`, opaque to the client.
174
+ */
175
+ export const CommandOutboxListQuerySchema = z.object({
176
+ status: z.enum(COMMAND_OUTBOX_LISTED_STATUSES).default('dead'),
177
+ limit: z.coerce.number().int().min(1).max(COMMAND_OUTBOX_PAGE_MAX).default(50),
178
+ cursor: z
179
+ .string()
180
+ .regex(/^[1-9][0-9]{0,18}$/)
181
+ .optional(),
182
+ });
183
+ /**
184
+ * One outbox row as an operator sees it: names, ids, codes, counts and dates
185
+ * only. The row's `data` is **never** served, and neither is anything a
186
+ * failure said — only its code and the error's class are stored — so this list
187
+ * shows nothing the audit log would not (FR-040).
188
+ *
189
+ * `lastErrorCode` is the raw stored string; the screen translates it when the
190
+ * hook module or the platform has a sentence for it, and shows it as it is
191
+ * otherwise.
192
+ */
193
+ export const CommandOutboxListItemSchema = z.object({
194
+ id: z.string().uuid(),
195
+ action: z.string(),
196
+ objectType: z.string(),
197
+ objectId: z.string(),
198
+ organizationId: z.string().uuid().nullable(),
199
+ hookModule: z.string(),
200
+ hookId: z.string(),
201
+ status: CommandOutboxStatusSchema,
202
+ attempts: z.number().int().nonnegative(),
203
+ lastErrorCode: z.string().nullable(),
204
+ lastErrorClass: z.string().nullable(),
205
+ createdAt: z.string(),
206
+ availableAt: z.string(),
207
+ deadAt: z.string().nullable(),
208
+ });
209
+ /** One page; `nextCursor` is `null` on the last. */
210
+ export const CommandOutboxListResponseSchema = z.object({
211
+ items: z.array(CommandOutboxListItemSchema),
212
+ nextCursor: z.string().nullable(),
213
+ });
214
+ /**
215
+ * `POST /api/v1/admin/command-outbox/:id/retry` — the path parameter. Any
216
+ * string, on purpose: a value that is not a uuid names no row, so the route
217
+ * answers it with the same `404` as an unknown id (issue #781, owner ruling of
218
+ * 2026-11-05), where a uuid params schema would answer `400` (issue #1269).
219
+ */
220
+ export const CommandOutboxRetryParamsSchema = z.object({ id: z.string() });
221
+ /** `POST /api/v1/admin/command-outbox/:id/retry` — the row, now pending. */
222
+ export const CommandOutboxRetryResponseSchema = z.object({ item: CommandOutboxListItemSchema });
223
+ /**
224
+ * The failure codes the platform's own drain stores in `last_error_code`
225
+ * (`contracts/outbox-and-admin-api.md`, amendment 4). Lower-kebab, because
226
+ * they are delivery outcomes and not HTTP error codes; translated by the
227
+ * platform vocabulary under {@link commandOutboxFailureKey}.
228
+ */
229
+ export const COMMAND_OUTBOX_FAILURE_CODES = {
230
+ HOOK_UNREGISTERED: 'hook-unregistered',
231
+ PERMANENT_FAILURE: 'permanent-failure',
232
+ HANDLER_FAILED: 'handler-failed',
233
+ };
234
+ /**
235
+ * The bundle key a stored failure code may be translated under, besides
236
+ * `errors.<CODE>`: `commandOutbox.failure.<code>`, the code verbatim.
237
+ *
238
+ * Two families because a stored code has two shapes. An `HttpError`'s code is
239
+ * SCREAMING_SNAKE and already has its `errors.<CODE>` sentence wherever it is
240
+ * declared; a `PermanentOutboxFailure` code may be any code-shaped string
241
+ * (`acme-erp-rejected`), which `errors.*` cannot hold — that family is read by
242
+ * the error envelope and refuses any other key grammar
243
+ * (`check-error-translations`, `malformed-key`).
244
+ */
245
+ export function commandOutboxFailureKey(code) {
246
+ return `commandOutbox.failure.${code}`;
247
+ }
248
+ //# sourceMappingURL=command-hooks.js.map
@@ -51,10 +51,10 @@ export declare const comparisonAttributeRowSchema: z.ZodObject<{
51
51
  boolean: "boolean";
52
52
  date: "date";
53
53
  enum: "enum";
54
- multiselect: "multiselect";
55
- price: "price";
56
54
  select: "select";
55
+ multiselect: "multiselect";
57
56
  page_builder: "page_builder";
57
+ price: "price";
58
58
  }>;
59
59
  values: z.ZodArray<z.ZodNullable<z.ZodString>>;
60
60
  rowClass: z.ZodEnum<{
@@ -117,10 +117,10 @@ export declare const comparisonOwnerViewSchema: z.ZodObject<{
117
117
  boolean: "boolean";
118
118
  date: "date";
119
119
  enum: "enum";
120
- multiselect: "multiselect";
121
- price: "price";
122
120
  select: "select";
121
+ multiselect: "multiselect";
123
122
  page_builder: "page_builder";
123
+ price: "price";
124
124
  }>;
125
125
  values: z.ZodArray<z.ZodNullable<z.ZodString>>;
126
126
  rowClass: z.ZodEnum<{
@@ -185,10 +185,10 @@ export declare const comparisonDocumentDataSchema: z.ZodObject<{
185
185
  boolean: "boolean";
186
186
  date: "date";
187
187
  enum: "enum";
188
- multiselect: "multiselect";
189
- price: "price";
190
188
  select: "select";
189
+ multiselect: "multiselect";
191
190
  page_builder: "page_builder";
191
+ price: "price";
192
192
  }>;
193
193
  values: z.ZodArray<z.ZodNullable<z.ZodString>>;
194
194
  rowClass: z.ZodEnum<{
@@ -252,10 +252,10 @@ export declare const comparisonOwnerResponseSchema: z.ZodObject<{
252
252
  boolean: "boolean";
253
253
  date: "date";
254
254
  enum: "enum";
255
- multiselect: "multiselect";
256
- price: "price";
257
255
  select: "select";
256
+ multiselect: "multiselect";
258
257
  page_builder: "page_builder";
258
+ price: "price";
259
259
  }>;
260
260
  values: z.ZodArray<z.ZodNullable<z.ZodString>>;
261
261
  rowClass: z.ZodEnum<{
@@ -330,10 +330,10 @@ export declare const comparisonSharedViewSchema: z.ZodObject<{
330
330
  boolean: "boolean";
331
331
  date: "date";
332
332
  enum: "enum";
333
- multiselect: "multiselect";
334
- price: "price";
335
333
  select: "select";
334
+ multiselect: "multiselect";
336
335
  page_builder: "page_builder";
336
+ price: "price";
337
337
  }>;
338
338
  values: z.ZodArray<z.ZodNullable<z.ZodString>>;
339
339
  rowClass: z.ZodEnum<{
@@ -389,10 +389,10 @@ export declare const comparisonSharedResponseSchema: z.ZodObject<{
389
389
  boolean: "boolean";
390
390
  date: "date";
391
391
  enum: "enum";
392
- multiselect: "multiselect";
393
- price: "price";
394
392
  select: "select";
393
+ multiselect: "multiselect";
395
394
  page_builder: "page_builder";
395
+ price: "price";
396
396
  }>;
397
397
  values: z.ZodArray<z.ZodNullable<z.ZodString>>;
398
398
  rowClass: z.ZodEnum<{
@@ -556,10 +556,10 @@ export declare const comparisonAdminDetailSchema: z.ZodObject<{
556
556
  boolean: "boolean";
557
557
  date: "date";
558
558
  enum: "enum";
559
- multiselect: "multiselect";
560
- price: "price";
561
559
  select: "select";
560
+ multiselect: "multiselect";
562
561
  page_builder: "page_builder";
562
+ price: "price";
563
563
  }>;
564
564
  values: z.ZodArray<z.ZodNullable<z.ZodString>>;
565
565
  rowClass: z.ZodEnum<{
@@ -16,18 +16,39 @@ export declare const creditLimitReservationReleaseReasonSchema: z.ZodEnum<{
16
16
  export type CreditLimitReservationReleaseReason = z.infer<typeof creditLimitReservationReleaseReasonSchema>;
17
17
  export declare const creditLimitViewSchema: z.ZodObject<{
18
18
  organizationId: z.ZodString;
19
+ organizationName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
20
  grantedAmount: z.ZodNumber;
20
21
  availableAmount: z.ZodNumber;
21
22
  currency: z.ZodString;
22
23
  activeReservationCount: z.ZodNumber;
23
24
  activeReservations: z.ZodArray<z.ZodObject<{
24
25
  orderId: z.ZodString;
26
+ orderBusinessId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
27
  amount: z.ZodNumber;
26
28
  createdAt: z.ZodString;
27
29
  }, z.core.$strip>>;
28
30
  grantedAt: z.ZodString;
29
31
  }, z.core.$strip>;
30
32
  export type CreditLimitView = z.infer<typeof creditLimitViewSchema>;
33
+ /** `GET /api/v1/admin/credit-limits` — every granted credit limit (issue #599). */
34
+ export declare const creditLimitListResponseSchema: z.ZodObject<{
35
+ data: z.ZodArray<z.ZodObject<{
36
+ organizationId: z.ZodString;
37
+ organizationName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ grantedAmount: z.ZodNumber;
39
+ availableAmount: z.ZodNumber;
40
+ currency: z.ZodString;
41
+ activeReservationCount: z.ZodNumber;
42
+ activeReservations: z.ZodArray<z.ZodObject<{
43
+ orderId: z.ZodString;
44
+ orderBusinessId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ amount: z.ZodNumber;
46
+ createdAt: z.ZodString;
47
+ }, z.core.$strip>>;
48
+ grantedAt: z.ZodString;
49
+ }, z.core.$strip>>;
50
+ }, z.core.$strip>;
51
+ export type CreditLimitListResponse = z.infer<typeof creditLimitListResponseSchema>;
31
52
  export declare const grantCreditLimitRequestSchema: z.ZodObject<{
32
53
  grantedAmount: z.ZodNumber;
33
54
  currency: z.ZodString;