@unifiedcommerce/core 0.4.4 → 0.4.5
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/adapters/console-email.d.ts +23 -0
- package/dist/adapters/console-email.d.ts.map +1 -0
- package/dist/adapters/console-email.js +38 -0
- package/dist/auth/access.d.ts +101 -0
- package/dist/auth/access.d.ts.map +1 -0
- package/dist/auth/access.js +128 -0
- package/dist/auth/auth-schema.d.ts +1475 -0
- package/dist/auth/auth-schema.d.ts.map +1 -0
- package/dist/auth/auth-schema.js +124 -0
- package/dist/auth/middleware.d.ts +5 -0
- package/dist/auth/middleware.d.ts.map +1 -0
- package/dist/auth/middleware.js +141 -0
- package/dist/auth/org.d.ts +22 -0
- package/dist/auth/org.d.ts.map +1 -0
- package/dist/auth/org.js +36 -0
- package/dist/auth/permissions.d.ts +4 -0
- package/dist/auth/permissions.d.ts.map +1 -0
- package/dist/auth/permissions.js +24 -0
- package/dist/auth/setup.d.ts +29 -0
- package/dist/auth/setup.d.ts.map +1 -0
- package/dist/auth/setup.js +117 -0
- package/dist/auth/system-actor.d.ts +7 -0
- package/dist/auth/system-actor.d.ts.map +1 -0
- package/dist/auth/system-actor.js +17 -0
- package/dist/auth/types.d.ts +11 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +1 -0
- package/dist/config/defaults.d.ts +3 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +80 -0
- package/dist/config/define-config.d.ts +9 -0
- package/dist/config/define-config.d.ts.map +1 -0
- package/dist/config/define-config.js +44 -0
- package/dist/config/types.d.ts +327 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +1 -0
- package/dist/generated/plugin-manifest.d.ts +48 -0
- package/dist/generated/plugin-manifest.d.ts.map +1 -0
- package/dist/generated/plugin-manifest.js +20 -0
- package/dist/hooks/checkout-completion.d.ts +58 -0
- package/dist/hooks/checkout-completion.d.ts.map +1 -0
- package/dist/hooks/checkout-completion.js +137 -0
- package/dist/hooks/checkout.d.ts +99 -0
- package/dist/hooks/checkout.d.ts.map +1 -0
- package/dist/hooks/checkout.js +317 -0
- package/dist/hooks/order-emails.d.ts +16 -0
- package/dist/hooks/order-emails.d.ts.map +1 -0
- package/dist/hooks/order-emails.js +44 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/interfaces/mcp/agent-prompt.d.ts +16 -0
- package/dist/interfaces/mcp/agent-prompt.d.ts.map +1 -0
- package/dist/interfaces/mcp/agent-prompt.js +172 -0
- package/dist/interfaces/mcp/context-enrichment.d.ts +39 -0
- package/dist/interfaces/mcp/context-enrichment.d.ts.map +1 -0
- package/dist/interfaces/mcp/context-enrichment.js +119 -0
- package/dist/interfaces/mcp/server.d.ts +5 -0
- package/dist/interfaces/mcp/server.d.ts.map +1 -0
- package/dist/interfaces/mcp/server.js +30 -0
- package/dist/interfaces/mcp/tool-builder.d.ts +120 -0
- package/dist/interfaces/mcp/tool-builder.d.ts.map +1 -0
- package/dist/interfaces/mcp/tool-builder.js +224 -0
- package/dist/interfaces/mcp/tools/analytics.d.ts +42 -0
- package/dist/interfaces/mcp/tools/analytics.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/analytics.js +70 -0
- package/dist/interfaces/mcp/tools/cart.d.ts +14 -0
- package/dist/interfaces/mcp/tools/cart.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/cart.js +47 -0
- package/dist/interfaces/mcp/tools/catalog.d.ts +53 -0
- package/dist/interfaces/mcp/tools/catalog.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/catalog.js +284 -0
- package/dist/interfaces/mcp/tools/index.d.ts +3 -0
- package/dist/interfaces/mcp/tools/index.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/index.js +20 -0
- package/dist/interfaces/mcp/tools/inventory.d.ts +27 -0
- package/dist/interfaces/mcp/tools/inventory.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/inventory.js +143 -0
- package/dist/interfaces/mcp/tools/orders.d.ts +18 -0
- package/dist/interfaces/mcp/tools/orders.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/orders.js +82 -0
- package/dist/interfaces/mcp/tools/pricing.d.ts +29 -0
- package/dist/interfaces/mcp/tools/pricing.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/pricing.js +90 -0
- package/dist/interfaces/mcp/tools/promotions.d.ts +44 -0
- package/dist/interfaces/mcp/tools/promotions.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/promotions.js +109 -0
- package/dist/interfaces/mcp/tools/registry.d.ts +32 -0
- package/dist/interfaces/mcp/tools/registry.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/registry.js +55 -0
- package/dist/interfaces/mcp/tools/search.d.ts +14 -0
- package/dist/interfaces/mcp/tools/search.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/search.js +39 -0
- package/dist/interfaces/mcp/tools/webhooks.d.ts +15 -0
- package/dist/interfaces/mcp/tools/webhooks.d.ts.map +1 -0
- package/dist/interfaces/mcp/tools/webhooks.js +48 -0
- package/dist/interfaces/mcp/transport.d.ts +20 -0
- package/dist/interfaces/mcp/transport.d.ts.map +1 -0
- package/dist/interfaces/mcp/transport.js +99 -0
- package/dist/interfaces/rest/customer-portal.d.ts +5 -0
- package/dist/interfaces/rest/customer-portal.d.ts.map +1 -0
- package/dist/interfaces/rest/customer-portal.js +206 -0
- package/dist/interfaces/rest/router.d.ts +164 -0
- package/dist/interfaces/rest/router.d.ts.map +1 -0
- package/dist/interfaces/rest/router.js +259 -0
- package/dist/interfaces/rest/routes/admin-jobs.d.ts +5 -0
- package/dist/interfaces/rest/routes/admin-jobs.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/admin-jobs.js +48 -0
- package/dist/interfaces/rest/routes/audit.d.ts +5 -0
- package/dist/interfaces/rest/routes/audit.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/audit.js +43 -0
- package/dist/interfaces/rest/routes/carts.d.ts +5 -0
- package/dist/interfaces/rest/routes/carts.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/carts.js +55 -0
- package/dist/interfaces/rest/routes/catalog.d.ts +5 -0
- package/dist/interfaces/rest/routes/catalog.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/catalog.js +256 -0
- package/dist/interfaces/rest/routes/checkout.d.ts +5 -0
- package/dist/interfaces/rest/routes/checkout.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/checkout.js +216 -0
- package/dist/interfaces/rest/routes/customers.d.ts +5 -0
- package/dist/interfaces/rest/routes/customers.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/customers.js +74 -0
- package/dist/interfaces/rest/routes/entity-aliases.d.ts +18 -0
- package/dist/interfaces/rest/routes/entity-aliases.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/entity-aliases.js +39 -0
- package/dist/interfaces/rest/routes/inventory.d.ts +5 -0
- package/dist/interfaces/rest/routes/inventory.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/inventory.js +72 -0
- package/dist/interfaces/rest/routes/media.d.ts +5 -0
- package/dist/interfaces/rest/routes/media.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/media.js +65 -0
- package/dist/interfaces/rest/routes/orders.d.ts +5 -0
- package/dist/interfaces/rest/routes/orders.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/orders.js +64 -0
- package/dist/interfaces/rest/routes/payments.d.ts +5 -0
- package/dist/interfaces/rest/routes/payments.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/payments.js +45 -0
- package/dist/interfaces/rest/routes/pricing.d.ts +5 -0
- package/dist/interfaces/rest/routes/pricing.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/pricing.js +48 -0
- package/dist/interfaces/rest/routes/promotions.d.ts +5 -0
- package/dist/interfaces/rest/routes/promotions.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/promotions.js +76 -0
- package/dist/interfaces/rest/routes/search.d.ts +5 -0
- package/dist/interfaces/rest/routes/search.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/search.js +60 -0
- package/dist/interfaces/rest/routes/webhooks.d.ts +5 -0
- package/dist/interfaces/rest/routes/webhooks.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/webhooks.js +39 -0
- package/dist/interfaces/rest/schemas/admin-jobs.d.ts +327 -0
- package/dist/interfaces/rest/schemas/admin-jobs.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/admin-jobs.js +37 -0
- package/dist/interfaces/rest/schemas/audit.d.ts +59 -0
- package/dist/interfaces/rest/schemas/audit.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/audit.js +43 -0
- package/dist/interfaces/rest/schemas/carts.d.ts +1456 -0
- package/dist/interfaces/rest/schemas/carts.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/carts.js +109 -0
- package/dist/interfaces/rest/schemas/catalog.d.ts +5452 -0
- package/dist/interfaces/rest/schemas/catalog.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/catalog.js +397 -0
- package/dist/interfaces/rest/schemas/checkout.d.ts +160 -0
- package/dist/interfaces/rest/schemas/checkout.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/checkout.js +60 -0
- package/dist/interfaces/rest/schemas/customer-portal.d.ts +2203 -0
- package/dist/interfaces/rest/schemas/customer-portal.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/customer-portal.js +177 -0
- package/dist/interfaces/rest/schemas/customers.d.ts +422 -0
- package/dist/interfaces/rest/schemas/customers.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/customers.js +150 -0
- package/dist/interfaces/rest/schemas/inventory.d.ts +561 -0
- package/dist/interfaces/rest/schemas/inventory.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/inventory.js +148 -0
- package/dist/interfaces/rest/schemas/media.d.ts +303 -0
- package/dist/interfaces/rest/schemas/media.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/media.js +69 -0
- package/dist/interfaces/rest/schemas/orders.d.ts +1792 -0
- package/dist/interfaces/rest/schemas/orders.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/orders.js +93 -0
- package/dist/interfaces/rest/schemas/pricing.d.ts +256 -0
- package/dist/interfaces/rest/schemas/pricing.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/pricing.js +72 -0
- package/dist/interfaces/rest/schemas/promotions.d.ts +363 -0
- package/dist/interfaces/rest/schemas/promotions.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/promotions.js +98 -0
- package/dist/interfaces/rest/schemas/responses.d.ts +4086 -0
- package/dist/interfaces/rest/schemas/responses.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/responses.js +74 -0
- package/dist/interfaces/rest/schemas/search.d.ts +247 -0
- package/dist/interfaces/rest/schemas/search.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/search.js +55 -0
- package/dist/interfaces/rest/schemas/shared.d.ts +95 -0
- package/dist/interfaces/rest/schemas/shared.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/shared.js +51 -0
- package/dist/interfaces/rest/schemas/webhooks.d.ts +221 -0
- package/dist/interfaces/rest/schemas/webhooks.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/webhooks.js +62 -0
- package/dist/interfaces/rest/utils.d.ts +45 -0
- package/dist/interfaces/rest/utils.d.ts.map +1 -0
- package/dist/interfaces/rest/utils.js +71 -0
- package/dist/interfaces/rest/webhook-router.d.ts +41 -0
- package/dist/interfaces/rest/webhook-router.d.ts.map +1 -0
- package/dist/interfaces/rest/webhook-router.js +36 -0
- package/dist/kernel/compensation/executor.d.ts +21 -0
- package/dist/kernel/compensation/executor.d.ts.map +1 -0
- package/dist/kernel/compensation/executor.js +36 -0
- package/dist/kernel/compensation/types.d.ts +25 -0
- package/dist/kernel/compensation/types.d.ts.map +1 -0
- package/dist/kernel/compensation/types.js +1 -0
- package/dist/kernel/database/adapter.d.ts +18 -0
- package/dist/kernel/database/adapter.d.ts.map +1 -0
- package/dist/kernel/database/adapter.js +3 -0
- package/dist/kernel/database/drizzle-db.d.ts +49 -0
- package/dist/kernel/database/drizzle-db.d.ts.map +1 -0
- package/dist/kernel/database/drizzle-db.js +20 -0
- package/dist/kernel/database/migrate.d.ts +38 -0
- package/dist/kernel/database/migrate.d.ts.map +1 -0
- package/dist/kernel/database/migrate.js +61 -0
- package/dist/kernel/database/plugin-types.d.ts +32 -0
- package/dist/kernel/database/plugin-types.d.ts.map +1 -0
- package/dist/kernel/database/plugin-types.js +10 -0
- package/dist/kernel/database/schema.d.ts +24 -0
- package/dist/kernel/database/schema.d.ts.map +1 -0
- package/dist/kernel/database/schema.js +36 -0
- package/dist/kernel/database/scoped-db.d.ts +20 -0
- package/dist/kernel/database/scoped-db.d.ts.map +1 -0
- package/dist/kernel/database/scoped-db.js +62 -0
- package/dist/kernel/database/tx-context.d.ts +15 -0
- package/dist/kernel/database/tx-context.d.ts.map +1 -0
- package/dist/kernel/database/tx-context.js +19 -0
- package/dist/kernel/error-mapper.d.ts +3 -0
- package/dist/kernel/error-mapper.d.ts.map +1 -0
- package/dist/kernel/error-mapper.js +12 -0
- package/dist/kernel/errors.d.ts +38 -0
- package/dist/kernel/errors.d.ts.map +1 -0
- package/dist/kernel/errors.js +69 -0
- package/dist/kernel/factory/repository-factory.d.ts +71 -0
- package/dist/kernel/factory/repository-factory.d.ts.map +1 -0
- package/dist/kernel/factory/repository-factory.js +138 -0
- package/dist/kernel/hooks/create-context.d.ts +25 -0
- package/dist/kernel/hooks/create-context.d.ts.map +1 -0
- package/dist/kernel/hooks/create-context.js +22 -0
- package/dist/kernel/hooks/executor.d.ts +12 -0
- package/dist/kernel/hooks/executor.d.ts.map +1 -0
- package/dist/kernel/hooks/executor.js +50 -0
- package/dist/kernel/hooks/registry.d.ts +28 -0
- package/dist/kernel/hooks/registry.d.ts.map +1 -0
- package/dist/kernel/hooks/registry.js +58 -0
- package/dist/kernel/hooks/types.d.ts +37 -0
- package/dist/kernel/hooks/types.d.ts.map +1 -0
- package/dist/kernel/hooks/types.js +1 -0
- package/dist/kernel/http-error.d.ts +30 -0
- package/dist/kernel/http-error.d.ts.map +1 -0
- package/dist/kernel/http-error.js +35 -0
- package/dist/kernel/jobs/adapter.d.ts +25 -0
- package/dist/kernel/jobs/adapter.d.ts.map +1 -0
- package/dist/kernel/jobs/adapter.js +9 -0
- package/dist/kernel/jobs/drizzle-adapter.d.ts +15 -0
- package/dist/kernel/jobs/drizzle-adapter.d.ts.map +1 -0
- package/dist/kernel/jobs/drizzle-adapter.js +42 -0
- package/dist/kernel/jobs/runner.d.ts +24 -0
- package/dist/kernel/jobs/runner.d.ts.map +1 -0
- package/dist/kernel/jobs/runner.js +114 -0
- package/dist/kernel/jobs/schema.d.ts +280 -0
- package/dist/kernel/jobs/schema.d.ts.map +1 -0
- package/dist/kernel/jobs/schema.js +37 -0
- package/dist/kernel/jobs/types.d.ts +30 -0
- package/dist/kernel/jobs/types.d.ts.map +1 -0
- package/dist/kernel/jobs/types.js +1 -0
- package/dist/kernel/local-api.d.ts +103 -0
- package/dist/kernel/local-api.d.ts.map +1 -0
- package/dist/kernel/local-api.js +89 -0
- package/dist/kernel/plugin/manifest.d.ts +90 -0
- package/dist/kernel/plugin/manifest.d.ts.map +1 -0
- package/dist/kernel/plugin/manifest.js +169 -0
- package/dist/kernel/query/executor.d.ts +21 -0
- package/dist/kernel/query/executor.d.ts.map +1 -0
- package/dist/kernel/query/executor.js +128 -0
- package/dist/kernel/query/registry.d.ts +33 -0
- package/dist/kernel/query/registry.d.ts.map +1 -0
- package/dist/kernel/query/registry.js +20 -0
- package/dist/kernel/result.d.ts +36 -0
- package/dist/kernel/result.d.ts.map +1 -0
- package/dist/kernel/result.js +16 -0
- package/dist/kernel/schema/extra-columns.d.ts +23 -0
- package/dist/kernel/schema/extra-columns.d.ts.map +1 -0
- package/dist/kernel/schema/extra-columns.js +10 -0
- package/dist/kernel/service-registry.d.ts +109 -0
- package/dist/kernel/service-registry.d.ts.map +1 -0
- package/dist/kernel/service-registry.js +26 -0
- package/dist/kernel/service-timing.d.ts +25 -0
- package/dist/kernel/service-timing.d.ts.map +1 -0
- package/dist/kernel/service-timing.js +62 -0
- package/dist/kernel/state-machine/machine.d.ts +24 -0
- package/dist/kernel/state-machine/machine.d.ts.map +1 -0
- package/dist/kernel/state-machine/machine.js +70 -0
- package/dist/modules/analytics/drizzle-adapter.d.ts +13 -0
- package/dist/modules/analytics/drizzle-adapter.d.ts.map +1 -0
- package/dist/modules/analytics/drizzle-adapter.js +358 -0
- package/dist/modules/analytics/hooks.d.ts +13 -0
- package/dist/modules/analytics/hooks.d.ts.map +1 -0
- package/dist/modules/analytics/hooks.js +12 -0
- package/dist/modules/analytics/models.d.ts +14 -0
- package/dist/modules/analytics/models.d.ts.map +1 -0
- package/dist/modules/analytics/models.js +118 -0
- package/dist/modules/analytics/repository/index.d.ts +5 -0
- package/dist/modules/analytics/repository/index.d.ts.map +1 -0
- package/dist/modules/analytics/repository/index.js +1 -0
- package/dist/modules/analytics/service.d.ts +45 -0
- package/dist/modules/analytics/service.d.ts.map +1 -0
- package/dist/modules/analytics/service.js +196 -0
- package/dist/modules/analytics/types.d.ts +119 -0
- package/dist/modules/analytics/types.d.ts.map +1 -0
- package/dist/modules/analytics/types.js +25 -0
- package/dist/modules/audit/hooks.d.ts +7 -0
- package/dist/modules/audit/hooks.d.ts.map +1 -0
- package/dist/modules/audit/hooks.js +67 -0
- package/dist/modules/audit/schema.d.ts +178 -0
- package/dist/modules/audit/schema.d.ts.map +1 -0
- package/dist/modules/audit/schema.js +21 -0
- package/dist/modules/audit/service.d.ts +38 -0
- package/dist/modules/audit/service.d.ts.map +1 -0
- package/dist/modules/audit/service.js +109 -0
- package/dist/modules/cart/access.d.ts +11 -0
- package/dist/modules/cart/access.d.ts.map +1 -0
- package/dist/modules/cart/access.js +18 -0
- package/dist/modules/cart/matcher.d.ts +20 -0
- package/dist/modules/cart/matcher.d.ts.map +1 -0
- package/dist/modules/cart/matcher.js +2 -0
- package/dist/modules/cart/repository/index.d.ts +45 -0
- package/dist/modules/cart/repository/index.d.ts.map +1 -0
- package/dist/modules/cart/repository/index.js +158 -0
- package/dist/modules/cart/schema.d.ts +359 -0
- package/dist/modules/cart/schema.d.ts.map +1 -0
- package/dist/modules/cart/schema.js +40 -0
- package/dist/modules/cart/schemas.d.ts +29 -0
- package/dist/modules/cart/schemas.d.ts.map +1 -0
- package/dist/modules/cart/schemas.js +14 -0
- package/dist/modules/cart/service.d.ts +63 -0
- package/dist/modules/cart/service.d.ts.map +1 -0
- package/dist/modules/cart/service.js +339 -0
- package/dist/modules/catalog/repository/index.d.ts +106 -0
- package/dist/modules/catalog/repository/index.d.ts.map +1 -0
- package/dist/modules/catalog/repository/index.js +455 -0
- package/dist/modules/catalog/schema.d.ts +1193 -0
- package/dist/modules/catalog/schema.d.ts.map +1 -0
- package/dist/modules/catalog/schema.js +149 -0
- package/dist/modules/catalog/schemas.d.ts +81 -0
- package/dist/modules/catalog/schemas.d.ts.map +1 -0
- package/dist/modules/catalog/schemas.js +62 -0
- package/dist/modules/catalog/service.d.ts +160 -0
- package/dist/modules/catalog/service.d.ts.map +1 -0
- package/dist/modules/catalog/service.js +759 -0
- package/dist/modules/customers/repository/index.d.ts +47 -0
- package/dist/modules/customers/repository/index.d.ts.map +1 -0
- package/dist/modules/customers/repository/index.js +206 -0
- package/dist/modules/customers/schema.d.ts +560 -0
- package/dist/modules/customers/schema.d.ts.map +1 -0
- package/dist/modules/customers/schema.js +60 -0
- package/dist/modules/customers/service.d.ts +27 -0
- package/dist/modules/customers/service.d.ts.map +1 -0
- package/dist/modules/customers/service.js +106 -0
- package/dist/modules/fulfillment/repository/index.d.ts +63 -0
- package/dist/modules/fulfillment/repository/index.d.ts.map +1 -0
- package/dist/modules/fulfillment/repository/index.js +268 -0
- package/dist/modules/fulfillment/schema.d.ts +655 -0
- package/dist/modules/fulfillment/schema.d.ts.map +1 -0
- package/dist/modules/fulfillment/schema.js +83 -0
- package/dist/modules/fulfillment/service.d.ts +58 -0
- package/dist/modules/fulfillment/service.d.ts.map +1 -0
- package/dist/modules/fulfillment/service.js +338 -0
- package/dist/modules/fulfillment/types.d.ts +44 -0
- package/dist/modules/fulfillment/types.d.ts.map +1 -0
- package/dist/modules/fulfillment/types.js +1 -0
- package/dist/modules/inventory/repository/index.d.ts +81 -0
- package/dist/modules/inventory/repository/index.d.ts.map +1 -0
- package/dist/modules/inventory/repository/index.js +310 -0
- package/dist/modules/inventory/schema.d.ts +570 -0
- package/dist/modules/inventory/schema.d.ts.map +1 -0
- package/dist/modules/inventory/schema.js +69 -0
- package/dist/modules/inventory/schemas.d.ts +31 -0
- package/dist/modules/inventory/schemas.d.ts.map +1 -0
- package/dist/modules/inventory/schemas.js +28 -0
- package/dist/modules/inventory/service.d.ts +69 -0
- package/dist/modules/inventory/service.d.ts.map +1 -0
- package/dist/modules/inventory/service.js +283 -0
- package/dist/modules/media/adapter.d.ts +16 -0
- package/dist/modules/media/adapter.d.ts.map +1 -0
- package/dist/modules/media/adapter.js +1 -0
- package/dist/modules/media/repository/index.d.ts +35 -0
- package/dist/modules/media/repository/index.d.ts.map +1 -0
- package/dist/modules/media/repository/index.js +176 -0
- package/dist/modules/media/schema.d.ts +289 -0
- package/dist/modules/media/schema.d.ts.map +1 -0
- package/dist/modules/media/schema.js +35 -0
- package/dist/modules/media/service.d.ts +42 -0
- package/dist/modules/media/service.d.ts.map +1 -0
- package/dist/modules/media/service.js +89 -0
- package/dist/modules/orders/repository/index.d.ts +48 -0
- package/dist/modules/orders/repository/index.d.ts.map +1 -0
- package/dist/modules/orders/repository/index.js +199 -0
- package/dist/modules/orders/schema.d.ts +672 -0
- package/dist/modules/orders/schema.d.ts.map +1 -0
- package/dist/modules/orders/schema.js +63 -0
- package/dist/modules/orders/service.d.ts +85 -0
- package/dist/modules/orders/service.d.ts.map +1 -0
- package/dist/modules/orders/service.js +313 -0
- package/dist/modules/orders/stale-order-cleanup.d.ts +27 -0
- package/dist/modules/orders/stale-order-cleanup.d.ts.map +1 -0
- package/dist/modules/orders/stale-order-cleanup.js +55 -0
- package/dist/modules/organization/service.d.ts +53 -0
- package/dist/modules/organization/service.d.ts.map +1 -0
- package/dist/modules/organization/service.js +151 -0
- package/dist/modules/payments/adapter.d.ts +42 -0
- package/dist/modules/payments/adapter.d.ts.map +1 -0
- package/dist/modules/payments/adapter.js +1 -0
- package/dist/modules/payments/repository/index.d.ts +5 -0
- package/dist/modules/payments/repository/index.d.ts.map +1 -0
- package/dist/modules/payments/repository/index.js +1 -0
- package/dist/modules/payments/service.d.ts +23 -0
- package/dist/modules/payments/service.d.ts.map +1 -0
- package/dist/modules/payments/service.js +72 -0
- package/dist/modules/pricing/repository/index.d.ts +34 -0
- package/dist/modules/pricing/repository/index.d.ts.map +1 -0
- package/dist/modules/pricing/repository/index.js +176 -0
- package/dist/modules/pricing/schema.d.ts +565 -0
- package/dist/modules/pricing/schema.d.ts.map +1 -0
- package/dist/modules/pricing/schema.js +57 -0
- package/dist/modules/pricing/schemas.d.ts +37 -0
- package/dist/modules/pricing/schemas.d.ts.map +1 -0
- package/dist/modules/pricing/schemas.js +30 -0
- package/dist/modules/pricing/service.d.ts +62 -0
- package/dist/modules/pricing/service.d.ts.map +1 -0
- package/dist/modules/pricing/service.js +308 -0
- package/dist/modules/promotions/repository/index.d.ts +41 -0
- package/dist/modules/promotions/repository/index.d.ts.map +1 -0
- package/dist/modules/promotions/repository/index.js +204 -0
- package/dist/modules/promotions/schema.d.ts +427 -0
- package/dist/modules/promotions/schema.d.ts.map +1 -0
- package/dist/modules/promotions/schema.js +52 -0
- package/dist/modules/promotions/schemas.d.ts +33 -0
- package/dist/modules/promotions/schemas.d.ts.map +1 -0
- package/dist/modules/promotions/schemas.js +32 -0
- package/dist/modules/promotions/service.d.ts +80 -0
- package/dist/modules/promotions/service.d.ts.map +1 -0
- package/dist/modules/promotions/service.js +347 -0
- package/dist/modules/search/adapter.d.ts +51 -0
- package/dist/modules/search/adapter.d.ts.map +1 -0
- package/dist/modules/search/adapter.js +1 -0
- package/dist/modules/search/hooks.d.ts +8 -0
- package/dist/modules/search/hooks.d.ts.map +1 -0
- package/dist/modules/search/hooks.js +6 -0
- package/dist/modules/search/repository/index.d.ts +5 -0
- package/dist/modules/search/repository/index.d.ts.map +1 -0
- package/dist/modules/search/repository/index.js +1 -0
- package/dist/modules/search/service.d.ts +24 -0
- package/dist/modules/search/service.d.ts.map +1 -0
- package/dist/modules/search/service.js +217 -0
- package/dist/modules/shipping/calculator.d.ts +42 -0
- package/dist/modules/shipping/calculator.d.ts.map +1 -0
- package/dist/modules/shipping/calculator.js +91 -0
- package/dist/modules/shipping/repository/index.d.ts +5 -0
- package/dist/modules/shipping/repository/index.d.ts.map +1 -0
- package/dist/modules/shipping/repository/index.js +1 -0
- package/dist/modules/shipping/service.d.ts +28 -0
- package/dist/modules/shipping/service.d.ts.map +1 -0
- package/dist/modules/shipping/service.js +20 -0
- package/dist/modules/tax/adapter.d.ts +58 -0
- package/dist/modules/tax/adapter.d.ts.map +1 -0
- package/dist/modules/tax/adapter.js +1 -0
- package/dist/modules/tax/repository/index.d.ts +5 -0
- package/dist/modules/tax/repository/index.d.ts.map +1 -0
- package/dist/modules/tax/repository/index.js +1 -0
- package/dist/modules/tax/service.d.ts +19 -0
- package/dist/modules/tax/service.d.ts.map +1 -0
- package/dist/modules/tax/service.js +34 -0
- package/dist/modules/webhooks/hook.d.ts +13 -0
- package/dist/modules/webhooks/hook.d.ts.map +1 -0
- package/dist/modules/webhooks/hook.js +29 -0
- package/dist/modules/webhooks/repository/index.d.ts +40 -0
- package/dist/modules/webhooks/repository/index.d.ts.map +1 -0
- package/dist/modules/webhooks/repository/index.js +175 -0
- package/dist/modules/webhooks/schema.d.ts +404 -0
- package/dist/modules/webhooks/schema.d.ts.map +1 -0
- package/dist/modules/webhooks/schema.js +40 -0
- package/dist/modules/webhooks/service.d.ts +23 -0
- package/dist/modules/webhooks/service.d.ts.map +1 -0
- package/dist/modules/webhooks/service.js +92 -0
- package/dist/modules/webhooks/signing.d.ts +2 -0
- package/dist/modules/webhooks/signing.d.ts.map +1 -0
- package/dist/modules/webhooks/signing.js +5 -0
- package/dist/modules/webhooks/ssrf-guard.d.ts +19 -0
- package/dist/modules/webhooks/ssrf-guard.d.ts.map +1 -0
- package/dist/modules/webhooks/ssrf-guard.js +79 -0
- package/dist/modules/webhooks/tasks.d.ts +16 -0
- package/dist/modules/webhooks/tasks.d.ts.map +1 -0
- package/dist/modules/webhooks/tasks.js +35 -0
- package/dist/modules/webhooks/worker.d.ts +21 -0
- package/dist/modules/webhooks/worker.d.ts.map +1 -0
- package/dist/modules/webhooks/worker.js +113 -0
- package/dist/runtime/commerce.d.ts +110 -0
- package/dist/runtime/commerce.d.ts.map +1 -0
- package/dist/runtime/commerce.js +37 -0
- package/dist/runtime/kernel.d.ts +71 -0
- package/dist/runtime/kernel.d.ts.map +1 -0
- package/dist/runtime/kernel.js +306 -0
- package/dist/runtime/logger.d.ts +11 -0
- package/dist/runtime/logger.d.ts.map +1 -0
- package/dist/runtime/logger.js +32 -0
- package/dist/runtime/shutdown.d.ts +15 -0
- package/dist/runtime/shutdown.d.ts.map +1 -0
- package/dist/runtime/shutdown.js +34 -0
- package/dist/test-utils/create-pglite-adapter.d.ts +32 -0
- package/dist/test-utils/create-pglite-adapter.d.ts.map +1 -0
- package/dist/test-utils/create-pglite-adapter.js +107 -0
- package/dist/test-utils/create-plugin-test-app.d.ts +50 -0
- package/dist/test-utils/create-plugin-test-app.d.ts.map +1 -0
- package/dist/test-utils/create-plugin-test-app.js +74 -0
- package/dist/test-utils/create-repository-test-harness.d.ts +8 -0
- package/dist/test-utils/create-repository-test-harness.d.ts.map +1 -0
- package/dist/test-utils/create-repository-test-harness.js +7 -0
- package/dist/test-utils/create-test-config.d.ts +18 -0
- package/dist/test-utils/create-test-config.d.ts.map +1 -0
- package/dist/test-utils/create-test-config.js +172 -0
- package/dist/test-utils/create-test-kernel.d.ts +3 -0
- package/dist/test-utils/create-test-kernel.d.ts.map +1 -0
- package/dist/test-utils/create-test-kernel.js +5 -0
- package/dist/test-utils/create-test-plugin-context.d.ts +42 -0
- package/dist/test-utils/create-test-plugin-context.d.ts.map +1 -0
- package/dist/test-utils/create-test-plugin-context.js +46 -0
- package/dist/test-utils/rest-api-test-utils.d.ts +64 -0
- package/dist/test-utils/rest-api-test-utils.d.ts.map +1 -0
- package/dist/test-utils/rest-api-test-utils.js +207 -0
- package/dist/test-utils/test-actors.d.ts +15 -0
- package/dist/test-utils/test-actors.d.ts.map +1 -0
- package/dist/test-utils/test-actors.js +57 -0
- package/dist/test-utils/typed-hooks.d.ts +43 -0
- package/dist/test-utils/typed-hooks.d.ts.map +1 -0
- package/dist/test-utils/typed-hooks.js +35 -0
- package/dist/testing.d.ts +14 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +13 -0
- package/dist/types/commerce-types.d.ts +34 -0
- package/dist/types/commerce-types.d.ts.map +1 -0
- package/dist/types/commerce-types.js +1 -0
- package/dist/utils/id.d.ts +2 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +3 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +16 -0
- package/dist/utils/pagination.d.ts +11 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { type AppEnv } from "../utils.js";
|
|
4
|
+
export declare function pricingRoutes(kernel: Kernel): OpenAPIHono<AppEnv, {}, "/">;
|
|
5
|
+
//# sourceMappingURL=pricing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/rest/routes/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,KAAK,MAAM,EAAqD,MAAM,aAAa,CAAC;AAE7F,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,gCAmD3C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { setBasePriceRoute, createModifierRoute, listPricesRoute } from "../schemas/pricing.js";
|
|
3
|
+
import { mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils.js";
|
|
4
|
+
export function pricingRoutes(kernel) {
|
|
5
|
+
const router = new OpenAPIHono();
|
|
6
|
+
router.use("/prices", requirePerm("pricing:manage"));
|
|
7
|
+
// @ts-expect-error -- openapi() enforces strict response typing but our handler
|
|
8
|
+
// returns union responses (201 | 400 | 422). The route definition documents the
|
|
9
|
+
// contract; the handler returns dynamic status.
|
|
10
|
+
router.openapi(setBasePriceRoute, async (c) => {
|
|
11
|
+
const actor = c.get("actor");
|
|
12
|
+
const result = await kernel.services.pricing.setBasePrice(c.req.valid("json"), actor);
|
|
13
|
+
if (!result.ok) {
|
|
14
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
15
|
+
}
|
|
16
|
+
return c.json({ data: result.value }, 201);
|
|
17
|
+
});
|
|
18
|
+
// @ts-expect-error -- openapi handler union return type
|
|
19
|
+
router.openapi(listPricesRoute, async (c) => {
|
|
20
|
+
const entityId = c.req.query("entityId");
|
|
21
|
+
const variantId = c.req.query("variantId");
|
|
22
|
+
const currency = c.req.query("currency");
|
|
23
|
+
const customerGroupId = c.req.query("customerGroupId");
|
|
24
|
+
const result = await kernel.services.pricing.listPrices({
|
|
25
|
+
...(entityId !== undefined ? { entityId } : {}),
|
|
26
|
+
...(variantId !== undefined ? { variantId } : {}),
|
|
27
|
+
...(currency !== undefined ? { currency } : {}),
|
|
28
|
+
...(customerGroupId !== undefined ? { customerGroupId } : {}),
|
|
29
|
+
});
|
|
30
|
+
if (!result.ok) {
|
|
31
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
32
|
+
}
|
|
33
|
+
return c.json({ data: result.value });
|
|
34
|
+
});
|
|
35
|
+
router.use("/modifiers", requirePerm("pricing:manage"));
|
|
36
|
+
// @ts-expect-error -- openapi() enforces strict response typing but our handler
|
|
37
|
+
// returns union responses (201 | 400 | 422). The route definition documents the
|
|
38
|
+
// contract; the handler returns dynamic status.
|
|
39
|
+
router.openapi(createModifierRoute, async (c) => {
|
|
40
|
+
const actor = c.get("actor");
|
|
41
|
+
const result = await kernel.services.pricing.createModifier(c.req.valid("json"), actor);
|
|
42
|
+
if (!result.ok) {
|
|
43
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
44
|
+
}
|
|
45
|
+
return c.json({ data: result.value }, 201);
|
|
46
|
+
});
|
|
47
|
+
return router;
|
|
48
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { type AppEnv } from "../utils.js";
|
|
4
|
+
export declare function promotionRoutes(kernel: Kernel): OpenAPIHono<AppEnv, {}, "/">;
|
|
5
|
+
//# sourceMappingURL=promotions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promotions.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/rest/routes/promotions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,KAAK,MAAM,EAAqD,MAAM,aAAa,CAAC;AAG7F,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,gCAqF7C"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { rateLimiter } from "hono-rate-limiter";
|
|
3
|
+
import { createPromotionRoute, validatePromotionRoute, deactivatePromotionRoute, listActivePromotionsRoute } from "../schemas/promotions.js";
|
|
4
|
+
import { mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils.js";
|
|
5
|
+
import { resolveOrgId } from "../../../auth/org.js";
|
|
6
|
+
export function promotionRoutes(kernel) {
|
|
7
|
+
const router = new OpenAPIHono();
|
|
8
|
+
// Rate limit promo code validation — prevents brute-force code enumeration
|
|
9
|
+
router.use("/validate", rateLimiter({
|
|
10
|
+
windowMs: 60 * 1000,
|
|
11
|
+
limit: 10,
|
|
12
|
+
keyGenerator: (c) => {
|
|
13
|
+
// Node.js Request has a socket property; Hono types it as unknown.
|
|
14
|
+
const socket = c.req.raw.socket;
|
|
15
|
+
return socket?.remoteAddress ?? "unknown";
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
18
|
+
router.use("/", requirePerm("promotions:manage"));
|
|
19
|
+
// @ts-expect-error -- openapi() enforces strict response typing but our handler
|
|
20
|
+
// returns union responses (201 | 400 | 422). The route definition documents the
|
|
21
|
+
// contract; the handler returns dynamic status.
|
|
22
|
+
router.openapi(createPromotionRoute, async (c) => {
|
|
23
|
+
const body = c.req.valid("json");
|
|
24
|
+
const actor = c.get("actor");
|
|
25
|
+
const result = await kernel.services.promotions.create(body, actor);
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
28
|
+
}
|
|
29
|
+
return c.json({ data: result.value }, 201);
|
|
30
|
+
});
|
|
31
|
+
// List active promotions — requires auth
|
|
32
|
+
router.use("/active", requirePerm("promotions:read"));
|
|
33
|
+
// @ts-expect-error -- openapi handler union return type
|
|
34
|
+
router.openapi(listActivePromotionsRoute, async (_c) => {
|
|
35
|
+
const actor = _c.get("actor");
|
|
36
|
+
const result = await kernel.services.promotions.listActive(actor);
|
|
37
|
+
if (!result.ok) {
|
|
38
|
+
return _c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
39
|
+
}
|
|
40
|
+
return _c.json({ data: result.value });
|
|
41
|
+
});
|
|
42
|
+
// @ts-expect-error -- openapi() enforces strict response typing but our handler
|
|
43
|
+
// returns union responses (200 | 400 | 404). The route definition documents the
|
|
44
|
+
// contract; the handler returns dynamic status.
|
|
45
|
+
router.openapi(validatePromotionRoute, async (c) => {
|
|
46
|
+
const payload = c.req.valid("json");
|
|
47
|
+
const actor = c.get("actor");
|
|
48
|
+
const orgId = resolveOrgId(actor);
|
|
49
|
+
const result = await kernel.services.promotions.validate(payload.code, {
|
|
50
|
+
orgId,
|
|
51
|
+
currency: payload.currency,
|
|
52
|
+
subtotal: payload.subtotal,
|
|
53
|
+
lineItems: payload.lineItems,
|
|
54
|
+
...(payload.customerId !== undefined ? { customerId: payload.customerId } : {}),
|
|
55
|
+
...(payload.customerGroupIds !== undefined ? { customerGroupIds: payload.customerGroupIds } : {}),
|
|
56
|
+
});
|
|
57
|
+
if (!result.ok) {
|
|
58
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
59
|
+
}
|
|
60
|
+
return c.json({ data: result.value });
|
|
61
|
+
});
|
|
62
|
+
router.use("/:id/deactivate", requirePerm("promotions:manage"));
|
|
63
|
+
// @ts-expect-error -- openapi() enforces strict response typing but our handler
|
|
64
|
+
// returns union responses (200 | 400 | 404). The route definition documents the
|
|
65
|
+
// contract; the handler returns dynamic status.
|
|
66
|
+
router.openapi(deactivatePromotionRoute, async (c) => {
|
|
67
|
+
const actor = c.get("actor");
|
|
68
|
+
const orgId = resolveOrgId(actor);
|
|
69
|
+
const result = await kernel.services.promotions.deactivate(orgId, c.req.param("id"));
|
|
70
|
+
if (!result.ok) {
|
|
71
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
72
|
+
}
|
|
73
|
+
return c.json({ data: result.value });
|
|
74
|
+
});
|
|
75
|
+
return router;
|
|
76
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { type AppEnv } from "../utils.js";
|
|
4
|
+
export declare function searchRoutes(kernel: Kernel): OpenAPIHono<AppEnv, {}, "/">;
|
|
5
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/rest/routes/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,KAAK,MAAM,EAAwC,MAAM,aAAa,CAAC;AAEhF,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,gCAiE1C"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { searchRoute, suggestRoute } from "../schemas/search.js";
|
|
3
|
+
import { mapErrorToResponse, mapErrorToStatus } from "../utils.js";
|
|
4
|
+
export function searchRoutes(kernel) {
|
|
5
|
+
const router = new OpenAPIHono();
|
|
6
|
+
// @ts-expect-error -- openapi handler union return type
|
|
7
|
+
router.openapi(searchRoute, async (c) => {
|
|
8
|
+
const q = c.req.query("q") ?? "";
|
|
9
|
+
const type = c.req.query("type");
|
|
10
|
+
const category = c.req.query("category");
|
|
11
|
+
const brand = c.req.query("brand");
|
|
12
|
+
const status = c.req.query("status");
|
|
13
|
+
const page = Number.parseInt(c.req.query("page") ?? "1", 10);
|
|
14
|
+
const limit = Number.parseInt(c.req.query("limit") ?? "20", 10);
|
|
15
|
+
const facets = (c.req.query("facets") ?? "")
|
|
16
|
+
.split(",")
|
|
17
|
+
.map((facet) => facet.trim())
|
|
18
|
+
.filter(Boolean);
|
|
19
|
+
const result = await kernel.services.search.query({
|
|
20
|
+
query: q,
|
|
21
|
+
page,
|
|
22
|
+
limit,
|
|
23
|
+
filters: {
|
|
24
|
+
...(type ? { type } : {}),
|
|
25
|
+
...(category ? { category } : {}),
|
|
26
|
+
...(brand ? { brand } : {}),
|
|
27
|
+
...(status ? { status } : {}),
|
|
28
|
+
},
|
|
29
|
+
...(facets.length > 0 ? { facets } : {}),
|
|
30
|
+
}, { actor: c.get("actor"), tx: null, requestId: "" });
|
|
31
|
+
if (!result.ok) {
|
|
32
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
33
|
+
}
|
|
34
|
+
return c.json({
|
|
35
|
+
data: result.value.hits,
|
|
36
|
+
meta: {
|
|
37
|
+
total: result.value.total,
|
|
38
|
+
page: result.value.page,
|
|
39
|
+
limit: result.value.limit,
|
|
40
|
+
facets: result.value.facets,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
// @ts-expect-error -- openapi handler union return type
|
|
45
|
+
router.openapi(suggestRoute, async (c) => {
|
|
46
|
+
const prefix = c.req.query("prefix") ?? "";
|
|
47
|
+
const type = c.req.query("type");
|
|
48
|
+
const limit = Number.parseInt(c.req.query("limit") ?? "10", 10);
|
|
49
|
+
const result = await kernel.services.search.suggest({
|
|
50
|
+
prefix,
|
|
51
|
+
...(type ? { type } : {}),
|
|
52
|
+
limit,
|
|
53
|
+
}, { actor: c.get("actor"), tx: null, requestId: "" });
|
|
54
|
+
if (!result.ok) {
|
|
55
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
56
|
+
}
|
|
57
|
+
return c.json({ data: result.value });
|
|
58
|
+
});
|
|
59
|
+
return router;
|
|
60
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import type { Kernel } from "../../../runtime/kernel.js";
|
|
3
|
+
import { type AppEnv } from "../utils.js";
|
|
4
|
+
export declare function webhookRoutes(kernel: Kernel): OpenAPIHono<AppEnv, {}, "/">;
|
|
5
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/rest/routes/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,KAAK,MAAM,EAAqD,MAAM,aAAa,CAAC;AAE7F,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,gCAwC3C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { createWebhookEndpointRoute, listWebhookEndpointsRoute, deleteWebhookEndpointRoute } from "../schemas/webhooks.js";
|
|
3
|
+
import { mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils.js";
|
|
4
|
+
export function webhookRoutes(kernel) {
|
|
5
|
+
const router = new OpenAPIHono();
|
|
6
|
+
router.use("/*", requirePerm("webhooks:manage"));
|
|
7
|
+
// @ts-expect-error -- openapi handler union return type
|
|
8
|
+
router.openapi(createWebhookEndpointRoute, async (c) => {
|
|
9
|
+
const body = c.req.valid("json");
|
|
10
|
+
// Generate a default secret if none provided (Zod schema marks it optional for API convenience)
|
|
11
|
+
if (!body.secret) {
|
|
12
|
+
body.secret = `whsec_${crypto.randomUUID().replace(/-/g, "")}`;
|
|
13
|
+
}
|
|
14
|
+
const actor = c.get("actor");
|
|
15
|
+
const result = await kernel.services.webhooks.createEndpoint(body, actor);
|
|
16
|
+
if (!result.ok) {
|
|
17
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
18
|
+
}
|
|
19
|
+
return c.json({ data: result.value }, 201);
|
|
20
|
+
});
|
|
21
|
+
// @ts-expect-error -- openapi handler union return type
|
|
22
|
+
router.openapi(listWebhookEndpointsRoute, async (c) => {
|
|
23
|
+
const result = await kernel.services.webhooks.listEndpoints();
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
26
|
+
}
|
|
27
|
+
const sanitized = result.value.map(({ secret: _secret, ...rest }) => rest);
|
|
28
|
+
return c.json({ data: sanitized });
|
|
29
|
+
});
|
|
30
|
+
// @ts-expect-error -- openapi handler union return type
|
|
31
|
+
router.openapi(deleteWebhookEndpointRoute, async (c) => {
|
|
32
|
+
const result = await kernel.services.webhooks.deleteEndpoint(c.req.param("id"));
|
|
33
|
+
if (!result.ok) {
|
|
34
|
+
return c.json(mapErrorToResponse(result.error), mapErrorToStatus(result.error));
|
|
35
|
+
}
|
|
36
|
+
return c.json({ data: { deleted: true } });
|
|
37
|
+
});
|
|
38
|
+
return router;
|
|
39
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const listFailedJobsRoute: {
|
|
3
|
+
method: "get";
|
|
4
|
+
path: "/jobs/failed";
|
|
5
|
+
tags: string[];
|
|
6
|
+
summary: string;
|
|
7
|
+
request: {
|
|
8
|
+
query: z.ZodObject<{
|
|
9
|
+
limit: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
};
|
|
12
|
+
responses: {
|
|
13
|
+
200: {
|
|
14
|
+
content: {
|
|
15
|
+
"application/json": {
|
|
16
|
+
schema: z.ZodObject<{
|
|
17
|
+
data: z.ZodArray<import("drizzle-zod").BuildSchema<"select", {
|
|
18
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
19
|
+
name: "id";
|
|
20
|
+
tableName: "commerce_jobs";
|
|
21
|
+
dataType: "string";
|
|
22
|
+
columnType: "PgUUID";
|
|
23
|
+
data: string;
|
|
24
|
+
driverParam: string;
|
|
25
|
+
notNull: true;
|
|
26
|
+
hasDefault: true;
|
|
27
|
+
isPrimaryKey: true;
|
|
28
|
+
isAutoincrement: false;
|
|
29
|
+
hasRuntimeDefault: false;
|
|
30
|
+
enumValues: undefined;
|
|
31
|
+
baseColumn: never;
|
|
32
|
+
identity: undefined;
|
|
33
|
+
generated: undefined;
|
|
34
|
+
}, {}, {}>;
|
|
35
|
+
organizationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
36
|
+
name: "organization_id";
|
|
37
|
+
tableName: "commerce_jobs";
|
|
38
|
+
dataType: "string";
|
|
39
|
+
columnType: "PgText";
|
|
40
|
+
data: string;
|
|
41
|
+
driverParam: string;
|
|
42
|
+
notNull: true;
|
|
43
|
+
hasDefault: false;
|
|
44
|
+
isPrimaryKey: false;
|
|
45
|
+
isAutoincrement: false;
|
|
46
|
+
hasRuntimeDefault: false;
|
|
47
|
+
enumValues: [string, ...string[]];
|
|
48
|
+
baseColumn: never;
|
|
49
|
+
identity: undefined;
|
|
50
|
+
generated: undefined;
|
|
51
|
+
}, {}, {}>;
|
|
52
|
+
queue: import("drizzle-orm/pg-core").PgColumn<{
|
|
53
|
+
name: "queue";
|
|
54
|
+
tableName: "commerce_jobs";
|
|
55
|
+
dataType: "string";
|
|
56
|
+
columnType: "PgText";
|
|
57
|
+
data: string;
|
|
58
|
+
driverParam: string;
|
|
59
|
+
notNull: true;
|
|
60
|
+
hasDefault: true;
|
|
61
|
+
isPrimaryKey: false;
|
|
62
|
+
isAutoincrement: false;
|
|
63
|
+
hasRuntimeDefault: false;
|
|
64
|
+
enumValues: [string, ...string[]];
|
|
65
|
+
baseColumn: never;
|
|
66
|
+
identity: undefined;
|
|
67
|
+
generated: undefined;
|
|
68
|
+
}, {}, {}>;
|
|
69
|
+
taskSlug: import("drizzle-orm/pg-core").PgColumn<{
|
|
70
|
+
name: "task_slug";
|
|
71
|
+
tableName: "commerce_jobs";
|
|
72
|
+
dataType: "string";
|
|
73
|
+
columnType: "PgText";
|
|
74
|
+
data: string;
|
|
75
|
+
driverParam: string;
|
|
76
|
+
notNull: true;
|
|
77
|
+
hasDefault: false;
|
|
78
|
+
isPrimaryKey: false;
|
|
79
|
+
isAutoincrement: false;
|
|
80
|
+
hasRuntimeDefault: false;
|
|
81
|
+
enumValues: [string, ...string[]];
|
|
82
|
+
baseColumn: never;
|
|
83
|
+
identity: undefined;
|
|
84
|
+
generated: undefined;
|
|
85
|
+
}, {}, {}>;
|
|
86
|
+
input: import("drizzle-orm/pg-core").PgColumn<{
|
|
87
|
+
name: "input";
|
|
88
|
+
tableName: "commerce_jobs";
|
|
89
|
+
dataType: "json";
|
|
90
|
+
columnType: "PgJsonb";
|
|
91
|
+
data: unknown;
|
|
92
|
+
driverParam: unknown;
|
|
93
|
+
notNull: true;
|
|
94
|
+
hasDefault: true;
|
|
95
|
+
isPrimaryKey: false;
|
|
96
|
+
isAutoincrement: false;
|
|
97
|
+
hasRuntimeDefault: false;
|
|
98
|
+
enumValues: undefined;
|
|
99
|
+
baseColumn: never;
|
|
100
|
+
identity: undefined;
|
|
101
|
+
generated: undefined;
|
|
102
|
+
}, {}, {}>;
|
|
103
|
+
output: import("drizzle-orm/pg-core").PgColumn<{
|
|
104
|
+
name: "output";
|
|
105
|
+
tableName: "commerce_jobs";
|
|
106
|
+
dataType: "json";
|
|
107
|
+
columnType: "PgJsonb";
|
|
108
|
+
data: unknown;
|
|
109
|
+
driverParam: unknown;
|
|
110
|
+
notNull: false;
|
|
111
|
+
hasDefault: false;
|
|
112
|
+
isPrimaryKey: false;
|
|
113
|
+
isAutoincrement: false;
|
|
114
|
+
hasRuntimeDefault: false;
|
|
115
|
+
enumValues: undefined;
|
|
116
|
+
baseColumn: never;
|
|
117
|
+
identity: undefined;
|
|
118
|
+
generated: undefined;
|
|
119
|
+
}, {}, {}>;
|
|
120
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
121
|
+
name: "status";
|
|
122
|
+
tableName: "commerce_jobs";
|
|
123
|
+
dataType: "string";
|
|
124
|
+
columnType: "PgText";
|
|
125
|
+
data: "pending" | "processing" | "succeeded" | "failed";
|
|
126
|
+
driverParam: string;
|
|
127
|
+
notNull: true;
|
|
128
|
+
hasDefault: true;
|
|
129
|
+
isPrimaryKey: false;
|
|
130
|
+
isAutoincrement: false;
|
|
131
|
+
hasRuntimeDefault: false;
|
|
132
|
+
enumValues: ["pending", "processing", "succeeded", "failed"];
|
|
133
|
+
baseColumn: never;
|
|
134
|
+
identity: undefined;
|
|
135
|
+
generated: undefined;
|
|
136
|
+
}, {}, {}>;
|
|
137
|
+
attempts: import("drizzle-orm/pg-core").PgColumn<{
|
|
138
|
+
name: "attempts";
|
|
139
|
+
tableName: "commerce_jobs";
|
|
140
|
+
dataType: "number";
|
|
141
|
+
columnType: "PgInteger";
|
|
142
|
+
data: number;
|
|
143
|
+
driverParam: string | number;
|
|
144
|
+
notNull: true;
|
|
145
|
+
hasDefault: true;
|
|
146
|
+
isPrimaryKey: false;
|
|
147
|
+
isAutoincrement: false;
|
|
148
|
+
hasRuntimeDefault: false;
|
|
149
|
+
enumValues: undefined;
|
|
150
|
+
baseColumn: never;
|
|
151
|
+
identity: undefined;
|
|
152
|
+
generated: undefined;
|
|
153
|
+
}, {}, {}>;
|
|
154
|
+
maxAttempts: import("drizzle-orm/pg-core").PgColumn<{
|
|
155
|
+
name: "max_attempts";
|
|
156
|
+
tableName: "commerce_jobs";
|
|
157
|
+
dataType: "number";
|
|
158
|
+
columnType: "PgInteger";
|
|
159
|
+
data: number;
|
|
160
|
+
driverParam: string | number;
|
|
161
|
+
notNull: true;
|
|
162
|
+
hasDefault: true;
|
|
163
|
+
isPrimaryKey: false;
|
|
164
|
+
isAutoincrement: false;
|
|
165
|
+
hasRuntimeDefault: false;
|
|
166
|
+
enumValues: undefined;
|
|
167
|
+
baseColumn: never;
|
|
168
|
+
identity: undefined;
|
|
169
|
+
generated: undefined;
|
|
170
|
+
}, {}, {}>;
|
|
171
|
+
error: import("drizzle-orm/pg-core").PgColumn<{
|
|
172
|
+
name: "error";
|
|
173
|
+
tableName: "commerce_jobs";
|
|
174
|
+
dataType: "string";
|
|
175
|
+
columnType: "PgText";
|
|
176
|
+
data: string;
|
|
177
|
+
driverParam: string;
|
|
178
|
+
notNull: false;
|
|
179
|
+
hasDefault: false;
|
|
180
|
+
isPrimaryKey: false;
|
|
181
|
+
isAutoincrement: false;
|
|
182
|
+
hasRuntimeDefault: false;
|
|
183
|
+
enumValues: [string, ...string[]];
|
|
184
|
+
baseColumn: never;
|
|
185
|
+
identity: undefined;
|
|
186
|
+
generated: undefined;
|
|
187
|
+
}, {}, {}>;
|
|
188
|
+
waitUntil: import("drizzle-orm/pg-core").PgColumn<{
|
|
189
|
+
name: "wait_until";
|
|
190
|
+
tableName: "commerce_jobs";
|
|
191
|
+
dataType: "date";
|
|
192
|
+
columnType: "PgTimestamp";
|
|
193
|
+
data: Date;
|
|
194
|
+
driverParam: string;
|
|
195
|
+
notNull: false;
|
|
196
|
+
hasDefault: false;
|
|
197
|
+
isPrimaryKey: false;
|
|
198
|
+
isAutoincrement: false;
|
|
199
|
+
hasRuntimeDefault: false;
|
|
200
|
+
enumValues: undefined;
|
|
201
|
+
baseColumn: never;
|
|
202
|
+
identity: undefined;
|
|
203
|
+
generated: undefined;
|
|
204
|
+
}, {}, {}>;
|
|
205
|
+
concurrencyKey: import("drizzle-orm/pg-core").PgColumn<{
|
|
206
|
+
name: "concurrency_key";
|
|
207
|
+
tableName: "commerce_jobs";
|
|
208
|
+
dataType: "string";
|
|
209
|
+
columnType: "PgText";
|
|
210
|
+
data: string;
|
|
211
|
+
driverParam: string;
|
|
212
|
+
notNull: false;
|
|
213
|
+
hasDefault: false;
|
|
214
|
+
isPrimaryKey: false;
|
|
215
|
+
isAutoincrement: false;
|
|
216
|
+
hasRuntimeDefault: false;
|
|
217
|
+
enumValues: [string, ...string[]];
|
|
218
|
+
baseColumn: never;
|
|
219
|
+
identity: undefined;
|
|
220
|
+
generated: undefined;
|
|
221
|
+
}, {}, {}>;
|
|
222
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
223
|
+
name: "created_at";
|
|
224
|
+
tableName: "commerce_jobs";
|
|
225
|
+
dataType: "date";
|
|
226
|
+
columnType: "PgTimestamp";
|
|
227
|
+
data: Date;
|
|
228
|
+
driverParam: string;
|
|
229
|
+
notNull: true;
|
|
230
|
+
hasDefault: true;
|
|
231
|
+
isPrimaryKey: false;
|
|
232
|
+
isAutoincrement: false;
|
|
233
|
+
hasRuntimeDefault: false;
|
|
234
|
+
enumValues: undefined;
|
|
235
|
+
baseColumn: never;
|
|
236
|
+
identity: undefined;
|
|
237
|
+
generated: undefined;
|
|
238
|
+
}, {}, {}>;
|
|
239
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
240
|
+
name: "updated_at";
|
|
241
|
+
tableName: "commerce_jobs";
|
|
242
|
+
dataType: "date";
|
|
243
|
+
columnType: "PgTimestamp";
|
|
244
|
+
data: Date;
|
|
245
|
+
driverParam: string;
|
|
246
|
+
notNull: true;
|
|
247
|
+
hasDefault: true;
|
|
248
|
+
isPrimaryKey: false;
|
|
249
|
+
isAutoincrement: false;
|
|
250
|
+
hasRuntimeDefault: false;
|
|
251
|
+
enumValues: undefined;
|
|
252
|
+
baseColumn: never;
|
|
253
|
+
identity: undefined;
|
|
254
|
+
generated: undefined;
|
|
255
|
+
}, {}, {}>;
|
|
256
|
+
processingStartedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
257
|
+
name: "processing_started_at";
|
|
258
|
+
tableName: "commerce_jobs";
|
|
259
|
+
dataType: "date";
|
|
260
|
+
columnType: "PgTimestamp";
|
|
261
|
+
data: Date;
|
|
262
|
+
driverParam: string;
|
|
263
|
+
notNull: false;
|
|
264
|
+
hasDefault: false;
|
|
265
|
+
isPrimaryKey: false;
|
|
266
|
+
isAutoincrement: false;
|
|
267
|
+
hasRuntimeDefault: false;
|
|
268
|
+
enumValues: undefined;
|
|
269
|
+
baseColumn: never;
|
|
270
|
+
identity: undefined;
|
|
271
|
+
generated: undefined;
|
|
272
|
+
}, {}, {}>;
|
|
273
|
+
completedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
274
|
+
name: "completed_at";
|
|
275
|
+
tableName: "commerce_jobs";
|
|
276
|
+
dataType: "date";
|
|
277
|
+
columnType: "PgTimestamp";
|
|
278
|
+
data: Date;
|
|
279
|
+
driverParam: string;
|
|
280
|
+
notNull: false;
|
|
281
|
+
hasDefault: false;
|
|
282
|
+
isPrimaryKey: false;
|
|
283
|
+
isAutoincrement: false;
|
|
284
|
+
hasRuntimeDefault: false;
|
|
285
|
+
enumValues: undefined;
|
|
286
|
+
baseColumn: never;
|
|
287
|
+
identity: undefined;
|
|
288
|
+
generated: undefined;
|
|
289
|
+
}, {}, {}>;
|
|
290
|
+
}, undefined, undefined>>;
|
|
291
|
+
}, z.core.$strip>;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
description: string;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
} & {
|
|
298
|
+
getRoutingPath(): "/jobs/failed";
|
|
299
|
+
};
|
|
300
|
+
export declare const retryJobRoute: {
|
|
301
|
+
method: "post";
|
|
302
|
+
path: "/jobs/{id}/retry";
|
|
303
|
+
tags: string[];
|
|
304
|
+
summary: string;
|
|
305
|
+
request: {
|
|
306
|
+
params: z.ZodObject<{
|
|
307
|
+
id: z.ZodString;
|
|
308
|
+
}, z.core.$strip>;
|
|
309
|
+
};
|
|
310
|
+
responses: {
|
|
311
|
+
200: {
|
|
312
|
+
content: {
|
|
313
|
+
"application/json": {
|
|
314
|
+
schema: z.ZodObject<{
|
|
315
|
+
data: z.ZodObject<{
|
|
316
|
+
retried: z.ZodLiteral<true>;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
}, z.core.$strip>;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
description: string;
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
} & {
|
|
325
|
+
getRoutingPath(): "/jobs/:id/retry";
|
|
326
|
+
};
|
|
327
|
+
//# sourceMappingURL=admin-jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-jobs.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/rest/schemas/admin-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAKnD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB9B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBxB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z, createRoute } from "@hono/zod-openapi";
|
|
2
|
+
import { JobListResponse } from "./responses.js";
|
|
3
|
+
// ─── Route Definitions ──────────────────────────────────────────────────────
|
|
4
|
+
export const listFailedJobsRoute = createRoute({
|
|
5
|
+
method: "get",
|
|
6
|
+
path: "/jobs/failed",
|
|
7
|
+
tags: ["Admin Jobs"],
|
|
8
|
+
summary: "List failed jobs",
|
|
9
|
+
request: {
|
|
10
|
+
query: z.object({
|
|
11
|
+
limit: z.string().optional(),
|
|
12
|
+
}),
|
|
13
|
+
},
|
|
14
|
+
responses: {
|
|
15
|
+
200: {
|
|
16
|
+
content: { "application/json": { schema: JobListResponse } },
|
|
17
|
+
description: "Failed jobs",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
export const retryJobRoute = createRoute({
|
|
22
|
+
method: "post",
|
|
23
|
+
path: "/jobs/{id}/retry",
|
|
24
|
+
tags: ["Admin Jobs"],
|
|
25
|
+
summary: "Retry a failed job",
|
|
26
|
+
request: {
|
|
27
|
+
params: z.object({
|
|
28
|
+
id: z.string().min(1).openapi({ example: "job-uuid" }),
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
responses: {
|
|
32
|
+
200: {
|
|
33
|
+
content: { "application/json": { schema: z.object({ data: z.object({ retried: z.literal(true) }) }) } },
|
|
34
|
+
description: "Job retried",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|