@atlasauth/cli 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/args.d.ts +121 -0
  3. package/dist/args.js +45 -0
  4. package/dist/args.js.map +1 -1
  5. package/dist/commands/config.js +71 -6
  6. package/dist/commands/config.js.map +1 -1
  7. package/dist/commands/dev.d.ts +8 -0
  8. package/dist/commands/dev.js +84 -0
  9. package/dist/commands/dev.js.map +1 -0
  10. package/dist/commands/init.js +13 -8
  11. package/dist/commands/init.js.map +1 -1
  12. package/dist/commands/migrate.d.ts +6 -2
  13. package/dist/commands/migrate.js +13 -3
  14. package/dist/commands/migrate.js.map +1 -1
  15. package/dist/commands/pages.d.ts +14 -0
  16. package/dist/commands/pages.js +113 -0
  17. package/dist/commands/pages.js.map +1 -0
  18. package/dist/context.d.ts +1 -1
  19. package/dist/help.d.ts +1 -1
  20. package/dist/help.js +96 -2
  21. package/dist/help.js.map +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +3 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/migrate/appwrite/plugin.d.ts +2 -0
  26. package/dist/migrate/appwrite/plugin.js +103 -0
  27. package/dist/migrate/appwrite/plugin.js.map +1 -0
  28. package/dist/migrate/auth0/plugin.d.ts +2 -0
  29. package/dist/migrate/auth0/plugin.js +126 -0
  30. package/dist/migrate/auth0/plugin.js.map +1 -0
  31. package/dist/migrate/authentik/plugin.d.ts +2 -0
  32. package/dist/migrate/authentik/plugin.js +135 -0
  33. package/dist/migrate/authentik/plugin.js.map +1 -0
  34. package/dist/migrate/azure-ad-b2c/plugin.d.ts +8 -0
  35. package/dist/migrate/azure-ad-b2c/plugin.js +165 -0
  36. package/dist/migrate/azure-ad-b2c/plugin.js.map +1 -0
  37. package/dist/migrate/clerk/plugin.d.ts +2 -0
  38. package/dist/migrate/clerk/plugin.js +76 -0
  39. package/dist/migrate/clerk/plugin.js.map +1 -0
  40. package/dist/migrate/cognito/plugin.d.ts +5 -0
  41. package/dist/migrate/cognito/plugin.js +170 -0
  42. package/dist/migrate/cognito/plugin.js.map +1 -0
  43. package/dist/migrate/corbado/plugin.d.ts +2 -0
  44. package/dist/migrate/corbado/plugin.js +63 -0
  45. package/dist/migrate/corbado/plugin.js.map +1 -0
  46. package/dist/migrate/descope/plugin.d.ts +2 -0
  47. package/dist/migrate/descope/plugin.js +83 -0
  48. package/dist/migrate/descope/plugin.js.map +1 -0
  49. package/dist/migrate/entra-external-id/plugin.d.ts +8 -0
  50. package/dist/migrate/entra-external-id/plugin.js +12 -0
  51. package/dist/migrate/entra-external-id/plugin.js.map +1 -0
  52. package/dist/migrate/export/appwrite-config.d.ts +28 -0
  53. package/dist/migrate/export/appwrite-config.js +170 -0
  54. package/dist/migrate/export/appwrite-config.js.map +1 -0
  55. package/dist/migrate/export/appwrite.d.ts +51 -0
  56. package/dist/migrate/export/appwrite.js +288 -0
  57. package/dist/migrate/export/appwrite.js.map +1 -0
  58. package/dist/migrate/export/auth0-config.d.ts +29 -0
  59. package/dist/migrate/export/auth0-config.js +249 -0
  60. package/dist/migrate/export/auth0-config.js.map +1 -0
  61. package/dist/migrate/export/auth0.d.ts +62 -0
  62. package/dist/migrate/export/auth0.js +575 -0
  63. package/dist/migrate/export/auth0.js.map +1 -0
  64. package/dist/migrate/export/authentik-config.d.ts +45 -0
  65. package/dist/migrate/export/authentik-config.js +357 -0
  66. package/dist/migrate/export/authentik-config.js.map +1 -0
  67. package/dist/migrate/export/authentik.d.ts +110 -0
  68. package/dist/migrate/export/authentik.js +838 -0
  69. package/dist/migrate/export/authentik.js.map +1 -0
  70. package/dist/migrate/export/azure-config.d.ts +58 -0
  71. package/dist/migrate/export/azure-config.js +344 -0
  72. package/dist/migrate/export/azure-config.js.map +1 -0
  73. package/dist/migrate/export/azure.d.ts +85 -0
  74. package/dist/migrate/export/azure.js +373 -0
  75. package/dist/migrate/export/azure.js.map +1 -0
  76. package/dist/migrate/export/clerk-config.d.ts +26 -0
  77. package/dist/migrate/export/clerk-config.js +227 -0
  78. package/dist/migrate/export/clerk-config.js.map +1 -0
  79. package/dist/migrate/export/clerk.d.ts +46 -0
  80. package/dist/migrate/export/clerk.js +486 -0
  81. package/dist/migrate/export/clerk.js.map +1 -0
  82. package/dist/migrate/export/cognito-config.d.ts +25 -0
  83. package/dist/migrate/export/cognito-config.js +273 -0
  84. package/dist/migrate/export/cognito-config.js.map +1 -0
  85. package/dist/migrate/export/cognito.d.ts +103 -0
  86. package/dist/migrate/export/cognito.js +441 -0
  87. package/dist/migrate/export/cognito.js.map +1 -0
  88. package/dist/migrate/export/corbado-config.d.ts +20 -0
  89. package/dist/migrate/export/corbado-config.js +63 -0
  90. package/dist/migrate/export/corbado-config.js.map +1 -0
  91. package/dist/migrate/export/corbado.d.ts +37 -0
  92. package/dist/migrate/export/corbado.js +132 -0
  93. package/dist/migrate/export/corbado.js.map +1 -0
  94. package/dist/migrate/export/descope.d.ts +35 -0
  95. package/dist/migrate/export/descope.js +208 -0
  96. package/dist/migrate/export/descope.js.map +1 -0
  97. package/dist/migrate/export/fake-vendor.test-helper.d.ts +27 -0
  98. package/dist/migrate/export/fake-vendor.test-helper.js +41 -0
  99. package/dist/migrate/export/fake-vendor.test-helper.js.map +1 -0
  100. package/dist/migrate/export/firebase-config.d.ts +24 -0
  101. package/dist/migrate/export/firebase-config.js +215 -0
  102. package/dist/migrate/export/firebase-config.js.map +1 -0
  103. package/dist/migrate/export/firebase.d.ts +102 -0
  104. package/dist/migrate/export/firebase.js +464 -0
  105. package/dist/migrate/export/firebase.js.map +1 -0
  106. package/dist/migrate/export/frameworks/app-users.d.ts +42 -0
  107. package/dist/migrate/export/frameworks/app-users.js +161 -0
  108. package/dist/migrate/export/frameworks/app-users.js.map +1 -0
  109. package/dist/migrate/export/frameworks/authjs.d.ts +41 -0
  110. package/dist/migrate/export/frameworks/authjs.js +146 -0
  111. package/dist/migrate/export/frameworks/authjs.js.map +1 -0
  112. package/dist/migrate/export/frameworks/devise.d.ts +39 -0
  113. package/dist/migrate/export/frameworks/devise.js +218 -0
  114. package/dist/migrate/export/frameworks/devise.js.map +1 -0
  115. package/dist/migrate/export/frameworks/django.d.ts +45 -0
  116. package/dist/migrate/export/frameworks/django.js +315 -0
  117. package/dist/migrate/export/frameworks/django.js.map +1 -0
  118. package/dist/migrate/export/frameworks/lucia.d.ts +42 -0
  119. package/dist/migrate/export/frameworks/lucia.js +263 -0
  120. package/dist/migrate/export/frameworks/lucia.js.map +1 -0
  121. package/dist/migrate/export/frameworks/tables.d.ts +90 -0
  122. package/dist/migrate/export/frameworks/tables.js +325 -0
  123. package/dist/migrate/export/frameworks/tables.js.map +1 -0
  124. package/dist/migrate/export/frameworks/webauthn.d.ts +25 -0
  125. package/dist/migrate/export/frameworks/webauthn.js +130 -0
  126. package/dist/migrate/export/frameworks/webauthn.js.map +1 -0
  127. package/dist/migrate/export/frontegg-config.d.ts +29 -0
  128. package/dist/migrate/export/frontegg-config.js +238 -0
  129. package/dist/migrate/export/frontegg-config.js.map +1 -0
  130. package/dist/migrate/export/frontegg.d.ts +67 -0
  131. package/dist/migrate/export/frontegg.js +410 -0
  132. package/dist/migrate/export/frontegg.js.map +1 -0
  133. package/dist/migrate/export/fusionauth-config.d.ts +26 -0
  134. package/dist/migrate/export/fusionauth-config.js +226 -0
  135. package/dist/migrate/export/fusionauth-config.js.map +1 -0
  136. package/dist/migrate/export/fusionauth.d.ts +99 -0
  137. package/dist/migrate/export/fusionauth.js +642 -0
  138. package/dist/migrate/export/fusionauth.js.map +1 -0
  139. package/dist/migrate/export/hanko-config.d.ts +27 -0
  140. package/dist/migrate/export/hanko-config.js +265 -0
  141. package/dist/migrate/export/hanko-config.js.map +1 -0
  142. package/dist/migrate/export/hanko.d.ts +52 -0
  143. package/dist/migrate/export/hanko.js +605 -0
  144. package/dist/migrate/export/hanko.js.map +1 -0
  145. package/dist/migrate/export/keycloak-config.d.ts +19 -0
  146. package/dist/migrate/export/keycloak-config.js +219 -0
  147. package/dist/migrate/export/keycloak-config.js.map +1 -0
  148. package/dist/migrate/export/keycloak.d.ts +155 -0
  149. package/dist/migrate/export/keycloak.js +878 -0
  150. package/dist/migrate/export/keycloak.js.map +1 -0
  151. package/dist/migrate/export/kinde-descope-config.d.ts +38 -0
  152. package/dist/migrate/export/kinde-descope-config.js +172 -0
  153. package/dist/migrate/export/kinde-descope-config.js.map +1 -0
  154. package/dist/migrate/export/kinde.d.ts +57 -0
  155. package/dist/migrate/export/kinde.js +333 -0
  156. package/dist/migrate/export/kinde.js.map +1 -0
  157. package/dist/migrate/export/ldap.d.ts +53 -0
  158. package/dist/migrate/export/ldap.js +277 -0
  159. package/dist/migrate/export/ldap.js.map +1 -0
  160. package/dist/migrate/export/logto-config.d.ts +27 -0
  161. package/dist/migrate/export/logto-config.js +264 -0
  162. package/dist/migrate/export/logto-config.js.map +1 -0
  163. package/dist/migrate/export/logto.d.ts +150 -0
  164. package/dist/migrate/export/logto.js +809 -0
  165. package/dist/migrate/export/logto.js.map +1 -0
  166. package/dist/migrate/export/magic-config.d.ts +14 -0
  167. package/dist/migrate/export/magic-config.js +28 -0
  168. package/dist/migrate/export/magic-config.js.map +1 -0
  169. package/dist/migrate/export/magic.d.ts +31 -0
  170. package/dist/migrate/export/magic.js +93 -0
  171. package/dist/migrate/export/magic.js.map +1 -0
  172. package/dist/migrate/export/mini-yaml.d.ts +19 -0
  173. package/dist/migrate/export/mini-yaml.js +581 -0
  174. package/dist/migrate/export/mini-yaml.js.map +1 -0
  175. package/dist/migrate/export/nhost-config.d.ts +26 -0
  176. package/dist/migrate/export/nhost-config.js +360 -0
  177. package/dist/migrate/export/nhost-config.js.map +1 -0
  178. package/dist/migrate/export/nhost.d.ts +64 -0
  179. package/dist/migrate/export/nhost.js +304 -0
  180. package/dist/migrate/export/nhost.js.map +1 -0
  181. package/dist/migrate/export/okta-config.d.ts +30 -0
  182. package/dist/migrate/export/okta-config.js +205 -0
  183. package/dist/migrate/export/okta-config.js.map +1 -0
  184. package/dist/migrate/export/okta.d.ts +43 -0
  185. package/dist/migrate/export/okta.js +337 -0
  186. package/dist/migrate/export/okta.js.map +1 -0
  187. package/dist/migrate/export/onelogin.d.ts +22 -0
  188. package/dist/migrate/export/onelogin.js +123 -0
  189. package/dist/migrate/export/onelogin.js.map +1 -0
  190. package/dist/migrate/export/ory-config.d.ts +58 -0
  191. package/dist/migrate/export/ory-config.js +451 -0
  192. package/dist/migrate/export/ory-config.js.map +1 -0
  193. package/dist/migrate/export/ory.d.ts +81 -0
  194. package/dist/migrate/export/ory.js +555 -0
  195. package/dist/migrate/export/ory.js.map +1 -0
  196. package/dist/migrate/export/password-detect.d.ts +29 -0
  197. package/dist/migrate/export/password-detect.js +81 -0
  198. package/dist/migrate/export/password-detect.js.map +1 -0
  199. package/dist/migrate/export/pingone.d.ts +36 -0
  200. package/dist/migrate/export/pingone.js +218 -0
  201. package/dist/migrate/export/pingone.js.map +1 -0
  202. package/dist/migrate/export/plugin-kit.d.ts +25 -0
  203. package/dist/migrate/export/plugin-kit.js +82 -0
  204. package/dist/migrate/export/plugin-kit.js.map +1 -0
  205. package/dist/migrate/export/pocketbase-config.d.ts +28 -0
  206. package/dist/migrate/export/pocketbase-config.js +180 -0
  207. package/dist/migrate/export/pocketbase-config.js.map +1 -0
  208. package/dist/migrate/export/pocketbase.d.ts +52 -0
  209. package/dist/migrate/export/pocketbase.js +243 -0
  210. package/dist/migrate/export/pocketbase.js.map +1 -0
  211. package/dist/migrate/export/project-files.d.ts +15 -0
  212. package/dist/migrate/export/project-files.js +43 -0
  213. package/dist/migrate/export/project-files.js.map +1 -0
  214. package/dist/migrate/export/propelauth-config.d.ts +18 -0
  215. package/dist/migrate/export/propelauth-config.js +58 -0
  216. package/dist/migrate/export/propelauth-config.js.map +1 -0
  217. package/dist/migrate/export/propelauth-harness.test-helper.d.ts +62 -0
  218. package/dist/migrate/export/propelauth-harness.test-helper.js +109 -0
  219. package/dist/migrate/export/propelauth-harness.test-helper.js.map +1 -0
  220. package/dist/migrate/export/propelauth.d.ts +48 -0
  221. package/dist/migrate/export/propelauth.js +255 -0
  222. package/dist/migrate/export/propelauth.js.map +1 -0
  223. package/dist/migrate/export/record-set.d.ts +44 -0
  224. package/dist/migrate/export/record-set.js +98 -0
  225. package/dist/migrate/export/record-set.js.map +1 -0
  226. package/dist/migrate/export/source-lines.d.ts +17 -0
  227. package/dist/migrate/export/source-lines.js +43 -0
  228. package/dist/migrate/export/source-lines.js.map +1 -0
  229. package/dist/migrate/export/sso-metadata.d.ts +47 -0
  230. package/dist/migrate/export/sso-metadata.js +180 -0
  231. package/dist/migrate/export/sso-metadata.js.map +1 -0
  232. package/dist/migrate/export/stytch-config.d.ts +22 -0
  233. package/dist/migrate/export/stytch-config.js +102 -0
  234. package/dist/migrate/export/stytch-config.js.map +1 -0
  235. package/dist/migrate/export/stytch.d.ts +68 -0
  236. package/dist/migrate/export/stytch.js +510 -0
  237. package/dist/migrate/export/stytch.js.map +1 -0
  238. package/dist/migrate/export/supabase-config.d.ts +48 -0
  239. package/dist/migrate/export/supabase-config.js +408 -0
  240. package/dist/migrate/export/supabase-config.js.map +1 -0
  241. package/dist/migrate/export/supabase.d.ts +86 -0
  242. package/dist/migrate/export/supabase.js +524 -0
  243. package/dist/migrate/export/supabase.js.map +1 -0
  244. package/dist/migrate/export/supertokens-config.d.ts +20 -0
  245. package/dist/migrate/export/supertokens-config.js +150 -0
  246. package/dist/migrate/export/supertokens-config.js.map +1 -0
  247. package/dist/migrate/export/supertokens.d.ts +125 -0
  248. package/dist/migrate/export/supertokens.js +464 -0
  249. package/dist/migrate/export/supertokens.js.map +1 -0
  250. package/dist/migrate/export/table.d.ts +35 -0
  251. package/dist/migrate/export/table.js +248 -0
  252. package/dist/migrate/export/table.js.map +1 -0
  253. package/dist/migrate/export/translate-kit.d.ts +46 -0
  254. package/dist/migrate/export/translate-kit.js +148 -0
  255. package/dist/migrate/export/translate-kit.js.map +1 -0
  256. package/dist/migrate/export/userfront-config.d.ts +15 -0
  257. package/dist/migrate/export/userfront-config.js +49 -0
  258. package/dist/migrate/export/userfront-config.js.map +1 -0
  259. package/dist/migrate/export/userfront.d.ts +38 -0
  260. package/dist/migrate/export/userfront.js +189 -0
  261. package/dist/migrate/export/userfront.js.map +1 -0
  262. package/dist/migrate/export/vendor-http.d.ts +46 -0
  263. package/dist/migrate/export/vendor-http.js +138 -0
  264. package/dist/migrate/export/vendor-http.js.map +1 -0
  265. package/dist/migrate/export/workos-config.d.ts +23 -0
  266. package/dist/migrate/export/workos-config.js +125 -0
  267. package/dist/migrate/export/workos-config.js.map +1 -0
  268. package/dist/migrate/export/workos.d.ts +46 -0
  269. package/dist/migrate/export/workos.js +272 -0
  270. package/dist/migrate/export/workos.js.map +1 -0
  271. package/dist/migrate/export/zip.d.ts +8 -0
  272. package/dist/migrate/export/zip.js +66 -0
  273. package/dist/migrate/export/zip.js.map +1 -0
  274. package/dist/migrate/export/zitadel-config.d.ts +37 -0
  275. package/dist/migrate/export/zitadel-config.js +279 -0
  276. package/dist/migrate/export/zitadel-config.js.map +1 -0
  277. package/dist/migrate/export/zitadel.d.ts +82 -0
  278. package/dist/migrate/export/zitadel.js +447 -0
  279. package/dist/migrate/export/zitadel.js.map +1 -0
  280. package/dist/migrate/firebase/plugin.d.ts +2 -0
  281. package/dist/migrate/firebase/plugin.js +152 -0
  282. package/dist/migrate/firebase/plugin.js.map +1 -0
  283. package/dist/migrate/framework/builtins.d.ts +2 -0
  284. package/dist/migrate/framework/builtins.js +52 -0
  285. package/dist/migrate/framework/builtins.js.map +1 -0
  286. package/dist/migrate/framework/commands.d.ts +20 -0
  287. package/dist/migrate/framework/commands.js +58 -0
  288. package/dist/migrate/framework/commands.js.map +1 -0
  289. package/dist/migrate/framework/custom.d.ts +12 -0
  290. package/dist/migrate/framework/custom.js +96 -0
  291. package/dist/migrate/framework/custom.js.map +1 -0
  292. package/dist/migrate/framework/orchestrator.d.ts +113 -0
  293. package/dist/migrate/framework/orchestrator.js +532 -0
  294. package/dist/migrate/framework/orchestrator.js.map +1 -0
  295. package/dist/migrate/framework/plugin.d.ts +167 -0
  296. package/dist/migrate/framework/plugin.js +3 -0
  297. package/dist/migrate/framework/plugin.js.map +1 -0
  298. package/dist/migrate/framework/registry.d.ts +11 -0
  299. package/dist/migrate/framework/registry.js +44 -0
  300. package/dist/migrate/framework/registry.js.map +1 -0
  301. package/dist/migrate/framework/report.d.ts +17 -0
  302. package/dist/migrate/framework/report.js +103 -0
  303. package/dist/migrate/framework/report.js.map +1 -0
  304. package/dist/migrate/frameworks/plugins.d.ts +29 -0
  305. package/dist/migrate/frameworks/plugins.js +402 -0
  306. package/dist/migrate/frameworks/plugins.js.map +1 -0
  307. package/dist/migrate/frameworks/report.d.ts +92 -0
  308. package/dist/migrate/frameworks/report.js +207 -0
  309. package/dist/migrate/frameworks/report.js.map +1 -0
  310. package/dist/migrate/frameworks/translate-js.d.ts +5 -0
  311. package/dist/migrate/frameworks/translate-js.js +503 -0
  312. package/dist/migrate/frameworks/translate-js.js.map +1 -0
  313. package/dist/migrate/frameworks/translate-rails-django.d.ts +3 -0
  314. package/dist/migrate/frameworks/translate-rails-django.js +1391 -0
  315. package/dist/migrate/frameworks/translate-rails-django.js.map +1 -0
  316. package/dist/migrate/frontegg/plugin.d.ts +2 -0
  317. package/dist/migrate/frontegg/plugin.js +78 -0
  318. package/dist/migrate/frontegg/plugin.js.map +1 -0
  319. package/dist/migrate/fusionauth/plugin.d.ts +2 -0
  320. package/dist/migrate/fusionauth/plugin.js +109 -0
  321. package/dist/migrate/fusionauth/plugin.js.map +1 -0
  322. package/dist/migrate/hanko/plugin.d.ts +2 -0
  323. package/dist/migrate/hanko/plugin.js +100 -0
  324. package/dist/migrate/hanko/plugin.js.map +1 -0
  325. package/dist/migrate/keycloak/plugin.d.ts +2 -0
  326. package/dist/migrate/keycloak/plugin.js +148 -0
  327. package/dist/migrate/keycloak/plugin.js.map +1 -0
  328. package/dist/migrate/kinde/plugin.d.ts +2 -0
  329. package/dist/migrate/kinde/plugin.js +105 -0
  330. package/dist/migrate/kinde/plugin.js.map +1 -0
  331. package/dist/migrate/ldap/plugin.d.ts +2 -0
  332. package/dist/migrate/ldap/plugin.js +73 -0
  333. package/dist/migrate/ldap/plugin.js.map +1 -0
  334. package/dist/migrate/logto/plugin.d.ts +2 -0
  335. package/dist/migrate/logto/plugin.js +131 -0
  336. package/dist/migrate/logto/plugin.js.map +1 -0
  337. package/dist/migrate/magic/plugin.d.ts +2 -0
  338. package/dist/migrate/magic/plugin.js +56 -0
  339. package/dist/migrate/magic/plugin.js.map +1 -0
  340. package/dist/migrate/nhost/plugin.d.ts +2 -0
  341. package/dist/migrate/nhost/plugin.js +115 -0
  342. package/dist/migrate/nhost/plugin.js.map +1 -0
  343. package/dist/migrate/oidc/plugin.d.ts +2 -0
  344. package/dist/migrate/oidc/plugin.js +73 -0
  345. package/dist/migrate/oidc/plugin.js.map +1 -0
  346. package/dist/migrate/okta/plugin.d.ts +2 -0
  347. package/dist/migrate/okta/plugin.js +105 -0
  348. package/dist/migrate/okta/plugin.js.map +1 -0
  349. package/dist/migrate/onelogin/plugin.d.ts +2 -0
  350. package/dist/migrate/onelogin/plugin.js +61 -0
  351. package/dist/migrate/onelogin/plugin.js.map +1 -0
  352. package/dist/migrate/ory/plugin.d.ts +2 -0
  353. package/dist/migrate/ory/plugin.js +186 -0
  354. package/dist/migrate/ory/plugin.js.map +1 -0
  355. package/dist/migrate/ping-identity/plugin.d.ts +2 -0
  356. package/dist/migrate/ping-identity/plugin.js +100 -0
  357. package/dist/migrate/ping-identity/plugin.js.map +1 -0
  358. package/dist/migrate/pocketbase/plugin.d.ts +2 -0
  359. package/dist/migrate/pocketbase/plugin.js +99 -0
  360. package/dist/migrate/pocketbase/plugin.js.map +1 -0
  361. package/dist/migrate/propelauth/plugin.d.ts +2 -0
  362. package/dist/migrate/propelauth/plugin.js +65 -0
  363. package/dist/migrate/propelauth/plugin.js.map +1 -0
  364. package/dist/migrate/saml/plugin.d.ts +2 -0
  365. package/dist/migrate/saml/plugin.js +79 -0
  366. package/dist/migrate/saml/plugin.js.map +1 -0
  367. package/dist/migrate/stytch/plugin.d.ts +2 -0
  368. package/dist/migrate/stytch/plugin.js +97 -0
  369. package/dist/migrate/stytch/plugin.js.map +1 -0
  370. package/dist/migrate/supabase/plugin.d.ts +2 -0
  371. package/dist/migrate/supabase/plugin.js +149 -0
  372. package/dist/migrate/supabase/plugin.js.map +1 -0
  373. package/dist/migrate/supertokens/plugin.d.ts +2 -0
  374. package/dist/migrate/supertokens/plugin.js +114 -0
  375. package/dist/migrate/supertokens/plugin.js.map +1 -0
  376. package/dist/migrate/user-table/plugin.d.ts +2 -0
  377. package/dist/migrate/user-table/plugin.js +62 -0
  378. package/dist/migrate/user-table/plugin.js.map +1 -0
  379. package/dist/migrate/userfront/plugin.d.ts +2 -0
  380. package/dist/migrate/userfront/plugin.js +60 -0
  381. package/dist/migrate/userfront/plugin.js.map +1 -0
  382. package/dist/migrate/workos/plugin.d.ts +2 -0
  383. package/dist/migrate/workos/plugin.js +81 -0
  384. package/dist/migrate/workos/plugin.js.map +1 -0
  385. package/dist/migrate/zitadel/plugin.d.ts +2 -0
  386. package/dist/migrate/zitadel/plugin.js +114 -0
  387. package/dist/migrate/zitadel/plugin.js.map +1 -0
  388. package/dist/run.js +4 -0
  389. package/dist/run.js.map +1 -1
  390. package/package.json +7 -5
package/dist/help.js CHANGED
@@ -23,6 +23,7 @@ Commands:
23
23
  api-keys list|create|revoke
24
24
  webhooks list|create|upsert|update|test|deliveries|redeliver|replay|rotate|reveal
25
25
  listen --forward-to <url> Forward live events to your local server, signed (no tunnel)
26
+ dev [proxy] Local in-memory Atlas (emulator) / one-origin dev proxy
26
27
  move-origin --from --to Move an app to a new domain in one step (--dry-run first)
27
28
  csp --framework next|express|nginx
28
29
  Print the Content Security Policy sources Atlas needs
@@ -36,8 +37,12 @@ Commands:
36
37
  Atlas staff: accounts for other platforms' integration teams
37
38
  (operator sign-in with a recent second factor; passwords to 0600 files)
38
39
  sessions revoke
39
- config export|import|plan Config-as-code: round-trip the instance's config; plan = drift diff
40
+ config export|import|plan|promote
41
+ Config-as-code: round-trip the instance's config; plan = drift diff;
42
+ promote = copy one environment's config to another
40
43
  actions list|deploy|test|logs|gallery|show|install|installs|update|publish
44
+ pages list|push|preview|promote|pull|discard
45
+ Code-defined hosted-page templates: draft, signed preview link, promote
41
46
  init Create or complete an app's setup (idempotent); secrets to 0600 files
42
47
  preflight Check an instance's setup; non-zero exit on errors (for CI)
43
48
  doctor Integration health: webhooks, logout, referrals, email, consent (exit 1 on a failure)
@@ -58,6 +63,9 @@ Commands:
58
63
  migrate better-auth config [path]
59
64
  Translate the app's betterAuth({...}) options into Atlas
60
65
  config files plus a report (offline)
66
+ migrate <vendor> [step] [path]
67
+ Move from any vendor (config, export, import, bridge, lazy):
68
+ resumable; vendor credentials never leave this machine
61
69
  info [path] Print the environment for a support ticket (versions, SDKs,
62
70
  instance, API latency, preflight); secrets redacted
63
71
  mcp install Add the Atlas MCP server (docs search) to Cursor, Claude Code,
@@ -94,6 +102,35 @@ Usage:
94
102
  atlas migrate better-auth [path] [--dry-run] [--yes] [--resume] [--force] [--json]
95
103
  [--dir <dir>] [--state-file <file>] [--entry <file>] [--bundle <file>] [--run-export]
96
104
  [--confirm-conflicts] [--bridge-days <n>] [--skip <step,...>]
105
+ atlas migrate <vendor> [path] [--dry-run] [--yes] [--resume] [--force] [--json]
106
+ [--set name=value ...] [--skip <step,...>] [--bridge-days <n>] [--confirm-conflicts]
107
+ atlas migrate <vendor> config|export|import|bridge|lazy [path] [--set name=value ...]
108
+ atlas migrate export <vendor> [path] (same as: atlas migrate <vendor> export)
109
+ atlas migrate custom export --file <records.ndjson|.json> [path]
110
+
111
+ migrate <vendor> is the program for every other vendor, one plugin each
112
+ (atlas migrate --help lists them). Steps, checkpointed in
113
+ atlas-migrate/<vendor>/state.json (--state-file):
114
+ preflight instance and key
115
+ config read the vendor's configuration, write Atlas config files and
116
+ <vendor>-report.md (1:1 / differs / manual, with where each came from)
117
+ export read the vendor (its API with YOUR vendor credentials, an export
118
+ file, or your database) and write atlas-migrate/<vendor>/bundle.atlas,
119
+ sealed to this instance's import key; resumable from a checkpoint
120
+ import upload, dry-run report, confirm, import (resumes a stopped import)
121
+ bridge accept the vendor's sessions for --bridge-days (default 30)
122
+ lazy verify passwords against the vendor on first sign-in (vendors whose
123
+ hashes never leave them)
124
+ code atlas migrate code --from <vendor>, after a confirmation
125
+ verify the import's counts and a checklist
126
+ Vendor settings and credentials are --set name=value (e.g. --set auth0-domain=…)
127
+ or the environment variable the plugin names; they are used here only.
128
+
129
+ Self-hosted frameworks (authjs, lucia, passport, iron-session, devise, django)
130
+ keep users in your own database, so nothing calls a vendor: config reads your
131
+ app's source, and export reads table dumps you make with your own tools
132
+ (--set dump=<dir>: one <table>.csv/.json/.ndjson per table) or, for devise and
133
+ django, the export script it writes on the first run, piped in with --file -.
97
134
 
98
135
  migrate better-auth config reads your betterAuth({...}) setup statically (it
99
136
  follows imports and resolves env vars by NAME, never their values) and writes
@@ -126,10 +163,33 @@ Vendors:
126
163
  Supabase client itself stays for your database
127
164
  auth0 @auth0/auth0-react, @auth0/nextjs-auth0 (v3 and v4), @auth0/auth0-spa-js
128
165
  better-auth better-auth (client, server, Next.js handler, cookies)
166
+ lucia lucia v2 / v3 (validateSession, cookies, invalidate…): TODO markers
167
+ naming the Atlas call for each, since no call has the same shape
168
+ passport passport + express-session (initialize, session, authenticate('jwt'),
169
+ req.isAuthenticated()); strategies and req.user are reported
170
+ iron-session getIronSession() reads of the user id -> auth()
171
+ keycloak keycloak-js, @react-keycloak, keycloak-connect, the Keycloak Auth.js provider
172
+ ory @ory/client, @ory/nextjs, @ory/elements (Kratos and Hydra)
173
+ zitadel @zitadel/react, @zitadel/node, @zitadel/next
174
+ logto @logto/react, @logto/next, @logto/node and the other Logto SDKs
175
+ supertokens supertokens-node, supertokens-web-js, supertokens-auth-react
176
+ authentik react-oidc-context / oidc-client-ts pointed at authentik, @goauthentik/api
177
+ fusionauth @fusionauth/react-sdk, @fusionauth/typescript-client and the other FusionAuth SDKs
178
+ hanko @teamhanko/hanko-elements and hanko-frontend-sdk
129
179
  openid-client openid-client (Issuer.discover, authorizationUrl, callback, endSessionUrl)
130
180
  jose jose used to verify OIDC ID tokens (jwtVerify + createRemoteJWKSet)
131
181
  generic-oidc a hand-rolled relying party (discovery, PKCE, code exchange, JWKS) found
132
182
  by its code; replaced by oidc.start / oidc.callback / oidc.logoutUrl
183
+ firebase firebase/auth (modular and v8 compat), react-firebase-hooks, FirebaseUI,
184
+ firebase-admin auth calls; Firebase itself stays for Firestore/Storage
185
+ cognito aws-amplify/auth (v6 and v5 Auth), Hub auth events, @aws-amplify/ui-react,
186
+ amazon-cognito-identity-js, aws-jwt-verify
187
+ azure-ad-b2c @azure/msal-browser, @azure/msal-react, @azure/msal-node, passport-azure-ad
188
+ entra-external-id the same MSAL rewrite, for Entra External ID tenants
189
+ appwrite the Appwrite Account API (new Account(client)), node-appwrite Users/Teams;
190
+ Databases/Storage stay
191
+ pocketbase pb.authStore and collection auth calls; collections and files stay
192
+ nhost @nhost/react / @nhost/nextjs hooks and nhost.auth.*; GraphQL/Storage stay
133
193
 
134
194
  What it rewrites: imports, providers, hooks, server session helpers, middleware,
135
195
  sign-in/out calls and env var names, onto native Atlas APIs and the drop-in
@@ -143,6 +203,7 @@ Options:
143
203
  --json Machine-readable result (diffs, report, packages, env)
144
204
 
145
205
  Safe to re-run: migrated code is left as it is. Move your users with
206
+ 'atlas migrate <vendor>' (Clerk, Auth0, Okta, Kinde, Descope, Better Auth) or
146
207
  'atlas import --from <vendor> <export-file>'.`,
147
208
  info: `atlas info — the environment, for support tickets
148
209
 
@@ -371,6 +432,16 @@ and no second endpoint. The signing secret belongs to this session only and is
371
432
  written to a 0600 file (webhook-listen.env): point your verifier at it. --events
372
433
  takes names or patterns (user.*, *.created). The session lasts up to an hour;
373
434
  Ctrl-C stops it. --count n exits after n events (exit 1 if any forward failed).`,
435
+ dev: `atlas dev — a local, in-memory Atlas
436
+
437
+ Usage:
438
+ atlas dev [--port 4400] [--seed seed.json] [--app http://localhost:3000]
439
+ atlas dev proxy --app <url> --api <fapi url> [--port 4401]
440
+
441
+ The emulator serves the Frontend API, a minimal Backend API, OIDC discovery and
442
+ a mail/SMS catcher at /__emulator/mail. Every code is 424242. With --app it also
443
+ forwards everything it does not own to your app, so both share one origin.
444
+ 'dev proxy' does the same against a real instance. No account, no network.`,
374
445
  'move-origin': `atlas move-origin — move an app to a new domain
375
446
 
376
447
  Usage: atlas move-origin --from <origin> --to <origin> [--dry-run] [--yes] [--json]
@@ -562,6 +633,7 @@ Usage:
562
633
  atlas config export [--dir <path>] [--format json|yaml]
563
634
  atlas config import [--dir <path>] [--format json|yaml] [--dry-run] [--prune]
564
635
  atlas config plan [--dir <path>] [--format json|yaml] [--prune] [--exit-code] [--json]
636
+ atlas config promote --from <profile> --to <profile> [--dry-run] [--prune] [--yes] [--format json|yaml]
565
637
 
566
638
  export Read the instance's current config (instance/auth config, OAuth clients
567
639
  and providers, SSO connections, resource servers, JWT templates, roles,
@@ -580,13 +652,35 @@ plan A Terraform-style, read-only diff of the directory against the live
580
652
  instance: field-by-field before -> after for updates. --exit-code exits 2
581
653
  when there is drift (for CI); --json for tooling.
582
654
 
655
+ promote Copy one environment's configuration to another (development ->
656
+ staging -> production). Each environment is a profile holding that
657
+ instance's secret key ('atlas login --profile staging'). Uses the same
658
+ plan/apply engine as import; --dry-run prints the plan only, and
659
+ applying to a live key needs --yes. Secrets never travel.
660
+
583
661
  Secrets never live on disk. Inject a credential at import with a \${ENV_VAR}
584
662
  placeholder in a file (e.g. a provider "client_secret": "\${GOOGLE_SECRET}").`,
663
+ pages: `atlas pages — code-defined hosted-page templates
664
+
665
+ Usage:
666
+ atlas pages list [--json]
667
+ atlas pages push <file> --page <sign-in|sign-up|user-profile> [--promote] [--json]
668
+ atlas pages preview --page <page> [--json]
669
+ atlas pages promote --page <page> [--json]
670
+ atlas pages pull --page <page> [--draft]
671
+ atlas pages discard --page <page> --status <draft|live> [--json]
672
+
673
+ A template is a JSON file of components (heading, text, image, link, button_link,
674
+ list, divider, spacer, columns) in four regions around the sign-in card: header,
675
+ above_form, below_form and footer. There is no raw HTML, CSS or script; Atlas
676
+ validates the file and renders it. push saves a draft only; the live page does not
677
+ change until promote (or push --promote). preview prints a signed link, valid for an
678
+ hour, that shows the draft with a preview banner.`,
585
679
  actions: `atlas actions — manage Actions (tenant code run in the auth pipeline)
586
680
 
587
681
  Usage:
588
682
  atlas actions list [--json]
589
- atlas actions deploy <file> --trigger <post_login|pre_user_registration|post_user_registration> [--name <n>] [--json]
683
+ atlas actions deploy <file> --trigger <trigger> [--name <n>] [--json]
590
684
  atlas actions test <file> [--trigger <t>] [--json]
591
685
  atlas actions logs <action-id> [--json]
592
686
 
package/dist/help.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEU,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDA6EgC,CAAC;AAEzD,oDAAoD;AACvC,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAyDmC;IAC5C,IAAI,EAAE;;;;;;;;;;gEAUwD;IAC9D,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2EAmCiE;IACzE,GAAG,EAAE;;;;;;;;;;;;;;;+CAewC;IAC7C,MAAM,EAAE;;;;;;;;;;;;sCAY4B;IACpC,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IAEnC,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEA+BiE;IAEvE,SAAS,EAAE;;;;;;oDAMuC;IAElD,MAAM,EAAE;;;;;;;;iEAQuD;IAE/D,GAAG,EAAE;;;;;;;;;;mDAU4C;IAEjD,MAAM,EAAE;;;;;;;;wDAQ8C;IAEtD,QAAQ,EAAE;;;8CAGkC;IAE5C,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8EAgCoE;IAC5E,KAAK,EAAE;;;;;;;;;;;;;;;kDAeyC;IAChD,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;qEA0B0D;CACpE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { webhooks } from './commands/webhooks';
20
20
  export { sessions } from './commands/sessions';
21
21
  export { config } from './commands/config';
22
22
  export { actions } from './commands/actions';
23
+ export { pages } from './commands/pages';
23
24
  export { init } from './commands/init';
24
25
  export { preflight, envCommand, client } from './commands/project-commands';
25
26
  export { referrals } from './commands/referrals';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BETTER_AUTH_MIGRATION_STEPS = exports.migrateBetterAuth = exports.translateBetterAuth = exports.planConfigImport = exports.migrate = exports.manifestPath = exports.writeManifest = exports.readManifest = exports.deliverSecret = exports.productDir = exports.renderDotenv = exports.parseDotenv = exports.readEnvFile = exports.writeSecretFile = exports.referrals = exports.client = exports.envCommand = exports.preflight = exports.init = exports.actions = exports.config = exports.sessions = exports.webhooks = exports.apiKeys = exports.orgs = exports.users = exports.whoami = exports.logout = exports.login = exports.getVersion = exports.defaultPrompter = exports.defaultConfigPath = exports.MemoryConfigStore = exports.FileConfigStore = exports.captureIO = exports.defaultIO = exports.CliError = exports.isNotFound = exports.createConfigHttp = exports.defaultContext = exports.run = void 0;
3
+ exports.BETTER_AUTH_MIGRATION_STEPS = exports.migrateBetterAuth = exports.translateBetterAuth = exports.planConfigImport = exports.migrate = exports.manifestPath = exports.writeManifest = exports.readManifest = exports.deliverSecret = exports.productDir = exports.renderDotenv = exports.parseDotenv = exports.readEnvFile = exports.writeSecretFile = exports.referrals = exports.client = exports.envCommand = exports.preflight = exports.init = exports.pages = exports.actions = exports.config = exports.sessions = exports.webhooks = exports.apiKeys = exports.orgs = exports.users = exports.whoami = exports.logout = exports.login = exports.getVersion = exports.defaultPrompter = exports.defaultConfigPath = exports.MemoryConfigStore = exports.FileConfigStore = exports.captureIO = exports.defaultIO = exports.CliError = exports.isNotFound = exports.createConfigHttp = exports.defaultContext = exports.run = void 0;
4
4
  /**
5
5
  * Library surface of `@atlasauth/cli`. The package ships a bin (`atlas`), but
6
6
  * exporting the pieces lets the handlers be unit-tested with injected deps and
@@ -46,6 +46,8 @@ var config_2 = require("./commands/config");
46
46
  Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_2.config; } });
47
47
  var actions_1 = require("./commands/actions");
48
48
  Object.defineProperty(exports, "actions", { enumerable: true, get: function () { return actions_1.actions; } });
49
+ var pages_1 = require("./commands/pages");
50
+ Object.defineProperty(exports, "pages", { enumerable: true, get: function () { return pages_1.pages; } });
49
51
  var init_1 = require("./commands/init");
50
52
  Object.defineProperty(exports, "init", { enumerable: true, get: function () { return init_1.init; } });
51
53
  var project_commands_1 = require("./commands/project-commands");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAA0C;AAAjC,0FAAA,GAAG,OAAA;AACZ,qCAAmF;AAA1E,yGAAA,cAAc,OAAA;AACvB,6CAA8E;AAArE,+GAAA,gBAAgB,OAAA;AAAE,yGAAA,UAAU,OAAA;AACrC,mCAAoC;AAA3B,kGAAA,QAAQ,OAAA;AACjB,2BAAqE;AAA5D,+FAAA,SAAS,OAAA;AAAE,+FAAA,SAAS,OAAA;AAC7B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;AAEf,qCAOmB;AANjB,uGAAA,YAAY,OAAA;AACZ,wGAAA,aAAa,OAAA;AACb,uGAAA,YAAY,OAAA;AAKd,8CAA6C;AAApC,kGAAA,OAAO,OAAA;AAChB,4CAA0F;AAAjF,0GAAA,gBAAgB,OAAA;AACzB,6DAA+H;AAAtH,gHAAA,mBAAmB,OAAA;AAC5B,mEAA6G;AAApG,iHAAA,iBAAiB,OAAA;AAAE,2HAAA,KAAK,OAA+B"}
@@ -0,0 +1,2 @@
1
+ import type { MigrationPlugin } from '../framework/plugin';
2
+ export declare const appwritePlugin: MigrationPlugin;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appwritePlugin = void 0;
4
+ const appwrite_1 = require("../export/appwrite");
5
+ const appwrite_config_1 = require("../export/appwrite-config");
6
+ const errors_1 = require("../../errors");
7
+ const plugin_kit_1 = require("../export/plugin-kit");
8
+ const project_files_1 = require("../export/project-files");
9
+ /**
10
+ * `atlas migrate appwrite` — an Appwrite project (Cloud or self-hosted): auth
11
+ * settings from appwrite.json and the project document, users with their
12
+ * hashes and hash options, identities, MFA recovery codes, teams, memberships
13
+ * and invitations through the Server API (an API key on this machine), the
14
+ * `appwrite` remote bridge (Appwrite vouches for a live session once), lazy
15
+ * migration through the Account API for anyone the export missed, and the
16
+ * `appwrite` codemod.
17
+ */
18
+ const ENDPOINT = { flag: '--appwrite-endpoint', env: 'APPWRITE_ENDPOINT', label: 'the Appwrite API endpoint including /v1 (default https://cloud.appwrite.io/v1)', required: false };
19
+ const PROJECT_ID = { flag: '--appwrite-project-id', env: 'APPWRITE_PROJECT_ID', label: 'the Appwrite project id', required: true };
20
+ const API_KEY = { flag: '--appwrite-api-key', env: 'APPWRITE_API_KEY', label: 'an Appwrite API key with users.read and teams.read', required: true, secret: true };
21
+ const RECOVERY_CODES = { flag: '--appwrite-recovery-codes', env: 'APPWRITE_RECOVERY_CODES', label: 'true to export MFA recovery codes', required: false };
22
+ const SKIP_TEAMS = { flag: '--appwrite-skip-teams', env: 'APPWRITE_SKIP_TEAMS', label: 'true to leave teams out', required: false };
23
+ const CONFIG_FILE = { flag: '--appwrite-config', env: 'APPWRITE_CONFIG_FILE', label: 'appwrite.json (after appwrite pull settings)', required: false };
24
+ const PROJECT_FILE = { flag: '--appwrite-project-file', env: 'APPWRITE_PROJECT_FILE', label: 'the project document (appwrite projects get --project-id <id> --json)', required: false };
25
+ function endpointOf(p) {
26
+ return (p.credential(ENDPOINT) ?? appwrite_1.APPWRITE_CLOUD).trim().replace(/\/+$/, '');
27
+ }
28
+ exports.appwritePlugin = {
29
+ vendor: 'appwrite',
30
+ source: 'appwrite',
31
+ label: 'Appwrite',
32
+ help: 'Move an Appwrite project: its auth methods, session and password settings and OAuth providers as Atlas config; its users with their password hashes (Argon2, bcrypt, scrypt, Firebase scrypt, MD5, SHA, phpass), labels, prefs, OAuth identities, MFA recovery codes, teams, memberships and invitations; a zero-logout bridge that asks Appwrite about each live session once; lazy migration for anyone left; and the code. Your API key stays on this machine.',
33
+ config: {
34
+ reads: 'appwrite.json (appwrite pull settings) and, for OAuth providers, the project document (appwrite projects get --json)',
35
+ credentials: [CONFIG_FILE, PROJECT_FILE, ENDPOINT, { ...PROJECT_ID, required: false }],
36
+ async translate(p) {
37
+ const file = (0, project_files_1.projectFile)(p, CONFIG_FILE, ['appwrite.json', 'appwrite.config.json']);
38
+ const projectText = (0, plugin_kit_1.localFile)(p, PROJECT_FILE, 'text');
39
+ if (!file && !projectText)
40
+ throw new errors_1.CliError('Appwrite: no appwrite.json in this folder. Run appwrite pull settings, or pass --set appwrite-config=<file> / --set appwrite-project-file=<appwrite projects get --json output>.');
41
+ let project;
42
+ if (projectText) {
43
+ try {
44
+ project = JSON.parse(projectText);
45
+ }
46
+ catch {
47
+ throw new errors_1.CliError('Appwrite: the project document is not JSON (use appwrite projects get --project-id <id> --json).');
48
+ }
49
+ }
50
+ return (0, plugin_kit_1.vendorStep)('Appwrite', async () => (0, appwrite_config_1.translateAppwriteConfig)({ file, project, endpoint: p.credential(ENDPOINT), projectId: p.credential({ ...PROJECT_ID, required: false }) }));
51
+ },
52
+ },
53
+ export: {
54
+ reads: 'the Appwrite Server API (users with hashes, identities, MFA, teams and memberships)',
55
+ credentials: [ENDPOINT, PROJECT_ID, API_KEY, RECOVERY_CODES, SKIP_TEAMS],
56
+ limits: [
57
+ 'TOTP secrets are encrypted at rest and Appwrite has no API to read them: those users enrol an authenticator app again. Recovery codes move with --set appwrite-recovery-codes=true.',
58
+ 'Sessions are stored as hashes and cannot be exported: the appwrite bridge preset asks Appwrite about each live session once instead.',
59
+ 'A SHA hash imported into Appwrite without a version is ambiguous (SHA3-512 on 1.x, SHA-256 on 2.x): the export picks by digest length and warns.',
60
+ 'OAuth access and refresh tokens are not exported: users keep their link and re-consent when your app next calls the provider.',
61
+ ],
62
+ async run(p, writer, resume) {
63
+ const set = await (0, plugin_kit_1.vendorStep)('Appwrite', () => (0, appwrite_1.exportAppwrite)({
64
+ endpoint: endpointOf(p),
65
+ projectId: (0, plugin_kit_1.need)(p, PROJECT_ID),
66
+ apiKey: (0, plugin_kit_1.need)(p, API_KEY),
67
+ recoveryCodes: (0, project_files_1.truthyCredential)(p, RECOVERY_CODES),
68
+ skipTeams: (0, project_files_1.truthyCredential)(p, SKIP_TEAMS),
69
+ fetchImpl: p.fetch,
70
+ onProgress: (m) => p.say(` reading ${m}`),
71
+ }));
72
+ await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
73
+ },
74
+ },
75
+ bridge: {
76
+ preset: 'appwrite',
77
+ vars(p, t) {
78
+ const vars = { ...t?.bridge?.vars };
79
+ const endpoint = p.credential(ENDPOINT);
80
+ if (endpoint || !vars.endpoint_url)
81
+ vars.endpoint_url = endpointOf(p);
82
+ const project = p.credential({ ...PROJECT_ID, required: false });
83
+ if (project)
84
+ vars.project_id = project;
85
+ return vars;
86
+ },
87
+ },
88
+ lazy: {
89
+ preset: 'appwrite',
90
+ config(p, t) {
91
+ const config = { ...t?.lazy?.config };
92
+ const endpoint = p.credential(ENDPOINT);
93
+ if (endpoint || !config.endpoint)
94
+ config.endpoint = endpointOf(p);
95
+ const project = p.credential({ ...PROJECT_ID, required: false });
96
+ if (project)
97
+ config.project_id = project;
98
+ return config;
99
+ },
100
+ },
101
+ codemod: 'appwrite',
102
+ };
103
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/appwrite/plugin.ts"],"names":[],"mappings":";;;AAAA,iDAAoE;AACpE,+DAAoE;AACpE,yCAAwC;AAExC,qDAAmF;AACnF,2DAAwE;AAExE;;;;;;;;GAQG;AAEH,MAAM,QAAQ,GAAmB,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,gFAAgF,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACrM,MAAM,UAAU,GAAmB,EAAE,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACnJ,MAAM,OAAO,GAAmB,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,oDAAoD,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACnL,MAAM,cAAc,GAAmB,EAAE,IAAI,EAAE,2BAA2B,EAAE,GAAG,EAAE,yBAAyB,EAAE,KAAK,EAAE,mCAAmC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC1K,MAAM,UAAU,GAAmB,EAAE,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACpJ,MAAM,WAAW,GAAmB,EAAE,IAAI,EAAE,mBA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Plugin } from '../framework/plugin';
2
+ export declare const auth0Plugin: MigrationPlugin;
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.auth0Plugin = void 0;
4
+ const auth0_1 = require("../export/auth0");
5
+ const auth0_config_1 = require("../export/auth0-config");
6
+ const errors_1 = require("../../errors");
7
+ const plugin_kit_1 = require("../export/plugin-kit");
8
+ const vendor_http_1 = require("../export/vendor-http");
9
+ /**
10
+ * `atlas migrate auth0` (also Okta Customer Identity Cloud) — the tenant's
11
+ * settings through the Management API, users through a users-export job (or
12
+ * an export file), the password hashes and MFA secrets from Auth0 support's
13
+ * encrypted export when the owner has it, the `auth0` bridge preset (the ID
14
+ * token in the app session, verified against the tenant's JWKS) and lazy
15
+ * migration through the password-realm grant for every other password.
16
+ */
17
+ const DOMAIN = { flag: '--auth0-domain', env: 'AUTH0_DOMAIN', label: 'your Auth0 domain (tenant.us.auth0.com)', required: true };
18
+ const MGMT_CLIENT_ID = { flag: '--auth0-mgmt-client-id', env: 'AUTH0_MGMT_CLIENT_ID', label: 'the client id of a machine-to-machine app authorized for the Management API', required: false };
19
+ const MGMT_CLIENT_SECRET = { flag: '--auth0-mgmt-client-secret', env: 'AUTH0_MGMT_CLIENT_SECRET', label: 'that app\'s client secret', required: false, secret: true };
20
+ const MGMT_TOKEN = { flag: '--auth0-mgmt-token', env: 'AUTH0_MGMT_TOKEN', label: 'a Management API token', required: false, secret: true };
21
+ const CLIENT_ID = { flag: '--auth0-client-id', env: 'AUTH0_CLIENT_ID', label: 'your application\'s client id (the ID token audience)', required: false };
22
+ const CLIENT_SECRET = { flag: '--auth0-client-secret', env: 'AUTH0_CLIENT_SECRET', label: 'your application\'s client secret (for a confidential application)', required: false, secret: true };
23
+ const CONNECTION = { flag: '--auth0-connection', env: 'AUTH0_CONNECTION', label: 'the database connection', required: false };
24
+ const USERS_FILE = { flag: '--auth0-users-file', env: 'AUTH0_USERS_FILE', label: 'a users export file (NDJSON or JSON)', required: false };
25
+ const HASHES_FILE = { flag: '--auth0-hashes-file', env: 'AUTH0_HASHES_FILE', label: 'the decrypted password-hash export from Auth0 support', required: false };
26
+ const RP_ID = { flag: '--rp-id', env: 'ATLAS_MIGRATE_RP_ID', label: 'the WebAuthn relying party id passkeys were registered for', required: false };
27
+ function domainOf(p) {
28
+ return (0, plugin_kit_1.hostOf)((0, plugin_kit_1.need)(p, DOMAIN));
29
+ }
30
+ /** The Management API, with a token or client credentials (asked for on this machine, sent only to Auth0). */
31
+ function managementHttp(p, domain) {
32
+ const token = p.credential(MGMT_TOKEN);
33
+ const clientId = p.credential(MGMT_CLIENT_ID);
34
+ const clientSecret = p.credential(MGMT_CLIENT_SECRET);
35
+ if (!token && !(clientId && clientSecret)) {
36
+ throw new errors_1.CliError('Auth0: pass a Management API token (--auth0-mgmt-token / AUTH0_MGMT_TOKEN), or the client id and secret of a machine-to-machine app authorized for it (AUTH0_MGMT_CLIENT_ID, AUTH0_MGMT_CLIENT_SECRET).');
37
+ }
38
+ let bearer = token;
39
+ return new vendor_http_1.VendorHttp({
40
+ vendor: 'Auth0',
41
+ baseUrl: `https://${domain}/api/v2`,
42
+ headers: async () => ({ authorization: `Bearer ${(bearer ??= await (0, auth0_1.managementToken)(domain, { domain, clientId, clientSecret }, p.fetch))}` }),
43
+ fetchImpl: p.fetch,
44
+ });
45
+ }
46
+ exports.auth0Plugin = {
47
+ vendor: 'auth0',
48
+ source: 'auth0',
49
+ label: 'Auth0',
50
+ help: 'Move an Auth0 (Okta Customer Identity Cloud) tenant: its connections, MFA, password policy, applications, APIs, roles and organizations as Atlas config; its users (export job), identities, organizations, members, roles and invitations, plus password hashes and MFA secrets from the encrypted export Auth0 support provides; a zero-logout bridge; lazy migration for every password you do not have; and the code. Management credentials stay on this machine.',
51
+ config: {
52
+ reads: 'your Auth0 tenant via the Management API',
53
+ credentials: [DOMAIN, MGMT_TOKEN, MGMT_CLIENT_ID, MGMT_CLIENT_SECRET],
54
+ async translate(p) {
55
+ const domain = domainOf(p);
56
+ const snap = await (0, plugin_kit_1.vendorStep)('Auth0', () => (0, auth0_config_1.fetchAuth0Config)(managementHttp(p, domain), domain));
57
+ return (0, auth0_config_1.translateAuth0Config)(snap);
58
+ },
59
+ },
60
+ export: {
61
+ reads: 'the Auth0 Management API (users-export job, organizations, roles) and the support hash export (--auth0-hashes-file)',
62
+ credentials: [DOMAIN, MGMT_TOKEN, MGMT_CLIENT_ID, MGMT_CLIENT_SECRET, USERS_FILE, HASHES_FILE, CONNECTION],
63
+ limits: [
64
+ 'Password hashes and MFA secrets never come out of the Management API: Auth0 support exports them on request (paid plans, encrypted to your PGP key). Pass the decrypted file with --auth0-hashes-file; without it, passwords move by lazy migration.',
65
+ 'Users-export jobs are not available on the Free plan: export from the dashboard (or the User Import / Export extension) and pass the file with --auth0-users-file.',
66
+ 'Passkey private keys never leave the authenticator; with --authentication-methods the public credentials are exported and keep working when your Atlas domain matches the relying party (--rp-id).',
67
+ 'Sessions are not exported: the auth0 bridge preset exchanges the ID token from the app session.',
68
+ ],
69
+ async run(p, writer, resume) {
70
+ const domain = domainOf(p);
71
+ const usersText = (0, plugin_kit_1.localFile)(p, USERS_FILE, 'text');
72
+ const token = p.credential(MGMT_TOKEN);
73
+ const clientId = p.credential(MGMT_CLIENT_ID);
74
+ const clientSecret = p.credential(MGMT_CLIENT_SECRET);
75
+ if (!usersText && !token && !(clientId && clientSecret)) {
76
+ throw new errors_1.CliError('Auth0: pass Management API credentials (AUTH0_MGMT_TOKEN, or AUTH0_MGMT_CLIENT_ID and AUTH0_MGMT_CLIENT_SECRET), or a users export file (--auth0-users-file).');
77
+ }
78
+ const set = await (0, plugin_kit_1.vendorStep)('Auth0', () => (0, auth0_1.exportAuth0)({
79
+ domain,
80
+ token,
81
+ clientId,
82
+ clientSecret,
83
+ usersText,
84
+ hashesText: (0, plugin_kit_1.localFile)(p, HASHES_FILE, 'text'),
85
+ connectionId: p.credential(CONNECTION),
86
+ authenticationMethods: (0, plugin_kit_1.flag)(p, 'authentication-methods'),
87
+ rpId: p.credential(RP_ID),
88
+ fetchImpl: p.fetch,
89
+ onProgress: (m) => p.say(` reading ${m}`),
90
+ }));
91
+ await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
92
+ },
93
+ },
94
+ bridge: {
95
+ preset: 'auth0',
96
+ vars(p, t) {
97
+ const vars = { ...t?.bridge?.vars };
98
+ const domain = p.credential({ ...DOMAIN, required: false });
99
+ if (domain)
100
+ vars.domain = (0, plugin_kit_1.hostOf)(domain);
101
+ const clientId = p.credential(CLIENT_ID);
102
+ if (clientId)
103
+ vars.client_id = clientId;
104
+ return vars;
105
+ },
106
+ },
107
+ lazy: {
108
+ preset: 'auth0',
109
+ config(p, t) {
110
+ const config = { ...t?.lazy?.config };
111
+ const domain = p.credential({ ...DOMAIN, required: false });
112
+ if (domain)
113
+ config.domain = (0, plugin_kit_1.hostOf)(domain);
114
+ const clientId = p.credential(CLIENT_ID);
115
+ if (clientId)
116
+ config.client_id = clientId;
117
+ const connection = p.credential(CONNECTION);
118
+ if (connection)
119
+ config.connection = connection;
120
+ return config;
121
+ },
122
+ secret: CLIENT_SECRET,
123
+ },
124
+ codemod: 'auth0',
125
+ };
126
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/auth0/plugin.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAC/D,yDAAgF;AAChF,yCAAwC;AAExC,qDAAiG;AACjG,uDAAmD;AAEnD;;;;;;;GAOG;AAEH,MAAM,MAAM,GAAmB,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,yCAAyC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjJ,MAAM,cAAc,GAAmB,EAAE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,sBAAsB,EAAE,KAAK,EAAE,6EAA6E,EAAE,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C;YAC9D,MAAM,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5D,IAAI,MAAM;gBAAE,MAAM,CAAC,MAAM,GAAG,IAAA,mBAAM,EAAC,MAAM,CAAC,CAAC;YAC3C,MAAM,QAAQ,GAAG,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YACzC,IAAI,QAAQ;gBAAE,MAAM,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1C,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAC5C,IAAI,UAAU;gBAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;YAC/C,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,aAAa;KACtB;IACD,OAAO,EAAE,OAAO;CACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { MigrationPlugin } from '../framework/plugin';
2
+ export declare const authentikPlugin: MigrationPlugin;
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.authentikPlugin = void 0;
4
+ const node_path_1 = require("node:path");
5
+ const errors_1 = require("../../errors");
6
+ const authentik_1 = require("../export/authentik");
7
+ const authentik_config_1 = require("../export/authentik-config");
8
+ const tables_1 = require("../export/frameworks/tables");
9
+ const plugin_kit_1 = require("../export/plugin-kit");
10
+ /**
11
+ * `atlas migrate authentik` — a self-hosted authentik: its blueprint file (or
12
+ * the settings objects through the API) as Atlas config; users with their
13
+ * Django password digests (PBKDF2, bcrypt, Argon2, scrypt), social and SAML
14
+ * source links, groups and RBAC roles, API and app-password tokens, TOTP
15
+ * seeds, recovery codes, SMS / email factors and WebAuthn passkeys from a
16
+ * dump of authentik's own PostgreSQL tables made on this machine; the
17
+ * `authentik` bridge preset (an OAuth2 provider's token becomes an Atlas
18
+ * session); lazy migration through authentik's flow executor when only the API
19
+ * is available; and the code. Nothing here connects to the database.
20
+ */
21
+ const DUMP = { flag: '--authentik-dump', env: 'AUTHENTIK_DUMP_DIR', label: 'a folder of authentik table dumps (authentik_core_user.csv, authentik_core_group.json, …)', required: false };
22
+ const URL_ = { flag: '--authentik-url', env: 'AUTHENTIK_URL', label: 'the authentik URL (https://auth.example.com)', required: false };
23
+ const TOKEN = { flag: '--authentik-token', env: 'AUTHENTIK_TOKEN', label: 'an authentik API token (Directory → Tokens, intent API)', required: false, secret: true };
24
+ const BLUEPRINT = { flag: '--authentik-blueprint', env: 'AUTHENTIK_BLUEPRINT', label: 'a blueprint YAML file (ak export_blueprint)', required: false };
25
+ const SUB_MODE = { flag: '--authentik-sub-mode', env: 'AUTHENTIK_SUB_MODE', label: `the provider's Subject mode (${authentik_1.AUTHENTIK_SUB_MODES.join(', ')}); default: the mode the providers in the dump use, else hashed_user_id`, required: false };
26
+ const INSTALL_ID = { flag: '--authentik-install-id', env: 'AUTHENTIK_INSTALL_ID', label: 'the install id (SELECT id FROM authentik_install_id), when the dump lacks that table', required: false };
27
+ const GROUPS_AS = { flag: '--authentik-groups-as', env: 'AUTHENTIK_GROUPS_AS', label: 'roles (default), organizations or skip: what authentik groups become', required: false };
28
+ const RP_ID = { flag: '--rp-id', env: 'ATLAS_MIGRATE_RP_ID', label: 'the WebAuthn relying party id for passkeys registered before authentik stored one (your authentik host)', required: false };
29
+ const TRUST_EMAILS = { flag: '--authentik-trust-emails', env: 'AUTHENTIK_TRUST_EMAILS', label: '"true" to treat every email address as verified (authentik has no verified flag)', required: false };
30
+ const OAUTH_TOKENS = { flag: '--authentik-oauth-tokens', env: 'AUTHENTIK_OAUTH_TOKENS', label: '"include" to carry the stored upstream OAuth access tokens of social links', required: false };
31
+ const ISSUER = { flag: '--authentik-issuer', env: 'AUTHENTIK_ISSUER', label: "the provider's issuer URL (https://auth.example.com/application/o/<application slug>)", required: false };
32
+ const CLIENT_ID = { flag: '--authentik-client-id', env: 'AUTHENTIK_CLIENT_ID', label: "the OAuth2 provider's client id (the tokens' aud)", required: false };
33
+ const FLOW_SLUG = { flag: '--authentik-flow-slug', env: 'AUTHENTIK_FLOW_SLUG', label: 'the authentication flow slug for lazy migration (default default-authentication-flow)', required: false };
34
+ const LAZY_SUB_MODES = ['hashed_user_id', 'user_id', 'user_username', 'user_email'];
35
+ function subMode(p) {
36
+ const raw = p.credential(SUB_MODE)?.trim().toLowerCase();
37
+ if (!raw)
38
+ return undefined;
39
+ if (!authentik_1.AUTHENTIK_SUB_MODES.includes(raw))
40
+ throw new errors_1.CliError(`authentik: --set authentik-sub-mode takes ${authentik_1.AUTHENTIK_SUB_MODES.join(', ')} (got ${raw}).`);
41
+ return raw;
42
+ }
43
+ const baseUrl = (p) => p.credential(URL_)?.trim().replace(/\/+$/, '');
44
+ exports.authentikPlugin = {
45
+ vendor: 'authentik',
46
+ source: 'authentik',
47
+ label: 'authentik',
48
+ help: "Move authentik: a blueprint file (or the settings objects through the API) as Atlas config; users with their password digests, social and SAML identities, groups and roles, tokens, authenticator apps, recovery codes and passkeys from a dump of authentik's own tables made with psql; a zero-logout bridge for an OAuth2 provider's tokens; lazy migration through authentik's flows when you only have the API; and the code. Database access stays on this machine.",
49
+ config: {
50
+ reads: 'a blueprint YAML file, or the settings objects through the authentik API',
51
+ credentials: [BLUEPRINT, URL_, TOKEN],
52
+ async translate(p) {
53
+ const url = baseUrl(p);
54
+ const file = p.credential(BLUEPRINT);
55
+ if (file) {
56
+ const text = (0, plugin_kit_1.localFile)(p, BLUEPRINT, 'text');
57
+ return (0, authentik_config_1.translateAuthentikConfig)(await (0, plugin_kit_1.vendorStep)('authentik', async () => (0, authentik_config_1.snapshotFromBlueprint)(text, file, url)));
58
+ }
59
+ const token = p.credential(TOKEN);
60
+ if (url && token)
61
+ return (0, authentik_config_1.translateAuthentikConfig)(await (0, plugin_kit_1.vendorStep)('authentik', () => (0, authentik_config_1.fetchAuthentikConfig)({ baseUrl: url, token, fetchImpl: p.fetch })));
62
+ throw new errors_1.CliError('authentik: pass a blueprint file (--set authentik-blueprint=<file>, from `ak export_blueprint`), or the authentik URL and an API token to read the settings through the API.');
63
+ },
64
+ },
65
+ export: {
66
+ reads: "a dump of authentik's tables (psql \\copy of authentik_core_user, groups, tokens, source links, authenticator devices …) or the authentik API",
67
+ credentials: [DUMP, URL_, TOKEN, SUB_MODE, INSTALL_ID, GROUPS_AS, RP_ID, TRUST_EMAILS, OAUTH_TOKENS],
68
+ limits: [
69
+ 'The API never returns password hashes, TOTP seeds, recovery codes or WebAuthn public keys: dump the database tables to move them. The API export has users, groups, roles, source links and API token keys only; passwords then move by lazy migration and authenticator users enrol again.',
70
+ 'authentik has no verified-email flag: addresses are verified only when the user attribute email_verified is true, or with --set authentik-trust-emails=true.',
71
+ 'Users are keyed by the `sub` your providers hand out (the Subject mode; hashed_user_id by default, which needs the install id): the export reads it from the dump, and warns when providers disagree.',
72
+ 'Service accounts, outpost accounts and recovery or verification tokens do not move; LDAP, Kerberos and other directory source links stay with their directory.',
73
+ 'Passkeys only work on the domain they were registered for; devices registered before authentik stored an RP id need --set rp-id=<your authentik host>.',
74
+ ],
75
+ async run(p, writer, resume) {
76
+ const dump = p.credential(DUMP);
77
+ const url = baseUrl(p);
78
+ const token = dump ? undefined : p.credential(TOKEN);
79
+ if (!dump && !(url && token)) {
80
+ throw new errors_1.CliError('authentik: pass a folder of table dumps (--set authentik-dump=<folder>), or the authentik URL and an API token for an export without password hashes.');
81
+ }
82
+ const groups = p.credential(GROUPS_AS)?.trim().toLowerCase();
83
+ if (groups && !['roles', 'organizations', 'skip'].includes(groups))
84
+ throw new errors_1.CliError(`authentik: --set authentik-groups-as takes roles, organizations or skip (got ${groups}).`);
85
+ const set = await (0, plugin_kit_1.vendorStep)('authentik', () => (0, authentik_1.exportAuthentik)({
86
+ tables: dump ? (0, tables_1.readDumpDir)((0, node_path_1.resolve)(dump)) : undefined,
87
+ baseUrl: url,
88
+ token,
89
+ subMode: subMode(p),
90
+ installId: p.credential(INSTALL_ID),
91
+ groupsAs: groups,
92
+ rpId: p.credential(RP_ID),
93
+ trustEmails: p.credential(TRUST_EMAILS)?.toLowerCase() === 'true',
94
+ oauthTokens: p.credential(OAUTH_TOKENS) === 'include',
95
+ fetchImpl: p.fetch,
96
+ onProgress: (m) => p.say(` reading ${m}`),
97
+ }));
98
+ await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
99
+ },
100
+ },
101
+ bridge: {
102
+ preset: 'authentik',
103
+ vars(p, t) {
104
+ const vars = { ...t?.bridge?.vars };
105
+ const issuer = p.credential(ISSUER);
106
+ if (issuer)
107
+ vars.issuer = issuer.trim().replace(/\/+$/, '');
108
+ const clientId = p.credential(CLIENT_ID);
109
+ if (clientId)
110
+ vars.client_id = clientId.trim();
111
+ return vars;
112
+ },
113
+ },
114
+ lazy: {
115
+ preset: 'authentik',
116
+ config(p, t) {
117
+ const config = { ...t?.lazy?.config };
118
+ const url = baseUrl(p);
119
+ if (url)
120
+ config.base_url = url;
121
+ const flow = p.credential(FLOW_SLUG);
122
+ if (flow)
123
+ config.flow_slug = flow.trim();
124
+ const mode = subMode(p);
125
+ if (mode) {
126
+ if (!LAZY_SUB_MODES.includes(mode))
127
+ throw new errors_1.CliError(`authentik: lazy migration reads the user from a session, which has no ${mode}: use ${LAZY_SUB_MODES.join(', ')}, or move users with the database export.`);
128
+ config.sub_mode = mode;
129
+ }
130
+ return config;
131
+ },
132
+ },
133
+ codemod: 'authentik',
134
+ };
135
+ //# sourceMappingURL=plugin.js.map