@noodleseed/one 0.91.0 → 0.93.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/bin.js +0 -0
- package/dist/commands/catalog-data-hosted-deployment.d.ts.map +1 -1
- package/dist/commands/catalog-data-hosted-deployment.js +2 -2
- package/dist/commands/catalog-data-hosted-deployment.js.map +1 -1
- package/dist/commands/deploy-dotenv-import.d.ts +28 -0
- package/dist/commands/deploy-dotenv-import.d.ts.map +1 -0
- package/dist/commands/deploy-dotenv-import.js +50 -0
- package/dist/commands/deploy-dotenv-import.js.map +1 -0
- package/dist/commands/deploy-fire-progress.d.ts +28 -0
- package/dist/commands/deploy-fire-progress.d.ts.map +1 -0
- package/dist/commands/deploy-fire-progress.js +64 -0
- package/dist/commands/deploy-fire-progress.js.map +1 -0
- package/dist/commands/deploy-first-flow.d.ts +72 -0
- package/dist/commands/deploy-first-flow.d.ts.map +1 -0
- package/dist/commands/deploy-first-flow.js +315 -0
- package/dist/commands/deploy-first-flow.js.map +1 -0
- package/dist/commands/deploy-ops.d.ts +1 -27
- package/dist/commands/deploy-ops.d.ts.map +1 -1
- package/dist/commands/deploy-ops.js +122 -145
- package/dist/commands/deploy-ops.js.map +1 -1
- package/dist/commands/deploy-output.d.ts +7 -1
- package/dist/commands/deploy-output.d.ts.map +1 -1
- package/dist/commands/deploy-output.js +21 -12
- package/dist/commands/deploy-output.js.map +1 -1
- package/dist/commands/deploy-preflight.d.ts +35 -0
- package/dist/commands/deploy-preflight.d.ts.map +1 -0
- package/dist/commands/deploy-preflight.js +74 -0
- package/dist/commands/deploy-preflight.js.map +1 -0
- package/dist/commands/deploy-resume.d.ts +23 -0
- package/dist/commands/deploy-resume.d.ts.map +1 -0
- package/dist/commands/deploy-resume.js +79 -0
- package/dist/commands/deploy-resume.js.map +1 -0
- package/dist/deploy.d.ts +2 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +3 -0
- package/dist/deploy.js.map +1 -1
- package/dist/dev.d.ts +2 -0
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +8 -2
- package/dist/dev.js.map +1 -1
- package/dist/fire.d.ts +2 -2
- package/dist/fire.d.ts.map +1 -1
- package/dist/fire.js +6 -6
- package/dist/fire.js.map +1 -1
- package/dist/first-run.d.ts.map +1 -1
- package/dist/first-run.js +39 -33
- package/dist/first-run.js.map +1 -1
- package/dist/local-config.d.ts +2 -1
- package/dist/local-config.d.ts.map +1 -1
- package/dist/local-config.js +29 -2
- package/dist/local-config.js.map +1 -1
- package/dist/plugin-mode/build-readiness-server.d.ts.map +1 -1
- package/dist/plugin-mode/build-readiness-server.js +54 -4
- package/dist/plugin-mode/build-readiness-server.js.map +1 -1
- package/dist/project-dotenv.d.ts +15 -0
- package/dist/project-dotenv.d.ts.map +1 -0
- package/dist/project-dotenv.js +135 -0
- package/dist/project-dotenv.js.map +1 -0
- package/dist/project-scaffold-templates.d.ts.map +1 -1
- package/dist/project-scaffold-templates.js +6 -3
- package/dist/project-scaffold-templates.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +2 -2
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/index.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/plugin-bundle.js +2 -2
- package/node_modules/@noodle-borg/agent-kit/dist/plugin-bundle.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-connect-refs.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-connect-refs.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +3 -6
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js +2 -2
- package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-router.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-router.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/service/dist/assistant-bindings.js +4 -4
- package/node_modules/@noodle-borg/service/dist/assistant-bindings.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-deploy-transaction.d.ts +41 -0
- package/node_modules/@noodle-borg/service/dist/registry-deploy-transaction.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/registry-deploy-transaction.js +93 -0
- package/node_modules/@noodle-borg/service/dist/registry-deploy-transaction.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/registry-targets.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/registry-targets.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-targets.js +10 -4
- package/node_modules/@noodle-borg/service/dist/registry-targets.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +17 -0
- package/node_modules/@noodle-borg/service/dist/registry-types.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts +4 -2
- package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.js +79 -75
- package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +16 -0
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/deploy-dispatch.d.ts +21 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-dispatch.js +25 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-idempotency.d.ts +16 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-idempotency.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-idempotency.js +20 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-idempotency.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-preflight.d.ts +12 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-preflight.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-preflight.js +132 -0
- package/node_modules/@noodle-borg/service/dist/routes/deploy-preflight.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +2 -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 +3 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.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 +15 -12
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +82 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/index.js +37 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-data-hosted-deployment.d.ts","sourceRoot":"","sources":["../../src/commands/catalog-data-hosted-deployment.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,OAAO,KAAK,EAAgB,WAAW,EAA4B,MAAM,oBAAoB,CAAC;AAwG9F,eAAO,MAAM,yBAAyB,EAAE,SAAS,WAAW,
|
|
1
|
+
{"version":3,"file":"catalog-data-hosted-deployment.d.ts","sourceRoot":"","sources":["../../src/commands/catalog-data-hosted-deployment.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,OAAO,KAAK,EAAgB,WAAW,EAA4B,MAAM,oBAAoB,CAAC;AAwG9F,eAAO,MAAM,yBAAyB,EAAE,SAAS,WAAW,EA+O3D,CAAC"}
|
|
@@ -97,7 +97,7 @@ export const CATALOG_HOSTED_DEPLOYMENT = [
|
|
|
97
97
|
name: 'deploy',
|
|
98
98
|
section: 'start',
|
|
99
99
|
next: ['noodle login then noodle deploy', 'noodle github connect'],
|
|
100
|
-
summary: '
|
|
100
|
+
summary: 'Preflight required config, deploy your server, and verify its governed MCP URL is ready.',
|
|
101
101
|
arguments: [
|
|
102
102
|
argument({
|
|
103
103
|
...ARGUMENT_FIELDS,
|
|
@@ -157,7 +157,7 @@ export const CATALOG_HOSTED_DEPLOYMENT = [
|
|
|
157
157
|
...FLAG_FIELDS,
|
|
158
158
|
name: 'no-prompt',
|
|
159
159
|
type: 'boolean',
|
|
160
|
-
summary: 'Never prompt to set missing secrets.',
|
|
160
|
+
summary: 'Never prompt to set missing variables or secrets; return the complete checklist.',
|
|
161
161
|
}),
|
|
162
162
|
JSON_FLAG,
|
|
163
163
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-data-hosted-deployment.js","sourceRoot":"","sources":["../../src/commands/catalog-data-hosted-deployment.ts"],"names":[],"mappings":"AAGA,MAAM,YAAY,GAAG;IACnB,YAAY;IACZ,aAAa;IACb,eAAe;IACf,QAAQ;IACR,OAAO;IACP,WAAW;CACH,CAAC;AAE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Ae,GAAG,IAAI,CAAC;IAC3B,GAAG,WAAW;IACd,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,qCAAqC;IAC9C,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AACH,MAAM,SAAS,GAAG,IAAI,CAAC;IACrB,GAAG,WAAW;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,mBAAmB;CAC7B,CAAC,CAAC;AACH,MAAM,mBAAmB,GAAwB;IAC/C,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,SAAS;CACV,CAAC;AAEF,2GAA2G;AAC3G,MAAM,WAAW,GAAwB;IACvC,IAAI,CAAC;QACH,GAAG,WAAW;QACd,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,SAAS;QACf,OAAO,EACL,8FAA8F;QAChG,aAAa,EAAE,CAAC,MAAM,CAAC;KACxB,CAAC;IACF,IAAI,CAAC;QACH,GAAG,WAAW;QACd,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,qCAAqC;QAC9C,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE;KACxC,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAA2B;IAC/D;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,CAAC,iCAAiC,EAAE,uBAAuB,CAAC;QAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"catalog-data-hosted-deployment.js","sourceRoot":"","sources":["../../src/commands/catalog-data-hosted-deployment.ts"],"names":[],"mappings":"AAGA,MAAM,YAAY,GAAG;IACnB,YAAY;IACZ,aAAa;IACb,eAAe;IACf,QAAQ;IACR,OAAO;IACP,WAAW;CACH,CAAC;AAEX,MAA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
|
|
3
|
+
readonly missingSecrets: readonly string[];
|
|
4
|
+
readonly missingVariables: readonly string[];
|
|
5
|
+
readonly serviceUrl: string;
|
|
6
|
+
readonly token: string;
|
|
7
|
+
readonly target: {
|
|
8
|
+
readonly org: string;
|
|
9
|
+
readonly app: string;
|
|
10
|
+
readonly env: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface DeployDotenvImportDependencies {
|
|
14
|
+
readonly confirmImport?: (message: string) => Promise<boolean>;
|
|
15
|
+
readonly write?: (message: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface DeployDotenvImportResult {
|
|
18
|
+
readonly imported: boolean;
|
|
19
|
+
readonly secrets: readonly string[];
|
|
20
|
+
readonly variables: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Offer one target-specific import for missing, declared config names found in the project `.env`.
|
|
24
|
+
* Values are never rendered; unrelated keys remain local and untouched.
|
|
25
|
+
*/
|
|
26
|
+
export declare function promptToImportMissingDotenvConfig(input: DeployDotenvImportInput, dependencies?: DeployDotenvImportDependencies): Promise<DeployDotenvImportResult>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=deploy-dotenv-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-dotenv-import.d.ts","sourceRoot":"","sources":["../../src/commands/deploy-dotenv-import.ts"],"names":[],"mappings":"AAIA,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACvF;AAED,UAAU,8BAA8B;IACtC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAsB,iCAAiC,CACrD,KAAK,EAAE,uBAAuB,EAC9B,YAAY,GAAE,8BAAmC,GAChD,OAAO,CAAC,wBAAwB,CAAC,CAsCnC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { serviceJson } from '../control-plane.js';
|
|
2
|
+
import { readProjectDotenv } from '../project-dotenv.js';
|
|
3
|
+
import { confirm } from '../prompts.js';
|
|
4
|
+
/**
|
|
5
|
+
* Offer one target-specific import for missing, declared config names found in the project `.env`.
|
|
6
|
+
* Values are never rendered; unrelated keys remain local and untouched.
|
|
7
|
+
*/
|
|
8
|
+
export async function promptToImportMissingDotenvConfig(input, dependencies = {}) {
|
|
9
|
+
const dotenv = readProjectDotenv(input.projectRoot);
|
|
10
|
+
if (dotenv === undefined)
|
|
11
|
+
return notImported();
|
|
12
|
+
const secrets = input.missingSecrets.filter((name) => Object.hasOwn(dotenv.values, name));
|
|
13
|
+
const variables = input.missingVariables.filter((name) => Object.hasOwn(dotenv.values, name));
|
|
14
|
+
if (secrets.length === 0 && variables.length === 0)
|
|
15
|
+
return notImported();
|
|
16
|
+
const write = dependencies.write ?? ((message) => console.error(message));
|
|
17
|
+
write(`Found matching .env values for ${targetLabel(input.target)}:`);
|
|
18
|
+
for (const name of variables)
|
|
19
|
+
write(` variable ${name}`);
|
|
20
|
+
for (const name of secrets)
|
|
21
|
+
write(` secret ${name}`);
|
|
22
|
+
const confirmImport = dependencies.confirmImport ??
|
|
23
|
+
((message) => confirm(message, { initial: false, output: process.stderr }));
|
|
24
|
+
if (!(await confirmImport(`Copy these .env values to ${targetLabel(input.target)}?`))) {
|
|
25
|
+
return notImported();
|
|
26
|
+
}
|
|
27
|
+
for (const [kind, names] of [
|
|
28
|
+
['variable', variables],
|
|
29
|
+
['secret', secrets],
|
|
30
|
+
]) {
|
|
31
|
+
for (const name of names) {
|
|
32
|
+
await serviceJson(`${input.serviceUrl}/v1/orgs/${encodeURIComponent(input.target.org)}` +
|
|
33
|
+
`/apps/${encodeURIComponent(input.target.app)}` +
|
|
34
|
+
`/envs/${encodeURIComponent(input.target.env)}/${kind}s/${encodeURIComponent(name)}`, input.token, {
|
|
35
|
+
method: 'PUT',
|
|
36
|
+
headers: { 'content-type': 'application/json' },
|
|
37
|
+
body: JSON.stringify({ value: dotenv.values[name] }),
|
|
38
|
+
});
|
|
39
|
+
write(`set ${kind} ${name} from .env`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { imported: true, secrets, variables };
|
|
43
|
+
}
|
|
44
|
+
function targetLabel(target) {
|
|
45
|
+
return `${target.org}/${target.app}/${target.env}`;
|
|
46
|
+
}
|
|
47
|
+
function notImported() {
|
|
48
|
+
return { imported: false, secrets: [], variables: [] };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=deploy-dotenv-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-dotenv-import.js","sourceRoot":"","sources":["../../src/commands/deploy-dotenv-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CA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;AAED,SAAS,WAAW;IAClB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type DeployFireController } from '../fire.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether this `deploy` run is eligible for the animated fire band in place of the plain spinner:
|
|
4
|
+
* a genuinely interactive, colored TTY on *both* streams (dismissal needs stdin), not `--json`,
|
|
5
|
+
* and not explicitly opted out by setting `NOODLE_NO_FIRE` (any value — presence-based, like
|
|
6
|
+
* `NO_COLOR`). `CI`/`NO_COLOR` are checked on the INJECTED env (presence, mirroring
|
|
7
|
+
* `detectColorMode`'s semantics) so the gate honors its seam rather than only the global env.
|
|
8
|
+
*/
|
|
9
|
+
export declare function shouldRunDeployFire(opts: {
|
|
10
|
+
readonly json: boolean;
|
|
11
|
+
readonly stdout: {
|
|
12
|
+
readonly isTTY?: boolean;
|
|
13
|
+
};
|
|
14
|
+
readonly stdin: {
|
|
15
|
+
readonly isTTY?: boolean;
|
|
16
|
+
};
|
|
17
|
+
readonly env: NodeJS.ProcessEnv;
|
|
18
|
+
}): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Wrap a `fetch` so the fire band's progress reflects real network milestones instead of a timer:
|
|
21
|
+
* the first call proves compile finished (nothing else could have made a request yet); the assets
|
|
22
|
+
* preflight response proves assets are checked; each asset upload nudges progress toward the upload
|
|
23
|
+
* milestone; and starting the final `/deploy` POST proves uploads are done (deploy.ts always awaits
|
|
24
|
+
* them first) and marks entry into the indeterminate activate wait — which a deploy that packaged no
|
|
25
|
+
* assets also reaches directly, correctly collapsing the assets/upload stages to instant.
|
|
26
|
+
*/
|
|
27
|
+
export declare function instrumentFireFetch(base: typeof fetch, fire: DeployFireController): typeof fetch;
|
|
28
|
+
//# sourceMappingURL=deploy-fire-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-fire-progress.d.ts","sourceRoot":"","sources":["../../src/commands/deploy-fire-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAc,MAAM,YAAY,CAAC;AAKnE;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACjC,GAAG,OAAO,CAUV;AAQD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,KAAK,CA+BhG"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { MILESTONES } from '../fire.js';
|
|
2
|
+
import { detectColorMode } from '../gradient.js';
|
|
3
|
+
// --- deploy fire animation (founder-approved UX, ADR-free — see fire.ts for the design) --------
|
|
4
|
+
/**
|
|
5
|
+
* Whether this `deploy` run is eligible for the animated fire band in place of the plain spinner:
|
|
6
|
+
* a genuinely interactive, colored TTY on *both* streams (dismissal needs stdin), not `--json`,
|
|
7
|
+
* and not explicitly opted out by setting `NOODLE_NO_FIRE` (any value — presence-based, like
|
|
8
|
+
* `NO_COLOR`). `CI`/`NO_COLOR` are checked on the INJECTED env (presence, mirroring
|
|
9
|
+
* `detectColorMode`'s semantics) so the gate honors its seam rather than only the global env.
|
|
10
|
+
*/
|
|
11
|
+
export function shouldRunDeployFire(opts) {
|
|
12
|
+
return (!opts.json &&
|
|
13
|
+
opts.env.CI === undefined &&
|
|
14
|
+
opts.env.NO_COLOR === undefined &&
|
|
15
|
+
opts.stdout.isTTY === true &&
|
|
16
|
+
detectColorMode(opts.stdout) !== 'none' &&
|
|
17
|
+
opts.stdin.isTTY === true &&
|
|
18
|
+
opts.env.NOODLE_NO_FIRE === undefined);
|
|
19
|
+
}
|
|
20
|
+
function requestUrl(input) {
|
|
21
|
+
if (typeof input === 'string')
|
|
22
|
+
return input;
|
|
23
|
+
if (input instanceof URL)
|
|
24
|
+
return input.toString();
|
|
25
|
+
return input.url;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Wrap a `fetch` so the fire band's progress reflects real network milestones instead of a timer:
|
|
29
|
+
* the first call proves compile finished (nothing else could have made a request yet); the assets
|
|
30
|
+
* preflight response proves assets are checked; each asset upload nudges progress toward the upload
|
|
31
|
+
* milestone; and starting the final `/deploy` POST proves uploads are done (deploy.ts always awaits
|
|
32
|
+
* them first) and marks entry into the indeterminate activate wait — which a deploy that packaged no
|
|
33
|
+
* assets also reaches directly, correctly collapsing the assets/upload stages to instant.
|
|
34
|
+
*/
|
|
35
|
+
export function instrumentFireFetch(base, fire) {
|
|
36
|
+
let sawFirstCall = false;
|
|
37
|
+
let uploadProgress = MILESTONES.assets;
|
|
38
|
+
const wrapped = async (input, init) => {
|
|
39
|
+
const url = requestUrl(input);
|
|
40
|
+
const isDeployPost = url.endsWith('/deploy');
|
|
41
|
+
const isPreflight = url.endsWith('/assets/preflight');
|
|
42
|
+
const isUpload = !isDeployPost && !isPreflight && (init?.method ?? 'GET').toUpperCase() === 'PUT';
|
|
43
|
+
if (!sawFirstCall) {
|
|
44
|
+
sawFirstCall = true;
|
|
45
|
+
fire.setProgress(MILESTONES.compile);
|
|
46
|
+
}
|
|
47
|
+
if (isDeployPost) {
|
|
48
|
+
fire.setProgress(MILESTONES.upload);
|
|
49
|
+
fire.setProgress(MILESTONES.activate);
|
|
50
|
+
}
|
|
51
|
+
const response = await base(input, init);
|
|
52
|
+
if (isPreflight) {
|
|
53
|
+
uploadProgress = MILESTONES.assets;
|
|
54
|
+
fire.setProgress(uploadProgress);
|
|
55
|
+
}
|
|
56
|
+
else if (isUpload) {
|
|
57
|
+
uploadProgress += (MILESTONES.upload - uploadProgress) * 0.4;
|
|
58
|
+
fire.setProgress(uploadProgress);
|
|
59
|
+
}
|
|
60
|
+
return response;
|
|
61
|
+
};
|
|
62
|
+
return wrapped;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=deploy-fire-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-fire-progress.js","sourceRoot":"","sources":["../../src/commands/deploy-fire-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,UAAU,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,kGAAkG;AAElG;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAKnC;IACC,OAAO,CACL,CAAC,IAAI,CAAC,IAAI;QACV,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,SAAS;QACzB,IAAI,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI;QAC1B,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,MAAM;QACvC,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI;QACzB,IAAI,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS,CACtC,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,KAAkC;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,YAAY,GAAG;QAAE,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAClD,OAAQ,KAAiB,CAAC,GAAG,CAAC;AAChC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAkB,EAAE,IAA0B;IAChF,IAAI,YAAY,GA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-0,0 +1,72 @@
|
|
|
1
|
+
import type { AccessMode, OrgMembershipSource } from '../deploy.js';
|
|
2
|
+
import { promptAndSetMissingConfig } from './deploy-output.js';
|
|
3
|
+
import { type HostedDeployTarget } from './deploy-preflight.js';
|
|
4
|
+
import { type JsonError } from './output.js';
|
|
5
|
+
export interface CanonicalDeployPreparation {
|
|
6
|
+
readonly ok: true;
|
|
7
|
+
readonly idempotencyKey?: string;
|
|
8
|
+
readonly resumeCommand: string;
|
|
9
|
+
readonly verificationRequired: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface CanonicalDeployPreparationFailure {
|
|
12
|
+
readonly ok: false;
|
|
13
|
+
readonly exitCode: number;
|
|
14
|
+
readonly error: JsonError;
|
|
15
|
+
}
|
|
16
|
+
export interface HostedDeployVerification {
|
|
17
|
+
readonly required: boolean;
|
|
18
|
+
readonly ok: boolean;
|
|
19
|
+
readonly checks?: readonly {
|
|
20
|
+
readonly level: 'PASS' | 'WARN' | 'FAIL';
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly message: string;
|
|
23
|
+
}[];
|
|
24
|
+
readonly message?: string;
|
|
25
|
+
}
|
|
26
|
+
interface PrepareCanonicalDeployInput {
|
|
27
|
+
readonly manifestPath: string;
|
|
28
|
+
readonly connectorsPath?: string;
|
|
29
|
+
readonly serviceUrl: string;
|
|
30
|
+
readonly token?: string;
|
|
31
|
+
readonly target: HostedDeployTarget;
|
|
32
|
+
readonly accessMode?: AccessMode;
|
|
33
|
+
readonly orgMembershipSources?: readonly OrgMembershipSource[];
|
|
34
|
+
readonly serverVersion: string;
|
|
35
|
+
readonly projectRoot: string;
|
|
36
|
+
readonly saveLegacy?: boolean;
|
|
37
|
+
readonly noSave?: boolean;
|
|
38
|
+
readonly noPrompt: boolean;
|
|
39
|
+
readonly json: boolean;
|
|
40
|
+
readonly interactive: boolean;
|
|
41
|
+
readonly silent?: boolean;
|
|
42
|
+
}
|
|
43
|
+
interface PrepareCanonicalDeployDependencies {
|
|
44
|
+
readonly confirmDotenvImport?: (message: string) => Promise<boolean>;
|
|
45
|
+
readonly promptMissingConfig?: typeof promptAndSetMissingConfig;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Run the read-only half of the canonical hosted deploy. It returns only after the complete
|
|
49
|
+
* configuration checklist is ready and a retry key has been durably recorded.
|
|
50
|
+
*/
|
|
51
|
+
export declare function prepareCanonicalDeploy(input: PrepareCanonicalDeployInput, dependencies?: PrepareCanonicalDeployDependencies): Promise<CanonicalDeployPreparation | CanonicalDeployPreparationFailure>;
|
|
52
|
+
export declare function verifyHostedDeploy(input: {
|
|
53
|
+
readonly required: boolean;
|
|
54
|
+
readonly serviceUrl: string;
|
|
55
|
+
readonly token?: string;
|
|
56
|
+
readonly target: HostedDeployTarget;
|
|
57
|
+
}): Promise<HostedDeployVerification>;
|
|
58
|
+
export declare function completeDeployResume(projectRoot: string, idempotencyKey: string | undefined): void;
|
|
59
|
+
export declare function deployResumeCommand(input: {
|
|
60
|
+
readonly manifestPath: string;
|
|
61
|
+
readonly connectorsPath?: string;
|
|
62
|
+
readonly serviceUrl: string;
|
|
63
|
+
readonly target: HostedDeployTarget;
|
|
64
|
+
readonly accessMode: AccessMode;
|
|
65
|
+
readonly serverVersion: string;
|
|
66
|
+
readonly saveLegacy?: boolean;
|
|
67
|
+
readonly noSave?: boolean;
|
|
68
|
+
readonly noPrompt?: boolean;
|
|
69
|
+
readonly json?: boolean;
|
|
70
|
+
}): string;
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=deploy-first-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-first-flow.d.ts","sourceRoot":"","sources":["../../src/commands/deploy-first-flow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIpE,OAAO,EAA2B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAEL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Q,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,MAAM,CAuBT"}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { ServiceRequestError, serviceJson } from '../control-plane.js';
|
|
2
|
+
import { printRecovery } from '../diagnostics.js';
|
|
3
|
+
import { ProjectDotenvError } from '../project-dotenv.js';
|
|
4
|
+
import { promptToImportMissingDotenvConfig } from './deploy-dotenv-import.js';
|
|
5
|
+
import { managedConfigSetCommand, promptAndSetMissingConfig } from './deploy-output.js';
|
|
6
|
+
import { DeployPreflightInputError, preflightHostedDeploy, } from './deploy-preflight.js';
|
|
7
|
+
import { clearDeployResume, loadOrCreateDeployResume } from './deploy-resume.js';
|
|
8
|
+
import { EXIT, printJsonFailure } from './output.js';
|
|
9
|
+
/**
|
|
10
|
+
* Run the read-only half of the canonical hosted deploy. It returns only after the complete
|
|
11
|
+
* configuration checklist is ready and a retry key has been durably recorded.
|
|
12
|
+
*/
|
|
13
|
+
export async function prepareCanonicalDeploy(input, dependencies = {}) {
|
|
14
|
+
const resumeCommand = deployResumeCommand({
|
|
15
|
+
manifestPath: input.manifestPath,
|
|
16
|
+
...(input.connectorsPath !== undefined ? { connectorsPath: input.connectorsPath } : {}),
|
|
17
|
+
serviceUrl: input.serviceUrl,
|
|
18
|
+
target: input.target,
|
|
19
|
+
accessMode: input.accessMode ?? 'owner-only',
|
|
20
|
+
serverVersion: input.serverVersion,
|
|
21
|
+
...(input.saveLegacy !== undefined ? { saveLegacy: input.saveLegacy } : {}),
|
|
22
|
+
...(input.noSave !== undefined ? { noSave: input.noSave } : {}),
|
|
23
|
+
noPrompt: input.noPrompt,
|
|
24
|
+
json: input.json,
|
|
25
|
+
});
|
|
26
|
+
if (input.token === undefined) {
|
|
27
|
+
return { ok: true, resumeCommand, verificationRequired: false };
|
|
28
|
+
}
|
|
29
|
+
const token = input.token;
|
|
30
|
+
try {
|
|
31
|
+
const runPreflight = () => preflightHostedDeploy({
|
|
32
|
+
manifestPath: input.manifestPath,
|
|
33
|
+
...(input.connectorsPath !== undefined ? { connectorsPath: input.connectorsPath } : {}),
|
|
34
|
+
serviceUrl: input.serviceUrl,
|
|
35
|
+
token,
|
|
36
|
+
target: input.target,
|
|
37
|
+
...(input.accessMode !== undefined ? { accessMode: input.accessMode } : {}),
|
|
38
|
+
...(input.orgMembershipSources !== undefined
|
|
39
|
+
? { orgMembershipSources: input.orgMembershipSources }
|
|
40
|
+
: {}),
|
|
41
|
+
serverVersion: input.serverVersion,
|
|
42
|
+
});
|
|
43
|
+
let preflight = await runPreflight();
|
|
44
|
+
if (!preflight.response.ready &&
|
|
45
|
+
configOnly(preflight.response.errors) &&
|
|
46
|
+
!input.noPrompt &&
|
|
47
|
+
input.interactive &&
|
|
48
|
+
!input.json) {
|
|
49
|
+
const dotenvImport = await promptToImportMissingDotenvConfig({
|
|
50
|
+
projectRoot: input.projectRoot,
|
|
51
|
+
missingSecrets: preflight.response.config.missingSecrets,
|
|
52
|
+
missingVariables: preflight.response.config.missingVariables,
|
|
53
|
+
serviceUrl: input.serviceUrl,
|
|
54
|
+
token,
|
|
55
|
+
target: input.target,
|
|
56
|
+
}, dependencies.confirmDotenvImport !== undefined
|
|
57
|
+
? { confirmImport: dependencies.confirmDotenvImport }
|
|
58
|
+
: {});
|
|
59
|
+
if (dotenvImport.imported)
|
|
60
|
+
preflight = await runPreflight();
|
|
61
|
+
if (!preflight.response.ready && configOnly(preflight.response.errors)) {
|
|
62
|
+
const promptMissingConfig = dependencies.promptMissingConfig ?? promptAndSetMissingConfig;
|
|
63
|
+
await promptMissingConfig({
|
|
64
|
+
missingSecrets: preflight.response.config.missingSecrets,
|
|
65
|
+
missingVariables: preflight.response.config.missingVariables,
|
|
66
|
+
serviceUrl: input.serviceUrl,
|
|
67
|
+
token,
|
|
68
|
+
target: input.target,
|
|
69
|
+
});
|
|
70
|
+
preflight = await runPreflight();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (!sameTarget(preflight.response.target, input.target)) {
|
|
74
|
+
throw new Error('deploy preflight returned a different target');
|
|
75
|
+
}
|
|
76
|
+
if (!preflight.response.ready) {
|
|
77
|
+
return preflightBlocked(preflight.response, input.target, resumeCommand, input.json, input.silent === true);
|
|
78
|
+
}
|
|
79
|
+
const resume = loadOrCreateDeployResume({
|
|
80
|
+
projectRoot: input.projectRoot,
|
|
81
|
+
fingerprint: preflight.fingerprint,
|
|
82
|
+
target: input.target,
|
|
83
|
+
serverVersion: input.serverVersion,
|
|
84
|
+
});
|
|
85
|
+
return {
|
|
86
|
+
ok: true,
|
|
87
|
+
idempotencyKey: resume.idempotencyKey,
|
|
88
|
+
resumeCommand,
|
|
89
|
+
verificationRequired: true,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return preflightError(error, input.serviceUrl, input.target, input.json, input.silent === true);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export async function verifyHostedDeploy(input) {
|
|
97
|
+
if (!input.required || input.token === undefined)
|
|
98
|
+
return { required: false, ok: true };
|
|
99
|
+
try {
|
|
100
|
+
const raw = await serviceJson(`${input.serviceUrl}/v1/orgs/${encodeURIComponent(input.target.org)}` +
|
|
101
|
+
`/apps/${encodeURIComponent(input.target.app)}` +
|
|
102
|
+
`/envs/${encodeURIComponent(input.target.env)}/smoke`, input.token, { method: 'POST' });
|
|
103
|
+
if (!isSmokeResponse(raw)) {
|
|
104
|
+
return {
|
|
105
|
+
required: true,
|
|
106
|
+
ok: false,
|
|
107
|
+
message: 'hosted readiness response did not match the expected contract',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
required: true,
|
|
112
|
+
ok: raw.ok,
|
|
113
|
+
checks: raw.checks,
|
|
114
|
+
...(!raw.ok ? { message: failedCheckMessage(raw.checks) } : {}),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
return {
|
|
119
|
+
required: true,
|
|
120
|
+
ok: false,
|
|
121
|
+
message: error instanceof Error ? error.message : String(error),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
export function completeDeployResume(projectRoot, idempotencyKey) {
|
|
126
|
+
if (idempotencyKey !== undefined)
|
|
127
|
+
clearDeployResume(projectRoot, idempotencyKey);
|
|
128
|
+
}
|
|
129
|
+
export function deployResumeCommand(input) {
|
|
130
|
+
const args = [
|
|
131
|
+
'noodle',
|
|
132
|
+
'deploy',
|
|
133
|
+
input.manifestPath,
|
|
134
|
+
...(input.connectorsPath !== undefined ? ['--connectors', input.connectorsPath] : []),
|
|
135
|
+
'--service',
|
|
136
|
+
input.serviceUrl,
|
|
137
|
+
'--org',
|
|
138
|
+
input.target.org,
|
|
139
|
+
'--app',
|
|
140
|
+
input.target.app,
|
|
141
|
+
'--env',
|
|
142
|
+
input.target.env,
|
|
143
|
+
'--version',
|
|
144
|
+
input.serverVersion,
|
|
145
|
+
'--access',
|
|
146
|
+
input.accessMode,
|
|
147
|
+
...(input.noSave ? ['--no-save'] : input.saveLegacy ? ['--save'] : []),
|
|
148
|
+
...(input.noPrompt ? ['--no-prompt'] : []),
|
|
149
|
+
...(input.json ? ['--json'] : []),
|
|
150
|
+
];
|
|
151
|
+
return args.map(shellQuoteCommandArgument).join(' ');
|
|
152
|
+
}
|
|
153
|
+
function shellQuoteCommandArgument(value) {
|
|
154
|
+
if (/^[a-zA-Z0-9_./:@%+,=-]+$/.test(value))
|
|
155
|
+
return value;
|
|
156
|
+
return `'${value.replaceAll("'", "'\"'\"'")}'`;
|
|
157
|
+
}
|
|
158
|
+
function preflightBlocked(response, target, resumeCommand, json, silent) {
|
|
159
|
+
const missingSecrets = response.config.missingSecrets;
|
|
160
|
+
const missingVariables = response.config.missingVariables;
|
|
161
|
+
const configMissing = missingSecrets.length > 0 || missingVariables.length > 0;
|
|
162
|
+
if (!configMissing || !configOnly(response.errors)) {
|
|
163
|
+
const cause = response.errors.map((error) => error.message).join('; ') || 'preflight failed';
|
|
164
|
+
const error = {
|
|
165
|
+
code: 'deploy_preflight_failed',
|
|
166
|
+
message: cause,
|
|
167
|
+
fix: 'Fix every reported deploy input error before retrying.',
|
|
168
|
+
next: 'noodle validate',
|
|
169
|
+
errors: response.errors,
|
|
170
|
+
detail: { target, resume: resumeCommand },
|
|
171
|
+
};
|
|
172
|
+
if (!silent) {
|
|
173
|
+
if (json)
|
|
174
|
+
printJsonFailure(error);
|
|
175
|
+
else {
|
|
176
|
+
printRecovery({
|
|
177
|
+
command: 'deploy',
|
|
178
|
+
cause,
|
|
179
|
+
fix: error.fix,
|
|
180
|
+
next: error.next,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return { ok: false, exitCode: EXIT.FAILURE, error };
|
|
185
|
+
}
|
|
186
|
+
const actions = [
|
|
187
|
+
...missingVariables.map((name) => managedConfigSetCommand('variable', name, target)),
|
|
188
|
+
...missingSecrets.map((name) => managedConfigSetCommand('secret', name, target)),
|
|
189
|
+
];
|
|
190
|
+
const onlySecrets = missingSecrets.length > 0 && missingVariables.length === 0;
|
|
191
|
+
const onlyVariables = missingVariables.length > 0 && missingSecrets.length === 0;
|
|
192
|
+
const code = onlySecrets
|
|
193
|
+
? 'missing_secret'
|
|
194
|
+
: onlyVariables
|
|
195
|
+
? 'missing_variable'
|
|
196
|
+
: 'missing_config';
|
|
197
|
+
const message = onlySecrets
|
|
198
|
+
? `Missing required managed secret(s): ${missingSecrets.join(', ')}`
|
|
199
|
+
: onlyVariables
|
|
200
|
+
? `Missing required managed variable(s): ${missingVariables.join(', ')}`
|
|
201
|
+
: 'Required hosted variables and secrets are missing.';
|
|
202
|
+
const fix = onlySecrets
|
|
203
|
+
? 'Set every missing secret at the environment scope, then rerun the same deploy command.'
|
|
204
|
+
: onlyVariables
|
|
205
|
+
? 'Set every missing variable at the environment scope, then rerun the same deploy command.'
|
|
206
|
+
: 'Set every listed variable and secret, then rerun the same deploy command.';
|
|
207
|
+
const error = {
|
|
208
|
+
code,
|
|
209
|
+
message,
|
|
210
|
+
fix,
|
|
211
|
+
next: actions[0] ?? resumeCommand,
|
|
212
|
+
errors: response.errors,
|
|
213
|
+
detail: {
|
|
214
|
+
target,
|
|
215
|
+
missingSecrets,
|
|
216
|
+
missingVariables,
|
|
217
|
+
actions,
|
|
218
|
+
resume: resumeCommand,
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
if (!silent) {
|
|
222
|
+
if (json)
|
|
223
|
+
printJsonFailure(error);
|
|
224
|
+
else {
|
|
225
|
+
printRecovery({
|
|
226
|
+
command: 'deploy',
|
|
227
|
+
cause: message,
|
|
228
|
+
fix,
|
|
229
|
+
next: actions[0] ?? resumeCommand,
|
|
230
|
+
});
|
|
231
|
+
for (const action of actions.slice(1))
|
|
232
|
+
console.error(`Also set: ${action}`);
|
|
233
|
+
console.error(`Resume: ${resumeCommand}`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return { ok: false, exitCode: EXIT.FAILURE, error };
|
|
237
|
+
}
|
|
238
|
+
function preflightError(error, serviceUrl, target, json, silent) {
|
|
239
|
+
const serviceError = error instanceof ServiceRequestError ? error : undefined;
|
|
240
|
+
const status = serviceError?.status ?? 0;
|
|
241
|
+
const message = error instanceof DeployPreflightInputError
|
|
242
|
+
? error.message
|
|
243
|
+
: error instanceof Error
|
|
244
|
+
? error.message
|
|
245
|
+
: String(error);
|
|
246
|
+
const dotenvFailure = error instanceof ProjectDotenvError;
|
|
247
|
+
const localInputFailure = serviceError === undefined;
|
|
248
|
+
const next = status === 401
|
|
249
|
+
? `noodle login --service ${serviceUrl}`
|
|
250
|
+
: status === 403 || status === 404
|
|
251
|
+
? 'noodle whoami'
|
|
252
|
+
: dotenvFailure
|
|
253
|
+
? 'noodle deploy'
|
|
254
|
+
: localInputFailure
|
|
255
|
+
? 'noodle validate'
|
|
256
|
+
: `noodle doctor --service ${serviceUrl}`;
|
|
257
|
+
const exitCode = status === 401 || status === 403
|
|
258
|
+
? EXIT.AUTH
|
|
259
|
+
: status === 0 && serviceError !== undefined
|
|
260
|
+
? EXIT.UNREACHABLE
|
|
261
|
+
: EXIT.FAILURE;
|
|
262
|
+
const fix = status === 401 || status === 403
|
|
263
|
+
? 'Sign in and confirm access to the selected organization.'
|
|
264
|
+
: dotenvFailure
|
|
265
|
+
? 'Fix the reported .env syntax line, then retry the deploy.'
|
|
266
|
+
: 'Repair the reported preflight problem before deploying.';
|
|
267
|
+
const failure = {
|
|
268
|
+
code: serviceError?.code ??
|
|
269
|
+
(status === 401 || status === 403 ? 'deploy_failed' : 'deploy_preflight_failed'),
|
|
270
|
+
message,
|
|
271
|
+
fix,
|
|
272
|
+
next,
|
|
273
|
+
...(serviceError?.requestId !== undefined ? { requestId: serviceError.requestId } : {}),
|
|
274
|
+
...(error instanceof DeployPreflightInputError ? { errors: error.errors } : {}),
|
|
275
|
+
detail: { status, target },
|
|
276
|
+
};
|
|
277
|
+
if (!silent) {
|
|
278
|
+
if (json)
|
|
279
|
+
printJsonFailure(failure, exitCode);
|
|
280
|
+
else {
|
|
281
|
+
printRecovery({
|
|
282
|
+
command: 'deploy',
|
|
283
|
+
cause: status === 403 || status === 404
|
|
284
|
+
? `${message} (target: ${target.org}/${target.app}/${target.env})`
|
|
285
|
+
: message,
|
|
286
|
+
fix,
|
|
287
|
+
next,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return { ok: false, exitCode, error: failure };
|
|
292
|
+
}
|
|
293
|
+
function configOnly(errors) {
|
|
294
|
+
return (errors.length > 0 &&
|
|
295
|
+
errors.every((error) => error.code === 'missing_secret' || error.code === 'missing_variable'));
|
|
296
|
+
}
|
|
297
|
+
function sameTarget(left, right) {
|
|
298
|
+
return left.org === right.org && left.app === right.app && left.env === right.env;
|
|
299
|
+
}
|
|
300
|
+
function isSmokeResponse(value) {
|
|
301
|
+
if (typeof value !== 'object' || value === null)
|
|
302
|
+
return false;
|
|
303
|
+
const candidate = value;
|
|
304
|
+
return (typeof candidate.ok === 'boolean' &&
|
|
305
|
+
Array.isArray(candidate.checks) &&
|
|
306
|
+
candidate.checks.every((check) => typeof check === 'object' &&
|
|
307
|
+
check !== null &&
|
|
308
|
+
['PASS', 'WARN', 'FAIL'].includes(String(check.level)) &&
|
|
309
|
+
typeof check.name === 'string' &&
|
|
310
|
+
typeof check.message === 'string'));
|
|
311
|
+
}
|
|
312
|
+
function failedCheckMessage(checks) {
|
|
313
|
+
return checks.find((check) => check.level === 'FAIL')?.message ?? 'hosted readiness check failed';
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=deploy-first-flow.js.map
|