@atlasauth/cli 0.25.0 → 0.25.1
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.
- package/CHANGELOG.md +6 -0
- package/dist/args.d.ts +601 -0
- package/dist/args.js +289 -0
- package/dist/args.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +19 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/actions-gallery.d.ts +8 -0
- package/dist/commands/actions-gallery.js +197 -0
- package/dist/commands/actions-gallery.js.map +1 -0
- package/dist/commands/actions.d.ts +13 -0
- package/dist/commands/actions.js +135 -0
- package/dist/commands/actions.js.map +1 -0
- package/dist/commands/admin.d.ts +49 -0
- package/dist/commands/admin.js +353 -0
- package/dist/commands/admin.js.map +1 -0
- package/dist/commands/api-keys.d.ts +4 -0
- package/dist/commands/api-keys.js +96 -0
- package/dist/commands/api-keys.js.map +1 -0
- package/dist/commands/auth.d.ts +25 -0
- package/dist/commands/auth.js +102 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/config.d.ts +104 -0
- package/dist/commands/config.js +1532 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/csp.d.ts +32 -0
- package/dist/commands/csp.js +180 -0
- package/dist/commands/csp.js.map +1 -0
- package/dist/commands/dev.d.ts +8 -0
- package/dist/commands/dev.js +84 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/fga.d.ts +10 -0
- package/dist/commands/fga.js +146 -0
- package/dist/commands/fga.js.map +1 -0
- package/dist/commands/golive.d.ts +40 -0
- package/dist/commands/golive.js +285 -0
- package/dist/commands/golive.js.map +1 -0
- package/dist/commands/id-accounts.d.ts +13 -0
- package/dist/commands/id-accounts.js +195 -0
- package/dist/commands/id-accounts.js.map +1 -0
- package/dist/commands/import-better-auth.d.ts +3 -0
- package/dist/commands/import-better-auth.js +164 -0
- package/dist/commands/import-better-auth.js.map +1 -0
- package/dist/commands/import.d.ts +3 -0
- package/dist/commands/import.js +123 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/info.d.ts +75 -0
- package/dist/commands/info.js +362 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.js +438 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/integrations.d.ts +8 -0
- package/dist/commands/integrations.js +112 -0
- package/dist/commands/integrations.js.map +1 -0
- package/dist/commands/listen.d.ts +17 -0
- package/dist/commands/listen.js +223 -0
- package/dist/commands/listen.js.map +1 -0
- package/dist/commands/mcp.d.ts +38 -0
- package/dist/commands/mcp.js +111 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/migrate.d.ts +16 -0
- package/dist/commands/migrate.js +114 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/move-origin.d.ts +11 -0
- package/dist/commands/move-origin.js +95 -0
- package/dist/commands/move-origin.js.map +1 -0
- package/dist/commands/operator.d.ts +18 -0
- package/dist/commands/operator.js +238 -0
- package/dist/commands/operator.js.map +1 -0
- package/dist/commands/orgs.d.ts +4 -0
- package/dist/commands/orgs.js +72 -0
- package/dist/commands/orgs.js.map +1 -0
- package/dist/commands/pages.d.ts +14 -0
- package/dist/commands/pages.js +113 -0
- package/dist/commands/pages.js.map +1 -0
- package/dist/commands/partner-platforms.d.ts +10 -0
- package/dist/commands/partner-platforms.js +157 -0
- package/dist/commands/partner-platforms.js.map +1 -0
- package/dist/commands/project-commands.d.ts +38 -0
- package/dist/commands/project-commands.js +361 -0
- package/dist/commands/project-commands.js.map +1 -0
- package/dist/commands/referrals.d.ts +69 -0
- package/dist/commands/referrals.js +1056 -0
- package/dist/commands/referrals.js.map +1 -0
- package/dist/commands/resources.d.ts +44 -0
- package/dist/commands/resources.js +234 -0
- package/dist/commands/resources.js.map +1 -0
- package/dist/commands/sessions.d.ts +4 -0
- package/dist/commands/sessions.js +28 -0
- package/dist/commands/sessions.js.map +1 -0
- package/dist/commands/shared.d.ts +38 -0
- package/dist/commands/shared.js +69 -0
- package/dist/commands/shared.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.js +77 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/users.d.ts +4 -0
- package/dist/commands/users.js +100 -0
- package/dist/commands/users.js.map +1 -0
- package/dist/commands/webhooks.d.ts +34 -0
- package/dist/commands/webhooks.js +301 -0
- package/dist/commands/webhooks.js.map +1 -0
- package/dist/config-http.d.ts +29 -0
- package/dist/config-http.js +64 -0
- package/dist/config-http.js.map +1 -0
- package/dist/config.d.ts +64 -0
- package/dist/config.js +69 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +72 -0
- package/dist/context.js +27 -0
- package/dist/context.js.map +1 -0
- package/dist/define-config.d.ts +9 -0
- package/dist/define-config.js +8 -0
- package/dist/define-config.js.map +1 -0
- package/dist/errors.d.ts +15 -0
- package/dist/errors.js +25 -0
- package/dist/errors.js.map +1 -0
- package/dist/help.d.ts +8 -0
- package/dist/help.js +868 -0
- package/dist/help.js.map +1 -0
- package/dist/import/csv.d.ts +6 -0
- package/dist/import/csv.js +63 -0
- package/dist/import/csv.js.map +1 -0
- package/dist/import/vendors.d.ts +57 -0
- package/dist/import/vendors.js +568 -0
- package/dist/import/vendors.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -0
- package/dist/io.d.ts +21 -0
- package/dist/io.js +28 -0
- package/dist/io.js.map +1 -0
- package/dist/migrate/appwrite/plugin.d.ts +2 -0
- package/dist/migrate/appwrite/plugin.js +103 -0
- package/dist/migrate/appwrite/plugin.js.map +1 -0
- package/dist/migrate/auth0/plugin.d.ts +2 -0
- package/dist/migrate/auth0/plugin.js +126 -0
- package/dist/migrate/auth0/plugin.js.map +1 -0
- package/dist/migrate/authentik/plugin.d.ts +2 -0
- package/dist/migrate/authentik/plugin.js +135 -0
- package/dist/migrate/authentik/plugin.js.map +1 -0
- package/dist/migrate/azure-ad-b2c/plugin.d.ts +8 -0
- package/dist/migrate/azure-ad-b2c/plugin.js +165 -0
- package/dist/migrate/azure-ad-b2c/plugin.js.map +1 -0
- package/dist/migrate/better-auth/integration.d.ts +59 -0
- package/dist/migrate/better-auth/integration.js +81 -0
- package/dist/migrate/better-auth/integration.js.map +1 -0
- package/dist/migrate/better-auth/orchestrator.d.ts +43 -0
- package/dist/migrate/better-auth/orchestrator.js +525 -0
- package/dist/migrate/better-auth/orchestrator.js.map +1 -0
- package/dist/migrate/better-auth/output.d.ts +20 -0
- package/dist/migrate/better-auth/output.js +146 -0
- package/dist/migrate/better-auth/output.js.map +1 -0
- package/dist/migrate/better-auth/translate.d.ts +77 -0
- package/dist/migrate/better-auth/translate.js +1989 -0
- package/dist/migrate/better-auth/translate.js.map +1 -0
- package/dist/migrate/clerk/plugin.d.ts +2 -0
- package/dist/migrate/clerk/plugin.js +76 -0
- package/dist/migrate/clerk/plugin.js.map +1 -0
- package/dist/migrate/cognito/plugin.d.ts +5 -0
- package/dist/migrate/cognito/plugin.js +170 -0
- package/dist/migrate/cognito/plugin.js.map +1 -0
- package/dist/migrate/corbado/plugin.d.ts +2 -0
- package/dist/migrate/corbado/plugin.js +63 -0
- package/dist/migrate/corbado/plugin.js.map +1 -0
- package/dist/migrate/descope/plugin.d.ts +2 -0
- package/dist/migrate/descope/plugin.js +83 -0
- package/dist/migrate/descope/plugin.js.map +1 -0
- package/dist/migrate/entra-external-id/plugin.d.ts +8 -0
- package/dist/migrate/entra-external-id/plugin.js +12 -0
- package/dist/migrate/entra-external-id/plugin.js.map +1 -0
- package/dist/migrate/export/appwrite-config.d.ts +28 -0
- package/dist/migrate/export/appwrite-config.js +170 -0
- package/dist/migrate/export/appwrite-config.js.map +1 -0
- package/dist/migrate/export/appwrite.d.ts +51 -0
- package/dist/migrate/export/appwrite.js +288 -0
- package/dist/migrate/export/appwrite.js.map +1 -0
- package/dist/migrate/export/auth0-config.d.ts +29 -0
- package/dist/migrate/export/auth0-config.js +249 -0
- package/dist/migrate/export/auth0-config.js.map +1 -0
- package/dist/migrate/export/auth0.d.ts +62 -0
- package/dist/migrate/export/auth0.js +575 -0
- package/dist/migrate/export/auth0.js.map +1 -0
- package/dist/migrate/export/authentik-config.d.ts +45 -0
- package/dist/migrate/export/authentik-config.js +357 -0
- package/dist/migrate/export/authentik-config.js.map +1 -0
- package/dist/migrate/export/authentik.d.ts +110 -0
- package/dist/migrate/export/authentik.js +838 -0
- package/dist/migrate/export/authentik.js.map +1 -0
- package/dist/migrate/export/azure-config.d.ts +58 -0
- package/dist/migrate/export/azure-config.js +344 -0
- package/dist/migrate/export/azure-config.js.map +1 -0
- package/dist/migrate/export/azure.d.ts +85 -0
- package/dist/migrate/export/azure.js +373 -0
- package/dist/migrate/export/azure.js.map +1 -0
- package/dist/migrate/export/clerk-config.d.ts +26 -0
- package/dist/migrate/export/clerk-config.js +227 -0
- package/dist/migrate/export/clerk-config.js.map +1 -0
- package/dist/migrate/export/clerk.d.ts +46 -0
- package/dist/migrate/export/clerk.js +486 -0
- package/dist/migrate/export/clerk.js.map +1 -0
- package/dist/migrate/export/cognito-config.d.ts +25 -0
- package/dist/migrate/export/cognito-config.js +273 -0
- package/dist/migrate/export/cognito-config.js.map +1 -0
- package/dist/migrate/export/cognito.d.ts +103 -0
- package/dist/migrate/export/cognito.js +441 -0
- package/dist/migrate/export/cognito.js.map +1 -0
- package/dist/migrate/export/corbado-config.d.ts +20 -0
- package/dist/migrate/export/corbado-config.js +63 -0
- package/dist/migrate/export/corbado-config.js.map +1 -0
- package/dist/migrate/export/corbado.d.ts +37 -0
- package/dist/migrate/export/corbado.js +132 -0
- package/dist/migrate/export/corbado.js.map +1 -0
- package/dist/migrate/export/descope.d.ts +35 -0
- package/dist/migrate/export/descope.js +208 -0
- package/dist/migrate/export/descope.js.map +1 -0
- package/dist/migrate/export/fake-vendor.test-helper.d.ts +27 -0
- package/dist/migrate/export/fake-vendor.test-helper.js +41 -0
- package/dist/migrate/export/fake-vendor.test-helper.js.map +1 -0
- package/dist/migrate/export/firebase-config.d.ts +24 -0
- package/dist/migrate/export/firebase-config.js +215 -0
- package/dist/migrate/export/firebase-config.js.map +1 -0
- package/dist/migrate/export/firebase.d.ts +102 -0
- package/dist/migrate/export/firebase.js +464 -0
- package/dist/migrate/export/firebase.js.map +1 -0
- package/dist/migrate/export/frameworks/app-users.d.ts +42 -0
- package/dist/migrate/export/frameworks/app-users.js +161 -0
- package/dist/migrate/export/frameworks/app-users.js.map +1 -0
- package/dist/migrate/export/frameworks/authjs.d.ts +41 -0
- package/dist/migrate/export/frameworks/authjs.js +146 -0
- package/dist/migrate/export/frameworks/authjs.js.map +1 -0
- package/dist/migrate/export/frameworks/devise.d.ts +39 -0
- package/dist/migrate/export/frameworks/devise.js +218 -0
- package/dist/migrate/export/frameworks/devise.js.map +1 -0
- package/dist/migrate/export/frameworks/django.d.ts +45 -0
- package/dist/migrate/export/frameworks/django.js +315 -0
- package/dist/migrate/export/frameworks/django.js.map +1 -0
- package/dist/migrate/export/frameworks/lucia.d.ts +42 -0
- package/dist/migrate/export/frameworks/lucia.js +263 -0
- package/dist/migrate/export/frameworks/lucia.js.map +1 -0
- package/dist/migrate/export/frameworks/tables.d.ts +90 -0
- package/dist/migrate/export/frameworks/tables.js +325 -0
- package/dist/migrate/export/frameworks/tables.js.map +1 -0
- package/dist/migrate/export/frameworks/webauthn.d.ts +25 -0
- package/dist/migrate/export/frameworks/webauthn.js +130 -0
- package/dist/migrate/export/frameworks/webauthn.js.map +1 -0
- package/dist/migrate/export/frontegg-config.d.ts +29 -0
- package/dist/migrate/export/frontegg-config.js +238 -0
- package/dist/migrate/export/frontegg-config.js.map +1 -0
- package/dist/migrate/export/frontegg.d.ts +67 -0
- package/dist/migrate/export/frontegg.js +410 -0
- package/dist/migrate/export/frontegg.js.map +1 -0
- package/dist/migrate/export/fusionauth-config.d.ts +26 -0
- package/dist/migrate/export/fusionauth-config.js +226 -0
- package/dist/migrate/export/fusionauth-config.js.map +1 -0
- package/dist/migrate/export/fusionauth.d.ts +99 -0
- package/dist/migrate/export/fusionauth.js +642 -0
- package/dist/migrate/export/fusionauth.js.map +1 -0
- package/dist/migrate/export/hanko-config.d.ts +27 -0
- package/dist/migrate/export/hanko-config.js +265 -0
- package/dist/migrate/export/hanko-config.js.map +1 -0
- package/dist/migrate/export/hanko.d.ts +52 -0
- package/dist/migrate/export/hanko.js +605 -0
- package/dist/migrate/export/hanko.js.map +1 -0
- package/dist/migrate/export/keycloak-config.d.ts +19 -0
- package/dist/migrate/export/keycloak-config.js +219 -0
- package/dist/migrate/export/keycloak-config.js.map +1 -0
- package/dist/migrate/export/keycloak.d.ts +155 -0
- package/dist/migrate/export/keycloak.js +878 -0
- package/dist/migrate/export/keycloak.js.map +1 -0
- package/dist/migrate/export/kinde-descope-config.d.ts +38 -0
- package/dist/migrate/export/kinde-descope-config.js +172 -0
- package/dist/migrate/export/kinde-descope-config.js.map +1 -0
- package/dist/migrate/export/kinde.d.ts +57 -0
- package/dist/migrate/export/kinde.js +333 -0
- package/dist/migrate/export/kinde.js.map +1 -0
- package/dist/migrate/export/ldap.d.ts +53 -0
- package/dist/migrate/export/ldap.js +277 -0
- package/dist/migrate/export/ldap.js.map +1 -0
- package/dist/migrate/export/logto-config.d.ts +27 -0
- package/dist/migrate/export/logto-config.js +264 -0
- package/dist/migrate/export/logto-config.js.map +1 -0
- package/dist/migrate/export/logto.d.ts +150 -0
- package/dist/migrate/export/logto.js +809 -0
- package/dist/migrate/export/logto.js.map +1 -0
- package/dist/migrate/export/magic-config.d.ts +14 -0
- package/dist/migrate/export/magic-config.js +28 -0
- package/dist/migrate/export/magic-config.js.map +1 -0
- package/dist/migrate/export/magic.d.ts +31 -0
- package/dist/migrate/export/magic.js +93 -0
- package/dist/migrate/export/magic.js.map +1 -0
- package/dist/migrate/export/mini-yaml.d.ts +19 -0
- package/dist/migrate/export/mini-yaml.js +581 -0
- package/dist/migrate/export/mini-yaml.js.map +1 -0
- package/dist/migrate/export/nhost-config.d.ts +26 -0
- package/dist/migrate/export/nhost-config.js +360 -0
- package/dist/migrate/export/nhost-config.js.map +1 -0
- package/dist/migrate/export/nhost.d.ts +64 -0
- package/dist/migrate/export/nhost.js +304 -0
- package/dist/migrate/export/nhost.js.map +1 -0
- package/dist/migrate/export/okta-config.d.ts +30 -0
- package/dist/migrate/export/okta-config.js +205 -0
- package/dist/migrate/export/okta-config.js.map +1 -0
- package/dist/migrate/export/okta.d.ts +43 -0
- package/dist/migrate/export/okta.js +337 -0
- package/dist/migrate/export/okta.js.map +1 -0
- package/dist/migrate/export/onelogin.d.ts +22 -0
- package/dist/migrate/export/onelogin.js +123 -0
- package/dist/migrate/export/onelogin.js.map +1 -0
- package/dist/migrate/export/ory-config.d.ts +58 -0
- package/dist/migrate/export/ory-config.js +451 -0
- package/dist/migrate/export/ory-config.js.map +1 -0
- package/dist/migrate/export/ory.d.ts +81 -0
- package/dist/migrate/export/ory.js +555 -0
- package/dist/migrate/export/ory.js.map +1 -0
- package/dist/migrate/export/password-detect.d.ts +29 -0
- package/dist/migrate/export/password-detect.js +81 -0
- package/dist/migrate/export/password-detect.js.map +1 -0
- package/dist/migrate/export/pingone.d.ts +36 -0
- package/dist/migrate/export/pingone.js +218 -0
- package/dist/migrate/export/pingone.js.map +1 -0
- package/dist/migrate/export/plugin-kit.d.ts +25 -0
- package/dist/migrate/export/plugin-kit.js +82 -0
- package/dist/migrate/export/plugin-kit.js.map +1 -0
- package/dist/migrate/export/pocketbase-config.d.ts +28 -0
- package/dist/migrate/export/pocketbase-config.js +180 -0
- package/dist/migrate/export/pocketbase-config.js.map +1 -0
- package/dist/migrate/export/pocketbase.d.ts +52 -0
- package/dist/migrate/export/pocketbase.js +243 -0
- package/dist/migrate/export/pocketbase.js.map +1 -0
- package/dist/migrate/export/project-files.d.ts +15 -0
- package/dist/migrate/export/project-files.js +43 -0
- package/dist/migrate/export/project-files.js.map +1 -0
- package/dist/migrate/export/propelauth-config.d.ts +18 -0
- package/dist/migrate/export/propelauth-config.js +58 -0
- package/dist/migrate/export/propelauth-config.js.map +1 -0
- package/dist/migrate/export/propelauth-harness.test-helper.d.ts +62 -0
- package/dist/migrate/export/propelauth-harness.test-helper.js +109 -0
- package/dist/migrate/export/propelauth-harness.test-helper.js.map +1 -0
- package/dist/migrate/export/propelauth.d.ts +48 -0
- package/dist/migrate/export/propelauth.js +255 -0
- package/dist/migrate/export/propelauth.js.map +1 -0
- package/dist/migrate/export/record-set.d.ts +44 -0
- package/dist/migrate/export/record-set.js +98 -0
- package/dist/migrate/export/record-set.js.map +1 -0
- package/dist/migrate/export/source-lines.d.ts +17 -0
- package/dist/migrate/export/source-lines.js +43 -0
- package/dist/migrate/export/source-lines.js.map +1 -0
- package/dist/migrate/export/sso-metadata.d.ts +47 -0
- package/dist/migrate/export/sso-metadata.js +180 -0
- package/dist/migrate/export/sso-metadata.js.map +1 -0
- package/dist/migrate/export/stytch-config.d.ts +22 -0
- package/dist/migrate/export/stytch-config.js +102 -0
- package/dist/migrate/export/stytch-config.js.map +1 -0
- package/dist/migrate/export/stytch.d.ts +68 -0
- package/dist/migrate/export/stytch.js +510 -0
- package/dist/migrate/export/stytch.js.map +1 -0
- package/dist/migrate/export/supabase-config.d.ts +48 -0
- package/dist/migrate/export/supabase-config.js +408 -0
- package/dist/migrate/export/supabase-config.js.map +1 -0
- package/dist/migrate/export/supabase.d.ts +86 -0
- package/dist/migrate/export/supabase.js +524 -0
- package/dist/migrate/export/supabase.js.map +1 -0
- package/dist/migrate/export/supertokens-config.d.ts +20 -0
- package/dist/migrate/export/supertokens-config.js +150 -0
- package/dist/migrate/export/supertokens-config.js.map +1 -0
- package/dist/migrate/export/supertokens.d.ts +125 -0
- package/dist/migrate/export/supertokens.js +464 -0
- package/dist/migrate/export/supertokens.js.map +1 -0
- package/dist/migrate/export/table.d.ts +35 -0
- package/dist/migrate/export/table.js +248 -0
- package/dist/migrate/export/table.js.map +1 -0
- package/dist/migrate/export/translate-kit.d.ts +46 -0
- package/dist/migrate/export/translate-kit.js +148 -0
- package/dist/migrate/export/translate-kit.js.map +1 -0
- package/dist/migrate/export/userfront-config.d.ts +15 -0
- package/dist/migrate/export/userfront-config.js +49 -0
- package/dist/migrate/export/userfront-config.js.map +1 -0
- package/dist/migrate/export/userfront.d.ts +38 -0
- package/dist/migrate/export/userfront.js +189 -0
- package/dist/migrate/export/userfront.js.map +1 -0
- package/dist/migrate/export/vendor-http.d.ts +46 -0
- package/dist/migrate/export/vendor-http.js +138 -0
- package/dist/migrate/export/vendor-http.js.map +1 -0
- package/dist/migrate/export/workos-config.d.ts +23 -0
- package/dist/migrate/export/workos-config.js +125 -0
- package/dist/migrate/export/workos-config.js.map +1 -0
- package/dist/migrate/export/workos.d.ts +46 -0
- package/dist/migrate/export/workos.js +272 -0
- package/dist/migrate/export/workos.js.map +1 -0
- package/dist/migrate/export/zip.d.ts +8 -0
- package/dist/migrate/export/zip.js +66 -0
- package/dist/migrate/export/zip.js.map +1 -0
- package/dist/migrate/export/zitadel-config.d.ts +37 -0
- package/dist/migrate/export/zitadel-config.js +279 -0
- package/dist/migrate/export/zitadel-config.js.map +1 -0
- package/dist/migrate/export/zitadel.d.ts +82 -0
- package/dist/migrate/export/zitadel.js +447 -0
- package/dist/migrate/export/zitadel.js.map +1 -0
- package/dist/migrate/firebase/plugin.d.ts +2 -0
- package/dist/migrate/firebase/plugin.js +152 -0
- package/dist/migrate/firebase/plugin.js.map +1 -0
- package/dist/migrate/framework/builtins.d.ts +2 -0
- package/dist/migrate/framework/builtins.js +52 -0
- package/dist/migrate/framework/builtins.js.map +1 -0
- package/dist/migrate/framework/commands.d.ts +20 -0
- package/dist/migrate/framework/commands.js +58 -0
- package/dist/migrate/framework/commands.js.map +1 -0
- package/dist/migrate/framework/custom.d.ts +12 -0
- package/dist/migrate/framework/custom.js +96 -0
- package/dist/migrate/framework/custom.js.map +1 -0
- package/dist/migrate/framework/orchestrator.d.ts +113 -0
- package/dist/migrate/framework/orchestrator.js +532 -0
- package/dist/migrate/framework/orchestrator.js.map +1 -0
- package/dist/migrate/framework/plugin.d.ts +167 -0
- package/dist/migrate/framework/plugin.js +3 -0
- package/dist/migrate/framework/plugin.js.map +1 -0
- package/dist/migrate/framework/registry.d.ts +11 -0
- package/dist/migrate/framework/registry.js +44 -0
- package/dist/migrate/framework/registry.js.map +1 -0
- package/dist/migrate/framework/report.d.ts +17 -0
- package/dist/migrate/framework/report.js +103 -0
- package/dist/migrate/framework/report.js.map +1 -0
- package/dist/migrate/frameworks/plugins.d.ts +29 -0
- package/dist/migrate/frameworks/plugins.js +402 -0
- package/dist/migrate/frameworks/plugins.js.map +1 -0
- package/dist/migrate/frameworks/report.d.ts +92 -0
- package/dist/migrate/frameworks/report.js +207 -0
- package/dist/migrate/frameworks/report.js.map +1 -0
- package/dist/migrate/frameworks/translate-js.d.ts +5 -0
- package/dist/migrate/frameworks/translate-js.js +503 -0
- package/dist/migrate/frameworks/translate-js.js.map +1 -0
- package/dist/migrate/frameworks/translate-rails-django.d.ts +3 -0
- package/dist/migrate/frameworks/translate-rails-django.js +1391 -0
- package/dist/migrate/frameworks/translate-rails-django.js.map +1 -0
- package/dist/migrate/frontegg/plugin.d.ts +2 -0
- package/dist/migrate/frontegg/plugin.js +78 -0
- package/dist/migrate/frontegg/plugin.js.map +1 -0
- package/dist/migrate/fusionauth/plugin.d.ts +2 -0
- package/dist/migrate/fusionauth/plugin.js +109 -0
- package/dist/migrate/fusionauth/plugin.js.map +1 -0
- package/dist/migrate/hanko/plugin.d.ts +2 -0
- package/dist/migrate/hanko/plugin.js +100 -0
- package/dist/migrate/hanko/plugin.js.map +1 -0
- package/dist/migrate/keycloak/plugin.d.ts +2 -0
- package/dist/migrate/keycloak/plugin.js +148 -0
- package/dist/migrate/keycloak/plugin.js.map +1 -0
- package/dist/migrate/kinde/plugin.d.ts +2 -0
- package/dist/migrate/kinde/plugin.js +105 -0
- package/dist/migrate/kinde/plugin.js.map +1 -0
- package/dist/migrate/ldap/plugin.d.ts +2 -0
- package/dist/migrate/ldap/plugin.js +73 -0
- package/dist/migrate/ldap/plugin.js.map +1 -0
- package/dist/migrate/logto/plugin.d.ts +2 -0
- package/dist/migrate/logto/plugin.js +131 -0
- package/dist/migrate/logto/plugin.js.map +1 -0
- package/dist/migrate/magic/plugin.d.ts +2 -0
- package/dist/migrate/magic/plugin.js +56 -0
- package/dist/migrate/magic/plugin.js.map +1 -0
- package/dist/migrate/nhost/plugin.d.ts +2 -0
- package/dist/migrate/nhost/plugin.js +115 -0
- package/dist/migrate/nhost/plugin.js.map +1 -0
- package/dist/migrate/oidc/plugin.d.ts +2 -0
- package/dist/migrate/oidc/plugin.js +73 -0
- package/dist/migrate/oidc/plugin.js.map +1 -0
- package/dist/migrate/okta/plugin.d.ts +2 -0
- package/dist/migrate/okta/plugin.js +105 -0
- package/dist/migrate/okta/plugin.js.map +1 -0
- package/dist/migrate/onelogin/plugin.d.ts +2 -0
- package/dist/migrate/onelogin/plugin.js +61 -0
- package/dist/migrate/onelogin/plugin.js.map +1 -0
- package/dist/migrate/ory/plugin.d.ts +2 -0
- package/dist/migrate/ory/plugin.js +186 -0
- package/dist/migrate/ory/plugin.js.map +1 -0
- package/dist/migrate/ping-identity/plugin.d.ts +2 -0
- package/dist/migrate/ping-identity/plugin.js +100 -0
- package/dist/migrate/ping-identity/plugin.js.map +1 -0
- package/dist/migrate/pocketbase/plugin.d.ts +2 -0
- package/dist/migrate/pocketbase/plugin.js +99 -0
- package/dist/migrate/pocketbase/plugin.js.map +1 -0
- package/dist/migrate/propelauth/plugin.d.ts +2 -0
- package/dist/migrate/propelauth/plugin.js +65 -0
- package/dist/migrate/propelauth/plugin.js.map +1 -0
- package/dist/migrate/saml/plugin.d.ts +2 -0
- package/dist/migrate/saml/plugin.js +79 -0
- package/dist/migrate/saml/plugin.js.map +1 -0
- package/dist/migrate/stytch/plugin.d.ts +2 -0
- package/dist/migrate/stytch/plugin.js +97 -0
- package/dist/migrate/stytch/plugin.js.map +1 -0
- package/dist/migrate/supabase/plugin.d.ts +2 -0
- package/dist/migrate/supabase/plugin.js +149 -0
- package/dist/migrate/supabase/plugin.js.map +1 -0
- package/dist/migrate/supertokens/plugin.d.ts +2 -0
- package/dist/migrate/supertokens/plugin.js +114 -0
- package/dist/migrate/supertokens/plugin.js.map +1 -0
- package/dist/migrate/user-table/plugin.d.ts +2 -0
- package/dist/migrate/user-table/plugin.js +62 -0
- package/dist/migrate/user-table/plugin.js.map +1 -0
- package/dist/migrate/userfront/plugin.d.ts +2 -0
- package/dist/migrate/userfront/plugin.js +60 -0
- package/dist/migrate/userfront/plugin.js.map +1 -0
- package/dist/migrate/workos/plugin.d.ts +2 -0
- package/dist/migrate/workos/plugin.js +81 -0
- package/dist/migrate/workos/plugin.js.map +1 -0
- package/dist/migrate/zitadel/plugin.d.ts +2 -0
- package/dist/migrate/zitadel/plugin.js +114 -0
- package/dist/migrate/zitadel/plugin.js.map +1 -0
- package/dist/output.d.ts +41 -0
- package/dist/output.js +72 -0
- package/dist/output.js.map +1 -0
- package/dist/project.d.ts +64 -0
- package/dist/project.js +86 -0
- package/dist/project.js.map +1 -0
- package/dist/prompt.d.ts +15 -0
- package/dist/prompt.js +46 -0
- package/dist/prompt.js.map +1 -0
- package/dist/run.d.ts +12 -0
- package/dist/run.js +157 -0
- package/dist/run.js.map +1 -0
- package/dist/secrets.d.ts +41 -0
- package/dist/secrets.js +142 -0
- package/dist/secrets.js.map +1 -0
- package/dist/serialize.d.ts +30 -0
- package/dist/serialize.js +131 -0
- package/dist/serialize.js.map +1 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.js +21 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.importBetterAuthBundle = importBetterAuthBundle;
|
|
4
|
+
const backend_1 = require("@atlasauth/backend");
|
|
5
|
+
const args_1 = require("../args");
|
|
6
|
+
const errors_1 = require("../errors");
|
|
7
|
+
const output_1 = require("../output");
|
|
8
|
+
const project_1 = require("../project");
|
|
9
|
+
const shared_1 = require("./shared");
|
|
10
|
+
function parseOptions(ctx, raw) {
|
|
11
|
+
if (!raw)
|
|
12
|
+
return undefined;
|
|
13
|
+
const text = raw.startsWith('@') ? ctx.readFile(raw.slice(1)) : raw;
|
|
14
|
+
try {
|
|
15
|
+
const v = JSON.parse(text);
|
|
16
|
+
if (!v || typeof v !== 'object' || Array.isArray(v))
|
|
17
|
+
throw new Error('not an object');
|
|
18
|
+
return v;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
throw new errors_1.CliError('--options must be a JSON object, or @<file> holding one.');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function printReport(ctx, imp) {
|
|
25
|
+
const out = (s) => ctx.io.out(s);
|
|
26
|
+
const r = imp.report;
|
|
27
|
+
if (!r)
|
|
28
|
+
return;
|
|
29
|
+
out('Dry run (nothing imported yet):');
|
|
30
|
+
for (const m of r.models) {
|
|
31
|
+
out(` ${m.label.padEnd(44)} ${String(m.found).padStart(6)} found ${String(m.will_create).padStart(6)} new ${String(m.will_update).padStart(6)} existing ${String(m.will_skip).padStart(6)} skipped`);
|
|
32
|
+
}
|
|
33
|
+
if (r.conflicts_total) {
|
|
34
|
+
out(`Conflicts with existing Atlas data: ${r.conflicts_total}`);
|
|
35
|
+
for (const c of r.conflicts.slice(0, 10))
|
|
36
|
+
out(` [${c.resolution}] ${c.model} ${c.row_id ?? ''}: ${c.message}`);
|
|
37
|
+
}
|
|
38
|
+
for (const a of r.action_items)
|
|
39
|
+
out(`${a.severity === 'required' ? 'REQUIRED' : a.severity === 'recommended' ? 'todo' : 'note'}: ${a.message} (${a.count}${a.items.length ? `: ${a.items.slice(0, 5).join(', ')}` : ''})`);
|
|
40
|
+
for (const w of r.warnings)
|
|
41
|
+
out(`warning: ${w}`);
|
|
42
|
+
if (r.skipped_total) {
|
|
43
|
+
out(`Skipped rows: ${r.skipped_total}`);
|
|
44
|
+
for (const [code, n] of Object.entries(r.skipped_by_code))
|
|
45
|
+
out(` ${code}: ${n}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function printResult(ctx, imp) {
|
|
49
|
+
const r = imp.result;
|
|
50
|
+
if (!r)
|
|
51
|
+
return;
|
|
52
|
+
ctx.io.out(`Imported (import ${imp.id}):`);
|
|
53
|
+
for (const m of r.models) {
|
|
54
|
+
ctx.io.out(` ${m.label.padEnd(44)} ${m.created} created, ${m.updated + m.unchanged} existing, ${m.skipped} skipped, ${m.failed} failed`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function poll(ctx, http, imp, json) {
|
|
58
|
+
const sleep = ctx.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
59
|
+
let last = -1;
|
|
60
|
+
while (['analyzing', 'queued', 'applying'].includes(imp.status)) {
|
|
61
|
+
await sleep(2000);
|
|
62
|
+
imp = await http.get(`/v1/better_auth_imports/${encodeURIComponent(imp.id)}`);
|
|
63
|
+
const pct = imp.progress?.percent ?? -1;
|
|
64
|
+
if (!json && pct !== last && imp.progress)
|
|
65
|
+
ctx.io.err(` ${imp.status}: ${imp.progress.processed}/${imp.progress.total} (${pct}%)`);
|
|
66
|
+
last = pct;
|
|
67
|
+
}
|
|
68
|
+
return imp;
|
|
69
|
+
}
|
|
70
|
+
async function importBetterAuthBundle(ctx, args) {
|
|
71
|
+
const json = (0, shared_1.wantsJson)(args.values);
|
|
72
|
+
const auth = (0, shared_1.resolveAuth)(ctx, args.values);
|
|
73
|
+
const http = (0, project_1.httpFor)(ctx, { secretKey: auth.secretKey, apiUrl: auth.apiUrl });
|
|
74
|
+
const bundle = (0, args_1.str)(args.values, 'bundle');
|
|
75
|
+
const existing = (0, args_1.str)(args.values, 'import');
|
|
76
|
+
const options = parseOptions(ctx, (0, args_1.str)(args.values, 'options'));
|
|
77
|
+
if (!bundle && !existing) {
|
|
78
|
+
const key = await http.get('/v1/better_auth_imports/public_key');
|
|
79
|
+
if (json)
|
|
80
|
+
(0, output_1.printJson)(ctx.io, key);
|
|
81
|
+
else {
|
|
82
|
+
ctx.io.out(`Import key ${key.kid} (fingerprint ${key.fingerprint}).`);
|
|
83
|
+
ctx.io.out('In your Better Auth app, run:');
|
|
84
|
+
ctx.io.out(` npx atlas-better-auth-export --out better-auth.atlas-bundle --public-key ${key.compact}`);
|
|
85
|
+
ctx.io.out('then:');
|
|
86
|
+
ctx.io.out(' atlas import --from better-auth --bundle better-auth.atlas-bundle');
|
|
87
|
+
}
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
90
|
+
let imp;
|
|
91
|
+
if (bundle) {
|
|
92
|
+
const text = ctx.readFile(bundle);
|
|
93
|
+
const parts = (0, backend_1.splitBundleParts)(text);
|
|
94
|
+
if (parts.length === 0)
|
|
95
|
+
throw new errors_1.CliError(`${bundle} is empty.`);
|
|
96
|
+
imp = await http.post('/v1/better_auth_imports', options ? { options } : {});
|
|
97
|
+
for (let i = 0; i < parts.length; i++) {
|
|
98
|
+
await http.put(`/v1/better_auth_imports/${encodeURIComponent(imp.id)}/parts/${i + 1}`, { data: parts[i] });
|
|
99
|
+
if (!json)
|
|
100
|
+
ctx.io.err(` uploaded part ${i + 1}/${parts.length}`);
|
|
101
|
+
}
|
|
102
|
+
imp = await http.post(`/v1/better_auth_imports/${encodeURIComponent(imp.id)}/finalize`, {});
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
imp = await http.get(`/v1/better_auth_imports/${encodeURIComponent(existing)}`);
|
|
106
|
+
if (imp.status === 'uploading') {
|
|
107
|
+
imp = await http.post(`/v1/better_auth_imports/${encodeURIComponent(imp.id)}/finalize`, {});
|
|
108
|
+
}
|
|
109
|
+
else if (options && ['ready', 'failed', 'completed'].includes(imp.status)) {
|
|
110
|
+
imp = await http.post(`/v1/better_auth_imports/${encodeURIComponent(imp.id)}/dry_run`, { options });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
imp = await poll(ctx, http, imp, json);
|
|
114
|
+
if (imp.status === 'invalid' || (imp.status === 'failed' && !imp.analyzed_at)) {
|
|
115
|
+
if (json)
|
|
116
|
+
(0, output_1.printJson)(ctx.io, imp);
|
|
117
|
+
throw new errors_1.CliError(`Atlas could not read the bundle: ${imp.error?.message ?? imp.status} (${imp.error?.code ?? imp.status}).`);
|
|
118
|
+
}
|
|
119
|
+
if (imp.status === 'completed' && !options) {
|
|
120
|
+
if (json)
|
|
121
|
+
(0, output_1.printJson)(ctx.io, imp);
|
|
122
|
+
else {
|
|
123
|
+
ctx.io.out(`Import ${imp.id} is already complete.`);
|
|
124
|
+
printResult(ctx, imp);
|
|
125
|
+
}
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
128
|
+
if (!json)
|
|
129
|
+
printReport(ctx, imp);
|
|
130
|
+
if (args.values['dry-run']) {
|
|
131
|
+
if (json)
|
|
132
|
+
(0, output_1.printJson)(ctx.io, imp);
|
|
133
|
+
else
|
|
134
|
+
ctx.io.out(`Nothing was imported. Apply it with: atlas import --from better-auth --import ${imp.id}`);
|
|
135
|
+
return 0;
|
|
136
|
+
}
|
|
137
|
+
const conflicts = imp.report?.conflicts_total ?? 0;
|
|
138
|
+
if (conflicts > 0 && !args.values['confirm-conflicts']) {
|
|
139
|
+
if (json)
|
|
140
|
+
(0, output_1.printJson)(ctx.io, imp);
|
|
141
|
+
throw new errors_1.CliError(`The dry run found ${conflicts} conflict(s). Review them, then re-run with --import ${imp.id} --confirm-conflicts.`);
|
|
142
|
+
}
|
|
143
|
+
if (!args.values.yes && !json) {
|
|
144
|
+
const answer = (await ctx.prompt.text(`Import into Atlas now? [y/N] `)).trim().toLowerCase();
|
|
145
|
+
if (answer !== 'y' && answer !== 'yes') {
|
|
146
|
+
ctx.io.out(`Not applied. Apply later with: atlas import --from better-auth --import ${imp.id}`);
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
imp = await http.post(`/v1/better_auth_imports/${encodeURIComponent(imp.id)}/apply`, conflicts > 0 ? { confirm_conflicts: true } : {});
|
|
151
|
+
imp = await poll(ctx, http, imp, json);
|
|
152
|
+
if (json)
|
|
153
|
+
(0, output_1.printJson)(ctx.io, imp);
|
|
154
|
+
else
|
|
155
|
+
printResult(ctx, imp);
|
|
156
|
+
if (imp.status !== 'completed') {
|
|
157
|
+
throw new errors_1.CliError(`The import stopped (${imp.error?.message ?? imp.status}). Run the same command with --import ${imp.id} to resume.`);
|
|
158
|
+
}
|
|
159
|
+
const failed = imp.progress?.failed ?? 0;
|
|
160
|
+
if (!json)
|
|
161
|
+
ctx.io.out(`Done. Next: turn on the session bridge so signed-in users stay signed in, then switch your app's SDK to Atlas.`);
|
|
162
|
+
return failed > 0 ? 2 : 0;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=import-better-auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-better-auth.js","sourceRoot":"","sources":["../../src/commands/import-better-auth.ts"],"names":[],"mappings":";;AAkFA,wDAmFC;AArKD,gDAAuG;AACvG,kCAA+C;AAE/C,sCAAqC;AACrC,sCAAsC;AACtC,wCAAqC;AACrC,qCAAkD;AAsBlD,SAAS,YAAY,CAAC,GAAe,EAAE,GAAuB;IAC5D,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpE,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;QACtC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,MAAM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AE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACzJ,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACvC,IAAI,IAAI;QAAE,IAAA,kBAAS,EAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;;QAC5B,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,GAAG,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QAC/B,MAAM,IAAI,iBAAQ,CAAC,uBAAuB,GAAG,CAAC,KAAK,EAAE,OAAO,IAAI,GAAG,CAAC,MAAM,yCAAyC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;IAC1I,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI;QAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,gHAAgH,CAAC,CAAC;IACxI,OAAO,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.importUsers = importUsers;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const args_1 = require("../args");
|
|
7
|
+
const errors_1 = require("../errors");
|
|
8
|
+
const output_1 = require("../output");
|
|
9
|
+
const project_1 = require("../project");
|
|
10
|
+
const vendors_1 = require("../import/vendors");
|
|
11
|
+
const shared_1 = require("./shared");
|
|
12
|
+
const import_better_auth_1 = require("./import-better-auth");
|
|
13
|
+
async function importUsers(ctx, args) {
|
|
14
|
+
const vendor = (0, args_1.str)(args.values, 'from');
|
|
15
|
+
if (!vendor || !vendors_1.VENDORS.includes(vendor)) {
|
|
16
|
+
throw new errors_1.CliError(`import needs --from <${vendors_1.VENDORS.join('|')}>.`);
|
|
17
|
+
}
|
|
18
|
+
// Better Auth: the sealed bundle from `npx atlas-better-auth-export` carries
|
|
19
|
+
// every model (passwords, two-factor, passkeys, orgs, API keys, sessions…);
|
|
20
|
+
// the table-JSON path below stays for exports made without it.
|
|
21
|
+
if (vendor === 'better-auth' && ((0, args_1.str)(args.values, 'bundle') || (0, args_1.str)(args.values, 'import') || !args.positionals[1])) {
|
|
22
|
+
return (0, import_better_auth_1.importBetterAuthBundle)(ctx, args);
|
|
23
|
+
}
|
|
24
|
+
const file = args.positionals[1];
|
|
25
|
+
if (!file)
|
|
26
|
+
throw new errors_1.CliError(`import needs the export file: atlas import --from ${vendor} <file>`);
|
|
27
|
+
const text = ctx.readFile(file);
|
|
28
|
+
let doc;
|
|
29
|
+
let hashes;
|
|
30
|
+
try {
|
|
31
|
+
doc = (0, vendors_1.parseExport)(text, file);
|
|
32
|
+
const hashesFile = (0, args_1.str)(args.values, 'hashes');
|
|
33
|
+
if (hashesFile)
|
|
34
|
+
hashes = (0, vendors_1.parseExport)(ctx.readFile(hashesFile), hashesFile);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
throw new errors_1.CliError(err instanceof Error ? err.message : String(err));
|
|
38
|
+
}
|
|
39
|
+
const { rows, warnings } = (0, vendors_1.mapExport)(vendor, doc, hashes);
|
|
40
|
+
const json = (0, shared_1.wantsJson)(args.values);
|
|
41
|
+
const summary = (0, vendors_1.summarize)(rows);
|
|
42
|
+
let hashConfig;
|
|
43
|
+
const hashConfigFile = (0, args_1.str)(args.values, 'hash-config');
|
|
44
|
+
if (hashConfigFile) {
|
|
45
|
+
try {
|
|
46
|
+
hashConfig = JSON.parse(ctx.readFile(hashConfigFile));
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
throw new errors_1.CliError(`--hash-config ${hashConfigFile} is not valid JSON.`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (vendor === 'firebase' && (summary.with_password_hash ?? 0) > 0 && !hashConfig && !args.values['dry-run']) {
|
|
53
|
+
throw new errors_1.CliError('Firebase password hashes need the project hash parameters. Copy them from the Firebase console (Authentication > Users > Password hash parameters) into a JSON file and pass --hash-config <file>.');
|
|
54
|
+
}
|
|
55
|
+
if (args.values['dry-run']) {
|
|
56
|
+
if (json)
|
|
57
|
+
(0, output_1.printJson)(ctx.io, { vendor, summary, warnings, sample: rows.slice(0, 3).map(redact) });
|
|
58
|
+
else {
|
|
59
|
+
ctx.io.out(`Dry run: ${rows.length} user(s) mapped from ${vendor}. Nothing was sent.`);
|
|
60
|
+
for (const [k, v] of Object.entries(summary))
|
|
61
|
+
ctx.io.out(` ${k.replace(/_/g, ' ')}: ${v}`);
|
|
62
|
+
for (const w of warnings)
|
|
63
|
+
ctx.io.out(` note: ${w}`);
|
|
64
|
+
}
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
if (rows.length === 0)
|
|
68
|
+
throw new errors_1.CliError('The export contains no users with an email address.');
|
|
69
|
+
const batchSize = Math.min(Math.max(Number((0, args_1.str)(args.values, 'batch-size') ?? 100) || 100, 1), 100);
|
|
70
|
+
const statePath = (0, args_1.str)(args.values, 'state-file') ?? `${file}.atlas-import.json`;
|
|
71
|
+
const sha = (0, node_crypto_1.createHash)('sha256').update(text).digest('hex');
|
|
72
|
+
let state = { vendor, input_sha256: sha, next_index: 0, total: rows.length, succeeded: 0, failed: 0, jobs: [] };
|
|
73
|
+
if ((0, node_fs_1.existsSync)(statePath)) {
|
|
74
|
+
const saved = JSON.parse((0, node_fs_1.readFileSync)(statePath, 'utf8'));
|
|
75
|
+
if (saved.input_sha256 !== sha || saved.vendor !== vendor) {
|
|
76
|
+
throw new errors_1.CliError(`${statePath} belongs to a different export. Delete it or pass --state-file to start over.`);
|
|
77
|
+
}
|
|
78
|
+
state = saved;
|
|
79
|
+
if (state.next_index >= rows.length) {
|
|
80
|
+
ctx.io.out(`Already imported: ${state.succeeded} succeeded, ${state.failed} failed. Delete ${statePath} to run again.`);
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
ctx.io.err(`Resuming at user ${state.next_index + 1} of ${rows.length}.`);
|
|
84
|
+
}
|
|
85
|
+
const auth = (0, shared_1.resolveAuth)(ctx, args.values);
|
|
86
|
+
const http = (0, project_1.httpFor)(ctx, { secretKey: auth.secretKey, apiUrl: auth.apiUrl });
|
|
87
|
+
for (const w of warnings)
|
|
88
|
+
ctx.io.err(`note: ${w}`);
|
|
89
|
+
while (state.next_index < rows.length) {
|
|
90
|
+
const batch = rows.slice(state.next_index, state.next_index + batchSize);
|
|
91
|
+
const body = { users: batch, upsert: true };
|
|
92
|
+
if (args.values['create-orgs'])
|
|
93
|
+
body.create_organizations = true;
|
|
94
|
+
if (hashConfig)
|
|
95
|
+
body.password_hash_config = { firebase: hashConfig };
|
|
96
|
+
let job = await http.post('/v1/user_imports', body);
|
|
97
|
+
// A batch over the inline limit is queued; poll it to completion.
|
|
98
|
+
while (job.status === 'pending' || job.status === 'processing') {
|
|
99
|
+
await (ctx.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms))))(2000);
|
|
100
|
+
job = await http.get(`/v1/jobs/${job.id}`);
|
|
101
|
+
}
|
|
102
|
+
state.next_index += batch.length;
|
|
103
|
+
state.succeeded += job.succeeded;
|
|
104
|
+
state.failed += job.failed;
|
|
105
|
+
state.jobs.push(job.id);
|
|
106
|
+
(0, node_fs_1.writeFileSync)(statePath, JSON.stringify(state, null, 2));
|
|
107
|
+
if (!json)
|
|
108
|
+
ctx.io.err(` ${state.next_index}/${rows.length} sent (job ${job.id}: ${job.succeeded} ok, ${job.failed} issues)`);
|
|
109
|
+
}
|
|
110
|
+
if (json)
|
|
111
|
+
(0, output_1.printJson)(ctx.io, { ...state, summary, warnings });
|
|
112
|
+
else {
|
|
113
|
+
ctx.io.out(`Imported ${rows.length} user(s) from ${vendor}: ${state.succeeded} created or updated, ${state.failed} row issue(s).`);
|
|
114
|
+
if (state.failed)
|
|
115
|
+
ctx.io.out(`Per-row issues: GET /v1/jobs/<job-id>/errors for jobs ${state.jobs.join(', ')}`);
|
|
116
|
+
}
|
|
117
|
+
return state.failed > 0 ? 2 : 0;
|
|
118
|
+
}
|
|
119
|
+
/** A dry-run sample never prints a password hash. */
|
|
120
|
+
function redact(row) {
|
|
121
|
+
return row.password_hash ? { ...row, password_hash: '[redacted]', ...(row.password_salt ? { password_salt: '[redacted]' } : {}) } : row;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/commands/import.ts"],"names":[],"mappings":";;AAgDA,kCAqGC;AArJD,6CAAyC;AACzC,qCAAkE;AAClE,kCAA+C;AAE/C,sCAAqC;AACrC,sCAAsC;AACtC,wCAAqC;AACrC,+CAA4G;AAC5G,qCAAkD;AAClD,6DAA8D;AAuCvD,KAAK,UAAU,WAAW,CAAC,GAAe,EAAE,IAAgB;IACjE,MAAM,MAAM,GAAG,IAAA,UAAG,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAuB,CAAC;IAC9D,IAAI,CAAC,MAAM,IAAI,CAAE,iBAA6B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,iBAAQ,CAAC,wBAAwB,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpE,CAAC;IACD,6EAA6E;IAC7E,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAI,MAAM,KAAK,aAAa,IAAI,CAAC,IAAA,UAAG,EAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,IAAA,UAAG,EAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,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,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,qDAAqD;AACrD,SAAS,MAAM,CAAC,GAAc;IAC5B,OAAO,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AAC1I,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ParsedArgs } from '../args';
|
|
2
|
+
import type { RunContext } from '../context';
|
|
3
|
+
export interface InfoPackage {
|
|
4
|
+
name: string;
|
|
5
|
+
wanted: string;
|
|
6
|
+
installed: string | null;
|
|
7
|
+
latest: string | null;
|
|
8
|
+
update_available: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface InfoReport {
|
|
11
|
+
object: 'atlas_info';
|
|
12
|
+
generated_at: string;
|
|
13
|
+
cli: {
|
|
14
|
+
version: string;
|
|
15
|
+
latest: string | null;
|
|
16
|
+
update_available: boolean;
|
|
17
|
+
};
|
|
18
|
+
runtime: {
|
|
19
|
+
node: string;
|
|
20
|
+
platform: string;
|
|
21
|
+
arch: string;
|
|
22
|
+
};
|
|
23
|
+
project: {
|
|
24
|
+
path: string;
|
|
25
|
+
name: string | null;
|
|
26
|
+
framework: {
|
|
27
|
+
name: string;
|
|
28
|
+
package: string;
|
|
29
|
+
version: string | null;
|
|
30
|
+
} | null;
|
|
31
|
+
packages: InfoPackage[];
|
|
32
|
+
};
|
|
33
|
+
instance: {
|
|
34
|
+
configured: boolean;
|
|
35
|
+
api_url: string | null;
|
|
36
|
+
key_source: string | null;
|
|
37
|
+
secret_key_prefix: string | null;
|
|
38
|
+
instance_id: string | null;
|
|
39
|
+
environment: string | null;
|
|
40
|
+
frontend_api_host: string | null;
|
|
41
|
+
publishable_key_prefix: string | null;
|
|
42
|
+
publishable_key_source: string | null;
|
|
43
|
+
publishable_key_matches_instance: boolean | null;
|
|
44
|
+
error: string | null;
|
|
45
|
+
};
|
|
46
|
+
api: {
|
|
47
|
+
reachable: boolean;
|
|
48
|
+
health_status: number | null;
|
|
49
|
+
health_latency_ms: number | null;
|
|
50
|
+
instance_latency_ms: number | null;
|
|
51
|
+
error: string | null;
|
|
52
|
+
};
|
|
53
|
+
preflight: {
|
|
54
|
+
ran: boolean;
|
|
55
|
+
ok: boolean | null;
|
|
56
|
+
errors: number;
|
|
57
|
+
warnings: number;
|
|
58
|
+
info: number;
|
|
59
|
+
findings: Array<{
|
|
60
|
+
severity: string;
|
|
61
|
+
code: string;
|
|
62
|
+
}>;
|
|
63
|
+
error: string | null;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** `atlas_live_sk_abc…` → `atlas_live_sk_`, `sk_live_abc…` → `sk_live_`; anything else → its first 3 chars. */
|
|
67
|
+
export declare function keyPrefix(key: string): string;
|
|
68
|
+
/** Mask anything that looks like an Atlas (or other bearer) secret in free text. */
|
|
69
|
+
export declare function redactSecrets(text: string): string;
|
|
70
|
+
/** Dotted-number compare that tolerates prerelease tags (`1.2.0-rc.1` < `1.2.0`). */
|
|
71
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
72
|
+
export declare function info(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
73
|
+
export declare function collectInfo(ctx: RunContext, args: ParsedArgs): Promise<InfoReport>;
|
|
74
|
+
/** The human block: aligned, copyable, nothing secret. */
|
|
75
|
+
export declare function renderInfo(r: InfoReport): string[];
|