@zitadel/cli 0.1.0-alpha.13 → 0.1.0-alpha.15

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.
Files changed (43) hide show
  1. package/README.md +137 -57
  2. package/SKILLS.md +26 -13
  3. package/dist/commands/apply.mjs +11 -6
  4. package/dist/commands/apply.mjs.map +1 -1
  5. package/dist/commands/doctor.mjs +89 -12
  6. package/dist/commands/doctor.mjs.map +1 -1
  7. package/dist/commands/eject.mjs +4 -4
  8. package/dist/commands/logs.mjs +2 -2
  9. package/dist/commands/plan.mjs +6 -4
  10. package/dist/commands/plan.mjs.map +1 -1
  11. package/dist/commands/reset.mjs +2 -2
  12. package/dist/commands/schemas/list.mjs +134 -0
  13. package/dist/commands/schemas/list.mjs.map +1 -0
  14. package/dist/commands/setup.mjs +158 -23
  15. package/dist/commands/setup.mjs.map +1 -1
  16. package/dist/commands/start.mjs +4 -4
  17. package/dist/commands/status.mjs +3 -3
  18. package/dist/commands/stop.mjs +3 -3
  19. package/dist/{docker-Djz6BLp9.mjs → docker-D7BSD5C9.mjs} +3 -3
  20. package/dist/{docker-Djz6BLp9.mjs.map → docker-D7BSD5C9.mjs.map} +1 -1
  21. package/dist/{docker-guidance-D-33g1uV.mjs → docker-guidance-mcTT3_0E.mjs} +2 -2
  22. package/dist/{docker-guidance-D-33g1uV.mjs.map → docker-guidance-mcTT3_0E.mjs.map} +1 -1
  23. package/dist/environment-BQF7LeCz.mjs +17 -0
  24. package/dist/environment-BQF7LeCz.mjs.map +1 -0
  25. package/dist/{oclif-BoUVygsZ.mjs → oclif-Bm-FkF6z.mjs} +66 -13
  26. package/dist/oclif-Bm-FkF6z.mjs.map +1 -0
  27. package/dist/{orca-DU8myWGm.mjs → orca-CpXj_XsA.mjs} +46 -94
  28. package/dist/orca-CpXj_XsA.mjs.map +1 -0
  29. package/dist/{ports-B09RjuHx.mjs → ports-CxBKS1ga.mjs} +1 -1
  30. package/dist/{ports-B09RjuHx.mjs.map → ports-CxBKS1ga.mjs.map} +1 -1
  31. package/dist/{processes-Cw8TO1SY.mjs → processes-BVqYsxT8.mjs} +1 -1
  32. package/dist/{processes-Cw8TO1SY.mjs.map → processes-BVqYsxT8.mjs.map} +1 -1
  33. package/dist/{project-B1qVQMKS.mjs → project-Dk7V0xka.mjs} +3 -3
  34. package/dist/{project-B1qVQMKS.mjs.map → project-Dk7V0xka.mjs.map} +1 -1
  35. package/dist/{sync-B8Z2it_E.mjs → sync-CYuHVQT5.mjs} +344 -116
  36. package/dist/sync-CYuHVQT5.mjs.map +1 -0
  37. package/dist/user-schema-DDz5-lX5.mjs +13 -0
  38. package/dist/user-schema-DDz5-lX5.mjs.map +1 -0
  39. package/oclif.manifest.json +106 -1
  40. package/package.json +6 -5
  41. package/dist/oclif-BoUVygsZ.mjs.map +0 -1
  42. package/dist/orca-DU8myWGm.mjs.map +0 -1
  43. package/dist/sync-B8Z2it_E.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
- import { C as isObject, E as ZitadelError, T as stableStringify, n as DEFAULT_SERVER, w as parseJsonObject, x as MANAGED_MARKER, y as npmDistTagForCliVersion } from "./oclif-BoUVygsZ.mjs";
2
- import { basename, dirname, join } from "node:path";
1
+ import { C as isObject, E as ZitadelError, T as stableStringify, n as DEFAULT_SERVER, w as parseJsonObject, x as MANAGED_MARKER, y as npmDistTagForCliVersion } from "./oclif-Bm-FkF6z.mjs";
3
2
  import { chmod, mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
3
+ import { basename, dirname, join } from "node:path";
4
4
  import { builders, generateCode, parseModule } from "magicast";
5
5
  import { spawnSync } from "node:child_process";
6
6
  //#region src/lib/orca/detectors/package-json.ts
@@ -632,10 +632,9 @@ var AbstractRulePatcher = class {
632
632
  /**
633
633
  * The framework-agnostic `.zitadel/` base files every rule patcher writes:
634
634
  * the project secret, `zitadel.json`, env templates, and an empty sync
635
- * state. The `schemas/` and `flows/` directories are created empty — the
636
- * server provisions the default user schema and flow definition when the
637
- * project is created, so nothing is scaffolded into them here. Pure: no
638
- * filesystem or network.
635
+ * state. The `schemas/` and `flows/` directories are created empty here;
636
+ * setup fills them from versioned local defaults after patching.
637
+ * Pure: no filesystem or network.
639
638
  */
640
639
  baseOps(ctx) {
641
640
  return [
@@ -934,14 +933,14 @@ function appComponentTemplate(projectId) {
934
933
  import { Component } from "@angular/core";
935
934
  import {
936
935
  ZitadelLoginComponent,
937
- ZitadelLogoutComponent,
936
+ ZitadelSessionComponent,
938
937
  configureZitadel,
939
938
  } from "@zitadel/sdk-angular";
940
939
 
941
940
  @Component({
942
941
  selector: "app-root",
943
942
  standalone: true,
944
- imports: [ZitadelLoginComponent, ZitadelLogoutComponent],
943
+ imports: [ZitadelLoginComponent, ZitadelSessionComponent],
945
944
  templateUrl: "./app.html",
946
945
  })
947
946
  export class App {
@@ -973,7 +972,10 @@ function appTemplateHtml() {
973
972
  </main>
974
973
  } @else if (path.startsWith('/profile')) {
975
974
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
976
- <zitadel-auth-logout [project]="project" [postSignOutUrl]="'/login'"></zitadel-auth-logout>
975
+ <zitadel-auth-session
976
+ [project]="project"
977
+ [postSignOutUrl]="'/login'"
978
+ ></zitadel-auth-session>
977
979
  </div>
978
980
  } @else if (path.startsWith('/register')) {
979
981
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
@@ -1215,8 +1217,8 @@ export default function ${mode === "login" ? "LoginPage" : "RegisterPage"}() {
1215
1217
  //#region src/lib/orca/patchers/rule/next/renderers/react/index.ts
1216
1218
  /**
1217
1219
  * The Next.js App Router renderer scaffolds `/login`, `/register`, and
1218
- * `/profile` pages that drive the `<zitadel-login>` and `<zitadel-logout>`
1219
- * Lit web components.
1220
+ * `/profile` pages that drive the `<zitadel-login>` and `<zitadel-session>`
1221
+ * Lit web components. `/profile` is the post-sign-in "signed in as" card.
1220
1222
  *
1221
1223
  * Each page is a single client component (`"use client"`) that, inside a
1222
1224
  * `next/dynamic({ ssr: false })` loader, builds the SDK project handle with
@@ -1302,24 +1304,20 @@ export default function ${componentName}() {
1302
1304
  "use client";
1303
1305
 
1304
1306
  import dynamic from "next/dynamic";
1305
- import { useEffect, useState } from "react";
1306
-
1307
- type SessionProof = {
1308
- session_id?: string;
1309
- state?: string;
1310
- user_id?: string;
1311
- };
1312
1307
 
1313
- const ZitadelLogout = dynamic(
1308
+ const ZitadelSession = dynamic(
1314
1309
  async () => {
1315
1310
  const { configureZitadel } = await import("@zitadel/sdk-next/client");
1311
+ // Build the SDK project handle and pass it to the session card via the
1312
+ // \`project\` prop. The card reads identity from "/__nextgen/sessions/me"
1313
+ // and exposes a Sign out action.
1316
1314
  const project = configureZitadel({
1317
1315
  projectId: process.env.NEXT_PUBLIC_ZITADEL_PROJECT_ID ?? "",
1318
1316
  proxyPath: "/__nextgen",
1319
1317
  });
1320
- return function ZitadelLogoutElement() {
1318
+ return function ZitadelSessionElement() {
1321
1319
  return (
1322
- <zitadel-logout
1320
+ <zitadel-session
1323
1321
  project={project}
1324
1322
  post-sign-out-url="/login"
1325
1323
  />
@@ -1330,60 +1328,9 @@ const ZitadelLogout = dynamic(
1330
1328
  );
1331
1329
 
1332
1330
  export default function ProfilePage() {
1333
- const [session, setSession] = useState<SessionProof | null>(null);
1334
- const [sessionError, setSessionError] = useState("");
1335
-
1336
- useEffect(() => {
1337
- let cancelled = false;
1338
-
1339
- fetch("/__nextgen/sessions/me", { cache: "no-store" })
1340
- .then(async (response) => {
1341
- if (!response.ok) {
1342
- throw new Error("Session check failed: " + String(response.status));
1343
- }
1344
- return response.json() as Promise<SessionProof>;
1345
- })
1346
- .then((nextSession) => {
1347
- if (!cancelled) {
1348
- setSession(nextSession);
1349
- }
1350
- })
1351
- .catch((error: unknown) => {
1352
- if (!cancelled) {
1353
- setSessionError(error instanceof Error ? error.message : "Session check failed");
1354
- }
1355
- });
1356
-
1357
- return () => {
1358
- cancelled = true;
1359
- };
1360
- }, []);
1361
-
1362
1331
  return (
1363
- <main style={{ minHeight: "100vh", colorScheme: "dark", background: "#0f0f11", color: "#f4f4f6", padding: "48px", fontFamily: "system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif" }}>
1364
- <div style={{ maxWidth: "680px", margin: "0 auto" }}>
1365
- <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "24px" }}>
1366
- <h1 style={{ fontSize: "24px", fontWeight: 700, margin: 0, color: "#f4f4f6" }}>Signed in</h1>
1367
- <ZitadelLogout />
1368
- </div>
1369
- <p style={{ color: "#33a779", fontWeight: 600 }}>Signed in profile loaded.</p>
1370
- {session ? (
1371
- <dl style={{ display: "grid", gap: "12px", marginTop: "24px" }}>
1372
- <div>
1373
- <dt style={{ color: "#bfbfcf", fontSize: "14px" }}>Session state</dt>
1374
- <dd style={{ margin: 0, fontWeight: 600, color: "#f4f4f6" }}>{session.state ?? "active"}</dd>
1375
- </div>
1376
- <div>
1377
- <dt style={{ color: "#bfbfcf", fontSize: "14px" }}>User id</dt>
1378
- <dd style={{ margin: 0, fontFamily: "monospace", color: "#f4f4f6" }}>{session.user_id ?? "available"}</dd>
1379
- </div>
1380
- </dl>
1381
- ) : (
1382
- <p style={{ color: sessionError ? "#ea4f70" : "#bfbfcf" }}>
1383
- {sessionError || "Checking session..."}
1384
- </p>
1385
- )}
1386
- </div>
1332
+ <main style={{ minHeight: "100vh", colorScheme: "dark", background: "#0f0f11" }}>
1333
+ <ZitadelSession />
1387
1334
  </main>
1388
1335
  );
1389
1336
  }
@@ -1407,6 +1354,12 @@ declare module "react" {
1407
1354
  project?: ZitadelProject;
1408
1355
  "post-sign-out-url"?: string;
1409
1356
  };
1357
+ "zitadel-session": React.HTMLAttributes<HTMLElement> & {
1358
+ project?: ZitadelProject;
1359
+ "post-sign-out-url"?: string;
1360
+ heading?: string;
1361
+ "logout-label"?: string;
1362
+ };
1410
1363
  }
1411
1364
  }
1412
1365
  }
@@ -1787,7 +1740,7 @@ function loginPageTemplate() {
1787
1740
  function registerPageTemplate() {
1788
1741
  return authPage("register");
1789
1742
  }
1790
- /** `pages/profile.vue` — the signed-in view with the logout widget. */
1743
+ /** `pages/profile.vue` — the post-sign-in "signed in as" session card. */
1791
1744
  function profilePageTemplate() {
1792
1745
  return `<script setup lang="ts">
1793
1746
  ${MANAGED_MARKER}
@@ -1797,10 +1750,9 @@ const project = useZitadelProject();
1797
1750
  <\/script>
1798
1751
 
1799
1752
  <template>
1800
- <main style="${MAIN_STYLE}; padding: 24px">
1801
- <h1>Signed in (Nuxt)</h1>
1753
+ <main style="${MAIN_STYLE}">
1802
1754
  <ClientOnly>
1803
- <zitadel-logout :project="project" post-sign-out-url="/login" />
1755
+ <zitadel-session :project="project" post-sign-out-url="/login" />
1804
1756
  </ClientOnly>
1805
1757
  </main>
1806
1758
  </template>
@@ -2043,7 +1995,7 @@ function buildViteProxyOp(devPort, server) {
2043
1995
  /**
2044
1996
  * The managed `src/app.tsx`: a minimal path-based router that renders the
2045
1997
  * `@zitadel/sdk-qwik` widgets — a landing chooser at `/`, login at `/login`,
2046
- * register at `/register`, and the logout widget at `/profile`. Exports a named `App`
1998
+ * register at `/register`, and the signed-in session card at `/profile`. Exports a named `App`
2047
1999
  * (`component$`) to match the create-vite Qwik entry (`main.tsx` imports
2048
2000
  * `{ App }`). The project id comes from `VITE_ZITADEL_PROJECT_ID`. No secret
2049
2001
  * reaches the browser: the dev proxy in `vite.config.*` attaches the project
@@ -2052,7 +2004,7 @@ function buildViteProxyOp(devPort, server) {
2052
2004
  function appTemplate$4() {
2053
2005
  return `${MANAGED_MARKER}
2054
2006
  import { component$ } from "@builder.io/qwik";
2055
- import { ZitadelLogin, ZitadelLogout, configureZitadel } from "@zitadel/sdk-qwik";
2007
+ import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-qwik";
2056
2008
 
2057
2009
  const project = configureZitadel({
2058
2010
  projectId: import.meta.env.VITE_ZITADEL_PROJECT_ID,
@@ -2080,7 +2032,7 @@ export const App = component$(() => {
2080
2032
  if (path.startsWith("/profile")) {
2081
2033
  return (
2082
2034
  <div style={{ position: "fixed", inset: "0", overflow: "auto", background: "#0f0f11", colorScheme: "dark" }}>
2083
- <ZitadelLogout project={project} postSignOutUrl="/login" />
2035
+ <ZitadelSession project={project} postSignOutUrl="/login" />
2084
2036
  </div>
2085
2037
  );
2086
2038
  }
@@ -2169,7 +2121,7 @@ var QwikPatcher = class extends AbstractRulePatcher {
2169
2121
  /**
2170
2122
  * The managed `src/App.tsx`: a minimal path-based router that renders the
2171
2123
  * `@zitadel/sdk-react` widgets — a landing chooser at `/`, login at `/login`,
2172
- * register at `/register`, and the logout widget at `/profile`. The project id comes from
2124
+ * register at `/register`, and the signed-in session card at `/profile`. The project id comes from
2173
2125
  * `VITE_ZITADEL_PROJECT_ID` (Vite only exposes `VITE_`-prefixed env to the
2174
2126
  * client). No secret reaches the browser: the dev proxy in `vite.config.*`
2175
2127
  * attaches the project service-key secret (from `ZITADEL_PROJECT_SECRET`)
@@ -2177,7 +2129,7 @@ var QwikPatcher = class extends AbstractRulePatcher {
2177
2129
  */
2178
2130
  function appTemplate$3() {
2179
2131
  return `${MANAGED_MARKER}
2180
- import { ZitadelLogin, ZitadelLogout, configureZitadel } from "@zitadel/sdk-react";
2132
+ import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-react";
2181
2133
 
2182
2134
  const project = configureZitadel({
2183
2135
  projectId: import.meta.env.VITE_ZITADEL_PROJECT_ID,
@@ -2205,7 +2157,7 @@ export default function App() {
2205
2157
  if (path.startsWith("/profile")) {
2206
2158
  return (
2207
2159
  <div style={{ position: "fixed", inset: 0, overflow: "auto", background: "#0f0f11", colorScheme: "dark" }}>
2208
- <ZitadelLogout project={project} postSignOutUrl="/login" />
2160
+ <ZitadelSession project={project} postSignOutUrl="/login" />
2209
2161
  </div>
2210
2162
  );
2211
2163
  }
@@ -2292,7 +2244,7 @@ var ReactPatcher = class extends AbstractRulePatcher {
2292
2244
  /**
2293
2245
  * The managed `src/App.tsx`: a minimal path-based router that renders the
2294
2246
  * `@zitadel/sdk-solid` widgets — a landing chooser at `/`, login at `/login`,
2295
- * register at `/register`, and the logout widget at `/profile`. The project id comes from
2247
+ * register at `/register`, and the signed-in session card at `/profile`. The project id comes from
2296
2248
  * `VITE_ZITADEL_PROJECT_ID` (Vite only exposes `VITE_`-prefixed env to the
2297
2249
  * client). No secret reaches the browser: the dev proxy in `vite.config.*`
2298
2250
  * attaches the project service-key secret (from `ZITADEL_PROJECT_SECRET`)
@@ -2300,7 +2252,7 @@ var ReactPatcher = class extends AbstractRulePatcher {
2300
2252
  */
2301
2253
  function appTemplate$2() {
2302
2254
  return `${MANAGED_MARKER}
2303
- import { ZitadelLogin, ZitadelLogout, configureZitadel } from "@zitadel/sdk-solid";
2255
+ import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-solid";
2304
2256
 
2305
2257
  const project = configureZitadel({
2306
2258
  projectId: import.meta.env.VITE_ZITADEL_PROJECT_ID,
@@ -2328,7 +2280,7 @@ export default function App() {
2328
2280
  if (path.startsWith("/profile")) {
2329
2281
  return (
2330
2282
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
2331
- <ZitadelLogout project={project} postSignOutUrl="/login" />
2283
+ <ZitadelSession project={project} postSignOutUrl="/login" />
2332
2284
  </div>
2333
2285
  );
2334
2286
  }
@@ -2415,7 +2367,7 @@ var SolidPatcher = class extends AbstractRulePatcher {
2415
2367
  /**
2416
2368
  * The managed `src/App.svelte`: a minimal path-based router that renders the
2417
2369
  * `@zitadel/sdk-svelte` widgets — a landing chooser at `/`, login at `/login`,
2418
- * register at `/register`, and the logout widget at `/profile`. The managed marker lives in
2370
+ * register at `/register`, and the signed-in session card at `/profile`. The managed marker lives in
2419
2371
  * the `<script lang="ts">` block (a JS comment) so eject/doctor stay
2420
2372
  * marker-aware. The project id comes from `VITE_ZITADEL_PROJECT_ID`. No secret
2421
2373
  * reaches the browser: the dev proxy in `vite.config.*` attaches the project
@@ -2424,7 +2376,7 @@ var SolidPatcher = class extends AbstractRulePatcher {
2424
2376
  function appTemplate$1() {
2425
2377
  return `<script lang="ts">
2426
2378
  ${MANAGED_MARKER}
2427
- import { ZitadelLogin, ZitadelLogout, configureZitadel } from "@zitadel/sdk-svelte";
2379
+ import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-svelte";
2428
2380
 
2429
2381
  const project = configureZitadel({
2430
2382
  projectId: import.meta.env.VITE_ZITADEL_PROJECT_ID,
@@ -2448,7 +2400,7 @@ const path = window.location.pathname;
2448
2400
  </main>
2449
2401
  {:else if path.startsWith("/profile")}
2450
2402
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
2451
- <ZitadelLogout {project} postSignOutUrl="/login" />
2403
+ <ZitadelSession {project} postSignOutUrl="/login" />
2452
2404
  </div>
2453
2405
  {:else if path.startsWith("/register")}
2454
2406
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
@@ -2529,7 +2481,7 @@ var SveltePatcher = class extends AbstractRulePatcher {
2529
2481
  /**
2530
2482
  * The managed `src/App.vue`: a minimal path-based router that renders the
2531
2483
  * `@zitadel/sdk-vue` widgets — a landing chooser at `/`, login at `/login`,
2532
- * register at `/register`, and the logout widget at `/profile`. The managed marker lives in
2484
+ * register at `/register`, and the signed-in session card at `/profile`. The managed marker lives in
2533
2485
  * the `<script setup>` block (a JS comment) so eject/doctor stay marker-aware.
2534
2486
  * The project id comes from `VITE_ZITADEL_PROJECT_ID`. No secret reaches the
2535
2487
  * browser: the dev proxy in `vite.config.*` attaches the project service-key
@@ -2538,7 +2490,7 @@ var SveltePatcher = class extends AbstractRulePatcher {
2538
2490
  function appTemplate() {
2539
2491
  return `<script setup lang="ts">
2540
2492
  ${MANAGED_MARKER}
2541
- import { ZitadelLogin, ZitadelLogout, configureZitadel } from "@zitadel/sdk-vue";
2493
+ import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-vue";
2542
2494
 
2543
2495
  const project = configureZitadel({
2544
2496
  projectId: import.meta.env.VITE_ZITADEL_PROJECT_ID,
@@ -2567,7 +2519,7 @@ const path = window.location.pathname;
2567
2519
  v-else-if="path.startsWith('/profile')"
2568
2520
  style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark"
2569
2521
  >
2570
- <ZitadelLogout :project="project" postSignOutUrl="/login" />
2522
+ <ZitadelSession :project="project" postSignOutUrl="/login" />
2571
2523
  </div>
2572
2524
  <div
2573
2525
  v-else-if="path.startsWith('/register')"
@@ -3218,4 +3170,4 @@ function isErrno(error, code) {
3218
3170
  //#endregion
3219
3171
  export { issuerFromPort as i, inspectScaffoldTarget as n, RENDERER_IDS as r, createOrca as t };
3220
3172
 
3221
- //# sourceMappingURL=orca-DU8myWGm.mjs.map
3173
+ //# sourceMappingURL=orca-CpXj_XsA.mjs.map