@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
@@ -12,10 +12,8 @@
12
12
  */
13
13
  import { randomUUID } from 'node:crypto';
14
14
  import { LockMode } from '@mikro-orm/core';
15
- import { ERROR_CODES, applyTranslationPatch, } from '@endora-commerce/contracts';
15
+ import { ERROR_CODES, isUuidShape, } from '@endora-commerce/contracts';
16
16
  import { HttpError } from '@endora-commerce/platform/http';
17
- import { loadChannelRoles, loadHiddenChannelsByItem, writeGalleryChannelRole, writeGalleryHiddenChannels, } from './gallery-scopes.js';
18
- import { assertProductChannelMembers } from './attachment-packaging-scopes.js';
19
17
  import { requireLinkableAsset } from './linkable-asset.js';
20
18
  import { Product } from '../entities/product.entity.js';
21
19
  import { GalleryItem } from '../entities/gallery-item.entity.js';
@@ -30,7 +28,6 @@ export class GalleryService {
30
28
  emFactory;
31
29
  commandBus;
32
30
  assets;
33
- membership;
34
31
  constructor(emFactory,
35
32
  /** Feature 054 — audits gallery-item writes co-transactionally when provided. */
36
33
  commandBus,
@@ -42,14 +39,14 @@ export class GalleryService {
42
39
  */
43
40
  assets,
44
41
  /**
45
- * Feature 163 (FR-014) — which channels the product is a member of: an image may be
46
- * hidden, or a role given, only in one of them. Removing an override never asks.
42
+ * Feature 163 (FR-014) — which channels the product is a member of. Unused since feature 174
43
+ * retired the per-channel media writes on this route; kept so the composition root's
44
+ * signature does not move before T041 rewrites the service.
47
45
  */
48
- membership) {
46
+ _membership) {
49
47
  this.emFactory = emFactory;
50
48
  this.commandBus = commandBus;
51
49
  this.assets = assets;
52
- this.membership = membership;
53
50
  }
54
51
  #requireAssets() {
55
52
  if (!this.assets) {
@@ -77,64 +74,8 @@ export class GalleryService {
77
74
  await this.#assertProductExists(em, productId);
78
75
  return this.#fetchAllForProduct(em, productId);
79
76
  }
80
- /**
81
- * Feature 163 (FR-076) — `GET …/gallery/channel-roles`: every channel holding a role
82
- * override for the product, sorted by channel id; a role without one is `null`.
83
- */
84
- async listChannelRoles(productId) {
85
- const em = this.emFactory();
86
- await this.#assertProductExists(em, productId);
87
- const byChannel = await loadChannelRoles(em, productId);
88
- return [...byChannel].map(([channelId, roles]) => channelRolesDto(channelId, roles));
89
- }
90
- /**
91
- * Feature 163 (FR-076, `contracts/seo-media-attachments.md` §2) — `PUT
92
- * …/gallery/channel-roles`: the Command `product.media.update`. A role named with an
93
- * item moves to it in the channel (the item must be the product's, the channel one
94
- * the product is a member of); `null` returns the role to the global holder (always
95
- * allowed, FR-015); an absent role is untouched. One audit entry with the channel's
96
- * three roles before and after; `product.updated.v1` `['media']` after commit; a
97
- * request that changes nothing writes and announces nothing.
98
- */
99
- async putChannelRoles(productId, req) {
100
- const channelId = req.channelId;
101
- const requested = ROLE_KEYS.flatMap(([key, label]) => {
102
- const itemId = req.roles[key];
103
- return itemId === undefined ? [] : [[label, itemId]];
104
- });
105
- await this.#runMediaCommand(productId, async (em) => {
106
- const current = (await loadChannelRoles(em, productId)).get(channelId) ?? new Map();
107
- const before = channelRolesDto(channelId, current);
108
- const next = new Map(current);
109
- for (const [label, itemId] of requested) {
110
- if (itemId === null)
111
- next.delete(label);
112
- else
113
- next.set(label, itemId);
114
- }
115
- const after = channelRolesDto(channelId, next);
116
- if (sameRoles(before.roles, after.roles))
117
- return null;
118
- const named = requested.flatMap(([, itemId]) => (itemId === null ? [] : [itemId]));
119
- if (named.length > 0) {
120
- await this.#assertMembers(productId, [channelId]);
121
- const owned = await em.find(GalleryItem, { id: { $in: named }, productId });
122
- const ownedIds = new Set(owned.map((item) => item.id));
123
- const foreign = named.find((itemId) => !ownedIds.has(itemId));
124
- if (foreign !== undefined) {
125
- throw new HttpError(404, ERROR_CODES.GALLERY_ITEM_NOT_FOUND, `Gallery item ${foreign} not found under Product ${productId}.`);
126
- }
127
- }
128
- for (const [label, itemId] of requested) {
129
- if ((current.get(label) ?? null) === itemId)
130
- continue;
131
- await writeGalleryChannelRole(em, productId, channelId, label, itemId);
132
- }
133
- return { before, after };
134
- });
135
- const roles = (await loadChannelRoles(this.emFactory(), productId)).get(channelId) ?? new Map();
136
- return channelRolesDto(channelId, roles);
137
- }
77
+ // Feature 174 (`contracts/scoped-values-api.md` §6) — 163's `GET` / `PUT …/gallery/channel-roles`
78
+ // are retired: a role at C or C×L is the scoped field `galleryRole:<label>` of the save Command.
138
79
  /**
139
80
  * Feature 075 / D-87 — the batch half of {@link list}, for the callers that
140
81
  * walk a page or a whole sellable catalogue.
@@ -153,16 +94,11 @@ export class GalleryService {
153
94
  * Feature 163 (FR-076, owner decision MED-1 = A) — `channelId` is the feed's channel:
154
95
  * an item hidden there is left out, in the same statement. `null` = the global gallery.
155
96
  */
156
- async listForProducts(productIds, channelId) {
97
+ async listForProducts(productIds, channelId, languageCode = null) {
157
98
  if (productIds.length === 0)
158
99
  return [];
159
100
  const ids = [...new Set(productIds)];
160
- const hiddenInChannel = channelId === null
161
- ? ''
162
- : `and not exists (
163
- select 1 from gallery_item_channel_hidden h
164
- where h.gallery_item_id = gi.id and h.sales_channel_id = ?
165
- )`;
101
+ const hidden = effectiveHiddenSql('gi.id', 'gi.hidden', channelId);
166
102
  // `em.execute`, not `em.getConnection().execute`, so a caller that opens a
167
103
  // transaction around this read sees its own uncommitted writes (issue #200).
168
104
  const rows = await this.emFactory().execute(`select gi.product_id::text as product_id,
@@ -170,8 +106,8 @@ export class GalleryService {
170
106
  gi.position
171
107
  from gallery_items gi
172
108
  where gi.product_id in (${ids.map(() => '?').join(',')})
173
- ${hiddenInChannel}
174
- order by gi.product_id, gi.position asc, gi.id asc`, channelId === null ? ids : [...ids, channelId]);
109
+ and not ${hidden.sql}
110
+ order by gi.product_id, gi.position asc, gi.id asc`, [...ids, ...hidden.params(channelId, languageCode)]);
175
111
  return rows.map((row) => ({
176
112
  productId: row.product_id,
177
113
  assetId: row.asset_id,
@@ -204,7 +140,7 @@ export class GalleryService {
204
140
  * holder is hidden there (`effectiveGallery`'s rule, in one statement). `null` = the
205
141
  * global holder.
206
142
  */
207
- async baseImageUrls(productIds, channelId) {
143
+ async baseImageUrls(productIds, channelId, languageCode = null) {
208
144
  const urlByProduct = new Map();
209
145
  for (const id of productIds)
210
146
  urlByProduct.set(id, null);
@@ -212,32 +148,37 @@ export class GalleryService {
212
148
  return urlByProduct;
213
149
  const ids = [...urlByProduct.keys()];
214
150
  const placeholders = ids.map(() => '?').join(',');
151
+ const hidden = effectiveHiddenSql('gi.id', 'gi.hidden', channelId);
152
+ // Feature 174 (`data-model.md` §6b) — the holder at (C, L): the C×L row, else the C row
153
+ // (an override with `gallery_item_id null` = no image holds the role), else the Global
154
+ // label; then none when that holder is effectively hidden there.
215
155
  const rows = await this.emFactory().execute(channelId === null
216
156
  ? `select gil.product_id::text as product_id, gi.asset_id::text as asset_id
217
157
  from gallery_item_labels gil
218
158
  join gallery_items gi on gi.id = gil.gallery_item_id
219
159
  where gil.label = 'base_image'
220
- and gil.product_id in (${placeholders})`
160
+ and gil.product_id in (${placeholders})
161
+ and not ${hidden.sql}`
221
162
  : `select holder.product_id::text as product_id, gi.asset_id::text as asset_id
222
163
  from (
223
164
  select p.id as product_id,
224
- coalesce(
225
- (select cl.gallery_item_id
226
- from gallery_item_channel_labels cl
227
- join gallery_items ci on ci.id = cl.gallery_item_id and ci.product_id = cl.product_id
228
- where cl.product_id = p.id and cl.sales_channel_id = ? and cl.label = 'base_image'),
229
- (select gil.gallery_item_id
230
- from gallery_item_labels gil
231
- where gil.product_id = p.id and gil.label = 'base_image')
232
- ) as gallery_item_id
165
+ case when ov.found then ov.gallery_item_id else gil.gallery_item_id end as gallery_item_id
233
166
  from products p
167
+ left join lateral (
168
+ select r.gallery_item_id, true as found
169
+ from gallery_role_scope_overrides r
170
+ where r.product_id = p.id and r.label = 'base_image' and r.sales_channel_id = ?
171
+ and (r.language_code is null or lower(r.language_code) = lower(?::text))
172
+ order by (r.language_code is null) asc
173
+ limit 1
174
+ ) ov on true
175
+ left join gallery_item_labels gil on gil.product_id = p.id and gil.label = 'base_image'
234
176
  where p.id in (${placeholders})
235
177
  ) holder
236
- join gallery_items gi on gi.id = holder.gallery_item_id
237
- where not exists (
238
- select 1 from gallery_item_channel_hidden h
239
- where h.gallery_item_id = holder.gallery_item_id and h.sales_channel_id = ?
240
- )`, channelId === null ? ids : [channelId, ...ids, channelId]);
178
+ join gallery_items gi on gi.id = holder.gallery_item_id and gi.product_id = holder.product_id
179
+ where not ${hidden.sql}`, channelId === null
180
+ ? [...ids, ...hidden.params(null, null)]
181
+ : [channelId, languageCode, ...ids, ...hidden.params(channelId, languageCode)]);
241
182
  if (rows.length === 0)
242
183
  return urlByProduct;
243
184
  // One call to the owner for every base image in the batch. `assets_library`
@@ -283,67 +224,20 @@ export class GalleryService {
283
224
  }
284
225
  return (await this.#fetchOne(em, id));
285
226
  }
286
- async update(productId, itemId, req, options) {
287
- if (req.altText !== undefined || req.hiddenInChannels !== undefined || req.labels !== undefined) {
288
- await this.#updateScoped(productId, itemId, req, options);
289
- }
290
- else {
291
- await this.#updatePosition(productId, itemId, req);
292
- }
293
- return (await this.#fetchOne(this.emFactory(), itemId));
294
- }
295
227
  /**
296
- * Feature 163 (FR-076, FR-077) — an item write carrying alt text, the hidden set or
297
- * the labels: the Command `product.media.update` (one audit entry: the item's
298
- * position, alt text, hidden channels and labels before and after),
299
- * `product.updated.v1` `['media']` after commit. A new hidden channel must be one the
300
- * product is a member of (FR-014); removing one never asks (FR-015).
301
- *
302
- * Checkpoint F (B-1) — the labels are replaced on the Command's own `em`, under the
303
- * product row lock and in its transaction, so a label conflict rolls the whole write
304
- * back. With `?replace=true` a label taken from another item is that item's loss: the
305
- * entry restores this item, not the other one's label.
228
+ * Feature 174 (`contracts/scoped-values-api.md` §6) — a collection operation: the item's
229
+ * position (`gallery_item.update`, one audit entry). Roles, alt text and the hidden flag are
230
+ * scoped fields of `PUT …/products/:id/scoped-values`.
306
231
  */
307
- async #updateScoped(productId, itemId, req, options) {
308
- const requestedLabels = req.labels === undefined ? undefined : this.#normalizeAndValidateLabels(req.labels);
309
- await this.#runMediaCommand(productId, async (em) => {
310
- const item = await em.findOne(GalleryItem, { id: itemId, productId });
311
- if (!item) {
312
- throw new HttpError(404, ERROR_CODES.GALLERY_ITEM_NOT_FOUND, `Gallery item ${itemId} not found under Product ${productId}.`);
313
- }
314
- const hiddenBefore = (await loadHiddenChannelsByItem(em, [itemId])).get(itemId) ?? [];
315
- const labelsBefore = (await em.find(GalleryItemLabel, { galleryItemId: itemId })).map((l) => l.label);
316
- const labelsAfter = requestedLabels ?? labelsBefore;
317
- const before = itemProjection(item, hiddenBefore, labelsBefore);
318
- const hiddenAfter = req.hiddenInChannels === undefined ? hiddenBefore : [...new Set(req.hiddenInChannels)].sort();
319
- const added = hiddenAfter.filter((channelId) => !hiddenBefore.includes(channelId));
320
- if (added.length > 0)
321
- await this.#assertMembers(productId, added);
322
- if (req.position !== undefined)
323
- item.position = req.position;
324
- if (req.altText !== undefined)
325
- item.altText = applyTranslationPatch(item.altText, req.altText);
326
- const after = itemProjection(item, hiddenAfter, labelsAfter);
327
- if (JSON.stringify(before) === JSON.stringify(after))
328
- return null;
329
- // Re-sending `before` through the PATCH restores the item exactly (FR-081): a
330
- // language the write added reads `''` there, which removes it again.
331
- withRemovals(before, after);
332
- if (req.hiddenInChannels !== undefined) {
333
- await writeGalleryHiddenChannels(em, productId, itemId, hiddenAfter);
334
- }
335
- if (requestedLabels !== undefined && JSON.stringify(before['labels']) !== JSON.stringify(after['labels'])) {
336
- await em.execute(`delete from gallery_item_labels where gallery_item_id = ?`, [itemId]);
337
- if (requestedLabels.length > 0) {
338
- await this.#applyLabels(em, productId, itemId, requestedLabels, options);
339
- }
340
- }
341
- await em.flush();
342
- return { before, after };
343
- });
232
+ async update(productId, itemId, req) {
233
+ await this.#updatePosition(productId, itemId, req);
234
+ return (await this.#fetchOne(this.emFactory(), itemId));
344
235
  }
345
236
  async #updatePosition(productId, itemId, req) {
346
237
  await this.#audited('gallery_item.update', itemId, async (em) => {
238
+ if (!isUuidShape(itemId) || !isUuidShape(productId)) {
239
+ throw new HttpError(404, ERROR_CODES.GALLERY_ITEM_NOT_FOUND, `Gallery item ${itemId} not found under Product ${productId}.`);
240
+ }
347
241
  const item = await em.findOne(GalleryItem, { id: itemId, productId });
348
242
  if (!item) {
349
243
  throw new HttpError(404, ERROR_CODES.GALLERY_ITEM_NOT_FOUND, `Gallery item ${itemId} not found under Product ${productId}.`);
@@ -356,6 +250,9 @@ export class GalleryService {
356
250
  }
357
251
  async delete(productId, itemId) {
358
252
  await this.#audited('gallery_item.delete', itemId, async (em) => {
253
+ if (!isUuidShape(itemId) || !isUuidShape(productId)) {
254
+ throw new HttpError(404, ERROR_CODES.GALLERY_ITEM_NOT_FOUND, `Gallery item ${itemId} not found under Product ${productId}.`);
255
+ }
359
256
  const item = await em.findOne(GalleryItem, { id: itemId, productId });
360
257
  if (!item) {
361
258
  throw new HttpError(404, ERROR_CODES.GALLERY_ITEM_NOT_FOUND, `Gallery item ${itemId} not found under Product ${productId}.`);
@@ -404,6 +301,9 @@ export class GalleryService {
404
301
  objectType: 'product',
405
302
  objectId: productId,
406
303
  run: async ({ em }) => {
304
+ if (!isUuidShape(productId)) {
305
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product ${productId} not found.`);
306
+ }
407
307
  const product = await em.findOne(Product, { id: productId }, { lockMode: LockMode.PESSIMISTIC_WRITE });
408
308
  if (!product) {
409
309
  throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product ${productId} not found.`);
@@ -440,11 +340,10 @@ export class GalleryService {
440
340
  });
441
341
  });
442
342
  }
443
- /** FR-014 — every channel in `channelIds` is one the product is a member of, else `422 SCOPE_INVALID`. */
444
- async #assertMembers(productId, channelIds) {
445
- await assertProductChannelMembers(this.membership, productId, channelIds);
446
- }
447
343
  async #assertProductExists(em, productId) {
344
+ if (!isUuidShape(productId)) {
345
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product ${productId} not found.`);
346
+ }
448
347
  const product = await em.findOne(Product, { id: productId });
449
348
  if (!product) {
450
349
  throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product ${productId} not found.`);
@@ -510,79 +409,56 @@ export class GalleryService {
510
409
  if (items.length === 0)
511
410
  return [];
512
411
  const labels = await em.find(GalleryItemLabel, { productId });
513
- const hidden = await loadHiddenChannelsByItem(em, items.map((i) => i.id));
514
412
  const labelsByItem = new Map();
515
413
  for (const l of labels) {
516
414
  const existing = labelsByItem.get(l.galleryItemId) ?? [];
517
415
  existing.push(l.label);
518
416
  labelsByItem.set(l.galleryItemId, existing);
519
417
  }
520
- return items.map((i) => this.#toDto(i, labelsByItem.get(i.id) ?? [], hidden.get(i.id) ?? []));
418
+ return items.map((i) => this.#toDto(i, labelsByItem.get(i.id) ?? []));
521
419
  }
522
420
  async #fetchOne(em, itemId) {
421
+ if (!isUuidShape(itemId))
422
+ return null;
523
423
  const item = await em.findOne(GalleryItem, { id: itemId });
524
424
  if (!item)
525
425
  return null;
526
426
  const labels = await em.find(GalleryItemLabel, { galleryItemId: itemId });
527
- const hidden = (await loadHiddenChannelsByItem(em, [itemId])).get(itemId) ?? [];
528
- return this.#toDto(item, labels.map((l) => l.label), hidden);
427
+ return this.#toDto(item, labels.map((l) => l.label));
529
428
  }
530
- #toDto(item, labels, hiddenInChannels) {
429
+ #toDto(item, labels) {
531
430
  return {
532
431
  id: item.id,
533
432
  productId: item.productId,
534
433
  assetId: item.assetId,
535
434
  position: item.position,
536
435
  labels: [...labels].sort(),
537
- altText: { ...(item.altText ?? {}) },
538
- hiddenInChannels: [...hiddenInChannels],
436
+ altText: item.altText,
437
+ hidden: item.hidden,
539
438
  createdAt: item.createdAt.toISOString(),
540
439
  updatedAt: item.updatedAt.toISOString(),
541
440
  };
542
441
  }
543
442
  }
544
- /** The API key of each gallery role, beside the stored label it names (Principle VI: camelCase keys). */
545
- const ROLE_KEYS = [
546
- ['baseImage', 'base_image'],
547
- ['smallImage', 'small_image'],
548
- ['thumbnail', 'thumbnail'],
549
- ];
550
- function channelRolesDto(channelId, roles) {
551
- return {
552
- channelId,
553
- roles: {
554
- baseImage: roles.get('base_image') ?? null,
555
- smallImage: roles.get('small_image') ?? null,
556
- thumbnail: roles.get('thumbnail') ?? null,
557
- },
558
- };
559
- }
560
- function sameRoles(a, b) {
561
- return ROLE_KEYS.every(([key]) => a[key] === b[key]);
562
- }
563
- /** The audit projection of one item's scoped media write (FR-080): enough to restore it by re-sending. */
564
- function itemProjection(item, hiddenInChannels, labels) {
565
- const altText = Object.fromEntries(Object.entries(item.altText ?? {}).sort(([a], [b]) => a.localeCompare(b)));
566
- return {
567
- itemId: item.id,
568
- position: item.position,
569
- altText,
570
- hiddenInChannels: [...hiddenInChannels].sort(),
571
- labels: [...labels].sort(),
572
- };
573
- }
574
443
  /**
575
- * Each side's `altText` names every language the other side names, `''` where it has
576
- * none — so either projection, sent as a PATCH body, puts the item back as it was.
444
+ * Feature 174 (`data-model.md` §6a) — a gallery item's effective `hidden` at (C, L) as one SQL
445
+ * boolean: the C×L override, else the C override, else the Global column. With no channel, the
446
+ * Global column alone. Languages compare case-insensitively (a caller's tag against the stored
447
+ * channel spelling).
577
448
  */
578
- function withRemovals(before, after) {
579
- const b = before['altText'];
580
- const a = after['altText'];
581
- for (const code of Object.keys(a))
582
- if (!(code in b))
583
- b[code] = '';
584
- for (const code of Object.keys(b))
585
- if (!(code in a))
586
- a[code] = '';
449
+ function effectiveHiddenSql(itemId, globalHidden, channelId) {
450
+ if (channelId === null)
451
+ return { sql: `coalesce(${globalHidden}, false)`, params: () => [] };
452
+ return {
453
+ sql: `coalesce(
454
+ (select (o.value ->> 'v')::boolean
455
+ from gallery_item_scope_overrides o
456
+ where o.gallery_item_id = ${itemId} and o.field = 'hidden' and o.sales_channel_id = ?
457
+ and (o.language_code is null or lower(o.language_code) = lower(?::text))
458
+ order by (o.language_code is null) asc
459
+ limit 1),
460
+ ${globalHidden}, false)`,
461
+ params: (channel, languageCode) => [channel, languageCode],
462
+ };
587
463
  }
588
464
  //# sourceMappingURL=gallery.service.js.map
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from 'node:crypto';
2
- import { ERROR_CODES } from '@endora-commerce/contracts';
2
+ import { ERROR_CODES, isUuidShape } from '@endora-commerce/contracts';
3
3
  import { HttpError } from '@endora-commerce/platform/http';
4
4
  import { Product } from '../entities/product.entity.js';
5
5
  import { GroupedItem } from '../entities/grouped-item.entity.js';
@@ -32,7 +32,15 @@ export class GroupedService {
32
32
  const em = this.emFactory();
33
33
  await this.assertGroupedParent(em, parentProductId);
34
34
  if (input.childProductId === parentProductId) {
35
- throw new HttpError(400, ERROR_CODES.VALIDATION_FAILED, 'A grouped product cannot include itself as a child.');
35
+ // Issue #624 (#86) — the product links' self-reference code, the token
36
+ // choosing the grouped product's sentence.
37
+ throw new HttpError(400, ERROR_CODES.SELF_LINK_NOT_ALLOWED, 'A grouped product cannot include itself as a child.', {
38
+ code: 'grouped',
39
+ productId: parentProductId,
40
+ });
41
+ }
42
+ if (!isUuidShape(input.childProductId)) {
43
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Child product "${input.childProductId}" not found.`);
36
44
  }
37
45
  const child = await em.findOne(Product, { id: input.childProductId });
38
46
  if (!child || child.deletedAt) {
@@ -64,7 +72,7 @@ export class GroupedService {
64
72
  }
65
73
  catch (err) {
66
74
  if (err instanceof Error && /uniq_grouped_items_parent_child/.test(err.message)) {
67
- throw new HttpError(409, ERROR_CODES.VALIDATION_FAILED, `Child product "${input.childProductId}" is already in this group.`);
75
+ throw new HttpError(409, ERROR_CODES.GROUPED_ITEM_ALREADY_EXISTS, `Child product "${input.childProductId}" is already in this group.`, { parentProductId, childProductId: input.childProductId, childSku: child.sku });
68
76
  }
69
77
  throw err;
70
78
  }
@@ -84,6 +92,9 @@ export class GroupedService {
84
92
  async updateItem(parentProductId, itemId, input) {
85
93
  const row = await this.#audited('grouped_item.update', itemId, async (em) => {
86
94
  await this.assertGroupedParent(em, parentProductId);
95
+ if (!isUuidShape(itemId) || !isUuidShape(parentProductId)) {
96
+ throw new HttpError(404, ERROR_CODES.GROUPED_ITEM_NOT_FOUND, `Grouped item "${itemId}" not found on parent ${parentProductId}.`);
97
+ }
87
98
  const r = await em.findOne(GroupedItem, { id: itemId, parentProductId });
88
99
  if (!r) {
89
100
  throw new HttpError(404, ERROR_CODES.GROUPED_ITEM_NOT_FOUND, `Grouped item "${itemId}" not found on parent ${parentProductId}.`);
@@ -104,6 +115,9 @@ export class GroupedService {
104
115
  async removeItem(parentProductId, itemId) {
105
116
  await this.#audited('grouped_item.delete', itemId, async (em) => {
106
117
  await this.assertGroupedParent(em, parentProductId);
118
+ if (!isUuidShape(itemId) || !isUuidShape(parentProductId)) {
119
+ throw new HttpError(404, ERROR_CODES.GROUPED_ITEM_NOT_FOUND, `Grouped item "${itemId}" not found on parent ${parentProductId}.`);
120
+ }
107
121
  const row = await em.findOne(GroupedItem, { id: itemId, parentProductId });
108
122
  if (!row) {
109
123
  throw new HttpError(404, ERROR_CODES.GROUPED_ITEM_NOT_FOUND, `Grouped item "${itemId}" not found on parent ${parentProductId}.`);
@@ -114,6 +128,9 @@ export class GroupedService {
114
128
  });
115
129
  }
116
130
  async assertGroupedParent(em, parentProductId) {
131
+ if (!isUuidShape(parentProductId)) {
132
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product "${parentProductId}" not found.`);
133
+ }
117
134
  const parent = await em.findOne(Product, { id: parentProductId });
118
135
  if (!parent || parent.deletedAt) {
119
136
  throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product "${parentProductId}" not found.`);
@@ -10,9 +10,8 @@
10
10
  */
11
11
  import { randomUUID } from 'node:crypto';
12
12
  import { UniqueConstraintViolationException } from '@mikro-orm/core';
13
- import { ERROR_CODES, applyTranslationPatch, isValidOrderMinimum, } from '@endora-commerce/contracts';
13
+ import { ERROR_CODES, isValidOrderMinimum, isUuidShape, } from '@endora-commerce/contracts';
14
14
  import { HttpError } from '@endora-commerce/platform/http';
15
- import { mirrorTranslationRemovals, sortedTranslations } from './attachment-packaging-scopes.js';
16
15
  import { Product } from '../entities/product.entity.js';
17
16
  import { ProductPackagingUnit } from '../entities/product-packaging-unit.entity.js';
18
17
  const ELIGIBLE_TYPES = new Set(['simple', 'configurable']);
@@ -90,7 +89,6 @@ export class PackagingUnitService {
90
89
  isDefault: req.isDefault ?? false,
91
90
  minOrderUnits: req.minOrderUnits ?? null,
92
91
  // Feature 163 (FR-079) — the name per language.
93
- nameTranslations: applyTranslationPatch({}, req.nameTranslations ?? {}),
94
92
  });
95
93
  try {
96
94
  await em.flush();
@@ -109,8 +107,6 @@ export class PackagingUnitService {
109
107
  const unit = await this.#audited('packaging_unit.update', unitId, async (em) => {
110
108
  const u = await this.#findOwned(em, productId, unitId);
111
109
  const before = unitProjection(u);
112
- if (req.name !== undefined)
113
- u.name = req.name.trim();
114
110
  if (req.baseQuantity !== undefined)
115
111
  u.baseQuantity = req.baseQuantity;
116
112
  if (req.position !== undefined)
@@ -119,16 +115,11 @@ export class PackagingUnitService {
119
115
  u.isDefault = req.isDefault;
120
116
  if (req.minOrderUnits !== undefined)
121
117
  u.minOrderUnits = req.minOrderUnits;
122
- // Feature 163 (FR-079) — the named languages set, `''` removes one.
123
- if (req.nameTranslations !== undefined) {
124
- u.nameTranslations = applyTranslationPatch(u.nameTranslations, req.nameTranslations);
125
- }
126
118
  const after = unitProjection(u);
127
119
  // A request that changes nothing writes and announces nothing (FR-080).
128
120
  if (JSON.stringify(before) === JSON.stringify(after) && req.position === undefined) {
129
121
  return { result: u, before, after, unchanged: true };
130
122
  }
131
- mirrorTranslationRemovals(before, after, ['nameTranslations']);
132
123
  try {
133
124
  await em.flush();
134
125
  }
@@ -168,6 +159,9 @@ export class PackagingUnitService {
168
159
  }
169
160
  // -- INTERNALS ------------------------------------------------------------
170
161
  async #assertProductExists(em, productId) {
162
+ if (!isUuidShape(productId)) {
163
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product ${productId} not found.`);
164
+ }
171
165
  const product = await em.findOne(Product, { id: productId });
172
166
  if (!product) {
173
167
  throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product ${productId} not found.`);
@@ -181,6 +175,9 @@ export class PackagingUnitService {
181
175
  }
182
176
  }
183
177
  async #findOwned(em, productId, unitId) {
178
+ if (!isUuidShape(unitId) || !isUuidShape(productId)) {
179
+ throw new HttpError(404, ERROR_CODES.PACKAGING_UNIT_NOT_FOUND, `Packaging unit ${unitId} not found under Product ${productId}.`);
180
+ }
184
181
  const unit = await em.findOne(ProductPackagingUnit, { id: unitId, productId });
185
182
  if (!unit) {
186
183
  throw new HttpError(404, ERROR_CODES.PACKAGING_UNIT_NOT_FOUND, `Packaging unit ${unitId} not found under Product ${productId}.`);
@@ -222,7 +219,6 @@ export class PackagingUnitService {
222
219
  id: u.id,
223
220
  productId: u.productId,
224
221
  name: u.name,
225
- nameTranslations: { ...(u.nameTranslations ?? {}) },
226
222
  baseQuantity: u.baseQuantity,
227
223
  position: u.position,
228
224
  isDefault: u.isDefault,
@@ -241,7 +237,6 @@ function unitProjection(u) {
241
237
  return {
242
238
  productId: u.productId,
243
239
  name: u.name,
244
- nameTranslations: sortedTranslations(u.nameTranslations),
245
240
  baseQuantity: u.baseQuantity,
246
241
  isDefault: u.isDefault,
247
242
  minOrderUnits: u.minOrderUnits ?? null,
@@ -0,0 +1,64 @@
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
+ /** One language's Page Builder document — opaque beyond being a JSON object. */
10
+ export type PageBuilderDocument = Record<string, unknown>;
11
+ /** The stored envelope: one document per language code. */
12
+ export interface PageBuilderEnvelope {
13
+ languages: Record<string, PageBuilderDocument>;
14
+ }
15
+ /** What the product form's card shows of one language, instead of the document (R-3). */
16
+ export interface PageBuilderDocumentSummary {
17
+ /** Top-level blocks. */
18
+ blocks: number;
19
+ /** The first text a block carries, tags stripped, whitespace folded, at most {@link EXCERPT_MAX_LENGTH} characters. */
20
+ excerpt: string | null;
21
+ }
22
+ /** The ceiling on a summary's excerpt, in characters. */
23
+ export declare const EXCERPT_MAX_LENGTH = 120;
24
+ /**
25
+ * Whether a Page Builder document would render anything: a block at the top
26
+ * level, or in a legacy `zones` bucket. An editor that was opened and saved
27
+ * untouched stores a document with neither.
28
+ */
29
+ export declare function hasPageBuilderBlocks(tree: PageBuilderDocument): boolean;
30
+ /**
31
+ * The envelope as it is stored (FR-013, R-2): a language whose document holds
32
+ * no block is dropped, and an envelope with no language left is `null` — "no
33
+ * value". Normalising once on write means every reader (the card, the delete
34
+ * count, the product page) reads one fact rather than re-deriving it.
35
+ */
36
+ export declare function normalisePageBuilderEnvelope(envelope: PageBuilderEnvelope | null): PageBuilderEnvelope | null;
37
+ /**
38
+ * One language's summary (R-3): the top-level block count, and the first text
39
+ * a top-level block carries. The "first text" rule is per block shape, which
40
+ * is why it lives here and not in a jsonpath.
41
+ */
42
+ export declare function summarisePageBuilderDocument(document: PageBuilderDocument): PageBuilderDocumentSummary;
43
+ /** The UTF-8 byte length of the envelope's JSON — what the 1 MiB ceiling is measured in (FR-012). */
44
+ export declare function pageBuilderEnvelopeBytes(envelope: PageBuilderEnvelope): number;
45
+ /** The part of a read's context the language walk reads. */
46
+ export interface PageBuilderLanguageContext {
47
+ preferredLanguage?: string | null | undefined;
48
+ resolvedChannel: {
49
+ defaultLanguage?: string | null | undefined;
50
+ };
51
+ }
52
+ /**
53
+ * The language a reader is shown (FR-033, R-12), shared by category and product
54
+ * content: the caller's, then the channel's default, then `en-US`, then `en`,
55
+ * then any stored language. A language whose document holds no block is
56
+ * skipped, because an operator who saved the Polish tab empty did not ask for
57
+ * the English text to disappear from the Polish storefront. `null` when no
58
+ * language holds a block.
59
+ */
60
+ export declare function resolvePageBuilderLanguage(languages: Readonly<Record<string, PageBuilderDocument>>, ctx: PageBuilderLanguageContext): {
61
+ language: string;
62
+ document: PageBuilderDocument;
63
+ } | null;
64
+ //# sourceMappingURL=page-builder-content.d.ts.map