@zitadel/cli 1.0.0-alpha.20 → 1.0.0-alpha.22
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/SKILLS.md +20 -4
- package/dist/box-B_mwKole.mjs +35 -0
- package/dist/box-B_mwKole.mjs.map +1 -0
- package/dist/{branding-cygSBPkV.mjs → branding-DvoH8e0D.mjs} +2 -2
- package/dist/{branding-cygSBPkV.mjs.map → branding-DvoH8e0D.mjs.map} +1 -1
- package/dist/claim-state-B6ZSKmhW.mjs +125 -0
- package/dist/claim-state-B6ZSKmhW.mjs.map +1 -0
- package/dist/commands/apply.mjs +4 -4
- package/dist/commands/branding/eject.mjs +3 -3
- package/dist/commands/claim.mjs +47 -4
- package/dist/commands/claim.mjs.map +1 -1
- package/dist/commands/doctor.mjs +33 -17
- package/dist/commands/doctor.mjs.map +1 -1
- package/dist/commands/eject.mjs +3 -3
- package/dist/commands/logs.mjs +2 -2
- package/dist/commands/plan.mjs +4 -4
- package/dist/commands/reset.mjs +2 -2
- package/dist/commands/schemas/list.mjs +3 -3
- package/dist/commands/setup.mjs +56 -18
- package/dist/commands/setup.mjs.map +1 -1
- package/dist/commands/start.mjs +3 -3
- package/dist/commands/status.mjs +6 -6
- package/dist/commands/status.mjs.map +1 -1
- package/dist/commands/stop.mjs +3 -3
- package/dist/{docker-DcRGTOJa.mjs → docker-B1MjOMFo.mjs} +7 -4
- package/dist/docker-B1MjOMFo.mjs.map +1 -0
- package/dist/{environment-rjRVkJjW.mjs → environment-fibXmzM8.mjs} +1 -1
- package/dist/{environment-rjRVkJjW.mjs.map → environment-fibXmzM8.mjs.map} +1 -1
- package/dist/{journey-guidance-BGrOX_gT.mjs → journey-guidance-C9MxJNTg.mjs} +2 -2
- package/dist/{journey-guidance-BGrOX_gT.mjs.map → journey-guidance-C9MxJNTg.mjs.map} +1 -1
- package/dist/{oclif-CanO3zdt.mjs → oclif-JlsN1lfO.mjs} +1 -1
- package/dist/{oclif-CanO3zdt.mjs.map → oclif-JlsN1lfO.mjs.map} +1 -1
- package/dist/{orca-BzQIQqzt.mjs → orca-CPMHzmg3.mjs} +5 -4
- package/dist/{orca-BzQIQqzt.mjs.map → orca-CPMHzmg3.mjs.map} +1 -1
- package/dist/{package-manager-DFdLcDx1.mjs → package-manager-CDUsoGBy.mjs} +3 -3
- package/dist/{package-manager-DFdLcDx1.mjs.map → package-manager-CDUsoGBy.mjs.map} +1 -1
- package/dist/{ports-BM20XIZb.mjs → ports-hidBnSW-.mjs} +2 -2
- package/dist/{ports-BM20XIZb.mjs.map → ports-hidBnSW-.mjs.map} +1 -1
- package/dist/{processes-DKHPkU8O.mjs → processes-Cv19mJ2I.mjs} +1 -1
- package/dist/{processes-DKHPkU8O.mjs.map → processes-Cv19mJ2I.mjs.map} +1 -1
- package/dist/{project-CHhot85s.mjs → project-Ba0nriNm.mjs} +2 -2
- package/dist/{project-CHhot85s.mjs.map → project-Ba0nriNm.mjs.map} +1 -1
- package/dist/{sync-BBlACKzT.mjs → sync-ChlLQ4vZ.mjs} +4 -4
- package/dist/{sync-BBlACKzT.mjs.map → sync-ChlLQ4vZ.mjs.map} +1 -1
- package/dist/{user-schema-DTuOsdKE.mjs → user-schema-C2mC-JTN.mjs} +1 -1
- package/dist/{user-schema-DTuOsdKE.mjs.map → user-schema-C2mC-JTN.mjs.map} +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +7 -5
- package/dist/claim-state-DlfD6Res.mjs +0 -66
- package/dist/claim-state-DlfD6Res.mjs.map +0 -1
- package/dist/docker-DcRGTOJa.mjs.map +0 -1
package/dist/commands/setup.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { n as brandingDesignLabel, t as BRANDING_DESIGN_INFO } from "../designs-Ckz18Dpo.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { a as
|
|
9
|
-
import { i as
|
|
10
|
-
import {
|
|
2
|
+
import { n as wrapForBox, t as renderBoxActions } from "../box-B_mwKole.mjs";
|
|
3
|
+
import { D as toZitadelError, E as ZitadelError, M as serverKind, T as stableStringify, j as publicCliCommand, k as normalizePublicCliProse, n as DEFAULT_SERVER, t as BaseCommand, u as detectHealthyLocalServer } from "../oclif-JlsN1lfO.mjs";
|
|
4
|
+
import { i as claimState, n as claimBoxAction, o as claimWindowDeadline, r as claimCommand, t as claimAction } from "../claim-state-B6ZSKmhW.mjs";
|
|
5
|
+
import { n as customizeAndPublishActions, r as verifyLoginAction, t as brandingGuidanceAction } from "../journey-guidance-C9MxJNTg.mjs";
|
|
6
|
+
import { i as RENDERER_IDS, n as inspectScaffoldTarget, r as AVAILABLE_RENDERER_IDS, s as issuerFromPort, t as createOrca } from "../orca-CPMHzmg3.mjs";
|
|
7
|
+
import { n as hasZitadelSecret, t as hasZitadelConfig } from "../project-Ba0nriNm.mjs";
|
|
8
|
+
import { a as updateState, t as SCHEMAS_DIR } from "../user-schema-C2mC-JTN.mjs";
|
|
9
|
+
import { a as runPackageCommand, c as writeScaffoldManifest, i as installCommandFor, n as detectPackageManager, r as devCommandFor } from "../package-manager-CDUsoGBy.mjs";
|
|
10
|
+
import { i as toBrandingWireBody, t as BRANDING_DIR } from "../branding-DvoH8e0D.mjs";
|
|
11
|
+
import { c as writeBackResource, o as hashForState, u as FLOWS_DIR } from "../sync-ChlLQ4vZ.mjs";
|
|
11
12
|
import { mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
12
13
|
import { basename, dirname, join } from "node:path";
|
|
13
14
|
import { cancel, confirm, intro, isCancel, outro, select, spinner, text } from "@clack/prompts";
|
|
@@ -15,9 +16,9 @@ import { Flags } from "@oclif/core";
|
|
|
15
16
|
import { createZitadelClient } from "@zitadel/api/client";
|
|
16
17
|
import { BRANDING_DESIGNS, DEFAULT_BRANDING_CONFIG_PATH, DEFAULT_BRANDING_TEMPLATE_PATH, DEFAULT_FLOW_CONFIG_PATH, DEFAULT_FLOW_SCHEMA_URI, DEFAULT_SCHEMA_CONFIG_PATH, DEFAULT_SETUP_PRESET, DEFAULT_SETUP_USE_CASE, SETUP_PRESETS, SETUP_USE_CASES, brandingReadmeContent, flowsReadmeContent, getDefaultBrandingConfig, getDefaultHumanUserSchema, getDefaultLoginFlow, schemasReadmeContent } from "@zitadel/config/defaults";
|
|
17
18
|
import { consola as consola$1 } from "consola";
|
|
19
|
+
import pc from "picocolors";
|
|
18
20
|
import { BRANDING_FILE_SCHEMA_REF } from "@zitadel/config/meta-schemas";
|
|
19
21
|
import { normalizeFlowBody, normalizeSchemaBody } from "@zitadel/config/normalize";
|
|
20
|
-
import pc from "picocolors";
|
|
21
22
|
//#region src/lib/orca/patchers/posture.ts
|
|
22
23
|
/**
|
|
23
24
|
* Frameworks whose patchers add route files without owning the app shell —
|
|
@@ -237,11 +238,25 @@ function outcome(input) {
|
|
|
237
238
|
`Start your project: ${input.devCommand} (then open ${input.issuer}/login)`,
|
|
238
239
|
verifyLoginAction()
|
|
239
240
|
];
|
|
240
|
-
const
|
|
241
|
+
const boxActions = [
|
|
242
|
+
...input.includeInstallCommand ? [{
|
|
243
|
+
text: "Install dependencies:",
|
|
244
|
+
command: input.install.command
|
|
245
|
+
}] : [],
|
|
246
|
+
{
|
|
247
|
+
text: `Start your project (then open ${input.issuer}/login):`,
|
|
248
|
+
command: input.devCommand
|
|
249
|
+
},
|
|
250
|
+
{ text: verifyLoginAction() },
|
|
251
|
+
{
|
|
252
|
+
text: "Once login works, this shows your next steps (customizing is covered in your README's Zitadel section):",
|
|
253
|
+
command: statusCommand
|
|
254
|
+
}
|
|
255
|
+
];
|
|
241
256
|
return {
|
|
242
257
|
install: input.install,
|
|
243
258
|
devCommand: input.devCommand,
|
|
244
|
-
boxActions
|
|
259
|
+
boxActions,
|
|
245
260
|
nextActions: [...verifyActions, ...customizeAndPublishActions(input.cliVersion)],
|
|
246
261
|
nextCommands: input.includeInstallCommand ? [
|
|
247
262
|
input.install.command,
|
|
@@ -936,14 +951,17 @@ var Setup = class Setup extends BaseCommand {
|
|
|
936
951
|
package_manager: installOutcome.install.package_manager
|
|
937
952
|
});
|
|
938
953
|
const writtenRel = allFilesWritten.map((file) => relativeDisplayPath(cwd, file));
|
|
954
|
+
const deadline = dryRun ? void 0 : claimWindowDeadline(project.created_at);
|
|
939
955
|
const claimNudge = claimState({
|
|
940
956
|
secret: {},
|
|
941
957
|
server: answers.server
|
|
942
|
-
}).kind === "detached" ? {
|
|
943
|
-
actions: [claimAction(this.meta.cliVersion)],
|
|
958
|
+
}).kind === "detached" || serverKind.value(answers.server) === "local" && (dryRun || await localServerHostsPlatform(answers.server)) ? {
|
|
959
|
+
actions: [claimAction(this.meta.cliVersion, deadline)],
|
|
960
|
+
boxActions: [claimBoxAction(this.meta.cliVersion, deadline)],
|
|
944
961
|
commands: [claimCommand(this.meta.cliVersion)]
|
|
945
962
|
} : {
|
|
946
963
|
actions: [],
|
|
964
|
+
boxActions: [],
|
|
947
965
|
commands: []
|
|
948
966
|
};
|
|
949
967
|
const warnings = designWarnings(answers.design);
|
|
@@ -959,11 +977,11 @@ var Setup = class Setup extends BaseCommand {
|
|
|
959
977
|
});
|
|
960
978
|
consola$1.box({
|
|
961
979
|
title: "Zitadel is ready",
|
|
962
|
-
message: [
|
|
980
|
+
message: wrapForBox([
|
|
963
981
|
renderSummary(sections),
|
|
964
982
|
"",
|
|
965
|
-
[...installOutcome.boxActions, ...claimNudge.
|
|
966
|
-
].join("\n"),
|
|
983
|
+
renderBoxActions([...installOutcome.boxActions, ...claimNudge.boxActions])
|
|
984
|
+
].join("\n")),
|
|
967
985
|
style: {
|
|
968
986
|
padding: 1,
|
|
969
987
|
borderStyle: "rounded",
|
|
@@ -1023,6 +1041,26 @@ async function resolveScaffoldFramework(framework, nonInteractive, orca) {
|
|
|
1023
1041
|
if (nonInteractive) throw new ZitadelError("E_FRAMEWORK_NOT_DETECTED", "Empty directory — pass --framework", { hint: "Run without --json/--non-interactive to choose from a prompt, or pass --framework for scripted setup." });
|
|
1024
1042
|
return new PickFrameworkPrompt().ask(orca.availableFrameworks());
|
|
1025
1043
|
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Whether a local server hosts the platform plane, i.e. whether a claim
|
|
1046
|
+
* started against it can actually complete. `platform.bootstrap_project`
|
|
1047
|
+
* pins the deployment's default project to the well-known proj_platform, and
|
|
1048
|
+
* the console runtime document publishes that resolution, so one public GET
|
|
1049
|
+
* answers the question. Fail closed: an unreadable, absent, or hanging
|
|
1050
|
+
* document means no nudge, never a nudge into a flow that would 401 at
|
|
1051
|
+
* claim/complete — the timeout mirrors checkLocalServerHealth so a socket
|
|
1052
|
+
* that accepts and stalls cannot hang setup after the real work is done.
|
|
1053
|
+
* Exported so the fail-closed behavior is testable without a live server.
|
|
1054
|
+
*/
|
|
1055
|
+
async function localServerHostsPlatform(server, timeoutMs = 1500) {
|
|
1056
|
+
try {
|
|
1057
|
+
const res = await fetch(new URL("/console/runtime.json", server), { signal: AbortSignal.timeout(timeoutMs) });
|
|
1058
|
+
if (!res.ok) return false;
|
|
1059
|
+
return (await res.json()).console_project_id === "proj_platform";
|
|
1060
|
+
} catch {
|
|
1061
|
+
return false;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1026
1064
|
/** A deterministic stand-in project for `--dry-run`, so no remote call is made. */
|
|
1027
1065
|
function dryRunProject(issuer) {
|
|
1028
1066
|
return {
|
|
@@ -1266,6 +1304,6 @@ function buildSummary(opts) {
|
|
|
1266
1304
|
];
|
|
1267
1305
|
}
|
|
1268
1306
|
//#endregion
|
|
1269
|
-
export { Setup as default };
|
|
1307
|
+
export { Setup as default, localServerHostsPlatform };
|
|
1270
1308
|
|
|
1271
1309
|
//# sourceMappingURL=setup.mjs.map
|