@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,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `envs` resource commands: `noodle envs list` / `noodle envs inspect`. Read-only, org- and
|
|
3
|
+
* app-scoped views over the hosted `GET /v1/orgs/{org}/apps/{app}/envs[/{env}]` routes (see
|
|
4
|
+
* `packages/service/src/routes/envs.ts`); each `EnvSummary` narrows the app aggregation to one
|
|
5
|
+
* environment. The wire types, target resolution, failure builders, and branded table styling live
|
|
6
|
+
* in `resource-shared.ts` (`envs` parses its own `--app` flag, below); the interactive org/app/env
|
|
7
|
+
* pickers for an unresolved target live in `target-picker.ts`.
|
|
8
|
+
*/
|
|
9
|
+
import { readConfig } from '../config.js';
|
|
10
|
+
import { resolveControlPlaneToken, ServiceRequestError, serviceJson } from '../control-plane.js';
|
|
11
|
+
import { readProjectLink } from '../project.js';
|
|
12
|
+
import { relativeTime } from '../relative-time.js';
|
|
13
|
+
import { renderTable } from '../table.js';
|
|
14
|
+
import { EXIT, printJsonOk } from './output.js';
|
|
15
|
+
import { ACCESS_CHIP_COLORS, ACTIVE_GREEN, authRequired, DIM_GRAY, notFoundApp, notFoundEnv, stdoutTableOptions, } from './resource-shared.js';
|
|
16
|
+
import { printCliFailure, resolveTenantTarget, serviceFailure, usage } from './shared.js';
|
|
17
|
+
import { pickAppInteractively, pickEnvInteractively, pickOrgInteractively, } from './target-picker.js';
|
|
18
|
+
export async function runEnvs(rest, env, home) {
|
|
19
|
+
const [subcommand, ...tail] = rest;
|
|
20
|
+
if (subcommand === 'list')
|
|
21
|
+
return runEnvsList(tail, env, home);
|
|
22
|
+
if (subcommand === 'inspect')
|
|
23
|
+
return runEnvsInspect(tail, env, home);
|
|
24
|
+
usage();
|
|
25
|
+
return EXIT.USAGE;
|
|
26
|
+
}
|
|
27
|
+
function parseCommonEnvsArgs(rest) {
|
|
28
|
+
let org;
|
|
29
|
+
let app;
|
|
30
|
+
let service;
|
|
31
|
+
let authToken;
|
|
32
|
+
let json = false;
|
|
33
|
+
let archived = false;
|
|
34
|
+
const positional = [];
|
|
35
|
+
for (let i = 0; i < rest.length; i++) {
|
|
36
|
+
const arg = rest[i];
|
|
37
|
+
if (arg === '--org')
|
|
38
|
+
org = rest[++i];
|
|
39
|
+
else if (arg === '--app')
|
|
40
|
+
app = rest[++i];
|
|
41
|
+
else if (arg === '--service')
|
|
42
|
+
service = rest[++i];
|
|
43
|
+
else if (arg === '--auth-token')
|
|
44
|
+
authToken = rest[++i];
|
|
45
|
+
else if (arg === '--json')
|
|
46
|
+
json = true;
|
|
47
|
+
else if (arg === '--archived')
|
|
48
|
+
archived = true;
|
|
49
|
+
else if (arg !== undefined)
|
|
50
|
+
positional.push(arg);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
common: {
|
|
54
|
+
...(org !== undefined ? { org } : {}),
|
|
55
|
+
...(app !== undefined ? { app } : {}),
|
|
56
|
+
...(service !== undefined ? { service } : {}),
|
|
57
|
+
...(authToken !== undefined ? { authToken } : {}),
|
|
58
|
+
json,
|
|
59
|
+
archived,
|
|
60
|
+
},
|
|
61
|
+
positional,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resolve org/app the same way `resolveTenantTarget` does (flag > link > config), but without
|
|
66
|
+
* failing when one is still missing — the caller uses this to know which picker(s) to attempt
|
|
67
|
+
* before falling back to `resolveTenantTarget`'s combined `target_required` failure.
|
|
68
|
+
*/
|
|
69
|
+
function partialEnvsTarget(common, home) {
|
|
70
|
+
const project = readProjectLink();
|
|
71
|
+
const config = readConfig(home);
|
|
72
|
+
const org = common.org ?? project?.org ?? config.defaultOrg;
|
|
73
|
+
const app = common.app ?? project?.app ?? config.defaultApp;
|
|
74
|
+
const serviceUrl = common.service ?? project?.serviceUrl ?? config.serviceUrl;
|
|
75
|
+
return {
|
|
76
|
+
...(org !== undefined ? { org } : {}),
|
|
77
|
+
...(app !== undefined ? { app } : {}),
|
|
78
|
+
...(serviceUrl !== undefined ? { serviceUrl } : {}),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// --- list ----------------------------------------------------------------------
|
|
82
|
+
export async function runEnvsList(rest, env, home) {
|
|
83
|
+
const { common } = parseCommonEnvsArgs(rest);
|
|
84
|
+
const target = resolveTenantTarget({
|
|
85
|
+
...(common.org !== undefined ? { org: common.org } : {}),
|
|
86
|
+
...(common.app !== undefined ? { app: common.app } : {}),
|
|
87
|
+
}, home);
|
|
88
|
+
const partial = partialEnvsTarget(common, home);
|
|
89
|
+
const resolved = await resolveControlPlaneToken({
|
|
90
|
+
serviceFlag: common.service ?? (target.ok ? target.serviceUrl : partial.serviceUrl),
|
|
91
|
+
authFlag: common.authToken,
|
|
92
|
+
env,
|
|
93
|
+
home,
|
|
94
|
+
});
|
|
95
|
+
let org;
|
|
96
|
+
let app;
|
|
97
|
+
if (target.ok) {
|
|
98
|
+
org = target.org;
|
|
99
|
+
app = target.app;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
let pickedOrg = partial.org;
|
|
103
|
+
let pickedApp = partial.app;
|
|
104
|
+
if (pickedOrg === undefined) {
|
|
105
|
+
pickedOrg = await pickOrgInteractively(resolved, common.json, (o) => `noodle envs list --org ${o}`);
|
|
106
|
+
}
|
|
107
|
+
if (pickedOrg !== undefined && pickedApp === undefined) {
|
|
108
|
+
const resolvedOrg = pickedOrg;
|
|
109
|
+
pickedApp = await pickAppInteractively(resolved, resolvedOrg, common.json, (a) => `noodle envs list --org ${resolvedOrg} --app ${a}`);
|
|
110
|
+
}
|
|
111
|
+
if (pickedOrg === undefined || pickedApp === undefined) {
|
|
112
|
+
return printCliFailure('envs', target.error, common.json);
|
|
113
|
+
}
|
|
114
|
+
org = pickedOrg;
|
|
115
|
+
app = pickedApp;
|
|
116
|
+
}
|
|
117
|
+
if (resolved.token === undefined)
|
|
118
|
+
return printCliFailure('envs', authRequired(), common.json);
|
|
119
|
+
try {
|
|
120
|
+
const url = new URL(`${resolved.serviceUrl}/v1/orgs/${encodeURIComponent(org)}` +
|
|
121
|
+
`/apps/${encodeURIComponent(app)}/envs`);
|
|
122
|
+
if (common.archived)
|
|
123
|
+
url.searchParams.set('archived', 'true');
|
|
124
|
+
const body = await serviceJson(url.toString(), resolved.token);
|
|
125
|
+
if (common.json) {
|
|
126
|
+
printJsonOk(body.data);
|
|
127
|
+
return EXIT.OK;
|
|
128
|
+
}
|
|
129
|
+
if (body.data.envs.length === 0) {
|
|
130
|
+
console.log(`No environments for ${org}/${app}. Deploy with \`noodle deploy\`.`);
|
|
131
|
+
return EXIT.OK;
|
|
132
|
+
}
|
|
133
|
+
console.log(renderEnvsTable(body.data.envs, stdoutTableOptions()));
|
|
134
|
+
return EXIT.OK;
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
if (error instanceof ServiceRequestError && error.status === 404) {
|
|
138
|
+
return printCliFailure('envs', notFoundApp(org, app), common.json);
|
|
139
|
+
}
|
|
140
|
+
return printCliFailure('envs', serviceFailure('envs', error, 'noodle doctor'), common.json);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// --- inspect -------------------------------------------------------------------
|
|
144
|
+
export async function runEnvsInspect(rest, env, home) {
|
|
145
|
+
const { common, positional } = parseCommonEnvsArgs(rest);
|
|
146
|
+
let envName = positional[0];
|
|
147
|
+
const target = resolveTenantTarget({
|
|
148
|
+
...(common.org !== undefined ? { org: common.org } : {}),
|
|
149
|
+
...(common.app !== undefined ? { app: common.app } : {}),
|
|
150
|
+
}, home);
|
|
151
|
+
if (!target.ok) {
|
|
152
|
+
if (envName === undefined) {
|
|
153
|
+
usage();
|
|
154
|
+
return EXIT.USAGE;
|
|
155
|
+
}
|
|
156
|
+
return printCliFailure('envs', target.error, common.json);
|
|
157
|
+
}
|
|
158
|
+
const resolved = await resolveControlPlaneToken({
|
|
159
|
+
serviceFlag: common.service ?? target.serviceUrl,
|
|
160
|
+
authFlag: common.authToken,
|
|
161
|
+
env,
|
|
162
|
+
home,
|
|
163
|
+
});
|
|
164
|
+
if (envName === undefined) {
|
|
165
|
+
const picked = await pickEnvInteractively(resolved, target.org, target.app, common.json, (e) => `noodle envs inspect ${e} --org ${target.org} --app ${target.app}`);
|
|
166
|
+
if (picked === undefined) {
|
|
167
|
+
usage();
|
|
168
|
+
return EXIT.USAGE;
|
|
169
|
+
}
|
|
170
|
+
envName = picked;
|
|
171
|
+
}
|
|
172
|
+
if (resolved.token === undefined)
|
|
173
|
+
return printCliFailure('envs', authRequired(), common.json);
|
|
174
|
+
try {
|
|
175
|
+
const url = `${resolved.serviceUrl}/v1/orgs/${encodeURIComponent(target.org)}` +
|
|
176
|
+
`/apps/${encodeURIComponent(target.app)}/envs/${encodeURIComponent(envName)}`;
|
|
177
|
+
const body = await serviceJson(url, resolved.token);
|
|
178
|
+
if (common.json) {
|
|
179
|
+
printJsonOk(body.data);
|
|
180
|
+
return EXIT.OK;
|
|
181
|
+
}
|
|
182
|
+
printEnvDetail(target.org, target.app, body.data);
|
|
183
|
+
return EXIT.OK;
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
if (error instanceof ServiceRequestError && error.status === 404) {
|
|
187
|
+
return printCliFailure('envs', notFoundEnv(target.org, target.app, envName), common.json);
|
|
188
|
+
}
|
|
189
|
+
return printCliFailure('envs', serviceFailure('envs', error, 'noodle envs list'), common.json);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function printEnvDetail(org, app, envSummary) {
|
|
193
|
+
console.log(`env: ${envSummary.envName}`);
|
|
194
|
+
console.log(`org: ${org}`);
|
|
195
|
+
console.log(`app: ${app}`);
|
|
196
|
+
console.log(`access: ${envSummary.accessMode ?? '—'}`);
|
|
197
|
+
console.log(`active: ${envSummary.active ? 'yes' : 'no'}`);
|
|
198
|
+
console.log(`deploys: ${envSummary.deploymentCount}`);
|
|
199
|
+
console.log(`created: ${envSummary.createdAt}`);
|
|
200
|
+
console.log(`updated: ${envSummary.lastActivityAt ?? '—'}`);
|
|
201
|
+
if (envSummary.latest !== undefined) {
|
|
202
|
+
const version = envSummary.latest.serverVersion !== undefined ? ` (v${envSummary.latest.serverVersion})` : '';
|
|
203
|
+
console.log(`latest: ${envSummary.latest.deploymentId}${version}`);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
console.log('latest: no deploys');
|
|
207
|
+
}
|
|
208
|
+
if (envSummary.archivedAt !== undefined)
|
|
209
|
+
console.log(`archived: ${envSummary.archivedAt}`);
|
|
210
|
+
}
|
|
211
|
+
// --- table rendering -----------------------------------------------------------
|
|
212
|
+
const ENVS_COLUMNS = [
|
|
213
|
+
{ header: 'ENV', get: (e) => e.envName },
|
|
214
|
+
{
|
|
215
|
+
header: 'STATUS',
|
|
216
|
+
get: (e) => (e.latest === undefined ? 'no deploys' : e.active ? 'active' : 'inactive'),
|
|
217
|
+
color: (e) => (e.latest !== undefined && e.active ? ACTIVE_GREEN : DIM_GRAY),
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
header: 'ACCESS',
|
|
221
|
+
get: (e) => e.accessMode ?? '—',
|
|
222
|
+
color: (e) => (e.accessMode !== undefined ? ACCESS_CHIP_COLORS[e.accessMode] : undefined),
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
header: 'DEPLOYS',
|
|
226
|
+
get: (e) => String(e.deploymentCount),
|
|
227
|
+
align: 'right',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
header: 'UPDATED',
|
|
231
|
+
get: (e) => (e.lastActivityAt !== undefined ? relativeTime(e.lastActivityAt) : '—'),
|
|
232
|
+
align: 'right',
|
|
233
|
+
color: (e) => (e.lastActivityAt === undefined ? DIM_GRAY : undefined),
|
|
234
|
+
},
|
|
235
|
+
];
|
|
236
|
+
/** Render the `envs list` table. Exported so tests (and the contract drift gate) can call it directly. */
|
|
237
|
+
export function renderEnvsTable(envs, opts) {
|
|
238
|
+
return renderTable(ENVS_COLUMNS, envs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AC,UAAU,IAAI,GAAG;QAC/B,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;KAC1F;IACD;QACE,MAAM,EAAE,SAAS;QACjB,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;QACrC,KAAK,EAAE,OAAO;KACf;IACD;QACE,MAAM,EAAE,SAAS;QACjB,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACnF,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;KACtE;CACF,CAAC;AAEF,0GAA0G;AAC1G,MAAM,UAAU,eAAe,CAAC,IAA2B,EAAE,IAAkB;IAC7E,OAAO,WAAW,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface GithubConnectDeps {
|
|
2
|
+
/** Injectable browser opener seam (tests spy/inject; production defaults to the real `open`/`xdg-open`). */
|
|
3
|
+
readonly openBrowser?: (url: string) => void | Promise<void>;
|
|
4
|
+
/** Poll interval for the install hand-off. Default 2000ms. */
|
|
5
|
+
readonly pollIntervalMs?: number;
|
|
6
|
+
/** Total time to wait for the browser install to land before giving up. Default 5 minutes. */
|
|
7
|
+
readonly pollTimeoutMs?: number;
|
|
8
|
+
/** Injectable sleep, so tests never depend on real timers. */
|
|
9
|
+
readonly sleep?: (ms: number) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare function runGithubConnect(rest: readonly string[], env: NodeJS.ProcessEnv, home: string, deps?: GithubConnectDeps): Promise<number>;
|
|
12
|
+
export declare function runGithubStatus(rest: readonly string[], env: NodeJS.ProcessEnv, home: string): Promise<number>;
|
|
13
|
+
export declare function runGithubDisconnect(rest: readonly string[], env: NodeJS.ProcessEnv, home: string): Promise<number>;
|
|
14
|
+
export declare function runGithub(rest: readonly string[], env: NodeJS.ProcessEnv, home: string): Promise<number>;
|
|
15
|
+
//# sourceMappingURL=github-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-ops.d.ts","sourceRoot":"","sources":["../../src/commands/github-ops.ts"],"names":[],"mappings":"AAoCA,MAAM,WAAW,iBAAiB;IAChC,4GAA4G;IAC5G,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,8DAA8D;IAC9D,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,8FAA8F;IAC9F,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAyCD,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAwIjB;AAID,wBAAsB,eAAe,CACnC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAsEjB;AAID,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAgEjB;AAID,wBAAsB,SAAS,CAC7B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `noodle github connect|status|disconnect` (GHD-1.4): browser-driven GitHub App installation plus the
|
|
3
|
+
* service-backed repository-connection APIs (`packages/service/src/routes/github-connection.ts` +
|
|
4
|
+
* `github-setup.ts`). `connect` never writes any local state before its final `POST .../github/connection`
|
|
5
|
+
* call — every earlier step (install-url, opening the browser, polling, claiming) is read-only or lives
|
|
6
|
+
* entirely in the service's short-lived nonce/pending state, so a Ctrl-C at any point before that last
|
|
7
|
+
* network call leaves nothing to clean up locally or remotely. Wire types, target resolution, arg
|
|
8
|
+
* parsing, and the failure builders live in the sibling `github-shared.ts`.
|
|
9
|
+
*/
|
|
10
|
+
import { resolveControlPlaneToken, ServiceRequestError, serviceJson } from '../control-plane.js';
|
|
11
|
+
import { AbortPromptError, confirm, isInteractive, select } from '../prompts.js';
|
|
12
|
+
import { relativeTime } from '../relative-time.js';
|
|
13
|
+
import { printStep } from '../status.js';
|
|
14
|
+
import { openUrl, shouldOpenBrowser } from './deploy-ops.js';
|
|
15
|
+
import { runGithubRuns } from './github-runs-ops.js';
|
|
16
|
+
import { authRequired, conflictFailure, githubAppNotConfiguredFailure, installTimeoutFailure, missingRepoAnswerFailure, noRepositoriesFailure, ownerRoleFailure, parseGithubArgs, repoNotFoundFailure, resolveGithubTarget, serviceErrorFailure, } from './github-shared.js';
|
|
17
|
+
import { EXIT, printJsonOk } from './output.js';
|
|
18
|
+
import { dimText } from './resource-shared.js';
|
|
19
|
+
import { printCliFailure } from './shared.js';
|
|
20
|
+
const DEFAULT_POLL_INTERVAL_MS = 2000;
|
|
21
|
+
const DEFAULT_POLL_TIMEOUT_MS = 5 * 60 * 1000;
|
|
22
|
+
function defaultSleep(ms) {
|
|
23
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Poll `GET /v1/github/installations/pending?state=` until the browser install flow lands the GitHub
|
|
27
|
+
* Setup URL redirect on the service (`packages/service/src/routes/github-setup.ts` stores the
|
|
28
|
+
* installationId keyed by the signed state nonce). 404 = not landed yet, keep polling; anything else
|
|
29
|
+
* propagates. Resolves `undefined` on timeout.
|
|
30
|
+
*/
|
|
31
|
+
async function pollPendingInstallation(serviceUrl, token, state, opts) {
|
|
32
|
+
const deadline = Date.now() + opts.timeoutMs;
|
|
33
|
+
for (;;) {
|
|
34
|
+
try {
|
|
35
|
+
const body = await serviceJson(`${serviceUrl}/v1/github/installations/pending?state=${encodeURIComponent(state)}`, token);
|
|
36
|
+
return body.data.installationId;
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (!(error instanceof ServiceRequestError) || error.status !== 404)
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
if (Date.now() >= deadline)
|
|
43
|
+
return undefined;
|
|
44
|
+
await opts.sleep(opts.intervalMs);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export async function runGithubConnect(rest, env, home, deps = {}) {
|
|
48
|
+
const args = parseGithubArgs(rest);
|
|
49
|
+
const json = args.json;
|
|
50
|
+
const resolved = resolveGithubTarget(args, home);
|
|
51
|
+
if (!resolved.ok)
|
|
52
|
+
return printCliFailure('github', resolved.error, json);
|
|
53
|
+
const { org, app, source } = resolved.target;
|
|
54
|
+
if (!json)
|
|
55
|
+
printStep('done', `Target: ${org}/${app} (from ${source})`);
|
|
56
|
+
const tokenResolution = await resolveControlPlaneToken({
|
|
57
|
+
serviceFlag: args.service ?? resolved.target.serviceUrl,
|
|
58
|
+
authFlag: args.authToken,
|
|
59
|
+
env,
|
|
60
|
+
home,
|
|
61
|
+
});
|
|
62
|
+
if (tokenResolution.token === undefined)
|
|
63
|
+
return printCliFailure('github', authRequired(), json);
|
|
64
|
+
const { serviceUrl, token } = tokenResolution;
|
|
65
|
+
let installUrl;
|
|
66
|
+
let state;
|
|
67
|
+
try {
|
|
68
|
+
const body = await serviceJson(`${serviceUrl}/v1/github/install-url?org=${encodeURIComponent(org)}&app=${encodeURIComponent(app)}`, token);
|
|
69
|
+
installUrl = body.data.installUrl;
|
|
70
|
+
state = body.data.state;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (error instanceof ServiceRequestError && error.status === 409) {
|
|
74
|
+
return printCliFailure('github', githubAppNotConfiguredFailure(), json);
|
|
75
|
+
}
|
|
76
|
+
return printCliFailure('github', serviceErrorFailure('noodle github connect', error), json);
|
|
77
|
+
}
|
|
78
|
+
if (!json) {
|
|
79
|
+
printStep('done', 'Opening GitHub to install Noodle Seed Deploys…');
|
|
80
|
+
console.log(dimText(installUrl, process.stdout));
|
|
81
|
+
}
|
|
82
|
+
const opener = deps.openBrowser ?? ((url) => (shouldOpenBrowser(env) ? openUrl(url) : undefined));
|
|
83
|
+
await Promise.resolve(opener(installUrl));
|
|
84
|
+
let landed;
|
|
85
|
+
try {
|
|
86
|
+
landed = await pollPendingInstallation(serviceUrl, token, state, {
|
|
87
|
+
intervalMs: deps.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS,
|
|
88
|
+
timeoutMs: deps.pollTimeoutMs ?? DEFAULT_POLL_TIMEOUT_MS,
|
|
89
|
+
sleep: deps.sleep ?? defaultSleep,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return printCliFailure('github', serviceErrorFailure('noodle github connect', error), json);
|
|
94
|
+
}
|
|
95
|
+
if (landed === undefined)
|
|
96
|
+
return printCliFailure('github', installTimeoutFailure(), json);
|
|
97
|
+
// The claim body carries only the state: the service derives the installationId from the landed
|
|
98
|
+
// setup redirect itself and returns it — a client-supplied id is never trusted.
|
|
99
|
+
let repos;
|
|
100
|
+
let installationId;
|
|
101
|
+
try {
|
|
102
|
+
const claimBody = await serviceJson(`${serviceUrl}/v1/github/installations/claim`, token, {
|
|
103
|
+
method: 'POST',
|
|
104
|
+
headers: { 'content-type': 'application/json' },
|
|
105
|
+
body: JSON.stringify({ state }),
|
|
106
|
+
});
|
|
107
|
+
repos = claimBody.data.repositories;
|
|
108
|
+
installationId = claimBody.data.installationId;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
if (error instanceof ServiceRequestError && error.status === 403) {
|
|
112
|
+
return printCliFailure('github', ownerRoleFailure(org), json);
|
|
113
|
+
}
|
|
114
|
+
return printCliFailure('github', serviceErrorFailure('noodle github connect', error), json);
|
|
115
|
+
}
|
|
116
|
+
let chosen;
|
|
117
|
+
if (args.repo !== undefined) {
|
|
118
|
+
const match = repos.find((r) => r.fullName === args.repo);
|
|
119
|
+
if (match === undefined)
|
|
120
|
+
return printCliFailure('github', repoNotFoundFailure(args.repo, repos), json);
|
|
121
|
+
chosen = match;
|
|
122
|
+
}
|
|
123
|
+
else if (repos.length === 0) {
|
|
124
|
+
return printCliFailure('github', noRepositoriesFailure(), json);
|
|
125
|
+
}
|
|
126
|
+
else if (repos.length === 1) {
|
|
127
|
+
chosen = repos[0];
|
|
128
|
+
if (!json)
|
|
129
|
+
printStep('done', `Repository: ${chosen.fullName} (only repository in this installation)`);
|
|
130
|
+
}
|
|
131
|
+
else if (json || !isInteractive()) {
|
|
132
|
+
return printCliFailure('github', missingRepoAnswerFailure(repos), json);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
const options = repos.map((r) => ({
|
|
136
|
+
value: r,
|
|
137
|
+
label: r.fullName,
|
|
138
|
+
}));
|
|
139
|
+
try {
|
|
140
|
+
chosen = await select('Which repository?', options);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (error instanceof AbortPromptError) {
|
|
144
|
+
console.error('github connect: cancelled');
|
|
145
|
+
return EXIT.USAGE;
|
|
146
|
+
}
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
let record;
|
|
151
|
+
try {
|
|
152
|
+
const connectBody = await serviceJson(`${serviceUrl}/v1/orgs/${encodeURIComponent(org)}/apps/${encodeURIComponent(app)}/github/connection`, token, {
|
|
153
|
+
method: 'POST',
|
|
154
|
+
headers: { 'content-type': 'application/json' },
|
|
155
|
+
body: JSON.stringify({ installationId, githubRepositoryId: chosen.id }),
|
|
156
|
+
});
|
|
157
|
+
record = connectBody.data;
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
if (error instanceof ServiceRequestError) {
|
|
161
|
+
if (error.status === 403)
|
|
162
|
+
return printCliFailure('github', ownerRoleFailure(org), json);
|
|
163
|
+
if (error.status === 409)
|
|
164
|
+
return printCliFailure('github', conflictFailure(org, app, error.message), json);
|
|
165
|
+
}
|
|
166
|
+
return printCliFailure('github', serviceErrorFailure('noodle github connect', error), json);
|
|
167
|
+
}
|
|
168
|
+
if (json) {
|
|
169
|
+
printJsonOk(record);
|
|
170
|
+
return EXIT.OK;
|
|
171
|
+
}
|
|
172
|
+
printStep('done', `Connected ${record.repoName} → ${org}/${app}`);
|
|
173
|
+
console.log(`repo: ${record.repoName}`);
|
|
174
|
+
console.log(`branch: ${record.defaultBranch} → prod`);
|
|
175
|
+
console.log('PRs: pr-{number} preview environments (activates with deploy-on-push rollout)');
|
|
176
|
+
console.log('Next: git push deploys once rollout completes — check with noodle github status');
|
|
177
|
+
return EXIT.OK;
|
|
178
|
+
}
|
|
179
|
+
// --- status --------------------------------------------------------------------------------------
|
|
180
|
+
export async function runGithubStatus(rest, env, home) {
|
|
181
|
+
const args = parseGithubArgs(rest);
|
|
182
|
+
const json = args.json;
|
|
183
|
+
const resolved = resolveGithubTarget(args, home);
|
|
184
|
+
if (!resolved.ok)
|
|
185
|
+
return printCliFailure('github', resolved.error, json);
|
|
186
|
+
const { org, app } = resolved.target;
|
|
187
|
+
const tokenResolution = await resolveControlPlaneToken({
|
|
188
|
+
serviceFlag: args.service ?? resolved.target.serviceUrl,
|
|
189
|
+
authFlag: args.authToken,
|
|
190
|
+
env,
|
|
191
|
+
home,
|
|
192
|
+
});
|
|
193
|
+
if (tokenResolution.token === undefined)
|
|
194
|
+
return printCliFailure('github', authRequired(), json);
|
|
195
|
+
const { serviceUrl, token } = tokenResolution;
|
|
196
|
+
try {
|
|
197
|
+
const body = await serviceJson(`${serviceUrl}/v1/orgs/${encodeURIComponent(org)}/apps/${encodeURIComponent(app)}/github/connection`, token);
|
|
198
|
+
const record = body.data;
|
|
199
|
+
// Best-effort last-run line (GHD-2): the runs feed exists now, so status can surface it. A read
|
|
200
|
+
// failure here must never break status itself.
|
|
201
|
+
let lastRun;
|
|
202
|
+
try {
|
|
203
|
+
const runsBody = await serviceJson(`${serviceUrl}/v1/orgs/${encodeURIComponent(org)}/apps/${encodeURIComponent(app)}/github/runs?limit=1`, token);
|
|
204
|
+
lastRun = runsBody.data.runs[0];
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
lastRun = undefined;
|
|
208
|
+
}
|
|
209
|
+
if (json) {
|
|
210
|
+
printJsonOk({
|
|
211
|
+
connected: true,
|
|
212
|
+
connection: record,
|
|
213
|
+
...(lastRun !== undefined ? { lastRun } : {}),
|
|
214
|
+
});
|
|
215
|
+
return EXIT.OK;
|
|
216
|
+
}
|
|
217
|
+
console.log(`repo: ${record.repoName} #${record.githubRepositoryId}`);
|
|
218
|
+
console.log(`target: ${org}/${app}`);
|
|
219
|
+
console.log(`branch: ${record.defaultBranch} → prod`);
|
|
220
|
+
console.log('state: connected');
|
|
221
|
+
console.log(`installation: ${record.installationId}`);
|
|
222
|
+
console.log(lastRun !== undefined
|
|
223
|
+
? `last run: ${lastRun.commitSha.slice(0, 7)} → ${lastRun.envName} (${lastRun.status}, ${relativeTime(lastRun.createdAt)}) — noodle github runs`
|
|
224
|
+
: 'last run: — (no deploy runs yet)');
|
|
225
|
+
return EXIT.OK;
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
if (error instanceof ServiceRequestError && error.status === 404) {
|
|
229
|
+
// Not-connected is a read result, not an error — exit 0 with the connect pointer.
|
|
230
|
+
if (json) {
|
|
231
|
+
printJsonOk({ connected: false });
|
|
232
|
+
return EXIT.OK;
|
|
233
|
+
}
|
|
234
|
+
console.log(`target: ${org}/${app}`);
|
|
235
|
+
console.log('state: not connected');
|
|
236
|
+
console.log('Next: noodle github connect');
|
|
237
|
+
return EXIT.OK;
|
|
238
|
+
}
|
|
239
|
+
return printCliFailure('github', serviceErrorFailure('noodle github status', error), json);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// --- disconnect ------------------------------------------------------------------------------------
|
|
243
|
+
export async function runGithubDisconnect(rest, env, home) {
|
|
244
|
+
const args = parseGithubArgs(rest);
|
|
245
|
+
const json = args.json;
|
|
246
|
+
const resolved = resolveGithubTarget(args, home);
|
|
247
|
+
if (!resolved.ok)
|
|
248
|
+
return printCliFailure('github', resolved.error, json);
|
|
249
|
+
const { org, app } = resolved.target;
|
|
250
|
+
if (!args.yes) {
|
|
251
|
+
const interactive = !json && process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
252
|
+
if (!interactive) {
|
|
253
|
+
return printCliFailure('github', {
|
|
254
|
+
code: 'confirmation_required',
|
|
255
|
+
message: 'disconnect requires confirmation',
|
|
256
|
+
cause: 'This stops GitHub-triggered deploys for the app. Reconnect any time.',
|
|
257
|
+
fix: 'Re-run with --yes to confirm non-interactively.',
|
|
258
|
+
next: `noodle github disconnect --org ${org} --app ${app} --yes`,
|
|
259
|
+
exitCode: EXIT.USAGE,
|
|
260
|
+
}, json);
|
|
261
|
+
}
|
|
262
|
+
const confirmed = await confirm(`This stops GitHub-triggered deploys for ${org}/${app}. Reconnect any time. Disconnect?`, { initial: false });
|
|
263
|
+
if (!confirmed) {
|
|
264
|
+
console.error('github disconnect: cancelled');
|
|
265
|
+
return EXIT.USAGE;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
const tokenResolution = await resolveControlPlaneToken({
|
|
269
|
+
serviceFlag: args.service ?? resolved.target.serviceUrl,
|
|
270
|
+
authFlag: args.authToken,
|
|
271
|
+
env,
|
|
272
|
+
home,
|
|
273
|
+
});
|
|
274
|
+
if (tokenResolution.token === undefined)
|
|
275
|
+
return printCliFailure('github', authRequired(), json);
|
|
276
|
+
const { serviceUrl, token } = tokenResolution;
|
|
277
|
+
try {
|
|
278
|
+
const body = await serviceJson(`${serviceUrl}/v1/orgs/${encodeURIComponent(org)}/apps/${encodeURIComponent(app)}/github/connection`, token, { method: 'DELETE' });
|
|
279
|
+
if (json) {
|
|
280
|
+
printJsonOk(body.data);
|
|
281
|
+
return EXIT.OK;
|
|
282
|
+
}
|
|
283
|
+
console.log(body.data.disabled
|
|
284
|
+
? `Disconnected ${org}/${app}. Reconnect any time with: noodle github connect --org ${org} --app ${app}`
|
|
285
|
+
: `${org}/${app} was already disconnected.`);
|
|
286
|
+
return EXIT.OK;
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
if (error instanceof ServiceRequestError && error.status === 403) {
|
|
290
|
+
return printCliFailure('github', ownerRoleFailure(org), json);
|
|
291
|
+
}
|
|
292
|
+
return printCliFailure('github', serviceErrorFailure('noodle github disconnect', error), json);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// --- dispatch ------------------------------------------------------------------------------------
|
|
296
|
+
export async function runGithub(rest, env, home) {
|
|
297
|
+
const [action, ...actionRest] = rest;
|
|
298
|
+
if (action === 'connect')
|
|
299
|
+
return runGithubConnect(actionRest, env, home);
|
|
300
|
+
if (action === 'status')
|
|
301
|
+
return runGithubStatus(actionRest, env, home);
|
|
302
|
+
if (action === 'disconnect')
|
|
303
|
+
return runGithubDisconnect(actionRest, env, home);
|
|
304
|
+
if (action === 'runs')
|
|
305
|
+
return runGithubRuns(actionRest, env, home);
|
|
306
|
+
const json = rest.includes('--json');
|
|
307
|
+
return printCliFailure('github', {
|
|
308
|
+
code: 'usage_error',
|
|
309
|
+
message: 'usage: noodle github connect|status|disconnect|runs',
|
|
310
|
+
cause: 'usage: noodle github connect|status|disconnect|runs',
|
|
311
|
+
fix: 'Check the command arguments.',
|
|
312
|
+
next: 'noodle github --help',
|
|
313
|
+
exitCode: EXIT.USAGE,
|
|
314
|
+
}, json);
|
|
315
|
+
}
|
|
316
|
+
//# sourceMappingURL=github-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-ops.js","sourceRoot":"","sources":["../../src/commands/github-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAqB,MAAM,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAkB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EACL,YAAY,EACZ,eAAe,EAEf,6BAA6B,EAC7B,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EAEf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAs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C,KAAK;KACrB,EACD,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TableOptions } from '../table.js';
|
|
2
|
+
/**
|
|
3
|
+
* `noodle github runs [--org --app --limit N --json --watch]` (GHD-2): the deploy-runs feed behind
|
|
4
|
+
* `GET /v1/orgs/{org}/apps/{app}/github/runs`. Pulled forward from GHD-4.4 so Phase 2 is observable
|
|
5
|
+
* the moment webhook intake lands — a queued/blocked run is visible here (and in the console feed)
|
|
6
|
+
* even though nothing builds it until GHD-3. Split from `github-ops.ts` for the size gate.
|
|
7
|
+
*/
|
|
8
|
+
/** Wire shape of one deploy run — mirrors `DeployRunSchema` (`contract/v1/github-runs-response.json`). */
|
|
9
|
+
export interface DeployRun {
|
|
10
|
+
readonly runId: string;
|
|
11
|
+
readonly orgSlug: string;
|
|
12
|
+
readonly appSlug: string;
|
|
13
|
+
readonly envName: string;
|
|
14
|
+
readonly sourceEvent: 'push' | 'pull_request';
|
|
15
|
+
readonly deliveryId: string;
|
|
16
|
+
readonly githubRepositoryId: number;
|
|
17
|
+
readonly commitSha: string;
|
|
18
|
+
readonly ref: string;
|
|
19
|
+
readonly prNumber?: number;
|
|
20
|
+
readonly status: 'queued' | 'building' | 'deploying' | 'deployed' | 'failed' | 'canceled' | 'superseded';
|
|
21
|
+
readonly blockedReason?: string;
|
|
22
|
+
readonly deploymentId?: string;
|
|
23
|
+
readonly actorLogin: string;
|
|
24
|
+
readonly errorSummary?: string;
|
|
25
|
+
readonly createdAt: string;
|
|
26
|
+
readonly startedAt?: string;
|
|
27
|
+
readonly finishedAt?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Render the `github runs` table. Exported for tests and the contract drift gate. */
|
|
30
|
+
export declare function renderRunsTable(runs: readonly DeployRun[], opts: TableOptions): string;
|
|
31
|
+
export declare function runGithubRuns(rest: readonly string[], env: NodeJS.ProcessEnv, home: string): Promise<number>;
|
|
32
|
+
//# sourceMappingURL=github-runs-ops.d.ts.map
|