@atlasauth/cli 0.23.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 (527) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +3 -3
  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 -90
  25. package/dist/commands/config.js +0 -1430
  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/errors.d.ts +0 -15
  115. package/dist/errors.js +0 -25
  116. package/dist/errors.js.map +0 -1
  117. package/dist/help.d.ts +0 -8
  118. package/dist/help.js +0 -868
  119. package/dist/help.js.map +0 -1
  120. package/dist/import/csv.d.ts +0 -6
  121. package/dist/import/csv.js +0 -63
  122. package/dist/import/csv.js.map +0 -1
  123. package/dist/import/vendors.d.ts +0 -57
  124. package/dist/import/vendors.js +0 -568
  125. package/dist/import/vendors.js.map +0 -1
  126. package/dist/index.d.ts +0 -32
  127. package/dist/index.js +0 -79
  128. package/dist/index.js.map +0 -1
  129. package/dist/io.d.ts +0 -21
  130. package/dist/io.js +0 -28
  131. package/dist/io.js.map +0 -1
  132. package/dist/migrate/appwrite/plugin.d.ts +0 -2
  133. package/dist/migrate/appwrite/plugin.js +0 -103
  134. package/dist/migrate/appwrite/plugin.js.map +0 -1
  135. package/dist/migrate/auth0/plugin.d.ts +0 -2
  136. package/dist/migrate/auth0/plugin.js +0 -126
  137. package/dist/migrate/auth0/plugin.js.map +0 -1
  138. package/dist/migrate/authentik/plugin.d.ts +0 -2
  139. package/dist/migrate/authentik/plugin.js +0 -135
  140. package/dist/migrate/authentik/plugin.js.map +0 -1
  141. package/dist/migrate/azure-ad-b2c/plugin.d.ts +0 -8
  142. package/dist/migrate/azure-ad-b2c/plugin.js +0 -165
  143. package/dist/migrate/azure-ad-b2c/plugin.js.map +0 -1
  144. package/dist/migrate/better-auth/integration.d.ts +0 -59
  145. package/dist/migrate/better-auth/integration.js +0 -81
  146. package/dist/migrate/better-auth/integration.js.map +0 -1
  147. package/dist/migrate/better-auth/orchestrator.d.ts +0 -43
  148. package/dist/migrate/better-auth/orchestrator.js +0 -525
  149. package/dist/migrate/better-auth/orchestrator.js.map +0 -1
  150. package/dist/migrate/better-auth/output.d.ts +0 -20
  151. package/dist/migrate/better-auth/output.js +0 -146
  152. package/dist/migrate/better-auth/output.js.map +0 -1
  153. package/dist/migrate/better-auth/translate.d.ts +0 -77
  154. package/dist/migrate/better-auth/translate.js +0 -1989
  155. package/dist/migrate/better-auth/translate.js.map +0 -1
  156. package/dist/migrate/clerk/plugin.d.ts +0 -2
  157. package/dist/migrate/clerk/plugin.js +0 -76
  158. package/dist/migrate/clerk/plugin.js.map +0 -1
  159. package/dist/migrate/cognito/plugin.d.ts +0 -5
  160. package/dist/migrate/cognito/plugin.js +0 -170
  161. package/dist/migrate/cognito/plugin.js.map +0 -1
  162. package/dist/migrate/corbado/plugin.d.ts +0 -2
  163. package/dist/migrate/corbado/plugin.js +0 -63
  164. package/dist/migrate/corbado/plugin.js.map +0 -1
  165. package/dist/migrate/descope/plugin.d.ts +0 -2
  166. package/dist/migrate/descope/plugin.js +0 -83
  167. package/dist/migrate/descope/plugin.js.map +0 -1
  168. package/dist/migrate/entra-external-id/plugin.d.ts +0 -8
  169. package/dist/migrate/entra-external-id/plugin.js +0 -12
  170. package/dist/migrate/entra-external-id/plugin.js.map +0 -1
  171. package/dist/migrate/export/appwrite-config.d.ts +0 -28
  172. package/dist/migrate/export/appwrite-config.js +0 -170
  173. package/dist/migrate/export/appwrite-config.js.map +0 -1
  174. package/dist/migrate/export/appwrite.d.ts +0 -51
  175. package/dist/migrate/export/appwrite.js +0 -288
  176. package/dist/migrate/export/appwrite.js.map +0 -1
  177. package/dist/migrate/export/auth0-config.d.ts +0 -29
  178. package/dist/migrate/export/auth0-config.js +0 -249
  179. package/dist/migrate/export/auth0-config.js.map +0 -1
  180. package/dist/migrate/export/auth0.d.ts +0 -62
  181. package/dist/migrate/export/auth0.js +0 -575
  182. package/dist/migrate/export/auth0.js.map +0 -1
  183. package/dist/migrate/export/authentik-config.d.ts +0 -45
  184. package/dist/migrate/export/authentik-config.js +0 -357
  185. package/dist/migrate/export/authentik-config.js.map +0 -1
  186. package/dist/migrate/export/authentik.d.ts +0 -110
  187. package/dist/migrate/export/authentik.js +0 -838
  188. package/dist/migrate/export/authentik.js.map +0 -1
  189. package/dist/migrate/export/azure-config.d.ts +0 -58
  190. package/dist/migrate/export/azure-config.js +0 -344
  191. package/dist/migrate/export/azure-config.js.map +0 -1
  192. package/dist/migrate/export/azure.d.ts +0 -85
  193. package/dist/migrate/export/azure.js +0 -373
  194. package/dist/migrate/export/azure.js.map +0 -1
  195. package/dist/migrate/export/clerk-config.d.ts +0 -26
  196. package/dist/migrate/export/clerk-config.js +0 -227
  197. package/dist/migrate/export/clerk-config.js.map +0 -1
  198. package/dist/migrate/export/clerk.d.ts +0 -46
  199. package/dist/migrate/export/clerk.js +0 -486
  200. package/dist/migrate/export/clerk.js.map +0 -1
  201. package/dist/migrate/export/cognito-config.d.ts +0 -25
  202. package/dist/migrate/export/cognito-config.js +0 -273
  203. package/dist/migrate/export/cognito-config.js.map +0 -1
  204. package/dist/migrate/export/cognito.d.ts +0 -103
  205. package/dist/migrate/export/cognito.js +0 -441
  206. package/dist/migrate/export/cognito.js.map +0 -1
  207. package/dist/migrate/export/corbado-config.d.ts +0 -20
  208. package/dist/migrate/export/corbado-config.js +0 -63
  209. package/dist/migrate/export/corbado-config.js.map +0 -1
  210. package/dist/migrate/export/corbado.d.ts +0 -37
  211. package/dist/migrate/export/corbado.js +0 -132
  212. package/dist/migrate/export/corbado.js.map +0 -1
  213. package/dist/migrate/export/descope.d.ts +0 -35
  214. package/dist/migrate/export/descope.js +0 -208
  215. package/dist/migrate/export/descope.js.map +0 -1
  216. package/dist/migrate/export/fake-vendor.test-helper.d.ts +0 -27
  217. package/dist/migrate/export/fake-vendor.test-helper.js +0 -41
  218. package/dist/migrate/export/fake-vendor.test-helper.js.map +0 -1
  219. package/dist/migrate/export/firebase-config.d.ts +0 -24
  220. package/dist/migrate/export/firebase-config.js +0 -215
  221. package/dist/migrate/export/firebase-config.js.map +0 -1
  222. package/dist/migrate/export/firebase.d.ts +0 -102
  223. package/dist/migrate/export/firebase.js +0 -464
  224. package/dist/migrate/export/firebase.js.map +0 -1
  225. package/dist/migrate/export/frameworks/app-users.d.ts +0 -42
  226. package/dist/migrate/export/frameworks/app-users.js +0 -161
  227. package/dist/migrate/export/frameworks/app-users.js.map +0 -1
  228. package/dist/migrate/export/frameworks/authjs.d.ts +0 -41
  229. package/dist/migrate/export/frameworks/authjs.js +0 -146
  230. package/dist/migrate/export/frameworks/authjs.js.map +0 -1
  231. package/dist/migrate/export/frameworks/devise.d.ts +0 -39
  232. package/dist/migrate/export/frameworks/devise.js +0 -218
  233. package/dist/migrate/export/frameworks/devise.js.map +0 -1
  234. package/dist/migrate/export/frameworks/django.d.ts +0 -45
  235. package/dist/migrate/export/frameworks/django.js +0 -315
  236. package/dist/migrate/export/frameworks/django.js.map +0 -1
  237. package/dist/migrate/export/frameworks/lucia.d.ts +0 -42
  238. package/dist/migrate/export/frameworks/lucia.js +0 -263
  239. package/dist/migrate/export/frameworks/lucia.js.map +0 -1
  240. package/dist/migrate/export/frameworks/tables.d.ts +0 -90
  241. package/dist/migrate/export/frameworks/tables.js +0 -325
  242. package/dist/migrate/export/frameworks/tables.js.map +0 -1
  243. package/dist/migrate/export/frameworks/webauthn.d.ts +0 -25
  244. package/dist/migrate/export/frameworks/webauthn.js +0 -130
  245. package/dist/migrate/export/frameworks/webauthn.js.map +0 -1
  246. package/dist/migrate/export/frontegg-config.d.ts +0 -29
  247. package/dist/migrate/export/frontegg-config.js +0 -238
  248. package/dist/migrate/export/frontegg-config.js.map +0 -1
  249. package/dist/migrate/export/frontegg.d.ts +0 -67
  250. package/dist/migrate/export/frontegg.js +0 -410
  251. package/dist/migrate/export/frontegg.js.map +0 -1
  252. package/dist/migrate/export/fusionauth-config.d.ts +0 -26
  253. package/dist/migrate/export/fusionauth-config.js +0 -226
  254. package/dist/migrate/export/fusionauth-config.js.map +0 -1
  255. package/dist/migrate/export/fusionauth.d.ts +0 -99
  256. package/dist/migrate/export/fusionauth.js +0 -642
  257. package/dist/migrate/export/fusionauth.js.map +0 -1
  258. package/dist/migrate/export/hanko-config.d.ts +0 -27
  259. package/dist/migrate/export/hanko-config.js +0 -265
  260. package/dist/migrate/export/hanko-config.js.map +0 -1
  261. package/dist/migrate/export/hanko.d.ts +0 -52
  262. package/dist/migrate/export/hanko.js +0 -605
  263. package/dist/migrate/export/hanko.js.map +0 -1
  264. package/dist/migrate/export/keycloak-config.d.ts +0 -19
  265. package/dist/migrate/export/keycloak-config.js +0 -219
  266. package/dist/migrate/export/keycloak-config.js.map +0 -1
  267. package/dist/migrate/export/keycloak.d.ts +0 -155
  268. package/dist/migrate/export/keycloak.js +0 -878
  269. package/dist/migrate/export/keycloak.js.map +0 -1
  270. package/dist/migrate/export/kinde-descope-config.d.ts +0 -38
  271. package/dist/migrate/export/kinde-descope-config.js +0 -172
  272. package/dist/migrate/export/kinde-descope-config.js.map +0 -1
  273. package/dist/migrate/export/kinde.d.ts +0 -57
  274. package/dist/migrate/export/kinde.js +0 -333
  275. package/dist/migrate/export/kinde.js.map +0 -1
  276. package/dist/migrate/export/ldap.d.ts +0 -53
  277. package/dist/migrate/export/ldap.js +0 -277
  278. package/dist/migrate/export/ldap.js.map +0 -1
  279. package/dist/migrate/export/logto-config.d.ts +0 -27
  280. package/dist/migrate/export/logto-config.js +0 -264
  281. package/dist/migrate/export/logto-config.js.map +0 -1
  282. package/dist/migrate/export/logto.d.ts +0 -150
  283. package/dist/migrate/export/logto.js +0 -809
  284. package/dist/migrate/export/logto.js.map +0 -1
  285. package/dist/migrate/export/magic-config.d.ts +0 -14
  286. package/dist/migrate/export/magic-config.js +0 -28
  287. package/dist/migrate/export/magic-config.js.map +0 -1
  288. package/dist/migrate/export/magic.d.ts +0 -31
  289. package/dist/migrate/export/magic.js +0 -93
  290. package/dist/migrate/export/magic.js.map +0 -1
  291. package/dist/migrate/export/mini-yaml.d.ts +0 -19
  292. package/dist/migrate/export/mini-yaml.js +0 -581
  293. package/dist/migrate/export/mini-yaml.js.map +0 -1
  294. package/dist/migrate/export/nhost-config.d.ts +0 -26
  295. package/dist/migrate/export/nhost-config.js +0 -360
  296. package/dist/migrate/export/nhost-config.js.map +0 -1
  297. package/dist/migrate/export/nhost.d.ts +0 -64
  298. package/dist/migrate/export/nhost.js +0 -304
  299. package/dist/migrate/export/nhost.js.map +0 -1
  300. package/dist/migrate/export/okta-config.d.ts +0 -30
  301. package/dist/migrate/export/okta-config.js +0 -205
  302. package/dist/migrate/export/okta-config.js.map +0 -1
  303. package/dist/migrate/export/okta.d.ts +0 -43
  304. package/dist/migrate/export/okta.js +0 -337
  305. package/dist/migrate/export/okta.js.map +0 -1
  306. package/dist/migrate/export/onelogin.d.ts +0 -22
  307. package/dist/migrate/export/onelogin.js +0 -123
  308. package/dist/migrate/export/onelogin.js.map +0 -1
  309. package/dist/migrate/export/ory-config.d.ts +0 -58
  310. package/dist/migrate/export/ory-config.js +0 -451
  311. package/dist/migrate/export/ory-config.js.map +0 -1
  312. package/dist/migrate/export/ory.d.ts +0 -81
  313. package/dist/migrate/export/ory.js +0 -555
  314. package/dist/migrate/export/ory.js.map +0 -1
  315. package/dist/migrate/export/password-detect.d.ts +0 -29
  316. package/dist/migrate/export/password-detect.js +0 -81
  317. package/dist/migrate/export/password-detect.js.map +0 -1
  318. package/dist/migrate/export/pingone.d.ts +0 -36
  319. package/dist/migrate/export/pingone.js +0 -218
  320. package/dist/migrate/export/pingone.js.map +0 -1
  321. package/dist/migrate/export/plugin-kit.d.ts +0 -25
  322. package/dist/migrate/export/plugin-kit.js +0 -82
  323. package/dist/migrate/export/plugin-kit.js.map +0 -1
  324. package/dist/migrate/export/pocketbase-config.d.ts +0 -28
  325. package/dist/migrate/export/pocketbase-config.js +0 -180
  326. package/dist/migrate/export/pocketbase-config.js.map +0 -1
  327. package/dist/migrate/export/pocketbase.d.ts +0 -52
  328. package/dist/migrate/export/pocketbase.js +0 -243
  329. package/dist/migrate/export/pocketbase.js.map +0 -1
  330. package/dist/migrate/export/project-files.d.ts +0 -15
  331. package/dist/migrate/export/project-files.js +0 -43
  332. package/dist/migrate/export/project-files.js.map +0 -1
  333. package/dist/migrate/export/propelauth-config.d.ts +0 -18
  334. package/dist/migrate/export/propelauth-config.js +0 -58
  335. package/dist/migrate/export/propelauth-config.js.map +0 -1
  336. package/dist/migrate/export/propelauth-harness.test-helper.d.ts +0 -62
  337. package/dist/migrate/export/propelauth-harness.test-helper.js +0 -109
  338. package/dist/migrate/export/propelauth-harness.test-helper.js.map +0 -1
  339. package/dist/migrate/export/propelauth.d.ts +0 -48
  340. package/dist/migrate/export/propelauth.js +0 -255
  341. package/dist/migrate/export/propelauth.js.map +0 -1
  342. package/dist/migrate/export/record-set.d.ts +0 -44
  343. package/dist/migrate/export/record-set.js +0 -98
  344. package/dist/migrate/export/record-set.js.map +0 -1
  345. package/dist/migrate/export/source-lines.d.ts +0 -17
  346. package/dist/migrate/export/source-lines.js +0 -43
  347. package/dist/migrate/export/source-lines.js.map +0 -1
  348. package/dist/migrate/export/sso-metadata.d.ts +0 -47
  349. package/dist/migrate/export/sso-metadata.js +0 -180
  350. package/dist/migrate/export/sso-metadata.js.map +0 -1
  351. package/dist/migrate/export/stytch-config.d.ts +0 -22
  352. package/dist/migrate/export/stytch-config.js +0 -102
  353. package/dist/migrate/export/stytch-config.js.map +0 -1
  354. package/dist/migrate/export/stytch.d.ts +0 -68
  355. package/dist/migrate/export/stytch.js +0 -510
  356. package/dist/migrate/export/stytch.js.map +0 -1
  357. package/dist/migrate/export/supabase-config.d.ts +0 -48
  358. package/dist/migrate/export/supabase-config.js +0 -408
  359. package/dist/migrate/export/supabase-config.js.map +0 -1
  360. package/dist/migrate/export/supabase.d.ts +0 -86
  361. package/dist/migrate/export/supabase.js +0 -524
  362. package/dist/migrate/export/supabase.js.map +0 -1
  363. package/dist/migrate/export/supertokens-config.d.ts +0 -20
  364. package/dist/migrate/export/supertokens-config.js +0 -150
  365. package/dist/migrate/export/supertokens-config.js.map +0 -1
  366. package/dist/migrate/export/supertokens.d.ts +0 -125
  367. package/dist/migrate/export/supertokens.js +0 -464
  368. package/dist/migrate/export/supertokens.js.map +0 -1
  369. package/dist/migrate/export/table.d.ts +0 -35
  370. package/dist/migrate/export/table.js +0 -248
  371. package/dist/migrate/export/table.js.map +0 -1
  372. package/dist/migrate/export/translate-kit.d.ts +0 -46
  373. package/dist/migrate/export/translate-kit.js +0 -148
  374. package/dist/migrate/export/translate-kit.js.map +0 -1
  375. package/dist/migrate/export/userfront-config.d.ts +0 -15
  376. package/dist/migrate/export/userfront-config.js +0 -49
  377. package/dist/migrate/export/userfront-config.js.map +0 -1
  378. package/dist/migrate/export/userfront.d.ts +0 -38
  379. package/dist/migrate/export/userfront.js +0 -189
  380. package/dist/migrate/export/userfront.js.map +0 -1
  381. package/dist/migrate/export/vendor-http.d.ts +0 -46
  382. package/dist/migrate/export/vendor-http.js +0 -138
  383. package/dist/migrate/export/vendor-http.js.map +0 -1
  384. package/dist/migrate/export/workos-config.d.ts +0 -23
  385. package/dist/migrate/export/workos-config.js +0 -125
  386. package/dist/migrate/export/workos-config.js.map +0 -1
  387. package/dist/migrate/export/workos.d.ts +0 -46
  388. package/dist/migrate/export/workos.js +0 -272
  389. package/dist/migrate/export/workos.js.map +0 -1
  390. package/dist/migrate/export/zip.d.ts +0 -8
  391. package/dist/migrate/export/zip.js +0 -66
  392. package/dist/migrate/export/zip.js.map +0 -1
  393. package/dist/migrate/export/zitadel-config.d.ts +0 -37
  394. package/dist/migrate/export/zitadel-config.js +0 -279
  395. package/dist/migrate/export/zitadel-config.js.map +0 -1
  396. package/dist/migrate/export/zitadel.d.ts +0 -82
  397. package/dist/migrate/export/zitadel.js +0 -447
  398. package/dist/migrate/export/zitadel.js.map +0 -1
  399. package/dist/migrate/firebase/plugin.d.ts +0 -2
  400. package/dist/migrate/firebase/plugin.js +0 -152
  401. package/dist/migrate/firebase/plugin.js.map +0 -1
  402. package/dist/migrate/framework/builtins.d.ts +0 -2
  403. package/dist/migrate/framework/builtins.js +0 -52
  404. package/dist/migrate/framework/builtins.js.map +0 -1
  405. package/dist/migrate/framework/commands.d.ts +0 -20
  406. package/dist/migrate/framework/commands.js +0 -58
  407. package/dist/migrate/framework/commands.js.map +0 -1
  408. package/dist/migrate/framework/custom.d.ts +0 -12
  409. package/dist/migrate/framework/custom.js +0 -96
  410. package/dist/migrate/framework/custom.js.map +0 -1
  411. package/dist/migrate/framework/orchestrator.d.ts +0 -113
  412. package/dist/migrate/framework/orchestrator.js +0 -532
  413. package/dist/migrate/framework/orchestrator.js.map +0 -1
  414. package/dist/migrate/framework/plugin.d.ts +0 -167
  415. package/dist/migrate/framework/plugin.js +0 -3
  416. package/dist/migrate/framework/plugin.js.map +0 -1
  417. package/dist/migrate/framework/registry.d.ts +0 -11
  418. package/dist/migrate/framework/registry.js +0 -44
  419. package/dist/migrate/framework/registry.js.map +0 -1
  420. package/dist/migrate/framework/report.d.ts +0 -17
  421. package/dist/migrate/framework/report.js +0 -103
  422. package/dist/migrate/framework/report.js.map +0 -1
  423. package/dist/migrate/frameworks/plugins.d.ts +0 -29
  424. package/dist/migrate/frameworks/plugins.js +0 -402
  425. package/dist/migrate/frameworks/plugins.js.map +0 -1
  426. package/dist/migrate/frameworks/report.d.ts +0 -92
  427. package/dist/migrate/frameworks/report.js +0 -207
  428. package/dist/migrate/frameworks/report.js.map +0 -1
  429. package/dist/migrate/frameworks/translate-js.d.ts +0 -5
  430. package/dist/migrate/frameworks/translate-js.js +0 -503
  431. package/dist/migrate/frameworks/translate-js.js.map +0 -1
  432. package/dist/migrate/frameworks/translate-rails-django.d.ts +0 -3
  433. package/dist/migrate/frameworks/translate-rails-django.js +0 -1391
  434. package/dist/migrate/frameworks/translate-rails-django.js.map +0 -1
  435. package/dist/migrate/frontegg/plugin.d.ts +0 -2
  436. package/dist/migrate/frontegg/plugin.js +0 -78
  437. package/dist/migrate/frontegg/plugin.js.map +0 -1
  438. package/dist/migrate/fusionauth/plugin.d.ts +0 -2
  439. package/dist/migrate/fusionauth/plugin.js +0 -109
  440. package/dist/migrate/fusionauth/plugin.js.map +0 -1
  441. package/dist/migrate/hanko/plugin.d.ts +0 -2
  442. package/dist/migrate/hanko/plugin.js +0 -100
  443. package/dist/migrate/hanko/plugin.js.map +0 -1
  444. package/dist/migrate/keycloak/plugin.d.ts +0 -2
  445. package/dist/migrate/keycloak/plugin.js +0 -148
  446. package/dist/migrate/keycloak/plugin.js.map +0 -1
  447. package/dist/migrate/kinde/plugin.d.ts +0 -2
  448. package/dist/migrate/kinde/plugin.js +0 -105
  449. package/dist/migrate/kinde/plugin.js.map +0 -1
  450. package/dist/migrate/ldap/plugin.d.ts +0 -2
  451. package/dist/migrate/ldap/plugin.js +0 -73
  452. package/dist/migrate/ldap/plugin.js.map +0 -1
  453. package/dist/migrate/logto/plugin.d.ts +0 -2
  454. package/dist/migrate/logto/plugin.js +0 -131
  455. package/dist/migrate/logto/plugin.js.map +0 -1
  456. package/dist/migrate/magic/plugin.d.ts +0 -2
  457. package/dist/migrate/magic/plugin.js +0 -56
  458. package/dist/migrate/magic/plugin.js.map +0 -1
  459. package/dist/migrate/nhost/plugin.d.ts +0 -2
  460. package/dist/migrate/nhost/plugin.js +0 -115
  461. package/dist/migrate/nhost/plugin.js.map +0 -1
  462. package/dist/migrate/oidc/plugin.d.ts +0 -2
  463. package/dist/migrate/oidc/plugin.js +0 -73
  464. package/dist/migrate/oidc/plugin.js.map +0 -1
  465. package/dist/migrate/okta/plugin.d.ts +0 -2
  466. package/dist/migrate/okta/plugin.js +0 -105
  467. package/dist/migrate/okta/plugin.js.map +0 -1
  468. package/dist/migrate/onelogin/plugin.d.ts +0 -2
  469. package/dist/migrate/onelogin/plugin.js +0 -61
  470. package/dist/migrate/onelogin/plugin.js.map +0 -1
  471. package/dist/migrate/ory/plugin.d.ts +0 -2
  472. package/dist/migrate/ory/plugin.js +0 -186
  473. package/dist/migrate/ory/plugin.js.map +0 -1
  474. package/dist/migrate/ping-identity/plugin.d.ts +0 -2
  475. package/dist/migrate/ping-identity/plugin.js +0 -100
  476. package/dist/migrate/ping-identity/plugin.js.map +0 -1
  477. package/dist/migrate/pocketbase/plugin.d.ts +0 -2
  478. package/dist/migrate/pocketbase/plugin.js +0 -99
  479. package/dist/migrate/pocketbase/plugin.js.map +0 -1
  480. package/dist/migrate/propelauth/plugin.d.ts +0 -2
  481. package/dist/migrate/propelauth/plugin.js +0 -65
  482. package/dist/migrate/propelauth/plugin.js.map +0 -1
  483. package/dist/migrate/saml/plugin.d.ts +0 -2
  484. package/dist/migrate/saml/plugin.js +0 -79
  485. package/dist/migrate/saml/plugin.js.map +0 -1
  486. package/dist/migrate/stytch/plugin.d.ts +0 -2
  487. package/dist/migrate/stytch/plugin.js +0 -97
  488. package/dist/migrate/stytch/plugin.js.map +0 -1
  489. package/dist/migrate/supabase/plugin.d.ts +0 -2
  490. package/dist/migrate/supabase/plugin.js +0 -149
  491. package/dist/migrate/supabase/plugin.js.map +0 -1
  492. package/dist/migrate/supertokens/plugin.d.ts +0 -2
  493. package/dist/migrate/supertokens/plugin.js +0 -114
  494. package/dist/migrate/supertokens/plugin.js.map +0 -1
  495. package/dist/migrate/user-table/plugin.d.ts +0 -2
  496. package/dist/migrate/user-table/plugin.js +0 -62
  497. package/dist/migrate/user-table/plugin.js.map +0 -1
  498. package/dist/migrate/userfront/plugin.d.ts +0 -2
  499. package/dist/migrate/userfront/plugin.js +0 -60
  500. package/dist/migrate/userfront/plugin.js.map +0 -1
  501. package/dist/migrate/workos/plugin.d.ts +0 -2
  502. package/dist/migrate/workos/plugin.js +0 -81
  503. package/dist/migrate/workos/plugin.js.map +0 -1
  504. package/dist/migrate/zitadel/plugin.d.ts +0 -2
  505. package/dist/migrate/zitadel/plugin.js +0 -114
  506. package/dist/migrate/zitadel/plugin.js.map +0 -1
  507. package/dist/output.d.ts +0 -41
  508. package/dist/output.js +0 -72
  509. package/dist/output.js.map +0 -1
  510. package/dist/project.d.ts +0 -64
  511. package/dist/project.js +0 -86
  512. package/dist/project.js.map +0 -1
  513. package/dist/prompt.d.ts +0 -15
  514. package/dist/prompt.js +0 -46
  515. package/dist/prompt.js.map +0 -1
  516. package/dist/run.d.ts +0 -12
  517. package/dist/run.js +0 -157
  518. package/dist/run.js.map +0 -1
  519. package/dist/secrets.d.ts +0 -41
  520. package/dist/secrets.js +0 -142
  521. package/dist/secrets.js.map +0 -1
  522. package/dist/serialize.d.ts +0 -30
  523. package/dist/serialize.js +0 -131
  524. package/dist/serialize.js.map +0 -1
  525. package/dist/version.d.ts +0 -7
  526. package/dist/version.js +0 -21
  527. package/dist/version.js.map +0 -1
@@ -1,605 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hankoPasswordHash = hankoPasswordHash;
4
- exports.exportHankoTables = exportHankoTables;
5
- exports.exportHankoApi = exportHankoApi;
6
- const tables_1 = require("./frameworks/tables");
7
- const record_set_1 = require("./record-set");
8
- const vendor_http_1 = require("./vendor-http");
9
- /** Hanko's built-in third-party providers (`third_party.providers.<name>`); `custom_<key>` are custom OIDC providers. */
10
- const BUILT_IN_PROVIDERS = new Set(['apple', 'discord', 'facebook', 'github', 'google', 'linkedin', 'microsoft']);
11
- /** Hanko's TOTP parameters (flow_api/services/totp.go: pquerna/otp defaults, not configurable). */
12
- const TOTP = { digits: 6, period: 30, algorithm: 'SHA1' };
13
- const NO_PASSKEY_RP = 'Passkeys were left out: pass the relying-party id they were registered for (--set hanko-rp-id=<webauthn.relying_party.id>, e.g. example.com).';
14
- const MFA_ONLY_NOTE = (n) => `${n} WebAuthn credential(s) were Hanko security keys used only as a second factor (mfa_only). They move as passkeys bound to the same relying-party id; Atlas can also accept them as a first factor.`;
15
- // ── password hashes ─────────────────────────────────────────────────────────
16
- /**
17
- * Hanko's own Firebase-scrypt import format (flow_api/services/password.go,
18
- * after Supabase's): `$fbscrypt$v=1,n=<mem cost>,r=<rounds>,p=<parallelism>,ss=<salt
19
- * separator>,sk=<signer key>$<salt>$<hash>`, every value standard base64.
20
- */
21
- const FBSCRYPT = /^\$fbscrypt\$v=(\d+),n=(\d+),r=(\d+),p=(\d+)(?:,ss=([^,$]+))?(?:,sk=([^$]+))?\$([^$]+)\$(.+)$/;
22
- /** A Hanko `password_credentials.password` as a bundle password; null when Atlas cannot verify it. */
23
- function hankoPasswordHash(raw) {
24
- const digest = (0, tables_1.text)(raw);
25
- if (!digest)
26
- return null;
27
- if (/^\$2[aby]\$\d{2}\$[./A-Za-z0-9]{53}$/.test(digest))
28
- return { algorithm: 'bcrypt', hash: digest };
29
- const m = FBSCRYPT.exec(digest);
30
- // Atlas's scrypt_firebase verifier is Firebase's own construction: version 1, p = 1.
31
- if (!m || m[1] !== '1' || m[4] !== '1' || !m[6])
32
- return null;
33
- return {
34
- algorithm: 'scrypt_firebase',
35
- hash: m[8],
36
- salt: m[7],
37
- params: { rounds: Number(m[3]), mem_cost: Number(m[2]), salt_separator: m[5] ?? '', signer_key: m[6] },
38
- };
39
- }
40
- // ── shared mapping ──────────────────────────────────────────────────────────
41
- /** Base64url bytes as Hanko stores them (raw URL encoding); other encodings are normalised. */
42
- function b64u(v) {
43
- const s = (0, tables_1.text)(v);
44
- if (!s)
45
- return undefined;
46
- return /^[A-Za-z0-9_-]+$/.test(s) ? s : (0, tables_1.base64url)(s);
47
- }
48
- const ZERO_AAGUID = '00000000-0000-0000-0000-000000000000';
49
- function passkey(o) {
50
- const credentialId = b64u(o.id);
51
- const publicKey = b64u(o.publicKey);
52
- if (!credentialId || !publicKey)
53
- return null;
54
- const aaguid = (0, tables_1.text)(o.aaguid);
55
- const count = Number(o.signCount);
56
- return (0, record_set_1.compact)({
57
- id: credentialId,
58
- user_id: o.userId,
59
- credential_id: credentialId,
60
- public_key: publicKey,
61
- sign_count: Number.isFinite(count) && count > 0 ? count : undefined,
62
- rp_id: o.rpId,
63
- transports: o.transports,
64
- aaguid: aaguid && aaguid !== ZERO_AAGUID ? aaguid : undefined,
65
- backed_up: o.backedUp === undefined ? undefined : (0, tables_1.bool)(o.backedUp),
66
- name: (0, tables_1.text)(o.name),
67
- created_at: (0, tables_1.time)(o.createdAt),
68
- });
69
- }
70
- /** A metadata column / field: a JSON object (or the string Hanko stores), only when it has keys. */
71
- function metadata(v) {
72
- return (0, record_set_1.bag)((0, record_set_1.isObj)(v) ? v : (0, tables_1.json)(v));
73
- }
74
- /** `user_custom_claims.claims` stores `{ name: { value, source } }`; the Admin API returns them flat. */
75
- function customClaims(v, wrapped) {
76
- const o = (0, record_set_1.isObj)(v) ? v : (0, tables_1.json)(v);
77
- if (!o)
78
- return undefined;
79
- if (!wrapped)
80
- return (0, record_set_1.bag)(o);
81
- const flat = {};
82
- for (const [k, c] of Object.entries(o))
83
- flat[k] = (0, record_set_1.isObj)(c) && 'value' in c ? c.value : c;
84
- return (0, record_set_1.bag)(flat);
85
- }
86
- function privateMetadata(priv, claims) {
87
- // Custom claims Hanko put in the session JWT: kept for a JWT template to add back.
88
- return (0, record_set_1.bag)({ ...(priv ?? {}), ...(claims ? { hanko_custom_claims: claims } : {}) });
89
- }
90
- /** A third-party / SAML identity. `provider` is Hanko's provider id (`google`, `custom_<key>`, or a SAML IdP's entity id). */
91
- function identity(o) {
92
- const kind = o.saml ? 'saml' : BUILT_IN_PROVIDERS.has(o.provider) ? 'oauth' : 'oidc';
93
- const verified = o.data?.email_verified;
94
- return (0, record_set_1.compact)({
95
- id: o.id,
96
- user_id: o.userId,
97
- provider: o.provider,
98
- provider_user_id: o.providerUserId,
99
- kind,
100
- sso_connection_id: o.ssoConnectionId,
101
- email: (0, record_set_1.str)(o.data?.email)?.toLowerCase() ?? o.fallbackEmail,
102
- email_verified: verified === undefined ? undefined : verified === true || verified === 'true',
103
- profile: (0, record_set_1.bag)(o.data),
104
- });
105
- }
106
- function sortedEmails(list) {
107
- // Primary first, the rest in the order Hanko had them.
108
- return [...list.filter((e) => e.primary), ...list.filter((e) => !e.primary)];
109
- }
110
- /** A Hanko user with neither an email nor a username cannot be imported (nothing to sign in with). */
111
- const NO_IDENTIFIER = 'Hanko user without an email address or username';
112
- function membershipRole(slugs, set) {
113
- const sorted = [...new Set(slugs)].sort();
114
- if (sorted.length > 1)
115
- set.warn('Some memberships carry more than one Hanko role: Atlas keeps one role per membership (the first by slug); grant the others again in Atlas.');
116
- return sorted[0] ?? 'member';
117
- }
118
- // ── the database dump ───────────────────────────────────────────────────────
119
- /** Read a Hanko database dump (pure). */
120
- function exportHankoTables(tables, opts = {}) {
121
- const set = new record_set_1.RecordSet();
122
- const tenant = pickTenant(tables, opts.tenantId);
123
- const rows = (...names) => tables.rows(...names).filter((r) => !tenant || !(0, tables_1.text)((0, tables_1.col)(r, 'tenant_id')) || (0, tables_1.text)((0, tables_1.col)(r, 'tenant_id')) === tenant);
124
- const by = (list, key, value) => {
125
- const out = new Map();
126
- for (const r of list) {
127
- const k = (0, tables_1.text)((0, tables_1.col)(r, key));
128
- const v = value(r);
129
- if (!k || v === undefined)
130
- continue;
131
- out.set(k, [...(out.get(k) ?? []), v]);
132
- }
133
- return out;
134
- };
135
- const userRows = rows('users');
136
- if (!userRows.length)
137
- throw new Error('No users table in the dump (expected users.json / users.ndjson / users.csv from the Hanko database).');
138
- // users.id is internal; the JWT `sub` (and every Admin API id) is public_id, equal to id unless set on creation.
139
- const publicId = new Map();
140
- for (const u of userRows) {
141
- const id = (0, tables_1.text)((0, tables_1.col)(u, 'id'));
142
- if (id)
143
- publicId.set(id, (0, tables_1.text)((0, tables_1.col)(u, 'public_id')) ?? id);
144
- }
145
- const primaries = new Set(rows('primary_emails').map((r) => (0, tables_1.text)((0, tables_1.col)(r, 'email_id'))).filter((v) => !!v));
146
- const emailRows = rows('emails');
147
- const emailById = new Map();
148
- for (const e of emailRows) {
149
- const id = (0, tables_1.text)((0, tables_1.col)(e, 'id'));
150
- const address = (0, tables_1.text)((0, tables_1.col)(e, 'address'));
151
- if (id && address)
152
- emailById.set(id, { address: address.toLowerCase(), userId: (0, tables_1.text)((0, tables_1.col)(e, 'user_id')) });
153
- }
154
- const emailsOf = by(emailRows, 'user_id', (e) => {
155
- const address = (0, tables_1.text)((0, tables_1.col)(e, 'address'));
156
- return address ? { email: address.toLowerCase(), verified: (0, tables_1.bool)((0, tables_1.col)(e, 'verified')), primary: primaries.has((0, tables_1.text)((0, tables_1.col)(e, 'id')) ?? '') } : undefined;
157
- });
158
- const usernameOf = new Map();
159
- for (const r of rows('usernames')) {
160
- const userId = (0, tables_1.text)((0, tables_1.col)(r, 'user_id'));
161
- const username = (0, tables_1.text)((0, tables_1.col)(r, 'username'));
162
- if (userId && username)
163
- usernameOf.set(userId, username);
164
- }
165
- const passwordOf = new Map();
166
- for (const r of rows('password_credentials')) {
167
- const userId = (0, tables_1.text)((0, tables_1.col)(r, 'user_id'));
168
- if (userId)
169
- passwordOf.set(userId, (0, tables_1.col)(r, 'password'));
170
- }
171
- const metadataOf = new Map();
172
- for (const r of rows('user_metadata')) {
173
- const userId = (0, tables_1.text)((0, tables_1.col)(r, 'user_id'));
174
- if (userId)
175
- metadataOf.set(userId, r);
176
- }
177
- const claimsOf = new Map();
178
- for (const r of rows('user_custom_claims')) {
179
- const userId = (0, tables_1.text)((0, tables_1.col)(r, 'user_id'));
180
- const claims = customClaims((0, tables_1.col)(r, 'claims'), true);
181
- if (userId && claims)
182
- claimsOf.set(userId, claims);
183
- }
184
- // ── users ──
185
- const exported = new Map(); // internal id → exported (public) id
186
- let unsupportedHashes = 0;
187
- for (const u of userRows) {
188
- const id = (0, tables_1.text)((0, tables_1.col)(u, 'id'));
189
- if (!id)
190
- continue;
191
- const pub = publicId.get(id);
192
- let emails = sortedEmails(emailsOf.get(id) ?? []);
193
- // Hanko before late 2022 kept one address on the user row.
194
- const legacyEmail = (0, tables_1.text)((0, tables_1.col)(u, 'email'));
195
- if (!emails.length && legacyEmail)
196
- emails = [{ email: legacyEmail.toLowerCase(), verified: (0, tables_1.bool)((0, tables_1.col)(u, 'verified')), primary: true }];
197
- if (emails.length && !emails.some((e) => e.primary))
198
- emails[0] = { ...emails[0], primary: true };
199
- const username = usernameOf.get(id) ?? (0, tables_1.text)((0, tables_1.col)(u, 'username'));
200
- if (!emails.length && !username) {
201
- set.omit('user', NO_IDENTIFIER);
202
- continue;
203
- }
204
- let password;
205
- if (passwordOf.has(id)) {
206
- password = hankoPasswordHash(passwordOf.get(id)) ?? undefined;
207
- if (!password)
208
- unsupportedHashes++;
209
- }
210
- const meta = metadataOf.get(id);
211
- set.add('user', (0, record_set_1.compact)({
212
- id: pub,
213
- emails,
214
- username,
215
- first_name: (0, tables_1.text)((0, tables_1.col)(u, 'given_name')),
216
- last_name: (0, tables_1.text)((0, tables_1.col)(u, 'family_name')),
217
- name: (0, tables_1.text)((0, tables_1.col)(u, 'name')),
218
- image_url: (0, tables_1.text)((0, tables_1.col)(u, 'picture')),
219
- password,
220
- public_metadata: meta ? metadata((0, tables_1.col)(meta, 'public_metadata')) : undefined,
221
- private_metadata: privateMetadata(meta ? metadata((0, tables_1.col)(meta, 'private_metadata')) : undefined, claimsOf.get(id)),
222
- unsafe_metadata: meta ? metadata((0, tables_1.col)(meta, 'unsafe_metadata')) : undefined,
223
- created_at: (0, tables_1.time)((0, tables_1.col)(u, 'created_at')),
224
- }), pub);
225
- exported.set(id, pub);
226
- }
227
- if (unsupportedHashes) {
228
- set.warn(`${unsupportedHashes} password hash(es) are in a format Atlas cannot verify: those users sign in once through the hanko lazy-migration preset (or reset their password).`);
229
- }
230
- const owner = (internal) => (internal ? exported.get(internal) : undefined);
231
- // ── SAML providers (Hanko ≥ 2.x keeps them in the database; config.yaml ones are synthesised below) ──
232
- const metadataByProvider = new Map();
233
- for (const m of rows('saml_idp_metadata')) {
234
- const pid = (0, tables_1.text)((0, tables_1.col)(m, 'provider_id'));
235
- if (pid)
236
- metadataByProvider.set(pid, m);
237
- }
238
- const connectionByDomain = new Map();
239
- for (const p of rows('saml_providers')) {
240
- const id = (0, tables_1.text)((0, tables_1.col)(p, 'id'));
241
- const domain = (0, tables_1.text)((0, tables_1.col)(p, 'domain'))?.toLowerCase();
242
- if (!id)
243
- continue;
244
- if (domain)
245
- connectionByDomain.set(domain, id);
246
- const md = metadataByProvider.get(id);
247
- const attrs = (0, tables_1.json)((0, tables_1.col)(p, 'attribute_map'));
248
- const mapping = {};
249
- for (const [k, v] of Object.entries(attrs ?? {}))
250
- if (typeof v === 'string' && v)
251
- mapping[k] = v;
252
- set.add('sso_connection', (0, record_set_1.compact)({
253
- id,
254
- name: (0, tables_1.text)((0, tables_1.col)(p, 'name')),
255
- protocol: 'saml',
256
- domains: domain ? [domain] : undefined,
257
- enabled: (0, tables_1.col)(p, 'enabled') === undefined ? undefined : (0, tables_1.bool)((0, tables_1.col)(p, 'enabled')),
258
- saml: (0, record_set_1.compact)({
259
- idp_entity_id: (0, tables_1.text)((0, tables_1.col)(p, 'entity_id')) ?? (md ? (0, tables_1.text)((0, tables_1.col)(md, 'issuer')) : undefined),
260
- idp_metadata_url: (0, tables_1.text)((0, tables_1.col)(p, 'metadata_url')),
261
- idp_metadata_xml: md ? (0, tables_1.text)((0, tables_1.col)(md, 'raw_metadata_xml')) : undefined,
262
- idp_sso_url: md ? (0, tables_1.text)((0, tables_1.col)(md, 'sso_url')) : undefined,
263
- idp_certificate: md ? (0, tables_1.text)((0, tables_1.col)(md, 'certificates_pem')) : undefined,
264
- attribute_mapping: Object.keys(mapping).length ? mapping : undefined,
265
- }),
266
- }), id);
267
- }
268
- // ── identities ──
269
- const samlDomainOf = new Map();
270
- for (const s of rows('saml_identities')) {
271
- const identityId = (0, tables_1.text)((0, tables_1.col)(s, 'identity_id'));
272
- const domain = (0, tables_1.text)((0, tables_1.col)(s, 'domain'))?.toLowerCase();
273
- if (identityId && domain)
274
- samlDomainOf.set(identityId, domain);
275
- }
276
- const providers = new Set();
277
- let synthesized = 0;
278
- for (const r of rows('identities')) {
279
- // Before 2025 the columns were provider_id (the provider's user id) and provider_name.
280
- const legacy = (0, tables_1.col)(r, 'provider_name') !== undefined;
281
- const provider = (0, tables_1.text)((0, tables_1.col)(r, legacy ? 'provider_name' : 'provider_id'));
282
- const providerUserId = (0, tables_1.text)((0, tables_1.col)(r, legacy ? 'provider_id' : 'provider_user_id'));
283
- const emailId = (0, tables_1.text)((0, tables_1.col)(r, 'email_id'));
284
- const user = owner((0, tables_1.text)((0, tables_1.col)(r, 'user_id')) ?? (emailId ? emailById.get(emailId)?.userId : undefined));
285
- if (!provider || !providerUserId || !user) {
286
- set.omit('identity', 'Identity whose user was not exported');
287
- continue;
288
- }
289
- const id = (0, tables_1.text)((0, tables_1.col)(r, 'id'));
290
- const domain = id ? samlDomainOf.get(id) : undefined;
291
- let ssoConnectionId;
292
- if (domain) {
293
- ssoConnectionId = connectionByDomain.get(domain);
294
- if (!ssoConnectionId) {
295
- // A SAML provider configured in config.yaml: the connection is created from what the identity knows.
296
- ssoConnectionId = `saml:${domain}`;
297
- connectionByDomain.set(domain, ssoConnectionId);
298
- set.add('sso_connection', { id: ssoConnectionId, name: domain, protocol: 'saml', domains: [domain], saml: { idp_entity_id: provider } }, ssoConnectionId);
299
- synthesized++;
300
- }
301
- }
302
- else {
303
- providers.add(provider);
304
- }
305
- set.add('identity', identity({
306
- id,
307
- userId: user,
308
- provider,
309
- providerUserId,
310
- data: (0, tables_1.json)((0, tables_1.col)(r, 'data')),
311
- ssoConnectionId,
312
- saml: Boolean(domain),
313
- fallbackEmail: emailId ? emailById.get(emailId)?.address : undefined,
314
- }), `${provider}\u0000${providerUserId}`);
315
- }
316
- if (synthesized) {
317
- set.warn(`${synthesized} SAML connection(s) come from config.yaml (saml.identity_providers) and were created from their users' identities: add each IdP's metadata URL in Atlas (atlas migrate hanko config lists them).`);
318
- }
319
- // ── TOTP ──
320
- for (const r of rows('otp_secrets')) {
321
- const user = owner((0, tables_1.text)((0, tables_1.col)(r, 'user_id')));
322
- const secret = (0, tables_1.text)((0, tables_1.col)(r, 'secret'))?.replace(/=+$/, '').toUpperCase();
323
- if (!user || !secret)
324
- continue;
325
- set.add('mfa_factor', (0, record_set_1.compact)({ id: (0, tables_1.text)((0, tables_1.col)(r, 'id')), user_id: user, type: 'totp', secret_base32: secret, ...TOTP, verified: true, created_at: (0, tables_1.time)((0, tables_1.col)(r, 'created_at')) }));
326
- }
327
- // ── passkeys and security keys ──
328
- const transports = by(rows('webauthn_credential_transports'), 'webauthn_credential_id', (t) => (0, tables_1.text)((0, tables_1.col)(t, 'name')));
329
- const credentials = rows('webauthn_credentials').filter((c) => owner((0, tables_1.text)((0, tables_1.col)(c, 'user_id'))));
330
- if (credentials.length && !opts.rpId) {
331
- set.omit('passkey', 'No relying-party id given (--set hanko-rp-id)', credentials.length);
332
- set.warn(NO_PASSKEY_RP);
333
- }
334
- else if (opts.rpId) {
335
- let mfaOnly = 0;
336
- for (const c of credentials) {
337
- const record = passkey({
338
- id: (0, tables_1.col)(c, 'id'),
339
- userId: owner((0, tables_1.text)((0, tables_1.col)(c, 'user_id'))),
340
- publicKey: (0, tables_1.col)(c, 'public_key'),
341
- rpId: opts.rpId,
342
- signCount: (0, tables_1.col)(c, 'sign_count'),
343
- aaguid: (0, tables_1.col)(c, 'aaguid'),
344
- backedUp: (0, tables_1.col)(c, 'backup_state'),
345
- name: (0, tables_1.col)(c, 'name'),
346
- transports: transports.get((0, tables_1.text)((0, tables_1.col)(c, 'id')) ?? '') ?? [],
347
- createdAt: (0, tables_1.col)(c, 'created_at'),
348
- });
349
- if (!record) {
350
- set.omit('passkey', 'WebAuthn credential without an id or public key');
351
- continue;
352
- }
353
- if ((0, tables_1.bool)((0, tables_1.col)(c, 'mfa_only')))
354
- mfaOnly++;
355
- set.add('passkey', record, record.credential_id);
356
- }
357
- if (mfaOnly)
358
- set.warn(MFA_ONLY_NOTE(mfaOnly));
359
- }
360
- // ── organizations, roles, memberships ──
361
- for (const o of rows('organizations')) {
362
- const id = (0, tables_1.text)((0, tables_1.col)(o, 'id'));
363
- const name = (0, tables_1.text)((0, tables_1.col)(o, 'name'));
364
- if (id && name)
365
- set.add('organization', (0, record_set_1.compact)({ id, name, created_at: (0, tables_1.time)((0, tables_1.col)(o, 'created_at')) }), id);
366
- }
367
- const roleSlug = new Map();
368
- for (const r of rows('roles')) {
369
- const id = (0, tables_1.text)((0, tables_1.col)(r, 'id'));
370
- const slug = (0, tables_1.text)((0, tables_1.col)(r, 'slug'));
371
- if (!id || !slug)
372
- continue;
373
- roleSlug.set(id, slug);
374
- set.add('role', (0, record_set_1.compact)({ key: slug, name: (0, tables_1.text)((0, tables_1.col)(r, 'name')), scope: 'organization' }), slug);
375
- }
376
- const bindings = new Map();
377
- for (const b of rows('role_bindings')) {
378
- const slug = roleSlug.get((0, tables_1.text)((0, tables_1.col)(b, 'role_id')) ?? '');
379
- const key = `${(0, tables_1.text)((0, tables_1.col)(b, 'user_id'))}\u0000${(0, tables_1.text)((0, tables_1.col)(b, 'organization_id'))}`;
380
- if (slug)
381
- bindings.set(key, [...(bindings.get(key) ?? []), slug]);
382
- }
383
- for (const m of rows('organization_memberships')) {
384
- const internal = (0, tables_1.text)((0, tables_1.col)(m, 'user_id'));
385
- const user = owner(internal);
386
- const org = (0, tables_1.text)((0, tables_1.col)(m, 'organization_id'));
387
- if (!user || !org) {
388
- set.omit('membership', 'Membership whose user was not exported');
389
- continue;
390
- }
391
- set.add('membership', (0, record_set_1.compact)({ id: (0, tables_1.text)((0, tables_1.col)(m, 'id')), organization_id: org, user_id: user, role: membershipRole(bindings.get(`${internal}\u0000${org}`) ?? [], set), created_at: (0, tables_1.time)((0, tables_1.col)(m, 'created_at')) }), `${org}\u0000${user}`);
392
- }
393
- // ── what does not move ──
394
- const now = Date.now();
395
- const live = rows('sessions').filter((s) => {
396
- const exp = (0, tables_1.timeMs)((0, tables_1.col)(s, 'expires_at'));
397
- return exp === undefined || exp > now;
398
- }).length;
399
- if (live)
400
- set.omit('session', 'Hanko sessions are JWTs the bridge accepts as they are (hanko preset)', live);
401
- const webhooks = rows('webhooks').length;
402
- if (webhooks)
403
- set.warn(`${webhooks} Hanko webhook(s) in the database: recreate them as Atlas webhooks (the event names differ).`);
404
- set.manifest = (0, record_set_1.compact)({
405
- origin: tenant ? `Hanko database dump (tenant ${tenant})` : 'Hanko database dump',
406
- rpId: opts.rpId,
407
- providers: [...providers].sort(),
408
- settings: (0, record_set_1.compact)({ hanko_tenant_id: tenant, totp: { ...TOTP } }),
409
- });
410
- return set;
411
- }
412
- /** The tenant to export: the one given, the only one in the dump, or an error naming them. */
413
- function pickTenant(tables, given) {
414
- if (given)
415
- return given;
416
- const tenants = new Set(tables.rows('users').map((u) => (0, tables_1.text)((0, tables_1.col)(u, 'tenant_id'))).filter((t) => !!t));
417
- if (tenants.size > 1) {
418
- throw new Error(`The dump holds users of ${tenants.size} Hanko tenants (${[...tenants].sort().join(', ')}): export one at a time with --set hanko-tenant-id=<tenant id>.`);
419
- }
420
- return undefined;
421
- }
422
- // ── the Admin API ───────────────────────────────────────────────────────────
423
- /** Every page of a Hanko admin listing (`?page=&per_page=`; Link / X-Total-Count headers). Null when the endpoint does not exist. */
424
- async function pages(http, path, size, optional) {
425
- const out = [];
426
- for (let page = 1;; page++) {
427
- let res;
428
- try {
429
- res = await http.get(`${path}?page=${page}&per_page=${size}`);
430
- }
431
- catch (err) {
432
- // Older Hanko versions have no organizations / roles.
433
- if (optional && err instanceof vendor_http_1.VendorApiError && err.status === 404)
434
- return null;
435
- throw err;
436
- }
437
- const list = (0, record_set_1.objs)(res.body);
438
- out.push(...list);
439
- const total = Number(res.headers.get('x-total-count'));
440
- if (list.length < size || (Number.isFinite(total) && total > 0 && out.length >= total))
441
- return out;
442
- }
443
- }
444
- /** Read a Hanko project through the Admin API. */
445
- async function exportHankoApi(o) {
446
- const set = new record_set_1.RecordSet();
447
- const progress = o.onProgress ?? (() => undefined);
448
- const size = Math.min(Math.max(o.pageSize ?? 100, 1), 1000);
449
- const http = new vendor_http_1.VendorHttp({
450
- vendor: 'Hanko',
451
- baseUrl: o.adminUrl,
452
- headers: o.apiKey ? { authorization: `Bearer ${o.apiKey}` } : {},
453
- fetchImpl: o.fetchImpl,
454
- sleep: o.sleep,
455
- });
456
- progress('organizations');
457
- for (const org of (await pages(http, '/organizations', size, true)) ?? []) {
458
- const id = (0, record_set_1.str)(org.id);
459
- const name = (0, record_set_1.str)(org.name);
460
- if (id && name)
461
- set.add('organization', (0, record_set_1.compact)({ id, name, created_at: (0, record_set_1.str)(org.created_at) }), id);
462
- }
463
- progress('roles');
464
- for (const role of (await pages(http, '/roles', size, true)) ?? []) {
465
- const slug = (0, record_set_1.str)(role.slug);
466
- if (slug)
467
- set.add('role', (0, record_set_1.compact)({ key: slug, name: (0, record_set_1.str)(role.name), scope: 'organization' }), slug);
468
- }
469
- progress('users');
470
- const listed = (await pages(http, '/users', size, false)) ?? [];
471
- const providers = new Set();
472
- let withPassword = 0;
473
- let withTotp = 0;
474
- let mfaOnly = 0;
475
- let credentialsWithoutRp = 0;
476
- for (const [i, item] of listed.entries()) {
477
- const id = (0, record_set_1.str)(item.id);
478
- if (!id)
479
- continue;
480
- if (i > 0 && i % 100 === 0)
481
- progress(`users (${i}/${listed.length})`);
482
- // The listing has emails, passkeys and username; identities, metadata and names need the user itself.
483
- let u = item;
484
- try {
485
- const { body } = await http.get(`/users/${encodeURIComponent(id)}`);
486
- if ((0, record_set_1.isObj)(body))
487
- u = { ...item, ...body };
488
- }
489
- catch (err) {
490
- if (!(err instanceof vendor_http_1.VendorApiError && err.status === 404))
491
- throw err;
492
- }
493
- const emailById = new Map();
494
- const emails = sortedEmails((0, record_set_1.objs)(u.emails).flatMap((e) => {
495
- const address = (0, record_set_1.str)(e.address)?.toLowerCase();
496
- if (!address)
497
- return [];
498
- if ((0, record_set_1.str)(e.id))
499
- emailById.set((0, record_set_1.str)(e.id), address);
500
- return [{ email: address, verified: e.is_verified === true, primary: e.is_primary === true }];
501
- }));
502
- const named = u.username;
503
- const username = (0, record_set_1.isObj)(named) ? (0, record_set_1.str)(named.username) : (0, record_set_1.str)(named);
504
- if (!emails.length && !username) {
505
- set.omit('user', NO_IDENTIFIER);
506
- continue;
507
- }
508
- if ((0, record_set_1.isObj)(u.password))
509
- withPassword++;
510
- if ((0, record_set_1.isObj)(u.otp))
511
- withTotp++;
512
- const meta = (0, record_set_1.isObj)(u.metadata) ? u.metadata : {};
513
- set.add('user', (0, record_set_1.compact)({
514
- id,
515
- emails,
516
- username,
517
- first_name: (0, record_set_1.str)(u.given_name),
518
- last_name: (0, record_set_1.str)(u.family_name),
519
- name: (0, record_set_1.str)(u.name),
520
- image_url: (0, record_set_1.str)(u.picture),
521
- public_metadata: metadata(meta.public_metadata),
522
- private_metadata: privateMetadata(metadata(meta.private_metadata), customClaims(u.custom_claims, false)),
523
- unsafe_metadata: metadata(meta.unsafe_metadata),
524
- created_at: (0, record_set_1.str)(u.created_at),
525
- }), id);
526
- // The admin DTO names them the other way round: provider_id is the provider's user id, provider_name the provider.
527
- for (const ident of (0, record_set_1.objs)(u.identities)) {
528
- const provider = (0, record_set_1.str)(ident.provider_name);
529
- const providerUserId = (0, record_set_1.str)(ident.provider_id);
530
- if (!provider || !providerUserId)
531
- continue;
532
- const saml = /^(https?:\/\/|urn:)/i.test(provider);
533
- if (!saml)
534
- providers.add(provider);
535
- set.add('identity', identity({ id: (0, record_set_1.str)(ident.id), userId: id, provider, providerUserId, saml, fallbackEmail: emailById.get((0, record_set_1.str)(ident.email_id) ?? '') }), `${provider}\u0000${providerUserId}`);
536
- }
537
- for (const c of (0, record_set_1.objs)(u.webauthn_credentials)) {
538
- if (!o.rpId) {
539
- credentialsWithoutRp++;
540
- continue;
541
- }
542
- const record = passkey({
543
- id: c.id,
544
- userId: id,
545
- publicKey: c.public_key,
546
- rpId: o.rpId,
547
- aaguid: c.aaguid,
548
- backedUp: c.backup_state,
549
- name: c.name,
550
- transports: (0, record_set_1.strs)(c.transports),
551
- createdAt: c.created_at,
552
- });
553
- if (!record) {
554
- set.omit('passkey', 'WebAuthn credential without an id or public key');
555
- continue;
556
- }
557
- if (c.mfa_only === true)
558
- mfaOnly++;
559
- set.add('passkey', record, record.credential_id);
560
- }
561
- for (const org of (0, record_set_1.objs)(u.organizations)) {
562
- const orgId = (0, record_set_1.str)(org.id);
563
- if (!orgId)
564
- continue;
565
- if ((0, record_set_1.str)(org.name))
566
- set.add('organization', { id: orgId, name: (0, record_set_1.str)(org.name) }, orgId);
567
- const roles = (0, record_set_1.objs)(org.roles);
568
- for (const r of roles)
569
- if ((0, record_set_1.str)(r.slug))
570
- set.add('role', (0, record_set_1.compact)({ key: (0, record_set_1.str)(r.slug), name: (0, record_set_1.str)(r.name), scope: 'organization' }), (0, record_set_1.str)(r.slug));
571
- set.add('membership', { organization_id: orgId, user_id: id, role: membershipRole(roles.map((r) => (0, record_set_1.str)(r.slug)).filter((s) => !!s), set) }, `${orgId}\u0000${id}`);
572
- }
573
- }
574
- if (withPassword) {
575
- set.warn(`${withPassword} user(s) have a Hanko password: the Admin API never returns password hashes, so these move by lazy migration (preset hanko) on each user's first Atlas sign-in — or export from the database instead.`);
576
- }
577
- if (withTotp)
578
- set.warn(`${withTotp} user(s) use TOTP: the Admin API never returns TOTP secrets, so they enrol an authenticator again in Atlas (a database dump carries the secrets).`);
579
- if (credentialsWithoutRp) {
580
- set.omit('passkey', 'No relying-party id given (--set hanko-rp-id)', credentialsWithoutRp);
581
- set.warn(NO_PASSKEY_RP);
582
- }
583
- if (mfaOnly)
584
- set.warn(MFA_ONLY_NOTE(mfaOnly));
585
- if (o.apiUrl) {
586
- progress('signing keys');
587
- const pub = new vendor_http_1.VendorHttp({ vendor: 'Hanko', baseUrl: o.apiUrl, fetchImpl: o.fetchImpl, sleep: o.sleep });
588
- try {
589
- const { body } = await pub.get('/.well-known/jwks.json');
590
- for (const jwk of (0, record_set_1.objs)((0, record_set_1.isObj)(body) ? body.keys : undefined)) {
591
- const kid = (0, record_set_1.str)(jwk.kid);
592
- if (kid && jwk.d === undefined)
593
- set.add('jwks', { kid, jwk }, kid);
594
- }
595
- }
596
- catch (err) {
597
- if (!(err instanceof vendor_http_1.VendorApiError))
598
- throw err;
599
- set.warn(`Could not read Hanko's signing keys (${err.message}); the bridge fetches them itself.`);
600
- }
601
- }
602
- set.manifest = (0, record_set_1.compact)({ origin: `Hanko Admin API ${o.adminUrl.replace(/^https?:\/\//, '').replace(/\/+$/, '')}`, rpId: o.rpId, providers: [...providers].sort(), settings: { totp: { ...TOTP } } });
603
- return set;
604
- }
605
- //# sourceMappingURL=hanko.js.map