@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
package/dist/admin.d.ts CHANGED
@@ -21,14 +21,39 @@ export declare const adminUserSchema: z.ZodObject<{
21
21
  lastLoginAt: z.ZodNullable<z.ZodString>;
22
22
  createdAt: z.ZodString;
23
23
  updatedAt: z.ZodString;
24
+ preferredLanguage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ bio: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
24
27
  }, z.core.$strip>;
25
28
  export type AdminUser = z.infer<typeof adminUserSchema>;
29
+ /**
30
+ * Feature 171 (US6) — an administrator's public author profile: the avatar (one
31
+ * library asset, the same in every language) and the biography per language, each
32
+ * at most {@link ADMIN_USER_BIO_MAX_LENGTH} characters. `null` clears either.
33
+ */
34
+ export declare const ADMIN_USER_BIO_MAX_LENGTH = 2000;
35
+ /**
36
+ * Issue #948 — a role's `requiresTwoFactor` that is set and not in force, as
37
+ * the Settings read's `notice` says it of `mfa.admin.totp_enforced` (issue
38
+ * #930). `code` is the token the Roles screen looks up in `admin_users`'
39
+ * bundle (`roles.twoFactor.notice.<code>`); `message` is the English sentence
40
+ * it falls back to.
41
+ */
42
+ export declare const adminRoleTwoFactorNoticeSchema: z.ZodObject<{
43
+ code: z.ZodString;
44
+ message: z.ZodString;
45
+ }, z.core.$strip>;
46
+ export type AdminRoleTwoFactorNotice = z.infer<typeof adminRoleTwoFactorNoticeSchema>;
26
47
  export declare const adminRoleSchema: z.ZodObject<{
27
48
  id: z.ZodString;
28
49
  code: z.ZodString;
29
50
  name: z.ZodString;
30
51
  permissions: z.ZodArray<z.ZodString>;
31
52
  requiresTwoFactor: z.ZodBoolean;
53
+ twoFactorNotice: z.ZodOptional<z.ZodObject<{
54
+ code: z.ZodString;
55
+ message: z.ZodString;
56
+ }, z.core.$strip>>;
32
57
  createdAt: z.ZodString;
33
58
  updatedAt: z.ZodString;
34
59
  }, z.core.$strip>;
@@ -61,6 +86,9 @@ export declare const adminMeResponseSchema: z.ZodObject<{
61
86
  lastLoginAt: z.ZodNullable<z.ZodString>;
62
87
  createdAt: z.ZodString;
63
88
  updatedAt: z.ZodString;
89
+ preferredLanguage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
90
+ avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
+ bio: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
64
92
  }, z.core.$strip>;
65
93
  role: z.ZodNullable<z.ZodObject<{
66
94
  id: z.ZodString;
@@ -68,6 +96,10 @@ export declare const adminMeResponseSchema: z.ZodObject<{
68
96
  name: z.ZodString;
69
97
  permissions: z.ZodArray<z.ZodString>;
70
98
  requiresTwoFactor: z.ZodBoolean;
99
+ twoFactorNotice: z.ZodOptional<z.ZodObject<{
100
+ code: z.ZodString;
101
+ message: z.ZodString;
102
+ }, z.core.$strip>>;
71
103
  createdAt: z.ZodString;
72
104
  updatedAt: z.ZodString;
73
105
  }, z.core.$strip>>;
@@ -86,6 +118,41 @@ export declare const adminLoginRequestSchema: z.ZodObject<{
86
118
  email: z.ZodString;
87
119
  password: z.ZodString;
88
120
  }, z.core.$strip>;
121
+ /**
122
+ * `POST /api/v1/auth/admin/login` — the first sign-in step (issue #599). Only
123
+ * `authenticated` sets the session cookie and names the administrator; the
124
+ * other two arms hand the client the opaque ticket its second step takes.
125
+ */
126
+ export declare const adminLoginResponseSchema: z.ZodObject<{
127
+ data: z.ZodDiscriminatedUnion<[z.ZodObject<{
128
+ status: z.ZodLiteral<"authenticated">;
129
+ adminUser: z.ZodObject<{
130
+ id: z.ZodString;
131
+ email: z.ZodString;
132
+ firstName: z.ZodString;
133
+ lastName: z.ZodString;
134
+ adminRoleId: z.ZodNullable<z.ZodString>;
135
+ twoFactorEnabled: z.ZodBoolean;
136
+ status: z.ZodEnum<{
137
+ active: "active";
138
+ inactive: "inactive";
139
+ }>;
140
+ lastLoginAt: z.ZodNullable<z.ZodString>;
141
+ createdAt: z.ZodString;
142
+ updatedAt: z.ZodString;
143
+ preferredLanguage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
144
+ avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
145
+ bio: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
146
+ }, z.core.$strip>;
147
+ }, z.core.$strip>, z.ZodObject<{
148
+ status: z.ZodLiteral<"mfaRequired">;
149
+ challengeId: z.ZodString;
150
+ }, z.core.$strip>, z.ZodObject<{
151
+ status: z.ZodLiteral<"mfaSetupRequired">;
152
+ setupTicket: z.ZodString;
153
+ }, z.core.$strip>], "status">;
154
+ }, z.core.$strip>;
155
+ export type AdminLoginResponse = z.infer<typeof adminLoginResponseSchema>;
89
156
  export declare const impersonationRequestSchema: z.ZodObject<{
90
157
  customerAccountId: z.ZodString;
91
158
  reason: z.ZodOptional<z.ZodString>;
@@ -98,10 +165,15 @@ export declare const impersonationStartResponseSchema: z.ZodObject<{
98
165
  email: z.ZodString;
99
166
  firstName: z.ZodString;
100
167
  lastName: z.ZodString;
101
- role: z.ZodEnum<{
102
- organization_admin: "organization_admin";
103
- regular_user: "regular_user";
104
- }>;
168
+ organizationRole: z.ZodObject<{
169
+ id: z.ZodString;
170
+ name: z.ZodString;
171
+ kind: z.ZodEnum<{
172
+ custom: "custom";
173
+ administrator: "administrator";
174
+ member: "member";
175
+ }>;
176
+ }, z.core.$strict>;
105
177
  }, z.core.$strip>;
106
178
  }, z.core.$strip>;
107
179
  export type ImpersonationStartResponse = z.infer<typeof impersonationStartResponseSchema>;
@@ -114,6 +186,8 @@ export declare const createAdminUserRequestSchema: z.ZodObject<{
114
186
  }, z.core.$strip>;
115
187
  export type CreateAdminUserRequest = z.infer<typeof createAdminUserRequestSchema>;
116
188
  export declare const updateAdminUserRequestSchema: z.ZodObject<{
189
+ avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
190
+ bio: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
117
191
  firstName: z.ZodOptional<z.ZodString>;
118
192
  lastName: z.ZodOptional<z.ZodString>;
119
193
  adminRoleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -141,6 +215,8 @@ export type UpdateAdminUserRequest = z.infer<typeof updateAdminUserRequestSchema
141
215
  * restate.
142
216
  */
143
217
  export declare const updateAdminUserSelfRequestSchema: z.ZodObject<{
218
+ avatarAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ bio: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
144
220
  firstName: z.ZodOptional<z.ZodString>;
145
221
  lastName: z.ZodOptional<z.ZodString>;
146
222
  password: z.ZodOptional<z.ZodString>;
@@ -169,6 +245,39 @@ export declare const upsertAdminRoleRequestSchema: z.ZodObject<{
169
245
  requiresTwoFactor: z.ZodOptional<z.ZodBoolean>;
170
246
  }, z.core.$strip>;
171
247
  export type UpsertAdminRoleRequest = z.infer<typeof upsertAdminRoleRequestSchema>;
248
+ /**
249
+ * `PUT /api/v1/admin/admin-roles/:code` — the role as saved, plus how many of
250
+ * its holders were signed out by the save (issue #349).
251
+ *
252
+ * Non-zero only when the save turned `requiresTwoFactor` on: the holders with
253
+ * no enrolled second factor had sessions opened without one, and those end.
254
+ * The acting administrator's own current session is kept.
255
+ */
256
+ export declare const adminRoleWriteResultSchema: z.ZodObject<{
257
+ id: z.ZodString;
258
+ code: z.ZodString;
259
+ name: z.ZodString;
260
+ permissions: z.ZodArray<z.ZodString>;
261
+ requiresTwoFactor: z.ZodBoolean;
262
+ twoFactorNotice: z.ZodOptional<z.ZodObject<{
263
+ code: z.ZodString;
264
+ message: z.ZodString;
265
+ }, z.core.$strip>>;
266
+ createdAt: z.ZodString;
267
+ updatedAt: z.ZodString;
268
+ signedOutAdministrators: z.ZodNumber;
269
+ }, z.core.$strip>;
270
+ export type AdminRoleWriteResult = z.infer<typeof adminRoleWriteResultSchema>;
271
+ /**
272
+ * `GET /api/v1/admin/admin-roles/:code/two-factor-impact` — how many holders of
273
+ * the role have no enrolled second factor, so the editor can say how many will
274
+ * be signed out before it turns the requirement on. `null` while `mfa` is off,
275
+ * when no session would be ended and the requirement cannot be turned on.
276
+ */
277
+ export declare const adminRoleTwoFactorImpactSchema: z.ZodObject<{
278
+ unprotectedAdministrators: z.ZodNullable<z.ZodNumber>;
279
+ }, z.core.$strip>;
280
+ export type AdminRoleTwoFactorImpact = z.infer<typeof adminRoleTwoFactorImpactSchema>;
172
281
  /** Optional per-module permission declaration on `ModuleManifest.permissions`. */
173
282
  export declare const modulePermissionDeclarationSchema: z.ZodObject<{
174
283
  code: z.ZodString;
@@ -290,6 +399,7 @@ export declare const auditLogEntrySchema: z.ZodObject<{
290
399
  id: z.ZodString;
291
400
  actorAdminUserId: z.ZodNullable<z.ZodString>;
292
401
  impersonatedCustomerAccountId: z.ZodNullable<z.ZodString>;
402
+ actorCustomerAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
293
403
  actedAt: z.ZodString;
294
404
  action: z.ZodString;
295
405
  objectType: z.ZodString;
package/dist/admin.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { adminPreferencesSchema } from './admin-preferences.js';
3
3
  import { isoDateTimeSchema, uuidSchema } from './common.js';
4
+ import { organizationRoleRefSchema } from './organization-roles.js';
4
5
  /**
5
6
  * Admin module contracts (US4) — AdminUser, AdminRole, Impersonation,
6
7
  * AuditLogEntry. Source of truth per Principle V.
@@ -20,13 +21,56 @@ export const adminUserSchema = z.object({
20
21
  lastLoginAt: isoDateTimeSchema.nullable(),
21
22
  createdAt: isoDateTimeSchema,
22
23
  updatedAt: isoDateTimeSchema,
24
+ /**
25
+ * Feature 019 — the administrator's Admin UI language, `null` when none is
26
+ * saved (the UI then opens in its default). Answered by every admin-user read
27
+ * since 019 and declared here only by issue #599; optional for a client that
28
+ * predates it.
29
+ */
30
+ preferredLanguage: z.string().nullable().optional(),
31
+ /** Feature 171 (US6) — the author avatar, a library asset. Optional for clients that predate it. */
32
+ avatarAssetId: uuidSchema.nullable().optional(),
33
+ /** Feature 171 (US6) — the author biography per language. */
34
+ bio: z.record(z.string(), z.string()).nullable().optional(),
35
+ });
36
+ /**
37
+ * Feature 171 (US6) — an administrator's public author profile: the avatar (one
38
+ * library asset, the same in every language) and the biography per language, each
39
+ * at most {@link ADMIN_USER_BIO_MAX_LENGTH} characters. `null` clears either.
40
+ */
41
+ export const ADMIN_USER_BIO_MAX_LENGTH = 2000;
42
+ const adminUserAuthorProfileFields = {
43
+ avatarAssetId: uuidSchema.nullable().optional(),
44
+ bio: z.record(z.string().min(2).max(16), z.string().max(ADMIN_USER_BIO_MAX_LENGTH)).nullable().optional(),
45
+ };
46
+ const REQUIRES_TWO_FACTOR_DESCRIPTION = 'Whether holders of this role must sign in with a second factor. Read by `mfa` at sign-in: ' +
47
+ 'a holder with no enrolled factor is asked to set one up, an enrolled holder is challenged. ' +
48
+ 'Has no effect while `mfa` is off (sign-in is then password-only), nor while `mfa` has no ' +
49
+ 'encryption key (no second factor is asked for at all; see `twoFactorNotice`), and `mfa` ' +
50
+ 'cannot be switched off while any role sets it.';
51
+ /**
52
+ * Issue #948 — a role's `requiresTwoFactor` that is set and not in force, as
53
+ * the Settings read's `notice` says it of `mfa.admin.totp_enforced` (issue
54
+ * #930). `code` is the token the Roles screen looks up in `admin_users`'
55
+ * bundle (`roles.twoFactor.notice.<code>`); `message` is the English sentence
56
+ * it falls back to.
57
+ */
58
+ export const adminRoleTwoFactorNoticeSchema = z.object({
59
+ code: z.string().min(1),
60
+ message: z.string().min(1),
23
61
  });
24
62
  export const adminRoleSchema = z.object({
25
63
  id: uuidSchema,
26
64
  code: z.string(),
27
65
  name: z.string(),
28
66
  permissions: z.array(z.string()),
29
- requiresTwoFactor: z.boolean(),
67
+ requiresTwoFactor: z.boolean().describe(REQUIRES_TWO_FACTOR_DESCRIPTION),
68
+ /**
69
+ * Present only while `requiresTwoFactor` is set and not applied — `mfa` has
70
+ * no encryption key (`code: 'encryption_key_missing'`). Absent otherwise,
71
+ * and absent on a read that does not compute it.
72
+ */
73
+ twoFactorNotice: adminRoleTwoFactorNoticeSchema.optional(),
30
74
  createdAt: isoDateTimeSchema,
31
75
  updatedAt: isoDateTimeSchema,
32
76
  });
@@ -59,6 +103,18 @@ export const adminLoginRequestSchema = z.object({
59
103
  email: z.string().email(),
60
104
  password: z.string(),
61
105
  });
106
+ /**
107
+ * `POST /api/v1/auth/admin/login` — the first sign-in step (issue #599). Only
108
+ * `authenticated` sets the session cookie and names the administrator; the
109
+ * other two arms hand the client the opaque ticket its second step takes.
110
+ */
111
+ export const adminLoginResponseSchema = z.object({
112
+ data: z.discriminatedUnion('status', [
113
+ z.object({ status: z.literal('authenticated'), adminUser: adminUserSchema }),
114
+ z.object({ status: z.literal('mfaRequired'), challengeId: z.string().min(1) }),
115
+ z.object({ status: z.literal('mfaSetupRequired'), setupTicket: z.string().min(1) }),
116
+ ]),
117
+ });
62
118
  export const impersonationRequestSchema = z.object({
63
119
  customerAccountId: uuidSchema,
64
120
  reason: z.string().max(2000).optional(),
@@ -70,7 +126,11 @@ export const impersonationStartResponseSchema = z.object({
70
126
  email: z.string().email(),
71
127
  firstName: z.string(),
72
128
  lastName: z.string(),
73
- role: z.enum(['organization_admin', 'regular_user']),
129
+ /**
130
+ * The impersonated member's role — whose permissions the impersonation acts
131
+ * under (spec *Impersonation*); it replaced the legacy `role` (FR-073).
132
+ */
133
+ organizationRole: organizationRoleRefSchema,
74
134
  }),
75
135
  });
76
136
  // --- Admin user CRUD --------------------------------------------------------
@@ -87,6 +147,7 @@ export const updateAdminUserRequestSchema = z
87
147
  lastName: z.string().min(1).max(120).optional(),
88
148
  adminRoleId: uuidSchema.nullable().optional(),
89
149
  status: z.enum(['active', 'inactive']).optional(),
150
+ ...adminUserAuthorProfileFields,
90
151
  })
91
152
  .strict();
92
153
  /**
@@ -112,6 +173,7 @@ export const updateAdminUserSelfRequestSchema = z
112
173
  lastName: z.string().min(1).max(120).optional(),
113
174
  password: z.string().min(12).max(120).optional(),
114
175
  currentPassword: z.string().min(1).max(256).optional(),
176
+ ...adminUserAuthorProfileFields,
115
177
  })
116
178
  .strict()
117
179
  .superRefine((body, ctx) => {
@@ -144,7 +206,32 @@ export const upsertAdminRoleRequestSchema = z.object({
144
206
  code: z.string().min(1).max(64),
145
207
  name: z.string().min(1).max(160),
146
208
  permissions: z.array(z.string().min(1).max(120)),
147
- requiresTwoFactor: z.boolean().optional(),
209
+ requiresTwoFactor: z
210
+ .boolean()
211
+ .optional()
212
+ .describe(`${REQUIRES_TWO_FACTOR_DESCRIPTION} Turning it on is refused with 409 ` +
213
+ '`MFA_REQUIRED_FOR_ROLE_TWO_FACTOR` while `mfa` is off or has no encryption key; ' +
214
+ 'turning it off is always allowed.'),
215
+ });
216
+ /**
217
+ * `PUT /api/v1/admin/admin-roles/:code` — the role as saved, plus how many of
218
+ * its holders were signed out by the save (issue #349).
219
+ *
220
+ * Non-zero only when the save turned `requiresTwoFactor` on: the holders with
221
+ * no enrolled second factor had sessions opened without one, and those end.
222
+ * The acting administrator's own current session is kept.
223
+ */
224
+ export const adminRoleWriteResultSchema = adminRoleSchema.extend({
225
+ signedOutAdministrators: z.number().int().nonnegative(),
226
+ });
227
+ /**
228
+ * `GET /api/v1/admin/admin-roles/:code/two-factor-impact` — how many holders of
229
+ * the role have no enrolled second factor, so the editor can say how many will
230
+ * be signed out before it turns the requirement on. `null` while `mfa` is off,
231
+ * when no session would be ended and the requirement cannot be turned on.
232
+ */
233
+ export const adminRoleTwoFactorImpactSchema = z.object({
234
+ unprotectedAdministrators: z.number().int().nonnegative().nullable(),
148
235
  });
149
236
  /** Optional per-module permission declaration on `ModuleManifest.permissions`. */
150
237
  export const modulePermissionDeclarationSchema = z.object({
@@ -280,6 +367,14 @@ export const auditLogEntrySchema = z.object({
280
367
  id: uuidSchema,
281
368
  actorAdminUserId: uuidSchema.nullable(),
282
369
  impersonatedCustomerAccountId: uuidSchema.nullable(),
370
+ /**
371
+ * The customer who acted for themselves — a storefront Organization
372
+ * administrator managing roles, invitations or members
373
+ * (`specs/170-organization-roles/` FR-065, R-21; issue #741). `null` for an
374
+ * admin, under impersonation, and for the system. Optional so a payload from
375
+ * a server that predates the column still parses.
376
+ */
377
+ actorCustomerAccountId: uuidSchema.nullable().optional(),
283
378
  actedAt: isoDateTimeSchema,
284
379
  action: z.string(),
285
380
  objectType: z.string(),
@@ -61,6 +61,28 @@ export declare const apiKeySchema: z.ZodObject<{
61
61
  expiresAt: z.ZodNullable<z.ZodString>;
62
62
  }, z.core.$strip>;
63
63
  export type ApiKey = z.infer<typeof apiKeySchema>;
64
+ /** `GET /api/v1/admin/api-keys` — every key, revoked ones included, newest first (issue #599). */
65
+ export declare const apiKeyListResponseSchema: z.ZodObject<{
66
+ data: z.ZodArray<z.ZodObject<{
67
+ id: z.ZodString;
68
+ name: z.ZodString;
69
+ lastFour: z.ZodString;
70
+ scopes: z.ZodArray<z.ZodString>;
71
+ status: z.ZodEnum<{
72
+ active: "active";
73
+ revoked: "revoked";
74
+ }>;
75
+ lastUsedAt: z.ZodNullable<z.ZodString>;
76
+ revokedAt: z.ZodNullable<z.ZodString>;
77
+ createdAt: z.ZodString;
78
+ updatedAt: z.ZodString;
79
+ organizationId: z.ZodNullable<z.ZodString>;
80
+ salesChannelId: z.ZodNullable<z.ZodString>;
81
+ customerAccountId: z.ZodNullable<z.ZodString>;
82
+ expiresAt: z.ZodNullable<z.ZodString>;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>;
85
+ export type ApiKeyListResponse = z.infer<typeof apiKeyListResponseSchema>;
64
86
  export declare const createApiKeyRequestSchema: z.ZodObject<{
65
87
  name: z.ZodString;
66
88
  scopes: z.ZodArray<z.ZodEnum<{
package/dist/api-keys.js CHANGED
@@ -55,6 +55,10 @@ export const apiKeySchema = z.object({
55
55
  customerAccountId: uuidSchema.nullable(),
56
56
  expiresAt: isoDateTimeSchema.nullable(),
57
57
  });
58
+ /** `GET /api/v1/admin/api-keys` — every key, revoked ones included, newest first (issue #599). */
59
+ export const apiKeyListResponseSchema = z.object({
60
+ data: z.array(apiKeySchema),
61
+ });
58
62
  export const createApiKeyRequestSchema = z.object({
59
63
  name: z.string().min(1).max(160),
60
64
  scopes: z.array(apiKeyScopeSchema).min(1),
@@ -33,6 +33,8 @@ export declare const assetReferenceKindSchema: z.ZodEnum<{
33
33
  crm_opportunity_attachment: "crm_opportunity_attachment";
34
34
  project_attachment: "project_attachment";
35
35
  task_attachment: "task_attachment";
36
+ admin_user_avatar: "admin_user_avatar";
37
+ product_content: "product_content";
36
38
  }>;
37
39
  export type AssetReferenceKind = z.infer<typeof assetReferenceKindSchema>;
38
40
  export declare const assetReferenceSchema: z.ZodObject<{
@@ -51,6 +53,8 @@ export declare const assetReferenceSchema: z.ZodObject<{
51
53
  crm_opportunity_attachment: "crm_opportunity_attachment";
52
54
  project_attachment: "project_attachment";
53
55
  task_attachment: "task_attachment";
56
+ admin_user_avatar: "admin_user_avatar";
57
+ product_content: "product_content";
54
58
  }>;
55
59
  entityId: z.ZodString;
56
60
  label: z.ZodString;
@@ -207,6 +211,8 @@ export declare const assetDetailSchema: z.ZodObject<{
207
211
  crm_opportunity_attachment: "crm_opportunity_attachment";
208
212
  project_attachment: "project_attachment";
209
213
  task_attachment: "task_attachment";
214
+ admin_user_avatar: "admin_user_avatar";
215
+ product_content: "product_content";
210
216
  }>;
211
217
  entityId: z.ZodString;
212
218
  label: z.ZodString;
@@ -315,6 +321,8 @@ export declare const getAssetResponseSchema: z.ZodObject<{
315
321
  crm_opportunity_attachment: "crm_opportunity_attachment";
316
322
  project_attachment: "project_attachment";
317
323
  task_attachment: "task_attachment";
324
+ admin_user_avatar: "admin_user_avatar";
325
+ product_content: "product_content";
318
326
  }>;
319
327
  entityId: z.ZodString;
320
328
  label: z.ZodString;
@@ -488,6 +496,25 @@ export interface AssetRecord {
488
496
  /** Operator-chosen alias, or null. */
489
497
  permalink: string | null;
490
498
  }
499
+ /**
500
+ * The event `assets_library` publishes on the in-process EventBus after a
501
+ * committed write that changes what an embedded asset renders as — its bytes
502
+ * (a replace, a restore of the previous version, and with them the
503
+ * `?v=<contentVersion>` marker), its URL (a permalink set or removed, a
504
+ * visibility change), its rendered details (filename, label, alt text, MIME
505
+ * type), or whether it is live at all (a soft delete, a restore). Issue #363.
506
+ *
507
+ * It exists for whoever caches an answer that **embeds** an asset — `cms`
508
+ * caches resolved pages, blocks and hooks — because such a cache cannot
509
+ * otherwise learn that the embedded asset moved. The owner names no consumer:
510
+ * a subscriber that is absent or switched off simply hears nothing.
511
+ */
512
+ export declare const ASSET_CHANGED_EVENT = "assets_library.asset_changed.v1";
513
+ /** The payload of {@link ASSET_CHANGED_EVENT}, beside the bus's `eventId` / `occurredAt`. */
514
+ export interface AssetChangedEvent {
515
+ /** The assets the write changed — at least one. */
516
+ readonly assetIds: readonly string[];
517
+ }
491
518
  /**
492
519
  * Container name: `assetReadPort`. Owner: `assets_library`.
493
520
  *
@@ -537,6 +564,24 @@ export interface AssetReadPort {
537
564
  * build per row, and the run walks the whole sellable catalogue.
538
565
  */
539
566
  resolvePublicUrls(assetIds: readonly string[]): Promise<Map<string, string>>;
567
+ /**
568
+ * The URL {@link AssetsLibraryPort.getAsset} carries for each of these live
569
+ * assets, keyed by asset id — the versioned stable URL of a `public` one, a
570
+ * signed, expiring link to a `private` one — and nothing for an id that names
571
+ * no live row.
572
+ *
573
+ * **For a consumer that renders what an editor embedded**: a storefront page,
574
+ * block or menu shows a private asset too, as long as the link is fresh, and
575
+ * caches the answer no longer than it would cache `getAsset`'s. A consumer
576
+ * that publishes a link someone fetches later wants
577
+ * {@link resolvePublicUrls}.
578
+ *
579
+ * Batched, and without the detail's `references` list, for the reason
580
+ * `resolvePublicUrls` gives (issue #685): a page resolving each of ~150 embeds
581
+ * through `getAsset` walked the content of every page, block, template, post,
582
+ * product and menu once per embed, on every cache miss.
583
+ */
584
+ resolveUrls(assetIds: readonly string[]): Promise<Map<string, string>>;
540
585
  /**
541
586
  * Which of these assets the **ambient caller** may see in the asset library
542
587
  * (`specs/166-asset-reference-visibility/`): an asset no reader-restricted
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // See specs/013-assets-library/contracts/ for the per-surface contracts these schemas back.
9
9
  import { z } from 'zod';
10
- import { isoDateTimeSchema, uuidSchema, multilingualStringSchema } from './common.js';
10
+ import { isoDateTimeSchema, uuidSchema, multilingualStringSchema, isUuidShape } from './common.js';
11
11
  // ────────────────────────────────────────────────────────────────────────────
12
12
  // (1) Domain types
13
13
  // ────────────────────────────────────────────────────────────────────────────
@@ -37,6 +37,10 @@ export const assetReferenceKindSchema = z.enum([
37
37
  'project_attachment',
38
38
  // `specs/165-task-management/` FR-008: a file attached to a Task.
39
39
  'task_attachment',
40
+ // `specs/171-blog-i18n-authors/` US6: an administrator's author avatar.
41
+ 'admin_user_avatar',
42
+ // `specs/172-product-content-attributes/` FR-063: an asset embedded in a product's content attribute.
43
+ 'product_content',
40
44
  ]);
41
45
  export const assetReferenceSchema = z.object({
42
46
  kind: assetReferenceKindSchema,
@@ -195,14 +199,13 @@ export const moveManyAssetsResponseSchema = z.object({
195
199
  // (2) HTTP — permalinks and the previous version (specs/156-asset-stable-url/)
196
200
  // ────────────────────────────────────────────────────────────────────────────
197
201
  export const ASSET_PERMALINK_MAX_LENGTH = 200;
198
- const ASSET_ID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
199
202
  const PERMALINK_CHARACTERS = /^[A-Za-z0-9._/-]+$/;
200
203
  /**
201
204
  * True for the shape the file route treats as an asset id, in either case. A
202
205
  * permalink of this shape would be unreachable, so the validator refuses it.
203
206
  */
204
207
  export function isAssetIdShaped(segment) {
205
- return ASSET_ID_SHAPE.test(segment);
208
+ return isUuidShape(segment);
206
209
  }
207
210
  /**
208
211
  * The one permalink rule for the server and the admin form. Pure; no I/O.
@@ -274,4 +277,18 @@ export const assetEmbedResolutionSchema = z.object({
274
277
  label: z.string().nullable(),
275
278
  visibility: assetVisibilitySchema,
276
279
  });
280
+ /**
281
+ * The event `assets_library` publishes on the in-process EventBus after a
282
+ * committed write that changes what an embedded asset renders as — its bytes
283
+ * (a replace, a restore of the previous version, and with them the
284
+ * `?v=<contentVersion>` marker), its URL (a permalink set or removed, a
285
+ * visibility change), its rendered details (filename, label, alt text, MIME
286
+ * type), or whether it is live at all (a soft delete, a restore). Issue #363.
287
+ *
288
+ * It exists for whoever caches an answer that **embeds** an asset — `cms`
289
+ * caches resolved pages, blocks and hooks — because such a cache cannot
290
+ * otherwise learn that the embedded asset moved. The owner names no consumer:
291
+ * a subscriber that is absent or switched off simply hears nothing.
292
+ */
293
+ export const ASSET_CHANGED_EVENT = 'assets_library.asset_changed.v1';
277
294
  //# sourceMappingURL=assets-library.js.map
@@ -1,4 +1,16 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * The value an erased audit-snapshot field holds (issue #844).
4
+ *
5
+ * When a customer is anonymised, the platform rewrites the audit history of
6
+ * that subject in place: every key is kept, so a diff still says *which* fields
7
+ * changed, and every personal value becomes this marker. It is the **stored**
8
+ * value — the raw JSON, the CLI and an export print it as is — and a reader
9
+ * that shows it to a person translates it (the admin audit viewer draws
10
+ * `auditLog.erased`). Only a value equal to the marker is one: a string that
11
+ * merely starts with it is ordinary data.
12
+ */
13
+ export declare const AUDIT_ERASED_MARKER = "[erased]";
2
14
  /**
3
15
  * Audit-log reference labels — "what is this row about, and where does it live?"
4
16
  * (feature 075, D-87 drain).
@@ -1,4 +1,16 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * The value an erased audit-snapshot field holds (issue #844).
4
+ *
5
+ * When a customer is anonymised, the platform rewrites the audit history of
6
+ * that subject in place: every key is kept, so a diff still says *which* fields
7
+ * changed, and every personal value becomes this marker. It is the **stored**
8
+ * value — the raw JSON, the CLI and an export print it as is — and a reader
9
+ * that shows it to a person translates it (the admin audit viewer draws
10
+ * `auditLog.erased`). Only a value equal to the marker is one: a string that
11
+ * merely starts with it is ordinary data.
12
+ */
13
+ export const AUDIT_ERASED_MARKER = '[erased]';
2
14
  // ---------------------------------------------------------------------------
3
15
  // Recent-activity visibility — the operator axis of D-163.1 (feature 080)
4
16
  // ---------------------------------------------------------------------------
package/dist/auth.d.ts CHANGED
@@ -32,6 +32,15 @@ export declare const ADMIN_SESSION_COOKIE_NAME = "b2b_admin_session";
32
32
  * minutes, never in a URL.
33
33
  */
34
34
  export declare const MFA_CHALLENGE_COOKIE_NAME = "b2b_mfa_challenge";
35
+ /**
36
+ * The storefront's one-render "your basket was carried over" notice: `adopted`
37
+ * or `merged`, read and cleared by the next page render. Two writers, one
38
+ * reader, as {@link MFA_CHALLENGE_COOKIE_NAME}: the storefront's sign-in
39
+ * actions set it, and so does `mfa`'s federated callback, which signs the
40
+ * customer in with no storefront action in between (issue #1188). `httpOnly`,
41
+ * path `/`, thirty seconds.
42
+ */
43
+ export declare const CART_MERGE_FLASH_COOKIE_NAME = "b2b_cart_merge_flash";
35
44
  /**
36
45
  * The cookie a completed administrator sign-in leaves on the device, so that
37
46
  * the device is recognised as one the account has been used from.
package/dist/auth.js CHANGED
@@ -33,6 +33,15 @@ export const ADMIN_SESSION_COOKIE_NAME = 'b2b_admin_session';
33
33
  * minutes, never in a URL.
34
34
  */
35
35
  export const MFA_CHALLENGE_COOKIE_NAME = 'b2b_mfa_challenge';
36
+ /**
37
+ * The storefront's one-render "your basket was carried over" notice: `adopted`
38
+ * or `merged`, read and cleared by the next page render. Two writers, one
39
+ * reader, as {@link MFA_CHALLENGE_COOKIE_NAME}: the storefront's sign-in
40
+ * actions set it, and so does `mfa`'s federated callback, which signs the
41
+ * customer in with no storefront action in between (issue #1188). `httpOnly`,
42
+ * path `/`, thirty seconds.
43
+ */
44
+ export const CART_MERGE_FLASH_COOKIE_NAME = 'b2b_cart_merge_flash';
36
45
  /**
37
46
  * The cookie a completed administrator sign-in leaves on the device, so that
38
47
  * the device is recognised as one the account has been used from.