@unifiedcommerce/core 0.0.1 → 0.0.2
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/auth/access.d.ts +1 -1
- package/dist/auth/access.d.ts.map +1 -1
- package/dist/auth/auth-schema.js +3 -3
- package/dist/auth/middleware.d.ts +2 -2
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +37 -10
- package/dist/auth/org.js +1 -1
- package/dist/auth/permissions.d.ts +1 -1
- package/dist/auth/permissions.d.ts.map +1 -1
- package/dist/auth/permissions.js +1 -1
- package/dist/auth/setup.d.ts +19 -10
- package/dist/auth/setup.d.ts.map +1 -1
- package/dist/auth/setup.js +3 -4
- package/dist/auth/system-actor.d.ts +1 -1
- package/dist/auth/system-actor.d.ts.map +1 -1
- package/dist/auth/system-actor.js +1 -1
- package/dist/config/defaults.d.ts +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/define-config.d.ts +1 -1
- package/dist/config/define-config.d.ts.map +1 -1
- package/dist/config/define-config.js +2 -2
- package/dist/config/types.d.ts +11 -11
- package/dist/config/types.d.ts.map +1 -1
- package/dist/hooks/checkout-completion.d.ts +2 -2
- package/dist/hooks/checkout-completion.d.ts.map +1 -1
- package/dist/hooks/checkout-completion.js +2 -2
- package/dist/hooks/checkout.d.ts +3 -3
- package/dist/hooks/checkout.d.ts.map +1 -1
- package/dist/hooks/checkout.js +3 -3
- package/dist/hooks/order-emails.d.ts +1 -1
- package/dist/hooks/order-emails.d.ts.map +1 -1
- package/dist/index.d.ts +81 -81
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -13381
- package/dist/interfaces/mcp/context-enrichment.d.ts +2 -2
- package/dist/interfaces/mcp/context-enrichment.d.ts.map +1 -1
- package/dist/interfaces/mcp/context-enrichment.js +1 -1
- package/dist/interfaces/mcp/server.d.ts +2 -2
- package/dist/interfaces/mcp/server.d.ts.map +1 -1
- package/dist/interfaces/mcp/server.js +3 -3
- package/dist/interfaces/mcp/transport.d.ts +2 -2
- package/dist/interfaces/mcp/transport.d.ts.map +1 -1
- package/dist/interfaces/mcp/transport.js +1 -1
- package/dist/interfaces/rest/customer-portal.d.ts +2 -2
- package/dist/interfaces/rest/customer-portal.d.ts.map +1 -1
- package/dist/interfaces/rest/customer-portal.js +3 -3
- package/dist/interfaces/rest/index.d.ts +2 -2
- package/dist/interfaces/rest/index.d.ts.map +1 -1
- package/dist/interfaces/rest/index.js +13 -13
- package/dist/interfaces/rest/router.d.ts +1 -1
- package/dist/interfaces/rest/router.d.ts.map +1 -1
- package/dist/interfaces/rest/router.js +4 -4
- package/dist/interfaces/rest/routes/admin-jobs.d.ts +2 -2
- package/dist/interfaces/rest/routes/admin-jobs.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/admin-jobs.js +4 -4
- package/dist/interfaces/rest/routes/audit.d.ts +2 -2
- package/dist/interfaces/rest/routes/audit.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/audit.js +3 -3
- package/dist/interfaces/rest/routes/carts.d.ts +2 -2
- package/dist/interfaces/rest/routes/carts.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/carts.js +2 -2
- package/dist/interfaces/rest/routes/catalog.d.ts +2 -2
- package/dist/interfaces/rest/routes/catalog.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/catalog.js +2 -2
- package/dist/interfaces/rest/routes/checkout.d.ts +2 -2
- package/dist/interfaces/rest/routes/checkout.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/checkout.js +7 -7
- package/dist/interfaces/rest/routes/inventory.d.ts +2 -2
- package/dist/interfaces/rest/routes/inventory.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/inventory.js +2 -2
- package/dist/interfaces/rest/routes/media.d.ts +2 -2
- package/dist/interfaces/rest/routes/media.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/media.js +2 -2
- package/dist/interfaces/rest/routes/orders.d.ts +2 -2
- package/dist/interfaces/rest/routes/orders.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/orders.js +2 -2
- package/dist/interfaces/rest/routes/payments.d.ts +2 -2
- package/dist/interfaces/rest/routes/payments.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/payments.js +2 -2
- package/dist/interfaces/rest/routes/pricing.d.ts +2 -2
- package/dist/interfaces/rest/routes/pricing.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/pricing.js +2 -2
- package/dist/interfaces/rest/routes/promotions.d.ts +2 -2
- package/dist/interfaces/rest/routes/promotions.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/promotions.js +3 -3
- package/dist/interfaces/rest/routes/search.d.ts +2 -2
- package/dist/interfaces/rest/routes/search.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/search.js +2 -2
- package/dist/interfaces/rest/routes/webhooks.d.ts +2 -2
- package/dist/interfaces/rest/routes/webhooks.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/webhooks.js +2 -2
- package/dist/interfaces/rest/schemas/admin-jobs.js +1 -1
- package/dist/interfaces/rest/schemas/carts.d.ts +1 -1
- package/dist/interfaces/rest/schemas/carts.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/carts.js +3 -3
- package/dist/interfaces/rest/schemas/catalog.js +3 -3
- package/dist/interfaces/rest/schemas/checkout.js +1 -1
- package/dist/interfaces/rest/schemas/customer-portal.js +2 -2
- package/dist/interfaces/rest/schemas/inventory.d.ts +1 -1
- package/dist/interfaces/rest/schemas/inventory.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/inventory.js +2 -2
- package/dist/interfaces/rest/schemas/media.js +1 -1
- package/dist/interfaces/rest/schemas/orders.js +2 -2
- package/dist/interfaces/rest/schemas/pricing.d.ts +1 -1
- package/dist/interfaces/rest/schemas/pricing.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/pricing.js +2 -2
- package/dist/interfaces/rest/schemas/promotions.d.ts +1 -1
- package/dist/interfaces/rest/schemas/promotions.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/promotions.js +2 -2
- package/dist/interfaces/rest/schemas/responses.js +5 -5
- package/dist/interfaces/rest/schemas/search.js +1 -1
- package/dist/interfaces/rest/schemas/webhooks.js +1 -1
- package/dist/interfaces/rest/utils.d.ts +2 -2
- package/dist/interfaces/rest/utils.d.ts.map +1 -1
- package/dist/interfaces/rest/utils.js +2 -2
- package/dist/interfaces/rest/webhook-router.d.ts +1 -1
- package/dist/interfaces/rest/webhook-router.d.ts.map +1 -1
- package/dist/kernel/compensation/executor.d.ts +2 -2
- package/dist/kernel/compensation/executor.d.ts.map +1 -1
- package/dist/kernel/compensation/types.d.ts +3 -3
- package/dist/kernel/compensation/types.d.ts.map +1 -1
- package/dist/kernel/database/drizzle-db.d.ts +1 -1
- package/dist/kernel/database/drizzle-db.d.ts.map +1 -1
- package/dist/kernel/database/drizzle-db.js +1 -1
- package/dist/kernel/database/migrate.d.ts +2 -2
- package/dist/kernel/database/migrate.d.ts.map +1 -1
- package/dist/kernel/database/migrate.js +1 -1
- package/dist/kernel/database/schema.d.ts +13 -13
- package/dist/kernel/database/schema.d.ts.map +1 -1
- package/dist/kernel/database/schema.js +13 -13
- package/dist/kernel/database/tx-context.d.ts +2 -2
- package/dist/kernel/database/tx-context.d.ts.map +1 -1
- package/dist/kernel/error-mapper.js +1 -1
- package/dist/kernel/factory/repository-factory.d.ts +2 -2
- package/dist/kernel/factory/repository-factory.d.ts.map +1 -1
- package/dist/kernel/factory/repository-factory.js +1 -1
- package/dist/kernel/hooks/create-context.d.ts +4 -4
- package/dist/kernel/hooks/create-context.d.ts.map +1 -1
- package/dist/kernel/hooks/create-context.js +1 -1
- package/dist/kernel/hooks/executor.d.ts +1 -1
- package/dist/kernel/hooks/executor.d.ts.map +1 -1
- package/dist/kernel/hooks/types.d.ts +3 -3
- package/dist/kernel/hooks/types.d.ts.map +1 -1
- package/dist/kernel/http-error.d.ts +1 -1
- package/dist/kernel/http-error.d.ts.map +1 -1
- package/dist/kernel/jobs/drizzle-adapter.d.ts +3 -3
- package/dist/kernel/jobs/drizzle-adapter.d.ts.map +1 -1
- package/dist/kernel/jobs/drizzle-adapter.js +2 -2
- package/dist/kernel/jobs/runner.d.ts +3 -3
- package/dist/kernel/jobs/runner.d.ts.map +1 -1
- package/dist/kernel/jobs/runner.js +1 -1
- package/dist/kernel/jobs/schema.js +1 -1
- package/dist/kernel/jobs/types.d.ts +2 -2
- package/dist/kernel/jobs/types.d.ts.map +1 -1
- package/dist/kernel/local-api.d.ts +21 -21
- package/dist/kernel/local-api.d.ts.map +1 -1
- package/dist/kernel/plugin/manifest.d.ts +1 -1
- package/dist/kernel/plugin/manifest.d.ts.map +1 -1
- package/dist/kernel/query/executor.d.ts +1 -1
- package/dist/kernel/query/executor.d.ts.map +1 -1
- package/dist/kernel/query/executor.js +1 -1
- package/dist/kernel/result.d.ts +1 -1
- package/dist/kernel/result.d.ts.map +1 -1
- package/dist/kernel/state-machine/machine.js +1 -1
- package/dist/modules/analytics/drizzle-adapter.d.ts +3 -3
- package/dist/modules/analytics/drizzle-adapter.d.ts.map +1 -1
- package/dist/modules/analytics/drizzle-adapter.js +2 -2
- package/dist/modules/analytics/models.d.ts +1 -1
- package/dist/modules/analytics/models.d.ts.map +1 -1
- package/dist/modules/analytics/repository/index.d.ts +1 -1
- package/dist/modules/analytics/repository/index.d.ts.map +1 -1
- package/dist/modules/analytics/service.d.ts +4 -4
- package/dist/modules/analytics/service.d.ts.map +1 -1
- package/dist/modules/analytics/service.js +2 -2
- package/dist/modules/analytics/types.d.ts +1 -1
- package/dist/modules/analytics/types.d.ts.map +1 -1
- package/dist/modules/audit/hooks.d.ts +1 -1
- package/dist/modules/audit/hooks.d.ts.map +1 -1
- package/dist/modules/audit/schema.js +1 -1
- package/dist/modules/audit/service.d.ts +4 -4
- package/dist/modules/audit/service.d.ts.map +1 -1
- package/dist/modules/audit/service.js +2 -2
- package/dist/modules/cart/access.d.ts +2 -2
- package/dist/modules/cart/access.d.ts.map +1 -1
- package/dist/modules/cart/matcher.d.ts +1 -1
- package/dist/modules/cart/matcher.d.ts.map +1 -1
- package/dist/modules/cart/repository/index.d.ts +3 -3
- package/dist/modules/cart/repository/index.d.ts.map +1 -1
- package/dist/modules/cart/repository/index.js +1 -1
- package/dist/modules/cart/schema.js +2 -2
- package/dist/modules/cart/service.d.ts +10 -10
- package/dist/modules/cart/service.d.ts.map +1 -1
- package/dist/modules/cart/service.js +8 -8
- package/dist/modules/catalog/repository/index.d.ts +3 -3
- package/dist/modules/catalog/repository/index.d.ts.map +1 -1
- package/dist/modules/catalog/repository/index.js +1 -1
- package/dist/modules/catalog/schema.js +1 -1
- package/dist/modules/catalog/service.d.ts +9 -9
- package/dist/modules/catalog/service.d.ts.map +1 -1
- package/dist/modules/catalog/service.js +8 -8
- package/dist/modules/customers/repository/index.d.ts +3 -3
- package/dist/modules/customers/repository/index.d.ts.map +1 -1
- package/dist/modules/customers/repository/index.js +1 -1
- package/dist/modules/customers/schema.js +1 -1
- package/dist/modules/customers/service.d.ts +4 -4
- package/dist/modules/customers/service.d.ts.map +1 -1
- package/dist/modules/customers/service.js +3 -3
- package/dist/modules/fulfillment/repository/index.d.ts +3 -3
- package/dist/modules/fulfillment/repository/index.d.ts.map +1 -1
- package/dist/modules/fulfillment/repository/index.js +1 -1
- package/dist/modules/fulfillment/schema.js +2 -2
- package/dist/modules/fulfillment/service.d.ts +6 -6
- package/dist/modules/fulfillment/service.d.ts.map +1 -1
- package/dist/modules/fulfillment/service.js +4 -4
- package/dist/modules/fulfillment/types.d.ts +2 -2
- package/dist/modules/fulfillment/types.d.ts.map +1 -1
- package/dist/modules/inventory/repository/index.d.ts +3 -3
- package/dist/modules/inventory/repository/index.d.ts.map +1 -1
- package/dist/modules/inventory/repository/index.js +1 -1
- package/dist/modules/inventory/schema.js +2 -2
- package/dist/modules/inventory/service.d.ts +9 -9
- package/dist/modules/inventory/service.d.ts.map +1 -1
- package/dist/modules/inventory/service.js +8 -8
- package/dist/modules/media/adapter.d.ts +1 -1
- package/dist/modules/media/adapter.d.ts.map +1 -1
- package/dist/modules/media/repository/index.d.ts +3 -3
- package/dist/modules/media/repository/index.d.ts.map +1 -1
- package/dist/modules/media/repository/index.js +1 -1
- package/dist/modules/media/schema.js +2 -2
- package/dist/modules/media/service.d.ts +6 -6
- package/dist/modules/media/service.d.ts.map +1 -1
- package/dist/modules/media/service.js +4 -4
- package/dist/modules/orders/repository/index.d.ts +3 -3
- package/dist/modules/orders/repository/index.d.ts.map +1 -1
- package/dist/modules/orders/repository/index.js +1 -1
- package/dist/modules/orders/schema.js +2 -2
- package/dist/modules/orders/service.d.ts +8 -8
- package/dist/modules/orders/service.d.ts.map +1 -1
- package/dist/modules/orders/service.js +9 -9
- package/dist/modules/orders/stale-order-cleanup.d.ts +1 -1
- package/dist/modules/orders/stale-order-cleanup.d.ts.map +1 -1
- package/dist/modules/orders/stale-order-cleanup.js +1 -1
- package/dist/modules/organization/service.d.ts +1 -1
- package/dist/modules/organization/service.d.ts.map +1 -1
- package/dist/modules/organization/service.js +1 -1
- package/dist/modules/payments/adapter.d.ts +1 -1
- package/dist/modules/payments/adapter.d.ts.map +1 -1
- package/dist/modules/payments/repository/index.d.ts +1 -1
- package/dist/modules/payments/repository/index.d.ts.map +1 -1
- package/dist/modules/payments/service.d.ts +3 -3
- package/dist/modules/payments/service.d.ts.map +1 -1
- package/dist/modules/payments/service.js +2 -2
- package/dist/modules/pricing/repository/index.d.ts +3 -3
- package/dist/modules/pricing/repository/index.d.ts.map +1 -1
- package/dist/modules/pricing/repository/index.js +1 -1
- package/dist/modules/pricing/schema.js +2 -2
- package/dist/modules/pricing/service.d.ts +7 -7
- package/dist/modules/pricing/service.d.ts.map +1 -1
- package/dist/modules/pricing/service.js +3 -3
- package/dist/modules/promotions/repository/index.d.ts +3 -3
- package/dist/modules/promotions/repository/index.d.ts.map +1 -1
- package/dist/modules/promotions/repository/index.js +1 -1
- package/dist/modules/promotions/schema.js +1 -1
- package/dist/modules/promotions/service.d.ts +8 -8
- package/dist/modules/promotions/service.d.ts.map +1 -1
- package/dist/modules/promotions/service.js +3 -3
- package/dist/modules/search/adapter.d.ts +1 -1
- package/dist/modules/search/adapter.d.ts.map +1 -1
- package/dist/modules/search/hooks.d.ts +1 -1
- package/dist/modules/search/hooks.d.ts.map +1 -1
- package/dist/modules/search/repository/index.d.ts +1 -1
- package/dist/modules/search/repository/index.d.ts.map +1 -1
- package/dist/modules/search/service.d.ts +4 -4
- package/dist/modules/search/service.d.ts.map +1 -1
- package/dist/modules/search/service.js +2 -2
- package/dist/modules/shipping/calculator.d.ts +3 -3
- package/dist/modules/shipping/calculator.d.ts.map +1 -1
- package/dist/modules/shipping/repository/index.d.ts +1 -1
- package/dist/modules/shipping/repository/index.d.ts.map +1 -1
- package/dist/modules/shipping/service.d.ts +5 -5
- package/dist/modules/shipping/service.d.ts.map +1 -1
- package/dist/modules/shipping/service.js +2 -2
- package/dist/modules/tax/adapter.d.ts +1 -1
- package/dist/modules/tax/adapter.d.ts.map +1 -1
- package/dist/modules/tax/repository/index.d.ts +1 -1
- package/dist/modules/tax/repository/index.d.ts.map +1 -1
- package/dist/modules/tax/service.d.ts +2 -2
- package/dist/modules/tax/service.d.ts.map +1 -1
- package/dist/modules/tax/service.js +2 -2
- package/dist/modules/webhooks/hook.d.ts +1 -1
- package/dist/modules/webhooks/hook.d.ts.map +1 -1
- package/dist/modules/webhooks/repository/index.d.ts +3 -3
- package/dist/modules/webhooks/repository/index.d.ts.map +1 -1
- package/dist/modules/webhooks/repository/index.js +1 -1
- package/dist/modules/webhooks/schema.js +1 -1
- package/dist/modules/webhooks/service.d.ts +4 -4
- package/dist/modules/webhooks/service.d.ts.map +1 -1
- package/dist/modules/webhooks/service.js +3 -3
- package/dist/modules/webhooks/tasks.d.ts +1 -1
- package/dist/modules/webhooks/tasks.d.ts.map +1 -1
- package/dist/modules/webhooks/tasks.js +1 -1
- package/dist/modules/webhooks/worker.d.ts +1 -1
- package/dist/modules/webhooks/worker.d.ts.map +1 -1
- package/dist/modules/webhooks/worker.js +2 -2
- package/dist/runtime/commerce.d.ts +9 -9
- package/dist/runtime/commerce.d.ts.map +1 -1
- package/dist/runtime/commerce.js +5 -5
- package/dist/runtime/kernel.d.ts +21 -21
- package/dist/runtime/kernel.d.ts.map +1 -1
- package/dist/runtime/kernel.js +41 -41
- package/dist/runtime/logger.d.ts +1 -1
- package/dist/runtime/logger.d.ts.map +1 -1
- package/dist/runtime/server.d.ts +6 -6
- package/dist/runtime/server.d.ts.map +1 -1
- package/dist/runtime/server.js +8 -6
- package/dist/runtime/shutdown.d.ts +1 -1
- package/dist/runtime/shutdown.d.ts.map +1 -1
- package/dist/test-utils/create-pglite-adapter.d.ts +2 -2
- package/dist/test-utils/create-pglite-adapter.d.ts.map +1 -1
- package/dist/test-utils/create-pglite-adapter.js +3 -3
- package/dist/test-utils/create-plugin-test-app.d.ts +3 -3
- package/dist/test-utils/create-plugin-test-app.d.ts.map +1 -1
- package/dist/test-utils/create-plugin-test-app.js +4 -4
- package/dist/test-utils/create-repository-test-harness.d.ts +2 -2
- package/dist/test-utils/create-repository-test-harness.d.ts.map +1 -1
- package/dist/test-utils/create-repository-test-harness.js +2 -2
- package/dist/test-utils/create-test-config.d.ts +1 -1
- package/dist/test-utils/create-test-config.d.ts.map +1 -1
- package/dist/test-utils/create-test-config.js +4 -4
- package/dist/test-utils/create-test-kernel.d.ts +2 -2
- package/dist/test-utils/create-test-kernel.d.ts.map +1 -1
- package/dist/test-utils/create-test-kernel.js +2 -2
- package/dist/test-utils/create-test-plugin-context.d.ts +2 -2
- package/dist/test-utils/create-test-plugin-context.d.ts.map +1 -1
- package/dist/test-utils/create-test-plugin-context.js +3 -3
- package/dist/test-utils/rest-api-test-utils.d.ts +4 -4
- package/dist/test-utils/rest-api-test-utils.d.ts.map +1 -1
- package/dist/test-utils/rest-api-test-utils.js +8 -8
- package/dist/test-utils/test-actors.d.ts +1 -1
- package/dist/test-utils/test-actors.d.ts.map +1 -1
- package/dist/test-utils/typed-hooks.d.ts +2 -2
- package/dist/test-utils/typed-hooks.d.ts.map +1 -1
- package/dist/types/commerce-types.d.ts +5 -5
- package/dist/types/commerce-types.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/package.json +17 -9
- package/src/auth/access.ts +1 -1
- package/src/auth/auth-schema.ts +3 -3
- package/src/auth/middleware.ts +43 -14
- package/src/auth/org.ts +1 -1
- package/src/auth/permissions.ts +2 -2
- package/src/auth/setup.ts +18 -14
- package/src/auth/system-actor.ts +2 -2
- package/src/config/defaults.ts +1 -1
- package/src/config/define-config.ts +3 -3
- package/src/config/types.ts +11 -11
- package/src/hooks/checkout-completion.ts +4 -4
- package/src/hooks/checkout.ts +8 -8
- package/src/hooks/order-emails.ts +1 -1
- package/src/index.ts +83 -83
- package/src/interfaces/mcp/context-enrichment.ts +3 -3
- package/src/interfaces/mcp/server.ts +6 -6
- package/src/interfaces/mcp/transport.ts +3 -3
- package/src/interfaces/rest/customer-portal.ts +6 -6
- package/src/interfaces/rest/index.ts +15 -15
- package/src/interfaces/rest/router.ts +5 -5
- package/src/interfaces/rest/routes/admin-jobs.ts +5 -5
- package/src/interfaces/rest/routes/audit.ts +4 -4
- package/src/interfaces/rest/routes/carts.ts +4 -4
- package/src/interfaces/rest/routes/catalog.ts +5 -5
- package/src/interfaces/rest/routes/checkout.ts +11 -11
- package/src/interfaces/rest/routes/inventory.ts +3 -3
- package/src/interfaces/rest/routes/media.ts +4 -4
- package/src/interfaces/rest/routes/orders.ts +3 -3
- package/src/interfaces/rest/routes/payments.ts +3 -3
- package/src/interfaces/rest/routes/pricing.ts +3 -3
- package/src/interfaces/rest/routes/promotions.ts +4 -4
- package/src/interfaces/rest/routes/search.ts +3 -3
- package/src/interfaces/rest/routes/webhooks.ts +3 -3
- package/src/interfaces/rest/schemas/admin-jobs.ts +1 -1
- package/src/interfaces/rest/schemas/carts.ts +3 -3
- package/src/interfaces/rest/schemas/catalog.ts +3 -3
- package/src/interfaces/rest/schemas/checkout.ts +1 -1
- package/src/interfaces/rest/schemas/customer-portal.ts +2 -2
- package/src/interfaces/rest/schemas/inventory.ts +2 -2
- package/src/interfaces/rest/schemas/media.ts +1 -1
- package/src/interfaces/rest/schemas/orders.ts +2 -2
- package/src/interfaces/rest/schemas/pricing.ts +2 -2
- package/src/interfaces/rest/schemas/promotions.ts +2 -2
- package/src/interfaces/rest/schemas/responses.ts +5 -5
- package/src/interfaces/rest/schemas/search.ts +1 -1
- package/src/interfaces/rest/schemas/webhooks.ts +1 -1
- package/src/interfaces/rest/utils.ts +4 -4
- package/src/interfaces/rest/webhook-router.ts +1 -1
- package/src/kernel/compensation/executor.ts +2 -2
- package/src/kernel/compensation/types.ts +3 -3
- package/src/kernel/database/drizzle-db.ts +1 -1
- package/src/kernel/database/migrate.ts +2 -2
- package/src/kernel/database/schema.ts +13 -13
- package/src/kernel/database/tx-context.ts +2 -2
- package/src/kernel/error-mapper.ts +1 -1
- package/src/kernel/factory/repository-factory.ts +3 -3
- package/src/kernel/hooks/create-context.ts +5 -5
- package/src/kernel/hooks/executor.ts +1 -1
- package/src/kernel/hooks/types.ts +3 -3
- package/src/kernel/http-error.ts +1 -1
- package/src/kernel/jobs/drizzle-adapter.ts +5 -5
- package/src/kernel/jobs/runner.ts +4 -4
- package/src/kernel/jobs/schema.ts +1 -1
- package/src/kernel/jobs/types.ts +2 -2
- package/src/kernel/local-api.ts +4 -4
- package/src/kernel/plugin/manifest.ts +1 -1
- package/src/kernel/query/executor.ts +2 -2
- package/src/kernel/result.ts +1 -1
- package/src/kernel/state-machine/machine.ts +1 -1
- package/src/modules/analytics/drizzle-adapter.ts +4 -4
- package/src/modules/analytics/models.ts +1 -1
- package/src/modules/analytics/repository/index.ts +1 -1
- package/src/modules/analytics/service.ts +5 -5
- package/src/modules/analytics/types.ts +1 -1
- package/src/modules/audit/hooks.ts +3 -3
- package/src/modules/audit/schema.ts +1 -1
- package/src/modules/audit/service.ts +5 -5
- package/src/modules/cart/access.ts +2 -2
- package/src/modules/cart/matcher.ts +1 -1
- package/src/modules/cart/repository/index.ts +3 -3
- package/src/modules/cart/schema.ts +2 -2
- package/src/modules/cart/service.ts +17 -17
- package/src/modules/catalog/repository/index.ts +3 -3
- package/src/modules/catalog/schema.ts +1 -1
- package/src/modules/catalog/service.ts +16 -16
- package/src/modules/customers/repository/index.ts +3 -3
- package/src/modules/customers/schema.ts +1 -1
- package/src/modules/customers/service.ts +6 -6
- package/src/modules/fulfillment/repository/index.ts +3 -3
- package/src/modules/fulfillment/schema.ts +2 -2
- package/src/modules/fulfillment/service.ts +9 -9
- package/src/modules/fulfillment/types.ts +2 -2
- package/src/modules/inventory/repository/index.ts +3 -3
- package/src/modules/inventory/schema.ts +2 -2
- package/src/modules/inventory/service.ts +16 -16
- package/src/modules/media/adapter.ts +1 -1
- package/src/modules/media/repository/index.ts +3 -3
- package/src/modules/media/schema.ts +2 -2
- package/src/modules/media/service.ts +9 -9
- package/src/modules/orders/repository/index.ts +3 -3
- package/src/modules/orders/schema.ts +2 -2
- package/src/modules/orders/service.ts +15 -15
- package/src/modules/orders/stale-order-cleanup.ts +2 -2
- package/src/modules/organization/service.ts +2 -2
- package/src/modules/payments/adapter.ts +1 -1
- package/src/modules/payments/repository/index.ts +1 -1
- package/src/modules/payments/service.ts +3 -3
- package/src/modules/pricing/repository/index.ts +3 -3
- package/src/modules/pricing/schema.ts +2 -2
- package/src/modules/pricing/service.ts +9 -9
- package/src/modules/promotions/repository/index.ts +3 -3
- package/src/modules/promotions/schema.ts +1 -1
- package/src/modules/promotions/service.ts +10 -10
- package/src/modules/search/adapter.ts +1 -1
- package/src/modules/search/hooks.ts +2 -2
- package/src/modules/search/repository/index.ts +1 -1
- package/src/modules/search/service.ts +5 -5
- package/src/modules/shipping/calculator.ts +3 -3
- package/src/modules/shipping/repository/index.ts +1 -1
- package/src/modules/shipping/service.ts +5 -5
- package/src/modules/tax/adapter.ts +1 -1
- package/src/modules/tax/repository/index.ts +1 -1
- package/src/modules/tax/service.ts +3 -3
- package/src/modules/webhooks/hook.ts +1 -1
- package/src/modules/webhooks/repository/index.ts +3 -3
- package/src/modules/webhooks/schema.ts +1 -1
- package/src/modules/webhooks/service.ts +6 -6
- package/src/modules/webhooks/tasks.ts +3 -3
- package/src/modules/webhooks/worker.ts +3 -3
- package/src/runtime/commerce.ts +11 -11
- package/src/runtime/kernel.ts +45 -45
- package/src/runtime/logger.ts +1 -1
- package/src/runtime/server.ts +17 -13
- package/src/runtime/shutdown.ts +1 -1
- package/src/test-utils/create-pglite-adapter.ts +5 -5
- package/src/test-utils/create-plugin-test-app.ts +7 -7
- package/src/test-utils/create-repository-test-harness.ts +3 -3
- package/src/test-utils/create-test-config.ts +6 -6
- package/src/test-utils/create-test-kernel.ts +3 -3
- package/src/test-utils/create-test-plugin-context.ts +4 -4
- package/src/test-utils/rest-api-test-utils.ts +11 -11
- package/src/test-utils/test-actors.ts +1 -1
- package/src/test-utils/typed-hooks.ts +2 -2
- package/src/types/commerce-types.ts +5 -5
- package/src/utils/logger.ts +1 -1
- package/dist/auth/pos.d.ts +0 -3
- package/dist/auth/pos.d.ts.map +0 -1
- package/dist/auth/pos.js +0 -62
- package/dist/index.js.map +0 -156
- package/dist/interfaces/graphql/index.d.ts +0 -4
- package/dist/interfaces/graphql/index.d.ts.map +0 -1
- package/dist/interfaces/graphql/index.js +0 -415
- package/dist/kernel/factory/in-memory-repository-factory.d.ts +0 -20
- package/dist/kernel/factory/in-memory-repository-factory.d.ts.map +0 -1
- package/dist/kernel/factory/in-memory-repository-factory.js +0 -83
- package/dist/kernel/plugin/capability-registry.d.ts +0 -9
- package/dist/kernel/plugin/capability-registry.d.ts.map +0 -1
- package/dist/kernel/plugin/capability-registry.js +0 -28
- package/dist/kernel/plugin/dependency-graph.d.ts +0 -6
- package/dist/kernel/plugin/dependency-graph.d.ts.map +0 -1
- package/dist/kernel/plugin/dependency-graph.js +0 -55
- package/dist/modules/analytics/cubes.d.ts +0 -19
- package/dist/modules/analytics/cubes.d.ts.map +0 -1
- package/dist/modules/analytics/cubes.js +0 -187
- package/dist/modules/cart/repository/in-memory.d.ts +0 -30
- package/dist/modules/cart/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/cart/repository/in-memory.js +0 -159
- package/dist/modules/catalog/repository/in-memory.d.ts +0 -82
- package/dist/modules/catalog/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/catalog/repository/in-memory.js +0 -444
- package/dist/modules/customers/repository/in-memory.d.ts +0 -37
- package/dist/modules/customers/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/customers/repository/in-memory.js +0 -278
- package/dist/modules/fulfillment/repository/in-memory.d.ts +0 -53
- package/dist/modules/fulfillment/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/fulfillment/repository/in-memory.js +0 -327
- package/dist/modules/inventory/repository/in-memory.d.ts +0 -51
- package/dist/modules/inventory/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/inventory/repository/in-memory.js +0 -281
- package/dist/modules/media/repository/in-memory.d.ts +0 -26
- package/dist/modules/media/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/media/repository/in-memory.js +0 -145
- package/dist/modules/orders/repository/in-memory.d.ts +0 -40
- package/dist/modules/orders/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/orders/repository/in-memory.js +0 -245
- package/dist/modules/pricing/repository/in-memory.d.ts +0 -25
- package/dist/modules/pricing/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/pricing/repository/in-memory.js +0 -288
- package/dist/modules/promotions/repository/in-memory.d.ts +0 -32
- package/dist/modules/promotions/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/promotions/repository/in-memory.js +0 -227
- package/dist/modules/webhooks/repository/in-memory.d.ts +0 -31
- package/dist/modules/webhooks/repository/in-memory.d.ts.map +0 -1
- package/dist/modules/webhooks/repository/in-memory.js +0 -187
- package/dist/runtime/state-manager.d.ts +0 -14
- package/dist/runtime/state-manager.d.ts.map +0 -1
- package/dist/runtime/state-manager.js +0 -84
- package/dist/runtime/state-repository.d.ts +0 -13
- package/dist/runtime/state-repository.d.ts.map +0 -1
- package/dist/runtime/state-repository.js +0 -160
- package/dist/runtime/state.d.ts +0 -382
- package/dist/runtime/state.d.ts.map +0 -1
- package/dist/runtime/state.js +0 -37
- package/dist/runtime/store.d.ts +0 -382
- package/dist/runtime/store.d.ts.map +0 -1
- package/dist/runtime/store.js +0 -37
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { index, integer, jsonb, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
|
2
|
-
import { organization } from "../../auth/auth-schema";
|
|
3
|
-
import { sellableEntities, variants } from "../catalog/schema";
|
|
2
|
+
import { organization } from "../../auth/auth-schema.js";
|
|
3
|
+
import { sellableEntities, variants } from "../catalog/schema.js";
|
|
4
4
|
|
|
5
5
|
export const carts = pgTable("carts", {
|
|
6
6
|
id: uuid("id").defaultRandom().primaryKey(),
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { resolveOrgId } from "../../auth/org";
|
|
2
|
-
import { assertOwnership, assertPermission } from "../../auth/permissions";
|
|
3
|
-
import type { Actor } from "../../auth/types";
|
|
4
|
-
import type { CommerceConfig } from "../../config/types";
|
|
1
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
2
|
+
import { assertOwnership, assertPermission } from "../../auth/permissions.js";
|
|
3
|
+
import type { Actor } from "../../auth/types.js";
|
|
4
|
+
import type { CommerceConfig } from "../../config/types.js";
|
|
5
5
|
import {
|
|
6
6
|
CommerceNotFoundError,
|
|
7
7
|
CommerceValidationError,
|
|
8
8
|
toCommerceError,
|
|
9
|
-
} from "../../kernel/errors";
|
|
10
|
-
import { runAfterHooks, runBeforeHooks } from "../../kernel/hooks/executor";
|
|
11
|
-
import { createHookContext } from "../../kernel/hooks/create-context";
|
|
9
|
+
} from "../../kernel/errors.js";
|
|
10
|
+
import { runAfterHooks, runBeforeHooks } from "../../kernel/hooks/executor.js";
|
|
11
|
+
import { createHookContext } from "../../kernel/hooks/create-context.js";
|
|
12
12
|
import type {
|
|
13
13
|
AfterHook,
|
|
14
14
|
BeforeHook,
|
|
15
15
|
HookContext,
|
|
16
|
-
} from "../../kernel/hooks/types";
|
|
17
|
-
import type { HookRegistry } from "../../kernel/hooks/registry";
|
|
18
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
19
|
-
import { createLogger } from "../../utils/logger";
|
|
20
|
-
import type { TxContext } from "../../kernel/database/tx-context";
|
|
21
|
-
import { CartRepository, type Cart, type CartLineItem } from "./repository";
|
|
22
|
-
import type { CatalogRepository } from "../catalog/repository";
|
|
16
|
+
} from "../../kernel/hooks/types.js";
|
|
17
|
+
import type { HookRegistry } from "../../kernel/hooks/registry.js";
|
|
18
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
19
|
+
import { createLogger } from "../../utils/logger.js";
|
|
20
|
+
import type { TxContext } from "../../kernel/database/tx-context.js";
|
|
21
|
+
import { CartRepository, type Cart, type CartLineItem } from "./repository/index.js";
|
|
22
|
+
import type { CatalogRepository } from "../catalog/repository/index.js";
|
|
23
23
|
|
|
24
24
|
export type {
|
|
25
25
|
CreateCartInput,
|
|
26
26
|
AddCartItemInput,
|
|
27
27
|
UpdateCartItemInput,
|
|
28
|
-
} from "./schemas";
|
|
28
|
+
} from "./schemas.js";
|
|
29
29
|
|
|
30
30
|
import type {
|
|
31
31
|
CreateCartInput,
|
|
32
32
|
AddCartItemInput,
|
|
33
33
|
UpdateCartItemInput,
|
|
34
|
-
} from "./schemas";
|
|
34
|
+
} from "./schemas.js";
|
|
35
35
|
|
|
36
|
-
import { defaultCartItemMatcher, type CartItemMatcher } from "./matcher";
|
|
36
|
+
import { defaultCartItemMatcher, type CartItemMatcher } from "./matcher.js";
|
|
37
37
|
|
|
38
38
|
export interface CartServiceDeps {
|
|
39
39
|
repository: CartRepository;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { eq, and, inArray, type SQL } from "drizzle-orm";
|
|
2
|
-
import type { TxContext } from "../../../kernel/database/tx-context";
|
|
2
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
3
3
|
import type {
|
|
4
4
|
DrizzleDatabase,
|
|
5
5
|
DbOrTx,
|
|
6
|
-
} from "../../../kernel/database/drizzle-db";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
7
|
import {
|
|
8
8
|
sellableEntities,
|
|
9
9
|
sellableAttributes,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
optionValues,
|
|
17
17
|
variants,
|
|
18
18
|
variantOptionValues,
|
|
19
|
-
} from "../schema";
|
|
19
|
+
} from "../schema.js";
|
|
20
20
|
|
|
21
21
|
// Infer types from Drizzle schema
|
|
22
22
|
export type SellableEntity = typeof sellableEntities.$inferSelect;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { resolveOrgId } from "../../auth/org";
|
|
2
|
-
import { assertPermission } from "../../auth/permissions";
|
|
3
|
-
import type { Actor } from "../../auth/types";
|
|
4
|
-
import type { CommerceConfig } from "../../config/types";
|
|
1
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
2
|
+
import { assertPermission } from "../../auth/permissions.js";
|
|
3
|
+
import type { Actor } from "../../auth/types.js";
|
|
4
|
+
import type { CommerceConfig } from "../../config/types.js";
|
|
5
5
|
import {
|
|
6
6
|
CommerceConflictError,
|
|
7
7
|
CommerceNotFoundError,
|
|
8
8
|
CommerceValidationError,
|
|
9
9
|
toCommerceError,
|
|
10
|
-
} from "../../kernel/errors";
|
|
11
|
-
import { runAfterHooks, runBeforeHooks } from "../../kernel/hooks/executor";
|
|
12
|
-
import { createHookContext } from "../../kernel/hooks/create-context";
|
|
10
|
+
} from "../../kernel/errors.js";
|
|
11
|
+
import { runAfterHooks, runBeforeHooks } from "../../kernel/hooks/executor.js";
|
|
12
|
+
import { createHookContext } from "../../kernel/hooks/create-context.js";
|
|
13
13
|
import type {
|
|
14
14
|
AfterHook,
|
|
15
15
|
BeforeHook,
|
|
16
16
|
HookContext,
|
|
17
|
-
} from "../../kernel/hooks/types";
|
|
18
|
-
import type { HookRegistry } from "../../kernel/hooks/registry";
|
|
19
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
20
|
-
import { createLogger } from "../../utils/logger";
|
|
21
|
-
import { paginate, type Pagination } from "../../utils/pagination";
|
|
22
|
-
import type { TxContext } from "../../kernel/database/tx-context";
|
|
17
|
+
} from "../../kernel/hooks/types.js";
|
|
18
|
+
import type { HookRegistry } from "../../kernel/hooks/registry.js";
|
|
19
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
20
|
+
import { createLogger } from "../../utils/logger.js";
|
|
21
|
+
import { paginate, type Pagination } from "../../utils/pagination.js";
|
|
22
|
+
import type { TxContext } from "../../kernel/database/tx-context.js";
|
|
23
23
|
import {
|
|
24
24
|
CatalogRepository,
|
|
25
25
|
type SellableEntity,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
type OptionType,
|
|
34
34
|
type OptionValue,
|
|
35
35
|
type Variant,
|
|
36
|
-
} from "./repository";
|
|
36
|
+
} from "./repository/index.js";
|
|
37
37
|
|
|
38
38
|
// ─── Re-exported schema-derived types ────────────────────────────────────────
|
|
39
39
|
export type {
|
|
@@ -46,7 +46,7 @@ export type {
|
|
|
46
46
|
CreateOptionTypeInput,
|
|
47
47
|
CreateOptionValueInput,
|
|
48
48
|
CreateVariantInput,
|
|
49
|
-
} from "./schemas";
|
|
49
|
+
} from "./schemas.js";
|
|
50
50
|
|
|
51
51
|
import type {
|
|
52
52
|
CreateEntityInput,
|
|
@@ -58,7 +58,7 @@ import type {
|
|
|
58
58
|
CreateOptionTypeInput,
|
|
59
59
|
CreateOptionValueInput,
|
|
60
60
|
CreateVariantInput,
|
|
61
|
-
} from "./schemas";
|
|
61
|
+
} from "./schemas.js";
|
|
62
62
|
|
|
63
63
|
// ─── Hand-written types (not derivable from a single z.infer) ───────────────
|
|
64
64
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { eq, and } from "drizzle-orm";
|
|
2
|
-
import type { TxContext } from "../../../kernel/database/tx-context";
|
|
2
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
3
3
|
import type {
|
|
4
4
|
DrizzleDatabase,
|
|
5
5
|
DbOrTx,
|
|
6
|
-
} from "../../../kernel/database/drizzle-db";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
7
|
import {
|
|
8
8
|
customers,
|
|
9
9
|
customerAddresses,
|
|
10
10
|
customerGroups,
|
|
11
11
|
customerGroupMembers,
|
|
12
|
-
} from "../schema";
|
|
12
|
+
} from "../schema.js";
|
|
13
13
|
|
|
14
14
|
// Infer types from Drizzle schema
|
|
15
15
|
export type Customer = typeof customers.$inferSelect;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { boolean, index, jsonb, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
2
|
-
import { organization } from "../../auth/auth-schema";
|
|
2
|
+
import { organization } from "../../auth/auth-schema.js";
|
|
3
3
|
|
|
4
4
|
export const customers = pgTable("customers", {
|
|
5
5
|
id: uuid("id").defaultRandom().primaryKey(),
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { resolveOrgId } from "../../auth/org";
|
|
2
|
-
import type { Actor } from "../../auth/types";
|
|
3
|
-
import { CommerceNotFoundError } from "../../kernel/errors";
|
|
4
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
5
|
-
import type { TxContext } from "../../kernel/database/tx-context";
|
|
1
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
2
|
+
import type { Actor } from "../../auth/types.js";
|
|
3
|
+
import { CommerceNotFoundError } from "../../kernel/errors.js";
|
|
4
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
5
|
+
import type { TxContext } from "../../kernel/database/tx-context.js";
|
|
6
6
|
import type {
|
|
7
7
|
CustomersRepository,
|
|
8
8
|
Customer,
|
|
9
9
|
CustomerAddress,
|
|
10
10
|
CustomerAddressInsert,
|
|
11
|
-
} from "./repository";
|
|
11
|
+
} from "./repository/index.js";
|
|
12
12
|
|
|
13
13
|
interface CustomerServiceDeps {
|
|
14
14
|
repository: CustomersRepository;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { eq, desc, and, sql } from "drizzle-orm";
|
|
2
|
-
import type { TxContext } from "../../../kernel/database/tx-context";
|
|
2
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
3
3
|
import type {
|
|
4
4
|
DrizzleDatabase,
|
|
5
5
|
DbOrTx,
|
|
6
|
-
} from "../../../kernel/database/drizzle-db";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
7
|
import {
|
|
8
8
|
fulfillmentRecords,
|
|
9
9
|
fulfillmentLineItems,
|
|
10
10
|
fulfillmentEvents,
|
|
11
|
-
} from "../schema";
|
|
11
|
+
} from "../schema.js";
|
|
12
12
|
|
|
13
13
|
// Infer types from Drizzle schema
|
|
14
14
|
export type FulfillmentRecord = typeof fulfillmentRecords.$inferSelect;
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
uuid,
|
|
8
8
|
boolean,
|
|
9
9
|
} from "drizzle-orm/pg-core";
|
|
10
|
-
import { orders, orderLineItems } from "../orders/schema";
|
|
11
|
-
import { customers } from "../customers/schema";
|
|
10
|
+
import { orders, orderLineItems } from "../orders/schema.js";
|
|
11
|
+
import { customers } from "../customers/schema.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Fulfillment Records Table
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createHmac } from "node:crypto";
|
|
2
|
-
import { resolveOrgId } from "../../auth/org";
|
|
3
|
-
import type { Actor } from "../../auth/types";
|
|
4
|
-
import { CommerceNotFoundError } from "../../kernel/errors";
|
|
5
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
6
|
-
import type { TxContext } from "../../kernel/database/tx-context";
|
|
7
|
-
import type { FulfillmentRepository } from "./repository";
|
|
8
|
-
import type { OrdersRepository } from "../orders/repository";
|
|
2
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
3
|
+
import type { Actor } from "../../auth/types.js";
|
|
4
|
+
import { CommerceNotFoundError } from "../../kernel/errors.js";
|
|
5
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
6
|
+
import type { TxContext } from "../../kernel/database/tx-context.js";
|
|
7
|
+
import type { FulfillmentRepository } from "./repository/index.js";
|
|
8
|
+
import type { OrdersRepository } from "../orders/repository/index.js";
|
|
9
9
|
import type {
|
|
10
10
|
FulfillmentLineItem,
|
|
11
11
|
FulfillmentRecord,
|
|
12
12
|
FulfillmentStrategy,
|
|
13
13
|
FulfillmentStrategyContext,
|
|
14
|
-
} from "./types";
|
|
15
|
-
import { makeId } from "../../utils/id";
|
|
14
|
+
} from "./types.js";
|
|
15
|
+
import { makeId } from "../../utils/id.js";
|
|
16
16
|
|
|
17
17
|
interface InventoryServiceLike {
|
|
18
18
|
adjust(input: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Result } from "../../kernel/result";
|
|
2
|
-
import type { OrderLineItem } from "../orders/repository";
|
|
1
|
+
import type { Result } from "../../kernel/result.js";
|
|
2
|
+
import type { OrderLineItem } from "../orders/repository/index.js";
|
|
3
3
|
|
|
4
4
|
export interface FulfillmentRecord {
|
|
5
5
|
id: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { eq, and, inArray, isNull, sql } from "drizzle-orm";
|
|
2
|
-
import type { TxContext } from "../../../kernel/database/tx-context";
|
|
2
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
3
3
|
import type {
|
|
4
4
|
DrizzleDatabase,
|
|
5
5
|
DbOrTx,
|
|
6
|
-
} from "../../../kernel/database/drizzle-db";
|
|
7
|
-
import { warehouses, inventoryLevels, inventoryMovements } from "../schema";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
|
+
import { warehouses, inventoryLevels, inventoryMovements } from "../schema.js";
|
|
8
8
|
|
|
9
9
|
// Infer types from Drizzle schema
|
|
10
10
|
export type Warehouse = typeof warehouses.$inferSelect;
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
uniqueIndex,
|
|
10
10
|
uuid,
|
|
11
11
|
} from "drizzle-orm/pg-core";
|
|
12
|
-
import { organization } from "../../auth/auth-schema";
|
|
13
|
-
import { sellableEntities, variants } from "../catalog/schema";
|
|
12
|
+
import { organization } from "../../auth/auth-schema.js";
|
|
13
|
+
import { sellableEntities, variants } from "../catalog/schema.js";
|
|
14
14
|
|
|
15
15
|
export const warehouses = pgTable(
|
|
16
16
|
"warehouses",
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { resolveOrgId } from "../../auth/org";
|
|
2
|
-
import { assertPermission } from "../../auth/permissions";
|
|
3
|
-
import type { Actor } from "../../auth/types";
|
|
4
|
-
import type { CommerceConfig } from "../../config/types";
|
|
1
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
2
|
+
import { assertPermission } from "../../auth/permissions.js";
|
|
3
|
+
import type { Actor } from "../../auth/types.js";
|
|
4
|
+
import type { CommerceConfig } from "../../config/types.js";
|
|
5
5
|
import {
|
|
6
6
|
CommerceNotFoundError,
|
|
7
7
|
CommerceValidationError,
|
|
8
8
|
toCommerceError,
|
|
9
|
-
} from "../../kernel/errors";
|
|
10
|
-
import { runAfterHooks } from "../../kernel/hooks/executor";
|
|
11
|
-
import { createHookContext } from "../../kernel/hooks/create-context";
|
|
12
|
-
import type { HookContext } from "../../kernel/hooks/types";
|
|
13
|
-
import type { HookRegistry } from "../../kernel/hooks/registry";
|
|
14
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
15
|
-
import { createLogger } from "../../utils/logger";
|
|
16
|
-
import type { DatabaseAdapter } from "../../kernel/database/adapter";
|
|
17
|
-
import { createTxContext, type TxContext } from "../../kernel/database/tx-context";
|
|
9
|
+
} from "../../kernel/errors.js";
|
|
10
|
+
import { runAfterHooks } from "../../kernel/hooks/executor.js";
|
|
11
|
+
import { createHookContext } from "../../kernel/hooks/create-context.js";
|
|
12
|
+
import type { HookContext } from "../../kernel/hooks/types.js";
|
|
13
|
+
import type { HookRegistry } from "../../kernel/hooks/registry.js";
|
|
14
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
15
|
+
import { createLogger } from "../../utils/logger.js";
|
|
16
|
+
import type { DatabaseAdapter } from "../../kernel/database/adapter.js";
|
|
17
|
+
import { createTxContext, type TxContext } from "../../kernel/database/tx-context.js";
|
|
18
18
|
import {
|
|
19
19
|
InventoryRepository,
|
|
20
20
|
type Warehouse,
|
|
21
21
|
type InventoryLevel,
|
|
22
|
-
} from "./repository";
|
|
22
|
+
} from "./repository/index.js";
|
|
23
23
|
|
|
24
|
-
export type { InventoryAdjustInput, InventoryReserveInput, InventoryReleaseInput } from "./schemas";
|
|
25
|
-
import type { InventoryAdjustInput, InventoryReserveInput, InventoryReleaseInput } from "./schemas";
|
|
24
|
+
export type { InventoryAdjustInput, InventoryReserveInput, InventoryReleaseInput } from "./schemas.js";
|
|
25
|
+
import type { InventoryAdjustInput, InventoryReserveInput, InventoryReleaseInput } from "./schemas.js";
|
|
26
26
|
|
|
27
27
|
export interface InventoryServiceDeps {
|
|
28
28
|
repository: InventoryRepository;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { eq, and, inArray } from "drizzle-orm";
|
|
2
|
-
import type { TxContext } from "../../../kernel/database/tx-context";
|
|
2
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
3
3
|
import type {
|
|
4
4
|
DrizzleDatabase,
|
|
5
5
|
DbOrTx,
|
|
6
|
-
} from "../../../kernel/database/drizzle-db";
|
|
7
|
-
import { mediaAssets, entityMedia } from "../schema";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
|
+
import { mediaAssets, entityMedia } from "../schema.js";
|
|
8
8
|
|
|
9
9
|
// Infer types from Drizzle schema
|
|
10
10
|
export type MediaAsset = typeof mediaAssets.$inferSelect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { index, integer, jsonb, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
|
2
|
-
import { organization } from "../../auth/auth-schema";
|
|
3
|
-
import { sellableEntities, variants } from "../catalog/schema";
|
|
2
|
+
import { organization } from "../../auth/auth-schema.js";
|
|
3
|
+
import { sellableEntities, variants } from "../catalog/schema.js";
|
|
4
4
|
|
|
5
5
|
export const mediaAssets = pgTable(
|
|
6
6
|
"media_assets",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { resolveOrgId } from "../../auth/org";
|
|
2
|
-
import type { Actor } from "../../auth/types";
|
|
3
|
-
import type { StorageAdapter, StoredFile } from "./adapter";
|
|
4
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
1
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
2
|
+
import type { Actor } from "../../auth/types.js";
|
|
3
|
+
import type { StorageAdapter, StoredFile } from "./adapter.js";
|
|
4
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
5
5
|
import {
|
|
6
6
|
CommerceNotFoundError,
|
|
7
7
|
CommerceValidationError,
|
|
8
|
-
} from "../../kernel/errors";
|
|
9
|
-
import type { MediaRepository } from "./repository";
|
|
10
|
-
import type { CatalogRepository } from "../catalog/repository";
|
|
11
|
-
import type { TxContext } from "../../kernel/database/tx-context";
|
|
12
|
-
import { makeId } from "../../utils/id";
|
|
8
|
+
} from "../../kernel/errors.js";
|
|
9
|
+
import type { MediaRepository } from "./repository/index.js";
|
|
10
|
+
import type { CatalogRepository } from "../catalog/repository/index.js";
|
|
11
|
+
import type { TxContext } from "../../kernel/database/tx-context.js";
|
|
12
|
+
import { makeId } from "../../utils/id.js";
|
|
13
13
|
|
|
14
14
|
export interface UploadMediaInput {
|
|
15
15
|
filename: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { eq, and, desc, sql } from "drizzle-orm";
|
|
2
|
-
import type { TxContext } from "../../../kernel/database/tx-context";
|
|
2
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
3
3
|
import type {
|
|
4
4
|
DrizzleDatabase,
|
|
5
5
|
DbOrTx,
|
|
6
|
-
} from "../../../kernel/database/drizzle-db";
|
|
7
|
-
import { orders, orderLineItems, orderStatusHistory } from "../schema";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
|
+
import { orders, orderLineItems, orderStatusHistory } from "../schema.js";
|
|
8
8
|
|
|
9
9
|
// Infer types from Drizzle schema
|
|
10
10
|
export type Order = typeof orders.$inferSelect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
2
|
-
import { organization } from "../../auth/auth-schema";
|
|
3
|
-
import { sellableEntities, variants } from "../catalog/schema";
|
|
2
|
+
import { organization } from "../../auth/auth-schema.js";
|
|
3
|
+
import { sellableEntities, variants } from "../catalog/schema.js";
|
|
4
4
|
|
|
5
5
|
export const orders = pgTable("orders", {
|
|
6
6
|
id: uuid("id").defaultRandom().primaryKey(),
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { resolveOrgId } from "../../auth/org";
|
|
2
|
-
import { assertOwnership, assertPermission } from "../../auth/permissions";
|
|
3
|
-
import type { Actor } from "../../auth/types";
|
|
1
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
2
|
+
import { assertOwnership, assertPermission } from "../../auth/permissions.js";
|
|
3
|
+
import type { Actor } from "../../auth/types.js";
|
|
4
4
|
import {
|
|
5
5
|
CommerceInvalidTransitionError,
|
|
6
6
|
CommerceNotFoundError,
|
|
7
7
|
CommerceValidationError,
|
|
8
8
|
toCommerceError,
|
|
9
|
-
} from "../../kernel/errors";
|
|
10
|
-
import { runAfterHooks, runBeforeHooks } from "../../kernel/hooks/executor";
|
|
11
|
-
import { createHookContext } from "../../kernel/hooks/create-context";
|
|
9
|
+
} from "../../kernel/errors.js";
|
|
10
|
+
import { runAfterHooks, runBeforeHooks } from "../../kernel/hooks/executor.js";
|
|
11
|
+
import { createHookContext } from "../../kernel/hooks/create-context.js";
|
|
12
12
|
import type {
|
|
13
13
|
AfterHook,
|
|
14
14
|
BeforeHook,
|
|
15
15
|
HookContext,
|
|
16
|
-
} from "../../kernel/hooks/types";
|
|
17
|
-
import type { HookRegistry } from "../../kernel/hooks/registry";
|
|
16
|
+
} from "../../kernel/hooks/types.js";
|
|
17
|
+
import type { HookRegistry } from "../../kernel/hooks/registry.js";
|
|
18
18
|
import {
|
|
19
19
|
canTransition,
|
|
20
20
|
orderStateMachine,
|
|
21
21
|
type OrderState,
|
|
22
22
|
type StateDefinition,
|
|
23
|
-
} from "../../kernel/state-machine/machine";
|
|
24
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
25
|
-
import { createLogger } from "../../utils/logger";
|
|
26
|
-
import { paginate, type Pagination } from "../../utils/pagination";
|
|
27
|
-
import type { TxContext } from "../../kernel/database/tx-context";
|
|
28
|
-
import type { PluginDb } from "../../kernel/database/plugin-types";
|
|
23
|
+
} from "../../kernel/state-machine/machine.js";
|
|
24
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
25
|
+
import { createLogger } from "../../utils/logger.js";
|
|
26
|
+
import { paginate, type Pagination } from "../../utils/pagination.js";
|
|
27
|
+
import type { TxContext } from "../../kernel/database/tx-context.js";
|
|
28
|
+
import type { PluginDb } from "../../kernel/database/plugin-types.js";
|
|
29
29
|
import {
|
|
30
30
|
OrdersRepository,
|
|
31
31
|
type Order,
|
|
32
32
|
type OrderLineItem,
|
|
33
33
|
type OrderStatusHistory,
|
|
34
|
-
} from "./repository";
|
|
34
|
+
} from "./repository/index.js";
|
|
35
35
|
|
|
36
36
|
export interface CreateOrderInput {
|
|
37
37
|
customerId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { eq, and, lt, sql } from "drizzle-orm";
|
|
2
|
-
import { orders } from "./schema";
|
|
3
|
-
import type { TaskDefinition, TaskContext } from "../../kernel/jobs/types";
|
|
2
|
+
import { orders } from "./schema.js";
|
|
3
|
+
import type { TaskDefinition, TaskContext } from "../../kernel/jobs/types.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Stale Order Cleanup Task
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
import { eq } from "drizzle-orm";
|
|
12
12
|
import type { PgDatabase, PgQueryResultHKT } from "drizzle-orm/pg-core";
|
|
13
|
-
import { organization, member } from "../../auth/auth-schema";
|
|
14
|
-
import type { AuthInstance } from "../../auth/setup";
|
|
13
|
+
import { organization, member } from "../../auth/auth-schema.js";
|
|
14
|
+
import type { AuthInstance } from "../../auth/setup.js";
|
|
15
15
|
|
|
16
16
|
type DrizzleDb = PgDatabase<PgQueryResultHKT, Record<string, unknown>>;
|
|
17
17
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CommerceValidationError } from "../../kernel/errors";
|
|
2
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
1
|
+
import { CommerceValidationError } from "../../kernel/errors.js";
|
|
2
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
3
3
|
import type {
|
|
4
4
|
CreatePaymentIntentParams,
|
|
5
5
|
PaymentAdapter,
|
|
6
6
|
PaymentCapture,
|
|
7
7
|
PaymentIntent,
|
|
8
8
|
PaymentRefund,
|
|
9
|
-
} from "./adapter";
|
|
9
|
+
} from "./adapter.js";
|
|
10
10
|
|
|
11
11
|
export class PaymentsService {
|
|
12
12
|
private readonly adapterMap: Map<string, PaymentAdapter>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { eq, and, lte, gte, or, isNull } from "drizzle-orm";
|
|
2
|
-
import type { TxContext } from "../../../kernel/database/tx-context";
|
|
2
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
3
3
|
import type {
|
|
4
4
|
DrizzleDatabase,
|
|
5
5
|
DbOrTx,
|
|
6
|
-
} from "../../../kernel/database/drizzle-db";
|
|
7
|
-
import { prices, priceModifiers } from "../schema";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
|
+
import { prices, priceModifiers } from "../schema.js";
|
|
8
8
|
|
|
9
9
|
// Infer types from Drizzle schema
|
|
10
10
|
export type Price = typeof prices.$inferSelect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { index, integer, jsonb, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
|
2
|
-
import { organization } from "../../auth/auth-schema";
|
|
3
|
-
import { sellableEntities, variants } from "../catalog/schema";
|
|
2
|
+
import { organization } from "../../auth/auth-schema.js";
|
|
3
|
+
import { sellableEntities, variants } from "../catalog/schema.js";
|
|
4
4
|
|
|
5
5
|
export const prices = pgTable(
|
|
6
6
|
"prices",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { resolveOrgId } from "../../auth/org";
|
|
2
|
-
import type { Actor } from "../../auth/types";
|
|
1
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
2
|
+
import type { Actor } from "../../auth/types.js";
|
|
3
3
|
import {
|
|
4
4
|
CommerceNotFoundError,
|
|
5
5
|
CommerceValidationError,
|
|
6
|
-
} from "../../kernel/errors";
|
|
7
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
8
|
-
import type { TxContext } from "../../kernel/database/tx-context";
|
|
6
|
+
} from "../../kernel/errors.js";
|
|
7
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
8
|
+
import type { TxContext } from "../../kernel/database/tx-context.js";
|
|
9
9
|
import type {
|
|
10
10
|
PricingRepository,
|
|
11
11
|
Price,
|
|
12
12
|
PriceModifier,
|
|
13
13
|
PriceInsert,
|
|
14
14
|
PriceModifierInsert,
|
|
15
|
-
} from "./repository";
|
|
16
|
-
import type { CatalogRepository } from "../catalog/repository";
|
|
15
|
+
} from "./repository/index.js";
|
|
16
|
+
import type { CatalogRepository } from "../catalog/repository/index.js";
|
|
17
17
|
|
|
18
18
|
// Re-export PriceModifierType from schema for external use
|
|
19
19
|
export type PriceModifierType =
|
|
@@ -61,8 +61,8 @@ export interface ResolvedPrice {
|
|
|
61
61
|
basePriceId: string;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export type { SetBasePriceInput, CreatePriceModifierInput } from "./schemas";
|
|
65
|
-
import type { SetBasePriceInput, CreatePriceModifierInput } from "./schemas";
|
|
64
|
+
export type { SetBasePriceInput, CreatePriceModifierInput } from "./schemas.js";
|
|
65
|
+
import type { SetBasePriceInput, CreatePriceModifierInput } from "./schemas.js";
|
|
66
66
|
|
|
67
67
|
function matchesQuantity(
|
|
68
68
|
min: number | null | undefined,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { eq, and, lte, gte, or, isNull, desc, sql } from "drizzle-orm";
|
|
2
|
-
import type { TxContext } from "../../../kernel/database/tx-context";
|
|
2
|
+
import type { TxContext } from "../../../kernel/database/tx-context.js";
|
|
3
3
|
import type {
|
|
4
4
|
DrizzleDatabase,
|
|
5
5
|
DbOrTx,
|
|
6
|
-
} from "../../../kernel/database/drizzle-db";
|
|
7
|
-
import { promotions, promotionUsages } from "../schema";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
|
+
import { promotions, promotionUsages } from "../schema.js";
|
|
8
8
|
|
|
9
9
|
// Infer types from Drizzle schema
|
|
10
10
|
export type Promotion = typeof promotions.$inferSelect;
|