@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,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bag = exports.strs = exports.objs = exports.str = exports.isObj = exports.RecordSet = void 0;
4
- exports.e164 = e164;
5
- exports.compact = compact;
6
- const migrate_1 = require("@atlasauth/migrate");
7
- /**
8
- * What a vendor exporter gathered, grouped by canonical model. A vendor API
9
- * hands data back in ITS order (users carry their identities, organizations
10
- * their members); the bundle needs canonical order, so exporters collect here
11
- * and the writer replays {@link RecordSet.ordered}.
12
- */
13
- class RecordSet {
14
- rows = new Map();
15
- seen = new Map();
16
- warnings = [];
17
- omitted = {};
18
- /** Manifest fields the exporter learned (origin, providers, settings, rpId). */
19
- manifest = {};
20
- /**
21
- * Add a row. With `key`, a second row with the same key is dropped (a member
22
- * reached through two listings, a role seen on two organizations).
23
- */
24
- add(model, data, key) {
25
- if (key !== undefined) {
26
- const keys = this.seen.get(model) ?? new Set();
27
- if (keys.has(key))
28
- return;
29
- keys.add(key);
30
- this.seen.set(model, keys);
31
- }
32
- const list = this.rows.get(model) ?? [];
33
- list.push(data);
34
- this.rows.set(model, list);
35
- }
36
- warn(message) {
37
- if (!this.warnings.includes(message))
38
- this.warnings.push(message);
39
- }
40
- omit(model, reason, count = 1) {
41
- const o = this.omitted[model] ?? { count: 0, reason };
42
- o.count += count;
43
- this.omitted[model] = o;
44
- }
45
- count(model) {
46
- return this.rows.get(model)?.length ?? 0;
47
- }
48
- list(model) {
49
- return (this.rows.get(model) ?? []);
50
- }
51
- /** Every row, in the order the bundle writer requires. */
52
- *ordered() {
53
- for (const model of migrate_1.CANONICAL_MODEL_ORDER) {
54
- for (const data of this.rows.get(model) ?? [])
55
- yield { model, data };
56
- }
57
- }
58
- counts() {
59
- const out = {};
60
- for (const model of migrate_1.CANONICAL_MODEL_ORDER) {
61
- const n = this.rows.get(model)?.length ?? 0;
62
- if (n)
63
- out[model] = n;
64
- }
65
- return out;
66
- }
67
- }
68
- exports.RecordSet = RecordSet;
69
- const isObj = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
70
- exports.isObj = isObj;
71
- const str = (v) => typeof v === 'string' && v.trim() ? v.trim() : typeof v === 'number' && Number.isFinite(v) ? String(v) : undefined;
72
- exports.str = str;
73
- const objs = (v) => (Array.isArray(v) ? v.filter(exports.isObj) : []);
74
- exports.objs = objs;
75
- const strs = (v) => Array.isArray(v) ? v.map((x) => (0, exports.str)(x)).filter((x) => x !== undefined) : [];
76
- exports.strs = strs;
77
- /** A metadata bag, only when it has keys. */
78
- const bag = (v) => ((0, exports.isObj)(v) && Object.keys(v).length > 0 ? v : undefined);
79
- exports.bag = bag;
80
- /** E.164 or nothing: vendors store numbers with spaces/dashes; anything else is dropped. */
81
- function e164(raw) {
82
- const s = (0, exports.str)(raw);
83
- if (!s)
84
- return undefined;
85
- const digits = s.replace(/[\s().-]/g, '');
86
- const withPlus = digits.startsWith('+') ? digits : digits.startsWith('00') ? `+${digits.slice(2)}` : `+${digits}`;
87
- return /^\+[1-9]\d{6,14}$/.test(withPlus) ? withPlus : undefined;
88
- }
89
- /** Drop undefined fields so a record carries only what the vendor had. */
90
- function compact(o) {
91
- for (const k of Object.keys(o)) {
92
- const v = o[k];
93
- if (v === undefined || (Array.isArray(v) && v.length === 0))
94
- delete o[k];
95
- }
96
- return o;
97
- }
98
- //# sourceMappingURL=record-set.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record-set.js","sourceRoot":"","sources":["../../../src/migrate/export/record-set.ts"],"names":[],"mappings":";;;AAoFA,oBAMC;AAED,0BAMC;AAlGD,gDAK4B;AAE5B;;;;;GAKG;AACH,MAAa,SAAS;IACH,IAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAC5C,IAAI,GAAG,IAAI,GAAG,EAA+B,CAAC;IACtD,QAAQ,GAAa,EAAE,CAAC;IACxB,OAAO,GAAsD,EAAE,CAAC;IACzE,gFAAgF;IAChF,QAAQ,GAAqG,EAAE,CAAC;IAEhH;;;OAGG;IACH,GAAG,CAA2B,KAAQ,EAAE,IAA4B,EAAE,GAAY;QAChF,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAA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,SAAgB,OAAO,CAAmB,CAAI;IAC5C,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAmB,EAAE,CAAC;QACjD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { ReportStatus } from '../framework/plugin';
2
- import type { ConfigBuilder } from './translate-kit';
3
- /**
4
- * Report lines that point at a config FILE the owner keeps (appwrite.json,
5
- * nhost.toml, pb_schema.json): the 1-based line a setting sits on, so the
6
- * report reads `nhost/nhost.toml:42` instead of a bare setting path.
7
- */
8
- /**
9
- * The line of a JSON key path (`["settings", "auth", "security", "duration"]`)
10
- * in a JSON text, found by walking the quoted keys in order. Undefined when a
11
- * key is missing (the report then names only the setting path).
12
- */
13
- export declare function jsonKeyLine(text: string, path: string[]): number | undefined;
14
- /** The 1-based line of a character offset. */
15
- export declare function lineAt(text: string, offset: number): number;
16
- /** Add a report line with a file location (when the line is known). */
17
- export declare function addAt(b: ConfigBuilder, file: string | undefined, line: number | undefined, status: ReportStatus, area: string, setting: string, note: string, atlas?: string): void;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonKeyLine = jsonKeyLine;
4
- exports.lineAt = lineAt;
5
- exports.addAt = addAt;
6
- /**
7
- * Report lines that point at a config FILE the owner keeps (appwrite.json,
8
- * nhost.toml, pb_schema.json): the 1-based line a setting sits on, so the
9
- * report reads `nhost/nhost.toml:42` instead of a bare setting path.
10
- */
11
- /**
12
- * The line of a JSON key path (`["settings", "auth", "security", "duration"]`)
13
- * in a JSON text, found by walking the quoted keys in order. Undefined when a
14
- * key is missing (the report then names only the setting path).
15
- */
16
- function jsonKeyLine(text, path) {
17
- let at = 0;
18
- for (const key of path) {
19
- const i = text.indexOf(`"${key}"`, at);
20
- if (i < 0)
21
- return undefined;
22
- at = i + key.length + 2;
23
- }
24
- return lineAt(text, at);
25
- }
26
- /** The 1-based line of a character offset. */
27
- function lineAt(text, offset) {
28
- let line = 1;
29
- for (let i = 0; i < offset && i < text.length; i++)
30
- if (text.charCodeAt(i) === 10)
31
- line++;
32
- return line;
33
- }
34
- /** Add a report line with a file location (when the line is known). */
35
- function addAt(b, file, line, status, area, setting, note, atlas) {
36
- b.add(status, area, setting, note, atlas);
37
- if (file && line) {
38
- const entry = b.report[b.report.length - 1];
39
- entry.file = file;
40
- entry.line = line;
41
- }
42
- }
43
- //# sourceMappingURL=source-lines.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-lines.js","sourceRoot":"","sources":["../../../src/migrate/export/source-lines.ts"],"names":[],"mappings":";;AAcA,kCAQC;AAGD,wBAIC;AAGD,sBAOC;AApCD;;;;GAIG;AAEH;;;;GAIG;AACH,SAAgB,WAAW,CAAC,IAAY,EAAE,IAAc;IACtD,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,SAAS,CAAC;QAC5B,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC1B,CAAC;AAED,8CAA8C;AAC9C,SAAgB,MAAM,CAAC,IAAY,EAAE,MAAc;IACjD,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,CAAC;IAC1F,OAAO,IAAI,CAAC;AACd,CAAC;AAED,uEAAuE;AACvE,SAAgB,KAAK,CAAC,CAAgB,EAAE,IAAwB,EAAE,IAAwB,EAAE,MAAoB,EAAE,IAAY,EAAE,OAAe,EAAE,IAAY,EAAE,KAAc;IAC3K,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1C,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC;QAC7C,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAClB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;AACH,CAAC"}
@@ -1,47 +0,0 @@
1
- import type { SsoConnectionRecord } from '@atlasauth/migrate';
2
- import { RecordSet, type Obj } from './record-set';
3
- export interface SamlIdp {
4
- entityId: string;
5
- ssoUrl?: string;
6
- ssoBinding?: string;
7
- certificates: string[];
8
- nameIdFormat?: string;
9
- wantAuthnRequestsSigned?: boolean;
10
- }
11
- /** Every identity provider in a metadata document. Throws on a document with none. */
12
- export declare function parseSamlMetadata(xml: string): SamlIdp[];
13
- export interface SsoConnectionOptions {
14
- name?: string;
15
- domains?: string[];
16
- organizationId?: string;
17
- metadataUrl?: string;
18
- id?: string;
19
- }
20
- export declare function samlConnections(xml: string, o?: SsoConnectionOptions): {
21
- connections: SsoConnectionRecord[];
22
- warnings: string[];
23
- };
24
- export interface OidcDiscovery {
25
- issuer: string;
26
- authorization_endpoint?: string;
27
- token_endpoint?: string;
28
- userinfo_endpoint?: string;
29
- jwks_uri?: string;
30
- scopes_supported: string[];
31
- grant_types_supported: string[];
32
- id_token_signing_alg_values_supported: string[];
33
- }
34
- /** The discovery URL for an issuer or a discovery URL. */
35
- export declare function discoveryUrl(input: string): string;
36
- export declare function parseDiscovery(doc: unknown, requested: string): OidcDiscovery;
37
- export declare function fetchDiscovery(fetchImpl: typeof fetch, input: string): Promise<OidcDiscovery>;
38
- export declare function oidcConnection(d: OidcDiscovery, o?: SsoConnectionOptions & {
39
- clientId?: string;
40
- clientSecret?: string;
41
- }): SsoConnectionRecord;
42
- /** The records an SSO-only route writes: the connection, and an organization when it belongs to one. */
43
- export declare function connectionSet(connections: SsoConnectionRecord[], origin: string, organization?: {
44
- id: string;
45
- name: string;
46
- }): RecordSet;
47
- export type { Obj };
@@ -1,180 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseSamlMetadata = parseSamlMetadata;
4
- exports.samlConnections = samlConnections;
5
- exports.discoveryUrl = discoveryUrl;
6
- exports.parseDiscovery = parseDiscovery;
7
- exports.fetchDiscovery = fetchDiscovery;
8
- exports.oidcConnection = oidcConnection;
9
- exports.connectionSet = connectionSet;
10
- const record_set_1 = require("./record-set");
11
- /**
12
- * The SSO connections any identity provider hands over as standard documents:
13
- * SAML 2.0 IdP metadata (an EntityDescriptor, or an EntitiesDescriptor
14
- * federation) and an OpenID Connect discovery document. Used by the `saml` and
15
- * `oidc` routes, and by every vendor whose enterprise connections are
16
- * described by one of the two.
17
- */
18
- // ── SAML metadata ───────────────────────────────────────────────────────────
19
- const attr = (tag, name) => {
20
- const m = new RegExp(`\\b${name}\\s*=\\s*("([^"]*)"|'([^']*)')`).exec(tag);
21
- const v = m ? (m[2] ?? m[3]) : undefined;
22
- return v === undefined ? undefined : decodeXml(v);
23
- };
24
- function decodeXml(s) {
25
- return s.replace(/&(lt|gt|amp|quot|apos|#x[0-9a-f]+|#\d+);/gi, (_, e) => {
26
- const l = e.toLowerCase();
27
- if (l === 'lt')
28
- return '<';
29
- if (l === 'gt')
30
- return '>';
31
- if (l === 'amp')
32
- return '&';
33
- if (l === 'quot')
34
- return '"';
35
- if (l === 'apos')
36
- return "'";
37
- return String.fromCodePoint(l.startsWith('#x') ? parseInt(l.slice(2), 16) : parseInt(l.slice(1), 10));
38
- });
39
- }
40
- /** Elements by local name, ignoring any namespace prefix (`md:`, `ds:`, none). */
41
- function elements(xml, local) {
42
- const out = [];
43
- const re = new RegExp(`<(?:[A-Za-z0-9_-]+:)?${local}\\b([^>]*?)(/>|>([\\s\\S]*?)</(?:[A-Za-z0-9_-]+:)?${local}\\s*>)`, 'g');
44
- for (let m = re.exec(xml); m; m = re.exec(xml))
45
- out.push({ tag: m[1], body: m[3] ?? '' });
46
- return out;
47
- }
48
- /** Every identity provider in a metadata document. Throws on a document with none. */
49
- function parseSamlMetadata(xml) {
50
- if (/<!DOCTYPE|<!ENTITY/i.test(xml))
51
- throw new Error('The metadata contains a DOCTYPE / ENTITY declaration, which is refused.');
52
- const idps = [];
53
- const scoped = elements(xml, 'EntityDescriptor');
54
- // An EntityDescriptor nested in an EntitiesDescriptor is matched by the regex too; a lone one matches once.
55
- for (const ed of scoped) {
56
- const idp = elements(ed.body, 'IDPSSODescriptor')[0];
57
- const entityId = attr(`${ed.tag}`, 'entityID');
58
- if (!idp || !entityId)
59
- continue;
60
- const services = elements(idp.body, 'SingleSignOnService').map((s) => ({ binding: attr(s.tag, 'Binding') ?? '', location: attr(s.tag, 'Location') }));
61
- const pick = services.find((s) => s.binding.endsWith('HTTP-Redirect') && s.location) ?? services.find((s) => s.binding.endsWith('HTTP-POST') && s.location) ?? services.find((s) => s.location);
62
- const certs = [];
63
- for (const k of elements(idp.body, 'KeyDescriptor')) {
64
- if (attr(k.tag, 'use') === 'encryption')
65
- continue;
66
- for (const c of elements(k.body, 'X509Certificate')) {
67
- const b64 = c.body.replace(/\s+/g, '');
68
- if (/^[A-Za-z0-9+/=]+$/.test(b64) && !certs.includes(b64))
69
- certs.push(b64);
70
- }
71
- }
72
- idps.push((0, record_set_1.compact)({
73
- entityId,
74
- ssoUrl: pick?.location,
75
- ssoBinding: pick?.binding,
76
- certificates: certs,
77
- nameIdFormat: elements(idp.body, 'NameIDFormat')[0]?.body.trim() || undefined,
78
- wantAuthnRequestsSigned: attr(idp.tag, 'WantAuthnRequestsSigned') === 'true' ? true : undefined,
79
- }));
80
- }
81
- if (!idps.length)
82
- throw new Error('No identity provider (IDPSSODescriptor) found in the SAML metadata.');
83
- return idps;
84
- }
85
- const pem = (b64) => `-----BEGIN CERTIFICATE-----\n${b64.match(/.{1,64}/g).join('\n')}\n-----END CERTIFICATE-----\n`;
86
- function samlConnections(xml, o = {}) {
87
- const idps = parseSamlMetadata(xml);
88
- const warnings = [];
89
- const connections = idps.map((idp, i) => {
90
- // compact() drops an empty certificate list.
91
- const certificates = idp.certificates ?? [];
92
- if (!idp.ssoUrl)
93
- warnings.push(`${idp.entityId}: no SingleSignOnService in the metadata.`);
94
- if (!certificates.length)
95
- warnings.push(`${idp.entityId}: no signing certificate in the metadata; Atlas cannot verify its assertions.`);
96
- if (certificates.length > 1)
97
- warnings.push(`${idp.entityId}: ${certificates.length} signing certificates; the first is imported, add the others in the dashboard when the IdP rolls its key.`);
98
- return (0, record_set_1.compact)({
99
- id: o.id ?? (idps.length > 1 ? `${slug(idp.entityId)}-${i + 1}` : slug(idp.entityId)),
100
- name: o.name ?? hostName(idp.entityId),
101
- organization_id: o.organizationId,
102
- protocol: 'saml',
103
- domains: o.domains,
104
- enabled: true,
105
- saml: (0, record_set_1.compact)({
106
- idp_entity_id: idp.entityId,
107
- idp_sso_url: idp.ssoUrl,
108
- idp_certificate: certificates[0] ? pem(certificates[0]) : undefined,
109
- idp_metadata_url: o.metadataUrl,
110
- idp_metadata_xml: idps.length === 1 ? xml : undefined,
111
- }),
112
- });
113
- });
114
- return { connections, warnings };
115
- }
116
- const slug = (s) => s.replace(/^https?:\/\//, '').replace(/[^A-Za-z0-9]+/g, '-').replace(/^-+|-+$/g, '').toLowerCase().slice(0, 64) || 'saml';
117
- const hostName = (entityId) => {
118
- try {
119
- return new URL(entityId).host;
120
- }
121
- catch {
122
- return entityId.slice(0, 64);
123
- }
124
- };
125
- /** The discovery URL for an issuer or a discovery URL. */
126
- function discoveryUrl(input) {
127
- const u = input.trim().replace(/\/+$/, '');
128
- if (!/^https:\/\//i.test(u))
129
- throw new Error('The OpenID Connect issuer must be an https:// URL.');
130
- return u.endsWith('/.well-known/openid-configuration') ? u : `${u}/.well-known/openid-configuration`;
131
- }
132
- function parseDiscovery(doc, requested) {
133
- if (!(0, record_set_1.isObj)(doc) || !(0, record_set_1.str)(doc.issuer))
134
- throw new Error('The discovery document has no issuer.');
135
- const issuer = (0, record_set_1.str)(doc.issuer);
136
- const want = requested.replace(/\/\.well-known\/openid-configuration$/, '').replace(/\/+$/, '');
137
- // RFC 8414 §3.3: the issuer in the document must equal the one it was fetched for.
138
- if (issuer.replace(/\/+$/, '') !== want)
139
- throw new Error(`The discovery document names issuer ${issuer}, not ${want}.`);
140
- return {
141
- issuer,
142
- authorization_endpoint: (0, record_set_1.str)(doc.authorization_endpoint),
143
- token_endpoint: (0, record_set_1.str)(doc.token_endpoint),
144
- userinfo_endpoint: (0, record_set_1.str)(doc.userinfo_endpoint),
145
- jwks_uri: (0, record_set_1.str)(doc.jwks_uri),
146
- scopes_supported: (0, record_set_1.strs)(doc.scopes_supported),
147
- grant_types_supported: (0, record_set_1.strs)(doc.grant_types_supported),
148
- id_token_signing_alg_values_supported: (0, record_set_1.strs)(doc.id_token_signing_alg_values_supported),
149
- };
150
- }
151
- async function fetchDiscovery(fetchImpl, input) {
152
- const url = discoveryUrl(input);
153
- const res = await fetchImpl(url, { headers: { accept: 'application/json' }, redirect: 'error' });
154
- if (res.status !== 200)
155
- throw new Error(`${url} answered ${res.status}.`);
156
- return parseDiscovery(await res.json().catch(() => null), input.trim().replace(/\/\.well-known\/openid-configuration$/, ''));
157
- }
158
- function oidcConnection(d, o = {}) {
159
- const scopes = ['openid', 'email', 'profile'].filter((s) => d.scopes_supported.length === 0 || d.scopes_supported.includes(s));
160
- return (0, record_set_1.compact)({
161
- id: o.id ?? slug(d.issuer),
162
- name: o.name ?? hostName(d.issuer),
163
- organization_id: o.organizationId,
164
- protocol: 'oidc',
165
- domains: o.domains,
166
- enabled: true,
167
- oidc: (0, record_set_1.compact)({ issuer: d.issuer, discovery_url: discoveryUrl(d.issuer), client_id: o.clientId, client_secret: o.clientSecret, scopes }),
168
- });
169
- }
170
- /** The records an SSO-only route writes: the connection, and an organization when it belongs to one. */
171
- function connectionSet(connections, origin, organization) {
172
- const set = new record_set_1.RecordSet();
173
- set.manifest = { origin };
174
- if (organization)
175
- set.add('organization', { id: organization.id, name: organization.name, slug: slug(organization.name) }, organization.id);
176
- for (const c of connections)
177
- set.add('sso_connection', organization ? { ...c, organization_id: organization.id } : c, c.id);
178
- return set;
179
- }
180
- //# sourceMappingURL=sso-metadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sso-metadata.js","sourceRoot":"","sources":["../../../src/migrate/export/sso-metadata.ts"],"names":[],"mappings":";;AAiDA,8CA8BC;AAYD,0CA0BC;AAyBD,oCAIC;AAED,wCAgBC;AAED,wCAKC;AAED,wCAWC;AAGD,sCAMC;AAhMD,6CAA8E;AAE9E;;;;;;GAMG;AAEH,+EAA+E;AAE/E,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,IAAY,EAAsB,EAAE;IAC7D,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,MAAM,IAAI,gCAAgC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3E,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,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ClB,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,IAAA,oBAAO,EAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;KAClH,CAAC,CAAC;AAC5B,CAAC;AAED,wGAAwG;AACxG,SAAgB,aAAa,CAAC,WAAkC,EAAE,MAAc,EAAE,YAA2C;IAC3H,MAAM,GAAG,GAAG,IAAI,sBAAS,EAAE,CAAC;IAC5B,GAAG,CAAC,QAAQ,GAAG,EAAE,MAAM,EAAE,CAAC;IAC1B,IAAI,YAAY;QAAE,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;IAC5I,KAAK,MAAM,CAAC,IAAI,WAAW;QAAE,GAAG,CAAC,GAAG,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAC5H,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { TranslationResult } from '../framework/plugin';
2
- import { type Obj } from './record-set';
3
- import { type StytchProduct } from './stytch';
4
- import { type VendorHttp } from './vendor-http';
5
- /**
6
- * `atlas migrate stytch config` — what Stytch's project API exposes: the RBAC
7
- * policy (roles, resources and their actions) and, for B2B, the organizations
8
- * with their SSO connections. Password strength, session duration, OAuth
9
- * providers, MFA and branding are dashboard-only settings: the report lists
10
- * each as manual, with where to find it. The bridge and lazy-migration presets
11
- * are carried to the next step.
12
- */
13
- export interface StytchConfigSnapshot {
14
- projectId: string;
15
- product: StytchProduct;
16
- roles: Obj[];
17
- resources: Obj[];
18
- organizations: number;
19
- ssoConnections: number;
20
- }
21
- export declare function fetchStytchConfig(http: VendorHttp, projectId: string, product: StytchProduct): Promise<StytchConfigSnapshot>;
22
- export declare function translateStytchConfig(snap: StytchConfigSnapshot): TranslationResult;
@@ -1,102 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchStytchConfig = fetchStytchConfig;
4
- exports.translateStytchConfig = translateStytchConfig;
5
- const record_set_1 = require("./record-set");
6
- const stytch_1 = require("./stytch");
7
- const translate_kit_1 = require("./translate-kit");
8
- const vendor_http_1 = require("./vendor-http");
9
- async function optionalGet(http, path) {
10
- try {
11
- const body = (await http.get(path)).body;
12
- return (0, record_set_1.isObj)(body) ? body : null;
13
- }
14
- catch (err) {
15
- if (err instanceof vendor_http_1.VendorApiError && [400, 403, 404].includes(err.status))
16
- return null;
17
- throw err;
18
- }
19
- }
20
- async function fetchStytchConfig(http, projectId, product) {
21
- // The consumer policy endpoint is UNCONFIRMED; a project without it just reports no roles.
22
- const res = await optionalGet(http, product === 'b2b' ? '/v1/b2b/rbac/policy' : '/v1/rbac/policy');
23
- const policy = res && (0, record_set_1.isObj)(res.policy) ? res.policy : {};
24
- let organizations = 0;
25
- let ssoConnections = 0;
26
- if (product === 'b2b') {
27
- try {
28
- const { body } = await http.post('/v1/b2b/organizations/search', { limit: 1000 });
29
- const orgs = (0, record_set_1.objs)((0, record_set_1.isObj)(body) ? body.organizations : undefined);
30
- organizations = orgs.length;
31
- for (const o of orgs) {
32
- const id = (0, record_set_1.str)(o.organization_id);
33
- const sso = id ? await optionalGet(http, `/v1/b2b/sso/${encodeURIComponent(id)}`) : null;
34
- if (sso)
35
- ssoConnections += (0, record_set_1.objs)(sso.saml_connections).length + (0, record_set_1.objs)(sso.oidc_connections).length;
36
- }
37
- }
38
- catch (err) {
39
- if (!(err instanceof vendor_http_1.VendorApiError))
40
- throw err;
41
- }
42
- }
43
- return { projectId, product, roles: (0, record_set_1.objs)(policy.roles), resources: (0, record_set_1.objs)(policy.resources), organizations, ssoConnections };
44
- }
45
- function translateStytchConfig(snap) {
46
- const b = new translate_kit_1.ConfigBuilder();
47
- const permissions = new Set();
48
- for (const r of snap.resources) {
49
- const resource = (0, record_set_1.str)(r.resource_id);
50
- if (resource)
51
- for (const a of (0, record_set_1.strs)(r.actions))
52
- permissions.add(`${resource}:${a}`);
53
- }
54
- let roles = 0;
55
- for (const r of snap.roles) {
56
- const id = (0, record_set_1.str)(r.role_id);
57
- if (!id)
58
- continue;
59
- const key = (0, stytch_1.stytchRoleKey)(id);
60
- const perms = (0, record_set_1.objs)(r.permissions).flatMap((p) => (0, record_set_1.strs)(p.actions).map((a) => `${(0, record_set_1.str)(p.resource_id) ?? '*'}:${a}`));
61
- for (const p of perms)
62
- if (!p.startsWith('*:'))
63
- permissions.add(p);
64
- // Built-in roles already exist in Atlas as admin and member.
65
- if (key !== id)
66
- continue;
67
- roles++;
68
- b.roles[id] = key;
69
- b.push('roles', { key, name: key, description: (0, record_set_1.str)(r.description) ?? '', permissions: perms });
70
- }
71
- for (const key of permissions)
72
- b.push('permissions', { key, name: key, description: '' });
73
- if (permissions.size)
74
- b.add('mapped', 'authorization', 'RBAC resources and actions', `${permissions.size} permission(s), keyed resource:action.`, 'permissions');
75
- if (roles)
76
- b.add('mapped', 'authorization', 'custom roles', `${roles} role(s); members keep the same role id as their Atlas role key. stytch_admin and stytch_member map to Atlas's admin and member.`, 'roles');
77
- if (snap.roles.length === 0)
78
- b.add('manual', 'authorization', 'RBAC policy', 'No RBAC policy was returned; default roles carry over as admin and member.');
79
- if (snap.ssoConnections)
80
- b.add('mapped', 'enterprise', `${snap.ssoConnections} SSO connection(s) in ${snap.organizations} organization(s)`, 'Move with the data export as Atlas SSO connections.', 'sso_connections');
81
- if (snap.product === 'b2b')
82
- b.add('manual', 'organizations', 'organization MFA policy, allowed auth methods, JIT provisioning', 'Per-organization settings are kept in the exported organization metadata; set the matching policy on each Atlas organization.');
83
- for (const [setting, where] of [
84
- ['password strength (zxcvbn / LUDS) and breach check', 'Dashboard → Authentication → Passwords; set Atlas password rules under auth_config.password'],
85
- ['session duration and JWT lifetime', 'Dashboard → Sessions; set the Atlas session lifetime'],
86
- ['OAuth providers (client ids and secrets)', 'Dashboard → OAuth; use the same OAuth apps in Atlas so imported accounts relink'],
87
- ['redirect URLs and authorized domains', 'Dashboard → Redirect URLs, SDK configuration'],
88
- ['multi-factor authentication (TOTP, SMS)', 'Dashboard → Authentication → MFA'],
89
- ['email templates, SMS and branding', 'Dashboard → Email templates, Branding'],
90
- ['custom claims and JWT templates', 'Dashboard → Sessions → JWT templates'],
91
- ['webhooks', 'Dashboard → Webhooks (create Atlas webhook endpoints)'],
92
- ]) {
93
- b.add('manual', 'settings not in the API', setting, `Stytch does not expose this through the project API; copy it from ${where}.`);
94
- }
95
- const test = snap.projectId.startsWith('project-test-');
96
- const vars = { project_id: snap.projectId, ...(test ? { api_host: 'test.stytch.com' } : {}), ...(snap.product === 'b2b' ? { jwks_path: 'b2b/sessions' } : {}) };
97
- return b.result(`Stytch project ${snap.projectId}`, {
98
- bridge: { preset: 'stytch', vars },
99
- lazy: { preset: 'stytch', config: { project_id: snap.projectId, product: snap.product } },
100
- });
101
- }
102
- //# sourceMappingURL=stytch-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stytch-config.js","sourceRoot":"","sources":["../../../src/migrate/export/stytch-config.ts"],"names":[],"mappings":";;AAkCA,8CAqBC;AAED,sDAgDC;AAvGD,6CAAgE;AAChE,qCAA6D;AAC7D,mDAAgD;AAChD,+CAAgE;AAmBhE,KAAK,UAAU,WAAW,CAAC,IAAgB,EAAE,IAAY;IACvD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAM,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GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IACxD,MAAM,IAAI,GAA2B,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACxL,OAAO,CAAC,CAAC,MAAM,CAAC,kBAAkB,IAAI,CAAC,SAAS,EAAE,EAAE;QAClD,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClC,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE;KAC1F,CAAC,CAAC;AACL,CAAC"}
@@ -1,68 +0,0 @@
1
- import type { PasswordHash, UserRecord } from '@atlasauth/migrate';
2
- import { RecordSet, type Obj } from './record-set';
3
- import { VendorHttp } from './vendor-http';
4
- /**
5
- * `atlas migrate export stytch` — Stytch (consumer and B2B) onto the canonical
6
- * bundle models, from the Stytch API with the project id and secret (on this
7
- * machine only).
8
- *
9
- * consumer `POST /v1/users/search` (cursor paging, 1000 per page): emails
10
- * and phone numbers with their verified flags, name, OAuth
11
- * providers, metadata, roles, lock state.
12
- * B2B `POST /v1/b2b/organizations/search`, then per organization
13
- * `POST /v1/b2b/organizations/members/search`, `GET /v1/b2b/sso/{org}`
14
- * and the RBAC policy (`GET /v1/b2b/rbac/policy`).
15
- *
16
- * Stytch members belong to ONE organization each (`member_id` is per
17
- * organization). Atlas users are people, so members sharing an email become one
18
- * user: the earliest member's id is the user id (the session JWT `sub` of that
19
- * member maps to it) and the others' ids are kept in `private_metadata`.
20
- *
21
- * Password hashes never leave Stytch through the API: they come from the export
22
- * Stytch support sends on request (support@stytch.com), given as `--stytch-hashes`
23
- * (CSV, JSON or NDJSON). Until then the `stytch` lazy-migration preset checks
24
- * passwords against Stytch on first sign-in. TOTP secrets, passkeys and crypto
25
- * wallets are not exported.
26
- */
27
- export type StytchProduct = 'consumer' | 'b2b';
28
- export interface StytchExportOptions {
29
- projectId: string;
30
- secret: string;
31
- /** Detected from the project when omitted. */
32
- product?: StytchProduct;
33
- /** Override `https://api.stytch.com` (live) / `https://test.stytch.com` (test), e.g. a custom domain. */
34
- baseUrl?: string;
35
- /** The support-provided password export (CSV, JSON array or NDJSON text). */
36
- hashesText?: string;
37
- fetchImpl?: typeof fetch;
38
- sleep?: (ms: number) => Promise<void>;
39
- onProgress?: (message: string) => void;
40
- }
41
- /** The API host for a project id: live projects are on api.stytch.com, test projects on test.stytch.com. */
42
- export declare function stytchBaseUrl(projectId: string): string;
43
- /** HTTP Basic credentials for the project. */
44
- export declare function stytchAuthorization(projectId: string, secret: string): string;
45
- export declare function stytchHttp(o: Pick<StytchExportOptions, 'projectId' | 'secret' | 'baseUrl' | 'fetchImpl' | 'sleep'>): VendorHttp;
46
- /** Is this a B2B project? Its organization search answers; a consumer project refuses the endpoint. */
47
- export declare function detectStytchProduct(http: VendorHttp): Promise<StytchProduct>;
48
- /** Stytch's cursor paging: `results_metadata.next_cursor` until it is null. */
49
- export declare function stytchSearch(http: VendorHttp, path: string, body: Obj, key: string): Promise<Obj[]>;
50
- export declare function exportStytch(opts: StytchExportOptions): Promise<RecordSet>;
51
- /** One Stytch user object → a user record; null with nothing to sign in with. */
52
- export declare function mapStytchUser(u: Obj): UserRecord | null;
53
- export declare function stytchRoleKey(roleId: string): string;
54
- /**
55
- * Parse the password export Stytch support sends: a JSON array (or an object
56
- * holding one under `users` / `members` / `results`), NDJSON, or CSV with a
57
- * header row. Keys are lower-cased; a nested `scrypt_config` etc. is flattened.
58
- */
59
- export declare function parseStytchHashes(text: string): Obj[];
60
- /**
61
- * One row of the support export → the bundle's password hash. Field names
62
- * follow Stytch's own password-migration API (`hash`, `hash_type`, and the
63
- * `scrypt_config` / `pbkdf_2_config` / salt fields), which is the format the
64
- * export mirrors (UNCONFIRMED: Stytch support documents it per request).
65
- */
66
- export declare function stytchPasswordHash(row: Obj): PasswordHash | {
67
- reason: string;
68
- };