@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
@@ -10,9 +10,8 @@
10
10
  */
11
11
  import { randomUUID } from 'node:crypto';
12
12
  import { LockMode, UniqueConstraintViolationException } from '@mikro-orm/core';
13
- import { ERROR_CODES, applyTranslationPatch, } from '@endora-commerce/contracts';
13
+ import { ERROR_CODES, isUuidShape, } from '@endora-commerce/contracts';
14
14
  import { HttpError } from '@endora-commerce/platform/http';
15
- import { assertProductChannelMembers, loadHiddenChannelsByAttachment, mirrorTranslationRemovals, sortedTranslations, writeAttachmentHiddenChannels, } from './attachment-packaging-scopes.js';
16
15
  import { Product } from '../entities/product.entity.js';
17
16
  import { AttachmentType } from '../entities/attachment-type.entity.js';
18
17
  import { ProductAttachment } from '../entities/product-attachment.entity.js';
@@ -22,7 +21,6 @@ export class AttachmentService {
22
21
  emFactory;
23
22
  commandBus;
24
23
  assets;
25
- membership;
26
24
  constructor(emFactory,
27
25
  /** Feature 054 — audits attachment writes co-transactionally when provided. */
28
26
  commandBus,
@@ -34,14 +32,14 @@ export class AttachmentService {
34
32
  */
35
33
  assets,
36
34
  /**
37
- * Feature 163 (FR-014) — which channels the product is a member of: an attachment
38
- * may be hidden only in one of them. Removing a hidden channel never asks.
35
+ * Feature 163 (FR-014) — which channels the product is a member of. Unused since feature 174
36
+ * retired the per-channel attachment writes on this route; kept so the composition root's
37
+ * signature does not move before T041 rewrites the service.
39
38
  */
40
- membership) {
39
+ _membership) {
41
40
  this.emFactory = emFactory;
42
41
  this.commandBus = commandBus;
43
42
  this.assets = assets;
44
- this.membership = membership;
45
43
  }
46
44
  #requireAssets() {
47
45
  if (!this.assets) {
@@ -108,6 +106,9 @@ export class AttachmentService {
108
106
  }
109
107
  async updateType(id, req) {
110
108
  const t = await this.#audited('attachment_type.update', 'attachment_type', id, async (em) => {
109
+ if (!isUuidShape(id)) {
110
+ throw new HttpError(404, ERROR_CODES.ATTACHMENT_TYPE_NOT_FOUND, `AttachmentType ${id} not found.`);
111
+ }
111
112
  const row = await em.findOne(AttachmentType, { id });
112
113
  if (!row) {
113
114
  throw new HttpError(404, ERROR_CODES.ATTACHMENT_TYPE_NOT_FOUND, `AttachmentType ${id} not found.`);
@@ -143,6 +144,9 @@ export class AttachmentService {
143
144
  }
144
145
  async deleteType(id) {
145
146
  await this.#audited('attachment_type.delete', 'attachment_type', id, async (em) => {
147
+ if (!isUuidShape(id)) {
148
+ throw new HttpError(404, ERROR_CODES.ATTACHMENT_TYPE_NOT_FOUND, `AttachmentType ${id} not found.`);
149
+ }
146
150
  const t = await em.findOne(AttachmentType, { id });
147
151
  if (!t) {
148
152
  throw new HttpError(404, ERROR_CODES.ATTACHMENT_TYPE_NOT_FOUND, `AttachmentType ${id} not found.`);
@@ -161,8 +165,7 @@ export class AttachmentService {
161
165
  const em = this.emFactory();
162
166
  await this.#assertProductExists(em, productId);
163
167
  const items = await em.find(ProductAttachment, { productId }, { orderBy: { position: 'asc', id: 'asc' } });
164
- const hidden = await loadHiddenChannelsByAttachment(em, items.map((i) => i.id));
165
- return items.map((i) => this.#attachmentDto(i, hidden.get(i.id) ?? []));
168
+ return items.map((i) => this.#attachmentDto(i));
166
169
  }
167
170
  async createAttachment(productId, req) {
168
171
  const em = this.emFactory();
@@ -172,13 +175,14 @@ export class AttachmentService {
172
175
  if (!ASSET_KINDS_ATTACHMENT.has(asset.kind)) {
173
176
  throw new HttpError(400, ERROR_CODES.ASSET_KIND_NOT_SUPPORTED, `Attachments require asset.kind ∈ {pdf, certificate, other}; got "${asset.kind}".`);
174
177
  }
178
+ if (!isUuidShape(req.attachmentTypeId)) {
179
+ throw new HttpError(404, ERROR_CODES.ATTACHMENT_TYPE_NOT_FOUND, `AttachmentType ${req.attachmentTypeId} not found.`);
180
+ }
175
181
  const type = await em.findOne(AttachmentType, { id: req.attachmentTypeId });
176
182
  if (!type) {
177
183
  throw new HttpError(404, ERROR_CODES.ATTACHMENT_TYPE_NOT_FOUND, `AttachmentType ${req.attachmentTypeId} not found.`);
178
184
  }
179
185
  const position = req.position ?? (await this.#nextPosition(em, productId));
180
- const hiddenInChannels = [...new Set(req.hiddenInChannels ?? [])].sort();
181
- await assertProductChannelMembers(this.membership, productId, hiddenInChannels);
182
186
  const id = randomUUID();
183
187
  // Feature 163 (FR-080) — one audit entry per request, the Command's; the route
184
188
  // writes none of its own. `product.updated.v1` `['attachments']` after commit.
@@ -191,23 +195,20 @@ export class AttachmentService {
191
195
  name: req.name,
192
196
  description: req.description ?? null,
193
197
  position,
194
- nameTranslations: applyTranslationPatch({}, req.nameTranslations ?? {}),
195
- descriptionTranslations: applyTranslationPatch({}, req.descriptionTranslations ?? {}),
196
198
  });
197
199
  await cem.flush();
198
- if (hiddenInChannels.length > 0) {
199
- await writeAttachmentHiddenChannels(cem, productId, id, hiddenInChannels);
200
- }
201
200
  return {
202
201
  result: created,
203
202
  before: null,
204
- after: { ...attachmentProjection(created, hiddenInChannels), assetId: req.assetId },
203
+ after: { ...attachmentProjection(created), assetId: req.assetId },
205
204
  };
206
205
  });
207
- return this.#attachmentDto(attachment, hiddenInChannels);
206
+ return this.#attachmentDto(attachment);
208
207
  }
209
208
  async updateAttachment(productId, attachmentId, req) {
210
- let hiddenAfter = [];
209
+ if (!isUuidShape(attachmentId) || !isUuidShape(productId)) {
210
+ throw new HttpError(404, ERROR_CODES.ATTACHMENT_NOT_FOUND, `Attachment ${attachmentId} not found under Product ${productId}.`);
211
+ }
211
212
  const a = await this.#runAttachmentCommand('product_attachment.update', attachmentId, productId, async (em) => {
212
213
  // Locked, so concurrent writes on one attachment serialise and each audit
213
214
  // `before` is its true predecessor (FR-081).
@@ -215,46 +216,33 @@ export class AttachmentService {
215
216
  if (!row) {
216
217
  throw new HttpError(404, ERROR_CODES.ATTACHMENT_NOT_FOUND, `Attachment ${attachmentId} not found under Product ${productId}.`);
217
218
  }
218
- const hiddenBefore = (await loadHiddenChannelsByAttachment(em, [attachmentId])).get(attachmentId) ?? [];
219
- const before = attachmentProjection(row, hiddenBefore);
220
- hiddenAfter =
221
- req.hiddenInChannels === undefined ? hiddenBefore : [...new Set(req.hiddenInChannels)].sort();
222
- // FR-014 / FR-015 — only a channel the write adds must be a member one.
223
- await assertProductChannelMembers(this.membership, productId, hiddenAfter.filter((channelId) => !hiddenBefore.includes(channelId)));
219
+ const before = attachmentProjection(row);
224
220
  if (req.attachmentTypeId !== undefined) {
221
+ if (!isUuidShape(req.attachmentTypeId)) {
222
+ throw new HttpError(404, ERROR_CODES.ATTACHMENT_TYPE_NOT_FOUND, `AttachmentType ${req.attachmentTypeId} not found.`);
223
+ }
225
224
  const type = await em.findOne(AttachmentType, { id: req.attachmentTypeId });
226
225
  if (!type) {
227
226
  throw new HttpError(404, ERROR_CODES.ATTACHMENT_TYPE_NOT_FOUND, `AttachmentType ${req.attachmentTypeId} not found.`);
228
227
  }
229
228
  row.attachmentTypeId = req.attachmentTypeId;
230
229
  }
231
- if (req.name !== undefined)
232
- row.name = req.name;
233
- if (req.description !== undefined)
234
- row.description = req.description;
235
230
  if (req.position !== undefined)
236
231
  row.position = req.position;
237
- if (req.nameTranslations !== undefined) {
238
- row.nameTranslations = applyTranslationPatch(row.nameTranslations, req.nameTranslations);
239
- }
240
- if (req.descriptionTranslations !== undefined) {
241
- row.descriptionTranslations = applyTranslationPatch(row.descriptionTranslations, req.descriptionTranslations);
242
- }
243
- const after = attachmentProjection(row, hiddenAfter);
232
+ const after = attachmentProjection(row);
244
233
  // A request that changes nothing writes and announces nothing.
245
234
  if (JSON.stringify(before) === JSON.stringify(after))
246
235
  return { result: row, unchanged: true };
247
- mirrorTranslationRemovals(before, after, ['nameTranslations', 'descriptionTranslations']);
248
- if (req.hiddenInChannels !== undefined) {
249
- await writeAttachmentHiddenChannels(em, productId, attachmentId, hiddenAfter);
250
- }
251
236
  await em.flush();
252
237
  return { result: row, before, after };
253
238
  });
254
- return this.#attachmentDto(a, hiddenAfter);
239
+ return this.#attachmentDto(a);
255
240
  }
256
241
  async deleteAttachment(productId, attachmentId) {
257
242
  await this.#audited('product_attachment.delete', 'product_attachment', attachmentId, async (em) => {
243
+ if (!isUuidShape(attachmentId) || !isUuidShape(productId)) {
244
+ throw new HttpError(404, ERROR_CODES.ATTACHMENT_NOT_FOUND, `Attachment ${attachmentId} not found under Product ${productId}.`);
245
+ }
258
246
  const a = await em.findOne(ProductAttachment, { id: attachmentId, productId });
259
247
  if (!a) {
260
248
  throw new HttpError(404, ERROR_CODES.ATTACHMENT_NOT_FOUND, `Attachment ${attachmentId} not found under Product ${productId}.`);
@@ -311,6 +299,9 @@ export class AttachmentService {
311
299
  });
312
300
  }
313
301
  async #assertProductExists(em, productId) {
302
+ if (!isUuidShape(productId)) {
303
+ throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product ${productId} not found.`);
304
+ }
314
305
  const product = await em.findOne(Product, { id: productId });
315
306
  if (!product) {
316
307
  throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Product ${productId} not found.`);
@@ -330,7 +321,7 @@ export class AttachmentService {
330
321
  const rows = (await em.execute(`select coalesce(max(position), -1) + 1 as next_position from product_attachments where product_id = ?`, [productId]));
331
322
  return rows[0]?.next_position ?? 0;
332
323
  }
333
- #attachmentDto(a, hiddenInChannels) {
324
+ #attachmentDto(a) {
334
325
  return {
335
326
  id: a.id,
336
327
  productId: a.productId,
@@ -339,9 +330,7 @@ export class AttachmentService {
339
330
  name: a.name,
340
331
  description: a.description ?? null,
341
332
  position: a.position,
342
- nameTranslations: { ...(a.nameTranslations ?? {}) },
343
- descriptionTranslations: { ...(a.descriptionTranslations ?? {}) },
344
- hiddenInChannels: [...hiddenInChannels],
333
+ hidden: a.hidden,
345
334
  createdAt: a.createdAt.toISOString(),
346
335
  updatedAt: a.updatedAt.toISOString(),
347
336
  };
@@ -351,16 +340,13 @@ export class AttachmentService {
351
340
  * The audit projection of one attachment write (FR-080): every field the PATCH accepts
352
341
  * plus the product, so re-sending it (minus `productId`) restores the row (FR-081).
353
342
  */
354
- function attachmentProjection(row, hiddenInChannels) {
343
+ function attachmentProjection(row) {
355
344
  return {
356
345
  productId: row.productId,
357
346
  attachmentTypeId: row.attachmentTypeId,
358
347
  name: row.name,
359
348
  description: row.description ?? null,
360
349
  position: row.position,
361
- nameTranslations: sortedTranslations(row.nameTranslations),
362
- descriptionTranslations: sortedTranslations(row.descriptionTranslations),
363
- hiddenInChannels: [...hiddenInChannels].sort(),
364
350
  };
365
351
  }
366
352
  //# sourceMappingURL=attachment.service.js.map
@@ -0,0 +1,14 @@
1
+ /**
2
+ * What one `filter[attr.<key>]` means for one product value (issue #684): the
3
+ * value, rendered as `String` renders it, is one of the requested values — and
4
+ * a multiselect matches when **any** of its options does, each option rendered
5
+ * the same way. An empty multiselect matches nothing, and so does a key the
6
+ * product does not carry (`undefined`).
7
+ *
8
+ * This is the page-side half of the listing's attribute filter. The statement
9
+ * half is `CatalogQueryService#attributeCondition`, which restates this rule in
10
+ * SQL; `backend/test/contract/catalog/products-list-filtered-paging.test.ts`
11
+ * holds the two together. Change one, change the other.
12
+ */
13
+ export declare function attributeFilterMatches(value: unknown, wanted: readonly string[]): boolean;
14
+ //# sourceMappingURL=attribute-filter-match.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What one `filter[attr.<key>]` means for one product value (issue #684): the
3
+ * value, rendered as `String` renders it, is one of the requested values — and
4
+ * a multiselect matches when **any** of its options does, each option rendered
5
+ * the same way. An empty multiselect matches nothing, and so does a key the
6
+ * product does not carry (`undefined`).
7
+ *
8
+ * This is the page-side half of the listing's attribute filter. The statement
9
+ * half is `CatalogQueryService#attributeCondition`, which restates this rule in
10
+ * SQL; `backend/test/contract/catalog/products-list-filtered-paging.test.ts`
11
+ * holds the two together. Change one, change the other.
12
+ */
13
+ export function attributeFilterMatches(value, wanted) {
14
+ if (value === undefined)
15
+ return false;
16
+ const rendered = Array.isArray(value) ? value.map((option) => String(option)) : [String(value)];
17
+ return rendered.some((text) => wanted.includes(text));
18
+ }
19
+ //# sourceMappingURL=attribute-filter-match.js.map
@@ -1,11 +1,13 @@
1
1
  import type { EntityManager } from '@mikro-orm/postgresql';
2
- import { type AttributeScope, type AttributeScopeChangePreviewResponse } from '@endora-commerce/contracts';
2
+ import { type AttributeScopeChangePreviewResponse, type AttributeValueType, type ScopeLevel } from '@endora-commerce/contracts';
3
3
  import type { CatalogAttributeReadService } from './catalog-attribute-read.service.js';
4
4
  /**
5
5
  * Feature 163 (`specs/163-product-data-scopes/`) — the FR-090 preview of a change to a
6
- * user-defined attribute's scope flags,
7
- * `GET /api/v1/admin/catalog/attributes/:idOrKey/scope-change-preview`
8
- * (`contracts/admin-scopes-api.md` §6, research R27).
6
+ * user-defined attribute's scope, on feature 174's one flag and its value type (R15, FR-012):
7
+ * `GET /api/v1/admin/catalog/attributes/:idOrKey/scope-change-preview?scopable=&valueType=`
8
+ * (`contracts/admin-scopes-api.md` §6, research R27). The scope set is derived from both — a
9
+ * scopable text attribute {G, C, C×L}, a scopable non-text one {G, C}, a non-scopable one {G} —
10
+ * so scopable → not scopable orphans every override and text → non-text the C×L ones.
9
11
  *
10
12
  * A read only. The attribute update itself is unchanged and keeps every
11
13
  * `product_value_overrides` row; the resolver skips the ones the new flags no longer
@@ -26,9 +28,17 @@ export interface OrphanedSlots {
26
28
  channelLanguage: boolean;
27
29
  }
28
30
  /** The slots readable under `current` and not under `next`. */
29
- export declare function slotsOrphanedByScopeChange(current: AttributeScope, next: AttributeScope): OrphanedSlots;
30
- /** The requested flags: `"true"` / `"false"`; an absent one keeps the attribute's current flag. */
31
- export declare function parseScopeChangeQuery(query: Record<string, unknown>, current: AttributeScope): AttributeScope;
31
+ export declare function slotsOrphanedByScopeChange(current: readonly ScopeLevel[], next: readonly ScopeLevel[]): OrphanedSlots;
32
+ /** What the scope set is derived from (feature 174, `attributeScopeSet`). */
33
+ export interface AttributeScopeInput {
34
+ scopable: boolean;
35
+ valueType: AttributeValueType;
36
+ }
37
+ /**
38
+ * The requested scope: `scopable` `"true"` / `"false"` and `valueType` one of the attribute value
39
+ * types; an absent parameter keeps the attribute's current one.
40
+ */
41
+ export declare function parseScopeChangeQuery(query: Record<string, unknown>, current: AttributeScopeInput): AttributeScopeInput;
32
42
  export declare class AttributeScopePreviewService {
33
43
  private readonly emFactory;
34
44
  private readonly attributeRead;
@@ -1,8 +1,8 @@
1
- import { ERROR_CODES, } from '@endora-commerce/contracts';
1
+ import { ERROR_CODES, attributeScopeSet, attributeValueTypeSchema, } from '@endora-commerce/contracts';
2
2
  import { HttpError } from '@endora-commerce/platform/http';
3
- /** The resolver's test (`resolveAttribute` steps 1–2), per slot. */
4
- function readable(scope) {
5
- return { channel: scope.channelScoped, channelLanguage: scope.channelScoped && scope.languageScoped };
3
+ /** The slots the resolver reads for an attribute's scope set (feature 174, `attributeScopeSet`). */
4
+ function readable(levels) {
5
+ return { channel: levels.includes('C'), channelLanguage: levels.includes('CL') };
6
6
  }
7
7
  /** The slots readable under `current` and not under `next`. */
8
8
  export function slotsOrphanedByScopeChange(current, next) {
@@ -13,21 +13,30 @@ export function slotsOrphanedByScopeChange(current, next) {
13
13
  channelLanguage: before.channelLanguage && !after.channelLanguage,
14
14
  };
15
15
  }
16
- function parseFlag(raw, field, current) {
17
- if (raw === undefined)
18
- return current;
19
- if (raw === 'true')
20
- return true;
21
- if (raw === 'false')
22
- return false;
23
- throw new HttpError(400, ERROR_CODES.VALIDATION_FAILED, `"${field}" must be "true" or "false".`, { field });
24
- }
25
- /** The requested flags: `"true"` / `"false"`; an absent one keeps the attribute's current flag. */
16
+ /**
17
+ * The requested scope: `scopable` `"true"` / `"false"` and `valueType` one of the attribute value
18
+ * types; an absent parameter keeps the attribute's current one.
19
+ */
26
20
  export function parseScopeChangeQuery(query, current) {
27
- return {
28
- channelScoped: parseFlag(query['channelScoped'], 'channelScoped', current.channelScoped),
29
- languageScoped: parseFlag(query['languageScoped'], 'languageScoped', current.languageScoped),
30
- };
21
+ const rawScopable = query['scopable'];
22
+ let scopable = current.scopable;
23
+ if (rawScopable === 'true')
24
+ scopable = true;
25
+ else if (rawScopable === 'false')
26
+ scopable = false;
27
+ else if (rawScopable !== undefined) {
28
+ throw new HttpError(400, ERROR_CODES.VALIDATION_FAILED, '"scopable" must be "true" or "false".', { field: 'scopable' });
29
+ }
30
+ const rawType = query['valueType'];
31
+ let valueType = current.valueType;
32
+ if (rawType !== undefined) {
33
+ const parsed = attributeValueTypeSchema.safeParse(rawType);
34
+ if (!parsed.success) {
35
+ throw new HttpError(400, ERROR_CODES.VALIDATION_FAILED, '"valueType" is not an attribute value type.', { field: 'valueType' });
36
+ }
37
+ valueType = parsed.data;
38
+ }
39
+ return { scopable, valueType };
31
40
  }
32
41
  export class AttributeScopePreviewService {
33
42
  emFactory;
@@ -42,8 +51,9 @@ export class AttributeScopePreviewService {
42
51
  const attribute = await this.attributeRead.getByIdOrKey(idOrKey);
43
52
  if (!attribute)
44
53
  throw new HttpError(404, ERROR_CODES.NOT_FOUND, `Attribute "${idOrKey}" not found.`);
45
- const current = { channelScoped: attribute.channelScoped, languageScoped: attribute.languageScoped };
46
- const slots = slotsOrphanedByScopeChange(current, parseScopeChangeQuery(query, current));
54
+ const current = { scopable: attribute.scopable, valueType: attribute.valueType };
55
+ const next = parseScopeChangeQuery(query, current);
56
+ const slots = slotsOrphanedByScopeChange(attributeScopeSet(current), attributeScopeSet(next));
47
57
  if (!slots.channel && !slots.channelLanguage)
48
58
  return { orphanedOverrides: 0, byChannel: [] };
49
59
  const slotCondition = slots.channel && slots.channelLanguage
@@ -35,7 +35,16 @@ export declare class AttributeSetService {
35
35
  */
36
36
  attributeRead?: CatalogAttributeReadService | undefined);
37
37
  listSets(): Promise<AttributeSetDto[]>;
38
- getSetDetail(id: string): Promise<AttributeSetDetailDto>;
38
+ /**
39
+ * One set with its members. `includeContent: false` (feature 172, FR-042)
40
+ * leaves out the Page Builder content attributes: the integration-facing
41
+ * read offers a connector what it can map, and a document is not a value a
42
+ * connector maps. The admin read keeps them — the product form lays its
43
+ * content cards out from it (OR-2).
44
+ */
45
+ getSetDetail(id: string, options?: {
46
+ includeContent?: boolean;
47
+ }): Promise<AttributeSetDetailDto>;
39
48
  createSet(input: CreateAttributeSetRequest): Promise<AttributeSetDetailDto>;
40
49
  updateSet(id: string, input: UpdateAttributeSetRequest): Promise<AttributeSetDto>;
41
50
  deleteSet(id: string): Promise<void>;
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import { randomUUID } from 'node:crypto';
13
13
  import { UniqueConstraintViolationException } from '@mikro-orm/core';
14
- import { ERROR_CODES, } from '@endora-commerce/contracts';
14
+ import { ERROR_CODES, isUuidShape, } from '@endora-commerce/contracts';
15
15
  import { HttpError } from '@endora-commerce/platform/http';
16
16
  import { AttributeSet } from '../entities/attribute-set.entity.js';
17
17
  import { assertCodeNotImmutable, assertNotInUse, AttributeSetValidationError, } from './attribute-set-validations.js';
@@ -93,13 +93,26 @@ export class AttributeSetService {
93
93
  updatedAt: new Date(r.updated_at).toISOString(),
94
94
  }));
95
95
  }
96
- async getSetDetail(id) {
96
+ /**
97
+ * One set with its members. `includeContent: false` (feature 172, FR-042)
98
+ * leaves out the Page Builder content attributes: the integration-facing
99
+ * read offers a connector what it can map, and a document is not a value a
100
+ * connector maps. The admin read keeps them — the product form lays its
101
+ * content cards out from it (OR-2).
102
+ */
103
+ async getSetDetail(id, options = {}) {
97
104
  const em = this.emFactory();
105
+ if (!isUuidShape(id)) {
106
+ throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
107
+ }
98
108
  const set = await em.findOne(AttributeSet, { id });
99
109
  if (!set) {
100
110
  throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
101
111
  }
102
- const attrs = await this.#listAssignedAttributes(em, id);
112
+ const assigned = await this.#listAssignedAttributes(em, id);
113
+ const attrs = options.includeContent === false
114
+ ? assigned.filter((attribute) => attribute.valueType !== 'page_builder')
115
+ : assigned;
103
116
  const counts = await this.#computeCounts(em, id);
104
117
  return this.#toDetailDto(set, attrs, counts);
105
118
  }
@@ -164,6 +177,9 @@ export class AttributeSetService {
164
177
  }
165
178
  async updateSet(id, input) {
166
179
  const set = await this.#audited('attribute_set.update', id, async (em) => {
180
+ if (!isUuidShape(id)) {
181
+ throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
182
+ }
167
183
  const s = await em.findOne(AttributeSet, { id });
168
184
  if (!s) {
169
185
  throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
@@ -216,6 +232,9 @@ export class AttributeSetService {
216
232
  }
217
233
  async deleteSet(id) {
218
234
  await this.#audited('attribute_set.delete', id, async (em) => {
235
+ if (!isUuidShape(id)) {
236
+ throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
237
+ }
219
238
  const set = await em.findOne(AttributeSet, { id });
220
239
  if (!set) {
221
240
  throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
@@ -245,6 +264,9 @@ export class AttributeSetService {
245
264
  }
246
265
  async assignAttributes(id, input) {
247
266
  const readEm = this.emFactory();
267
+ if (!isUuidShape(id)) {
268
+ throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
269
+ }
248
270
  const set = await readEm.findOne(AttributeSet, { id });
249
271
  if (!set) {
250
272
  throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
@@ -296,6 +318,9 @@ export class AttributeSetService {
296
318
  }
297
319
  async unassignAttribute(id, attributeId) {
298
320
  const readEm = this.emFactory();
321
+ if (!isUuidShape(id)) {
322
+ throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
323
+ }
299
324
  const set = await readEm.findOne(AttributeSet, { id });
300
325
  if (!set) {
301
326
  throw new HttpError(404, ERROR_CODES.ATTRIBUTE_SET_NOT_FOUND, `Attribute Set ${id} not found.`);
@@ -342,7 +367,8 @@ export class AttributeSetService {
342
367
  label: view.label,
343
368
  valueType: view.valueType,
344
369
  position: r.position,
345
- languageScoped: view.languageScoped,
370
+ scopable: view.scopable,
371
+ scopeLevels: [...view.scopeLevels],
346
372
  };
347
373
  })
348
374
  .filter((a) => a !== undefined);
@@ -10,11 +10,11 @@ import { type ApiAttributeType as ContractApiAttributeType, type AttributeValueT
10
10
  * - specs/061-attributes-on-custom-fields/research.md §R7 (CF triple map)
11
11
  */
12
12
  /** Legacy DB-level types — superset of foundation 001's `attributeValueTypeSchema`. */
13
- export type DbAttributeValueType = 'string' | 'number' | 'boolean' | 'enum' | 'date' | 'multiselect' | 'price';
13
+ export type DbAttributeValueType = 'string' | 'number' | 'boolean' | 'enum' | 'date' | 'multiselect' | 'price' | 'page_builder';
14
14
  /** The legacy persisted form (pre-061 `product_attributes.value_type`). */
15
15
  export type LegacyAttributeValueType = DbAttributeValueType | 'select';
16
16
  /** Generic Custom Fields value types the product host maps onto. */
17
- export type CfAttributeValueType = 'text' | 'number' | 'boolean' | 'date' | 'select' | 'multiselect';
17
+ export type CfAttributeValueType = 'text' | 'number' | 'boolean' | 'date' | 'select' | 'multiselect' | 'page_builder';
18
18
  /** Extension refinement: how a cf `select` renders (legacy `enum` vs `select`). */
19
19
  export type SelectDisplay = 'pill' | 'dropdown';
20
20
  /** Extension refinement: which numeric semantics back a cf `number`. */
@@ -22,6 +22,8 @@ export function legacyToCfType(valueType) {
22
22
  return { cfValueType: 'select', selectDisplay: 'dropdown', numericKind: null };
23
23
  case 'multiselect':
24
24
  return { cfValueType: 'multiselect', selectDisplay: null, numericKind: null };
25
+ case 'page_builder':
26
+ return { cfValueType: 'page_builder', selectDisplay: null, numericKind: null };
25
27
  default: {
26
28
  const _exhaustive = valueType;
27
29
  throw new InvalidAttributeMappingError(`Unsupported legacy attribute valueType: ${String(_exhaustive)}`, 'INVALID_DB_TYPE');
@@ -47,6 +49,8 @@ export function cfToLegacyValueType(cfValueType, selectDisplay, numericKind) {
47
49
  return selectDisplay === 'pill' ? 'enum' : 'select';
48
50
  case 'multiselect':
49
51
  return 'multiselect';
52
+ case 'page_builder':
53
+ return 'page_builder';
50
54
  default:
51
55
  throw new InvalidAttributeMappingError(`Unsupported cf attribute valueType: ${cfValueType}`, 'INVALID_DB_TYPE');
52
56
  }
@@ -82,6 +86,8 @@ export function resolveAttributeApiType(req) {
82
86
  return { valueType: 'multiselect', displayAsSlider: false };
83
87
  case 'price':
84
88
  return { valueType: 'price', displayAsSlider: req.displayAsSlider ?? false };
89
+ case 'page_builder':
90
+ return { valueType: 'page_builder', displayAsSlider: false };
85
91
  case 'slider': {
86
92
  // Zod refine catches the missing-numericKind path; this is a
87
93
  // belt-and-braces guard for direct service callers (seeders, etc).
@@ -0,0 +1,31 @@
1
+ import type { EntityManager } from '@mikro-orm/postgresql';
2
+ import type { AdminAttributeUsage } from '@endora-commerce/contracts';
3
+ /**
4
+ * Feature 172 (`specs/172-product-content-attributes/`, FR-007 – FR-009, owner
5
+ * ruling OR-5, research R-21) — what deleting an attribute would meet.
6
+ *
7
+ * **One query for the dialog and the guard.** `GET …/attributes/:idOrKey/usage`
8
+ * and `catalog.attribute.delete` both call {@link readAttributeUsage}, so the
9
+ * count an operator is shown before confirming is the count the Command refuses
10
+ * on — the two cannot disagree.
11
+ *
12
+ * - `attributeSetCount` — set memberships of the definition (refuses).
13
+ * - `productValueCount` — distinct **non-deleted** products holding a value for
14
+ * the key: a baseline value (`products.attribute_values`), a per-channel
15
+ * override (`product_value_overrides`) or a variant value
16
+ * (`product_variants.variant_attribute_values`) (refuses). A soft-deleted
17
+ * product does not count: nothing purges or restores one, so it would block
18
+ * the attribute for ever with nothing the operator could clear (R-21).
19
+ * - `productContentCount` — Page Builder content rows of the attribute whose
20
+ * product is not soft-deleted (deleted with the attribute). Always `0` for a
21
+ * non-content attribute, whose extension id no content row carries.
22
+ */
23
+ export interface AttributeUsageTarget {
24
+ definitionId: string;
25
+ extensionId: string;
26
+ key: string;
27
+ }
28
+ export declare function readAttributeUsage(
29
+ /** A Command's EntityManager (the delete guard), or a fresh one (the usage read). */
30
+ em: EntityManager, target: AttributeUsageTarget): Promise<AdminAttributeUsage>;
31
+ //# sourceMappingURL=attribute-usage.d.ts.map
@@ -0,0 +1,29 @@
1
+ export async function readAttributeUsage(
2
+ /** A Command's EntityManager (the delete guard), or a fresh one (the usage read). */
3
+ em, target) {
4
+ // `em.execute`, never `em.getConnection().execute`: inside a Command this
5
+ // must read the state of the transaction whose write it guards (issue #200).
6
+ // The JSONB key operator is escaped (`\\?`), because a bare `?` is a binding.
7
+ const rows = (await em.execute(`select
8
+ (select count(*)::int from attribute_set_attributes where custom_field_definition_id = ?) as attribute_set_count,
9
+ (select count(*)::int
10
+ from products p
11
+ where p.deleted_at is null
12
+ and (p.attribute_values \\? ?
13
+ or exists (select 1 from product_value_overrides o
14
+ where o.product_id = p.id and o.attribute_key = ?)
15
+ or exists (select 1 from product_variants v
16
+ where v.parent_product_id = p.id and v.variant_attribute_values \\? ?))
17
+ ) as product_value_count,
18
+ (select count(*)::int
19
+ from product_content_values pcv
20
+ join products p on p.id = pcv.product_id
21
+ where pcv.product_attribute_id = ? and p.deleted_at is null) as product_content_count`, [target.definitionId, target.key, target.key, target.key, target.extensionId]));
22
+ const row = rows[0];
23
+ return {
24
+ attributeSetCount: Number(row?.attribute_set_count ?? 0),
25
+ productValueCount: Number(row?.product_value_count ?? 0),
26
+ productContentCount: Number(row?.product_content_count ?? 0),
27
+ };
28
+ }
29
+ //# sourceMappingURL=attribute-usage.js.map
@@ -206,7 +206,7 @@ export type UndoOutcome = {
206
206
  undoStatus: 'reverted' | 'partially_reverted' | 'none';
207
207
  } | {
208
208
  ok: false;
209
- code: 'NOT_FOUND' | 'NOT_REVERSIBLE' | 'ALREADY_REVERTED';
209
+ code: 'NOT_FOUND' | 'RUNNING' | 'NOT_REVERSIBLE' | 'ALREADY_REVERTED';
210
210
  };
211
211
  /**
212
212
  * The trail is stored and read later by administrators in languages of their