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