@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
@@ -0,0 +1,248 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseDelimited = parseDelimited;
4
+ exports.parseTable = parseTable;
5
+ exports.parseKeyValues = parseKeyValues;
6
+ exports.typedParams = typedParams;
7
+ exports.mapTable = mapTable;
8
+ const password_detect_1 = require("./password-detect");
9
+ const record_set_1 = require("./record-set");
10
+ const translate_kit_1 = require("./translate-kit");
11
+ // ── parsing ─────────────────────────────────────────────────────────────────
12
+ /** RFC 4180 CSV with a sniffed delimiter (`,` `;` tab `|`), quoted fields, doubled quotes, embedded newlines. */
13
+ function parseDelimited(text) {
14
+ const src = text.replace(/^\ufeff/, '');
15
+ const first = src.split(/\r?\n/, 1)[0] ?? '';
16
+ const delimiter = [',', ';', '\t', '|'].map((d) => [d, first.split(d).length]).sort((a, b) => b[1] - a[1])[0][0];
17
+ const rows = [];
18
+ let row = [];
19
+ let field = '';
20
+ let quoted = false;
21
+ for (let i = 0; i < src.length; i++) {
22
+ const c = src[i];
23
+ if (quoted) {
24
+ if (c === '"') {
25
+ if (src[i + 1] === '"') {
26
+ field += '"';
27
+ i++;
28
+ }
29
+ else
30
+ quoted = false;
31
+ }
32
+ else
33
+ field += c;
34
+ }
35
+ else if (c === '"' && field === '')
36
+ quoted = true;
37
+ else if (c === delimiter) {
38
+ row.push(field);
39
+ field = '';
40
+ }
41
+ else if (c === '\n' || c === '\r') {
42
+ if (c === '\r' && src[i + 1] === '\n')
43
+ i++;
44
+ row.push(field);
45
+ field = '';
46
+ if (row.some((f) => f !== ''))
47
+ rows.push(row);
48
+ row = [];
49
+ }
50
+ else
51
+ field += c;
52
+ }
53
+ row.push(field);
54
+ if (row.some((f) => f !== ''))
55
+ rows.push(row);
56
+ const header = (rows.shift() ?? []).map((h) => h.trim());
57
+ return rows.map((r) => Object.fromEntries(header.map((h, i) => [h, r[i] ?? ''])));
58
+ }
59
+ /** Rows from CSV/TSV, a JSON array (of objects, or `{ users: [...] }`) or NDJSON. */
60
+ function parseTable(text) {
61
+ const t = text.trim();
62
+ if (t.startsWith('[') || t.startsWith('{')) {
63
+ try {
64
+ const v = JSON.parse(t);
65
+ if (Array.isArray(v))
66
+ return v.filter(record_set_1.isObj);
67
+ if ((0, record_set_1.isObj)(v)) {
68
+ const list = Object.values(v).find(Array.isArray);
69
+ if (list)
70
+ return list.filter(record_set_1.isObj);
71
+ return [v];
72
+ }
73
+ }
74
+ catch {
75
+ // NDJSON: one object per line
76
+ return t.split(/\r?\n/).filter((l) => l.trim()).map((l, i) => {
77
+ try {
78
+ const o = JSON.parse(l);
79
+ if (!(0, record_set_1.isObj)(o))
80
+ throw new Error('not an object');
81
+ return o;
82
+ }
83
+ catch {
84
+ throw new Error(`Line ${i + 1} is not a JSON object.`);
85
+ }
86
+ });
87
+ }
88
+ }
89
+ return parseDelimited(t);
90
+ }
91
+ // ── column recognition ──────────────────────────────────────────────────────
92
+ const NAMES = {
93
+ id: ['id', 'user_id', 'userid', 'uid', 'uuid', 'sub', 'external_id'],
94
+ email: ['email', 'email_address', 'emailaddress', 'mail', 'e_mail'],
95
+ email_verified: ['email_verified', 'emailverified', 'verified', 'is_verified', 'email_confirmed', 'email_confirmed_at', 'confirmed_at', 'email_verified_at'],
96
+ username: ['username', 'user_name', 'login', 'handle', 'screen_name'],
97
+ first_name: ['first_name', 'firstname', 'given_name', 'givenname', 'fname'],
98
+ last_name: ['last_name', 'lastname', 'family_name', 'surname', 'lname'],
99
+ name: ['name', 'full_name', 'fullname', 'display_name', 'displayname'],
100
+ phone: ['phone', 'phone_number', 'phonenumber', 'mobile', 'mobile_phone', 'tel'],
101
+ password: ['password_hash', 'passwordhash', 'encrypted_password', 'hashed_password', 'password_digest', 'pwd_hash', 'password', 'passwd', 'hash', 'pass'],
102
+ salt: ['password_salt', 'salt', 'pwd_salt', 'passwordsalt'],
103
+ created_at: ['created_at', 'createdat', 'created', 'date_joined', 'registered_at', 'signup_date'],
104
+ last_sign_in_at: ['last_sign_in_at', 'last_login', 'last_login_at', 'last_seen', 'lastlogin'],
105
+ roles: ['roles', 'role', 'groups'],
106
+ disabled: ['disabled', 'banned', 'is_banned', 'blocked', 'is_blocked', 'suspended', 'locked'],
107
+ active: ['active', 'is_active', 'enabled'],
108
+ image_url: ['image_url', 'avatar', 'avatar_url', 'picture', 'photo'],
109
+ };
110
+ const truthy = (v) => {
111
+ if (typeof v === 'boolean')
112
+ return v;
113
+ if (typeof v === 'number')
114
+ return v !== 0;
115
+ const s = String(v ?? '').trim().toLowerCase();
116
+ return ['1', 'true', 't', 'yes', 'y'].includes(s) || (s !== '' && !['0', 'false', 'f', 'no', 'n', 'null', 'nil', 'none'].includes(s) && /^\d{4}-|^\d{9,}$/.test(s));
117
+ };
118
+ function columnFinder(row, map = {}) {
119
+ const lower = new Map(Object.keys(row).map((k) => [k.toLowerCase().replace(/[\s-]+/g, '_'), k]));
120
+ return (field) => {
121
+ const wanted = map[field];
122
+ if (wanted)
123
+ return Object.keys(row).find((k) => k === wanted) ?? lower.get(wanted.toLowerCase());
124
+ for (const n of NAMES[field] ?? [])
125
+ if (lower.has(n))
126
+ return lower.get(n);
127
+ return undefined;
128
+ };
129
+ }
130
+ const isoTime = (v) => {
131
+ const s = (0, record_set_1.str)(v);
132
+ if (!s)
133
+ return undefined;
134
+ const n = /^\d{9,13}$/.test(s) ? Number(s) * (s.length >= 12 ? 1 : 1000) : Date.parse(s);
135
+ return Number.isFinite(n) && n > 0 ? new Date(n).toISOString() : undefined;
136
+ };
137
+ function passwordFor(hash, salt, o) {
138
+ const algorithm = o.hashAlgorithm?.toLowerCase();
139
+ if (algorithm === 'plaintext') {
140
+ const d = (0, password_detect_1.detectPasswordHash)(hash, { plaintext: true });
141
+ return d.ok ? { password: d.password } : { reason: d.reason };
142
+ }
143
+ if (!algorithm || algorithm === 'auto') {
144
+ const d = (0, password_detect_1.detectPasswordHash)(hash);
145
+ if (d.ok)
146
+ return { password: d.password, weak: d.weak };
147
+ return { reason: `${d.reason}; name its algorithm with --set hash-algorithm=<id>` };
148
+ }
149
+ if (!(0, password_detect_1.isKnownAlgorithm)(algorithm))
150
+ return { reason: `unknown hash algorithm "${algorithm}"` };
151
+ const params = { ...(o.hashParams ?? {}) };
152
+ if (o.saltPosition)
153
+ params.salt_position = o.saltPosition;
154
+ if (o.hashEncoding)
155
+ params.encoding = o.hashEncoding;
156
+ return { password: (0, record_set_1.compact)({ algorithm, hash, salt, params: Object.keys(params).length ? params : undefined }) };
157
+ }
158
+ /** Parse `a=1,b=two,c=true` into typed params. */
159
+ function parseKeyValues(raw) {
160
+ const out = {};
161
+ for (const part of (raw ?? '').split(',')) {
162
+ const i = part.indexOf('=');
163
+ if (i > 0)
164
+ out[part.slice(0, i).trim()] = part.slice(i + 1).trim();
165
+ }
166
+ return out;
167
+ }
168
+ function typedParams(raw) {
169
+ return Object.fromEntries(Object.entries(parseKeyValues(raw)).map(([k, v]) => [k, v === 'true' ? true : v === 'false' ? false : /^\d+$/.test(v) ? Number(v) : v]));
170
+ }
171
+ // ── mapping ─────────────────────────────────────────────────────────────────
172
+ function mapTable(rows, options = {}) {
173
+ const set = new record_set_1.RecordSet();
174
+ set.manifest = { origin: options.origin ?? 'user table' };
175
+ const ids = new Set();
176
+ let n = 0;
177
+ const unusable = new Map();
178
+ let weak = 0;
179
+ for (const row of rows) {
180
+ n++;
181
+ const col = columnFinder(row, options.map);
182
+ const get = (f) => {
183
+ const c = col(f);
184
+ return c === undefined ? undefined : row[c];
185
+ };
186
+ const emailRaw = (0, record_set_1.str)(get('email'))?.toLowerCase();
187
+ const email = emailRaw?.includes('@') ? emailRaw : undefined;
188
+ const phone = (0, record_set_1.e164)(get('phone'));
189
+ const username = (0, record_set_1.str)(get('username'));
190
+ if (!email && !phone && !username) {
191
+ set.omit('user', 'no email, phone or username', 1);
192
+ continue;
193
+ }
194
+ const id = (0, record_set_1.str)(get('id')) ?? email ?? username ?? String(n);
195
+ if (ids.has(id)) {
196
+ set.omit('user', 'duplicate id', 1);
197
+ continue;
198
+ }
199
+ ids.add(id);
200
+ const verifiedCol = col('email_verified');
201
+ const emails = email ? [{ email, verified: options.trustEmails === true || (verifiedCol !== undefined && truthy(row[verifiedCol])), primary: true }] : [];
202
+ const phones = phone ? [{ phone, verified: false, primary: true }] : [];
203
+ const record = (0, record_set_1.compact)({
204
+ id,
205
+ emails,
206
+ phones,
207
+ username,
208
+ first_name: (0, record_set_1.str)(get('first_name')),
209
+ last_name: (0, record_set_1.str)(get('last_name')),
210
+ name: (0, record_set_1.str)(get('name')),
211
+ image_url: (0, record_set_1.str)(get('image_url')),
212
+ created_at: isoTime(get('created_at')),
213
+ last_sign_in_at: isoTime(get('last_sign_in_at')),
214
+ });
215
+ const roleValue = get('roles');
216
+ const roles = (Array.isArray(roleValue) ? (0, record_set_1.strs)(roleValue) : ((0, record_set_1.str)(roleValue) ?? '').split(/[;,|]/)).map((r) => r.trim()).filter(Boolean).map(translate_kit_1.keyOf);
217
+ for (const r of roles)
218
+ set.add('role', { key: r, name: r, scope: 'app' }, r);
219
+ if (roles.length)
220
+ record.roles = [...new Set(roles)];
221
+ if (truthy(get('disabled')) && col('disabled') !== undefined) {
222
+ record.banned = true;
223
+ record.ban_reason = 'Disabled in the source table';
224
+ }
225
+ else if (col('active') !== undefined && get('active') !== '' && get('active') !== undefined && !truthy(get('active'))) {
226
+ record.banned = true;
227
+ record.ban_reason = 'Inactive in the source table';
228
+ }
229
+ const hash = (0, record_set_1.str)(get('password'));
230
+ if (hash) {
231
+ const r = passwordFor(hash, (0, record_set_1.str)(get('salt')), options);
232
+ if (r.password) {
233
+ record.password = r.password;
234
+ if (r.weak)
235
+ weak++;
236
+ }
237
+ else
238
+ unusable.set(r.reason, (unusable.get(r.reason) ?? 0) + 1);
239
+ }
240
+ set.add('user', record, id);
241
+ }
242
+ for (const [reason, count] of unusable)
243
+ set.warn(`${count} password(s) left out: ${reason}.`);
244
+ if (weak)
245
+ set.warn(`${weak} password(s) use a weak legacy hash; Atlas re-hashes each to Argon2id on that user's first sign-in.`);
246
+ return set;
247
+ }
248
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/migrate/export/table.ts"],"names":[],"mappings":";;AAoCA,wCAiCC;AAGD,gCAyBC;AAkED,wCAOC;AAED,kCAEC;AAID,4BAsEC;AAvPD,uDAAyE;AACzE,6CAAoF;AACpF,mDAAwC;AA8BxC,+EAA+E;AAE/E,iHAAiH;AACjH,SAAgB,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AG,IAAI,CAAC;YACrB,MAAM,CAAC,UAAU,GAAG,8BAA8B,CAAC;QACrD,CAAC;QAED,MAAM,IAAI,GAAG,IAAA,gBAAG,EAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;QAClC,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,IAAA,gBAAG,EAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACvD,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;gBACf,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;gBAC7B,IAAI,CAAC,CAAC,IAAI;oBAAE,IAAI,EAAE,CAAC;YACrB,CAAC;;gBAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACrE,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IACD,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,QAAQ;QAAE,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,0BAA0B,MAAM,GAAG,CAAC,CAAC;IAC9F,IAAI,IAAI;QAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,qGAAqG,CAAC,CAAC;IACjI,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { ReportStatus, TranslationReportEntry, TranslationResult } from '../framework/plugin';
2
+ import type { Json } from '../../serialize';
3
+ /**
4
+ * Shared machinery for the vendor CONFIG translators (`atlas migrate <vendor>
5
+ * config`): build the Atlas config-as-code documents (`instance` with its
6
+ * `auth_config`, `oauth_providers`, `roles`, `permissions`, …) and the report
7
+ * line by line, every line naming the vendor setting it came from.
8
+ *
9
+ * Secrets are never copied: a vendor client secret becomes a `${NAME}`
10
+ * placeholder the operator sets before `atlas config import`.
11
+ */
12
+ export declare class ConfigBuilder {
13
+ readonly auth: Record<string, Json>;
14
+ readonly instance: Record<string, Json>;
15
+ readonly collections: Record<string, Json[]>;
16
+ readonly report: TranslationReportEntry[];
17
+ private readonly env;
18
+ readonly providers: Record<string, string>;
19
+ readonly roles: Record<string, string>;
20
+ /** Set `auth_config.<path>` (dotted). */
21
+ set(path: string, value: Json): void;
22
+ add(status: ReportStatus, area: string, setting: string, note: string, atlas?: string): void;
23
+ /** A `${NAME}` placeholder the import interpolates from the environment. */
24
+ placeholder(name: string, purpose: string): string;
25
+ push(collection: keyof ConfigBuilder['collections'] | string, value: Json): void;
26
+ /** An `oauth_providers` entry for a built-in Atlas provider, credentials as placeholders. */
27
+ socialProvider(o: {
28
+ atlasKey: string;
29
+ vendorName: string;
30
+ area: string;
31
+ setting: string;
32
+ clientId?: string;
33
+ scopes?: string[];
34
+ enabled?: boolean;
35
+ allowSignUp?: boolean;
36
+ }): void;
37
+ result(origin: string, extra?: Pick<TranslationResult, 'bridge' | 'lazy'>): TranslationResult;
38
+ }
39
+ /** Social provider names vendors use → Atlas built-in provider keys. */
40
+ export declare const SOCIAL_KEYS: Record<string, string>;
41
+ /** The Atlas key for a vendor's provider name (`oauth_google`, `oauth2:google`, `GOOGLE`, `google-oauth2`), or null. */
42
+ export declare function socialKey(raw: string): string | null;
43
+ /** `Billing Admin` → `billing_admin`. */
44
+ export declare function keyOf(name: string): string;
45
+ /** Atlas's session window: 5 minutes to 90 days. */
46
+ export declare function clampSessionMs(ms: number): number;
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SOCIAL_KEYS = exports.ConfigBuilder = void 0;
4
+ exports.socialKey = socialKey;
5
+ exports.keyOf = keyOf;
6
+ exports.clampSessionMs = clampSessionMs;
7
+ /**
8
+ * Shared machinery for the vendor CONFIG translators (`atlas migrate <vendor>
9
+ * config`): build the Atlas config-as-code documents (`instance` with its
10
+ * `auth_config`, `oauth_providers`, `roles`, `permissions`, …) and the report
11
+ * line by line, every line naming the vendor setting it came from.
12
+ *
13
+ * Secrets are never copied: a vendor client secret becomes a `${NAME}`
14
+ * placeholder the operator sets before `atlas config import`.
15
+ */
16
+ class ConfigBuilder {
17
+ auth = {};
18
+ instance = {};
19
+ collections = {
20
+ oauth_providers: [],
21
+ custom_oauth_providers: [],
22
+ permissions: [],
23
+ roles: [],
24
+ oauth_clients: [],
25
+ resource_servers: [],
26
+ redirect_urls: [],
27
+ jwt_templates: [],
28
+ };
29
+ report = [];
30
+ env = new Map();
31
+ providers = {};
32
+ roles = {};
33
+ /** Set `auth_config.<path>` (dotted). */
34
+ set(path, value) {
35
+ const keys = path.split('.');
36
+ let node = this.auth;
37
+ for (const k of keys.slice(0, -1)) {
38
+ const next = node[k];
39
+ if (!next || typeof next !== 'object' || Array.isArray(next))
40
+ node[k] = {};
41
+ node = node[k];
42
+ }
43
+ node[keys[keys.length - 1]] = value;
44
+ }
45
+ add(status, area, setting, note, atlas) {
46
+ this.report.push({ status, area, setting, note, ...(atlas ? { atlas } : {}) });
47
+ }
48
+ /** A `${NAME}` placeholder the import interpolates from the environment. */
49
+ placeholder(name, purpose) {
50
+ this.env.set(name, purpose);
51
+ return `\${${name}}`;
52
+ }
53
+ push(collection, value) {
54
+ (this.collections[collection] ??= []).push(value);
55
+ }
56
+ /** An `oauth_providers` entry for a built-in Atlas provider, credentials as placeholders. */
57
+ socialProvider(o) {
58
+ const upper = o.atlasKey.toUpperCase().replace(/[^A-Z0-9]+/g, '_');
59
+ if (this.collections.oauth_providers.some((p) => p.provider === o.atlasKey))
60
+ return;
61
+ const entry = {
62
+ provider: o.atlasKey,
63
+ enabled: o.enabled !== false,
64
+ allow_sign_in: true,
65
+ allow_sign_up: o.allowSignUp !== false,
66
+ client_id: o.clientId ?? this.placeholder(`${upper}_CLIENT_ID`, `${o.vendorName} client id`),
67
+ client_secret: this.placeholder(`${upper}_CLIENT_SECRET`, `${o.vendorName} client secret`),
68
+ };
69
+ if (o.scopes?.length)
70
+ entry.scopes = o.scopes;
71
+ this.push('oauth_providers', entry);
72
+ this.providers[o.vendorName] = o.atlasKey;
73
+ this.add(o.clientId ? 'differs' : 'manual', o.area, o.setting, `${o.vendorName} sign-in becomes Atlas's built-in "${o.atlasKey}" provider. Keep the same OAuth app so imported accounts relink by provider user id; add Atlas's callback URL to it${o.clientId ? '' : ', and set the client id'} and set ${upper}_CLIENT_SECRET (secrets are never copied).`, `oauth_providers ${o.atlasKey}`);
74
+ }
75
+ result(origin, extra = {}) {
76
+ const documents = {};
77
+ const instance = { ...this.instance };
78
+ if (Object.keys(this.auth).length)
79
+ instance.auth_config = this.auth;
80
+ if (Object.keys(instance).length)
81
+ documents.instance = instance;
82
+ for (const [type, list] of Object.entries(this.collections))
83
+ if (list.length)
84
+ documents[type] = list;
85
+ return {
86
+ origin,
87
+ documents,
88
+ report: this.report,
89
+ env: [...this.env.entries()].map(([name, purpose]) => ({ name, for: purpose })),
90
+ mappings: { providers: this.providers, roles: this.roles },
91
+ ...extra,
92
+ };
93
+ }
94
+ }
95
+ exports.ConfigBuilder = ConfigBuilder;
96
+ /** Social provider names vendors use → Atlas built-in provider keys. */
97
+ exports.SOCIAL_KEYS = {
98
+ google: 'google',
99
+ 'google-oauth2': 'google',
100
+ github: 'github',
101
+ gitlab: 'gitlab',
102
+ facebook: 'facebook',
103
+ apple: 'apple',
104
+ microsoft: 'microsoft',
105
+ windowslive: 'microsoft',
106
+ 'microsoft-account': 'microsoft',
107
+ azure_ad: 'microsoft',
108
+ linkedin: 'linkedin',
109
+ linkedin_oidc: 'linkedin',
110
+ twitter: 'x',
111
+ x: 'x',
112
+ discord: 'discord',
113
+ slack: 'slack',
114
+ spotify: 'spotify',
115
+ twitch: 'twitch',
116
+ bitbucket: 'bitbucket',
117
+ dropbox: 'dropbox',
118
+ notion: 'notion',
119
+ salesforce: 'salesforce',
120
+ paypal: 'paypal',
121
+ amazon: 'amazon',
122
+ tiktok: 'tiktok',
123
+ line: 'line',
124
+ zoom: 'zoom',
125
+ figma: 'figma',
126
+ hubspot: 'hubspot',
127
+ atlassian: 'atlassian',
128
+ coinbase: 'coinbase',
129
+ box: 'box',
130
+ yahoo: 'yahoo',
131
+ roblox: 'roblox',
132
+ reddit: 'reddit',
133
+ };
134
+ /** The Atlas key for a vendor's provider name (`oauth_google`, `oauth2:google`, `GOOGLE`, `google-oauth2`), or null. */
135
+ function socialKey(raw) {
136
+ const k = raw.toLowerCase().replace(/^oauth2?[_:]/, '').replace(/^oauth_/, '');
137
+ return exports.SOCIAL_KEYS[k] ?? null;
138
+ }
139
+ /** `Billing Admin` → `billing_admin`. */
140
+ function keyOf(name) {
141
+ return name.trim().toLowerCase().replace(/[^a-z0-9:]+/g, '_').replace(/^_+|_+$/g, '') || 'role';
142
+ }
143
+ const MIN = 60_000;
144
+ /** Atlas's session window: 5 minutes to 90 days. */
145
+ function clampSessionMs(ms) {
146
+ return Math.min(Math.max(ms, 5 * MIN), 90 * 24 * 60 * MIN);
147
+ }
148
+ //# sourceMappingURL=translate-kit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate-kit.js","sourceRoot":"","sources":["../../../src/migrate/export/translate-kit.ts"],"names":[],"mappings":";;;AAkJA,8BAGC;AAGD,sBAEC;AAID,wCAEC;AA7JD;;;;;;;;GAQG;AACH,MAAa,aAAa;IACf,IAAI,GAAyB,EAAE,CAAC;IAChC,QAAQ,GAAyB,EAAE,CAAC;IACpC,WAAW,GAA2B;QAC7C,eAAe,EAAE,EAAE;QACnB,sBAAsB,EAAE,EAAE;QAC1B,WAAW,EAAE,EAAE;QACf,KAAK,EAAE,EAAE;QACT,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,EAAE;QACpB,aAAa,EAAE,EAAE;QACjB,aAAa,EAAE,EAAE;KAClB,CAAC;IACO,MAAM,GAA6B,EA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AI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC;AAClG,CAAC;AAED,MAAM,GAAG,GAAG,MAAM,CAAC;AACnB,oDAAoD;AACpD,SAAgB,cAAc,CAAC,EAAU;IACvC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { TranslationResult } from '../framework/plugin';
2
+ import { type VendorHttp } from './vendor-http';
3
+ /**
4
+ * `atlas migrate userfront config` — what Userfront's admin API exposes about
5
+ * a tenant's configuration: its roles. Sign-in methods, forms, password and
6
+ * MFA rules, session lifetimes, domains and branding live only in the
7
+ * Userfront dashboard: the report lists each as manual with where to look.
8
+ * Passwords move by the `userfront` lazy-migration preset.
9
+ */
10
+ export interface UserfrontConfigSnapshot {
11
+ tenantId: string;
12
+ roles: string[];
13
+ }
14
+ export declare function fetchUserfrontConfig(http: VendorHttp, tenantId: string): Promise<UserfrontConfigSnapshot>;
15
+ export declare function translateUserfrontConfig(snap: UserfrontConfigSnapshot): TranslationResult;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchUserfrontConfig = fetchUserfrontConfig;
4
+ exports.translateUserfrontConfig = translateUserfrontConfig;
5
+ const record_set_1 = require("./record-set");
6
+ const translate_kit_1 = require("./translate-kit");
7
+ const userfront_1 = require("./userfront");
8
+ const vendor_http_1 = require("./vendor-http");
9
+ async function fetchUserfrontConfig(http, tenantId) {
10
+ const tid = (0, userfront_1.checkTenantId)(tenantId);
11
+ let body = null;
12
+ try {
13
+ body = (await http.get(`/tenants/${tid}/roles`)).body;
14
+ }
15
+ catch (err) {
16
+ if (!(err instanceof vendor_http_1.VendorApiError) || ![400, 403, 404].includes(err.status))
17
+ throw err;
18
+ }
19
+ return { tenantId: tid, roles: (0, record_set_1.objs)(body?.roles).map((r) => (0, record_set_1.str)(r.name)).filter((n) => !!n) };
20
+ }
21
+ function translateUserfrontConfig(snap) {
22
+ const b = new translate_kit_1.ConfigBuilder();
23
+ const seen = new Set();
24
+ for (const name of snap.roles) {
25
+ const key = (0, translate_kit_1.keyOf)(name);
26
+ if (seen.has(key))
27
+ continue;
28
+ seen.add(key);
29
+ b.roles[name] = key;
30
+ b.push('roles', { key, name, description: '', permissions: [] });
31
+ }
32
+ if (seen.size)
33
+ b.add('mapped', 'authorization', 'roles', `${seen.size} role(s) (tenant roles become app roles; members keep theirs with the data export).`, 'roles');
34
+ b.add('mapped', 'authentication', 'password sign-in', 'Userfront never returns password hashes: the userfront lazy-migration preset checks each password against Userfront on the first Atlas sign-in.', 'auth_config.strategies.password');
35
+ for (const [setting, where] of [
36
+ ['sign-in methods (password, email link, code, social, SSO)', 'Dashboard → Authentication'],
37
+ ['multi-factor authentication', 'Dashboard → Authentication → Multi-factor'],
38
+ ['session and token lifetimes', 'Dashboard → Settings → Sessions'],
39
+ ['social provider credentials', 'Dashboard → Authentication → Social (re-enter each client id and secret as an Atlas oauth provider)'],
40
+ ['domains and redirect URLs', 'Dashboard → Settings → Domains'],
41
+ ['forms and branding', 'Dashboard → Toolkit / Branding (use the Atlas components and theme)'],
42
+ ['custom emails', 'Dashboard → Emails (use the Atlas email templates)'],
43
+ ]) {
44
+ b.add('manual', 'settings not in the API', setting, `Userfront does not expose this by API; copy it from the dashboard (${where}).`);
45
+ }
46
+ b.add('differs', 'sessions', 'access and ID tokens', 'Userfront tokens carry no issuer claim, so the zero-logout bridge cannot verify them: users sign in once more after the switch.', 'migration bridge');
47
+ return b.result(`Userfront tenant ${snap.tenantId}`, { lazy: { preset: 'userfront', config: { tenant_id: snap.tenantId } } });
48
+ }
49
+ //# sourceMappingURL=userfront-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userfront-config.js","sourceRoot":"","sources":["../../../src/migrate/export/userfront-config.ts"],"names":[],"mappings":";;AAmBA,oDASC;AAED,4DAyBC;AArDD,6CAAmD;AACnD,mDAAuD;AACvD,2CAA4C;AAC5C,+CAAgE;AAczD,KAAK,UAAU,oBAAoB,CAAC,IAAgB,EAAE,QAAgB;IAC3E,MAAM,GAAG,GAAG,IAAA,yBAAa,EAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,IAAI,GAAe,IAAI,CAAC;IAC5B,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,GAAG,YAAY,4BAAc,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,MAAM,GAAG,CAAC;IAC3F,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,IAAA,iBAAI,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAG,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7G,CAAC;AAED,SAAgB,wBAAwB,CAAC,IAA6B;IACpE,MAAM,CAAC,GAAG,IAAI,6BAAa,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,IAAA,qBAAK,EAAC,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AAQ,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;AAChI,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { UserRecord } from '@atlasauth/migrate';
2
+ import { RecordSet, type Obj } from './record-set';
3
+ import { VendorHttp } from './vendor-http';
4
+ /**
5
+ * `atlas migrate export userfront` — a Userfront tenant onto the canonical
6
+ * bundle models, read with an admin API key (`uf_live_admin_…`) on this
7
+ * machine.
8
+ *
9
+ * - users (email, username, phone, names, image, custom `data`, confirmed
10
+ * flags, locked) with their roles on the tenant;
11
+ * - sub-tenants → organizations, with each member's role in them;
12
+ * - roles (the tenant's role list plus any a user holds).
13
+ *
14
+ * Userfront never returns password hashes, so passwords move by lazy
15
+ * migration: the `userfront` preset checks each password against Userfront's
16
+ * own sign-in on a member's first Atlas sign-in. Not exportable: second
17
+ * factors (re-enrol), passkeys (register again), social account ids (relink
18
+ * by verified email), pending invitations (create only, no listing).
19
+ */
20
+ export interface UserfrontExportOptions {
21
+ tenantId: string;
22
+ /** An admin key: `uf_live_admin_…` for the live tenant, `uf_test_admin_…` for test mode. */
23
+ apiKey: string;
24
+ apiBase?: string;
25
+ fetchImpl?: typeof fetch;
26
+ sleep?: (ms: number) => Promise<void>;
27
+ onProgress?: (message: string) => void;
28
+ }
29
+ export declare function checkTenantId(tenantId: string): string;
30
+ export declare function userfrontHttp(o: {
31
+ apiKey: string;
32
+ apiBase?: string;
33
+ fetchImpl?: typeof fetch;
34
+ sleep?: (ms: number) => Promise<void>;
35
+ }): VendorHttp;
36
+ export declare function exportUserfront(opts: UserfrontExportOptions): Promise<RecordSet>;
37
+ /** One Userfront user (users/find result) → a user record. */
38
+ export declare function mapUserfrontUser(u: Obj, tenantId: string): UserRecord | null;