@atlasauth/cli 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/args.d.ts +121 -0
- package/dist/args.js +45 -0
- package/dist/args.js.map +1 -1
- package/dist/commands/config.js +71 -6
- package/dist/commands/config.js.map +1 -1
- 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/init.js +13 -8
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +6 -2
- package/dist/commands/migrate.js +13 -3
- package/dist/commands/migrate.js.map +1 -1
- 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/context.d.ts +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.js +96 -2
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- 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/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/run.js +4 -0
- package/dist/run.js.map +1 -1
- package/package.json +7 -5
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.supabasePlugin = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const supabase_1 = require("../export/supabase");
|
|
6
|
+
const supabase_config_1 = require("../export/supabase-config");
|
|
7
|
+
const errors_1 = require("../../errors");
|
|
8
|
+
const plugin_kit_1 = require("../export/plugin-kit");
|
|
9
|
+
/**
|
|
10
|
+
* `atlas migrate supabase` — Supabase Auth, hosted or self-hosted: its
|
|
11
|
+
* `config.toml` (or the hosted project's settings through the Management
|
|
12
|
+
* API) as Atlas config; users with their bcrypt / argon2 / Firebase-scrypt
|
|
13
|
+
* hashes, identities, SAML connections, TOTP secrets, phone and WebAuthn
|
|
14
|
+
* factors, recovery-code hashes and live sessions from a dump of the auth
|
|
15
|
+
* schema made on this machine; the `supabase` bridge preset (a Supabase
|
|
16
|
+
* access token becomes an Atlas session); lazy migration when only the Admin
|
|
17
|
+
* API is available; and the code. Nothing here connects to the database.
|
|
18
|
+
*/
|
|
19
|
+
const PROJECT_URL = { flag: '--supabase-url', env: 'SUPABASE_URL', label: 'your project URL (https://<ref>.supabase.co)', required: false };
|
|
20
|
+
const DUMP = { flag: '--supabase-dump', env: 'SUPABASE_DUMP_DIR', label: 'a folder of auth-schema table dumps (users.csv, identities.csv, …)', required: false };
|
|
21
|
+
const SERVICE_ROLE = { flag: '--supabase-service-role-key', env: 'SUPABASE_SERVICE_ROLE_KEY', label: 'the service_role / secret key (Admin API export only)', required: false, secret: true };
|
|
22
|
+
const CONFIG_FILE = { flag: '--supabase-config', env: 'SUPABASE_CONFIG_TOML', label: 'supabase/config.toml', required: false };
|
|
23
|
+
const ACCESS_TOKEN = { flag: '--supabase-access-token', env: 'SUPABASE_ACCESS_TOKEN', label: 'a personal access token (Management API)', required: false, secret: true };
|
|
24
|
+
const PROJECT_REF = { flag: '--supabase-project-ref', env: 'SUPABASE_PROJECT_REF', label: 'the project ref (the subdomain of <ref>.supabase.co)', required: false };
|
|
25
|
+
const ANONYMOUS = { flag: '--supabase-anonymous', env: 'SUPABASE_ANONYMOUS', label: '"include" to export anonymous users too', required: false };
|
|
26
|
+
const ANON_KEY = { flag: '--supabase-anon-key', env: 'SUPABASE_ANON_KEY', label: 'the anon / publishable key, for lazy migration', required: false };
|
|
27
|
+
const DB_KEYS = { flag: '--supabase-db-encryption-keys', env: 'GOTRUE_SECURITY_DB_ENCRYPTION_KEYS', label: 'GoTrue column-encryption keys, comma-separated key_id:key (only when GOTRUE_SECURITY_DB_ENCRYPTION_ENCRYPT is on)', required: false, secret: true };
|
|
28
|
+
const BRIDGE = { flag: '--supabase-bridge', env: 'SUPABASE_BRIDGE', label: 'what the bridge exchanges: access-token (default; up to a week past expiry) or refresh-token (the sessions the dump imported)', required: false };
|
|
29
|
+
const AUTH_URL = { flag: '--supabase-auth-url', env: 'SUPABASE_AUTH_URL', label: 'self-hosted or custom domain: the Auth URL (https://db.example.com/auth/v1)', required: false };
|
|
30
|
+
const COOKIE_NAME = { flag: '--supabase-cookie-name', env: 'SUPABASE_COOKIE_NAME', label: 'self-hosted: the SSR cookie name (sb-<first label of the host>-auth-token)', required: false };
|
|
31
|
+
const RP_ID = { flag: '--rp-id', env: 'ATLAS_MIGRATE_RP_ID', label: 'the WebAuthn relying party id passkeys were registered for', required: false };
|
|
32
|
+
/** The project ref, from the flag or a hosted URL. */
|
|
33
|
+
function refOf(p) {
|
|
34
|
+
const ref = p.credential(PROJECT_REF);
|
|
35
|
+
if (ref)
|
|
36
|
+
return ref.trim();
|
|
37
|
+
const url = p.credential(PROJECT_URL);
|
|
38
|
+
return url ? /^https:\/\/([a-z0-9]+)\.supabase\.co\/?$/.exec(url.trim())?.[1] : undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* `supabase` (hosted access tokens), `supabase_self_hosted` (an Auth URL of
|
|
42
|
+
* your own) or `supabase_refresh_token` (refresh tokens among the sessions the
|
|
43
|
+
* dump imported; hosted cookie names).
|
|
44
|
+
*/
|
|
45
|
+
function bridgePreset(p) {
|
|
46
|
+
const mode = (p.credential(BRIDGE) ?? 'access-token').trim().toLowerCase();
|
|
47
|
+
if (mode === 'refresh-token') {
|
|
48
|
+
if (p.credential(AUTH_URL))
|
|
49
|
+
throw new errors_1.CliError('Supabase: --set supabase-bridge=refresh-token reads the hosted cookie (sb-<ref>-auth-token); for a self-hosted project use the access-token bridge, or set the preset and cookie name through the bridge API.');
|
|
50
|
+
return 'supabase_refresh_token';
|
|
51
|
+
}
|
|
52
|
+
if (mode !== 'access-token')
|
|
53
|
+
throw new errors_1.CliError(`Supabase: --set supabase-bridge takes access-token or refresh-token (got ${mode}).`);
|
|
54
|
+
return p.credential(AUTH_URL) ? 'supabase_self_hosted' : 'supabase';
|
|
55
|
+
}
|
|
56
|
+
exports.supabasePlugin = {
|
|
57
|
+
vendor: 'supabase',
|
|
58
|
+
source: 'supabase',
|
|
59
|
+
label: 'Supabase Auth',
|
|
60
|
+
help: 'Move Supabase Auth (hosted or self-hosted): config.toml or the hosted project settings as Atlas config; users with their password hashes, social and SAML identities, TOTP secrets, phone and WebAuthn factors and live sessions from a dump of the auth schema you make with psql; a zero-logout bridge for Supabase access tokens; lazy migration when you only have the Admin API; and the code. Database access stays on this machine.',
|
|
61
|
+
config: {
|
|
62
|
+
reads: 'supabase/config.toml (or the hosted project through the Management API)',
|
|
63
|
+
credentials: [CONFIG_FILE, ACCESS_TOKEN, PROJECT_REF, PROJECT_URL],
|
|
64
|
+
async translate(p) {
|
|
65
|
+
const token = p.credential(ACCESS_TOKEN);
|
|
66
|
+
const ref = refOf(p);
|
|
67
|
+
if (token && ref) {
|
|
68
|
+
return (0, supabase_config_1.translateSupabaseConfig)(await (0, plugin_kit_1.vendorStep)('Supabase', () => (0, supabase_config_1.fetchSupabaseAuthConfig)({ projectRef: ref, accessToken: token, fetchImpl: p.fetch })));
|
|
69
|
+
}
|
|
70
|
+
const path = p.credential(CONFIG_FILE) ?? `${p.project}/supabase/config.toml`;
|
|
71
|
+
let text;
|
|
72
|
+
try {
|
|
73
|
+
text = p.ctx.readFile((0, node_path_1.resolve)(path));
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
throw new errors_1.CliError(`Supabase: no config.toml at ${path}. Pass --set supabase-config=<path>, or a personal access token and project ref to read the hosted project.`);
|
|
77
|
+
}
|
|
78
|
+
const settings = (0, supabase_config_1.settingsFromToml)(text, path);
|
|
79
|
+
return (0, supabase_config_1.translateSupabaseConfig)(ref ? { ...settings, projectRef: ref } : settings);
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
export: {
|
|
83
|
+
reads: 'a dump of the auth schema (psql \\copy of auth.users, identities, mfa_factors, sessions, refresh_tokens, sso_*, webauthn_credentials) or the Admin API',
|
|
84
|
+
credentials: [DUMP, PROJECT_URL, SERVICE_ROLE, ANONYMOUS, RP_ID, DB_KEYS],
|
|
85
|
+
limits: [
|
|
86
|
+
'Password hashes, TOTP secrets and sessions live only in the database: dump the auth schema (see the guide). The Admin API export has none of them, and passwords then move by lazy migration.',
|
|
87
|
+
'Values encrypted with GoTrue column encryption (GOTRUE_SECURITY_DB_ENCRYPTION_*) are decrypted on this machine with --set supabase-db-encryption-keys=<key_id>:<key>; without the keys those passwords move by lazy migration and those TOTP users enrol again.',
|
|
88
|
+
'Recovery codes move as their argon2id hashes; passkeys and WebAuthn factors only with --rp-id and when Atlas serves sign-in on that domain.',
|
|
89
|
+
'Refresh tokens in the newer signed format (no auth.refresh_tokens row) cannot be exported; the supabase bridge still exchanges the access token.',
|
|
90
|
+
],
|
|
91
|
+
async run(p, writer, resume) {
|
|
92
|
+
const dump = p.credential(DUMP);
|
|
93
|
+
const url = p.credential(PROJECT_URL);
|
|
94
|
+
const key = dump ? undefined : p.credential(SERVICE_ROLE);
|
|
95
|
+
if (!dump && !(url && key)) {
|
|
96
|
+
throw new errors_1.CliError('Supabase: pass a folder of auth-schema dumps (--set supabase-dump=<folder>), or the project URL and service_role key for an Admin API export without password hashes.');
|
|
97
|
+
}
|
|
98
|
+
const set = await (0, plugin_kit_1.vendorStep)('Supabase', () => (0, supabase_1.exportSupabase)({
|
|
99
|
+
dumpDir: dump ? (0, node_path_1.resolve)(dump) : undefined,
|
|
100
|
+
url,
|
|
101
|
+
serviceRoleKey: key,
|
|
102
|
+
rpId: p.credential(RP_ID),
|
|
103
|
+
includeAnonymous: p.credential(ANONYMOUS) === 'include',
|
|
104
|
+
dbEncryptionKeys: p.credential(DB_KEYS)?.split(',').map((k) => k.trim()).filter(Boolean),
|
|
105
|
+
fetchImpl: p.fetch,
|
|
106
|
+
onProgress: (m) => p.say(` reading ${m}`),
|
|
107
|
+
}));
|
|
108
|
+
await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
bridge: {
|
|
112
|
+
preset: 'supabase',
|
|
113
|
+
presetFor: bridgePreset,
|
|
114
|
+
vars(p, t) {
|
|
115
|
+
const vars = { ...t?.bridge?.vars };
|
|
116
|
+
const preset = bridgePreset(p);
|
|
117
|
+
if (preset === 'supabase_self_hosted') {
|
|
118
|
+
const authUrl = p.credential(AUTH_URL).trim().replace(/\/+$/, '');
|
|
119
|
+
delete vars.project_ref;
|
|
120
|
+
vars.auth_url = authUrl;
|
|
121
|
+
const host = /^https?:\/\/([^/:]+)/i.exec(authUrl)?.[1];
|
|
122
|
+
if (!host)
|
|
123
|
+
throw new errors_1.CliError(`Supabase: --set supabase-auth-url must be an https URL ending in /auth/v1 (got ${authUrl}).`);
|
|
124
|
+
// @supabase/ssr names the cookie after the first label of the project host.
|
|
125
|
+
vars.cookie_name = p.credential(COOKIE_NAME)?.trim() ?? `sb-${host.split('.')[0]}-auth-token`;
|
|
126
|
+
return vars;
|
|
127
|
+
}
|
|
128
|
+
const ref = refOf(p);
|
|
129
|
+
if (ref)
|
|
130
|
+
vars.project_ref = ref;
|
|
131
|
+
return vars;
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
lazy: {
|
|
135
|
+
preset: 'supabase',
|
|
136
|
+
config(p, t) {
|
|
137
|
+
const config = { ...t?.lazy?.config };
|
|
138
|
+
const url = p.credential(PROJECT_URL);
|
|
139
|
+
if (url)
|
|
140
|
+
config.url = url.trim().replace(/\/+$/, '');
|
|
141
|
+
const anon = p.credential(ANON_KEY);
|
|
142
|
+
if (anon)
|
|
143
|
+
config.anon_key = anon;
|
|
144
|
+
return config;
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
codemod: 'supabase',
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/supabase/plugin.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,iDAAoD;AACpD,+DAA+G;AAC/G,yCAAwC;AAExC,qDAAkE;AAElE;;;;;;;;;GASG;AAEH,MAAM,WAAW,GAAmB,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,8CAA8C,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC5J,MAAM,IAAI,GAAmB,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,oEAAoE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACjL,MAAM,YAAY,GAAmB,EAAE,IAAI,EAAE,6BAA6B,EAAE,GAAG,EAAE,2BAA2B,EAAE,KAAK,EAAE,uDAAuD,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC9M,MAAM,WAAW,GAAmB,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC/I,MAAM,YAAY,GAAmB,E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EAAE,CAAC;YACT,MAAM,MAAM,GAA2B,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YAC9D,MAAM,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YACtC,IAAI,GAAG;gBAAE,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACrD,MAAM,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,IAAI;gBAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;YACjC,OAAO,MAAM,CAAC;QAChB,CAAC;KACF;IACD,OAAO,EAAE,UAAU;CACpB,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.supertokensPlugin = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const errors_1 = require("../../errors");
|
|
6
|
+
const tables_1 = require("../export/frameworks/tables");
|
|
7
|
+
const plugin_kit_1 = require("../export/plugin-kit");
|
|
8
|
+
const supertokens_1 = require("../export/supertokens");
|
|
9
|
+
const supertokens_config_1 = require("../export/supertokens-config");
|
|
10
|
+
/**
|
|
11
|
+
* `atlas migrate supertokens` — a SuperTokens core (self-hosted or the managed
|
|
12
|
+
* service): the core's recipes, providers and token settings as Atlas config;
|
|
13
|
+
* users with their linked login methods, verified emails, third-party links,
|
|
14
|
+
* metadata, roles and tenants through the core API with its API key (on this
|
|
15
|
+
* machine) or from a dump of the core database, which also carries bcrypt /
|
|
16
|
+
* Argon2 password hashes and TOTP secrets; the `supertokens` bridge preset (the
|
|
17
|
+
* session's access token verified against your backend's JWKS); lazy migration
|
|
18
|
+
* through the core's own sign-in; and the code.
|
|
19
|
+
*/
|
|
20
|
+
const CONNECTION_URI = { flag: '--supertokens-connection-uri', env: 'SUPERTOKENS_CONNECTION_URI', label: 'the core address (https://st-dev-xxxx.aws.supertokens.io, or http://localhost:3567)', required: false };
|
|
21
|
+
const API_KEY = { flag: '--supertokens-api-key', env: 'SUPERTOKENS_API_KEY', label: 'the core API key', required: false, secret: true };
|
|
22
|
+
const DUMP = { flag: '--supertokens-dump', env: 'SUPERTOKENS_DUMP_DIR', label: 'a folder of core database table dumps (all_auth_recipe_users.csv, emailpassword_users.csv, …)', required: false };
|
|
23
|
+
const APP_ID = { flag: '--supertokens-app-id', env: 'SUPERTOKENS_APP_ID', label: 'the SuperTokens app id (multi-app cores; default public)', required: false };
|
|
24
|
+
const TENANT_ID = { flag: '--supertokens-tenant-id', env: 'SUPERTOKENS_TENANT_ID', label: 'the tenant the lazy-migration sign-in runs on (default public)', required: false };
|
|
25
|
+
const PREFIX = { flag: '--supertokens-table-prefix', env: 'SUPERTOKENS_TABLE_PREFIX', label: 'the core\'s table_names_prefix, when it has one', required: false };
|
|
26
|
+
const API_DOMAIN = { flag: '--supertokens-api-domain', env: 'SUPERTOKENS_API_DOMAIN', label: 'your backend\'s apiDomain (https://api.example.com), the issuer of your access tokens', required: false };
|
|
27
|
+
const API_BASE_PATH = { flag: '--supertokens-api-base-path', env: 'SUPERTOKENS_API_BASE_PATH', label: 'your backend\'s apiBasePath without slashes (default auth)', required: false };
|
|
28
|
+
function coreUri(p, required) {
|
|
29
|
+
const raw = p.credential({ ...CONNECTION_URI, required });
|
|
30
|
+
if (!raw)
|
|
31
|
+
return undefined;
|
|
32
|
+
try {
|
|
33
|
+
return (0, supertokens_1.normalizeCoreUri)(raw);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
throw new errors_1.CliError(`SuperTokens: ${raw} is not a core address (https://host or http://host:3567).`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.supertokensPlugin = {
|
|
40
|
+
vendor: 'supertokens',
|
|
41
|
+
source: 'supertokens',
|
|
42
|
+
label: 'SuperTokens',
|
|
43
|
+
help: 'Move a SuperTokens core (self-hosted or managed): its recipes, third-party providers and token settings as Atlas config; users with linked login methods, verified emails, third-party links, metadata, roles and tenants through the core API with its API key (on this machine) or from a dump of the core database, which also carries bcrypt and Argon2 password hashes and TOTP secrets; a zero-logout bridge on your access tokens; lazy migration through the core\'s own sign-in; and the code.',
|
|
44
|
+
config: {
|
|
45
|
+
reads: 'your SuperTokens core via its HTTP API',
|
|
46
|
+
credentials: [CONNECTION_URI, API_KEY, APP_ID],
|
|
47
|
+
async translate(p) {
|
|
48
|
+
const uri = coreUri(p, true);
|
|
49
|
+
const appId = p.credential(APP_ID)?.trim() || 'public';
|
|
50
|
+
const http = (0, supertokens_1.supertokensHttp)({ connectionUri: uri, apiKey: p.credential(API_KEY), fetchImpl: p.fetch });
|
|
51
|
+
return (0, supertokens_config_1.translateSupertokensConfig)(await (0, plugin_kit_1.vendorStep)('SuperTokens', () => (0, supertokens_config_1.fetchSupertokensConfig)(http, uri, appId)));
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
export: {
|
|
55
|
+
reads: 'the SuperTokens core API (API key) or a dump of the core database',
|
|
56
|
+
credentials: [CONNECTION_URI, API_KEY, DUMP, APP_ID, PREFIX],
|
|
57
|
+
limits: [
|
|
58
|
+
'The core API never returns password hashes or TOTP secrets: export from the core database (--set supertokens-dump=<folder>) to carry bcrypt and Argon2 hashes and verified TOTP devices; the managed service has no database access, so those users move by lazy migration and enrol their authenticator app again.',
|
|
59
|
+
'Sessions are not exported: the core keeps only a double hash of each refresh token. The bridge exchanges the access-token JWT a user still holds, verified against your backend\'s JWKS.',
|
|
60
|
+
'A password hash that is not bcrypt or Argon2 (for example one imported from Firebase) cannot be verified by Atlas: those users reset their password or move by lazy migration.',
|
|
61
|
+
'Tenants become organizations; a tenant\'s own enabled recipes and providers do not carry over (configure SSO connections per organization).',
|
|
62
|
+
'Code in supertokens.init (override functions, custom claims, MFA requirements, email and SMS delivery) is not visible to the core: it is listed in the config report as manual.',
|
|
63
|
+
],
|
|
64
|
+
async run(p, writer, resume) {
|
|
65
|
+
const dumpDir = p.credential(DUMP);
|
|
66
|
+
const uri = coreUri(p, false);
|
|
67
|
+
if (!dumpDir && !uri) {
|
|
68
|
+
throw new errors_1.CliError('SuperTokens: pass a core database dump (--set supertokens-dump=<folder>), or the core address with its API key (--set supertokens-connection-uri=… and SUPERTOKENS_API_KEY).');
|
|
69
|
+
}
|
|
70
|
+
const set = await (0, plugin_kit_1.vendorStep)('SuperTokens', async () => (0, supertokens_1.exportSupertokens)({
|
|
71
|
+
tables: dumpDir ? (0, tables_1.readDumpDir)((0, node_path_1.resolve)(dumpDir)) : undefined,
|
|
72
|
+
connectionUri: uri,
|
|
73
|
+
apiKey: p.credential(API_KEY),
|
|
74
|
+
appId: p.credential(APP_ID)?.trim(),
|
|
75
|
+
tablePrefix: p.credential(PREFIX)?.trim(),
|
|
76
|
+
fetchImpl: p.fetch,
|
|
77
|
+
onProgress: (m) => p.say(` reading ${m}`),
|
|
78
|
+
}));
|
|
79
|
+
await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
bridge: {
|
|
83
|
+
preset: 'supertokens',
|
|
84
|
+
vars(p, t) {
|
|
85
|
+
const vars = { ...t?.bridge?.vars };
|
|
86
|
+
const domain = p.credential(API_DOMAIN)?.trim();
|
|
87
|
+
if (domain)
|
|
88
|
+
vars.base_url = domain;
|
|
89
|
+
const basePath = p.credential(API_BASE_PATH)?.trim().replace(/^\/+|\/+$/g, '');
|
|
90
|
+
if (basePath)
|
|
91
|
+
vars.api_base_path = basePath;
|
|
92
|
+
return vars;
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
lazy: {
|
|
96
|
+
preset: 'supertokens',
|
|
97
|
+
config(p, t) {
|
|
98
|
+
const config = { ...t?.lazy?.config };
|
|
99
|
+
const uri = coreUri(p, false);
|
|
100
|
+
if (uri)
|
|
101
|
+
config.base_url = uri;
|
|
102
|
+
const tenant = p.credential(TENANT_ID)?.trim();
|
|
103
|
+
if (tenant)
|
|
104
|
+
config.tenant_id = tenant;
|
|
105
|
+
const app = p.credential(APP_ID)?.trim();
|
|
106
|
+
if (app)
|
|
107
|
+
config.app_id = app;
|
|
108
|
+
return config;
|
|
109
|
+
},
|
|
110
|
+
secret: API_KEY,
|
|
111
|
+
},
|
|
112
|
+
codemod: 'supertokens',
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/supertokens/plugin.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,yCAAwC;AACxC,wDAA0D;AAC1D,qDAAkE;AAClE,uDAA6F;AAC7F,qEAAkG;AAGlG;;;;;;;;;GASG;AAEH,MAAM,cAAc,GAAmB,EAAE,IAAI,EAAE,8BAA8B,EAAE,GAAG,EAAE,4BAA4B,EAAE,KAAK,EAAE,qFAAqF,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAClO,MAAM,OAAO,GAAmB,EAAE,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACxJ,MAAM,IAAI,GAAmB,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,sBAAsB,EAAE,KAAK,EAAE,+FAA+F,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAClN,MAAM,MAAM,GAAmB,EAAE,IAAI,EAAE,sBAAsB,EAAE,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,0DAA0D,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC/K,MAAM,SAAS,GAAmB,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,EAAE,uBAAuB,EAAE,KAAK,EAA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,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC;YAC/B,MAAM,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC;YAC/C,IAAI,MAAM;gBAAE,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC;YACtC,MAAM,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;YACzC,IAAI,GAAG;gBAAE,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;YAC7B,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,OAAO;KAChB;IACD,OAAO,EAAE,aAAa;CACvB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userTablePlugin = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const args_1 = require("../../args");
|
|
6
|
+
const errors_1 = require("../../errors");
|
|
7
|
+
const plugin_kit_1 = require("../export/plugin-kit");
|
|
8
|
+
const table_1 = require("../export/table");
|
|
9
|
+
/**
|
|
10
|
+
* `atlas migrate user-table export --file users.csv` — a user table from any
|
|
11
|
+
* system as CSV / TSV / JSON / NDJSON, with the hash-algorithm picker for
|
|
12
|
+
* stores whose password column is not self-describing. The vendor-neutral
|
|
13
|
+
* catch-all: every flag below is optional.
|
|
14
|
+
*/
|
|
15
|
+
const SPEC = (flag, env, label) => ({ flag, env, label, required: false });
|
|
16
|
+
const HASH_ALGORITHM = SPEC('hash-algorithm', 'ATLAS_HASH_ALGORITHM', 'the password hash algorithm: auto (default), plaintext, or any id such as bcrypt, md5, sha256_salted, pbkdf2, scrypt');
|
|
17
|
+
const SALT_POSITION = SPEC('salt-position', 'ATLAS_SALT_POSITION', 'salted digests: prefix or suffix (default suffix)');
|
|
18
|
+
const HASH_ENCODING = SPEC('hash-encoding', 'ATLAS_HASH_ENCODING', 'how the hash column is encoded: hex, base64 or base64url');
|
|
19
|
+
const HASH_PARAMS = SPEC('hash-params', 'ATLAS_HASH_PARAMS', 'algorithm parameters, e.g. iterations=10000,digest=sha256');
|
|
20
|
+
const COLUMNS = SPEC('map', 'ATLAS_COLUMN_MAP', 'column names when yours differ: email=Mail,id=uid,password=pwd,salt=pwd_salt');
|
|
21
|
+
const TRUST = SPEC('trust-emails', 'ATLAS_TRUST_EMAILS', 'mark every address verified (true or false)');
|
|
22
|
+
function file(p) {
|
|
23
|
+
return (0, args_1.str)(p.args.values, 'file') ?? p.credential({ flag: 'file', env: 'ATLAS_MIGRATE_FILE', label: 'the users file (--file)', required: true });
|
|
24
|
+
}
|
|
25
|
+
exports.userTablePlugin = {
|
|
26
|
+
vendor: 'user-table',
|
|
27
|
+
source: 'custom',
|
|
28
|
+
label: 'Your own user table (CSV / JSON)',
|
|
29
|
+
help: 'Import users from a CSV, TSV, JSON array or NDJSON file — a SELECT * of your users table. Columns are recognised by their usual names (id, email, email_verified, username, first_name, last_name, phone, password_hash, salt, created_at, roles, disabled …) or named with --set map=email=Mail,id=uid. Name the password algorithm with --set hash-algorithm=<id> when the column is not self-describing (add salt-position, hash-encoding and hash-params as needed), or plaintext to hash it on this machine. The file is read locally.',
|
|
30
|
+
export: {
|
|
31
|
+
reads: 'a local CSV / TSV / JSON / NDJSON file (--file)',
|
|
32
|
+
credentials: [HASH_ALGORITHM, SALT_POSITION, HASH_ENCODING, HASH_PARAMS, COLUMNS, TRUST],
|
|
33
|
+
limits: ['Social links, second factors, organizations and sessions are not in a flat table: import those with atlas migrate custom (canonical records) after this.'],
|
|
34
|
+
async run(p, writer, resume) {
|
|
35
|
+
const path = (0, node_path_1.resolve)(file(p));
|
|
36
|
+
let rows;
|
|
37
|
+
try {
|
|
38
|
+
rows = (0, table_1.parseTable)(p.ctx.readFile(path));
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
throw new errors_1.CliError(`${path}: ${err.message}`);
|
|
42
|
+
}
|
|
43
|
+
if (!rows.length)
|
|
44
|
+
throw new errors_1.CliError(`No rows found in ${path}.`);
|
|
45
|
+
const position = p.credential(SALT_POSITION);
|
|
46
|
+
if (position && position !== 'prefix' && position !== 'suffix')
|
|
47
|
+
throw new errors_1.CliError('--set salt-position must be prefix or suffix.');
|
|
48
|
+
const set = (0, table_1.mapTable)(rows, {
|
|
49
|
+
map: (0, table_1.parseKeyValues)(p.credential(COLUMNS)),
|
|
50
|
+
hashAlgorithm: p.credential(HASH_ALGORITHM),
|
|
51
|
+
saltPosition: position,
|
|
52
|
+
hashEncoding: p.credential(HASH_ENCODING),
|
|
53
|
+
hashParams: (0, table_1.typedParams)(p.credential(HASH_PARAMS)),
|
|
54
|
+
trustEmails: p.credential(TRUST) === 'true',
|
|
55
|
+
origin: `user table ${path}`,
|
|
56
|
+
});
|
|
57
|
+
p.say(` read ${rows.length} row(s) from ${path}`);
|
|
58
|
+
await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/user-table/plugin.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qCAAiC;AACjC,yCAAwC;AACxC,qDAAsD;AACtD,2CAAoF;AAGpF;;;;;GAKG;AAEH,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,GAAW,EAAE,KAAa,EAAkB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;AACnH,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,sHAAsH,CAAC,CAAC;AAC9L,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,qBAAqB,EAAE,mDAAmD,C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|
|
4
|
+
const userfront_1 = require("../export/userfront");
|
|
5
|
+
const userfront_config_1 = require("../export/userfront-config");
|
|
6
|
+
const plugin_kit_1 = require("../export/plugin-kit");
|
|
7
|
+
/**
|
|
8
|
+
* `atlas migrate userfront` — users, sub-tenants (as organizations) and roles
|
|
9
|
+
* through Userfront's admin API (tenant id + admin key, on this machine), and
|
|
10
|
+
* lazy migration through Userfront's password sign-in for every password:
|
|
11
|
+
* Userfront never returns hashes. There is no bridge preset: Userfront tokens
|
|
12
|
+
* carry no issuer claim, which the zero-logout bridge requires.
|
|
13
|
+
*/
|
|
14
|
+
const TENANT_ID = { flag: '--userfront-tenant-id', env: 'USERFRONT_TENANT_ID', label: 'your Userfront tenant id', required: true };
|
|
15
|
+
const API_KEY = { flag: '--userfront-api-key', env: 'USERFRONT_API_KEY', label: 'a Userfront admin API key (uf_live_admin_…)', required: true, secret: true };
|
|
16
|
+
/** The tenant id from the flag or env, else the one the app already uses. */
|
|
17
|
+
function tenantId(p) {
|
|
18
|
+
const env = p.ctx.env;
|
|
19
|
+
const raw = p.credential({ ...TENANT_ID, required: false }) ??
|
|
20
|
+
(env.NEXT_PUBLIC_USERFRONT_TENANT_ID ?? env.REACT_APP_USERFRONT_TENANT_ID ?? env.VITE_USERFRONT_TENANT_ID)?.trim() ??
|
|
21
|
+
(0, plugin_kit_1.need)(p, TENANT_ID);
|
|
22
|
+
return (0, userfront_1.checkTenantId)(raw);
|
|
23
|
+
}
|
|
24
|
+
exports.userfrontPlugin = {
|
|
25
|
+
vendor: 'userfront',
|
|
26
|
+
source: 'userfront',
|
|
27
|
+
label: 'Userfront',
|
|
28
|
+
help: 'Move a Userfront tenant: users with their verified emails and phones, usernames and custom data, sub-tenants as organizations with member roles, roles as Atlas roles, lazy migration through Userfront\'s own sign-in for every password (Userfront never returns hashes), and the code. Your admin key stays on this machine.',
|
|
29
|
+
config: {
|
|
30
|
+
reads: 'your Userfront tenant via the admin API (roles)',
|
|
31
|
+
credentials: [TENANT_ID, API_KEY],
|
|
32
|
+
async translate(p) {
|
|
33
|
+
const tid = tenantId(p);
|
|
34
|
+
const http = (0, userfront_1.userfrontHttp)({ apiKey: (0, plugin_kit_1.need)(p, API_KEY), fetchImpl: p.fetch });
|
|
35
|
+
return (0, userfront_config_1.translateUserfrontConfig)(await (0, plugin_kit_1.vendorStep)('Userfront', () => (0, userfront_config_1.fetchUserfrontConfig)(http, tid)));
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
export: {
|
|
39
|
+
reads: 'the Userfront admin API (users, sub-tenants, roles)',
|
|
40
|
+
credentials: [TENANT_ID, API_KEY],
|
|
41
|
+
limits: [
|
|
42
|
+
'Userfront never returns password hashes: passwords move by lazy migration (the userfront preset checks each one against Userfront on the first Atlas sign-in).',
|
|
43
|
+
'Second factors, passkeys and social-account ids cannot be exported: members enrol again, register passkeys again and relink social accounts by verified email.',
|
|
44
|
+
'Pending invitations cannot be listed (Userfront can only create them): invite members again from Atlas.',
|
|
45
|
+
'Sessions are not exported: Userfront tokens carry no issuer claim, so there is no zero-logout bridge; users sign in once after the switch.',
|
|
46
|
+
],
|
|
47
|
+
async run(p, writer, resume) {
|
|
48
|
+
const set = await (0, plugin_kit_1.vendorStep)('Userfront', () => (0, userfront_1.exportUserfront)({ tenantId: tenantId(p), apiKey: (0, plugin_kit_1.need)(p, API_KEY), fetchImpl: p.fetch, onProgress: (m) => p.say(` reading ${m}`) }));
|
|
49
|
+
await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
lazy: {
|
|
53
|
+
preset: 'userfront',
|
|
54
|
+
config(p, t) {
|
|
55
|
+
return { ...t?.lazy?.config, tenant_id: t?.lazy?.config.tenant_id ?? tenantId(p) };
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
codemod: 'userfront',
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|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,CAAC;QACrF,CAAC;KACF;IACD,OAAO,EAAE,WAAW;CACrB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workosPlugin = void 0;
|
|
4
|
+
const workos_1 = require("../export/workos");
|
|
5
|
+
const workos_config_1 = require("../export/workos-config");
|
|
6
|
+
const plugin_kit_1 = require("../export/plugin-kit");
|
|
7
|
+
const vendor_http_1 = require("../export/vendor-http");
|
|
8
|
+
/**
|
|
9
|
+
* `atlas migrate workos` — a WorkOS environment (AuthKit, SSO, Directory
|
|
10
|
+
* Sync) through the WorkOS API with the environment's API key (on this
|
|
11
|
+
* machine): roles and permissions as Atlas config; users with verified
|
|
12
|
+
* emails, OAuth identities, organizations, memberships and role slugs,
|
|
13
|
+
* invitations and SSO connections as data; the `workos` bridge preset (access
|
|
14
|
+
* tokens verified against the client's JWKS, with a local unsealer for the
|
|
15
|
+
* `wos-session` cookie) and lazy migration through WorkOS's password
|
|
16
|
+
* authentication for every password.
|
|
17
|
+
*/
|
|
18
|
+
const API_KEY = { flag: '--workos-api-key', env: 'WORKOS_API_KEY', label: 'a WorkOS API key (sk_…)', required: true, secret: true };
|
|
19
|
+
const CLIENT_ID = { flag: '--workos-client-id', env: 'WORKOS_CLIENT_ID', label: 'your WorkOS client id (client_…)', required: true };
|
|
20
|
+
const HASHES_FILE = { flag: '--workos-hashes-file', env: 'WORKOS_HASHES_FILE', label: 'a password-hash export from WorkOS support', required: false };
|
|
21
|
+
const BASE_URL = { flag: '--workos-base-url', env: 'WORKOS_BASE_URL', label: 'the WorkOS API base URL', required: false };
|
|
22
|
+
const COUNT_FACTORS = { flag: '--workos-factors', env: 'WORKOS_COUNT_FACTORS', label: 'set to 1 to count second factors (one extra request per user)', required: false };
|
|
23
|
+
/** The client id from the flag/env, or the app's own public env var; undefined when neither is set. */
|
|
24
|
+
function clientIdOpt(p) {
|
|
25
|
+
return (p.credential({ ...CLIENT_ID, required: false }) ??
|
|
26
|
+
(p.ctx.env.NEXT_PUBLIC_WORKOS_CLIENT_ID?.trim() || p.ctx.env.VITE_WORKOS_CLIENT_ID?.trim() || undefined));
|
|
27
|
+
}
|
|
28
|
+
function clientId(p) {
|
|
29
|
+
return clientIdOpt(p) ?? (0, plugin_kit_1.need)(p, CLIENT_ID);
|
|
30
|
+
}
|
|
31
|
+
function baseUrl(p) {
|
|
32
|
+
return p.credential(BASE_URL)?.replace(/\/+$/, '');
|
|
33
|
+
}
|
|
34
|
+
exports.workosPlugin = {
|
|
35
|
+
vendor: 'workos',
|
|
36
|
+
source: 'workos',
|
|
37
|
+
label: 'WorkOS',
|
|
38
|
+
help: 'Move a WorkOS environment: roles and permissions as Atlas config; users with verified emails and OAuth identities, organizations, memberships and role slugs, invitations and SSO connections; password hashes when WorkOS support provides them; a zero-logout bridge for AuthKit access tokens (including the sealed wos-session cookie); lazy migration through WorkOS password authentication; and the code. Your API key stays on this machine.',
|
|
39
|
+
config: {
|
|
40
|
+
reads: 'your WorkOS environment via the API (roles, permissions, redirect URIs, connections)',
|
|
41
|
+
credentials: [API_KEY, CLIENT_ID],
|
|
42
|
+
async translate(p) {
|
|
43
|
+
const http = new vendor_http_1.VendorHttp({ vendor: 'WorkOS', baseUrl: baseUrl(p) ?? 'https://api.workos.com', headers: { authorization: `Bearer ${(0, plugin_kit_1.need)(p, API_KEY)}` }, fetchImpl: p.fetch });
|
|
44
|
+
const snap = await (0, plugin_kit_1.vendorStep)('WorkOS', () => (0, workos_config_1.fetchWorkosConfig)(http, clientIdOpt(p)));
|
|
45
|
+
return (0, workos_config_1.translateWorkosConfig)(snap);
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
export: {
|
|
49
|
+
reads: 'the WorkOS API (organizations, roles, users, identities, memberships, invitations, connections) and, if you have one, the support hash export (--workos-hashes-file)',
|
|
50
|
+
credentials: [API_KEY, CLIENT_ID, HASHES_FILE, BASE_URL, COUNT_FACTORS],
|
|
51
|
+
limits: [
|
|
52
|
+
'WorkOS has no password-hash export: if WorkOS support provides one, pass it with --workos-hashes-file; otherwise passwords move by lazy migration (checked against WorkOS on each user\'s first sign-in).',
|
|
53
|
+
'TOTP secrets and passkeys are not exportable: users enrol their second factor and passkeys again.',
|
|
54
|
+
'SSO connections move without the identity provider\'s entity id, SSO URL or OIDC secret (the WorkOS API does not return them): each customer\'s IdP admin sets the connection up again against the new Atlas details.',
|
|
55
|
+
'API key secrets are shown once by WorkOS: reissue them as Atlas API keys. Sessions are not exported: AuthKit access tokens are JWTs, exchanged by the workos bridge preset.',
|
|
56
|
+
],
|
|
57
|
+
async run(p, writer, resume) {
|
|
58
|
+
const set = await (0, plugin_kit_1.vendorStep)('WorkOS', () => (0, workos_1.exportWorkos)({
|
|
59
|
+
apiKey: (0, plugin_kit_1.need)(p, API_KEY),
|
|
60
|
+
clientId: clientIdOpt(p),
|
|
61
|
+
baseUrl: baseUrl(p),
|
|
62
|
+
hashesText: (0, plugin_kit_1.localFile)(p, HASHES_FILE, 'text'),
|
|
63
|
+
countFactors: Boolean(p.credential(COUNT_FACTORS)),
|
|
64
|
+
fetchImpl: p.fetch,
|
|
65
|
+
onProgress: (m) => p.say(` reading ${m}`),
|
|
66
|
+
}));
|
|
67
|
+
await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
bridge: {
|
|
71
|
+
preset: 'workos',
|
|
72
|
+
vars: (p, t) => ({ ...t?.bridge?.vars, client_id: t?.bridge?.vars.client_id ?? clientId(p) }),
|
|
73
|
+
},
|
|
74
|
+
lazy: {
|
|
75
|
+
preset: 'workos',
|
|
76
|
+
config: (p, t) => ({ ...t?.lazy?.config, client_id: t?.lazy?.config.client_id ?? clientId(p) }),
|
|
77
|
+
secret: API_KEY,
|
|
78
|
+
},
|
|
79
|
+
codemod: 'workos',
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=plugin.js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