@endora-commerce/mod-catalog 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 (615) hide show
  1. package/dist/admin/components/CopyToChannelsDialog.d.ts +37 -0
  2. package/dist/admin/components/CopyToChannelsDialog.js +83 -0
  3. package/dist/admin/components/PackagingUnitsEditor.d.ts +13 -4
  4. package/dist/admin/components/PackagingUnitsEditor.js +21 -85
  5. package/dist/admin/components/ProductAttachmentsSection.d.ts +1 -3
  6. package/dist/admin/components/ProductAttachmentsSection.js +59 -98
  7. package/dist/admin/components/ProductAttributesTab.d.ts +1 -11
  8. package/dist/admin/components/ProductAttributesTab.js +128 -119
  9. package/dist/admin/components/ProductContentCard.d.ts +41 -0
  10. package/dist/admin/components/ProductContentCard.js +28 -0
  11. package/dist/admin/components/ProductEditorSaveAction.d.ts +22 -0
  12. package/dist/admin/components/ProductEditorSaveAction.js +23 -0
  13. package/dist/admin/components/ProductGallerySection.d.ts +2 -13
  14. package/dist/admin/components/ProductGallerySection.js +98 -354
  15. package/dist/admin/components/ProductInventoryTab.d.ts +12 -1
  16. package/dist/admin/components/ProductInventoryTab.js +52 -115
  17. package/dist/admin/components/ProductOrderRulesCard.d.ts +11 -15
  18. package/dist/admin/components/ProductOrderRulesCard.js +15 -268
  19. package/dist/admin/components/ProductScopeBar.d.ts +34 -0
  20. package/dist/admin/components/ProductScopeBar.js +70 -0
  21. package/dist/admin/components/ProductScopeOverview.d.ts +13 -1
  22. package/dist/admin/components/ProductScopeOverview.js +56 -37
  23. package/dist/admin/components/ProductUrlRedirects.d.ts +15 -0
  24. package/dist/admin/components/ProductUrlRedirects.js +70 -0
  25. package/dist/admin/components/ProductsBulkEditDialog.js +4 -3
  26. package/dist/admin/components/editor/DetailsTab.d.ts +30 -0
  27. package/dist/admin/components/editor/DetailsTab.js +60 -0
  28. package/dist/admin/components/editor/SectionHeading.d.ts +22 -0
  29. package/dist/admin/components/editor/SectionHeading.js +19 -0
  30. package/dist/admin/components/editor/confirm-removal.d.ts +13 -0
  31. package/dist/admin/components/editor/confirm-removal.js +33 -0
  32. package/dist/admin/components/editor/editor-context.d.ts +55 -0
  33. package/dist/admin/components/editor/editor-context.js +88 -0
  34. package/dist/admin/components/editor/scoped-controls.d.ts +46 -0
  35. package/dist/admin/components/editor/scoped-controls.js +64 -0
  36. package/dist/admin/index.d.ts +1 -1
  37. package/dist/admin/index.js +11 -0
  38. package/dist/admin/lib/attribute-scope.d.ts +17 -14
  39. package/dist/admin/lib/attribute-scope.js +12 -9
  40. package/dist/admin/lib/bulk-result-outcome.d.ts +14 -0
  41. package/dist/admin/lib/bulk-result-outcome.js +13 -0
  42. package/dist/admin/lib/editor-scope.d.ts +35 -0
  43. package/dist/admin/lib/editor-scope.js +114 -0
  44. package/dist/admin/lib/order-minimum-input.d.ts +13 -0
  45. package/dist/admin/lib/order-minimum-input.js +16 -0
  46. package/dist/admin/lib/product-labels.d.ts +0 -2
  47. package/dist/admin/lib/product-labels.js +1 -5
  48. package/dist/admin/lib/product-scopes-api.d.ts +5 -22
  49. package/dist/admin/lib/product-scopes-api.js +4 -48
  50. package/dist/admin/lib/product-url-keys-api.d.ts +4 -27
  51. package/dist/admin/lib/product-url-keys-api.js +1 -50
  52. package/dist/admin/lib/scope-overview.d.ts +13 -14
  53. package/dist/admin/lib/scope-overview.js +36 -31
  54. package/dist/admin/lib/scoped-editor-store.d.ts +81 -0
  55. package/dist/admin/lib/scoped-editor-store.js +198 -0
  56. package/dist/admin/lib/scoped-values-api.d.ts +14 -0
  57. package/dist/admin/lib/scoped-values-api.js +55 -0
  58. package/dist/admin/pages/AttachmentTypesPage.js +14 -4
  59. package/dist/admin/pages/AttributeSetsPage.js +11 -4
  60. package/dist/admin/pages/AttributesManager.js +130 -40
  61. package/dist/admin/pages/BulkOperationDetailPage.js +11 -4
  62. package/dist/admin/pages/CategoriesTree.d.ts +5 -0
  63. package/dist/admin/pages/CategoriesTree.js +226 -40
  64. package/dist/admin/pages/ProductContentPage.d.ts +27 -0
  65. package/dist/admin/pages/ProductContentPage.js +161 -0
  66. package/dist/admin/pages/ProductCreateForm.d.ts +3 -0
  67. package/dist/admin/pages/ProductCreateForm.js +87 -0
  68. package/dist/admin/pages/ProductEditor.js +938 -458
  69. package/dist/admin/pages/ProductsList.js +33 -38
  70. package/dist/backend/admin-search-provider.d.ts +2 -1
  71. package/dist/backend/admin-search-provider.js +1 -1
  72. package/dist/backend/commands/attribute-commands.d.ts +4 -3
  73. package/dist/backend/commands/attribute-commands.js +137 -30
  74. package/dist/backend/commands/product-content-commands.d.ts +31 -0
  75. package/dist/backend/commands/product-content-commands.js +70 -0
  76. package/dist/backend/commands/scoped-values.commands.d.ts +95 -0
  77. package/dist/backend/commands/scoped-values.commands.js +235 -0
  78. package/dist/backend/demo/reset.js +2 -1
  79. package/dist/backend/demo/rows.d.ts +18 -0
  80. package/dist/backend/demo/rows.js +18 -0
  81. package/dist/backend/demo/seed.d.ts +2 -1
  82. package/dist/backend/demo/seed.js +20 -6
  83. package/dist/backend/entities/gallery-item-scope-override.entity.d.ts +30 -0
  84. package/dist/backend/entities/gallery-item-scope-override.entity.js +80 -0
  85. package/dist/backend/entities/gallery-item.entity.d.ts +7 -6
  86. package/dist/backend/entities/gallery-item.entity.js +11 -6
  87. package/dist/backend/entities/gallery-role-scope-override.entity.d.ts +28 -0
  88. package/dist/backend/entities/gallery-role-scope-override.entity.js +75 -0
  89. package/dist/backend/entities/product-attachment-scope-override.entity.d.ts +30 -0
  90. package/dist/backend/entities/product-attachment-scope-override.entity.js +80 -0
  91. package/dist/backend/entities/product-attachment.entity.d.ts +4 -6
  92. package/dist/backend/entities/product-attachment.entity.js +6 -12
  93. package/dist/backend/entities/product-attribute.entity.d.ts +5 -9
  94. package/dist/backend/entities/product-attribute.entity.js +5 -13
  95. package/dist/backend/entities/product-channel-scope.entity.d.ts +7 -2
  96. package/dist/backend/entities/product-channel-scope.entity.js +10 -1
  97. package/dist/backend/entities/product-content-value.entity.d.ts +39 -0
  98. package/dist/backend/entities/product-content-value.entity.js +81 -0
  99. package/dist/backend/entities/product-packaging-unit-scope-override.entity.d.ts +30 -0
  100. package/dist/backend/entities/product-packaging-unit-scope-override.entity.js +80 -0
  101. package/dist/backend/entities/product-packaging-unit.entity.d.ts +1 -7
  102. package/dist/backend/entities/product-packaging-unit.entity.js +0 -10
  103. package/dist/backend/entities/product-url-key.entity.d.ts +14 -19
  104. package/dist/backend/entities/product-url-key.entity.js +17 -22
  105. package/dist/backend/entities/product-url-redirect.entity.d.ts +8 -13
  106. package/dist/backend/entities/product-url-redirect.entity.js +13 -14
  107. package/dist/backend/entities/product-variant.entity.d.ts +8 -1
  108. package/dist/backend/entities/product-variant.entity.js +13 -2
  109. package/dist/backend/entities/product.entity.d.ts +31 -14
  110. package/dist/backend/entities/product.entity.js +41 -34
  111. package/dist/backend/index.d.ts +11 -3
  112. package/dist/backend/index.js +155 -49
  113. package/dist/backend/plugin.d.ts +36 -6
  114. package/dist/backend/plugin.js +36 -13
  115. package/dist/backend/prompt-tools.d.ts +3 -2
  116. package/dist/backend/prompt-tools.js +18 -7
  117. package/dist/backend/routes.admin.d.ts +15 -16
  118. package/dist/backend/routes.admin.js +122 -103
  119. package/dist/backend/routes.api-key.js +4 -2
  120. package/dist/backend/routes.external.js +3 -2
  121. package/dist/backend/routes.public.d.ts +8 -1
  122. package/dist/backend/routes.public.js +68 -11
  123. package/dist/backend/services/asset-references.d.ts +12 -1
  124. package/dist/backend/services/asset-references.js +42 -2
  125. package/dist/backend/services/attachment-packaging-scopes.d.ts +38 -20
  126. package/dist/backend/services/attachment-packaging-scopes.js +58 -75
  127. package/dist/backend/services/attachment.service.d.ts +4 -8
  128. package/dist/backend/services/attachment.service.js +35 -49
  129. package/dist/backend/services/attribute-filter-match.d.ts +14 -0
  130. package/dist/backend/services/attribute-filter-match.js +19 -0
  131. package/dist/backend/services/attribute-scope-preview.d.ts +17 -7
  132. package/dist/backend/services/attribute-scope-preview.js +30 -20
  133. package/dist/backend/services/attribute-set.service.d.ts +10 -1
  134. package/dist/backend/services/attribute-set.service.js +30 -4
  135. package/dist/backend/services/attribute-type-mapping.d.ts +2 -2
  136. package/dist/backend/services/attribute-type-mapping.js +6 -0
  137. package/dist/backend/services/attribute-usage.d.ts +31 -0
  138. package/dist/backend/services/attribute-usage.js +29 -0
  139. package/dist/backend/services/bulk-operation.service.d.ts +1 -1
  140. package/dist/backend/services/bulk-operation.service.js +16 -6
  141. package/dist/backend/services/bundle.service.js +19 -1
  142. package/dist/backend/services/catalog-admin-search.service.d.ts +3 -2
  143. package/dist/backend/services/catalog-admin-search.service.js +6 -6
  144. package/dist/backend/services/catalog-admin.service.d.ts +63 -12
  145. package/dist/backend/services/catalog-admin.service.js +368 -195
  146. package/dist/backend/services/catalog-attribute-read.service.d.ts +14 -0
  147. package/dist/backend/services/catalog-attribute-read.service.js +9 -19
  148. package/dist/backend/services/catalog-bulk-import.service.d.ts +58 -5
  149. package/dist/backend/services/catalog-bulk-import.service.js +192 -142
  150. package/dist/backend/services/catalog-bulk-update.service.d.ts +5 -3
  151. package/dist/backend/services/catalog-bulk-update.service.js +21 -8
  152. package/dist/backend/services/catalog-product-read.service.d.ts +11 -1
  153. package/dist/backend/services/catalog-product-read.service.js +37 -17
  154. package/dist/backend/services/catalog-query.service.d.ts +48 -8
  155. package/dist/backend/services/catalog-query.service.js +180 -116
  156. package/dist/backend/services/catalog-quick-search.service.js +5 -5
  157. package/dist/backend/services/catalog-write-ports.d.ts +14 -16
  158. package/dist/backend/services/catalog-write-ports.js +11 -70
  159. package/dist/backend/services/category-admin.service.js +29 -5
  160. package/dist/backend/services/content-attribute-rules.d.ts +61 -0
  161. package/dist/backend/services/content-attribute-rules.js +102 -0
  162. package/dist/backend/services/effective-value.sql.d.ts +24 -38
  163. package/dist/backend/services/effective-value.sql.js +37 -87
  164. package/dist/backend/services/gallery-scopes.d.ts +45 -22
  165. package/dist/backend/services/gallery-scopes.js +116 -109
  166. package/dist/backend/services/gallery.service.d.ts +13 -27
  167. package/dist/backend/services/gallery.service.js +75 -199
  168. package/dist/backend/services/grouped.service.js +20 -3
  169. package/dist/backend/services/packaging-unit.service.js +7 -12
  170. package/dist/backend/services/page-builder-content.d.ts +64 -0
  171. package/dist/backend/services/page-builder-content.js +113 -0
  172. package/dist/backend/services/primary-asset-url.d.ts +6 -1
  173. package/dist/backend/services/primary-asset-url.js +9 -4
  174. package/dist/backend/services/product-availability.service.d.ts +16 -3
  175. package/dist/backend/services/product-availability.service.js +58 -21
  176. package/dist/backend/services/product-content.service.d.ts +62 -0
  177. package/dist/backend/services/product-content.service.js +122 -0
  178. package/dist/backend/services/product-editor-preferences.service.d.ts +6 -0
  179. package/dist/backend/services/product-editor-preferences.service.js +12 -0
  180. package/dist/backend/services/product-global-field-rules.d.ts +39 -0
  181. package/dist/backend/services/product-global-field-rules.js +84 -0
  182. package/dist/backend/services/product-link.service.js +14 -16
  183. package/dist/backend/services/product-list-view-service.js +5 -8
  184. package/dist/backend/services/product-page-revalidation.d.ts +9 -0
  185. package/dist/backend/services/product-page-revalidation.js +19 -0
  186. package/dist/backend/services/product-scopes.service.d.ts +18 -8
  187. package/dist/backend/services/product-scopes.service.js +91 -36
  188. package/dist/backend/services/product-value-resolver.service.d.ts +2 -2
  189. package/dist/backend/services/product-value-resolver.service.js +4 -7
  190. package/dist/backend/services/publication-window-sweep.d.ts +61 -7
  191. package/dist/backend/services/publication-window-sweep.js +106 -19
  192. package/dist/backend/services/scheduled-work-probe.d.ts +34 -0
  193. package/dist/backend/services/scheduled-work-probe.js +30 -0
  194. package/dist/backend/services/scope-completeness.d.ts +11 -11
  195. package/dist/backend/services/scope-completeness.js +26 -33
  196. package/dist/backend/services/scope-overview.service.d.ts +24 -24
  197. package/dist/backend/services/scope-overview.service.js +33 -76
  198. package/dist/backend/services/scoped-store-adapters.d.ts +58 -0
  199. package/dist/backend/services/scoped-store-adapters.js +92 -0
  200. package/dist/backend/services/scoped-values-global-only.d.ts +36 -0
  201. package/dist/backend/services/scoped-values-global-only.js +92 -0
  202. package/dist/backend/services/scoped-values-import.d.ts +86 -0
  203. package/dist/backend/services/scoped-values-import.js +320 -0
  204. package/dist/backend/services/scoped-values-read.service.d.ts +56 -0
  205. package/dist/backend/services/scoped-values-read.service.js +289 -0
  206. package/dist/backend/services/scoped-values-save.service.d.ts +79 -0
  207. package/dist/backend/services/scoped-values-save.service.js +675 -0
  208. package/dist/backend/services/scoped-values-state.d.ts +94 -0
  209. package/dist/backend/services/scoped-values-state.js +159 -0
  210. package/dist/backend/services/scoped-values.service.d.ts +36 -0
  211. package/dist/backend/services/scoped-values.service.js +92 -0
  212. package/dist/backend/services/storefront-value-overrides.d.ts +7 -8
  213. package/dist/backend/services/storefront-value-overrides.js +11 -14
  214. package/dist/backend/services/table-maintenance-queue.d.ts +78 -0
  215. package/dist/backend/services/table-maintenance-queue.js +97 -0
  216. package/dist/backend/services/url-key-resolution.service.d.ts +12 -18
  217. package/dist/backend/services/url-key-resolution.service.js +43 -43
  218. package/dist/backend/services/url-key.service.d.ts +87 -135
  219. package/dist/backend/services/url-key.service.js +447 -619
  220. package/dist/manifest.d.ts +51 -1
  221. package/dist/manifest.js +111 -7
  222. package/dist/migrations/20261030T113855_catalog_scope_model_texts.d.ts +36 -0
  223. package/dist/migrations/20261030T113855_catalog_scope_model_texts.js +225 -0
  224. package/dist/migrations/20261030T113859_catalog_scope_model_order_rules.d.ts +18 -0
  225. package/dist/migrations/20261030T113859_catalog_scope_model_order_rules.js +39 -0
  226. package/dist/migrations/20261030T113904_catalog_scope_model_url_keys.d.ts +6 -0
  227. package/dist/migrations/20261030T113904_catalog_scope_model_url_keys.js +119 -0
  228. package/dist/migrations/20261030T113908_catalog_scope_model_media.d.ts +6 -0
  229. package/dist/migrations/20261030T113908_catalog_scope_model_media.js +185 -0
  230. package/dist/migrations/20261104T121504_catalog_product_content_values.d.ts +36 -0
  231. package/dist/migrations/20261104T121504_catalog_product_content_values.js +53 -0
  232. package/dist/migrations/20261107T093126_catalog_sku_unique_among_live.d.ts +33 -0
  233. package/dist/migrations/20261107T093126_catalog_sku_unique_among_live.js +58 -0
  234. package/dist/migrations/20261107T120008_catalog_product_created_at_milliseconds.d.ts +36 -0
  235. package/dist/migrations/20261107T120008_catalog_product_created_at_milliseconds.js +40 -0
  236. package/dist/migrations/20261114T000706_catalog_category_main_image.d.ts +37 -0
  237. package/dist/migrations/20261114T000706_catalog_category_main_image.js +56 -0
  238. package/dist/migrations/index.d.ts +9 -1
  239. package/dist/migrations/index.js +17 -1
  240. package/docs/catalog/attachments.md +53 -43
  241. package/docs/catalog/attribute-sets.md +3 -2
  242. package/docs/catalog/attributes.md +99 -25
  243. package/docs/catalog/category-content.md +9 -3
  244. package/docs/catalog/composite-products.md +5 -3
  245. package/docs/catalog/editing-a-product-at-a-scope.md +151 -0
  246. package/docs/catalog/gallery-and-labels.md +61 -60
  247. package/docs/catalog/packaging-units.md +43 -34
  248. package/docs/catalog/per-channel-per-language-overrides.md +83 -410
  249. package/docs/catalog/product-content.md +184 -0
  250. package/docs/catalog/product-links.md +2 -2
  251. package/docs/catalog/url-keys-and-redirects.md +79 -79
  252. package/docs/catalog.md +113 -31
  253. package/i18n/en.json +317 -274
  254. package/i18n/pl.json +319 -276
  255. package/package.json +13 -12
  256. package/dist/admin/components/AttachmentScopesDialog.d.ts +0 -22
  257. package/dist/admin/components/AttachmentScopesDialog.d.ts.map +0 -1
  258. package/dist/admin/components/AttachmentScopesDialog.js +0 -70
  259. package/dist/admin/components/AttachmentScopesDialog.js.map +0 -1
  260. package/dist/admin/components/PackagingUnitsEditor.d.ts.map +0 -1
  261. package/dist/admin/components/PackagingUnitsEditor.js.map +0 -1
  262. package/dist/admin/components/ProductAttachmentsSection.d.ts.map +0 -1
  263. package/dist/admin/components/ProductAttachmentsSection.js.map +0 -1
  264. package/dist/admin/components/ProductAttributesTab.d.ts.map +0 -1
  265. package/dist/admin/components/ProductAttributesTab.js.map +0 -1
  266. package/dist/admin/components/ProductGallerySection.d.ts.map +0 -1
  267. package/dist/admin/components/ProductGallerySection.js.map +0 -1
  268. package/dist/admin/components/ProductInventoryTab.d.ts.map +0 -1
  269. package/dist/admin/components/ProductInventoryTab.js.map +0 -1
  270. package/dist/admin/components/ProductOrderRulesCard.d.ts.map +0 -1
  271. package/dist/admin/components/ProductOrderRulesCard.js.map +0 -1
  272. package/dist/admin/components/ProductScopeControls.d.ts +0 -31
  273. package/dist/admin/components/ProductScopeControls.d.ts.map +0 -1
  274. package/dist/admin/components/ProductScopeControls.js +0 -243
  275. package/dist/admin/components/ProductScopeControls.js.map +0 -1
  276. package/dist/admin/components/ProductScopeEditor.d.ts +0 -88
  277. package/dist/admin/components/ProductScopeEditor.d.ts.map +0 -1
  278. package/dist/admin/components/ProductScopeEditor.js +0 -396
  279. package/dist/admin/components/ProductScopeEditor.js.map +0 -1
  280. package/dist/admin/components/ProductScopeOverview.d.ts.map +0 -1
  281. package/dist/admin/components/ProductScopeOverview.js.map +0 -1
  282. package/dist/admin/components/ProductStatusPills.d.ts.map +0 -1
  283. package/dist/admin/components/ProductStatusPills.js.map +0 -1
  284. package/dist/admin/components/ProductUrlKeysPanel.d.ts +0 -17
  285. package/dist/admin/components/ProductUrlKeysPanel.d.ts.map +0 -1
  286. package/dist/admin/components/ProductUrlKeysPanel.js +0 -215
  287. package/dist/admin/components/ProductUrlKeysPanel.js.map +0 -1
  288. package/dist/admin/components/ProductsBulkEditDialog.d.ts.map +0 -1
  289. package/dist/admin/components/ProductsBulkEditDialog.js.map +0 -1
  290. package/dist/admin/components/ScopedDialogParts.d.ts +0 -23
  291. package/dist/admin/components/ScopedDialogParts.d.ts.map +0 -1
  292. package/dist/admin/components/ScopedDialogParts.js +0 -16
  293. package/dist/admin/components/ScopedDialogParts.js.map +0 -1
  294. package/dist/admin/index.d.ts.map +0 -1
  295. package/dist/admin/index.js.map +0 -1
  296. package/dist/admin/lib/attribute-scope.d.ts.map +0 -1
  297. package/dist/admin/lib/attribute-scope.js.map +0 -1
  298. package/dist/admin/lib/bulk-operation-log-text.d.ts.map +0 -1
  299. package/dist/admin/lib/bulk-operation-log-text.js.map +0 -1
  300. package/dist/admin/lib/media-scopes.d.ts +0 -41
  301. package/dist/admin/lib/media-scopes.d.ts.map +0 -1
  302. package/dist/admin/lib/media-scopes.js +0 -66
  303. package/dist/admin/lib/media-scopes.js.map +0 -1
  304. package/dist/admin/lib/product-labels.d.ts.map +0 -1
  305. package/dist/admin/lib/product-labels.js.map +0 -1
  306. package/dist/admin/lib/product-scope-drafts.d.ts +0 -77
  307. package/dist/admin/lib/product-scope-drafts.d.ts.map +0 -1
  308. package/dist/admin/lib/product-scope-drafts.js +0 -133
  309. package/dist/admin/lib/product-scope-drafts.js.map +0 -1
  310. package/dist/admin/lib/product-scopes-api.d.ts.map +0 -1
  311. package/dist/admin/lib/product-scopes-api.js.map +0 -1
  312. package/dist/admin/lib/product-url-keys-api.d.ts.map +0 -1
  313. package/dist/admin/lib/product-url-keys-api.js.map +0 -1
  314. package/dist/admin/lib/resolve-product-selection.d.ts.map +0 -1
  315. package/dist/admin/lib/resolve-product-selection.js.map +0 -1
  316. package/dist/admin/lib/scope-overview.d.ts.map +0 -1
  317. package/dist/admin/lib/scope-overview.js.map +0 -1
  318. package/dist/admin/pages/AttachmentTypesPage.d.ts.map +0 -1
  319. package/dist/admin/pages/AttachmentTypesPage.js.map +0 -1
  320. package/dist/admin/pages/AttributeSetsPage.d.ts.map +0 -1
  321. package/dist/admin/pages/AttributeSetsPage.js.map +0 -1
  322. package/dist/admin/pages/AttributesManager.d.ts.map +0 -1
  323. package/dist/admin/pages/AttributesManager.js.map +0 -1
  324. package/dist/admin/pages/BulkOperationDetailPage.d.ts.map +0 -1
  325. package/dist/admin/pages/BulkOperationDetailPage.js.map +0 -1
  326. package/dist/admin/pages/BulkOperationsPage.d.ts.map +0 -1
  327. package/dist/admin/pages/BulkOperationsPage.js.map +0 -1
  328. package/dist/admin/pages/CategoriesTree.d.ts.map +0 -1
  329. package/dist/admin/pages/CategoriesTree.js.map +0 -1
  330. package/dist/admin/pages/CategoryContentPage.d.ts.map +0 -1
  331. package/dist/admin/pages/CategoryContentPage.js.map +0 -1
  332. package/dist/admin/pages/ProductEditor.d.ts.map +0 -1
  333. package/dist/admin/pages/ProductEditor.js.map +0 -1
  334. package/dist/admin/pages/ProductsList.d.ts.map +0 -1
  335. package/dist/admin/pages/ProductsList.js.map +0 -1
  336. package/dist/backend/admin-search-provider.d.ts.map +0 -1
  337. package/dist/backend/admin-search-provider.js.map +0 -1
  338. package/dist/backend/commands/attribute-commands.d.ts.map +0 -1
  339. package/dist/backend/commands/attribute-commands.js.map +0 -1
  340. package/dist/backend/demo/reset.d.ts.map +0 -1
  341. package/dist/backend/demo/reset.js.map +0 -1
  342. package/dist/backend/demo/rows.d.ts.map +0 -1
  343. package/dist/backend/demo/rows.js.map +0 -1
  344. package/dist/backend/demo/seed.d.ts.map +0 -1
  345. package/dist/backend/demo/seed.js.map +0 -1
  346. package/dist/backend/entities/attachment-type.entity.d.ts.map +0 -1
  347. package/dist/backend/entities/attachment-type.entity.js.map +0 -1
  348. package/dist/backend/entities/attribute-set-attribute.entity.d.ts.map +0 -1
  349. package/dist/backend/entities/attribute-set-attribute.entity.js.map +0 -1
  350. package/dist/backend/entities/attribute-set.entity.d.ts.map +0 -1
  351. package/dist/backend/entities/attribute-set.entity.js.map +0 -1
  352. package/dist/backend/entities/bulk-operation.entity.d.ts.map +0 -1
  353. package/dist/backend/entities/bulk-operation.entity.js.map +0 -1
  354. package/dist/backend/entities/bundle-slot-option.entity.d.ts.map +0 -1
  355. package/dist/backend/entities/bundle-slot-option.entity.js.map +0 -1
  356. package/dist/backend/entities/bundle-slot.entity.d.ts.map +0 -1
  357. package/dist/backend/entities/bundle-slot.entity.js.map +0 -1
  358. package/dist/backend/entities/category.entity.d.ts.map +0 -1
  359. package/dist/backend/entities/category.entity.js.map +0 -1
  360. package/dist/backend/entities/gallery-item-channel-hidden.entity.d.ts +0 -14
  361. package/dist/backend/entities/gallery-item-channel-hidden.entity.d.ts.map +0 -1
  362. package/dist/backend/entities/gallery-item-channel-hidden.entity.js +0 -42
  363. package/dist/backend/entities/gallery-item-channel-hidden.entity.js.map +0 -1
  364. package/dist/backend/entities/gallery-item-channel-label.entity.d.ts +0 -18
  365. package/dist/backend/entities/gallery-item-channel-label.entity.d.ts.map +0 -1
  366. package/dist/backend/entities/gallery-item-channel-label.entity.js +0 -49
  367. package/dist/backend/entities/gallery-item-channel-label.entity.js.map +0 -1
  368. package/dist/backend/entities/gallery-item-label.entity.d.ts.map +0 -1
  369. package/dist/backend/entities/gallery-item-label.entity.js.map +0 -1
  370. package/dist/backend/entities/gallery-item.entity.d.ts.map +0 -1
  371. package/dist/backend/entities/gallery-item.entity.js.map +0 -1
  372. package/dist/backend/entities/grouped-item.entity.d.ts.map +0 -1
  373. package/dist/backend/entities/grouped-item.entity.js.map +0 -1
  374. package/dist/backend/entities/product-attachment-channel-hidden.entity.d.ts +0 -13
  375. package/dist/backend/entities/product-attachment-channel-hidden.entity.d.ts.map +0 -1
  376. package/dist/backend/entities/product-attachment-channel-hidden.entity.js +0 -41
  377. package/dist/backend/entities/product-attachment-channel-hidden.entity.js.map +0 -1
  378. package/dist/backend/entities/product-attachment.entity.d.ts.map +0 -1
  379. package/dist/backend/entities/product-attachment.entity.js.map +0 -1
  380. package/dist/backend/entities/product-attribute.entity.d.ts.map +0 -1
  381. package/dist/backend/entities/product-attribute.entity.js.map +0 -1
  382. package/dist/backend/entities/product-channel-language-scope.entity.d.ts.map +0 -1
  383. package/dist/backend/entities/product-channel-language-scope.entity.js.map +0 -1
  384. package/dist/backend/entities/product-channel-scope.entity.d.ts.map +0 -1
  385. package/dist/backend/entities/product-channel-scope.entity.js.map +0 -1
  386. package/dist/backend/entities/product-editor-preference.entity.d.ts.map +0 -1
  387. package/dist/backend/entities/product-editor-preference.entity.js.map +0 -1
  388. package/dist/backend/entities/product-link.entity.d.ts.map +0 -1
  389. package/dist/backend/entities/product-link.entity.js.map +0 -1
  390. package/dist/backend/entities/product-list-saved-view.entity.d.ts.map +0 -1
  391. package/dist/backend/entities/product-list-saved-view.entity.js.map +0 -1
  392. package/dist/backend/entities/product-packaging-unit.entity.d.ts.map +0 -1
  393. package/dist/backend/entities/product-packaging-unit.entity.js.map +0 -1
  394. package/dist/backend/entities/product-url-key.entity.d.ts.map +0 -1
  395. package/dist/backend/entities/product-url-key.entity.js.map +0 -1
  396. package/dist/backend/entities/product-url-redirect.entity.d.ts.map +0 -1
  397. package/dist/backend/entities/product-url-redirect.entity.js.map +0 -1
  398. package/dist/backend/entities/product-value-override.entity.d.ts.map +0 -1
  399. package/dist/backend/entities/product-value-override.entity.js.map +0 -1
  400. package/dist/backend/entities/product-variant.entity.d.ts.map +0 -1
  401. package/dist/backend/entities/product-variant.entity.js.map +0 -1
  402. package/dist/backend/entities/product.entity.d.ts.map +0 -1
  403. package/dist/backend/entities/product.entity.js.map +0 -1
  404. package/dist/backend/index.d.ts.map +0 -1
  405. package/dist/backend/index.js.map +0 -1
  406. package/dist/backend/plugin.d.ts.map +0 -1
  407. package/dist/backend/plugin.js.map +0 -1
  408. package/dist/backend/prompt-tools.d.ts.map +0 -1
  409. package/dist/backend/prompt-tools.js.map +0 -1
  410. package/dist/backend/routes.admin.d.ts.map +0 -1
  411. package/dist/backend/routes.admin.js.map +0 -1
  412. package/dist/backend/routes.admin.url-keys.d.ts.map +0 -1
  413. package/dist/backend/routes.admin.url-keys.js.map +0 -1
  414. package/dist/backend/routes.api-key.d.ts.map +0 -1
  415. package/dist/backend/routes.api-key.js.map +0 -1
  416. package/dist/backend/routes.external.d.ts.map +0 -1
  417. package/dist/backend/routes.external.js.map +0 -1
  418. package/dist/backend/routes.public.d.ts.map +0 -1
  419. package/dist/backend/routes.public.js.map +0 -1
  420. package/dist/backend/routes.public.url-keys.d.ts.map +0 -1
  421. package/dist/backend/routes.public.url-keys.js.map +0 -1
  422. package/dist/backend/saved-view-actor.d.ts.map +0 -1
  423. package/dist/backend/saved-view-actor.js.map +0 -1
  424. package/dist/backend/services/asset-references.d.ts.map +0 -1
  425. package/dist/backend/services/asset-references.js.map +0 -1
  426. package/dist/backend/services/attachment-packaging-scopes.d.ts.map +0 -1
  427. package/dist/backend/services/attachment-packaging-scopes.js.map +0 -1
  428. package/dist/backend/services/attachment.service.d.ts.map +0 -1
  429. package/dist/backend/services/attachment.service.js.map +0 -1
  430. package/dist/backend/services/attribute-option-validator.d.ts.map +0 -1
  431. package/dist/backend/services/attribute-option-validator.js.map +0 -1
  432. package/dist/backend/services/attribute-scope-preview.d.ts.map +0 -1
  433. package/dist/backend/services/attribute-scope-preview.js.map +0 -1
  434. package/dist/backend/services/attribute-set-validations.d.ts.map +0 -1
  435. package/dist/backend/services/attribute-set-validations.js.map +0 -1
  436. package/dist/backend/services/attribute-set.service.d.ts.map +0 -1
  437. package/dist/backend/services/attribute-set.service.js.map +0 -1
  438. package/dist/backend/services/attribute-type-mapping.d.ts.map +0 -1
  439. package/dist/backend/services/attribute-type-mapping.js.map +0 -1
  440. package/dist/backend/services/attribute-value-key.service.d.ts.map +0 -1
  441. package/dist/backend/services/attribute-value-key.service.js.map +0 -1
  442. package/dist/backend/services/audit-references.d.ts.map +0 -1
  443. package/dist/backend/services/audit-references.js.map +0 -1
  444. package/dist/backend/services/bulk-operation-queue.d.ts.map +0 -1
  445. package/dist/backend/services/bulk-operation-queue.js.map +0 -1
  446. package/dist/backend/services/bulk-operation.service.d.ts.map +0 -1
  447. package/dist/backend/services/bulk-operation.service.js.map +0 -1
  448. package/dist/backend/services/bundle.service.d.ts.map +0 -1
  449. package/dist/backend/services/bundle.service.js.map +0 -1
  450. package/dist/backend/services/catalog-admin-search.service.d.ts.map +0 -1
  451. package/dist/backend/services/catalog-admin-search.service.js.map +0 -1
  452. package/dist/backend/services/catalog-admin.service.d.ts.map +0 -1
  453. package/dist/backend/services/catalog-admin.service.js.map +0 -1
  454. package/dist/backend/services/catalog-attribute-read.service.d.ts.map +0 -1
  455. package/dist/backend/services/catalog-attribute-read.service.js.map +0 -1
  456. package/dist/backend/services/catalog-bulk-import.service.d.ts.map +0 -1
  457. package/dist/backend/services/catalog-bulk-import.service.js.map +0 -1
  458. package/dist/backend/services/catalog-bulk-update.service.d.ts.map +0 -1
  459. package/dist/backend/services/catalog-bulk-update.service.js.map +0 -1
  460. package/dist/backend/services/catalog-category-read.service.d.ts.map +0 -1
  461. package/dist/backend/services/catalog-category-read.service.js.map +0 -1
  462. package/dist/backend/services/catalog-org-price-decorator.d.ts.map +0 -1
  463. package/dist/backend/services/catalog-org-price-decorator.js.map +0 -1
  464. package/dist/backend/services/catalog-product-filter.service.d.ts.map +0 -1
  465. package/dist/backend/services/catalog-product-filter.service.js.map +0 -1
  466. package/dist/backend/services/catalog-product-read.service.d.ts.map +0 -1
  467. package/dist/backend/services/catalog-product-read.service.js.map +0 -1
  468. package/dist/backend/services/catalog-query.service.d.ts.map +0 -1
  469. package/dist/backend/services/catalog-query.service.js.map +0 -1
  470. package/dist/backend/services/catalog-quick-search.service.d.ts.map +0 -1
  471. package/dist/backend/services/catalog-quick-search.service.js.map +0 -1
  472. package/dist/backend/services/catalog-write-ports.d.ts.map +0 -1
  473. package/dist/backend/services/catalog-write-ports.js.map +0 -1
  474. package/dist/backend/services/category-admin.service.d.ts.map +0 -1
  475. package/dist/backend/services/category-admin.service.js.map +0 -1
  476. package/dist/backend/services/channel-url-facts.d.ts.map +0 -1
  477. package/dist/backend/services/channel-url-facts.js.map +0 -1
  478. package/dist/backend/services/effective-value.sql.d.ts.map +0 -1
  479. package/dist/backend/services/effective-value.sql.js.map +0 -1
  480. package/dist/backend/services/gallery-scopes.d.ts.map +0 -1
  481. package/dist/backend/services/gallery-scopes.js.map +0 -1
  482. package/dist/backend/services/gallery.service.d.ts.map +0 -1
  483. package/dist/backend/services/gallery.service.js.map +0 -1
  484. package/dist/backend/services/grouped.service.d.ts.map +0 -1
  485. package/dist/backend/services/grouped.service.js.map +0 -1
  486. package/dist/backend/services/label-resolver.d.ts.map +0 -1
  487. package/dist/backend/services/label-resolver.js.map +0 -1
  488. package/dist/backend/services/linkable-asset.d.ts.map +0 -1
  489. package/dist/backend/services/linkable-asset.js.map +0 -1
  490. package/dist/backend/services/packaging-unit.service.d.ts.map +0 -1
  491. package/dist/backend/services/packaging-unit.service.js.map +0 -1
  492. package/dist/backend/services/primary-asset-url.d.ts.map +0 -1
  493. package/dist/backend/services/primary-asset-url.js.map +0 -1
  494. package/dist/backend/services/product-availability.service.d.ts.map +0 -1
  495. package/dist/backend/services/product-availability.service.js.map +0 -1
  496. package/dist/backend/services/product-availability.sql.d.ts.map +0 -1
  497. package/dist/backend/services/product-availability.sql.js.map +0 -1
  498. package/dist/backend/services/product-editor-preferences.service.d.ts.map +0 -1
  499. package/dist/backend/services/product-editor-preferences.service.js.map +0 -1
  500. package/dist/backend/services/product-link.service.d.ts.map +0 -1
  501. package/dist/backend/services/product-link.service.js.map +0 -1
  502. package/dist/backend/services/product-list-view-service.d.ts.map +0 -1
  503. package/dist/backend/services/product-list-view-service.js.map +0 -1
  504. package/dist/backend/services/product-overrides.service.d.ts +0 -84
  505. package/dist/backend/services/product-overrides.service.d.ts.map +0 -1
  506. package/dist/backend/services/product-overrides.service.js +0 -211
  507. package/dist/backend/services/product-overrides.service.js.map +0 -1
  508. package/dist/backend/services/product-page-revalidation.d.ts.map +0 -1
  509. package/dist/backend/services/product-page-revalidation.js.map +0 -1
  510. package/dist/backend/services/product-scope-context.service.d.ts +0 -36
  511. package/dist/backend/services/product-scope-context.service.d.ts.map +0 -1
  512. package/dist/backend/services/product-scope-context.service.js +0 -107
  513. package/dist/backend/services/product-scope-context.service.js.map +0 -1
  514. package/dist/backend/services/product-scopes.service.d.ts.map +0 -1
  515. package/dist/backend/services/product-scopes.service.js.map +0 -1
  516. package/dist/backend/services/product-summary-text.d.ts.map +0 -1
  517. package/dist/backend/services/product-summary-text.js.map +0 -1
  518. package/dist/backend/services/product-type-validations.d.ts.map +0 -1
  519. package/dist/backend/services/product-type-validations.js.map +0 -1
  520. package/dist/backend/services/product-value-resolver.service.d.ts.map +0 -1
  521. package/dist/backend/services/product-value-resolver.service.js.map +0 -1
  522. package/dist/backend/services/publication-window-sweep.d.ts.map +0 -1
  523. package/dist/backend/services/publication-window-sweep.js.map +0 -1
  524. package/dist/backend/services/scope-completeness.d.ts.map +0 -1
  525. package/dist/backend/services/scope-completeness.js.map +0 -1
  526. package/dist/backend/services/scope-overview.service.d.ts.map +0 -1
  527. package/dist/backend/services/scope-overview.service.js.map +0 -1
  528. package/dist/backend/services/sql-id-arrays.d.ts.map +0 -1
  529. package/dist/backend/services/sql-id-arrays.js.map +0 -1
  530. package/dist/backend/services/storefront-value-overrides.d.ts.map +0 -1
  531. package/dist/backend/services/storefront-value-overrides.js.map +0 -1
  532. package/dist/backend/services/system-attribute-scopes.d.ts.map +0 -1
  533. package/dist/backend/services/system-attribute-scopes.js.map +0 -1
  534. package/dist/backend/services/url-key-resolution.service.d.ts.map +0 -1
  535. package/dist/backend/services/url-key-resolution.service.js.map +0 -1
  536. package/dist/backend/services/url-key.service.d.ts.map +0 -1
  537. package/dist/backend/services/url-key.service.js.map +0 -1
  538. package/dist/backend/services/viewer-organization.d.ts.map +0 -1
  539. package/dist/backend/services/viewer-organization.js.map +0 -1
  540. package/dist/manifest.d.ts.map +0 -1
  541. package/dist/manifest.js.map +0 -1
  542. package/dist/migrations/20260429T064146_catalog_attribute_sets_init.d.ts.map +0 -1
  543. package/dist/migrations/20260429T064146_catalog_attribute_sets_init.js.map +0 -1
  544. package/dist/migrations/20260429T070004_catalog_product_attribute_extensions.d.ts.map +0 -1
  545. package/dist/migrations/20260429T070004_catalog_product_attribute_extensions.js.map +0 -1
  546. package/dist/migrations/20260429T102322_catalog_product_type_and_virtual_fields.d.ts.map +0 -1
  547. package/dist/migrations/20260429T102322_catalog_product_type_and_virtual_fields.js.map +0 -1
  548. package/dist/migrations/20260429T111839_catalog_gallery_items_and_labels.d.ts.map +0 -1
  549. package/dist/migrations/20260429T111839_catalog_gallery_items_and_labels.js.map +0 -1
  550. package/dist/migrations/20260429T112543_catalog_product_attachments.d.ts.map +0 -1
  551. package/dist/migrations/20260429T112543_catalog_product_attachments.js.map +0 -1
  552. package/dist/migrations/20260429T123726_catalog_product_links.d.ts.map +0 -1
  553. package/dist/migrations/20260429T123726_catalog_product_links.js.map +0 -1
  554. package/dist/migrations/20260429T130803_catalog_grouped_and_bundle.d.ts.map +0 -1
  555. package/dist/migrations/20260429T130803_catalog_grouped_and_bundle.js.map +0 -1
  556. package/dist/migrations/20260501T185835_catalog_product_attribute_is_comparable.d.ts.map +0 -1
  557. package/dist/migrations/20260501T185835_catalog_product_attribute_is_comparable.js.map +0 -1
  558. package/dist/migrations/20260505T060113_catalog_attribute_options_and_flags.d.ts.map +0 -1
  559. package/dist/migrations/20260505T060113_catalog_attribute_options_and_flags.js.map +0 -1
  560. package/dist/migrations/20260515T082629_catalog_attribute_mass_editable.d.ts.map +0 -1
  561. package/dist/migrations/20260515T082629_catalog_attribute_mass_editable.js.map +0 -1
  562. package/dist/migrations/20260526T124736_catalog_product_status_inactive.d.ts.map +0 -1
  563. package/dist/migrations/20260526T124736_catalog_product_status_inactive.js.map +0 -1
  564. package/dist/migrations/20260611T140346_catalog_product_value_overrides_init.d.ts.map +0 -1
  565. package/dist/migrations/20260611T140346_catalog_product_value_overrides_init.js.map +0 -1
  566. package/dist/migrations/20260611T140400_catalog_attribute_quick_searchable.d.ts.map +0 -1
  567. package/dist/migrations/20260611T140400_catalog_attribute_quick_searchable.js.map +0 -1
  568. package/dist/migrations/20260611T140407_catalog_bulk_operations.d.ts.map +0 -1
  569. package/dist/migrations/20260611T140407_catalog_bulk_operations.js.map +0 -1
  570. package/dist/migrations/20260611T140408_catalog_bulk_operation_logs.d.ts.map +0 -1
  571. package/dist/migrations/20260611T140408_catalog_bulk_operation_logs.js.map +0 -1
  572. package/dist/migrations/20260611T140412_catalog_product_packaging_units.d.ts.map +0 -1
  573. package/dist/migrations/20260611T140412_catalog_product_packaging_units.js.map +0 -1
  574. package/dist/migrations/20260718T060659_catalog_bulk_operation_revert_state.d.ts.map +0 -1
  575. package/dist/migrations/20260718T060659_catalog_bulk_operation_revert_state.js.map +0 -1
  576. package/dist/migrations/20260718T200343_catalog_category_custom_field_values.d.ts.map +0 -1
  577. package/dist/migrations/20260718T200343_catalog_category_custom_field_values.js.map +0 -1
  578. package/dist/migrations/20260723T230401_catalog_attributes_on_custom_fields.d.ts.map +0 -1
  579. package/dist/migrations/20260723T230401_catalog_attributes_on_custom_fields.js.map +0 -1
  580. package/dist/migrations/20260804T152604_catalog_widen_product_sku.d.ts.map +0 -1
  581. package/dist/migrations/20260804T152604_catalog_widen_product_sku.js.map +0 -1
  582. package/dist/migrations/20260804T160244_catalog_category_activation.d.ts.map +0 -1
  583. package/dist/migrations/20260804T160244_catalog_category_activation.js.map +0 -1
  584. package/dist/migrations/20260912T094557_catalog_sales_channel_products.d.ts.map +0 -1
  585. package/dist/migrations/20260912T094557_catalog_sales_channel_products.js.map +0 -1
  586. package/dist/migrations/20260912T094623_catalog_sales_channel_categories.d.ts.map +0 -1
  587. package/dist/migrations/20260912T094623_catalog_sales_channel_categories.js.map +0 -1
  588. package/dist/migrations/20260925T125527_catalog_inventory_columns.d.ts.map +0 -1
  589. package/dist/migrations/20260925T125527_catalog_inventory_columns.js.map +0 -1
  590. package/dist/migrations/20261008T080839_catalog_product_attribute_is_price_rule.d.ts.map +0 -1
  591. package/dist/migrations/20261008T080839_catalog_product_attribute_is_price_rule.js.map +0 -1
  592. package/dist/migrations/20261008T092714_catalog_category_content.d.ts.map +0 -1
  593. package/dist/migrations/20261008T092714_catalog_category_content.js.map +0 -1
  594. package/dist/migrations/20261014T170531_catalog_product_list_saved_views.d.ts.map +0 -1
  595. package/dist/migrations/20261014T170531_catalog_product_list_saved_views.js.map +0 -1
  596. package/dist/migrations/20261016T082008_catalog_order_rules.d.ts.map +0 -1
  597. package/dist/migrations/20261016T082008_catalog_order_rules.js.map +0 -1
  598. package/dist/migrations/20261022T035133_catalog_product_scopes.d.ts.map +0 -1
  599. package/dist/migrations/20261022T035133_catalog_product_scopes.js.map +0 -1
  600. package/dist/migrations/20261022T054223_catalog_product_url_keys.d.ts.map +0 -1
  601. package/dist/migrations/20261022T054223_catalog_product_url_keys.js.map +0 -1
  602. package/dist/migrations/20261022T111811_catalog_price_fields_removed.d.ts.map +0 -1
  603. package/dist/migrations/20261022T111811_catalog_price_fields_removed.js.map +0 -1
  604. package/dist/migrations/20261022T182523_catalog_admin_name_keys.d.ts.map +0 -1
  605. package/dist/migrations/20261022T182523_catalog_admin_name_keys.js.map +0 -1
  606. package/dist/migrations/20261025T222634_catalog_product_status_drop_draft.d.ts.map +0 -1
  607. package/dist/migrations/20261025T222634_catalog_product_status_drop_draft.js.map +0 -1
  608. package/dist/migrations/20261026T033453_catalog_product_media_scopes.d.ts.map +0 -1
  609. package/dist/migrations/20261026T033453_catalog_product_media_scopes.js.map +0 -1
  610. package/dist/migrations/20261026T084533_catalog_attachment_packaging_translations.d.ts.map +0 -1
  611. package/dist/migrations/20261026T084533_catalog_attachment_packaging_translations.js.map +0 -1
  612. package/dist/migrations/index.d.ts.map +0 -1
  613. package/dist/migrations/index.js.map +0 -1
  614. package/dist/ports/index.d.ts.map +0 -1
  615. package/dist/ports/index.js.map +0 -1
@@ -0,0 +1,113 @@
1
+ /**
2
+ * The pure Page Builder helpers the catalogue's content shares between
3
+ * category content (feature `fcf6daa76`) and product content attributes
4
+ * (`specs/172-product-content-attributes/`, research R-2, R-3, R-12).
5
+ *
6
+ * No I/O and no entity: every function here takes plain JSON and answers
7
+ * plain JSON, so the rule each one states has exactly one home.
8
+ */
9
+ /** The ceiling on a summary's excerpt, in characters. */
10
+ export const EXCERPT_MAX_LENGTH = 120;
11
+ /** The block props an excerpt is read from, in order of preference. */
12
+ const TEXT_PROPS = ['text', 'title', 'heading', 'body', 'html'];
13
+ /**
14
+ * Whether a Page Builder document would render anything: a block at the top
15
+ * level, or in a legacy `zones` bucket. An editor that was opened and saved
16
+ * untouched stores a document with neither.
17
+ */
18
+ export function hasPageBuilderBlocks(tree) {
19
+ if (Array.isArray(tree['content']) && tree['content'].length > 0)
20
+ return true;
21
+ const zones = tree['zones'];
22
+ if (zones && typeof zones === 'object') {
23
+ return Object.values(zones).some((zone) => Array.isArray(zone) && zone.length > 0);
24
+ }
25
+ return false;
26
+ }
27
+ /**
28
+ * The envelope as it is stored (FR-013, R-2): a language whose document holds
29
+ * no block is dropped, and an envelope with no language left is `null` — "no
30
+ * value". Normalising once on write means every reader (the card, the delete
31
+ * count, the product page) reads one fact rather than re-deriving it.
32
+ */
33
+ export function normalisePageBuilderEnvelope(envelope) {
34
+ if (envelope === null)
35
+ return null;
36
+ const languages = {};
37
+ for (const [language, document] of Object.entries(envelope.languages)) {
38
+ if (hasPageBuilderBlocks(document))
39
+ languages[language] = document;
40
+ }
41
+ return Object.keys(languages).length > 0 ? { languages } : null;
42
+ }
43
+ /** Tags stripped and whitespace folded — what an excerpt reads as. */
44
+ function plainText(value) {
45
+ return value
46
+ .replace(/<[^>]*>/g, ' ')
47
+ .replace(/\s+/g, ' ')
48
+ .trim();
49
+ }
50
+ /** The first non-empty text of one block's props, in {@link TEXT_PROPS} order. */
51
+ function blockText(block) {
52
+ if (!block || typeof block !== 'object')
53
+ return null;
54
+ const props = block.props;
55
+ if (!props || typeof props !== 'object')
56
+ return null;
57
+ for (const name of TEXT_PROPS) {
58
+ const value = props[name];
59
+ if (typeof value !== 'string')
60
+ continue;
61
+ const text = plainText(value);
62
+ if (text.length > 0)
63
+ return text;
64
+ }
65
+ return null;
66
+ }
67
+ /**
68
+ * One language's summary (R-3): the top-level block count, and the first text
69
+ * a top-level block carries. The "first text" rule is per block shape, which
70
+ * is why it lives here and not in a jsonpath.
71
+ */
72
+ export function summarisePageBuilderDocument(document) {
73
+ const content = Array.isArray(document['content']) ? document['content'] : [];
74
+ let excerpt = null;
75
+ for (const block of content) {
76
+ const text = blockText(block);
77
+ if (text !== null) {
78
+ excerpt = text.slice(0, EXCERPT_MAX_LENGTH);
79
+ break;
80
+ }
81
+ }
82
+ return { blocks: content.length, excerpt };
83
+ }
84
+ /** The UTF-8 byte length of the envelope's JSON — what the 1 MiB ceiling is measured in (FR-012). */
85
+ export function pageBuilderEnvelopeBytes(envelope) {
86
+ return Buffer.byteLength(JSON.stringify(envelope), 'utf8');
87
+ }
88
+ /**
89
+ * The language a reader is shown (FR-033, R-12), shared by category and product
90
+ * content: the caller's, then the channel's default, then `en-US`, then `en`,
91
+ * then any stored language. A language whose document holds no block is
92
+ * skipped, because an operator who saved the Polish tab empty did not ask for
93
+ * the English text to disappear from the Polish storefront. `null` when no
94
+ * language holds a block.
95
+ */
96
+ export function resolvePageBuilderLanguage(languages, ctx) {
97
+ const candidates = [
98
+ ctx.preferredLanguage,
99
+ ctx.resolvedChannel.defaultLanguage,
100
+ 'en-US',
101
+ 'en',
102
+ ...Object.keys(languages),
103
+ ].filter((value) => typeof value === 'string');
104
+ for (const language of candidates) {
105
+ if (!Object.hasOwn(languages, language))
106
+ continue;
107
+ const document = languages[language];
108
+ if (document !== undefined && hasPageBuilderBlocks(document))
109
+ return { language, document };
110
+ }
111
+ return null;
112
+ }
113
+ //# sourceMappingURL=page-builder-content.js.map
@@ -6,5 +6,10 @@ export declare function resolvePrimaryAssetUrls(em: EntityManager, assets: Asset
6
6
  * items are skipped and its own role holders replace the global ones
7
7
  * (`effectiveGallery`). `null` = the global gallery (no channel to ask about).
8
8
  */
9
- channelId: string | null): Promise<Map<string, string | null>>;
9
+ channelId: string | null,
10
+ /**
11
+ * Feature 174 — the card's scope language: with it, the C×L → C → G chain of each item's
12
+ * `hidden` flag and each role; `null` = the Channel level.
13
+ */
14
+ languageCode?: string | null): Promise<Map<string, string | null>>;
10
15
  //# sourceMappingURL=primary-asset-url.d.ts.map
@@ -1,11 +1,16 @@
1
- import { effectiveGallery, loadGalleryChannelOverrides } from './gallery-scopes.js';
1
+ import { effectiveGallery, loadGalleryScopes } from './gallery-scopes.js';
2
2
  export async function resolvePrimaryAssetUrls(em, assets, productIds,
3
3
  /**
4
4
  * Feature 163 (FR-076, R14) — the sales channel the card is shown in: its hidden
5
5
  * items are skipped and its own role holders replace the global ones
6
6
  * (`effectiveGallery`). `null` = the global gallery (no channel to ask about).
7
7
  */
8
- channelId) {
8
+ channelId,
9
+ /**
10
+ * Feature 174 — the card's scope language: with it, the C×L → C → G chain of each item's
11
+ * `hidden` flag and each role; `null` = the Channel level.
12
+ */
13
+ languageCode = null) {
9
14
  const result = new Map();
10
15
  for (const id of productIds)
11
16
  result.set(id, null);
@@ -20,9 +25,9 @@ channelId) {
20
25
  left join gallery_item_labels gil on gil.gallery_item_id = gi.id
21
26
  where gi.product_id in (${ids.map(() => '?').join(',')})
22
27
  order by gi.product_id, gi.position asc, gi.id asc`, ids);
23
- // Only a page with a gallery asks about the channel's overrides of it.
28
+ // Only a page with a gallery asks about the scope's overrides of it.
24
29
  const overrides = galleryRows.length > 0
25
- ? await loadGalleryChannelOverrides(em, [...new Set(galleryRows.map((row) => row.product_id))], channelId)
30
+ ? await loadGalleryScopes(em, [...new Set(galleryRows.map((row) => row.product_id))], { channelId, languageCode })
26
31
  : new Map();
27
32
  // One product's items in gallery order, each with its global labels.
28
33
  const itemsByProduct = new Map();
@@ -1,5 +1,5 @@
1
1
  import type { EntityManager } from '@mikro-orm/postgresql';
2
- import { type CatalogProductAvailabilityPort, type ChannelAvailability, type ProductAudience, type ProductAvailabilityScope, type ProductChannelLanguageScopeRecord, type ProductChannelScopeRecord, type ProductGlobalScopeFields, type ProductScopeStatus, type ProductVisibility, type ScopeChannel, toScopeChannel } from '@endora-commerce/contracts';
2
+ import { type CatalogProductAvailabilityPort, type EffectiveProductTexts, type ChannelAvailability, type ProductAudience, type ProductAvailabilityScope, type ProductChannelLanguageScopeRecord, type ProductChannelScopeRecord, type ProductGlobalScopeFields, type ProductScopeStatus, type ProductVisibility, type ScopeChannel, toScopeChannel } from '@endora-commerce/contracts';
3
3
  import type { SalesChannelMembershipPort, SalesChannelResolutionPort } from '@endora-commerce/platform/kernel';
4
4
  /**
5
5
  * Feature 163 — `catalogProductAvailabilityPort` (`contracts/product-scopes.md`
@@ -67,10 +67,23 @@ export declare class ProductAvailabilityService implements CatalogProductAvailab
67
67
  scopeChannel(channelId: string): Promise<ScopeChannel | null>;
68
68
  filterAvailable(productIds: readonly string[], scope: ProductAvailabilityScope): Promise<Set<string>>;
69
69
  describeChannelAvailability(productIds: readonly string[], channelId: string): Promise<Map<string, ChannelAvailability>>;
70
- effectiveNames(productIds: readonly string[], scope: {
70
+ /**
71
+ * Feature 174 (`contracts/readers.md` §2) — the effective name and description at (C, L) along
72
+ * C×L → C → Global. `languageCode` `null` = the channel's default language (an operator, N2). An
73
+ * unknown channel answers the Global texts.
74
+ */
75
+ effectiveTexts(productIds: readonly string[], scope: {
71
76
  channelId: string;
72
77
  languageCode: string | null;
73
- }): Promise<Map<string, string>>;
78
+ }): Promise<Map<string, EffectiveProductTexts>>;
79
+ /**
80
+ * Feature 174 — the effective packaging-unit name per unit id at (C, L); `null` = an empty
81
+ * override (nothing shown). An id no unit has is absent.
82
+ */
83
+ effectivePackagingUnitNames(unitIds: readonly string[], scope: {
84
+ channelId: string;
85
+ languageCode: string | null;
86
+ }): Promise<Map<string, string | null>>;
74
87
  effectiveOrderRules(productIds: readonly string[], channelId: string): Promise<Map<string, {
75
88
  minOrderQuantity: number | null;
76
89
  returnable: boolean;
@@ -1,4 +1,4 @@
1
- import { effectiveAudience, effectiveOrderRules, effectiveStatus, effectiveSystemText, effectiveWindow, isOn, isProductEffectivelyAvailable, overrideLanguages, toScopeChannel, } from '@endora-commerce/contracts';
1
+ import { effectiveAudience, effectiveOrderRules, effectiveStatus, effectiveSystemText, effectiveWindow, isOn, isProductEffectivelyAvailable, resolveScopeLanguage, resolveScoped, sameLanguage, toScopeChannel, } from '@endora-commerce/contracts';
2
2
  import { Product } from '../entities/product.entity.js';
3
3
  import { ProductChannelScope } from '../entities/product-channel-scope.entity.js';
4
4
  import { ProductChannelLanguageScope } from '../entities/product-channel-language-scope.entity.js';
@@ -31,6 +31,7 @@ function toChannelRecord(row) {
31
31
  audience: row.visibility !== null && row.visibility !== undefined
32
32
  ? { visibility: row.visibility, allowedOrganizationIds: row.allowedOrganizationIds ?? [] }
33
33
  : null,
34
+ minOrderQuantityOverridden: row.minOrderQuantityOverridden,
34
35
  minOrderQuantity: row.minOrderQuantity ?? null,
35
36
  returnable: row.returnable ?? null,
36
37
  };
@@ -113,16 +114,6 @@ const SCOPED_PRODUCT_FIELDS = [
113
114
  'minOrderQuantity',
114
115
  'returnable',
115
116
  ];
116
- /** The baseline name pick of the storefront reads: L → channel default → `en-US` → `en` → first key. */
117
- function pickName(blob, languages) {
118
- for (const language of languages) {
119
- const hit = blob[language];
120
- if (hit)
121
- return hit;
122
- }
123
- const first = Object.keys(blob)[0];
124
- return first ? (blob[first] ?? '') : '';
125
- }
126
117
  export class ProductAvailabilityService {
127
118
  emFactory;
128
119
  membership;
@@ -186,23 +177,69 @@ export class ProductAvailabilityService {
186
177
  }
187
178
  return out;
188
179
  }
189
- async effectiveNames(productIds, scope) {
180
+ /**
181
+ * Feature 174 (`contracts/readers.md` §2) — the effective name and description at (C, L) along
182
+ * C×L → C → Global. `languageCode` `null` = the channel's default language (an operator, N2). An
183
+ * unknown channel answers the Global texts.
184
+ */
185
+ async effectiveTexts(productIds, scope) {
190
186
  const out = new Map();
191
187
  const ids = [...new Set(productIds)];
192
188
  if (ids.length === 0)
193
189
  return out;
194
190
  const channel = await this.scopeChannel(scope.channelId);
195
191
  const em = this.emFactory();
196
- const products = await inIdChunks(ids, (chunk) => em.find(Product, { id: { $in: chunk } }, { fields: ['id', 'name'] }));
197
- const languages = overrideLanguages(scope.languageCode ?? undefined, channel?.defaultLanguage);
198
- const overrides = channel
199
- ? await loadChannelOverridesByProduct(em, ids, channel.id)
200
- : new Map();
192
+ const products = await inIdChunks(ids, (chunk) => em.find(Product, { id: { $in: chunk } }, { fields: ['id', 'name', 'description'] }));
193
+ const overrides = channel ? await loadChannelOverridesByProduct(em, ids, channel.id) : new Map();
194
+ const ctx = channel
195
+ ? { channelId: channel.id, languageCode: resolveScopeLanguage(channel, scope.languageCode) }
196
+ : null;
201
197
  for (const product of products) {
202
- const baseline = product.name ?? {};
203
- out.set(product.id, channel
204
- ? effectiveSystemText(overrides.get(product.id), 'name', { channelId: channel.id, languages }, baseline, pickName(baseline, languages))
205
- : pickName(baseline, languages));
198
+ const rows = overrides.get(product.id);
199
+ out.set(product.id, {
200
+ name: ctx ? (effectiveSystemText(rows, 'name', ctx, product.name) ?? '') : product.name,
201
+ description: ctx ? effectiveSystemText(rows, 'description', ctx, product.description) : product.description,
202
+ });
203
+ }
204
+ return out;
205
+ }
206
+ /**
207
+ * Feature 174 — the effective packaging-unit name per unit id at (C, L); `null` = an empty
208
+ * override (nothing shown). An id no unit has is absent.
209
+ */
210
+ async effectivePackagingUnitNames(unitIds, scope) {
211
+ const out = new Map();
212
+ const ids = [...new Set(unitIds)];
213
+ if (ids.length === 0)
214
+ return out;
215
+ const channel = await this.scopeChannel(scope.channelId);
216
+ const em = this.emFactory();
217
+ const units = await em.execute(`select id::text as id, name from product_packaging_units where id = any(?::uuid[])`, [uuidArrayLiteral(ids)]);
218
+ const rows = channel
219
+ ? await em.execute(`select packaging_unit_id::text as packaging_unit_id, language_code, value
220
+ from product_packaging_unit_scope_overrides
221
+ where packaging_unit_id = any(?::uuid[]) and sales_channel_id = ? and field = 'name'`, [uuidArrayLiteral(ids), channel.id])
222
+ : [];
223
+ const languageCode = channel ? resolveScopeLanguage(channel, scope.languageCode) : null;
224
+ for (const unit of units) {
225
+ if (!channel || languageCode === null) {
226
+ out.set(unit.id, unit.name);
227
+ continue;
228
+ }
229
+ const resolved = resolveScoped({
230
+ global: unit.name,
231
+ rows: rows
232
+ .filter((row) => row.packaging_unit_id === unit.id)
233
+ .filter((row) => row.language_code === null || sameLanguage(row.language_code, languageCode))
234
+ .map((row) => ({
235
+ channelId: channel.id,
236
+ languageCode: row.language_code,
237
+ value: typeof row.value?.v === 'string' ? { kind: 'value', value: row.value.v } : { kind: 'empty' },
238
+ })),
239
+ scope: { level: 'channel_language', channelId: channel.id, languageCode },
240
+ levels: ['G', 'C', 'CL'],
241
+ });
242
+ out.set(unit.id, resolved.value);
206
243
  }
207
244
  return out;
208
245
  }
@@ -0,0 +1,62 @@
1
+ import type { EntityManager } from '@mikro-orm/postgresql';
2
+ import { type AdminProductContent, type AdminProductContentLanguageStatus, type AdminProductContentList, type ProductContentEnvelope } from '@endora-commerce/contracts';
3
+ import type { CommandBus } from '@endora-commerce/platform/commands';
4
+ import type { CatalogAttributeView } from './catalog-attribute-read.service.js';
5
+ import { type PageBuilderDocumentSummary } from './page-builder-content.js';
6
+ /**
7
+ * A product's Page Builder content attributes in the admin (feature 172,
8
+ * `specs/172-product-content-attributes/` contracts/admin-api.md §4–§5,
9
+ * research R-8, R-16).
10
+ *
11
+ * The content a product carries is the rows of `product_content_values` whose
12
+ * attribute is a `page_builder` member of the product's **current** set. A row
13
+ * whose attribute left the set is kept and invisible to every read here
14
+ * (FR-061); a soft-deleted product's rows are kept and unreachable (FR-062,
15
+ * OR-6). Not gated on the CMS: the card shows its status with the CMS off
16
+ * (FR-050) — only the editing canvas is the CMS's.
17
+ */
18
+ /** One `attribute_set_attributes` row, as the membership read answers it. */
19
+ export interface SetMemberRow {
20
+ custom_field_definition_id: string;
21
+ position: number;
22
+ }
23
+ /** A content attribute of the product's set. */
24
+ export interface ContentAttributeMember {
25
+ /** `product_attributes.id`. */
26
+ attributeId: string;
27
+ key: string;
28
+ label: Record<string, string>;
29
+ labelDefault: string;
30
+ position: number;
31
+ }
32
+ /**
33
+ * The `page_builder` members of a set, by position then key (FR-020, FR-030).
34
+ * Membership is definition-keyed (feature 061); the identity comes from the
35
+ * composed attribute view.
36
+ */
37
+ export declare function contentAttributeMembers(rows: readonly SetMemberRow[], views: readonly CatalogAttributeView[]): ContentAttributeMember[];
38
+ /** The stored languages of one value, as the card shows them — never the document. */
39
+ export declare function languageStatuses(summary: Readonly<Record<string, PageBuilderDocumentSummary>> | undefined): AdminProductContentLanguageStatus[];
40
+ /** The attribute read this service needs — the composed view of every product attribute. */
41
+ export interface ProductContentAttributeRead {
42
+ listAll(): Promise<CatalogAttributeView[]>;
43
+ }
44
+ export declare class ProductContentService {
45
+ #private;
46
+ private readonly emFactory;
47
+ private readonly commandBus;
48
+ private readonly attributeRead;
49
+ constructor(emFactory: () => EntityManager, commandBus: CommandBus, attributeRead: ProductContentAttributeRead);
50
+ /** `GET …/products/:id/content` — the cards: summaries only (research R-3). */
51
+ list(productId: string): Promise<AdminProductContentList>;
52
+ /** `GET …/products/:id/content/:attributeKey` — one envelope, `null` when none is stored. */
53
+ get(productId: string, attributeKey: string): Promise<AdminProductContent>;
54
+ /**
55
+ * `PUT …/products/:id/content/:attributeKey` — replace one value: normalise
56
+ * (FR-013), hold to the ceiling (FR-012), and write through the audited
57
+ * Command `product.content.update`. `null`, or no language with a block,
58
+ * removes the value.
59
+ */
60
+ replace(productId: string, attributeKey: string, content: ProductContentEnvelope): Promise<AdminProductContent>;
61
+ }
62
+ //# sourceMappingURL=product-content.service.d.ts.map
@@ -0,0 +1,122 @@
1
+ import { ERROR_CODES, PAGE_BUILDER_CONTENT_MAX_BYTES, uuidSchema, isUuidShape, } from '@endora-commerce/contracts';
2
+ import { HttpError } from '@endora-commerce/platform/http';
3
+ import { updateProductContentCommand } from '../commands/product-content-commands.js';
4
+ import { Product } from '../entities/product.entity.js';
5
+ import { ProductContentValue } from '../entities/product-content-value.entity.js';
6
+ import { normalisePageBuilderEnvelope, pageBuilderEnvelopeBytes, } from './page-builder-content.js';
7
+ /**
8
+ * The `page_builder` members of a set, by position then key (FR-020, FR-030).
9
+ * Membership is definition-keyed (feature 061); the identity comes from the
10
+ * composed attribute view.
11
+ */
12
+ export function contentAttributeMembers(rows, views) {
13
+ const byDefinition = new Map(views.map((view) => [view.customFieldDefinitionId, view]));
14
+ const members = [];
15
+ for (const row of rows) {
16
+ const view = byDefinition.get(row.custom_field_definition_id);
17
+ if (!view || view.valueType !== 'page_builder')
18
+ continue;
19
+ members.push({
20
+ attributeId: view.id,
21
+ key: view.key,
22
+ label: view.label,
23
+ labelDefault: view.labelDefault,
24
+ position: row.position,
25
+ });
26
+ }
27
+ return members.sort((a, b) => a.position - b.position || a.key.localeCompare(b.key));
28
+ }
29
+ /** The stored languages of one value, as the card shows them — never the document. */
30
+ export function languageStatuses(summary) {
31
+ return Object.entries(summary ?? {})
32
+ .sort(([a], [b]) => a.localeCompare(b))
33
+ .map(([language, entry]) => ({ language, filled: true, blocks: entry.blocks, excerpt: entry.excerpt }));
34
+ }
35
+ export class ProductContentService {
36
+ emFactory;
37
+ commandBus;
38
+ attributeRead;
39
+ constructor(emFactory, commandBus, attributeRead) {
40
+ this.emFactory = emFactory;
41
+ this.commandBus = commandBus;
42
+ this.attributeRead = attributeRead;
43
+ }
44
+ /** `GET …/products/:id/content` — the cards: summaries only (research R-3). */
45
+ async list(productId) {
46
+ const em = this.emFactory();
47
+ const product = await this.#product(em, productId);
48
+ const members = await this.#members(em, product.attributeSetId);
49
+ const rows = members.length === 0
50
+ ? []
51
+ : await em.find(ProductContentValue, {
52
+ productId,
53
+ productAttributeId: { $in: members.map((member) => member.attributeId) },
54
+ });
55
+ const summaryByAttribute = new Map(rows.map((row) => [row.productAttributeId, row.summary]));
56
+ return {
57
+ productId,
58
+ attributeSetId: product.attributeSetId,
59
+ attributes: members.map((member) => ({
60
+ ...member,
61
+ languages: languageStatuses(summaryByAttribute.get(member.attributeId)),
62
+ })),
63
+ };
64
+ }
65
+ /** `GET …/products/:id/content/:attributeKey` — one envelope, `null` when none is stored. */
66
+ async get(productId, attributeKey) {
67
+ const em = this.emFactory();
68
+ const product = await this.#product(em, productId);
69
+ const member = (await this.#members(em, product.attributeSetId)).find((m) => m.key === attributeKey);
70
+ if (!member) {
71
+ throw new HttpError(404, ERROR_CODES.NOT_FOUND, `"${attributeKey}" is not a Page Builder content attribute of this product's attribute set.`);
72
+ }
73
+ const row = await em.findOne(ProductContentValue, { productId, productAttributeId: member.attributeId }, { populate: ['content'] });
74
+ return { productId, attributeKey, content: row?.content ?? null };
75
+ }
76
+ /**
77
+ * `PUT …/products/:id/content/:attributeKey` — replace one value: normalise
78
+ * (FR-013), hold to the ceiling (FR-012), and write through the audited
79
+ * Command `product.content.update`. `null`, or no language with a block,
80
+ * removes the value.
81
+ */
82
+ async replace(productId, attributeKey, content) {
83
+ const em = this.emFactory();
84
+ const product = await this.#product(em, productId);
85
+ const member = (await this.#members(em, product.attributeSetId)).find((m) => m.key === attributeKey);
86
+ if (!member) {
87
+ throw new HttpError(400, ERROR_CODES.ATTRIBUTE_VALUE_REJECTED, `"${attributeKey}" is not a Page Builder content attribute of this product's attribute set.`, [{ path: 'attributeKey', issue: "not a Page Builder content attribute of this product's attribute set" }]);
88
+ }
89
+ const normalised = normalisePageBuilderEnvelope(content);
90
+ // The route's schema already holds the ceiling; a caller that does not
91
+ // arrive over HTTP is held to it here.
92
+ if (normalised !== null && pageBuilderEnvelopeBytes(normalised) > PAGE_BUILDER_CONTENT_MAX_BYTES) {
93
+ throw new HttpError(400, ERROR_CODES.VALIDATION_FAILED, `Product content must not exceed ${PAGE_BUILDER_CONTENT_MAX_BYTES} bytes.`);
94
+ }
95
+ const stored = await this.commandBus.run(updateProductContentCommand({
96
+ productId,
97
+ productAttributeId: member.attributeId,
98
+ attributeKey,
99
+ content: normalised,
100
+ }));
101
+ return { productId, attributeKey, content: stored };
102
+ }
103
+ async #product(em, productId) {
104
+ // An id that is not a uuid names no product; it must not reach the query.
105
+ if (!uuidSchema.safeParse(productId).success) {
106
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, 'Product not found.');
107
+ }
108
+ if (!isUuidShape(productId))
109
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, 'Product not found.');
110
+ const product = await em.findOne(Product, { id: productId, deletedAt: null }, { fields: ['id', 'attributeSetId'] });
111
+ if (!product)
112
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, 'Product not found.');
113
+ return product;
114
+ }
115
+ async #members(em, attributeSetId) {
116
+ const rows = (await em.execute(`select custom_field_definition_id, position from attribute_set_attributes where attribute_set_id = ?`, [attributeSetId]));
117
+ if (rows.length === 0)
118
+ return [];
119
+ return contentAttributeMembers(rows, await this.attributeRead.listAll());
120
+ }
121
+ }
122
+ //# sourceMappingURL=product-content.service.js.map
@@ -1,5 +1,11 @@
1
1
  import type { EntityManager } from '@mikro-orm/postgresql';
2
2
  import { ProductEditorPreference } from '../entities/product-editor-preference.entity.js';
3
+ /**
4
+ * Feature 174 (C2/C3 security review note) — the admin a preference row belongs to. Without a
5
+ * resolved admin id the call is refused: a shared fallback id would hand every admin the scope
6
+ * another one last chose.
7
+ */
8
+ export declare function preferenceOwner(actorAdminUserId: string | null | undefined): string;
3
9
  /**
4
10
  * Feature 022 — per-(admin user, product) memory of the last
5
11
  * Sales Channel + Language the editor selected on the product edit
@@ -1,4 +1,16 @@
1
+ import { ERROR_CODES } from '@endora-commerce/contracts';
2
+ import { HttpError } from '@endora-commerce/platform/http';
1
3
  import { ProductEditorPreference } from '../entities/product-editor-preference.entity.js';
4
+ /**
5
+ * Feature 174 (C2/C3 security review note) — the admin a preference row belongs to. Without a
6
+ * resolved admin id the call is refused: a shared fallback id would hand every admin the scope
7
+ * another one last chose.
8
+ */
9
+ export function preferenceOwner(actorAdminUserId) {
10
+ if (!actorAdminUserId)
11
+ throw new HttpError(403, ERROR_CODES.FORBIDDEN, 'An editor preference needs a signed-in administrator.');
12
+ return actorAdminUserId;
13
+ }
2
14
  /**
3
15
  * Feature 022 — per-(admin user, product) memory of the last
4
16
  * Sales Channel + Language the editor selected on the product edit
@@ -0,0 +1,39 @@
1
+ import type { EntityManager } from '@mikro-orm/postgresql';
2
+ import type { CatalogAttributeView } from '@endora-commerce/contracts';
3
+ /**
4
+ * The rules a write of a product's Global-only fields holds, whichever route carries it: the
5
+ * product `PATCH` (`CatalogAdminService`) and the scoped save (`product.scoped_values.save`,
6
+ * feature 174, C2/C3 code review 1). Each rule answers what is wrong and leaves the refusal's
7
+ * shape to its caller, because the two routes answer in their own contracts' error shapes. Every
8
+ * query runs on the caller's `em`, inside the caller's transaction.
9
+ */
10
+ /** `products.sku`'s width, and the cap the create contract enforces (feature 068). */
11
+ export declare const PRODUCT_SKU_MAX = 255;
12
+ /** Who already holds a SKU: another product, or a variant (one namespace, feature 025). */
13
+ export type SkuHolder = {
14
+ productId: string;
15
+ } | {
16
+ variantId: string;
17
+ };
18
+ /**
19
+ * The live holder of `sku` other than `productId`, or `null` when it is free. Variants share the
20
+ * namespace and the database does not enforce that, so both tables are read. A deleted product
21
+ * or variant holds nothing (issue #693): its row keeps the SKU, and the SKU is free for reuse.
22
+ */
23
+ export declare function findSkuHolder(em: EntityManager, productId: string, sku: string): Promise<SkuHolder | null>;
24
+ /** Whether an attribute set exists. */
25
+ export declare function attributeSetExists(em: EntityManager, attributeSetId: string): Promise<boolean>;
26
+ /** The ids among `categoryIds` that name no category, or a deleted one. */
27
+ export declare function missingCategoryIds(em: EntityManager, categoryIds: readonly string[]): Promise<string[]>;
28
+ /**
29
+ * The keys of the set's required attributes that `values` leaves without a value (feature 012,
30
+ * FR-013): absent, `null` and `''` count as no value.
31
+ */
32
+ export declare function missingRequiredAttributeKeys(setAttributes: Iterable<CatalogAttributeView>, values: Readonly<Record<string, unknown>>): string[];
33
+ /**
34
+ * Makes `product_categories` hold exactly `categoryIds` for one product: the current rows are
35
+ * read and only the difference is deleted or inserted. Returns whether anything was written. A
36
+ * repeated id is one membership (the bridge's primary key is the pair).
37
+ */
38
+ export declare function reconcileProductCategories(em: EntityManager, productId: string, categoryIds: readonly string[]): Promise<boolean>;
39
+ //# sourceMappingURL=product-global-field-rules.d.ts.map
@@ -0,0 +1,84 @@
1
+ import { Product } from '../entities/product.entity.js';
2
+ import { ProductVariant } from '../entities/product-variant.entity.js';
3
+ /**
4
+ * The rules a write of a product's Global-only fields holds, whichever route carries it: the
5
+ * product `PATCH` (`CatalogAdminService`) and the scoped save (`product.scoped_values.save`,
6
+ * feature 174, C2/C3 code review 1). Each rule answers what is wrong and leaves the refusal's
7
+ * shape to its caller, because the two routes answer in their own contracts' error shapes. Every
8
+ * query runs on the caller's `em`, inside the caller's transaction.
9
+ */
10
+ /** `products.sku`'s width, and the cap the create contract enforces (feature 068). */
11
+ export const PRODUCT_SKU_MAX = 255;
12
+ /**
13
+ * The live holder of `sku` other than `productId`, or `null` when it is free. Variants share the
14
+ * namespace and the database does not enforce that, so both tables are read. A deleted product
15
+ * or variant holds nothing (issue #693): its row keeps the SKU, and the SKU is free for reuse.
16
+ */
17
+ export async function findSkuHolder(em, productId, sku) {
18
+ const product = await em.findOne(Product, { sku, id: { $ne: productId }, deletedAt: null }, { fields: ['id'] });
19
+ if (product)
20
+ return { productId: product.id };
21
+ const variant = await em.findOne(ProductVariant, { sku, deletedAt: null }, { fields: ['id'] });
22
+ if (variant)
23
+ return { variantId: variant.id };
24
+ return null;
25
+ }
26
+ /** Whether an attribute set exists. */
27
+ export async function attributeSetExists(em, attributeSetId) {
28
+ const rows = await em.execute(`select id from attribute_sets where id = ?`, [attributeSetId]);
29
+ return rows.length > 0;
30
+ }
31
+ /** The ids among `categoryIds` that name no category, or a deleted one. */
32
+ export async function missingCategoryIds(em, categoryIds) {
33
+ const ids = [...new Set(categoryIds)];
34
+ if (ids.length === 0)
35
+ return [];
36
+ const rows = await em.execute(`select id::text as id from categories where deleted_at is null and id in (${ids.map(() => '?').join(', ')})`, ids);
37
+ const found = new Set(rows.map((row) => row.id));
38
+ return ids.filter((id) => !found.has(id));
39
+ }
40
+ /**
41
+ * The keys of the set's required attributes that `values` leaves without a value (feature 012,
42
+ * FR-013): absent, `null` and `''` count as no value.
43
+ */
44
+ export function missingRequiredAttributeKeys(setAttributes, values) {
45
+ const missing = [];
46
+ for (const view of setAttributes) {
47
+ if (!view.isRequired)
48
+ continue;
49
+ const value = values[view.key];
50
+ if (value === undefined || value === null || value === '')
51
+ missing.push(view.key);
52
+ }
53
+ return missing;
54
+ }
55
+ /**
56
+ * Makes `product_categories` hold exactly `categoryIds` for one product: the current rows are
57
+ * read and only the difference is deleted or inserted. Returns whether anything was written. A
58
+ * repeated id is one membership (the bridge's primary key is the pair).
59
+ */
60
+ export async function reconcileProductCategories(em, productId, categoryIds) {
61
+ // Runs only inside a caller's Command (`product.create`, `product.update`,
62
+ // `product.scoped_values.save`) on that Command's `em`.
63
+ const conn = em.getConnection();
64
+ const txCtx = em.getTransactionContext();
65
+ const currentRows = (await conn.execute(`select category_id from product_categories where product_id = ?`, [productId], 'all', txCtx));
66
+ const current = new Set(currentRows.map((r) => r.category_id));
67
+ const target = new Set(categoryIds);
68
+ const toAdd = [...target].filter((id) => !current.has(id));
69
+ const toRemove = [...current].filter((id) => !target.has(id));
70
+ if (toRemove.length > 0) {
71
+ const placeholders = toRemove.map(() => '?').join(',');
72
+ await conn.execute(`delete from product_categories where product_id = ? and category_id in (${placeholders})`, [productId, ...toRemove], 'run', txCtx);
73
+ }
74
+ if (toAdd.length > 0) {
75
+ const placeholders = toAdd.map(() => '(?,?)').join(',');
76
+ const params = [];
77
+ for (const cid of toAdd) {
78
+ params.push(productId, cid);
79
+ }
80
+ await conn.execute(`insert into product_categories (product_id, category_id) values ${placeholders}`, params, 'run', txCtx);
81
+ }
82
+ return toAdd.length > 0 || toRemove.length > 0;
83
+ }
84
+ //# sourceMappingURL=product-global-field-rules.js.map