@harrylabsj/kiwi-merchant-cloud 0.12.0
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/app/a2a/client/client.d.ts +38 -0
- package/app/a2a/client/client.js +195 -0
- package/app/a2a/client/client.js.map +1 -0
- package/app/a2a/client/error.d.ts +35 -0
- package/app/a2a/client/error.js +34 -0
- package/app/a2a/client/error.js.map +1 -0
- package/app/a2a/client/index.d.ts +29 -0
- package/app/a2a/client/index.js +26 -0
- package/app/a2a/client/index.js.map +1 -0
- package/app/a2a/client/jsonrpc.d.ts +49 -0
- package/app/a2a/client/jsonrpc.js +86 -0
- package/app/a2a/client/jsonrpc.js.map +1 -0
- package/app/a2a/client/parse.d.ts +18 -0
- package/app/a2a/client/parse.js +158 -0
- package/app/a2a/client/parse.js.map +1 -0
- package/app/a2a/client/types.d.ts +113 -0
- package/app/a2a/client/types.js +26 -0
- package/app/a2a/client/types.js.map +1 -0
- package/app/a2a/client/url-policy.d.ts +51 -0
- package/app/a2a/client/url-policy.js +325 -0
- package/app/a2a/client/url-policy.js.map +1 -0
- package/app/a2a/clock.d.ts +30 -0
- package/app/a2a/clock.js +39 -0
- package/app/a2a/clock.js.map +1 -0
- package/app/a2a/negotiate.d.ts +96 -0
- package/app/a2a/negotiate.js +326 -0
- package/app/a2a/negotiate.js.map +1 -0
- package/app/a2a/node.d.ts +175 -0
- package/app/a2a/node.js +641 -0
- package/app/a2a/node.js.map +1 -0
- package/app/a2a/server/auth.d.ts +38 -0
- package/app/a2a/server/auth.js +121 -0
- package/app/a2a/server/auth.js.map +1 -0
- package/app/a2a/server/card.d.ts +25 -0
- package/app/a2a/server/card.js +135 -0
- package/app/a2a/server/card.js.map +1 -0
- package/app/a2a/server/errors.d.ts +127 -0
- package/app/a2a/server/errors.js +197 -0
- package/app/a2a/server/errors.js.map +1 -0
- package/app/a2a/server/generic-responder.d.ts +48 -0
- package/app/a2a/server/generic-responder.js +57 -0
- package/app/a2a/server/generic-responder.js.map +1 -0
- package/app/a2a/server/handler.d.ts +22 -0
- package/app/a2a/server/handler.js +57 -0
- package/app/a2a/server/handler.js.map +1 -0
- package/app/a2a/server/inbound-message.d.ts +37 -0
- package/app/a2a/server/inbound-message.js +104 -0
- package/app/a2a/server/inbound-message.js.map +1 -0
- package/app/a2a/server/index.d.ts +46 -0
- package/app/a2a/server/index.js +44 -0
- package/app/a2a/server/index.js.map +1 -0
- package/app/a2a/server/merchant-handler.d.ts +111 -0
- package/app/a2a/server/merchant-handler.js +993 -0
- package/app/a2a/server/merchant-handler.js.map +1 -0
- package/app/a2a/server/pipeline.d.ts +144 -0
- package/app/a2a/server/pipeline.js +561 -0
- package/app/a2a/server/pipeline.js.map +1 -0
- package/app/a2a/server/server.d.ts +101 -0
- package/app/a2a/server/server.js +800 -0
- package/app/a2a/server/server.js.map +1 -0
- package/app/a2a/server/task-registry.d.ts +59 -0
- package/app/a2a/server/task-registry.js +129 -0
- package/app/a2a/server/task-registry.js.map +1 -0
- package/app/a2a/server/throttle.d.ts +167 -0
- package/app/a2a/server/throttle.js +329 -0
- package/app/a2a/server/throttle.js.map +1 -0
- package/app/a2a/server/types.d.ts +234 -0
- package/app/a2a/server/types.js +17 -0
- package/app/a2a/server/types.js.map +1 -0
- package/app/a2a/server/ucp.d.ts +77 -0
- package/app/a2a/server/ucp.js +94 -0
- package/app/a2a/server/ucp.js.map +1 -0
- package/app/a2a/signing-key.d.ts +63 -0
- package/app/a2a/signing-key.js +191 -0
- package/app/a2a/signing-key.js.map +1 -0
- package/app/a2a/task/index.d.ts +24 -0
- package/app/a2a/task/index.js +22 -0
- package/app/a2a/task/index.js.map +1 -0
- package/app/a2a/task/ledger.d.ts +48 -0
- package/app/a2a/task/ledger.js +65 -0
- package/app/a2a/task/ledger.js.map +1 -0
- package/app/a2a/task/poller.d.ts +93 -0
- package/app/a2a/task/poller.js +184 -0
- package/app/a2a/task/poller.js.map +1 -0
- package/app/a2a/task/state.d.ts +72 -0
- package/app/a2a/task/state.js +119 -0
- package/app/a2a/task/state.js.map +1 -0
- package/app/a2a/ucp-agent.d.ts +49 -0
- package/app/a2a/ucp-agent.js +78 -0
- package/app/a2a/ucp-agent.js.map +1 -0
- package/app/a2a/v1/headers.d.ts +33 -0
- package/app/a2a/v1/headers.js +56 -0
- package/app/a2a/v1/headers.js.map +1 -0
- package/app/a2a/v1/methods.d.ts +52 -0
- package/app/a2a/v1/methods.js +75 -0
- package/app/a2a/v1/methods.js.map +1 -0
- package/app/a2a/v1/part.d.ts +48 -0
- package/app/a2a/v1/part.js +91 -0
- package/app/a2a/v1/part.js.map +1 -0
- package/app/a2a/v1/types.d.ts +94 -0
- package/app/a2a/v1/types.js +62 -0
- package/app/a2a/v1/types.js.map +1 -0
- package/app/agent/agent-db.d.ts +31 -0
- package/app/agent/agent-db.js +96 -0
- package/app/agent/agent-db.js.map +1 -0
- package/app/agent/buyer/buyer-tools.d.ts +82 -0
- package/app/agent/buyer/buyer-tools.js +1582 -0
- package/app/agent/buyer/buyer-tools.js.map +1 -0
- package/app/agent/buyer/ranker.d.ts +53 -0
- package/app/agent/buyer/ranker.js +153 -0
- package/app/agent/buyer/ranker.js.map +1 -0
- package/app/agent/buyer/scheduler.d.ts +67 -0
- package/app/agent/buyer/scheduler.js +329 -0
- package/app/agent/buyer/scheduler.js.map +1 -0
- package/app/agent/buyer/search-loop.d.ts +45 -0
- package/app/agent/buyer/search-loop.js +428 -0
- package/app/agent/buyer/search-loop.js.map +1 -0
- package/app/agent/buyer/task-store.d.ts +187 -0
- package/app/agent/buyer/task-store.js +656 -0
- package/app/agent/buyer/task-store.js.map +1 -0
- package/app/agent/buyer/types.d.ts +199 -0
- package/app/agent/buyer/types.js +127 -0
- package/app/agent/buyer/types.js.map +1 -0
- package/app/agent/chat-tools.d.ts +32 -0
- package/app/agent/chat-tools.js +200 -0
- package/app/agent/chat-tools.js.map +1 -0
- package/app/agent/chat-tui.d.ts +49 -0
- package/app/agent/chat-tui.js +314 -0
- package/app/agent/chat-tui.js.map +1 -0
- package/app/agent/connector/fake-connector.d.ts +50 -0
- package/app/agent/connector/fake-connector.js +138 -0
- package/app/agent/connector/fake-connector.js.map +1 -0
- package/app/agent/connector/http-connector.d.ts +49 -0
- package/app/agent/connector/http-connector.js +208 -0
- package/app/agent/connector/http-connector.js.map +1 -0
- package/app/agent/connector/types.d.ts +103 -0
- package/app/agent/connector/types.js +97 -0
- package/app/agent/connector/types.js.map +1 -0
- package/app/agent/context/fencing.d.ts +27 -0
- package/app/agent/context/fencing.js +126 -0
- package/app/agent/context/fencing.js.map +1 -0
- package/app/agent/context/grounding.d.ts +18 -0
- package/app/agent/context/grounding.js +22 -0
- package/app/agent/context/grounding.js.map +1 -0
- package/app/agent/fake-chat-model.d.ts +22 -0
- package/app/agent/fake-chat-model.js +132 -0
- package/app/agent/fake-chat-model.js.map +1 -0
- package/app/agent/host/events.d.ts +31 -0
- package/app/agent/host/events.js +62 -0
- package/app/agent/host/events.js.map +1 -0
- package/app/agent/host/tui-renderer.d.ts +17 -0
- package/app/agent/host/tui-renderer.js +125 -0
- package/app/agent/host/tui-renderer.js.map +1 -0
- package/app/agent/host/web-renderer.d.ts +76 -0
- package/app/agent/host/web-renderer.js +204 -0
- package/app/agent/host/web-renderer.js.map +1 -0
- package/app/agent/kernel-builder.d.ts +29 -0
- package/app/agent/kernel-builder.js +183 -0
- package/app/agent/kernel-builder.js.map +1 -0
- package/app/agent/kernel.d.ts +299 -0
- package/app/agent/kernel.js +1616 -0
- package/app/agent/kernel.js.map +1 -0
- package/app/agent/kiwi-tool.d.ts +33 -0
- package/app/agent/kiwi-tool.js +17 -0
- package/app/agent/kiwi-tool.js.map +1 -0
- package/app/agent/memory/schema.d.ts +32 -0
- package/app/agent/memory/schema.js +566 -0
- package/app/agent/memory/schema.js.map +1 -0
- package/app/agent/memory/store.d.ts +198 -0
- package/app/agent/memory/store.js +911 -0
- package/app/agent/memory/store.js.map +1 -0
- package/app/agent/memory/types.d.ts +139 -0
- package/app/agent/memory/types.js +119 -0
- package/app/agent/memory/types.js.map +1 -0
- package/app/agent/memory/vault.d.ts +49 -0
- package/app/agent/memory/vault.js +125 -0
- package/app/agent/memory/vault.js.map +1 -0
- package/app/agent/merchant/action-candidate.d.ts +137 -0
- package/app/agent/merchant/action-candidate.js +373 -0
- package/app/agent/merchant/action-candidate.js.map +1 -0
- package/app/agent/merchant/credential-broker.d.ts +67 -0
- package/app/agent/merchant/credential-broker.js +76 -0
- package/app/agent/merchant/credential-broker.js.map +1 -0
- package/app/agent/merchant/fake-merchant-client.d.ts +76 -0
- package/app/agent/merchant/fake-merchant-client.js +297 -0
- package/app/agent/merchant/fake-merchant-client.js.map +1 -0
- package/app/agent/merchant/intelligence/backend.d.ts +40 -0
- package/app/agent/merchant/intelligence/backend.js +2 -0
- package/app/agent/merchant/intelligence/backend.js.map +1 -0
- package/app/agent/merchant/intelligence/default-backend.d.ts +38 -0
- package/app/agent/merchant/intelligence/default-backend.js +477 -0
- package/app/agent/merchant/intelligence/default-backend.js.map +1 -0
- package/app/agent/merchant/intelligence/http-analytics-source.d.ts +55 -0
- package/app/agent/merchant/intelligence/http-analytics-source.js +193 -0
- package/app/agent/merchant/intelligence/http-analytics-source.js.map +1 -0
- package/app/agent/merchant/intelligence/types.d.ts +109 -0
- package/app/agent/merchant/intelligence/types.js +2 -0
- package/app/agent/merchant/intelligence/types.js.map +1 -0
- package/app/agent/merchant/merchant-client.d.ts +134 -0
- package/app/agent/merchant/merchant-client.js +460 -0
- package/app/agent/merchant/merchant-client.js.map +1 -0
- package/app/agent/merchant/merchant-enrichment.d.ts +10 -0
- package/app/agent/merchant/merchant-enrichment.js +38 -0
- package/app/agent/merchant/merchant-enrichment.js.map +1 -0
- package/app/agent/merchant/merchant-grounding.d.ts +5 -0
- package/app/agent/merchant/merchant-grounding.js +76 -0
- package/app/agent/merchant/merchant-grounding.js.map +1 -0
- package/app/agent/merchant/merchant-presentations.d.ts +8 -0
- package/app/agent/merchant/merchant-presentations.js +207 -0
- package/app/agent/merchant/merchant-presentations.js.map +1 -0
- package/app/agent/merchant/merchant-tools.d.ts +70 -0
- package/app/agent/merchant/merchant-tools.js +795 -0
- package/app/agent/merchant/merchant-tools.js.map +1 -0
- package/app/agent/merchant/types.d.ts +236 -0
- package/app/agent/merchant/types.js +252 -0
- package/app/agent/merchant/types.js.map +1 -0
- package/app/agent/mode.d.ts +32 -0
- package/app/agent/mode.js +34 -0
- package/app/agent/mode.js.map +1 -0
- package/app/agent/negotiation-chat.d.ts +93 -0
- package/app/agent/negotiation-chat.js +365 -0
- package/app/agent/negotiation-chat.js.map +1 -0
- package/app/agent/presentation/registry.d.ts +14 -0
- package/app/agent/presentation/registry.js +24 -0
- package/app/agent/presentation/registry.js.map +1 -0
- package/app/agent/presentation/runner.d.ts +11 -0
- package/app/agent/presentation/runner.js +17 -0
- package/app/agent/presentation/runner.js.map +1 -0
- package/app/agent/presentation/sanitize.d.ts +16 -0
- package/app/agent/presentation/sanitize.js +37 -0
- package/app/agent/presentation/sanitize.js.map +1 -0
- package/app/agent/presentation/types.d.ts +28 -0
- package/app/agent/presentation/types.js +8 -0
- package/app/agent/presentation/types.js.map +1 -0
- package/app/agent/session.d.ts +34 -0
- package/app/agent/session.js +156 -0
- package/app/agent/session.js.map +1 -0
- package/app/agent/skills/registry.d.ts +11 -0
- package/app/agent/skills/registry.js +119 -0
- package/app/agent/skills/registry.js.map +1 -0
- package/app/agent/skills/tools.d.ts +6 -0
- package/app/agent/skills/tools.js +36 -0
- package/app/agent/skills/tools.js.map +1 -0
- package/app/agent/skills/types.d.ts +9 -0
- package/app/agent/skills/types.js +2 -0
- package/app/agent/skills/types.js.map +1 -0
- package/app/agent/supplier/scheduler.d.ts +86 -0
- package/app/agent/supplier/scheduler.js +618 -0
- package/app/agent/supplier/scheduler.js.map +1 -0
- package/app/agent/supplier/store.d.ts +173 -0
- package/app/agent/supplier/store.js +387 -0
- package/app/agent/supplier/store.js.map +1 -0
- package/app/agent/system-prompt.d.ts +30 -0
- package/app/agent/system-prompt.js +94 -0
- package/app/agent/system-prompt.js.map +1 -0
- package/app/agent/write-gate.d.ts +102 -0
- package/app/agent/write-gate.js +82 -0
- package/app/agent/write-gate.js.map +1 -0
- package/app/alerts/external-delivery.d.ts +78 -0
- package/app/alerts/external-delivery.js +256 -0
- package/app/alerts/external-delivery.js.map +1 -0
- package/app/auth/app-oauth-callback.d.ts +38 -0
- package/app/auth/app-oauth-callback.js +119 -0
- package/app/auth/app-oauth-callback.js.map +1 -0
- package/app/auth/merchant-authorization.d.ts +49 -0
- package/app/auth/merchant-authorization.js +61 -0
- package/app/auth/merchant-authorization.js.map +1 -0
- package/app/auth/merchant-oauth.d.ts +255 -0
- package/app/auth/merchant-oauth.js +738 -0
- package/app/auth/merchant-oauth.js.map +1 -0
- package/app/auth/merchant-pairing.d.ts +113 -0
- package/app/auth/merchant-pairing.js +249 -0
- package/app/auth/merchant-pairing.js.map +1 -0
- package/app/auth/merchant-sessions.d.ts +77 -0
- package/app/auth/merchant-sessions.js +190 -0
- package/app/auth/merchant-sessions.js.map +1 -0
- package/app/buyer-core/a2a-knp.d.ts +71 -0
- package/app/buyer-core/a2a-knp.js +139 -0
- package/app/buyer-core/a2a-knp.js.map +1 -0
- package/app/buyer-core/a2a-negotiator.d.ts +37 -0
- package/app/buyer-core/a2a-negotiator.js +152 -0
- package/app/buyer-core/a2a-negotiator.js.map +1 -0
- package/app/buyer-core/a2a-quote-fetcher.d.ts +44 -0
- package/app/buyer-core/a2a-quote-fetcher.js +178 -0
- package/app/buyer-core/a2a-quote-fetcher.js.map +1 -0
- package/app/buyer-core/build-service.d.ts +51 -0
- package/app/buyer-core/build-service.js +96 -0
- package/app/buyer-core/build-service.js.map +1 -0
- package/app/buyer-core/errors.d.ts +31 -0
- package/app/buyer-core/errors.js +54 -0
- package/app/buyer-core/errors.js.map +1 -0
- package/app/buyer-core/merchant-index.d.ts +118 -0
- package/app/buyer-core/merchant-index.js +481 -0
- package/app/buyer-core/merchant-index.js.map +1 -0
- package/app/buyer-core/negotiator.d.ts +41 -0
- package/app/buyer-core/negotiator.js +192 -0
- package/app/buyer-core/negotiator.js.map +1 -0
- package/app/buyer-core/network-search.d.ts +92 -0
- package/app/buyer-core/network-search.js +144 -0
- package/app/buyer-core/network-search.js.map +1 -0
- package/app/buyer-core/product-summary.d.ts +71 -0
- package/app/buyer-core/product-summary.js +63 -0
- package/app/buyer-core/product-summary.js.map +1 -0
- package/app/buyer-core/quote-fetcher.d.ts +46 -0
- package/app/buyer-core/quote-fetcher.js +167 -0
- package/app/buyer-core/quote-fetcher.js.map +1 -0
- package/app/buyer-core/service.d.ts +359 -0
- package/app/buyer-core/service.js +700 -0
- package/app/buyer-core/service.js.map +1 -0
- package/app/buyer-core/store.d.ts +84 -0
- package/app/buyer-core/store.js +256 -0
- package/app/buyer-core/store.js.map +1 -0
- package/app/cli.d.ts +97 -0
- package/app/cli.js +2330 -0
- package/app/cli.js.map +1 -0
- package/app/cloud/binding/audit.d.ts +72 -0
- package/app/cloud/binding/audit.js +137 -0
- package/app/cloud/binding/audit.js.map +1 -0
- package/app/cloud/binding/enrollment-challenge.d.ts +37 -0
- package/app/cloud/binding/enrollment-challenge.js +153 -0
- package/app/cloud/binding/enrollment-challenge.js.map +1 -0
- package/app/cloud/binding/enrollment-heartbeat.d.ts +26 -0
- package/app/cloud/binding/enrollment-heartbeat.js +146 -0
- package/app/cloud/binding/enrollment-heartbeat.js.map +1 -0
- package/app/cloud/binding/enrollment-key-recovery.d.ts +27 -0
- package/app/cloud/binding/enrollment-key-recovery.js +127 -0
- package/app/cloud/binding/enrollment-key-recovery.js.map +1 -0
- package/app/cloud/binding/issuance.d.ts +76 -0
- package/app/cloud/binding/issuance.js +121 -0
- package/app/cloud/binding/issuance.js.map +1 -0
- package/app/cloud/binding/proofs.d.ts +110 -0
- package/app/cloud/binding/proofs.js +200 -0
- package/app/cloud/binding/proofs.js.map +1 -0
- package/app/cloud/binding/runtime-challenge.d.ts +48 -0
- package/app/cloud/binding/runtime-challenge.js +185 -0
- package/app/cloud/binding/runtime-challenge.js.map +1 -0
- package/app/cloud/bootstrap.d.ts +63 -0
- package/app/cloud/bootstrap.js +1161 -0
- package/app/cloud/bootstrap.js.map +1 -0
- package/app/cloud/catalog-client.d.ts +305 -0
- package/app/cloud/catalog-client.js +962 -0
- package/app/cloud/catalog-client.js.map +1 -0
- package/app/cloud/config.d.ts +103 -0
- package/app/cloud/config.js +274 -0
- package/app/cloud/config.js.map +1 -0
- package/app/cloud/http-router.d.ts +63 -0
- package/app/cloud/http-router.js +135 -0
- package/app/cloud/http-router.js.map +1 -0
- package/app/cloud/listing-publisher.d.ts +45 -0
- package/app/cloud/listing-publisher.js +244 -0
- package/app/cloud/listing-publisher.js.map +1 -0
- package/app/cloud/main.d.ts +16 -0
- package/app/cloud/main.js +64 -0
- package/app/cloud/main.js.map +1 -0
- package/app/cloud/merchant-connect.d.ts +47 -0
- package/app/cloud/merchant-connect.js +331 -0
- package/app/cloud/merchant-connect.js.map +1 -0
- package/app/cloud/merchant-identity.d.ts +14 -0
- package/app/cloud/merchant-identity.js +76 -0
- package/app/cloud/merchant-identity.js.map +1 -0
- package/app/cloud/onboarding/catalog-pipeline.d.ts +135 -0
- package/app/cloud/onboarding/catalog-pipeline.js +454 -0
- package/app/cloud/onboarding/catalog-pipeline.js.map +1 -0
- package/app/cloud/onboarding/local-fallback.d.ts +86 -0
- package/app/cloud/onboarding/local-fallback.js +98 -0
- package/app/cloud/onboarding/local-fallback.js.map +1 -0
- package/app/cloud/onboarding/steps.d.ts +95 -0
- package/app/cloud/onboarding/steps.js +175 -0
- package/app/cloud/onboarding/steps.js.map +1 -0
- package/app/cloud/onboarding/store.d.ts +136 -0
- package/app/cloud/onboarding/store.js +472 -0
- package/app/cloud/onboarding/store.js.map +1 -0
- package/app/cloud/onboarding/types.d.ts +132 -0
- package/app/cloud/onboarding/types.js +152 -0
- package/app/cloud/onboarding/types.js.map +1 -0
- package/app/cloud/product-import-tabular.d.ts +100 -0
- package/app/cloud/product-import-tabular.js +1073 -0
- package/app/cloud/product-import-tabular.js.map +1 -0
- package/app/cloud/product-source.d.ts +104 -0
- package/app/cloud/product-source.js +276 -0
- package/app/cloud/product-source.js.map +1 -0
- package/app/cloud/readiness.d.ts +49 -0
- package/app/cloud/readiness.js +54 -0
- package/app/cloud/readiness.js.map +1 -0
- package/app/cloud-sample/merchant.yaml +27 -0
- package/app/cloud-sample/products.json +22 -0
- package/app/commerce/data-source.d.ts +107 -0
- package/app/commerce/data-source.js +25 -0
- package/app/commerce/data-source.js.map +1 -0
- package/app/commerce/fake-client.d.ts +167 -0
- package/app/commerce/fake-client.js +549 -0
- package/app/commerce/fake-client.js.map +1 -0
- package/app/commerce/http-client.d.ts +73 -0
- package/app/commerce/http-client.js +288 -0
- package/app/commerce/http-client.js.map +1 -0
- package/app/commerce/shopping-cli-source.d.ts +57 -0
- package/app/commerce/shopping-cli-source.js +234 -0
- package/app/commerce/shopping-cli-source.js.map +1 -0
- package/app/commerce/types.d.ts +146 -0
- package/app/commerce/types.js +31 -0
- package/app/commerce/types.js.map +1 -0
- package/app/config/profile.d.ts +225 -0
- package/app/config/profile.js +654 -0
- package/app/config/profile.js.map +1 -0
- package/app/config/provider-kind.d.ts +26 -0
- package/app/config/provider-kind.js +19 -0
- package/app/config/provider-kind.js.map +1 -0
- package/app/contracts/cloud-contracts.d.ts +23 -0
- package/app/contracts/cloud-contracts.js +90 -0
- package/app/contracts/cloud-contracts.js.map +1 -0
- package/app/contracts/negotiation-schema.d.ts +28 -0
- package/app/contracts/negotiation-schema.js +101 -0
- package/app/contracts/negotiation-schema.js.map +1 -0
- package/app/contracts/northbound-schema.d.ts +27 -0
- package/app/contracts/northbound-schema.js +102 -0
- package/app/contracts/northbound-schema.js.map +1 -0
- package/app/contracts/schemas.d.ts +31 -0
- package/app/contracts/schemas.js +122 -0
- package/app/contracts/schemas.js.map +1 -0
- package/app/counterparty/a2a-direct/index.d.ts +57 -0
- package/app/counterparty/a2a-direct/index.js +378 -0
- package/app/counterparty/a2a-direct/index.js.map +1 -0
- package/app/counterparty/channel.d.ts +200 -0
- package/app/counterparty/channel.js +61 -0
- package/app/counterparty/channel.js.map +1 -0
- package/app/counterparty/index.d.ts +28 -0
- package/app/counterparty/index.js +24 -0
- package/app/counterparty/index.js.map +1 -0
- package/app/counterparty/platform-api/index.d.ts +41 -0
- package/app/counterparty/platform-api/index.js +65 -0
- package/app/counterparty/platform-api/index.js.map +1 -0
- package/app/counterparty/registry.d.ts +53 -0
- package/app/counterparty/registry.js +73 -0
- package/app/counterparty/registry.js.map +1 -0
- package/app/counterparty/shopping-cli-hosted/index.d.ts +39 -0
- package/app/counterparty/shopping-cli-hosted/index.js +377 -0
- package/app/counterparty/shopping-cli-hosted/index.js.map +1 -0
- package/app/demo/demo-runner.d.ts +81 -0
- package/app/demo/demo-runner.js +445 -0
- package/app/demo/demo-runner.js.map +1 -0
- package/app/discovery/agent-card/error.d.ts +28 -0
- package/app/discovery/agent-card/error.js +31 -0
- package/app/discovery/agent-card/error.js.map +1 -0
- package/app/discovery/agent-card/extensions.d.ts +20 -0
- package/app/discovery/agent-card/extensions.js +59 -0
- package/app/discovery/agent-card/extensions.js.map +1 -0
- package/app/discovery/agent-card/index.d.ts +29 -0
- package/app/discovery/agent-card/index.js +38 -0
- package/app/discovery/agent-card/index.js.map +1 -0
- package/app/discovery/agent-card/secrets.d.ts +30 -0
- package/app/discovery/agent-card/secrets.js +240 -0
- package/app/discovery/agent-card/secrets.js.map +1 -0
- package/app/discovery/agent-card/types.d.ts +113 -0
- package/app/discovery/agent-card/types.js +37 -0
- package/app/discovery/agent-card/types.js.map +1 -0
- package/app/discovery/agent-card/validate.d.ts +31 -0
- package/app/discovery/agent-card/validate.js +217 -0
- package/app/discovery/agent-card/validate.js.map +1 -0
- package/app/discovery/capability/error.d.ts +23 -0
- package/app/discovery/capability/error.js +28 -0
- package/app/discovery/capability/error.js.map +1 -0
- package/app/discovery/capability/index.d.ts +21 -0
- package/app/discovery/capability/index.js +21 -0
- package/app/discovery/capability/index.js.map +1 -0
- package/app/discovery/capability/intersect.d.ts +56 -0
- package/app/discovery/capability/intersect.js +137 -0
- package/app/discovery/capability/intersect.js.map +1 -0
- package/app/discovery/catalog-source/buyer-follows.d.ts +82 -0
- package/app/discovery/catalog-source/buyer-follows.js +228 -0
- package/app/discovery/catalog-source/buyer-follows.js.map +1 -0
- package/app/discovery/catalog-source/cloud-card.d.ts +184 -0
- package/app/discovery/catalog-source/cloud-card.js +385 -0
- package/app/discovery/catalog-source/cloud-card.js.map +1 -0
- package/app/discovery/catalog-source/cloud-hosting.d.ts +71 -0
- package/app/discovery/catalog-source/cloud-hosting.js +70 -0
- package/app/discovery/catalog-source/cloud-hosting.js.map +1 -0
- package/app/discovery/catalog-source/connector-identity.d.ts +75 -0
- package/app/discovery/catalog-source/connector-identity.js +175 -0
- package/app/discovery/catalog-source/connector-identity.js.map +1 -0
- package/app/discovery/catalog-source/errors.d.ts +42 -0
- package/app/discovery/catalog-source/errors.js +56 -0
- package/app/discovery/catalog-source/errors.js.map +1 -0
- package/app/discovery/catalog-source/index.d.ts +32 -0
- package/app/discovery/catalog-source/index.js +31 -0
- package/app/discovery/catalog-source/index.js.map +1 -0
- package/app/discovery/catalog-source/kiwi-record.d.ts +190 -0
- package/app/discovery/catalog-source/kiwi-record.js +72 -0
- package/app/discovery/catalog-source/kiwi-record.js.map +1 -0
- package/app/discovery/catalog-source/kiwi-schema.d.ts +33 -0
- package/app/discovery/catalog-source/kiwi-schema.js +106 -0
- package/app/discovery/catalog-source/kiwi-schema.js.map +1 -0
- package/app/discovery/catalog-source/kiwi-source.d.ts +38 -0
- package/app/discovery/catalog-source/kiwi-source.js +335 -0
- package/app/discovery/catalog-source/kiwi-source.js.map +1 -0
- package/app/discovery/catalog-source/merchant-publications.d.ts +65 -0
- package/app/discovery/catalog-source/merchant-publications.js +212 -0
- package/app/discovery/catalog-source/merchant-publications.js.map +1 -0
- package/app/discovery/catalog-source/register.d.ts +82 -0
- package/app/discovery/catalog-source/register.js +159 -0
- package/app/discovery/catalog-source/register.js.map +1 -0
- package/app/discovery/catalog-source/schema.d.ts +21 -0
- package/app/discovery/catalog-source/schema.js +63 -0
- package/app/discovery/catalog-source/schema.js.map +1 -0
- package/app/discovery/catalog-source/source.d.ts +47 -0
- package/app/discovery/catalog-source/source.js +202 -0
- package/app/discovery/catalog-source/source.js.map +1 -0
- package/app/discovery/catalog-source/types.d.ts +122 -0
- package/app/discovery/catalog-source/types.js +30 -0
- package/app/discovery/catalog-source/types.js.map +1 -0
- package/app/discovery/index.d.ts +25 -0
- package/app/discovery/index.js +25 -0
- package/app/discovery/index.js.map +1 -0
- package/app/discovery/merchant-subscriptions.d.ts +45 -0
- package/app/discovery/merchant-subscriptions.js +319 -0
- package/app/discovery/merchant-subscriptions.js.map +1 -0
- package/app/discovery/resolve.d.ts +230 -0
- package/app/discovery/resolve.js +487 -0
- package/app/discovery/resolve.js.map +1 -0
- package/app/discovery/ucp/error.d.ts +25 -0
- package/app/discovery/ucp/error.js +27 -0
- package/app/discovery/ucp/error.js.map +1 -0
- package/app/discovery/ucp/index.d.ts +33 -0
- package/app/discovery/ucp/index.js +28 -0
- package/app/discovery/ucp/index.js.map +1 -0
- package/app/discovery/ucp/intersect.d.ts +148 -0
- package/app/discovery/ucp/intersect.js +312 -0
- package/app/discovery/ucp/intersect.js.map +1 -0
- package/app/discovery/ucp/resolver.d.ts +69 -0
- package/app/discovery/ucp/resolver.js +243 -0
- package/app/discovery/ucp/resolver.js.map +1 -0
- package/app/discovery/ucp/types.d.ts +97 -0
- package/app/discovery/ucp/types.js +103 -0
- package/app/discovery/ucp/types.js.map +1 -0
- package/app/discovery/ucp/validate.d.ts +38 -0
- package/app/discovery/ucp/validate.js +232 -0
- package/app/discovery/ucp/validate.js.map +1 -0
- package/app/discovery/ucp/vendor.d.ts +60 -0
- package/app/discovery/ucp/vendor.js +61 -0
- package/app/discovery/ucp/vendor.js.map +1 -0
- package/app/doctor.d.ts +26 -0
- package/app/doctor.js +113 -0
- package/app/doctor.js.map +1 -0
- package/app/exit-codes.d.ts +26 -0
- package/app/exit-codes.js +27 -0
- package/app/exit-codes.js.map +1 -0
- package/app/fanout/disclosure.d.ts +138 -0
- package/app/fanout/disclosure.js +188 -0
- package/app/fanout/disclosure.js.map +1 -0
- package/app/fanout/index.d.ts +32 -0
- package/app/fanout/index.js +30 -0
- package/app/fanout/index.js.map +1 -0
- package/app/fanout/orchestrator.d.ts +155 -0
- package/app/fanout/orchestrator.js +442 -0
- package/app/fanout/orchestrator.js.map +1 -0
- package/app/fanout/policy.d.ts +128 -0
- package/app/fanout/policy.js +130 -0
- package/app/fanout/policy.js.map +1 -0
- package/app/fs/atomic-write.d.ts +18 -0
- package/app/fs/atomic-write.js +29 -0
- package/app/fs/atomic-write.js.map +1 -0
- package/app/handoff/acp-commerce.d.ts +58 -0
- package/app/handoff/acp-commerce.js +69 -0
- package/app/handoff/acp-commerce.js.map +1 -0
- package/app/handoff/authorization.d.ts +127 -0
- package/app/handoff/authorization.js +107 -0
- package/app/handoff/authorization.js.map +1 -0
- package/app/handoff/candidate.d.ts +94 -0
- package/app/handoff/candidate.js +172 -0
- package/app/handoff/candidate.js.map +1 -0
- package/app/handoff/channel.d.ts +88 -0
- package/app/handoff/channel.js +189 -0
- package/app/handoff/channel.js.map +1 -0
- package/app/handoff/completion.d.ts +44 -0
- package/app/handoff/completion.js +136 -0
- package/app/handoff/completion.js.map +1 -0
- package/app/handoff/delivery.d.ts +61 -0
- package/app/handoff/delivery.js +190 -0
- package/app/handoff/delivery.js.map +1 -0
- package/app/handoff/destination.d.ts +39 -0
- package/app/handoff/destination.js +110 -0
- package/app/handoff/destination.js.map +1 -0
- package/app/handoff/errors.d.ts +34 -0
- package/app/handoff/errors.js +48 -0
- package/app/handoff/errors.js.map +1 -0
- package/app/handoff/idempotency.d.ts +60 -0
- package/app/handoff/idempotency.js +178 -0
- package/app/handoff/idempotency.js.map +1 -0
- package/app/handoff/index.d.ts +46 -0
- package/app/handoff/index.js +48 -0
- package/app/handoff/index.js.map +1 -0
- package/app/handoff/ledger.d.ts +104 -0
- package/app/handoff/ledger.js +282 -0
- package/app/handoff/ledger.js.map +1 -0
- package/app/handoff/lifecycle.d.ts +29 -0
- package/app/handoff/lifecycle.js +102 -0
- package/app/handoff/lifecycle.js.map +1 -0
- package/app/handoff/metrics.d.ts +56 -0
- package/app/handoff/metrics.js +78 -0
- package/app/handoff/metrics.js.map +1 -0
- package/app/handoff/operator-approval.d.ts +143 -0
- package/app/handoff/operator-approval.js +287 -0
- package/app/handoff/operator-approval.js.map +1 -0
- package/app/handoff/order-record.d.ts +104 -0
- package/app/handoff/order-record.js +257 -0
- package/app/handoff/order-record.js.map +1 -0
- package/app/handoff/package.d.ts +102 -0
- package/app/handoff/package.js +132 -0
- package/app/handoff/package.js.map +1 -0
- package/app/handoff/transaction.d.ts +115 -0
- package/app/handoff/transaction.js +314 -0
- package/app/handoff/transaction.js.map +1 -0
- package/app/handoff/ucp-checkout/cart-channel.d.ts +111 -0
- package/app/handoff/ucp-checkout/cart-channel.js +370 -0
- package/app/handoff/ucp-checkout/cart-channel.js.map +1 -0
- package/app/handoff/ucp-checkout/cart-parse.d.ts +22 -0
- package/app/handoff/ucp-checkout/cart-parse.js +102 -0
- package/app/handoff/ucp-checkout/cart-parse.js.map +1 -0
- package/app/handoff/ucp-checkout/cart-types.d.ts +93 -0
- package/app/handoff/ucp-checkout/cart-types.js +38 -0
- package/app/handoff/ucp-checkout/cart-types.js.map +1 -0
- package/app/handoff/ucp-checkout/channel.d.ts +159 -0
- package/app/handoff/ucp-checkout/channel.js +641 -0
- package/app/handoff/ucp-checkout/channel.js.map +1 -0
- package/app/handoff/ucp-checkout/client.d.ts +88 -0
- package/app/handoff/ucp-checkout/client.js +228 -0
- package/app/handoff/ucp-checkout/client.js.map +1 -0
- package/app/handoff/ucp-checkout/endpoint.d.ts +36 -0
- package/app/handoff/ucp-checkout/endpoint.js +145 -0
- package/app/handoff/ucp-checkout/endpoint.js.map +1 -0
- package/app/handoff/ucp-checkout/index.d.ts +35 -0
- package/app/handoff/ucp-checkout/index.js +36 -0
- package/app/handoff/ucp-checkout/index.js.map +1 -0
- package/app/handoff/ucp-checkout/parse.d.ts +71 -0
- package/app/handoff/ucp-checkout/parse.js +349 -0
- package/app/handoff/ucp-checkout/parse.js.map +1 -0
- package/app/handoff/ucp-checkout/totals.d.ts +41 -0
- package/app/handoff/ucp-checkout/totals.js +36 -0
- package/app/handoff/ucp-checkout/totals.js.map +1 -0
- package/app/handoff/ucp-checkout/types.d.ts +149 -0
- package/app/handoff/ucp-checkout/types.js +58 -0
- package/app/handoff/ucp-checkout/types.js.map +1 -0
- package/app/handoff/url-safety.d.ts +44 -0
- package/app/handoff/url-safety.js +121 -0
- package/app/handoff/url-safety.js.map +1 -0
- package/app/http/cli.d.ts +16 -0
- package/app/http/cli.js +123 -0
- package/app/http/cli.js.map +1 -0
- package/app/http/merchant-engagement-api.d.ts +10 -0
- package/app/http/merchant-engagement-api.js +138 -0
- package/app/http/merchant-engagement-api.js.map +1 -0
- package/app/http/merchant-feed-api.d.ts +7 -0
- package/app/http/merchant-feed-api.js +129 -0
- package/app/http/merchant-feed-api.js.map +1 -0
- package/app/http/merchant-follow-api.d.ts +15 -0
- package/app/http/merchant-follow-api.js +192 -0
- package/app/http/merchant-follow-api.js.map +1 -0
- package/app/http/merchant-management/api.d.ts +258 -0
- package/app/http/merchant-management/api.js +3022 -0
- package/app/http/merchant-management/api.js.map +1 -0
- package/app/http/merchant-management/draft-store.d.ts +51 -0
- package/app/http/merchant-management/draft-store.js +95 -0
- package/app/http/merchant-management/draft-store.js.map +1 -0
- package/app/http/merchant-management/event-projection.d.ts +41 -0
- package/app/http/merchant-management/event-projection.js +190 -0
- package/app/http/merchant-management/event-projection.js.map +1 -0
- package/app/http/merchant-management/operation-store.d.ts +97 -0
- package/app/http/merchant-management/operation-store.js +252 -0
- package/app/http/merchant-management/operation-store.js.map +1 -0
- package/app/http/merchant-management/page.d.ts +29 -0
- package/app/http/merchant-management/page.js +641 -0
- package/app/http/merchant-management/page.js.map +1 -0
- package/app/http/merchant-management/problem-client.d.ts +19 -0
- package/app/http/merchant-management/problem-client.js +55 -0
- package/app/http/merchant-management/problem-client.js.map +1 -0
- package/app/http/merchant-management/problem.d.ts +74 -0
- package/app/http/merchant-management/problem.js +112 -0
- package/app/http/merchant-management/problem.js.map +1 -0
- package/app/http/merchant-management/reconciliation-worker.d.ts +95 -0
- package/app/http/merchant-management/reconciliation-worker.js +397 -0
- package/app/http/merchant-management/reconciliation-worker.js.map +1 -0
- package/app/http/merchant-management/service-state.d.ts +86 -0
- package/app/http/merchant-management/service-state.js +217 -0
- package/app/http/merchant-management/service-state.js.map +1 -0
- package/app/http/merchant-management/trusted-page.d.ts +3 -0
- package/app/http/merchant-management/trusted-page.js +73 -0
- package/app/http/merchant-management/trusted-page.js.map +1 -0
- package/app/http/merchant-management/webauthn-confirmation.d.ts +148 -0
- package/app/http/merchant-management/webauthn-confirmation.js +517 -0
- package/app/http/merchant-management/webauthn-confirmation.js.map +1 -0
- package/app/http/merchant-privacy-api.d.ts +9 -0
- package/app/http/merchant-privacy-api.js +96 -0
- package/app/http/merchant-privacy-api.js.map +1 -0
- package/app/http/merchant-server.d.ts +65 -0
- package/app/http/merchant-server.js +346 -0
- package/app/http/merchant-server.js.map +1 -0
- package/app/http/server.d.ts +39 -0
- package/app/http/server.js +300 -0
- package/app/http/server.js.map +1 -0
- package/app/i18n.d.ts +24 -0
- package/app/i18n.js +27 -0
- package/app/i18n.js.map +1 -0
- package/app/mcp/cli.d.ts +72 -0
- package/app/mcp/cli.js +153 -0
- package/app/mcp/cli.js.map +1 -0
- package/app/mcp/merchant-auth.d.ts +78 -0
- package/app/mcp/merchant-auth.js +146 -0
- package/app/mcp/merchant-auth.js.map +1 -0
- package/app/mcp/merchant-dirs.d.ts +26 -0
- package/app/mcp/merchant-dirs.js +44 -0
- package/app/mcp/merchant-dirs.js.map +1 -0
- package/app/mcp/merchant-resources.d.ts +38 -0
- package/app/mcp/merchant-resources.js +146 -0
- package/app/mcp/merchant-resources.js.map +1 -0
- package/app/mcp/merchant-rfq-resources.d.ts +37 -0
- package/app/mcp/merchant-rfq-resources.js +132 -0
- package/app/mcp/merchant-rfq-resources.js.map +1 -0
- package/app/mcp/merchant-rfq-tools.d.ts +61 -0
- package/app/mcp/merchant-rfq-tools.js +584 -0
- package/app/mcp/merchant-rfq-tools.js.map +1 -0
- package/app/mcp/merchant-runtime-assembly.d.ts +74 -0
- package/app/mcp/merchant-runtime-assembly.js +476 -0
- package/app/mcp/merchant-runtime-assembly.js.map +1 -0
- package/app/mcp/merchant-server.d.ts +171 -0
- package/app/mcp/merchant-server.js +852 -0
- package/app/mcp/merchant-server.js.map +1 -0
- package/app/mcp/merchant-tools.d.ts +103 -0
- package/app/mcp/merchant-tools.js +517 -0
- package/app/mcp/merchant-tools.js.map +1 -0
- package/app/mcp/server.d.ts +41 -0
- package/app/mcp/server.js +142 -0
- package/app/mcp/server.js.map +1 -0
- package/app/mcp/tools.d.ts +30 -0
- package/app/mcp/tools.js +426 -0
- package/app/mcp/tools.js.map +1 -0
- package/app/mcp/types.d.ts +107 -0
- package/app/mcp/types.js +56 -0
- package/app/mcp/types.js.map +1 -0
- package/app/merchant/application/actor.d.ts +85 -0
- package/app/merchant/application/actor.js +162 -0
- package/app/merchant/application/actor.js.map +1 -0
- package/app/merchant/application/money.d.ts +35 -0
- package/app/merchant/application/money.js +124 -0
- package/app/merchant/application/money.js.map +1 -0
- package/app/merchant/application/service.d.ts +228 -0
- package/app/merchant/application/service.js +262 -0
- package/app/merchant/application/service.js.map +1 -0
- package/app/merchant/clock-safety.d.ts +50 -0
- package/app/merchant/clock-safety.js +153 -0
- package/app/merchant/clock-safety.js.map +1 -0
- package/app/merchant/decision-backend.d.ts +82 -0
- package/app/merchant/decision-backend.js +272 -0
- package/app/merchant/decision-backend.js.map +1 -0
- package/app/merchant/engagement-store.d.ts +32 -0
- package/app/merchant/engagement-store.js +119 -0
- package/app/merchant/engagement-store.js.map +1 -0
- package/app/merchant/exact-product-executors.d.ts +11 -0
- package/app/merchant/exact-product-executors.js +132 -0
- package/app/merchant/exact-product-executors.js.map +1 -0
- package/app/merchant/feed-executors.d.ts +17 -0
- package/app/merchant/feed-executors.js +151 -0
- package/app/merchant/feed-executors.js.map +1 -0
- package/app/merchant/feed-store.d.ts +141 -0
- package/app/merchant/feed-store.js +496 -0
- package/app/merchant/feed-store.js.map +1 -0
- package/app/merchant/follow-store.d.ts +66 -0
- package/app/merchant/follow-store.js +295 -0
- package/app/merchant/follow-store.js.map +1 -0
- package/app/merchant/grant-executors.d.ts +11 -0
- package/app/merchant/grant-executors.js +136 -0
- package/app/merchant/grant-executors.js.map +1 -0
- package/app/merchant/grant-store.d.ts +125 -0
- package/app/merchant/grant-store.js +313 -0
- package/app/merchant/grant-store.js.map +1 -0
- package/app/merchant/inventory-executors.d.ts +47 -0
- package/app/merchant/inventory-executors.js +91 -0
- package/app/merchant/inventory-executors.js.map +1 -0
- package/app/merchant/listing-executors.d.ts +51 -0
- package/app/merchant/listing-executors.js +100 -0
- package/app/merchant/listing-executors.js.map +1 -0
- package/app/merchant/negotiation-observer.d.ts +92 -0
- package/app/merchant/negotiation-observer.js +278 -0
- package/app/merchant/negotiation-observer.js.map +1 -0
- package/app/merchant/operation-receipts.d.ts +57 -0
- package/app/merchant/operation-receipts.js +138 -0
- package/app/merchant/operation-receipts.js.map +1 -0
- package/app/merchant/operations-report.d.ts +85 -0
- package/app/merchant/operations-report.js +227 -0
- package/app/merchant/operations-report.js.map +1 -0
- package/app/merchant/ops.d.ts +69 -0
- package/app/merchant/ops.js +87 -0
- package/app/merchant/ops.js.map +1 -0
- package/app/merchant/promotion-broadcast-recovery.d.ts +22 -0
- package/app/merchant/promotion-broadcast-recovery.js +74 -0
- package/app/merchant/promotion-broadcast-recovery.js.map +1 -0
- package/app/merchant/promotion-broadcast-workflow.d.ts +42 -0
- package/app/merchant/promotion-broadcast-workflow.js +171 -0
- package/app/merchant/promotion-broadcast-workflow.js.map +1 -0
- package/app/merchant/promotion-executors.d.ts +18 -0
- package/app/merchant/promotion-executors.js +133 -0
- package/app/merchant/promotion-executors.js.map +1 -0
- package/app/merchant/promotion-store.d.ts +114 -0
- package/app/merchant/promotion-store.js +325 -0
- package/app/merchant/promotion-store.js.map +1 -0
- package/app/merchant/promotion-time.d.ts +19 -0
- package/app/merchant/promotion-time.js +162 -0
- package/app/merchant/promotion-time.js.map +1 -0
- package/app/merchant/quote-calculator.d.ts +32 -0
- package/app/merchant/quote-calculator.js +70 -0
- package/app/merchant/quote-calculator.js.map +1 -0
- package/app/merchant/service-control-executors.d.ts +15 -0
- package/app/merchant/service-control-executors.js +52 -0
- package/app/merchant/service-control-executors.js.map +1 -0
- package/app/merchant/stats-store.d.ts +86 -0
- package/app/merchant/stats-store.js +176 -0
- package/app/merchant/stats-store.js.map +1 -0
- package/app/merchant/ucp-profile.d.ts +39 -0
- package/app/merchant/ucp-profile.js +55 -0
- package/app/merchant/ucp-profile.js.map +1 -0
- package/app/merchant/workbench-service.d.ts +190 -0
- package/app/merchant/workbench-service.js +427 -0
- package/app/merchant/workbench-service.js.map +1 -0
- package/app/merchant-admin/pending-page.d.ts +139 -0
- package/app/merchant-admin/pending-page.js +89 -0
- package/app/merchant-admin/pending-page.js.map +1 -0
- package/app/merchant-admin/rfq-page.d.ts +105 -0
- package/app/merchant-admin/rfq-page.js +176 -0
- package/app/merchant-admin/rfq-page.js.map +1 -0
- package/app/merchant-core/commands.d.ts +126 -0
- package/app/merchant-core/commands.js +268 -0
- package/app/merchant-core/commands.js.map +1 -0
- package/app/merchant-core/executor.d.ts +93 -0
- package/app/merchant-core/executor.js +227 -0
- package/app/merchant-core/executor.js.map +1 -0
- package/app/merchant-core/negotiation-adapters.d.ts +55 -0
- package/app/merchant-core/negotiation-adapters.js +55 -0
- package/app/merchant-core/negotiation-adapters.js.map +1 -0
- package/app/merchant-core/network-checks.d.ts +65 -0
- package/app/merchant-core/network-checks.js +111 -0
- package/app/merchant-core/network-checks.js.map +1 -0
- package/app/merchant-core/operations.d.ts +64 -0
- package/app/merchant-core/operations.js +136 -0
- package/app/merchant-core/operations.js.map +1 -0
- package/app/merchant-core/policy-runtime.d.ts +70 -0
- package/app/merchant-core/policy-runtime.js +181 -0
- package/app/merchant-core/policy-runtime.js.map +1 -0
- package/app/merchant-core/product-import.d.ts +67 -0
- package/app/merchant-core/product-import.js +160 -0
- package/app/merchant-core/product-import.js.map +1 -0
- package/app/merchant-core/rfq/artifacts.d.ts +78 -0
- package/app/merchant-core/rfq/artifacts.js +219 -0
- package/app/merchant-core/rfq/artifacts.js.map +1 -0
- package/app/merchant-core/rfq/data-source-adapter.d.ts +49 -0
- package/app/merchant-core/rfq/data-source-adapter.js +128 -0
- package/app/merchant-core/rfq/data-source-adapter.js.map +1 -0
- package/app/merchant-core/rfq/delivery.d.ts +43 -0
- package/app/merchant-core/rfq/delivery.js +57 -0
- package/app/merchant-core/rfq/delivery.js.map +1 -0
- package/app/merchant-core/rfq/fact-resolver.d.ts +76 -0
- package/app/merchant-core/rfq/fact-resolver.js +220 -0
- package/app/merchant-core/rfq/fact-resolver.js.map +1 -0
- package/app/merchant-core/rfq/handoff.d.ts +54 -0
- package/app/merchant-core/rfq/handoff.js +71 -0
- package/app/merchant-core/rfq/handoff.js.map +1 -0
- package/app/merchant-core/rfq/policy.d.ts +77 -0
- package/app/merchant-core/rfq/policy.js +104 -0
- package/app/merchant-core/rfq/policy.js.map +1 -0
- package/app/merchant-core/rfq/pricing.d.ts +48 -0
- package/app/merchant-core/rfq/pricing.js +150 -0
- package/app/merchant-core/rfq/pricing.js.map +1 -0
- package/app/merchant-core/rfq/quote-revisions.d.ts +52 -0
- package/app/merchant-core/rfq/quote-revisions.js +126 -0
- package/app/merchant-core/rfq/quote-revisions.js.map +1 -0
- package/app/merchant-core/rfq/release-coordinator.d.ts +99 -0
- package/app/merchant-core/rfq/release-coordinator.js +355 -0
- package/app/merchant-core/rfq/release-coordinator.js.map +1 -0
- package/app/merchant-core/rfq/repository.d.ts +398 -0
- package/app/merchant-core/rfq/repository.js +855 -0
- package/app/merchant-core/rfq/repository.js.map +1 -0
- package/app/merchant-core/rfq/service.d.ts +398 -0
- package/app/merchant-core/rfq/service.js +1036 -0
- package/app/merchant-core/rfq/service.js.map +1 -0
- package/app/merchant-core/rfq/source-records.d.ts +97 -0
- package/app/merchant-core/rfq/source-records.js +349 -0
- package/app/merchant-core/rfq/source-records.js.map +1 -0
- package/app/merchant-core/rfq/types.d.ts +197 -0
- package/app/merchant-core/rfq/types.js +110 -0
- package/app/merchant-core/rfq/types.js.map +1 -0
- package/app/merchant-core/service.d.ts +320 -0
- package/app/merchant-core/service.js +597 -0
- package/app/merchant-core/service.js.map +1 -0
- package/app/merchant-core/storage/clock-skew-alerts.d.ts +21 -0
- package/app/merchant-core/storage/clock-skew-alerts.js +67 -0
- package/app/merchant-core/storage/clock-skew-alerts.js.map +1 -0
- package/app/merchant-core/storage/leased-job.d.ts +42 -0
- package/app/merchant-core/storage/leased-job.js +38 -0
- package/app/merchant-core/storage/leased-job.js.map +1 -0
- package/app/merchant-core/storage/operation-lifecycle.d.ts +78 -0
- package/app/merchant-core/storage/operation-lifecycle.js +111 -0
- package/app/merchant-core/storage/operation-lifecycle.js.map +1 -0
- package/app/merchant-core/storage/redact.d.ts +29 -0
- package/app/merchant-core/storage/redact.js +34 -0
- package/app/merchant-core/storage/redact.js.map +1 -0
- package/app/merchant-core/storage/schema.d.ts +24 -0
- package/app/merchant-core/storage/schema.js +22 -0
- package/app/merchant-core/storage/schema.js.map +1 -0
- package/app/merchant-core/storage/transaction.d.ts +47 -0
- package/app/merchant-core/storage/transaction.js +28 -0
- package/app/merchant-core/storage/transaction.js.map +1 -0
- package/app/merchant-gateway/catalog-publications.d.ts +124 -0
- package/app/merchant-gateway/catalog-publications.js +281 -0
- package/app/merchant-gateway/catalog-publications.js.map +1 -0
- package/app/merchant-gateway/catalog-tools.d.ts +46 -0
- package/app/merchant-gateway/catalog-tools.js +335 -0
- package/app/merchant-gateway/catalog-tools.js.map +1 -0
- package/app/merchant-gateway/cli.d.ts +75 -0
- package/app/merchant-gateway/cli.js +461 -0
- package/app/merchant-gateway/cli.js.map +1 -0
- package/app/merchant-gateway/credential-vault.d.ts +44 -0
- package/app/merchant-gateway/credential-vault.js +111 -0
- package/app/merchant-gateway/credential-vault.js.map +1 -0
- package/app/merchant-gateway/entry-server.d.ts +117 -0
- package/app/merchant-gateway/entry-server.js +757 -0
- package/app/merchant-gateway/entry-server.js.map +1 -0
- package/app/merchant-gateway/instance-registration.d.ts +144 -0
- package/app/merchant-gateway/instance-registration.js +391 -0
- package/app/merchant-gateway/instance-registration.js.map +1 -0
- package/app/merchant-gateway/instance-tools.d.ts +58 -0
- package/app/merchant-gateway/instance-tools.js +186 -0
- package/app/merchant-gateway/instance-tools.js.map +1 -0
- package/app/merchant-gateway/mcp-proxy.d.ts +25 -0
- package/app/merchant-gateway/mcp-proxy.js +192 -0
- package/app/merchant-gateway/mcp-proxy.js.map +1 -0
- package/app/merchant-gateway/pinned-fetch.d.ts +54 -0
- package/app/merchant-gateway/pinned-fetch.js +231 -0
- package/app/merchant-gateway/pinned-fetch.js.map +1 -0
- package/app/merchant-gateway/tenant-registry.d.ts +82 -0
- package/app/merchant-gateway/tenant-registry.js +190 -0
- package/app/merchant-gateway/tenant-registry.js.map +1 -0
- package/app/merchant-gateway/tool-bundle.d.ts +26 -0
- package/app/merchant-gateway/tool-bundle.js +56 -0
- package/app/merchant-gateway/tool-bundle.js.map +1 -0
- package/app/merchant-runtime/backup.d.ts +48 -0
- package/app/merchant-runtime/backup.js +226 -0
- package/app/merchant-runtime/backup.js.map +1 -0
- package/app/merchant-runtime/health.d.ts +99 -0
- package/app/merchant-runtime/health.js +206 -0
- package/app/merchant-runtime/health.js.map +1 -0
- package/app/merchant-runtime/jobs.d.ts +64 -0
- package/app/merchant-runtime/jobs.js +107 -0
- package/app/merchant-runtime/jobs.js.map +1 -0
- package/app/merchant-runtime/manager.d.ts +94 -0
- package/app/merchant-runtime/manager.js +305 -0
- package/app/merchant-runtime/manager.js.map +1 -0
- package/app/merchant-runtime/services.d.ts +30 -0
- package/app/merchant-runtime/services.js +51 -0
- package/app/merchant-runtime/services.js.map +1 -0
- package/app/negotiation/action-candidate.d.ts +97 -0
- package/app/negotiation/action-candidate.js +160 -0
- package/app/negotiation/action-candidate.js.map +1 -0
- package/app/negotiation/condition/evaluator.d.ts +36 -0
- package/app/negotiation/condition/evaluator.js +123 -0
- package/app/negotiation/condition/evaluator.js.map +1 -0
- package/app/negotiation/context-map/index.d.ts +23 -0
- package/app/negotiation/context-map/index.js +22 -0
- package/app/negotiation/context-map/index.js.map +1 -0
- package/app/negotiation/context-map/store.d.ts +51 -0
- package/app/negotiation/context-map/store.js +186 -0
- package/app/negotiation/context-map/store.js.map +1 -0
- package/app/negotiation/context-map/types.d.ts +29 -0
- package/app/negotiation/context-map/types.js +57 -0
- package/app/negotiation/context-map/types.js.map +1 -0
- package/app/negotiation/domain/common.d.ts +95 -0
- package/app/negotiation/domain/common.js +216 -0
- package/app/negotiation/domain/common.js.map +1 -0
- package/app/negotiation/domain/envelope.d.ts +55 -0
- package/app/negotiation/domain/envelope.js +110 -0
- package/app/negotiation/domain/envelope.js.map +1 -0
- package/app/negotiation/domain/identifiers.d.ts +65 -0
- package/app/negotiation/domain/identifiers.js +130 -0
- package/app/negotiation/domain/identifiers.js.map +1 -0
- package/app/negotiation/domain/objects.d.ts +156 -0
- package/app/negotiation/domain/objects.js +343 -0
- package/app/negotiation/domain/objects.js.map +1 -0
- package/app/negotiation/idempotency/index.d.ts +26 -0
- package/app/negotiation/idempotency/index.js +25 -0
- package/app/negotiation/idempotency/index.js.map +1 -0
- package/app/negotiation/idempotency/store.d.ts +75 -0
- package/app/negotiation/idempotency/store.js +260 -0
- package/app/negotiation/idempotency/store.js.map +1 -0
- package/app/negotiation/idempotency/types.d.ts +118 -0
- package/app/negotiation/idempotency/types.js +49 -0
- package/app/negotiation/idempotency/types.js.map +1 -0
- package/app/negotiation/jcs.d.ts +21 -0
- package/app/negotiation/jcs.js +117 -0
- package/app/negotiation/jcs.js.map +1 -0
- package/app/negotiation/lease/store.d.ts +21 -0
- package/app/negotiation/lease/store.js +175 -0
- package/app/negotiation/lease/store.js.map +1 -0
- package/app/negotiation/ledger/event.d.ts +148 -0
- package/app/negotiation/ledger/event.js +207 -0
- package/app/negotiation/ledger/event.js.map +1 -0
- package/app/negotiation/ledger/index.d.ts +28 -0
- package/app/negotiation/ledger/index.js +26 -0
- package/app/negotiation/ledger/index.js.map +1 -0
- package/app/negotiation/ledger/payload-segments.d.ts +51 -0
- package/app/negotiation/ledger/payload-segments.js +247 -0
- package/app/negotiation/ledger/payload-segments.js.map +1 -0
- package/app/negotiation/ledger/store.d.ts +131 -0
- package/app/negotiation/ledger/store.js +500 -0
- package/app/negotiation/ledger/store.js.map +1 -0
- package/app/negotiation/prompt.d.ts +34 -0
- package/app/negotiation/prompt.js +113 -0
- package/app/negotiation/prompt.js.map +1 -0
- package/app/negotiation/recovery/index.d.ts +26 -0
- package/app/negotiation/recovery/index.js +24 -0
- package/app/negotiation/recovery/index.js.map +1 -0
- package/app/negotiation/recovery/outbound.d.ts +49 -0
- package/app/negotiation/recovery/outbound.js +34 -0
- package/app/negotiation/recovery/outbound.js.map +1 -0
- package/app/negotiation/recovery/recover.d.ts +59 -0
- package/app/negotiation/recovery/recover.js +510 -0
- package/app/negotiation/recovery/recover.js.map +1 -0
- package/app/negotiation/recovery/types.d.ts +85 -0
- package/app/negotiation/recovery/types.js +17 -0
- package/app/negotiation/recovery/types.js.map +1 -0
- package/app/negotiation/state/phase.d.ts +70 -0
- package/app/negotiation/state/phase.js +220 -0
- package/app/negotiation/state/phase.js.map +1 -0
- package/app/negotiation/types.d.ts +139 -0
- package/app/negotiation/types.js +24 -0
- package/app/negotiation/types.js.map +1 -0
- package/app/net/safe-http.d.ts +54 -0
- package/app/net/safe-http.js +124 -0
- package/app/net/safe-http.js.map +1 -0
- package/app/net/url.d.ts +26 -0
- package/app/net/url.js +32 -0
- package/app/net/url.js.map +1 -0
- package/app/operator/controller.d.ts +184 -0
- package/app/operator/controller.js +797 -0
- package/app/operator/controller.js.map +1 -0
- package/app/operator/runner.d.ts +139 -0
- package/app/operator/runner.js +267 -0
- package/app/operator/runner.js.map +1 -0
- package/app/operator/store.d.ts +39 -0
- package/app/operator/store.js +169 -0
- package/app/operator/store.js.map +1 -0
- package/app/operator/strategy.d.ts +54 -0
- package/app/operator/strategy.js +249 -0
- package/app/operator/strategy.js.map +1 -0
- package/app/operator/tui.d.ts +27 -0
- package/app/operator/tui.js +395 -0
- package/app/operator/tui.js.map +1 -0
- package/app/operator/types.d.ts +224 -0
- package/app/operator/types.js +17 -0
- package/app/operator/types.js.map +1 -0
- package/app/privacy/ledger-payload-deletion.d.ts +10 -0
- package/app/privacy/ledger-payload-deletion.js +31 -0
- package/app/privacy/ledger-payload-deletion.js.map +1 -0
- package/app/privacy/local-backup-deletion.d.ts +13 -0
- package/app/privacy/local-backup-deletion.js +115 -0
- package/app/privacy/local-backup-deletion.js.map +1 -0
- package/app/privacy/workbench-retention.d.ts +105 -0
- package/app/privacy/workbench-retention.js +501 -0
- package/app/privacy/workbench-retention.js.map +1 -0
- package/app/product-buyer.d.ts +79 -0
- package/app/product-buyer.js +165 -0
- package/app/product-buyer.js.map +1 -0
- package/app/product-catalog.d.ts +43 -0
- package/app/product-catalog.js +60 -0
- package/app/product-catalog.js.map +1 -0
- package/app/product-cli.d.ts +70 -0
- package/app/product-cli.js +259 -0
- package/app/product-cli.js.map +1 -0
- package/app/product-compat.d.ts +58 -0
- package/app/product-compat.js +74 -0
- package/app/product-compat.js.map +1 -0
- package/app/product-init.d.ts +102 -0
- package/app/product-init.js +294 -0
- package/app/product-init.js.map +1 -0
- package/app/product-merchant.d.ts +43 -0
- package/app/product-merchant.js +75 -0
- package/app/product-merchant.js.map +1 -0
- package/app/product-publish.d.ts +89 -0
- package/app/product-publish.js +538 -0
- package/app/product-publish.js.map +1 -0
- package/app/product-setup-public.d.ts +51 -0
- package/app/product-setup-public.js +165 -0
- package/app/product-setup-public.js.map +1 -0
- package/app/product-supplier.d.ts +148 -0
- package/app/product-supplier.js +452 -0
- package/app/product-supplier.js.map +1 -0
- package/app/protocol/legacy-shopping-negotiation/adapter.d.ts +42 -0
- package/app/protocol/legacy-shopping-negotiation/adapter.js +561 -0
- package/app/protocol/legacy-shopping-negotiation/adapter.js.map +1 -0
- package/app/protocol/legacy-shopping-negotiation/mapping.d.ts +78 -0
- package/app/protocol/legacy-shopping-negotiation/mapping.js +321 -0
- package/app/protocol/legacy-shopping-negotiation/mapping.js.map +1 -0
- package/app/protocol/legacy-shopping-negotiation/money.d.ts +49 -0
- package/app/protocol/legacy-shopping-negotiation/money.js +70 -0
- package/app/protocol/legacy-shopping-negotiation/money.js.map +1 -0
- package/app/protocol/legacy-shopping-negotiation/types.d.ts +107 -0
- package/app/protocol/legacy-shopping-negotiation/types.js +34 -0
- package/app/protocol/legacy-shopping-negotiation/types.js.map +1 -0
- package/app/runtime/buyer-policy.d.ts +58 -0
- package/app/runtime/buyer-policy.js +89 -0
- package/app/runtime/buyer-policy.js.map +1 -0
- package/app/runtime/fake-model.d.ts +77 -0
- package/app/runtime/fake-model.js +313 -0
- package/app/runtime/fake-model.js.map +1 -0
- package/app/runtime/foreground.d.ts +56 -0
- package/app/runtime/foreground.js +97 -0
- package/app/runtime/foreground.js.map +1 -0
- package/app/runtime/heartbeat.d.ts +36 -0
- package/app/runtime/heartbeat.js +49 -0
- package/app/runtime/heartbeat.js.map +1 -0
- package/app/runtime/merchant-turn.d.ts +35 -0
- package/app/runtime/merchant-turn.js +20 -0
- package/app/runtime/merchant-turn.js.map +1 -0
- package/app/runtime/model.d.ts +40 -0
- package/app/runtime/model.js +86 -0
- package/app/runtime/model.js.map +1 -0
- package/app/runtime/negotiation-turn.d.ts +101 -0
- package/app/runtime/negotiation-turn.js +317 -0
- package/app/runtime/negotiation-turn.js.map +1 -0
- package/app/runtime/tools.d.ts +64 -0
- package/app/runtime/tools.js +236 -0
- package/app/runtime/tools.js.map +1 -0
- package/app/supervisor/init.d.ts +31 -0
- package/app/supervisor/init.js +222 -0
- package/app/supervisor/init.js.map +1 -0
- package/app/supervisor/logs.d.ts +28 -0
- package/app/supervisor/logs.js +101 -0
- package/app/supervisor/logs.js.map +1 -0
- package/app/supervisor/manage.d.ts +76 -0
- package/app/supervisor/manage.js +510 -0
- package/app/supervisor/manage.js.map +1 -0
- package/app/supervisor/manifest.d.ts +69 -0
- package/app/supervisor/manifest.js +209 -0
- package/app/supervisor/manifest.js.map +1 -0
- package/app/supervisor/stack-config.d.ts +84 -0
- package/app/supervisor/stack-config.js +270 -0
- package/app/supervisor/stack-config.js.map +1 -0
- package/app/supervisor/wrapper.d.ts +17 -0
- package/app/supervisor/wrapper.js +138 -0
- package/app/supervisor/wrapper.js.map +1 -0
- package/app/trust/binding/claims.d.ts +92 -0
- package/app/trust/binding/claims.js +175 -0
- package/app/trust/binding/claims.js.map +1 -0
- package/app/trust/binding/thumbprint.d.ts +35 -0
- package/app/trust/binding/thumbprint.js +88 -0
- package/app/trust/binding/thumbprint.js.map +1 -0
- package/app/trust/binding/verify.d.ts +84 -0
- package/app/trust/binding/verify.js +121 -0
- package/app/trust/binding/verify.js.map +1 -0
- package/app/trust/identity/auth-verifier.d.ts +115 -0
- package/app/trust/identity/auth-verifier.js +216 -0
- package/app/trust/identity/auth-verifier.js.map +1 -0
- package/app/trust/identity/identity-binding.d.ts +63 -0
- package/app/trust/identity/identity-binding.js +59 -0
- package/app/trust/identity/identity-binding.js.map +1 -0
- package/app/trust/identity/index.d.ts +38 -0
- package/app/trust/identity/index.js +31 -0
- package/app/trust/identity/index.js.map +1 -0
- package/app/trust/identity/jwk.d.ts +11 -0
- package/app/trust/identity/jwk.js +2 -0
- package/app/trust/identity/jwk.js.map +1 -0
- package/app/trust/identity/jws.d.ts +86 -0
- package/app/trust/identity/jws.js +207 -0
- package/app/trust/identity/jws.js.map +1 -0
- package/app/trust/identity/keys.d.ts +72 -0
- package/app/trust/identity/keys.js +118 -0
- package/app/trust/identity/keys.js.map +1 -0
- package/app/trust/identity/message-signature.d.ts +92 -0
- package/app/trust/identity/message-signature.js +320 -0
- package/app/trust/identity/message-signature.js.map +1 -0
- package/app/trust/identity/nonce.d.ts +45 -0
- package/app/trust/identity/nonce.js +50 -0
- package/app/trust/identity/nonce.js.map +1 -0
- package/app/trust/identity/signature-base.d.ts +84 -0
- package/app/trust/identity/signature-base.js +261 -0
- package/app/trust/identity/signature-base.js.map +1 -0
- package/app/trust/identity/trust-policy.d.ts +92 -0
- package/app/trust/identity/trust-policy.js +95 -0
- package/app/trust/identity/trust-policy.js.map +1 -0
- package/app/trust/index.d.ts +21 -0
- package/app/trust/index.js +22 -0
- package/app/trust/index.js.map +1 -0
- package/app/trust/records/evaluator.d.ts +76 -0
- package/app/trust/records/evaluator.js +122 -0
- package/app/trust/records/evaluator.js.map +1 -0
- package/app/trust/records/index.d.ts +28 -0
- package/app/trust/records/index.js +26 -0
- package/app/trust/records/index.js.map +1 -0
- package/app/trust/records/store.d.ts +75 -0
- package/app/trust/records/store.js +339 -0
- package/app/trust/records/store.js.map +1 -0
- package/app/trust/records/types.d.ts +159 -0
- package/app/trust/records/types.js +40 -0
- package/app/trust/records/types.js.map +1 -0
- package/app/tui/banner.d.ts +46 -0
- package/app/tui/banner.js +99 -0
- package/app/tui/banner.js.map +1 -0
- package/app/tui/styles.d.ts +70 -0
- package/app/tui/styles.js +197 -0
- package/app/tui/styles.js.map +1 -0
- package/app/tui/theme.d.ts +63 -0
- package/app/tui/theme.js +136 -0
- package/app/tui/theme.js.map +1 -0
- package/app/weixin/channel.d.ts +92 -0
- package/app/weixin/channel.js +386 -0
- package/app/weixin/channel.js.map +1 -0
- package/app/weixin/cli-weixin.d.ts +29 -0
- package/app/weixin/cli-weixin.js +130 -0
- package/app/weixin/cli-weixin.js.map +1 -0
- package/app/weixin/credentials.d.ts +33 -0
- package/app/weixin/credentials.js +118 -0
- package/app/weixin/credentials.js.map +1 -0
- package/app/weixin/ilink-client.d.ts +53 -0
- package/app/weixin/ilink-client.js +333 -0
- package/app/weixin/ilink-client.js.map +1 -0
- package/app/weixin/login.d.ts +37 -0
- package/app/weixin/login.js +96 -0
- package/app/weixin/login.js.map +1 -0
- package/app/weixin/qr.d.ts +26 -0
- package/app/weixin/qr.js +525 -0
- package/app/weixin/qr.js.map +1 -0
- package/app/weixin/types.d.ts +114 -0
- package/app/weixin/types.js +48 -0
- package/app/weixin/types.js.map +1 -0
- package/build-manifest.json +19910 -0
- package/contracts/candidate-agent-dto-1.0.schema.json +172 -0
- package/contracts/card-publication/0.1.2/request.schema.json +78 -0
- package/contracts/commerce-intent/1.0/schema.json +124 -0
- package/contracts/conformance/python-service/run.py +134 -0
- package/contracts/delegation-policy/1.0/schema.json +143 -0
- package/contracts/effective-authorization/1.0/schema.json +167 -0
- package/contracts/interop/kiwi-buyer-message-send.json +43 -0
- package/contracts/interop/knp-data-part-examples.json +243 -0
- package/contracts/kiwi-catalog/1.0/agent-record.schema.json +78 -0
- package/contracts/kiwi-catalog/1.0/listing-record.schema.json +98 -0
- package/contracts/kiwi-catalog/1.0/listing-search-result.schema.json +60 -0
- package/contracts/kiwi-contracts.lock.json +7 -0
- package/contracts/manifest.json +211 -0
- package/contracts/merchant-management/1.0/README.md +109 -0
- package/contracts/merchant-management/1.0/approval-decision.schema.json +16 -0
- package/contracts/merchant-management/1.0/approval-preview.schema.json +26 -0
- package/contracts/merchant-management/1.0/connector-delivery-manifest.schema.json +78 -0
- package/contracts/merchant-management/1.0/management-error.schema.json +30 -0
- package/contracts/merchant-management/1.0/operation-receipt.schema.json +28 -0
- package/contracts/merchant-management/1.0/runtime-management-descriptor.schema.json +33 -0
- package/contracts/merchant-management/1.0/runtime-status.schema.json +42 -0
- package/contracts/merchant-rfq/0.1.0/delivery-record.schema.json +206 -0
- package/contracts/merchant-rfq/0.1.0/fact-snapshot.schema.json +118 -0
- package/contracts/merchant-rfq/0.1.0/handoff-record.schema.json +251 -0
- package/contracts/merchant-rfq/0.1.0/pricing-input.schema.json +139 -0
- package/contracts/merchant-rfq/0.1.0/quote-revision.schema.json +153 -0
- package/contracts/merchant-rfq/0.1.0/release-request.schema.json +121 -0
- package/contracts/merchant-rfq/0.1.0/rfq-case.schema.json +357 -0
- package/contracts/merchant-rfq/0.1.0/source-record.schema.json +162 -0
- package/contracts/merchant-workbench/1.0/README.md +6 -0
- package/contracts/merchant-workbench/1.0/money.schema.json +19 -0
- package/contracts/merchant-workbench/1.0/problem.schema.json +73 -0
- package/contracts/negotiation/1.0/schema.json +501 -0
- package/contracts/persistent-task/1.0/schema.json +191 -0
- package/contracts/runtime-binding/0.1.2/binding-request.schema.json +73 -0
- package/contracts/runtime-binding/0.1.2/claims.schema.json +100 -0
- package/contracts/runtime-binding/0.1.2/document.schema.json +163 -0
- package/contracts/shopping.negotiation/0.1/capabilities.schema.json +47 -0
- package/contracts/shopping.negotiation/0.1/decision.schema.json +120 -0
- package/contracts/shopping.negotiation/0.1/policy-result.schema.json +52 -0
- package/contracts/shopping.negotiation/0.1/snapshot.schema.json +172 -0
- package/contracts/vectors/binding-thumbprint.json +15 -0
- package/contracts/vectors/candidate-agent.invalid-private-field.json +7 -0
- package/contracts/vectors/candidate-agent.valid.json +26 -0
- package/contracts/vectors/commerce-intent.invalid-no-items.json +7 -0
- package/contracts/vectors/commerce-intent.valid.json +32 -0
- package/contracts/vectors/delegation-policy.invalid-payment-auto.json +15 -0
- package/contracts/vectors/delegation-policy.valid.json +25 -0
- package/contracts/vectors/effective-authorization.invalid-deny-wins.json +20 -0
- package/contracts/vectors/effective-authorization.valid.json +23 -0
- package/contracts/vectors/persistent-task.invalid-no-idempotency.json +7 -0
- package/contracts/vectors/persistent-task.valid.json +45 -0
- package/index.js +6 -0
- package/node_modules/@hexagon/base64/dist/base64.cjs +198 -0
- package/node_modules/@hexagon/base64/dist/base64.min.js +1 -0
- package/node_modules/@hexagon/base64/dist/base64.min.mjs +1 -0
- package/node_modules/@hexagon/base64/package.json +73 -0
- package/node_modules/@hexagon/base64/src/base64.js +190 -0
- package/node_modules/@hexagon/base64/src/base64.single.js +3 -0
- package/node_modules/@hono/node-server/dist/conninfo.cjs +22 -0
- package/node_modules/@hono/node-server/dist/conninfo.d.cts +11 -0
- package/node_modules/@hono/node-server/dist/conninfo.d.mts +11 -0
- package/node_modules/@hono/node-server/dist/conninfo.mjs +20 -0
- package/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs +5 -0
- package/node_modules/@hono/node-server/dist/constants-BXAKTxRC.cjs +11 -0
- package/node_modules/@hono/node-server/dist/early-hints.cjs +35 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.cts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.mts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.mjs +33 -0
- package/node_modules/@hono/node-server/dist/index.cjs +1318 -0
- package/node_modules/@hono/node-server/dist/index.d.cts +101 -0
- package/node_modules/@hono/node-server/dist/index.d.mts +101 -0
- package/node_modules/@hono/node-server/dist/index.mjs +1313 -0
- package/node_modules/@hono/node-server/dist/serve-static.cjs +151 -0
- package/node_modules/@hono/node-server/dist/serve-static.d.cts +18 -0
- package/node_modules/@hono/node-server/dist/serve-static.d.mts +18 -0
- package/node_modules/@hono/node-server/dist/serve-static.mjs +150 -0
- package/node_modules/@hono/node-server/dist/utils/response.cjs +8 -0
- package/node_modules/@hono/node-server/dist/utils/response.d.cts +4 -0
- package/node_modules/@hono/node-server/dist/utils/response.d.mts +4 -0
- package/node_modules/@hono/node-server/dist/utils/response.mjs +7 -0
- package/node_modules/@hono/node-server/dist/utils/stream.cjs +65 -0
- package/node_modules/@hono/node-server/dist/utils/stream.d.cts +6 -0
- package/node_modules/@hono/node-server/dist/utils/stream.d.mts +6 -0
- package/node_modules/@hono/node-server/dist/utils/stream.mjs +64 -0
- package/node_modules/@hono/node-server/package.json +127 -0
- package/node_modules/@levischuck/tiny-cbor/esm/cbor/cbor.js +440 -0
- package/node_modules/@levischuck/tiny-cbor/esm/cbor/cbor_internal.js +111 -0
- package/node_modules/@levischuck/tiny-cbor/esm/index.js +1 -0
- package/node_modules/@levischuck/tiny-cbor/esm/package.json +3 -0
- package/node_modules/@levischuck/tiny-cbor/package.json +25 -0
- package/node_modules/@levischuck/tiny-cbor/script/cbor/cbor.js +447 -0
- package/node_modules/@levischuck/tiny-cbor/script/cbor/cbor_internal.js +116 -0
- package/node_modules/@levischuck/tiny-cbor/script/index.js +8 -0
- package/node_modules/@levischuck/tiny-cbor/script/package.json +3 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js +320 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js +1044 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js +618 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/middleware.js +252 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js +211 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js +202 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js +484 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/websocket.js +58 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js +29 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js +188 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js +68 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js +39 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js +19 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js +36 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js +250 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js +251 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js +28 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js +51 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/package.json +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js +3 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js +202 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js +201 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js +21 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js +77 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js +65 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js +136 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js +21 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js +75 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js +71 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js +3 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js +162 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js +128 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js +3 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js +48 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js +58 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js +433 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js +922 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/middleware/hostHeaderValidation.js +80 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.js +64 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sse.js +172 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js +17 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js +88 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/streamableHttp.js +165 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js +965 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js +263 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-json-schema-compat.js +79 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth-utils.js +48 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js +234 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js +64 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/metadataUtils.js +25 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js +1112 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/responseMessage.js +23 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js +46 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/toolNameValidation.js +97 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js +43 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/uriTemplate.js +243 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/spec.types.js +27 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/types.js +2105 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js +94 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/cfworker-provider.js +69 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/index.js +30 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/types.js +3 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js +290 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +1019 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +613 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/middleware.js +245 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js +206 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js +194 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +479 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/websocket.js +54 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/index.js +13 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js +184 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js +64 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/index.js +20 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js +16 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js +32 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js +246 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.js +246 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/types.js +10 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/inMemory.js +47 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/package.json +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/clients.js +2 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js +180 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/authorize.js +171 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/metadata.js +15 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/register.js +71 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/revoke.js +59 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/handlers/token.js +107 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/allowedMethods.js +18 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js +72 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/clientAuth.js +45 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/provider.js +2 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js +158 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/router.js +118 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.js +2 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +41 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js +52 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +429 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +917 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.js +76 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.js +58 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js +165 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js +13 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +81 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js +161 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +961 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +228 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +51 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js +44 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +208 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js +57 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/metadataUtils.js +22 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +1107 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.js +19 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +40 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +92 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js +39 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js +239 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/spec.types.js +24 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +2065 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +87 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js +65 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js +29 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js +2 -0
- package/node_modules/@modelcontextprotocol/sdk/package.json +165 -0
- package/node_modules/@peculiar/asn1-android/build/cjs/attestation.js +39 -0
- package/node_modules/@peculiar/asn1-android/build/cjs/index.js +6 -0
- package/node_modules/@peculiar/asn1-android/build/cjs/key_description.js +519 -0
- package/node_modules/@peculiar/asn1-android/build/cjs/nonstandard.js +107 -0
- package/node_modules/@peculiar/asn1-android/build/es2015/attestation.js +34 -0
- package/node_modules/@peculiar/asn1-android/build/es2015/index.js +3 -0
- package/node_modules/@peculiar/asn1-android/build/es2015/key_description.js +512 -0
- package/node_modules/@peculiar/asn1-android/build/es2015/nonstandard.js +103 -0
- package/node_modules/@peculiar/asn1-android/package.json +54 -0
- package/node_modules/@peculiar/asn1-asym-key/build/cjs/index.js +84 -0
- package/node_modules/@peculiar/asn1-asym-key/build/es2015/index.js +77 -0
- package/node_modules/@peculiar/asn1-asym-key/package.json +55 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/attribute.js +22 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/attributes/counter_signature.js +13 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/attributes/index.js +8 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/attributes/message_digest.js +8 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/attributes/signing_time.js +13 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/certificate_choices.js +64 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/content_info.js +22 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/encapsulated_content_info.js +40 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/encrypted_content_info.js +56 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/enveloped_data.js +60 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/index.js +24 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/issuer_and_serial_number.js +23 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/kek_recipient_info.js +53 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/key_agree_recipient_info.js +167 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/key_trans_recipient_info.js +51 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/object_identifiers.js +10 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/originator_info.js +31 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/other_key_attribute.js +22 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/password_recipient_info.js +32 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/recipient_info.js +75 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/recipient_infos.js +20 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/revocation_info_choice.js +54 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/signed_data.js +64 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/signer_identifier.js +28 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/signer_info.js +70 -0
- package/node_modules/@peculiar/asn1-cms/build/cjs/types.js +51 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/attribute.js +18 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/attributes/counter_signature.js +10 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/attributes/index.js +4 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/attributes/message_digest.js +4 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/attributes/signing_time.js +10 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/certificate_choices.js +60 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/content_info.js +18 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/encapsulated_content_info.js +36 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/encrypted_content_info.js +52 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/enveloped_data.js +56 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/index.js +21 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/issuer_and_serial_number.js +19 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/kek_recipient_info.js +48 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/key_agree_recipient_info.js +160 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/key_trans_recipient_info.js +47 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/object_identifiers.js +7 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/originator_info.js +27 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/other_key_attribute.js +18 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/password_recipient_info.js +28 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/recipient_info.js +71 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/recipient_infos.js +17 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/revocation_info_choice.js +50 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/signed_data.js +60 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/signer_identifier.js +25 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/signer_info.js +66 -0
- package/node_modules/@peculiar/asn1-cms/build/es2015/types.js +48 -0
- package/node_modules/@peculiar/asn1-cms/package.json +55 -0
- package/node_modules/@peculiar/asn1-csr/build/cjs/attributes.js +20 -0
- package/node_modules/@peculiar/asn1-csr/build/cjs/certification_request.js +29 -0
- package/node_modules/@peculiar/asn1-csr/build/cjs/certification_request_info.js +34 -0
- package/node_modules/@peculiar/asn1-csr/build/cjs/index.js +6 -0
- package/node_modules/@peculiar/asn1-csr/build/es2015/attributes.js +17 -0
- package/node_modules/@peculiar/asn1-csr/build/es2015/certification_request.js +25 -0
- package/node_modules/@peculiar/asn1-csr/build/es2015/certification_request_info.js +30 -0
- package/node_modules/@peculiar/asn1-csr/build/es2015/index.js +3 -0
- package/node_modules/@peculiar/asn1-csr/package.json +55 -0
- package/node_modules/@peculiar/asn1-ecc/build/cjs/algorithms.js +14 -0
- package/node_modules/@peculiar/asn1-ecc/build/cjs/ec_parameters.js +27 -0
- package/node_modules/@peculiar/asn1-ecc/build/cjs/ec_private_key.js +36 -0
- package/node_modules/@peculiar/asn1-ecc/build/cjs/ec_signature_value.js +25 -0
- package/node_modules/@peculiar/asn1-ecc/build/cjs/index.js +9 -0
- package/node_modules/@peculiar/asn1-ecc/build/cjs/object_identifiers.js +26 -0
- package/node_modules/@peculiar/asn1-ecc/build/cjs/rfc3279.js +95 -0
- package/node_modules/@peculiar/asn1-ecc/build/es2015/algorithms.js +10 -0
- package/node_modules/@peculiar/asn1-ecc/build/es2015/ec_parameters.js +24 -0
- package/node_modules/@peculiar/asn1-ecc/build/es2015/ec_private_key.js +32 -0
- package/node_modules/@peculiar/asn1-ecc/build/es2015/ec_signature_value.js +21 -0
- package/node_modules/@peculiar/asn1-ecc/build/es2015/index.js +6 -0
- package/node_modules/@peculiar/asn1-ecc/build/es2015/object_identifiers.js +23 -0
- package/node_modules/@peculiar/asn1-ecc/build/es2015/rfc3279.js +90 -0
- package/node_modules/@peculiar/asn1-ecc/package.json +56 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/attribute.js +36 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/authenticated_safe.js +20 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/bags/cert_bag.js +26 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/bags/crl_bag.js +25 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/bags/index.js +9 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/bags/key_bag.js +12 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/bags/pkcs8_shrouded_key_bag.js +12 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/bags/secret_bag.js +22 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/bags/types.js +11 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/index.js +10 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/mac_data.js +27 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/object_identifiers.js +14 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/pfx.js +28 -0
- package/node_modules/@peculiar/asn1-pfx/build/cjs/safe_bag.js +45 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/attribute.js +32 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/authenticated_safe.js +17 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/bags/cert_bag.js +22 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/bags/crl_bag.js +21 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/bags/index.js +6 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/bags/key_bag.js +9 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/bags/pkcs8_shrouded_key_bag.js +9 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/bags/secret_bag.js +18 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/bags/types.js +8 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/index.js +7 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/mac_data.js +23 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/object_identifiers.js +11 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/pfx.js +24 -0
- package/node_modules/@peculiar/asn1-pfx/build/es2015/safe_bag.js +41 -0
- package/node_modules/@peculiar/asn1-pfx/package.json +57 -0
- package/node_modules/@peculiar/asn1-pkcs8/build/cjs/encrypted_private_key_info.js +23 -0
- package/node_modules/@peculiar/asn1-pkcs8/build/cjs/index.js +5 -0
- package/node_modules/@peculiar/asn1-pkcs8/build/cjs/private_key_info.js +54 -0
- package/node_modules/@peculiar/asn1-pkcs8/build/es2015/encrypted_private_key_info.js +18 -0
- package/node_modules/@peculiar/asn1-pkcs8/build/es2015/index.js +2 -0
- package/node_modules/@peculiar/asn1-pkcs8/build/es2015/private_key_info.js +49 -0
- package/node_modules/@peculiar/asn1-pkcs8/package.json +53 -0
- package/node_modules/@peculiar/asn1-pkcs9/build/cjs/index.js +301 -0
- package/node_modules/@peculiar/asn1-pkcs9/build/es2015/index.js +293 -0
- package/node_modules/@peculiar/asn1-pkcs9/package.json +57 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/algorithms.js +40 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/index.js +9 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/object_identifiers.js +28 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/other_prime_info.js +46 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/parameters/index.js +6 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsaes_oaep.js +45 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsassa_pkcs1_v1_5.js +20 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsassa_pss.js +53 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/rsa_private_key.js +79 -0
- package/node_modules/@peculiar/asn1-rsa/build/cjs/rsa_public_key.js +25 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/algorithms.js +36 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/index.js +6 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/object_identifiers.js +25 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/other_prime_info.js +42 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/index.js +3 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsaes_oaep.js +41 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsassa_pkcs1_v1_5.js +16 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsassa_pss.js +49 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/rsa_private_key.js +75 -0
- package/node_modules/@peculiar/asn1-rsa/build/es2015/rsa_public_key.js +21 -0
- package/node_modules/@peculiar/asn1-rsa/package.json +54 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/convert.js +25 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/converters.js +148 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/decorators.js +52 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/enums.js +40 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/errors/index.js +4 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/errors/schema_validation.js +7 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/helper.js +44 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/index.js +22 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/objects.js +17 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/parser.js +313 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/schema.js +165 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/serializer.js +150 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/storage.js +5 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/types/bit_string.js +71 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/types/index.js +5 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/types/octet_string.js +45 -0
- package/node_modules/@peculiar/asn1-schema/build/cjs/types.js +2 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/convert.js +20 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/converters.js +143 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/decorators.js +43 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/enums.js +37 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/errors/index.js +1 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/errors/schema_validation.js +3 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/helper.js +39 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/index.js +9 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/objects.js +13 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/parser.js +308 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/schema.js +160 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/serializer.js +145 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/storage.js +2 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/types/bit_string.js +66 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/types/index.js +2 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/types/octet_string.js +40 -0
- package/node_modules/@peculiar/asn1-schema/build/es2015/types.js +1 -0
- package/node_modules/@peculiar/asn1-schema/package.json +64 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/algorithm_identifier.js +28 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/attribute.js +22 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/certificate.js +29 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/certificate_list.js +29 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extension.js +41 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/authority_information_access.js +36 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/authority_key_identifier.js +48 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/basic_constraints.js +27 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/certificate_issuer.js +19 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/certificate_policies.js +136 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_delta_indicator.js +14 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_distribution_points.js +132 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_freshest.js +22 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_issuing_distribution_point.js +68 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_number.js +20 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_reason.js +39 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/entrust_version_info.js +46 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/extended_key_usage.js +28 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/index.js +28 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/inhibit_any_policy.js +23 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/invalidity_date.js +22 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/issuer_alternative_name.js +19 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/key_usage.js +56 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/name_constraints.js +74 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/policy_constraints.js +33 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/policy_mappings.js +35 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/private_key_usage_period.js +31 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_alternative_name.js +19 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_directory_attributes.js +22 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_info_access.js +22 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_key_identifier.js +9 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/general_name.js +132 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/general_names.js +20 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/index.js +19 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/ip_converter.js +177 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/name.js +110 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/object_identifiers.js +16 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/subject_public_key_info.js +20 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/tbs_cert_list.js +83 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/tbs_certificate.js +78 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/time.js +43 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/types.js +9 -0
- package/node_modules/@peculiar/asn1-x509/build/cjs/validity.js +23 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/algorithm_identifier.js +24 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/attribute.js +18 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/certificate.js +25 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/certificate_list.js +25 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extension.js +37 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/authority_information_access.js +32 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/authority_key_identifier.js +43 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/basic_constraints.js +23 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/certificate_issuer.js +16 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/certificate_policies.js +129 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_delta_indicator.js +11 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_distribution_points.js +127 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_freshest.js +19 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_issuing_distribution_point.js +64 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_number.js +17 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_reason.js +36 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/entrust_version_info.js +41 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/extended_key_usage.js +25 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/index.js +25 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/inhibit_any_policy.js +20 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/invalidity_date.js +19 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/issuer_alternative_name.js +16 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/key_usage.js +52 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/name_constraints.js +69 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/policy_constraints.js +29 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/policy_mappings.js +31 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/private_key_usage_period.js +27 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_alternative_name.js +16 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_directory_attributes.js +19 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_info_access.js +19 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_key_identifier.js +5 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/general_name.js +127 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/general_names.js +17 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/index.js +16 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/ip_converter.js +173 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/name.js +106 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/object_identifiers.js +13 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/subject_public_key_info.js +16 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/tbs_cert_list.js +78 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/tbs_certificate.js +74 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/time.js +40 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/types.js +6 -0
- package/node_modules/@peculiar/asn1-x509/build/es2015/validity.js +19 -0
- package/node_modules/@peculiar/asn1-x509/package.json +54 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/aa_clear_attrs.js +27 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/aa_controls.js +44 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_cert_issuer.js +31 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_cert_validity_period.js +19 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_spec.js +19 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/attribute_certificate.js +25 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/attribute_certificate_info.js +67 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/class_list.js +16 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/clearance.js +31 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/holder.js +41 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/ietf_attr_syntax.js +46 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/index.js +23 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/issuer_serial.js +30 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/object_digest_info.js +37 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/object_identifiers.js +17 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/proxy_info.js +20 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/role_syntax.js +29 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/security_category.js +27 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/svce_auth_info.js +27 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/target.js +79 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/cjs/v2_form.js +39 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/aa_clear_attrs.js +23 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/aa_controls.js +40 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/attr_cert_issuer.js +28 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/attr_cert_validity_period.js +15 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/attr_spec.js +16 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/attribute_certificate.js +21 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/attribute_certificate_info.js +63 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/class_list.js +12 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/clearance.js +27 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/holder.js +37 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/ietf_attr_syntax.js +41 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/index.js +20 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/issuer_serial.js +26 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/object_digest_info.js +33 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/object_identifiers.js +14 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/proxy_info.js +17 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/role_syntax.js +25 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/security_category.js +23 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/svce_auth_info.js +23 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/target.js +75 -0
- package/node_modules/@peculiar/asn1-x509-attr/build/es2015/v2_form.js +35 -0
- package/node_modules/@peculiar/asn1-x509-attr/package.json +54 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/build/cjs/composite_keys.js +49 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/build/cjs/composite_signatures.js +34 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/build/cjs/index.js +6 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/build/cjs/object_identifiers.js +19 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/composite_keys.js +44 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/composite_signatures.js +31 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/index.js +3 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/build/es2015/object_identifiers.js +16 -0
- package/node_modules/@peculiar/asn1-x509-post-quantum/package.json +56 -0
- package/node_modules/@peculiar/utils/build/cjs/bytes/buffer-source.js +115 -0
- package/node_modules/@peculiar/utils/build/cjs/bytes/concat.js +41 -0
- package/node_modules/@peculiar/utils/build/cjs/bytes/equal.js +17 -0
- package/node_modules/@peculiar/utils/build/cjs/bytes/index.js +31 -0
- package/node_modules/@peculiar/utils/build/cjs/bytes/sequence.js +161 -0
- package/node_modules/@peculiar/utils/build/cjs/bytes/types.js +2 -0
- package/node_modules/@peculiar/utils/build/cjs/converters/convert.js +74 -0
- package/node_modules/@peculiar/utils/build/cjs/converters/defaults.js +72 -0
- package/node_modules/@peculiar/utils/build/cjs/converters/index.js +18 -0
- package/node_modules/@peculiar/utils/build/cjs/converters/registry.js +188 -0
- package/node_modules/@peculiar/utils/build/cjs/converters/types.js +2 -0
- package/node_modules/@peculiar/utils/build/cjs/encoding/base64.js +48 -0
- package/node_modules/@peculiar/utils/build/cjs/encoding/base64url.js +26 -0
- package/node_modules/@peculiar/utils/build/cjs/encoding/binary.js +26 -0
- package/node_modules/@peculiar/utils/build/cjs/encoding/hex.js +229 -0
- package/node_modules/@peculiar/utils/build/cjs/encoding/index.js +10 -0
- package/node_modules/@peculiar/utils/build/cjs/encoding/utf16.js +24 -0
- package/node_modules/@peculiar/utils/build/cjs/encoding/utf8.js +13 -0
- package/node_modules/@peculiar/utils/build/cjs/index.js +10 -0
- package/node_modules/@peculiar/utils/build/cjs/legacy/buffer-source-converter.js +37 -0
- package/node_modules/@peculiar/utils/build/cjs/legacy/convert.js +72 -0
- package/node_modules/@peculiar/utils/build/cjs/legacy/functions.js +23 -0
- package/node_modules/@peculiar/utils/build/cjs/legacy/index.js +11 -0
- package/node_modules/@peculiar/utils/build/cjs/package.json +3 -0
- package/node_modules/@peculiar/utils/build/cjs/pem/index.js +14 -0
- package/node_modules/@peculiar/utils/build/cjs/pem/pem.js +140 -0
- package/node_modules/@peculiar/utils/build/cjs/pem/types.js +2 -0
- package/node_modules/@peculiar/utils/build/esm/bytes/buffer-source.js +101 -0
- package/node_modules/@peculiar/utils/build/esm/bytes/concat.js +37 -0
- package/node_modules/@peculiar/utils/build/esm/bytes/equal.js +14 -0
- package/node_modules/@peculiar/utils/build/esm/bytes/index.js +4 -0
- package/node_modules/@peculiar/utils/build/esm/bytes/sequence.js +150 -0
- package/node_modules/@peculiar/utils/build/esm/bytes/types.js +1 -0
- package/node_modules/@peculiar/utils/build/esm/converters/convert.js +71 -0
- package/node_modules/@peculiar/utils/build/esm/converters/defaults.js +68 -0
- package/node_modules/@peculiar/utils/build/esm/converters/index.js +3 -0
- package/node_modules/@peculiar/utils/build/esm/converters/registry.js +185 -0
- package/node_modules/@peculiar/utils/build/esm/converters/types.js +1 -0
- package/node_modules/@peculiar/utils/build/esm/encoding/base64.js +40 -0
- package/node_modules/@peculiar/utils/build/esm/encoding/base64url.js +19 -0
- package/node_modules/@peculiar/utils/build/esm/encoding/binary.js +20 -0
- package/node_modules/@peculiar/utils/build/esm/encoding/hex.js +220 -0
- package/node_modules/@peculiar/utils/build/esm/encoding/index.js +6 -0
- package/node_modules/@peculiar/utils/build/esm/encoding/utf16.js +19 -0
- package/node_modules/@peculiar/utils/build/esm/encoding/utf8.js +8 -0
- package/node_modules/@peculiar/utils/build/esm/index.js +6 -0
- package/node_modules/@peculiar/utils/build/esm/legacy/buffer-source-converter.js +33 -0
- package/node_modules/@peculiar/utils/build/esm/legacy/convert.js +68 -0
- package/node_modules/@peculiar/utils/build/esm/legacy/functions.js +18 -0
- package/node_modules/@peculiar/utils/build/esm/legacy/index.js +3 -0
- package/node_modules/@peculiar/utils/build/esm/pem/index.js +1 -0
- package/node_modules/@peculiar/utils/build/esm/pem/pem.js +129 -0
- package/node_modules/@peculiar/utils/build/esm/pem/types.js +1 -0
- package/node_modules/@peculiar/utils/package.json +111 -0
- package/node_modules/@peculiar/x509/build/x509.cjs.js +3629 -0
- package/node_modules/@peculiar/x509/build/x509.es.js +3552 -0
- package/node_modules/@peculiar/x509/build/x509.js +85 -0
- package/node_modules/@peculiar/x509/package.json +101 -0
- package/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.js +41 -0
- package/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.js +221 -0
- package/node_modules/@simplewebauthn/server/esm/errors/index.js +24 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.js +17 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.js +21 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.js +31 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.js +11 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.js +89 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/cose.js +105 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.js +16 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.js +34 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.js +16 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.js +11 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/fetch.js +14 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.js +24 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.js +20 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.js +77 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/index.js +19 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.js +117 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/index.js +11 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.js +72 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.js +35 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.js +14 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.js +11 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.js +61 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importJWKKey.js +10 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.js +7 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoHashAlgName.js +23 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +34 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/runtimeSupportsWebCryptoKeyAlg.js +16 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/structs.js +1 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js +73 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.js +36 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyAKP.js +48 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.js +70 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.js +48 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.js +88 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.js +79 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/logging.js +30 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/mapJWSAlgToCOSEAlg.js +31 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.js +44 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.js +41 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.js +106 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.js +25 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/toHash.js +12 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.js +194 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.js +34 -0
- package/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.js +35 -0
- package/node_modules/@simplewebauthn/server/esm/index.js +9 -0
- package/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.js +17 -0
- package/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.js +12 -0
- package/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.js +153 -0
- package/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.js +42 -0
- package/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.js +59 -0
- package/node_modules/@simplewebauthn/server/esm/package.json +3 -0
- package/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.js +163 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.js +136 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/isValidTPMManufacturerID.js +6 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.js +58 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.js +94 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.js +332 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.js +120 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.js +113 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.js +58 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.js +48 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.js +113 -0
- package/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js +224 -0
- package/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.js +171 -0
- package/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.js +32 -0
- package/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.js +25 -0
- package/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.js +74 -0
- package/node_modules/@simplewebauthn/server/esm/services/metadataService.js +274 -0
- package/node_modules/@simplewebauthn/server/esm/services/settingsService.js +86 -0
- package/node_modules/@simplewebauthn/server/esm/types/dom.js +1 -0
- package/node_modules/@simplewebauthn/server/esm/types/index.js +1 -0
- package/node_modules/@simplewebauthn/server/package.json +67 -0
- package/node_modules/@simplewebauthn/server/script/authentication/generateAuthenticationOptions.js +44 -0
- package/node_modules/@simplewebauthn/server/script/authentication/verifyAuthenticationResponse.js +224 -0
- package/node_modules/@simplewebauthn/server/script/errors/index.js +29 -0
- package/node_modules/@simplewebauthn/server/script/helpers/convertAAGUIDToString.js +20 -0
- package/node_modules/@simplewebauthn/server/script/helpers/convertCOSEtoPKCS.js +24 -0
- package/node_modules/@simplewebauthn/server/script/helpers/convertCertBufferToPEM.js +34 -0
- package/node_modules/@simplewebauthn/server/script/helpers/convertPEMToBytes.js +14 -0
- package/node_modules/@simplewebauthn/server/script/helpers/convertX509PublicKeyToCOSE.js +92 -0
- package/node_modules/@simplewebauthn/server/script/helpers/cose.js +116 -0
- package/node_modules/@simplewebauthn/server/script/helpers/decodeAttestationObject.js +20 -0
- package/node_modules/@simplewebauthn/server/script/helpers/decodeAuthenticatorExtensions.js +37 -0
- package/node_modules/@simplewebauthn/server/script/helpers/decodeClientDataJSON.js +20 -0
- package/node_modules/@simplewebauthn/server/script/helpers/decodeCredentialPublicKey.js +15 -0
- package/node_modules/@simplewebauthn/server/script/helpers/fetch.js +18 -0
- package/node_modules/@simplewebauthn/server/script/helpers/generateChallenge.js +28 -0
- package/node_modules/@simplewebauthn/server/script/helpers/generateUserID.js +24 -0
- package/node_modules/@simplewebauthn/server/script/helpers/getCertificateInfo.js +80 -0
- package/node_modules/@simplewebauthn/server/script/helpers/index.js +49 -0
- package/node_modules/@simplewebauthn/server/script/helpers/isCertRevoked.js +120 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/index.js +37 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoBase64URL.js +85 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCBOR.js +62 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/digest.js +17 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getRandomValues.js +14 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/getWebCrypto.js +66 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/importJWKKey.js +13 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/index.js +13 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoHashAlgName.js +26 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +37 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/runtimeSupportsWebCryptoKeyAlg.js +19 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/structs.js +2 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/unwrapEC2Signature.js +76 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verify.js +39 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyAKP.js +51 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyEC2.js +73 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyOKP.js +51 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoCrypto/verifyRSA.js +91 -0
- package/node_modules/@simplewebauthn/server/script/helpers/iso/isoUint8Array.js +89 -0
- package/node_modules/@simplewebauthn/server/script/helpers/logging.js +34 -0
- package/node_modules/@simplewebauthn/server/script/helpers/mapJWSAlgToCOSEAlg.js +34 -0
- package/node_modules/@simplewebauthn/server/script/helpers/mapX509SignatureAlgToCOSEAlg.js +47 -0
- package/node_modules/@simplewebauthn/server/script/helpers/matchExpectedRPID.js +44 -0
- package/node_modules/@simplewebauthn/server/script/helpers/parseAuthenticatorData.js +110 -0
- package/node_modules/@simplewebauthn/server/script/helpers/parseBackupFlags.js +30 -0
- package/node_modules/@simplewebauthn/server/script/helpers/toHash.js +15 -0
- package/node_modules/@simplewebauthn/server/script/helpers/validateCertificatePath.js +197 -0
- package/node_modules/@simplewebauthn/server/script/helpers/validateExtFIDOGenCEAAGUID.js +37 -0
- package/node_modules/@simplewebauthn/server/script/helpers/verifySignature.js +39 -0
- package/node_modules/@simplewebauthn/server/script/index.js +25 -0
- package/node_modules/@simplewebauthn/server/script/metadata/mdsTypes.js +18 -0
- package/node_modules/@simplewebauthn/server/script/metadata/parseJWT.js +15 -0
- package/node_modules/@simplewebauthn/server/script/metadata/verifyAttestationWithMetadata.js +157 -0
- package/node_modules/@simplewebauthn/server/script/metadata/verifyJWT.js +45 -0
- package/node_modules/@simplewebauthn/server/script/metadata/verifyMDSBlob.js +62 -0
- package/node_modules/@simplewebauthn/server/script/package.json +3 -0
- package/node_modules/@simplewebauthn/server/script/registration/generateRegistrationOptions.js +167 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/constants.js +139 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/isValidTPMManufacturerID.js +9 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parseCertInfo.js +61 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/parsePubArea.js +97 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/tpm/verifyAttestationTPM.js +335 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidKey.js +123 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationAndroidSafetyNet.js +116 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationApple.js +61 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationFIDOU2F.js +51 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifications/verifyAttestationPacked.js +116 -0
- package/node_modules/@simplewebauthn/server/script/registration/verifyRegistrationResponse.js +227 -0
- package/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-key.js +174 -0
- package/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/android-safetynet.js +35 -0
- package/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/apple.js +28 -0
- package/node_modules/@simplewebauthn/server/script/services/defaultRootCerts/mds.js +77 -0
- package/node_modules/@simplewebauthn/server/script/services/metadataService.js +278 -0
- package/node_modules/@simplewebauthn/server/script/services/settingsService.js +89 -0
- package/node_modules/@simplewebauthn/server/script/types/dom.js +2 -0
- package/node_modules/@simplewebauthn/server/script/types/index.js +2 -0
- package/node_modules/accepts/index.js +238 -0
- package/node_modules/accepts/package.json +47 -0
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +892 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/ajv-formats/dist/formats.js +208 -0
- package/node_modules/ajv-formats/dist/index.js +37 -0
- package/node_modules/ajv-formats/dist/limit.js +69 -0
- package/node_modules/ajv-formats/package.json +74 -0
- package/node_modules/ajv-formats/src/formats.ts +269 -0
- package/node_modules/ajv-formats/src/index.ts +62 -0
- package/node_modules/ajv-formats/src/limit.ts +99 -0
- package/node_modules/asn1js/build/index.es.js +3198 -0
- package/node_modules/asn1js/build/index.js +3266 -0
- package/node_modules/asn1js/package.json +86 -0
- package/node_modules/body-parser/index.js +55 -0
- package/node_modules/body-parser/lib/read.js +247 -0
- package/node_modules/body-parser/lib/types/json.js +186 -0
- package/node_modules/body-parser/lib/types/raw.js +42 -0
- package/node_modules/body-parser/lib/types/text.js +36 -0
- package/node_modules/body-parser/lib/types/urlencoded.js +138 -0
- package/node_modules/body-parser/lib/utils.js +100 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/body-parser/node_modules/content-type/package.json +52 -0
- package/node_modules/body-parser/package.json +65 -0
- package/node_modules/bytes/index.js +170 -0
- package/node_modules/bytes/package.json +42 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/call-bound/.eslintrc +13 -0
- package/node_modules/call-bound/.github/FUNDING.yml +12 -0
- package/node_modules/call-bound/.nycrc +9 -0
- package/node_modules/call-bound/index.js +19 -0
- package/node_modules/call-bound/package.json +99 -0
- package/node_modules/call-bound/tsconfig.json +10 -0
- package/node_modules/content-disposition/index.js +536 -0
- package/node_modules/content-disposition/package.json +40 -0
- package/node_modules/content-type/index.js +225 -0
- package/node_modules/content-type/package.json +42 -0
- package/node_modules/cookie/index.js +335 -0
- package/node_modules/cookie/package.json +44 -0
- package/node_modules/cookie-signature/index.js +47 -0
- package/node_modules/cookie-signature/package.json +24 -0
- package/node_modules/cors/lib/index.js +238 -0
- package/node_modules/cors/package.json +42 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +91 -0
- package/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/node_modules/cross-spawn/package.json +73 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/depd/index.js +538 -0
- package/node_modules/depd/lib/browser/index.js +77 -0
- package/node_modules/depd/package.json +45 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/ee-first/index.js +95 -0
- package/node_modules/ee-first/package.json +29 -0
- package/node_modules/encodeurl/index.js +60 -0
- package/node_modules/encodeurl/package.json +40 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +79 -0
- package/node_modules/es-object-atoms/tsconfig.json +7 -0
- package/node_modules/escape-html/index.js +78 -0
- package/node_modules/escape-html/package.json +24 -0
- package/node_modules/etag/index.js +131 -0
- package/node_modules/etag/package.json +47 -0
- package/node_modules/eventsource/dist/index.cjs +273 -0
- package/node_modules/eventsource/dist/index.d.cts +332 -0
- package/node_modules/eventsource/dist/index.js +273 -0
- package/node_modules/eventsource/package.json +130 -0
- package/node_modules/eventsource/src/EventSource.ts +596 -0
- package/node_modules/eventsource/src/errors.ts +141 -0
- package/node_modules/eventsource/src/index.ts +3 -0
- package/node_modules/eventsource/src/types.ts +152 -0
- package/node_modules/eventsource-parser/dist/index.cjs +177 -0
- package/node_modules/eventsource-parser/dist/index.d.cts +169 -0
- package/node_modules/eventsource-parser/dist/index.js +177 -0
- package/node_modules/eventsource-parser/dist/stream.cjs +29 -0
- package/node_modules/eventsource-parser/dist/stream.d.cts +134 -0
- package/node_modules/eventsource-parser/dist/stream.js +30 -0
- package/node_modules/eventsource-parser/package.json +92 -0
- package/node_modules/eventsource-parser/src/errors.ts +44 -0
- package/node_modules/eventsource-parser/src/index.ts +8 -0
- package/node_modules/eventsource-parser/src/parse.ts +439 -0
- package/node_modules/eventsource-parser/src/stream.ts +107 -0
- package/node_modules/eventsource-parser/src/types.ts +122 -0
- package/node_modules/eventsource-parser/stream.js +2 -0
- package/node_modules/express/index.js +11 -0
- package/node_modules/express/lib/application.js +631 -0
- package/node_modules/express/lib/express.js +81 -0
- package/node_modules/express/lib/request.js +514 -0
- package/node_modules/express/lib/response.js +1053 -0
- package/node_modules/express/lib/utils.js +271 -0
- package/node_modules/express/lib/view.js +205 -0
- package/node_modules/express/package.json +99 -0
- package/node_modules/express-rate-limit/dist/index.cjs +1088 -0
- package/node_modules/express-rate-limit/dist/index.d.cts +699 -0
- package/node_modules/express-rate-limit/dist/index.d.mts +699 -0
- package/node_modules/express-rate-limit/dist/index.mjs +1044 -0
- package/node_modules/express-rate-limit/package.json +116 -0
- package/node_modules/express-rate-limit/tsconfig.json +8 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +106 -0
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/eslint.config.js +6 -0
- package/node_modules/fast-uri/index.js +631 -0
- package/node_modules/fast-uri/lib/schemes.js +272 -0
- package/node_modules/fast-uri/lib/utils.js +747 -0
- package/node_modules/fast-uri/package.json +68 -0
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/finalhandler/index.js +293 -0
- package/node_modules/finalhandler/package.json +47 -0
- package/node_modules/forwarded/index.js +90 -0
- package/node_modules/forwarded/package.json +45 -0
- package/node_modules/fresh/index.js +136 -0
- package/node_modules/fresh/package.json +46 -0
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/hono/dist/_virtual/_rolldown/runtime.js +13 -0
- package/node_modules/hono/dist/adapter/aws-lambda/conninfo.js +43 -0
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +342 -0
- package/node_modules/hono/dist/adapter/aws-lambda/index.js +3 -0
- package/node_modules/hono/dist/adapter/aws-lambda/types.js +1 -0
- package/node_modules/hono/dist/adapter/bun/conninfo.js +22 -0
- package/node_modules/hono/dist/adapter/bun/index.js +6 -0
- package/node_modules/hono/dist/adapter/bun/serve-static.js +30 -0
- package/node_modules/hono/dist/adapter/bun/server.js +11 -0
- package/node_modules/hono/dist/adapter/bun/ssg.js +27 -0
- package/node_modules/hono/dist/adapter/bun/websocket.js +66 -0
- package/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js +24 -0
- package/node_modules/hono/dist/adapter/cloudflare-pages/handler.js +64 -0
- package/node_modules/hono/dist/adapter/cloudflare-pages/index.js +3 -0
- package/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js +7 -0
- package/node_modules/hono/dist/adapter/cloudflare-workers/index.js +4 -0
- package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js +7 -0
- package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js +28 -0
- package/node_modules/hono/dist/adapter/cloudflare-workers/utils.js +22 -0
- package/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js +33 -0
- package/node_modules/hono/dist/adapter/deno/conninfo.js +17 -0
- package/node_modules/hono/dist/adapter/deno/deno.d.js +1 -0
- package/node_modules/hono/dist/adapter/deno/index.js +5 -0
- package/node_modules/hono/dist/adapter/deno/serve-static.js +35 -0
- package/node_modules/hono/dist/adapter/deno/ssg.js +29 -0
- package/node_modules/hono/dist/adapter/deno/websocket.js +32 -0
- package/node_modules/hono/dist/adapter/lambda-edge/conninfo.js +7 -0
- package/node_modules/hono/dist/adapter/lambda-edge/handler.js +111 -0
- package/node_modules/hono/dist/adapter/lambda-edge/index.js +3 -0
- package/node_modules/hono/dist/adapter/netlify/conninfo.js +24 -0
- package/node_modules/hono/dist/adapter/netlify/handler.js +11 -0
- package/node_modules/hono/dist/adapter/netlify/index.js +3 -0
- package/node_modules/hono/dist/adapter/netlify/mod.js +3 -0
- package/node_modules/hono/dist/adapter/service-worker/handler.js +16 -0
- package/node_modules/hono/dist/adapter/service-worker/index.js +25 -0
- package/node_modules/hono/dist/adapter/service-worker/types.js +1 -0
- package/node_modules/hono/dist/adapter/vercel/conninfo.js +7 -0
- package/node_modules/hono/dist/adapter/vercel/handler.js +9 -0
- package/node_modules/hono/dist/adapter/vercel/index.js +3 -0
- package/node_modules/hono/dist/cjs/_virtual/_rolldown/runtime.js +33 -0
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js +44 -0
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +352 -0
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js +7 -0
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js +0 -0
- package/node_modules/hono/dist/cjs/adapter/bun/conninfo.js +23 -0
- package/node_modules/hono/dist/cjs/adapter/bun/index.js +14 -0
- package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +31 -0
- package/node_modules/hono/dist/cjs/adapter/bun/server.js +12 -0
- package/node_modules/hono/dist/cjs/adapter/bun/ssg.js +29 -0
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +70 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js +25 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js +67 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js +7 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js +8 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js +7 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +8 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js +29 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js +23 -0
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js +34 -0
- package/node_modules/hono/dist/cjs/adapter/deno/conninfo.js +18 -0
- package/node_modules/hono/dist/cjs/adapter/deno/deno.d.js +0 -0
- package/node_modules/hono/dist/cjs/adapter/deno/index.js +10 -0
- package/node_modules/hono/dist/cjs/adapter/deno/serve-static.js +36 -0
- package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +31 -0
- package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +33 -0
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js +8 -0
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +116 -0
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js +5 -0
- package/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js +25 -0
- package/node_modules/hono/dist/cjs/adapter/netlify/handler.js +12 -0
- package/node_modules/hono/dist/cjs/adapter/netlify/index.js +5 -0
- package/node_modules/hono/dist/cjs/adapter/netlify/mod.js +5 -0
- package/node_modules/hono/dist/cjs/adapter/service-worker/handler.js +17 -0
- package/node_modules/hono/dist/cjs/adapter/service-worker/index.js +27 -0
- package/node_modules/hono/dist/cjs/adapter/service-worker/types.js +0 -0
- package/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js +8 -0
- package/node_modules/hono/dist/cjs/adapter/vercel/handler.js +10 -0
- package/node_modules/hono/dist/cjs/adapter/vercel/index.js +5 -0
- package/node_modules/hono/dist/cjs/client/client.js +145 -0
- package/node_modules/hono/dist/cjs/client/fetch-result-please.js +67 -0
- package/node_modules/hono/dist/cjs/client/index.js +7 -0
- package/node_modules/hono/dist/cjs/client/types.js +0 -0
- package/node_modules/hono/dist/cjs/client/utils.js +70 -0
- package/node_modules/hono/dist/cjs/compose.js +51 -0
- package/node_modules/hono/dist/cjs/context.js +383 -0
- package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +54 -0
- package/node_modules/hono/dist/cjs/helper/accepts/index.js +3 -0
- package/node_modules/hono/dist/cjs/helper/adapter/index.js +41 -0
- package/node_modules/hono/dist/cjs/helper/conninfo/index.js +0 -0
- package/node_modules/hono/dist/cjs/helper/conninfo/types.js +0 -0
- package/node_modules/hono/dist/cjs/helper/cookie/index.js +89 -0
- package/node_modules/hono/dist/cjs/helper/css/common.js +194 -0
- package/node_modules/hono/dist/cjs/helper/css/index.js +142 -0
- package/node_modules/hono/dist/cjs/helper/dev/index.js +53 -0
- package/node_modules/hono/dist/cjs/helper/factory/index.js +33 -0
- package/node_modules/hono/dist/cjs/helper/html/index.js +34 -0
- package/node_modules/hono/dist/cjs/helper/proxy/index.js +122 -0
- package/node_modules/hono/dist/cjs/helper/route/index.js +128 -0
- package/node_modules/hono/dist/cjs/helper/ssg/index.js +19 -0
- package/node_modules/hono/dist/cjs/helper/ssg/middleware.js +65 -0
- package/node_modules/hono/dist/cjs/helper/ssg/plugins.js +68 -0
- package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +220 -0
- package/node_modules/hono/dist/cjs/helper/ssg/utils.js +70 -0
- package/node_modules/hono/dist/cjs/helper/streaming/index.js +8 -0
- package/node_modules/hono/dist/cjs/helper/streaming/sse.js +59 -0
- package/node_modules/hono/dist/cjs/helper/streaming/stream.js +26 -0
- package/node_modules/hono/dist/cjs/helper/streaming/text.js +12 -0
- package/node_modules/hono/dist/cjs/helper/streaming/utils.js +16 -0
- package/node_modules/hono/dist/cjs/helper/testing/index.js +18 -0
- package/node_modules/hono/dist/cjs/helper/websocket/index.js +56 -0
- package/node_modules/hono/dist/cjs/hono-base.js +349 -0
- package/node_modules/hono/dist/cjs/hono.js +29 -0
- package/node_modules/hono/dist/cjs/http-exception.js +56 -0
- package/node_modules/hono/dist/cjs/index.js +22 -0
- package/node_modules/hono/dist/cjs/jsx/base.js +266 -0
- package/node_modules/hono/dist/cjs/jsx/children.js +19 -0
- package/node_modules/hono/dist/cjs/jsx/components.js +147 -0
- package/node_modules/hono/dist/cjs/jsx/constants.js +15 -0
- package/node_modules/hono/dist/cjs/jsx/context.js +170 -0
- package/node_modules/hono/dist/cjs/jsx/dom/client.js +56 -0
- package/node_modules/hono/dist/cjs/jsx/dom/components.js +26 -0
- package/node_modules/hono/dist/cjs/jsx/dom/context.js +43 -0
- package/node_modules/hono/dist/cjs/jsx/dom/css.js +153 -0
- package/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +65 -0
- package/node_modules/hono/dist/cjs/jsx/dom/index.js +122 -0
- package/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +306 -0
- package/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +17 -0
- package/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +5 -0
- package/node_modules/hono/dist/cjs/jsx/dom/render.js +525 -0
- package/node_modules/hono/dist/cjs/jsx/dom/server.js +44 -0
- package/node_modules/hono/dist/cjs/jsx/dom/utils.js +9 -0
- package/node_modules/hono/dist/cjs/jsx/hooks/index.js +280 -0
- package/node_modules/hono/dist/cjs/jsx/index.js +89 -0
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +27 -0
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +138 -0
- package/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +0 -0
- package/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +16 -0
- package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +37 -0
- package/node_modules/hono/dist/cjs/jsx/streaming.js +135 -0
- package/node_modules/hono/dist/cjs/jsx/types.js +0 -0
- package/node_modules/hono/dist/cjs/jsx/utils.js +116 -0
- package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +100 -0
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +97 -0
- package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +69 -0
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +173 -0
- package/node_modules/hono/dist/cjs/middleware/combine/index.js +139 -0
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +82 -0
- package/node_modules/hono/dist/cjs/middleware/context-storage/index.js +55 -0
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +109 -0
- package/node_modules/hono/dist/cjs/middleware/csrf/index.js +106 -0
- package/node_modules/hono/dist/cjs/middleware/etag/digest.js +62 -0
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +79 -0
- package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +168 -0
- package/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +104 -0
- package/node_modules/hono/dist/cjs/middleware/jwk/index.js +3 -0
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +122 -0
- package/node_modules/hono/dist/cjs/middleware/jwt/index.js +9 -0
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +124 -0
- package/node_modules/hono/dist/cjs/middleware/language/index.js +7 -0
- package/node_modules/hono/dist/cjs/middleware/language/language.js +208 -0
- package/node_modules/hono/dist/cjs/middleware/logger/index.js +51 -0
- package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +84 -0
- package/node_modules/hono/dist/cjs/middleware/method-override/index.js +105 -0
- package/node_modules/hono/dist/cjs/middleware/powered-by/index.js +25 -0
- package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +41 -0
- package/node_modules/hono/dist/cjs/middleware/request-id/index.js +3 -0
- package/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +35 -0
- package/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +4 -0
- package/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -0
- package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +166 -0
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +61 -0
- package/node_modules/hono/dist/cjs/middleware/serve-static/path.js +17 -0
- package/node_modules/hono/dist/cjs/middleware/timeout/index.js +42 -0
- package/node_modules/hono/dist/cjs/middleware/timing/index.js +7 -0
- package/node_modules/hono/dist/cjs/middleware/timing/timing.js +189 -0
- package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +89 -0
- package/node_modules/hono/dist/cjs/package.json +3 -0
- package/node_modules/hono/dist/cjs/preset/quick.js +19 -0
- package/node_modules/hono/dist/cjs/preset/tiny.js +16 -0
- package/node_modules/hono/dist/cjs/request/constants.js +5 -0
- package/node_modules/hono/dist/cjs/request.js +337 -0
- package/node_modules/hono/dist/cjs/router/linear-router/index.js +3 -0
- package/node_modules/hono/dist/cjs/router/linear-router/router.js +97 -0
- package/node_modules/hono/dist/cjs/router/pattern-router/index.js +3 -0
- package/node_modules/hono/dist/cjs/router/pattern-router/router.js +42 -0
- package/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +7 -0
- package/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +21 -0
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +96 -0
- package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +97 -0
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +102 -0
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +74 -0
- package/node_modules/hono/dist/cjs/router/smart-router/index.js +3 -0
- package/node_modules/hono/dist/cjs/router/smart-router/router.js +50 -0
- package/node_modules/hono/dist/cjs/router/trie-router/index.js +3 -0
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +135 -0
- package/node_modules/hono/dist/cjs/router/trie-router/router.js +16 -0
- package/node_modules/hono/dist/cjs/router/utils.js +5 -0
- package/node_modules/hono/dist/cjs/router.js +40 -0
- package/node_modules/hono/dist/cjs/types.js +5 -0
- package/node_modules/hono/dist/cjs/utils/accept.js +194 -0
- package/node_modules/hono/dist/cjs/utils/basic-auth.js +21 -0
- package/node_modules/hono/dist/cjs/utils/body.js +97 -0
- package/node_modules/hono/dist/cjs/utils/buffer.js +55 -0
- package/node_modules/hono/dist/cjs/utils/color.js +39 -0
- package/node_modules/hono/dist/cjs/utils/compress.js +12 -0
- package/node_modules/hono/dist/cjs/utils/concurrent.js +31 -0
- package/node_modules/hono/dist/cjs/utils/constants.js +8 -0
- package/node_modules/hono/dist/cjs/utils/cookie.js +129 -0
- package/node_modules/hono/dist/cjs/utils/crypto.js +38 -0
- package/node_modules/hono/dist/cjs/utils/encode.js +37 -0
- package/node_modules/hono/dist/cjs/utils/filepath.js +27 -0
- package/node_modules/hono/dist/cjs/utils/handler.js +14 -0
- package/node_modules/hono/dist/cjs/utils/headers.js +0 -0
- package/node_modules/hono/dist/cjs/utils/html.js +109 -0
- package/node_modules/hono/dist/cjs/utils/http-status.js +0 -0
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +247 -0
- package/node_modules/hono/dist/cjs/utils/jwt/index.js +15 -0
- package/node_modules/hono/dist/cjs/utils/jwt/jwa.js +25 -0
- package/node_modules/hono/dist/cjs/utils/jwt/jws.js +135 -0
- package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +136 -0
- package/node_modules/hono/dist/cjs/utils/jwt/types.js +124 -0
- package/node_modules/hono/dist/cjs/utils/jwt/utf8.js +11 -0
- package/node_modules/hono/dist/cjs/utils/mime.js +80 -0
- package/node_modules/hono/dist/cjs/utils/stream.js +89 -0
- package/node_modules/hono/dist/cjs/utils/types.js +0 -0
- package/node_modules/hono/dist/cjs/utils/url.js +215 -0
- package/node_modules/hono/dist/cjs/validator/index.js +3 -0
- package/node_modules/hono/dist/cjs/validator/utils.js +0 -0
- package/node_modules/hono/dist/cjs/validator/validator.js +65 -0
- package/node_modules/hono/dist/client/client.js +144 -0
- package/node_modules/hono/dist/client/fetch-result-please.js +65 -0
- package/node_modules/hono/dist/client/index.js +4 -0
- package/node_modules/hono/dist/client/types.js +1 -0
- package/node_modules/hono/dist/client/utils.js +62 -0
- package/node_modules/hono/dist/compose.js +50 -0
- package/node_modules/hono/dist/context.js +381 -0
- package/node_modules/hono/dist/helper/accepts/accepts.js +52 -0
- package/node_modules/hono/dist/helper/accepts/index.js +2 -0
- package/node_modules/hono/dist/helper/adapter/index.js +37 -0
- package/node_modules/hono/dist/helper/conninfo/index.js +1 -0
- package/node_modules/hono/dist/helper/conninfo/types.js +1 -0
- package/node_modules/hono/dist/helper/cookie/index.js +82 -0
- package/node_modules/hono/dist/helper/css/common.js +178 -0
- package/node_modules/hono/dist/helper/css/index.js +135 -0
- package/node_modules/hono/dist/helper/dev/index.js +50 -0
- package/node_modules/hono/dist/helper/factory/index.js +30 -0
- package/node_modules/hono/dist/helper/html/index.js +32 -0
- package/node_modules/hono/dist/helper/proxy/index.js +121 -0
- package/node_modules/hono/dist/helper/route/index.js +124 -0
- package/node_modules/hono/dist/helper/ssg/index.js +4 -0
- package/node_modules/hono/dist/helper/ssg/middleware.js +58 -0
- package/node_modules/hono/dist/helper/ssg/plugins.js +66 -0
- package/node_modules/hono/dist/helper/ssg/ssg.js +212 -0
- package/node_modules/hono/dist/helper/ssg/utils.js +65 -0
- package/node_modules/hono/dist/helper/streaming/index.js +4 -0
- package/node_modules/hono/dist/helper/streaming/sse.js +57 -0
- package/node_modules/hono/dist/helper/streaming/stream.js +25 -0
- package/node_modules/hono/dist/helper/streaming/text.js +11 -0
- package/node_modules/hono/dist/helper/streaming/utils.js +10 -0
- package/node_modules/hono/dist/helper/testing/index.js +17 -0
- package/node_modules/hono/dist/helper/websocket/index.js +53 -0
- package/node_modules/hono/dist/hono-base.js +348 -0
- package/node_modules/hono/dist/hono.js +28 -0
- package/node_modules/hono/dist/http-exception.js +55 -0
- package/node_modules/hono/dist/index.js +20 -0
- package/node_modules/hono/dist/jsx/base.js +251 -0
- package/node_modules/hono/dist/jsx/children.js +17 -0
- package/node_modules/hono/dist/jsx/components.js +145 -0
- package/node_modules/hono/dist/jsx/constants.js +9 -0
- package/node_modules/hono/dist/jsx/context.js +165 -0
- package/node_modules/hono/dist/jsx/dom/client.js +50 -0
- package/node_modules/hono/dist/jsx/dom/components.js +24 -0
- package/node_modules/hono/dist/jsx/dom/context.js +41 -0
- package/node_modules/hono/dist/jsx/dom/css.js +145 -0
- package/node_modules/hono/dist/jsx/dom/hooks/index.js +60 -0
- package/node_modules/hono/dist/jsx/dom/index.js +79 -0
- package/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +290 -0
- package/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +15 -0
- package/node_modules/hono/dist/jsx/dom/jsx-runtime.js +2 -0
- package/node_modules/hono/dist/jsx/dom/render.js +516 -0
- package/node_modules/hono/dist/jsx/dom/server.js +37 -0
- package/node_modules/hono/dist/jsx/dom/utils.js +8 -0
- package/node_modules/hono/dist/jsx/hooks/index.js +259 -0
- package/node_modules/hono/dist/jsx/index.js +50 -0
- package/node_modules/hono/dist/jsx/intrinsic-element/common.js +22 -0
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +124 -0
- package/node_modules/hono/dist/jsx/intrinsic-elements.js +1 -0
- package/node_modules/hono/dist/jsx/jsx-dev-runtime.js +14 -0
- package/node_modules/hono/dist/jsx/jsx-runtime.js +31 -0
- package/node_modules/hono/dist/jsx/streaming.js +132 -0
- package/node_modules/hono/dist/jsx/types.js +1 -0
- package/node_modules/hono/dist/jsx/utils.js +112 -0
- package/node_modules/hono/dist/middleware/basic-auth/index.js +99 -0
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +96 -0
- package/node_modules/hono/dist/middleware/body-limit/index.js +68 -0
- package/node_modules/hono/dist/middleware/cache/index.js +172 -0
- package/node_modules/hono/dist/middleware/combine/index.js +136 -0
- package/node_modules/hono/dist/middleware/compress/index.js +80 -0
- package/node_modules/hono/dist/middleware/context-storage/index.js +53 -0
- package/node_modules/hono/dist/middleware/cors/index.js +108 -0
- package/node_modules/hono/dist/middleware/csrf/index.js +105 -0
- package/node_modules/hono/dist/middleware/etag/digest.js +61 -0
- package/node_modules/hono/dist/middleware/etag/index.js +77 -0
- package/node_modules/hono/dist/middleware/ip-restriction/index.js +167 -0
- package/node_modules/hono/dist/middleware/jsx-renderer/index.js +101 -0
- package/node_modules/hono/dist/middleware/jwk/index.js +2 -0
- package/node_modules/hono/dist/middleware/jwk/jwk.js +121 -0
- package/node_modules/hono/dist/middleware/jwt/index.js +3 -0
- package/node_modules/hono/dist/middleware/jwt/jwt.js +119 -0
- package/node_modules/hono/dist/middleware/language/index.js +2 -0
- package/node_modules/hono/dist/middleware/language/language.js +198 -0
- package/node_modules/hono/dist/middleware/logger/index.js +50 -0
- package/node_modules/hono/dist/middleware/method-not-allowed/index.js +83 -0
- package/node_modules/hono/dist/middleware/method-override/index.js +104 -0
- package/node_modules/hono/dist/middleware/powered-by/index.js +24 -0
- package/node_modules/hono/dist/middleware/pretty-json/index.js +40 -0
- package/node_modules/hono/dist/middleware/request-id/index.js +2 -0
- package/node_modules/hono/dist/middleware/request-id/request-id.js +34 -0
- package/node_modules/hono/dist/middleware/secure-headers/index.js +2 -0
- package/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js +1 -0
- package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +164 -0
- package/node_modules/hono/dist/middleware/serve-static/index.js +60 -0
- package/node_modules/hono/dist/middleware/serve-static/path.js +16 -0
- package/node_modules/hono/dist/middleware/timeout/index.js +42 -0
- package/node_modules/hono/dist/middleware/timing/index.js +2 -0
- package/node_modules/hono/dist/middleware/timing/timing.js +184 -0
- package/node_modules/hono/dist/middleware/trailing-slash/index.js +87 -0
- package/node_modules/hono/dist/preset/quick.js +18 -0
- package/node_modules/hono/dist/preset/tiny.js +15 -0
- package/node_modules/hono/dist/request/constants.js +4 -0
- package/node_modules/hono/dist/request.js +335 -0
- package/node_modules/hono/dist/router/linear-router/index.js +2 -0
- package/node_modules/hono/dist/router/linear-router/router.js +96 -0
- package/node_modules/hono/dist/router/pattern-router/index.js +2 -0
- package/node_modules/hono/dist/router/pattern-router/router.js +41 -0
- package/node_modules/hono/dist/router/reg-exp-router/index.js +3 -0
- package/node_modules/hono/dist/router/reg-exp-router/matcher.js +19 -0
- package/node_modules/hono/dist/router/reg-exp-router/node.js +91 -0
- package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +94 -0
- package/node_modules/hono/dist/router/reg-exp-router/router.js +101 -0
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +73 -0
- package/node_modules/hono/dist/router/smart-router/index.js +2 -0
- package/node_modules/hono/dist/router/smart-router/router.js +49 -0
- package/node_modules/hono/dist/router/trie-router/index.js +2 -0
- package/node_modules/hono/dist/router/trie-router/node.js +134 -0
- package/node_modules/hono/dist/router/trie-router/router.js +15 -0
- package/node_modules/hono/dist/router/utils.js +4 -0
- package/node_modules/hono/dist/router.js +35 -0
- package/node_modules/hono/dist/types/package.json +3 -0
- package/node_modules/hono/dist/types.js +4 -0
- package/node_modules/hono/dist/utils/accept.js +193 -0
- package/node_modules/hono/dist/utils/basic-auth.js +20 -0
- package/node_modules/hono/dist/utils/body.js +96 -0
- package/node_modules/hono/dist/utils/buffer.js +51 -0
- package/node_modules/hono/dist/utils/color.js +37 -0
- package/node_modules/hono/dist/utils/compress.js +11 -0
- package/node_modules/hono/dist/utils/concurrent.js +30 -0
- package/node_modules/hono/dist/utils/constants.js +7 -0
- package/node_modules/hono/dist/utils/cookie.js +125 -0
- package/node_modules/hono/dist/utils/crypto.js +34 -0
- package/node_modules/hono/dist/utils/encode.js +33 -0
- package/node_modules/hono/dist/utils/filepath.js +25 -0
- package/node_modules/hono/dist/utils/handler.js +12 -0
- package/node_modules/hono/dist/utils/headers.js +1 -0
- package/node_modules/hono/dist/utils/html.js +103 -0
- package/node_modules/hono/dist/utils/http-status.js +1 -0
- package/node_modules/hono/dist/utils/ipaddr.js +238 -0
- package/node_modules/hono/dist/utils/jwt/index.js +14 -0
- package/node_modules/hono/dist/utils/jwt/jwa.js +24 -0
- package/node_modules/hono/dist/utils/jwt/jws.js +133 -0
- package/node_modules/hono/dist/utils/jwt/jwt.js +130 -0
- package/node_modules/hono/dist/utils/jwt/types.js +108 -0
- package/node_modules/hono/dist/utils/jwt/utf8.js +9 -0
- package/node_modules/hono/dist/utils/mime.js +77 -0
- package/node_modules/hono/dist/utils/stream.js +88 -0
- package/node_modules/hono/dist/utils/types.js +1 -0
- package/node_modules/hono/dist/utils/url.js +201 -0
- package/node_modules/hono/dist/validator/index.js +2 -0
- package/node_modules/hono/dist/validator/utils.js +1 -0
- package/node_modules/hono/dist/validator/validator.js +64 -0
- package/node_modules/hono/package.json +706 -0
- package/node_modules/http-errors/index.js +290 -0
- package/node_modules/http-errors/package.json +54 -0
- package/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/node_modules/iconv-lite/encodings/index.js +23 -0
- package/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/node_modules/iconv-lite/encodings/sbcs-data.js +180 -0
- package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/node_modules/iconv-lite/encodings/utf32.js +314 -0
- package/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/node_modules/iconv-lite/lib/index.js +182 -0
- package/node_modules/iconv-lite/lib/streams.js +105 -0
- package/node_modules/iconv-lite/package.json +70 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/ip-address/dist/address-error.js +12 -0
- package/node_modules/ip-address/dist/common.js +154 -0
- package/node_modules/ip-address/dist/ip-address.js +35 -0
- package/node_modules/ip-address/dist/ipv4.js +595 -0
- package/node_modules/ip-address/dist/ipv6.js +1458 -0
- package/node_modules/ip-address/dist/v4/constants.js +51 -0
- package/node_modules/ip-address/dist/v6/constants.js +128 -0
- package/node_modules/ip-address/dist/v6/helpers.js +54 -0
- package/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
- package/node_modules/ip-address/package.json +90 -0
- package/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/node_modules/ipaddr.js/package.json +35 -0
- package/node_modules/is-promise/index.js +6 -0
- package/node_modules/is-promise/index.mjs +3 -0
- package/node_modules/is-promise/package.json +30 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/jose/dist/webapi/index.js +70 -0
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -0
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +26 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +15 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +35 -0
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +40 -0
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +105 -0
- package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -0
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +55 -0
- package/node_modules/jose/dist/webapi/jwks/local.js +59 -0
- package/node_modules/jose/dist/webapi/jwks/remote.js +101 -0
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +20 -0
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +8 -0
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +23 -0
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +12 -0
- package/node_modules/jose/dist/webapi/jws/general/sign.js +58 -0
- package/node_modules/jose/dist/webapi/jws/general/verify.js +48 -0
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -0
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +45 -0
- package/node_modules/jose/dist/webapi/jwt/sign.js +19 -0
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +34 -0
- package/node_modules/jose/dist/webapi/jwt/verify.js +13 -0
- package/node_modules/jose/dist/webapi/key/export.js +35 -0
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +35 -0
- package/node_modules/jose/dist/webapi/key/generate_secret.js +36 -0
- package/node_modules/jose/dist/webapi/key/import.js +53 -0
- package/node_modules/jose/dist/webapi/lib/asn1.js +138 -0
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +75 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +90 -0
- package/node_modules/jose/dist/webapi/lib/deflate.js +40 -0
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +116 -0
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +187 -0
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +75 -0
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +74 -0
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +46 -0
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +86 -0
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +146 -0
- package/node_modules/jose/dist/webapi/lib/key.js +155 -0
- package/node_modules/jose/dist/webapi/lib/key_algorithm.js +15 -0
- package/node_modules/jose/dist/webapi/lib/key_descriptor.js +9 -0
- package/node_modules/jose/dist/webapi/lib/key_management.js +196 -0
- package/node_modules/jose/dist/webapi/lib/validate.js +122 -0
- package/node_modules/jose/dist/webapi/util/base64url.js +16 -0
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +33 -0
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +19 -0
- package/node_modules/jose/dist/webapi/util/errors.js +109 -0
- package/node_modules/jose/package.json +134 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/json-schema-typed/draft_07.js +328 -0
- package/node_modules/json-schema-typed/draft_2019_09.js +349 -0
- package/node_modules/json-schema-typed/draft_2020_12.js +352 -0
- package/node_modules/json-schema-typed/package.json +44 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/media-typer/index.js +135 -0
- package/node_modules/media-typer/package.json +37 -0
- package/node_modules/merge-descriptors/index.js +26 -0
- package/node_modules/merge-descriptors/package.json +50 -0
- package/node_modules/mime-db/db.json +9342 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +56 -0
- package/node_modules/mime-types/index.js +211 -0
- package/node_modules/mime-types/mimeScore.js +57 -0
- package/node_modules/mime-types/package.json +49 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/negotiator/index.js +83 -0
- package/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/negotiator/lib/charset.js +145 -0
- package/node_modules/negotiator/lib/encoding.js +184 -0
- package/node_modules/negotiator/lib/language.js +158 -0
- package/node_modules/negotiator/lib/mediaType.js +176 -0
- package/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/negotiator/package.json +49 -0
- package/node_modules/object-assign/index.js +90 -0
- package/node_modules/object-assign/package.json +42 -0
- package/node_modules/object-inspect/.eslintrc +53 -0
- package/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/node_modules/object-inspect/.nycrc +13 -0
- package/node_modules/object-inspect/example/all.js +23 -0
- package/node_modules/object-inspect/example/circular.js +6 -0
- package/node_modules/object-inspect/example/fn.js +5 -0
- package/node_modules/object-inspect/example/inspect.js +10 -0
- package/node_modules/object-inspect/index.js +544 -0
- package/node_modules/object-inspect/package-support.json +20 -0
- package/node_modules/object-inspect/package.json +105 -0
- package/node_modules/object-inspect/test-core-js.js +26 -0
- package/node_modules/object-inspect/util.inspect.js +1 -0
- package/node_modules/on-finished/index.js +234 -0
- package/node_modules/on-finished/package.json +39 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/parseurl/index.js +158 -0
- package/node_modules/parseurl/package.json +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-to-regexp/dist/index.js +431 -0
- package/node_modules/path-to-regexp/package.json +64 -0
- package/node_modules/pkce-challenge/dist/index.browser.js +75 -0
- package/node_modules/pkce-challenge/dist/index.node.cjs +83 -0
- package/node_modules/pkce-challenge/dist/index.node.d.cts +19 -0
- package/node_modules/pkce-challenge/dist/index.node.js +78 -0
- package/node_modules/pkce-challenge/package.json +59 -0
- package/node_modules/proxy-addr/index.js +359 -0
- package/node_modules/proxy-addr/package.json +51 -0
- package/node_modules/pvtsutils/build/index.es.js +393 -0
- package/node_modules/pvtsutils/build/index.js +399 -0
- package/node_modules/pvtsutils/package.json +76 -0
- package/node_modules/pvutils/build/utils.es.js +340 -0
- package/node_modules/pvutils/build/utils.js +361 -0
- package/node_modules/pvutils/package.json +63 -0
- package/node_modules/qs/.editorconfig +46 -0
- package/node_modules/qs/.github/FUNDING.yml +12 -0
- package/node_modules/qs/.nycrc +13 -0
- package/node_modules/qs/dist/qs.js +141 -0
- package/node_modules/qs/eslint.config.mjs +57 -0
- package/node_modules/qs/lib/formats.js +23 -0
- package/node_modules/qs/lib/index.js +11 -0
- package/node_modules/qs/lib/parse.js +413 -0
- package/node_modules/qs/lib/stringify.js +378 -0
- package/node_modules/qs/lib/utils.js +388 -0
- package/node_modules/qs/package.json +95 -0
- package/node_modules/range-parser/index.js +181 -0
- package/node_modules/range-parser/package.json +48 -0
- package/node_modules/raw-body/index.js +336 -0
- package/node_modules/raw-body/package.json +46 -0
- package/node_modules/reflect-metadata/CopyrightNotice.txt +15 -0
- package/node_modules/reflect-metadata/Reflect.js +1415 -0
- package/node_modules/reflect-metadata/ReflectLite.js +1137 -0
- package/node_modules/reflect-metadata/ReflectNoConflict.js +1111 -0
- package/node_modules/reflect-metadata/package.json +68 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/router/index.js +748 -0
- package/node_modules/router/lib/layer.js +247 -0
- package/node_modules/router/lib/route.js +242 -0
- package/node_modules/router/package.json +44 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/send/index.js +997 -0
- package/node_modules/send/package.json +63 -0
- package/node_modules/serve-static/index.js +208 -0
- package/node_modules/serve-static/package.json +44 -0
- package/node_modules/setprototypeof/index.js +17 -0
- package/node_modules/setprototypeof/package.json +38 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/side-channel/.editorconfig +9 -0
- package/node_modules/side-channel/.eslintrc +12 -0
- package/node_modules/side-channel/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel/.nycrc +13 -0
- package/node_modules/side-channel/index.js +46 -0
- package/node_modules/side-channel/package.json +85 -0
- package/node_modules/side-channel/tsconfig.json +9 -0
- package/node_modules/side-channel-list/.editorconfig +9 -0
- package/node_modules/side-channel-list/.eslintrc +11 -0
- package/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-list/.nycrc +13 -0
- package/node_modules/side-channel-list/index.js +111 -0
- package/node_modules/side-channel-list/package.json +77 -0
- package/node_modules/side-channel-list/tsconfig.json +9 -0
- package/node_modules/side-channel-map/.editorconfig +9 -0
- package/node_modules/side-channel-map/.eslintrc +11 -0
- package/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-map/.nycrc +13 -0
- package/node_modules/side-channel-map/index.js +68 -0
- package/node_modules/side-channel-map/package.json +80 -0
- package/node_modules/side-channel-map/tsconfig.json +9 -0
- package/node_modules/side-channel-weakmap/.editorconfig +9 -0
- package/node_modules/side-channel-weakmap/.eslintrc +12 -0
- package/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-weakmap/.nycrc +13 -0
- package/node_modules/side-channel-weakmap/index.js +84 -0
- package/node_modules/side-channel-weakmap/package.json +87 -0
- package/node_modules/side-channel-weakmap/tsconfig.json +9 -0
- package/node_modules/statuses/codes.json +65 -0
- package/node_modules/statuses/index.js +146 -0
- package/node_modules/statuses/package.json +49 -0
- package/node_modules/toidentifier/index.js +32 -0
- package/node_modules/toidentifier/package.json +38 -0
- package/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/tslib/modules/index.js +70 -0
- package/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/tslib/package.json +47 -0
- package/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/tslib/tslib.es6.js +402 -0
- package/node_modules/tslib/tslib.es6.mjs +401 -0
- package/node_modules/tslib/tslib.html +1 -0
- package/node_modules/tslib/tslib.js +484 -0
- package/node_modules/tsyringe/dist/cjs/decorators/auto-injectable.js +46 -0
- package/node_modules/tsyringe/dist/cjs/decorators/index.js +20 -0
- package/node_modules/tsyringe/dist/cjs/decorators/inject-all-with-transform.js +13 -0
- package/node_modules/tsyringe/dist/cjs/decorators/inject-all.js +12 -0
- package/node_modules/tsyringe/dist/cjs/decorators/inject-with-transform.js +10 -0
- package/node_modules/tsyringe/dist/cjs/decorators/inject.js +12 -0
- package/node_modules/tsyringe/dist/cjs/decorators/injectable.js +21 -0
- package/node_modules/tsyringe/dist/cjs/decorators/registry.js +14 -0
- package/node_modules/tsyringe/dist/cjs/decorators/scoped.js +13 -0
- package/node_modules/tsyringe/dist/cjs/decorators/singleton.js +11 -0
- package/node_modules/tsyringe/dist/cjs/dependency-container.js +341 -0
- package/node_modules/tsyringe/dist/cjs/error-helpers.js +19 -0
- package/node_modules/tsyringe/dist/cjs/factories/factory-function.js +2 -0
- package/node_modules/tsyringe/dist/cjs/factories/index.js +8 -0
- package/node_modules/tsyringe/dist/cjs/factories/instance-caching-factory.js +12 -0
- package/node_modules/tsyringe/dist/cjs/factories/instance-per-container-caching-factory.js +14 -0
- package/node_modules/tsyringe/dist/cjs/factories/predicate-aware-class-factory.js +19 -0
- package/node_modules/tsyringe/dist/cjs/index.js +15 -0
- package/node_modules/tsyringe/dist/cjs/interceptors.js +17 -0
- package/node_modules/tsyringe/dist/cjs/lazy-helpers.js +54 -0
- package/node_modules/tsyringe/dist/cjs/providers/class-provider.js +7 -0
- package/node_modules/tsyringe/dist/cjs/providers/factory-provider.js +7 -0
- package/node_modules/tsyringe/dist/cjs/providers/index.js +12 -0
- package/node_modules/tsyringe/dist/cjs/providers/injection-token.js +24 -0
- package/node_modules/tsyringe/dist/cjs/providers/provider.js +14 -0
- package/node_modules/tsyringe/dist/cjs/providers/token-provider.js +7 -0
- package/node_modules/tsyringe/dist/cjs/providers/value-provider.js +7 -0
- package/node_modules/tsyringe/dist/cjs/reflection-helpers.js +27 -0
- package/node_modules/tsyringe/dist/cjs/registry-base.js +39 -0
- package/node_modules/tsyringe/dist/cjs/registry.js +6 -0
- package/node_modules/tsyringe/dist/cjs/resolution-context.js +8 -0
- package/node_modules/tsyringe/dist/cjs/types/constructor.js +2 -0
- package/node_modules/tsyringe/dist/cjs/types/dependency-container.js +2 -0
- package/node_modules/tsyringe/dist/cjs/types/dictionary.js +2 -0
- package/node_modules/tsyringe/dist/cjs/types/disposable.js +13 -0
- package/node_modules/tsyringe/dist/cjs/types/frequency.js +2 -0
- package/node_modules/tsyringe/dist/cjs/types/index.js +4 -0
- package/node_modules/tsyringe/dist/cjs/types/interceptor-options.js +2 -0
- package/node_modules/tsyringe/dist/cjs/types/lifecycle.js +10 -0
- package/node_modules/tsyringe/dist/cjs/types/registration-options.js +2 -0
- package/node_modules/tsyringe/dist/cjs/types/transform.js +2 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/auto-injectable.js +44 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/index.js +9 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/inject-all-with-transform.js +11 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/inject-all.js +10 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/inject-with-transform.js +8 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/inject.js +10 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/injectable.js +19 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/registry.js +12 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/scoped.js +10 -0
- package/node_modules/tsyringe/dist/esm2015/decorators/singleton.js +9 -0
- package/node_modules/tsyringe/dist/esm2015/dependency-container.js +338 -0
- package/node_modules/tsyringe/dist/esm2015/error-helpers.js +15 -0
- package/node_modules/tsyringe/dist/esm2015/factories/factory-function.js +0 -0
- package/node_modules/tsyringe/dist/esm2015/factories/index.js +3 -0
- package/node_modules/tsyringe/dist/esm2015/factories/instance-caching-factory.js +9 -0
- package/node_modules/tsyringe/dist/esm2015/factories/instance-per-container-caching-factory.js +11 -0
- package/node_modules/tsyringe/dist/esm2015/factories/predicate-aware-class-factory.js +16 -0
- package/node_modules/tsyringe/dist/esm2015/index.js +9 -0
- package/node_modules/tsyringe/dist/esm2015/interceptors.js +11 -0
- package/node_modules/tsyringe/dist/esm2015/lazy-helpers.js +49 -0
- package/node_modules/tsyringe/dist/esm2015/providers/class-provider.js +3 -0
- package/node_modules/tsyringe/dist/esm2015/providers/factory-provider.js +3 -0
- package/node_modules/tsyringe/dist/esm2015/providers/index.js +5 -0
- package/node_modules/tsyringe/dist/esm2015/providers/injection-token.js +17 -0
- package/node_modules/tsyringe/dist/esm2015/providers/provider.js +10 -0
- package/node_modules/tsyringe/dist/esm2015/providers/token-provider.js +3 -0
- package/node_modules/tsyringe/dist/esm2015/providers/value-provider.js +3 -0
- package/node_modules/tsyringe/dist/esm2015/reflection-helpers.js +22 -0
- package/node_modules/tsyringe/dist/esm2015/registry-base.js +36 -0
- package/node_modules/tsyringe/dist/esm2015/registry.js +3 -0
- package/node_modules/tsyringe/dist/esm2015/resolution-context.js +5 -0
- package/node_modules/tsyringe/dist/esm2015/types/constructor.js +0 -0
- package/node_modules/tsyringe/dist/esm2015/types/dependency-container.js +0 -0
- package/node_modules/tsyringe/dist/esm2015/types/dictionary.js +0 -0
- package/node_modules/tsyringe/dist/esm2015/types/disposable.js +9 -0
- package/node_modules/tsyringe/dist/esm2015/types/frequency.js +0 -0
- package/node_modules/tsyringe/dist/esm2015/types/index.js +1 -0
- package/node_modules/tsyringe/dist/esm2015/types/interceptor-options.js +0 -0
- package/node_modules/tsyringe/dist/esm2015/types/lifecycle.js +8 -0
- package/node_modules/tsyringe/dist/esm2015/types/registration-options.js +0 -0
- package/node_modules/tsyringe/dist/esm2015/types/transform.js +0 -0
- package/node_modules/tsyringe/dist/esm5/decorators/auto-injectable.js +48 -0
- package/node_modules/tsyringe/dist/esm5/decorators/index.js +9 -0
- package/node_modules/tsyringe/dist/esm5/decorators/inject-all-with-transform.js +15 -0
- package/node_modules/tsyringe/dist/esm5/decorators/inject-all.js +10 -0
- package/node_modules/tsyringe/dist/esm5/decorators/inject-with-transform.js +12 -0
- package/node_modules/tsyringe/dist/esm5/decorators/inject.js +10 -0
- package/node_modules/tsyringe/dist/esm5/decorators/injectable.js +19 -0
- package/node_modules/tsyringe/dist/esm5/decorators/registry.js +13 -0
- package/node_modules/tsyringe/dist/esm5/decorators/scoped.js +10 -0
- package/node_modules/tsyringe/dist/esm5/decorators/singleton.js +9 -0
- package/node_modules/tsyringe/dist/esm5/dependency-container.js +410 -0
- package/node_modules/tsyringe/dist/esm5/error-helpers.js +17 -0
- package/node_modules/tsyringe/dist/esm5/factories/factory-function.js +0 -0
- package/node_modules/tsyringe/dist/esm5/factories/index.js +3 -0
- package/node_modules/tsyringe/dist/esm5/factories/instance-caching-factory.js +9 -0
- package/node_modules/tsyringe/dist/esm5/factories/instance-per-container-caching-factory.js +11 -0
- package/node_modules/tsyringe/dist/esm5/factories/predicate-aware-class-factory.js +17 -0
- package/node_modules/tsyringe/dist/esm5/index.js +9 -0
- package/node_modules/tsyringe/dist/esm5/interceptors.js +26 -0
- package/node_modules/tsyringe/dist/esm5/lazy-helpers.js +57 -0
- package/node_modules/tsyringe/dist/esm5/providers/class-provider.js +3 -0
- package/node_modules/tsyringe/dist/esm5/providers/factory-provider.js +3 -0
- package/node_modules/tsyringe/dist/esm5/providers/index.js +5 -0
- package/node_modules/tsyringe/dist/esm5/providers/injection-token.js +17 -0
- package/node_modules/tsyringe/dist/esm5/providers/provider.js +10 -0
- package/node_modules/tsyringe/dist/esm5/providers/token-provider.js +3 -0
- package/node_modules/tsyringe/dist/esm5/providers/value-provider.js +3 -0
- package/node_modules/tsyringe/dist/esm5/reflection-helpers.js +22 -0
- package/node_modules/tsyringe/dist/esm5/registry-base.js +38 -0
- package/node_modules/tsyringe/dist/esm5/registry.js +10 -0
- package/node_modules/tsyringe/dist/esm5/resolution-context.js +7 -0
- package/node_modules/tsyringe/dist/esm5/types/constructor.js +0 -0
- package/node_modules/tsyringe/dist/esm5/types/dependency-container.js +0 -0
- package/node_modules/tsyringe/dist/esm5/types/dictionary.js +0 -0
- package/node_modules/tsyringe/dist/esm5/types/disposable.js +9 -0
- package/node_modules/tsyringe/dist/esm5/types/frequency.js +0 -0
- package/node_modules/tsyringe/dist/esm5/types/index.js +1 -0
- package/node_modules/tsyringe/dist/esm5/types/interceptor-options.js +0 -0
- package/node_modules/tsyringe/dist/esm5/types/lifecycle.js +8 -0
- package/node_modules/tsyringe/dist/esm5/types/registration-options.js +0 -0
- package/node_modules/tsyringe/dist/esm5/types/transform.js +0 -0
- package/node_modules/tsyringe/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/tsyringe/node_modules/tslib/modules/index.js +51 -0
- package/node_modules/tsyringe/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/tsyringe/node_modules/tslib/package.json +37 -0
- package/node_modules/tsyringe/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/tsyringe/node_modules/tslib/tslib.es6.js +218 -0
- package/node_modules/tsyringe/node_modules/tslib/tslib.html +1 -0
- package/node_modules/tsyringe/node_modules/tslib/tslib.js +284 -0
- package/node_modules/tsyringe/package.json +63 -0
- package/node_modules/type-is/index.js +240 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/type-is/node_modules/content-type/package.json +52 -0
- package/node_modules/type-is/package.json +51 -0
- package/node_modules/unpipe/index.js +69 -0
- package/node_modules/unpipe/package.json +27 -0
- package/node_modules/vary/index.js +149 -0
- package/node_modules/vary/package.json +43 -0
- package/node_modules/which/bin/node-which +52 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +52 -0
- package/node_modules/zod/index.d.cts +3 -0
- package/node_modules/zod/index.js +7 -0
- package/node_modules/zod/locales/index.cjs +36 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +51 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +147 -0
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/node_modules/zod/src/v4/classic/external.ts +57 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
- package/node_modules/zod/src/v4/core/api.ts +1875 -0
- package/node_modules/zod/src/v4/core/checks.ts +1266 -0
- package/node_modules/zod/src/v4/core/compile.ts +2313 -0
- package/node_modules/zod/src/v4/core/core.ts +230 -0
- package/node_modules/zod/src/v4/core/doc.ts +52 -0
- package/node_modules/zod/src/v4/core/errors.ts +543 -0
- package/node_modules/zod/src/v4/core/index.ts +19 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +309 -0
- package/node_modules/zod/src/v4/core/regexes.ts +217 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +5192 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
- package/node_modules/zod/src/v4/core/util.ts +1280 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +120 -0
- package/node_modules/zod/src/v4/locales/az.ts +116 -0
- package/node_modules/zod/src/v4/locales/be.ts +188 -0
- package/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +121 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +123 -0
- package/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/node_modules/zod/src/v4/locales/de.ts +121 -0
- package/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +136 -0
- package/node_modules/zod/src/v4/locales/eo.ts +123 -0
- package/node_modules/zod/src/v4/locales/es.ts +145 -0
- package/node_modules/zod/src/v4/locales/fa.ts +131 -0
- package/node_modules/zod/src/v4/locales/fi.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr.ts +139 -0
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +253 -0
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/node_modules/zod/src/v4/locales/hu.ts +122 -0
- package/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/node_modules/zod/src/v4/locales/id.ts +120 -0
- package/node_modules/zod/src/v4/locales/index.ts +63 -0
- package/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/node_modules/zod/src/v4/locales/it.ts +121 -0
- package/node_modules/zod/src/v4/locales/ja.ts +119 -0
- package/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +126 -0
- package/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/node_modules/zod/src/v4/locales/mk.ts +123 -0
- package/node_modules/zod/src/v4/locales/ms.ts +120 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +121 -0
- package/node_modules/zod/src/v4/locales/ota.ts +122 -0
- package/node_modules/zod/src/v4/locales/pl.ts +123 -0
- package/node_modules/zod/src/v4/locales/ps.ts +131 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +159 -0
- package/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/node_modules/zod/src/v4/locales/ru.ts +188 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +123 -0
- package/node_modules/zod/src/v4/locales/sv.ts +124 -0
- package/node_modules/zod/src/v4/locales/ta.ts +123 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +124 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +116 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/node_modules/zod/src/v4/locales/ur.ts +124 -0
- package/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/node_modules/zod/src/v4/locales/vi.ts +122 -0
- package/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
- package/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +52 -0
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +167 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.js +143 -0
- package/node_modules/zod/v3/errors.cjs +36 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +41 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +156 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +52 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +21 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3798 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.js +3697 -0
- package/node_modules/zod/v4/classic/checks.cjs +53 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +66 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +80 -0
- package/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +102 -0
- package/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/node_modules/zod/v4/classic/errors.js +57 -0
- package/node_modules/zod/v4/classic/external.cjs +97 -0
- package/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/node_modules/zod/v4/classic/external.js +17 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +52 -0
- package/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +68 -0
- package/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/node_modules/zod/v4/classic/iso.js +15 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +63 -0
- package/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/node_modules/zod/v4/classic/parse.js +16 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
- package/node_modules/zod/v4/classic/schemas.js +1535 -0
- package/node_modules/zod/v4/core/api.cjs +1269 -0
- package/node_modules/zod/v4/core/api.d.cts +335 -0
- package/node_modules/zod/v4/core/api.js +1107 -0
- package/node_modules/zod/v4/core/checks.cjs +561 -0
- package/node_modules/zod/v4/core/checks.d.cts +294 -0
- package/node_modules/zod/v4/core/checks.js +516 -0
- package/node_modules/zod/v4/core/compile.cjs +1908 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.js +1858 -0
- package/node_modules/zod/v4/core/core.cjs +167 -0
- package/node_modules/zod/v4/core/core.d.cts +82 -0
- package/node_modules/zod/v4/core/core.js +141 -0
- package/node_modules/zod/v4/core/doc.cjs +61 -0
- package/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/node_modules/zod/v4/core/doc.js +38 -0
- package/node_modules/zod/v4/core/errors.cjs +317 -0
- package/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/node_modules/zod/v4/core/errors.js +267 -0
- package/node_modules/zod/v4/core/index.cjs +70 -0
- package/node_modules/zod/v4/core/index.d.cts +19 -0
- package/node_modules/zod/v4/core/index.js +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/node_modules/zod/v4/core/json-schema.cjs +21 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +233 -0
- package/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/node_modules/zod/v4/core/parse.js +175 -0
- package/node_modules/zod/v4/core/regexes.cjs +209 -0
- package/node_modules/zod/v4/core/regexes.d.cts +90 -0
- package/node_modules/zod/v4/core/regexes.js +156 -0
- package/node_modules/zod/v4/core/registries.cjs +75 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2669 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1273 -0
- package/node_modules/zod/v4/core/schemas.js +2606 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.js +651 -0
- package/node_modules/zod/v4/core/util.cjs +949 -0
- package/node_modules/zod/v4/core/util.d.cts +278 -0
- package/node_modules/zod/v4/core/util.js +859 -0
- package/node_modules/zod/v4/core/versions.cjs +27 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/core/visit.cjs +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +51 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.js +4 -0
- package/node_modules/zod/v4/locales/ar.cjs +138 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.js +111 -0
- package/node_modules/zod/v4/locales/az.cjs +137 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.js +110 -0
- package/node_modules/zod/v4/locales/be.cjs +195 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.js +168 -0
- package/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.js +125 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +139 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.js +112 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +143 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.js +116 -0
- package/node_modules/zod/v4/locales/da.cjs +147 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.js +120 -0
- package/node_modules/zod/v4/locales/de.cjs +140 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.js +113 -0
- package/node_modules/zod/v4/locales/el.cjs +139 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.js +112 -0
- package/node_modules/zod/v4/locales/en.cjs +152 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.js +125 -0
- package/node_modules/zod/v4/locales/eo.cjs +141 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.js +114 -0
- package/node_modules/zod/v4/locales/es.cjs +163 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.js +136 -0
- package/node_modules/zod/v4/locales/fa.cjs +146 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.js +119 -0
- package/node_modules/zod/v4/locales/fi.cjs +144 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.js +117 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.js +112 -0
- package/node_modules/zod/v4/locales/fr.cjs +156 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.js +129 -0
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +248 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.js +221 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +153 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.js +126 -0
- package/node_modules/zod/v4/locales/hu.cjs +140 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.js +113 -0
- package/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.js +158 -0
- package/node_modules/zod/v4/locales/id.cjs +138 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.js +111 -0
- package/node_modules/zod/v4/locales/index.cjs +152 -0
- package/node_modules/zod/v4/locales/index.d.cts +63 -0
- package/node_modules/zod/v4/locales/index.js +63 -0
- package/node_modules/zod/v4/locales/is.cjs +141 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.js +114 -0
- package/node_modules/zod/v4/locales/it.cjs +140 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.js +113 -0
- package/node_modules/zod/v4/locales/ja.cjs +139 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.js +112 -0
- package/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.js +117 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +142 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.js +115 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +143 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.js +116 -0
- package/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.js +207 -0
- package/node_modules/zod/v4/locales/mk.cjs +141 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.js +114 -0
- package/node_modules/zod/v4/locales/ms.cjs +139 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.js +112 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +142 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.js +115 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +140 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.js +113 -0
- package/node_modules/zod/v4/locales/ota.cjs +141 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.js +114 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +141 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.js +114 -0
- package/node_modules/zod/v4/locales/ps.cjs +146 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.js +119 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +169 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.js +142 -0
- package/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.js +122 -0
- package/node_modules/zod/v4/locales/ru.cjs +195 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.js +168 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +141 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.js +114 -0
- package/node_modules/zod/v4/locales/sv.cjs +142 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.js +115 -0
- package/node_modules/zod/v4/locales/ta.cjs +142 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.js +115 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +142 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.js +115 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +137 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.js +110 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +140 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.js +113 -0
- package/node_modules/zod/v4/locales/ur.cjs +142 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.js +115 -0
- package/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.js +113 -0
- package/node_modules/zod/v4/locales/vi.cjs +140 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.js +113 -0
- package/node_modules/zod/v4/locales/yo.cjs +139 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.js +112 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.js +114 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.js +112 -0
- package/node_modules/zod/v4/mini/checks.cjs +54 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +71 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +95 -0
- package/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/node_modules/zod/v4/mini/external.js +16 -0
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +51 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +83 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +37 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
- package/node_modules/zod/v4/mini/schemas.js +1002 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +51 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/node_modules/zod-to-json-schema/.github/CR_logotype-full-color.png +0 -0
- package/node_modules/zod-to-json-schema/.github/FUNDING.yml +1 -0
- package/node_modules/zod-to-json-schema/.prettierrc.json +1 -0
- package/node_modules/zod-to-json-schema/createIndex.ts +32 -0
- package/node_modules/zod-to-json-schema/dist/cjs/Options.js +51 -0
- package/node_modules/zod-to-json-schema/dist/cjs/Refs.js +26 -0
- package/node_modules/zod-to-json-schema/dist/cjs/errorMessages.js +19 -0
- package/node_modules/zod-to-json-schema/dist/cjs/getRelativePath.js +12 -0
- package/node_modules/zod-to-json-schema/dist/cjs/index.js +56 -0
- package/node_modules/zod-to-json-schema/dist/cjs/package.json +1 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parseDef.js +66 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parseTypes.js +2 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/any.js +21 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/array.js +30 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/bigint.js +53 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/boolean.js +9 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/branded.js +8 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/catch.js +8 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/date.js +50 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/default.js +11 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/effects.js +11 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/enum.js +10 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/intersection.js +56 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/literal.js +25 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/map.js +30 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/nativeEnum.js +20 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/never.js +15 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/null.js +14 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/nullable.js +37 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/number.js +56 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/object.js +76 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/optional.js +25 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/pipeline.js +24 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/promise.js +8 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/readonly.js +8 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/record.js +65 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/set.js +24 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/string.js +356 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/tuple.js +36 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/undefined.js +10 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/union.js +84 -0
- package/node_modules/zod-to-json-schema/dist/cjs/parsers/unknown.js +8 -0
- package/node_modules/zod-to-json-schema/dist/cjs/selectParser.js +109 -0
- package/node_modules/zod-to-json-schema/dist/cjs/zodToJsonSchema.js +90 -0
- package/node_modules/zod-to-json-schema/dist/esm/Options.js +46 -0
- package/node_modules/zod-to-json-schema/dist/esm/Refs.js +22 -0
- package/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +14 -0
- package/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +8 -0
- package/node_modules/zod-to-json-schema/dist/esm/index.js +40 -0
- package/node_modules/zod-to-json-schema/dist/esm/package.json +1 -0
- package/node_modules/zod-to-json-schema/dist/esm/parseDef.js +62 -0
- package/node_modules/zod-to-json-schema/dist/esm/parseTypes.js +1 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +17 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +26 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +49 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +5 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +4 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +4 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +46 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +7 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +7 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +6 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +52 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +21 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +26 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +16 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +11 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +10 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +33 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +52 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +72 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +21 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +20 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +4 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +4 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +61 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +20 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +352 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +32 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +6 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +80 -0
- package/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +4 -0
- package/node_modules/zod-to-json-schema/dist/esm/selectParser.js +105 -0
- package/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +87 -0
- package/node_modules/zod-to-json-schema/package.json +85 -0
- package/node_modules/zod-to-json-schema/postcjs.ts +3 -0
- package/node_modules/zod-to-json-schema/postesm.ts +3 -0
- package/package.json +45 -0
- package/prepare.mjs +220 -0
- package/runtime-package.json +23 -0
|
@@ -0,0 +1,3022 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 harrylabsj
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* 商家私有管理 API(BD 设计 §9/§10/§11:`/merchant/api/*`,契约
|
|
18
|
+
* `merchant-management/1`,schemas 见 contracts/merchant-management/1.0/)。
|
|
19
|
+
*
|
|
20
|
+
* 职责边界(BD §8.1 的「HTTP/MCP 适配层」行):
|
|
21
|
+
* - 路由、会话→已验证主体、CSRF/Origin、输入 Schema 校验、幂等与错误映射;
|
|
22
|
+
* - **不**重写报价/审批规则:业务全部经 BD-01 `MerchantApplicationService`
|
|
23
|
+
* 与 core 命令日志;本层只编排权威操作记录(§10.2 的幂等顺序)。
|
|
24
|
+
*
|
|
25
|
+
* 鉴权(一个部署单元 ≠ 一个权限域,红线 4):
|
|
26
|
+
* - 会话与 /admin 同源(`MerchantAdminSessions`,kiwi_admin cookie,12h);
|
|
27
|
+
* A2A Bearer/签名与 Catalog OAuth **不是**管理凭据(UC11);
|
|
28
|
+
* - 写请求必须携带会话绑定的 CSRF 头(HMAC(sessionId, 进程密钥),恒定时间
|
|
29
|
+
* 比较);请求带 Origin 时必须命中允许 origin 列表(精确匹配,BD §7.2;
|
|
30
|
+
* CORS 不是认证);
|
|
31
|
+
* - 主体只从会话派生:正文/路径/头里的 merchant_id/actor_id 一律不认(UC10);
|
|
32
|
+
* 跨商家对象统一 404,不透露对方存在(UC09)。
|
|
33
|
+
*
|
|
34
|
+
* 幂等(§10.2):先认证与归属 → 规范化输入 → 权威存储查
|
|
35
|
+
* `(merchant_id, actor_id, command_type, idempotency_key)`;同键同摘要回放原
|
|
36
|
+
* 回执,同键异摘要 409。校验/授权类失败在触达执行前 `release()` 回滚占位,
|
|
37
|
+
* 允许修正后用原键重试;执行层异常且无法证明「未执行」→ 记 unknown 并保留
|
|
38
|
+
* operation_id 查询路径(§11.1),绝不当作失败自动重做。
|
|
39
|
+
*/
|
|
40
|
+
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
41
|
+
import { contentHash } from "../../agent/merchant/action-candidate.js";
|
|
42
|
+
import { ADMIN_SESSION_COOKIE } from "../../auth/merchant-sessions.js";
|
|
43
|
+
import { parseProductTable, ProductTableError, productTableDigest, } from "../../cloud/product-source.js";
|
|
44
|
+
import { convertTabularImport, renderImportTemplateCsv, renderImportTemplateXlsx, TABULAR_IMPORT_MAX_BYTES, } from "../../cloud/product-import-tabular.js";
|
|
45
|
+
import { MerchantImportDraftStore } from "./draft-store.js";
|
|
46
|
+
import { ActorContextError, assertVerifiedActor, createVerifiedActorContext, hasPermission, } from "../../merchant/application/actor.js";
|
|
47
|
+
import { MANAGEMENT_API_MAJOR, MANAGEMENT_ERROR_STATUS, ManagementError, MerchantApplicationService, } from "../../merchant/application/service.js";
|
|
48
|
+
import { managementRequestDigest, MerchantManagementOperationStore } from "./operation-store.js";
|
|
49
|
+
import { OnboardingStore } from "../../cloud/onboarding/store.js";
|
|
50
|
+
import { readEnrollmentStore } from "../../cloud/binding/enrollment-challenge.js";
|
|
51
|
+
import { requestsDisabledLocalImplementation } from "../../cloud/onboarding/local-fallback.js";
|
|
52
|
+
import { checkStepSubmission, planWizard, WIZARD_STEPS } from "../../cloud/onboarding/steps.js";
|
|
53
|
+
import { createWorkbenchProblem } from "./problem.js";
|
|
54
|
+
import { WorkbenchConfirmationError, } from "./webauthn-confirmation.js";
|
|
55
|
+
import { MerchantWorkbenchError, } from "../../merchant/workbench-service.js";
|
|
56
|
+
import { NEGOTIATION_STATUS_FILTERS, } from "../../merchant/negotiation-observer.js";
|
|
57
|
+
import { parseReportPeriod, } from "../../merchant/operations-report.js";
|
|
58
|
+
import { parseExactMoney, WorkbenchMoneyError, WORKBENCH_CURRENCY_TABLE_VERSION, } from "../../merchant/application/money.js";
|
|
59
|
+
import { EXACT_PRODUCT_TOOLS } from "../../merchant/exact-product-executors.js";
|
|
60
|
+
import { SERVICE_CONTROL_TOOLS } from "../../merchant/service-control-executors.js";
|
|
61
|
+
import { BROADCAST_TOOLS } from "../../merchant/feed-executors.js";
|
|
62
|
+
import { MerchantFeedError } from "../../merchant/feed-store.js";
|
|
63
|
+
import { GRANT_TOOLS } from "../../merchant/grant-executors.js";
|
|
64
|
+
import { PROMOTION_TOOLS } from "../../merchant/promotion-executors.js";
|
|
65
|
+
import { MerchantPromotionError, } from "../../merchant/promotion-store.js";
|
|
66
|
+
import { WorkbenchEventProjectionError, } from "./event-projection.js";
|
|
67
|
+
import { GRANT_ACTIONS, MerchantGrantError, } from "../../merchant/grant-store.js";
|
|
68
|
+
const API_PREFIX = "/merchant/api";
|
|
69
|
+
const WORKBENCH_API_PREFIX = "/merchant/api/v1";
|
|
70
|
+
const MAX_BODY_BYTES = 1_048_576;
|
|
71
|
+
/** 非候选写命令确认引用的有效期(BD §7.3:短时、单次)。 */
|
|
72
|
+
const CONFIRMATION_TTL_MS = 5 * 60 * 1000;
|
|
73
|
+
class BodyTooLarge {
|
|
74
|
+
}
|
|
75
|
+
export function createMerchantManagementApiHandler(options) {
|
|
76
|
+
const log = options.log ??
|
|
77
|
+
((line) => {
|
|
78
|
+
process.stderr.write(line);
|
|
79
|
+
});
|
|
80
|
+
const now = options.now ?? (() => new Date());
|
|
81
|
+
const operations = options.operations;
|
|
82
|
+
// CSRF 进程密钥:令牌 = HMAC(sessionId, key)。重启后页面重新拉取 /session
|
|
83
|
+
// 即可取到新令牌;跨进程不可推导,持 Cookie 者本就可推导(CSRF 威胁模型成立)。
|
|
84
|
+
const csrfKey = randomBytes(32);
|
|
85
|
+
const baseDeps = {
|
|
86
|
+
merchantId: options.merchantId,
|
|
87
|
+
generation: options.generation,
|
|
88
|
+
runtimeVersion: options.runtimeVersion,
|
|
89
|
+
readiness: options.readiness,
|
|
90
|
+
serviceState: () => options.serviceState.state,
|
|
91
|
+
// 对话私有工具取决于 B07(平台动态绑定能力),未验证前一律 false(§4.2)。
|
|
92
|
+
capabilities: () => ({ management_page: true, dialog_tools: false }),
|
|
93
|
+
listCandidates: options.listPending,
|
|
94
|
+
getCandidate: (candidateId) => options.listPending().find((item) => item.candidate_id === candidateId),
|
|
95
|
+
getOperation: (operationId) => operations.get(operationId, options.merchantId),
|
|
96
|
+
decide: async () => {
|
|
97
|
+
// 只读实例不携带执行通道;审批执行必须走 executionService(带 operationId)。
|
|
98
|
+
throw new ManagementError("invalid_input", "decision execution requires the write path");
|
|
99
|
+
},
|
|
100
|
+
...(options.policy !== undefined ? { policy: options.policy } : {}),
|
|
101
|
+
...(options.products !== undefined ? { products: options.products } : {}),
|
|
102
|
+
...(options.now !== undefined ? { now: options.now } : {}),
|
|
103
|
+
};
|
|
104
|
+
const readService = new MerchantApplicationService(baseDeps);
|
|
105
|
+
/** 执行实例:deps.decide 绑定本次幂等占位的 operationId(回执可对账)。 */
|
|
106
|
+
function executionService(operationId) {
|
|
107
|
+
return new MerchantApplicationService({
|
|
108
|
+
...baseDeps,
|
|
109
|
+
decide: async (input) => {
|
|
110
|
+
await options.executeDecision({
|
|
111
|
+
candidateId: input.candidateId,
|
|
112
|
+
actorId: input.actorId,
|
|
113
|
+
merchantId: input.merchantId,
|
|
114
|
+
approve: input.approve,
|
|
115
|
+
confirmationRef: input.confirmationRef,
|
|
116
|
+
idempotencyKey: input.idempotencyKey,
|
|
117
|
+
});
|
|
118
|
+
return { operationId, status: "succeeded" };
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return (req, res) => {
|
|
123
|
+
void handle(req, res).catch((err) => {
|
|
124
|
+
respondError(res, err);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
async function handle(req, res) {
|
|
128
|
+
const method = req.method ?? "GET";
|
|
129
|
+
let url;
|
|
130
|
+
try {
|
|
131
|
+
url = new URL(req.url ?? "/", "http://merchant-management.internal");
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
writeJson(res, 400, errorBody("invalid_input", "invalid request target"));
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const pathname = url.pathname;
|
|
138
|
+
if (pathname !== API_PREFIX && !pathname.startsWith(`${API_PREFIX}/`)) {
|
|
139
|
+
writeJson(res, 404, errorBody("not_found", "unknown management api path"));
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (pathname === WORKBENCH_API_PREFIX || pathname.startsWith(`${WORKBENCH_API_PREFIX}/`)) {
|
|
143
|
+
const requestId = `req_${randomBytes(12).toString("hex")}`;
|
|
144
|
+
const rest = pathname === WORKBENCH_API_PREFIX ? "/" : pathname.slice(WORKBENCH_API_PREFIX.length);
|
|
145
|
+
try {
|
|
146
|
+
if (method === "GET") {
|
|
147
|
+
await routeWorkbenchV1Get(req, res, url, rest, requestId);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (method === "POST") {
|
|
151
|
+
await routeWorkbenchV1Post(req, res, rest, requestId, url);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
{
|
|
155
|
+
writeWorkbenchProblem(res, "VALIDATION_ERROR", requestId, "请求方法不可用", "该 Workbench 路由当前只接受 GET/POST。", { allow: "GET, POST" });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
respondWorkbenchError(res, error, requestId);
|
|
161
|
+
}
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const rest = pathname === API_PREFIX ? "/" : pathname.slice(API_PREFIX.length);
|
|
165
|
+
try {
|
|
166
|
+
if (method === "GET") {
|
|
167
|
+
await routeGet(req, res, url, rest);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (method === "POST") {
|
|
171
|
+
await routePost(req, res, rest);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
if (err instanceof BodyTooLarge) {
|
|
177
|
+
writeJson(res, 413, errorBody("invalid_input", "request body too large"));
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
respondError(res, err);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (isKnownPath(rest)) {
|
|
184
|
+
writeJson(res, 405, errorBody("invalid_input", "method not allowed"), { allow: "GET, POST" });
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
writeJson(res, 404, errorBody("not_found", "unknown management api path"));
|
|
188
|
+
}
|
|
189
|
+
// ── 只读路由(认证即鉴权入口;业务授权在服务层逐次复核)────────────────
|
|
190
|
+
/** Workbench v1 读取面复用同一应用服务;未实现路由明确失败,不返回假数据。 */
|
|
191
|
+
async function routeWorkbenchV1Get(req, res, url, rest, requestId) {
|
|
192
|
+
if (rest === "/overview") {
|
|
193
|
+
const auth = requireActor(req);
|
|
194
|
+
const runtime = await readService.getStatus(auth.ctx);
|
|
195
|
+
const pendingApprovals = options
|
|
196
|
+
.listPending()
|
|
197
|
+
.filter((candidate) => candidate.status === "pending_approval").length;
|
|
198
|
+
let negotiationsOverview = {
|
|
199
|
+
observable: false,
|
|
200
|
+
value: null,
|
|
201
|
+
reason: "unified_negotiation_projection_unavailable",
|
|
202
|
+
};
|
|
203
|
+
if (options.negotiations !== undefined) {
|
|
204
|
+
try {
|
|
205
|
+
const result = await options.negotiations.list(1);
|
|
206
|
+
negotiationsOverview = { observable: true, value: { total: result.total } };
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
negotiationsOverview = {
|
|
210
|
+
observable: false,
|
|
211
|
+
value: null,
|
|
212
|
+
reason: "negotiation_authority_unavailable",
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
writeJson(res, 200, {
|
|
217
|
+
generated_at: now().toISOString(),
|
|
218
|
+
runtime,
|
|
219
|
+
approvals: { observable: true, pending: pendingApprovals },
|
|
220
|
+
broadcasts: options.workbenchFeed === undefined
|
|
221
|
+
? { observable: false, value: null, reason: "feed_authority_unavailable" }
|
|
222
|
+
: {
|
|
223
|
+
observable: true,
|
|
224
|
+
value: options.workbenchFeed.summary(auth.ctx.merchantId),
|
|
225
|
+
},
|
|
226
|
+
promotions: options.workbenchPromotions === undefined
|
|
227
|
+
? { observable: false, value: null, reason: "promotion_authority_unavailable" }
|
|
228
|
+
: {
|
|
229
|
+
observable: true,
|
|
230
|
+
value: options.workbenchPromotions.summary(auth.ctx.merchantId),
|
|
231
|
+
},
|
|
232
|
+
followers: options.followerSummary === undefined
|
|
233
|
+
? {
|
|
234
|
+
observable: false,
|
|
235
|
+
value: null,
|
|
236
|
+
reason: "verified_buyer_identity_resolver_unavailable",
|
|
237
|
+
}
|
|
238
|
+
: {
|
|
239
|
+
observable: true,
|
|
240
|
+
value: { active_verified_subjects: options.followerSummary() },
|
|
241
|
+
},
|
|
242
|
+
engagement: options.engagementSummary === undefined
|
|
243
|
+
? { observable: false, value: null, reason: "engagement_authority_unavailable" }
|
|
244
|
+
: { observable: true, value: options.engagementSummary() },
|
|
245
|
+
negotiations: negotiationsOverview,
|
|
246
|
+
}, { "x-request-id": requestId });
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (rest === "/runtime/status") {
|
|
250
|
+
const auth = requireActor(req);
|
|
251
|
+
writeJson(res, 200, {
|
|
252
|
+
...await readService.getStatus(auth.ctx),
|
|
253
|
+
merchant_name: options.merchantName ?? null,
|
|
254
|
+
merchant_name_needs_update: options.merchantNameNeedsUpdate === true,
|
|
255
|
+
}, { "x-request-id": requestId });
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (rest === "/products") {
|
|
259
|
+
const auth = requireActor(req);
|
|
260
|
+
authorizeOrThrow(auth.ctx, "products:read");
|
|
261
|
+
const channel = options.exactProducts;
|
|
262
|
+
if (channel === undefined) {
|
|
263
|
+
throw new ManagementError("unavailable", "exact product authority is not configured");
|
|
264
|
+
}
|
|
265
|
+
const query = pageQuery(url);
|
|
266
|
+
const offset = query.cursor === undefined ? 0 : Number.parseInt(query.cursor, 10);
|
|
267
|
+
if (!Number.isSafeInteger(offset) || offset < 0) {
|
|
268
|
+
throw new ManagementError("invalid_input", "product cursor is invalid");
|
|
269
|
+
}
|
|
270
|
+
const limit = Math.min(query.limit ?? 50, 100);
|
|
271
|
+
const all = await channel.list();
|
|
272
|
+
writeJson(res, 200, {
|
|
273
|
+
items: all.slice(offset, offset + limit).map(exactProductProjection),
|
|
274
|
+
next_cursor: offset + limit < all.length ? String(offset + limit) : null,
|
|
275
|
+
total: all.length,
|
|
276
|
+
}, { "x-request-id": requestId });
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (rest === "/products/import-template") {
|
|
280
|
+
const auth = requireActor(req);
|
|
281
|
+
authorizeOrThrow(auth.ctx, "products:read");
|
|
282
|
+
const format = url.searchParams.get("format");
|
|
283
|
+
if (format !== "csv" && format !== "xlsx") {
|
|
284
|
+
throw new ManagementError("invalid_input", "format must be csv or xlsx");
|
|
285
|
+
}
|
|
286
|
+
if (res.headersSent) {
|
|
287
|
+
res.end();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
if (format === "csv") {
|
|
291
|
+
const body = renderImportTemplateCsv();
|
|
292
|
+
res.writeHead(200, {
|
|
293
|
+
"content-type": "text/csv; charset=utf-8",
|
|
294
|
+
"content-disposition": 'attachment; filename="kiwi-product-import-template.csv"',
|
|
295
|
+
"cache-control": "no-store",
|
|
296
|
+
"x-request-id": requestId,
|
|
297
|
+
});
|
|
298
|
+
res.end(body);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
const bytes = renderImportTemplateXlsx();
|
|
302
|
+
res.writeHead(200, {
|
|
303
|
+
"content-type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
304
|
+
"content-disposition": 'attachment; filename="kiwi-product-import-template.xlsx"',
|
|
305
|
+
"cache-control": "no-store",
|
|
306
|
+
"x-request-id": requestId,
|
|
307
|
+
});
|
|
308
|
+
res.end(Buffer.from(bytes));
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const productMatch = /^\/products\/([^/]+)$/.exec(rest);
|
|
312
|
+
if (productMatch !== null) {
|
|
313
|
+
const auth = requireActor(req);
|
|
314
|
+
authorizeOrThrow(auth.ctx, "products:read");
|
|
315
|
+
const channel = options.exactProducts;
|
|
316
|
+
if (channel === undefined) {
|
|
317
|
+
throw new ManagementError("unavailable", "exact product authority is not configured");
|
|
318
|
+
}
|
|
319
|
+
writeJson(res, 200, exactProductProjection(await channel.get(pathSegment(productMatch[1] ?? ""))), { "x-request-id": requestId });
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
if (rest === "/approvals") {
|
|
323
|
+
const auth = requireActor(req);
|
|
324
|
+
writeJson(res, 200, await readService.listApprovals(auth.ctx, pageQuery(url)), {
|
|
325
|
+
"x-request-id": requestId,
|
|
326
|
+
});
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (rest === "/negotiations") {
|
|
330
|
+
const auth = requireActor(req);
|
|
331
|
+
authorizeOrThrow(auth.ctx, "approvals:read");
|
|
332
|
+
const query = pageQuery(url);
|
|
333
|
+
const statusRaw = url.searchParams.get("status");
|
|
334
|
+
if (statusRaw !== null && statusRaw !== "" && !NEGOTIATION_STATUS_FILTERS.includes(statusRaw)) {
|
|
335
|
+
throw new ManagementError("invalid_input", "status must be active, agreement or all");
|
|
336
|
+
}
|
|
337
|
+
const observer = options.negotiationObserver;
|
|
338
|
+
if (observer !== undefined) {
|
|
339
|
+
writeJson(res, 200, observer.list({
|
|
340
|
+
...(query.cursor !== undefined ? { cursor: query.cursor } : {}),
|
|
341
|
+
...(query.limit !== undefined ? { limit: query.limit } : {}),
|
|
342
|
+
...(statusRaw !== null && statusRaw !== ""
|
|
343
|
+
? { status: statusRaw }
|
|
344
|
+
: {}),
|
|
345
|
+
}), { "x-request-id": requestId });
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (statusRaw !== null && statusRaw !== "") {
|
|
349
|
+
throw new ManagementError("unavailable", "status filtering requires the negotiation observer projection");
|
|
350
|
+
}
|
|
351
|
+
const channel = options.negotiations;
|
|
352
|
+
if (channel === undefined) {
|
|
353
|
+
throw new ManagementError("unavailable", "negotiation authority is not configured");
|
|
354
|
+
}
|
|
355
|
+
writeJson(res, 200, await channel.list(query.limit), { "x-request-id": requestId });
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
const negotiationMatch = /^\/negotiations\/([^/]+)$/.exec(rest);
|
|
359
|
+
if (negotiationMatch !== null) {
|
|
360
|
+
const auth = requireActor(req);
|
|
361
|
+
authorizeOrThrow(auth.ctx, "approvals:read");
|
|
362
|
+
const observer = options.negotiationObserver;
|
|
363
|
+
if (observer !== undefined) {
|
|
364
|
+
writeJson(res, 200, observer.timeline(pathSegment(negotiationMatch[1] ?? "")), {
|
|
365
|
+
"x-request-id": requestId,
|
|
366
|
+
});
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
const channel = options.negotiations;
|
|
370
|
+
if (channel === undefined) {
|
|
371
|
+
throw new ManagementError("unavailable", "negotiation authority is not configured");
|
|
372
|
+
}
|
|
373
|
+
writeJson(res, 200, await channel.get(pathSegment(negotiationMatch[1] ?? "")), {
|
|
374
|
+
"x-request-id": requestId,
|
|
375
|
+
});
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
if (rest === "/reports") {
|
|
379
|
+
const auth = requireActor(req);
|
|
380
|
+
authorizeOrThrow(auth.ctx, "operations:read");
|
|
381
|
+
const builder = options.operationsReports;
|
|
382
|
+
if (builder === undefined) {
|
|
383
|
+
throw new ManagementError("unavailable", "operations report authority is not configured");
|
|
384
|
+
}
|
|
385
|
+
const periodRaw = url.searchParams.get("period");
|
|
386
|
+
writeJson(res, 200, builder.build(parseReportPeriod(periodRaw)), {
|
|
387
|
+
"x-request-id": requestId,
|
|
388
|
+
});
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (rest === "/broadcasts") {
|
|
392
|
+
const auth = requireActor(req);
|
|
393
|
+
authorizeOrThrow(auth.ctx, "approvals:read");
|
|
394
|
+
const feed = requireWorkbenchFeed();
|
|
395
|
+
writeJson(res, 200, feed.listBroadcasts(auth.ctx.merchantId, pageQuery(url)), {
|
|
396
|
+
"x-request-id": requestId,
|
|
397
|
+
});
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
if (rest === "/operator-grants") {
|
|
401
|
+
const auth = requireActor(req);
|
|
402
|
+
authorizeOrThrow(auth.ctx, "grants:manage");
|
|
403
|
+
const grants = requireWorkbenchGrants();
|
|
404
|
+
writeJson(res, 200, grants.listGrants(auth.ctx.merchantId, pageQuery(url)), {
|
|
405
|
+
"x-request-id": requestId,
|
|
406
|
+
});
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
if (rest === "/promotions") {
|
|
410
|
+
const auth = requireActor(req);
|
|
411
|
+
authorizeOrThrow(auth.ctx, "products:read");
|
|
412
|
+
writeJson(res, 200, requireWorkbenchPromotions().listPromotions(auth.ctx.merchantId, pageQuery(url)), { "x-request-id": requestId });
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
const promotionMatch = /^\/promotions\/([^/]+)$/.exec(rest);
|
|
416
|
+
if (promotionMatch !== null) {
|
|
417
|
+
const auth = requireActor(req);
|
|
418
|
+
authorizeOrThrow(auth.ctx, "products:read");
|
|
419
|
+
const value = requireWorkbenchPromotions().getPromotion(auth.ctx.merchantId, pathSegment(promotionMatch[1] ?? ""));
|
|
420
|
+
if (value === undefined)
|
|
421
|
+
throw new ManagementError("not_found", "unknown promotion");
|
|
422
|
+
writeJson(res, 200, value, { "x-request-id": requestId });
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const promotionWorkflowMatch = /^\/promotion-workflows\/([^/]+)$/.exec(rest);
|
|
426
|
+
if (promotionWorkflowMatch !== null) {
|
|
427
|
+
const auth = requireActor(req);
|
|
428
|
+
authorizeOrThrow(auth.ctx, "operations:read");
|
|
429
|
+
const workflow = options.promotionBroadcastWorkflows?.get(auth.ctx.merchantId, pathSegment(promotionWorkflowMatch[1] ?? ""));
|
|
430
|
+
if (workflow === undefined) {
|
|
431
|
+
throw new ManagementError("not_found", "unknown promotion broadcast workflow");
|
|
432
|
+
}
|
|
433
|
+
writeJson(res, 200, workflow, { "x-request-id": requestId });
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
const broadcastMatch = /^\/broadcasts\/([^/]+)$/.exec(rest);
|
|
437
|
+
if (broadcastMatch !== null) {
|
|
438
|
+
const auth = requireActor(req);
|
|
439
|
+
authorizeOrThrow(auth.ctx, "approvals:read");
|
|
440
|
+
const value = requireWorkbenchFeed().getBroadcast(auth.ctx.merchantId, pathSegment(broadcastMatch[1] ?? ""));
|
|
441
|
+
if (value === undefined)
|
|
442
|
+
throw new ManagementError("not_found", "unknown broadcast");
|
|
443
|
+
writeJson(res, 200, value, { "x-request-id": requestId });
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
const approvalMatch = /^\/approvals\/([^/]+)$/.exec(rest);
|
|
447
|
+
if (approvalMatch !== null) {
|
|
448
|
+
const auth = requireActor(req);
|
|
449
|
+
writeJson(res, 200, await readService.getApproval(auth.ctx, pathSegment(approvalMatch[1] ?? "")), { "x-request-id": requestId });
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const operationMatch = /^\/operations\/([^/]+)$/.exec(rest);
|
|
453
|
+
if (operationMatch !== null) {
|
|
454
|
+
const auth = requireActor(req);
|
|
455
|
+
writeJson(res, 200, readService.getOperation(auth.ctx, pathSegment(operationMatch[1] ?? "")), { "x-request-id": requestId });
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
if (rest === "/alerts") {
|
|
459
|
+
const auth = requireActor(req);
|
|
460
|
+
authorizeOrThrow(auth.ctx, "operations:read");
|
|
461
|
+
const store = options.workbenchReconciliation;
|
|
462
|
+
if (store === undefined) {
|
|
463
|
+
throw new ManagementError("unavailable", "Workbench alert authority is not configured");
|
|
464
|
+
}
|
|
465
|
+
writeJson(res, 200, store.listAlerts(auth.ctx.merchantId, pageQuery(url)), {
|
|
466
|
+
"x-request-id": requestId,
|
|
467
|
+
});
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
if (rest === "/events") {
|
|
471
|
+
const auth = requireActor(req);
|
|
472
|
+
authorizeOrThrow(auth.ctx, "operations:read");
|
|
473
|
+
const store = options.workbenchEvents;
|
|
474
|
+
if (store === undefined) {
|
|
475
|
+
throw new ManagementError("unavailable", "Workbench event projection is not configured");
|
|
476
|
+
}
|
|
477
|
+
const query = pageQuery(url);
|
|
478
|
+
writeJson(res, 200, store.list(auth.ctx.merchantId, {
|
|
479
|
+
...(query.cursor !== undefined ? { cursor: query.cursor } : {}),
|
|
480
|
+
...(query.limit !== undefined ? { limit: query.limit } : {}),
|
|
481
|
+
}), { "x-request-id": requestId });
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const privacyRequestMatch = /^\/privacy-requests\/([^/]+)$/u.exec(rest);
|
|
485
|
+
if (privacyRequestMatch !== null) {
|
|
486
|
+
const auth = requireActor(req);
|
|
487
|
+
authorizeOrThrow(auth.ctx, "operations:read");
|
|
488
|
+
const request = options.workbenchRetention?.getRequest(pathSegment(privacyRequestMatch[1] ?? ""), auth.ctx.merchantId);
|
|
489
|
+
if (request === undefined) {
|
|
490
|
+
throw new ManagementError("not_found", "unknown privacy request");
|
|
491
|
+
}
|
|
492
|
+
writeJson(res, 200, {
|
|
493
|
+
request_id: request.requestId,
|
|
494
|
+
status: request.status,
|
|
495
|
+
consent_generation: request.consentGeneration,
|
|
496
|
+
received_at: request.receivedAt,
|
|
497
|
+
updated_at: request.updatedAt,
|
|
498
|
+
...(request.limitationReason !== undefined
|
|
499
|
+
? { limitation_reason: request.limitationReason }
|
|
500
|
+
: {}),
|
|
501
|
+
}, { "x-request-id": requestId });
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
const confirmationMatch = /^\/confirmations\/([^/]+)$/.exec(rest);
|
|
505
|
+
if (confirmationMatch !== null) {
|
|
506
|
+
const auth = requireActor(req);
|
|
507
|
+
writeJson(res, 200, requireWorkbenchConfirmations().requestProjection({
|
|
508
|
+
confirmationId: pathSegment(confirmationMatch[1] ?? ""),
|
|
509
|
+
merchantId: auth.ctx.merchantId,
|
|
510
|
+
actorId: auth.ctx.actorId,
|
|
511
|
+
}), { "x-request-id": requestId });
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
const confirmationRefMatch = /^\/confirmations\/by-ref\/([^/]+)$/.exec(rest);
|
|
515
|
+
if (confirmationRefMatch !== null) {
|
|
516
|
+
const auth = requireActor(req);
|
|
517
|
+
writeJson(res, 200, requireWorkbenchConfirmations().requestProjectionByRef({
|
|
518
|
+
requestRef: pathSegment(confirmationRefMatch[1] ?? ""),
|
|
519
|
+
merchantId: auth.ctx.merchantId,
|
|
520
|
+
actorId: auth.ctx.actorId,
|
|
521
|
+
}), { "x-request-id": requestId });
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
writeWorkbenchProblem(res, "RESOURCE_NOT_FOUND", requestId, "资源不存在", "Workbench API 路由不存在或尚未实现。");
|
|
525
|
+
}
|
|
526
|
+
async function routeWorkbenchV1Post(req, res, rest, requestId, url) {
|
|
527
|
+
if (rest === "/runtime/safety-stops") {
|
|
528
|
+
const auth = requireActor(req);
|
|
529
|
+
assertWriteGuards(req, auth.sessionId);
|
|
530
|
+
authorizeOrThrow(auth.ctx, "service:pause");
|
|
531
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
532
|
+
"expected_revision",
|
|
533
|
+
"reason",
|
|
534
|
+
"idempotency_key",
|
|
535
|
+
]);
|
|
536
|
+
const expectedRevision = requireInteger(fields["expected_revision"], "expected_revision");
|
|
537
|
+
const reason = optionalString(fields["reason"], "reason");
|
|
538
|
+
const idempotencyKey = requireString(fields["idempotency_key"], "idempotency_key");
|
|
539
|
+
const requestDigest = managementRequestDigest({
|
|
540
|
+
expected_revision: expectedRevision,
|
|
541
|
+
reason: reason ?? null,
|
|
542
|
+
});
|
|
543
|
+
const begun = operations.begin({
|
|
544
|
+
merchantId: auth.ctx.merchantId,
|
|
545
|
+
actorId: auth.ctx.actorId,
|
|
546
|
+
commandType: "runtime.safety_stop",
|
|
547
|
+
idempotencyKey,
|
|
548
|
+
requestDigest,
|
|
549
|
+
});
|
|
550
|
+
if (begun.kind === "conflict") {
|
|
551
|
+
throw new ManagementError("conflict", "idempotency key was reused with another request");
|
|
552
|
+
}
|
|
553
|
+
if (begun.kind === "replay") {
|
|
554
|
+
writeJson(res, 200, begun.receipt, { "x-request-id": requestId });
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
if (expectedRevision !== options.serviceState.serviceRevision) {
|
|
558
|
+
operations.release(begun.operationId);
|
|
559
|
+
throw new ManagementError("precondition_changed", "service revision changed");
|
|
560
|
+
}
|
|
561
|
+
try {
|
|
562
|
+
const applied = options.serviceState.pause(reason);
|
|
563
|
+
const receipt = {
|
|
564
|
+
...staticReceipt(begun.operationId, "runtime.safety_stop", "succeeded"),
|
|
565
|
+
resource_ref: "service",
|
|
566
|
+
result_revision: applied.service_revision,
|
|
567
|
+
completed_at: now().toISOString(),
|
|
568
|
+
};
|
|
569
|
+
operations.complete(begun.operationId, "succeeded", receipt);
|
|
570
|
+
writeJson(res, 200, receipt, { "x-request-id": requestId });
|
|
571
|
+
}
|
|
572
|
+
catch (error) {
|
|
573
|
+
operations.release(begun.operationId);
|
|
574
|
+
throw error;
|
|
575
|
+
}
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
if (rest === "/pricing/previews") {
|
|
579
|
+
const auth = requireActor(req);
|
|
580
|
+
authorizeOrThrow(auth.ctx, "products:read");
|
|
581
|
+
const fields = objectFields(await readJsonBody(req), ["sku", "quantity"]);
|
|
582
|
+
const channel = options.quotePreview;
|
|
583
|
+
if (channel === undefined) {
|
|
584
|
+
throw new ManagementError("unavailable", "shared quote calculator is unavailable");
|
|
585
|
+
}
|
|
586
|
+
const result = await channel(requireString(fields["sku"], "sku"), requirePositiveInteger(fields["quantity"], "quantity"));
|
|
587
|
+
writeJson(res, 200, result, { "x-request-id": requestId });
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
if (rest === "/runtime/mode-drafts") {
|
|
591
|
+
const auth = requireActor(req);
|
|
592
|
+
assertWriteGuards(req, auth.sessionId);
|
|
593
|
+
authorizeOrThrow(auth.ctx, "service:resume");
|
|
594
|
+
if (auth.ctx.role !== "owner") {
|
|
595
|
+
throw new ManagementError("forbidden", "only owner can prepare service recovery");
|
|
596
|
+
}
|
|
597
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
598
|
+
"target_state",
|
|
599
|
+
"expected_revision",
|
|
600
|
+
"reason",
|
|
601
|
+
]);
|
|
602
|
+
if (fields["target_state"] !== "OPERATING") {
|
|
603
|
+
throw new ManagementError("invalid_input", "runtime mode draft currently supports target_state=OPERATING only");
|
|
604
|
+
}
|
|
605
|
+
const expectedRevision = requirePositiveInteger(fields["expected_revision"], "expected_revision");
|
|
606
|
+
if (expectedRevision !== options.serviceState.serviceRevision) {
|
|
607
|
+
throw new ManagementError("precondition_changed", "service revision changed");
|
|
608
|
+
}
|
|
609
|
+
const channel = options.prepareServiceResume;
|
|
610
|
+
if (channel === undefined) {
|
|
611
|
+
throw new ManagementError("unavailable", "service recovery candidate is unavailable");
|
|
612
|
+
}
|
|
613
|
+
const reason = optionalString(fields["reason"], "reason");
|
|
614
|
+
const prepared = await channel({
|
|
615
|
+
expectedRevision,
|
|
616
|
+
...(reason !== undefined ? { reason } : {}),
|
|
617
|
+
});
|
|
618
|
+
writeJson(res, 201, prepared, { "x-request-id": requestId });
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
if (rest === "/webauthn/registrations/options") {
|
|
622
|
+
const auth = requireActor(req);
|
|
623
|
+
assertWriteGuards(req, auth.sessionId);
|
|
624
|
+
const registration = await requireRegistrationAuthorization(req, auth.ctx);
|
|
625
|
+
const begun = await requireWorkbenchConfirmations().beginCredentialRegistration({
|
|
626
|
+
merchantId: auth.ctx.merchantId,
|
|
627
|
+
actorId: auth.ctx.actorId,
|
|
628
|
+
rpName: registration.rpName,
|
|
629
|
+
rpId: registration.rpId,
|
|
630
|
+
origin: registration.origin,
|
|
631
|
+
userName: auth.ctx.actorId,
|
|
632
|
+
userDisplayName: auth.ctx.actorId,
|
|
633
|
+
});
|
|
634
|
+
writeJson(res, 201, begun, { "x-request-id": requestId });
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
const registrationVerify = /^\/webauthn\/registrations\/([^/]+)\/verify$/.exec(rest);
|
|
638
|
+
if (registrationVerify !== null) {
|
|
639
|
+
const auth = requireActor(req);
|
|
640
|
+
assertWriteGuards(req, auth.sessionId);
|
|
641
|
+
await requireRegistrationAuthorization(req, auth.ctx);
|
|
642
|
+
const body = await readJsonBody(req);
|
|
643
|
+
if (body === null || typeof body !== "object" || Array.isArray(body)) {
|
|
644
|
+
throw new ManagementError("invalid_input", "registration response must be an object");
|
|
645
|
+
}
|
|
646
|
+
const result = await requireWorkbenchConfirmations().finishCredentialRegistration({
|
|
647
|
+
registrationId: pathSegment(registrationVerify[1] ?? ""),
|
|
648
|
+
merchantId: auth.ctx.merchantId,
|
|
649
|
+
actorId: auth.ctx.actorId,
|
|
650
|
+
response: body,
|
|
651
|
+
});
|
|
652
|
+
writeJson(res, 201, result, { "x-request-id": requestId });
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
if (rest === "/confirmations") {
|
|
656
|
+
const auth = requireActor(req);
|
|
657
|
+
assertWriteGuards(req, auth.sessionId);
|
|
658
|
+
authorizeOrThrow(auth.ctx, "approvals:decide");
|
|
659
|
+
const confirmations = requireWorkbenchConfirmations();
|
|
660
|
+
if (!confirmations.hasUsableCredential(auth.ctx.merchantId, auth.ctx.actorId)) {
|
|
661
|
+
throw new WorkbenchConfirmationError("credential_unavailable", "actor has no verified WebAuthn credential");
|
|
662
|
+
}
|
|
663
|
+
const fields = objectFields(await readJsonBody(req), ["candidate_id", "decision"]);
|
|
664
|
+
const candidateId = requireString(fields["candidate_id"], "candidate_id");
|
|
665
|
+
const decision = requireDecision(fields["decision"]);
|
|
666
|
+
const candidate = options.listPending().find((item) => item.candidate_id === candidateId);
|
|
667
|
+
if (candidate === undefined || candidate.status !== "pending_approval") {
|
|
668
|
+
throw new ManagementError("not_found", `unknown pending candidate: ${candidateId}`);
|
|
669
|
+
}
|
|
670
|
+
const expiresAt = new Date(Math.min(Date.parse(candidate.expires_at), now().getTime() + CONFIRMATION_TTL_MS)).toISOString();
|
|
671
|
+
const decisionAuthorization = authorizeBroadcastCandidate(auth.ctx, candidate, "broadcast.decide") ??
|
|
672
|
+
authorizeGrantCandidate(auth.ctx, candidate) ??
|
|
673
|
+
authorizePromotionCandidate(auth.ctx, candidate) ??
|
|
674
|
+
authorizeProductCandidate(auth.ctx, candidate) ??
|
|
675
|
+
authorizeServiceControlCandidate(auth.ctx, candidate);
|
|
676
|
+
const confirmation = confirmations.createRequest({
|
|
677
|
+
merchantId: auth.ctx.merchantId,
|
|
678
|
+
actorId: auth.ctx.actorId,
|
|
679
|
+
candidateId,
|
|
680
|
+
approvalGeneration: 1,
|
|
681
|
+
decision,
|
|
682
|
+
operationId: `wop_${randomBytes(16).toString("hex")}`,
|
|
683
|
+
actionDigest: contentHash({
|
|
684
|
+
arguments: candidate.arguments,
|
|
685
|
+
preconditions: candidate.preconditions,
|
|
686
|
+
}),
|
|
687
|
+
actionSnapshot: {
|
|
688
|
+
merchant_id: auth.ctx.merchantId,
|
|
689
|
+
candidate_id: candidateId,
|
|
690
|
+
decision,
|
|
691
|
+
tool: candidate.tool,
|
|
692
|
+
arguments: candidate.arguments,
|
|
693
|
+
preconditions: candidate.preconditions,
|
|
694
|
+
risk: candidate.risk,
|
|
695
|
+
candidate_expires_at: candidate.expires_at,
|
|
696
|
+
...(decisionAuthorization !== undefined
|
|
697
|
+
? { decision_authorization: decisionAuthorization }
|
|
698
|
+
: {}),
|
|
699
|
+
},
|
|
700
|
+
expectedVersion: 1,
|
|
701
|
+
expiresAt,
|
|
702
|
+
});
|
|
703
|
+
writeJson(res, 201, {
|
|
704
|
+
confirmation_id: confirmation.confirmationId,
|
|
705
|
+
request_ref: confirmation.requestRef,
|
|
706
|
+
expires_at: confirmation.expiresAt,
|
|
707
|
+
}, { "x-request-id": requestId });
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
const optionsMatch = /^\/confirmations\/([^/]+)\/assertion-options$/.exec(rest);
|
|
711
|
+
if (optionsMatch !== null) {
|
|
712
|
+
const auth = requireActor(req);
|
|
713
|
+
assertWriteGuards(req, auth.sessionId);
|
|
714
|
+
writeJson(res, 200, requireWorkbenchConfirmations().assertionOptions({
|
|
715
|
+
confirmationId: pathSegment(optionsMatch[1] ?? ""),
|
|
716
|
+
merchantId: auth.ctx.merchantId,
|
|
717
|
+
actorId: auth.ctx.actorId,
|
|
718
|
+
}), { "x-request-id": requestId });
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
const decisionMatch = /^\/approvals\/([^/]+)\/decisions$/.exec(rest);
|
|
722
|
+
if (decisionMatch !== null) {
|
|
723
|
+
const auth = requireActor(req);
|
|
724
|
+
assertWriteGuards(req, auth.sessionId);
|
|
725
|
+
authorizeOrThrow(auth.ctx, "approvals:decide");
|
|
726
|
+
const candidateId = pathSegment(decisionMatch[1] ?? "");
|
|
727
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
728
|
+
"confirmation_id",
|
|
729
|
+
"decision",
|
|
730
|
+
"expected_version",
|
|
731
|
+
"assertion",
|
|
732
|
+
]);
|
|
733
|
+
const assertionFields = objectFields(fields["assertion"], [
|
|
734
|
+
"credential_id",
|
|
735
|
+
"client_data_json",
|
|
736
|
+
"authenticator_data",
|
|
737
|
+
"signature",
|
|
738
|
+
]);
|
|
739
|
+
const assertion = {
|
|
740
|
+
credentialId: requireString(assertionFields["credential_id"], "credential_id"),
|
|
741
|
+
clientDataJSON: requireString(assertionFields["client_data_json"], "client_data_json"),
|
|
742
|
+
authenticatorData: requireString(assertionFields["authenticator_data"], "authenticator_data"),
|
|
743
|
+
signature: requireString(assertionFields["signature"], "signature"),
|
|
744
|
+
};
|
|
745
|
+
const candidate = options.listPending().find((item) => item.candidate_id === candidateId);
|
|
746
|
+
if (candidate === undefined || candidate.status !== "pending_approval") {
|
|
747
|
+
throw new ManagementError("not_found", `unknown pending candidate: ${candidateId}`);
|
|
748
|
+
}
|
|
749
|
+
const currentAuthorization = authorizeBroadcastCandidate(auth.ctx, candidate, "broadcast.decide") ??
|
|
750
|
+
authorizeGrantCandidate(auth.ctx, candidate) ??
|
|
751
|
+
authorizePromotionCandidate(auth.ctx, candidate) ??
|
|
752
|
+
authorizeProductCandidate(auth.ctx, candidate) ??
|
|
753
|
+
authorizeServiceControlCandidate(auth.ctx, candidate);
|
|
754
|
+
if (currentAuthorization !== undefined) {
|
|
755
|
+
const confirmationId = requireString(fields["confirmation_id"], "confirmation_id");
|
|
756
|
+
const frozen = requireWorkbenchConfirmations().requestProjection({
|
|
757
|
+
confirmationId,
|
|
758
|
+
merchantId: auth.ctx.merchantId,
|
|
759
|
+
actorId: auth.ctx.actorId,
|
|
760
|
+
}).snapshot["decision_authorization"];
|
|
761
|
+
if (!sameAuthorizationGeneration(frozen, currentAuthorization)) {
|
|
762
|
+
throw new ManagementError("forbidden", "broadcast authorization changed after confirmation was created");
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
const outcome = requireWorkbenchConfirmations().finalizeDecision({
|
|
766
|
+
confirmationId: requireString(fields["confirmation_id"], "confirmation_id"),
|
|
767
|
+
merchantId: auth.ctx.merchantId,
|
|
768
|
+
actorId: auth.ctx.actorId,
|
|
769
|
+
candidateId,
|
|
770
|
+
approvalGeneration: 1,
|
|
771
|
+
decision: requireDecision(fields["decision"]),
|
|
772
|
+
actionDigest: contentHash({
|
|
773
|
+
arguments: candidate.arguments,
|
|
774
|
+
preconditions: candidate.preconditions,
|
|
775
|
+
}),
|
|
776
|
+
expectedVersion: requireInteger(fields["expected_version"], "expected_version"),
|
|
777
|
+
assertion,
|
|
778
|
+
});
|
|
779
|
+
writeJson(res, outcome.kind === "decided" ? 202 : 200, {
|
|
780
|
+
operation_id: outcome.operationId,
|
|
781
|
+
status: outcome.kind === "decided" ? "accepted" : "already_decided",
|
|
782
|
+
decision: outcome.decision,
|
|
783
|
+
...(outcome.kind === "already_decided" ? { decided_by: outcome.actorId } : {}),
|
|
784
|
+
}, { "x-request-id": requestId });
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
787
|
+
// The v1 Workbench page uses these same application services. Keeping the
|
|
788
|
+
// handlers shared avoids a second import/policy implementation while the
|
|
789
|
+
// surrounding v1 dispatcher maps thrown errors to RFC 9457 Problem Details.
|
|
790
|
+
if (rest === "/products/import-drafts") {
|
|
791
|
+
await postProductsImportDraft(req, res);
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
const importCommitMatch = /^\/products\/import-drafts\/([^/]+)\/commit$/.exec(rest);
|
|
795
|
+
if (importCommitMatch !== null) {
|
|
796
|
+
await postProductsImportCommit(req, res, pathSegment(importCommitMatch[1] ?? ""));
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
if (rest === "/products/import-parse") {
|
|
800
|
+
await postProductsImportParse(req, res, url);
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
if (rest === "/policy/drafts") {
|
|
804
|
+
await postPolicyDraft(req, res);
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
if (rest === "/policy/form-drafts") {
|
|
808
|
+
await postPolicyFormDraft(req, res);
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
const policyCommitMatch = /^\/policy\/drafts\/([^/]+)\/commit$/.exec(rest);
|
|
812
|
+
if (policyCommitMatch !== null) {
|
|
813
|
+
await postPolicyCommit(req, res, pathSegment(policyCommitMatch[1] ?? ""));
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
if (rest === "/broadcasts/drafts") {
|
|
817
|
+
const auth = requireActor(req);
|
|
818
|
+
assertWriteGuards(req, auth.sessionId);
|
|
819
|
+
authorizeOrThrow(auth.ctx, "broadcast:draft");
|
|
820
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
821
|
+
"action",
|
|
822
|
+
"broadcast_id",
|
|
823
|
+
"expected_revision",
|
|
824
|
+
"broadcast",
|
|
825
|
+
"reason",
|
|
826
|
+
]);
|
|
827
|
+
const action = requireString(fields["action"], "action");
|
|
828
|
+
if (action !== "publish" && action !== "revise" && action !== "withdraw") {
|
|
829
|
+
throw new ManagementError("invalid_input", "action must be publish, revise or withdraw");
|
|
830
|
+
}
|
|
831
|
+
const scoped = authorizeBroadcastAction(auth.ctx, "broadcast.draft");
|
|
832
|
+
const authorization = {
|
|
833
|
+
actor_id: auth.ctx.actorId,
|
|
834
|
+
actor_role: auth.ctx.role,
|
|
835
|
+
action: "broadcast.draft",
|
|
836
|
+
authorization_generation: scoped.generation,
|
|
837
|
+
matched_grant_ids: scoped.grantIds,
|
|
838
|
+
};
|
|
839
|
+
const reason = optionalString(fields["reason"], "reason");
|
|
840
|
+
let prepared;
|
|
841
|
+
if (action === "publish") {
|
|
842
|
+
const channel = options.prepareBroadcastPublish;
|
|
843
|
+
if (channel === undefined)
|
|
844
|
+
throw new ManagementError("unavailable", "broadcast prepare is unavailable");
|
|
845
|
+
prepared = await channel({
|
|
846
|
+
broadcast: requireObject(fields["broadcast"], "broadcast"),
|
|
847
|
+
authorization,
|
|
848
|
+
...(reason !== undefined ? { reason } : {}),
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
else if (action === "revise") {
|
|
852
|
+
const channel = options.prepareBroadcastRevise;
|
|
853
|
+
if (channel === undefined)
|
|
854
|
+
throw new ManagementError("unavailable", "broadcast prepare is unavailable");
|
|
855
|
+
prepared = await channel({
|
|
856
|
+
broadcastId: requireString(fields["broadcast_id"], "broadcast_id"),
|
|
857
|
+
expectedRevision: requireInteger(fields["expected_revision"], "expected_revision"),
|
|
858
|
+
broadcast: requireObject(fields["broadcast"], "broadcast"),
|
|
859
|
+
authorization,
|
|
860
|
+
...(reason !== undefined ? { reason } : {}),
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
else {
|
|
864
|
+
const channel = options.prepareBroadcastWithdraw;
|
|
865
|
+
if (channel === undefined)
|
|
866
|
+
throw new ManagementError("unavailable", "broadcast prepare is unavailable");
|
|
867
|
+
prepared = await channel({
|
|
868
|
+
broadcastId: requireString(fields["broadcast_id"], "broadcast_id"),
|
|
869
|
+
expectedRevision: requireInteger(fields["expected_revision"], "expected_revision"),
|
|
870
|
+
authorization,
|
|
871
|
+
...(reason !== undefined ? { reason } : {}),
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
writeJson(res, 201, prepared, { "x-request-id": requestId });
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
if (rest === "/change-drafts") {
|
|
878
|
+
const auth = requireActor(req);
|
|
879
|
+
assertWriteGuards(req, auth.sessionId);
|
|
880
|
+
authorizeOrThrow(auth.ctx, "products:draft");
|
|
881
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
882
|
+
"kind",
|
|
883
|
+
"sku",
|
|
884
|
+
"title",
|
|
885
|
+
"money",
|
|
886
|
+
"expected_authority_version",
|
|
887
|
+
"stock",
|
|
888
|
+
"paused",
|
|
889
|
+
"description",
|
|
890
|
+
"category",
|
|
891
|
+
"tags",
|
|
892
|
+
"delivery_attributes",
|
|
893
|
+
"handoff_destination",
|
|
894
|
+
"reason",
|
|
895
|
+
]);
|
|
896
|
+
const kind = requireString(fields["kind"], "kind");
|
|
897
|
+
const sku = requireString(fields["sku"], "sku");
|
|
898
|
+
const createExact = kind === "product_create_exact";
|
|
899
|
+
const scoped = createExact
|
|
900
|
+
? authorizeProductCreateAction(auth.ctx)
|
|
901
|
+
: authorizeProductAction(auth.ctx, "product.draft", [sku]);
|
|
902
|
+
const authorization = {
|
|
903
|
+
actor_id: auth.ctx.actorId,
|
|
904
|
+
actor_role: auth.ctx.role,
|
|
905
|
+
action: createExact ? "product.create" : "product.draft",
|
|
906
|
+
resource_type: createExact ? "merchant" : "product",
|
|
907
|
+
resource_ids: [sku],
|
|
908
|
+
authorization_generation: scoped.generation,
|
|
909
|
+
matched_grant_ids: scoped.grantIds,
|
|
910
|
+
};
|
|
911
|
+
const reason = optionalString(fields["reason"], "reason");
|
|
912
|
+
let prepared;
|
|
913
|
+
if (kind === "inventory_update") {
|
|
914
|
+
const channel = options.prepareInventoryUpdate;
|
|
915
|
+
if (channel === undefined) {
|
|
916
|
+
throw new ManagementError("unavailable", "inventory candidate preparation is unavailable");
|
|
917
|
+
}
|
|
918
|
+
const stock = requireInteger(fields["stock"], "stock");
|
|
919
|
+
if (stock < 0)
|
|
920
|
+
throw new ManagementError("invalid_input", "stock must be non-negative");
|
|
921
|
+
prepared = await channel({
|
|
922
|
+
sku,
|
|
923
|
+
stock,
|
|
924
|
+
authorization,
|
|
925
|
+
...(reason !== undefined ? { reason } : {}),
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
else if (kind === "listing_change") {
|
|
929
|
+
const channel = options.prepareListingChange;
|
|
930
|
+
if (channel === undefined) {
|
|
931
|
+
throw new ManagementError("unavailable", "listing candidate preparation is unavailable");
|
|
932
|
+
}
|
|
933
|
+
if (typeof fields["paused"] !== "boolean") {
|
|
934
|
+
throw new ManagementError("invalid_input", "paused must be a boolean");
|
|
935
|
+
}
|
|
936
|
+
prepared = await channel({
|
|
937
|
+
sku,
|
|
938
|
+
paused: fields["paused"],
|
|
939
|
+
authorization,
|
|
940
|
+
...(reason !== undefined ? { reason } : {}),
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
else if (kind === "product_create_exact") {
|
|
944
|
+
const channel = options.prepareExactProductCreate;
|
|
945
|
+
if (channel === undefined) {
|
|
946
|
+
throw new ManagementError("unavailable", "exact product creation candidate preparation is unavailable");
|
|
947
|
+
}
|
|
948
|
+
prepared = await channel({
|
|
949
|
+
sku,
|
|
950
|
+
title: requireString(fields["title"], "title"),
|
|
951
|
+
money: requireExactMoneyInput(fields["money"]),
|
|
952
|
+
stock: requireNonNegativeInteger(fields["stock"], "stock"),
|
|
953
|
+
expectedAuthorityVersion: requirePositiveInteger(fields["expected_authority_version"], "expected_authority_version"),
|
|
954
|
+
authorization,
|
|
955
|
+
...(typeof fields["description"] === "string"
|
|
956
|
+
? { description: fields["description"] }
|
|
957
|
+
: {}),
|
|
958
|
+
...(typeof fields["category"] === "string" ? { category: fields["category"] } : {}),
|
|
959
|
+
...(fields["tags"] !== undefined
|
|
960
|
+
? { tags: requireStringArray(fields["tags"], "tags") }
|
|
961
|
+
: {}),
|
|
962
|
+
...(fields["delivery_attributes"] !== undefined
|
|
963
|
+
? {
|
|
964
|
+
deliveryAttributes: requireStringArray(fields["delivery_attributes"], "delivery_attributes"),
|
|
965
|
+
}
|
|
966
|
+
: {}),
|
|
967
|
+
...(typeof fields["handoff_destination"] === "string"
|
|
968
|
+
? { handoffDestination: fields["handoff_destination"] }
|
|
969
|
+
: {}),
|
|
970
|
+
...(reason !== undefined ? { reason } : {}),
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
else if (kind === "product_money_update_exact") {
|
|
974
|
+
const channel = options.prepareExactProductMoneyUpdate;
|
|
975
|
+
if (channel === undefined) {
|
|
976
|
+
throw new ManagementError("unavailable", "exact product money candidate preparation is unavailable");
|
|
977
|
+
}
|
|
978
|
+
prepared = await channel({
|
|
979
|
+
sku,
|
|
980
|
+
money: requireExactMoneyInput(fields["money"]),
|
|
981
|
+
expectedAuthorityVersion: requirePositiveInteger(fields["expected_authority_version"], "expected_authority_version"),
|
|
982
|
+
authorization,
|
|
983
|
+
...(reason !== undefined ? { reason } : {}),
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
else {
|
|
987
|
+
throw new ManagementError("invalid_input", "kind must be inventory_update, listing_change, product_create_exact or product_money_update_exact");
|
|
988
|
+
}
|
|
989
|
+
writeJson(res, 201, prepared, { "x-request-id": requestId });
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
if (rest === "/operator-grant-drafts") {
|
|
993
|
+
const auth = requireActor(req);
|
|
994
|
+
assertWriteGuards(req, auth.sessionId);
|
|
995
|
+
authorizeOrThrow(auth.ctx, "grants:manage");
|
|
996
|
+
if (auth.ctx.role !== "owner") {
|
|
997
|
+
throw new ManagementError("forbidden", "only owner can prepare grant changes");
|
|
998
|
+
}
|
|
999
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
1000
|
+
"action",
|
|
1001
|
+
"subject_id",
|
|
1002
|
+
"grant_action",
|
|
1003
|
+
"resource_type",
|
|
1004
|
+
"resource_selector",
|
|
1005
|
+
"expires_at",
|
|
1006
|
+
"grant_id",
|
|
1007
|
+
"reason",
|
|
1008
|
+
]);
|
|
1009
|
+
const action = requireString(fields["action"], "action");
|
|
1010
|
+
const reason = optionalString(fields["reason"], "reason");
|
|
1011
|
+
let prepared;
|
|
1012
|
+
if (action === "create") {
|
|
1013
|
+
const channel = options.prepareGrantCreate;
|
|
1014
|
+
if (channel === undefined)
|
|
1015
|
+
throw new ManagementError("unavailable", "grant prepare is unavailable");
|
|
1016
|
+
prepared = await channel({
|
|
1017
|
+
ownerActorId: auth.ctx.actorId,
|
|
1018
|
+
subjectId: requireString(fields["subject_id"], "subject_id"),
|
|
1019
|
+
action: requireGrantAction(fields["grant_action"]),
|
|
1020
|
+
resourceType: requireGrantResourceType(fields["resource_type"]),
|
|
1021
|
+
resourceSelector: requireGrantSelector(fields["resource_selector"]),
|
|
1022
|
+
expiresAt: requireString(fields["expires_at"], "expires_at"),
|
|
1023
|
+
...(reason !== undefined ? { reason } : {}),
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
else if (action === "revoke") {
|
|
1027
|
+
const channel = options.prepareGrantRevoke;
|
|
1028
|
+
if (channel === undefined)
|
|
1029
|
+
throw new ManagementError("unavailable", "grant prepare is unavailable");
|
|
1030
|
+
prepared = await channel({
|
|
1031
|
+
ownerActorId: auth.ctx.actorId,
|
|
1032
|
+
grantId: requireString(fields["grant_id"], "grant_id"),
|
|
1033
|
+
...(reason !== undefined ? { reason } : {}),
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
else {
|
|
1037
|
+
throw new ManagementError("invalid_input", "action must be create or revoke");
|
|
1038
|
+
}
|
|
1039
|
+
writeJson(res, 201, prepared, { "x-request-id": requestId });
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
if (rest === "/promotions/drafts") {
|
|
1043
|
+
const auth = requireActor(req);
|
|
1044
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1045
|
+
authorizeOrThrow(auth.ctx, "products:draft");
|
|
1046
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
1047
|
+
"sku_refs",
|
|
1048
|
+
"rule",
|
|
1049
|
+
"audience",
|
|
1050
|
+
"starts",
|
|
1051
|
+
"ends",
|
|
1052
|
+
"timezone",
|
|
1053
|
+
"ends_date_inclusive",
|
|
1054
|
+
"stackable",
|
|
1055
|
+
"priority",
|
|
1056
|
+
]);
|
|
1057
|
+
const skuRefs = requireStringArray(fields["sku_refs"], "sku_refs");
|
|
1058
|
+
authorizeProductAction(auth.ctx, "product.draft", skuRefs);
|
|
1059
|
+
const created = requireWorkbenchPromotions().createDraft(auth.ctx.merchantId, {
|
|
1060
|
+
skuRefs,
|
|
1061
|
+
rule: fields["rule"],
|
|
1062
|
+
audience: requirePublicAudience(fields["audience"]),
|
|
1063
|
+
starts: requireString(fields["starts"], "starts"),
|
|
1064
|
+
ends: requireString(fields["ends"], "ends"),
|
|
1065
|
+
timezone: requireString(fields["timezone"], "timezone"),
|
|
1066
|
+
...(fields["ends_date_inclusive"] === true ? { endsDateInclusive: true } : {}),
|
|
1067
|
+
...(fields["stackable"] === true ? { stackable: true } : {}),
|
|
1068
|
+
...(fields["priority"] !== undefined
|
|
1069
|
+
? { priority: requireInteger(fields["priority"], "priority") }
|
|
1070
|
+
: {}),
|
|
1071
|
+
});
|
|
1072
|
+
writeJson(res, 201, created, { "x-request-id": requestId });
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
const promotionDraftMatch = /^\/promotions\/([^/]+)\/(publish|withdraw)-drafts$/.exec(rest);
|
|
1076
|
+
if (promotionDraftMatch !== null) {
|
|
1077
|
+
const auth = requireActor(req);
|
|
1078
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1079
|
+
authorizeOrThrow(auth.ctx, "products:draft");
|
|
1080
|
+
const promotionId = pathSegment(promotionDraftMatch[1] ?? "");
|
|
1081
|
+
const promotion = requireWorkbenchPromotions().getPromotion(auth.ctx.merchantId, promotionId);
|
|
1082
|
+
if (promotion === undefined)
|
|
1083
|
+
throw new ManagementError("not_found", "unknown promotion");
|
|
1084
|
+
authorizeProductAction(auth.ctx, "product.draft", promotion.sku_refs);
|
|
1085
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
1086
|
+
"expected_revision",
|
|
1087
|
+
"reason",
|
|
1088
|
+
"broadcast",
|
|
1089
|
+
]);
|
|
1090
|
+
const expectedRevision = requireInteger(fields["expected_revision"], "expected_revision");
|
|
1091
|
+
const reason = optionalString(fields["reason"], "reason");
|
|
1092
|
+
const publish = promotionDraftMatch[2] === "publish";
|
|
1093
|
+
const channel = publish ? options.preparePromotionPublish : options.preparePromotionWithdraw;
|
|
1094
|
+
if (channel === undefined) {
|
|
1095
|
+
throw new ManagementError("unavailable", "promotion candidate preparation is unavailable");
|
|
1096
|
+
}
|
|
1097
|
+
const broadcast = fields["broadcast"] === undefined
|
|
1098
|
+
? undefined
|
|
1099
|
+
: requireObject(fields["broadcast"], "broadcast");
|
|
1100
|
+
let workflowId;
|
|
1101
|
+
let broadcastAuthorization;
|
|
1102
|
+
if (publish) {
|
|
1103
|
+
if (options.promotionBroadcastWorkflows === undefined) {
|
|
1104
|
+
throw new ManagementError("unavailable", "promotion workflow authority is unavailable");
|
|
1105
|
+
}
|
|
1106
|
+
if (broadcast !== undefined) {
|
|
1107
|
+
authorizeOrThrow(auth.ctx, "broadcast:draft");
|
|
1108
|
+
const scoped = authorizeBroadcastAction(auth.ctx, "broadcast.draft");
|
|
1109
|
+
broadcastAuthorization = {
|
|
1110
|
+
actor_id: auth.ctx.actorId,
|
|
1111
|
+
actor_role: auth.ctx.role,
|
|
1112
|
+
action: "broadcast.draft",
|
|
1113
|
+
authorization_generation: scoped.generation,
|
|
1114
|
+
matched_grant_ids: scoped.grantIds,
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
workflowId = options.promotionBroadcastWorkflows.create({
|
|
1118
|
+
merchantId: auth.ctx.merchantId,
|
|
1119
|
+
promotionId,
|
|
1120
|
+
...(broadcast !== undefined ? { broadcast } : {}),
|
|
1121
|
+
...(broadcastAuthorization !== undefined ? { broadcastAuthorization } : {}),
|
|
1122
|
+
}).workflow_id;
|
|
1123
|
+
}
|
|
1124
|
+
let prepared;
|
|
1125
|
+
try {
|
|
1126
|
+
prepared = await channel({
|
|
1127
|
+
promotionId,
|
|
1128
|
+
expectedRevision,
|
|
1129
|
+
...(workflowId !== undefined ? { workflowId } : {}),
|
|
1130
|
+
...(broadcastAuthorization !== undefined ? { broadcastAuthorization } : {}),
|
|
1131
|
+
...(reason !== undefined ? { reason } : {}),
|
|
1132
|
+
});
|
|
1133
|
+
if (workflowId !== undefined) {
|
|
1134
|
+
const candidateId = candidateIdFromPreparation(prepared);
|
|
1135
|
+
if (!options.promotionBroadcastWorkflows.bindPromotionCandidate(auth.ctx.merchantId, workflowId, candidateId)) {
|
|
1136
|
+
throw new Error("promotion workflow candidate binding failed");
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
catch (error) {
|
|
1141
|
+
if (workflowId !== undefined) {
|
|
1142
|
+
options.promotionBroadcastWorkflows?.markFailed(auth.ctx.merchantId, workflowId, error instanceof Error ? error.message : String(error));
|
|
1143
|
+
}
|
|
1144
|
+
throw error;
|
|
1145
|
+
}
|
|
1146
|
+
const response = workflowId !== undefined &&
|
|
1147
|
+
prepared !== null &&
|
|
1148
|
+
typeof prepared === "object" &&
|
|
1149
|
+
!Array.isArray(prepared)
|
|
1150
|
+
? { ...prepared, workflow_id: workflowId }
|
|
1151
|
+
: prepared;
|
|
1152
|
+
writeJson(res, 201, response, { "x-request-id": requestId });
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
const retryPromotionBroadcast = /^\/promotion-workflows\/([^/]+)\/retry-broadcast$/.exec(rest);
|
|
1156
|
+
if (retryPromotionBroadcast !== null) {
|
|
1157
|
+
const auth = requireActor(req);
|
|
1158
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1159
|
+
authorizeOrThrow(auth.ctx, "broadcast:draft");
|
|
1160
|
+
const workflows = options.promotionBroadcastWorkflows;
|
|
1161
|
+
const prepare = options.prepareBroadcastPublish;
|
|
1162
|
+
if (workflows === undefined || prepare === undefined) {
|
|
1163
|
+
throw new ManagementError("unavailable", "promotion broadcast retry is unavailable");
|
|
1164
|
+
}
|
|
1165
|
+
const workflowId = pathSegment(retryPromotionBroadcast[1] ?? "");
|
|
1166
|
+
if (workflows.get(auth.ctx.merchantId, workflowId)?.status !== "partial") {
|
|
1167
|
+
throw new ManagementError("conflict", "workflow is not in a retryable partial state");
|
|
1168
|
+
}
|
|
1169
|
+
const broadcast = workflows.broadcastContent(auth.ctx.merchantId, workflowId);
|
|
1170
|
+
if (broadcast === undefined) {
|
|
1171
|
+
throw new ManagementError("conflict", "workflow is not in a retryable partial state");
|
|
1172
|
+
}
|
|
1173
|
+
const scoped = authorizeBroadcastAction(auth.ctx, "broadcast.draft");
|
|
1174
|
+
const authorization = {
|
|
1175
|
+
actor_id: auth.ctx.actorId,
|
|
1176
|
+
actor_role: auth.ctx.role,
|
|
1177
|
+
action: "broadcast.draft",
|
|
1178
|
+
authorization_generation: scoped.generation,
|
|
1179
|
+
matched_grant_ids: scoped.grantIds,
|
|
1180
|
+
};
|
|
1181
|
+
const prepared = await prepare({
|
|
1182
|
+
broadcast,
|
|
1183
|
+
authorization,
|
|
1184
|
+
workflowId,
|
|
1185
|
+
reason: "retry promotion workflow broadcast draft only",
|
|
1186
|
+
});
|
|
1187
|
+
const candidateId = candidateIdFromPreparation(prepared);
|
|
1188
|
+
const workflow = workflows.markBroadcastPending(auth.ctx.merchantId, workflowId, candidateId);
|
|
1189
|
+
writeJson(res, 201, {
|
|
1190
|
+
...prepared,
|
|
1191
|
+
workflow,
|
|
1192
|
+
}, { "x-request-id": requestId });
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
const acknowledgeAlert = /^\/alerts\/([^/]+)\/acknowledgements$/.exec(rest);
|
|
1196
|
+
if (acknowledgeAlert !== null) {
|
|
1197
|
+
const auth = requireActor(req);
|
|
1198
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1199
|
+
authorizeOrThrow(auth.ctx, "alerts:ack");
|
|
1200
|
+
objectFields(await readJsonBody(req), []);
|
|
1201
|
+
const store = options.workbenchReconciliation;
|
|
1202
|
+
if (store === undefined) {
|
|
1203
|
+
throw new ManagementError("unavailable", "Workbench alert authority is not configured");
|
|
1204
|
+
}
|
|
1205
|
+
const alertId = pathSegment(acknowledgeAlert[1] ?? "");
|
|
1206
|
+
if (!store.acknowledgeAlert(auth.ctx.merchantId, alertId, auth.ctx.actorId)) {
|
|
1207
|
+
throw new ManagementError("not_found", "unknown alert");
|
|
1208
|
+
}
|
|
1209
|
+
writeJson(res, 200, { alert_id: alertId, acknowledged: true }, { "x-request-id": requestId });
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
writeWorkbenchProblem(res, "RESOURCE_NOT_FOUND", requestId, "资源不存在", "Workbench 写路由不存在或尚未实现。");
|
|
1213
|
+
}
|
|
1214
|
+
function requireWorkbenchConfirmations() {
|
|
1215
|
+
if (options.workbenchConfirmations === undefined) {
|
|
1216
|
+
throw new WorkbenchConfirmationError("credential_unavailable", "trusted confirmation channel is not configured");
|
|
1217
|
+
}
|
|
1218
|
+
return options.workbenchConfirmations;
|
|
1219
|
+
}
|
|
1220
|
+
function requireWorkbenchFeed() {
|
|
1221
|
+
if (options.workbenchFeed === undefined) {
|
|
1222
|
+
throw new ManagementError("unavailable", "Workbench Feed authority is not configured");
|
|
1223
|
+
}
|
|
1224
|
+
return options.workbenchFeed;
|
|
1225
|
+
}
|
|
1226
|
+
function requireWorkbenchGrants() {
|
|
1227
|
+
if (options.workbenchGrants === undefined) {
|
|
1228
|
+
throw new ManagementError("unavailable", "Workbench grant authority is not configured");
|
|
1229
|
+
}
|
|
1230
|
+
return options.workbenchGrants;
|
|
1231
|
+
}
|
|
1232
|
+
function requireWorkbenchPromotions() {
|
|
1233
|
+
if (options.workbenchPromotions === undefined) {
|
|
1234
|
+
throw new ManagementError("unavailable", "Workbench promotion authority is not configured");
|
|
1235
|
+
}
|
|
1236
|
+
return options.workbenchPromotions;
|
|
1237
|
+
}
|
|
1238
|
+
function authorizeBroadcastAction(actor, action) {
|
|
1239
|
+
if (actor.role === "owner") {
|
|
1240
|
+
return {
|
|
1241
|
+
generation: options.workbenchGrants?.authorizationGeneration(actor.merchantId, actor.actorId) ?? 0,
|
|
1242
|
+
grantIds: [],
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
const grants = options.workbenchGrants;
|
|
1246
|
+
if (grants === undefined)
|
|
1247
|
+
throw new ManagementError("forbidden", "scoped grants are unavailable");
|
|
1248
|
+
const result = grants.authorize(actor, { action, resourceType: "merchant" });
|
|
1249
|
+
if (!result.authorized)
|
|
1250
|
+
throw new ManagementError("forbidden", `missing scoped grant: ${action}`);
|
|
1251
|
+
return { generation: result.generation, grantIds: result.grantIds };
|
|
1252
|
+
}
|
|
1253
|
+
function authorizeProductAction(actor, action, resourceIds) {
|
|
1254
|
+
if (actor.role === "owner") {
|
|
1255
|
+
return {
|
|
1256
|
+
generation: options.workbenchGrants?.authorizationGeneration(actor.merchantId, actor.actorId) ?? 0,
|
|
1257
|
+
grantIds: [],
|
|
1258
|
+
};
|
|
1259
|
+
}
|
|
1260
|
+
const grants = options.workbenchGrants;
|
|
1261
|
+
if (grants === undefined)
|
|
1262
|
+
throw new ManagementError("forbidden", "scoped grants are unavailable");
|
|
1263
|
+
const result = grants.authorize(actor, {
|
|
1264
|
+
action,
|
|
1265
|
+
resourceType: "product",
|
|
1266
|
+
resourceIds,
|
|
1267
|
+
});
|
|
1268
|
+
if (!result.authorized)
|
|
1269
|
+
throw new ManagementError("forbidden", `missing scoped grant: ${action}`);
|
|
1270
|
+
return { generation: result.generation, grantIds: result.grantIds };
|
|
1271
|
+
}
|
|
1272
|
+
function authorizeProductCreateAction(actor) {
|
|
1273
|
+
if (actor.role === "owner") {
|
|
1274
|
+
return {
|
|
1275
|
+
generation: options.workbenchGrants?.authorizationGeneration(actor.merchantId, actor.actorId) ?? 0,
|
|
1276
|
+
grantIds: [],
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
const grants = options.workbenchGrants;
|
|
1280
|
+
if (grants === undefined)
|
|
1281
|
+
throw new ManagementError("forbidden", "scoped grants are unavailable");
|
|
1282
|
+
const result = grants.authorize(actor, {
|
|
1283
|
+
action: "product.create",
|
|
1284
|
+
resourceType: "merchant",
|
|
1285
|
+
});
|
|
1286
|
+
if (!result.authorized) {
|
|
1287
|
+
throw new ManagementError("forbidden", "missing scoped grant: product.create");
|
|
1288
|
+
}
|
|
1289
|
+
return { generation: result.generation, grantIds: result.grantIds };
|
|
1290
|
+
}
|
|
1291
|
+
function authorizeBroadcastCandidate(actor, candidate, action) {
|
|
1292
|
+
if (!Object.values(BROADCAST_TOOLS).includes(candidate.tool)) {
|
|
1293
|
+
return undefined;
|
|
1294
|
+
}
|
|
1295
|
+
authorizeOrThrow(actor, "broadcast:decide");
|
|
1296
|
+
const scoped = authorizeBroadcastAction(actor, action);
|
|
1297
|
+
return {
|
|
1298
|
+
actor_id: actor.actorId,
|
|
1299
|
+
actor_role: actor.role,
|
|
1300
|
+
action,
|
|
1301
|
+
authorization_generation: scoped.generation,
|
|
1302
|
+
matched_grant_ids: scoped.grantIds,
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
function authorizeGrantCandidate(actor, candidate) {
|
|
1306
|
+
if (!Object.values(GRANT_TOOLS).includes(candidate.tool)) {
|
|
1307
|
+
return undefined;
|
|
1308
|
+
}
|
|
1309
|
+
authorizeOrThrow(actor, "grants:manage");
|
|
1310
|
+
if (actor.role !== "owner") {
|
|
1311
|
+
throw new ManagementError("forbidden", "only owner can decide grant changes");
|
|
1312
|
+
}
|
|
1313
|
+
return {
|
|
1314
|
+
actor_id: actor.actorId,
|
|
1315
|
+
actor_role: actor.role,
|
|
1316
|
+
action: "grants.manage",
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
function authorizePromotionCandidate(actor, candidate) {
|
|
1320
|
+
if (!Object.values(PROMOTION_TOOLS).includes(candidate.tool)) {
|
|
1321
|
+
return undefined;
|
|
1322
|
+
}
|
|
1323
|
+
authorizeOrThrow(actor, "products:decide");
|
|
1324
|
+
const promotionId = String(candidate.arguments["promotion_id"] ?? "");
|
|
1325
|
+
const promotion = requireWorkbenchPromotions().getPromotion(actor.merchantId, promotionId);
|
|
1326
|
+
if (promotion === undefined)
|
|
1327
|
+
throw new ManagementError("not_found", "unknown promotion");
|
|
1328
|
+
const scoped = authorizeProductAction(actor, "product.decide", promotion.sku_refs);
|
|
1329
|
+
return {
|
|
1330
|
+
actor_id: actor.actorId,
|
|
1331
|
+
actor_role: actor.role,
|
|
1332
|
+
action: "product.decide",
|
|
1333
|
+
resource_type: "product",
|
|
1334
|
+
resource_ids: promotion.sku_refs,
|
|
1335
|
+
authorization_generation: scoped.generation,
|
|
1336
|
+
matched_grant_ids: scoped.grantIds,
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
function authorizeProductCandidate(actor, candidate) {
|
|
1340
|
+
const productScopedTools = new Set([
|
|
1341
|
+
"draft_product_change",
|
|
1342
|
+
"kiwi_merchant_prepare_product_update",
|
|
1343
|
+
"kiwi_merchant_prepare_inventory_update",
|
|
1344
|
+
"kiwi_merchant_prepare_listing_change",
|
|
1345
|
+
EXACT_PRODUCT_TOOLS.updateMoney,
|
|
1346
|
+
]);
|
|
1347
|
+
const createsProduct = candidate.tool === "kiwi_merchant_prepare_product_create" ||
|
|
1348
|
+
candidate.tool === EXACT_PRODUCT_TOOLS.create;
|
|
1349
|
+
if (!createsProduct && !productScopedTools.has(candidate.tool))
|
|
1350
|
+
return undefined;
|
|
1351
|
+
authorizeOrThrow(actor, "products:decide");
|
|
1352
|
+
if (createsProduct) {
|
|
1353
|
+
const sku = candidate.tool === EXACT_PRODUCT_TOOLS.create
|
|
1354
|
+
? requireString(candidate.arguments["sku"], "candidate sku")
|
|
1355
|
+
: requireString(requireObject(candidate.arguments["product"], "candidate product")["sku"], "candidate product.sku");
|
|
1356
|
+
const generation = options.workbenchGrants?.authorizationGeneration(actor.merchantId, actor.actorId) ?? 0;
|
|
1357
|
+
if (actor.role !== "owner") {
|
|
1358
|
+
const grants = options.workbenchGrants;
|
|
1359
|
+
if (grants === undefined) {
|
|
1360
|
+
throw new ManagementError("forbidden", "scoped grants are unavailable");
|
|
1361
|
+
}
|
|
1362
|
+
const result = grants.authorize(actor, {
|
|
1363
|
+
action: "product.create",
|
|
1364
|
+
resourceType: "merchant",
|
|
1365
|
+
});
|
|
1366
|
+
if (!result.authorized) {
|
|
1367
|
+
throw new ManagementError("forbidden", "missing scoped grant: product.create");
|
|
1368
|
+
}
|
|
1369
|
+
return {
|
|
1370
|
+
actor_id: actor.actorId,
|
|
1371
|
+
actor_role: actor.role,
|
|
1372
|
+
action: "product.create",
|
|
1373
|
+
resource_type: "merchant",
|
|
1374
|
+
resource_ids: [sku],
|
|
1375
|
+
authorization_generation: result.generation,
|
|
1376
|
+
matched_grant_ids: result.grantIds,
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
return {
|
|
1380
|
+
actor_id: actor.actorId,
|
|
1381
|
+
actor_role: actor.role,
|
|
1382
|
+
action: "product.create",
|
|
1383
|
+
resource_type: "merchant",
|
|
1384
|
+
resource_ids: [sku],
|
|
1385
|
+
authorization_generation: generation,
|
|
1386
|
+
matched_grant_ids: [],
|
|
1387
|
+
};
|
|
1388
|
+
}
|
|
1389
|
+
const sku = requireString(candidate.arguments["sku"], "candidate sku");
|
|
1390
|
+
const scoped = authorizeProductAction(actor, "product.decide", [sku]);
|
|
1391
|
+
return {
|
|
1392
|
+
actor_id: actor.actorId,
|
|
1393
|
+
actor_role: actor.role,
|
|
1394
|
+
action: "product.decide",
|
|
1395
|
+
resource_type: "product",
|
|
1396
|
+
resource_ids: [sku],
|
|
1397
|
+
authorization_generation: scoped.generation,
|
|
1398
|
+
matched_grant_ids: scoped.grantIds,
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
function authorizeServiceControlCandidate(actor, candidate) {
|
|
1402
|
+
if (candidate.tool !== SERVICE_CONTROL_TOOLS.resume)
|
|
1403
|
+
return undefined;
|
|
1404
|
+
authorizeOrThrow(actor, "service:resume");
|
|
1405
|
+
if (actor.role !== "owner") {
|
|
1406
|
+
throw new ManagementError("forbidden", "only owner can decide service recovery");
|
|
1407
|
+
}
|
|
1408
|
+
return {
|
|
1409
|
+
actor_id: actor.actorId,
|
|
1410
|
+
actor_role: actor.role,
|
|
1411
|
+
action: "service.resume",
|
|
1412
|
+
authorization_generation: 0,
|
|
1413
|
+
matched_grant_ids: [],
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
async function requireRegistrationAuthorization(req, actor) {
|
|
1417
|
+
const registration = options.webauthnRegistration;
|
|
1418
|
+
if (registration === undefined || !(await registration.authorize(req, actor))) {
|
|
1419
|
+
throw new WorkbenchConfirmationError("credential_unavailable", "independent WebAuthn registration authorization is unavailable");
|
|
1420
|
+
}
|
|
1421
|
+
return registration;
|
|
1422
|
+
}
|
|
1423
|
+
async function routeGet(req, res, url, rest) {
|
|
1424
|
+
if (rest === "/session") {
|
|
1425
|
+
const auth = requireActor(req);
|
|
1426
|
+
writeJson(res, 200, {
|
|
1427
|
+
api_version: `${MANAGEMENT_API_MAJOR}`,
|
|
1428
|
+
actor_id: auth.session.principal_id,
|
|
1429
|
+
merchant_id: auth.session.merchant_id,
|
|
1430
|
+
role: auth.session.role,
|
|
1431
|
+
expires_at: auth.session.expires_at,
|
|
1432
|
+
csrf_token: csrfTokenFor(auth.sessionId),
|
|
1433
|
+
});
|
|
1434
|
+
return;
|
|
1435
|
+
}
|
|
1436
|
+
if (rest === "/status") {
|
|
1437
|
+
const auth = requireActor(req);
|
|
1438
|
+
writeJson(res, 200, await readService.getStatus(auth.ctx));
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
if (rest === "/products") {
|
|
1442
|
+
const auth = requireActor(req);
|
|
1443
|
+
writeJson(res, 200, await readService.listProducts(auth.ctx, pageQuery(url)));
|
|
1444
|
+
return;
|
|
1445
|
+
}
|
|
1446
|
+
if (rest === "/onboarding") {
|
|
1447
|
+
const auth = requireActor(req);
|
|
1448
|
+
authorizeOrThrow(auth.ctx, "onboarding:manage");
|
|
1449
|
+
const channel = onboardingChannel();
|
|
1450
|
+
const record = channel.store.activeRecord(auth.ctx.merchantId) ?? null;
|
|
1451
|
+
const readiness = await options.readiness();
|
|
1452
|
+
const setupNotices = [
|
|
1453
|
+
...(readiness.checks.products?.code === "PRODUCTS_NOT_CONFIGURED"
|
|
1454
|
+
? [{ code: "products_required", message: "请先导入商品;导入后系统会自动继续服务检查,当前不会报价或发布名片。" }]
|
|
1455
|
+
: []),
|
|
1456
|
+
...(options.merchantNameNeedsUpdate === true
|
|
1457
|
+
? [{ code: "merchant_name_required", message: "请设置商家显示名后再确认公开资料。" }]
|
|
1458
|
+
: []),
|
|
1459
|
+
];
|
|
1460
|
+
const enrollment = record === null || channel.enrollmentStateDir === undefined
|
|
1461
|
+
? undefined
|
|
1462
|
+
: readEnrollmentStore(channel.enrollmentStateDir).sessions
|
|
1463
|
+
.map((session) => session)
|
|
1464
|
+
.find((session) => session.owner_ref === record.recordId);
|
|
1465
|
+
writeJson(res, 200, {
|
|
1466
|
+
record,
|
|
1467
|
+
plan: record === null ? null : planWizard(record),
|
|
1468
|
+
setup_notices: setupNotices,
|
|
1469
|
+
...(enrollment !== undefined ? {
|
|
1470
|
+
connect: {
|
|
1471
|
+
enrollment_id: enrollment.enrollment_id,
|
|
1472
|
+
status: enrollment.status,
|
|
1473
|
+
user_code: enrollment.user_code,
|
|
1474
|
+
verification_uri: enrollment.verification_uri,
|
|
1475
|
+
expires_at: enrollment.expires_at,
|
|
1476
|
+
},
|
|
1477
|
+
} : {}),
|
|
1478
|
+
});
|
|
1479
|
+
return;
|
|
1480
|
+
}
|
|
1481
|
+
if (rest === "/policy") {
|
|
1482
|
+
const auth = requireActor(req);
|
|
1483
|
+
writeJson(res, 200, await readService.getPolicy(auth.ctx));
|
|
1484
|
+
return;
|
|
1485
|
+
}
|
|
1486
|
+
if (rest === "/approvals") {
|
|
1487
|
+
const auth = requireActor(req);
|
|
1488
|
+
writeJson(res, 200, await readService.listApprovals(auth.ctx, pageQuery(url)));
|
|
1489
|
+
return;
|
|
1490
|
+
}
|
|
1491
|
+
const approvalMatch = /^\/approvals\/([^/]+)$/.exec(rest);
|
|
1492
|
+
if (approvalMatch !== null) {
|
|
1493
|
+
const auth = requireActor(req);
|
|
1494
|
+
writeJson(res, 200, await readService.getApproval(auth.ctx, pathSegment(approvalMatch[1] ?? "")));
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
const operationMatch = /^\/operations\/([^/]+)$/.exec(rest);
|
|
1498
|
+
if (operationMatch !== null) {
|
|
1499
|
+
const auth = requireActor(req);
|
|
1500
|
+
writeJson(res, 200, readService.getOperation(auth.ctx, pathSegment(operationMatch[1] ?? "")));
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
if (isKnownPath(rest)) {
|
|
1504
|
+
writeJson(res, 405, errorBody("invalid_input", "method not allowed"), { allow: "POST" });
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1507
|
+
writeJson(res, 404, errorBody("not_found", "unknown management api path"));
|
|
1508
|
+
}
|
|
1509
|
+
// ── 写路由(BD §10.1;每条都过 CSRF/Origin + 幂等 + 服务层复检)──────────
|
|
1510
|
+
async function routePost(req, res, rest) {
|
|
1511
|
+
if (rest === "/confirmations") {
|
|
1512
|
+
await postConfirmation(req, res);
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
if (rest === "/onboarding/intents") {
|
|
1516
|
+
await postOnboardingIntent(req, res);
|
|
1517
|
+
return;
|
|
1518
|
+
}
|
|
1519
|
+
const advanceMatch = /^\/onboarding\/([^/]+)\/advance$/.exec(rest);
|
|
1520
|
+
if (advanceMatch !== null) {
|
|
1521
|
+
await postOnboardingAdvance(req, res, pathSegment(advanceMatch[1] ?? ""));
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
const cancelMatch = /^\/onboarding\/([^/]+)\/cancel$/.exec(rest);
|
|
1525
|
+
if (cancelMatch !== null) {
|
|
1526
|
+
await postOnboardingCancel(req, res, pathSegment(cancelMatch[1] ?? ""));
|
|
1527
|
+
return;
|
|
1528
|
+
}
|
|
1529
|
+
const refusedMatch = /^\/onboarding\/([^/]+)\/consent-refused$/.exec(rest);
|
|
1530
|
+
if (refusedMatch !== null) {
|
|
1531
|
+
await postOnboardingConsentRefused(req, res, pathSegment(refusedMatch[1] ?? ""));
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1534
|
+
if (rest === "/service/pause") {
|
|
1535
|
+
await postServicePause(req, res);
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1538
|
+
if (rest === "/service/resume") {
|
|
1539
|
+
await postServiceResume(req, res);
|
|
1540
|
+
return;
|
|
1541
|
+
}
|
|
1542
|
+
const decisionMatch = /^\/approvals\/([^/]+)\/(approve|reject)$/.exec(rest);
|
|
1543
|
+
if (decisionMatch !== null) {
|
|
1544
|
+
await postApprovalDecision(req, res, pathSegment(decisionMatch[1] ?? ""), decisionMatch[2] === "approve");
|
|
1545
|
+
return;
|
|
1546
|
+
}
|
|
1547
|
+
if (rest === "/products/import-drafts") {
|
|
1548
|
+
await postProductsImportDraft(req, res);
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
const importCommitMatch = /^\/products\/import-drafts\/([^/]+)\/commit$/.exec(rest);
|
|
1552
|
+
if (importCommitMatch !== null) {
|
|
1553
|
+
await postProductsImportCommit(req, res, pathSegment(importCommitMatch[1] ?? ""));
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
if (rest === "/policy/drafts") {
|
|
1557
|
+
await postPolicyDraft(req, res);
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
const policyCommitMatch = /^\/policy\/drafts\/([^/]+)\/commit$/.exec(rest);
|
|
1561
|
+
if (policyCommitMatch !== null) {
|
|
1562
|
+
await postPolicyCommit(req, res, pathSegment(policyCommitMatch[1] ?? ""));
|
|
1563
|
+
return;
|
|
1564
|
+
}
|
|
1565
|
+
if (isKnownPath(rest)) {
|
|
1566
|
+
writeJson(res, 405, errorBody("invalid_input", "method not allowed"), { allow: "GET" });
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
writeJson(res, 404, errorBody("not_found", "unknown management api path"));
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* POST /confirmations —— 生成短时单次确认引用(BD §10.1)。
|
|
1573
|
+
* 候选审批确认绑定候选摘要/主体/商家/动作(core 凭证存储,执行层核销);
|
|
1574
|
+
* 非候选命令目前仅 service.resume(管理确认表,单次核销)。
|
|
1575
|
+
* **确认引用不能由普通对话工具申请**(§7.3)——本端点只接受页面会话。
|
|
1576
|
+
*/
|
|
1577
|
+
// ── 开通向导(M4 §5.4)──────────────────────────────────────────────
|
|
1578
|
+
//
|
|
1579
|
+
// 写在这里而不是 /admin/*:那是"审核面"(一次性确认凭证、无 CSRF),本 API 面
|
|
1580
|
+
// 已有会话→主体 + CSRF + 幂等四元组 + 错误码映射,向导是商家自己的操作(BD §9)。
|
|
1581
|
+
/** 向导依赖;未配置 → 503(不伪造一个能用的向导)。 */
|
|
1582
|
+
function onboardingChannel() {
|
|
1583
|
+
const channel = options.onboarding;
|
|
1584
|
+
if (channel === undefined) {
|
|
1585
|
+
throw new ManagementError("unavailable", "onboarding is not configured");
|
|
1586
|
+
}
|
|
1587
|
+
return channel;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* POST /onboarding/intents —— 打开/复用开通意图(§7.1:重复点击只返回同一条)。
|
|
1591
|
+
*
|
|
1592
|
+
* 幂等:同键同摘要回原结果、同键不同摘要 409(与其它写命令同口径)。
|
|
1593
|
+
*/
|
|
1594
|
+
async function postOnboardingIntent(req, res) {
|
|
1595
|
+
const auth = requireActor(req);
|
|
1596
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1597
|
+
const body = await readJsonBody(req);
|
|
1598
|
+
const fields = objectFields(body, [
|
|
1599
|
+
"intent_id",
|
|
1600
|
+
"version_digest",
|
|
1601
|
+
"idempotency_key",
|
|
1602
|
+
"new_generation",
|
|
1603
|
+
]);
|
|
1604
|
+
authorizeOrThrow(auth.ctx, "onboarding:manage");
|
|
1605
|
+
const channel = onboardingChannel();
|
|
1606
|
+
const intentId = requireString(fields["intent_id"], "intent_id");
|
|
1607
|
+
const versionDigest = requireString(fields["version_digest"], "version_digest");
|
|
1608
|
+
const idempotencyKey = requireString(fields["idempotency_key"], "idempotency_key");
|
|
1609
|
+
const newGeneration = fields["new_generation"] === true;
|
|
1610
|
+
const requestDigest = managementRequestDigest({
|
|
1611
|
+
intent_id: intentId,
|
|
1612
|
+
version_digest: versionDigest,
|
|
1613
|
+
new_generation: newGeneration,
|
|
1614
|
+
});
|
|
1615
|
+
const probed = operations.probe({
|
|
1616
|
+
merchantId: auth.ctx.merchantId,
|
|
1617
|
+
actorId: auth.ctx.actorId,
|
|
1618
|
+
commandType: "onboarding.open_intent",
|
|
1619
|
+
idempotencyKey,
|
|
1620
|
+
requestDigest,
|
|
1621
|
+
});
|
|
1622
|
+
if (probed.kind === "replay") {
|
|
1623
|
+
writeJson(res, 200, probed.receipt);
|
|
1624
|
+
return;
|
|
1625
|
+
}
|
|
1626
|
+
if (probed.kind === "conflict") {
|
|
1627
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
1628
|
+
return;
|
|
1629
|
+
}
|
|
1630
|
+
const begun = operations.begin({
|
|
1631
|
+
merchantId: auth.ctx.merchantId,
|
|
1632
|
+
actorId: auth.ctx.actorId,
|
|
1633
|
+
commandType: "onboarding.open_intent",
|
|
1634
|
+
idempotencyKey,
|
|
1635
|
+
requestDigest,
|
|
1636
|
+
});
|
|
1637
|
+
if (begun.kind === "replay") {
|
|
1638
|
+
writeJson(res, 200, begun.receipt);
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
if (begun.kind === "conflict") {
|
|
1642
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
1643
|
+
return;
|
|
1644
|
+
}
|
|
1645
|
+
try {
|
|
1646
|
+
const record = channel.store.openIntent({
|
|
1647
|
+
merchantId: auth.ctx.merchantId,
|
|
1648
|
+
intentId,
|
|
1649
|
+
versionDigest,
|
|
1650
|
+
idempotencyKey: `onb-open:${idempotencyKey}`,
|
|
1651
|
+
requestDigest,
|
|
1652
|
+
...(newGeneration ? { newGeneration: true } : {}),
|
|
1653
|
+
});
|
|
1654
|
+
const receipt = {
|
|
1655
|
+
...staticReceipt(begun.operationId, "onboarding.open_intent", "succeeded"),
|
|
1656
|
+
resource_ref: `onboarding:${record.recordId}`,
|
|
1657
|
+
completed_at: now().toISOString(),
|
|
1658
|
+
};
|
|
1659
|
+
operations.complete(begun.operationId, "succeeded", receipt);
|
|
1660
|
+
writeJson(res, 200, { ...receipt, record });
|
|
1661
|
+
return;
|
|
1662
|
+
}
|
|
1663
|
+
catch (err) {
|
|
1664
|
+
// 存储层拒绝(非法输入/冲突)→ 释放占位;未产生业务效果,可修正后原键重试。
|
|
1665
|
+
operations.release(begun.operationId);
|
|
1666
|
+
respondError(res, err);
|
|
1667
|
+
return;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* POST /onboarding/{id}/advance —— 推进**一步**(§5.4)。
|
|
1672
|
+
*
|
|
1673
|
+
* 证据纪律(T007/T029):请求体**只能给 `note`(留痕用)**,不能给权威证据。
|
|
1674
|
+
* 需要权威证据的步骤由服务端 `platformEvidence` 适配器去平台取回执;适配器未配置
|
|
1675
|
+
* 或取不到 → **不推进**(503 / 拒绝),绝不接受客户端自称的"查询回执"。
|
|
1676
|
+
*/
|
|
1677
|
+
async function postOnboardingAdvance(req, res, recordId) {
|
|
1678
|
+
const auth = requireActor(req);
|
|
1679
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1680
|
+
const body = await readJsonBody(req);
|
|
1681
|
+
const fields = objectFields(body, ["step", "expected_revision", "idempotency_key", "note"]);
|
|
1682
|
+
authorizeOrThrow(auth.ctx, "onboarding:manage");
|
|
1683
|
+
const channel = onboardingChannel();
|
|
1684
|
+
const stepId = requireString(fields["step"], "step");
|
|
1685
|
+
const expectedRevision = requireInteger(fields["expected_revision"], "expected_revision");
|
|
1686
|
+
const idempotencyKey = requireString(fields["idempotency_key"], "idempotency_key");
|
|
1687
|
+
const note = optionalString(fields["note"], "note");
|
|
1688
|
+
const record = channel.store.getRecord(recordId);
|
|
1689
|
+
if (record === undefined || record.merchantId !== auth.ctx.merchantId) {
|
|
1690
|
+
// 不区分"不存在"与"不归本商家"(防枚举)
|
|
1691
|
+
throw new ManagementError("not_found", `unknown onboarding record: ${recordId}`);
|
|
1692
|
+
}
|
|
1693
|
+
const definition = WIZARD_STEPS.find((step) => step.id === stepId);
|
|
1694
|
+
if (definition === undefined) {
|
|
1695
|
+
throw new ManagementError("invalid_input", `unknown wizard step: ${stepId}`);
|
|
1696
|
+
}
|
|
1697
|
+
const requestDigest = managementRequestDigest({
|
|
1698
|
+
record_id: recordId,
|
|
1699
|
+
step: stepId,
|
|
1700
|
+
expected_revision: expectedRevision,
|
|
1701
|
+
});
|
|
1702
|
+
const probed = operations.probe({
|
|
1703
|
+
merchantId: auth.ctx.merchantId,
|
|
1704
|
+
actorId: auth.ctx.actorId,
|
|
1705
|
+
commandType: "onboarding.advance",
|
|
1706
|
+
idempotencyKey,
|
|
1707
|
+
requestDigest,
|
|
1708
|
+
});
|
|
1709
|
+
if (probed.kind === "replay") {
|
|
1710
|
+
writeJson(res, 200, probed.receipt);
|
|
1711
|
+
return;
|
|
1712
|
+
}
|
|
1713
|
+
if (probed.kind === "conflict") {
|
|
1714
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
1715
|
+
return;
|
|
1716
|
+
}
|
|
1717
|
+
const begun = operations.begin({
|
|
1718
|
+
merchantId: auth.ctx.merchantId,
|
|
1719
|
+
actorId: auth.ctx.actorId,
|
|
1720
|
+
commandType: "onboarding.advance",
|
|
1721
|
+
idempotencyKey,
|
|
1722
|
+
requestDigest,
|
|
1723
|
+
});
|
|
1724
|
+
if (begun.kind === "replay") {
|
|
1725
|
+
writeJson(res, 200, begun.receipt);
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
if (begun.kind === "conflict") {
|
|
1729
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1732
|
+
try {
|
|
1733
|
+
// 证据获取与准入判定排在**幂等探测之后**:同键重放必须先回原回执(UC20),
|
|
1734
|
+
// 不能被"适配器未配置/取不到回执"的 503 抢先——那是两条不同的语义。
|
|
1735
|
+
let evidence;
|
|
1736
|
+
if (definition.requiresAuthoritativeEvidence) {
|
|
1737
|
+
const adapter = channel.platformEvidence;
|
|
1738
|
+
if (adapter === undefined) {
|
|
1739
|
+
operations.release(begun.operationId);
|
|
1740
|
+
throw new ManagementError("tool_binding_unavailable", `step ${stepId} needs authoritative platform evidence; the platform adapter is not configured`);
|
|
1741
|
+
}
|
|
1742
|
+
const obtained = await adapter({ stepId, recordId: record.recordId });
|
|
1743
|
+
if (requestsDisabledLocalImplementation(obtained)) {
|
|
1744
|
+
throw new ManagementError("unavailable", `platform capability ${obtained.code || "cloud_service_unavailable"} is unavailable; local implementation fallback is disabled`);
|
|
1745
|
+
}
|
|
1746
|
+
if (obtained?.kind === "platform_failure") {
|
|
1747
|
+
throw new ManagementError("unavailable", `platform did not return an authoritative receipt (${obtained.code || "platform_failure"})`);
|
|
1748
|
+
}
|
|
1749
|
+
if (obtained === undefined) {
|
|
1750
|
+
operations.release(begun.operationId);
|
|
1751
|
+
throw new ManagementError("unavailable", `platform did not return an authoritative receipt for step ${stepId}`);
|
|
1752
|
+
}
|
|
1753
|
+
evidence = obtained;
|
|
1754
|
+
}
|
|
1755
|
+
else if (note !== undefined) {
|
|
1756
|
+
// 非权威留痕(例如商家拒绝的原因):记录,但不推进任何状态(§7.2)。
|
|
1757
|
+
channel.store.recordPendingEvidence(record.recordId, {
|
|
1758
|
+
kind: "text_claim",
|
|
1759
|
+
summary: note,
|
|
1760
|
+
observedAt: now().toISOString(),
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
// 提交前准入判定(状态不对/证据不足都在写之前拒,避免半途改状态)。
|
|
1764
|
+
const verdict = checkStepSubmission(record, definition.id, evidence);
|
|
1765
|
+
if (!verdict.ok) {
|
|
1766
|
+
operations.release(begun.operationId);
|
|
1767
|
+
throw new ManagementError(verdict.code === "evidence_not_authoritative" ? "forbidden" : "conflict", verdict.reason);
|
|
1768
|
+
}
|
|
1769
|
+
const advanced = channel.store.advance({
|
|
1770
|
+
recordId: record.recordId,
|
|
1771
|
+
expectedRevision,
|
|
1772
|
+
nextStatus: definition.advancesTo,
|
|
1773
|
+
step: definition.id,
|
|
1774
|
+
...(evidence !== undefined ? { evidence } : {}),
|
|
1775
|
+
});
|
|
1776
|
+
const receipt = {
|
|
1777
|
+
...staticReceipt(begun.operationId, "onboarding.advance", "succeeded"),
|
|
1778
|
+
resource_ref: `onboarding:${advanced.recordId}`,
|
|
1779
|
+
result_revision: advanced.revision,
|
|
1780
|
+
completed_at: now().toISOString(),
|
|
1781
|
+
};
|
|
1782
|
+
operations.complete(begun.operationId, "succeeded", receipt);
|
|
1783
|
+
writeJson(res, 200, { ...receipt, record: advanced });
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1786
|
+
catch (err) {
|
|
1787
|
+
// 状态/证据被存储层拒 → 未产生效果,释放占位。
|
|
1788
|
+
operations.release(begun.operationId);
|
|
1789
|
+
respondError(res, err);
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
/** POST /onboarding/{id}/cancel —— 撤销开通意图(终态;不自动删已有云资源)。 */
|
|
1794
|
+
async function postOnboardingCancel(req, res, recordId) {
|
|
1795
|
+
await onboardSimpleCommand(res, req, recordId, "onboarding.cancel", (store, record) => store.cancel(record.recordId, record.revision));
|
|
1796
|
+
}
|
|
1797
|
+
/** POST /onboarding/{id}/consent-refused —— T007:商家拒绝授权 = 保持等待。 */
|
|
1798
|
+
async function postOnboardingConsentRefused(req, res, recordId) {
|
|
1799
|
+
await onboardSimpleCommand(res, req, recordId, "onboarding.consent_refused", (store, record, note) => store.recordConsentRefused(record.recordId, record.revision, note !== undefined ? { note } : {}));
|
|
1800
|
+
}
|
|
1801
|
+
/** cancel / consent-refused 共用的薄编排(同幂等口径,避免两份重复代码)。 */
|
|
1802
|
+
async function onboardSimpleCommand(res, req, recordId, commandType, run) {
|
|
1803
|
+
const auth = requireActor(req);
|
|
1804
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1805
|
+
const body = await readJsonBody(req);
|
|
1806
|
+
const fields = objectFields(body, ["expected_revision", "idempotency_key", "note"]);
|
|
1807
|
+
authorizeOrThrow(auth.ctx, "onboarding:manage");
|
|
1808
|
+
const channel = onboardingChannel();
|
|
1809
|
+
const expectedRevision = requireInteger(fields["expected_revision"], "expected_revision");
|
|
1810
|
+
const idempotencyKey = requireString(fields["idempotency_key"], "idempotency_key");
|
|
1811
|
+
const note = optionalString(fields["note"], "note");
|
|
1812
|
+
const record = channel.store.getRecord(recordId);
|
|
1813
|
+
if (record === undefined || record.merchantId !== auth.ctx.merchantId) {
|
|
1814
|
+
throw new ManagementError("not_found", `unknown onboarding record: ${recordId}`);
|
|
1815
|
+
}
|
|
1816
|
+
if (record.revision !== expectedRevision) {
|
|
1817
|
+
throw new ManagementError("precondition_changed", `record is at revision ${record.revision}, expected ${expectedRevision}`);
|
|
1818
|
+
}
|
|
1819
|
+
const requestDigest = managementRequestDigest({
|
|
1820
|
+
record_id: recordId,
|
|
1821
|
+
expected_revision: expectedRevision,
|
|
1822
|
+
});
|
|
1823
|
+
const probed = operations.probe({
|
|
1824
|
+
merchantId: auth.ctx.merchantId,
|
|
1825
|
+
actorId: auth.ctx.actorId,
|
|
1826
|
+
commandType,
|
|
1827
|
+
idempotencyKey,
|
|
1828
|
+
requestDigest,
|
|
1829
|
+
});
|
|
1830
|
+
if (probed.kind === "replay") {
|
|
1831
|
+
writeJson(res, 200, probed.receipt);
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
if (probed.kind === "conflict") {
|
|
1835
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
1836
|
+
return;
|
|
1837
|
+
}
|
|
1838
|
+
const begun = operations.begin({
|
|
1839
|
+
merchantId: auth.ctx.merchantId,
|
|
1840
|
+
actorId: auth.ctx.actorId,
|
|
1841
|
+
commandType,
|
|
1842
|
+
idempotencyKey,
|
|
1843
|
+
requestDigest,
|
|
1844
|
+
});
|
|
1845
|
+
if (begun.kind === "replay") {
|
|
1846
|
+
writeJson(res, 200, begun.receipt);
|
|
1847
|
+
return;
|
|
1848
|
+
}
|
|
1849
|
+
if (begun.kind === "conflict") {
|
|
1850
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
1851
|
+
return;
|
|
1852
|
+
}
|
|
1853
|
+
try {
|
|
1854
|
+
const updated = run(channel.store, record, note);
|
|
1855
|
+
const receipt = {
|
|
1856
|
+
...staticReceipt(begun.operationId, commandType, "succeeded"),
|
|
1857
|
+
resource_ref: `onboarding:${record.recordId}`,
|
|
1858
|
+
completed_at: now().toISOString(),
|
|
1859
|
+
};
|
|
1860
|
+
operations.complete(begun.operationId, "succeeded", receipt);
|
|
1861
|
+
writeJson(res, 200, { ...receipt, record: updated });
|
|
1862
|
+
return;
|
|
1863
|
+
}
|
|
1864
|
+
catch (err) {
|
|
1865
|
+
operations.release(begun.operationId);
|
|
1866
|
+
respondError(res, err);
|
|
1867
|
+
return;
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
async function postConfirmation(req, res) {
|
|
1871
|
+
const auth = requireActor(req);
|
|
1872
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1873
|
+
const body = await readJsonBody(req);
|
|
1874
|
+
const fields = objectFields(body, [
|
|
1875
|
+
"candidate_id",
|
|
1876
|
+
"action",
|
|
1877
|
+
"arguments_hash",
|
|
1878
|
+
"preconditions_hash",
|
|
1879
|
+
"target",
|
|
1880
|
+
"expected_service_revision",
|
|
1881
|
+
]);
|
|
1882
|
+
if (fields.target !== undefined || fields.expected_service_revision !== undefined) {
|
|
1883
|
+
const target = requireString(fields.target, "target");
|
|
1884
|
+
if (target !== "service.resume") {
|
|
1885
|
+
throw new ManagementError("invalid_input", `unsupported confirmation target: ${target}`);
|
|
1886
|
+
}
|
|
1887
|
+
authorizeOrThrow(auth.ctx, "service:resume");
|
|
1888
|
+
const expectedRevision = requireInteger(fields.expected_service_revision, "expected_service_revision");
|
|
1889
|
+
if (expectedRevision !== options.serviceState.serviceRevision) {
|
|
1890
|
+
throw new ManagementError("precondition_changed", "service revision changed");
|
|
1891
|
+
}
|
|
1892
|
+
const targetDigest = managementRequestDigest({
|
|
1893
|
+
target,
|
|
1894
|
+
expected_service_revision: expectedRevision,
|
|
1895
|
+
});
|
|
1896
|
+
const confirmation = operations.createConfirmation({
|
|
1897
|
+
merchantId: auth.ctx.merchantId,
|
|
1898
|
+
actorId: auth.ctx.actorId,
|
|
1899
|
+
target,
|
|
1900
|
+
targetDigest,
|
|
1901
|
+
ttlMs: CONFIRMATION_TTL_MS,
|
|
1902
|
+
});
|
|
1903
|
+
writeJson(res, 200, {
|
|
1904
|
+
target,
|
|
1905
|
+
confirmation_ref: confirmation.ref,
|
|
1906
|
+
expires_at: confirmation.expires_at,
|
|
1907
|
+
});
|
|
1908
|
+
return;
|
|
1909
|
+
}
|
|
1910
|
+
authorizeOrThrow(auth.ctx, "approvals:decide");
|
|
1911
|
+
const candidateId = requireString(fields.candidate_id, "candidate_id");
|
|
1912
|
+
const action = requireString(fields.action, "action");
|
|
1913
|
+
if (action !== "approve" && action !== "reject") {
|
|
1914
|
+
throw new ManagementError("invalid_input", "action must be approve or reject");
|
|
1915
|
+
}
|
|
1916
|
+
const candidate = options.listPending().find((item) => item.candidate_id === candidateId);
|
|
1917
|
+
if (candidate === undefined) {
|
|
1918
|
+
throw new ManagementError("not_found", `unknown candidate: ${candidateId}`);
|
|
1919
|
+
}
|
|
1920
|
+
if (candidate.status !== "pending_approval") {
|
|
1921
|
+
throw new ManagementError("conflict", `candidate is not awaiting approval (status: ${candidate.status})`);
|
|
1922
|
+
}
|
|
1923
|
+
const argumentsHash = requireString(fields.arguments_hash, "arguments_hash");
|
|
1924
|
+
const preconditionsHash = requireString(fields.preconditions_hash, "preconditions_hash");
|
|
1925
|
+
if (candidate.arguments_hash !== argumentsHash ||
|
|
1926
|
+
candidate.preconditions_hash !== preconditionsHash) {
|
|
1927
|
+
throw new ManagementError("precondition_changed", "candidate changed since preview");
|
|
1928
|
+
}
|
|
1929
|
+
if (Date.parse(candidate.expires_at) <= now().getTime()) {
|
|
1930
|
+
throw new ManagementError("precondition_changed", "candidate has expired");
|
|
1931
|
+
}
|
|
1932
|
+
const confirmationRef = options.mintCandidateConfirmation({
|
|
1933
|
+
candidateId,
|
|
1934
|
+
candidateDigest: contentHash({
|
|
1935
|
+
arguments: candidate.arguments,
|
|
1936
|
+
preconditions: candidate.preconditions,
|
|
1937
|
+
}),
|
|
1938
|
+
principalId: auth.session.principal_id,
|
|
1939
|
+
merchantId: auth.session.merchant_id,
|
|
1940
|
+
action,
|
|
1941
|
+
});
|
|
1942
|
+
writeJson(res, 200, {
|
|
1943
|
+
target: "approval",
|
|
1944
|
+
candidate_id: candidateId,
|
|
1945
|
+
action,
|
|
1946
|
+
confirmation_ref: confirmationRef,
|
|
1947
|
+
expires_at: candidate.expires_at,
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1950
|
+
/** POST /approvals/{id}/approve|reject —— 幂等占位 → 服务层复检 → 执行 → 落回执。 */
|
|
1951
|
+
async function postApprovalDecision(req, res, candidateId, approve) {
|
|
1952
|
+
const commandType = `approval.${approve ? "approve" : "reject"}`;
|
|
1953
|
+
const auth = requireActor(req);
|
|
1954
|
+
assertWriteGuards(req, auth.sessionId);
|
|
1955
|
+
const body = await readJsonBody(req);
|
|
1956
|
+
const fields = objectFields(body, [
|
|
1957
|
+
"arguments_hash",
|
|
1958
|
+
"preconditions_hash",
|
|
1959
|
+
"confirmation_ref",
|
|
1960
|
+
"reason",
|
|
1961
|
+
"idempotency_key",
|
|
1962
|
+
]);
|
|
1963
|
+
const argumentsHash = requireString(fields.arguments_hash, "arguments_hash");
|
|
1964
|
+
const preconditionsHash = requireString(fields.preconditions_hash, "preconditions_hash");
|
|
1965
|
+
const confirmationRef = requireString(fields.confirmation_ref, "confirmation_ref");
|
|
1966
|
+
const idempotencyKey = requireString(fields.idempotency_key, "idempotency_key");
|
|
1967
|
+
const reason = optionalString(fields.reason, "reason");
|
|
1968
|
+
const requestDigest = managementRequestDigest({
|
|
1969
|
+
candidate_id: candidateId,
|
|
1970
|
+
arguments_hash: argumentsHash,
|
|
1971
|
+
preconditions_hash: preconditionsHash,
|
|
1972
|
+
confirmation_ref: confirmationRef,
|
|
1973
|
+
...(reason !== undefined ? { reason } : {}),
|
|
1974
|
+
});
|
|
1975
|
+
const begun = operations.begin({
|
|
1976
|
+
merchantId: auth.ctx.merchantId,
|
|
1977
|
+
actorId: auth.ctx.actorId,
|
|
1978
|
+
commandType,
|
|
1979
|
+
idempotencyKey,
|
|
1980
|
+
requestDigest,
|
|
1981
|
+
});
|
|
1982
|
+
if (begun.kind === "replay") {
|
|
1983
|
+
writeJson(res, 200, begun.receipt);
|
|
1984
|
+
return;
|
|
1985
|
+
}
|
|
1986
|
+
if (begun.kind === "conflict") {
|
|
1987
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
1988
|
+
return;
|
|
1989
|
+
}
|
|
1990
|
+
try {
|
|
1991
|
+
// expected_revision 传 0:本版契约用 arguments/preconditions 哈希作为
|
|
1992
|
+
// 条件更新证明(BD §11.2 的等价机制;候选对象暂无持久 revision 字段)。
|
|
1993
|
+
const receipt = await executionService(begun.operationId).decideApproval(auth.ctx, candidateId, {
|
|
1994
|
+
expected_revision: 0,
|
|
1995
|
+
arguments_hash: argumentsHash,
|
|
1996
|
+
preconditions_hash: preconditionsHash,
|
|
1997
|
+
confirmation_ref: confirmationRef,
|
|
1998
|
+
}, { approve, idempotencyKey, ...(reason !== undefined ? { reason } : {}) });
|
|
1999
|
+
operations.complete(begun.operationId, toStorageStatus(receipt.status), receipt);
|
|
2000
|
+
writeJson(res, 200, receipt);
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
2003
|
+
catch (err) {
|
|
2004
|
+
if (err instanceof ManagementError) {
|
|
2005
|
+
// 校验/授权/摘要/状态/过期类失败:未触达执行 → 释放占位,原键可重试。
|
|
2006
|
+
operations.release(begun.operationId);
|
|
2007
|
+
respondError(res, err);
|
|
2008
|
+
return;
|
|
2009
|
+
}
|
|
2010
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2011
|
+
if (message.includes("确认凭证")) {
|
|
2012
|
+
// core 凭证校验拒绝 = 未执行(凭证未被核销):释放占位,重新签确认后原键可重试。
|
|
2013
|
+
operations.release(begun.operationId);
|
|
2014
|
+
respondError(res, new ManagementError("forbidden", "confirmation reference is invalid or expired"));
|
|
2015
|
+
return;
|
|
2016
|
+
}
|
|
2017
|
+
// 无法证明「未执行」→ 记 unknown,保留对账路径(BD §11.1),绝不自动重做。
|
|
2018
|
+
log(`[merchant-management] ${commandType} 执行异常:${message}\n`);
|
|
2019
|
+
const receipt = staticReceipt(begun.operationId, commandType, "unknown");
|
|
2020
|
+
operations.complete(begun.operationId, "unknown", receipt);
|
|
2021
|
+
respondError(res, new ManagementError("unavailable", `execution outcome unknown; query operation ${begun.operationId} before retrying`));
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
/** POST /service/pause —— 拒新询价;既有任务不受影响(T012 语义)。 */
|
|
2025
|
+
async function postServicePause(req, res) {
|
|
2026
|
+
const auth = requireActor(req);
|
|
2027
|
+
assertWriteGuards(req, auth.sessionId);
|
|
2028
|
+
const body = await readJsonBody(req);
|
|
2029
|
+
const fields = objectFields(body, ["reason", "expected_service_revision", "idempotency_key"]);
|
|
2030
|
+
authorizeOrThrow(auth.ctx, "service:pause");
|
|
2031
|
+
const expectedRevision = requireInteger(fields.expected_service_revision, "expected_service_revision");
|
|
2032
|
+
const idempotencyKey = requireString(fields.idempotency_key, "idempotency_key");
|
|
2033
|
+
const reason = optionalString(fields.reason, "reason");
|
|
2034
|
+
if (expectedRevision !== options.serviceState.serviceRevision) {
|
|
2035
|
+
throw new ManagementError("precondition_changed", "service revision changed");
|
|
2036
|
+
}
|
|
2037
|
+
const begun = operations.begin({
|
|
2038
|
+
merchantId: auth.ctx.merchantId,
|
|
2039
|
+
actorId: auth.ctx.actorId,
|
|
2040
|
+
commandType: "service.pause",
|
|
2041
|
+
idempotencyKey,
|
|
2042
|
+
requestDigest: managementRequestDigest({
|
|
2043
|
+
expected_service_revision: expectedRevision,
|
|
2044
|
+
...(reason !== undefined ? { reason } : {}),
|
|
2045
|
+
}),
|
|
2046
|
+
});
|
|
2047
|
+
if (begun.kind === "replay") {
|
|
2048
|
+
writeJson(res, 200, begun.receipt);
|
|
2049
|
+
return;
|
|
2050
|
+
}
|
|
2051
|
+
if (begun.kind === "conflict") {
|
|
2052
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
2053
|
+
return;
|
|
2054
|
+
}
|
|
2055
|
+
try {
|
|
2056
|
+
const applied = options.serviceState.pause(reason);
|
|
2057
|
+
const receipt = {
|
|
2058
|
+
...staticReceipt(begun.operationId, "service.pause", "succeeded"),
|
|
2059
|
+
resource_ref: "service",
|
|
2060
|
+
result_revision: applied.service_revision,
|
|
2061
|
+
completed_at: now().toISOString(),
|
|
2062
|
+
};
|
|
2063
|
+
operations.complete(begun.operationId, "succeeded", receipt);
|
|
2064
|
+
writeJson(res, 200, receipt);
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2067
|
+
catch (err) {
|
|
2068
|
+
if (err instanceof ManagementError) {
|
|
2069
|
+
operations.release(begun.operationId);
|
|
2070
|
+
respondError(res, err);
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2073
|
+
throw err;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
/** POST /service/resume —— owner 专属 + 确认引用 + 就绪门(BD §10.1)。 */
|
|
2077
|
+
async function postServiceResume(req, res) {
|
|
2078
|
+
const auth = requireActor(req);
|
|
2079
|
+
assertWriteGuards(req, auth.sessionId);
|
|
2080
|
+
const body = await readJsonBody(req);
|
|
2081
|
+
const fields = objectFields(body, [
|
|
2082
|
+
"expected_service_revision",
|
|
2083
|
+
"confirmation_ref",
|
|
2084
|
+
"idempotency_key",
|
|
2085
|
+
]);
|
|
2086
|
+
authorizeOrThrow(auth.ctx, "service:resume");
|
|
2087
|
+
const expectedRevision = requireInteger(fields.expected_service_revision, "expected_service_revision");
|
|
2088
|
+
const confirmationRef = requireString(fields.confirmation_ref, "confirmation_ref");
|
|
2089
|
+
const idempotencyKey = requireString(fields.idempotency_key, "idempotency_key");
|
|
2090
|
+
if (expectedRevision !== options.serviceState.serviceRevision) {
|
|
2091
|
+
throw new ManagementError("precondition_changed", "service revision changed");
|
|
2092
|
+
}
|
|
2093
|
+
// 确认引用在触达执行前核销(单次);失败 = 未授权确认 → 403,不留占位。
|
|
2094
|
+
if (!operations.consumeConfirmation({
|
|
2095
|
+
ref: confirmationRef,
|
|
2096
|
+
merchantId: auth.ctx.merchantId,
|
|
2097
|
+
actorId: auth.ctx.actorId,
|
|
2098
|
+
target: "service.resume",
|
|
2099
|
+
targetDigest: managementRequestDigest({
|
|
2100
|
+
target: "service.resume",
|
|
2101
|
+
expected_service_revision: expectedRevision,
|
|
2102
|
+
}),
|
|
2103
|
+
})) {
|
|
2104
|
+
throw new ManagementError("forbidden", "confirmation reference is invalid or expired");
|
|
2105
|
+
}
|
|
2106
|
+
const begun = operations.begin({
|
|
2107
|
+
merchantId: auth.ctx.merchantId,
|
|
2108
|
+
actorId: auth.ctx.actorId,
|
|
2109
|
+
commandType: "service.resume",
|
|
2110
|
+
idempotencyKey,
|
|
2111
|
+
requestDigest: managementRequestDigest({ expected_service_revision: expectedRevision }),
|
|
2112
|
+
});
|
|
2113
|
+
if (begun.kind === "replay") {
|
|
2114
|
+
writeJson(res, 200, begun.receipt);
|
|
2115
|
+
return;
|
|
2116
|
+
}
|
|
2117
|
+
if (begun.kind === "conflict") {
|
|
2118
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
2119
|
+
return;
|
|
2120
|
+
}
|
|
2121
|
+
// 就绪门:恢复前重新取就绪结论;失败/异常都发生在迁移之前 → 释放占位。
|
|
2122
|
+
let readiness;
|
|
2123
|
+
try {
|
|
2124
|
+
readiness = await options.readiness();
|
|
2125
|
+
}
|
|
2126
|
+
catch {
|
|
2127
|
+
operations.release(begun.operationId);
|
|
2128
|
+
respondError(res, new ManagementError("unavailable", "readiness check failed; refusing to resume"));
|
|
2129
|
+
return;
|
|
2130
|
+
}
|
|
2131
|
+
const failedChecks = Object.entries(readiness.checks)
|
|
2132
|
+
.filter(([, check]) => !check.ok)
|
|
2133
|
+
.map(([name]) => name);
|
|
2134
|
+
try {
|
|
2135
|
+
const applied = options.serviceState.resume(readiness.ready, failedChecks);
|
|
2136
|
+
const receipt = {
|
|
2137
|
+
...staticReceipt(begun.operationId, "service.resume", "succeeded"),
|
|
2138
|
+
resource_ref: "service",
|
|
2139
|
+
result_revision: applied.service_revision,
|
|
2140
|
+
completed_at: now().toISOString(),
|
|
2141
|
+
};
|
|
2142
|
+
operations.complete(begun.operationId, "succeeded", receipt);
|
|
2143
|
+
writeJson(res, 200, receipt);
|
|
2144
|
+
return;
|
|
2145
|
+
}
|
|
2146
|
+
catch (err) {
|
|
2147
|
+
if (err instanceof ManagementError) {
|
|
2148
|
+
operations.release(begun.operationId);
|
|
2149
|
+
respondError(res, err);
|
|
2150
|
+
return;
|
|
2151
|
+
}
|
|
2152
|
+
throw err;
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
// ── 商品导入(BD §10.1:校验预览 → 确认提交;全批成功或全批不变)────────
|
|
2156
|
+
/**
|
|
2157
|
+
* POST /products/import-drafts —— 整表严格校验(任何行错误 → 整表拒绝并报
|
|
2158
|
+
* 行号)+ 当前表 CAS(base_digest)+ 增/改/留/删预览;只存草稿,不动商品表。
|
|
2159
|
+
* 语义是**整表替换**:新表未包含的 SKU 提交后即移除(预览给出 removed 数)。
|
|
2160
|
+
*/
|
|
2161
|
+
async function postProductsImportDraft(req, res) {
|
|
2162
|
+
const auth = requireActor(req);
|
|
2163
|
+
assertWriteGuards(req, auth.sessionId);
|
|
2164
|
+
const body = await readJsonBody(req);
|
|
2165
|
+
const fields = objectFields(body, ["table", "base_digest", "idempotency_key"]);
|
|
2166
|
+
authorizeOrThrow(auth.ctx, "products:import");
|
|
2167
|
+
const importChannel = options.productsImport;
|
|
2168
|
+
if (importChannel === undefined) {
|
|
2169
|
+
throw new ManagementError("unavailable", "product import storage is not configured");
|
|
2170
|
+
}
|
|
2171
|
+
let table;
|
|
2172
|
+
try {
|
|
2173
|
+
table = parseProductTable(fields["table"], "request body");
|
|
2174
|
+
table = importChannel.prepareTable?.(table) ?? table;
|
|
2175
|
+
}
|
|
2176
|
+
catch (err) {
|
|
2177
|
+
if (err instanceof ProductTableError) {
|
|
2178
|
+
throw new ManagementError("invalid_input", err.message);
|
|
2179
|
+
}
|
|
2180
|
+
throw err;
|
|
2181
|
+
}
|
|
2182
|
+
if ((table.runtime_owner_id ?? table.merchant_id) !== options.merchantId) {
|
|
2183
|
+
throw new ManagementError("forbidden", "product table runtime owner does not match this instance");
|
|
2184
|
+
}
|
|
2185
|
+
let base;
|
|
2186
|
+
try {
|
|
2187
|
+
base = importChannel.currentTable();
|
|
2188
|
+
}
|
|
2189
|
+
catch (err) {
|
|
2190
|
+
if (err instanceof ProductTableError) {
|
|
2191
|
+
throw new ManagementError("unavailable", `current product table unavailable (${err.code})`);
|
|
2192
|
+
}
|
|
2193
|
+
throw err;
|
|
2194
|
+
}
|
|
2195
|
+
const baseDigest = optionalString(fields["base_digest"], "base_digest");
|
|
2196
|
+
if (baseDigest !== undefined && baseDigest !== base.digest) {
|
|
2197
|
+
throw new ManagementError("precondition_changed", "product table changed since preview");
|
|
2198
|
+
}
|
|
2199
|
+
const currentBySku = new Map(base.records.map((record) => [record.sku, record]));
|
|
2200
|
+
let added = 0;
|
|
2201
|
+
let updated = 0;
|
|
2202
|
+
let unchanged = 0;
|
|
2203
|
+
for (const record of table.products) {
|
|
2204
|
+
const previous = currentBySku.get(record.sku);
|
|
2205
|
+
if (previous === undefined)
|
|
2206
|
+
added += 1;
|
|
2207
|
+
else if (JSON.stringify(previous) === JSON.stringify(record))
|
|
2208
|
+
unchanged += 1;
|
|
2209
|
+
else
|
|
2210
|
+
updated += 1;
|
|
2211
|
+
}
|
|
2212
|
+
const removedCount = base.records.filter((record) => !table.products.some((item) => item.sku === record.sku)).length;
|
|
2213
|
+
const digest = productTableDigest(table);
|
|
2214
|
+
const created = options.drafts.create({
|
|
2215
|
+
merchantId: auth.ctx.merchantId,
|
|
2216
|
+
kind: "products_import",
|
|
2217
|
+
payloadJson: JSON.stringify(table),
|
|
2218
|
+
payloadDigest: digest,
|
|
2219
|
+
...(base.digest !== "" ? { baseDigest: base.digest } : {}),
|
|
2220
|
+
});
|
|
2221
|
+
writeJson(res, 200, {
|
|
2222
|
+
draft_id: created.draftId,
|
|
2223
|
+
digest,
|
|
2224
|
+
reused: created.reused,
|
|
2225
|
+
base_digest: base.digest === "" ? null : base.digest,
|
|
2226
|
+
preview: {
|
|
2227
|
+
rows_total: table.products.length,
|
|
2228
|
+
added,
|
|
2229
|
+
updated,
|
|
2230
|
+
unchanged,
|
|
2231
|
+
removed: removedCount,
|
|
2232
|
+
},
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* POST /products/import-parse?format=csv|xlsx —— 把商家上传的 CSV/xlsx 原文
|
|
2237
|
+
* (WP12)转换为商品表草稿:表头映射报告 + 逐行问题清单。无状态(不落盘),
|
|
2238
|
+
* 商家确认后仍走 import-drafts 严格校验与整表替换预览;服务端解析保证工作
|
|
2239
|
+
* 台、脚本与技能共用同一实现(`product-import-tabular.ts`)。
|
|
2240
|
+
*/
|
|
2241
|
+
async function postProductsImportParse(req, res, url) {
|
|
2242
|
+
const auth = requireActor(req);
|
|
2243
|
+
assertWriteGuards(req, auth.sessionId);
|
|
2244
|
+
authorizeOrThrow(auth.ctx, "products:import");
|
|
2245
|
+
const format = url.searchParams.get("format");
|
|
2246
|
+
if (format !== "csv" && format !== "xlsx") {
|
|
2247
|
+
throw new ManagementError("invalid_input", "format must be csv or xlsx");
|
|
2248
|
+
}
|
|
2249
|
+
const chunks = [];
|
|
2250
|
+
let size = 0;
|
|
2251
|
+
for await (const chunk of req) {
|
|
2252
|
+
size += chunk.length;
|
|
2253
|
+
if (size > TABULAR_IMPORT_MAX_BYTES) {
|
|
2254
|
+
throw new ManagementError("invalid_input", `文件超过上限 ${TABULAR_IMPORT_MAX_BYTES} 字节,请分批导入或精简表格`);
|
|
2255
|
+
}
|
|
2256
|
+
chunks.push(chunk);
|
|
2257
|
+
}
|
|
2258
|
+
if (chunks.length === 0) {
|
|
2259
|
+
throw new ManagementError("invalid_input", "request body required");
|
|
2260
|
+
}
|
|
2261
|
+
const buffer = Buffer.concat(chunks);
|
|
2262
|
+
const result = convertTabularImport(format === "csv"
|
|
2263
|
+
? { kind: "csv", text: buffer.toString("utf8") }
|
|
2264
|
+
: { kind: "xlsx", bytes: new Uint8Array(buffer) }, { merchantId: options.merchantId, now: () => now() });
|
|
2265
|
+
writeJson(res, 200, {
|
|
2266
|
+
ok: result.ok,
|
|
2267
|
+
...(result.table !== undefined ? { table: result.table } : {}),
|
|
2268
|
+
report: result.report,
|
|
2269
|
+
errors: result.errors,
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2272
|
+
/** POST /products/import-drafts/{id}/commit —— 原子落盘;结果不可分辨时记 unknown。 */
|
|
2273
|
+
async function postProductsImportCommit(req, res, draftId) {
|
|
2274
|
+
const auth = requireActor(req);
|
|
2275
|
+
assertWriteGuards(req, auth.sessionId);
|
|
2276
|
+
const body = await readJsonBody(req);
|
|
2277
|
+
const fields = objectFields(body, ["expected_draft_digest", "idempotency_key"]);
|
|
2278
|
+
authorizeOrThrow(auth.ctx, "products:import");
|
|
2279
|
+
const importChannel = options.productsImport;
|
|
2280
|
+
if (importChannel === undefined) {
|
|
2281
|
+
throw new ManagementError("unavailable", "product import storage is not configured");
|
|
2282
|
+
}
|
|
2283
|
+
const draft = options.drafts.getPayload(auth.ctx.merchantId, draftId);
|
|
2284
|
+
if (draft === undefined) {
|
|
2285
|
+
throw new ManagementError("not_found", `unknown draft: ${draftId}`);
|
|
2286
|
+
}
|
|
2287
|
+
if (draft.kind !== "products_import") {
|
|
2288
|
+
throw new ManagementError("invalid_input", "draft is not a products import");
|
|
2289
|
+
}
|
|
2290
|
+
const expectedDigest = requireString(fields["expected_draft_digest"], "expected_draft_digest");
|
|
2291
|
+
if (expectedDigest !== draft.payload_digest) {
|
|
2292
|
+
throw new ManagementError("precondition_changed", "draft digest does not match");
|
|
2293
|
+
}
|
|
2294
|
+
let table;
|
|
2295
|
+
try {
|
|
2296
|
+
table = JSON.parse(draft.payload_json);
|
|
2297
|
+
}
|
|
2298
|
+
catch {
|
|
2299
|
+
throw new ManagementError("invalid_input", "draft payload is corrupted");
|
|
2300
|
+
}
|
|
2301
|
+
const idempotencyKey = requireString(fields["idempotency_key"], "idempotency_key");
|
|
2302
|
+
const requestDigest = managementRequestDigest({
|
|
2303
|
+
draft_id: draftId,
|
|
2304
|
+
expected_draft_digest: expectedDigest,
|
|
2305
|
+
});
|
|
2306
|
+
// 幂等探测先于草稿状态检查:同键重放必须回原回执,不能被「已提交」挡住(UC20)。
|
|
2307
|
+
const probed = operations.probe({
|
|
2308
|
+
merchantId: auth.ctx.merchantId,
|
|
2309
|
+
actorId: auth.ctx.actorId,
|
|
2310
|
+
commandType: "products.import_commit",
|
|
2311
|
+
idempotencyKey,
|
|
2312
|
+
requestDigest,
|
|
2313
|
+
});
|
|
2314
|
+
if (probed.kind === "replay") {
|
|
2315
|
+
writeJson(res, 200, probed.receipt);
|
|
2316
|
+
return;
|
|
2317
|
+
}
|
|
2318
|
+
if (probed.kind === "conflict") {
|
|
2319
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
2320
|
+
return;
|
|
2321
|
+
}
|
|
2322
|
+
if (draft.status === "committed") {
|
|
2323
|
+
throw new ManagementError("conflict", "draft has already been committed");
|
|
2324
|
+
}
|
|
2325
|
+
const begun = operations.begin({
|
|
2326
|
+
merchantId: auth.ctx.merchantId,
|
|
2327
|
+
actorId: auth.ctx.actorId,
|
|
2328
|
+
commandType: "products.import_commit",
|
|
2329
|
+
idempotencyKey,
|
|
2330
|
+
requestDigest,
|
|
2331
|
+
});
|
|
2332
|
+
if (begun.kind === "replay") {
|
|
2333
|
+
writeJson(res, 200, begun.receipt);
|
|
2334
|
+
return;
|
|
2335
|
+
}
|
|
2336
|
+
if (begun.kind === "conflict") {
|
|
2337
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
2338
|
+
return;
|
|
2339
|
+
}
|
|
2340
|
+
try {
|
|
2341
|
+
const written = importChannel.commit(table);
|
|
2342
|
+
const marked = options.drafts.markCommitted(auth.ctx.merchantId, draftId);
|
|
2343
|
+
if (!marked) {
|
|
2344
|
+
// 并发重复提交:文件已写入同一内容,占位释放即可(不产生第二份业务效果)。
|
|
2345
|
+
operations.release(begun.operationId);
|
|
2346
|
+
writeJson(res, 409, errorBody("conflict", "draft has already been committed"));
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
const receipt = {
|
|
2350
|
+
...staticReceipt(begun.operationId, "products.import_commit", "succeeded"),
|
|
2351
|
+
resource_ref: `products-table:${written.digest}`,
|
|
2352
|
+
completed_at: now().toISOString(),
|
|
2353
|
+
};
|
|
2354
|
+
operations.complete(begun.operationId, "succeeded", receipt);
|
|
2355
|
+
writeJson(res, 200, receipt);
|
|
2356
|
+
return;
|
|
2357
|
+
}
|
|
2358
|
+
catch (err) {
|
|
2359
|
+
if (err instanceof ProductTableError) {
|
|
2360
|
+
// 落盘前的校验/租户失败:商品表未动 → 释放占位,可修正后原键重试。
|
|
2361
|
+
operations.release(begun.operationId);
|
|
2362
|
+
respondError(res, new ManagementError("invalid_input", err.message));
|
|
2363
|
+
return;
|
|
2364
|
+
}
|
|
2365
|
+
// 文件系统失败且无法证明「未生效」→ 记 unknown,先查 GET /products 对账。
|
|
2366
|
+
log(`[merchant-management] products.import_commit 执行异常:${err instanceof Error ? err.message : String(err)}\n`);
|
|
2367
|
+
const receipt = staticReceipt(begun.operationId, "products.import_commit", "unknown");
|
|
2368
|
+
operations.complete(begun.operationId, "unknown", receipt);
|
|
2369
|
+
respondError(res, new ManagementError("unavailable", `commit outcome unknown; query operation ${begun.operationId} and GET /products before retrying`));
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
// ── 策略草稿(BD §7.4:敏感原文只进私有存储;API 只见摘要与版本)──────────
|
|
2373
|
+
/** POST /policy/drafts —— patch 原文入库;响应只含 draft_id 与摘要。 */
|
|
2374
|
+
async function postPolicyDraft(req, res) {
|
|
2375
|
+
const auth = requireActor(req);
|
|
2376
|
+
assertWriteGuards(req, auth.sessionId);
|
|
2377
|
+
const body = await readJsonBody(req);
|
|
2378
|
+
const fields = objectFields(body, ["patch", "expected_policy_revision"]);
|
|
2379
|
+
authorizeOrThrow(auth.ctx, "policy:draft");
|
|
2380
|
+
const patch = fields["patch"];
|
|
2381
|
+
if (patch === null || typeof patch !== "object" || Array.isArray(patch)) {
|
|
2382
|
+
throw new ManagementError("invalid_input", "patch must be a JSON object");
|
|
2383
|
+
}
|
|
2384
|
+
const current = options.policy?.();
|
|
2385
|
+
const expectedRevision = fields["expected_policy_revision"];
|
|
2386
|
+
if (expectedRevision !== undefined) {
|
|
2387
|
+
const expected = requireInteger(expectedRevision, "expected_policy_revision");
|
|
2388
|
+
if (current === undefined || current.version !== expected) {
|
|
2389
|
+
throw new ManagementError("precondition_changed", "policy revision changed");
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
const patchObject = patch;
|
|
2393
|
+
const digest = managementRequestDigest(patchObject);
|
|
2394
|
+
const created = options.drafts.create({
|
|
2395
|
+
merchantId: auth.ctx.merchantId,
|
|
2396
|
+
kind: "policy_override",
|
|
2397
|
+
payloadJson: JSON.stringify(patchObject),
|
|
2398
|
+
payloadDigest: digest,
|
|
2399
|
+
...(current !== undefined ? { baseDigest: current.digest } : {}),
|
|
2400
|
+
});
|
|
2401
|
+
writeJson(res, 200, {
|
|
2402
|
+
draft_id: created.draftId,
|
|
2403
|
+
digest,
|
|
2404
|
+
reused: created.reused,
|
|
2405
|
+
base_digest: current?.digest ?? null,
|
|
2406
|
+
});
|
|
2407
|
+
}
|
|
2408
|
+
/**
|
|
2409
|
+
* POST /policy/form-drafts —— 常用规则表单(WP11):表单友好字段 → 服务端映射
|
|
2410
|
+
* 为 policy schema 字段,走与 JSON patch 完全相同的草稿→确认提交流程。
|
|
2411
|
+
* schema 字段名只出现在服务端(页面壳不含策略内部字段名,隐私守卫不变)。
|
|
2412
|
+
*/
|
|
2413
|
+
async function postPolicyFormDraft(req, res) {
|
|
2414
|
+
const auth = requireActor(req);
|
|
2415
|
+
assertWriteGuards(req, auth.sessionId);
|
|
2416
|
+
authorizeOrThrow(auth.ctx, "policy:draft");
|
|
2417
|
+
const fields = objectFields(await readJsonBody(req), [
|
|
2418
|
+
"auto",
|
|
2419
|
+
"floor",
|
|
2420
|
+
"discount",
|
|
2421
|
+
"lead_days",
|
|
2422
|
+
"ttl_seconds",
|
|
2423
|
+
"human_review",
|
|
2424
|
+
]);
|
|
2425
|
+
const patch = {};
|
|
2426
|
+
if (fields["auto"] !== undefined) {
|
|
2427
|
+
if (fields["auto"] !== "on" && fields["auto"] !== "off") {
|
|
2428
|
+
throw new ManagementError("invalid_input", "auto must be on or off");
|
|
2429
|
+
}
|
|
2430
|
+
patch["auto_negotiate"] = fields["auto"] === "on";
|
|
2431
|
+
}
|
|
2432
|
+
if (fields["floor"] !== undefined) {
|
|
2433
|
+
patch["min_unit_price_private"] = requireNonNegativeNumber(fields["floor"], "floor");
|
|
2434
|
+
}
|
|
2435
|
+
if (fields["discount"] !== undefined) {
|
|
2436
|
+
const discount = requireNonNegativeNumber(fields["discount"], "discount");
|
|
2437
|
+
if (discount > 100) {
|
|
2438
|
+
throw new ManagementError("invalid_input", "discount must be between 0 and 100");
|
|
2439
|
+
}
|
|
2440
|
+
patch["max_auto_discount_percent"] = discount;
|
|
2441
|
+
}
|
|
2442
|
+
if (fields["lead_days"] !== undefined) {
|
|
2443
|
+
patch["delivery_lead_days"] = requirePositiveNumber(fields["lead_days"], "lead_days");
|
|
2444
|
+
}
|
|
2445
|
+
if (fields["ttl_seconds"] !== undefined) {
|
|
2446
|
+
patch["quote_ttl_seconds"] = requirePositiveInteger(fields["ttl_seconds"], "ttl_seconds");
|
|
2447
|
+
}
|
|
2448
|
+
if (fields["human_review"] !== undefined) {
|
|
2449
|
+
const triggers = requireStringArray(fields["human_review"], "human_review");
|
|
2450
|
+
for (const trigger of triggers) {
|
|
2451
|
+
if (!HUMAN_REVIEW_TRIGGERS.includes(trigger)) {
|
|
2452
|
+
throw new ManagementError("invalid_input", `human_review trigger must be one of ${HUMAN_REVIEW_TRIGGERS.join(", ")}`);
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
patch["human_review_on"] = triggers;
|
|
2456
|
+
}
|
|
2457
|
+
if (Object.keys(patch).length === 0) {
|
|
2458
|
+
throw new ManagementError("invalid_input", "form submitted no changes");
|
|
2459
|
+
}
|
|
2460
|
+
const current = options.policy?.();
|
|
2461
|
+
const digest = managementRequestDigest(patch);
|
|
2462
|
+
const created = options.drafts.create({
|
|
2463
|
+
merchantId: auth.ctx.merchantId,
|
|
2464
|
+
kind: "policy_override",
|
|
2465
|
+
payloadJson: JSON.stringify(patch),
|
|
2466
|
+
payloadDigest: digest,
|
|
2467
|
+
...(current !== undefined ? { baseDigest: current.digest } : {}),
|
|
2468
|
+
});
|
|
2469
|
+
writeJson(res, 200, {
|
|
2470
|
+
draft_id: created.draftId,
|
|
2471
|
+
digest,
|
|
2472
|
+
reused: created.reused,
|
|
2473
|
+
base_digest: current?.digest ?? null,
|
|
2474
|
+
applied_keys: Object.keys(patch),
|
|
2475
|
+
});
|
|
2476
|
+
}
|
|
2477
|
+
/** POST /policy/drafts/{id}/commit —— 应用策略补丁;回执只含版本与摘要(红线 6)。 */
|
|
2478
|
+
async function postPolicyCommit(req, res, draftId) {
|
|
2479
|
+
const auth = requireActor(req);
|
|
2480
|
+
assertWriteGuards(req, auth.sessionId);
|
|
2481
|
+
const body = await readJsonBody(req);
|
|
2482
|
+
const fields = objectFields(body, ["expected_draft_digest", "idempotency_key"]);
|
|
2483
|
+
authorizeOrThrow(auth.ctx, "policy:draft");
|
|
2484
|
+
const apply = options.policyApply;
|
|
2485
|
+
if (apply === undefined) {
|
|
2486
|
+
throw new ManagementError("unavailable", "policy apply is not configured");
|
|
2487
|
+
}
|
|
2488
|
+
const draft = options.drafts.getPayload(auth.ctx.merchantId, draftId);
|
|
2489
|
+
if (draft === undefined) {
|
|
2490
|
+
throw new ManagementError("not_found", `unknown draft: ${draftId}`);
|
|
2491
|
+
}
|
|
2492
|
+
if (draft.kind !== "policy_override") {
|
|
2493
|
+
throw new ManagementError("invalid_input", "draft is not a policy override");
|
|
2494
|
+
}
|
|
2495
|
+
const expectedDigest = requireString(fields["expected_draft_digest"], "expected_draft_digest");
|
|
2496
|
+
if (expectedDigest !== draft.payload_digest) {
|
|
2497
|
+
throw new ManagementError("precondition_changed", "draft digest does not match");
|
|
2498
|
+
}
|
|
2499
|
+
const idempotencyKey = requireString(fields["idempotency_key"], "idempotency_key");
|
|
2500
|
+
const requestDigest = managementRequestDigest({
|
|
2501
|
+
draft_id: draftId,
|
|
2502
|
+
expected_draft_digest: expectedDigest,
|
|
2503
|
+
});
|
|
2504
|
+
// 幂等探测先于草稿状态检查(同 UC20:重放不被「已提交」挡住)。
|
|
2505
|
+
const probed = operations.probe({
|
|
2506
|
+
merchantId: auth.ctx.merchantId,
|
|
2507
|
+
actorId: auth.ctx.actorId,
|
|
2508
|
+
commandType: "policy.commit",
|
|
2509
|
+
idempotencyKey,
|
|
2510
|
+
requestDigest,
|
|
2511
|
+
});
|
|
2512
|
+
if (probed.kind === "replay") {
|
|
2513
|
+
writeJson(res, 200, probed.receipt);
|
|
2514
|
+
return;
|
|
2515
|
+
}
|
|
2516
|
+
if (probed.kind === "conflict") {
|
|
2517
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
2518
|
+
return;
|
|
2519
|
+
}
|
|
2520
|
+
if (draft.status === "committed") {
|
|
2521
|
+
throw new ManagementError("conflict", "draft has already been committed");
|
|
2522
|
+
}
|
|
2523
|
+
const begun = operations.begin({
|
|
2524
|
+
merchantId: auth.ctx.merchantId,
|
|
2525
|
+
actorId: auth.ctx.actorId,
|
|
2526
|
+
commandType: "policy.commit",
|
|
2527
|
+
idempotencyKey,
|
|
2528
|
+
requestDigest,
|
|
2529
|
+
});
|
|
2530
|
+
if (begun.kind === "replay") {
|
|
2531
|
+
writeJson(res, 200, begun.receipt);
|
|
2532
|
+
return;
|
|
2533
|
+
}
|
|
2534
|
+
if (begun.kind === "conflict") {
|
|
2535
|
+
writeJson(res, 409, errorBody("conflict", "idempotency key was already used with a different request"));
|
|
2536
|
+
return;
|
|
2537
|
+
}
|
|
2538
|
+
let patch;
|
|
2539
|
+
try {
|
|
2540
|
+
patch = JSON.parse(draft.payload_json);
|
|
2541
|
+
}
|
|
2542
|
+
catch {
|
|
2543
|
+
throw new ManagementError("invalid_input", "draft payload is corrupted");
|
|
2544
|
+
}
|
|
2545
|
+
try {
|
|
2546
|
+
const applied = await apply(patch);
|
|
2547
|
+
options.drafts.markCommitted(auth.ctx.merchantId, draftId);
|
|
2548
|
+
const receipt = {
|
|
2549
|
+
...staticReceipt(begun.operationId, "policy.commit", "succeeded"),
|
|
2550
|
+
resource_ref: `policy:v${applied.version}`,
|
|
2551
|
+
result_revision: applied.version,
|
|
2552
|
+
completed_at: now().toISOString(),
|
|
2553
|
+
};
|
|
2554
|
+
operations.complete(begun.operationId, "succeeded", receipt);
|
|
2555
|
+
writeJson(res, 200, receipt);
|
|
2556
|
+
return;
|
|
2557
|
+
}
|
|
2558
|
+
catch (err) {
|
|
2559
|
+
// apply 是「校验 + 原子写」:校验失败未生效 → 释放占位可修正重试
|
|
2560
|
+
// (错误消息来自 runtime 校验层,不含策略数值本身)。
|
|
2561
|
+
operations.release(begun.operationId);
|
|
2562
|
+
respondError(res, new ManagementError("invalid_input", err instanceof Error ? err.message : String(err)));
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
// ── 认证与防护 ─────────────────────────────────────────────────────
|
|
2566
|
+
function requireActor(req) {
|
|
2567
|
+
const sessionId = cookieValue(req, ADMIN_SESSION_COOKIE);
|
|
2568
|
+
const session = sessionId !== undefined ? options.sessions.getSession(sessionId) : undefined;
|
|
2569
|
+
if (sessionId === undefined || session === undefined) {
|
|
2570
|
+
throw new ManagementError("unauthorized", "management session required");
|
|
2571
|
+
}
|
|
2572
|
+
const ctx = createVerifiedActorContext({
|
|
2573
|
+
actorId: session.principal_id,
|
|
2574
|
+
merchantId: session.merchant_id,
|
|
2575
|
+
role: session.role,
|
|
2576
|
+
authMethod: "admin-session",
|
|
2577
|
+
generation: options.generation(),
|
|
2578
|
+
requestId: `mreq_${randomBytes(8).toString("hex")}`,
|
|
2579
|
+
expiresAt: session.expires_at,
|
|
2580
|
+
});
|
|
2581
|
+
return { sessionId, session, ctx };
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* 适配层授权门(confirmations/pause/resume 在进入服务层之前先挡越权;
|
|
2585
|
+
* 服务层仍逐次复检——两层都要过,类型检查通过不算授权)。
|
|
2586
|
+
*/
|
|
2587
|
+
function authorizeOrThrow(ctx, permission) {
|
|
2588
|
+
const actor = assertVerifiedActor(ctx, now());
|
|
2589
|
+
if (!hasPermission(actor, permission)) {
|
|
2590
|
+
throw new ManagementError("forbidden", `missing permission: ${permission}`);
|
|
2591
|
+
}
|
|
2592
|
+
if (actor.merchantId !== options.merchantId) {
|
|
2593
|
+
throw new ManagementError("not_found", "resource does not belong to this merchant");
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
function assertWriteGuards(req, sessionId) {
|
|
2597
|
+
const presented = singleHeader(req, "x-csrf-token");
|
|
2598
|
+
if (!csrfValid(sessionId, presented)) {
|
|
2599
|
+
throw new ManagementError("forbidden", "missing or invalid CSRF token");
|
|
2600
|
+
}
|
|
2601
|
+
const origin = singleHeader(req, "origin");
|
|
2602
|
+
if (origin !== undefined &&
|
|
2603
|
+
options.allowedOrigins !== undefined &&
|
|
2604
|
+
!options.allowedOrigins.includes(origin)) {
|
|
2605
|
+
throw new ManagementError("forbidden", "origin is not allowed for management writes");
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
function csrfTokenFor(sessionId) {
|
|
2609
|
+
return createHmac("sha256", csrfKey).update(sessionId).digest("base64url");
|
|
2610
|
+
}
|
|
2611
|
+
function csrfValid(sessionId, presented) {
|
|
2612
|
+
if (presented === undefined || presented === "")
|
|
2613
|
+
return false;
|
|
2614
|
+
const expected = Buffer.from(csrfTokenFor(sessionId));
|
|
2615
|
+
const actual = Buffer.from(presented);
|
|
2616
|
+
return expected.length === actual.length && timingSafeEqual(expected, actual);
|
|
2617
|
+
}
|
|
2618
|
+
// ── 输入与输出辅助 ─────────────────────────────────────────────────
|
|
2619
|
+
async function readJsonBody(req) {
|
|
2620
|
+
const chunks = [];
|
|
2621
|
+
let size = 0;
|
|
2622
|
+
for await (const chunk of req) {
|
|
2623
|
+
size += chunk.length;
|
|
2624
|
+
if (size > MAX_BODY_BYTES)
|
|
2625
|
+
throw new BodyTooLarge();
|
|
2626
|
+
chunks.push(chunk);
|
|
2627
|
+
}
|
|
2628
|
+
if (chunks.length === 0) {
|
|
2629
|
+
throw new ManagementError("invalid_input", "JSON body required");
|
|
2630
|
+
}
|
|
2631
|
+
try {
|
|
2632
|
+
return JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
2633
|
+
}
|
|
2634
|
+
catch {
|
|
2635
|
+
throw new ManagementError("invalid_input", "body must be valid JSON");
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
function staticReceipt(operationId, commandType, status) {
|
|
2639
|
+
const stamp = now().toISOString();
|
|
2640
|
+
return {
|
|
2641
|
+
operation_id: operationId,
|
|
2642
|
+
command_type: commandType,
|
|
2643
|
+
status,
|
|
2644
|
+
resource_ref: null,
|
|
2645
|
+
result_revision: null,
|
|
2646
|
+
created_at: stamp,
|
|
2647
|
+
...(status === "succeeded" || status === "failed"
|
|
2648
|
+
? { completed_at: stamp }
|
|
2649
|
+
: { completed_at: null }),
|
|
2650
|
+
support_id: `sup_${operationId.slice(-8)}`,
|
|
2651
|
+
};
|
|
2652
|
+
}
|
|
2653
|
+
function toStorageStatus(status) {
|
|
2654
|
+
if (status === "succeeded" || status === "failed")
|
|
2655
|
+
return status;
|
|
2656
|
+
return "unknown";
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
// ── 模块级纯函数 ───────────────────────────────────────────────────────
|
|
2660
|
+
function isKnownPath(rest) {
|
|
2661
|
+
if (rest === "/session" ||
|
|
2662
|
+
rest === "/status" ||
|
|
2663
|
+
rest === "/products" ||
|
|
2664
|
+
rest === "/policy" ||
|
|
2665
|
+
rest === "/approvals" ||
|
|
2666
|
+
rest === "/confirmations" ||
|
|
2667
|
+
rest === "/service/pause" ||
|
|
2668
|
+
rest === "/service/resume" ||
|
|
2669
|
+
rest === "/products/import-drafts" ||
|
|
2670
|
+
rest === "/products/import-parse" ||
|
|
2671
|
+
rest === "/products/import-template" ||
|
|
2672
|
+
rest === "/policy/drafts" ||
|
|
2673
|
+
rest === "/onboarding") {
|
|
2674
|
+
return true;
|
|
2675
|
+
}
|
|
2676
|
+
return (/^\/approvals\/[^/]+(\/approve|\/reject)?$/.test(rest) ||
|
|
2677
|
+
/^\/operations\/[^/]+$/.test(rest) ||
|
|
2678
|
+
/^\/products\/import-drafts\/[^/]+\/commit$/.test(rest) ||
|
|
2679
|
+
/^\/policy\/drafts\/[^/]+\/commit$/.test(rest) ||
|
|
2680
|
+
/^\/onboarding\/([^/]+)\/(advance|cancel|consent-refused)$/.test(rest));
|
|
2681
|
+
}
|
|
2682
|
+
function pageQuery(url) {
|
|
2683
|
+
const out = {};
|
|
2684
|
+
const cursor = url.searchParams.get("cursor");
|
|
2685
|
+
if (cursor !== null && cursor !== "")
|
|
2686
|
+
out.cursor = cursor;
|
|
2687
|
+
const limitRaw = url.searchParams.get("limit");
|
|
2688
|
+
if (limitRaw !== null) {
|
|
2689
|
+
const limit = Number.parseInt(limitRaw, 10);
|
|
2690
|
+
if (!Number.isFinite(limit) || limit <= 0) {
|
|
2691
|
+
throw new ManagementError("invalid_input", "limit must be a positive integer");
|
|
2692
|
+
}
|
|
2693
|
+
out.limit = limit;
|
|
2694
|
+
}
|
|
2695
|
+
return out;
|
|
2696
|
+
}
|
|
2697
|
+
function pathSegment(raw) {
|
|
2698
|
+
try {
|
|
2699
|
+
return decodeURIComponent(raw);
|
|
2700
|
+
}
|
|
2701
|
+
catch {
|
|
2702
|
+
throw new ManagementError("invalid_input", "invalid path encoding");
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
function objectFields(body, allowed) {
|
|
2706
|
+
if (body === null || typeof body !== "object" || Array.isArray(body)) {
|
|
2707
|
+
throw new ManagementError("invalid_input", "body must be a JSON object");
|
|
2708
|
+
}
|
|
2709
|
+
for (const key of Object.keys(body)) {
|
|
2710
|
+
if (!allowed.includes(key)) {
|
|
2711
|
+
throw new ManagementError("invalid_input", `unknown field: ${key}`);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
return body;
|
|
2715
|
+
}
|
|
2716
|
+
function requireString(value, field) {
|
|
2717
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
2718
|
+
throw new ManagementError("invalid_input", `${field} must be a non-empty string`);
|
|
2719
|
+
}
|
|
2720
|
+
return value;
|
|
2721
|
+
}
|
|
2722
|
+
function requireObject(value, field) {
|
|
2723
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
2724
|
+
throw new ManagementError("invalid_input", `${field} must be a JSON object`);
|
|
2725
|
+
}
|
|
2726
|
+
return value;
|
|
2727
|
+
}
|
|
2728
|
+
function sameAuthorizationGeneration(frozen, current) {
|
|
2729
|
+
if (frozen === null || typeof frozen !== "object" || Array.isArray(frozen))
|
|
2730
|
+
return false;
|
|
2731
|
+
const value = frozen;
|
|
2732
|
+
return (value["actor_id"] === current["actor_id"] &&
|
|
2733
|
+
value["actor_role"] === current["actor_role"] &&
|
|
2734
|
+
value["action"] === current["action"] &&
|
|
2735
|
+
value["authorization_generation"] === current["authorization_generation"]);
|
|
2736
|
+
}
|
|
2737
|
+
function optionalString(value, field) {
|
|
2738
|
+
if (value === undefined)
|
|
2739
|
+
return undefined;
|
|
2740
|
+
return requireString(value, field);
|
|
2741
|
+
}
|
|
2742
|
+
function requireInteger(value, field) {
|
|
2743
|
+
if (typeof value !== "number" || !Number.isInteger(value)) {
|
|
2744
|
+
throw new ManagementError("invalid_input", `${field} must be an integer`);
|
|
2745
|
+
}
|
|
2746
|
+
return value;
|
|
2747
|
+
}
|
|
2748
|
+
function requireNonNegativeInteger(value, field) {
|
|
2749
|
+
const integer = requireInteger(value, field);
|
|
2750
|
+
if (integer < 0)
|
|
2751
|
+
throw new ManagementError("invalid_input", `${field} must be non-negative`);
|
|
2752
|
+
return integer;
|
|
2753
|
+
}
|
|
2754
|
+
function requirePositiveInteger(value, field) {
|
|
2755
|
+
const integer = requireInteger(value, field);
|
|
2756
|
+
if (integer < 1)
|
|
2757
|
+
throw new ManagementError("invalid_input", `${field} must be positive`);
|
|
2758
|
+
return integer;
|
|
2759
|
+
}
|
|
2760
|
+
/** 表单数值允许小数(元/百分比),但必须有限且非负(或正数,见下)。 */
|
|
2761
|
+
function requireNonNegativeNumber(value, field) {
|
|
2762
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
|
|
2763
|
+
throw new ManagementError("invalid_input", `${field} must be a non-negative number`);
|
|
2764
|
+
}
|
|
2765
|
+
return value;
|
|
2766
|
+
}
|
|
2767
|
+
function requirePositiveNumber(value, field) {
|
|
2768
|
+
const number = requireNonNegativeNumber(value, field);
|
|
2769
|
+
if (number === 0)
|
|
2770
|
+
throw new ManagementError("invalid_input", `${field} must be positive`);
|
|
2771
|
+
return number;
|
|
2772
|
+
}
|
|
2773
|
+
/** human_review_on 已知触发词(product-init/supervisor 初始化口径)。 */
|
|
2774
|
+
const HUMAN_REVIEW_TRIGGERS = ["below_floor", "exceptional_warranty", "suspicious_content"];
|
|
2775
|
+
function requireDecision(value) {
|
|
2776
|
+
if (value !== "approve" && value !== "reject") {
|
|
2777
|
+
throw new ManagementError("invalid_input", "decision must be approve or reject");
|
|
2778
|
+
}
|
|
2779
|
+
return value;
|
|
2780
|
+
}
|
|
2781
|
+
function requireGrantAction(value) {
|
|
2782
|
+
if (typeof value !== "string" || !GRANT_ACTIONS.includes(value)) {
|
|
2783
|
+
throw new ManagementError("invalid_input", "grant_action is invalid");
|
|
2784
|
+
}
|
|
2785
|
+
return value;
|
|
2786
|
+
}
|
|
2787
|
+
function requireGrantResourceType(value) {
|
|
2788
|
+
if (value !== "merchant" && value !== "product") {
|
|
2789
|
+
throw new ManagementError("invalid_input", "resource_type must be merchant or product");
|
|
2790
|
+
}
|
|
2791
|
+
return value;
|
|
2792
|
+
}
|
|
2793
|
+
function requireGrantSelector(value) {
|
|
2794
|
+
if (value === "merchant" || value === "all_products")
|
|
2795
|
+
return value;
|
|
2796
|
+
if (!Array.isArray(value) ||
|
|
2797
|
+
value.length === 0 ||
|
|
2798
|
+
value.some((item) => typeof item !== "string")) {
|
|
2799
|
+
throw new ManagementError("invalid_input", "resource_selector is invalid");
|
|
2800
|
+
}
|
|
2801
|
+
return value;
|
|
2802
|
+
}
|
|
2803
|
+
function requireStringArray(value, field) {
|
|
2804
|
+
if (!Array.isArray(value) ||
|
|
2805
|
+
value.length === 0 ||
|
|
2806
|
+
value.some((item) => typeof item !== "string")) {
|
|
2807
|
+
throw new ManagementError("invalid_input", `${field} must be a non-empty string array`);
|
|
2808
|
+
}
|
|
2809
|
+
return value;
|
|
2810
|
+
}
|
|
2811
|
+
function requirePublicAudience(value) {
|
|
2812
|
+
if (value !== "public") {
|
|
2813
|
+
throw new ManagementError("invalid_input", "audience must be public");
|
|
2814
|
+
}
|
|
2815
|
+
return value;
|
|
2816
|
+
}
|
|
2817
|
+
function candidateIdFromPreparation(value) {
|
|
2818
|
+
const prepared = requireObject(value, "prepared candidate");
|
|
2819
|
+
const candidate = requireObject(prepared["candidate"], "prepared candidate.candidate");
|
|
2820
|
+
return requireString(candidate["candidate_id"], "prepared candidate.candidate_id");
|
|
2821
|
+
}
|
|
2822
|
+
function exactProductProjection(product) {
|
|
2823
|
+
if (product.currency_table_version !== WORKBENCH_CURRENCY_TABLE_VERSION) {
|
|
2824
|
+
throw new ManagementError("unavailable", "exact product currency table version does not match Workbench v1");
|
|
2825
|
+
}
|
|
2826
|
+
return {
|
|
2827
|
+
sku: product.sku,
|
|
2828
|
+
merchant_id: product.merchant_id,
|
|
2829
|
+
title: product.title,
|
|
2830
|
+
description: product.description,
|
|
2831
|
+
category: product.category,
|
|
2832
|
+
tags: product.tags,
|
|
2833
|
+
stock: product.stock,
|
|
2834
|
+
money: {
|
|
2835
|
+
currency: product.currency,
|
|
2836
|
+
amount_minor: product.price_minor,
|
|
2837
|
+
currency_table_version: product.currency_table_version,
|
|
2838
|
+
},
|
|
2839
|
+
authority_version: product.authority_version,
|
|
2840
|
+
delivery_attributes: product.delivery_attributes,
|
|
2841
|
+
handoff_destination: product.handoff_destination,
|
|
2842
|
+
};
|
|
2843
|
+
}
|
|
2844
|
+
function requireExactMoneyInput(value) {
|
|
2845
|
+
const record = requireObject(value, "money");
|
|
2846
|
+
if (record["currency_table_version"] !== WORKBENCH_CURRENCY_TABLE_VERSION) {
|
|
2847
|
+
throw new ManagementError("invalid_input", `money.currency_table_version must be ${WORKBENCH_CURRENCY_TABLE_VERSION}`);
|
|
2848
|
+
}
|
|
2849
|
+
return parseExactMoney(record, { requireOperatingSupport: true });
|
|
2850
|
+
}
|
|
2851
|
+
function cookieValue(req, name) {
|
|
2852
|
+
const header = req.headers.cookie;
|
|
2853
|
+
if (header === undefined)
|
|
2854
|
+
return undefined;
|
|
2855
|
+
for (const part of header.split(";")) {
|
|
2856
|
+
const eq = part.indexOf("=");
|
|
2857
|
+
if (eq === -1)
|
|
2858
|
+
continue;
|
|
2859
|
+
if (part.slice(0, eq).trim() === name)
|
|
2860
|
+
return part.slice(eq + 1).trim();
|
|
2861
|
+
}
|
|
2862
|
+
return undefined;
|
|
2863
|
+
}
|
|
2864
|
+
function singleHeader(req, name) {
|
|
2865
|
+
const value = req.headers[name];
|
|
2866
|
+
if (Array.isArray(value))
|
|
2867
|
+
return value[0];
|
|
2868
|
+
return value;
|
|
2869
|
+
}
|
|
2870
|
+
function errorBody(code, message, opts = {}) {
|
|
2871
|
+
return {
|
|
2872
|
+
code,
|
|
2873
|
+
message,
|
|
2874
|
+
retryable: opts.retryable ?? false,
|
|
2875
|
+
support_id: opts.supportId ?? `sup_${randomBytes(4).toString("hex")}`,
|
|
2876
|
+
};
|
|
2877
|
+
}
|
|
2878
|
+
function writeJson(res, status, body, extra = {}) {
|
|
2879
|
+
if (res.headersSent) {
|
|
2880
|
+
res.end();
|
|
2881
|
+
return;
|
|
2882
|
+
}
|
|
2883
|
+
res.writeHead(status, {
|
|
2884
|
+
"content-type": "application/json; charset=utf-8",
|
|
2885
|
+
"cache-control": "no-store",
|
|
2886
|
+
pragma: "no-cache",
|
|
2887
|
+
...extra,
|
|
2888
|
+
});
|
|
2889
|
+
res.end(JSON.stringify(body));
|
|
2890
|
+
}
|
|
2891
|
+
function writeWorkbenchProblem(res, code, requestId, title, detail, details) {
|
|
2892
|
+
const body = createWorkbenchProblem(code, {
|
|
2893
|
+
title,
|
|
2894
|
+
detail,
|
|
2895
|
+
requestId,
|
|
2896
|
+
...(details !== undefined ? { details } : {}),
|
|
2897
|
+
});
|
|
2898
|
+
if (res.headersSent) {
|
|
2899
|
+
res.end();
|
|
2900
|
+
return;
|
|
2901
|
+
}
|
|
2902
|
+
res.writeHead(body.status, {
|
|
2903
|
+
"content-type": "application/problem+json; charset=utf-8",
|
|
2904
|
+
"cache-control": "no-store",
|
|
2905
|
+
pragma: "no-cache",
|
|
2906
|
+
"x-request-id": requestId,
|
|
2907
|
+
});
|
|
2908
|
+
res.end(JSON.stringify(body));
|
|
2909
|
+
}
|
|
2910
|
+
function respondWorkbenchError(res, error, requestId) {
|
|
2911
|
+
if (error instanceof WorkbenchEventProjectionError) {
|
|
2912
|
+
writeWorkbenchProblem(res, "VALIDATION_ERROR", requestId, "事件游标无效", error.message);
|
|
2913
|
+
return;
|
|
2914
|
+
}
|
|
2915
|
+
if (error instanceof WorkbenchMoneyError) {
|
|
2916
|
+
writeWorkbenchProblem(res, error.code === "MONEY_RANGE_EXCEEDED" || error.code === "MONEY_PRECISION_UNRECOVERABLE"
|
|
2917
|
+
? error.code
|
|
2918
|
+
: "VALIDATION_ERROR", requestId, "金额请求未完成", error.message);
|
|
2919
|
+
return;
|
|
2920
|
+
}
|
|
2921
|
+
if (error instanceof MerchantWorkbenchError) {
|
|
2922
|
+
const code = error.kind === "not_found"
|
|
2923
|
+
? "RESOURCE_NOT_FOUND"
|
|
2924
|
+
: error.kind === "validation"
|
|
2925
|
+
? "VALIDATION_ERROR"
|
|
2926
|
+
: error.kind === "auth"
|
|
2927
|
+
? "PERMISSION_REVOKED"
|
|
2928
|
+
: "DEPENDENCY_UNAVAILABLE";
|
|
2929
|
+
writeWorkbenchProblem(res, code, requestId, "磋商请求未完成", error.message);
|
|
2930
|
+
return;
|
|
2931
|
+
}
|
|
2932
|
+
if (error instanceof MerchantPromotionError) {
|
|
2933
|
+
const code = error.code === "clock_skew"
|
|
2934
|
+
? "RUNTIME_PAUSED"
|
|
2935
|
+
: error.code === "not_found"
|
|
2936
|
+
? "RESOURCE_NOT_FOUND"
|
|
2937
|
+
: error.code === "version_conflict"
|
|
2938
|
+
? "VERSION_CONFLICT"
|
|
2939
|
+
: "VALIDATION_ERROR";
|
|
2940
|
+
writeWorkbenchProblem(res, code, requestId, "促销请求未完成", error.message);
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
if (error instanceof MerchantGrantError) {
|
|
2944
|
+
const code = error.code === "not_found"
|
|
2945
|
+
? "RESOURCE_NOT_FOUND"
|
|
2946
|
+
: error.code === "invalid_input"
|
|
2947
|
+
? "VALIDATION_ERROR"
|
|
2948
|
+
: "PERMISSION_REVOKED";
|
|
2949
|
+
writeWorkbenchProblem(res, code, requestId, "授权未通过", error.message);
|
|
2950
|
+
return;
|
|
2951
|
+
}
|
|
2952
|
+
if (error instanceof MerchantFeedError) {
|
|
2953
|
+
const code = error.code === "not_found"
|
|
2954
|
+
? "RESOURCE_NOT_FOUND"
|
|
2955
|
+
: error.code === "version_conflict"
|
|
2956
|
+
? "VERSION_CONFLICT"
|
|
2957
|
+
: "VALIDATION_ERROR";
|
|
2958
|
+
writeWorkbenchProblem(res, code, requestId, "广播请求未完成", error.message);
|
|
2959
|
+
return;
|
|
2960
|
+
}
|
|
2961
|
+
if (error instanceof WorkbenchConfirmationError) {
|
|
2962
|
+
const mapping = {
|
|
2963
|
+
invalid_registration: "CONFIRMATION_INVALID",
|
|
2964
|
+
confirmation_not_found: "RESOURCE_NOT_FOUND",
|
|
2965
|
+
confirmation_expired: "CONFIRMATION_EXPIRED",
|
|
2966
|
+
confirmation_consumed: "CONFIRMATION_INVALID",
|
|
2967
|
+
confirmation_binding_mismatch: "CONFIRMATION_INVALID",
|
|
2968
|
+
credential_unavailable: "CONFIRMATION_CHANNEL_UNAVAILABLE",
|
|
2969
|
+
assertion_invalid: "CONFIRMATION_INVALID",
|
|
2970
|
+
};
|
|
2971
|
+
writeWorkbenchProblem(res, mapping[error.code], requestId, "可信确认未完成", error.message);
|
|
2972
|
+
return;
|
|
2973
|
+
}
|
|
2974
|
+
if (error instanceof ActorContextError) {
|
|
2975
|
+
if (error.code === "expired_context") {
|
|
2976
|
+
writeWorkbenchProblem(res, "UNAUTHENTICATED", requestId, "需要重新登录", "管理会话或主体上下文已经过期。");
|
|
2977
|
+
return;
|
|
2978
|
+
}
|
|
2979
|
+
writeWorkbenchProblem(res, "INTERNAL_ERROR", requestId, "主体校验失败", "主体上下文完整性校验失败。");
|
|
2980
|
+
return;
|
|
2981
|
+
}
|
|
2982
|
+
if (error instanceof ManagementError) {
|
|
2983
|
+
const mapping = {
|
|
2984
|
+
unauthorized: "UNAUTHENTICATED",
|
|
2985
|
+
forbidden: "PERMISSION_REVOKED",
|
|
2986
|
+
not_found: "RESOURCE_NOT_FOUND",
|
|
2987
|
+
conflict: "VERSION_CONFLICT",
|
|
2988
|
+
precondition_changed: "VERSION_CONFLICT",
|
|
2989
|
+
invalid_input: "VALIDATION_ERROR",
|
|
2990
|
+
rate_limited: "RATE_LIMITED",
|
|
2991
|
+
unavailable: "DEPENDENCY_UNAVAILABLE",
|
|
2992
|
+
tool_binding_unavailable: "DEPENDENCY_UNAVAILABLE",
|
|
2993
|
+
update_required: "VERSION_CONFLICT",
|
|
2994
|
+
};
|
|
2995
|
+
writeWorkbenchProblem(res, mapping[error.code] ?? "INTERNAL_ERROR", requestId, "请求未完成", error.message, { support_id: error.supportId });
|
|
2996
|
+
return;
|
|
2997
|
+
}
|
|
2998
|
+
process.stderr.write(`[merchant-management] Workbench 未预期异常:${error instanceof Error ? error.message : String(error)}\n`);
|
|
2999
|
+
writeWorkbenchProblem(res, "INTERNAL_ERROR", requestId, "内部错误", "请求未完成,请使用请求编号联系支持。");
|
|
3000
|
+
}
|
|
3001
|
+
function respondError(res, err) {
|
|
3002
|
+
if (res.headersSent) {
|
|
3003
|
+
res.end();
|
|
3004
|
+
return;
|
|
3005
|
+
}
|
|
3006
|
+
if (err instanceof ActorContextError) {
|
|
3007
|
+
if (err.code === "expired_context") {
|
|
3008
|
+
writeJson(res, 401, errorBody("unauthorized", "management session or actor context expired"));
|
|
3009
|
+
return;
|
|
3010
|
+
}
|
|
3011
|
+
process.stderr.write(`[merchant-management] 主体上下文完整性异常:${err.message}\n`);
|
|
3012
|
+
writeJson(res, 503, errorBody("unavailable", "actor context integrity failure"));
|
|
3013
|
+
return;
|
|
3014
|
+
}
|
|
3015
|
+
if (err instanceof ManagementError) {
|
|
3016
|
+
writeJson(res, MANAGEMENT_ERROR_STATUS[err.code], errorBody(err.code, err.message, { retryable: err.retryable, supportId: err.supportId }));
|
|
3017
|
+
return;
|
|
3018
|
+
}
|
|
3019
|
+
process.stderr.write(`[merchant-management] 未预期异常:${err instanceof Error ? err.message : String(err)}\n`);
|
|
3020
|
+
writeJson(res, 503, errorBody("unavailable", "internal error"));
|
|
3021
|
+
}
|
|
3022
|
+
//# sourceMappingURL=api.js.map
|