@atlasauth/cli 0.24.0 → 0.25.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 (530) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +4 -4
  3. package/dist/args.d.ts +0 -601
  4. package/dist/args.js +0 -289
  5. package/dist/args.js.map +0 -1
  6. package/dist/cli.d.ts +0 -2
  7. package/dist/cli.js +0 -19
  8. package/dist/cli.js.map +0 -1
  9. package/dist/commands/actions-gallery.d.ts +0 -8
  10. package/dist/commands/actions-gallery.js +0 -197
  11. package/dist/commands/actions-gallery.js.map +0 -1
  12. package/dist/commands/actions.d.ts +0 -13
  13. package/dist/commands/actions.js +0 -135
  14. package/dist/commands/actions.js.map +0 -1
  15. package/dist/commands/admin.d.ts +0 -49
  16. package/dist/commands/admin.js +0 -353
  17. package/dist/commands/admin.js.map +0 -1
  18. package/dist/commands/api-keys.d.ts +0 -4
  19. package/dist/commands/api-keys.js +0 -96
  20. package/dist/commands/api-keys.js.map +0 -1
  21. package/dist/commands/auth.d.ts +0 -25
  22. package/dist/commands/auth.js +0 -102
  23. package/dist/commands/auth.js.map +0 -1
  24. package/dist/commands/config.d.ts +0 -104
  25. package/dist/commands/config.js +0 -1506
  26. package/dist/commands/config.js.map +0 -1
  27. package/dist/commands/csp.d.ts +0 -32
  28. package/dist/commands/csp.js +0 -180
  29. package/dist/commands/csp.js.map +0 -1
  30. package/dist/commands/dev.d.ts +0 -8
  31. package/dist/commands/dev.js +0 -84
  32. package/dist/commands/dev.js.map +0 -1
  33. package/dist/commands/fga.d.ts +0 -10
  34. package/dist/commands/fga.js +0 -146
  35. package/dist/commands/fga.js.map +0 -1
  36. package/dist/commands/golive.d.ts +0 -40
  37. package/dist/commands/golive.js +0 -285
  38. package/dist/commands/golive.js.map +0 -1
  39. package/dist/commands/id-accounts.d.ts +0 -13
  40. package/dist/commands/id-accounts.js +0 -195
  41. package/dist/commands/id-accounts.js.map +0 -1
  42. package/dist/commands/import-better-auth.d.ts +0 -3
  43. package/dist/commands/import-better-auth.js +0 -164
  44. package/dist/commands/import-better-auth.js.map +0 -1
  45. package/dist/commands/import.d.ts +0 -3
  46. package/dist/commands/import.js +0 -123
  47. package/dist/commands/import.js.map +0 -1
  48. package/dist/commands/info.d.ts +0 -75
  49. package/dist/commands/info.js +0 -362
  50. package/dist/commands/info.js.map +0 -1
  51. package/dist/commands/init.d.ts +0 -3
  52. package/dist/commands/init.js +0 -438
  53. package/dist/commands/init.js.map +0 -1
  54. package/dist/commands/integrations.d.ts +0 -8
  55. package/dist/commands/integrations.js +0 -112
  56. package/dist/commands/integrations.js.map +0 -1
  57. package/dist/commands/listen.d.ts +0 -17
  58. package/dist/commands/listen.js +0 -223
  59. package/dist/commands/listen.js.map +0 -1
  60. package/dist/commands/mcp.d.ts +0 -38
  61. package/dist/commands/mcp.js +0 -111
  62. package/dist/commands/mcp.js.map +0 -1
  63. package/dist/commands/migrate.d.ts +0 -16
  64. package/dist/commands/migrate.js +0 -114
  65. package/dist/commands/migrate.js.map +0 -1
  66. package/dist/commands/move-origin.d.ts +0 -11
  67. package/dist/commands/move-origin.js +0 -95
  68. package/dist/commands/move-origin.js.map +0 -1
  69. package/dist/commands/operator.d.ts +0 -18
  70. package/dist/commands/operator.js +0 -238
  71. package/dist/commands/operator.js.map +0 -1
  72. package/dist/commands/orgs.d.ts +0 -4
  73. package/dist/commands/orgs.js +0 -72
  74. package/dist/commands/orgs.js.map +0 -1
  75. package/dist/commands/pages.d.ts +0 -14
  76. package/dist/commands/pages.js +0 -113
  77. package/dist/commands/pages.js.map +0 -1
  78. package/dist/commands/partner-platforms.d.ts +0 -10
  79. package/dist/commands/partner-platforms.js +0 -157
  80. package/dist/commands/partner-platforms.js.map +0 -1
  81. package/dist/commands/project-commands.d.ts +0 -38
  82. package/dist/commands/project-commands.js +0 -361
  83. package/dist/commands/project-commands.js.map +0 -1
  84. package/dist/commands/referrals.d.ts +0 -69
  85. package/dist/commands/referrals.js +0 -1056
  86. package/dist/commands/referrals.js.map +0 -1
  87. package/dist/commands/resources.d.ts +0 -44
  88. package/dist/commands/resources.js +0 -234
  89. package/dist/commands/resources.js.map +0 -1
  90. package/dist/commands/sessions.d.ts +0 -4
  91. package/dist/commands/sessions.js +0 -28
  92. package/dist/commands/sessions.js.map +0 -1
  93. package/dist/commands/shared.d.ts +0 -38
  94. package/dist/commands/shared.js +0 -69
  95. package/dist/commands/shared.js.map +0 -1
  96. package/dist/commands/status.d.ts +0 -3
  97. package/dist/commands/status.js +0 -77
  98. package/dist/commands/status.js.map +0 -1
  99. package/dist/commands/users.d.ts +0 -4
  100. package/dist/commands/users.js +0 -100
  101. package/dist/commands/users.js.map +0 -1
  102. package/dist/commands/webhooks.d.ts +0 -34
  103. package/dist/commands/webhooks.js +0 -301
  104. package/dist/commands/webhooks.js.map +0 -1
  105. package/dist/config-http.d.ts +0 -29
  106. package/dist/config-http.js +0 -64
  107. package/dist/config-http.js.map +0 -1
  108. package/dist/config.d.ts +0 -64
  109. package/dist/config.js +0 -69
  110. package/dist/config.js.map +0 -1
  111. package/dist/context.d.ts +0 -72
  112. package/dist/context.js +0 -27
  113. package/dist/context.js.map +0 -1
  114. package/dist/define-config.d.ts +0 -9
  115. package/dist/define-config.js +0 -8
  116. package/dist/define-config.js.map +0 -1
  117. package/dist/errors.d.ts +0 -15
  118. package/dist/errors.js +0 -25
  119. package/dist/errors.js.map +0 -1
  120. package/dist/help.d.ts +0 -8
  121. package/dist/help.js +0 -868
  122. package/dist/help.js.map +0 -1
  123. package/dist/import/csv.d.ts +0 -6
  124. package/dist/import/csv.js +0 -63
  125. package/dist/import/csv.js.map +0 -1
  126. package/dist/import/vendors.d.ts +0 -57
  127. package/dist/import/vendors.js +0 -568
  128. package/dist/import/vendors.js.map +0 -1
  129. package/dist/index.d.ts +0 -33
  130. package/dist/index.js +0 -81
  131. package/dist/index.js.map +0 -1
  132. package/dist/io.d.ts +0 -21
  133. package/dist/io.js +0 -28
  134. package/dist/io.js.map +0 -1
  135. package/dist/migrate/appwrite/plugin.d.ts +0 -2
  136. package/dist/migrate/appwrite/plugin.js +0 -103
  137. package/dist/migrate/appwrite/plugin.js.map +0 -1
  138. package/dist/migrate/auth0/plugin.d.ts +0 -2
  139. package/dist/migrate/auth0/plugin.js +0 -126
  140. package/dist/migrate/auth0/plugin.js.map +0 -1
  141. package/dist/migrate/authentik/plugin.d.ts +0 -2
  142. package/dist/migrate/authentik/plugin.js +0 -135
  143. package/dist/migrate/authentik/plugin.js.map +0 -1
  144. package/dist/migrate/azure-ad-b2c/plugin.d.ts +0 -8
  145. package/dist/migrate/azure-ad-b2c/plugin.js +0 -165
  146. package/dist/migrate/azure-ad-b2c/plugin.js.map +0 -1
  147. package/dist/migrate/better-auth/integration.d.ts +0 -59
  148. package/dist/migrate/better-auth/integration.js +0 -81
  149. package/dist/migrate/better-auth/integration.js.map +0 -1
  150. package/dist/migrate/better-auth/orchestrator.d.ts +0 -43
  151. package/dist/migrate/better-auth/orchestrator.js +0 -525
  152. package/dist/migrate/better-auth/orchestrator.js.map +0 -1
  153. package/dist/migrate/better-auth/output.d.ts +0 -20
  154. package/dist/migrate/better-auth/output.js +0 -146
  155. package/dist/migrate/better-auth/output.js.map +0 -1
  156. package/dist/migrate/better-auth/translate.d.ts +0 -77
  157. package/dist/migrate/better-auth/translate.js +0 -1989
  158. package/dist/migrate/better-auth/translate.js.map +0 -1
  159. package/dist/migrate/clerk/plugin.d.ts +0 -2
  160. package/dist/migrate/clerk/plugin.js +0 -76
  161. package/dist/migrate/clerk/plugin.js.map +0 -1
  162. package/dist/migrate/cognito/plugin.d.ts +0 -5
  163. package/dist/migrate/cognito/plugin.js +0 -170
  164. package/dist/migrate/cognito/plugin.js.map +0 -1
  165. package/dist/migrate/corbado/plugin.d.ts +0 -2
  166. package/dist/migrate/corbado/plugin.js +0 -63
  167. package/dist/migrate/corbado/plugin.js.map +0 -1
  168. package/dist/migrate/descope/plugin.d.ts +0 -2
  169. package/dist/migrate/descope/plugin.js +0 -83
  170. package/dist/migrate/descope/plugin.js.map +0 -1
  171. package/dist/migrate/entra-external-id/plugin.d.ts +0 -8
  172. package/dist/migrate/entra-external-id/plugin.js +0 -12
  173. package/dist/migrate/entra-external-id/plugin.js.map +0 -1
  174. package/dist/migrate/export/appwrite-config.d.ts +0 -28
  175. package/dist/migrate/export/appwrite-config.js +0 -170
  176. package/dist/migrate/export/appwrite-config.js.map +0 -1
  177. package/dist/migrate/export/appwrite.d.ts +0 -51
  178. package/dist/migrate/export/appwrite.js +0 -288
  179. package/dist/migrate/export/appwrite.js.map +0 -1
  180. package/dist/migrate/export/auth0-config.d.ts +0 -29
  181. package/dist/migrate/export/auth0-config.js +0 -249
  182. package/dist/migrate/export/auth0-config.js.map +0 -1
  183. package/dist/migrate/export/auth0.d.ts +0 -62
  184. package/dist/migrate/export/auth0.js +0 -575
  185. package/dist/migrate/export/auth0.js.map +0 -1
  186. package/dist/migrate/export/authentik-config.d.ts +0 -45
  187. package/dist/migrate/export/authentik-config.js +0 -357
  188. package/dist/migrate/export/authentik-config.js.map +0 -1
  189. package/dist/migrate/export/authentik.d.ts +0 -110
  190. package/dist/migrate/export/authentik.js +0 -838
  191. package/dist/migrate/export/authentik.js.map +0 -1
  192. package/dist/migrate/export/azure-config.d.ts +0 -58
  193. package/dist/migrate/export/azure-config.js +0 -344
  194. package/dist/migrate/export/azure-config.js.map +0 -1
  195. package/dist/migrate/export/azure.d.ts +0 -85
  196. package/dist/migrate/export/azure.js +0 -373
  197. package/dist/migrate/export/azure.js.map +0 -1
  198. package/dist/migrate/export/clerk-config.d.ts +0 -26
  199. package/dist/migrate/export/clerk-config.js +0 -227
  200. package/dist/migrate/export/clerk-config.js.map +0 -1
  201. package/dist/migrate/export/clerk.d.ts +0 -46
  202. package/dist/migrate/export/clerk.js +0 -486
  203. package/dist/migrate/export/clerk.js.map +0 -1
  204. package/dist/migrate/export/cognito-config.d.ts +0 -25
  205. package/dist/migrate/export/cognito-config.js +0 -273
  206. package/dist/migrate/export/cognito-config.js.map +0 -1
  207. package/dist/migrate/export/cognito.d.ts +0 -103
  208. package/dist/migrate/export/cognito.js +0 -441
  209. package/dist/migrate/export/cognito.js.map +0 -1
  210. package/dist/migrate/export/corbado-config.d.ts +0 -20
  211. package/dist/migrate/export/corbado-config.js +0 -63
  212. package/dist/migrate/export/corbado-config.js.map +0 -1
  213. package/dist/migrate/export/corbado.d.ts +0 -37
  214. package/dist/migrate/export/corbado.js +0 -132
  215. package/dist/migrate/export/corbado.js.map +0 -1
  216. package/dist/migrate/export/descope.d.ts +0 -35
  217. package/dist/migrate/export/descope.js +0 -208
  218. package/dist/migrate/export/descope.js.map +0 -1
  219. package/dist/migrate/export/fake-vendor.test-helper.d.ts +0 -27
  220. package/dist/migrate/export/fake-vendor.test-helper.js +0 -41
  221. package/dist/migrate/export/fake-vendor.test-helper.js.map +0 -1
  222. package/dist/migrate/export/firebase-config.d.ts +0 -24
  223. package/dist/migrate/export/firebase-config.js +0 -215
  224. package/dist/migrate/export/firebase-config.js.map +0 -1
  225. package/dist/migrate/export/firebase.d.ts +0 -102
  226. package/dist/migrate/export/firebase.js +0 -464
  227. package/dist/migrate/export/firebase.js.map +0 -1
  228. package/dist/migrate/export/frameworks/app-users.d.ts +0 -42
  229. package/dist/migrate/export/frameworks/app-users.js +0 -161
  230. package/dist/migrate/export/frameworks/app-users.js.map +0 -1
  231. package/dist/migrate/export/frameworks/authjs.d.ts +0 -41
  232. package/dist/migrate/export/frameworks/authjs.js +0 -146
  233. package/dist/migrate/export/frameworks/authjs.js.map +0 -1
  234. package/dist/migrate/export/frameworks/devise.d.ts +0 -39
  235. package/dist/migrate/export/frameworks/devise.js +0 -218
  236. package/dist/migrate/export/frameworks/devise.js.map +0 -1
  237. package/dist/migrate/export/frameworks/django.d.ts +0 -45
  238. package/dist/migrate/export/frameworks/django.js +0 -315
  239. package/dist/migrate/export/frameworks/django.js.map +0 -1
  240. package/dist/migrate/export/frameworks/lucia.d.ts +0 -42
  241. package/dist/migrate/export/frameworks/lucia.js +0 -263
  242. package/dist/migrate/export/frameworks/lucia.js.map +0 -1
  243. package/dist/migrate/export/frameworks/tables.d.ts +0 -90
  244. package/dist/migrate/export/frameworks/tables.js +0 -325
  245. package/dist/migrate/export/frameworks/tables.js.map +0 -1
  246. package/dist/migrate/export/frameworks/webauthn.d.ts +0 -25
  247. package/dist/migrate/export/frameworks/webauthn.js +0 -130
  248. package/dist/migrate/export/frameworks/webauthn.js.map +0 -1
  249. package/dist/migrate/export/frontegg-config.d.ts +0 -29
  250. package/dist/migrate/export/frontegg-config.js +0 -238
  251. package/dist/migrate/export/frontegg-config.js.map +0 -1
  252. package/dist/migrate/export/frontegg.d.ts +0 -67
  253. package/dist/migrate/export/frontegg.js +0 -410
  254. package/dist/migrate/export/frontegg.js.map +0 -1
  255. package/dist/migrate/export/fusionauth-config.d.ts +0 -26
  256. package/dist/migrate/export/fusionauth-config.js +0 -226
  257. package/dist/migrate/export/fusionauth-config.js.map +0 -1
  258. package/dist/migrate/export/fusionauth.d.ts +0 -99
  259. package/dist/migrate/export/fusionauth.js +0 -642
  260. package/dist/migrate/export/fusionauth.js.map +0 -1
  261. package/dist/migrate/export/hanko-config.d.ts +0 -27
  262. package/dist/migrate/export/hanko-config.js +0 -265
  263. package/dist/migrate/export/hanko-config.js.map +0 -1
  264. package/dist/migrate/export/hanko.d.ts +0 -52
  265. package/dist/migrate/export/hanko.js +0 -605
  266. package/dist/migrate/export/hanko.js.map +0 -1
  267. package/dist/migrate/export/keycloak-config.d.ts +0 -19
  268. package/dist/migrate/export/keycloak-config.js +0 -219
  269. package/dist/migrate/export/keycloak-config.js.map +0 -1
  270. package/dist/migrate/export/keycloak.d.ts +0 -155
  271. package/dist/migrate/export/keycloak.js +0 -878
  272. package/dist/migrate/export/keycloak.js.map +0 -1
  273. package/dist/migrate/export/kinde-descope-config.d.ts +0 -38
  274. package/dist/migrate/export/kinde-descope-config.js +0 -172
  275. package/dist/migrate/export/kinde-descope-config.js.map +0 -1
  276. package/dist/migrate/export/kinde.d.ts +0 -57
  277. package/dist/migrate/export/kinde.js +0 -333
  278. package/dist/migrate/export/kinde.js.map +0 -1
  279. package/dist/migrate/export/ldap.d.ts +0 -53
  280. package/dist/migrate/export/ldap.js +0 -277
  281. package/dist/migrate/export/ldap.js.map +0 -1
  282. package/dist/migrate/export/logto-config.d.ts +0 -27
  283. package/dist/migrate/export/logto-config.js +0 -264
  284. package/dist/migrate/export/logto-config.js.map +0 -1
  285. package/dist/migrate/export/logto.d.ts +0 -150
  286. package/dist/migrate/export/logto.js +0 -809
  287. package/dist/migrate/export/logto.js.map +0 -1
  288. package/dist/migrate/export/magic-config.d.ts +0 -14
  289. package/dist/migrate/export/magic-config.js +0 -28
  290. package/dist/migrate/export/magic-config.js.map +0 -1
  291. package/dist/migrate/export/magic.d.ts +0 -31
  292. package/dist/migrate/export/magic.js +0 -93
  293. package/dist/migrate/export/magic.js.map +0 -1
  294. package/dist/migrate/export/mini-yaml.d.ts +0 -19
  295. package/dist/migrate/export/mini-yaml.js +0 -581
  296. package/dist/migrate/export/mini-yaml.js.map +0 -1
  297. package/dist/migrate/export/nhost-config.d.ts +0 -26
  298. package/dist/migrate/export/nhost-config.js +0 -360
  299. package/dist/migrate/export/nhost-config.js.map +0 -1
  300. package/dist/migrate/export/nhost.d.ts +0 -64
  301. package/dist/migrate/export/nhost.js +0 -304
  302. package/dist/migrate/export/nhost.js.map +0 -1
  303. package/dist/migrate/export/okta-config.d.ts +0 -30
  304. package/dist/migrate/export/okta-config.js +0 -205
  305. package/dist/migrate/export/okta-config.js.map +0 -1
  306. package/dist/migrate/export/okta.d.ts +0 -43
  307. package/dist/migrate/export/okta.js +0 -337
  308. package/dist/migrate/export/okta.js.map +0 -1
  309. package/dist/migrate/export/onelogin.d.ts +0 -22
  310. package/dist/migrate/export/onelogin.js +0 -123
  311. package/dist/migrate/export/onelogin.js.map +0 -1
  312. package/dist/migrate/export/ory-config.d.ts +0 -58
  313. package/dist/migrate/export/ory-config.js +0 -451
  314. package/dist/migrate/export/ory-config.js.map +0 -1
  315. package/dist/migrate/export/ory.d.ts +0 -81
  316. package/dist/migrate/export/ory.js +0 -555
  317. package/dist/migrate/export/ory.js.map +0 -1
  318. package/dist/migrate/export/password-detect.d.ts +0 -29
  319. package/dist/migrate/export/password-detect.js +0 -81
  320. package/dist/migrate/export/password-detect.js.map +0 -1
  321. package/dist/migrate/export/pingone.d.ts +0 -36
  322. package/dist/migrate/export/pingone.js +0 -218
  323. package/dist/migrate/export/pingone.js.map +0 -1
  324. package/dist/migrate/export/plugin-kit.d.ts +0 -25
  325. package/dist/migrate/export/plugin-kit.js +0 -82
  326. package/dist/migrate/export/plugin-kit.js.map +0 -1
  327. package/dist/migrate/export/pocketbase-config.d.ts +0 -28
  328. package/dist/migrate/export/pocketbase-config.js +0 -180
  329. package/dist/migrate/export/pocketbase-config.js.map +0 -1
  330. package/dist/migrate/export/pocketbase.d.ts +0 -52
  331. package/dist/migrate/export/pocketbase.js +0 -243
  332. package/dist/migrate/export/pocketbase.js.map +0 -1
  333. package/dist/migrate/export/project-files.d.ts +0 -15
  334. package/dist/migrate/export/project-files.js +0 -43
  335. package/dist/migrate/export/project-files.js.map +0 -1
  336. package/dist/migrate/export/propelauth-config.d.ts +0 -18
  337. package/dist/migrate/export/propelauth-config.js +0 -58
  338. package/dist/migrate/export/propelauth-config.js.map +0 -1
  339. package/dist/migrate/export/propelauth-harness.test-helper.d.ts +0 -62
  340. package/dist/migrate/export/propelauth-harness.test-helper.js +0 -109
  341. package/dist/migrate/export/propelauth-harness.test-helper.js.map +0 -1
  342. package/dist/migrate/export/propelauth.d.ts +0 -48
  343. package/dist/migrate/export/propelauth.js +0 -255
  344. package/dist/migrate/export/propelauth.js.map +0 -1
  345. package/dist/migrate/export/record-set.d.ts +0 -44
  346. package/dist/migrate/export/record-set.js +0 -98
  347. package/dist/migrate/export/record-set.js.map +0 -1
  348. package/dist/migrate/export/source-lines.d.ts +0 -17
  349. package/dist/migrate/export/source-lines.js +0 -43
  350. package/dist/migrate/export/source-lines.js.map +0 -1
  351. package/dist/migrate/export/sso-metadata.d.ts +0 -47
  352. package/dist/migrate/export/sso-metadata.js +0 -180
  353. package/dist/migrate/export/sso-metadata.js.map +0 -1
  354. package/dist/migrate/export/stytch-config.d.ts +0 -22
  355. package/dist/migrate/export/stytch-config.js +0 -102
  356. package/dist/migrate/export/stytch-config.js.map +0 -1
  357. package/dist/migrate/export/stytch.d.ts +0 -68
  358. package/dist/migrate/export/stytch.js +0 -510
  359. package/dist/migrate/export/stytch.js.map +0 -1
  360. package/dist/migrate/export/supabase-config.d.ts +0 -48
  361. package/dist/migrate/export/supabase-config.js +0 -408
  362. package/dist/migrate/export/supabase-config.js.map +0 -1
  363. package/dist/migrate/export/supabase.d.ts +0 -86
  364. package/dist/migrate/export/supabase.js +0 -524
  365. package/dist/migrate/export/supabase.js.map +0 -1
  366. package/dist/migrate/export/supertokens-config.d.ts +0 -20
  367. package/dist/migrate/export/supertokens-config.js +0 -150
  368. package/dist/migrate/export/supertokens-config.js.map +0 -1
  369. package/dist/migrate/export/supertokens.d.ts +0 -125
  370. package/dist/migrate/export/supertokens.js +0 -464
  371. package/dist/migrate/export/supertokens.js.map +0 -1
  372. package/dist/migrate/export/table.d.ts +0 -35
  373. package/dist/migrate/export/table.js +0 -248
  374. package/dist/migrate/export/table.js.map +0 -1
  375. package/dist/migrate/export/translate-kit.d.ts +0 -46
  376. package/dist/migrate/export/translate-kit.js +0 -148
  377. package/dist/migrate/export/translate-kit.js.map +0 -1
  378. package/dist/migrate/export/userfront-config.d.ts +0 -15
  379. package/dist/migrate/export/userfront-config.js +0 -49
  380. package/dist/migrate/export/userfront-config.js.map +0 -1
  381. package/dist/migrate/export/userfront.d.ts +0 -38
  382. package/dist/migrate/export/userfront.js +0 -189
  383. package/dist/migrate/export/userfront.js.map +0 -1
  384. package/dist/migrate/export/vendor-http.d.ts +0 -46
  385. package/dist/migrate/export/vendor-http.js +0 -138
  386. package/dist/migrate/export/vendor-http.js.map +0 -1
  387. package/dist/migrate/export/workos-config.d.ts +0 -23
  388. package/dist/migrate/export/workos-config.js +0 -125
  389. package/dist/migrate/export/workos-config.js.map +0 -1
  390. package/dist/migrate/export/workos.d.ts +0 -46
  391. package/dist/migrate/export/workos.js +0 -272
  392. package/dist/migrate/export/workos.js.map +0 -1
  393. package/dist/migrate/export/zip.d.ts +0 -8
  394. package/dist/migrate/export/zip.js +0 -66
  395. package/dist/migrate/export/zip.js.map +0 -1
  396. package/dist/migrate/export/zitadel-config.d.ts +0 -37
  397. package/dist/migrate/export/zitadel-config.js +0 -279
  398. package/dist/migrate/export/zitadel-config.js.map +0 -1
  399. package/dist/migrate/export/zitadel.d.ts +0 -82
  400. package/dist/migrate/export/zitadel.js +0 -447
  401. package/dist/migrate/export/zitadel.js.map +0 -1
  402. package/dist/migrate/firebase/plugin.d.ts +0 -2
  403. package/dist/migrate/firebase/plugin.js +0 -152
  404. package/dist/migrate/firebase/plugin.js.map +0 -1
  405. package/dist/migrate/framework/builtins.d.ts +0 -2
  406. package/dist/migrate/framework/builtins.js +0 -52
  407. package/dist/migrate/framework/builtins.js.map +0 -1
  408. package/dist/migrate/framework/commands.d.ts +0 -20
  409. package/dist/migrate/framework/commands.js +0 -58
  410. package/dist/migrate/framework/commands.js.map +0 -1
  411. package/dist/migrate/framework/custom.d.ts +0 -12
  412. package/dist/migrate/framework/custom.js +0 -96
  413. package/dist/migrate/framework/custom.js.map +0 -1
  414. package/dist/migrate/framework/orchestrator.d.ts +0 -113
  415. package/dist/migrate/framework/orchestrator.js +0 -532
  416. package/dist/migrate/framework/orchestrator.js.map +0 -1
  417. package/dist/migrate/framework/plugin.d.ts +0 -167
  418. package/dist/migrate/framework/plugin.js +0 -3
  419. package/dist/migrate/framework/plugin.js.map +0 -1
  420. package/dist/migrate/framework/registry.d.ts +0 -11
  421. package/dist/migrate/framework/registry.js +0 -44
  422. package/dist/migrate/framework/registry.js.map +0 -1
  423. package/dist/migrate/framework/report.d.ts +0 -17
  424. package/dist/migrate/framework/report.js +0 -103
  425. package/dist/migrate/framework/report.js.map +0 -1
  426. package/dist/migrate/frameworks/plugins.d.ts +0 -29
  427. package/dist/migrate/frameworks/plugins.js +0 -402
  428. package/dist/migrate/frameworks/plugins.js.map +0 -1
  429. package/dist/migrate/frameworks/report.d.ts +0 -92
  430. package/dist/migrate/frameworks/report.js +0 -207
  431. package/dist/migrate/frameworks/report.js.map +0 -1
  432. package/dist/migrate/frameworks/translate-js.d.ts +0 -5
  433. package/dist/migrate/frameworks/translate-js.js +0 -503
  434. package/dist/migrate/frameworks/translate-js.js.map +0 -1
  435. package/dist/migrate/frameworks/translate-rails-django.d.ts +0 -3
  436. package/dist/migrate/frameworks/translate-rails-django.js +0 -1391
  437. package/dist/migrate/frameworks/translate-rails-django.js.map +0 -1
  438. package/dist/migrate/frontegg/plugin.d.ts +0 -2
  439. package/dist/migrate/frontegg/plugin.js +0 -78
  440. package/dist/migrate/frontegg/plugin.js.map +0 -1
  441. package/dist/migrate/fusionauth/plugin.d.ts +0 -2
  442. package/dist/migrate/fusionauth/plugin.js +0 -109
  443. package/dist/migrate/fusionauth/plugin.js.map +0 -1
  444. package/dist/migrate/hanko/plugin.d.ts +0 -2
  445. package/dist/migrate/hanko/plugin.js +0 -100
  446. package/dist/migrate/hanko/plugin.js.map +0 -1
  447. package/dist/migrate/keycloak/plugin.d.ts +0 -2
  448. package/dist/migrate/keycloak/plugin.js +0 -148
  449. package/dist/migrate/keycloak/plugin.js.map +0 -1
  450. package/dist/migrate/kinde/plugin.d.ts +0 -2
  451. package/dist/migrate/kinde/plugin.js +0 -105
  452. package/dist/migrate/kinde/plugin.js.map +0 -1
  453. package/dist/migrate/ldap/plugin.d.ts +0 -2
  454. package/dist/migrate/ldap/plugin.js +0 -73
  455. package/dist/migrate/ldap/plugin.js.map +0 -1
  456. package/dist/migrate/logto/plugin.d.ts +0 -2
  457. package/dist/migrate/logto/plugin.js +0 -131
  458. package/dist/migrate/logto/plugin.js.map +0 -1
  459. package/dist/migrate/magic/plugin.d.ts +0 -2
  460. package/dist/migrate/magic/plugin.js +0 -56
  461. package/dist/migrate/magic/plugin.js.map +0 -1
  462. package/dist/migrate/nhost/plugin.d.ts +0 -2
  463. package/dist/migrate/nhost/plugin.js +0 -115
  464. package/dist/migrate/nhost/plugin.js.map +0 -1
  465. package/dist/migrate/oidc/plugin.d.ts +0 -2
  466. package/dist/migrate/oidc/plugin.js +0 -73
  467. package/dist/migrate/oidc/plugin.js.map +0 -1
  468. package/dist/migrate/okta/plugin.d.ts +0 -2
  469. package/dist/migrate/okta/plugin.js +0 -105
  470. package/dist/migrate/okta/plugin.js.map +0 -1
  471. package/dist/migrate/onelogin/plugin.d.ts +0 -2
  472. package/dist/migrate/onelogin/plugin.js +0 -61
  473. package/dist/migrate/onelogin/plugin.js.map +0 -1
  474. package/dist/migrate/ory/plugin.d.ts +0 -2
  475. package/dist/migrate/ory/plugin.js +0 -186
  476. package/dist/migrate/ory/plugin.js.map +0 -1
  477. package/dist/migrate/ping-identity/plugin.d.ts +0 -2
  478. package/dist/migrate/ping-identity/plugin.js +0 -100
  479. package/dist/migrate/ping-identity/plugin.js.map +0 -1
  480. package/dist/migrate/pocketbase/plugin.d.ts +0 -2
  481. package/dist/migrate/pocketbase/plugin.js +0 -99
  482. package/dist/migrate/pocketbase/plugin.js.map +0 -1
  483. package/dist/migrate/propelauth/plugin.d.ts +0 -2
  484. package/dist/migrate/propelauth/plugin.js +0 -65
  485. package/dist/migrate/propelauth/plugin.js.map +0 -1
  486. package/dist/migrate/saml/plugin.d.ts +0 -2
  487. package/dist/migrate/saml/plugin.js +0 -79
  488. package/dist/migrate/saml/plugin.js.map +0 -1
  489. package/dist/migrate/stytch/plugin.d.ts +0 -2
  490. package/dist/migrate/stytch/plugin.js +0 -97
  491. package/dist/migrate/stytch/plugin.js.map +0 -1
  492. package/dist/migrate/supabase/plugin.d.ts +0 -2
  493. package/dist/migrate/supabase/plugin.js +0 -149
  494. package/dist/migrate/supabase/plugin.js.map +0 -1
  495. package/dist/migrate/supertokens/plugin.d.ts +0 -2
  496. package/dist/migrate/supertokens/plugin.js +0 -114
  497. package/dist/migrate/supertokens/plugin.js.map +0 -1
  498. package/dist/migrate/user-table/plugin.d.ts +0 -2
  499. package/dist/migrate/user-table/plugin.js +0 -62
  500. package/dist/migrate/user-table/plugin.js.map +0 -1
  501. package/dist/migrate/userfront/plugin.d.ts +0 -2
  502. package/dist/migrate/userfront/plugin.js +0 -60
  503. package/dist/migrate/userfront/plugin.js.map +0 -1
  504. package/dist/migrate/workos/plugin.d.ts +0 -2
  505. package/dist/migrate/workos/plugin.js +0 -81
  506. package/dist/migrate/workos/plugin.js.map +0 -1
  507. package/dist/migrate/zitadel/plugin.d.ts +0 -2
  508. package/dist/migrate/zitadel/plugin.js +0 -114
  509. package/dist/migrate/zitadel/plugin.js.map +0 -1
  510. package/dist/output.d.ts +0 -41
  511. package/dist/output.js +0 -72
  512. package/dist/output.js.map +0 -1
  513. package/dist/project.d.ts +0 -64
  514. package/dist/project.js +0 -86
  515. package/dist/project.js.map +0 -1
  516. package/dist/prompt.d.ts +0 -15
  517. package/dist/prompt.js +0 -46
  518. package/dist/prompt.js.map +0 -1
  519. package/dist/run.d.ts +0 -12
  520. package/dist/run.js +0 -157
  521. package/dist/run.js.map +0 -1
  522. package/dist/secrets.d.ts +0 -41
  523. package/dist/secrets.js +0 -142
  524. package/dist/secrets.js.map +0 -1
  525. package/dist/serialize.d.ts +0 -30
  526. package/dist/serialize.js +0 -131
  527. package/dist/serialize.js.map +0 -1
  528. package/dist/version.d.ts +0 -7
  529. package/dist/version.js +0 -21
  530. package/dist/version.js.map +0 -1
@@ -1,62 +0,0 @@
1
- import type { PasswordHash } from '@atlasauth/migrate';
2
- import { RecordSet, type Obj } from './record-set';
3
- /**
4
- * `atlas migrate export auth0` — Auth0 (and Okta Customer Identity Cloud,
5
- * which is Auth0) onto the canonical bundle models.
6
- *
7
- * Read with a Management API token the owner holds (a machine-to-machine
8
- * application's client id + secret, or a token pasted from the dashboard);
9
- * the calls run on this machine and the credentials go nowhere else.
10
- *
11
- * - users: through a user-export JOB (the only complete listing — user
12
- * search stops at 1,000), or from an export file the owner already has;
13
- * - password hashes and MFA secrets: Auth0 releases them ONLY through a
14
- * support ticket. Pass the decrypted file with --auth0-hashes-file; rows are matched
15
- * by user id (`_id.$oid` → `auth0|<oid>`) or email. Without it, enable the
16
- * `auth0` lazy-migration preset so passwords move on first sign-in;
17
- * - social and enterprise identities, app roles (role → users), organizations,
18
- * members with their roles, pending invitations, enterprise connections
19
- * (SAML / OIDC / Azure AD / ADFS / Okta / Ping / Google Workspace), and the
20
- * tenant's public signing keys;
21
- * - with --authentication-methods: per user, phone/email second factors and
22
- * passkeys (public key only — Auth0 never returns a TOTP secret by API).
23
- *
24
- * Sessions are not exported: Auth0 issues JWTs, bridged by the `auth0`
25
- * bridge preset against the tenant's JWKS.
26
- */
27
- export interface Auth0ExportOptions {
28
- /** The tenant's canonical domain (`acme.us.auth0.com`), not a custom domain. */
29
- domain: string;
30
- clientId?: string;
31
- clientSecret?: string;
32
- /** A Management API token, instead of client credentials. */
33
- token?: string;
34
- /** The text of a user export file (NDJSON or JSON array), instead of running an export job. */
35
- usersText?: string;
36
- /** The text of the decrypted password-hash / MFA export from Auth0 support (NDJSON or JSON). */
37
- hashesText?: string;
38
- /** Only this database / social connection's users (export job `connection_id`). */
39
- connectionId?: string;
40
- /** Read each user's authentication methods (phone/email factors, passkeys). One call per user. */
41
- authenticationMethods?: boolean;
42
- /** The WebAuthn relying party the passkeys were registered for (default: the domain). */
43
- rpId?: string;
44
- fetchImpl?: typeof fetch;
45
- sleep?: (ms: number) => Promise<void>;
46
- onProgress?: (message: string) => void;
47
- }
48
- /** Fields requested from the export job (json format allows whole metadata objects). */
49
- export declare const AUTH0_EXPORT_FIELDS: readonly ["user_id", "email", "email_verified", "username", "phone_number", "phone_verified", "given_name", "family_name", "name", "nickname", "picture", "identities", "app_metadata", "user_metadata", "created_at", "last_login", "blocked"];
50
- export declare function exportAuth0(opts: Auth0ExportOptions): Promise<RecordSet>;
51
- export declare function managementToken(domain: string, opts: Auth0ExportOptions, fetchImpl: typeof fetch): Promise<string>;
52
- /** NDJSON (Auth0's export format) or a JSON array / `{ users: [] }`. */
53
- export declare function parseLines(text: string): Obj[];
54
- /** Auth0 role names are free text: `Billing Admin` → `billing_admin`. */
55
- export declare function roleKey(name: string): string;
56
- /**
57
- * An Auth0 bulk-import `custom_password_hash` (users imported into Auth0 that
58
- * never signed in since keep it) → the Atlas registry's algorithm + params.
59
- */
60
- export declare function auth0CustomHash(c: Obj): PasswordHash | {
61
- reason: string;
62
- };
@@ -1,575 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AUTH0_EXPORT_FIELDS = void 0;
4
- exports.exportAuth0 = exportAuth0;
5
- exports.managementToken = managementToken;
6
- exports.parseLines = parseLines;
7
- exports.roleKey = roleKey;
8
- exports.auth0CustomHash = auth0CustomHash;
9
- const node_zlib_1 = require("node:zlib");
10
- const record_set_1 = require("./record-set");
11
- const vendor_http_1 = require("./vendor-http");
12
- /** Fields requested from the export job (json format allows whole metadata objects). */
13
- exports.AUTH0_EXPORT_FIELDS = [
14
- 'user_id',
15
- 'email',
16
- 'email_verified',
17
- 'username',
18
- 'phone_number',
19
- 'phone_verified',
20
- 'given_name',
21
- 'family_name',
22
- 'name',
23
- 'nickname',
24
- 'picture',
25
- 'identities',
26
- 'app_metadata',
27
- 'user_metadata',
28
- 'created_at',
29
- 'last_login',
30
- 'blocked',
31
- ];
32
- const ENTERPRISE_STRATEGIES = ['samlp', 'oidc', 'waad', 'adfs', 'okta', 'pingfederate', 'google-apps', 'ad'];
33
- async function exportAuth0(opts) {
34
- const set = new record_set_1.RecordSet();
35
- const domain = opts.domain.replace(/^https?:\/\//, '').replace(/\/+$/, '');
36
- if (!/^[a-z0-9.-]+$/i.test(domain))
37
- throw new Error(`Not an Auth0 domain: ${opts.domain}`);
38
- const progress = opts.onProgress ?? (() => undefined);
39
- const sleep = opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
40
- const fetchImpl = opts.fetchImpl ?? fetch;
41
- let token = opts.token;
42
- const http = new vendor_http_1.VendorHttp({
43
- vendor: 'Auth0',
44
- baseUrl: `https://${domain}/api/v2`,
45
- headers: async () => ({ authorization: `Bearer ${(token ??= await managementToken(domain, opts, fetchImpl))}` }),
46
- fetchImpl,
47
- sleep,
48
- });
49
- // Offline: only the files (users + hashes), no Management API calls at all.
50
- const online = Boolean(opts.token || (opts.clientId && opts.clientSecret));
51
- if (!online && opts.usersText === undefined) {
52
- throw new Error('Auth0 export needs a Management API token (or M2M client id + secret), or a user export file.');
53
- }
54
- if (!online)
55
- set.warn('Exported from files only: organizations, roles and enterprise connections need Management API access.');
56
- const list = async (fn) => (online ? fn() : []);
57
- // Enterprise connections first: identities point at them by name.
58
- progress('connections');
59
- const connectionIds = new Map();
60
- for (const c of await list(() => pageAll(http, `/connections?${ENTERPRISE_STRATEGIES.map((s) => `strategy=${s}`).join('&')}`, 'connections'))) {
61
- const added = addConnection(set, c, domain);
62
- if (added)
63
- connectionIds.set((0, record_set_1.str)(c.name), added);
64
- }
65
- progress('organizations');
66
- const orgs = await list(() => checkpointAll(http, '/organizations', 'organizations'));
67
- for (const o of orgs) {
68
- const id = (0, record_set_1.str)(o.id);
69
- const name = (0, record_set_1.str)(o.display_name) ?? (0, record_set_1.str)(o.name);
70
- if (!id || !name)
71
- continue;
72
- set.add('organization', (0, record_set_1.compact)({
73
- id,
74
- name,
75
- slug: (0, record_set_1.str)(o.name),
76
- image_url: (0, record_set_1.str)((0, record_set_1.isObj)(o.branding) ? o.branding.logo_url : undefined),
77
- public_metadata: (0, record_set_1.bag)(o.metadata),
78
- }));
79
- }
80
- progress('roles');
81
- const roles = await list(() => pageAll(http, '/roles', 'roles'));
82
- const roleKeyById = new Map();
83
- const userRoles = new Map();
84
- for (const r of roles) {
85
- const id = (0, record_set_1.str)(r.id);
86
- const name = (0, record_set_1.str)(r.name);
87
- if (!id || !name)
88
- continue;
89
- const key = roleKey(name);
90
- roleKeyById.set(id, key);
91
- const permissions = (await pageAll(http, `/roles/${id}/permissions`, 'permissions'))
92
- .map((p) => (0, record_set_1.str)(p.permission_name))
93
- .filter((p) => !!p);
94
- set.add('role', (0, record_set_1.compact)({ key, name, description: (0, record_set_1.str)(r.description), scope: 'app', permissions }), `app:${key}`);
95
- if (orgs.length)
96
- set.add('role', (0, record_set_1.compact)({ key, name, description: (0, record_set_1.str)(r.description), scope: 'organization', permissions }), `org:${key}`);
97
- for (const u of await checkpointAll(http, `/roles/${id}/users`, 'users')) {
98
- const uid = (0, record_set_1.str)(u.user_id);
99
- if (uid)
100
- userRoles.set(uid, [...(userRoles.get(uid) ?? []), key]);
101
- }
102
- }
103
- progress('users');
104
- const userLines = opts.usersText !== undefined ? parseLines(opts.usersText) : await runExportJob(http, opts, fetchImpl, sleep, progress);
105
- const secrets = opts.hashesText !== undefined ? indexHashes(parseLines(opts.hashesText)) : null;
106
- const userIds = new Set();
107
- let withHash = 0;
108
- for (const u of userLines) {
109
- const id = (0, record_set_1.str)(u.user_id);
110
- if (!id)
111
- continue;
112
- const secret = secrets ? (secrets.byId.get(id) ?? secrets.byEmail.get((0, record_set_1.str)(u.email)?.toLowerCase() ?? '')) : undefined;
113
- if (addUser(set, u, { roles: userRoles.get(id), secret, connectionIds })) {
114
- userIds.add(id);
115
- if (secret?.password)
116
- withHash++;
117
- }
118
- }
119
- const dbUsers = set.list('user').filter((u) => u.id.startsWith('auth0|')).length;
120
- if (!secrets && dbUsers > 0) {
121
- set.warn(`${dbUsers} database user(s) without password hashes: Auth0 releases hashes only through a support ticket. Import them later with --auth0-hashes-file, or turn on the auth0 lazy-migration preset so each password moves on its first sign-in.`);
122
- }
123
- else if (secrets && withHash < dbUsers) {
124
- set.omit('password', 'no row in the hash export for this database user', dbUsers - withHash);
125
- }
126
- if (opts.authenticationMethods && online) {
127
- progress('authentication methods');
128
- for (const id of userIds)
129
- await addAuthenticationMethods(set, http, id, opts.rpId ?? domain);
130
- }
131
- else {
132
- set.warn('Second factors and passkeys were not read (pass --authentication-methods). Without them, users re-enrol MFA in Atlas.');
133
- }
134
- progress('organization members');
135
- for (const o of orgs) {
136
- const orgId = (0, record_set_1.str)(o.id);
137
- if (!orgId)
138
- continue;
139
- for (const m of await checkpointAll(http, `/organizations/${orgId}/members?fields=user_id,roles&include_fields=true`, 'members')) {
140
- const uid = (0, record_set_1.str)(m.user_id);
141
- if (!uid || !userIds.has(uid))
142
- continue;
143
- const role = (0, record_set_1.objs)(m.roles).map((r) => roleKeyById.get((0, record_set_1.str)(r.id) ?? '') ?? ((0, record_set_1.str)(r.name) ? roleKey((0, record_set_1.str)(r.name)) : undefined)).find(Boolean) ?? 'member';
144
- set.add('membership', { organization_id: orgId, user_id: uid, role }, `${orgId}:${uid}`);
145
- if ((0, record_set_1.objs)(m.roles).length > 1)
146
- set.warn(`Some organization members hold several Auth0 roles; Atlas seats each member with one role (the first).`);
147
- }
148
- for (const inv of await pageAll(http, `/organizations/${orgId}/invitations`, 'invitations')) {
149
- const id = (0, record_set_1.str)(inv.id);
150
- const email = (0, record_set_1.str)((0, record_set_1.isObj)(inv.invitee) ? inv.invitee.email : undefined);
151
- if (!id || !email)
152
- continue;
153
- const roleIds = Array.isArray(inv.roles) ? inv.roles : [];
154
- set.add('invitation', (0, record_set_1.compact)({
155
- id,
156
- organization_id: orgId,
157
- email,
158
- role: roleIds.map((r) => roleKeyById.get(String(r))).find(Boolean),
159
- status: 'pending',
160
- expires_at: (0, record_set_1.str)(inv.expires_at),
161
- created_at: (0, record_set_1.str)(inv.created_at),
162
- }));
163
- }
164
- }
165
- progress('signing keys');
166
- if (online) {
167
- try {
168
- const res = await fetchImpl(`https://${domain}/.well-known/jwks.json`, { headers: { accept: 'application/json' } });
169
- if (res.ok) {
170
- const body = (await res.json());
171
- for (const k of (0, record_set_1.objs)(body.keys))
172
- if ((0, record_set_1.str)(k.kid))
173
- set.add('jwks', { kid: (0, record_set_1.str)(k.kid), jwk: k });
174
- }
175
- }
176
- catch {
177
- set.warn('The tenant JWKS could not be read; the bridge preset fetches it live instead.');
178
- }
179
- }
180
- set.manifest = {
181
- origin: domain,
182
- rpId: opts.authenticationMethods ? (opts.rpId ?? domain) : null,
183
- providers: [...new Set(set.list('identity').map((i) => i.provider))].sort(),
184
- };
185
- return set;
186
- }
187
- // ── tokens and paging ───────────────────────────────────────────────────────
188
- async function managementToken(domain, opts, fetchImpl) {
189
- if (!opts.clientId || !opts.clientSecret) {
190
- throw new Error('Auth0 export needs a Management API token, or the client id and secret of a machine-to-machine application authorized for the Management API.');
191
- }
192
- const res = await fetchImpl(`https://${domain}/oauth/token`, {
193
- method: 'POST',
194
- headers: { 'content-type': 'application/json', accept: 'application/json' },
195
- body: JSON.stringify({ grant_type: 'client_credentials', client_id: opts.clientId, client_secret: opts.clientSecret, audience: `https://${domain}/api/v2/` }),
196
- });
197
- const body = (await res.json().catch(() => ({})));
198
- if (!res.ok || !body.access_token) {
199
- throw new vendor_http_1.VendorApiError('Auth0', res.status, '/oauth/token', body.error_description ?? 'could not get a Management API token');
200
- }
201
- return body.access_token;
202
- }
203
- /** page/per_page listing with include_totals (Auth0's classic paging). */
204
- async function pageAll(http, path, key) {
205
- const out = [];
206
- const sep = path.includes('?') ? '&' : '?';
207
- for (let page = 0;; page++) {
208
- const { body } = await http.get(`${path}${sep}page=${page}&per_page=100&include_totals=true`);
209
- const rows = Array.isArray(body) ? body.filter(record_set_1.isObj) : (0, record_set_1.isObj)(body) ? (0, record_set_1.objs)(body[key]) : [];
210
- out.push(...rows);
211
- const total = (0, record_set_1.isObj)(body) && typeof body.total === 'number' ? body.total : undefined;
212
- if (rows.length < 100 || (total !== undefined && out.length >= total))
213
- return out;
214
- }
215
- }
216
- /** Checkpoint paging (`from` / `take`, `next` in the body): no 1,000-row ceiling. */
217
- async function checkpointAll(http, path, key) {
218
- const out = [];
219
- const sep = path.includes('?') ? '&' : '?';
220
- let from;
221
- for (;;) {
222
- const { body } = await http.get(`${path}${sep}take=100${from ? `&from=${encodeURIComponent(from)}` : ''}`);
223
- const rows = Array.isArray(body) ? body.filter(record_set_1.isObj) : (0, record_set_1.isObj)(body) ? (0, record_set_1.objs)(body[key]) : [];
224
- out.push(...rows);
225
- from = (0, record_set_1.isObj)(body) ? (0, record_set_1.str)(body.next) : undefined;
226
- if (!from || rows.length === 0)
227
- return out;
228
- }
229
- }
230
- async function runExportJob(http, opts, fetchImpl, sleep, progress) {
231
- const body = { format: 'json', fields: exports.AUTH0_EXPORT_FIELDS.map((name) => ({ name })) };
232
- if (opts.connectionId)
233
- body.connection_id = opts.connectionId;
234
- let job;
235
- try {
236
- job = (await http.post('/jobs/users-exports', body)).body;
237
- }
238
- catch (err) {
239
- if (err instanceof vendor_http_1.VendorApiError && (err.status === 403 || err.status === 402)) {
240
- throw new Error(`Auth0 refused the user export job (${err.message}). Export jobs need a paid plan and the read:users scope; or download an export yourself and pass it with --auth0-users-file.`);
241
- }
242
- throw err;
243
- }
244
- const id = (0, record_set_1.str)(job.id);
245
- if (!id)
246
- throw new Error('Auth0 did not return an export job id.');
247
- for (let i = 0;; i++) {
248
- const { body: status } = await http.get(`/jobs/${id}`);
249
- const state = (0, record_set_1.str)(status.status);
250
- if (state === 'completed' && (0, record_set_1.str)(status.location)) {
251
- // The location is a short-lived pre-signed URL: no Auth0 credentials go with it.
252
- const res = await fetchImpl((0, record_set_1.str)(status.location));
253
- if (!res.ok)
254
- throw new vendor_http_1.VendorApiError('Auth0', res.status, 'export download', 'the export file could not be downloaded');
255
- const raw = Buffer.from(await res.arrayBuffer());
256
- const text = raw[0] === 0x1f && raw[1] === 0x8b ? (0, node_zlib_1.gunzipSync)(raw).toString('utf8') : raw.toString('utf8');
257
- return parseLines(text);
258
- }
259
- if (state === 'failed')
260
- throw new Error(`The Auth0 export job ${id} failed${(0, record_set_1.str)(status.summary) ? `: ${(0, record_set_1.str)(status.summary)}` : ''}.`);
261
- if (i % 6 === 0)
262
- progress(`waiting for export job ${id} (${state ?? 'pending'}${typeof status.time_left_seconds === 'number' ? `, ~${status.time_left_seconds}s left` : ''})`);
263
- await sleep(5000);
264
- }
265
- }
266
- /** NDJSON (Auth0's export format) or a JSON array / `{ users: [] }`. */
267
- function parseLines(text) {
268
- const t = text.trim();
269
- if (!t)
270
- return [];
271
- if (t.startsWith('['))
272
- return (0, record_set_1.objs)(JSON.parse(t));
273
- try {
274
- const one = JSON.parse(t);
275
- if ((0, record_set_1.isObj)(one))
276
- return Array.isArray(one.users) ? (0, record_set_1.objs)(one.users) : [one];
277
- }
278
- catch {
279
- // NDJSON: one object per line.
280
- }
281
- return t
282
- .split(/\r?\n/)
283
- .filter((l) => l.trim())
284
- .map((l) => JSON.parse(l))
285
- .filter(record_set_1.isObj);
286
- }
287
- function indexHashes(rows) {
288
- const byId = new Map();
289
- const byEmail = new Map();
290
- for (const r of rows) {
291
- const oid = (0, record_set_1.isObj)(r._id) ? (0, record_set_1.str)(r._id.$oid) : (0, record_set_1.str)(r._id);
292
- const id = (0, record_set_1.str)(r.user_id) ?? (oid ? `auth0|${oid}` : undefined);
293
- const secret = {};
294
- const hash = (0, record_set_1.str)(r.passwordHash) ?? (0, record_set_1.str)(r.password_hash);
295
- if (hash)
296
- secret.password = { algorithm: 'auto', hash };
297
- else if ((0, record_set_1.isObj)(r.custom_password_hash)) {
298
- const mapped = auth0CustomHash(r.custom_password_hash);
299
- if ('reason' in mapped)
300
- secret.passwordReason = mapped.reason;
301
- else
302
- secret.password = mapped;
303
- }
304
- // MFA secrets, when support includes them, in the bulk-import `mfa_factors` shape.
305
- for (const f of (0, record_set_1.objs)(r.mfa_factors)) {
306
- const totp = (0, record_set_1.isObj)(f.totp) ? (0, record_set_1.str)(f.totp.secret) : undefined;
307
- if (totp)
308
- (secret.totp ??= []).push(totp);
309
- const phone = (0, record_set_1.isObj)(f.phone) ? (0, record_set_1.str)(f.phone.value) : undefined;
310
- if (phone)
311
- (secret.phones ??= []).push(phone);
312
- const email = (0, record_set_1.isObj)(f.email) ? (0, record_set_1.str)(f.email.value) : undefined;
313
- if (email)
314
- (secret.emails ??= []).push(email);
315
- }
316
- if (id)
317
- byId.set(id, secret);
318
- const email = (0, record_set_1.str)(r.email)?.toLowerCase();
319
- if (email && !byEmail.has(email))
320
- byEmail.set(email, secret);
321
- }
322
- return { byId, byEmail };
323
- }
324
- function addUser(set, u, ctx) {
325
- const id = (0, record_set_1.str)(u.user_id);
326
- const email = (0, record_set_1.str)(u.email)?.toLowerCase();
327
- const phone = (0, record_set_1.e164)(u.phone_number);
328
- const user = (0, record_set_1.compact)({
329
- id,
330
- emails: email ? [{ email, verified: u.email_verified === true, primary: true }] : [],
331
- phones: phone ? [{ phone, verified: u.phone_verified === true, primary: !email }] : [],
332
- username: (0, record_set_1.str)(u.username),
333
- first_name: (0, record_set_1.str)(u.given_name),
334
- last_name: (0, record_set_1.str)(u.family_name),
335
- name: (0, record_set_1.str)(u.given_name) || (0, record_set_1.str)(u.family_name) ? undefined : (0, record_set_1.str)(u.name) && (0, record_set_1.str)(u.name) !== email ? (0, record_set_1.str)(u.name) : undefined,
336
- image_url: (0, record_set_1.str)(u.picture),
337
- roles: ctx.roles,
338
- banned: u.blocked === true ? true : undefined,
339
- // app_metadata is server-controlled in Auth0 (often holds entitlements): it
340
- // lands in the backend-only bag. user_metadata is user-editable.
341
- private_metadata: (0, record_set_1.bag)(u.app_metadata),
342
- unsafe_metadata: (0, record_set_1.bag)(u.user_metadata),
343
- created_at: (0, record_set_1.str)(u.created_at),
344
- last_sign_in_at: (0, record_set_1.str)(u.last_login),
345
- });
346
- if (ctx.secret?.password)
347
- user.password = ctx.secret.password;
348
- else if (ctx.secret?.passwordReason)
349
- set.omit('password', ctx.secret.passwordReason);
350
- if (!user.emails?.length && !user.phones?.length && !user.username) {
351
- set.omit('user', 'no email, phone number or username');
352
- return false;
353
- }
354
- set.add('user', user);
355
- for (const i of (0, record_set_1.objs)(u.identities)) {
356
- const provider = (0, record_set_1.str)(i.provider);
357
- const sub = (0, record_set_1.str)(i.user_id);
358
- if (!provider || !sub || provider === 'auth0' || provider === 'sms' || provider === 'email')
359
- continue;
360
- const connection = (0, record_set_1.str)(i.connection);
361
- const enterprise = connection ? ctx.connectionIds.get(connection) : undefined;
362
- set.add('identity', (0, record_set_1.compact)({
363
- user_id: id,
364
- provider: enterprise ? connection : provider,
365
- provider_user_id: sub,
366
- kind: enterprise ? (provider === 'samlp' || provider === 'adfs' ? 'saml' : 'oidc') : i.isSocial === true ? 'oauth' : 'enterprise',
367
- sso_connection_id: enterprise,
368
- profile: (0, record_set_1.bag)(i.profileData),
369
- }));
370
- }
371
- for (const secret of ctx.secret?.totp ?? []) {
372
- set.add('mfa_factor', { user_id: id, type: 'totp', secret_base32: secret.replace(/=+$/, '').toUpperCase(), digits: 6, period: 30, algorithm: 'SHA1', verified: true });
373
- }
374
- for (const p of ctx.secret?.phones ?? []) {
375
- const n = (0, record_set_1.e164)(p);
376
- if (n)
377
- set.add('mfa_factor', { user_id: id, type: 'phone', phone: n, verified: true }, `phone:${id}:${n}`);
378
- }
379
- for (const _ of ctx.secret?.emails ?? [])
380
- set.add('mfa_factor', { user_id: id, type: 'email', verified: true }, `email:${id}`);
381
- return true;
382
- }
383
- async function addAuthenticationMethods(set, http, userId, rpId) {
384
- let methods;
385
- try {
386
- methods = await pageAll(http, `/users/${encodeURIComponent(userId)}/authentication-methods`, 'authenticators');
387
- }
388
- catch (err) {
389
- if (err instanceof vendor_http_1.VendorApiError && (err.status === 403 || err.status === 404))
390
- return;
391
- throw err;
392
- }
393
- for (const m of methods) {
394
- const type = (0, record_set_1.str)(m.type);
395
- if (m.confirmed === false)
396
- continue;
397
- if (type === 'phone' || type === 'sms') {
398
- const phone = (0, record_set_1.e164)(m.phone_number);
399
- if (phone)
400
- set.add('mfa_factor', { user_id: userId, type: 'phone', phone, verified: true, created_at: (0, record_set_1.str)(m.created_at) }, `phone:${userId}:${phone}`);
401
- }
402
- else if (type === 'email') {
403
- set.add('mfa_factor', { user_id: userId, type: 'email', verified: true, created_at: (0, record_set_1.str)(m.created_at) }, `email:${userId}`);
404
- }
405
- else if ((type === 'passkey' || type === 'webauthn-platform' || type === 'webauthn-roaming') && (0, record_set_1.str)(m.key_id) && (0, record_set_1.str)(m.public_key)) {
406
- set.add('passkey', (0, record_set_1.compact)({
407
- id: (0, record_set_1.str)(m.id),
408
- user_id: userId,
409
- credential_id: b64url((0, record_set_1.str)(m.key_id)),
410
- public_key: b64url((0, record_set_1.str)(m.public_key)),
411
- rp_id: (0, record_set_1.str)(m.relying_party_identifier) ?? rpId,
412
- aaguid: (0, record_set_1.str)(m.aaguid),
413
- name: (0, record_set_1.str)(m.name),
414
- backed_up: m.credential_backed_up === true ? true : undefined,
415
- created_at: (0, record_set_1.str)(m.created_at),
416
- }));
417
- }
418
- else if (type === 'totp' || type === 'guardian' || type === 'push' || type === 'recovery-code' || type === 'webauthn-roaming' || type === 'webauthn-platform') {
419
- set.omit('mfa_factor', `Auth0 does not return ${type} secrets by API (support export, or re-enrolment)`);
420
- }
421
- }
422
- }
423
- const b64url = (v) => v.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
424
- /** Auth0 role names are free text: `Billing Admin` → `billing_admin`. */
425
- function roleKey(name) {
426
- return name.trim().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/^_+|_+$/g, '') || 'role';
427
- }
428
- /**
429
- * An Auth0 bulk-import `custom_password_hash` (users imported into Auth0 that
430
- * never signed in since keep it) → the Atlas registry's algorithm + params.
431
- */
432
- function auth0CustomHash(c) {
433
- const algorithm = (0, record_set_1.str)(c.algorithm)?.toLowerCase();
434
- const hash = (0, record_set_1.isObj)(c.hash) ? c.hash : {};
435
- const value = (0, record_set_1.str)(hash.value);
436
- if (!algorithm || !value)
437
- return { reason: 'custom_password_hash without algorithm or hash value' };
438
- const salt = (0, record_set_1.isObj)(c.salt) ? c.salt : undefined;
439
- const pwEnc = (0, record_set_1.isObj)(c.password) ? (0, record_set_1.str)(c.password.encoding) : undefined;
440
- if (pwEnc && !['utf8', 'utf-8', 'ascii'].includes(pwEnc)) {
441
- return { reason: `custom_password_hash password.encoding "${pwEnc}" is not supported` };
442
- }
443
- const encoding = (0, record_set_1.str)(hash.encoding) ?? (algorithm === 'scrypt' ? 'hex' : 'hex');
444
- const saltParams = salt
445
- ? { salt_position: (0, record_set_1.str)(salt.position) ?? 'prefix', salt_encoding: (0, record_set_1.str)(salt.encoding) ?? 'utf8' }
446
- : {};
447
- switch (algorithm) {
448
- case 'bcrypt':
449
- return { algorithm: 'bcrypt', hash: value };
450
- case 'argon2':
451
- return { algorithm: 'argon2', hash: value };
452
- case 'pbkdf2':
453
- // A PHC string `$pbkdf2-<digest>$i=<iterations>,l=<keylen>$<salt>$<hash>`.
454
- return { algorithm: 'auto', hash: value };
455
- case 'ldap':
456
- // RFC 2307: Atlas verifies the SHA family ({SHA}, {SSHA}, {SSHA256}, {SSHA512}).
457
- return /^\{S?SHA(256|512)?\}/i.test(value) ? { algorithm: 'ldap_ssha', hash: value } : { reason: 'custom_password_hash ldap scheme other than {SHA}/{SSHA} is not supported' };
458
- case 'md5':
459
- case 'sha1':
460
- case 'sha256':
461
- case 'sha512': {
462
- const s = salt ? (0, record_set_1.str)(salt.value) : undefined;
463
- if (!s)
464
- return { algorithm, hash: value, params: { encoding } };
465
- return { algorithm: `${algorithm}_salted`, hash: value, salt: s, params: { encoding, ...saltParams } };
466
- }
467
- case 'hmac': {
468
- const digest = (0, record_set_1.str)(hash.digest)?.toLowerCase();
469
- const key = (0, record_set_1.isObj)(hash.key) ? (0, record_set_1.str)(hash.key.value) : undefined;
470
- if (digest !== 'sha256' || !key)
471
- return { reason: `custom_password_hash hmac with digest "${digest ?? '?'}" is not supported (sha256 only)` };
472
- if (salt)
473
- return { reason: 'custom_password_hash hmac with a salt is not supported' };
474
- return { algorithm: 'hmac_sha256', hash: value, params: { key, key_encoding: ((0, record_set_1.isObj)(hash.key) ? (0, record_set_1.str)(hash.key.encoding) : undefined) ?? 'utf8', encoding } };
475
- }
476
- case 'scrypt': {
477
- const s = salt ? (0, record_set_1.str)(salt.value) : undefined;
478
- const keylen = typeof c.keylen === 'number' ? c.keylen : undefined;
479
- if (!s || !keylen)
480
- return { reason: 'custom_password_hash scrypt needs salt and keylen' };
481
- return {
482
- algorithm: 'scrypt',
483
- hash: value,
484
- salt: s,
485
- params: {
486
- n: typeof c.cost === 'number' ? c.cost : 16384,
487
- r: typeof c.blockSize === 'number' ? c.blockSize : 8,
488
- p: typeof c.parallelization === 'number' ? c.parallelization : 1,
489
- key_length: keylen,
490
- encoding,
491
- salt_encoding: (0, record_set_1.str)(salt?.encoding) ?? 'utf8',
492
- },
493
- };
494
- }
495
- default:
496
- return { reason: `custom_password_hash algorithm "${algorithm}" is not supported` };
497
- }
498
- }
499
- // ── enterprise connections ──────────────────────────────────────────────────
500
- function addConnection(set, c, domain) {
501
- const id = (0, record_set_1.str)(c.id);
502
- const name = (0, record_set_1.str)(c.name);
503
- const strategy = (0, record_set_1.str)(c.strategy);
504
- if (!id || !name || !strategy)
505
- return undefined;
506
- const o = (0, record_set_1.isObj)(c.options) ? c.options : {};
507
- const domains = Array.isArray(o.domain_aliases) ? o.domain_aliases.map((d) => (0, record_set_1.str)(d)).filter((d) => !!d) : [];
508
- if (strategy === 'samlp' || strategy === 'adfs' || strategy === 'pingfederate') {
509
- const cert = (0, record_set_1.str)(o.signingCert) ?? (0, record_set_1.str)(o.cert);
510
- set.add('sso_connection', (0, record_set_1.compact)({
511
- id,
512
- name: (0, record_set_1.str)(c.display_name) ?? name,
513
- protocol: 'saml',
514
- domains,
515
- saml: (0, record_set_1.compact)({
516
- idp_entity_id: (0, record_set_1.str)(o.entityId) ?? (0, record_set_1.str)(o.issuer),
517
- idp_sso_url: (0, record_set_1.str)(o.signInEndpoint) ?? (0, record_set_1.str)(o.pingFederateBaseUrl),
518
- idp_certificate: cert ? pemFromAuth0Cert(cert) : undefined,
519
- idp_metadata_url: (0, record_set_1.str)(o.metadataUrl) ?? (0, record_set_1.str)(o.adfs_server),
520
- idp_metadata_xml: (0, record_set_1.str)(o.metadataXml),
521
- sp_entity_id: `urn:auth0:${domain.split('.')[0]}:${name}`,
522
- sp_acs_url: `https://${domain}/login/callback?connection=${encodeURIComponent(name)}`,
523
- attribute_mapping: (0, record_set_1.isObj)(o.fieldsMap)
524
- ? Object.fromEntries(Object.entries(o.fieldsMap).filter(([, v]) => typeof v === 'string'))
525
- : undefined,
526
- }),
527
- }));
528
- return id;
529
- }
530
- if (strategy === 'oidc' || strategy === 'okta' || strategy === 'waad' || strategy === 'google-apps') {
531
- const issuer = strategy === 'waad'
532
- ? (0, record_set_1.str)(o.tenant_domain)
533
- ? `https://login.microsoftonline.com/${(0, record_set_1.str)(o.tenant_id) ?? (0, record_set_1.str)(o.tenant_domain)}/v2.0`
534
- : undefined
535
- : strategy === 'google-apps'
536
- ? 'https://accounts.google.com'
537
- : (0, record_set_1.str)(o.issuer) ?? ((0, record_set_1.str)(o.domain) ? `https://${(0, record_set_1.str)(o.domain)}` : undefined);
538
- set.add('sso_connection', (0, record_set_1.compact)({
539
- id,
540
- name: (0, record_set_1.str)(c.display_name) ?? name,
541
- protocol: 'oidc',
542
- domains: strategy === 'google-apps' && (0, record_set_1.str)(o.domain) ? [...domains, (0, record_set_1.str)(o.domain)] : domains,
543
- oidc: (0, record_set_1.compact)({
544
- issuer,
545
- discovery_url: (0, record_set_1.str)(o.discovery_url),
546
- client_id: (0, record_set_1.str)(o.client_id),
547
- client_secret: (0, record_set_1.str)(o.client_secret),
548
- scopes: (0, record_set_1.str)(o.scope)?.split(/\s+/),
549
- }),
550
- }));
551
- if (!(0, record_set_1.str)(o.client_secret))
552
- set.warn(`Enterprise connection ${name}: Auth0 does not return its client secret; enter it in Atlas after the import.`);
553
- return id;
554
- }
555
- set.warn(`Enterprise connection ${name} (${strategy}) has no Atlas counterpart and was not exported (LDAP/AD connector: use lazy migration).`);
556
- return undefined;
557
- }
558
- /** Auth0 returns the IdP signing certificate as base64 DER or PEM. */
559
- function pemFromAuth0Cert(cert) {
560
- if (cert.includes('BEGIN CERTIFICATE'))
561
- return cert;
562
- const body = cert.replace(/\s+/g, '');
563
- let der = body;
564
- // Some tenants store the PEM itself base64-encoded.
565
- try {
566
- const decoded = Buffer.from(body, 'base64').toString('utf8');
567
- if (decoded.includes('BEGIN CERTIFICATE'))
568
- return decoded;
569
- }
570
- catch {
571
- der = body;
572
- }
573
- return `-----BEGIN CERTIFICATE-----\n${der.match(/.{1,64}/g).join('\n')}\n-----END CERTIFICATE-----`;
574
- }
575
- //# sourceMappingURL=auth0.js.map