@endora-commerce/mod-catalog 0.110.0 → 0.111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/PackagingUnitsEditor.js +2 -1
- package/dist/admin/components/ProductAttachmentsSection.js +1 -1
- package/dist/admin/components/ProductAttributesTab.js +1 -1
- package/dist/admin/components/ProductEditorSaveAction.d.ts +22 -0
- package/dist/admin/components/ProductEditorSaveAction.js +23 -0
- package/dist/admin/components/ProductGallerySection.js +1 -1
- package/dist/admin/components/ProductInventoryTab.d.ts +12 -1
- package/dist/admin/components/ProductInventoryTab.js +52 -115
- package/dist/admin/components/ProductScopeBar.d.ts +6 -0
- package/dist/admin/components/ProductScopeBar.js +2 -2
- package/dist/admin/components/ProductScopeOverview.js +10 -6
- package/dist/admin/components/ProductUrlRedirects.js +1 -1
- package/dist/admin/components/ProductsBulkEditDialog.js +4 -3
- package/dist/admin/components/editor/DetailsTab.js +3 -2
- package/dist/admin/components/editor/{ImmediateBadge.d.ts → SectionHeading.d.ts} +6 -5
- package/dist/admin/components/editor/{ImmediateBadge.js → SectionHeading.js} +8 -10
- package/dist/admin/components/editor/editor-context.d.ts +3 -1
- package/dist/admin/lib/bulk-result-outcome.d.ts +14 -0
- package/dist/admin/lib/bulk-result-outcome.js +13 -0
- package/dist/admin/lib/product-scopes-api.js +3 -3
- package/dist/admin/lib/product-url-keys-api.js +1 -1
- package/dist/admin/pages/AttachmentTypesPage.js +14 -4
- package/dist/admin/pages/AttributeSetsPage.js +11 -4
- package/dist/admin/pages/AttributesManager.js +11 -2
- package/dist/admin/pages/BulkOperationDetailPage.js +11 -4
- package/dist/admin/pages/CategoriesTree.d.ts +5 -0
- package/dist/admin/pages/CategoriesTree.js +226 -40
- package/dist/admin/pages/ProductEditor.js +172 -75
- package/dist/admin/pages/ProductsList.js +25 -20
- package/dist/backend/commands/attribute-commands.js +59 -13
- package/dist/backend/index.d.ts +3 -0
- package/dist/backend/index.js +20 -1
- package/dist/backend/routes.admin.js +12 -4
- package/dist/backend/routes.external.js +3 -2
- package/dist/backend/routes.public.js +9 -4
- package/dist/backend/services/bulk-operation.service.d.ts +1 -1
- package/dist/backend/services/bulk-operation.service.js +4 -0
- package/dist/backend/services/catalog-admin.service.js +19 -9
- package/dist/backend/services/catalog-attribute-read.service.js +2 -0
- package/dist/backend/services/catalog-bulk-import.service.d.ts +6 -0
- package/dist/backend/services/catalog-bulk-import.service.js +2 -0
- package/dist/backend/services/catalog-query.service.d.ts +10 -1
- package/dist/backend/services/catalog-query.service.js +26 -0
- package/dist/backend/services/category-admin.service.js +20 -4
- package/dist/backend/services/content-attribute-rules.d.ts +16 -4
- package/dist/backend/services/content-attribute-rules.js +25 -12
- package/dist/backend/services/grouped.service.js +7 -2
- package/dist/backend/services/product-scopes.service.d.ts +3 -2
- package/dist/backend/services/product-scopes.service.js +4 -3
- package/dist/backend/services/table-maintenance-queue.d.ts +78 -0
- package/dist/backend/services/table-maintenance-queue.js +97 -0
- package/dist/manifest.d.ts +45 -1
- package/dist/manifest.js +77 -7
- package/dist/migrations/20261114T000706_catalog_category_main_image.d.ts +37 -0
- package/dist/migrations/20261114T000706_catalog_category_main_image.js +56 -0
- package/dist/migrations/index.d.ts +2 -1
- package/dist/migrations/index.js +3 -1
- package/docs/catalog/attribute-sets.md +1 -0
- package/docs/catalog/attributes.md +34 -20
- package/docs/catalog/category-content.md +6 -3
- package/docs/catalog/composite-products.md +3 -1
- package/docs/catalog/editing-a-product-at-a-scope.md +60 -4
- package/docs/catalog/product-content.md +10 -6
- package/docs/catalog.md +45 -17
- package/i18n/en.json +48 -5
- package/i18n/pl.json +49 -6
- package/package.json +11 -10
- package/dist/admin/components/CopyToChannelsDialog.d.ts.map +0 -1
- package/dist/admin/components/CopyToChannelsDialog.js.map +0 -1
- package/dist/admin/components/PackagingUnitsEditor.d.ts.map +0 -1
- package/dist/admin/components/PackagingUnitsEditor.js.map +0 -1
- package/dist/admin/components/ProductAttachmentsSection.d.ts.map +0 -1
- package/dist/admin/components/ProductAttachmentsSection.js.map +0 -1
- package/dist/admin/components/ProductAttributesTab.d.ts.map +0 -1
- package/dist/admin/components/ProductAttributesTab.js.map +0 -1
- package/dist/admin/components/ProductContentCard.d.ts.map +0 -1
- package/dist/admin/components/ProductContentCard.js.map +0 -1
- package/dist/admin/components/ProductGallerySection.d.ts.map +0 -1
- package/dist/admin/components/ProductGallerySection.js.map +0 -1
- package/dist/admin/components/ProductInventoryTab.d.ts.map +0 -1
- package/dist/admin/components/ProductInventoryTab.js.map +0 -1
- package/dist/admin/components/ProductOrderRulesCard.d.ts.map +0 -1
- package/dist/admin/components/ProductOrderRulesCard.js.map +0 -1
- package/dist/admin/components/ProductScopeBar.d.ts.map +0 -1
- package/dist/admin/components/ProductScopeBar.js.map +0 -1
- package/dist/admin/components/ProductScopeOverview.d.ts.map +0 -1
- package/dist/admin/components/ProductScopeOverview.js.map +0 -1
- package/dist/admin/components/ProductStatusPills.d.ts.map +0 -1
- package/dist/admin/components/ProductStatusPills.js.map +0 -1
- package/dist/admin/components/ProductUrlRedirects.d.ts.map +0 -1
- package/dist/admin/components/ProductUrlRedirects.js.map +0 -1
- package/dist/admin/components/ProductsBulkEditDialog.d.ts.map +0 -1
- package/dist/admin/components/ProductsBulkEditDialog.js.map +0 -1
- package/dist/admin/components/editor/DetailsTab.d.ts.map +0 -1
- package/dist/admin/components/editor/DetailsTab.js.map +0 -1
- package/dist/admin/components/editor/ImmediateBadge.d.ts.map +0 -1
- package/dist/admin/components/editor/ImmediateBadge.js.map +0 -1
- package/dist/admin/components/editor/confirm-removal.d.ts.map +0 -1
- package/dist/admin/components/editor/confirm-removal.js.map +0 -1
- package/dist/admin/components/editor/editor-context.d.ts.map +0 -1
- package/dist/admin/components/editor/editor-context.js.map +0 -1
- package/dist/admin/components/editor/scoped-controls.d.ts.map +0 -1
- package/dist/admin/components/editor/scoped-controls.js.map +0 -1
- package/dist/admin/index.d.ts.map +0 -1
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/lib/attribute-scope.d.ts.map +0 -1
- package/dist/admin/lib/attribute-scope.js.map +0 -1
- package/dist/admin/lib/bulk-operation-log-text.d.ts.map +0 -1
- package/dist/admin/lib/bulk-operation-log-text.js.map +0 -1
- package/dist/admin/lib/editor-scope.d.ts.map +0 -1
- package/dist/admin/lib/editor-scope.js.map +0 -1
- package/dist/admin/lib/order-minimum-input.d.ts.map +0 -1
- package/dist/admin/lib/order-minimum-input.js.map +0 -1
- package/dist/admin/lib/product-labels.d.ts.map +0 -1
- package/dist/admin/lib/product-labels.js.map +0 -1
- package/dist/admin/lib/product-scopes-api.d.ts.map +0 -1
- package/dist/admin/lib/product-scopes-api.js.map +0 -1
- package/dist/admin/lib/product-url-keys-api.d.ts.map +0 -1
- package/dist/admin/lib/product-url-keys-api.js.map +0 -1
- package/dist/admin/lib/resolve-product-selection.d.ts.map +0 -1
- package/dist/admin/lib/resolve-product-selection.js.map +0 -1
- package/dist/admin/lib/scope-overview.d.ts.map +0 -1
- package/dist/admin/lib/scope-overview.js.map +0 -1
- package/dist/admin/lib/scoped-editor-store.d.ts.map +0 -1
- package/dist/admin/lib/scoped-editor-store.js.map +0 -1
- package/dist/admin/lib/scoped-values-api.d.ts.map +0 -1
- package/dist/admin/lib/scoped-values-api.js.map +0 -1
- package/dist/admin/pages/AttachmentTypesPage.d.ts.map +0 -1
- package/dist/admin/pages/AttachmentTypesPage.js.map +0 -1
- package/dist/admin/pages/AttributeSetsPage.d.ts.map +0 -1
- package/dist/admin/pages/AttributeSetsPage.js.map +0 -1
- package/dist/admin/pages/AttributesManager.d.ts.map +0 -1
- package/dist/admin/pages/AttributesManager.js.map +0 -1
- package/dist/admin/pages/BulkOperationDetailPage.d.ts.map +0 -1
- package/dist/admin/pages/BulkOperationDetailPage.js.map +0 -1
- package/dist/admin/pages/BulkOperationsPage.d.ts.map +0 -1
- package/dist/admin/pages/BulkOperationsPage.js.map +0 -1
- package/dist/admin/pages/CategoriesTree.d.ts.map +0 -1
- package/dist/admin/pages/CategoriesTree.js.map +0 -1
- package/dist/admin/pages/CategoryContentPage.d.ts.map +0 -1
- package/dist/admin/pages/CategoryContentPage.js.map +0 -1
- package/dist/admin/pages/ProductContentPage.d.ts.map +0 -1
- package/dist/admin/pages/ProductContentPage.js.map +0 -1
- package/dist/admin/pages/ProductCreateForm.d.ts.map +0 -1
- package/dist/admin/pages/ProductCreateForm.js.map +0 -1
- package/dist/admin/pages/ProductEditor.d.ts.map +0 -1
- package/dist/admin/pages/ProductEditor.js.map +0 -1
- package/dist/admin/pages/ProductsList.d.ts.map +0 -1
- package/dist/admin/pages/ProductsList.js.map +0 -1
- package/dist/backend/admin-search-provider.d.ts.map +0 -1
- package/dist/backend/admin-search-provider.js.map +0 -1
- package/dist/backend/commands/attribute-commands.d.ts.map +0 -1
- package/dist/backend/commands/attribute-commands.js.map +0 -1
- package/dist/backend/commands/product-content-commands.d.ts.map +0 -1
- package/dist/backend/commands/product-content-commands.js.map +0 -1
- package/dist/backend/commands/scoped-values.commands.d.ts.map +0 -1
- package/dist/backend/commands/scoped-values.commands.js.map +0 -1
- package/dist/backend/demo/reset.d.ts.map +0 -1
- package/dist/backend/demo/reset.js.map +0 -1
- package/dist/backend/demo/rows.d.ts.map +0 -1
- package/dist/backend/demo/rows.js.map +0 -1
- package/dist/backend/demo/seed.d.ts.map +0 -1
- package/dist/backend/demo/seed.js.map +0 -1
- package/dist/backend/entities/attachment-type.entity.d.ts.map +0 -1
- package/dist/backend/entities/attachment-type.entity.js.map +0 -1
- package/dist/backend/entities/attribute-set-attribute.entity.d.ts.map +0 -1
- package/dist/backend/entities/attribute-set-attribute.entity.js.map +0 -1
- package/dist/backend/entities/attribute-set.entity.d.ts.map +0 -1
- package/dist/backend/entities/attribute-set.entity.js.map +0 -1
- package/dist/backend/entities/bulk-operation.entity.d.ts.map +0 -1
- package/dist/backend/entities/bulk-operation.entity.js.map +0 -1
- package/dist/backend/entities/bundle-slot-option.entity.d.ts.map +0 -1
- package/dist/backend/entities/bundle-slot-option.entity.js.map +0 -1
- package/dist/backend/entities/bundle-slot.entity.d.ts.map +0 -1
- package/dist/backend/entities/bundle-slot.entity.js.map +0 -1
- package/dist/backend/entities/category.entity.d.ts.map +0 -1
- package/dist/backend/entities/category.entity.js.map +0 -1
- package/dist/backend/entities/gallery-item-label.entity.d.ts.map +0 -1
- package/dist/backend/entities/gallery-item-label.entity.js.map +0 -1
- package/dist/backend/entities/gallery-item-scope-override.entity.d.ts.map +0 -1
- package/dist/backend/entities/gallery-item-scope-override.entity.js.map +0 -1
- package/dist/backend/entities/gallery-item.entity.d.ts.map +0 -1
- package/dist/backend/entities/gallery-item.entity.js.map +0 -1
- package/dist/backend/entities/gallery-role-scope-override.entity.d.ts.map +0 -1
- package/dist/backend/entities/gallery-role-scope-override.entity.js.map +0 -1
- package/dist/backend/entities/grouped-item.entity.d.ts.map +0 -1
- package/dist/backend/entities/grouped-item.entity.js.map +0 -1
- package/dist/backend/entities/product-attachment-scope-override.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-attachment-scope-override.entity.js.map +0 -1
- package/dist/backend/entities/product-attachment.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-attachment.entity.js.map +0 -1
- package/dist/backend/entities/product-attribute.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-attribute.entity.js.map +0 -1
- package/dist/backend/entities/product-channel-language-scope.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-channel-language-scope.entity.js.map +0 -1
- package/dist/backend/entities/product-channel-scope.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-channel-scope.entity.js.map +0 -1
- package/dist/backend/entities/product-content-value.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-content-value.entity.js.map +0 -1
- package/dist/backend/entities/product-editor-preference.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-editor-preference.entity.js.map +0 -1
- package/dist/backend/entities/product-link.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-link.entity.js.map +0 -1
- package/dist/backend/entities/product-list-saved-view.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-list-saved-view.entity.js.map +0 -1
- package/dist/backend/entities/product-packaging-unit-scope-override.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-packaging-unit-scope-override.entity.js.map +0 -1
- package/dist/backend/entities/product-packaging-unit.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-packaging-unit.entity.js.map +0 -1
- package/dist/backend/entities/product-url-key.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-url-key.entity.js.map +0 -1
- package/dist/backend/entities/product-url-redirect.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-url-redirect.entity.js.map +0 -1
- package/dist/backend/entities/product-value-override.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-value-override.entity.js.map +0 -1
- package/dist/backend/entities/product-variant.entity.d.ts.map +0 -1
- package/dist/backend/entities/product-variant.entity.js.map +0 -1
- package/dist/backend/entities/product.entity.d.ts.map +0 -1
- package/dist/backend/entities/product.entity.js.map +0 -1
- package/dist/backend/index.d.ts.map +0 -1
- package/dist/backend/index.js.map +0 -1
- package/dist/backend/plugin.d.ts.map +0 -1
- package/dist/backend/plugin.js.map +0 -1
- package/dist/backend/prompt-tools.d.ts.map +0 -1
- package/dist/backend/prompt-tools.js.map +0 -1
- package/dist/backend/routes.admin.d.ts.map +0 -1
- package/dist/backend/routes.admin.js.map +0 -1
- package/dist/backend/routes.admin.url-keys.d.ts.map +0 -1
- package/dist/backend/routes.admin.url-keys.js.map +0 -1
- package/dist/backend/routes.api-key.d.ts.map +0 -1
- package/dist/backend/routes.api-key.js.map +0 -1
- package/dist/backend/routes.external.d.ts.map +0 -1
- package/dist/backend/routes.external.js.map +0 -1
- package/dist/backend/routes.public.d.ts.map +0 -1
- package/dist/backend/routes.public.js.map +0 -1
- package/dist/backend/routes.public.url-keys.d.ts.map +0 -1
- package/dist/backend/routes.public.url-keys.js.map +0 -1
- package/dist/backend/saved-view-actor.d.ts.map +0 -1
- package/dist/backend/saved-view-actor.js.map +0 -1
- package/dist/backend/services/asset-references.d.ts.map +0 -1
- package/dist/backend/services/asset-references.js.map +0 -1
- package/dist/backend/services/attachment-packaging-scopes.d.ts.map +0 -1
- package/dist/backend/services/attachment-packaging-scopes.js.map +0 -1
- package/dist/backend/services/attachment.service.d.ts.map +0 -1
- package/dist/backend/services/attachment.service.js.map +0 -1
- package/dist/backend/services/attribute-filter-match.d.ts.map +0 -1
- package/dist/backend/services/attribute-filter-match.js.map +0 -1
- package/dist/backend/services/attribute-option-validator.d.ts.map +0 -1
- package/dist/backend/services/attribute-option-validator.js.map +0 -1
- package/dist/backend/services/attribute-scope-preview.d.ts.map +0 -1
- package/dist/backend/services/attribute-scope-preview.js.map +0 -1
- package/dist/backend/services/attribute-set-validations.d.ts.map +0 -1
- package/dist/backend/services/attribute-set-validations.js.map +0 -1
- package/dist/backend/services/attribute-set.service.d.ts.map +0 -1
- package/dist/backend/services/attribute-set.service.js.map +0 -1
- package/dist/backend/services/attribute-type-mapping.d.ts.map +0 -1
- package/dist/backend/services/attribute-type-mapping.js.map +0 -1
- package/dist/backend/services/attribute-usage.d.ts.map +0 -1
- package/dist/backend/services/attribute-usage.js.map +0 -1
- package/dist/backend/services/attribute-value-key.service.d.ts.map +0 -1
- package/dist/backend/services/attribute-value-key.service.js.map +0 -1
- package/dist/backend/services/audit-references.d.ts.map +0 -1
- package/dist/backend/services/audit-references.js.map +0 -1
- package/dist/backend/services/bulk-operation-queue.d.ts.map +0 -1
- package/dist/backend/services/bulk-operation-queue.js.map +0 -1
- package/dist/backend/services/bulk-operation.service.d.ts.map +0 -1
- package/dist/backend/services/bulk-operation.service.js.map +0 -1
- package/dist/backend/services/bundle.service.d.ts.map +0 -1
- package/dist/backend/services/bundle.service.js.map +0 -1
- package/dist/backend/services/catalog-admin-search.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-admin-search.service.js.map +0 -1
- package/dist/backend/services/catalog-admin.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-admin.service.js.map +0 -1
- package/dist/backend/services/catalog-attribute-read.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-attribute-read.service.js.map +0 -1
- package/dist/backend/services/catalog-bulk-import.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-bulk-import.service.js.map +0 -1
- package/dist/backend/services/catalog-bulk-update.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-bulk-update.service.js.map +0 -1
- package/dist/backend/services/catalog-category-read.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-category-read.service.js.map +0 -1
- package/dist/backend/services/catalog-org-price-decorator.d.ts.map +0 -1
- package/dist/backend/services/catalog-org-price-decorator.js.map +0 -1
- package/dist/backend/services/catalog-product-filter.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-product-filter.service.js.map +0 -1
- package/dist/backend/services/catalog-product-read.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-product-read.service.js.map +0 -1
- package/dist/backend/services/catalog-query.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-query.service.js.map +0 -1
- package/dist/backend/services/catalog-quick-search.service.d.ts.map +0 -1
- package/dist/backend/services/catalog-quick-search.service.js.map +0 -1
- package/dist/backend/services/catalog-write-ports.d.ts.map +0 -1
- package/dist/backend/services/catalog-write-ports.js.map +0 -1
- package/dist/backend/services/category-admin.service.d.ts.map +0 -1
- package/dist/backend/services/category-admin.service.js.map +0 -1
- package/dist/backend/services/channel-url-facts.d.ts.map +0 -1
- package/dist/backend/services/channel-url-facts.js.map +0 -1
- package/dist/backend/services/content-attribute-rules.d.ts.map +0 -1
- package/dist/backend/services/content-attribute-rules.js.map +0 -1
- package/dist/backend/services/effective-value.sql.d.ts.map +0 -1
- package/dist/backend/services/effective-value.sql.js.map +0 -1
- package/dist/backend/services/gallery-scopes.d.ts.map +0 -1
- package/dist/backend/services/gallery-scopes.js.map +0 -1
- package/dist/backend/services/gallery.service.d.ts.map +0 -1
- package/dist/backend/services/gallery.service.js.map +0 -1
- package/dist/backend/services/grouped.service.d.ts.map +0 -1
- package/dist/backend/services/grouped.service.js.map +0 -1
- package/dist/backend/services/label-resolver.d.ts.map +0 -1
- package/dist/backend/services/label-resolver.js.map +0 -1
- package/dist/backend/services/linkable-asset.d.ts.map +0 -1
- package/dist/backend/services/linkable-asset.js.map +0 -1
- package/dist/backend/services/packaging-unit.service.d.ts.map +0 -1
- package/dist/backend/services/packaging-unit.service.js.map +0 -1
- package/dist/backend/services/page-builder-content.d.ts.map +0 -1
- package/dist/backend/services/page-builder-content.js.map +0 -1
- package/dist/backend/services/primary-asset-url.d.ts.map +0 -1
- package/dist/backend/services/primary-asset-url.js.map +0 -1
- package/dist/backend/services/product-availability.service.d.ts.map +0 -1
- package/dist/backend/services/product-availability.service.js.map +0 -1
- package/dist/backend/services/product-availability.sql.d.ts.map +0 -1
- package/dist/backend/services/product-availability.sql.js.map +0 -1
- package/dist/backend/services/product-content.service.d.ts.map +0 -1
- package/dist/backend/services/product-content.service.js.map +0 -1
- package/dist/backend/services/product-editor-preferences.service.d.ts.map +0 -1
- package/dist/backend/services/product-editor-preferences.service.js.map +0 -1
- package/dist/backend/services/product-global-field-rules.d.ts.map +0 -1
- package/dist/backend/services/product-global-field-rules.js.map +0 -1
- package/dist/backend/services/product-link.service.d.ts.map +0 -1
- package/dist/backend/services/product-link.service.js.map +0 -1
- package/dist/backend/services/product-list-view-service.d.ts.map +0 -1
- package/dist/backend/services/product-list-view-service.js.map +0 -1
- package/dist/backend/services/product-page-revalidation.d.ts.map +0 -1
- package/dist/backend/services/product-page-revalidation.js.map +0 -1
- package/dist/backend/services/product-scopes.service.d.ts.map +0 -1
- package/dist/backend/services/product-scopes.service.js.map +0 -1
- package/dist/backend/services/product-summary-text.d.ts.map +0 -1
- package/dist/backend/services/product-summary-text.js.map +0 -1
- package/dist/backend/services/product-type-validations.d.ts.map +0 -1
- package/dist/backend/services/product-type-validations.js.map +0 -1
- package/dist/backend/services/product-value-resolver.service.d.ts.map +0 -1
- package/dist/backend/services/product-value-resolver.service.js.map +0 -1
- package/dist/backend/services/publication-window-sweep.d.ts.map +0 -1
- package/dist/backend/services/publication-window-sweep.js.map +0 -1
- package/dist/backend/services/scheduled-work-probe.d.ts.map +0 -1
- package/dist/backend/services/scheduled-work-probe.js.map +0 -1
- package/dist/backend/services/scope-completeness.d.ts.map +0 -1
- package/dist/backend/services/scope-completeness.js.map +0 -1
- package/dist/backend/services/scope-overview.service.d.ts.map +0 -1
- package/dist/backend/services/scope-overview.service.js.map +0 -1
- package/dist/backend/services/scoped-store-adapters.d.ts.map +0 -1
- package/dist/backend/services/scoped-store-adapters.js.map +0 -1
- package/dist/backend/services/scoped-values-global-only.d.ts.map +0 -1
- package/dist/backend/services/scoped-values-global-only.js.map +0 -1
- package/dist/backend/services/scoped-values-import.d.ts.map +0 -1
- package/dist/backend/services/scoped-values-import.js.map +0 -1
- package/dist/backend/services/scoped-values-read.service.d.ts.map +0 -1
- package/dist/backend/services/scoped-values-read.service.js.map +0 -1
- package/dist/backend/services/scoped-values-save.service.d.ts.map +0 -1
- package/dist/backend/services/scoped-values-save.service.js.map +0 -1
- package/dist/backend/services/scoped-values-state.d.ts.map +0 -1
- package/dist/backend/services/scoped-values-state.js.map +0 -1
- package/dist/backend/services/scoped-values.service.d.ts.map +0 -1
- package/dist/backend/services/scoped-values.service.js.map +0 -1
- package/dist/backend/services/sql-id-arrays.d.ts.map +0 -1
- package/dist/backend/services/sql-id-arrays.js.map +0 -1
- package/dist/backend/services/storefront-value-overrides.d.ts.map +0 -1
- package/dist/backend/services/storefront-value-overrides.js.map +0 -1
- package/dist/backend/services/system-attribute-scopes.d.ts.map +0 -1
- package/dist/backend/services/system-attribute-scopes.js.map +0 -1
- package/dist/backend/services/url-key-resolution.service.d.ts.map +0 -1
- package/dist/backend/services/url-key-resolution.service.js.map +0 -1
- package/dist/backend/services/url-key.service.d.ts.map +0 -1
- package/dist/backend/services/url-key.service.js.map +0 -1
- package/dist/backend/services/viewer-organization.d.ts.map +0 -1
- package/dist/backend/services/viewer-organization.js.map +0 -1
- package/dist/manifest.d.ts.map +0 -1
- package/dist/manifest.js.map +0 -1
- package/dist/migrations/20260429T064146_catalog_attribute_sets_init.d.ts.map +0 -1
- package/dist/migrations/20260429T064146_catalog_attribute_sets_init.js.map +0 -1
- package/dist/migrations/20260429T070004_catalog_product_attribute_extensions.d.ts.map +0 -1
- package/dist/migrations/20260429T070004_catalog_product_attribute_extensions.js.map +0 -1
- package/dist/migrations/20260429T102322_catalog_product_type_and_virtual_fields.d.ts.map +0 -1
- package/dist/migrations/20260429T102322_catalog_product_type_and_virtual_fields.js.map +0 -1
- package/dist/migrations/20260429T111839_catalog_gallery_items_and_labels.d.ts.map +0 -1
- package/dist/migrations/20260429T111839_catalog_gallery_items_and_labels.js.map +0 -1
- package/dist/migrations/20260429T112543_catalog_product_attachments.d.ts.map +0 -1
- package/dist/migrations/20260429T112543_catalog_product_attachments.js.map +0 -1
- package/dist/migrations/20260429T123726_catalog_product_links.d.ts.map +0 -1
- package/dist/migrations/20260429T123726_catalog_product_links.js.map +0 -1
- package/dist/migrations/20260429T130803_catalog_grouped_and_bundle.d.ts.map +0 -1
- package/dist/migrations/20260429T130803_catalog_grouped_and_bundle.js.map +0 -1
- package/dist/migrations/20260501T185835_catalog_product_attribute_is_comparable.d.ts.map +0 -1
- package/dist/migrations/20260501T185835_catalog_product_attribute_is_comparable.js.map +0 -1
- package/dist/migrations/20260505T060113_catalog_attribute_options_and_flags.d.ts.map +0 -1
- package/dist/migrations/20260505T060113_catalog_attribute_options_and_flags.js.map +0 -1
- package/dist/migrations/20260515T082629_catalog_attribute_mass_editable.d.ts.map +0 -1
- package/dist/migrations/20260515T082629_catalog_attribute_mass_editable.js.map +0 -1
- package/dist/migrations/20260526T124736_catalog_product_status_inactive.d.ts.map +0 -1
- package/dist/migrations/20260526T124736_catalog_product_status_inactive.js.map +0 -1
- package/dist/migrations/20260611T140346_catalog_product_value_overrides_init.d.ts.map +0 -1
- package/dist/migrations/20260611T140346_catalog_product_value_overrides_init.js.map +0 -1
- package/dist/migrations/20260611T140400_catalog_attribute_quick_searchable.d.ts.map +0 -1
- package/dist/migrations/20260611T140400_catalog_attribute_quick_searchable.js.map +0 -1
- package/dist/migrations/20260611T140407_catalog_bulk_operations.d.ts.map +0 -1
- package/dist/migrations/20260611T140407_catalog_bulk_operations.js.map +0 -1
- package/dist/migrations/20260611T140408_catalog_bulk_operation_logs.d.ts.map +0 -1
- package/dist/migrations/20260611T140408_catalog_bulk_operation_logs.js.map +0 -1
- package/dist/migrations/20260611T140412_catalog_product_packaging_units.d.ts.map +0 -1
- package/dist/migrations/20260611T140412_catalog_product_packaging_units.js.map +0 -1
- package/dist/migrations/20260718T060659_catalog_bulk_operation_revert_state.d.ts.map +0 -1
- package/dist/migrations/20260718T060659_catalog_bulk_operation_revert_state.js.map +0 -1
- package/dist/migrations/20260718T200343_catalog_category_custom_field_values.d.ts.map +0 -1
- package/dist/migrations/20260718T200343_catalog_category_custom_field_values.js.map +0 -1
- package/dist/migrations/20260723T230401_catalog_attributes_on_custom_fields.d.ts.map +0 -1
- package/dist/migrations/20260723T230401_catalog_attributes_on_custom_fields.js.map +0 -1
- package/dist/migrations/20260804T152604_catalog_widen_product_sku.d.ts.map +0 -1
- package/dist/migrations/20260804T152604_catalog_widen_product_sku.js.map +0 -1
- package/dist/migrations/20260804T160244_catalog_category_activation.d.ts.map +0 -1
- package/dist/migrations/20260804T160244_catalog_category_activation.js.map +0 -1
- package/dist/migrations/20260912T094557_catalog_sales_channel_products.d.ts.map +0 -1
- package/dist/migrations/20260912T094557_catalog_sales_channel_products.js.map +0 -1
- package/dist/migrations/20260912T094623_catalog_sales_channel_categories.d.ts.map +0 -1
- package/dist/migrations/20260912T094623_catalog_sales_channel_categories.js.map +0 -1
- package/dist/migrations/20260925T125527_catalog_inventory_columns.d.ts.map +0 -1
- package/dist/migrations/20260925T125527_catalog_inventory_columns.js.map +0 -1
- package/dist/migrations/20261008T080839_catalog_product_attribute_is_price_rule.d.ts.map +0 -1
- package/dist/migrations/20261008T080839_catalog_product_attribute_is_price_rule.js.map +0 -1
- package/dist/migrations/20261008T092714_catalog_category_content.d.ts.map +0 -1
- package/dist/migrations/20261008T092714_catalog_category_content.js.map +0 -1
- package/dist/migrations/20261014T170531_catalog_product_list_saved_views.d.ts.map +0 -1
- package/dist/migrations/20261014T170531_catalog_product_list_saved_views.js.map +0 -1
- package/dist/migrations/20261016T082008_catalog_order_rules.d.ts.map +0 -1
- package/dist/migrations/20261016T082008_catalog_order_rules.js.map +0 -1
- package/dist/migrations/20261022T035133_catalog_product_scopes.d.ts.map +0 -1
- package/dist/migrations/20261022T035133_catalog_product_scopes.js.map +0 -1
- package/dist/migrations/20261022T054223_catalog_product_url_keys.d.ts.map +0 -1
- package/dist/migrations/20261022T054223_catalog_product_url_keys.js.map +0 -1
- package/dist/migrations/20261022T111811_catalog_price_fields_removed.d.ts.map +0 -1
- package/dist/migrations/20261022T111811_catalog_price_fields_removed.js.map +0 -1
- package/dist/migrations/20261022T182523_catalog_admin_name_keys.d.ts.map +0 -1
- package/dist/migrations/20261022T182523_catalog_admin_name_keys.js.map +0 -1
- package/dist/migrations/20261025T222634_catalog_product_status_drop_draft.d.ts.map +0 -1
- package/dist/migrations/20261025T222634_catalog_product_status_drop_draft.js.map +0 -1
- package/dist/migrations/20261026T033453_catalog_product_media_scopes.d.ts.map +0 -1
- package/dist/migrations/20261026T033453_catalog_product_media_scopes.js.map +0 -1
- package/dist/migrations/20261026T084533_catalog_attachment_packaging_translations.d.ts.map +0 -1
- package/dist/migrations/20261026T084533_catalog_attachment_packaging_translations.js.map +0 -1
- package/dist/migrations/20261030T113855_catalog_scope_model_texts.d.ts.map +0 -1
- package/dist/migrations/20261030T113855_catalog_scope_model_texts.js.map +0 -1
- package/dist/migrations/20261030T113859_catalog_scope_model_order_rules.d.ts.map +0 -1
- package/dist/migrations/20261030T113859_catalog_scope_model_order_rules.js.map +0 -1
- package/dist/migrations/20261030T113904_catalog_scope_model_url_keys.d.ts.map +0 -1
- package/dist/migrations/20261030T113904_catalog_scope_model_url_keys.js.map +0 -1
- package/dist/migrations/20261030T113908_catalog_scope_model_media.d.ts.map +0 -1
- package/dist/migrations/20261030T113908_catalog_scope_model_media.js.map +0 -1
- package/dist/migrations/20261104T121504_catalog_product_content_values.d.ts.map +0 -1
- package/dist/migrations/20261104T121504_catalog_product_content_values.js.map +0 -1
- package/dist/migrations/20261107T093126_catalog_sku_unique_among_live.d.ts.map +0 -1
- package/dist/migrations/20261107T093126_catalog_sku_unique_among_live.js.map +0 -1
- package/dist/migrations/20261107T120008_catalog_product_created_at_milliseconds.d.ts.map +0 -1
- package/dist/migrations/20261107T120008_catalog_product_created_at_milliseconds.js.map +0 -1
- package/dist/migrations/index.d.ts.map +0 -1
- package/dist/migrations/index.js.map +0 -1
- package/dist/ports/index.d.ts.map +0 -1
- package/dist/ports/index.js.map +0 -1
|
@@ -26,16 +26,28 @@ export declare const CONTENT_ATTRIBUTE_LOCKED_FLAGS: readonly ["isSearchable", "
|
|
|
26
26
|
export type ContentAttributeLockedFlag = (typeof CONTENT_ATTRIBUTE_LOCKED_FLAGS)[number];
|
|
27
27
|
export type ContentAttributeFlags = Partial<Record<ContentAttributeLockedFlag, boolean | undefined>>;
|
|
28
28
|
/**
|
|
29
|
-
* Refuse every locked capability switched on (FR-003, FR-040)
|
|
30
|
-
*
|
|
29
|
+
* Refuse every locked capability switched on (FR-003, FR-040).
|
|
30
|
+
*
|
|
31
|
+
* On create the request names the type itself, so the rule judges the request
|
|
32
|
+
* alone: `400 VALIDATION_FAILED`, one `details` entry per offending field. On
|
|
33
|
+
* update the caller passes the stored attribute — its stored type is what
|
|
34
|
+
* refuses the flag — and the refusal is `400 CONTENT_ATTRIBUTE_CAPABILITY_LOCKED`
|
|
35
|
+
* with the flags joined in `details.capabilities` (issue #1218, #86; the same
|
|
36
|
+
* split #624 made for the slider).
|
|
31
37
|
*/
|
|
32
|
-
export declare function assertContentAttributeShape(flags: ContentAttributeFlags
|
|
38
|
+
export declare function assertContentAttributeShape(flags: ContentAttributeFlags, stored?: {
|
|
39
|
+
readonly attributeKey: string;
|
|
40
|
+
}): void;
|
|
33
41
|
/**
|
|
34
42
|
* The value type of an attribute never moves to or from `page_builder`
|
|
35
43
|
* (FR-005): a document and a scalar value are not convertible into each other.
|
|
36
44
|
* Takes the legacy (DB) form of both sides.
|
|
45
|
+
*
|
|
46
|
+
* Issue #1218 (#86) — the stored type refuses a well-formed request, so the
|
|
47
|
+
* refusal is the value-type lock's code with the token `page_builder`, whose
|
|
48
|
+
* sentence names the attribute.
|
|
37
49
|
*/
|
|
38
|
-
export declare function assertTypeChangeAllowed(from: string, to: string): void;
|
|
50
|
+
export declare function assertTypeChangeAllowed(from: string, to: string, attributeKey: string): void;
|
|
39
51
|
/**
|
|
40
52
|
* The ordinary attribute-values path never carries a content attribute's key
|
|
41
53
|
* (FR-014, FR-042 inbound, research R-7): its value is a document authored on
|
|
@@ -40,29 +40,42 @@ export const CONTENT_ATTRIBUTE_LOCKED_FLAGS = [
|
|
|
40
40
|
];
|
|
41
41
|
const ISSUE = 'not available for Page Builder content';
|
|
42
42
|
/**
|
|
43
|
-
* Refuse every locked capability switched on (FR-003, FR-040)
|
|
44
|
-
*
|
|
43
|
+
* Refuse every locked capability switched on (FR-003, FR-040).
|
|
44
|
+
*
|
|
45
|
+
* On create the request names the type itself, so the rule judges the request
|
|
46
|
+
* alone: `400 VALIDATION_FAILED`, one `details` entry per offending field. On
|
|
47
|
+
* update the caller passes the stored attribute — its stored type is what
|
|
48
|
+
* refuses the flag — and the refusal is `400 CONTENT_ATTRIBUTE_CAPABILITY_LOCKED`
|
|
49
|
+
* with the flags joined in `details.capabilities` (issue #1218, #86; the same
|
|
50
|
+
* split #624 made for the slider).
|
|
45
51
|
*/
|
|
46
|
-
export function assertContentAttributeShape(flags) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
export function assertContentAttributeShape(flags, stored) {
|
|
53
|
+
const refused = CONTENT_ATTRIBUTE_LOCKED_FLAGS.filter((flag) => flags[flag] === true);
|
|
54
|
+
if (refused.length === 0)
|
|
55
|
+
return;
|
|
56
|
+
const message = `Page Builder content attributes cannot have: ${refused.join(', ')}.`;
|
|
57
|
+
if (stored) {
|
|
58
|
+
throw new HttpError(400, ERROR_CODES.CONTENT_ATTRIBUTE_CAPABILITY_LOCKED, message, {
|
|
59
|
+
attributeKey: stored.attributeKey,
|
|
60
|
+
capabilities: refused.join(', '),
|
|
61
|
+
});
|
|
54
62
|
}
|
|
63
|
+
throw new HttpError(400, ERROR_CODES.VALIDATION_FAILED, message, refused.map((flag) => ({ path: flag, issue: ISSUE })));
|
|
55
64
|
}
|
|
56
65
|
/**
|
|
57
66
|
* The value type of an attribute never moves to or from `page_builder`
|
|
58
67
|
* (FR-005): a document and a scalar value are not convertible into each other.
|
|
59
68
|
* Takes the legacy (DB) form of both sides.
|
|
69
|
+
*
|
|
70
|
+
* Issue #1218 (#86) — the stored type refuses a well-formed request, so the
|
|
71
|
+
* refusal is the value-type lock's code with the token `page_builder`, whose
|
|
72
|
+
* sentence names the attribute.
|
|
60
73
|
*/
|
|
61
|
-
export function assertTypeChangeAllowed(from, to) {
|
|
74
|
+
export function assertTypeChangeAllowed(from, to, attributeKey) {
|
|
62
75
|
if (from === to)
|
|
63
76
|
return;
|
|
64
77
|
if (from === 'page_builder' || to === 'page_builder') {
|
|
65
|
-
throw new HttpError(409, ERROR_CODES.
|
|
78
|
+
throw new HttpError(409, ERROR_CODES.ATTRIBUTE_VALUE_TYPE_LOCKED, 'The value type of a Page Builder content attribute cannot be changed.', { code: 'page_builder', attributeKey });
|
|
66
79
|
}
|
|
67
80
|
}
|
|
68
81
|
/**
|
|
@@ -32,7 +32,12 @@ export class GroupedService {
|
|
|
32
32
|
const em = this.emFactory();
|
|
33
33
|
await this.assertGroupedParent(em, parentProductId);
|
|
34
34
|
if (input.childProductId === parentProductId) {
|
|
35
|
-
|
|
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
|
+
});
|
|
36
41
|
}
|
|
37
42
|
if (!isUuidShape(input.childProductId)) {
|
|
38
43
|
throw new HttpError(404, ERROR_CODES.PRODUCT_NOT_FOUND, `Child product "${input.childProductId}" not found.`);
|
|
@@ -67,7 +72,7 @@ export class GroupedService {
|
|
|
67
72
|
}
|
|
68
73
|
catch (err) {
|
|
69
74
|
if (err instanceof Error && /uniq_grouped_items_parent_child/.test(err.message)) {
|
|
70
|
-
throw new HttpError(409, ERROR_CODES.
|
|
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 });
|
|
71
76
|
}
|
|
72
77
|
throw err;
|
|
73
78
|
}
|
|
@@ -100,8 +100,9 @@ export interface ProductScopeWritePlan {
|
|
|
100
100
|
* the channel's spelling, so case-insensitively), is `VALIDATION_FAILED` with
|
|
101
101
|
* `details.field` `channels` / `languageStatuses`.
|
|
102
102
|
* - A window whose start is not before its end is `VALIDATION_FAILED`,
|
|
103
|
-
* `details.field = 'window'`;
|
|
104
|
-
* with `details.field =
|
|
103
|
+
* `details.field = 'window'`; a channel minimum on a type that takes none is
|
|
104
|
+
* `MIN_ORDER_QUANTITY_NOT_SUPPORTED_FOR_TYPE` with `details.field =
|
|
105
|
+
* 'minOrderQuantity'` (the feature-155 rule; its own code since issue #624).
|
|
105
106
|
* - A global window change touches no override (FR-013).
|
|
106
107
|
*/
|
|
107
108
|
export declare function planProductScopeWrite(state: ProductScopeWriteState, request: PatchProductScopesRequest): ProductScopeWritePlan;
|
|
@@ -24,8 +24,9 @@ const CHANNEL_ROW_KEYS = ['status', 'window', 'audience', 'minOrderQuantity', 'r
|
|
|
24
24
|
* the channel's spelling, so case-insensitively), is `VALIDATION_FAILED` with
|
|
25
25
|
* `details.field` `channels` / `languageStatuses`.
|
|
26
26
|
* - A window whose start is not before its end is `VALIDATION_FAILED`,
|
|
27
|
-
* `details.field = 'window'`;
|
|
28
|
-
* with `details.field =
|
|
27
|
+
* `details.field = 'window'`; a channel minimum on a type that takes none is
|
|
28
|
+
* `MIN_ORDER_QUANTITY_NOT_SUPPORTED_FOR_TYPE` with `details.field =
|
|
29
|
+
* 'minOrderQuantity'` (the feature-155 rule; its own code since issue #624).
|
|
29
30
|
* - A global window change touches no override (FR-013).
|
|
30
31
|
*/
|
|
31
32
|
export function planProductScopeWrite(state, request) {
|
|
@@ -184,7 +185,7 @@ function applyChannelPatch(state, current, entry) {
|
|
|
184
185
|
const moq = toScopedWriteOp(entry.minOrderQuantity);
|
|
185
186
|
if (moq !== undefined) {
|
|
186
187
|
if (moq.op === 'set' && !isOrderMinimumEligibleType(state.productType)) {
|
|
187
|
-
throw new HttpError(422, ERROR_CODES.
|
|
188
|
+
throw new HttpError(422, ERROR_CODES.MIN_ORDER_QUANTITY_NOT_SUPPORTED_FOR_TYPE, `A minimum order quantity applies to simple or configurable products only; got "${state.productType}".`, { field: 'minOrderQuantity', productType: state.productType, channelId: entry.channelId });
|
|
188
189
|
}
|
|
189
190
|
// `inherit` → not overridden; `empty` → overridden with no minimum here; `set` → the value.
|
|
190
191
|
next.minOrderQuantityOverridden = moq.op !== 'inherit';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Worker } from 'bullmq';
|
|
2
|
+
import type { Redis } from 'ioredis';
|
|
3
|
+
import { type PlatformLogger } from '@endora-commerce/platform/kernel';
|
|
4
|
+
/**
|
|
5
|
+
* Table maintenance after a catalogue import — issue #409 (Principle X).
|
|
6
|
+
*
|
|
7
|
+
* Right after a bulk write Postgres has neither fresh statistics nor a
|
|
8
|
+
* visibility map for the rows it rewrote, until autovacuum's first pass —
|
|
9
|
+
* which, for an import below its scale factor, may never come. The admin's
|
|
10
|
+
* ordered walk over `products_admin_order_<lang>` and its search count lean on
|
|
11
|
+
* index-only scans, and without the visibility map each of them fetches every
|
|
12
|
+
* heap tuple (spec 161 R14, `book-lines-page.bench.ts`). So an import asks for
|
|
13
|
+
* `VACUUM (ANALYZE)` of `products` and `product_variants`: `ANALYZE` alone does
|
|
14
|
+
* not set the visibility map, and `VACUUM` cannot run inside a transaction, so
|
|
15
|
+
* it is a job here and never a statement in the import.
|
|
16
|
+
*
|
|
17
|
+
* **One job per table per window.** The job is delayed by the window and
|
|
18
|
+
* deduplicated by its table, so every import while it waits is absorbed — the
|
|
19
|
+
* vacuum still runs after them, because it runs later. An import while it
|
|
20
|
+
* runs keeps one follow-up (`keepLastIfActive`). `import_export` reaches this
|
|
21
|
+
* through `catalogBulkImportPort` — the import is this module's write — and
|
|
22
|
+
* never names a table. `price_lists` keeps its own queue for its own tables.
|
|
23
|
+
*
|
|
24
|
+
* Best effort by design: the import has committed when it asks, so a queue
|
|
25
|
+
* that cannot be reached is logged and the import answers as usual —
|
|
26
|
+
* autovacuum remains the floor. Attached with `ctx.worker`, so it stops with
|
|
27
|
+
* the module (Principle XVII), and built only where the host says this process
|
|
28
|
+
* consumes queues.
|
|
29
|
+
*/
|
|
30
|
+
export declare const CATALOG_TABLE_MAINTENANCE_QUEUE = "catalog.table-maintenance";
|
|
31
|
+
export declare const TABLE_MAINTENANCE_JOB = "vacuum-analyze";
|
|
32
|
+
/** The tables a catalogue import rewrites. */
|
|
33
|
+
export declare const CATALOG_BULK_TABLES: readonly ["products", "product_variants"];
|
|
34
|
+
export type CatalogBulkTable = (typeof CATALOG_BULK_TABLES)[number];
|
|
35
|
+
/**
|
|
36
|
+
* How long a request waits before its vacuum runs, and so how many writes one
|
|
37
|
+
* job absorbs. A minute is autovacuum's own default nap, and long enough for
|
|
38
|
+
* imports run back to back to land under one job.
|
|
39
|
+
*/
|
|
40
|
+
export declare const TABLE_MAINTENANCE_WINDOW_MS = 60000;
|
|
41
|
+
interface MaintenanceQueue {
|
|
42
|
+
add(name: string, data: {
|
|
43
|
+
table: string;
|
|
44
|
+
}, options: Record<string, unknown>): Promise<unknown>;
|
|
45
|
+
close(): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
export interface TableMaintenanceProducer {
|
|
48
|
+
/** Ask for `VACUUM (ANALYZE)` of this module's bulk tables; answers whether it was asked. Never throws. */
|
|
49
|
+
request(): Promise<boolean>;
|
|
50
|
+
close(): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export declare function createTableMaintenanceProducer(input: {
|
|
53
|
+
readonly redis?: Redis | undefined;
|
|
54
|
+
/** A queue to use instead of one built on `redis` (tests). */
|
|
55
|
+
readonly queue?: MaintenanceQueue;
|
|
56
|
+
readonly onError?: (err: unknown) => void;
|
|
57
|
+
/** {@link TABLE_MAINTENANCE_WINDOW_MS} unless a test shortens it. */
|
|
58
|
+
readonly windowMs?: number;
|
|
59
|
+
}): TableMaintenanceProducer;
|
|
60
|
+
/**
|
|
61
|
+
* The job: `VACUUM (ANALYZE)` of one of this module's tables, on a connection
|
|
62
|
+
* outside any transaction. The name comes off a queue, so it is checked
|
|
63
|
+
* against the module's own list before it reaches the statement.
|
|
64
|
+
*/
|
|
65
|
+
export declare function vacuumAnalyzeTable(connection: {
|
|
66
|
+
execute(sql: string): Promise<unknown>;
|
|
67
|
+
}, table: string): Promise<void>;
|
|
68
|
+
export declare function startTableMaintenanceWorker(input: {
|
|
69
|
+
readonly processRunsWorkers: boolean;
|
|
70
|
+
readonly moduleQueueRedis: Redis | undefined;
|
|
71
|
+
readonly connection: () => {
|
|
72
|
+
execute(sql: string): Promise<unknown>;
|
|
73
|
+
};
|
|
74
|
+
readonly log: PlatformLogger;
|
|
75
|
+
readonly attach: (worker: Worker) => void;
|
|
76
|
+
}): boolean;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=table-maintenance-queue.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Queue, Worker } from 'bullmq';
|
|
2
|
+
import { enterSystemScope } from '@endora-commerce/platform/kernel';
|
|
3
|
+
/**
|
|
4
|
+
* Table maintenance after a catalogue import — issue #409 (Principle X).
|
|
5
|
+
*
|
|
6
|
+
* Right after a bulk write Postgres has neither fresh statistics nor a
|
|
7
|
+
* visibility map for the rows it rewrote, until autovacuum's first pass —
|
|
8
|
+
* which, for an import below its scale factor, may never come. The admin's
|
|
9
|
+
* ordered walk over `products_admin_order_<lang>` and its search count lean on
|
|
10
|
+
* index-only scans, and without the visibility map each of them fetches every
|
|
11
|
+
* heap tuple (spec 161 R14, `book-lines-page.bench.ts`). So an import asks for
|
|
12
|
+
* `VACUUM (ANALYZE)` of `products` and `product_variants`: `ANALYZE` alone does
|
|
13
|
+
* not set the visibility map, and `VACUUM` cannot run inside a transaction, so
|
|
14
|
+
* it is a job here and never a statement in the import.
|
|
15
|
+
*
|
|
16
|
+
* **One job per table per window.** The job is delayed by the window and
|
|
17
|
+
* deduplicated by its table, so every import while it waits is absorbed — the
|
|
18
|
+
* vacuum still runs after them, because it runs later. An import while it
|
|
19
|
+
* runs keeps one follow-up (`keepLastIfActive`). `import_export` reaches this
|
|
20
|
+
* through `catalogBulkImportPort` — the import is this module's write — and
|
|
21
|
+
* never names a table. `price_lists` keeps its own queue for its own tables.
|
|
22
|
+
*
|
|
23
|
+
* Best effort by design: the import has committed when it asks, so a queue
|
|
24
|
+
* that cannot be reached is logged and the import answers as usual —
|
|
25
|
+
* autovacuum remains the floor. Attached with `ctx.worker`, so it stops with
|
|
26
|
+
* the module (Principle XVII), and built only where the host says this process
|
|
27
|
+
* consumes queues.
|
|
28
|
+
*/
|
|
29
|
+
export const CATALOG_TABLE_MAINTENANCE_QUEUE = 'catalog.table-maintenance';
|
|
30
|
+
export const TABLE_MAINTENANCE_JOB = 'vacuum-analyze';
|
|
31
|
+
/** The tables a catalogue import rewrites. */
|
|
32
|
+
export const CATALOG_BULK_TABLES = ['products', 'product_variants'];
|
|
33
|
+
/**
|
|
34
|
+
* How long a request waits before its vacuum runs, and so how many writes one
|
|
35
|
+
* job absorbs. A minute is autovacuum's own default nap, and long enough for
|
|
36
|
+
* imports run back to back to land under one job.
|
|
37
|
+
*/
|
|
38
|
+
export const TABLE_MAINTENANCE_WINDOW_MS = 60_000;
|
|
39
|
+
const SCOPE_REASON = 'catalog: vacuum the tables an import rewrote';
|
|
40
|
+
export function createTableMaintenanceProducer(input) {
|
|
41
|
+
const windowMs = input.windowMs ?? TABLE_MAINTENANCE_WINDOW_MS;
|
|
42
|
+
let queue = input.queue;
|
|
43
|
+
return {
|
|
44
|
+
async request() {
|
|
45
|
+
if (queue === undefined) {
|
|
46
|
+
if (input.redis === undefined)
|
|
47
|
+
return false;
|
|
48
|
+
queue = new Queue(CATALOG_TABLE_MAINTENANCE_QUEUE, {
|
|
49
|
+
connection: input.redis,
|
|
50
|
+
defaultJobOptions: { removeOnComplete: true, removeOnFail: true, attempts: 2, backoff: { type: 'fixed', delay: 10_000 } },
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
for (const table of CATALOG_BULK_TABLES) {
|
|
55
|
+
await queue.add(TABLE_MAINTENANCE_JOB, { table }, { delay: windowMs, deduplication: { id: table, keepLastIfActive: true } });
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
input.onError?.(err);
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
async close() {
|
|
65
|
+
await queue?.close();
|
|
66
|
+
queue = input.queue;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The job: `VACUUM (ANALYZE)` of one of this module's tables, on a connection
|
|
72
|
+
* outside any transaction. The name comes off a queue, so it is checked
|
|
73
|
+
* against the module's own list before it reaches the statement.
|
|
74
|
+
*/
|
|
75
|
+
export async function vacuumAnalyzeTable(connection, table) {
|
|
76
|
+
if (!CATALOG_BULK_TABLES.includes(table)) {
|
|
77
|
+
throw new Error(`table maintenance: "${table}" is not a catalog table`);
|
|
78
|
+
}
|
|
79
|
+
await connection.execute(`vacuum (analyze) "${table}"`);
|
|
80
|
+
}
|
|
81
|
+
export function startTableMaintenanceWorker(input) {
|
|
82
|
+
if (!input.processRunsWorkers || input.moduleQueueRedis === undefined)
|
|
83
|
+
return false;
|
|
84
|
+
const worker = new Worker(CATALOG_TABLE_MAINTENANCE_QUEUE, (job) => enterSystemScope(SCOPE_REASON, async () => {
|
|
85
|
+
const start = Date.now();
|
|
86
|
+
await vacuumAnalyzeTable(input.connection(), job.data.table);
|
|
87
|
+
input.log.info({ table: job.data.table, ms: Date.now() - start }, 'catalog: vacuum (analyze) after an import');
|
|
88
|
+
}),
|
|
89
|
+
// One at a time: two vacuums of one table wait on each other anyway.
|
|
90
|
+
{ connection: input.moduleQueueRedis, concurrency: 1 });
|
|
91
|
+
worker.on('failed', (job, err) => {
|
|
92
|
+
input.log.error({ err, table: job?.data.table, attemptsMade: job?.attemptsMade }, 'catalog: vacuum (analyze) after an import failed; autovacuum remains the fallback');
|
|
93
|
+
});
|
|
94
|
+
input.attach(worker);
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=table-maintenance-queue.js.map
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature 175 (`specs/175-buyer-input-custom-fields/` research R-11) — the
|
|
3
|
+
* admin writes of this module's two custom-field hosts, for
|
|
4
|
+
* `check:custom-field-writes`: the category create and update, and the
|
|
5
|
+
* `product` exemption — a product's values are catalog attribute values, which
|
|
6
|
+
* the catalog's attribute surfaces write, not a custom-field bag on the product
|
|
7
|
+
* create or update. Read as a literal by the check: keep every entry a literal
|
|
8
|
+
* object.
|
|
9
|
+
*/
|
|
10
|
+
export declare const customFieldWrites: ({
|
|
11
|
+
entityType: "category";
|
|
12
|
+
kind: "create";
|
|
13
|
+
method: "POST";
|
|
14
|
+
path: string;
|
|
15
|
+
body: string;
|
|
16
|
+
exempt?: never;
|
|
17
|
+
} | {
|
|
18
|
+
entityType: "category";
|
|
19
|
+
kind: "update";
|
|
20
|
+
method: "PATCH";
|
|
21
|
+
path: string;
|
|
22
|
+
body: string;
|
|
23
|
+
exempt?: never;
|
|
24
|
+
} | {
|
|
25
|
+
entityType: "product";
|
|
26
|
+
kind: "create";
|
|
27
|
+
exempt: string;
|
|
28
|
+
method?: never;
|
|
29
|
+
path?: never;
|
|
30
|
+
body?: never;
|
|
31
|
+
} | {
|
|
32
|
+
entityType: "product";
|
|
33
|
+
kind: "update";
|
|
34
|
+
exempt: string;
|
|
35
|
+
method?: never;
|
|
36
|
+
path?: never;
|
|
37
|
+
body?: never;
|
|
38
|
+
})[];
|
|
1
39
|
/**
|
|
2
40
|
* Catalog module — feature 002 (and predecessors).
|
|
3
41
|
*
|
|
@@ -85,6 +123,7 @@ export declare const manifest: {
|
|
|
85
123
|
weight: number;
|
|
86
124
|
descriptionKey?: string | undefined;
|
|
87
125
|
requiredPermission?: string | undefined;
|
|
126
|
+
entryApiRoute?: string | undefined;
|
|
88
127
|
keywordsKey?: string | undefined;
|
|
89
128
|
}[] | undefined;
|
|
90
129
|
permissions?: {
|
|
@@ -128,7 +167,7 @@ export declare const manifest: {
|
|
|
128
167
|
category: string;
|
|
129
168
|
contexts: ("email" | "cms" | "invoice" | "newsletter" | "document")[];
|
|
130
169
|
fields: Record<string, {
|
|
131
|
-
type: "number" | "object" | "array" | "uuid" | "text" | "
|
|
170
|
+
type: "number" | "object" | "array" | "uuid" | "text" | "select" | "external" | "textarea" | "radio" | "richtext";
|
|
132
171
|
label?: string | undefined;
|
|
133
172
|
required?: boolean | undefined;
|
|
134
173
|
options?: {
|
|
@@ -187,6 +226,11 @@ export declare const manifest: {
|
|
|
187
226
|
consumers: ("admin" | "backend" | "storefront")[];
|
|
188
227
|
addressOf: "admin" | "backend" | "storefront" | null;
|
|
189
228
|
}[] | undefined;
|
|
229
|
+
hookableActions?: {
|
|
230
|
+
action: string;
|
|
231
|
+
objectType: string;
|
|
232
|
+
phases: ("beforeCommit" | "afterCommit")[];
|
|
233
|
+
}[] | undefined;
|
|
190
234
|
};
|
|
191
235
|
/**
|
|
192
236
|
* What this module offers the admin home dashboard's Recent Activity card —
|
package/dist/manifest.js
CHANGED
|
@@ -28,6 +28,41 @@ const demo = {
|
|
|
28
28
|
seed: async (context) => (await import('./backend/demo/seed.js')).seedDemo(context),
|
|
29
29
|
reset: async (context) => (await import('./backend/demo/reset.js')).resetDemo(context),
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Feature 175 (`specs/175-buyer-input-custom-fields/` research R-11) — the
|
|
33
|
+
* admin writes of this module's two custom-field hosts, for
|
|
34
|
+
* `check:custom-field-writes`: the category create and update, and the
|
|
35
|
+
* `product` exemption — a product's values are catalog attribute values, which
|
|
36
|
+
* the catalog's attribute surfaces write, not a custom-field bag on the product
|
|
37
|
+
* create or update. Read as a literal by the check: keep every entry a literal
|
|
38
|
+
* object.
|
|
39
|
+
*/
|
|
40
|
+
export const customFieldWrites = [
|
|
41
|
+
{
|
|
42
|
+
entityType: 'category',
|
|
43
|
+
kind: 'create',
|
|
44
|
+
method: 'POST',
|
|
45
|
+
path: '/api/v1/admin/catalog/categories',
|
|
46
|
+
body: 'createCategoryRequestSchema',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
entityType: 'category',
|
|
50
|
+
kind: 'update',
|
|
51
|
+
method: 'PATCH',
|
|
52
|
+
path: '/api/v1/admin/catalog/categories/:id',
|
|
53
|
+
body: 'updateCategoryRequestSchema',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
entityType: 'product',
|
|
57
|
+
kind: 'create',
|
|
58
|
+
exempt: 'host-managed: values are catalog attribute values written by the catalog\'s attribute surfaces',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
entityType: 'product',
|
|
62
|
+
kind: 'update',
|
|
63
|
+
exempt: 'host-managed: values are catalog attribute values written by the catalog\'s attribute surfaces',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
31
66
|
/**
|
|
32
67
|
* Catalog module — feature 002 (and predecessors).
|
|
33
68
|
*
|
|
@@ -524,15 +559,39 @@ export const manifest = defineModuleManifest({
|
|
|
524
559
|
{ code: 'ATTACHMENT_TYPE_CODE_TAKEN' },
|
|
525
560
|
{ code: 'ATTACHMENT_TYPE_IN_USE' },
|
|
526
561
|
{ code: 'ATTACHMENT_TYPE_NOT_FOUND' },
|
|
562
|
+
// Issue #624 (#86) — the attribute and option refusals the stored state
|
|
563
|
+
// makes, which were `VALIDATION_FAILED`. The in-use refusals name what
|
|
564
|
+
// still uses the attribute or option through their tokens.
|
|
565
|
+
{ code: 'ATTRIBUTE_DEFAULT_OPTION_TAKEN' },
|
|
566
|
+
{ code: 'ATTRIBUTE_IN_USE', tokens: ['attribute_sets', 'products'] },
|
|
567
|
+
{ code: 'ATTRIBUTE_KEY_TAKEN' },
|
|
527
568
|
{ code: 'ATTRIBUTE_NOT_FOUND' },
|
|
528
569
|
{ code: 'ATTRIBUTE_NOT_MASS_EDITABLE' },
|
|
570
|
+
{ code: 'ATTRIBUTE_OPTION_IN_USE', tokens: ['products'] },
|
|
571
|
+
{ code: 'ATTRIBUTE_OPTION_VALUE_TAKEN' },
|
|
572
|
+
{ code: 'ATTRIBUTE_OPTIONS_NOT_SUPPORTED' },
|
|
529
573
|
{ code: 'ATTRIBUTE_SET_CODE_TAKEN' },
|
|
530
574
|
{ code: 'ATTRIBUTE_SET_IN_USE' },
|
|
531
575
|
{ code: 'ATTRIBUTE_SET_NOT_FOUND' },
|
|
576
|
+
// Issue #624 (#86).
|
|
577
|
+
{ code: 'ATTRIBUTE_SLIDER_NOT_SUPPORTED' },
|
|
532
578
|
{ code: 'ATTRIBUTE_VALUE_REJECTED' },
|
|
579
|
+
// Issue #1218 (#86) — `page_builder`: a type change to or from Page Builder content.
|
|
580
|
+
{ code: 'ATTRIBUTE_VALUE_TYPE_LOCKED', tokens: ['page_builder'] },
|
|
581
|
+
{ code: 'ATTRIBUTE_VALUES_REQUIRED' },
|
|
582
|
+
// Issue #501 — the three reasons an undo of a bulk operation is refused.
|
|
583
|
+
{ code: 'BULK_OPERATION_ALREADY_REVERTED' },
|
|
584
|
+
{ code: 'BULK_OPERATION_NOT_REVERSIBLE' },
|
|
585
|
+
{ code: 'BULK_OPERATION_RUNNING' },
|
|
533
586
|
{ code: 'BULK_TOO_LARGE' },
|
|
534
587
|
{ code: 'BUNDLE_SLOT_NOT_FOUND' },
|
|
535
588
|
{ code: 'BUNDLE_SLOT_OPTION_NOT_FOUND' },
|
|
589
|
+
// Issue #624 (#86) — the category refusals, which were `VALIDATION_FAILED`.
|
|
590
|
+
{ code: 'CATEGORY_HAS_CHILDREN' },
|
|
591
|
+
{ code: 'CATEGORY_MOVE_CYCLE' },
|
|
592
|
+
{ code: 'CATEGORY_SLUG_TAKEN' },
|
|
593
|
+
// Issue #1218 (#86) — a capability a stored content attribute holds off.
|
|
594
|
+
{ code: 'CONTENT_ATTRIBUTE_CAPABILITY_LOCKED' },
|
|
536
595
|
{ code: 'FIELD_IMMUTABLE' },
|
|
537
596
|
{ code: 'FIELD_NOT_AT_SCOPE' },
|
|
538
597
|
{ code: 'FILTER_NOT_ALLOWED' },
|
|
@@ -540,11 +599,15 @@ export const manifest = defineModuleManifest({
|
|
|
540
599
|
{ code: 'GALLERY_LABEL_ALREADY_TAKEN' },
|
|
541
600
|
{ code: 'GALLERY_LABEL_LIMIT_EXCEEDED' },
|
|
542
601
|
{ code: 'GLOBAL_ONLY_FIELD' },
|
|
602
|
+
// Issue #624 (#86).
|
|
603
|
+
{ code: 'GROUPED_ITEM_ALREADY_EXISTS' },
|
|
543
604
|
{ code: 'GROUPED_ITEM_NOT_FOUND' },
|
|
544
605
|
{ code: 'INVALID_QUANTITY_RANGE' },
|
|
545
606
|
{ code: 'LINK_ALREADY_EXISTS' },
|
|
546
607
|
{ code: 'MAX_EXCEEDED' },
|
|
547
608
|
{ code: 'MIN_NOT_MET' },
|
|
609
|
+
// Issue #624 (#86) — a minimum on a product type that takes none.
|
|
610
|
+
{ code: 'MIN_ORDER_QUANTITY_NOT_SUPPORTED_FOR_TYPE' },
|
|
548
611
|
{ code: 'NESTED_COMPOSITE_NOT_ALLOWED' },
|
|
549
612
|
{ code: 'OPTION_ALREADY_EXISTS' },
|
|
550
613
|
{ code: 'PACKAGING_UNIT_BELOW_MINIMUM_QUANTITY' },
|
|
@@ -569,14 +632,19 @@ export const manifest = defineModuleManifest({
|
|
|
569
632
|
{ code: 'PRODUCT_NOT_FOUND' },
|
|
570
633
|
{ code: 'PRODUCT_NOT_IN_COMPARISON' },
|
|
571
634
|
{ code: 'PRODUCT_SAVED_VIEW_NAME_TAKEN' },
|
|
572
|
-
|
|
635
|
+
// Issue #624 (#86) — a variant for a product that is not configurable is
|
|
636
|
+
// refused under this code, its token choosing the sentence.
|
|
637
|
+
{ code: 'PRODUCT_TYPE_MISMATCH', tokens: ['variants_need_configurable'] },
|
|
573
638
|
{ code: 'PRODUCT_UNMANAGED_STOCK' },
|
|
574
639
|
{ code: 'SCOPE_INCOMPLETE' },
|
|
575
640
|
{ code: 'SCOPE_INVALID' },
|
|
576
641
|
{ code: 'SCOPED_VALUE_INVALID' },
|
|
577
642
|
{ code: 'SELECTION_TOO_LARGE' },
|
|
578
|
-
|
|
579
|
-
|
|
643
|
+
// Issue #624 (#86) — a grouped product naming itself as a child, and a
|
|
644
|
+
// SKU rename onto a SKU a product or a variant holds (was `400
|
|
645
|
+
// VALIDATION_FAILED` `sku_in_use`), take these codes with a token.
|
|
646
|
+
{ code: 'SELF_LINK_NOT_ALLOWED', tokens: ['grouped'] },
|
|
647
|
+
{ code: 'SKU_ALREADY_EXISTS', tokens: ['held_by_product', 'held_by_variant'] },
|
|
580
648
|
{ code: 'SKU_NOT_IN_ASSORTMENT' },
|
|
581
649
|
{ code: 'SYSTEM_ATTRIBUTE_SET_IMMUTABLE' },
|
|
582
650
|
{ code: 'TARGET_PRODUCT_NOT_FOUND' },
|
|
@@ -674,10 +742,12 @@ export const manifest = defineModuleManifest({
|
|
|
674
742
|
// the first.
|
|
675
743
|
'scope visibility per channel',
|
|
676
744
|
'publication window',
|
|
677
|
-
// The
|
|
678
|
-
//
|
|
679
|
-
//
|
|
680
|
-
|
|
745
|
+
// The Archive / Restore actions live on the product list and editor:
|
|
746
|
+
// "archive" and "restore" find them, and the Polish words are under
|
|
747
|
+
// `keywordsKey` (issue #573). "archived" is deliberately not here: it
|
|
748
|
+
// names the archived list, which `open-archived-products` opens, and
|
|
749
|
+
// this row's lower weight would rank it first (issue #501).
|
|
750
|
+
'archive restore',
|
|
681
751
|
// Feature 174 (FR-108) — the one scope switcher sets the editor's channel and language:
|
|
682
752
|
// "language" and "translation" find it; the Polish words are under `keywordsKey`.
|
|
683
753
|
'language translation',
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
/**
|
|
3
|
+
* `categories.main_image_asset_id`, its foreign key to `assets` and its index
|
|
4
|
+
* (feature 013 — a catalogue category's main image from the assets library),
|
|
5
|
+
* created by `catalog`.
|
|
6
|
+
*
|
|
7
|
+
* `Category.mainImageAssetId` maps the column. Until issue #611 only
|
|
8
|
+
* `assets_library`'s frozen `Migration20260505T102206AssetsLibraryInit`
|
|
9
|
+
* created the three, so another module's migration decided this module's
|
|
10
|
+
* schema — the write the migration table-ownership rule (feature 097, R2)
|
|
11
|
+
* refuses. Declaring `catalog` in `assets_library` was no remedy: this module
|
|
12
|
+
* declares `assets_library`, so that closes a cycle. The frozen init keeps
|
|
13
|
+
* its class name and lost only these statements, the shape D-226 gave the
|
|
14
|
+
* `cms_pages` index the same body carried
|
|
15
|
+
* (`Migration20260912T125709CmsPageBodyAssetRefIndex`) and feature 134 gave
|
|
16
|
+
* the stock columns `inventory` carried
|
|
17
|
+
* (`Migration20260925T125527CatalogInventoryColumns`).
|
|
18
|
+
*
|
|
19
|
+
* The closure holds in the direction the SQL runs: this module declares
|
|
20
|
+
* `assets_library`, so `assets` exists by the time this runs.
|
|
21
|
+
*
|
|
22
|
+
* **`if not exists` and a `pg_constraint` probe**, because every database
|
|
23
|
+
* that ran the frozen init already has all three, and there this must be a
|
|
24
|
+
* no-op. PostgreSQL has no `add constraint if not exists`; the probe form
|
|
25
|
+
* follows `20260925T125527`. Types, names and `on delete set null` are the
|
|
26
|
+
* frozen statements verbatim, so the two paths reach one schema.
|
|
27
|
+
*
|
|
28
|
+
* **`down()` is deliberately empty**, for `20260925T125527`'s reason:
|
|
29
|
+
* `categories` is created by the platform's `core_foundation_init`, which a
|
|
30
|
+
* hard uninstall of this module never reverts, so the rows outlive `catalog`
|
|
31
|
+
* and dropping the column would silently lose every category's main image.
|
|
32
|
+
*/
|
|
33
|
+
export declare class Migration20261114T000706CatalogCategoryMainImage extends Migration {
|
|
34
|
+
up(): Promise<void>;
|
|
35
|
+
down(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=20261114T000706_catalog_category_main_image.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
/**
|
|
3
|
+
* `categories.main_image_asset_id`, its foreign key to `assets` and its index
|
|
4
|
+
* (feature 013 — a catalogue category's main image from the assets library),
|
|
5
|
+
* created by `catalog`.
|
|
6
|
+
*
|
|
7
|
+
* `Category.mainImageAssetId` maps the column. Until issue #611 only
|
|
8
|
+
* `assets_library`'s frozen `Migration20260505T102206AssetsLibraryInit`
|
|
9
|
+
* created the three, so another module's migration decided this module's
|
|
10
|
+
* schema — the write the migration table-ownership rule (feature 097, R2)
|
|
11
|
+
* refuses. Declaring `catalog` in `assets_library` was no remedy: this module
|
|
12
|
+
* declares `assets_library`, so that closes a cycle. The frozen init keeps
|
|
13
|
+
* its class name and lost only these statements, the shape D-226 gave the
|
|
14
|
+
* `cms_pages` index the same body carried
|
|
15
|
+
* (`Migration20260912T125709CmsPageBodyAssetRefIndex`) and feature 134 gave
|
|
16
|
+
* the stock columns `inventory` carried
|
|
17
|
+
* (`Migration20260925T125527CatalogInventoryColumns`).
|
|
18
|
+
*
|
|
19
|
+
* The closure holds in the direction the SQL runs: this module declares
|
|
20
|
+
* `assets_library`, so `assets` exists by the time this runs.
|
|
21
|
+
*
|
|
22
|
+
* **`if not exists` and a `pg_constraint` probe**, because every database
|
|
23
|
+
* that ran the frozen init already has all three, and there this must be a
|
|
24
|
+
* no-op. PostgreSQL has no `add constraint if not exists`; the probe form
|
|
25
|
+
* follows `20260925T125527`. Types, names and `on delete set null` are the
|
|
26
|
+
* frozen statements verbatim, so the two paths reach one schema.
|
|
27
|
+
*
|
|
28
|
+
* **`down()` is deliberately empty**, for `20260925T125527`'s reason:
|
|
29
|
+
* `categories` is created by the platform's `core_foundation_init`, which a
|
|
30
|
+
* hard uninstall of this module never reverts, so the rows outlive `catalog`
|
|
31
|
+
* and dropping the column would silently lose every category's main image.
|
|
32
|
+
*/
|
|
33
|
+
export class Migration20261114T000706CatalogCategoryMainImage extends Migration {
|
|
34
|
+
async up() {
|
|
35
|
+
this.addSql('alter table "categories" add column if not exists "main_image_asset_id" uuid null;');
|
|
36
|
+
this.addSql(`
|
|
37
|
+
do $$
|
|
38
|
+
begin
|
|
39
|
+
if not exists (
|
|
40
|
+
select 1 from pg_constraint
|
|
41
|
+
where "conname" = 'categories_main_image_fk'
|
|
42
|
+
and "conrelid" = '"categories"'::regclass
|
|
43
|
+
) then
|
|
44
|
+
alter table "categories"
|
|
45
|
+
add constraint "categories_main_image_fk" foreign key ("main_image_asset_id")
|
|
46
|
+
references "assets" ("id") on delete set null;
|
|
47
|
+
end if;
|
|
48
|
+
end $$;
|
|
49
|
+
`);
|
|
50
|
+
this.addSql('create index if not exists "categories_main_image_asset_id_index" on "categories" ("main_image_asset_id");');
|
|
51
|
+
}
|
|
52
|
+
async down() {
|
|
53
|
+
// Intentionally empty — see the class comment.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=20261114T000706_catalog_category_main_image.js.map
|
|
@@ -68,6 +68,7 @@ import { Migration20261030T113908CatalogScopeModelMedia } from './20261030T11390
|
|
|
68
68
|
import { Migration20261104T121504CatalogProductContentValues } from './20261104T121504_catalog_product_content_values.js';
|
|
69
69
|
import { Migration20261107T093126CatalogSkuUniqueAmongLive } from './20261107T093126_catalog_sku_unique_among_live.js';
|
|
70
70
|
import { Migration20261107T120008CatalogProductCreatedAtMilliseconds } from './20261107T120008_catalog_product_created_at_milliseconds.js';
|
|
71
|
+
import { Migration20261114T000706CatalogCategoryMainImage } from './20261114T000706_catalog_category_main_image.js';
|
|
71
72
|
export declare const migrations: (typeof Migration20260429T070004CatalogProductAttributeExtensions)[];
|
|
72
|
-
export { Migration20260429T064146CatalogAttributeSetsInit, Migration20260429T070004CatalogProductAttributeExtensions, Migration20260429T102322CatalogProductTypeAndVirtualFields, Migration20260429T111839CatalogGalleryItemsAndLabels, Migration20260429T112543CatalogProductAttachments, Migration20260429T123726CatalogProductLinks, Migration20260429T130803CatalogGroupedAndBundle, Migration20260501T185835CatalogProductAttributeIsComparable, Migration20260505T060113CatalogAttributeOptionsAndFlags, Migration20260515T082629CatalogAttributeMassEditable, Migration20260526T124736CatalogProductStatusInactive, Migration20260611T140346CatalogProductValueOverridesInit, Migration20260611T140400CatalogAttributeQuickSearchable, Migration20260611T140407CatalogBulkOperations, Migration20260611T140408CatalogBulkOperationLogs, Migration20260611T140412CatalogProductPackagingUnits, Migration20260718T060659CatalogBulkOperationRevertState, Migration20260718T200343CatalogCategoryCustomFieldValues, Migration20260723T230401CatalogAttributesOnCustomFields, Migration20260804T152604CatalogWidenProductSku, Migration20260804T160244CatalogCategoryActivation, Migration20260912T094557CatalogSalesChannelProducts, Migration20260912T094623CatalogSalesChannelCategories, Migration20260925T125527CatalogInventoryColumns, Migration20261008T080839CatalogProductAttributeIsPriceRule, Migration20261008T092714CatalogCategoryContent, Migration20261014T170531CatalogProductListSavedViews, Migration20261016T082008CatalogOrderRules, Migration20261022T035133CatalogProductScopes, Migration20261022T054223CatalogProductUrlKeys, Migration20261022T111811CatalogPriceFieldsRemoved, Migration20261022T182523CatalogAdminNameKeys, Migration20261025T222634CatalogProductStatusDropDraft, Migration20261026T033453CatalogProductMediaScopes, Migration20261026T084533CatalogAttachmentPackagingTranslations, Migration20261030T113855CatalogScopeModelTexts, Migration20261030T113859CatalogScopeModelOrderRules, Migration20261030T113904CatalogScopeModelUrlKeys, Migration20261030T113908CatalogScopeModelMedia, Migration20261104T121504CatalogProductContentValues, Migration20261107T093126CatalogSkuUniqueAmongLive, Migration20261107T120008CatalogProductCreatedAtMilliseconds, };
|
|
73
|
+
export { Migration20260429T064146CatalogAttributeSetsInit, Migration20260429T070004CatalogProductAttributeExtensions, Migration20260429T102322CatalogProductTypeAndVirtualFields, Migration20260429T111839CatalogGalleryItemsAndLabels, Migration20260429T112543CatalogProductAttachments, Migration20260429T123726CatalogProductLinks, Migration20260429T130803CatalogGroupedAndBundle, Migration20260501T185835CatalogProductAttributeIsComparable, Migration20260505T060113CatalogAttributeOptionsAndFlags, Migration20260515T082629CatalogAttributeMassEditable, Migration20260526T124736CatalogProductStatusInactive, Migration20260611T140346CatalogProductValueOverridesInit, Migration20260611T140400CatalogAttributeQuickSearchable, Migration20260611T140407CatalogBulkOperations, Migration20260611T140408CatalogBulkOperationLogs, Migration20260611T140412CatalogProductPackagingUnits, Migration20260718T060659CatalogBulkOperationRevertState, Migration20260718T200343CatalogCategoryCustomFieldValues, Migration20260723T230401CatalogAttributesOnCustomFields, Migration20260804T152604CatalogWidenProductSku, Migration20260804T160244CatalogCategoryActivation, Migration20260912T094557CatalogSalesChannelProducts, Migration20260912T094623CatalogSalesChannelCategories, Migration20260925T125527CatalogInventoryColumns, Migration20261008T080839CatalogProductAttributeIsPriceRule, Migration20261008T092714CatalogCategoryContent, Migration20261014T170531CatalogProductListSavedViews, Migration20261016T082008CatalogOrderRules, Migration20261022T035133CatalogProductScopes, Migration20261022T054223CatalogProductUrlKeys, Migration20261022T111811CatalogPriceFieldsRemoved, Migration20261022T182523CatalogAdminNameKeys, Migration20261025T222634CatalogProductStatusDropDraft, Migration20261026T033453CatalogProductMediaScopes, Migration20261026T084533CatalogAttachmentPackagingTranslations, Migration20261030T113855CatalogScopeModelTexts, Migration20261030T113859CatalogScopeModelOrderRules, Migration20261030T113904CatalogScopeModelUrlKeys, Migration20261030T113908CatalogScopeModelMedia, Migration20261104T121504CatalogProductContentValues, Migration20261107T093126CatalogSkuUniqueAmongLive, Migration20261107T120008CatalogProductCreatedAtMilliseconds, Migration20261114T000706CatalogCategoryMainImage, };
|
|
73
74
|
//# sourceMappingURL=index.d.ts.map
|