@unifiedcommerce/core 0.4.4 → 0.5.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/adapters/console-email.d.ts +23 -0
- package/dist/adapters/console-email.d.ts.map +1 -0
- package/dist/adapters/console-email.js +38 -0
- package/dist/auth/access.d.ts +101 -0
- package/dist/auth/access.d.ts.map +1 -0
- package/dist/auth/access.js +128 -0
- package/dist/auth/auth-schema.d.ts +1475 -0
- package/dist/auth/auth-schema.d.ts.map +1 -0
- package/dist/auth/auth-schema.js +124 -0
- package/dist/auth/middleware.d.ts +5 -0
- package/dist/auth/middleware.d.ts.map +1 -0
- package/dist/auth/middleware.js +141 -0
- package/dist/auth/org.d.ts +22 -0
- package/dist/auth/org.d.ts.map +1 -0
- package/dist/auth/org.js +36 -0
- package/dist/auth/permissions.d.ts +4 -0
- package/dist/auth/permissions.d.ts.map +1 -0
- package/dist/auth/permissions.js +24 -0
- package/dist/auth/setup.d.ts +29 -0
- package/dist/auth/setup.d.ts.map +1 -0
- package/dist/auth/setup.js +144 -0
- package/dist/auth/system-actor.d.ts +7 -0
- package/dist/auth/system-actor.d.ts.map +1 -0
- package/dist/auth/system-actor.js +17 -0
- package/dist/auth/types.d.ts +11 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +1 -0
- package/dist/config/defaults.d.ts +3 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +80 -0
- package/dist/config/define-config.d.ts +9 -0
- package/dist/config/define-config.d.ts.map +1 -0
- package/dist/config/define-config.js +44 -0
- package/dist/config/types.d.ts +327 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +1 -0
- package/dist/generated/plugin-manifest.d.ts +48 -0
- package/dist/generated/plugin-manifest.d.ts.map +1 -0
- package/dist/generated/plugin-manifest.js +20 -0
- package/dist/hooks/checkout-completion.d.ts +58 -0
- package/dist/hooks/checkout-completion.d.ts.map +1 -0
- package/dist/hooks/checkout-completion.js +137 -0
- package/dist/hooks/checkout.d.ts +99 -0
- package/dist/hooks/checkout.d.ts.map +1 -0
- package/dist/hooks/checkout.js +317 -0
- package/dist/hooks/order-emails.d.ts +16 -0
- package/dist/hooks/order-emails.d.ts.map +1 -0
- package/dist/hooks/order-emails.js +44 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/interfaces/mcp/agent-prompt.d.ts +16 -0
- package/dist/interfaces/mcp/agent-prompt.d.ts.map +1 -0
- package/dist/interfaces/mcp/agent-prompt.js +172 -0
- package/dist/interfaces/mcp/context-enrichment.d.ts +39 -0
- package/dist/interfaces/mcp/context-enrichment.d.ts.map +1 -0
- package/dist/interfaces/mcp/context-enrichment.js +119 -0
- package/dist/interfaces/mcp/server.d.ts +5 -0
- package/dist/interfaces/mcp/server.d.ts.map +1 -0
- package/dist/interfaces/mcp/server.js +30 -0
- package/dist/interfaces/mcp/tool-builder.d.ts +120 -0
- package/dist/interfaces/mcp/tool-builder.d.ts.map +1 -0
- package/dist/interfaces/mcp/tool-builder.js +224 -0
- package/dist/interfaces/mcp/tools/analytics.d.ts +42 -0
- package/dist/interfaces/mcp/tools/analytics.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/analytics.js +70 -0
- package/dist/interfaces/mcp/tools/cart.d.ts +14 -0
- package/dist/interfaces/mcp/tools/cart.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/cart.js +47 -0
- package/dist/interfaces/mcp/tools/catalog.d.ts +53 -0
- package/dist/interfaces/mcp/tools/catalog.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/catalog.js +284 -0
- package/dist/interfaces/mcp/tools/index.d.ts +3 -0
- package/dist/interfaces/mcp/tools/index.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/index.js +20 -0
- package/dist/interfaces/mcp/tools/inventory.d.ts +27 -0
- package/dist/interfaces/mcp/tools/inventory.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/inventory.js +143 -0
- package/dist/interfaces/mcp/tools/orders.d.ts +18 -0
- package/dist/interfaces/mcp/tools/orders.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/orders.js +82 -0
- package/dist/interfaces/mcp/tools/pricing.d.ts +29 -0
- package/dist/interfaces/mcp/tools/pricing.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/pricing.js +90 -0
- package/dist/interfaces/mcp/tools/promotions.d.ts +44 -0
- package/dist/interfaces/mcp/tools/promotions.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/promotions.js +109 -0
- package/dist/interfaces/mcp/tools/registry.d.ts +32 -0
- package/dist/interfaces/mcp/tools/registry.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/registry.js +55 -0
- package/dist/interfaces/mcp/tools/search.d.ts +14 -0
- package/dist/interfaces/mcp/tools/search.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/search.js +39 -0
- package/dist/interfaces/mcp/tools/webhooks.d.ts +15 -0
- package/dist/interfaces/mcp/tools/webhooks.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/webhooks.js +48 -0
- package/dist/interfaces/mcp/transport.d.ts +20 -0
- package/dist/interfaces/mcp/transport.d.ts.map +1 -0
- package/dist/interfaces/mcp/transport.js +99 -0
- package/dist/interfaces/rest/customer-portal.d.ts +5 -0
- package/dist/interfaces/rest/customer-portal.d.ts.map +1 -0
- package/dist/interfaces/rest/customer-portal.js +206 -0
- package/dist/interfaces/rest/router.d.ts +164 -0
- package/dist/interfaces/rest/router.d.ts.map +1 -0
- package/dist/interfaces/rest/router.js +259 -0
- package/dist/interfaces/rest/routes/admin-jobs.d.ts +5 -0
- package/dist/interfaces/rest/routes/admin-jobs.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/admin-jobs.js +48 -0
- package/dist/interfaces/rest/routes/audit.d.ts +5 -0
- package/dist/interfaces/rest/routes/audit.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/audit.js +43 -0
- package/dist/interfaces/rest/routes/carts.d.ts +5 -0
- package/dist/interfaces/rest/routes/carts.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/carts.js +55 -0
- package/dist/interfaces/rest/routes/catalog.d.ts +5 -0
- package/dist/interfaces/rest/routes/catalog.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/catalog.js +256 -0
- package/dist/interfaces/rest/routes/checkout.d.ts +5 -0
- package/dist/interfaces/rest/routes/checkout.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/checkout.js +216 -0
- package/dist/interfaces/rest/routes/customers.d.ts +5 -0
- package/dist/interfaces/rest/routes/customers.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/customers.js +78 -0
- package/dist/interfaces/rest/routes/entity-aliases.d.ts +18 -0
- package/dist/interfaces/rest/routes/entity-aliases.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/entity-aliases.js +39 -0
- package/dist/interfaces/rest/routes/inventory.d.ts +5 -0
- package/dist/interfaces/rest/routes/inventory.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/inventory.js +74 -0
- package/dist/interfaces/rest/routes/media.d.ts +5 -0
- package/dist/interfaces/rest/routes/media.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/media.js +65 -0
- package/dist/interfaces/rest/routes/orders.d.ts +5 -0
- package/dist/interfaces/rest/routes/orders.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/orders.js +64 -0
- package/dist/interfaces/rest/routes/payments.d.ts +5 -0
- package/dist/interfaces/rest/routes/payments.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/payments.js +45 -0
- package/dist/interfaces/rest/routes/pricing.d.ts +5 -0
- package/dist/interfaces/rest/routes/pricing.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/pricing.js +48 -0
- package/dist/interfaces/rest/routes/promotions.d.ts +5 -0
- package/dist/interfaces/rest/routes/promotions.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/promotions.js +76 -0
- package/dist/interfaces/rest/routes/search.d.ts +5 -0
- package/dist/interfaces/rest/routes/search.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/search.js +60 -0
- package/dist/interfaces/rest/routes/webhooks.d.ts +5 -0
- package/dist/interfaces/rest/routes/webhooks.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/webhooks.js +39 -0
- package/dist/interfaces/rest/schemas/admin-jobs.d.ts +327 -0
- package/dist/interfaces/rest/schemas/admin-jobs.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/admin-jobs.js +37 -0
- package/dist/interfaces/rest/schemas/audit.d.ts +59 -0
- package/dist/interfaces/rest/schemas/audit.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/audit.js +43 -0
- package/dist/interfaces/rest/schemas/carts.d.ts +1456 -0
- package/dist/interfaces/rest/schemas/carts.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/carts.js +109 -0
- package/dist/interfaces/rest/schemas/catalog.d.ts +5452 -0
- package/dist/interfaces/rest/schemas/catalog.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/catalog.js +397 -0
- package/dist/interfaces/rest/schemas/checkout.d.ts +160 -0
- package/dist/interfaces/rest/schemas/checkout.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/checkout.js +60 -0
- package/dist/interfaces/rest/schemas/customer-portal.d.ts +2203 -0
- package/dist/interfaces/rest/schemas/customer-portal.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/customer-portal.js +177 -0
- package/dist/interfaces/rest/schemas/customers.d.ts +422 -0
- package/dist/interfaces/rest/schemas/customers.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/customers.js +150 -0
- package/dist/interfaces/rest/schemas/inventory.d.ts +561 -0
- package/dist/interfaces/rest/schemas/inventory.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/inventory.js +148 -0
- package/dist/interfaces/rest/schemas/media.d.ts +303 -0
- package/dist/interfaces/rest/schemas/media.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/media.js +69 -0
- package/dist/interfaces/rest/schemas/orders.d.ts +1792 -0
- package/dist/interfaces/rest/schemas/orders.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/orders.js +93 -0
- package/dist/interfaces/rest/schemas/pricing.d.ts +256 -0
- package/dist/interfaces/rest/schemas/pricing.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/pricing.js +72 -0
- package/dist/interfaces/rest/schemas/promotions.d.ts +374 -0
- package/dist/interfaces/rest/schemas/promotions.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/promotions.js +104 -0
- package/dist/interfaces/rest/schemas/responses.d.ts +4086 -0
- package/dist/interfaces/rest/schemas/responses.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/responses.js +74 -0
- package/dist/interfaces/rest/schemas/search.d.ts +247 -0
- package/dist/interfaces/rest/schemas/search.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/search.js +55 -0
- package/dist/interfaces/rest/schemas/shared.d.ts +95 -0
- package/dist/interfaces/rest/schemas/shared.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/shared.js +51 -0
- package/dist/interfaces/rest/schemas/webhooks.d.ts +221 -0
- package/dist/interfaces/rest/schemas/webhooks.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/webhooks.js +62 -0
- package/dist/interfaces/rest/utils.d.ts +45 -0
- package/dist/interfaces/rest/utils.d.ts.map +1 -0
- package/dist/interfaces/rest/utils.js +71 -0
- package/dist/interfaces/rest/webhook-router.d.ts +41 -0
- package/dist/interfaces/rest/webhook-router.d.ts.map +1 -0
- package/dist/interfaces/rest/webhook-router.js +36 -0
- package/dist/kernel/compensation/executor.d.ts +21 -0
- package/dist/kernel/compensation/executor.d.ts.map +1 -0
- package/dist/kernel/compensation/executor.js +36 -0
- package/dist/kernel/compensation/types.d.ts +25 -0
- package/dist/kernel/compensation/types.d.ts.map +1 -0
- package/dist/kernel/compensation/types.js +1 -0
- package/dist/kernel/database/adapter.d.ts +18 -0
- package/dist/kernel/database/adapter.d.ts.map +1 -0
- package/dist/kernel/database/adapter.js +3 -0
- package/dist/kernel/database/drizzle-db.d.ts +49 -0
- package/dist/kernel/database/drizzle-db.d.ts.map +1 -0
- package/dist/kernel/database/drizzle-db.js +20 -0
- package/dist/kernel/database/migrate.d.ts +38 -0
- package/dist/kernel/database/migrate.d.ts.map +1 -0
- package/dist/kernel/database/migrate.js +61 -0
- package/dist/kernel/database/plugin-types.d.ts +32 -0
- package/dist/kernel/database/plugin-types.d.ts.map +1 -0
- package/dist/kernel/database/plugin-types.js +10 -0
- package/dist/kernel/database/schema.d.ts +24 -0
- package/dist/kernel/database/schema.d.ts.map +1 -0
- package/dist/kernel/database/schema.js +36 -0
- package/dist/kernel/database/scoped-db.d.ts +20 -0
- package/dist/kernel/database/scoped-db.d.ts.map +1 -0
- package/dist/kernel/database/scoped-db.js +62 -0
- package/dist/kernel/database/tx-context.d.ts +15 -0
- package/dist/kernel/database/tx-context.d.ts.map +1 -0
- package/dist/kernel/database/tx-context.js +19 -0
- package/dist/kernel/error-mapper.d.ts +3 -0
- package/dist/kernel/error-mapper.d.ts.map +1 -0
- package/dist/kernel/error-mapper.js +12 -0
- package/dist/kernel/errors.d.ts +38 -0
- package/dist/kernel/errors.d.ts.map +1 -0
- package/dist/kernel/errors.js +69 -0
- package/dist/kernel/factory/repository-factory.d.ts +71 -0
- package/dist/kernel/factory/repository-factory.d.ts.map +1 -0
- package/dist/kernel/factory/repository-factory.js +138 -0
- package/dist/kernel/hooks/create-context.d.ts +25 -0
- package/dist/kernel/hooks/create-context.d.ts.map +1 -0
- package/dist/kernel/hooks/create-context.js +22 -0
- package/dist/kernel/hooks/executor.d.ts +12 -0
- package/dist/kernel/hooks/executor.d.ts.map +1 -0
- package/dist/kernel/hooks/executor.js +50 -0
- package/dist/kernel/hooks/registry.d.ts +28 -0
- package/dist/kernel/hooks/registry.d.ts.map +1 -0
- package/dist/kernel/hooks/registry.js +58 -0
- package/dist/kernel/hooks/types.d.ts +37 -0
- package/dist/kernel/hooks/types.d.ts.map +1 -0
- package/dist/kernel/hooks/types.js +1 -0
- package/dist/kernel/http-error.d.ts +30 -0
- package/dist/kernel/http-error.d.ts.map +1 -0
- package/dist/kernel/http-error.js +35 -0
- package/dist/kernel/jobs/adapter.d.ts +25 -0
- package/dist/kernel/jobs/adapter.d.ts.map +1 -0
- package/dist/kernel/jobs/adapter.js +9 -0
- package/dist/kernel/jobs/drizzle-adapter.d.ts +15 -0
- package/dist/kernel/jobs/drizzle-adapter.d.ts.map +1 -0
- package/dist/kernel/jobs/drizzle-adapter.js +42 -0
- package/dist/kernel/jobs/runner.d.ts +24 -0
- package/dist/kernel/jobs/runner.d.ts.map +1 -0
- package/dist/kernel/jobs/runner.js +114 -0
- package/dist/kernel/jobs/schema.d.ts +280 -0
- package/dist/kernel/jobs/schema.d.ts.map +1 -0
- package/dist/kernel/jobs/schema.js +37 -0
- package/dist/kernel/jobs/types.d.ts +30 -0
- package/dist/kernel/jobs/types.d.ts.map +1 -0
- package/dist/kernel/jobs/types.js +1 -0
- package/dist/kernel/local-api.d.ts +103 -0
- package/dist/kernel/local-api.d.ts.map +1 -0
- package/dist/kernel/local-api.js +89 -0
- package/dist/kernel/plugin/manifest.d.ts +90 -0
- package/dist/kernel/plugin/manifest.d.ts.map +1 -0
- package/dist/kernel/plugin/manifest.js +169 -0
- package/dist/kernel/query/executor.d.ts +21 -0
- package/dist/kernel/query/executor.d.ts.map +1 -0
- package/dist/kernel/query/executor.js +128 -0
- package/dist/kernel/query/registry.d.ts +33 -0
- package/dist/kernel/query/registry.d.ts.map +1 -0
- package/dist/kernel/query/registry.js +20 -0
- package/dist/kernel/result.d.ts +36 -0
- package/dist/kernel/result.d.ts.map +1 -0
- package/dist/kernel/result.js +16 -0
- package/dist/kernel/schema/extra-columns.d.ts +23 -0
- package/dist/kernel/schema/extra-columns.d.ts.map +1 -0
- package/dist/kernel/schema/extra-columns.js +10 -0
- package/dist/kernel/service-registry.d.ts +109 -0
- package/dist/kernel/service-registry.d.ts.map +1 -0
- package/dist/kernel/service-registry.js +26 -0
- package/dist/kernel/service-timing.d.ts +25 -0
- package/dist/kernel/service-timing.d.ts.map +1 -0
- package/dist/kernel/service-timing.js +62 -0
- package/dist/kernel/state-machine/machine.d.ts +24 -0
- package/dist/kernel/state-machine/machine.d.ts.map +1 -0
- package/dist/kernel/state-machine/machine.js +70 -0
- package/dist/modules/analytics/drizzle-adapter.d.ts +13 -0
- package/dist/modules/analytics/drizzle-adapter.d.ts.map +1 -0
- package/dist/modules/analytics/drizzle-adapter.js +358 -0
- package/dist/modules/analytics/hooks.d.ts +13 -0
- package/dist/modules/analytics/hooks.d.ts.map +1 -0
- package/dist/modules/analytics/hooks.js +12 -0
- package/dist/modules/analytics/models.d.ts +14 -0
- package/dist/modules/analytics/models.d.ts.map +1 -0
- package/dist/modules/analytics/models.js +118 -0
- package/dist/modules/analytics/repository/index.d.ts +5 -0
- package/dist/modules/analytics/repository/index.d.ts.map +1 -0
- package/dist/modules/analytics/repository/index.js +1 -0
- package/dist/modules/analytics/service.d.ts +45 -0
- package/dist/modules/analytics/service.d.ts.map +1 -0
- package/dist/modules/analytics/service.js +196 -0
- package/dist/modules/analytics/types.d.ts +119 -0
- package/dist/modules/analytics/types.d.ts.map +1 -0
- package/dist/modules/analytics/types.js +25 -0
- package/dist/modules/audit/hooks.d.ts +7 -0
- package/dist/modules/audit/hooks.d.ts.map +1 -0
- package/dist/modules/audit/hooks.js +67 -0
- package/dist/modules/audit/schema.d.ts +178 -0
- package/dist/modules/audit/schema.d.ts.map +1 -0
- package/dist/modules/audit/schema.js +21 -0
- package/dist/modules/audit/service.d.ts +38 -0
- package/dist/modules/audit/service.d.ts.map +1 -0
- package/dist/modules/audit/service.js +109 -0
- package/dist/modules/cart/access.d.ts +11 -0
- package/dist/modules/cart/access.d.ts.map +1 -0
- package/dist/modules/cart/access.js +18 -0
- package/dist/modules/cart/matcher.d.ts +20 -0
- package/dist/modules/cart/matcher.d.ts.map +1 -0
- package/dist/modules/cart/matcher.js +2 -0
- package/dist/modules/cart/repository/index.d.ts +45 -0
- package/dist/modules/cart/repository/index.d.ts.map +1 -0
- package/dist/modules/cart/repository/index.js +158 -0
- package/dist/modules/cart/schema.d.ts +359 -0
- package/dist/modules/cart/schema.d.ts.map +1 -0
- package/dist/modules/cart/schema.js +40 -0
- package/dist/modules/cart/schemas.d.ts +29 -0
- package/dist/modules/cart/schemas.d.ts.map +1 -0
- package/dist/modules/cart/schemas.js +14 -0
- package/dist/modules/cart/service.d.ts +63 -0
- package/dist/modules/cart/service.d.ts.map +1 -0
- package/dist/modules/cart/service.js +339 -0
- package/dist/modules/catalog/repository/index.d.ts +106 -0
- package/dist/modules/catalog/repository/index.d.ts.map +1 -0
- package/dist/modules/catalog/repository/index.js +455 -0
- package/dist/modules/catalog/schema.d.ts +1193 -0
- package/dist/modules/catalog/schema.d.ts.map +1 -0
- package/dist/modules/catalog/schema.js +149 -0
- package/dist/modules/catalog/schemas.d.ts +81 -0
- package/dist/modules/catalog/schemas.d.ts.map +1 -0
- package/dist/modules/catalog/schemas.js +62 -0
- package/dist/modules/catalog/service.d.ts +165 -0
- package/dist/modules/catalog/service.d.ts.map +1 -0
- package/dist/modules/catalog/service.js +775 -0
- package/dist/modules/customers/repository/index.d.ts +47 -0
- package/dist/modules/customers/repository/index.d.ts.map +1 -0
- package/dist/modules/customers/repository/index.js +206 -0
- package/dist/modules/customers/schema.d.ts +560 -0
- package/dist/modules/customers/schema.d.ts.map +1 -0
- package/dist/modules/customers/schema.js +60 -0
- package/dist/modules/customers/service.d.ts +27 -0
- package/dist/modules/customers/service.d.ts.map +1 -0
- package/dist/modules/customers/service.js +106 -0
- package/dist/modules/fulfillment/repository/index.d.ts +63 -0
- package/dist/modules/fulfillment/repository/index.d.ts.map +1 -0
- package/dist/modules/fulfillment/repository/index.js +268 -0
- package/dist/modules/fulfillment/schema.d.ts +655 -0
- package/dist/modules/fulfillment/schema.d.ts.map +1 -0
- package/dist/modules/fulfillment/schema.js +83 -0
- package/dist/modules/fulfillment/service.d.ts +58 -0
- package/dist/modules/fulfillment/service.d.ts.map +1 -0
- package/dist/modules/fulfillment/service.js +338 -0
- package/dist/modules/fulfillment/types.d.ts +44 -0
- package/dist/modules/fulfillment/types.d.ts.map +1 -0
- package/dist/modules/fulfillment/types.js +1 -0
- package/dist/modules/inventory/repository/index.d.ts +81 -0
- package/dist/modules/inventory/repository/index.d.ts.map +1 -0
- package/dist/modules/inventory/repository/index.js +310 -0
- package/dist/modules/inventory/schema.d.ts +570 -0
- package/dist/modules/inventory/schema.d.ts.map +1 -0
- package/dist/modules/inventory/schema.js +69 -0
- package/dist/modules/inventory/schemas.d.ts +31 -0
- package/dist/modules/inventory/schemas.d.ts.map +1 -0
- package/dist/modules/inventory/schemas.js +28 -0
- package/dist/modules/inventory/service.d.ts +69 -0
- package/dist/modules/inventory/service.d.ts.map +1 -0
- package/dist/modules/inventory/service.js +283 -0
- package/dist/modules/media/adapter.d.ts +16 -0
- package/dist/modules/media/adapter.d.ts.map +1 -0
- package/dist/modules/media/adapter.js +1 -0
- package/dist/modules/media/repository/index.d.ts +35 -0
- package/dist/modules/media/repository/index.d.ts.map +1 -0
- package/dist/modules/media/repository/index.js +176 -0
- package/dist/modules/media/schema.d.ts +289 -0
- package/dist/modules/media/schema.d.ts.map +1 -0
- package/dist/modules/media/schema.js +35 -0
- package/dist/modules/media/service.d.ts +42 -0
- package/dist/modules/media/service.d.ts.map +1 -0
- package/dist/modules/media/service.js +89 -0
- package/dist/modules/orders/repository/index.d.ts +48 -0
- package/dist/modules/orders/repository/index.d.ts.map +1 -0
- package/dist/modules/orders/repository/index.js +199 -0
- package/dist/modules/orders/schema.d.ts +672 -0
- package/dist/modules/orders/schema.d.ts.map +1 -0
- package/dist/modules/orders/schema.js +63 -0
- package/dist/modules/orders/service.d.ts +85 -0
- package/dist/modules/orders/service.d.ts.map +1 -0
- package/dist/modules/orders/service.js +313 -0
- package/dist/modules/orders/stale-order-cleanup.d.ts +27 -0
- package/dist/modules/orders/stale-order-cleanup.d.ts.map +1 -0
- package/dist/modules/orders/stale-order-cleanup.js +55 -0
- package/dist/modules/organization/service.d.ts +53 -0
- package/dist/modules/organization/service.d.ts.map +1 -0
- package/dist/modules/organization/service.js +151 -0
- package/dist/modules/payments/adapter.d.ts +42 -0
- package/dist/modules/payments/adapter.d.ts.map +1 -0
- package/dist/modules/payments/adapter.js +1 -0
- package/dist/modules/payments/repository/index.d.ts +5 -0
- package/dist/modules/payments/repository/index.d.ts.map +1 -0
- package/dist/modules/payments/repository/index.js +1 -0
- package/dist/modules/payments/service.d.ts +23 -0
- package/dist/modules/payments/service.d.ts.map +1 -0
- package/dist/modules/payments/service.js +72 -0
- package/dist/modules/pricing/repository/index.d.ts +34 -0
- package/dist/modules/pricing/repository/index.d.ts.map +1 -0
- package/dist/modules/pricing/repository/index.js +176 -0
- package/dist/modules/pricing/schema.d.ts +565 -0
- package/dist/modules/pricing/schema.d.ts.map +1 -0
- package/dist/modules/pricing/schema.js +57 -0
- package/dist/modules/pricing/schemas.d.ts +37 -0
- package/dist/modules/pricing/schemas.d.ts.map +1 -0
- package/dist/modules/pricing/schemas.js +30 -0
- package/dist/modules/pricing/service.d.ts +62 -0
- package/dist/modules/pricing/service.d.ts.map +1 -0
- package/dist/modules/pricing/service.js +308 -0
- package/dist/modules/promotions/repository/index.d.ts +41 -0
- package/dist/modules/promotions/repository/index.d.ts.map +1 -0
- package/dist/modules/promotions/repository/index.js +204 -0
- package/dist/modules/promotions/schema.d.ts +427 -0
- package/dist/modules/promotions/schema.d.ts.map +1 -0
- package/dist/modules/promotions/schema.js +52 -0
- package/dist/modules/promotions/schemas.d.ts +33 -0
- package/dist/modules/promotions/schemas.d.ts.map +1 -0
- package/dist/modules/promotions/schemas.js +32 -0
- package/dist/modules/promotions/service.d.ts +85 -0
- package/dist/modules/promotions/service.d.ts.map +1 -0
- package/dist/modules/promotions/service.js +368 -0
- package/dist/modules/search/adapter.d.ts +51 -0
- package/dist/modules/search/adapter.d.ts.map +1 -0
- package/dist/modules/search/adapter.js +1 -0
- package/dist/modules/search/hooks.d.ts +8 -0
- package/dist/modules/search/hooks.d.ts.map +1 -0
- package/dist/modules/search/hooks.js +6 -0
- package/dist/modules/search/repository/index.d.ts +5 -0
- package/dist/modules/search/repository/index.d.ts.map +1 -0
- package/dist/modules/search/repository/index.js +1 -0
- package/dist/modules/search/service.d.ts +24 -0
- package/dist/modules/search/service.d.ts.map +1 -0
- package/dist/modules/search/service.js +217 -0
- package/dist/modules/shipping/calculator.d.ts +42 -0
- package/dist/modules/shipping/calculator.d.ts.map +1 -0
- package/dist/modules/shipping/calculator.js +91 -0
- package/dist/modules/shipping/repository/index.d.ts +5 -0
- package/dist/modules/shipping/repository/index.d.ts.map +1 -0
- package/dist/modules/shipping/repository/index.js +1 -0
- package/dist/modules/shipping/service.d.ts +28 -0
- package/dist/modules/shipping/service.d.ts.map +1 -0
- package/dist/modules/shipping/service.js +20 -0
- package/dist/modules/tax/adapter.d.ts +58 -0
- package/dist/modules/tax/adapter.d.ts.map +1 -0
- package/dist/modules/tax/adapter.js +1 -0
- package/dist/modules/tax/repository/index.d.ts +5 -0
- package/dist/modules/tax/repository/index.d.ts.map +1 -0
- package/dist/modules/tax/repository/index.js +1 -0
- package/dist/modules/tax/service.d.ts +19 -0
- package/dist/modules/tax/service.d.ts.map +1 -0
- package/dist/modules/tax/service.js +34 -0
- package/dist/modules/webhooks/hook.d.ts +13 -0
- package/dist/modules/webhooks/hook.d.ts.map +1 -0
- package/dist/modules/webhooks/hook.js +29 -0
- package/dist/modules/webhooks/repository/index.d.ts +40 -0
- package/dist/modules/webhooks/repository/index.d.ts.map +1 -0
- package/dist/modules/webhooks/repository/index.js +175 -0
- package/dist/modules/webhooks/schema.d.ts +404 -0
- package/dist/modules/webhooks/schema.d.ts.map +1 -0
- package/dist/modules/webhooks/schema.js +40 -0
- package/dist/modules/webhooks/service.d.ts +23 -0
- package/dist/modules/webhooks/service.d.ts.map +1 -0
- package/dist/modules/webhooks/service.js +92 -0
- package/dist/modules/webhooks/signing.d.ts +2 -0
- package/dist/modules/webhooks/signing.d.ts.map +1 -0
- package/dist/modules/webhooks/signing.js +5 -0
- package/dist/modules/webhooks/ssrf-guard.d.ts +19 -0
- package/dist/modules/webhooks/ssrf-guard.d.ts.map +1 -0
- package/dist/modules/webhooks/ssrf-guard.js +79 -0
- package/dist/modules/webhooks/tasks.d.ts +16 -0
- package/dist/modules/webhooks/tasks.d.ts.map +1 -0
- package/dist/modules/webhooks/tasks.js +35 -0
- package/dist/modules/webhooks/worker.d.ts +21 -0
- package/dist/modules/webhooks/worker.d.ts.map +1 -0
- package/dist/modules/webhooks/worker.js +113 -0
- package/dist/runtime/commerce.d.ts +110 -0
- package/dist/runtime/commerce.d.ts.map +1 -0
- package/dist/runtime/commerce.js +37 -0
- package/dist/runtime/kernel.d.ts +71 -0
- package/dist/runtime/kernel.d.ts.map +1 -0
- package/dist/runtime/kernel.js +306 -0
- package/dist/runtime/logger.d.ts +11 -0
- package/dist/runtime/logger.d.ts.map +1 -0
- package/dist/runtime/logger.js +32 -0
- package/dist/runtime/shutdown.d.ts +15 -0
- package/dist/runtime/shutdown.d.ts.map +1 -0
- package/dist/runtime/shutdown.js +34 -0
- package/dist/test-utils/create-pglite-adapter.d.ts +32 -0
- package/dist/test-utils/create-pglite-adapter.d.ts.map +1 -0
- package/dist/test-utils/create-pglite-adapter.js +107 -0
- package/dist/test-utils/create-plugin-test-app.d.ts +50 -0
- package/dist/test-utils/create-plugin-test-app.d.ts.map +1 -0
- package/dist/test-utils/create-plugin-test-app.js +74 -0
- package/dist/test-utils/create-repository-test-harness.d.ts +8 -0
- package/dist/test-utils/create-repository-test-harness.d.ts.map +1 -0
- package/dist/test-utils/create-repository-test-harness.js +7 -0
- package/dist/test-utils/create-test-config.d.ts +18 -0
- package/dist/test-utils/create-test-config.d.ts.map +1 -0
- package/dist/test-utils/create-test-config.js +172 -0
- package/dist/test-utils/create-test-kernel.d.ts +3 -0
- package/dist/test-utils/create-test-kernel.d.ts.map +1 -0
- package/dist/test-utils/create-test-kernel.js +5 -0
- package/dist/test-utils/create-test-plugin-context.d.ts +42 -0
- package/dist/test-utils/create-test-plugin-context.d.ts.map +1 -0
- package/dist/test-utils/create-test-plugin-context.js +46 -0
- package/dist/test-utils/rest-api-test-utils.d.ts +64 -0
- package/dist/test-utils/rest-api-test-utils.d.ts.map +1 -0
- package/dist/test-utils/rest-api-test-utils.js +207 -0
- package/dist/test-utils/test-actors.d.ts +15 -0
- package/dist/test-utils/test-actors.d.ts.map +1 -0
- package/dist/test-utils/test-actors.js +57 -0
- package/dist/test-utils/typed-hooks.d.ts +43 -0
- package/dist/test-utils/typed-hooks.d.ts.map +1 -0
- package/dist/test-utils/typed-hooks.js +35 -0
- package/dist/testing.d.ts +14 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +13 -0
- package/dist/types/commerce-types.d.ts +34 -0
- package/dist/types/commerce-types.d.ts.map +1 -0
- package/dist/types/commerce-types.js +1 -0
- package/dist/utils/id.d.ts +2 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +3 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +16 -0
- package/dist/utils/pagination.d.ts +11 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +15 -0
- package/package.json +2 -2
- package/src/auth/setup.ts +26 -0
- package/src/interfaces/rest/routes/customers.ts +7 -1
- package/src/interfaces/rest/routes/inventory.ts +4 -1
- package/src/interfaces/rest/routes/promotions.ts +12 -9
- package/src/interfaces/rest/schemas/promotions.ts +10 -4
- package/src/modules/catalog/service.ts +19 -0
- package/src/modules/promotions/service.ts +32 -0
- package/src/runtime/commerce.ts +1 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
2
|
+
import { assertOwnership, assertPermission } from "../../auth/permissions.js";
|
|
3
|
+
import { CommerceNotFoundError, CommerceValidationError, toCommerceError, } from "../../kernel/errors.js";
|
|
4
|
+
import { runAfterHooks, runBeforeHooks } from "../../kernel/hooks/executor.js";
|
|
5
|
+
import { createHookContext } from "../../kernel/hooks/create-context.js";
|
|
6
|
+
import { Err, Ok } from "../../kernel/result.js";
|
|
7
|
+
import { createLogger } from "../../utils/logger.js";
|
|
8
|
+
import { defaultCartItemMatcher } from "./matcher.js";
|
|
9
|
+
function makeContext(actor, services, tx = null) {
|
|
10
|
+
return createHookContext({
|
|
11
|
+
actor,
|
|
12
|
+
tx,
|
|
13
|
+
logger: createLogger("cart"),
|
|
14
|
+
services,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function isExpired(cart) {
|
|
18
|
+
return cart.expiresAt.getTime() < Date.now();
|
|
19
|
+
}
|
|
20
|
+
export class CartService {
|
|
21
|
+
deps;
|
|
22
|
+
repo;
|
|
23
|
+
catalogRepo;
|
|
24
|
+
constructor(deps) {
|
|
25
|
+
this.deps = deps;
|
|
26
|
+
this.repo = deps.repository;
|
|
27
|
+
this.catalogRepo = deps.catalogRepository;
|
|
28
|
+
}
|
|
29
|
+
async create(input, actor, ctx) {
|
|
30
|
+
try {
|
|
31
|
+
assertPermission(actor ?? null, "cart:create");
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return Err(toCommerceError(error));
|
|
35
|
+
}
|
|
36
|
+
const ttlMinutes = this.deps.config.cart?.ttlMinutes ?? 60 * 24 * 7;
|
|
37
|
+
const now = new Date();
|
|
38
|
+
const orgId = resolveOrgId(actor ?? null);
|
|
39
|
+
const cart = await this.repo.create({
|
|
40
|
+
organizationId: orgId,
|
|
41
|
+
status: "active",
|
|
42
|
+
currency: input.currency ?? "USD",
|
|
43
|
+
metadata: input.metadata ?? {},
|
|
44
|
+
expiresAt: new Date(now.getTime() + ttlMinutes * 60 * 1000),
|
|
45
|
+
...(input.customerId !== undefined
|
|
46
|
+
? { customerId: input.customerId }
|
|
47
|
+
: {}),
|
|
48
|
+
}, ctx);
|
|
49
|
+
return Ok(cart);
|
|
50
|
+
}
|
|
51
|
+
async getById(id, actor, ctx) {
|
|
52
|
+
const orgId = resolveOrgId(actor ?? ctx?.actor ?? null);
|
|
53
|
+
const cart = await this.repo.findById(orgId, id, ctx);
|
|
54
|
+
if (!cart)
|
|
55
|
+
return Err(new CommerceNotFoundError("Cart not found."));
|
|
56
|
+
// H2 fix: Non-admin actors can only access their own carts.
|
|
57
|
+
// Guest carts (customerId is null) are accessible by anyone (token-gated).
|
|
58
|
+
try {
|
|
59
|
+
this.assertCartOwnership(actor ?? null, cart);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
return Err(toCommerceError(error));
|
|
63
|
+
}
|
|
64
|
+
if (isExpired(cart) && cart.status === "active") {
|
|
65
|
+
await this.repo.updateStatus(cart.id, "abandoned", ctx);
|
|
66
|
+
cart.status = "abandoned";
|
|
67
|
+
}
|
|
68
|
+
const lineItems = await this.repo.findLineItemsByCartId(id, ctx);
|
|
69
|
+
return Ok({
|
|
70
|
+
...cart,
|
|
71
|
+
lineItems,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
async addItem(input, actor, ctx) {
|
|
75
|
+
try {
|
|
76
|
+
assertPermission(actor ?? null, "cart:update");
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
return Err(toCommerceError(error));
|
|
80
|
+
}
|
|
81
|
+
const orgId = resolveOrgId(actor ?? null);
|
|
82
|
+
const cart = await this.repo.findById(orgId, input.cartId, ctx);
|
|
83
|
+
if (!cart)
|
|
84
|
+
return Err(new CommerceNotFoundError("Cart not found."));
|
|
85
|
+
try {
|
|
86
|
+
this.assertCartOwnership(actor ?? null, cart);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
return Err(toCommerceError(error));
|
|
90
|
+
}
|
|
91
|
+
if (cart.status !== "active") {
|
|
92
|
+
return Err(new CommerceValidationError("Cart is not active."));
|
|
93
|
+
}
|
|
94
|
+
const quantity = input.quantity ?? 1;
|
|
95
|
+
if (quantity <= 0) {
|
|
96
|
+
return Err(new CommerceValidationError("Quantity must be greater than zero."));
|
|
97
|
+
}
|
|
98
|
+
// Validate entity exists
|
|
99
|
+
const entity = await this.catalogRepo.findEntityById(input.entityId, ctx);
|
|
100
|
+
if (!entity)
|
|
101
|
+
return Err(new CommerceNotFoundError("Entity not found."));
|
|
102
|
+
// Check if entity has variants
|
|
103
|
+
const entityVariants = await this.catalogRepo.findVariantsByEntityId(input.entityId, ctx);
|
|
104
|
+
const hasVariants = entityVariants.length > 0;
|
|
105
|
+
if (hasVariants && !input.variantId) {
|
|
106
|
+
const variantIds = entityVariants.map((v) => v.id);
|
|
107
|
+
return Err(new CommerceValidationError(`Entity "${entity.slug}" has variants enabled, but no variantId was provided.`, [
|
|
108
|
+
{
|
|
109
|
+
field: "variantId",
|
|
110
|
+
message: `Available variants: ${variantIds.join(", ")}`,
|
|
111
|
+
},
|
|
112
|
+
]));
|
|
113
|
+
}
|
|
114
|
+
const context = makeContext(actor ?? null, this.deps.services, ctx?.tx);
|
|
115
|
+
const beforeHooks = this.deps.hooks.resolve("cart.beforeAddItem");
|
|
116
|
+
const afterHooks = this.deps.hooks.resolve("cart.afterAddItem");
|
|
117
|
+
const processed = await runBeforeHooks(beforeHooks, input, "addItem", context);
|
|
118
|
+
// CartItemMatcher: deduplicate by merging quantity into existing matching item
|
|
119
|
+
const matcher = this.deps.cartItemMatcher ?? defaultCartItemMatcher;
|
|
120
|
+
const existingItems = await this.repo.findLineItemsByCartId(input.cartId, ctx);
|
|
121
|
+
const match = existingItems.find((existing) => matcher({
|
|
122
|
+
existingItem: existing,
|
|
123
|
+
newItem: {
|
|
124
|
+
...processed,
|
|
125
|
+
variantId: processed.variantId ?? null,
|
|
126
|
+
},
|
|
127
|
+
}));
|
|
128
|
+
let item;
|
|
129
|
+
if (match) {
|
|
130
|
+
const updated = await this.repo.updateLineItem(match.id, { quantity: match.quantity + quantity }, ctx);
|
|
131
|
+
item = updated;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
item = await this.repo.createLineItem({
|
|
135
|
+
cartId: input.cartId,
|
|
136
|
+
entityId: processed.entityId,
|
|
137
|
+
quantity,
|
|
138
|
+
unitPriceSnapshot: processed.unitPriceSnapshot ?? 1000,
|
|
139
|
+
currency: processed.currency ?? cart.currency,
|
|
140
|
+
metadata: processed.metadata ?? {},
|
|
141
|
+
...(processed.variantId !== undefined
|
|
142
|
+
? { variantId: processed.variantId }
|
|
143
|
+
: {}),
|
|
144
|
+
}, ctx);
|
|
145
|
+
}
|
|
146
|
+
await runAfterHooks(afterHooks, null, item, "addItem", context);
|
|
147
|
+
return Ok(item);
|
|
148
|
+
}
|
|
149
|
+
async removeItem(cartId, itemId, actor, ctx) {
|
|
150
|
+
try {
|
|
151
|
+
assertPermission(actor ?? null, "cart:update");
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
return Err(toCommerceError(error));
|
|
155
|
+
}
|
|
156
|
+
const orgId = resolveOrgId(actor ?? null);
|
|
157
|
+
const cart = await this.repo.findById(orgId, cartId, ctx);
|
|
158
|
+
if (!cart)
|
|
159
|
+
return Err(new CommerceNotFoundError("Cart not found."));
|
|
160
|
+
try {
|
|
161
|
+
this.assertCartOwnership(actor ?? null, cart);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
return Err(toCommerceError(error));
|
|
165
|
+
}
|
|
166
|
+
const existing = await this.repo.findLineItemById(itemId, ctx);
|
|
167
|
+
if (!existing || existing.cartId !== cartId) {
|
|
168
|
+
return Err(new CommerceNotFoundError("Cart item not found."));
|
|
169
|
+
}
|
|
170
|
+
const context = makeContext(actor ?? null, this.deps.services, ctx?.tx);
|
|
171
|
+
const beforeHooks = this.deps.hooks.resolve("cart.beforeRemoveItem");
|
|
172
|
+
const afterHooks = this.deps.hooks.resolve("cart.afterRemoveItem");
|
|
173
|
+
await runBeforeHooks(beforeHooks, existing, "removeItem", context);
|
|
174
|
+
await this.repo.deleteLineItem(itemId, ctx);
|
|
175
|
+
await runAfterHooks(afterHooks, existing, existing, "removeItem", context);
|
|
176
|
+
return Ok(undefined);
|
|
177
|
+
}
|
|
178
|
+
async updateQuantity(input, actor, ctx) {
|
|
179
|
+
try {
|
|
180
|
+
assertPermission(actor ?? null, "cart:update");
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
return Err(toCommerceError(error));
|
|
184
|
+
}
|
|
185
|
+
const orgId = resolveOrgId(actor ?? null);
|
|
186
|
+
const cart = await this.repo.findById(orgId, input.cartId, ctx);
|
|
187
|
+
if (!cart)
|
|
188
|
+
return Err(new CommerceNotFoundError("Cart not found."));
|
|
189
|
+
try {
|
|
190
|
+
this.assertCartOwnership(actor ?? null, cart);
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
return Err(toCommerceError(error));
|
|
194
|
+
}
|
|
195
|
+
const item = await this.repo.findLineItemById(input.itemId, ctx);
|
|
196
|
+
if (!item || item.cartId !== input.cartId) {
|
|
197
|
+
return Err(new CommerceNotFoundError("Cart item not found."));
|
|
198
|
+
}
|
|
199
|
+
if (input.quantity <= 0) {
|
|
200
|
+
return Err(new CommerceValidationError("Quantity must be greater than zero."));
|
|
201
|
+
}
|
|
202
|
+
const context = makeContext(actor ?? null, this.deps.services, ctx?.tx);
|
|
203
|
+
const beforeHooks = this.deps.hooks.resolve("cart.beforeUpdateQuantity");
|
|
204
|
+
const afterHooks = this.deps.hooks.resolve("cart.afterUpdateQuantity");
|
|
205
|
+
await runBeforeHooks(beforeHooks, input, "update", context);
|
|
206
|
+
const updated = await this.repo.updateLineItem(input.itemId, { quantity: input.quantity }, ctx);
|
|
207
|
+
if (!updated) {
|
|
208
|
+
return Err(new CommerceNotFoundError("Cart item not found."));
|
|
209
|
+
}
|
|
210
|
+
await runAfterHooks(afterHooks, item, updated, "update", context);
|
|
211
|
+
return Ok(updated);
|
|
212
|
+
}
|
|
213
|
+
async merge(sourceCartId, targetCartId, actor, ctx) {
|
|
214
|
+
try {
|
|
215
|
+
assertPermission(actor ?? null, "cart:update");
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
return Err(toCommerceError(error));
|
|
219
|
+
}
|
|
220
|
+
const orgId = resolveOrgId(actor ?? null);
|
|
221
|
+
const source = await this.repo.findById(orgId, sourceCartId, ctx);
|
|
222
|
+
const target = await this.repo.findById(orgId, targetCartId, ctx);
|
|
223
|
+
if (!source || !target)
|
|
224
|
+
return Err(new CommerceNotFoundError("Cart not found."));
|
|
225
|
+
const sourceItems = await this.repo.findLineItemsByCartId(sourceCartId, ctx);
|
|
226
|
+
// Move items from source to target
|
|
227
|
+
for (const item of sourceItems) {
|
|
228
|
+
await this.repo.createLineItem({
|
|
229
|
+
cartId: targetCartId,
|
|
230
|
+
entityId: item.entityId,
|
|
231
|
+
variantId: item.variantId,
|
|
232
|
+
quantity: item.quantity,
|
|
233
|
+
unitPriceSnapshot: item.unitPriceSnapshot,
|
|
234
|
+
currency: item.currency,
|
|
235
|
+
metadata: item.metadata ?? {},
|
|
236
|
+
}, ctx);
|
|
237
|
+
}
|
|
238
|
+
// Clear source cart items and mark as merged
|
|
239
|
+
await this.repo.deleteLineItemsByCartId(sourceCartId, ctx);
|
|
240
|
+
await this.repo.updateStatus(sourceCartId, "merged", ctx);
|
|
241
|
+
return Ok(undefined);
|
|
242
|
+
}
|
|
243
|
+
async abandon(cartId, actor, ctx) {
|
|
244
|
+
const orgId = resolveOrgId(actor ?? ctx?.actor ?? null);
|
|
245
|
+
const cart = await this.repo.findById(orgId, cartId, ctx);
|
|
246
|
+
if (!cart)
|
|
247
|
+
return Err(new CommerceNotFoundError("Cart not found."));
|
|
248
|
+
await this.repo.updateStatus(cartId, "abandoned", ctx);
|
|
249
|
+
return Ok(undefined);
|
|
250
|
+
}
|
|
251
|
+
async markAsCheckedOut(cartId, actor, ctx) {
|
|
252
|
+
const orgId = resolveOrgId(actor ?? ctx?.actor ?? null);
|
|
253
|
+
const cart = await this.repo.findById(orgId, cartId, ctx);
|
|
254
|
+
if (!cart)
|
|
255
|
+
return Err(new CommerceNotFoundError("Cart not found."));
|
|
256
|
+
await this.repo.updateStatus(cartId, "checked_out", ctx);
|
|
257
|
+
return Ok(undefined);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Atomically transitions a cart from "active" to "checking_out".
|
|
261
|
+
* Returns Err if the cart was already claimed by a concurrent checkout.
|
|
262
|
+
* This prevents TOCTOU race conditions on double-checkout.
|
|
263
|
+
*/
|
|
264
|
+
async claimForCheckout(cartId, ctx) {
|
|
265
|
+
const claimed = await this.repo.transitionToCheckingOut(cartId, ctx);
|
|
266
|
+
if (!claimed) {
|
|
267
|
+
return Err(new CommerceValidationError("Cart is not available for checkout. It may have already been checked out by a concurrent request."));
|
|
268
|
+
}
|
|
269
|
+
return Ok(claimed);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Creates an anonymous guest cart with a secret token for access control.
|
|
273
|
+
* The secret must be stored client-side (cookie/local storage) and sent
|
|
274
|
+
* with subsequent requests to identify the cart owner.
|
|
275
|
+
*/
|
|
276
|
+
async createGuestCart(currency = "USD", ctx) {
|
|
277
|
+
const secret = crypto.randomUUID();
|
|
278
|
+
const ttlMinutes = this.deps.config.cart?.ttlMinutes ?? 60 * 24 * 7;
|
|
279
|
+
const now = new Date();
|
|
280
|
+
const cart = await this.repo.create({
|
|
281
|
+
organizationId: resolveOrgId(null),
|
|
282
|
+
customerId: undefined,
|
|
283
|
+
status: "active",
|
|
284
|
+
currency,
|
|
285
|
+
secret,
|
|
286
|
+
metadata: {},
|
|
287
|
+
expiresAt: new Date(now.getTime() + ttlMinutes * 60 * 1000),
|
|
288
|
+
}, ctx);
|
|
289
|
+
return Ok({ cart, secret });
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Merges a guest (source) cart into an authenticated (target) cart on login.
|
|
293
|
+
* Uses addItem() internally so CartItemMatcher deduplication is applied.
|
|
294
|
+
* The source cart's secret must be provided for access control.
|
|
295
|
+
*/
|
|
296
|
+
async mergeCarts(targetCartId, sourceCartId, sourceSecret, actor, ctx) {
|
|
297
|
+
const orgId = resolveOrgId(actor);
|
|
298
|
+
const sourceCart = await this.repo.findById(orgId, sourceCartId, ctx);
|
|
299
|
+
if (!sourceCart || sourceCart.secret !== sourceSecret) {
|
|
300
|
+
return Err(new CommerceValidationError("Invalid cart or cart secret."));
|
|
301
|
+
}
|
|
302
|
+
const targetCart = await this.repo.findById(orgId, targetCartId, ctx);
|
|
303
|
+
if (!targetCart) {
|
|
304
|
+
return Err(new CommerceNotFoundError("Target cart not found."));
|
|
305
|
+
}
|
|
306
|
+
const sourceItems = await this.repo.findLineItemsByCartId(sourceCartId, ctx);
|
|
307
|
+
for (const item of sourceItems) {
|
|
308
|
+
await this.addItem({
|
|
309
|
+
cartId: targetCartId,
|
|
310
|
+
entityId: item.entityId,
|
|
311
|
+
quantity: item.quantity,
|
|
312
|
+
...(item.variantId != null ? { variantId: item.variantId } : {}),
|
|
313
|
+
unitPriceSnapshot: item.unitPriceSnapshot,
|
|
314
|
+
currency: item.currency,
|
|
315
|
+
metadata: item.metadata ?? {},
|
|
316
|
+
}, actor, ctx);
|
|
317
|
+
}
|
|
318
|
+
// Mark source cart as merged
|
|
319
|
+
await this.repo.updateStatus(sourceCartId, "merged", ctx);
|
|
320
|
+
const mergedCart = await this.repo.findById(orgId, targetCartId, ctx);
|
|
321
|
+
return Ok(mergedCart);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Asserts the actor owns the cart. Bypassed for:
|
|
325
|
+
* - Admin/staff actors (permissions include `*:*`)
|
|
326
|
+
* - Guest carts (customerId is null) — access is token-gated instead
|
|
327
|
+
* - Null actors (unauthenticated guest access)
|
|
328
|
+
*/
|
|
329
|
+
assertCartOwnership(actor, cart) {
|
|
330
|
+
// Guest carts have no customerId — access is controlled by cart secret/token
|
|
331
|
+
if (cart.customerId == null)
|
|
332
|
+
return;
|
|
333
|
+
// Unauthenticated access to a customer cart is blocked by assertPermission elsewhere
|
|
334
|
+
if (!actor)
|
|
335
|
+
return;
|
|
336
|
+
// Admin/staff bypass
|
|
337
|
+
assertOwnership(actor, cart.customerId);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
2
|
+
import type { DrizzleDatabase } from "../../../kernel/database/drizzle-db.js";
|
|
3
|
+
import { sellableEntities, sellableAttributes, sellableCustomFields, categories, entityCategories, brands, entityBrands, optionTypes, optionValues, variants, variantOptionValues } from "../schema.js";
|
|
4
|
+
export type SellableEntity = typeof sellableEntities.$inferSelect;
|
|
5
|
+
export type SellableEntityInsert = typeof sellableEntities.$inferInsert;
|
|
6
|
+
export type SellableAttribute = typeof sellableAttributes.$inferSelect;
|
|
7
|
+
export type SellableAttributeInsert = typeof sellableAttributes.$inferInsert;
|
|
8
|
+
export type SellableCustomField = typeof sellableCustomFields.$inferSelect;
|
|
9
|
+
export type SellableCustomFieldInsert = typeof sellableCustomFields.$inferInsert;
|
|
10
|
+
export type Category = typeof categories.$inferSelect;
|
|
11
|
+
export type CategoryInsert = typeof categories.$inferInsert;
|
|
12
|
+
export type EntityCategory = typeof entityCategories.$inferSelect;
|
|
13
|
+
export type EntityCategoryInsert = typeof entityCategories.$inferInsert;
|
|
14
|
+
export type Brand = typeof brands.$inferSelect;
|
|
15
|
+
export type BrandInsert = typeof brands.$inferInsert;
|
|
16
|
+
export type EntityBrand = typeof entityBrands.$inferSelect;
|
|
17
|
+
export type EntityBrandInsert = typeof entityBrands.$inferInsert;
|
|
18
|
+
export type OptionType = typeof optionTypes.$inferSelect;
|
|
19
|
+
export type OptionTypeInsert = typeof optionTypes.$inferInsert;
|
|
20
|
+
export type OptionValue = typeof optionValues.$inferSelect;
|
|
21
|
+
export type OptionValueInsert = typeof optionValues.$inferInsert;
|
|
22
|
+
export type Variant = typeof variants.$inferSelect;
|
|
23
|
+
export type VariantInsert = typeof variants.$inferInsert;
|
|
24
|
+
export type VariantOptionValue = typeof variantOptionValues.$inferSelect;
|
|
25
|
+
export type VariantOptionValueInsert = typeof variantOptionValues.$inferInsert;
|
|
26
|
+
/**
|
|
27
|
+
* CatalogRepository provides type-safe database operations for catalog entities.
|
|
28
|
+
*
|
|
29
|
+
* This repository uses Drizzle ORM with PostgresJsDatabase for full type inference.
|
|
30
|
+
* Transaction context is passed through TxContext when needed for transactional writes.
|
|
31
|
+
*
|
|
32
|
+
* All methods support an optional TxContext parameter for transaction participation.
|
|
33
|
+
* When ctx is provided, operations run within that transaction; otherwise they use the main db.
|
|
34
|
+
*/
|
|
35
|
+
export declare class CatalogRepository {
|
|
36
|
+
private readonly db;
|
|
37
|
+
constructor(db: DrizzleDatabase);
|
|
38
|
+
/**
|
|
39
|
+
* Returns the appropriate database context - either a transaction or the main db.
|
|
40
|
+
* Both DrizzleDatabase and DrizzleTx have the same query builder interface.
|
|
41
|
+
*/
|
|
42
|
+
private getDb;
|
|
43
|
+
findEntityById(id: string, ctx?: TxContext): Promise<SellableEntity | undefined>;
|
|
44
|
+
findEntityBySlug(orgId: string, slug: string, ctx?: TxContext): Promise<SellableEntity | undefined>;
|
|
45
|
+
findEntities(orgId: string, filter?: {
|
|
46
|
+
type?: string;
|
|
47
|
+
status?: string;
|
|
48
|
+
ids?: string[];
|
|
49
|
+
}, ctx?: TxContext): Promise<SellableEntity[]>;
|
|
50
|
+
createEntity(data: SellableEntityInsert, ctx?: TxContext): Promise<SellableEntity>;
|
|
51
|
+
updateEntity(id: string, data: Partial<Omit<SellableEntityInsert, "id">>, ctx?: TxContext): Promise<SellableEntity | undefined>;
|
|
52
|
+
deleteEntity(id: string, ctx?: TxContext): Promise<boolean>;
|
|
53
|
+
findAttributesByEntityId(entityId: string, ctx?: TxContext): Promise<SellableAttribute[]>;
|
|
54
|
+
findAttributeByLocale(entityId: string, locale: string, ctx?: TxContext): Promise<SellableAttribute | undefined>;
|
|
55
|
+
createAttribute(data: SellableAttributeInsert, ctx?: TxContext): Promise<SellableAttribute>;
|
|
56
|
+
updateAttribute(id: string, data: Partial<Omit<SellableAttributeInsert, "id">>, ctx?: TxContext): Promise<SellableAttribute | undefined>;
|
|
57
|
+
upsertAttribute(entityId: string, locale: string, data: Omit<SellableAttributeInsert, "entityId" | "locale">, ctx?: TxContext): Promise<SellableAttribute>;
|
|
58
|
+
deleteAttributesByEntityId(entityId: string, ctx?: TxContext): Promise<void>;
|
|
59
|
+
findCustomFieldsByEntityId(entityId: string, ctx?: TxContext): Promise<SellableCustomField[]>;
|
|
60
|
+
createCustomField(data: SellableCustomFieldInsert, ctx?: TxContext): Promise<SellableCustomField>;
|
|
61
|
+
deleteCustomFieldsByEntityId(entityId: string, ctx?: TxContext): Promise<void>;
|
|
62
|
+
findCategoryById(id: string, ctx?: TxContext): Promise<Category | undefined>;
|
|
63
|
+
findCategoryBySlug(orgId: string, slug: string, ctx?: TxContext): Promise<Category | undefined>;
|
|
64
|
+
findAllCategories(orgId: string, ctx?: TxContext): Promise<Category[]>;
|
|
65
|
+
createCategory(data: CategoryInsert, ctx?: TxContext): Promise<Category>;
|
|
66
|
+
updateCategory(id: string, data: Partial<Omit<CategoryInsert, "id">>, ctx?: TxContext): Promise<Category | undefined>;
|
|
67
|
+
deleteCategory(id: string, ctx?: TxContext): Promise<boolean>;
|
|
68
|
+
findEntityCategories(entityId: string, ctx?: TxContext): Promise<EntityCategory[]>;
|
|
69
|
+
findEntitiesByCategory(categoryId: string, ctx?: TxContext): Promise<string[]>;
|
|
70
|
+
addEntityToCategory(entityId: string, categoryId: string, sortOrder?: number, ctx?: TxContext): Promise<void>;
|
|
71
|
+
removeEntityFromCategory(entityId: string, categoryId: string, ctx?: TxContext): Promise<boolean>;
|
|
72
|
+
deleteEntityCategoriesByEntityId(entityId: string, ctx?: TxContext): Promise<void>;
|
|
73
|
+
deleteEntityCategoriesByCategoryId(categoryId: string, ctx?: TxContext): Promise<void>;
|
|
74
|
+
findBrandById(id: string, ctx?: TxContext): Promise<Brand | undefined>;
|
|
75
|
+
findBrandBySlug(orgId: string, slug: string, ctx?: TxContext): Promise<Brand | undefined>;
|
|
76
|
+
findAllBrands(orgId: string, ctx?: TxContext): Promise<Brand[]>;
|
|
77
|
+
createBrand(data: BrandInsert, ctx?: TxContext): Promise<Brand>;
|
|
78
|
+
updateBrand(id: string, data: Partial<Omit<BrandInsert, "id">>, ctx?: TxContext): Promise<Brand | undefined>;
|
|
79
|
+
deleteBrand(id: string, ctx?: TxContext): Promise<boolean>;
|
|
80
|
+
findEntityBrands(entityId: string, ctx?: TxContext): Promise<EntityBrand[]>;
|
|
81
|
+
addEntityToBrand(entityId: string, brandId: string, sortOrder?: number, ctx?: TxContext): Promise<void>;
|
|
82
|
+
removeEntityFromBrand(entityId: string, brandId: string, ctx?: TxContext): Promise<boolean>;
|
|
83
|
+
deleteEntityBrandsByEntityId(entityId: string, ctx?: TxContext): Promise<void>;
|
|
84
|
+
deleteEntityBrandsByBrandId(brandId: string, ctx?: TxContext): Promise<void>;
|
|
85
|
+
findOptionTypesByEntityId(entityId: string, ctx?: TxContext): Promise<OptionType[]>;
|
|
86
|
+
findOptionTypeById(id: string, ctx?: TxContext): Promise<OptionType | undefined>;
|
|
87
|
+
createOptionType(data: OptionTypeInsert, ctx?: TxContext): Promise<OptionType>;
|
|
88
|
+
deleteOptionTypesByEntityId(entityId: string, ctx?: TxContext): Promise<void>;
|
|
89
|
+
findOptionValuesByTypeId(optionTypeId: string, ctx?: TxContext): Promise<OptionValue[]>;
|
|
90
|
+
findOptionValueById(id: string, ctx?: TxContext): Promise<OptionValue | undefined>;
|
|
91
|
+
findOptionValuesByIds(ids: string[], ctx?: TxContext): Promise<OptionValue[]>;
|
|
92
|
+
createOptionValue(data: OptionValueInsert, ctx?: TxContext): Promise<OptionValue>;
|
|
93
|
+
deleteOptionValuesByTypeId(optionTypeId: string, ctx?: TxContext): Promise<void>;
|
|
94
|
+
findVariantsByEntityId(entityId: string, ctx?: TxContext): Promise<Variant[]>;
|
|
95
|
+
findVariantById(id: string, ctx?: TxContext): Promise<Variant | undefined>;
|
|
96
|
+
findVariantBySku(sku: string, ctx?: TxContext): Promise<Variant | undefined>;
|
|
97
|
+
findVariantByBarcode(barcode: string, ctx?: TxContext): Promise<Variant | undefined>;
|
|
98
|
+
createVariant(data: VariantInsert, ctx?: TxContext): Promise<Variant>;
|
|
99
|
+
updateVariant(id: string, data: Partial<Omit<VariantInsert, "id">>, ctx?: TxContext): Promise<Variant | undefined>;
|
|
100
|
+
deleteVariantsByEntityId(entityId: string, ctx?: TxContext): Promise<void>;
|
|
101
|
+
findVariantOptionValues(variantId: string, ctx?: TxContext): Promise<VariantOptionValue[]>;
|
|
102
|
+
createVariantOptionValues(data: VariantOptionValueInsert[], ctx?: TxContext): Promise<void>;
|
|
103
|
+
deleteVariantOptionValuesByVariantId(variantId: string, ctx?: TxContext): Promise<void>;
|
|
104
|
+
deleteVariantOptionValuesByEntityId(entityId: string, ctx?: TxContext): Promise<void>;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/catalog/repository/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAGtB,MAAM,MAAM,cAAc,GAAG,OAAO,gBAAgB,CAAC,YAAY,C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