@noodleseed/one 0.48.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +6 -6
- package/dist/cli.js.map +1 -1
- package/dist/commands/archive-ops.js +1 -1
- package/dist/commands/archive-ops.js.map +1 -1
- package/dist/commands/auth-metadata-readiness.d.ts +8 -0
- package/dist/commands/auth-metadata-readiness.d.ts.map +1 -0
- package/dist/commands/auth-metadata-readiness.js +164 -0
- package/dist/commands/auth-metadata-readiness.js.map +1 -0
- package/dist/commands/auth-ops.d.ts +3 -0
- package/dist/commands/auth-ops.d.ts.map +1 -1
- package/dist/commands/auth-ops.js +37 -82
- package/dist/commands/auth-ops.js.map +1 -1
- package/dist/commands/author-loop.d.ts +7 -3
- package/dist/commands/author-loop.d.ts.map +1 -1
- package/dist/commands/author-loop.js +33 -62
- package/dist/commands/author-loop.js.map +1 -1
- package/dist/commands/billing-admission-output.d.ts +16 -0
- package/dist/commands/billing-admission-output.d.ts.map +1 -0
- package/dist/commands/billing-admission-output.js +40 -0
- package/dist/commands/billing-admission-output.js.map +1 -0
- package/dist/commands/billing-enforcement-activation-args.d.ts +40 -0
- package/dist/commands/billing-enforcement-activation-args.d.ts.map +1 -0
- package/dist/commands/billing-enforcement-activation-args.js +125 -0
- package/dist/commands/billing-enforcement-activation-args.js.map +1 -0
- package/dist/commands/billing-enforcement-activation-files.d.ts +11 -0
- package/dist/commands/billing-enforcement-activation-files.d.ts.map +1 -0
- package/dist/commands/billing-enforcement-activation-files.js +54 -0
- package/dist/commands/billing-enforcement-activation-files.js.map +1 -0
- package/dist/commands/billing-enforcement-activation-ops.d.ts +2 -0
- package/dist/commands/billing-enforcement-activation-ops.d.ts.map +1 -0
- package/dist/commands/billing-enforcement-activation-ops.js +283 -0
- package/dist/commands/billing-enforcement-activation-ops.js.map +1 -0
- package/dist/commands/billing-enforcement-ops.d.ts.map +1 -1
- package/dist/commands/billing-enforcement-ops.js +5 -1
- package/dist/commands/billing-enforcement-ops.js.map +1 -1
- package/dist/commands/billing-read-ops.d.ts.map +1 -1
- package/dist/commands/billing-read-ops.js +15 -3
- package/dist/commands/billing-read-ops.js.map +1 -1
- package/dist/commands/billing-read-view.d.ts +40 -1
- package/dist/commands/billing-read-view.d.ts.map +1 -1
- package/dist/commands/billing-read-view.js +50 -0
- package/dist/commands/billing-read-view.js.map +1 -1
- package/dist/commands/catalog-data-resources.d.ts.map +1 -1
- package/dist/commands/catalog-data-resources.js +4 -3
- package/dist/commands/catalog-data-resources.js.map +1 -1
- package/dist/commands/config-values.d.ts.map +1 -1
- package/dist/commands/config-values.js +18 -2
- package/dist/commands/config-values.js.map +1 -1
- package/dist/commands/deploy-ops.d.ts +1 -0
- package/dist/commands/deploy-ops.d.ts.map +1 -1
- package/dist/commands/deploy-ops.js +5 -0
- package/dist/commands/deploy-ops.js.map +1 -1
- package/dist/commands/deploy-status-ops.js +1 -1
- package/dist/commands/deploy-status-ops.js.map +1 -1
- package/dist/commands/devtools.d.ts +1 -1
- package/dist/commands/devtools.d.ts.map +1 -1
- package/dist/commands/devtools.js +23 -4
- package/dist/commands/devtools.js.map +1 -1
- package/dist/commands/local-readiness.d.ts +6 -0
- package/dist/commands/local-readiness.d.ts.map +1 -0
- package/dist/commands/local-readiness.js +48 -0
- package/dist/commands/local-readiness.js.map +1 -0
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +13 -0
- package/dist/commands/shared.js.map +1 -1
- package/dist/deploy.d.ts +1 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +1 -0
- package/dist/deploy.js.map +1 -1
- package/dist/local-target.d.ts +16 -0
- package/dist/local-target.d.ts.map +1 -0
- package/dist/local-target.js +35 -0
- package/dist/local-target.js.map +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-connect-refs.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-connect-refs.js +7 -8
- package/node_modules/@noodle-borg/agent-kit/dist/skill-connect-refs.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/auth/dist/discovery.d.ts +11 -3
- package/node_modules/@noodle-borg/auth/dist/discovery.d.ts.map +1 -1
- package/node_modules/@noodle-borg/auth/dist/discovery.js +42 -7
- package/node_modules/@noodle-borg/auth/dist/discovery.js.map +1 -1
- package/node_modules/@noodle-borg/auth/dist/index.d.ts +1 -1
- package/node_modules/@noodle-borg/auth/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/auth/dist/index.js +1 -1
- package/node_modules/@noodle-borg/auth/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.js +2 -0
- package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
- package/node_modules/@noodle-borg/runtime/dist/result.d.ts +3 -1
- package/node_modules/@noodle-borg/runtime/dist/result.d.ts.map +1 -1
- package/node_modules/@noodle-borg/runtime/dist/result.js.map +1 -1
- package/node_modules/@noodle-borg/runtime/dist/tool-dispatch.d.ts +10 -0
- package/node_modules/@noodle-borg/runtime/dist/tool-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/runtime/dist/tool-dispatch.js +26 -1
- package/node_modules/@noodle-borg/runtime/dist/tool-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/authoritative-admission.d.ts +46 -0
- package/node_modules/@noodle-borg/service/dist/billing/authoritative-admission.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/authoritative-admission.js +111 -0
- package/node_modules/@noodle-borg/service/dist/billing/authoritative-admission.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/commercial-enforcement-projection.d.ts +80 -0
- package/node_modules/@noodle-borg/service/dist/billing/commercial-enforcement-projection.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/commercial-enforcement-projection.js +2 -0
- package/node_modules/@noodle-borg/service/dist/billing/commercial-enforcement-projection.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/commercial-entitlements.d.ts +18 -0
- package/node_modules/@noodle-borg/service/dist/billing/commercial-entitlements.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/commercial-entitlements.js +51 -0
- package/node_modules/@noodle-borg/service/dist/billing/commercial-entitlements.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation-support.d.ts +34 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation-support.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation-support.js +125 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation.d.ts +265 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation.js +340 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-activation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/enforcement-profile.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/integration.d.ts +15 -3
- package/node_modules/@noodle-borg/service/dist/billing/integration.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/integration.js +56 -3
- package/node_modules/@noodle-borg/service/dist/billing/integration.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-authoritative-authority.d.ts +20 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-authoritative-authority.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-authoritative-authority.js +121 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-authoritative-authority.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-apps.d.ts +10 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-apps.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-apps.js +33 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-apps.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-counters.d.ts +25 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-counters.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-counters.js +248 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-counters.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-projection.d.ts +17 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-projection.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-projection.js +278 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-projection.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-transaction.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-transaction.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-transaction.js +63 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-commercial-enforcement-transaction.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-locks.d.ts +6 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-locks.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-locks.js +89 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-locks.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-preflight.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-preflight.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-preflight.js +193 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-preflight.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-schema.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-schema.js +119 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-support.d.ts +65 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-support.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-support.js +159 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation.d.ts +31 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation.js +247 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-activation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile-schema.js +40 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile.js +45 -22
- package/node_modules/@noodle-borg/service/dist/billing/postgres-enforcement-profile.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-admission-ledger.d.ts +33 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-admission-ledger.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-admission-ledger.js +158 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-admission-ledger.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-admission.d.ts +18 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-admission.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-admission.js +326 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-admission.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epochs.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epochs.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epochs.js +10 -5
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-epochs.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-live-validation.js +3 -3
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-live-validation.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness.d.ts +3 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness.js +8 -2
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-readiness.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-reconciliation.js +4 -4
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-reconciliation.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-runtime.d.ts +2 -2
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-runtime.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-runtime.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-scheduler-store.js +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.js +27 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-meter-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-production-app-admission.d.ts +33 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-production-app-admission.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-production-app-admission.js +272 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-production-app-admission.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.js +2 -0
- package/node_modules/@noodle-borg/service/dist/billing/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.d.ts +174 -28
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.js +51 -6
- package/node_modules/@noodle-borg/service/dist/billing/read-contract.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing-public.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/billing-public.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing-public.js +3 -0
- package/node_modules/@noodle-borg/service/dist/billing-public.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts +14 -2
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/persistence-options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/persistence-options.js +9 -0
- package/node_modules/@noodle-borg/service/dist/persistence-options.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.js +10 -0
- package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/archive.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/archive.js +18 -1
- package/node_modules/@noodle-borg/service/dist/routes/archive.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing-enforcement-activation.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-enforcement-activation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-enforcement-activation.js +197 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-enforcement-activation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-production-app-response.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-production-app-response.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-production-app-response.js +33 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-production-app-response.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.js +203 -41
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.js +25 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-service-deps.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/commercial-service-deps.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-service-deps.js +9 -1
- package/node_modules/@noodle-borg/service/dist/routes/commercial-service-deps.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +19 -1
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/rollback.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/rollback.js +19 -1
- package/node_modules/@noodle-borg/service/dist/routes/rollback.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +41 -1
- package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +6 -3
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/cloudsql-pool.js +3 -3
- package/node_modules/@noodle-borg/service/dist/store/cloudsql-pool.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts +5 -7
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js +71 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +7 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +5 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.js +29 -34
- package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { BillingEnforcementActivationApprovalSchema, BillingEnforcementActivationConflictError, BillingEnforcementActivationMutationResultSchema, BillingEnforcementActivationPreviewSchema, BillingEnforcementActivationStatusSchema, billingEnforcementActivationSuccessAudit, normalizeActivationServiceUrl, parseBillingEnforcementActivateRequest, parseBillingEnforcementRollbackRequest, } from '../billing/enforcement-activation.js';
|
|
2
|
+
import { readJsonBody, sendForbidden, sendJson, sendUnauthorized } from '../http-util.js';
|
|
3
|
+
import { emitAuditMirrors } from '../store/audit.js';
|
|
4
|
+
export async function handleBillingEnforcementActivation(req, res, deps, action) {
|
|
5
|
+
const identity = await authorizeOperator(req, res, deps, action);
|
|
6
|
+
if (identity === undefined)
|
|
7
|
+
return;
|
|
8
|
+
const store = deps.store;
|
|
9
|
+
if (store === undefined) {
|
|
10
|
+
await emitDenial(deps.audit, 409, 'store_required', action, identity);
|
|
11
|
+
return sendJson(res, 409, {
|
|
12
|
+
ok: false,
|
|
13
|
+
code: 'billing_enforcement_activation_store_required',
|
|
14
|
+
error: 'billing enforcement activation requires the configured PostgreSQL lifecycle store',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (action === 'status')
|
|
18
|
+
return handleStatus(res, { ...deps, store }, identity);
|
|
19
|
+
const serviceUrl = deps.serviceUrl;
|
|
20
|
+
if (serviceUrl === undefined) {
|
|
21
|
+
await emitDenial(deps.audit, 409, 'service_required', action, identity);
|
|
22
|
+
return sendJson(res, 409, {
|
|
23
|
+
ok: false,
|
|
24
|
+
code: 'billing_enforcement_activation_service_required',
|
|
25
|
+
error: 'billing enforcement activation requires the configured public service URL',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const body = await readJsonBody(req, deps.maxBody);
|
|
29
|
+
if (!body.ok) {
|
|
30
|
+
await emitDenial(deps.audit, body.status, 'invalid_request', action, identity);
|
|
31
|
+
return sendJson(res, body.status, { ok: false, error: body.error });
|
|
32
|
+
}
|
|
33
|
+
const configuredDeps = { ...deps, store, serviceUrl };
|
|
34
|
+
if (action === 'preview')
|
|
35
|
+
return handlePreview(res, configuredDeps, identity, body.value);
|
|
36
|
+
return handleMutation(res, configuredDeps, identity, action, body.value);
|
|
37
|
+
}
|
|
38
|
+
async function handleStatus(res, deps, identity) {
|
|
39
|
+
try {
|
|
40
|
+
const status = BillingEnforcementActivationStatusSchema.parse(await deps.store.getActivationStatus());
|
|
41
|
+
await deps.audit.emit(statusAudit(status, identity));
|
|
42
|
+
sendJson(res, 200, { ok: true, data: status });
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
await handleStoreError(res, deps.audit, 'status', identity, error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function handlePreview(res, deps, identity, value) {
|
|
49
|
+
const approval = BillingEnforcementActivationApprovalSchema.safeParse(value);
|
|
50
|
+
if (!approval.success) {
|
|
51
|
+
await emitDenial(deps.audit, 400, 'invalid_request', 'preview', identity);
|
|
52
|
+
return sendJson(res, 400, {
|
|
53
|
+
ok: false,
|
|
54
|
+
error: `invalid billing enforcement activation approval: ${approval.error.message}`,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
if (approval.data.service !== normalizeActivationServiceUrl(deps.serviceUrl)) {
|
|
59
|
+
throw new BillingEnforcementActivationConflictError('activation_configuration_unavailable', 'activation approval targets a different service');
|
|
60
|
+
}
|
|
61
|
+
const preview = BillingEnforcementActivationPreviewSchema.parse(await deps.store.previewActivation({ approval: approval.data }));
|
|
62
|
+
await deps.audit.emit(previewAudit(preview, identity));
|
|
63
|
+
sendJson(res, 200, { ok: true, data: preview });
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
await handleStoreError(res, deps.audit, 'preview', identity, error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function handleMutation(res, deps, identity, action, value) {
|
|
70
|
+
let request;
|
|
71
|
+
try {
|
|
72
|
+
request =
|
|
73
|
+
action === 'activate'
|
|
74
|
+
? parseBillingEnforcementActivateRequest(value)
|
|
75
|
+
: parseBillingEnforcementRollbackRequest(value);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
await emitDenial(deps.audit, 400, 'invalid_request', action, identity);
|
|
79
|
+
return sendJson(res, 400, {
|
|
80
|
+
ok: false,
|
|
81
|
+
error: error instanceof Error ? error.message : String(error),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
const service = normalizeActivationServiceUrl(deps.serviceUrl);
|
|
86
|
+
const rawResult = action === 'activate'
|
|
87
|
+
? await deps.store.activateEnforcement({
|
|
88
|
+
request: request,
|
|
89
|
+
actor: identity,
|
|
90
|
+
service,
|
|
91
|
+
})
|
|
92
|
+
: await deps.store.rollbackEnforcement({
|
|
93
|
+
request: request,
|
|
94
|
+
actor: identity,
|
|
95
|
+
service,
|
|
96
|
+
});
|
|
97
|
+
const result = BillingEnforcementActivationMutationResultSchema.parse(rawResult);
|
|
98
|
+
await emitSuccess(deps, result, identity);
|
|
99
|
+
sendJson(res, action === 'activate' && !result.replayed ? 201 : 200, {
|
|
100
|
+
ok: true,
|
|
101
|
+
data: result,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
await handleStoreError(res, deps.audit, action, identity, error);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function authorizeOperator(req, res, deps, action) {
|
|
109
|
+
const auth = await deps.gate.authorize(req);
|
|
110
|
+
if (!auth.ok) {
|
|
111
|
+
await emitDenial(deps.audit, auth.status, 'authorization_failed', action);
|
|
112
|
+
if (auth.status === 401)
|
|
113
|
+
sendUnauthorized(res, auth.message);
|
|
114
|
+
else
|
|
115
|
+
sendForbidden(res, auth.message);
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
if (auth.identity === undefined) {
|
|
119
|
+
await emitDenial(deps.audit, 401, 'identity_required', action);
|
|
120
|
+
sendUnauthorized(res, 'identity required');
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
if (!auth.identity.superAdmin) {
|
|
124
|
+
await emitDenial(deps.audit, 403, 'super_admin_required', action, auth.identity);
|
|
125
|
+
sendForbidden(res, 'super-admin required');
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
return auth.identity;
|
|
129
|
+
}
|
|
130
|
+
async function handleStoreError(res, audit, action, identity, error) {
|
|
131
|
+
if (error instanceof BillingEnforcementActivationConflictError) {
|
|
132
|
+
await emitDenial(audit, 409, error.code, action, identity);
|
|
133
|
+
sendJson(res, 409, { ok: false, code: error.code, error: error.message });
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
await emitDenial(audit, 500, 'internal_error', action, identity);
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
function emitSuccess(deps, result, identity) {
|
|
140
|
+
const event = billingEnforcementActivationSuccessAudit(result, identity);
|
|
141
|
+
return deps.store.successAuditMode === 'transactional'
|
|
142
|
+
? emitAuditMirrors(deps.audit, event)
|
|
143
|
+
: deps.audit.emit(event);
|
|
144
|
+
}
|
|
145
|
+
function statusAudit(status, identity) {
|
|
146
|
+
return {
|
|
147
|
+
eventType: eventType('status'),
|
|
148
|
+
org: 'platform',
|
|
149
|
+
actorSubject: identity.subject,
|
|
150
|
+
actorEmail: identity.email,
|
|
151
|
+
decision: 'allow',
|
|
152
|
+
status: 200,
|
|
153
|
+
details: {
|
|
154
|
+
state: status.state,
|
|
155
|
+
generation: status.generation,
|
|
156
|
+
activeEpochId: status.activeEpochId,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function previewAudit(preview, identity) {
|
|
161
|
+
return {
|
|
162
|
+
eventType: eventType('preview'),
|
|
163
|
+
org: 'platform',
|
|
164
|
+
actorSubject: identity.subject,
|
|
165
|
+
actorEmail: identity.email,
|
|
166
|
+
decision: 'allow',
|
|
167
|
+
status: 200,
|
|
168
|
+
details: {
|
|
169
|
+
ready: preview.ready,
|
|
170
|
+
blockerCount: preview.blockers.length,
|
|
171
|
+
approvalChecksum: preview.approvalChecksum,
|
|
172
|
+
previewChecksum: preview.previewChecksum,
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function emitDenial(audit, status, reasonCode, action, identity) {
|
|
177
|
+
return audit.emit({
|
|
178
|
+
eventType: eventType(action),
|
|
179
|
+
org: 'platform',
|
|
180
|
+
decision: 'deny',
|
|
181
|
+
status,
|
|
182
|
+
reasonCode,
|
|
183
|
+
...(identity === undefined
|
|
184
|
+
? {}
|
|
185
|
+
: { actorSubject: identity.subject, actorEmail: identity.email }),
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
function eventType(action) {
|
|
189
|
+
if (action === 'status')
|
|
190
|
+
return 'billing.enforcement.activation.read';
|
|
191
|
+
if (action === 'preview')
|
|
192
|
+
return 'billing.enforcement.activation.previewed';
|
|
193
|
+
if (action === 'activate')
|
|
194
|
+
return 'billing.enforcement.activated';
|
|
195
|
+
return 'billing.enforcement.rolled_back';
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=billing-enforcement-activation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-enforcement-activation.js","sourceRoot":"","sources":["../../src/routes/billing-enforcement-activation.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,0CAA0C,EAC1C,yCAAyC,EAEzC,gDAAgD,EAEhD,yCAAyC,EAEzC,wCAAwC,EAGxC,wCAAwC,EACxC,6BAA6B,EAC7B,sCAAsC,EACtC,sCAAsC,GACvC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAA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AC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ServerResponse } from 'node:http';
|
|
2
|
+
import type { AuditSink } from '../store/audit.js';
|
|
3
|
+
interface ProductionAppAdmissionRejectionContext {
|
|
4
|
+
readonly audit: AuditSink;
|
|
5
|
+
readonly eventType: 'deploy.rejected' | 'rollback.rejected' | 'app.restore.rejected';
|
|
6
|
+
readonly org: string;
|
|
7
|
+
readonly app: string;
|
|
8
|
+
readonly env?: string;
|
|
9
|
+
readonly actorSubject?: string;
|
|
10
|
+
readonly actorEmail?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Translate the two typed commercial admission failures without disclosing pooled-account details. */
|
|
13
|
+
export declare function respondProductionAppAdmissionError(res: ServerResponse, error: unknown, context: ProductionAppAdmissionRejectionContext): Promise<boolean>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=billing-production-app-response.d.ts.map
|
package/node_modules/@noodle-borg/service/dist/routes/billing-production-app-response.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-production-app-response.d.ts","sourceRoot":"","sources":["../../src/routes/billing-production-app-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,UAAU,sCAAsC;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;IACrF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,uGAAuG;AACvG,wBAAsB,kCAAkC,CACtD,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAAC,OAAO,CAAC,CAgBlB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BillingProductionAppAdmissionError } from '../billing/postgres-production-app-admission.js';
|
|
2
|
+
import { sendJson } from '../http-util.js';
|
|
3
|
+
/** Translate the two typed commercial admission failures without disclosing pooled-account details. */
|
|
4
|
+
export async function respondProductionAppAdmissionError(res, error, context) {
|
|
5
|
+
if (!(error instanceof BillingProductionAppAdmissionError))
|
|
6
|
+
return false;
|
|
7
|
+
const response = productionAppAdmissionResponse(error.code);
|
|
8
|
+
await context.audit.emit({
|
|
9
|
+
eventType: context.eventType,
|
|
10
|
+
org: context.org,
|
|
11
|
+
app: context.app,
|
|
12
|
+
...(context.env !== undefined ? { env: context.env } : {}),
|
|
13
|
+
decision: 'deny',
|
|
14
|
+
status: response.status,
|
|
15
|
+
reasonCode: error.code,
|
|
16
|
+
...(context.actorSubject !== undefined ? { actorSubject: context.actorSubject } : {}),
|
|
17
|
+
...(context.actorEmail !== undefined ? { actorEmail: context.actorEmail } : {}),
|
|
18
|
+
});
|
|
19
|
+
sendJson(res, response.status, { ok: false, code: error.code, error: response.message });
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
function productionAppAdmissionResponse(code) {
|
|
23
|
+
return code === 'production_app_limit_exceeded'
|
|
24
|
+
? {
|
|
25
|
+
status: 409,
|
|
26
|
+
message: 'production app limit reached; archive an active app or contact support',
|
|
27
|
+
}
|
|
28
|
+
: {
|
|
29
|
+
status: 503,
|
|
30
|
+
message: 'billing enforcement is temporarily unavailable; retry later',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=billing-production-app-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-production-app-response.js","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OAAO,EAAE,CAAC,CAAC;IACzF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,8BAA8B,CAAC,IAAgD;IAItF,OAAO,IAAI,KAAK,+BAA+B;QAC7C,CAAC,CAAC;YACE,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,wEAAwE;SAClF;QACH,CAAC,CAAC;YACE,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,6DAA6D;SACvE,CAAC;AACR,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import type { DeployAuthGate } from '../auth/deploy-gate.js';
|
|
3
|
+
import type { BillingCommercialEnforcementProjectionStore } from '../billing/commercial-enforcement-projection.js';
|
|
3
4
|
import type { ServerRegistry } from '../registry.js';
|
|
4
5
|
import type { ControlPlaneStore } from '../store.js';
|
|
5
6
|
interface BillingReadDeps {
|
|
@@ -8,6 +9,7 @@ interface BillingReadDeps {
|
|
|
8
9
|
readonly registry: ServerRegistry;
|
|
9
10
|
readonly billingUsageEnabled?: boolean;
|
|
10
11
|
readonly clock?: () => Date;
|
|
12
|
+
readonly billingCommercialEnforcementProjectionStore?: BillingCommercialEnforcementProjectionStore;
|
|
11
13
|
}
|
|
12
14
|
export declare function handleBillingAccountList(req: IncomingMessage, res: ServerResponse, deps: BillingReadDeps): Promise<void>;
|
|
13
15
|
export declare function handleBillingAccountInspect(req: IncomingMessage, res: ServerResponse, billingAccountId: string, deps: BillingReadDeps): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-read.d.ts","sourceRoot":"","sources":["../../src/routes/billing-read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"billing-read.d.ts","sourceRoot":"","sources":["../../src/routes/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