@noodleseed/one 0.16.0 → 0.18.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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +52 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/alerts-ops.d.ts +2 -0
- package/dist/commands/alerts-ops.d.ts.map +1 -0
- package/dist/commands/alerts-ops.js +249 -0
- package/dist/commands/alerts-ops.js.map +1 -0
- package/dist/commands/analytics-ops.d.ts +13 -0
- package/dist/commands/analytics-ops.d.ts.map +1 -1
- package/dist/commands/analytics-ops.js +5 -2
- package/dist/commands/analytics-ops.js.map +1 -1
- package/dist/commands/apps-ops.d.ts +17 -0
- package/dist/commands/apps-ops.d.ts.map +1 -0
- package/dist/commands/apps-ops.js +285 -0
- package/dist/commands/apps-ops.js.map +1 -0
- package/dist/commands/archive-ops.js +2 -2
- package/dist/commands/archive-ops.js.map +1 -1
- package/dist/commands/catalog-data-config.d.ts +9 -0
- package/dist/commands/catalog-data-config.d.ts.map +1 -0
- package/dist/commands/catalog-data-config.js +67 -0
- package/dist/commands/catalog-data-config.js.map +1 -0
- package/dist/commands/catalog-data-core.d.ts +13 -0
- package/dist/commands/catalog-data-core.d.ts.map +1 -0
- package/dist/commands/catalog-data-core.js +354 -0
- package/dist/commands/catalog-data-core.js.map +1 -0
- package/dist/commands/catalog-data-resources.d.ts +8 -0
- package/dist/commands/catalog-data-resources.d.ts.map +1 -0
- package/dist/commands/catalog-data-resources.js +551 -0
- package/dist/commands/catalog-data-resources.js.map +1 -0
- package/dist/commands/catalog-dispatch.d.ts +15 -0
- package/dist/commands/catalog-dispatch.d.ts.map +1 -0
- package/dist/commands/catalog-dispatch.js +95 -0
- package/dist/commands/catalog-dispatch.js.map +1 -0
- package/dist/commands/catalog-render.d.ts +28 -0
- package/dist/commands/catalog-render.d.ts.map +1 -0
- package/dist/commands/catalog-render.js +142 -0
- package/dist/commands/catalog-render.js.map +1 -0
- package/dist/commands/catalog-types.d.ts +46 -0
- package/dist/commands/catalog-types.d.ts.map +1 -0
- package/dist/commands/catalog-types.js +7 -0
- package/dist/commands/catalog-types.js.map +1 -0
- package/dist/commands/catalog.d.ts +30 -0
- package/dist/commands/catalog.d.ts.map +1 -0
- package/dist/commands/catalog.js +108 -0
- package/dist/commands/catalog.js.map +1 -0
- package/dist/commands/commands-ops.d.ts +2 -0
- package/dist/commands/commands-ops.d.ts.map +1 -0
- package/dist/commands/commands-ops.js +19 -0
- package/dist/commands/commands-ops.js.map +1 -0
- package/dist/commands/deploy-ops.d.ts +45 -3
- package/dist/commands/deploy-ops.d.ts.map +1 -1
- package/dist/commands/deploy-ops.js +200 -227
- package/dist/commands/deploy-ops.js.map +1 -1
- package/dist/commands/deploy-status-ops.d.ts +13 -0
- package/dist/commands/deploy-status-ops.d.ts.map +1 -0
- package/dist/commands/deploy-status-ops.js +252 -0
- package/dist/commands/deploy-status-ops.js.map +1 -0
- package/dist/commands/deployments-ops.d.ts +30 -0
- package/dist/commands/deployments-ops.d.ts.map +1 -0
- package/dist/commands/deployments-ops.js +248 -0
- package/dist/commands/deployments-ops.js.map +1 -0
- package/dist/commands/envs-ops.d.ts +8 -0
- package/dist/commands/envs-ops.d.ts.map +1 -0
- package/dist/commands/envs-ops.js +240 -0
- package/dist/commands/envs-ops.js.map +1 -0
- package/dist/commands/github-ops.d.ts +15 -0
- package/dist/commands/github-ops.d.ts.map +1 -0
- package/dist/commands/github-ops.js +316 -0
- package/dist/commands/github-ops.js.map +1 -0
- package/dist/commands/github-runs-ops.d.ts +32 -0
- package/dist/commands/github-runs-ops.d.ts.map +1 -0
- package/dist/commands/github-runs-ops.js +132 -0
- package/dist/commands/github-runs-ops.js.map +1 -0
- package/dist/commands/github-shared.d.ts +60 -0
- package/dist/commands/github-shared.d.ts.map +1 -0
- package/dist/commands/github-shared.js +175 -0
- package/dist/commands/github-shared.js.map +1 -0
- package/dist/commands/org-admin.d.ts.map +1 -1
- package/dist/commands/org-admin.js +223 -43
- package/dist/commands/org-admin.js.map +1 -1
- package/dist/commands/output.d.ts +35 -0
- package/dist/commands/output.d.ts.map +1 -0
- package/dist/commands/output.js +34 -0
- package/dist/commands/output.js.map +1 -0
- package/dist/commands/resource-shared.d.ts +132 -0
- package/dist/commands/resource-shared.d.ts.map +1 -0
- package/dist/commands/resource-shared.js +159 -0
- package/dist/commands/resource-shared.js.map +1 -0
- package/dist/commands/session.d.ts +6 -9
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +42 -116
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +3 -91
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/target-picker.d.ts +44 -0
- package/dist/commands/target-picker.d.ts.map +1 -0
- package/dist/commands/target-picker.js +88 -0
- package/dist/commands/target-picker.js.map +1 -0
- package/dist/commands/update-ops.js +1 -1
- package/dist/diagnostics.d.ts +5 -0
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +1 -1
- package/dist/diagnostics.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +33 -0
- package/dist/doctor.js.map +1 -1
- package/dist/fire.d.ts +94 -0
- package/dist/fire.d.ts.map +1 -0
- package/dist/fire.js +418 -0
- package/dist/fire.js.map +1 -0
- package/dist/flavor.d.ts +19 -0
- package/dist/flavor.d.ts.map +1 -0
- package/dist/flavor.js +95 -0
- package/dist/flavor.js.map +1 -0
- package/dist/project.js +2 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +30 -17
- package/dist/prompts.js.map +1 -1
- package/dist/relative-time.d.ts +8 -0
- package/dist/relative-time.d.ts.map +1 -0
- package/dist/relative-time.js +29 -0
- package/dist/relative-time.js.map +1 -0
- package/dist/table.d.ts +47 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +152 -0
- package/dist/table.js.map +1 -0
- package/dist/update-binary.js +1 -1
- package/dist/update-check.d.ts +1 -1
- package/dist/update-check.js +1 -1
- package/dist/update.js +1 -1
- package/dist/watch.d.ts +52 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +177 -0
- package/dist/watch.js.map +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +28 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +6 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/connectors.js +14 -0
- package/node_modules/@noodle-borg/authoring/dist/connectors.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.js +18 -23
- package/node_modules/@noodle-borg/authoring/dist/recording.js.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/compile.js +9 -0
- package/node_modules/@noodle-borg/connector-defs/dist/compile.js.map +1 -1
- package/node_modules/@noodle-borg/openapi-import/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/openapi-import/dist/index.js +3 -1
- package/node_modules/@noodle-borg/openapi-import/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/alert-evaluator.d.ts +57 -0
- package/node_modules/@noodle-borg/service/dist/alert-evaluator.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/alert-evaluator.js +158 -0
- package/node_modules/@noodle-borg/service/dist/alert-evaluator.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/alert-webhook.d.ts +72 -0
- package/node_modules/@noodle-borg/service/dist/alert-webhook.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/alert-webhook.js +138 -0
- package/node_modules/@noodle-borg/service/dist/alert-webhook.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts +49 -0
- package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/app-client.js +23 -0
- package/node_modules/@noodle-borg/service/dist/github/app-client.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/install-nonce.d.ts +23 -0
- package/node_modules/@noodle-borg/service/dist/github/install-nonce.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/install-nonce.js +57 -0
- package/node_modules/@noodle-borg/service/dist/github/install-nonce.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.d.ts +38 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.js +41 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/index.d.ts +15 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +15 -1
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts +47 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +28 -7
- package/node_modules/@noodle-borg/service/dist/registry-state.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-state.js +116 -3
- package/node_modules/@noodle-borg/service/dist/registry-state.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts +14 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.js +20 -45
- package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.d.ts +28 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.js +50 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts.d.ts +39 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts.js +204 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.d.ts +23 -0
- package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.js +53 -0
- package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/apps.d.ts +24 -0
- package/node_modules/@noodle-borg/service/dist/routes/apps.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/apps.js +72 -0
- package/node_modules/@noodle-borg/service/dist/routes/apps.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts +465 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.js +233 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/deployments.d.ts +12 -1
- package/node_modules/@noodle-borg/service/dist/routes/deployments.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/deployments.js +31 -2
- package/node_modules/@noodle-borg/service/dist/routes/deployments.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.d.ts +17 -0
- package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.js +15 -0
- package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/envs.d.ts +22 -0
- package/node_modules/@noodle-borg/service/dist/routes/envs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/envs.js +46 -0
- package/node_modules/@noodle-borg/service/dist/routes/envs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.d.ts +29 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.js +202 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts +30 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js +95 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-runs.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-runs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-runs.js +33 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-runs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.d.ts +28 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.js +80 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts +29 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js +355 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.d.ts +27 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.js +61 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin.d.ts +5 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/org-admin.js +13 -1
- package/node_modules/@noodle-borg/service/dist/routes/org-admin.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +64 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js +170 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.d.ts +33 -0
- package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.js +69 -0
- package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +42 -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 +81 -82
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.d.ts +21 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.js +115 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules.d.ts +108 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules.js +181 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/control-plane.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/control-plane.js +3 -0
- package/node_modules/@noodle-borg/service/dist/store/control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts +24 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js +141 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts +31 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.js +120 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts +22 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js +116 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts +51 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs.js +158 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts +32 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.js +169 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts +14 -1
- package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/json-file.js +54 -1
- package/node_modules/@noodle-borg/service/dist/store/json-file.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.d.ts +19 -0
- package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.js +46 -0
- package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.d.ts +26 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.js +142 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts +11 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js +31 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-config.d.ts +21 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-config.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-config.js +80 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-config.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js +6 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-envs.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-envs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-envs.js +34 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-envs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts +9 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +113 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.js +130 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.js.map +1 -0
- 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 +85 -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 +32 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.js +72 -75
- package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/records.d.ts +56 -3
- package/node_modules/@noodle-borg/service/dist/store/records.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/records.js +158 -0
- package/node_modules/@noodle-borg/service/dist/store/records.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/validate.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/store/validate.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/validate.js +7 -0
- package/node_modules/@noodle-borg/service/dist/store/validate.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.d.ts +265 -17
- package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.js +10 -118
- package/node_modules/@noodle-borg/service/dist/store.js.map +1 -1
- package/node_modules/@noodle-borg/service/package.json +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function resolveGithubStateSecret(webhookSecret: string | undefined): string;
|
|
2
|
+
export interface InstallNoncePayload {
|
|
3
|
+
/**
|
|
4
|
+
* Random per-nonce id (the JWT `jti` idea). Without it two connect requests for the same
|
|
5
|
+
* subject/org/app in the same millisecond would sign to the SAME state and the first-write-wins
|
|
6
|
+
* pending store would conflate the two flows.
|
|
7
|
+
*/
|
|
8
|
+
readonly nonceId: string;
|
|
9
|
+
readonly subject: string;
|
|
10
|
+
readonly org: string;
|
|
11
|
+
readonly app: string;
|
|
12
|
+
readonly issuedAt: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function signInstallNonce(payload: InstallNoncePayload, secret: string): string;
|
|
15
|
+
export type InstallNonceVerification = {
|
|
16
|
+
readonly ok: true;
|
|
17
|
+
readonly payload: InstallNoncePayload;
|
|
18
|
+
} | {
|
|
19
|
+
readonly ok: false;
|
|
20
|
+
readonly reason: 'malformed' | 'tampered' | 'expired';
|
|
21
|
+
};
|
|
22
|
+
export declare function verifyInstallNonce(nonce: string, secret: string, now?: () => Date): InstallNonceVerification;
|
|
23
|
+
//# sourceMappingURL=install-nonce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-nonce.d.ts","sourceRoot":"","sources":["../../src/github/install-nonce.ts"],"names":[],"mappings":"AAiBA,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAOlF;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAIrF;AAED,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,CAAA;CAAE,CAAC;AAElF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,GAAG,GAAE,MAAM,IAAuB,GACjC,wBAAwB,CA4B1B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* HMAC-signed `state` nonce for the GitHub App installation hand-off (`GET /v1/github/install-url` →
|
|
4
|
+
* GitHub's installations/new redirect → `POST /v1/github/installations/claim`). Binds the request to the
|
|
5
|
+
* subject who asked for it and the org/app it targets, with a short expiry — an attacker cannot forge or
|
|
6
|
+
* replay a claim without the signing secret.
|
|
7
|
+
*/
|
|
8
|
+
const NONCE_TTL_MS = 10 * 60 * 1000;
|
|
9
|
+
// Dev/self-host fallback signing secret when no `githubApp.webhookSecret` is configured. Per-process, NOT
|
|
10
|
+
// stable across instances — acceptable only because this whole feature is unwired from live GitHub in this
|
|
11
|
+
// slice (no real installation ever reaches `claim` yet). Production must configure `webhookSecret` before
|
|
12
|
+
// GHD-1 is exposed on a multi-instance deployment; see ADR 0111.
|
|
13
|
+
const FALLBACK_SECRET = randomBytes(32).toString('hex');
|
|
14
|
+
export function resolveGithubStateSecret(webhookSecret) {
|
|
15
|
+
if (webhookSecret !== undefined && webhookSecret.trim().length === 0) {
|
|
16
|
+
// A blank configured secret would silently make every state trivially forgeable — fail loudly
|
|
17
|
+
// instead of signing with ''. (Unconfigured is fine: the per-process random fallback applies.)
|
|
18
|
+
throw new Error('githubApp.webhookSecret must not be empty when configured');
|
|
19
|
+
}
|
|
20
|
+
return webhookSecret ?? FALLBACK_SECRET;
|
|
21
|
+
}
|
|
22
|
+
export function signInstallNonce(payload, secret) {
|
|
23
|
+
const encoded = Buffer.from(JSON.stringify(payload), 'utf8').toString('base64url');
|
|
24
|
+
const signature = createHmac('sha256', secret).update(encoded).digest('hex');
|
|
25
|
+
return `${encoded}.${signature}`;
|
|
26
|
+
}
|
|
27
|
+
export function verifyInstallNonce(nonce, secret, now = () => new Date()) {
|
|
28
|
+
const parts = nonce.split('.');
|
|
29
|
+
if (parts.length !== 2)
|
|
30
|
+
return { ok: false, reason: 'malformed' };
|
|
31
|
+
const [encoded, signature] = parts;
|
|
32
|
+
const expected = createHmac('sha256', secret).update(encoded).digest('hex');
|
|
33
|
+
const expectedBuf = Buffer.from(expected, 'hex');
|
|
34
|
+
const signatureBuf = Buffer.from(signature, 'hex');
|
|
35
|
+
if (signatureBuf.length !== expectedBuf.length || !timingSafeEqual(signatureBuf, expectedBuf)) {
|
|
36
|
+
return { ok: false, reason: 'tampered' };
|
|
37
|
+
}
|
|
38
|
+
let payload;
|
|
39
|
+
try {
|
|
40
|
+
payload = JSON.parse(Buffer.from(encoded, 'base64url').toString('utf8'));
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return { ok: false, reason: 'malformed' };
|
|
44
|
+
}
|
|
45
|
+
if (typeof payload.nonceId !== 'string' ||
|
|
46
|
+
payload.nonceId.length === 0 ||
|
|
47
|
+
typeof payload.subject !== 'string' ||
|
|
48
|
+
typeof payload.org !== 'string' ||
|
|
49
|
+
typeof payload.app !== 'string' ||
|
|
50
|
+
typeof payload.issuedAt !== 'number') {
|
|
51
|
+
return { ok: false, reason: 'malformed' };
|
|
52
|
+
}
|
|
53
|
+
if (now().getTime() - payload.issuedAt > NONCE_TTL_MS)
|
|
54
|
+
return { ok: false, reason: 'expired' };
|
|
55
|
+
return { ok: true, payload };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=install-nonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-nonce.js","sourceRoot":"","sources":["../../src/github/install-nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE;;;;;GAKG;AAEH,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEpC,0GAA0G;AAC1G,2GAA2G;AAC3G,0GAA0G;AAC1G,iEAAiE;AACjE,MAAM,eAAe,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAExD,MAAM,UAAU,wBAAwB,CAAC,aAAiC;IACxE,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrE,8FAA8F;QAC9F,+FAA+F;QAC/F,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,aAAa,IAAI,eAAe,CAAC;AAC1C,CAAC;AAeD,MAAM,UAAU,gBAAgB,CAAC,OAA4B,EAAE,MAAc;IAC3E,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACnF,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7E,OAAO,GAAG,OAAO,IAAI,SAAS,EAAE,CAAC;AACnC,CAAC;AAMD,MAAM,UAAU,kBAAkB,CAChC,KAAa,EACb,MAAc,EACd,MAAk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AK,QAAQ;QAC/B,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC/B,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,EACpC,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC5C,CAAC;IACD,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,QAAQ,GAAG,YAAY;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC/F,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-off store for the CLI `noodle github connect` poll (GHD-1.4). GitHub's installation
|
|
3
|
+
* flow redirects the installer's BROWSER to the GitHub App's configured "Setup URL" once the install
|
|
4
|
+
* completes — a request the CLI process cannot receive directly (it has no public callback endpoint of
|
|
5
|
+
* its own). `GET /v1/github/setup` (`../routes/github-setup.ts`) IS that Setup URL: it lands the
|
|
6
|
+
* redirect, verifies the signed install-nonce `state` GitHub echoes back, and stashes the installationId
|
|
7
|
+
* here keyed by the raw state string. The CLI then polls `GET /v1/github/installations/pending?state=...`
|
|
8
|
+
* (same file) until the entry appears, then proceeds to `POST /v1/github/installations/claim`.
|
|
9
|
+
*
|
|
10
|
+
* Entries expire on the same 10-minute TTL as the nonce itself (`install-nonce.ts`) so a stale poll can
|
|
11
|
+
* never resurrect an old install correlation. The interface is async because a multi-instance
|
|
12
|
+
* deployment backs it with Postgres (`PostgresArtifactStore` implements it — GHD-2 closed the gap
|
|
13
|
+
* flagged in the GHD-1 review): the setup redirect and the CLI poll can land on different instances,
|
|
14
|
+
* so the hand-off must live in the shared store. The in-memory backend remains the single-instance
|
|
15
|
+
* dev/test default.
|
|
16
|
+
*/
|
|
17
|
+
/** Shared hand-off TTL — mirrors the install-nonce TTL so neither side outlives the other. */
|
|
18
|
+
export declare const PENDING_GITHUB_INSTALLATION_TTL_MS: number;
|
|
19
|
+
export interface PendingGithubInstallationStore {
|
|
20
|
+
/**
|
|
21
|
+
* Record that the setup redirect landed for `state`, carrying the installationId GitHub reported.
|
|
22
|
+
* FIRST write wins: a state can land exactly once — replays or a race against the legitimate
|
|
23
|
+
* redirect cannot overwrite the recorded installation (hardening: the repo-confirm step and the
|
|
24
|
+
* repo-in-installation re-verification already blunt a swapped id; this closes the race outright).
|
|
25
|
+
*/
|
|
26
|
+
put(state: string, installationId: number): Promise<void>;
|
|
27
|
+
/** The installationId stashed for `state`, or `undefined` if it hasn't landed yet (or has expired). */
|
|
28
|
+
get(state: string): Promise<number | undefined>;
|
|
29
|
+
}
|
|
30
|
+
export declare class InMemoryPendingGithubInstallationStore implements PendingGithubInstallationStore {
|
|
31
|
+
#private;
|
|
32
|
+
constructor(options?: {
|
|
33
|
+
now?: () => Date;
|
|
34
|
+
});
|
|
35
|
+
put(state: string, installationId: number): Promise<void>;
|
|
36
|
+
get(state: string): Promise<number | undefined>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=pending-installations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-installations.d.ts","sourceRoot":"","sources":["../../src/github/pending-installations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8FAA8F;AAC9F,eAAO,MAAM,kCAAkC,QAAiB,CAAC;AAOjE,MAAM,WAAW,8BAA8B;IAC7C;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,uGAAuG;IACvG,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACjD;AAED,qBAAa,sCAAuC,YAAW,8BAA8B;;gBAI/E,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;IAIxC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzD,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAStD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-off store for the CLI `noodle github connect` poll (GHD-1.4). GitHub's installation
|
|
3
|
+
* flow redirects the installer's BROWSER to the GitHub App's configured "Setup URL" once the install
|
|
4
|
+
* completes — a request the CLI process cannot receive directly (it has no public callback endpoint of
|
|
5
|
+
* its own). `GET /v1/github/setup` (`../routes/github-setup.ts`) IS that Setup URL: it lands the
|
|
6
|
+
* redirect, verifies the signed install-nonce `state` GitHub echoes back, and stashes the installationId
|
|
7
|
+
* here keyed by the raw state string. The CLI then polls `GET /v1/github/installations/pending?state=...`
|
|
8
|
+
* (same file) until the entry appears, then proceeds to `POST /v1/github/installations/claim`.
|
|
9
|
+
*
|
|
10
|
+
* Entries expire on the same 10-minute TTL as the nonce itself (`install-nonce.ts`) so a stale poll can
|
|
11
|
+
* never resurrect an old install correlation. The interface is async because a multi-instance
|
|
12
|
+
* deployment backs it with Postgres (`PostgresArtifactStore` implements it — GHD-2 closed the gap
|
|
13
|
+
* flagged in the GHD-1 review): the setup redirect and the CLI poll can land on different instances,
|
|
14
|
+
* so the hand-off must live in the shared store. The in-memory backend remains the single-instance
|
|
15
|
+
* dev/test default.
|
|
16
|
+
*/
|
|
17
|
+
/** Shared hand-off TTL — mirrors the install-nonce TTL so neither side outlives the other. */
|
|
18
|
+
export const PENDING_GITHUB_INSTALLATION_TTL_MS = 10 * 60 * 1000;
|
|
19
|
+
export class InMemoryPendingGithubInstallationStore {
|
|
20
|
+
#entries = new Map();
|
|
21
|
+
#now;
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
this.#now = options.now ?? (() => new Date());
|
|
24
|
+
}
|
|
25
|
+
async put(state, installationId) {
|
|
26
|
+
if (this.#entries.has(state))
|
|
27
|
+
return; // first write wins — see the interface doc
|
|
28
|
+
this.#entries.set(state, { installationId, createdAt: this.#now().getTime() });
|
|
29
|
+
}
|
|
30
|
+
async get(state) {
|
|
31
|
+
const entry = this.#entries.get(state);
|
|
32
|
+
if (entry === undefined)
|
|
33
|
+
return undefined;
|
|
34
|
+
if (this.#now().getTime() - entry.createdAt > PENDING_GITHUB_INSTALLATION_TTL_MS) {
|
|
35
|
+
this.#entries.delete(state);
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return entry.installationId;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=pending-installations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-installations.js","sourceRoot":"","sources":["../../src/github/pending-installations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAmBjE,MAAM,OAAO,sCAAsC;IACxC,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC3C,IAAI,CAAa;IAE1B,YAAY,UAAgC,EAAE;QAC5C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAa,EAAE,cAAsB;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,2CAA2C;QACjF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAa;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC1C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,SAAS,GAAG,kCAAkC,EAAE,CAAC;YACjF,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5B,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { ensureAuditSchema, PostgresAuditStore } from '@noodle-borg/module-audit';
|
|
2
|
+
export { ALERT_EVALUATION_INTERVAL_MS, AlertEvaluator, type AlertEvaluatorOptions, observedMetricValue, } from './alert-evaluator.js';
|
|
3
|
+
export { ALERT_WEBHOOK_SCHEMA_VERSION, type AlertWebhookDelivery, type AlertWebhookPayload, buildAlertWebhookPayload, type DeliverAlertWebhookOptions, deliverAlertWebhook, validateAlertWebhookUrl, type WebhookUrlPolicy, } from './alert-webhook.js';
|
|
2
4
|
export { ARCHIVE_SWEEP_INTERVAL_MS, ArchiveSweeper, type ArchiveSweeperOptions, DEFAULT_ARCHIVE_RETENTION_DAYS, resolveArchiveRetentionDays, } from './archive-sweeper.js';
|
|
3
5
|
export { type AssetAdapterKind, type AssetConfigInput, type AssetConfigResolution, type AssetQuotaOverride, createAssetStore, type ResolvedAssetConfig, resolveAssetConfig, } from './asset-config.js';
|
|
4
6
|
export { type AssetStore, type AssetUploadPlan, type AssetUploadTarget, InMemoryAssetStore, type InMemoryAssetStoreOptions, } from './assets.js';
|
|
@@ -8,23 +10,35 @@ export { COMMERCIAL_PLAN_NAMES, type CommercialPlanCatalog, type CommercialPlanN
|
|
|
8
10
|
export { type CustomerVerifierFactoryOptions, createCustomerVerifierFactory, createFirebaseIdTokenVerifier, } from './customer-verifier.js';
|
|
9
11
|
export { ORG_DOMAIN_TXT_LABEL, type OrgDomainVerificationResult, type TxtResolver, verifyOrgDomainDns, } from './domain-verification.js';
|
|
10
12
|
export { type EnsureFreeTierDefaultOptions, ensureFreeTierDefault, FREE_TIER_PLAN, FREE_TIER_POLICY_ID, } from './free-tier.js';
|
|
13
|
+
export { type GitHubAppClient, type GithubAppConfig, type GithubInstallationRepository, type GithubInstallationSummary, InMemoryGitHubAppClient, } from './github/app-client.js';
|
|
14
|
+
export { type InstallNoncePayload, type InstallNonceVerification, resolveGithubStateSecret, signInstallNonce, verifyInstallNonce, } from './github/install-nonce.js';
|
|
15
|
+
export { InMemoryPendingGithubInstallationStore, type PendingGithubInstallationStore, } from './github/pending-installations.js';
|
|
11
16
|
export type { ServiceOptions } from './options.js';
|
|
12
17
|
export { createLocalPolicyAdmissionGate, type FixedWindowQuota, InMemoryPolicyAssignmentStore, LocalPolicyAdmissionGate, type PolicyAssignment, type PolicyAssignmentInput, type PolicyAssignmentStore, PolicyConflictError, type PolicyCounterStore, type PolicyDeleteInput, type PolicyDocument, type PolicyRate, type PolicyRule, type PolicyScope, type PolicyWindow, resolveEffectivePolicy, } from './policy.js';
|
|
13
18
|
export { CachingPolicyAssignmentStore, type PolicyCacheOptions, } from './policy-cache.js';
|
|
14
19
|
export { InMemoryPolicyCounterStore } from './policy-counters.js';
|
|
15
20
|
export { type DeployError, type DeployResult, type RecoverResult, type RollbackResult, ServerRegistry, } from './registry.js';
|
|
16
21
|
export { aggregateRequestEvents, type ClientMetrics, type MethodMetrics, type RequestMetrics, type SeriesBucket, type ToolMetrics, } from './request-event-metrics.js';
|
|
22
|
+
export { AppResponseSchema, AppSummarySchema, AppsListResponseSchema, DeploymentResponseSchema, DeploymentSummarySchema, DeployRunSchema, EnvResponseSchema, EnvSummarySchema, EnvsListResponseSchema, GithubConnectionResponseSchema, GithubInstallUrlResponseSchema, GithubRunsListResponseSchema, OrgSummarySchema, RepoConnectionSchema, } from './routes/contracts.js';
|
|
17
23
|
export { type GcpKmsConfig, gcpKmsMasterKeyProvider, type KmsClient, } from './secret/kms-master-key.js';
|
|
18
24
|
export { type RunningService, serveService } from './serve.js';
|
|
19
25
|
export { createServiceHandler } from './service.js';
|
|
20
26
|
export { capabilitiesForConfig, defineNoodleService, expandServiceProfile, type NoodleServiceConfig, type ObservabilityConfig, type ObservabilityLogFormat, type ObservabilityLogLevel, type ObservabilityLogSink, parseNoodleServiceYaml, resolveServiceConfigSource, type ServiceConfigSource, } from './service-config.js';
|
|
27
|
+
export { ALERT_METRICS, ALERT_WINDOWS_MINUTES, type AlertFiringState, type AlertMetric, type AlertRuleRecord, type AlertRuleStore, type AlertWindowMinutes, type CreateAlertRuleInput, DEFAULT_ALERT_COOLDOWN_MINUTES, InMemoryAlertRuleStore, MAX_ALERT_RULES_PER_ENV, } from './store/alert-rules.js';
|
|
28
|
+
export { JsonFileAlertRuleStore } from './store/alert-rules-json-file.js';
|
|
21
29
|
export { AUDIT_SCHEMA_VERSION, type AuditDecision, type AuditDetails, type AuditEvent, type AuditEventInput, type AuditFilter, type AuditSink, type AuditStore, InMemoryAuditStore, type InMemoryAuditStoreOptions, MultiSink, redactDetails, StdoutAuditSink, } from './store/audit.js';
|
|
22
30
|
export { InMemoryControlPlaneStore } from './store/control-plane.js';
|
|
31
|
+
export { InMemoryGithubConnectionStore } from './store/github-connections.js';
|
|
32
|
+
export { JsonFileGithubConnectionStore } from './store/github-connections-json-file.js';
|
|
33
|
+
export { canTransitionDeployRun, DEFAULT_DEPLOY_RUN_LIST_LIMIT, DEPLOY_RUN_TRANSITIONS, InMemoryGithubDeployRunStore, } from './store/github-runs.js';
|
|
34
|
+
export { JsonFileGithubDeployRunStore } from './store/github-runs-json-file.js';
|
|
35
|
+
export { PostgresPendingGithubInstallationStore } from './store/pending-installations-postgres.js';
|
|
23
36
|
export { PostgresArtifactStore, type PostgresStoreOptions } from './store/postgres.js';
|
|
37
|
+
export { ensureAlertRuleSchema, PostgresAlertRuleStore, } from './store/postgres-alerts.js';
|
|
24
38
|
export { ensureStateHandleSchema, PostgresStateHandleStore, type PostgresStateHandleStoreOptions, } from './store/postgres-state-handles.js';
|
|
25
39
|
export { RequestEventBuffer } from './store/request-event-buffer.js';
|
|
26
40
|
export { InMemoryRequestEventStore } from './store/request-events.js';
|
|
27
41
|
export { ensureRequestEventSchema, PostgresRequestEventStore, } from './store/request-events-postgres.js';
|
|
28
42
|
export { InMemoryUserAppLogStore, type InMemoryUserAppLogStoreOptions, type UserAppLogEvent, type UserAppLogFilter, type UserAppLogInput, type UserAppLogLevel, type UserAppLogSink, type UserAppLogStore, } from './store/user-app-logs.js';
|
|
29
|
-
export { type AppArchiveResult, type AppRestoreResult, type ArtifactStore, CONFIG_NAME_PATTERN, type ConfigScope, type ConfigStore, type ConfigValueMetadata, type ControlPlaneStore, DEPLOYMENT_ID_PATTERN, type DeploymentListFilter, type DeploymentSummary, type DeployRecord, DOMAIN_PATTERN, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, type ManagedConfigKind, type OrgDomainRecord, type OrgInvitationRecord, type OrgMemberRecord, type OrgRecord, type OrgRole, resolveConfigScope, type SecretEnvelope, type SignupAllowlistKind, type SignupAllowlistRecord, SLUG_PATTERN, scopeChain, type TenantAuthConfig, type TenantRef, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
43
|
+
export { type AppArchiveResult, type AppRestoreResult, type AppSummary, type ArtifactStore, type CancelQueuedDeployRunsFilter, CONFIG_NAME_PATTERN, type ConfigScope, type ConfigStore, type ConfigValueMetadata, type ControlPlaneStore, type CreateDeployRunDuplicateReason, type CreateDeployRunInput, type CreateDeployRunResult, DEPLOYMENT_ID_PATTERN, type DeploymentListFilter, type DeploymentSummary, type DeployRecord, type DeployRunRecord, type DeployRunSourceEvent, type DeployRunStatus, DOMAIN_PATTERN, type EnvSummary, type GithubConnectionStore, type GithubDeployRunStore, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, type ListDeployRunsResult, type ManagedConfigKind, type OrgDomainRecord, type OrgInvitationRecord, type OrgMemberRecord, type OrgRecord, type OrgRole, type RepoConnectionConflict, type RepoConnectionConflictReason, type RepoConnectionRecord, resolveConfigScope, type SecretEnvelope, type SignupAllowlistKind, type SignupAllowlistRecord, SLUG_PATTERN, scopeChain, type TenantAuthConfig, type TenantRef, type UpsertRepoConnectionInput, type UpsertRepoConnectionResult, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validatePositiveInteger, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
30
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,KAAK,qBAAqB,EAC1B,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,KAAK,yBAAyB,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,iBAAiB,EACjB,KAAK,cAAc,EACnB,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,2BAA2B,GAC5B,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,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,YAAY,EACZ,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,2BAA2B,EAC3B,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,KAAK,qBAAqB,EAC1B,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,4BAA4B,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,yBAAyB,EACzB,cAAc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mB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,YAAY,EACZ,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,2BAA2B,EAC3B,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { ensureAuditSchema, PostgresAuditStore } from '@noodle-borg/module-audit';
|
|
2
|
+
export { ALERT_EVALUATION_INTERVAL_MS, AlertEvaluator, observedMetricValue, } from './alert-evaluator.js';
|
|
3
|
+
export { ALERT_WEBHOOK_SCHEMA_VERSION, buildAlertWebhookPayload, deliverAlertWebhook, validateAlertWebhookUrl, } from './alert-webhook.js';
|
|
2
4
|
export { ARCHIVE_SWEEP_INTERVAL_MS, ArchiveSweeper, DEFAULT_ARCHIVE_RETENTION_DAYS, resolveArchiveRetentionDays, } from './archive-sweeper.js';
|
|
3
5
|
export { createAssetStore, resolveAssetConfig, } from './asset-config.js';
|
|
4
6
|
export { InMemoryAssetStore, } from './assets.js';
|
|
@@ -8,22 +10,34 @@ export { COMMERCIAL_PLAN_NAMES, commercialPlanPolicyId, DEFAULT_COMMERCIAL_PLAN_
|
|
|
8
10
|
export { createCustomerVerifierFactory, createFirebaseIdTokenVerifier, } from './customer-verifier.js';
|
|
9
11
|
export { ORG_DOMAIN_TXT_LABEL, verifyOrgDomainDns, } from './domain-verification.js';
|
|
10
12
|
export { ensureFreeTierDefault, FREE_TIER_PLAN, FREE_TIER_POLICY_ID, } from './free-tier.js';
|
|
13
|
+
export { InMemoryGitHubAppClient, } from './github/app-client.js';
|
|
14
|
+
export { resolveGithubStateSecret, signInstallNonce, verifyInstallNonce, } from './github/install-nonce.js';
|
|
15
|
+
export { InMemoryPendingGithubInstallationStore, } from './github/pending-installations.js';
|
|
11
16
|
export { createLocalPolicyAdmissionGate, InMemoryPolicyAssignmentStore, LocalPolicyAdmissionGate, PolicyConflictError, resolveEffectivePolicy, } from './policy.js';
|
|
12
17
|
export { CachingPolicyAssignmentStore, } from './policy-cache.js';
|
|
13
18
|
export { InMemoryPolicyCounterStore } from './policy-counters.js';
|
|
14
19
|
export { ServerRegistry, } from './registry.js';
|
|
15
20
|
export { aggregateRequestEvents, } from './request-event-metrics.js';
|
|
21
|
+
export { AppResponseSchema, AppSummarySchema, AppsListResponseSchema, DeploymentResponseSchema, DeploymentSummarySchema, DeployRunSchema, EnvResponseSchema, EnvSummarySchema, EnvsListResponseSchema, GithubConnectionResponseSchema, GithubInstallUrlResponseSchema, GithubRunsListResponseSchema, OrgSummarySchema, RepoConnectionSchema, } from './routes/contracts.js';
|
|
16
22
|
export { gcpKmsMasterKeyProvider, } from './secret/kms-master-key.js';
|
|
17
23
|
export { serveService } from './serve.js';
|
|
18
24
|
export { createServiceHandler } from './service.js';
|
|
19
25
|
export { capabilitiesForConfig, defineNoodleService, expandServiceProfile, parseNoodleServiceYaml, resolveServiceConfigSource, } from './service-config.js';
|
|
26
|
+
export { ALERT_METRICS, ALERT_WINDOWS_MINUTES, DEFAULT_ALERT_COOLDOWN_MINUTES, InMemoryAlertRuleStore, MAX_ALERT_RULES_PER_ENV, } from './store/alert-rules.js';
|
|
27
|
+
export { JsonFileAlertRuleStore } from './store/alert-rules-json-file.js';
|
|
20
28
|
export { AUDIT_SCHEMA_VERSION, InMemoryAuditStore, MultiSink, redactDetails, StdoutAuditSink, } from './store/audit.js';
|
|
21
29
|
export { InMemoryControlPlaneStore } from './store/control-plane.js';
|
|
30
|
+
export { InMemoryGithubConnectionStore } from './store/github-connections.js';
|
|
31
|
+
export { JsonFileGithubConnectionStore } from './store/github-connections-json-file.js';
|
|
32
|
+
export { canTransitionDeployRun, DEFAULT_DEPLOY_RUN_LIST_LIMIT, DEPLOY_RUN_TRANSITIONS, InMemoryGithubDeployRunStore, } from './store/github-runs.js';
|
|
33
|
+
export { JsonFileGithubDeployRunStore } from './store/github-runs-json-file.js';
|
|
34
|
+
export { PostgresPendingGithubInstallationStore } from './store/pending-installations-postgres.js';
|
|
22
35
|
export { PostgresArtifactStore } from './store/postgres.js';
|
|
36
|
+
export { ensureAlertRuleSchema, PostgresAlertRuleStore, } from './store/postgres-alerts.js';
|
|
23
37
|
export { ensureStateHandleSchema, PostgresStateHandleStore, } from './store/postgres-state-handles.js';
|
|
24
38
|
export { RequestEventBuffer } from './store/request-event-buffer.js';
|
|
25
39
|
export { InMemoryRequestEventStore } from './store/request-events.js';
|
|
26
40
|
export { ensureRequestEventSchema, PostgresRequestEventStore, } from './store/request-events-postgres.js';
|
|
27
41
|
export { InMemoryUserAppLogStore, } from './store/user-app-logs.js';
|
|
28
|
-
export { CONFIG_NAME_PATTERN, DEPLOYMENT_ID_PATTERN, DOMAIN_PATTERN, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, resolveConfigScope, SLUG_PATTERN, scopeChain, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
42
|
+
export { CONFIG_NAME_PATTERN, DEPLOYMENT_ID_PATTERN, DOMAIN_PATTERN, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, resolveConfigScope, SLUG_PATTERN, scopeChain, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validatePositiveInteger, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
29
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,uBAAuB,GAQxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAML,mBAAmB,EAQnB,qBAAqB,EAOrB,cAAc,EAId,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EAWrB,kBAAkB,EAIlB,YAAY,EACZ,UAAU,EAKV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,2BAA2B,EAC3B,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
|
@@ -6,11 +6,14 @@ import type { AssetStore } from './assets.js';
|
|
|
6
6
|
import type { ControlPlaneSignupMode, DeployAuthGate } from './auth/deploy-gate.js';
|
|
7
7
|
import type { BuildInfo } from './build-info.js';
|
|
8
8
|
import type { CommercialPlanCatalog } from './commercial-plans.js';
|
|
9
|
+
import type { GitHubAppClient, GithubAppConfig } from './github/app-client.js';
|
|
10
|
+
import type { PendingGithubInstallationStore } from './github/pending-installations.js';
|
|
9
11
|
import type { LoadedServiceModule } from './modules/host.js';
|
|
10
12
|
import type { PolicyAssignmentStore, PolicyCounterStore } from './policy.js';
|
|
13
|
+
import type { AlertRuleStore } from './store/alert-rules.js';
|
|
11
14
|
import type { AuditSink } from './store/audit.js';
|
|
12
15
|
import type { UserAppLogStore } from './store/user-app-logs.js';
|
|
13
|
-
import type { ConfigStore, ControlPlaneStore } from './store.js';
|
|
16
|
+
import type { ConfigStore, ControlPlaneStore, GithubConnectionStore, GithubDeployRunStore } from './store.js';
|
|
14
17
|
export interface ServiceOptions {
|
|
15
18
|
/** Public base URL used to build returned endpoint URLs. Defaults to the request's Host header. */
|
|
16
19
|
readonly publicBaseUrl?: string;
|
|
@@ -107,6 +110,19 @@ export interface ServiceOptions {
|
|
|
107
110
|
* tiered by-plan retention is a later stage). Default 30.
|
|
108
111
|
*/
|
|
109
112
|
readonly requestEventRetentionDays?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Analytics alert-rule store (E2, ADR 0130). Backs the tenant `alerts` CRUD/test routes and the
|
|
115
|
+
* periodic evaluator. Default: in-memory in the handler; `serveService` selects Postgres when
|
|
116
|
+
* persistence is configured, else a `dataDir` JSON-file store, else in-memory (mirrors the
|
|
117
|
+
* request-event store selection).
|
|
118
|
+
*/
|
|
119
|
+
readonly alertRuleStore?: AlertRuleStore;
|
|
120
|
+
/**
|
|
121
|
+
* Dev/test-only carve-out allowing `http://localhost` / `http://127.0.0.1` / `[::1]` alert
|
|
122
|
+
* webhook targets (mirrors `customerVerifierAllowInsecureLocalhost`). Production leaves this
|
|
123
|
+
* unset: webhooks are https-only and delivery is SSRF-guarded (DNS-pinned public unicast).
|
|
124
|
+
*/
|
|
125
|
+
readonly alertWebhookAllowLoopback?: boolean;
|
|
110
126
|
/**
|
|
111
127
|
* The self-hosted authorization server issuer (OA-2) advertised in protected-resource metadata so an
|
|
112
128
|
* MCP client can discover where to authenticate. When unset, the metadata omits `authorization_servers`.
|
|
@@ -135,5 +151,35 @@ export interface ServiceOptions {
|
|
|
135
151
|
readonly deniedSignupSubjects?: readonly string[];
|
|
136
152
|
/** Boot-initialized service modules. Dynamic loading is owned by serveService, never request handlers. */
|
|
137
153
|
readonly loadedModules?: readonly LoadedServiceModule[];
|
|
154
|
+
/**
|
|
155
|
+
* GHD-1 repository-connection store (ADR 0111). Default: in-memory, useful for localhost tests only —
|
|
156
|
+
* `serveService` defaults to Postgres when persistence is enabled, else a `dataDir`-backed JSON-file
|
|
157
|
+
* store, else in-memory (mirrors `controlPlaneStore`/`configStore`).
|
|
158
|
+
*/
|
|
159
|
+
readonly githubConnectionStore?: GithubConnectionStore;
|
|
160
|
+
/**
|
|
161
|
+
* GHD-2 deploy-run store (ADR 0111 §6): webhook-accepted runs, replay-safe. Same backend-selection
|
|
162
|
+
* rule as `githubConnectionStore`.
|
|
163
|
+
*/
|
|
164
|
+
readonly githubDeployRunStore?: GithubDeployRunStore;
|
|
165
|
+
/**
|
|
166
|
+
* Non-secret Noodle Seed GitHub App identity (ADR 0111). Everything is optional — the whole GHD-1
|
|
167
|
+
* connection feature is off (install-url 409s) when absent. Long-lived credentials
|
|
168
|
+
* (`privateKeyPem`/`webhookSecret`) are read from the credential broker/secret manager by the caller,
|
|
169
|
+
* never stored in code, config files, or tests.
|
|
170
|
+
*/
|
|
171
|
+
readonly githubApp?: GithubAppConfig;
|
|
172
|
+
/**
|
|
173
|
+
* The GitHub App port (GHD-1): look up an installation and list its repositories. No live
|
|
174
|
+
* implementation ships in this slice — tests and local/dev use `InMemoryGitHubAppClient`; a JWT/
|
|
175
|
+
* installation-token-backed client is wired in a later slice once `githubApp`'s credentials are live.
|
|
176
|
+
*/
|
|
177
|
+
readonly githubAppClient?: GitHubAppClient;
|
|
178
|
+
/**
|
|
179
|
+
* GHD-1.4 CLI hand-off store: the installationId a landed GitHub App Setup URL redirect produced,
|
|
180
|
+
* keyed by the signed install-nonce `state`. In-memory single-flight state, not a durable record — see
|
|
181
|
+
* `github/pending-installations.ts`. Default: fresh in-memory store per `serveService` call.
|
|
182
|
+
*/
|
|
183
|
+
readonly pendingGithubInstallationStore?: PendingGithubInstallationStore;
|
|
138
184
|
}
|
|
139
185
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EACV,aAAa,EACb,MAAM,EACN,kBAAkB,EAClB,UAAU,EACX,MAAM,6BAA6B,CAAC;AACrC,O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,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7E;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9E,0FAA0F;IAC1F,QAAQ,CAAC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAC7C,4GAA4G;IAC5G,QAAQ,CAAC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACjD,sGAAsG;IACtG,QAAQ,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IACzD,6FAA6F;IAC7F,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,4GAA4G;IAC5G,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,0GAA0G;IAC1G,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACxD;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IACvD;;;OAGG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IACrD;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,8BAA8B,CAAC,EAAE,8BAA8B,CAAC;CAC1E"}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registry state operations that work over the {@link ServerRegistry}'s private maps: the no-store
|
|
3
|
-
* in-memory activation fallback and the app archive/restore/sweep cache reconciliation (ADR 0117).
|
|
4
|
-
* The registry passes a {@link RegistryStateView} of its private fields; store-backed calls hit the
|
|
5
|
-
* durable store first, then reconcile the in-process caches so no instance keeps serving stale state.
|
|
6
|
-
*/
|
|
7
1
|
import type { ServedTarget } from '@noodle-borg/transport-http';
|
|
8
|
-
import type { AppArchiveResult, AppRestoreResult, ArtifactStore, DeployRecord, TenantRef } from './store.js';
|
|
2
|
+
import type { AppArchiveResult, AppRestoreResult, AppSummary, ArtifactStore, DeploymentSummary, DeployRecord, EnvSummary, TenantRef } from './store.js';
|
|
9
3
|
export interface RegistryStateView {
|
|
10
4
|
readonly store: ArtifactStore | undefined;
|
|
11
5
|
readonly records: Map<string, DeployRecord>;
|
|
@@ -18,8 +12,35 @@ export declare function activateInMemory(records: Map<string, DeployRecord>, ref
|
|
|
18
12
|
readonly previousActive?: DeployRecord;
|
|
19
13
|
readonly alreadyActive: boolean;
|
|
20
14
|
} | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The active deploy record for a tenant, store-first then over the in-process cache (moved verbatim
|
|
17
|
+
* from `ServerRegistry.#activeRecord`). Store hits reconcile the caches so no instance serves stale
|
|
18
|
+
* state; the no-store path falls back to the newest matching record.
|
|
19
|
+
*/
|
|
20
|
+
export declare function activeRecord(state: RegistryStateView, ref: TenantRef): Promise<DeployRecord | undefined>;
|
|
21
|
+
/** {@link activeRecord} pinned to one server version (moved verbatim from `#activeRecordVersion`). */
|
|
22
|
+
export declare function activeRecordVersion(state: RegistryStateView, ref: TenantRef, serverVersion: string): Promise<DeployRecord | undefined>;
|
|
21
23
|
export declare function registryAppArchivedAt(state: RegistryStateView, org: string, app: string): Promise<string | undefined>;
|
|
22
24
|
export declare function registryArchiveApp(state: RegistryStateView, org: string, app: string, at: string): Promise<AppArchiveResult | undefined>;
|
|
23
25
|
export declare function registryRestoreApp(state: RegistryStateView, org: string, app: string): Promise<AppRestoreResult | undefined>;
|
|
24
26
|
export declare function registrySweepArchived(state: RegistryStateView, before: string): Promise<readonly DeployRecord[]>;
|
|
27
|
+
/** The `apps` resource, store-first with a no-store fallback over the registry's own record cache. */
|
|
28
|
+
export declare function registryListApps(state: RegistryStateView, org: string, opts: {
|
|
29
|
+
readonly includeArchived?: boolean;
|
|
30
|
+
readonly limit?: number;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
readonly apps: readonly AppSummary[];
|
|
33
|
+
readonly truncated: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function registryGetApp(state: RegistryStateView, org: string, app: string): Promise<AppSummary | undefined>;
|
|
36
|
+
/** The `envs` resource, store-first with a no-store fallback over the registry's own record cache. */
|
|
37
|
+
export declare function registryListEnvironments(state: RegistryStateView, org: string, app: string, opts: {
|
|
38
|
+
readonly includeArchived?: boolean;
|
|
39
|
+
}): Promise<readonly EnvSummary[]>;
|
|
40
|
+
export declare function registryGetEnvironment(state: RegistryStateView, org: string, app: string, env: string): Promise<EnvSummary | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* One deployment by id, scoped to `org`, store-first with a no-store fallback over the registry's own
|
|
43
|
+
* record cache. `undefined` both for an unknown id and for an id that belongs to a different org.
|
|
44
|
+
*/
|
|
45
|
+
export declare function registryGetDeployment(state: RegistryStateView, org: string, deploymentId: string): Promise<DeploymentSummary | undefined>;
|
|
25
46
|
//# sourceMappingURL=registry-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-state.d.ts","sourceRoot":"","sources":["../src/registry-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry-state.d.ts","sourceRoot":"","sources":["../src/registry-state.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAchE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,SAAS,EACV,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAA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B,GAAG,SAAS,CAAC,CAMxC"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Registry state operations that work over the {@link ServerRegistry}'s private maps: the no-store
|
|
3
|
+
* in-memory activation fallback and the app archive/restore/sweep cache reconciliation (ADR 0117).
|
|
4
|
+
* The registry passes a {@link RegistryStateView} of its private fields; store-backed calls hit the
|
|
5
|
+
* durable store first, then reconcile the in-process caches so no instance keeps serving stale state.
|
|
6
|
+
*/
|
|
7
|
+
import { normalizeServerVersion } from '@noodle-borg/module';
|
|
8
|
+
import { defaultActiveRecord } from './deployment-versioning.js';
|
|
9
|
+
import { recordMatchesTenant, tenantDeploymentKey, tenantKey } from './registry-targets.js';
|
|
10
|
+
import { appArchivedAt, deploymentSummary, paginateAppSummaries, planAppArchive, planAppRestore, summarizeApps, summarizeEnvs, withoutArchiveStamp, } from './store/records.js';
|
|
3
11
|
import { validateSlug } from './store/validate.js';
|
|
4
12
|
/** No-store activation fallback (moved verbatim from `ServerRegistry.#activateInMemory`). */
|
|
5
13
|
export function activateInMemory(records, ref, deploymentId) {
|
|
@@ -27,6 +35,52 @@ export function activateInMemory(records, ref, deploymentId) {
|
|
|
27
35
|
alreadyActive,
|
|
28
36
|
};
|
|
29
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The active deploy record for a tenant, store-first then over the in-process cache (moved verbatim
|
|
40
|
+
* from `ServerRegistry.#activeRecord`). Store hits reconcile the caches so no instance serves stale
|
|
41
|
+
* state; the no-store path falls back to the newest matching record.
|
|
42
|
+
*/
|
|
43
|
+
export async function activeRecord(state, ref) {
|
|
44
|
+
if (state.store) {
|
|
45
|
+
const record = await state.store.getActiveByTenant(ref);
|
|
46
|
+
if (record !== undefined) {
|
|
47
|
+
state.records.set(record.deploymentId, record);
|
|
48
|
+
state.activeTenants.set(tenantDeploymentKey(ref, record.serverVersion), record.deploymentId);
|
|
49
|
+
}
|
|
50
|
+
return record;
|
|
51
|
+
}
|
|
52
|
+
const cachedId = state.activeTenants.get(tenantKey(ref));
|
|
53
|
+
if (cachedId !== undefined) {
|
|
54
|
+
const cached = state.records.get(cachedId);
|
|
55
|
+
if (cached !== undefined && cached.archivedAt === undefined)
|
|
56
|
+
return cached;
|
|
57
|
+
}
|
|
58
|
+
return defaultActiveRecord([...state.records.values()], ref);
|
|
59
|
+
}
|
|
60
|
+
/** {@link activeRecord} pinned to one server version (moved verbatim from `#activeRecordVersion`). */
|
|
61
|
+
export async function activeRecordVersion(state, ref, serverVersion) {
|
|
62
|
+
const safeServerVersion = normalizeServerVersion(serverVersion);
|
|
63
|
+
if (state.store) {
|
|
64
|
+
const record = await state.store.getActiveByTenantVersion(ref, safeServerVersion);
|
|
65
|
+
if (record !== undefined) {
|
|
66
|
+
state.records.set(record.deploymentId, record);
|
|
67
|
+
state.activeTenants.set(tenantDeploymentKey(ref, safeServerVersion), record.deploymentId);
|
|
68
|
+
}
|
|
69
|
+
return record;
|
|
70
|
+
}
|
|
71
|
+
const cachedId = state.activeTenants.get(tenantDeploymentKey(ref, safeServerVersion));
|
|
72
|
+
if (cachedId !== undefined) {
|
|
73
|
+
const cached = state.records.get(cachedId);
|
|
74
|
+
if (cached !== undefined && cached.archivedAt === undefined)
|
|
75
|
+
return cached;
|
|
76
|
+
}
|
|
77
|
+
return [...state.records.values()]
|
|
78
|
+
.filter((record) => record.active &&
|
|
79
|
+
record.archivedAt === undefined &&
|
|
80
|
+
recordMatchesTenant(record, ref) &&
|
|
81
|
+
record.serverVersion === safeServerVersion)
|
|
82
|
+
.sort((a, b) => b.deploymentVersion - a.deploymentVersion)[0];
|
|
83
|
+
}
|
|
30
84
|
export function registryAppArchivedAt(state, org, app) {
|
|
31
85
|
const safeOrg = validateSlug('org', org);
|
|
32
86
|
const safeApp = validateSlug('app', app);
|
|
@@ -80,8 +134,67 @@ export async function registrySweepArchived(state, before) {
|
|
|
80
134
|
purgeActiveTenantEntries(state, ids);
|
|
81
135
|
return deleted;
|
|
82
136
|
}
|
|
137
|
+
/** The `apps` resource, store-first with a no-store fallback over the registry's own record cache. */
|
|
138
|
+
export function registryListApps(state, org, opts) {
|
|
139
|
+
const safeOrg = validateSlug('org', org);
|
|
140
|
+
if (state.store !== undefined)
|
|
141
|
+
return state.store.listApps(safeOrg, opts);
|
|
142
|
+
const records = appRecordsFromMap(state.records, safeOrg).map(deploymentSummary);
|
|
143
|
+
const summarized = summarizeApps(safeOrg, records, [], {
|
|
144
|
+
includeArchived: opts.includeArchived ?? false,
|
|
145
|
+
});
|
|
146
|
+
return Promise.resolve(paginateAppSummaries(summarized, opts.limit));
|
|
147
|
+
}
|
|
148
|
+
export function registryGetApp(state, org, app) {
|
|
149
|
+
const safeOrg = validateSlug('org', org);
|
|
150
|
+
const safeApp = validateSlug('app', app);
|
|
151
|
+
if (state.store !== undefined)
|
|
152
|
+
return state.store.getApp(safeOrg, safeApp);
|
|
153
|
+
const records = appRecordsFromMap(state.records, safeOrg, safeApp).map(deploymentSummary);
|
|
154
|
+
if (records.length === 0)
|
|
155
|
+
return Promise.resolve(undefined);
|
|
156
|
+
return Promise.resolve(summarizeApps(safeOrg, records, [], { includeArchived: true })[0]);
|
|
157
|
+
}
|
|
158
|
+
/** The `envs` resource, store-first with a no-store fallback over the registry's own record cache. */
|
|
159
|
+
export function registryListEnvironments(state, org, app, opts) {
|
|
160
|
+
const safeOrg = validateSlug('org', org);
|
|
161
|
+
const safeApp = validateSlug('app', app);
|
|
162
|
+
if (state.store !== undefined)
|
|
163
|
+
return state.store.listEnvironments(safeOrg, safeApp, opts);
|
|
164
|
+
const records = appRecordsFromMap(state.records, safeOrg, safeApp).map(deploymentSummary);
|
|
165
|
+
return Promise.resolve(summarizeEnvs(safeOrg, safeApp, records, [], {
|
|
166
|
+
includeArchived: opts.includeArchived ?? false,
|
|
167
|
+
}));
|
|
168
|
+
}
|
|
169
|
+
export function registryGetEnvironment(state, org, app, env) {
|
|
170
|
+
const safeOrg = validateSlug('org', org);
|
|
171
|
+
const safeApp = validateSlug('app', app);
|
|
172
|
+
const safeEnv = validateSlug('env', env);
|
|
173
|
+
if (state.store !== undefined)
|
|
174
|
+
return state.store.getEnvironment(safeOrg, safeApp, safeEnv);
|
|
175
|
+
const records = appRecordsFromMap(state.records, safeOrg, safeApp)
|
|
176
|
+
.filter((record) => record.environment === safeEnv)
|
|
177
|
+
.map(deploymentSummary);
|
|
178
|
+
if (records.length === 0)
|
|
179
|
+
return Promise.resolve(undefined);
|
|
180
|
+
return Promise.resolve(summarizeEnvs(safeOrg, safeApp, records, [], { includeArchived: true })[0]);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* One deployment by id, scoped to `org`, store-first with a no-store fallback over the registry's own
|
|
184
|
+
* record cache. `undefined` both for an unknown id and for an id that belongs to a different org.
|
|
185
|
+
*/
|
|
186
|
+
export function registryGetDeployment(state, org, deploymentId) {
|
|
187
|
+
const safeOrg = validateSlug('org', org);
|
|
188
|
+
if (state.store !== undefined)
|
|
189
|
+
return state.store.getDeployment(safeOrg, deploymentId);
|
|
190
|
+
const record = state.records.get(deploymentId);
|
|
191
|
+
if (record === undefined || record.orgSlug !== safeOrg)
|
|
192
|
+
return Promise.resolve(undefined);
|
|
193
|
+
return Promise.resolve(deploymentSummary(record));
|
|
194
|
+
}
|
|
195
|
+
/** Every record for `org`, optionally narrowed to one `app` (omit to scan the whole org). */
|
|
83
196
|
function appRecordsFromMap(records, org, app) {
|
|
84
|
-
return [...records.values()].filter((record) => record.orgSlug === org && record.appSlug === app);
|
|
197
|
+
return [...records.values()].filter((record) => record.orgSlug === org && (app === undefined || record.appSlug === app));
|
|
85
198
|
}
|
|
86
199
|
/**
|
|
87
200
|
* Stamp cached records and drop the app's active-tenant pointers so this instance stops serving
|