@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-schema.d.ts","sourceRoot":"","sources":["../../src/auth/auth-schema.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaf,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAclB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBlB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUvB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOvB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBjB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMf,CAAC"}
|
package/dist/auth/auth-schema.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { pgTable, text, timestamp, boolean, integer, } from "drizzle-orm/pg-core";
|
|
2
|
-
export const user = pgTable("user", {
|
|
3
|
-
id: text("id").primaryKey(),
|
|
4
|
-
name: text("name").notNull(),
|
|
5
|
-
email: text("email").notNull().unique(),
|
|
6
|
-
emailVerified: boolean("email_verified").default(false).notNull(),
|
|
7
|
-
image: text("image"),
|
|
8
|
-
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
9
|
-
updatedAt: timestamp("updated_at")
|
|
10
|
-
.defaultNow()
|
|
11
|
-
.$onUpdate(() => /* @__PURE__ */ new Date())
|
|
12
|
-
.notNull(),
|
|
13
|
-
vendorId: text("vendor_id"),
|
|
14
|
-
posOperatorPin: text("pos_operator_pin"),
|
|
15
|
-
});
|
|
16
|
-
export const session = pgTable("session", {
|
|
17
|
-
id: text("id").primaryKey(),
|
|
18
|
-
expiresAt: timestamp("expires_at").notNull(),
|
|
19
|
-
token: text("token").notNull().unique(),
|
|
20
|
-
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
21
|
-
updatedAt: timestamp("updated_at")
|
|
22
|
-
.$onUpdate(() => /* @__PURE__ */ new Date())
|
|
23
|
-
.notNull(),
|
|
24
|
-
ipAddress: text("ip_address"),
|
|
25
|
-
userAgent: text("user_agent"),
|
|
26
|
-
userId: text("user_id")
|
|
27
|
-
.notNull()
|
|
28
|
-
.references(() => user.id, { onDelete: "cascade" }),
|
|
29
|
-
activeOrganizationId: text("active_organization_id"),
|
|
30
|
-
});
|
|
31
|
-
export const account = pgTable("account", {
|
|
32
|
-
id: text("id").primaryKey(),
|
|
33
|
-
accountId: text("account_id").notNull(),
|
|
34
|
-
providerId: text("provider_id").notNull(),
|
|
35
|
-
userId: text("user_id")
|
|
36
|
-
.notNull()
|
|
37
|
-
.references(() => user.id, { onDelete: "cascade" }),
|
|
38
|
-
accessToken: text("access_token"),
|
|
39
|
-
refreshToken: text("refresh_token"),
|
|
40
|
-
idToken: text("id_token"),
|
|
41
|
-
accessTokenExpiresAt: timestamp("access_token_expires_at"),
|
|
42
|
-
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
|
43
|
-
scope: text("scope"),
|
|
44
|
-
password: text("password"),
|
|
45
|
-
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
46
|
-
updatedAt: timestamp("updated_at")
|
|
47
|
-
.$onUpdate(() => /* @__PURE__ */ new Date())
|
|
48
|
-
.notNull(),
|
|
49
|
-
});
|
|
50
|
-
export const verification = pgTable("verification", {
|
|
51
|
-
id: text("id").primaryKey(),
|
|
52
|
-
identifier: text("identifier").notNull(),
|
|
53
|
-
value: text("value").notNull(),
|
|
54
|
-
expiresAt: timestamp("expires_at").notNull(),
|
|
55
|
-
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
56
|
-
updatedAt: timestamp("updated_at")
|
|
57
|
-
.defaultNow()
|
|
58
|
-
.$onUpdate(() => /* @__PURE__ */ new Date())
|
|
59
|
-
.notNull(),
|
|
60
|
-
});
|
|
61
|
-
export const organization = pgTable("organization", {
|
|
62
|
-
id: text("id").primaryKey(),
|
|
63
|
-
name: text("name").notNull(),
|
|
64
|
-
slug: text("slug").notNull().unique(),
|
|
65
|
-
logo: text("logo"),
|
|
66
|
-
createdAt: timestamp("created_at").notNull(),
|
|
67
|
-
metadata: text("metadata"),
|
|
68
|
-
});
|
|
69
|
-
export const member = pgTable("member", {
|
|
70
|
-
id: text("id").primaryKey(),
|
|
71
|
-
organizationId: text("organization_id")
|
|
72
|
-
.notNull()
|
|
73
|
-
.references(() => organization.id, { onDelete: "cascade" }),
|
|
74
|
-
userId: text("user_id")
|
|
75
|
-
.notNull()
|
|
76
|
-
.references(() => user.id, { onDelete: "cascade" }),
|
|
77
|
-
role: text("role").default("member").notNull(),
|
|
78
|
-
createdAt: timestamp("created_at").notNull(),
|
|
79
|
-
});
|
|
80
|
-
export const invitation = pgTable("invitation", {
|
|
81
|
-
id: text("id").primaryKey(),
|
|
82
|
-
organizationId: text("organization_id")
|
|
83
|
-
.notNull()
|
|
84
|
-
.references(() => organization.id, { onDelete: "cascade" }),
|
|
85
|
-
email: text("email").notNull(),
|
|
86
|
-
role: text("role"),
|
|
87
|
-
status: text("status").default("pending").notNull(),
|
|
88
|
-
expiresAt: timestamp("expires_at").notNull(),
|
|
89
|
-
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
90
|
-
inviterId: text("inviter_id")
|
|
91
|
-
.notNull()
|
|
92
|
-
.references(() => user.id, { onDelete: "cascade" }),
|
|
93
|
-
});
|
|
94
|
-
export const apikey = pgTable("apikey", {
|
|
95
|
-
id: text("id").primaryKey(),
|
|
96
|
-
configId: text("config_id").default("default").notNull(),
|
|
97
|
-
name: text("name"),
|
|
98
|
-
start: text("start"),
|
|
99
|
-
referenceId: text("reference_id").notNull(),
|
|
100
|
-
prefix: text("prefix"),
|
|
101
|
-
key: text("key").notNull(),
|
|
102
|
-
refillInterval: integer("refill_interval"),
|
|
103
|
-
refillAmount: integer("refill_amount"),
|
|
104
|
-
lastRefillAt: timestamp("last_refill_at"),
|
|
105
|
-
enabled: boolean("enabled").default(true),
|
|
106
|
-
rateLimitEnabled: boolean("rate_limit_enabled").default(false),
|
|
107
|
-
rateLimitTimeWindow: integer("rate_limit_time_window").default(3600000),
|
|
108
|
-
rateLimitMax: integer("rate_limit_max").default(10000),
|
|
109
|
-
requestCount: integer("request_count").default(0),
|
|
110
|
-
remaining: integer("remaining"),
|
|
111
|
-
lastRequest: timestamp("last_request"),
|
|
112
|
-
expiresAt: timestamp("expires_at"),
|
|
113
|
-
createdAt: timestamp("created_at").notNull(),
|
|
114
|
-
updatedAt: timestamp("updated_at").notNull(),
|
|
115
|
-
permissions: text("permissions"),
|
|
116
|
-
metadata: text("metadata"),
|
|
117
|
-
});
|
|
118
|
-
export const jwks = pgTable("jwks", {
|
|
119
|
-
id: text("id").primaryKey(),
|
|
120
|
-
publicKey: text("public_key").notNull(),
|
|
121
|
-
privateKey: text("private_key").notNull(),
|
|
122
|
-
createdAt: timestamp("created_at").notNull(),
|
|
123
|
-
expiresAt: timestamp("expires_at"),
|
|
124
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { MiddlewareHandler } from "hono";
|
|
2
|
-
import type { CommerceConfig } from "../config/types.js";
|
|
3
|
-
import type { AuthInstance } from "./setup.js";
|
|
4
|
-
export declare function authMiddleware(auth: AuthInstance, config: CommerceConfig): MiddlewareHandler;
|
|
5
|
-
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/auth/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA0B/C,wBAAgB,cAAc,CAC5B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,cAAc,GACrB,iBAAiB,CAsInB"}
|
package/dist/auth/middleware.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_ORG_ID } from "./org.js";
|
|
2
|
-
function resolvePermissions(session, config) {
|
|
3
|
-
const role = session.session.activeOrganizationRole;
|
|
4
|
-
if (!role) {
|
|
5
|
-
return (config.auth?.customerPermissions ?? [
|
|
6
|
-
"catalog:read",
|
|
7
|
-
"cart:create",
|
|
8
|
-
"cart:read",
|
|
9
|
-
"cart:update",
|
|
10
|
-
"orders:create",
|
|
11
|
-
"orders:read:own",
|
|
12
|
-
"customers:read:self",
|
|
13
|
-
"customers:update:self",
|
|
14
|
-
]);
|
|
15
|
-
}
|
|
16
|
-
const roleConfig = config.auth?.roles?.[role];
|
|
17
|
-
return roleConfig ? roleConfig.permissions : [];
|
|
18
|
-
}
|
|
19
|
-
export function authMiddleware(auth, config) {
|
|
20
|
-
return async (c, next) => {
|
|
21
|
-
const session = (await auth.api.getSession({
|
|
22
|
-
headers: c.req.raw.headers,
|
|
23
|
-
}));
|
|
24
|
-
if (session) {
|
|
25
|
-
// Better Auth's session stores activeOrganizationId, but often not the role.
|
|
26
|
-
// For single-store apps (org_default), users may never call set-active,
|
|
27
|
-
// so activeOrganizationId can be null even for valid org members.
|
|
28
|
-
let role = session.session.activeOrganizationRole;
|
|
29
|
-
let orgId = session.session.activeOrganizationId;
|
|
30
|
-
// If no active org, try to resolve the user's membership in org_default.
|
|
31
|
-
// This handles the common case where the user is a member but hasn't
|
|
32
|
-
// called organization/set-active (single-store apps, seed scripts, tests).
|
|
33
|
-
if (!role && auth.api.getFullOrganization) {
|
|
34
|
-
try {
|
|
35
|
-
const org = await auth.api.getFullOrganization({
|
|
36
|
-
query: { organizationId: orgId ?? DEFAULT_ORG_ID },
|
|
37
|
-
headers: c.req.raw.headers,
|
|
38
|
-
});
|
|
39
|
-
if (org?.members) {
|
|
40
|
-
const membership = org.members.find((m) => m.userId === session.user.id);
|
|
41
|
-
if (membership) {
|
|
42
|
-
role = membership.role;
|
|
43
|
-
orgId = orgId ?? DEFAULT_ORG_ID;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
// fall through — treat as customer
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// Also try getActiveMemberRole if active org is set
|
|
52
|
-
if (!role && orgId && auth.api.getActiveMemberRole) {
|
|
53
|
-
try {
|
|
54
|
-
const roleResult = await auth.api.getActiveMemberRole({
|
|
55
|
-
headers: c.req.raw.headers,
|
|
56
|
-
});
|
|
57
|
-
role = roleResult?.role;
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
// fall through — treat as customer
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const enrichedSession = {
|
|
64
|
-
...session,
|
|
65
|
-
session: { ...session.session, activeOrganizationRole: role ?? null },
|
|
66
|
-
};
|
|
67
|
-
c.set("actor", {
|
|
68
|
-
type: "user",
|
|
69
|
-
userId: session.user.id,
|
|
70
|
-
email: session.user.email ?? null,
|
|
71
|
-
name: session.user.name ?? "User",
|
|
72
|
-
vendorId: session.user.vendorId ?? null,
|
|
73
|
-
organizationId: orgId ?? DEFAULT_ORG_ID,
|
|
74
|
-
role: role ?? "customer",
|
|
75
|
-
permissions: resolvePermissions(enrichedSession, config),
|
|
76
|
-
});
|
|
77
|
-
await next();
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
// Extract API key from headers
|
|
81
|
-
const apiKeyHeader = c.req.header("x-api-key") ??
|
|
82
|
-
c.req.header("authorization")?.replace("Bearer ", "");
|
|
83
|
-
if (apiKeyHeader &&
|
|
84
|
-
config.auth?.apiKeys?.enabled &&
|
|
85
|
-
auth.api.verifyApiKey) {
|
|
86
|
-
try {
|
|
87
|
-
// Better Auth server-side calls require { body: { ... } } wrapper.
|
|
88
|
-
// Returns { valid, error, key: Omit<ApiKey,"key"> | null }.
|
|
89
|
-
// See: https://better-auth.com/docs/plugins/api-key/reference
|
|
90
|
-
const result = await auth.api.verifyApiKey({
|
|
91
|
-
body: { key: apiKeyHeader },
|
|
92
|
-
});
|
|
93
|
-
if (result?.valid && result.key) {
|
|
94
|
-
const apiKey = result.key;
|
|
95
|
-
// v1.5+ renamed userId → referenceId on the apikey table.
|
|
96
|
-
const userId = (apiKey.referenceId ?? "");
|
|
97
|
-
const name = (apiKey.name ?? "API Key");
|
|
98
|
-
const orgId = (apiKey.organizationId ?? DEFAULT_ORG_ID);
|
|
99
|
-
// Better Auth stores permissions as Record<string, string[]>
|
|
100
|
-
// (e.g. {"catalog":["read","create"]}). Flatten to the
|
|
101
|
-
// "resource:action" string[] format the engine expects.
|
|
102
|
-
let permissions;
|
|
103
|
-
const rawPerms = apiKey.permissions;
|
|
104
|
-
if (Array.isArray(rawPerms)) {
|
|
105
|
-
permissions = rawPerms;
|
|
106
|
-
}
|
|
107
|
-
else if (rawPerms && typeof rawPerms === "object") {
|
|
108
|
-
permissions = [];
|
|
109
|
-
for (const [resource, actions] of Object.entries(rawPerms)) {
|
|
110
|
-
for (const action of actions) {
|
|
111
|
-
permissions.push(`${resource}:${action}`);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
permissions = config.auth?.apiKeys?.defaultPermissions ?? [];
|
|
117
|
-
}
|
|
118
|
-
c.set("actor", {
|
|
119
|
-
type: "api_key",
|
|
120
|
-
userId,
|
|
121
|
-
email: null,
|
|
122
|
-
name,
|
|
123
|
-
vendorId: null,
|
|
124
|
-
organizationId: orgId,
|
|
125
|
-
role: "api_key",
|
|
126
|
-
permissions,
|
|
127
|
-
});
|
|
128
|
-
await next();
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
catch {
|
|
133
|
-
// invalid, expired, or rate-limited key — fall through
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (!c.get("actor")) {
|
|
137
|
-
c.set("actor", null);
|
|
138
|
-
}
|
|
139
|
-
await next();
|
|
140
|
-
};
|
|
141
|
-
}
|
package/dist/auth/org.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deterministic ID for the default organization.
|
|
3
|
-
* Auto-created on kernel boot / test setup for single-tenant deployments.
|
|
4
|
-
*/
|
|
5
|
-
export declare const DEFAULT_ORG_ID = "org_default";
|
|
6
|
-
/**
|
|
7
|
-
* Extracts the organization ID from an actor.
|
|
8
|
-
* Falls back to the default org when the actor is null or has no org set.
|
|
9
|
-
*/
|
|
10
|
-
export declare function resolveOrgId(actor: unknown): string;
|
|
11
|
-
/**
|
|
12
|
-
* Ensures the default organization row exists in the database.
|
|
13
|
-
* Idempotent — safe to call multiple times (no-ops if the row exists).
|
|
14
|
-
*
|
|
15
|
-
* Uses OrganizationService which creates both the org row and
|
|
16
|
-
* (when auth is available) a member record for the creator.
|
|
17
|
-
*
|
|
18
|
-
* Accepts `unknown` so callers never need casts — the function
|
|
19
|
-
* handles the Drizzle type narrowing internally.
|
|
20
|
-
*/
|
|
21
|
-
export declare function ensureDefaultOrg(db: unknown, storeName?: string): Promise<void>;
|
|
22
|
-
//# sourceMappingURL=org.d.ts.map
|
package/dist/auth/org.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/auth/org.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMnD;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,OAAO,EACX,SAAS,SAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
package/dist/auth/org.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { OrganizationService } from "../modules/organization/service.js";
|
|
2
|
-
/**
|
|
3
|
-
* Deterministic ID for the default organization.
|
|
4
|
-
* Auto-created on kernel boot / test setup for single-tenant deployments.
|
|
5
|
-
*/
|
|
6
|
-
export const DEFAULT_ORG_ID = "org_default";
|
|
7
|
-
/**
|
|
8
|
-
* Extracts the organization ID from an actor.
|
|
9
|
-
* Falls back to the default org when the actor is null or has no org set.
|
|
10
|
-
*/
|
|
11
|
-
export function resolveOrgId(actor) {
|
|
12
|
-
if (actor != null && typeof actor === "object" && "organizationId" in actor) {
|
|
13
|
-
const orgId = actor.organizationId;
|
|
14
|
-
if (typeof orgId === "string")
|
|
15
|
-
return orgId;
|
|
16
|
-
}
|
|
17
|
-
return DEFAULT_ORG_ID;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Ensures the default organization row exists in the database.
|
|
21
|
-
* Idempotent — safe to call multiple times (no-ops if the row exists).
|
|
22
|
-
*
|
|
23
|
-
* Uses OrganizationService which creates both the org row and
|
|
24
|
-
* (when auth is available) a member record for the creator.
|
|
25
|
-
*
|
|
26
|
-
* Accepts `unknown` so callers never need casts — the function
|
|
27
|
-
* handles the Drizzle type narrowing internally.
|
|
28
|
-
*/
|
|
29
|
-
export async function ensureDefaultOrg(db, storeName = "Default Store") {
|
|
30
|
-
const orgService = new OrganizationService(db);
|
|
31
|
-
await orgService.create({
|
|
32
|
-
id: DEFAULT_ORG_ID,
|
|
33
|
-
name: storeName,
|
|
34
|
-
slug: "default",
|
|
35
|
-
});
|
|
36
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Actor } from "./types.js";
|
|
2
|
-
export declare function assertPermission(actor: Actor | null, required: string): void;
|
|
3
|
-
export declare function assertOwnership(actor: Actor | null, resourceOwnerId: string | null): void;
|
|
4
|
-
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/auth/permissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAc5E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAQzF"}
|
package/dist/auth/permissions.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CommerceForbiddenError } from "../kernel/errors.js";
|
|
2
|
-
export function assertPermission(actor, required) {
|
|
3
|
-
if (!actor) {
|
|
4
|
-
throw new CommerceForbiddenError("Authentication required.");
|
|
5
|
-
}
|
|
6
|
-
if (actor.permissions.includes("*:*"))
|
|
7
|
-
return;
|
|
8
|
-
const [resource] = required.split(":");
|
|
9
|
-
if (resource && actor.permissions.includes(`${resource}:*`))
|
|
10
|
-
return;
|
|
11
|
-
if (actor.permissions.includes(required))
|
|
12
|
-
return;
|
|
13
|
-
throw new CommerceForbiddenError(`Permission "${required}" is required. Your role "${actor.role}" does not include this permission.`);
|
|
14
|
-
}
|
|
15
|
-
export function assertOwnership(actor, resourceOwnerId) {
|
|
16
|
-
if (!actor) {
|
|
17
|
-
throw new CommerceForbiddenError("Authentication required.");
|
|
18
|
-
}
|
|
19
|
-
if (actor.permissions.includes("*:*"))
|
|
20
|
-
return;
|
|
21
|
-
if (actor.userId !== resourceOwnerId) {
|
|
22
|
-
throw new CommerceForbiddenError("You do not have access to this resource.");
|
|
23
|
-
}
|
|
24
|
-
}
|
package/dist/auth/setup.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { betterAuth } from "better-auth";
|
|
2
|
-
import { apiKey } from "@better-auth/api-key";
|
|
3
|
-
import { organization, twoFactor, phoneNumber, jwt, bearer } from "better-auth/plugins";
|
|
4
|
-
import type { CommerceConfig } from "../config/types.js";
|
|
5
|
-
import type { DatabaseAdapter } from "../kernel/database/adapter.js";
|
|
6
|
-
/**
|
|
7
|
-
* The auth type is inferred from `typeof betterAuth(...)` with all plugins enabled.
|
|
8
|
-
* This gives us the full API surface without manual interface maintenance.
|
|
9
|
-
*
|
|
10
|
-
* We use a type-level-only reference (never executed) to capture the complete type.
|
|
11
|
-
*/
|
|
12
|
-
type FullBetterAuth = ReturnType<typeof betterAuth<{
|
|
13
|
-
plugins: [
|
|
14
|
-
ReturnType<typeof organization>,
|
|
15
|
-
ReturnType<typeof bearer>,
|
|
16
|
-
ReturnType<typeof jwt>,
|
|
17
|
-
ReturnType<typeof twoFactor>,
|
|
18
|
-
ReturnType<typeof apiKey>,
|
|
19
|
-
ReturnType<typeof phoneNumber>
|
|
20
|
-
];
|
|
21
|
-
}>>;
|
|
22
|
-
/**
|
|
23
|
-
* AuthInstance — inferred from Better Auth with all plugins.
|
|
24
|
-
* No manual type maintenance needed.
|
|
25
|
-
*/
|
|
26
|
-
export type AuthInstance = FullBetterAuth;
|
|
27
|
-
export declare function createAuth(db: DatabaseAdapter, config: CommerceConfig): AuthInstance;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=setup.d.ts.map
|
package/dist/auth/setup.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/auth/setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAiBrE;;;;;GAKG;AACH,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC;IACjD,OAAO,EAAE;QACP,UAAU,CAAC,OAAO,YAAY,CAAC;QAC/B,UAAU,CAAC,OAAO,MAAM,CAAC;QACzB,UAAU,CAAC,OAAO,GAAG,CAAC;QACtB,UAAU,CAAC,OAAO,SAAS,CAAC;QAC5B,UAAU,CAAC,OAAO,MAAM,CAAC;QACzB,UAAU,CAAC,OAAO,WAAW,CAAC;KAC/B,CAAC;CACH,CAAC,CAAC,CAAC;AAEJ;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C,wBAAgB,UAAU,CACxB,EAAE,EAAE,eAAe,EACnB,MAAM,EAAE,cAAc,GACrB,YAAY,CA+Gd"}
|
package/dist/auth/setup.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { drizzleAdapter } from "@better-auth/drizzle-adapter";
|
|
2
|
-
import { betterAuth } from "better-auth";
|
|
3
|
-
import { apiKey } from "@better-auth/api-key";
|
|
4
|
-
import { organization, twoFactor, phoneNumber, jwt, bearer } from "better-auth/plugins";
|
|
5
|
-
import * as authSchema from "./auth-schema.js";
|
|
6
|
-
function resolveAuthDbProvider(provider) {
|
|
7
|
-
if (provider === "postgres" || provider === "postgresql" || provider === "pg")
|
|
8
|
-
return "pg";
|
|
9
|
-
if (provider === "mysql")
|
|
10
|
-
return "mysql";
|
|
11
|
-
if (provider === "sqlite")
|
|
12
|
-
return "sqlite";
|
|
13
|
-
throw new Error(`Unsupported auth database provider "${provider}".`);
|
|
14
|
-
}
|
|
15
|
-
export function createAuth(db, config) {
|
|
16
|
-
const plugins = [
|
|
17
|
-
organization({
|
|
18
|
-
roles: (config.auth?.roles ?? {}),
|
|
19
|
-
}),
|
|
20
|
-
bearer(),
|
|
21
|
-
jwt(),
|
|
22
|
-
];
|
|
23
|
-
if (config.auth?.twoFactor?.enabled) {
|
|
24
|
-
plugins.push(twoFactor({ issuer: config.storeName ?? "UnifiedCommerce" }));
|
|
25
|
-
}
|
|
26
|
-
const scopes = config.auth?.apiKeyScopes;
|
|
27
|
-
if (scopes && Object.keys(scopes).length > 0) {
|
|
28
|
-
const apiKeyConfigs = Object.entries(scopes).map(([scopeId, scope]) => ({
|
|
29
|
-
configId: scopeId,
|
|
30
|
-
defaultPrefix: scope.prefix,
|
|
31
|
-
...(scope.rateLimit
|
|
32
|
-
? {
|
|
33
|
-
rateLimit: {
|
|
34
|
-
enabled: true,
|
|
35
|
-
maxRequests: scope.rateLimit.maxRequests,
|
|
36
|
-
timeWindow: scope.rateLimit.timeWindow,
|
|
37
|
-
},
|
|
38
|
-
}
|
|
39
|
-
: {}),
|
|
40
|
-
}));
|
|
41
|
-
plugins.push(apiKey(apiKeyConfigs));
|
|
42
|
-
}
|
|
43
|
-
else if (config.auth?.apiKeys?.enabled) {
|
|
44
|
-
plugins.push(apiKey());
|
|
45
|
-
}
|
|
46
|
-
if (config.auth?.phoneAuth) {
|
|
47
|
-
plugins.push(phoneNumber({
|
|
48
|
-
sendOTP: config.auth.phoneAuth.sendOTP,
|
|
49
|
-
verifyOTP: config.auth.phoneAuth.verifyOTP,
|
|
50
|
-
otpLength: config.auth.phoneAuth.otpLength ?? 6,
|
|
51
|
-
expiresIn: config.auth.phoneAuth.expiresIn ?? 300,
|
|
52
|
-
signUpOnVerification: config.auth.phoneAuth.signUpOnVerification ?? {
|
|
53
|
-
getTempEmail: (phone) => `${phone.replace(/\+/g, "")}@phone.local`,
|
|
54
|
-
},
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
try {
|
|
58
|
-
const auth = betterAuth({
|
|
59
|
-
database: drizzleAdapter(db.db, {
|
|
60
|
-
provider: resolveAuthDbProvider(db.provider),
|
|
61
|
-
schema: authSchema,
|
|
62
|
-
}),
|
|
63
|
-
trustedOrigins: config.auth?.trustedOrigins ?? [],
|
|
64
|
-
emailAndPassword: {
|
|
65
|
-
enabled: true,
|
|
66
|
-
requireEmailVerification: config.auth?.requireEmailVerification ?? true,
|
|
67
|
-
sendResetPassword: async ({ user, url }) => {
|
|
68
|
-
if (!config.email)
|
|
69
|
-
return;
|
|
70
|
-
await config.email.send({
|
|
71
|
-
template: "password-reset",
|
|
72
|
-
to: user.email,
|
|
73
|
-
data: { resetUrl: url, userName: user.name },
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
sendVerificationEmail: async ({ user, url }) => {
|
|
77
|
-
if (!config.email)
|
|
78
|
-
return;
|
|
79
|
-
await config.email.send({
|
|
80
|
-
template: "email-verification",
|
|
81
|
-
to: user.email,
|
|
82
|
-
data: { verifyUrl: url, userName: user.name },
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
socialProviders: config.auth?.socialProviders ?? {},
|
|
87
|
-
session: {
|
|
88
|
-
expiresIn: config.auth?.sessionDuration ?? 60 * 60 * 24 * 7,
|
|
89
|
-
updateAge: 60 * 60 * 24,
|
|
90
|
-
cookieCache: {
|
|
91
|
-
enabled: true,
|
|
92
|
-
maxAge: 60 * 5,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
advanced: {
|
|
96
|
-
cookiePrefix: "uc",
|
|
97
|
-
useSecureCookies: process.env.NODE_ENV === "production",
|
|
98
|
-
},
|
|
99
|
-
plugins,
|
|
100
|
-
user: {
|
|
101
|
-
additionalFields: {
|
|
102
|
-
vendorId: { type: "string", required: false },
|
|
103
|
-
posOperatorPin: { type: "string", required: false },
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
// The runtime return matches FullBetterAuth structurally — plugins may differ
|
|
108
|
-
// at runtime (conditional) but the API surface is a superset.
|
|
109
|
-
return auth;
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
const message = error instanceof Error
|
|
113
|
-
? error.message
|
|
114
|
-
: "Unknown better-auth initialization error.";
|
|
115
|
-
throw new Error(`Failed to initialize authentication: ${message}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Actor } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a system actor for internal operations (webhooks, jobs, compensation chains).
|
|
4
|
-
* System actors have full permissions and are scoped to a specific organization.
|
|
5
|
-
*/
|
|
6
|
-
export declare function createSystemActor(orgId?: string): Actor;
|
|
7
|
-
//# sourceMappingURL=system-actor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system-actor.d.ts","sourceRoot":"","sources":["../../src/auth/system-actor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,GAAE,MAAuB,GAAG,KAAK,CAWvE"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_ORG_ID } from "./org.js";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a system actor for internal operations (webhooks, jobs, compensation chains).
|
|
4
|
-
* System actors have full permissions and are scoped to a specific organization.
|
|
5
|
-
*/
|
|
6
|
-
export function createSystemActor(orgId = DEFAULT_ORG_ID) {
|
|
7
|
-
return {
|
|
8
|
-
type: "api_key",
|
|
9
|
-
userId: "system:internal",
|
|
10
|
-
email: null,
|
|
11
|
-
name: "System",
|
|
12
|
-
vendorId: null,
|
|
13
|
-
organizationId: orgId,
|
|
14
|
-
role: "system",
|
|
15
|
-
permissions: ["*:*"],
|
|
16
|
-
};
|
|
17
|
-
}
|
package/dist/auth/types.d.ts
DELETED
package/dist/auth/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
package/dist/auth/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,cAAc,CA+EjD,CAAC"}
|