create-authenik8-app 2.4.14 → 2.4.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 (227) hide show
  1. package/README.md +34 -516
  2. package/dist/src/bin/cli.d.ts +3 -0
  3. package/dist/src/bin/cli.d.ts.map +1 -0
  4. package/dist/src/bin/cli.js +112 -0
  5. package/dist/src/bin/cli.js.map +1 -0
  6. package/dist/src/bin/index.js +108 -23
  7. package/dist/src/bin/index.js.map +1 -1
  8. package/dist/src/commands/add/apply.d.ts +6 -0
  9. package/dist/src/commands/add/apply.d.ts.map +1 -0
  10. package/dist/src/commands/add/apply.js +123 -0
  11. package/dist/src/commands/add/apply.js.map +1 -0
  12. package/dist/src/commands/add/ci.d.ts +6 -0
  13. package/dist/src/commands/add/ci.d.ts.map +1 -0
  14. package/dist/src/commands/add/ci.js +108 -0
  15. package/dist/src/commands/add/ci.js.map +1 -0
  16. package/dist/src/commands/add/context.d.ts +5 -0
  17. package/dist/src/commands/add/context.d.ts.map +1 -0
  18. package/dist/src/commands/add/context.js +19 -0
  19. package/dist/src/commands/add/context.js.map +1 -0
  20. package/dist/src/commands/add/diff.d.ts +4 -0
  21. package/dist/src/commands/add/diff.d.ts.map +1 -0
  22. package/dist/src/commands/add/diff.js +114 -0
  23. package/dist/src/commands/add/diff.js.map +1 -0
  24. package/dist/src/commands/add/index.d.ts +6 -0
  25. package/dist/src/commands/add/index.d.ts.map +1 -0
  26. package/dist/src/commands/add/index.js +61 -0
  27. package/dist/src/commands/add/index.js.map +1 -0
  28. package/dist/src/commands/add/output.d.ts +5 -0
  29. package/dist/src/commands/add/output.d.ts.map +1 -0
  30. package/dist/src/commands/add/output.js +58 -0
  31. package/dist/src/commands/add/output.js.map +1 -0
  32. package/dist/src/commands/add/plan.d.ts +6 -0
  33. package/dist/src/commands/add/plan.d.ts.map +1 -0
  34. package/dist/src/commands/add/plan.js +93 -0
  35. package/dist/src/commands/add/plan.js.map +1 -0
  36. package/dist/src/commands/add/registry.d.ts +4 -0
  37. package/dist/src/commands/add/registry.d.ts.map +1 -0
  38. package/dist/src/commands/add/registry.js +37 -0
  39. package/dist/src/commands/add/registry.js.map +1 -0
  40. package/dist/src/commands/add/types.d.ts +37 -0
  41. package/dist/src/commands/add/types.d.ts.map +1 -0
  42. package/dist/src/commands/add/types.js +2 -0
  43. package/dist/src/commands/add/types.js.map +1 -0
  44. package/dist/src/commands/doctor/checks.d.ts +3 -0
  45. package/dist/src/commands/doctor/checks.d.ts.map +1 -0
  46. package/dist/src/commands/doctor/checks.js +353 -0
  47. package/dist/src/commands/doctor/checks.js.map +1 -0
  48. package/dist/src/commands/doctor/context.d.ts +5 -0
  49. package/dist/src/commands/doctor/context.d.ts.map +1 -0
  50. package/dist/src/commands/doctor/context.js +134 -0
  51. package/dist/src/commands/doctor/context.js.map +1 -0
  52. package/dist/src/commands/doctor/index.d.ts +9 -0
  53. package/dist/src/commands/doctor/index.d.ts.map +1 -0
  54. package/dist/src/commands/doctor/index.js +80 -0
  55. package/dist/src/commands/doctor/index.js.map +1 -0
  56. package/dist/src/commands/doctor/output.d.ts +4 -0
  57. package/dist/src/commands/doctor/output.d.ts.map +1 -0
  58. package/dist/src/commands/doctor/output.js +53 -0
  59. package/dist/src/commands/doctor/output.js.map +1 -0
  60. package/dist/src/commands/doctor/postGeneration.d.ts +7 -0
  61. package/dist/src/commands/doctor/postGeneration.d.ts.map +1 -0
  62. package/dist/src/commands/doctor/postGeneration.js +22 -0
  63. package/dist/src/commands/doctor/postGeneration.js.map +1 -0
  64. package/dist/src/commands/doctor/services.d.ts +5 -0
  65. package/dist/src/commands/doctor/services.d.ts.map +1 -0
  66. package/dist/src/commands/doctor/services.js +80 -0
  67. package/dist/src/commands/doctor/services.js.map +1 -0
  68. package/dist/src/commands/doctor/types.d.ts +69 -0
  69. package/dist/src/commands/doctor/types.d.ts.map +1 -0
  70. package/dist/src/commands/doctor/types.js +2 -0
  71. package/dist/src/commands/doctor/types.js.map +1 -0
  72. package/dist/src/commands/upgrade/context.d.ts +5 -0
  73. package/dist/src/commands/upgrade/context.d.ts.map +1 -0
  74. package/dist/src/commands/upgrade/context.js +57 -0
  75. package/dist/src/commands/upgrade/context.js.map +1 -0
  76. package/dist/src/commands/upgrade/index.d.ts +7 -0
  77. package/dist/src/commands/upgrade/index.d.ts.map +1 -0
  78. package/dist/src/commands/upgrade/index.js +35 -0
  79. package/dist/src/commands/upgrade/index.js.map +1 -0
  80. package/dist/src/commands/upgrade/migrations.d.ts +4 -0
  81. package/dist/src/commands/upgrade/migrations.d.ts.map +1 -0
  82. package/dist/src/commands/upgrade/migrations.js +22 -0
  83. package/dist/src/commands/upgrade/migrations.js.map +1 -0
  84. package/dist/src/commands/upgrade/output.d.ts +4 -0
  85. package/dist/src/commands/upgrade/output.d.ts.map +1 -0
  86. package/dist/src/commands/upgrade/output.js +52 -0
  87. package/dist/src/commands/upgrade/output.js.map +1 -0
  88. package/dist/src/commands/upgrade/plan.d.ts +3 -0
  89. package/dist/src/commands/upgrade/plan.d.ts.map +1 -0
  90. package/dist/src/commands/upgrade/plan.js +119 -0
  91. package/dist/src/commands/upgrade/plan.js.map +1 -0
  92. package/dist/src/commands/upgrade/types.d.ts +48 -0
  93. package/dist/src/commands/upgrade/types.d.ts.map +1 -0
  94. package/dist/src/commands/upgrade/types.js +2 -0
  95. package/dist/src/commands/upgrade/types.js.map +1 -0
  96. package/dist/src/lib/args.d.ts +21 -0
  97. package/dist/src/lib/args.d.ts.map +1 -1
  98. package/dist/src/lib/args.js +119 -1
  99. package/dist/src/lib/args.js.map +1 -1
  100. package/dist/src/lib/constants.d.ts +1 -1
  101. package/dist/src/lib/constants.d.ts.map +1 -1
  102. package/dist/src/lib/constants.js +3 -1
  103. package/dist/src/lib/constants.js.map +1 -1
  104. package/dist/src/lib/expressOAuth.d.ts +10 -0
  105. package/dist/src/lib/expressOAuth.d.ts.map +1 -0
  106. package/dist/src/lib/expressOAuth.js +164 -0
  107. package/dist/src/lib/expressOAuth.js.map +1 -0
  108. package/dist/src/lib/interruption.d.ts +14 -0
  109. package/dist/src/lib/interruption.d.ts.map +1 -0
  110. package/dist/src/lib/interruption.js +16 -0
  111. package/dist/src/lib/interruption.js.map +1 -0
  112. package/dist/src/lib/nonInteractive.d.ts +8 -0
  113. package/dist/src/lib/nonInteractive.d.ts.map +1 -0
  114. package/dist/src/lib/nonInteractive.js +111 -0
  115. package/dist/src/lib/nonInteractive.js.map +1 -0
  116. package/dist/src/lib/oauth.d.ts +9 -0
  117. package/dist/src/lib/oauth.d.ts.map +1 -0
  118. package/dist/src/lib/oauth.js +62 -0
  119. package/dist/src/lib/oauth.js.map +1 -0
  120. package/dist/src/lib/onboarding.d.ts +8 -0
  121. package/dist/src/lib/onboarding.d.ts.map +1 -0
  122. package/dist/src/lib/onboarding.js +35 -0
  123. package/dist/src/lib/onboarding.js.map +1 -0
  124. package/dist/src/lib/packageManagerCommands.d.ts +11 -0
  125. package/dist/src/lib/packageManagerCommands.d.ts.map +1 -0
  126. package/dist/src/lib/packageManagerCommands.js +34 -0
  127. package/dist/src/lib/packageManagerCommands.js.map +1 -0
  128. package/dist/src/lib/process.d.ts.map +1 -1
  129. package/dist/src/lib/process.js +9 -0
  130. package/dist/src/lib/process.js.map +1 -1
  131. package/dist/src/lib/projectManifest.d.ts +67 -0
  132. package/dist/src/lib/projectManifest.d.ts.map +1 -0
  133. package/dist/src/lib/projectManifest.js +134 -0
  134. package/dist/src/lib/projectManifest.js.map +1 -0
  135. package/dist/src/lib/release.d.ts +9 -0
  136. package/dist/src/lib/release.d.ts.map +1 -0
  137. package/dist/src/lib/release.js +48 -0
  138. package/dist/src/lib/release.js.map +1 -0
  139. package/dist/src/lib/rootCommand.d.ts +15 -0
  140. package/dist/src/lib/rootCommand.d.ts.map +1 -0
  141. package/dist/src/lib/rootCommand.js +17 -0
  142. package/dist/src/lib/rootCommand.js.map +1 -0
  143. package/dist/src/lib/schemas.d.ts +15 -6
  144. package/dist/src/lib/schemas.d.ts.map +1 -1
  145. package/dist/src/lib/schemas.js +8 -1
  146. package/dist/src/lib/schemas.js.map +1 -1
  147. package/dist/src/lib/semver.d.ts +10 -0
  148. package/dist/src/lib/semver.d.ts.map +1 -0
  149. package/dist/src/lib/semver.js +51 -0
  150. package/dist/src/lib/semver.js.map +1 -0
  151. package/dist/src/lib/types.d.ts +5 -1
  152. package/dist/src/lib/types.d.ts.map +1 -1
  153. package/dist/src/steps/configurePrisma.d.ts.map +1 -1
  154. package/dist/src/steps/configurePrisma.js +18 -23
  155. package/dist/src/steps/configurePrisma.js.map +1 -1
  156. package/dist/src/steps/configureReadme.d.ts +4 -0
  157. package/dist/src/steps/configureReadme.d.ts.map +1 -0
  158. package/dist/src/steps/configureReadme.js +22 -0
  159. package/dist/src/steps/configureReadme.js.map +1 -0
  160. package/dist/src/steps/createProject.d.ts.map +1 -1
  161. package/dist/src/steps/createProject.js +16 -170
  162. package/dist/src/steps/createProject.js.map +1 -1
  163. package/dist/src/steps/finalSetup.d.ts +3 -2
  164. package/dist/src/steps/finalSetup.d.ts.map +1 -1
  165. package/dist/src/steps/finalSetup.js +14 -9
  166. package/dist/src/steps/finalSetup.js.map +1 -1
  167. package/dist/src/steps/installDeps.d.ts +1 -0
  168. package/dist/src/steps/installDeps.d.ts.map +1 -1
  169. package/dist/src/steps/installDeps.js +11 -0
  170. package/dist/src/steps/installDeps.js.map +1 -1
  171. package/dist/src/steps/prompts.d.ts.map +1 -1
  172. package/dist/src/steps/prompts.js +32 -13
  173. package/dist/src/steps/prompts.js.map +1 -1
  174. package/dist/src/utils/output.d.ts.map +1 -1
  175. package/dist/src/utils/output.js +23 -11
  176. package/dist/src/utils/output.js.map +1 -1
  177. package/package.json +5 -4
  178. package/templates/express-auth/README.md +21 -12
  179. package/templates/express-auth/package.json +11 -7
  180. package/templates/express-auth/src/config/redis.ts +109 -0
  181. package/templates/express-auth/src/server.ts +2 -0
  182. package/templates/express-auth+/README.md +25 -18
  183. package/templates/express-auth+/package.json +11 -7
  184. package/templates/express-auth+/src/auth/auth.ts +2 -0
  185. package/templates/express-auth+/src/auth/controllers/password.controller.ts +12 -1
  186. package/templates/express-auth+/src/auth/routes/password.route.ts +1 -0
  187. package/templates/express-auth+/src/config/redis.ts +109 -0
  188. package/templates/express-auth+/src/utils/security.ts +12 -0
  189. package/templates/express-base/README.md +21 -12
  190. package/templates/express-base/package.json +11 -8
  191. package/templates/express-base/src/.env.example +1 -1
  192. package/templates/express-base/src/config/redis.ts +109 -0
  193. package/templates/express-base/src/server.ts +2 -0
  194. package/templates/fullstack/.env.example +3 -2
  195. package/templates/fullstack/PRESET_CONTRACT.md +7 -3
  196. package/templates/fullstack/README.md +45 -7
  197. package/templates/fullstack/apps/api/package.json +6 -4
  198. package/templates/fullstack/apps/api/prisma/migrations/20260721000000_init/migration.sql +163 -0
  199. package/templates/fullstack/apps/api/prisma/migrations/migration_lock.toml +3 -0
  200. package/templates/fullstack/apps/api/src/auth/authenik8.ts +13 -4
  201. package/templates/fullstack/apps/api/src/config/env.ts +9 -1
  202. package/templates/fullstack/apps/api/src/config/logger.ts +21 -11
  203. package/templates/fullstack/apps/api/tests/logger.test.ts +43 -0
  204. package/templates/fullstack/apps/web/package.json +3 -1
  205. package/templates/fullstack/apps/web/src/App.tsx +1 -1
  206. package/templates/fullstack/apps/web/src/auth/RouteGuards.tsx +1 -1
  207. package/templates/fullstack/apps/web/src/components/AppShell.tsx +90 -45
  208. package/templates/fullstack/apps/web/src/components/AuthShell.tsx +10 -7
  209. package/templates/fullstack/apps/web/src/components/Page.tsx +6 -3
  210. package/templates/fullstack/apps/web/src/features/projects/ProjectPages.tsx +1 -1
  211. package/templates/fullstack/apps/web/src/main.tsx +13 -6
  212. package/templates/fullstack/apps/web/src/pages/DashboardPage.tsx +163 -23
  213. package/templates/fullstack/apps/web/src/pages/StatusPages.tsx +1 -1
  214. package/templates/fullstack/apps/web/src/pages/auth/LoginPage.tsx +93 -17
  215. package/templates/fullstack/apps/web/src/pages/auth/OAuthCallbackPage.tsx +1 -1
  216. package/templates/fullstack/apps/web/src/pages/auth/RecoveryPages.tsx +1 -1
  217. package/templates/fullstack/apps/web/src/pages/auth/RegisterPage.tsx +1 -1
  218. package/templates/fullstack/apps/web/src/pages/auth/VerifyEmailPage.tsx +1 -1
  219. package/templates/fullstack/apps/web/src/styles.css +119 -43
  220. package/templates/fullstack/apps/web/vite.config.ts +12 -0
  221. package/templates/fullstack/docker-compose.yml +2 -2
  222. package/templates/fullstack/gitignore.template +1 -0
  223. package/templates/fullstack/package.json +17 -8
  224. package/templates/fullstack/scripts/run-local.mjs +157 -0
  225. package/templates/prisma/postgresql/.env.example +1 -2
  226. package/templates/prisma/sqlite/.env.example +1 -2
  227. package/templates/prisma/sqlite/client.ts +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/doctor/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQjE,MAAM,OAAO,gBAAiB,SAAQ,KAAK;CAAG;AAI9C,MAAM,UAAU,oBAAoB,CAClC,IAAuB,EACvB,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IAEnB,IAAI,SAA6B,CAAC;IAClC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,IAAI,GAAG,KAAK,CAAC;IAEjB,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,QAAQ,KAAK,QAAQ;YAAE,IAAI,GAAG,IAAI,CAAC;aAClC,IAAI,QAAQ,KAAK,iBAAiB;YAAE,YAAY,GAAG,IAAI,CAAC;aACxD,IAAI,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AM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM;QAC9D,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM;QAChE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM;KAC/D,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DoctorReport } from "./types.js";
2
+ export declare function formatDoctorReport(report: DoctorReport, json: boolean): string;
3
+ export declare function doctorHelp(): string;
4
+ //# sourceMappingURL=output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/output.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,YAAY,CAAC;AAe5D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAsB9E;AAED,wBAAgB,UAAU,IAAI,MAAM,CAiBnC"}
@@ -0,0 +1,53 @@
1
+ import chalk from "chalk";
2
+ const statusSymbol = {
3
+ pass: "✓",
4
+ warn: "!",
5
+ fail: "×",
6
+ };
7
+ function colorStatus(check) {
8
+ const symbol = statusSymbol[check.status];
9
+ if (check.status === "pass")
10
+ return chalk.green(symbol);
11
+ if (check.status === "warn")
12
+ return chalk.yellow(symbol);
13
+ return chalk.red(symbol);
14
+ }
15
+ export function formatDoctorReport(report, json) {
16
+ if (json)
17
+ return `${JSON.stringify(report, null, 2)}\n`;
18
+ const lines = [
19
+ chalk.bold("\nAuthenik8 doctor"),
20
+ chalk.dim(`${report.preset} · ${report.rootDir}`),
21
+ "",
22
+ ];
23
+ for (const item of report.checks) {
24
+ lines.push(`${colorStatus(item)} ${chalk.bold(item.label)}: ${item.message}`);
25
+ if (item.fix)
26
+ lines.push(` ${chalk.dim(`Fix: ${item.fix}`)}`);
27
+ }
28
+ lines.push("", report.summary.failed > 0
29
+ ? chalk.red(`${report.summary.failed} failed, ${report.summary.warnings} warnings, ${report.summary.passed} passed`)
30
+ : report.summary.warnings > 0
31
+ ? chalk.yellow(`${report.summary.passed} passed with ${report.summary.warnings} warnings`)
32
+ : chalk.green(`All ${report.summary.passed} checks passed`), "");
33
+ return lines.join("\n");
34
+ }
35
+ export function doctorHelp() {
36
+ return `
37
+ AUTHENIK8 DOCTOR
38
+ Validate a generated project's auth configuration and local services
39
+
40
+ Usage:
41
+ create-authenik8-app doctor [directory] [options]
42
+
43
+ Options:
44
+ --json Print a machine-readable report
45
+ --skip-services Skip live Redis checks (useful in CI)
46
+ -h, --help Show this help message
47
+
48
+ Examples:
49
+ npx create-authenik8-app doctor
50
+ npx create-authenik8-app doctor ./my-app --json
51
+ `;
52
+ }
53
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../../src/commands/doctor/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,YAAY,GAA0C;IAC1D,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;CACV,CAAC;AAEF,SAAS,WAAW,CAAC,KAAkB;IACrC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxD,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM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AAM,CAAC,OAAO,CAAC,QAAQ,WAAW,CAAC;YAC1F,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,CAAC,EAC/D,EAAE,CACH,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO;;;;;;;;;;;;;;;CAeR,CAAC;AACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type PostGenerationDoctorResult = {
2
+ passed: number;
3
+ warnings: number;
4
+ warningLabels: readonly string[];
5
+ };
6
+ export declare function runPostGenerationDoctor(rootDir: string, dependenciesInstalled: boolean): Promise<PostGenerationDoctorResult>;
7
+ //# sourceMappingURL=postGeneration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postGeneration.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/postGeneration.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,CAAC;AAMF,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,qBAAqB,EAAE,OAAO,GAC7B,OAAO,CAAC,0BAA0B,CAAC,CAoBrC"}
@@ -0,0 +1,22 @@
1
+ import { runDoctor } from "./index.js";
2
+ function withoutServiceProbe(checks) {
3
+ return checks.filter((check) => check.id !== "service.redis");
4
+ }
5
+ export async function runPostGenerationDoctor(rootDir, dependenciesInstalled) {
6
+ const report = await runDoctor({ directory: rootDir, json: false, skipServices: true }, { allowMissingCore: !dependenciesInstalled });
7
+ const checks = withoutServiceProbe(report.checks);
8
+ const failures = checks.filter((check) => check.status === "fail");
9
+ if (failures.length > 0) {
10
+ const details = failures
11
+ .map((check) => `${check.label}: ${check.message}`)
12
+ .join("; ");
13
+ throw new Error(`Generated auth validation failed: ${details}`);
14
+ }
15
+ const warnings = checks.filter((check) => check.status === "warn");
16
+ return {
17
+ passed: checks.filter((check) => check.status === "pass").length,
18
+ warnings: warnings.length,
19
+ warningLabels: warnings.map((check) => check.label),
20
+ };
21
+ }
22
+ //# sourceMappingURL=postGeneration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postGeneration.js","sourceRoot":"","sources":["../../../../src/commands/doctor/postGeneration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AASvC,SAAS,mBAAmB,CAAC,MAA8B;IACzD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,eAAe,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAe,EACf,qBAA8B;IAE9B,MAAM,MAAM,GAAG,MAAM,SAAS,CAC5B,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,EACvD,EAAE,gBAAgB,EAAE,CAAC,qBAAqB,EAAE,CAC7C,CAAC;IACF,MAAM,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;IACnE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,QAAQ;aACrB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;aAClD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;IACnE,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM;QAChE,QAAQ,EAAE,QAAQ,CAAC,MAAM;QACzB,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;KACpD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { EnvironmentValues, RedisEndpoint, RedisProbe } from "./types.js";
2
+ export declare function redisProbePayload(endpoint: RedisEndpoint): string;
3
+ export declare const probeRedis: RedisProbe;
4
+ export declare function redisEndpointFromEnv(env: EnvironmentValues, fullstack: boolean): RedisEndpoint;
5
+ //# sourceMappingURL=services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/services.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQ/E,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CASjE;AAED,eAAO,MAAM,UAAU,EAAE,UAgCvB,CAAC;AAEH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,iBAAiB,EACtB,SAAS,EAAE,OAAO,GACjB,aAAa,CA2Bf"}
@@ -0,0 +1,80 @@
1
+ import net from "node:net";
2
+ import tls from "node:tls";
3
+ function redisCommand(parts) {
4
+ return `*${parts.length}\r\n${parts
5
+ .map((part) => `$${Buffer.byteLength(part)}\r\n${part}\r\n`)
6
+ .join("")}`;
7
+ }
8
+ export function redisProbePayload(endpoint) {
9
+ const commands = [];
10
+ if (endpoint.password) {
11
+ commands.push(redisCommand(endpoint.username
12
+ ? ["AUTH", endpoint.username, endpoint.password]
13
+ : ["AUTH", endpoint.password]));
14
+ }
15
+ commands.push(redisCommand(["PING"]));
16
+ return commands.join("");
17
+ }
18
+ export const probeRedis = (endpoint) => new Promise((resolve, reject) => {
19
+ let settled = false;
20
+ let response = "";
21
+ const connectionOptions = { host: endpoint.host, port: endpoint.port };
22
+ const socket = endpoint.tls
23
+ ? tls.connect({ ...connectionOptions, servername: net.isIP(endpoint.host) ? undefined : endpoint.host })
24
+ : net.createConnection(connectionOptions);
25
+ const finish = (error) => {
26
+ if (settled)
27
+ return;
28
+ settled = true;
29
+ socket.destroy();
30
+ if (error)
31
+ reject(error);
32
+ else
33
+ resolve();
34
+ };
35
+ socket.setTimeout(2_000);
36
+ socket.once("error", (error) => finish(error));
37
+ socket.once("timeout", () => finish(new Error("connection timed out")));
38
+ socket.once("close", () => finish(new Error("connection closed before Redis answered PING")));
39
+ socket.on("data", (chunk) => {
40
+ response += chunk.toString("utf8");
41
+ if (response.includes("-")) {
42
+ const redisError = response.split("\r\n").find((line) => line.startsWith("-"));
43
+ if (redisError)
44
+ finish(new Error(redisError.slice(1)));
45
+ return;
46
+ }
47
+ if (response.includes("+PONG\r\n"))
48
+ finish();
49
+ });
50
+ socket.once(endpoint.tls ? "secureConnect" : "connect", () => {
51
+ socket.write(redisProbePayload(endpoint));
52
+ });
53
+ });
54
+ export function redisEndpointFromEnv(env, fullstack) {
55
+ if (fullstack) {
56
+ const source = env.REDIS_URL?.trim() || "memory://";
57
+ if (source === "memory://") {
58
+ throw new Error("memory Redis does not have a network endpoint");
59
+ }
60
+ const url = new URL(source);
61
+ if (url.protocol !== "redis:" && url.protocol !== "rediss:") {
62
+ throw new Error("REDIS_URL must use redis:// or rediss://");
63
+ }
64
+ return {
65
+ host: url.hostname,
66
+ port: url.port ? Number.parseInt(url.port, 10) : 6379,
67
+ tls: url.protocol === "rediss:",
68
+ ...(url.username ? { username: decodeURIComponent(url.username) } : {}),
69
+ ...(url.password ? { password: decodeURIComponent(url.password) } : {}),
70
+ };
71
+ }
72
+ const port = Number(env.REDIS_PORT?.trim() || "6379");
73
+ return {
74
+ host: env.REDIS_HOST?.trim() || "127.0.0.1",
75
+ port,
76
+ tls: false,
77
+ ...(env.REDIS_PASSWORD?.trim() ? { password: env.REDIS_PASSWORD.trim() } : {}),
78
+ };
79
+ }
80
+ //# sourceMappingURL=services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.js","sourceRoot":"","sources":["../../../../src/commands/doctor/services.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,GAAG,MAAM,UAAU,CAAC;AAI3B,SAAS,YAAY,CAAC,KAAe;IACnC,OAAO,IAAI,KAAK,CAAC,MAAM,OAAO,KAAK;SAChC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC;SAC3D,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAuB;IACvD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ;YAC1C,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAChD,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACtC,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM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AQ,KAAK,SAAS,EAAE,CAAC;YAC5D,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,QAAQ;YAClB,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;YACrD,GAAG,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS;YAC/B,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxE,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,MAAM,CAAC,CAAC;IACtD,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,WAAW;QAC3C,IAAI;QACJ,GAAG,EAAE,KAAK;QACV,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,69 @@
1
+ import type { OAuthProvider } from "../../lib/oauth.js";
2
+ import type { ProjectManifestReadResult } from "../../lib/projectManifest.js";
3
+ import type { AuthMode, Database } from "../../lib/types.js";
4
+ export type DoctorPreset = AuthMode;
5
+ export type DoctorStatus = "pass" | "warn" | "fail";
6
+ export type DoctorPackageManager = "npm" | "pnpm" | "bun";
7
+ export type EnvironmentValues = Record<string, string | undefined>;
8
+ export type PackageJson = {
9
+ name?: string;
10
+ version?: string;
11
+ main?: string;
12
+ exports?: unknown;
13
+ workspaces?: string[];
14
+ trustedDependencies?: string[];
15
+ scripts?: Record<string, string>;
16
+ dependencies?: Record<string, string>;
17
+ devDependencies?: Record<string, string>;
18
+ };
19
+ export type DoctorContext = {
20
+ rootDir: string;
21
+ appDir: string;
22
+ preset: DoctorPreset;
23
+ packageManager: DoctorPackageManager;
24
+ packageJson: PackageJson;
25
+ appPackageJson: PackageJson;
26
+ env: EnvironmentValues;
27
+ envParseError?: string;
28
+ oauthProviders: OAuthProvider[];
29
+ usesPrisma: boolean;
30
+ databaseProvider?: Database;
31
+ manifest: ProjectManifestReadResult;
32
+ };
33
+ export type DoctorCheck = {
34
+ id: string;
35
+ label: string;
36
+ status: DoctorStatus;
37
+ message: string;
38
+ fix?: string;
39
+ };
40
+ export type DoctorSummary = {
41
+ passed: number;
42
+ warnings: number;
43
+ failed: number;
44
+ };
45
+ export type DoctorReport = {
46
+ rootDir: string;
47
+ preset: DoctorPreset;
48
+ checks: DoctorCheck[];
49
+ summary: DoctorSummary;
50
+ };
51
+ export type RedisEndpoint = {
52
+ host: string;
53
+ port: number;
54
+ tls: boolean;
55
+ username?: string;
56
+ password?: string;
57
+ };
58
+ export type RedisProbe = (endpoint: RedisEndpoint) => Promise<void>;
59
+ export type DoctorOptions = {
60
+ directory: string;
61
+ json: boolean;
62
+ skipServices: boolean;
63
+ };
64
+ export type DoctorRuntimeOptions = {
65
+ nodeVersion?: string;
66
+ redisProbe?: RedisProbe;
67
+ allowMissingCore?: boolean;
68
+ };
69
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,E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types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/commands/doctor/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { UpgradeContext } from "./types.js";
2
+ export declare class UpgradeProjectError extends Error {
3
+ }
4
+ export declare function createUpgradeContext(directory: string): Promise<UpgradeContext>;
5
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/commands/upgrade/context.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAOjD,qBAAa,mBAAoB,SAAQ,KAAK;CAAG;AAMjD,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CA+CrF"}
@@ -0,0 +1,57 @@
1
+ import path from "node:path";
2
+ import fs from "fs-extra";
3
+ import { readProjectManifest } from "../../lib/projectManifest.js";
4
+ import { currentToolRelease, templateEngineVersion } from "../../lib/release.js";
5
+ export class UpgradeProjectError extends Error {
6
+ }
7
+ function dependencyVersion(packageJson, name) {
8
+ return packageJson.dependencies?.[name] ?? packageJson.devDependencies?.[name];
9
+ }
10
+ export async function createUpgradeContext(directory) {
11
+ const rootDir = path.resolve(directory);
12
+ const manifestResult = await readProjectManifest(rootDir);
13
+ if (manifestResult.status === "missing") {
14
+ throw new UpgradeProjectError("authenik8.json is required for version-aware upgrades. Legacy projects must be migrated explicitly.");
15
+ }
16
+ if (manifestResult.status === "invalid")
17
+ throw new UpgradeProjectError(manifestResult.message);
18
+ const manifest = manifestResult.manifest;
19
+ const appDir = manifest.preset === "fullstack" ? path.join(rootDir, "apps/api") : rootDir;
20
+ const packagePath = path.join(appDir, "package.json");
21
+ if (!(await fs.pathExists(packagePath))) {
22
+ throw new UpgradeProjectError(`Required package file is missing: ${path.relative(rootDir, packagePath)}`);
23
+ }
24
+ const packageJson = await fs.readJson(packagePath);
25
+ const declaredEngineVersion = dependencyVersion(packageJson, "authenik8-core")?.trim();
26
+ if (!declaredEngineVersion) {
27
+ throw new UpgradeProjectError("The generated application does not declare authenik8-core.");
28
+ }
29
+ const installedCandidates = [
30
+ path.join(appDir, "node_modules/authenik8-core/package.json"),
31
+ path.join(rootDir, "node_modules/authenik8-core/package.json"),
32
+ ];
33
+ let installedEngineVersion;
34
+ for (const candidate of installedCandidates) {
35
+ if (!(await fs.pathExists(candidate)))
36
+ continue;
37
+ try {
38
+ installedEngineVersion = (await fs.readJson(candidate)).version?.trim();
39
+ }
40
+ catch {
41
+ throw new UpgradeProjectError("Installed authenik8-core package metadata is unreadable.");
42
+ }
43
+ break;
44
+ }
45
+ const release = currentToolRelease();
46
+ return {
47
+ rootDir,
48
+ appDir,
49
+ manifest,
50
+ packageManager: manifest.packageManager,
51
+ declaredEngineVersion,
52
+ ...(installedEngineVersion ? { installedEngineVersion } : {}),
53
+ targetGeneratorVersion: release.generatorVersion,
54
+ targetEngineVersion: templateEngineVersion(manifest.preset),
55
+ };
56
+ }
57
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/commands/upgrade/context.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAQjF,MAAM,OAAO,mBAAoB,SAAQ,KAAK;CAAG;AAEjD,SAAS,iBAAiB,CAAC,WAAwB,EAAE,IAAY;IAC/D,OAAO,WAAW,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,C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I,CAAC,OAAO,EAAE,0CAA0C,CAAC;KAC/D,CAAC;IACF,IAAI,sBAA0C,CAAC;IAC/C,KAAK,MAAM,SAAS,IAAI,mBAAmB,EAAE,CAAC;QAC5C,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YAAE,SAAS;QAChD,IAAI,CAAC;YACH,sBAAsB,GAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAA0B,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;QACpG,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,mBAAmB,CAAC,0DAA0D,CAAC,CAAC;QAC5F,CAAC;QACD,MAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,OAAO;QACL,OAAO;QACP,MAAM;QACN,QAAQ;QACR,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,qBAAqB;QACrB,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,sBAAsB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7D,sBAAsB,EAAE,OAAO,CAAC,gBAAgB;QAChD,mBAAmB,EAAE,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC;KAC5D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { UpgradeOptions, UpgradePlan } from "./types.js";
2
+ export declare class UpgradeUsageError extends Error {
3
+ }
4
+ export declare function parseUpgradeArguments(args: readonly string[], cwd?: string): UpgradeOptions;
5
+ export declare function runUpgrade(options: UpgradeOptions): Promise<UpgradePlan>;
6
+ export declare function upgradeCheckExitCode(plan: UpgradePlan): 0 | 1;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/upgrade/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,SAAgB,GAClB,cAAc,CAiBhB;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAE9E;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,CAAC,GAAG,CAAC,CAE7D"}
@@ -0,0 +1,35 @@
1
+ import path from "node:path";
2
+ import { createUpgradeContext } from "./context.js";
3
+ import { createUpgradePlan } from "./plan.js";
4
+ export class UpgradeUsageError extends Error {
5
+ }
6
+ export function parseUpgradeArguments(args, cwd = process.cwd()) {
7
+ let directory;
8
+ let json = false;
9
+ let check = false;
10
+ let help = false;
11
+ for (const argument of args) {
12
+ if (argument === "--json")
13
+ json = true;
14
+ else if (argument === "--check")
15
+ check = true;
16
+ else if (argument === "--help" || argument === "-h")
17
+ help = true;
18
+ else if (argument.startsWith("-")) {
19
+ throw new UpgradeUsageError(`Unknown upgrade option: ${argument}`);
20
+ }
21
+ else if (directory) {
22
+ throw new UpgradeUsageError("Upgrade accepts at most one project directory.");
23
+ }
24
+ else
25
+ directory = argument;
26
+ }
27
+ return { directory: path.resolve(cwd, directory ?? "."), json, check, help };
28
+ }
29
+ export async function runUpgrade(options) {
30
+ return createUpgradePlan(await createUpgradeContext(options.directory));
31
+ }
32
+ export function upgradeCheckExitCode(plan) {
33
+ return plan.status === "current" ? 0 : 1;
34
+ }
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW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C,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { UpgradeAction } from "./types.js";
2
+ /** Security-significant engine boundaries that require an explicit human review. */
3
+ export declare function coreMigrationActions(from: string, to: string): UpgradeAction[];
4
+ //# sourceMappingURL=migrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../../src/commands/upgrade/migrations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,EAAE,CAkB9E"}
@@ -0,0 +1,22 @@
1
+ import { parseSemanticVersion } from "../../lib/semver.js";
2
+ /** Security-significant engine boundaries that require an explicit human review. */
3
+ export function coreMigrationActions(from, to) {
4
+ const source = parseSemanticVersion(from);
5
+ const target = parseSemanticVersion(to);
6
+ if (!source || !target)
7
+ return [];
8
+ if (source.major < 2 && target.major >= 2) {
9
+ return [{
10
+ id: "engine.es256-v2",
11
+ kind: "required",
12
+ title: "Migrate the identity engine to the v2 security contract",
13
+ detail: [
14
+ "Replace legacy shared-secret JWT configuration with a persisted ES256 P-256 key ring, active kid, issuer, and audience.",
15
+ "Also audit asynchronous token verification, purpose-bound claims, Redis-backed OAuth state, and agent identity boundaries before changing the dependency.",
16
+ ].join(" "),
17
+ references: ["authenik8-core CHANGELOG.md: 2.0.0", "THREAT_MODEL.md", "AGENT_IDENTITY.md"],
18
+ }];
19
+ }
20
+ return [];
21
+ }
22
+ //# sourceMappingURL=migrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../../../src/commands/upgrade/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,oFAAoF;AACpF,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,EAAU;IAC3D,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAElC,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1C,OAAO,CAAC;gBACN,EAAE,EAAE,iBAAiB;gBACrB,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,yDAAyD;gBAChE,MAAM,EAAE;oBACN,yHAAyH;oBACzH,2JAA2J;iBAC5J,CAAC,IAAI,CAAC,GAAG,CAAC;gBACX,UAAU,EAAE,CAAC,oCAAoC,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;aAC3F,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { UpgradePlan } from "./types.js";
2
+ export declare function upgradeHelp(): string;
3
+ export declare function formatUpgradePlan(plan: UpgradePlan, json: boolean): string;
4
+ //# sourceMappingURL=output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/commands/upgrade/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAQ7D,wBAAgB,WAAW,IAAI,MAAM,CAkBpC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAuB1E"}
@@ -0,0 +1,52 @@
1
+ const actionSymbol = {
2
+ required: "!",
3
+ recommended: "-",
4
+ blocked: "×",
5
+ };
6
+ export function upgradeHelp() {
7
+ return `
8
+ AUTHENIK8 UPGRADE
9
+ Create a read-only, version-aware upgrade plan for a generated project
10
+
11
+ Usage:
12
+ create-authenik8-app upgrade [directory] [options]
13
+
14
+ Options:
15
+ --json Print a stable machine-readable plan
16
+ --check Exit non-zero when an upgrade is pending or blocked
17
+ -h, --help Show this help message
18
+
19
+ Examples:
20
+ npx create-authenik8-app upgrade
21
+ npx create-authenik8-app upgrade ./my-app --json
22
+ npx create-authenik8-app upgrade --check --json
23
+ `;
24
+ }
25
+ export function formatUpgradePlan(plan, json) {
26
+ if (json)
27
+ return `${JSON.stringify(plan, null, 2)}\n`;
28
+ const lines = [
29
+ "",
30
+ "Authenik8 upgrade plan",
31
+ `${plan.preset} · ${plan.rootDir}`,
32
+ "",
33
+ `Generator ${plan.versions.generator.project} → ${plan.versions.generator.target}`,
34
+ `Engine ${plan.versions.engine.manifest} → ${plan.versions.engine.target}`,
35
+ `Status ${plan.status}`,
36
+ "",
37
+ ];
38
+ if (plan.actions.length === 0) {
39
+ lines.push("No upgrade actions are required.", "");
40
+ return lines.join("\n");
41
+ }
42
+ for (const action of plan.actions) {
43
+ lines.push(`${actionSymbol[action.kind]} ${action.title}`, ` ${action.detail}`);
44
+ if (action.command)
45
+ lines.push(` Run: ${action.command}`);
46
+ if (action.references?.length)
47
+ lines.push(` Review: ${action.references.join(", ")}`);
48
+ }
49
+ lines.push("");
50
+ return lines.join("\n");
51
+ }
52
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../../src/commands/upgrade/output.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAA0C;IAC1D,QAAQ,EAAE,GAAG;IACb,WAAW,EAAE,GAAG;IAChB,OAAO,EAAE,GAAG;CACb,CAAC;AAEF,MAAM,UAAU,WAAW;IACzB,OAAO;;;;;;;;;;;;;;;;CAgBR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAiB,EAAE,IAAa;IAChE,IAAI,IAAI;QAAE,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAA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
+ import type { UpgradeContext, UpgradePlan } from "./types.js";
2
+ export declare function createUpgradePlan(context: UpgradeContext): UpgradePlan;
3
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../src/commands/upgrade/plan.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,cAAc,EACd,WAAW,EAEZ,MAAM,YAAY,CAAC;AAsBpB,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,WAAW,CA+HtE"}