@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
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { defineConfig } from "./config/define-config";
|
|
1
|
+
export { defineConfig } from "./config/define-config.js";
|
|
2
2
|
export type {
|
|
3
3
|
CommerceConfig,
|
|
4
4
|
CommercePlugin,
|
|
5
5
|
MCPResource,
|
|
6
6
|
MCPTool,
|
|
7
|
-
} from "./config/types";
|
|
8
|
-
export { defineCommercePlugin } from "./kernel/plugin/manifest";
|
|
7
|
+
} from "./config/types.js";
|
|
8
|
+
export { defineCommercePlugin } from "./kernel/plugin/manifest.js";
|
|
9
9
|
export type {
|
|
10
10
|
CommercePluginManifest,
|
|
11
11
|
PluginContext,
|
|
@@ -13,33 +13,33 @@ export type {
|
|
|
13
13
|
PluginLogger,
|
|
14
14
|
PluginPermission,
|
|
15
15
|
PluginRouteRegistration,
|
|
16
|
-
} from "./kernel/plugin/manifest";
|
|
17
|
-
|
|
18
|
-
export { router } from "./interfaces/rest/router";
|
|
19
|
-
export { webhookRouter, type WebhookRouterResult } from "./interfaces/rest/webhook-router";
|
|
20
|
-
export { isPrivateUrl, isPrivateIp } from "./modules/webhooks/ssrf-guard";
|
|
21
|
-
export { createServer } from "./runtime/server";
|
|
22
|
-
export { createLogger } from "./runtime/logger";
|
|
23
|
-
export type { Logger as PinoLogger } from "./runtime/logger";
|
|
24
|
-
export { setupGracefulShutdown } from "./runtime/shutdown";
|
|
25
|
-
export { createKernel } from "./runtime/kernel";
|
|
26
|
-
export type { Kernel } from "./runtime/kernel";
|
|
27
|
-
export { createTestKernel } from "./test-utils/create-test-kernel";
|
|
28
|
-
export { createTestPluginContext } from "./test-utils/create-test-plugin-context";
|
|
29
|
-
export { createRepositoryTestHarness } from "./test-utils/create-repository-test-harness";
|
|
30
|
-
export { createPluginTestApp, type PluginTestApp, type TestAppEnv } from "./test-utils/create-plugin-test-app";
|
|
16
|
+
} from "./kernel/plugin/manifest.js";
|
|
17
|
+
|
|
18
|
+
export { router } from "./interfaces/rest/router.js";
|
|
19
|
+
export { webhookRouter, type WebhookRouterResult } from "./interfaces/rest/webhook-router.js";
|
|
20
|
+
export { isPrivateUrl, isPrivateIp } from "./modules/webhooks/ssrf-guard.js";
|
|
21
|
+
export { createServer } from "./runtime/server.js";
|
|
22
|
+
export { createLogger } from "./runtime/logger.js";
|
|
23
|
+
export type { Logger as PinoLogger } from "./runtime/logger.js";
|
|
24
|
+
export { setupGracefulShutdown } from "./runtime/shutdown.js";
|
|
25
|
+
export { createKernel } from "./runtime/kernel.js";
|
|
26
|
+
export type { Kernel } from "./runtime/kernel.js";
|
|
27
|
+
export { createTestKernel } from "./test-utils/create-test-kernel.js";
|
|
28
|
+
export { createTestPluginContext } from "./test-utils/create-test-plugin-context.js";
|
|
29
|
+
export { createRepositoryTestHarness } from "./test-utils/create-repository-test-harness.js";
|
|
30
|
+
export { createPluginTestApp, type PluginTestApp, type TestAppEnv } from "./test-utils/create-plugin-test-app.js";
|
|
31
31
|
export {
|
|
32
32
|
testAdminActor, testStaffActor, testCustomerActor, testNoPermActor,
|
|
33
33
|
jsonHeaders,
|
|
34
|
-
} from "./test-utils/test-actors";
|
|
35
|
-
export { beforeHook, afterHook } from "./test-utils/typed-hooks";
|
|
36
|
-
|
|
37
|
-
export type { Actor } from "./auth/types";
|
|
38
|
-
export { resolveOrgId, ensureDefaultOrg, DEFAULT_ORG_ID } from "./auth/org";
|
|
39
|
-
export { OrganizationService } from "./modules/organization/service";
|
|
40
|
-
export { createScopedDb } from "./kernel/database/scoped-db";
|
|
41
|
-
export { assertOwnership, assertPermission } from "./auth/permissions";
|
|
42
|
-
export type { AccessResult, AccessContext, AccessFn, WhereClause } from "./auth/access";
|
|
34
|
+
} from "./test-utils/test-actors.js";
|
|
35
|
+
export { beforeHook, afterHook } from "./test-utils/typed-hooks.js";
|
|
36
|
+
|
|
37
|
+
export type { Actor } from "./auth/types.js";
|
|
38
|
+
export { resolveOrgId, ensureDefaultOrg, DEFAULT_ORG_ID } from "./auth/org.js";
|
|
39
|
+
export { OrganizationService } from "./modules/organization/service.js";
|
|
40
|
+
export { createScopedDb } from "./kernel/database/scoped-db.js";
|
|
41
|
+
export { assertOwnership, assertPermission } from "./auth/permissions.js";
|
|
42
|
+
export type { AccessResult, AccessContext, AccessFn, WhereClause } from "./auth/access.js";
|
|
43
43
|
export {
|
|
44
44
|
accessOR,
|
|
45
45
|
accessAND,
|
|
@@ -49,9 +49,9 @@ export {
|
|
|
49
49
|
isDocumentOwner,
|
|
50
50
|
publicAccess,
|
|
51
51
|
denyAll,
|
|
52
|
-
} from "./auth/access";
|
|
52
|
+
} from "./auth/access.js";
|
|
53
53
|
|
|
54
|
-
export { HookRegistry } from "./kernel/hooks/registry";
|
|
54
|
+
export { HookRegistry } from "./kernel/hooks/registry.js";
|
|
55
55
|
export type {
|
|
56
56
|
BeforeHook,
|
|
57
57
|
AfterHook,
|
|
@@ -60,40 +60,40 @@ export type {
|
|
|
60
60
|
HookOrigin,
|
|
61
61
|
Logger,
|
|
62
62
|
ServiceContainer,
|
|
63
|
-
} from "./kernel/hooks/types";
|
|
64
|
-
export { runBeforeHooks, runAfterHooks } from "./kernel/hooks/executor";
|
|
65
|
-
export { createHookContext } from "./kernel/hooks/create-context";
|
|
66
|
-
export type { CreateHookContextArgs } from "./kernel/hooks/create-context";
|
|
67
|
-
export type { JobsAdapter, EnqueueOptions } from "./kernel/jobs/adapter";
|
|
68
|
-
export { NullJobsAdapter } from "./kernel/jobs/adapter";
|
|
69
|
-
export { DrizzleJobsAdapter } from "./kernel/jobs/drizzle-adapter";
|
|
70
|
-
export { runPendingJobs } from "./kernel/jobs/runner";
|
|
71
|
-
export type { RunPendingJobsArgs } from "./kernel/jobs/runner";
|
|
63
|
+
} from "./kernel/hooks/types.js";
|
|
64
|
+
export { runBeforeHooks, runAfterHooks } from "./kernel/hooks/executor.js";
|
|
65
|
+
export { createHookContext } from "./kernel/hooks/create-context.js";
|
|
66
|
+
export type { CreateHookContextArgs } from "./kernel/hooks/create-context.js";
|
|
67
|
+
export type { JobsAdapter, EnqueueOptions } from "./kernel/jobs/adapter.js";
|
|
68
|
+
export { NullJobsAdapter } from "./kernel/jobs/adapter.js";
|
|
69
|
+
export { DrizzleJobsAdapter } from "./kernel/jobs/drizzle-adapter.js";
|
|
70
|
+
export { runPendingJobs } from "./kernel/jobs/runner.js";
|
|
71
|
+
export type { RunPendingJobsArgs } from "./kernel/jobs/runner.js";
|
|
72
72
|
export type {
|
|
73
73
|
TaskDefinition,
|
|
74
74
|
TaskContext,
|
|
75
75
|
TaskRetryConfig,
|
|
76
|
-
} from "./kernel/jobs/types";
|
|
76
|
+
} from "./kernel/jobs/types.js";
|
|
77
77
|
|
|
78
|
-
export { createLocalAPI, LocalAPI } from "./kernel/local-api";
|
|
79
|
-
export type { CommerceLocalAPI, LocalAPIOptions } from "./kernel/local-api";
|
|
80
|
-
export { createCommerce } from "./runtime/commerce";
|
|
81
|
-
export type { CommerceInstance } from "./runtime/commerce";
|
|
78
|
+
export { createLocalAPI, LocalAPI } from "./kernel/local-api.js";
|
|
79
|
+
export type { CommerceLocalAPI, LocalAPIOptions } from "./kernel/local-api.js";
|
|
80
|
+
export { createCommerce } from "./runtime/commerce.js";
|
|
81
|
+
export type { CommerceInstance } from "./runtime/commerce.js";
|
|
82
82
|
|
|
83
|
-
export { createAuditService, createNullAuditService } from "./modules/audit/service";
|
|
83
|
+
export { createAuditService, createNullAuditService } from "./modules/audit/service.js";
|
|
84
84
|
export type {
|
|
85
85
|
AuditService,
|
|
86
86
|
AuditEntry,
|
|
87
87
|
RecordArgs,
|
|
88
88
|
ListForEntityArgs,
|
|
89
|
-
} from "./modules/audit/service";
|
|
89
|
+
} from "./modules/audit/service.js";
|
|
90
90
|
|
|
91
|
-
export type { Result, PluginResult, PluginResultErr } from "./kernel/result";
|
|
92
|
-
export { Ok, Err, PluginErr } from "./kernel/result";
|
|
93
|
-
export type { PluginDb, PluginTxFn } from "./kernel/database/plugin-types";
|
|
94
|
-
export type { ServiceRegistry } from "./kernel/service-registry";
|
|
95
|
-
export { toHttpError, type HttpErrorResponse } from "./kernel/http-error";
|
|
96
|
-
export { withTiming } from "./kernel/service-timing";
|
|
91
|
+
export type { Result, PluginResult, PluginResultErr } from "./kernel/result.js";
|
|
92
|
+
export { Ok, Err, PluginErr } from "./kernel/result.js";
|
|
93
|
+
export type { PluginDb, PluginTxFn } from "./kernel/database/plugin-types.js";
|
|
94
|
+
export type { ServiceRegistry } from "./kernel/service-registry.js";
|
|
95
|
+
export { toHttpError, type HttpErrorResponse } from "./kernel/http-error.js";
|
|
96
|
+
export { withTiming } from "./kernel/service-timing.js";
|
|
97
97
|
|
|
98
98
|
export {
|
|
99
99
|
CommerceNotFoundError,
|
|
@@ -101,16 +101,16 @@ export {
|
|
|
101
101
|
CommerceForbiddenError,
|
|
102
102
|
CommerceConflictError,
|
|
103
103
|
CommerceInvalidTransitionError,
|
|
104
|
-
} from "./kernel/errors";
|
|
104
|
+
} from "./kernel/errors.js";
|
|
105
105
|
|
|
106
|
-
export { mapErrorToStatus } from "./kernel/error-mapper";
|
|
106
|
+
export { mapErrorToStatus } from "./kernel/error-mapper.js";
|
|
107
107
|
|
|
108
108
|
export {
|
|
109
109
|
canTransition,
|
|
110
110
|
assertTransition,
|
|
111
111
|
orderStateMachine,
|
|
112
112
|
extendOrderStateMachine,
|
|
113
|
-
} from "./kernel/state-machine/machine";
|
|
113
|
+
} from "./kernel/state-machine/machine.js";
|
|
114
114
|
|
|
115
115
|
export type {
|
|
116
116
|
PaymentAdapter,
|
|
@@ -118,8 +118,8 @@ export type {
|
|
|
118
118
|
PaymentIntent,
|
|
119
119
|
PaymentRefund,
|
|
120
120
|
PaymentWebhookEvent,
|
|
121
|
-
} from "./modules/payments/adapter";
|
|
122
|
-
export type { StorageAdapter } from "./modules/media/adapter";
|
|
121
|
+
} from "./modules/payments/adapter.js";
|
|
122
|
+
export type { StorageAdapter } from "./modules/media/adapter.js";
|
|
123
123
|
export type {
|
|
124
124
|
SearchAdapter,
|
|
125
125
|
SearchDocument,
|
|
@@ -128,17 +128,17 @@ export type {
|
|
|
128
128
|
SearchQueryParams,
|
|
129
129
|
SearchQueryResult,
|
|
130
130
|
SearchSuggestParams,
|
|
131
|
-
} from "./modules/search/adapter";
|
|
132
|
-
export type { DatabaseAdapter } from "./kernel/database/adapter";
|
|
131
|
+
} from "./modules/search/adapter.js";
|
|
132
|
+
export type { DatabaseAdapter } from "./kernel/database/adapter.js";
|
|
133
133
|
export {
|
|
134
134
|
createTxContext,
|
|
135
135
|
reuseOrCreateTxContext,
|
|
136
136
|
withTransaction,
|
|
137
|
-
} from "./kernel/database/tx-context";
|
|
137
|
+
} from "./kernel/database/tx-context.js";
|
|
138
138
|
export type {
|
|
139
139
|
TxContext,
|
|
140
140
|
WithTransactionOptions,
|
|
141
|
-
} from "./kernel/database/tx-context";
|
|
141
|
+
} from "./kernel/database/tx-context.js";
|
|
142
142
|
export type {
|
|
143
143
|
TaxAdapter,
|
|
144
144
|
TaxAddress,
|
|
@@ -147,52 +147,52 @@ export type {
|
|
|
147
147
|
TaxLineItem,
|
|
148
148
|
TaxReportParams,
|
|
149
149
|
TaxVoidParams,
|
|
150
|
-
} from "./modules/tax/adapter";
|
|
150
|
+
} from "./modules/tax/adapter.js";
|
|
151
151
|
|
|
152
|
-
export { getSchema, buildSchema, getTableNames } from "./kernel/database/migrate";
|
|
153
|
-
export { consoleEmailAdapter } from "./adapters/console-email";
|
|
152
|
+
export { getSchema, buildSchema, getTableNames } from "./kernel/database/migrate.js";
|
|
153
|
+
export { consoleEmailAdapter } from "./adapters/console-email.js";
|
|
154
154
|
|
|
155
|
-
export { runCompensationChain } from "./kernel/compensation/executor";
|
|
155
|
+
export { runCompensationChain } from "./kernel/compensation/executor.js";
|
|
156
156
|
export type {
|
|
157
157
|
CompensationContext,
|
|
158
158
|
Step,
|
|
159
|
-
} from "./kernel/compensation/types";
|
|
159
|
+
} from "./kernel/compensation/types.js";
|
|
160
160
|
|
|
161
|
-
export { createRepository } from "./kernel/factory/repository-factory";
|
|
161
|
+
export { createRepository } from "./kernel/factory/repository-factory.js";
|
|
162
162
|
export type {
|
|
163
163
|
BaseRepository,
|
|
164
164
|
SoftDeletableRepository,
|
|
165
165
|
RepositoryFor,
|
|
166
166
|
Filters,
|
|
167
167
|
FindOptions,
|
|
168
|
-
} from "./kernel/factory/repository-factory";
|
|
168
|
+
} from "./kernel/factory/repository-factory.js";
|
|
169
169
|
|
|
170
|
-
export { mergeExtraColumns } from "./kernel/schema/extra-columns";
|
|
171
|
-
export type { ExtraColumnsOption } from "./kernel/schema/extra-columns";
|
|
170
|
+
export { mergeExtraColumns } from "./kernel/schema/extra-columns.js";
|
|
171
|
+
export type { ExtraColumnsOption } from "./kernel/schema/extra-columns.js";
|
|
172
172
|
|
|
173
|
-
export type { CartItemMatcher } from "./modules/cart/matcher";
|
|
174
|
-
export { defaultCartItemMatcher } from "./modules/cart/matcher";
|
|
175
|
-
export { canAccessCart } from "./modules/cart/access";
|
|
173
|
+
export type { CartItemMatcher } from "./modules/cart/matcher.js";
|
|
174
|
+
export { defaultCartItemMatcher } from "./modules/cart/matcher.js";
|
|
175
|
+
export { canAccessCart } from "./modules/cart/access.js";
|
|
176
176
|
|
|
177
|
-
export { QueryRegistry } from "./kernel/query/registry";
|
|
178
|
-
export { executeQuery } from "./kernel/query/executor";
|
|
177
|
+
export { QueryRegistry } from "./kernel/query/registry.js";
|
|
178
|
+
export { executeQuery } from "./kernel/query/executor.js";
|
|
179
179
|
export type {
|
|
180
180
|
RelationDefinition,
|
|
181
181
|
EntityDefinition,
|
|
182
|
-
} from "./kernel/query/registry";
|
|
183
|
-
export type { QueryInput, QueryResult } from "./kernel/query/executor";
|
|
182
|
+
} from "./kernel/query/registry.js";
|
|
183
|
+
export type { QueryInput, QueryResult } from "./kernel/query/executor.js";
|
|
184
184
|
|
|
185
|
-
export type { CommerceModuleTypes } from "./types/commerce-types";
|
|
185
|
+
export type { CommerceModuleTypes } from "./types/commerce-types.js";
|
|
186
186
|
|
|
187
|
-
export { staleOrderCleanupTask } from "./modules/orders/stale-order-cleanup";
|
|
187
|
+
export { staleOrderCleanupTask } from "./modules/orders/stale-order-cleanup.js";
|
|
188
188
|
export {
|
|
189
189
|
COMMERCE_AGENT_SYSTEM_PROMPT,
|
|
190
190
|
COMMERCE_AGENT_SYSTEM_PROMPT_COMPACT,
|
|
191
|
-
} from "./interfaces/mcp/agent-prompt";
|
|
191
|
+
} from "./interfaces/mcp/agent-prompt.js";
|
|
192
192
|
|
|
193
|
-
export { DrizzleAnalyticsAdapter } from "./modules/analytics/drizzle-adapter";
|
|
194
|
-
export { BUILTIN_ANALYTICS_MODELS } from "./modules/analytics/models";
|
|
195
|
-
export { buildAnalyticsScope } from "./modules/analytics/types";
|
|
193
|
+
export { DrizzleAnalyticsAdapter } from "./modules/analytics/drizzle-adapter.js";
|
|
194
|
+
export { BUILTIN_ANALYTICS_MODELS } from "./modules/analytics/models.js";
|
|
195
|
+
export { buildAnalyticsScope } from "./modules/analytics/types.js";
|
|
196
196
|
export type {
|
|
197
197
|
AnalyticsAdapter,
|
|
198
198
|
AnalyticsQueryParams,
|
|
@@ -211,4 +211,4 @@ export type {
|
|
|
211
211
|
MeasureDefinition,
|
|
212
212
|
DimensionDefinition,
|
|
213
213
|
JoinDefinition,
|
|
214
|
-
} from "./modules/analytics/types";
|
|
214
|
+
} from "./modules/analytics/types.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { orderStateMachine } from "../../kernel/state-machine/machine";
|
|
2
|
-
import type { Order, OrderLineItem } from "../../modules/orders/repository";
|
|
3
|
-
import type { Kernel } from "../../runtime/kernel";
|
|
1
|
+
import { orderStateMachine } from "../../kernel/state-machine/machine.js";
|
|
2
|
+
import type { Order, OrderLineItem } from "../../modules/orders/repository/index.js";
|
|
3
|
+
import type { Kernel } from "../../runtime/kernel.js";
|
|
4
4
|
|
|
5
5
|
function getAvailableTransitions(status: string): string[] {
|
|
6
6
|
const transitions = (
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { MCPResource, MCPTool } from "../../config/types";
|
|
2
|
-
import type { AnalyticsQueryParams } from "../../modules/analytics/service";
|
|
3
|
-
import { buildAnalyticsScope } from "../../modules/analytics/types";
|
|
4
|
-
import type { Kernel } from "../../runtime/kernel";
|
|
5
|
-
import { orderStateMachine } from "../../kernel/state-machine/machine";
|
|
1
|
+
import type { MCPResource, MCPTool } from "../../config/types.js";
|
|
2
|
+
import type { AnalyticsQueryParams } from "../../modules/analytics/service.js";
|
|
3
|
+
import { buildAnalyticsScope } from "../../modules/analytics/types.js";
|
|
4
|
+
import type { Kernel } from "../../runtime/kernel.js";
|
|
5
|
+
import { orderStateMachine } from "../../kernel/state-machine/machine.js";
|
|
6
6
|
import {
|
|
7
7
|
enrichEntityForAgent,
|
|
8
8
|
enrichInventoryForAgent,
|
|
9
9
|
enrichOrderForAgent,
|
|
10
|
-
} from "./context-enrichment";
|
|
10
|
+
} from "./context-enrichment.js";
|
|
11
11
|
|
|
12
12
|
function textContent(value: unknown) {
|
|
13
13
|
return {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import { streamSSE, type SSEStreamingApi } from "hono/streaming";
|
|
3
|
-
import type { MCPTool } from "../../config/types";
|
|
4
|
-
import type { Kernel } from "../../runtime/kernel";
|
|
5
|
-
import { registerMCPCapabilities } from "./server";
|
|
3
|
+
import type { MCPTool } from "../../config/types.js";
|
|
4
|
+
import type { Kernel } from "../../runtime/kernel.js";
|
|
5
|
+
import { registerMCPCapabilities } from "./server.js";
|
|
6
6
|
|
|
7
7
|
async function handleMCPSession(
|
|
8
8
|
stream: SSEStreamingApi,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../runtime/kernel";
|
|
3
|
-
import { assertPermission } from "../../auth/permissions";
|
|
4
|
-
import type { Actor } from "../../auth/types";
|
|
5
|
-
import type { AppEnv } from "./utils";
|
|
2
|
+
import type { Kernel } from "../../runtime/kernel.js";
|
|
3
|
+
import { assertPermission } from "../../auth/permissions.js";
|
|
4
|
+
import type { Actor } from "../../auth/types.js";
|
|
5
|
+
import type { AppEnv } from "./utils.js";
|
|
6
6
|
import {
|
|
7
7
|
getProfileRoute,
|
|
8
8
|
listAddressesRoute,
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
reorderRoute,
|
|
16
16
|
updateProfileRoute,
|
|
17
17
|
createAddressRoute,
|
|
18
|
-
} from "./schemas/customer-portal";
|
|
19
|
-
import { isUUID, mapErrorToStatus } from "./utils";
|
|
18
|
+
} from "./schemas/customer-portal.js";
|
|
19
|
+
import { isUUID, mapErrorToStatus } from "./utils.js";
|
|
20
20
|
|
|
21
21
|
export function createCustomerPortalRoutes(kernel: Kernel) {
|
|
22
22
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
2
|
import { swaggerUI } from "@hono/swagger-ui";
|
|
3
3
|
import { sql } from "drizzle-orm";
|
|
4
|
-
import type { Kernel } from "../../runtime/kernel";
|
|
5
|
-
import type { AppEnv } from "./utils";
|
|
6
|
-
import { catalogRoutes } from "./routes/catalog";
|
|
7
|
-
import { inventoryRoutes } from "./routes/inventory";
|
|
8
|
-
import { mediaRoutes } from "./routes/media";
|
|
9
|
-
import { cartRoutes } from "./routes/carts";
|
|
10
|
-
import { checkoutRoutes } from "./routes/checkout";
|
|
11
|
-
import { orderRoutes } from "./routes/orders";
|
|
12
|
-
import { paymentRoutes } from "./routes/payments";
|
|
13
|
-
import { webhookRoutes } from "./routes/webhooks";
|
|
14
|
-
import { pricingRoutes } from "./routes/pricing";
|
|
15
|
-
import { promotionRoutes } from "./routes/promotions";
|
|
16
|
-
import { searchRoutes } from "./routes/search";
|
|
17
|
-
import { auditRoutes } from "./routes/audit";
|
|
18
|
-
import { adminJobRoutes } from "./routes/admin-jobs";
|
|
4
|
+
import type { Kernel } from "../../runtime/kernel.js";
|
|
5
|
+
import type { AppEnv } from "./utils.js";
|
|
6
|
+
import { catalogRoutes } from "./routes/catalog.js";
|
|
7
|
+
import { inventoryRoutes } from "./routes/inventory.js";
|
|
8
|
+
import { mediaRoutes } from "./routes/media.js";
|
|
9
|
+
import { cartRoutes } from "./routes/carts.js";
|
|
10
|
+
import { checkoutRoutes } from "./routes/checkout.js";
|
|
11
|
+
import { orderRoutes } from "./routes/orders.js";
|
|
12
|
+
import { paymentRoutes } from "./routes/payments.js";
|
|
13
|
+
import { webhookRoutes } from "./routes/webhooks.js";
|
|
14
|
+
import { pricingRoutes } from "./routes/pricing.js";
|
|
15
|
+
import { promotionRoutes } from "./routes/promotions.js";
|
|
16
|
+
import { searchRoutes } from "./routes/search.js";
|
|
17
|
+
import { auditRoutes } from "./routes/audit.js";
|
|
18
|
+
import { adminJobRoutes } from "./routes/admin-jobs.js";
|
|
19
19
|
|
|
20
20
|
export function createRestRoutes(kernel: Kernel) {
|
|
21
21
|
const router = new OpenAPIHono<AppEnv>({
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import { createRoute, z } from "@hono/zod-openapi";
|
|
30
|
-
import { ErrorSchema } from "./schemas/shared";
|
|
31
|
-
import { mapErrorToResponse, mapErrorToStatus } from "./utils";
|
|
32
|
-
import type { PluginRouteRegistration } from "../../kernel/plugin/manifest";
|
|
33
|
-
import { createScopedDb } from "../../kernel/database/scoped-db";
|
|
34
|
-
import { resolveOrgId } from "../../auth/org";
|
|
30
|
+
import { ErrorSchema } from "./schemas/shared.js";
|
|
31
|
+
import { mapErrorToResponse, mapErrorToStatus } from "./utils.js";
|
|
32
|
+
import type { PluginRouteRegistration } from "../../kernel/plugin/manifest.js";
|
|
33
|
+
import { createScopedDb } from "../../kernel/database/scoped-db.js";
|
|
34
|
+
import { resolveOrgId } from "../../auth/org.js";
|
|
35
35
|
|
|
36
36
|
// ─── Shared OpenAPI Error Responses ──────────────────────────────────────────
|
|
37
37
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
2
|
import { eq, and, desc } from "drizzle-orm";
|
|
3
3
|
import type { PgDatabase, PgQueryResultHKT } from "drizzle-orm/pg-core";
|
|
4
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
5
|
-
import { commerceJobs } from "../../../kernel/jobs/schema";
|
|
6
|
-
import { listFailedJobsRoute, retryJobRoute } from "../schemas/admin-jobs";
|
|
7
|
-
import { type AppEnv, requirePerm } from "../utils";
|
|
8
|
-
import { resolveOrgId } from "../../../auth/org";
|
|
4
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
5
|
+
import { commerceJobs } from "../../../kernel/jobs/schema.js";
|
|
6
|
+
import { listFailedJobsRoute, retryJobRoute } from "../schemas/admin-jobs.js";
|
|
7
|
+
import { type AppEnv, requirePerm } from "../utils.js";
|
|
8
|
+
import { resolveOrgId } from "../../../auth/org.js";
|
|
9
9
|
|
|
10
10
|
type Db = PgDatabase<PgQueryResultHKT, Record<string, unknown>>;
|
|
11
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
3
|
-
import { listAuditRoute, listEntityAuditRoute } from "../schemas/audit";
|
|
4
|
-
import { type AppEnv, requirePerm } from "../utils";
|
|
5
|
-
import { resolveOrgId } from "../../../auth/org";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { listAuditRoute, listEntityAuditRoute } from "../schemas/audit.js";
|
|
4
|
+
import { type AppEnv, requirePerm } from "../utils.js";
|
|
5
|
+
import { resolveOrgId } from "../../../auth/org.js";
|
|
6
6
|
|
|
7
7
|
export function auditRoutes(kernel: Kernel) {
|
|
8
8
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
3
|
-
import type { CreateCartInput, AddCartItemInput } from "../../../modules/cart/schemas";
|
|
4
|
-
import { createCartRoute, addCartItemRoute, updateCartItemQuantityRoute, getCartRoute, removeCartItemRoute } from "../schemas/carts";
|
|
5
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import type { CreateCartInput, AddCartItemInput } from "../../../modules/cart/schemas.js";
|
|
4
|
+
import { createCartRoute, addCartItemRoute, updateCartItemQuantityRoute, getCartRoute, removeCartItemRoute } from "../schemas/carts.js";
|
|
5
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils.js";
|
|
6
6
|
|
|
7
7
|
export function cartRoutes(kernel: Kernel) {
|
|
8
8
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
3
|
import type {
|
|
4
4
|
CreateEntityInput,
|
|
5
5
|
UpdateEntityInput,
|
|
@@ -10,11 +10,11 @@ import type {
|
|
|
10
10
|
CreateOptionTypeInput,
|
|
11
11
|
CreateOptionValueInput,
|
|
12
12
|
CreateVariantInput,
|
|
13
|
-
} from "../../../modules/catalog/schemas";
|
|
13
|
+
} from "../../../modules/catalog/schemas.js";
|
|
14
14
|
import type {
|
|
15
15
|
SetAttributesInput,
|
|
16
16
|
VariantGenerationStrategy,
|
|
17
|
-
} from "../../../modules/catalog/service";
|
|
17
|
+
} from "../../../modules/catalog/service.js";
|
|
18
18
|
import {
|
|
19
19
|
listEntitiesRoute,
|
|
20
20
|
getEntityRoute,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
createOptionValueRoute,
|
|
43
43
|
createVariantRoute,
|
|
44
44
|
generateVariantsRoute,
|
|
45
|
-
} from "../schemas/catalog";
|
|
45
|
+
} from "../schemas/catalog.js";
|
|
46
46
|
import {
|
|
47
47
|
type AppEnv,
|
|
48
48
|
mapErrorToResponse,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
parseInclude,
|
|
51
51
|
parsePagination,
|
|
52
52
|
parseSort,
|
|
53
|
-
} from "../utils";
|
|
53
|
+
} from "../utils.js";
|
|
54
54
|
|
|
55
55
|
export function catalogRoutes(kernel: Kernel) {
|
|
56
56
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
3
|
-
import { checkoutRoute } from "../schemas/checkout";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { checkoutRoute } from "../schemas/checkout.js";
|
|
4
4
|
import {
|
|
5
5
|
applyPromotionCodes,
|
|
6
6
|
authorizePayment,
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
validatePaymentMethod,
|
|
15
15
|
type CheckoutData,
|
|
16
16
|
type OrderResult,
|
|
17
|
-
} from "../../../hooks/checkout";
|
|
18
|
-
import { runAfterHooks, runBeforeHooks } from "../../../kernel/hooks/executor";
|
|
19
|
-
import { createHookContext } from "../../../kernel/hooks/create-context";
|
|
20
|
-
import type { AfterHook, BeforeHook, ServiceContainer } from "../../../kernel/hooks/types";
|
|
21
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils";
|
|
22
|
-
import { isCommerceError } from "../../../kernel/errors";
|
|
23
|
-
import { makeId } from "../../../utils/id";
|
|
24
|
-
import type { ShippingAddress } from "../../../modules/shipping/calculator";
|
|
17
|
+
} from "../../../hooks/checkout.js";
|
|
18
|
+
import { runAfterHooks, runBeforeHooks } from "../../../kernel/hooks/executor.js";
|
|
19
|
+
import { createHookContext } from "../../../kernel/hooks/create-context.js";
|
|
20
|
+
import type { AfterHook, BeforeHook, ServiceContainer } from "../../../kernel/hooks/types.js";
|
|
21
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils.js";
|
|
22
|
+
import { isCommerceError } from "../../../kernel/errors.js";
|
|
23
|
+
import { makeId } from "../../../utils/id.js";
|
|
24
|
+
import type { ShippingAddress } from "../../../modules/shipping/calculator.js";
|
|
25
25
|
|
|
26
26
|
export function checkoutRoutes(kernel: Kernel) {
|
|
27
27
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -95,7 +95,7 @@ export function checkoutRoutes(kernel: Kernel) {
|
|
|
95
95
|
services: kernel.services as ServiceContainer,
|
|
96
96
|
context: { moduleName: "checkout" },
|
|
97
97
|
origin: "rest",
|
|
98
|
-
kernel: kernel as unknown as { database: { db: import("../../../kernel/database/plugin-types").PluginDb } },
|
|
98
|
+
kernel: kernel as unknown as { database: { db: import("../../../kernel/database/plugin-types.js").PluginDb } },
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
3
|
import {
|
|
4
4
|
inventoryAdjustRoute,
|
|
5
5
|
inventoryReserveRoute,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
createWarehouseRoute,
|
|
8
8
|
inventoryCheckRoute,
|
|
9
9
|
listWarehousesRoute,
|
|
10
|
-
} from "../schemas/inventory";
|
|
11
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils";
|
|
10
|
+
} from "../schemas/inventory.js";
|
|
11
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils.js";
|
|
12
12
|
|
|
13
13
|
export function inventoryRoutes(kernel: Kernel) {
|
|
14
14
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
3
|
-
import type { AttachMediaInput } from "../../../modules/media/service";
|
|
4
|
-
import { attachMediaRoute, getMediaRoute, deleteMediaRoute } from "../schemas/media";
|
|
5
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import type { AttachMediaInput } from "../../../modules/media/service.js";
|
|
4
|
+
import { attachMediaRoute, getMediaRoute, deleteMediaRoute } from "../schemas/media.js";
|
|
5
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils.js";
|
|
6
6
|
|
|
7
7
|
export function mediaRoutes(kernel: Kernel) {
|
|
8
8
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
3
|
-
import { changeOrderStatusRoute, listOrdersRoute, getOrderRoute, getOrderFulfillmentsRoute } from "../schemas/orders";
|
|
4
|
-
import { type AppEnv, isUUID, mapErrorToResponse, mapErrorToStatus, parsePagination } from "../utils";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { changeOrderStatusRoute, listOrdersRoute, getOrderRoute, getOrderFulfillmentsRoute } from "../schemas/orders.js";
|
|
4
|
+
import { type AppEnv, isUUID, mapErrorToResponse, mapErrorToStatus, parsePagination } from "../utils.js";
|
|
5
5
|
|
|
6
6
|
export function orderRoutes(kernel: Kernel) {
|
|
7
7
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
2
|
import type { PgDatabase, PgQueryResultHKT } from "drizzle-orm/pg-core";
|
|
3
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
4
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils";
|
|
5
|
-
import { processedWebhookEvents } from "../../../modules/webhooks/schema";
|
|
3
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
4
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils.js";
|
|
5
|
+
import { processedWebhookEvents } from "../../../modules/webhooks/schema.js";
|
|
6
6
|
|
|
7
7
|
type Db = PgDatabase<PgQueryResultHKT, Record<string, unknown>>;
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
3
|
-
import { setBasePriceRoute, createModifierRoute, listPricesRoute } from "../schemas/pricing";
|
|
4
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { setBasePriceRoute, createModifierRoute, listPricesRoute } from "../schemas/pricing.js";
|
|
4
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils.js";
|
|
5
5
|
|
|
6
6
|
export function pricingRoutes(kernel: Kernel) {
|
|
7
7
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
2
|
import { rateLimiter } from "hono-rate-limiter";
|
|
3
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
4
|
-
import { createPromotionRoute, validatePromotionRoute, deactivatePromotionRoute, listActivePromotionsRoute } from "../schemas/promotions";
|
|
5
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils";
|
|
6
|
-
import { resolveOrgId } from "../../../auth/org";
|
|
3
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
4
|
+
import { createPromotionRoute, validatePromotionRoute, deactivatePromotionRoute, listActivePromotionsRoute } from "../schemas/promotions.js";
|
|
5
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils.js";
|
|
6
|
+
import { resolveOrgId } from "../../../auth/org.js";
|
|
7
7
|
|
|
8
8
|
export function promotionRoutes(kernel: Kernel) {
|
|
9
9
|
const router = new OpenAPIHono<AppEnv>();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import type { Kernel } from "../../../runtime/kernel";
|
|
3
|
-
import { searchRoute, suggestRoute } from "../schemas/search";
|
|
4
|
-
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { searchRoute, suggestRoute } from "../schemas/search.js";
|
|
4
|
+
import { type AppEnv, mapErrorToResponse, mapErrorToStatus } from "../utils.js";
|
|
5
5
|
|
|
6
6
|
export function searchRoutes(kernel: Kernel) {
|
|
7
7
|
const router = new OpenAPIHono<AppEnv>();
|