@camunda8/cli 4.7.0-alpha.3 → 4.7.0-alpha.30
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/CONTEXT.md +11 -0
- package/PLUGIN-HELP.md +1 -1
- package/README.md +9 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +48 -9
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/helpers/deploy-helpers.d.ts +96 -2
- package/dist/commands/helpers/deploy-helpers.d.ts.map +1 -1
- package/dist/commands/helpers/deploy-helpers.js +213 -70
- package/dist/commands/helpers/deploy-helpers.js.map +1 -1
- package/dist/commands/mcp-proxy.d.ts.map +1 -1
- package/dist/commands/mcp-proxy.js +13 -8
- package/dist/commands/mcp-proxy.js.map +1 -1
- package/dist/commands/profiles.d.ts.map +1 -1
- package/dist/commands/profiles.js +13 -7
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +1 -8
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +309 -16
- package/dist/commands/watch.js.map +1 -1
- package/dist/core/client.d.ts +13 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +48 -21
- package/dist/core/client.js.map +1 -1
- package/dist/core/config.d.ts +34 -3
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +91 -9
- package/dist/core/config.js.map +1 -1
- package/dist/core/env-address.d.ts +22 -0
- package/dist/core/env-address.d.ts.map +1 -0
- package/dist/core/env-address.js +30 -0
- package/dist/core/env-address.js.map +1 -0
- package/dist/core/errors.d.ts +17 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +32 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +2 -1
- package/dist/core/logger.js.map +1 -1
- package/dist/core/node-version.d.ts +18 -0
- package/dist/core/node-version.d.ts.map +1 -0
- package/dist/core/node-version.js +38 -0
- package/dist/core/node-version.js.map +1 -0
- package/dist/default-plugins/cluster/README.md +1 -1
- package/dist/default-plugins/cluster/c8ctl-plugin.js +289 -36
- package/dist/default-plugins/element-template/c8ctl-plugin.js +248 -7
- package/dist/default-plugins/mcp/README.md +33 -0
- package/dist/default-plugins/mcp/c8ctl-plugin.js +4870 -0
- package/dist/default-plugins/mcp/package.json +8 -0
- package/dist/default-plugins/modeler/README.md +23 -0
- package/dist/default-plugins/modeler/c8ctl-plugin.js +4314 -0
- package/dist/default-plugins/modeler/package.json +8 -0
- package/dist/default-plugins/setup/README.md +43 -0
- package/dist/default-plugins/setup/c8ctl-plugin.js +6903 -0
- package/dist/default-plugins/setup/package.json +8 -0
- package/dist/default-plugins/skills/README.md +35 -0
- package/dist/default-plugins/skills/c8ctl-plugin.js +3352 -0
- package/dist/default-plugins/skills/package.json +8 -0
- package/dist/framework/argv-parser.d.ts +14 -0
- package/dist/framework/argv-parser.d.ts.map +1 -1
- package/dist/framework/argv-parser.js +25 -0
- package/dist/framework/argv-parser.js.map +1 -1
- package/dist/framework/command-registry.d.ts +26 -0
- package/dist/framework/command-registry.d.ts.map +1 -1
- package/dist/framework/command-registry.js +45 -0
- package/dist/framework/command-registry.js.map +1 -1
- package/dist/framework/plugins/plugin-loader.d.ts +20 -2
- package/dist/framework/plugins/plugin-loader.d.ts.map +1 -1
- package/dist/framework/plugins/plugin-loader.js.map +1 -1
- package/dist/framework/ui/help.d.ts.map +1 -1
- package/dist/framework/ui/help.js +57 -14
- package/dist/framework/ui/help.js.map +1 -1
- package/dist/framework/ui/prompt.d.ts +88 -0
- package/dist/framework/ui/prompt.d.ts.map +1 -1
- package/dist/framework/ui/prompt.js +344 -0
- package/dist/framework/ui/prompt.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -12
- package/dist/index.js.map +1 -1
- package/dist/utils/command-local/mcp-install-helpers.d.ts +49 -0
- package/dist/utils/command-local/mcp-install-helpers.d.ts.map +1 -0
- package/dist/utils/command-local/mcp-install-helpers.js +394 -0
- package/dist/utils/command-local/mcp-install-helpers.js.map +1 -0
- package/dist/utils/command-local/process-instance-helpers.d.ts +6 -0
- package/dist/utils/command-local/process-instance-helpers.d.ts.map +1 -1
- package/dist/utils/command-local/process-instance-helpers.js +9 -0
- package/dist/utils/command-local/process-instance-helpers.js.map +1 -1
- package/dist/utils/command-local/skills-install-helpers.d.ts +45 -0
- package/dist/utils/command-local/skills-install-helpers.d.ts.map +1 -0
- package/dist/utils/command-local/skills-install-helpers.js +423 -0
- package/dist/utils/command-local/skills-install-helpers.js.map +1 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/shared/camunda-json.d.ts +24 -3
- package/dist/utils/shared/camunda-json.d.ts.map +1 -1
- package/dist/utils/shared/camunda-json.js +23 -5
- package/dist/utils/shared/camunda-json.js.map +1 -1
- package/dist/utils/shared/deploy-resource-selection.d.ts +165 -0
- package/dist/utils/shared/deploy-resource-selection.d.ts.map +1 -0
- package/dist/utils/shared/deploy-resource-selection.js +466 -0
- package/dist/utils/shared/deploy-resource-selection.js.map +1 -0
- package/dist/utils/shared/ignore.d.ts +26 -0
- package/dist/utils/shared/ignore.d.ts.map +1 -1
- package/dist/utils/shared/ignore.js +6 -2
- package/dist/utils/shared/ignore.js.map +1 -1
- package/package.json +3 -2
- package/dist/utils/command-local/setup-prerequisites.d.ts +0 -67
- package/dist/utils/command-local/setup-prerequisites.d.ts.map +0 -1
- package/dist/utils/command-local/setup-prerequisites.js +0 -238
- package/dist/utils/command-local/setup-prerequisites.js.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prerequisite checks for `c8ctl setup`: Node.js version, operating
|
|
3
|
-
* system and architecture, and network access to the Camunda 8 Run
|
|
4
|
-
* download host.
|
|
5
|
-
*
|
|
6
|
-
* Inputs (versions, platform, fetch, environment) are parameters with
|
|
7
|
-
* the real runtime as the default, so every outcome is testable.
|
|
8
|
-
*/
|
|
9
|
-
export type PrerequisiteId = "node" | "platform" | "network";
|
|
10
|
-
export interface PrerequisiteResult {
|
|
11
|
-
readonly id: PrerequisiteId;
|
|
12
|
-
readonly title: string;
|
|
13
|
-
readonly ok: boolean;
|
|
14
|
-
/** What was found, e.g. "Node.js 22.17.1 is installed; c8ctl needs >=22.18.0." */
|
|
15
|
-
readonly detail: string;
|
|
16
|
-
/** How to fix a failed check. */
|
|
17
|
-
readonly hint?: string;
|
|
18
|
-
}
|
|
19
|
-
/** The `fetch` subset the network check uses. */
|
|
20
|
-
export type PrerequisiteFetch = (url: string, init: {
|
|
21
|
-
method: string;
|
|
22
|
-
redirect: "manual";
|
|
23
|
-
signal: AbortSignal;
|
|
24
|
-
}) => Promise<unknown>;
|
|
25
|
-
type Env = Readonly<Record<string, string | undefined>>;
|
|
26
|
-
/**
|
|
27
|
-
* Pages for setting Camunda up by hand, for anyone who cannot meet a
|
|
28
|
-
* prerequisite. Unversioned docs.camunda.io URLs resolve to the current
|
|
29
|
-
* release.
|
|
30
|
-
*/
|
|
31
|
-
export declare const MANUAL_SETUP_LINKS: readonly {
|
|
32
|
-
readonly label: string;
|
|
33
|
-
readonly url: string;
|
|
34
|
-
}[];
|
|
35
|
-
/** The Node.js range from c8ctl's `engines.node`, the one npm enforces. */
|
|
36
|
-
export declare const REQUIRED_NODE_RANGE: string | undefined;
|
|
37
|
-
export declare function checkNodeVersion({ version, range, }?: {
|
|
38
|
-
version?: string;
|
|
39
|
-
range?: string;
|
|
40
|
-
}): PrerequisiteResult;
|
|
41
|
-
export declare function checkPlatform({ platform, arch, }?: {
|
|
42
|
-
platform?: string;
|
|
43
|
-
arch?: string;
|
|
44
|
-
}): PrerequisiteResult;
|
|
45
|
-
/**
|
|
46
|
-
* Check that the Camunda 8 Run download host answers. Any HTTP response,
|
|
47
|
-
* including a redirect, counts as reachable; a connection failure, a
|
|
48
|
-
* timeout, or a download URL that cannot work fails.
|
|
49
|
-
*/
|
|
50
|
-
export declare function checkNetwork({ fetch, env, timeoutMs, }?: {
|
|
51
|
-
fetch?: PrerequisiteFetch;
|
|
52
|
-
env?: Env;
|
|
53
|
-
timeoutMs?: number;
|
|
54
|
-
}): Promise<PrerequisiteResult>;
|
|
55
|
-
export declare function checkPrerequisites(options?: {
|
|
56
|
-
version?: string;
|
|
57
|
-
range?: string;
|
|
58
|
-
platform?: string;
|
|
59
|
-
arch?: string;
|
|
60
|
-
fetch?: PrerequisiteFetch;
|
|
61
|
-
env?: Env;
|
|
62
|
-
timeoutMs?: number;
|
|
63
|
-
}): Promise<PrerequisiteResult[]>;
|
|
64
|
-
/** Explain the failed checks and point at the manual setup instead. */
|
|
65
|
-
export declare function formatPrerequisiteFailures(results: readonly PrerequisiteResult[]): string;
|
|
66
|
-
export {};
|
|
67
|
-
//# sourceMappingURL=setup-prerequisites.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-prerequisites.d.ts","sourceRoot":"","sources":["../../../src/utils/command-local/setup-prerequisites.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,iDAAiD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,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,SAAS,CAAC,EAAE,MAAM,CAAC;CACd,GACJ,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAM/B;AAED,uEAAuE;AACvE,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACpC,MAAM,CAaR"}
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prerequisite checks for `c8ctl setup`: Node.js version, operating
|
|
3
|
-
* system and architecture, and network access to the Camunda 8 Run
|
|
4
|
-
* download host.
|
|
5
|
-
*
|
|
6
|
-
* Inputs (versions, platform, fetch, environment) are parameters with
|
|
7
|
-
* the real runtime as the default, so every outcome is testable.
|
|
8
|
-
*/
|
|
9
|
-
import { readFileSync } from "node:fs";
|
|
10
|
-
import { join } from "node:path";
|
|
11
|
-
import semver from "semver";
|
|
12
|
-
/**
|
|
13
|
-
* Pages for setting Camunda up by hand, for anyone who cannot meet a
|
|
14
|
-
* prerequisite. Unversioned docs.camunda.io URLs resolve to the current
|
|
15
|
-
* release.
|
|
16
|
-
*/
|
|
17
|
-
export const MANUAL_SETUP_LINKS = [
|
|
18
|
-
{
|
|
19
|
-
label: "Run your first process without c8ctl",
|
|
20
|
-
url: "https://docs.camunda.io/docs/guides/getting-started-hello-world/",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: "Install and start Camunda 8 Run",
|
|
24
|
-
url: "https://docs.camunda.io/docs/self-managed/quickstart/developer-quickstart/c8run/install-start/",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: "Install Desktop Modeler",
|
|
28
|
-
url: "https://docs.camunda.io/docs/components/modeler/desktop-modeler/install-the-modeler/",
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
// ── Node.js ────────────────────────────────────────────────────────
|
|
32
|
-
function readRequiredNodeRange() {
|
|
33
|
-
try {
|
|
34
|
-
// src/utils/command-local/ and dist/utils/command-local/ are both
|
|
35
|
-
// three levels below the package root.
|
|
36
|
-
const pkg = JSON.parse(readFileSync(join(import.meta.dirname, "..", "..", "..", "package.json"), "utf-8"));
|
|
37
|
-
const engines = pkg && typeof pkg === "object" && "engines" in pkg
|
|
38
|
-
? pkg.engines
|
|
39
|
-
: undefined;
|
|
40
|
-
const node = engines && typeof engines === "object" && "node" in engines
|
|
41
|
-
? engines.node
|
|
42
|
-
: undefined;
|
|
43
|
-
return typeof node === "string" ? node : undefined;
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/** The Node.js range from c8ctl's `engines.node`, the one npm enforces. */
|
|
50
|
-
export const REQUIRED_NODE_RANGE = readRequiredNodeRange();
|
|
51
|
-
export function checkNodeVersion({ version = process.versions.node, range = REQUIRED_NODE_RANGE, } = {}) {
|
|
52
|
-
const title = "Node.js version";
|
|
53
|
-
if (!range) {
|
|
54
|
-
return { id: "node", title, ok: true, detail: `Node.js ${version}.` };
|
|
55
|
-
}
|
|
56
|
-
const ok = semver.satisfies(version, range, { includePrerelease: true });
|
|
57
|
-
return ok
|
|
58
|
-
? { id: "node", title, ok, detail: `Node.js ${version}.` }
|
|
59
|
-
: {
|
|
60
|
-
id: "node",
|
|
61
|
-
title,
|
|
62
|
-
ok,
|
|
63
|
-
detail: `Node.js ${version} is installed; c8ctl needs ${range}.`,
|
|
64
|
-
hint: "Install a supported Node.js release from https://nodejs.org/en/download, then run c8ctl setup again.",
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
// ── Platform ───────────────────────────────────────────────────────
|
|
68
|
-
/**
|
|
69
|
-
* Platform and architecture pairs Camunda 8 Run is published for: exactly
|
|
70
|
-
* the darwin-aarch64, darwin-x86_64, linux-x86_64 and windows-x86_64
|
|
71
|
-
* builds on the Camunda Download Center. Other pairs, including Linux and
|
|
72
|
-
* Windows on arm64, have no build to download.
|
|
73
|
-
*/
|
|
74
|
-
const SUPPORTED_ARCHS_BY_PLATFORM = {
|
|
75
|
-
darwin: ["x64", "arm64"],
|
|
76
|
-
linux: ["x64"],
|
|
77
|
-
win32: ["x64"],
|
|
78
|
-
};
|
|
79
|
-
export function checkPlatform({ platform = process.platform, arch = process.arch, } = {}) {
|
|
80
|
-
const title = "Operating system";
|
|
81
|
-
const ok = Object.hasOwn(SUPPORTED_ARCHS_BY_PLATFORM, platform) &&
|
|
82
|
-
SUPPORTED_ARCHS_BY_PLATFORM[platform].includes(arch);
|
|
83
|
-
return ok
|
|
84
|
-
? { id: "platform", title, ok, detail: `${platform} ${arch}.` }
|
|
85
|
-
: {
|
|
86
|
-
id: "platform",
|
|
87
|
-
title,
|
|
88
|
-
ok,
|
|
89
|
-
detail: `Camunda 8 Run is not available for ${platform} ${arch}.`,
|
|
90
|
-
hint: "Camunda 8 Run is available for macOS (x64, arm64), Linux (x64) and Windows (x64).",
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
// ── Network ────────────────────────────────────────────────────────
|
|
94
|
-
const DEFAULT_DOWNLOAD_URL = "https://downloads.camunda.cloud/release/camunda/c8run/";
|
|
95
|
-
const DEFAULT_NETWORK_TIMEOUT_MS = 10_000;
|
|
96
|
-
/** The download base URL, honouring the same mirror override as the cluster plugin. */
|
|
97
|
-
function downloadBaseUrl(env) {
|
|
98
|
-
return (env.C8CTL_C8RUN_DOWNLOAD_URL || DEFAULT_DOWNLOAD_URL).replace(/\/*$/, "/");
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* A URL safe to print, redacted like the cluster plugin's download URLs:
|
|
102
|
-
* credentials become `***`, and a query string or fragment `?<redacted>`.
|
|
103
|
-
*/
|
|
104
|
-
function displayUrl(url) {
|
|
105
|
-
try {
|
|
106
|
-
const parsed = new URL(url);
|
|
107
|
-
if (parsed.username || parsed.password) {
|
|
108
|
-
parsed.username = "***";
|
|
109
|
-
parsed.password = "";
|
|
110
|
-
}
|
|
111
|
-
const query = parsed.search || parsed.hash ? "?<redacted>" : "";
|
|
112
|
-
parsed.search = "";
|
|
113
|
-
parsed.hash = "";
|
|
114
|
-
return `${parsed.toString()}${query}`;
|
|
115
|
-
}
|
|
116
|
-
catch {
|
|
117
|
-
return "(invalid URL)";
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/** Why a download URL cannot work, as the cluster plugin reports it, or undefined. */
|
|
121
|
-
function downloadUrlProblem(url) {
|
|
122
|
-
let parsed;
|
|
123
|
-
try {
|
|
124
|
-
parsed = new URL(url);
|
|
125
|
-
}
|
|
126
|
-
catch {
|
|
127
|
-
return "not a valid URL";
|
|
128
|
-
}
|
|
129
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
130
|
-
return `unsupported protocol ${parsed.protocol} (use http or https)`;
|
|
131
|
-
}
|
|
132
|
-
if (parsed.username || parsed.password) {
|
|
133
|
-
return "the URL contains credentials, which fetch() does not send";
|
|
134
|
-
}
|
|
135
|
-
return undefined;
|
|
136
|
-
}
|
|
137
|
-
/** The first error code in an error's cause chain, e.g. ENOTFOUND. */
|
|
138
|
-
function causeCode(error) {
|
|
139
|
-
for (let current = error, depth = 0; current && depth < 5; depth++) {
|
|
140
|
-
if (typeof current !== "object")
|
|
141
|
-
return undefined;
|
|
142
|
-
if ("code" in current && typeof current.code === "string") {
|
|
143
|
-
return current.code;
|
|
144
|
-
}
|
|
145
|
-
current = "cause" in current ? current.cause : undefined;
|
|
146
|
-
}
|
|
147
|
-
return undefined;
|
|
148
|
-
}
|
|
149
|
-
function networkHint(env) {
|
|
150
|
-
if (env.C8CTL_C8RUN_DOWNLOAD_URL) {
|
|
151
|
-
return ("C8CTL_C8RUN_DOWNLOAD_URL points the download at a mirror. Make sure that " +
|
|
152
|
-
"server is reachable, or unset it to use the Camunda Download Center.");
|
|
153
|
-
}
|
|
154
|
-
if ((env.HTTPS_PROXY || env.https_proxy) && env.NODE_USE_ENV_PROXY !== "1") {
|
|
155
|
-
return ("HTTPS_PROXY is set, but Node.js only uses it when NODE_USE_ENV_PROXY=1 is " +
|
|
156
|
-
"set as well (Node.js 22.21+ or 24.5+). Set NODE_USE_ENV_PROXY=1 and try again.");
|
|
157
|
-
}
|
|
158
|
-
return ("Check your network connection. Behind a proxy? Set HTTPS_PROXY together with " +
|
|
159
|
-
"NODE_USE_ENV_PROXY=1 (Node.js 22.21+ or 24.5+).");
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Check that the Camunda 8 Run download host answers. Any HTTP response,
|
|
163
|
-
* including a redirect, counts as reachable; a connection failure, a
|
|
164
|
-
* timeout, or a download URL that cannot work fails.
|
|
165
|
-
*/
|
|
166
|
-
export async function checkNetwork({ fetch = globalThis.fetch, env = process.env, timeoutMs = DEFAULT_NETWORK_TIMEOUT_MS, } = {}) {
|
|
167
|
-
const title = "Network access";
|
|
168
|
-
const url = downloadBaseUrl(env);
|
|
169
|
-
const shown = displayUrl(url);
|
|
170
|
-
const problem = downloadUrlProblem(url);
|
|
171
|
-
if (problem) {
|
|
172
|
-
return {
|
|
173
|
-
id: "network",
|
|
174
|
-
title,
|
|
175
|
-
ok: false,
|
|
176
|
-
detail: `Cannot use ${shown}: ${problem}.`,
|
|
177
|
-
hint: networkHint(env),
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
// A referenced timer rather than AbortSignal.timeout(), whose timer is
|
|
181
|
-
// unreferenced: the timeout must fire even when nothing else keeps the
|
|
182
|
-
// event loop alive, or a stalled request could end the process early.
|
|
183
|
-
const controller = new AbortController();
|
|
184
|
-
let timedOut = false;
|
|
185
|
-
const timer = setTimeout(() => {
|
|
186
|
-
timedOut = true;
|
|
187
|
-
controller.abort();
|
|
188
|
-
}, timeoutMs);
|
|
189
|
-
try {
|
|
190
|
-
// A redirect is an answer from the host, so it is not followed.
|
|
191
|
-
await fetch(url, {
|
|
192
|
-
method: "HEAD",
|
|
193
|
-
redirect: "manual",
|
|
194
|
-
signal: controller.signal,
|
|
195
|
-
});
|
|
196
|
-
return { id: "network", title, ok: true, detail: `${shown} is reachable.` };
|
|
197
|
-
}
|
|
198
|
-
catch (error) {
|
|
199
|
-
// Never the error's message: it can repeat the URL, credentials included.
|
|
200
|
-
const reason = timedOut
|
|
201
|
-
? `timed out after ${timeoutMs / 1000}s`
|
|
202
|
-
: (causeCode(error) ?? "connection failed");
|
|
203
|
-
return {
|
|
204
|
-
id: "network",
|
|
205
|
-
title,
|
|
206
|
-
ok: false,
|
|
207
|
-
detail: `Could not reach ${shown} (${reason}).`,
|
|
208
|
-
hint: networkHint(env),
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
finally {
|
|
212
|
-
clearTimeout(timer);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
// ── All checks ─────────────────────────────────────────────────────
|
|
216
|
-
export async function checkPrerequisites(options = {}) {
|
|
217
|
-
return [
|
|
218
|
-
checkNodeVersion(options),
|
|
219
|
-
checkPlatform(options),
|
|
220
|
-
await checkNetwork(options),
|
|
221
|
-
];
|
|
222
|
-
}
|
|
223
|
-
/** Explain the failed checks and point at the manual setup instead. */
|
|
224
|
-
export function formatPrerequisiteFailures(results) {
|
|
225
|
-
const failed = results.filter((result) => !result.ok);
|
|
226
|
-
return [
|
|
227
|
-
"c8ctl setup cannot continue:",
|
|
228
|
-
"",
|
|
229
|
-
...failed.flatMap((result) => [
|
|
230
|
-
` ✗ ${result.title}: ${result.detail}`,
|
|
231
|
-
...(result.hint ? [` ${result.hint}`] : []),
|
|
232
|
-
]),
|
|
233
|
-
"",
|
|
234
|
-
"To set up Camunda by hand instead:",
|
|
235
|
-
...MANUAL_SETUP_LINKS.map((link) => ` ${link.label}: ${link.url}`),
|
|
236
|
-
].join("\n");
|
|
237
|
-
}
|
|
238
|
-
//# sourceMappingURL=setup-prerequisites.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-prerequisites.js","sourceRoot":"","sources":["../../../src/utils/command-local/setup-prerequisites.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAsB5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAGzB;IACL;QACC,KAAK,EAAE,sCAAsC;QAC7C,GAAG,EAAE,kEAAkE;KACvE;IACD;QACC,KAAK,EAAE,iCAAiC;QACxC,GAAG,EAAE,gGAAgG;KACrG;IACD;QACC,KAAK,EAAE,yBAAyB;QAChC,GAAG,EAAE,sFAAsF;KAC3F;CACD,CAAC;AAEF,sEAAsE;AAEtE,SAAS,qBAAqB;IAC7B,IAAI,CAAC;QACJ,kEAAkE;QAClE,uCAAuC;QACvC,MAAM,GAAG,GAAY,IAAI,CAAC,KAAK,CAC9B,YAAY,CACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAC3D,OAAO,CACP,CACD,CAAC;QACF,MAAM,OAAO,GACZ,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,SAAS,IAAI,GAAG;YACjD,CAAC,CAAC,GAAG,CAAC,OAAO;YACb,CAAC,CAAC,SAAS,CAAC;QACd,MAAM,IAAI,GACT,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,IAAI,OAAO;YAC1D,CAAC,CAAC,OAAO,CAAC,IAAI;YACd,CAAC,CAAC,SAAS,CAAC;QACd,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,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