@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,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
3
|
-
import { createWebhookEndpointRoute, listWebhookEndpointsRoute, deleteWebhookEndpointRoute } from "../schemas/webhooks";
|
|
4
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { createWebhookEndpointRoute, listWebhookEndpointsRoute, deleteWebhookEndpointRoute } from "../schemas/webhooks.js";
|
|
4
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils.js";
|
|
5
5
|
|
|
6
6
|
export function webhookRoutes(kernel: Kernel) {
|
|
7
7
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z, createRoute } from "@hono/zod-openapi";
|
|
2
|
-
import { ErrorSchema, errorResponses, UuidParamSchema, DeletedResponseSchema } from "./shared";
|
|
3
|
-
import { CartResponse } from "./responses";
|
|
2
|
+
import { ErrorSchema, errorResponses, UuidParamSchema, DeletedResponseSchema } from "./shared.js";
|
|
3
|
+
import { CartResponse } from "./responses.js";
|
|
4
4
|
import {
|
|
5
5
|
CreateCartBodySchema,
|
|
6
6
|
AddCartItemBodySchema,
|
|
7
7
|
UpdateCartItemQuantityBodySchema,
|
|
8
|
-
} from "../../../modules/cart/schemas";
|
|
8
|
+
} from "../../../modules/cart/schemas.js";
|
|
9
9
|
|
|
10
10
|
export { CreateCartBodySchema, AddCartItemBodySchema, UpdateCartItemQuantityBodySchema };
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z, createRoute } from "@hono/zod-openapi";
|
|
2
|
-
import { errorResponses } from "./shared";
|
|
3
|
-
import { CatalogEntityResponse, CatalogEntityListResponse } from "./responses";
|
|
2
|
+
import { errorResponses } from "./shared.js";
|
|
3
|
+
import { CatalogEntityResponse, CatalogEntityListResponse } from "./responses.js";
|
|
4
4
|
import {
|
|
5
5
|
CreateEntityBodySchema,
|
|
6
6
|
UpdateEntityBodySchema,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
CreateOptionValueBodySchema,
|
|
14
14
|
CreateVariantBodySchema,
|
|
15
15
|
GenerateVariantsBodySchema,
|
|
16
|
-
} from "../../../modules/catalog/schemas";
|
|
16
|
+
} from "../../../modules/catalog/schemas.js";
|
|
17
17
|
|
|
18
18
|
// ─── Response Schemas ───────────────────────────────────────────────────────
|
|
19
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z, createRoute } from "@hono/zod-openapi";
|
|
2
|
-
import { errorResponses } from "./shared";
|
|
3
|
-
import { CustomerResponse, OrderResponse, OrderListResponse, CustomerAddressListResponse, CartResponse } from "./responses";
|
|
2
|
+
import { errorResponses } from "./shared.js";
|
|
3
|
+
import { CustomerResponse, OrderResponse, OrderListResponse, CustomerAddressListResponse, CartResponse } from "./responses.js";
|
|
4
4
|
|
|
5
5
|
const GenericDataResponse = z.object({ data: z.record(z.string(), z.unknown()) });
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z, createRoute } from "@hono/zod-openapi";
|
|
2
|
-
import { ErrorSchema, errorResponses } from "./shared";
|
|
2
|
+
import { ErrorSchema, errorResponses } from "./shared.js";
|
|
3
3
|
|
|
4
4
|
// ─── Request Schemas ─────────────────────────────────────────────────────────
|
|
5
5
|
|
|
6
|
-
import { InventoryAdjustBodySchema, InventoryReserveBodySchema, InventoryReleaseBodySchema } from "../../../modules/inventory/schemas";
|
|
6
|
+
import { InventoryAdjustBodySchema, InventoryReserveBodySchema, InventoryReleaseBodySchema } from "../../../modules/inventory/schemas.js";
|
|
7
7
|
export { InventoryAdjustBodySchema, InventoryReserveBodySchema, InventoryReleaseBodySchema };
|
|
8
8
|
|
|
9
9
|
export const CreateWarehouseBodySchema = z.object({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z, createRoute } from "@hono/zod-openapi";
|
|
2
|
-
import { ErrorSchema, errorResponses } from "./shared";
|
|
3
|
-
import { OrderResponse, OrderListResponse } from "./responses";
|
|
2
|
+
import { ErrorSchema, errorResponses } from "./shared.js";
|
|
3
|
+
import { OrderResponse, OrderListResponse } from "./responses.js";
|
|
4
4
|
|
|
5
5
|
// ─── Request Schemas ────────────────────────────────────────────────────────
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z, createRoute } from "@hono/zod-openapi";
|
|
2
|
-
import { ErrorSchema, errorResponses } from "./shared";
|
|
2
|
+
import { ErrorSchema, errorResponses } from "./shared.js";
|
|
3
3
|
|
|
4
4
|
// ─── Request Schemas ────────────────────────────────────────────────────────
|
|
5
5
|
|
|
6
|
-
import { SetBasePriceBodySchema, CreateModifierBodySchema } from "../../../modules/pricing/schemas";
|
|
6
|
+
import { SetBasePriceBodySchema, CreateModifierBodySchema } from "../../../modules/pricing/schemas.js";
|
|
7
7
|
export { SetBasePriceBodySchema, CreateModifierBodySchema };
|
|
8
8
|
|
|
9
9
|
// ─── Response Schemas ───────────────────────────────────────────────────────
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z, createRoute } from "@hono/zod-openapi";
|
|
2
|
-
import { ErrorSchema, errorResponses, UuidParamSchema } from "./shared";
|
|
2
|
+
import { ErrorSchema, errorResponses, UuidParamSchema } from "./shared.js";
|
|
3
3
|
|
|
4
4
|
// ─── Request Schemas ────────────────────────────────────────────────────────
|
|
5
5
|
|
|
6
|
-
import { CreatePromotionBodySchema } from "../../../modules/promotions/schemas";
|
|
6
|
+
import { CreatePromotionBodySchema } from "../../../modules/promotions/schemas.js";
|
|
7
7
|
export { CreatePromotionBodySchema };
|
|
8
8
|
|
|
9
9
|
export const ValidatePromotionBodySchema = z.object({
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
import { createSelectSchema } from "drizzle-zod";
|
|
11
11
|
import { z } from "@hono/zod-openapi";
|
|
12
|
-
import { orders, orderLineItems } from "../../../modules/orders/schema";
|
|
13
|
-
import { carts, cartLineItems } from "../../../modules/cart/schema";
|
|
14
|
-
import { customers, customerAddresses } from "../../../modules/customers/schema";
|
|
15
|
-
import { sellableEntities } from "../../../modules/catalog/schema";
|
|
16
|
-
import { commerceJobs } from "../../../kernel/jobs/schema";
|
|
12
|
+
import { orders, orderLineItems } from "../../../modules/orders/schema.js";
|
|
13
|
+
import { carts, cartLineItems } from "../../../modules/cart/schema.js";
|
|
14
|
+
import { customers, customerAddresses } from "../../../modules/customers/schema.js";
|
|
15
|
+
import { sellableEntities } from "../../../modules/catalog/schema.js";
|
|
16
|
+
import { commerceJobs } from "../../../kernel/jobs/schema.js";
|
|
17
17
|
|
|
18
18
|
// ─── Orders ──────────────────────────────────────────────────────────────────
|
|
19
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CommerceError } from "../../kernel/errors";
|
|
2
|
-
import { mapErrorToStatus } from "../../kernel/error-mapper";
|
|
3
|
-
import { toCommerceError } from "../../kernel/errors";
|
|
4
|
-
import type { Actor } from "../../auth/types";
|
|
1
|
+
import type { CommerceError } from "../../kernel/errors.js";
|
|
2
|
+
import { mapErrorToStatus } from "../../kernel/error-mapper.js";
|
|
3
|
+
import { toCommerceError } from "../../kernel/errors.js";
|
|
4
|
+
import type { Actor } from "../../auth/types.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Shared Hono environment type for all sub-routers.
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import { Hono } from "hono";
|
|
30
|
-
import type { Kernel } from "../../runtime/kernel";
|
|
30
|
+
import type { Kernel } from "../../runtime/kernel.js";
|
|
31
31
|
|
|
32
32
|
export interface WebhookRouterResult {
|
|
33
33
|
/** Raw Hono app — mount routes on this. No UC auth middleware attached. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CompensationContext, Step } from "./types";
|
|
2
|
-
import type { Result } from "../result";
|
|
1
|
+
import type { CompensationContext, Step } from "./types.js";
|
|
2
|
+
import type { Result } from "../result.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AnyStep erases the output type parameter so that heterogeneous step
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TxContext } from "../database/tx-context";
|
|
2
|
-
import type { HookContext } from "../hooks/types";
|
|
3
|
-
import type { Result } from "../result";
|
|
1
|
+
import type { TxContext } from "../database/tx-context.js";
|
|
2
|
+
import type { HookContext } from "../hooks/types.js";
|
|
3
|
+
import type { Result } from "../result.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* CompensationContext carries the transaction and hook context into
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* });
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import type { CommerceConfig } from "../../config/types";
|
|
24
|
-
import * as schema from "./schema";
|
|
23
|
+
import type { CommerceConfig } from "../../config/types.js";
|
|
24
|
+
import * as schema from "./schema.js";
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Returns the combined Drizzle schema object with all table definitions.
|
|
@@ -10,40 +10,40 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
// Auth (Better Auth generated tables)
|
|
13
|
-
export * from "../../auth/auth-schema";
|
|
13
|
+
export * from "../../auth/auth-schema.js";
|
|
14
14
|
|
|
15
15
|
// Catalog module
|
|
16
|
-
export * from "../../modules/catalog/schema";
|
|
16
|
+
export * from "../../modules/catalog/schema.js";
|
|
17
17
|
|
|
18
18
|
// Inventory module
|
|
19
|
-
export * from "../../modules/inventory/schema";
|
|
19
|
+
export * from "../../modules/inventory/schema.js";
|
|
20
20
|
|
|
21
21
|
// Cart module
|
|
22
|
-
export * from "../../modules/cart/schema";
|
|
22
|
+
export * from "../../modules/cart/schema.js";
|
|
23
23
|
|
|
24
24
|
// Orders module
|
|
25
|
-
export * from "../../modules/orders/schema";
|
|
25
|
+
export * from "../../modules/orders/schema.js";
|
|
26
26
|
|
|
27
27
|
// Customers module
|
|
28
|
-
export * from "../../modules/customers/schema";
|
|
28
|
+
export * from "../../modules/customers/schema.js";
|
|
29
29
|
|
|
30
30
|
// Pricing module
|
|
31
|
-
export * from "../../modules/pricing/schema";
|
|
31
|
+
export * from "../../modules/pricing/schema.js";
|
|
32
32
|
|
|
33
33
|
// Promotions module
|
|
34
|
-
export * from "../../modules/promotions/schema";
|
|
34
|
+
export * from "../../modules/promotions/schema.js";
|
|
35
35
|
|
|
36
36
|
// Media module
|
|
37
|
-
export * from "../../modules/media/schema";
|
|
37
|
+
export * from "../../modules/media/schema.js";
|
|
38
38
|
|
|
39
39
|
// Webhooks module
|
|
40
|
-
export * from "../../modules/webhooks/schema";
|
|
40
|
+
export * from "../../modules/webhooks/schema.js";
|
|
41
41
|
|
|
42
42
|
// Fulfillment module
|
|
43
|
-
export * from "../../modules/fulfillment/schema";
|
|
43
|
+
export * from "../../modules/fulfillment/schema.js";
|
|
44
44
|
|
|
45
45
|
// Jobs (kernel)
|
|
46
|
-
export * from "../jobs/schema";
|
|
46
|
+
export * from "../jobs/schema.js";
|
|
47
47
|
|
|
48
48
|
// Audit module
|
|
49
|
-
export * from "../../modules/audit/schema";
|
|
49
|
+
export * from "../../modules/audit/schema.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import type { Actor } from "../../auth/types";
|
|
3
|
-
import type { DatabaseAdapter } from "./adapter";
|
|
2
|
+
import type { Actor } from "../../auth/types.js";
|
|
3
|
+
import type { DatabaseAdapter } from "./adapter.js";
|
|
4
4
|
|
|
5
5
|
export interface TxContext<TTx = unknown> {
|
|
6
6
|
tx: TTx;
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
} from "drizzle-orm";
|
|
12
12
|
import type { PgTableWithColumns, TableConfig } from "drizzle-orm/pg-core";
|
|
13
13
|
import { PgTable } from "drizzle-orm/pg-core";
|
|
14
|
-
import type { TxContext } from "../database/tx-context";
|
|
15
|
-
import type { DrizzleDatabase, DbOrTx } from "../database/drizzle-db";
|
|
16
|
-
import { CommerceNotFoundError } from "../errors";
|
|
14
|
+
import type { TxContext } from "../database/tx-context.js";
|
|
15
|
+
import type { DrizzleDatabase, DbOrTx } from "../database/drizzle-db.js";
|
|
16
|
+
import { CommerceNotFoundError } from "../errors.js";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Filter type — partial record of column values to match with eq().
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import type { Actor } from "../../auth/types";
|
|
3
|
-
import type { JobsAdapter } from "../jobs/adapter";
|
|
4
|
-
import { NullJobsAdapter } from "../jobs/adapter";
|
|
5
|
-
import type { PluginDb } from "../database/plugin-types";
|
|
6
|
-
import type { HookContext, HookOrigin, Logger, ServiceContainer } from "./types";
|
|
2
|
+
import type { Actor } from "../../auth/types.js";
|
|
3
|
+
import type { JobsAdapter } from "../jobs/adapter.js";
|
|
4
|
+
import { NullJobsAdapter } from "../jobs/adapter.js";
|
|
5
|
+
import type { PluginDb } from "../database/plugin-types.js";
|
|
6
|
+
import type { HookContext, HookOrigin, Logger, ServiceContainer } from "./types.js";
|
|
7
7
|
|
|
8
8
|
export interface CreateHookContextArgs {
|
|
9
9
|
actor: Actor | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Actor } from "../../auth/types";
|
|
2
|
-
import type { JobsAdapter } from "../jobs/adapter";
|
|
3
|
-
import type { PluginDb } from "../database/plugin-types";
|
|
1
|
+
import type { Actor } from "../../auth/types.js";
|
|
2
|
+
import type { JobsAdapter } from "../jobs/adapter.js";
|
|
3
|
+
import type { PluginDb } from "../database/plugin-types.js";
|
|
4
4
|
|
|
5
5
|
export type HookOperation =
|
|
6
6
|
| "create"
|
package/src/kernel/http-error.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { eq, and } from "drizzle-orm";
|
|
2
|
-
import type { DrizzleDatabase } from "../database/drizzle-db";
|
|
3
|
-
import type { TaskDefinition } from "./types";
|
|
4
|
-
import type { JobsAdapter, EnqueueOptions } from "./adapter";
|
|
5
|
-
import { DEFAULT_ORG_ID } from "../../auth/org";
|
|
6
|
-
import { commerceJobs } from "./schema";
|
|
2
|
+
import type { DrizzleDatabase } from "../database/drizzle-db.js";
|
|
3
|
+
import type { TaskDefinition } from "./types.js";
|
|
4
|
+
import type { JobsAdapter, EnqueueOptions } from "./adapter.js";
|
|
5
|
+
import { DEFAULT_ORG_ID } from "../../auth/org.js";
|
|
6
|
+
import { commerceJobs } from "./schema.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* PostgreSQL-backed job queue adapter using the application's own database.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { eq, and, sql } from "drizzle-orm";
|
|
2
|
-
import type { DrizzleDatabase } from "../database/drizzle-db";
|
|
3
|
-
import type { Logger, ServiceContainer } from "../hooks/types";
|
|
4
|
-
import type { TaskDefinition } from "./types";
|
|
5
|
-
import { commerceJobs } from "./schema";
|
|
2
|
+
import type { DrizzleDatabase } from "../database/drizzle-db.js";
|
|
3
|
+
import type { Logger, ServiceContainer } from "../hooks/types.js";
|
|
4
|
+
import type { TaskDefinition } from "./types.js";
|
|
5
|
+
import { commerceJobs } from "./schema.js";
|
|
6
6
|
|
|
7
7
|
export interface RunPendingJobsArgs {
|
|
8
8
|
db: DrizzleDatabase;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
timestamp,
|
|
8
8
|
index,
|
|
9
9
|
} from "drizzle-orm/pg-core";
|
|
10
|
-
import { organization } from "../../auth/auth-schema";
|
|
10
|
+
import { organization } from "../../auth/auth-schema.js";
|
|
11
11
|
|
|
12
12
|
export const commerceJobs = pgTable("commerce_jobs", {
|
|
13
13
|
id: uuid("id").primaryKey().defaultRandom(),
|
package/src/kernel/jobs/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Logger, ServiceContainer } from "../hooks/types";
|
|
2
|
-
import type { DrizzleDatabase } from "../database/drizzle-db";
|
|
1
|
+
import type { Logger, ServiceContainer } from "../hooks/types.js";
|
|
2
|
+
import type { DrizzleDatabase } from "../database/drizzle-db.js";
|
|
3
3
|
|
|
4
4
|
export interface TaskContext {
|
|
5
5
|
logger: Logger;
|
package/src/kernel/local-api.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Actor } from "../auth/types";
|
|
2
|
-
import type { Kernel } from "../runtime/kernel";
|
|
3
|
-
import type { TxContext } from "./database/tx-context";
|
|
1
|
+
import type { Actor } from "../auth/types.js";
|
|
2
|
+
import type { Kernel } from "../runtime/kernel.js";
|
|
3
|
+
import type { TxContext } from "./database/tx-context.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Proxy-based Local API — the Payload-style programmatic interface.
|
|
@@ -13,7 +13,7 @@ import type { TxContext } from "./database/tx-context";
|
|
|
13
13
|
*
|
|
14
14
|
* ```typescript
|
|
15
15
|
* import { createCommerce } from "@unifiedcommerce/core";
|
|
16
|
-
* import config from "./commerce.config";
|
|
16
|
+
* import config from "./commerce.config.js";
|
|
17
17
|
*
|
|
18
18
|
* const commerce = await createCommerce(config);
|
|
19
19
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CommerceNotFoundError } from "../errors";
|
|
1
|
+
import { CommerceNotFoundError } from "../errors.js";
|
|
2
2
|
import type {
|
|
3
3
|
QueryRegistry,
|
|
4
4
|
EntityDefinition,
|
|
5
5
|
RelationDefinition,
|
|
6
|
-
} from "./registry";
|
|
6
|
+
} from "./registry.js";
|
|
7
7
|
|
|
8
8
|
export interface QueryInput {
|
|
9
9
|
entity: string;
|
package/src/kernel/result.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sql, type SQL } from "drizzle-orm";
|
|
2
|
-
import type { DrizzleDatabase } from "../../kernel/database/drizzle-db";
|
|
3
|
-
import { CommerceValidationError } from "../../kernel/errors";
|
|
4
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
2
|
+
import type { DrizzleDatabase } from "../../kernel/database/drizzle-db.js";
|
|
3
|
+
import { CommerceValidationError } from "../../kernel/errors.js";
|
|
4
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
5
5
|
import type {
|
|
6
6
|
AnalyticsAdapter,
|
|
7
7
|
AnalyticsFilter,
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
AnalyticsQueryResult,
|
|
13
13
|
AnalyticsScope,
|
|
14
14
|
AnalyticsTimeDimension,
|
|
15
|
-
} from "./types";
|
|
15
|
+
} from "./types.js";
|
|
16
16
|
|
|
17
17
|
// ─── Date Range Parsing ──────────────────────────────────────────────────────
|
|
18
18
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* (DrizzleAnalyticsAdapter — always on, built into core).
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { CommerceConfig } from "../../config/types";
|
|
10
|
-
import { CommerceValidationError } from "../../kernel/errors";
|
|
11
|
-
import { Err, Ok, type Result } from "../../kernel/result";
|
|
9
|
+
import type { CommerceConfig } from "../../config/types.js";
|
|
10
|
+
import { CommerceValidationError } from "../../kernel/errors.js";
|
|
11
|
+
import { Err, Ok, type Result } from "../../kernel/result.js";
|
|
12
12
|
import type {
|
|
13
13
|
AnalyticsAdapter,
|
|
14
14
|
AnalyticsMeta,
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
AnalyticsQueryParams,
|
|
18
18
|
AnalyticsQueryResult,
|
|
19
19
|
AnalyticsScope,
|
|
20
|
-
} from "./types";
|
|
20
|
+
} from "./types.js";
|
|
21
21
|
|
|
22
22
|
// Re-export types for backwards compatibility
|
|
23
23
|
export type {
|
|
@@ -26,7 +26,7 @@ export type {
|
|
|
26
26
|
AnalyticsQueryParams,
|
|
27
27
|
AnalyticsModelDefinition,
|
|
28
28
|
AnalyticsMeta,
|
|
29
|
-
} from "./types";
|
|
29
|
+
} from "./types.js";
|
|
30
30
|
|
|
31
31
|
export interface AnalyticsServiceDeps {
|
|
32
32
|
adapter: AnalyticsAdapter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AfterHook } from "../../kernel/hooks/types";
|
|
2
|
-
import type { HookHandler } from "../../kernel/hooks/registry";
|
|
3
|
-
import type { AuditService } from "./service";
|
|
1
|
+
import type { AfterHook } from "../../kernel/hooks/types.js";
|
|
2
|
+
import type { HookHandler } from "../../kernel/hooks/registry.js";
|
|
3
|
+
import type { AuditService } from "./service.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates an after-hook that records an audit entry for the operation.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { eq, and, desc, gte, lte } from "drizzle-orm";
|
|
2
2
|
import type { InferSelectModel } from "drizzle-orm";
|
|
3
|
-
import type { DrizzleDatabase } from "../../kernel/database/drizzle-db";
|
|
4
|
-
import type { TxContext } from "../../kernel/database/tx-context";
|
|
5
|
-
import type { HookContext } from "../../kernel/hooks/types";
|
|
6
|
-
import { resolveOrgId } from "../../auth/org";
|
|
7
|
-
import { auditLog } from "./schema";
|
|
3
|
+
import type { DrizzleDatabase } from "../../kernel/database/drizzle-db.js";
|
|
4
|
+
import type { TxContext } from "../../kernel/database/tx-context.js";
|
|
5
|
+
import type { HookContext } from "../../kernel/hooks/types.js";
|
|
6
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
7
|
+
import { auditLog } from "./schema.js";
|
|
8
8
|
|
|
9
9
|
export type AuditEntry = InferSelectModel<typeof auditLog>;
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { eq, and, lt } 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 { carts, cartLineItems } from "../schema";
|
|
6
|
+
} from "../../../kernel/database/drizzle-db.js";
|
|
7
|
+
import { carts, cartLineItems } from "../schema.js";
|
|
8
8
|
|
|
9
9
|
// Infer types from Drizzle schema
|
|
10
10
|
export type Cart = typeof carts.$inferSelect;
|