@atlasauth/cli 0.12.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 +6 -0
- package/dist/args.d.ts +15 -0
- package/dist/args.js +7 -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/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 +58 -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/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/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/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/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/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/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/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/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/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/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/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/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/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/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.js +35 -6
- package/dist/migrate/framework/builtins.js.map +1 -1
- package/dist/migrate/framework/orchestrator.js +3 -2
- package/dist/migrate/framework/orchestrator.js.map +1 -1
- package/dist/migrate/framework/plugin.d.ts +2 -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/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/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 +6 -5
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RecordSet, type Obj } from './record-set';
|
|
2
|
+
/**
|
|
3
|
+
* `atlas migrate export pocketbase` — a PocketBase app's auth collections.
|
|
4
|
+
*
|
|
5
|
+
* PocketBase's REST API never returns a password hash or a token key (they
|
|
6
|
+
* are stripped from every record, superusers included), so the export reads
|
|
7
|
+
* the SQLite database: `pb_data/data.db` directly through Node's built-in
|
|
8
|
+
* `node:sqlite` (read-only; stop the server or copy the file with its -wal
|
|
9
|
+
* and -shm first), or a dump directory the owner made with `sqlite3 -json`
|
|
10
|
+
* (one `<table>.json` per table: `_collections`, each auth collection, and
|
|
11
|
+
* `_externalAuths`). Nothing connects to a running PocketBase.
|
|
12
|
+
*
|
|
13
|
+
* What moves: every auth collection's records (v0.23+ `password`, ≤0.22
|
|
14
|
+
* `passwordHash`, both Go bcrypt), email + verified, username, name, avatar
|
|
15
|
+
* (as a file URL when the PocketBase URL is given), custom fields as public
|
|
16
|
+
* metadata, and OAuth2 links from `_externalAuths`. Superusers (`_superusers`,
|
|
17
|
+
* or ≤0.22 `_admins`) stay behind unless asked for. `_mfas` and `_otps` hold
|
|
18
|
+
* one-time sign-in state, not enrolments: nothing to carry. Tokens are HS256
|
|
19
|
+
* signed with a per-record key, so the bridge asks PocketBase about them
|
|
20
|
+
* (`pocketbase` bridge preset) instead of importing sessions.
|
|
21
|
+
*/
|
|
22
|
+
export interface PocketBaseTables {
|
|
23
|
+
/** `_collections` rows (`id, name, type, options, fields` or ≤0.22 `schema`). */
|
|
24
|
+
collections: Obj[];
|
|
25
|
+
/** Rows by table name. */
|
|
26
|
+
tables: Map<string, Obj[]>;
|
|
27
|
+
}
|
|
28
|
+
export interface PocketBaseExportOptions {
|
|
29
|
+
/** Auth collections to export (default: every auth collection except `_superusers`). */
|
|
30
|
+
collections?: string[];
|
|
31
|
+
includeSuperusers?: boolean;
|
|
32
|
+
/** The public PocketBase URL, to turn avatar file names into URLs. */
|
|
33
|
+
url?: string;
|
|
34
|
+
/** Shown in the dashboard as where the data came from (a file path, never a credential). */
|
|
35
|
+
origin?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function exportPocketBase(db: PocketBaseTables, opts?: PocketBaseExportOptions): RecordSet;
|
|
38
|
+
/** PocketBase stores `2024-01-02 03:04:05.123Z`; the bundle wants ISO-8601. */
|
|
39
|
+
export declare function pbTime(v: unknown): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* A dump directory: one file per table (`_collections.json`, `users.json`,
|
|
42
|
+
* `_externalAuths.json` …) as `sqlite3 -json` writes it (a JSON array), NDJSON,
|
|
43
|
+
* or CSV with a header row.
|
|
44
|
+
*/
|
|
45
|
+
export declare function readPocketBaseDump(dir: string): PocketBaseTables;
|
|
46
|
+
export declare function parseTable(text: string, ext: string): Obj[];
|
|
47
|
+
/**
|
|
48
|
+
* `pb_data/data.db` through Node's built-in SQLite (Node 22.5+), opened
|
|
49
|
+
* read-only. Reads `_collections`, every auth collection's table and
|
|
50
|
+
* `_externalAuths` — nothing else.
|
|
51
|
+
*/
|
|
52
|
+
export declare function readPocketBaseDb(path: string): Promise<PocketBaseTables>;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.exportPocketBase = exportPocketBase;
|
|
37
|
+
exports.pbTime = pbTime;
|
|
38
|
+
exports.readPocketBaseDump = readPocketBaseDump;
|
|
39
|
+
exports.parseTable = parseTable;
|
|
40
|
+
exports.readPocketBaseDb = readPocketBaseDb;
|
|
41
|
+
const node_fs_1 = require("node:fs");
|
|
42
|
+
const node_path_1 = require("node:path");
|
|
43
|
+
const csv_1 = require("../../import/csv");
|
|
44
|
+
const record_set_1 = require("./record-set");
|
|
45
|
+
/** Fields every auth record has that are not metadata. */
|
|
46
|
+
const SYSTEM_FIELDS = new Set([
|
|
47
|
+
'id', 'email', 'emailVisibility', 'verified', 'password', 'passwordHash', 'tokenKey', 'username', 'name', 'avatar', 'created', 'updated',
|
|
48
|
+
'lastResetSentAt', 'lastVerificationSentAt', 'lastLoginAlertSentAt',
|
|
49
|
+
]);
|
|
50
|
+
function exportPocketBase(db, opts = {}) {
|
|
51
|
+
const set = new record_set_1.RecordSet();
|
|
52
|
+
const auth = db.collections.filter((c) => (0, record_set_1.str)(c.type) === 'auth');
|
|
53
|
+
const wanted = opts.collections?.length ? new Set(opts.collections) : null;
|
|
54
|
+
const chosen = auth.filter((c) => {
|
|
55
|
+
const name = (0, record_set_1.str)(c.name) ?? '';
|
|
56
|
+
if (wanted)
|
|
57
|
+
return wanted.has(name);
|
|
58
|
+
return name !== '_superusers' || opts.includeSuperusers === true;
|
|
59
|
+
});
|
|
60
|
+
if (wanted)
|
|
61
|
+
for (const name of wanted)
|
|
62
|
+
if (!auth.some((c) => (0, record_set_1.str)(c.name) === name))
|
|
63
|
+
set.warn(`"${name}" is not an auth collection in this database and was skipped.`);
|
|
64
|
+
if (!auth.length)
|
|
65
|
+
set.warn('No auth collection found in _collections: is this a PocketBase data.db (or a dump of it)?');
|
|
66
|
+
if (db.tables.has('_admins') && opts.includeSuperusers)
|
|
67
|
+
set.warn('PocketBase ≤0.22 admins (_admins) are not exported: create them again as Atlas instance admins.');
|
|
68
|
+
const userIds = new Set();
|
|
69
|
+
const multiple = chosen.length > 1;
|
|
70
|
+
for (const c of chosen) {
|
|
71
|
+
const name = (0, record_set_1.str)(c.name);
|
|
72
|
+
const collectionId = (0, record_set_1.str)(c.id) ?? name;
|
|
73
|
+
const rows = db.tables.get(name) ?? db.tables.get(name.toLowerCase()) ?? [];
|
|
74
|
+
if (!rows.length)
|
|
75
|
+
set.warn(`The auth collection "${name}" has no rows in the export (was its table dumped?).`);
|
|
76
|
+
for (const r of rows) {
|
|
77
|
+
const id = (0, record_set_1.str)(r.id);
|
|
78
|
+
if (!id)
|
|
79
|
+
continue;
|
|
80
|
+
if (userIds.has(id)) {
|
|
81
|
+
set.omit('user', 'record id already exported from another auth collection');
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const user = mapRecord(r, { collection: name, collectionId, url: opts.url, tag: multiple || name !== 'users' });
|
|
85
|
+
if (!user) {
|
|
86
|
+
set.omit('user', 'record without an email or username');
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
userIds.add(id);
|
|
90
|
+
set.add('user', (0, record_set_1.compact)(user));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (set.list('user').some((u) => !u.password))
|
|
94
|
+
set.warn('Some records have no password hash (OAuth2- or OTP-only users): they keep signing in with those methods.');
|
|
95
|
+
// OAuth2 links: v0.23+ collectionRef/recordRef, ≤0.22 collectionId/recordId.
|
|
96
|
+
for (const e of db.tables.get('_externalauths') ?? db.tables.get('_externalAuths') ?? []) {
|
|
97
|
+
const userId = (0, record_set_1.str)(e.recordRef) ?? (0, record_set_1.str)(e.recordId);
|
|
98
|
+
const provider = (0, record_set_1.str)(e.provider);
|
|
99
|
+
const providerId = (0, record_set_1.str)(e.providerId);
|
|
100
|
+
if (!userId || !provider || !providerId || !userIds.has(userId))
|
|
101
|
+
continue;
|
|
102
|
+
set.add('identity', (0, record_set_1.compact)({ id: (0, record_set_1.str)(e.id), user_id: userId, provider, provider_user_id: providerId, kind: 'oauth' }), `${provider}:${providerId}`);
|
|
103
|
+
}
|
|
104
|
+
const providers = new Set(set.list('identity').map((i) => i.provider));
|
|
105
|
+
set.manifest = { ...set.manifest, origin: opts.origin ?? 'pocketbase data.db', providers: [...providers].sort() };
|
|
106
|
+
set.warn('PocketBase auth tokens are signed per record and cannot be imported: enable the pocketbase bridge preset so signed-in users move without a new sign-in.');
|
|
107
|
+
return set;
|
|
108
|
+
}
|
|
109
|
+
function mapRecord(r, ctx) {
|
|
110
|
+
const email = (0, record_set_1.str)(r.email)?.toLowerCase();
|
|
111
|
+
const username = (0, record_set_1.str)(r.username);
|
|
112
|
+
if (!email && !username)
|
|
113
|
+
return null;
|
|
114
|
+
const hash = (0, record_set_1.str)(r.password) ?? (0, record_set_1.str)(r.passwordHash);
|
|
115
|
+
const avatar = (0, record_set_1.str)(r.avatar);
|
|
116
|
+
const meta = {};
|
|
117
|
+
for (const [k, v] of Object.entries(r)) {
|
|
118
|
+
if (SYSTEM_FIELDS.has(k) || v === null || v === '' || v === undefined)
|
|
119
|
+
continue;
|
|
120
|
+
meta[k] = parseJsonish(v);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
id: (0, record_set_1.str)(r.id),
|
|
124
|
+
emails: email ? [{ email, verified: truthy(r.verified), primary: true }] : undefined,
|
|
125
|
+
username,
|
|
126
|
+
name: (0, record_set_1.str)(r.name),
|
|
127
|
+
image_url: avatar && ctx.url ? `${ctx.url.replace(/\/+$/, '')}/api/files/${encodeURIComponent(ctx.collectionId)}/${encodeURIComponent((0, record_set_1.str)(r.id))}/${encodeURIComponent(avatar)}` : undefined,
|
|
128
|
+
password: hash && /^\$2[aby]\$\d{2}\$/.test(hash) ? { algorithm: 'auto', hash } : undefined,
|
|
129
|
+
public_metadata: Object.keys(meta).length ? meta : undefined,
|
|
130
|
+
private_metadata: ctx.tag ? { pocketbase_collection: ctx.collection } : undefined,
|
|
131
|
+
created_at: pbTime(r.created),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/** PocketBase stores `2024-01-02 03:04:05.123Z`; the bundle wants ISO-8601. */
|
|
135
|
+
function pbTime(v) {
|
|
136
|
+
const s = (0, record_set_1.str)(v);
|
|
137
|
+
if (!s)
|
|
138
|
+
return undefined;
|
|
139
|
+
return /^\d{4}-\d{2}-\d{2} \d/.test(s) ? s.replace(' ', 'T') : s;
|
|
140
|
+
}
|
|
141
|
+
const truthy = (v) => v === true || v === 1 || v === '1' || v === 'true';
|
|
142
|
+
/** JSON / multi-select / relation fields come out of SQLite as JSON text. */
|
|
143
|
+
function parseJsonish(v) {
|
|
144
|
+
if (typeof v !== 'string')
|
|
145
|
+
return v;
|
|
146
|
+
const t = v.trim();
|
|
147
|
+
if ((t.startsWith('{') && t.endsWith('}')) || (t.startsWith('[') && t.endsWith(']'))) {
|
|
148
|
+
try {
|
|
149
|
+
return JSON.parse(t);
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return v;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return v;
|
|
156
|
+
}
|
|
157
|
+
// ── readers ─────────────────────────────────────────────────────────────────
|
|
158
|
+
function tablesFrom(byName) {
|
|
159
|
+
const collections = (byName.get('_collections') ?? []).map((c) => ({ ...c, options: parseJsonish(c.options), fields: parseJsonish(c.fields ?? c.schema) }));
|
|
160
|
+
return { collections, tables: byName };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A dump directory: one file per table (`_collections.json`, `users.json`,
|
|
164
|
+
* `_externalAuths.json` …) as `sqlite3 -json` writes it (a JSON array), NDJSON,
|
|
165
|
+
* or CSV with a header row.
|
|
166
|
+
*/
|
|
167
|
+
function readPocketBaseDump(dir) {
|
|
168
|
+
const byName = new Map();
|
|
169
|
+
for (const file of (0, node_fs_1.readdirSync)(dir).sort()) {
|
|
170
|
+
const path = (0, node_path_1.join)(dir, file);
|
|
171
|
+
const ext = (0, node_path_1.extname)(file).toLowerCase();
|
|
172
|
+
if (!(0, node_fs_1.statSync)(path).isFile() || !['.json', '.ndjson', '.jsonl', '.csv'].includes(ext))
|
|
173
|
+
continue;
|
|
174
|
+
const rows = parseTable((0, node_fs_1.readFileSync)(path, 'utf8'), ext);
|
|
175
|
+
const name = (0, node_path_1.basename)(file, (0, node_path_1.extname)(file));
|
|
176
|
+
byName.set(name, rows);
|
|
177
|
+
if (name.toLowerCase() !== name)
|
|
178
|
+
byName.set(name.toLowerCase(), rows);
|
|
179
|
+
}
|
|
180
|
+
return tablesFrom(byName);
|
|
181
|
+
}
|
|
182
|
+
function parseTable(text, ext) {
|
|
183
|
+
if (ext === '.csv')
|
|
184
|
+
return (0, csv_1.parseCsv)(text);
|
|
185
|
+
if (ext === '.ndjson' || ext === '.jsonl') {
|
|
186
|
+
return text
|
|
187
|
+
.split(/\r?\n/)
|
|
188
|
+
.map((l) => l.trim())
|
|
189
|
+
.filter(Boolean)
|
|
190
|
+
.map((l) => JSON.parse(l))
|
|
191
|
+
.filter(record_set_1.isObj);
|
|
192
|
+
}
|
|
193
|
+
const t = text.trim();
|
|
194
|
+
if (!t)
|
|
195
|
+
return [];
|
|
196
|
+
const parsed = JSON.parse(t);
|
|
197
|
+
if (Array.isArray(parsed))
|
|
198
|
+
return parsed.filter(record_set_1.isObj);
|
|
199
|
+
if ((0, record_set_1.isObj)(parsed) && Array.isArray(parsed.rows))
|
|
200
|
+
return parsed.rows.filter(record_set_1.isObj);
|
|
201
|
+
if ((0, record_set_1.isObj)(parsed) && Array.isArray(parsed.items))
|
|
202
|
+
return parsed.items.filter(record_set_1.isObj);
|
|
203
|
+
return [];
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* `pb_data/data.db` through Node's built-in SQLite (Node 22.5+), opened
|
|
207
|
+
* read-only. Reads `_collections`, every auth collection's table and
|
|
208
|
+
* `_externalAuths` — nothing else.
|
|
209
|
+
*/
|
|
210
|
+
async function readPocketBaseDb(path) {
|
|
211
|
+
const spec = 'node:sqlite';
|
|
212
|
+
let mod;
|
|
213
|
+
try {
|
|
214
|
+
mod = (await Promise.resolve(`${spec}`).then(s => __importStar(require(s))));
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
throw new Error('This Node.js has no built-in SQLite (node:sqlite, Node 22.5+). Dump the tables with sqlite3 -json instead and pass the folder with --set pocketbase-dump=<dir>.');
|
|
218
|
+
}
|
|
219
|
+
const db = new mod.DatabaseSync(path, { readOnly: true });
|
|
220
|
+
try {
|
|
221
|
+
const all = (sql) => db.prepare(sql).all().filter(record_set_1.isObj);
|
|
222
|
+
const has = new Set(all("SELECT name FROM sqlite_master WHERE type = 'table'").map((r) => (0, record_set_1.str)(r.name)).filter((n) => !!n));
|
|
223
|
+
if (!has.has('_collections'))
|
|
224
|
+
throw new Error(`${path} has no _collections table: it is not a PocketBase data.db.`);
|
|
225
|
+
const byName = new Map();
|
|
226
|
+
const q = (name) => `"${name.replace(/"/g, '""')}"`;
|
|
227
|
+
byName.set('_collections', all('SELECT * FROM _collections'));
|
|
228
|
+
for (const c of byName.get('_collections')) {
|
|
229
|
+
const name = (0, record_set_1.str)(c.name);
|
|
230
|
+
if (name && (0, record_set_1.str)(c.type) === 'auth' && has.has(name))
|
|
231
|
+
byName.set(name, all(`SELECT * FROM ${q(name)}`));
|
|
232
|
+
}
|
|
233
|
+
if (has.has('_externalAuths'))
|
|
234
|
+
byName.set('_externalAuths', all('SELECT * FROM _externalAuths'));
|
|
235
|
+
if (has.has('_admins'))
|
|
236
|
+
byName.set('_admins', []);
|
|
237
|
+
return tablesFrom(byName);
|
|
238
|
+
}
|
|
239
|
+
finally {
|
|
240
|
+
db.close();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=pocketbase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pocketbase.js","sourceRoot":"","sources":["../../../src/migrate/export/pocketbase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,4CAmDC;AA2BD,wBAIC;AA8BD,gDAYC;AAED,gCAiBC;AAYD,4CA0BC;AAvOD,qCAA8D;AAC9D,yCAAoD;AAEpD,0CAA4C;AAC5C,6CAAwE;AAwCxE,0DAA0D;AAC1D,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,IAAI,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS;IACxI,iBAAiB,EAAE,wBAAwB,EAAE,sBAAsB;CACpE,CAAC,CAAC;AAEH,SAAgB,gBAAgB,CAAC,EAAoB,EAAE,OAAgC,EAAE;IACvF,MAAM,GAAG,GAAG,IAAI,sBAAS,EAAE,CAAC;IAC5B,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,E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SAAS,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAClD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CredentialSpec, PluginContext } from '../framework/plugin';
|
|
2
|
+
/**
|
|
3
|
+
* A config file the vendor keeps in the app's repository (appwrite.json,
|
|
4
|
+
* nhost/nhost.toml, pb_schema.json): the path named by the flag / env var, or
|
|
5
|
+
* the first of `candidates` that exists in the project folder. The report
|
|
6
|
+
* shows the path relative to the project.
|
|
7
|
+
*/
|
|
8
|
+
export declare function projectFile(p: PluginContext, spec: CredentialSpec, candidates: string[]): {
|
|
9
|
+
path: string;
|
|
10
|
+
text: string;
|
|
11
|
+
} | undefined;
|
|
12
|
+
/** A folder the owner named (a table dump), or the first candidate folder that exists in the project. */
|
|
13
|
+
export declare function projectDir(p: PluginContext, spec: CredentialSpec, candidates?: string[]): string | undefined;
|
|
14
|
+
/** `--set name=true` / an env var set to true, 1 or yes. */
|
|
15
|
+
export declare function truthyCredential(p: PluginContext, spec: CredentialSpec): boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.projectFile = projectFile;
|
|
4
|
+
exports.projectDir = projectDir;
|
|
5
|
+
exports.truthyCredential = truthyCredential;
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const plugin_kit_1 = require("./plugin-kit");
|
|
9
|
+
/**
|
|
10
|
+
* A config file the vendor keeps in the app's repository (appwrite.json,
|
|
11
|
+
* nhost/nhost.toml, pb_schema.json): the path named by the flag / env var, or
|
|
12
|
+
* the first of `candidates` that exists in the project folder. The report
|
|
13
|
+
* shows the path relative to the project.
|
|
14
|
+
*/
|
|
15
|
+
function projectFile(p, spec, candidates) {
|
|
16
|
+
const named = p.credential({ ...spec, required: false });
|
|
17
|
+
if (named)
|
|
18
|
+
return { path: named, text: (0, plugin_kit_1.localFile)(p, spec, 'text') };
|
|
19
|
+
for (const c of candidates) {
|
|
20
|
+
const full = (0, node_path_1.resolve)(p.project, c);
|
|
21
|
+
if ((0, node_fs_1.existsSync)(full) && (0, node_fs_1.statSync)(full).isFile())
|
|
22
|
+
return { path: (0, node_path_1.relative)((0, node_path_1.resolve)(p.project), full) || c, text: p.ctx.readFile(full) };
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
/** A folder the owner named (a table dump), or the first candidate folder that exists in the project. */
|
|
27
|
+
function projectDir(p, spec, candidates = []) {
|
|
28
|
+
const named = p.credential({ ...spec, required: false });
|
|
29
|
+
if (named)
|
|
30
|
+
return (0, node_path_1.resolve)(named);
|
|
31
|
+
for (const c of candidates) {
|
|
32
|
+
const full = (0, node_path_1.join)((0, node_path_1.resolve)(p.project), c);
|
|
33
|
+
if ((0, node_fs_1.existsSync)(full) && (0, node_fs_1.statSync)(full).isDirectory())
|
|
34
|
+
return full;
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
/** `--set name=true` / an env var set to true, 1 or yes. */
|
|
39
|
+
function truthyCredential(p, spec) {
|
|
40
|
+
const v = p.credential({ ...spec, required: false });
|
|
41
|
+
return v !== undefined && /^(1|true|yes|on)$/i.test(v.trim());
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=project-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../../src/migrate/export/project-files.ts"],"names":[],"mappings":";;AAWA,kCAQC;AAGD,gCAQC;AAGD,4CAGC;AApCD,qCAA+C;AAC/C,yCAAoD;AAEpD,6CAAyC;AAEzC;;;;;GAKG;AACH,SA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IAAI,CAAC,IAAI,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,WAAW,EAAE;YAAE,OAAO,IAAI,CAAC;IACpE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4DAA4D;AAC5D,SAAgB,gBAAgB,CAAC,CAAgB,EAAE,IAAoB;IACrE,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,KAAK,SAAS,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TranslationResult } from '../framework/plugin';
|
|
2
|
+
import { type VendorHttp } from './vendor-http';
|
|
3
|
+
/**
|
|
4
|
+
* `atlas migrate propelauth config` — what PropelAuth's backend API exposes
|
|
5
|
+
* about a project's configuration: the custom role mappings, and which
|
|
6
|
+
* organizations have SAML set up. Login methods, password and MFA rules,
|
|
7
|
+
* session lifetimes, branding and the hosted-page settings live only in the
|
|
8
|
+
* PropelAuth dashboard: the report lists each as manual with where to find it.
|
|
9
|
+
*/
|
|
10
|
+
export interface PropelauthConfigSnapshot {
|
|
11
|
+
authUrl: string;
|
|
12
|
+
/** Names of the custom role mappings (shape UNCONFIRMED: tolerated as objects or bare names). */
|
|
13
|
+
roleMappings: string[];
|
|
14
|
+
orgs: number;
|
|
15
|
+
samlOrgs: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function fetchPropelauthConfig(http: VendorHttp, authUrl: string): Promise<PropelauthConfigSnapshot>;
|
|
18
|
+
export declare function translatePropelauthConfig(snap: PropelauthConfigSnapshot): TranslationResult;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchPropelauthConfig = fetchPropelauthConfig;
|
|
4
|
+
exports.translatePropelauthConfig = translatePropelauthConfig;
|
|
5
|
+
const record_set_1 = require("./record-set");
|
|
6
|
+
const translate_kit_1 = require("./translate-kit");
|
|
7
|
+
const propelauth_1 = require("./propelauth");
|
|
8
|
+
const vendor_http_1 = require("./vendor-http");
|
|
9
|
+
async function optional(fn, fallback) {
|
|
10
|
+
try {
|
|
11
|
+
return await fn();
|
|
12
|
+
}
|
|
13
|
+
catch (err) {
|
|
14
|
+
if (err instanceof vendor_http_1.VendorApiError && [400, 403, 404, 405].includes(err.status))
|
|
15
|
+
return fallback;
|
|
16
|
+
throw err;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function fetchPropelauthConfig(http, authUrl) {
|
|
20
|
+
const mappings = await optional(async () => (await http.get('/api/backend/v1/custom_role_mappings')).body, null);
|
|
21
|
+
const list = Array.isArray(mappings) ? mappings : Array.isArray(mappings?.custom_role_mappings) ? mappings.custom_role_mappings : [];
|
|
22
|
+
const roleMappings = list.map((m) => (typeof m === 'string' ? m : (0, record_set_1.str)(m?.custom_role_mapping_name) ?? (0, record_set_1.str)(m?.name))).filter((n) => !!n);
|
|
23
|
+
let orgs = 0;
|
|
24
|
+
let samlOrgs = 0;
|
|
25
|
+
for (let page = 0; page < 1000; page++) {
|
|
26
|
+
const body = await optional(async () => (await http.get(`/api/backend/v1/org/query?page_size=100&page_number=${page}`)).body, null);
|
|
27
|
+
const rows = (0, record_set_1.objs)(body?.orgs);
|
|
28
|
+
orgs += rows.length;
|
|
29
|
+
samlOrgs += rows.filter((o) => o.is_saml_configured === true).length;
|
|
30
|
+
if (body?.has_more_results !== true || rows.length === 0)
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
return { authUrl: (0, propelauth_1.normalizeAuthUrl)(authUrl), roleMappings, orgs, samlOrgs };
|
|
34
|
+
}
|
|
35
|
+
function translatePropelauthConfig(snap) {
|
|
36
|
+
const b = new translate_kit_1.ConfigBuilder();
|
|
37
|
+
b.add('mapped', 'organizations', 'organizations and members', `${snap.orgs} organization(s) with their members, roles, permissions and pending invitations move with the data export.`, 'organizations');
|
|
38
|
+
for (const name of snap.roleMappings) {
|
|
39
|
+
b.add('manual', 'roles', `custom role mapping ${name}`, 'PropelAuth role mappings choose which role set an organization uses; Atlas roles are instance-wide, so recreate the set once and assign it in Atlas.', 'roles');
|
|
40
|
+
}
|
|
41
|
+
if (snap.samlOrgs > 0) {
|
|
42
|
+
b.add('manual', 'enterprise', `SAML (${snap.samlOrgs} organization(s))`, 'PropelAuth never returns a connection\'s IdP settings: create each SAML connection again in Atlas with the IdP\'s metadata.', 'sso_connections');
|
|
43
|
+
}
|
|
44
|
+
for (const [setting, where] of [
|
|
45
|
+
['login methods (password, passwordless, social)', 'Dashboard → Login Methods'],
|
|
46
|
+
['password and MFA requirements', 'Dashboard → Login Methods / Security'],
|
|
47
|
+
['session and token lifetimes', 'Dashboard → Settings → Sessions'],
|
|
48
|
+
['social provider credentials', 'Dashboard → Login Methods → Social (re-enter each client id and secret as an Atlas oauth provider)'],
|
|
49
|
+
['allowed redirect URLs and domains', 'Dashboard → Frontend Integration'],
|
|
50
|
+
['branding, hosted pages and emails', 'Dashboard → Branding / Emails (use the Atlas theme and email templates)'],
|
|
51
|
+
['user properties and metadata schema', 'Dashboard → User Properties (carried as user metadata in the export)'],
|
|
52
|
+
]) {
|
|
53
|
+
b.add('manual', 'settings not in the API', setting, `PropelAuth does not expose this by API; copy it from the dashboard (${where}).`);
|
|
54
|
+
}
|
|
55
|
+
b.add('differs', 'sessions', 'access tokens', 'PropelAuth signs RS256 tokens verified with a project verifier key (there is no JWKS). The propelauth bridge preset needs that key to keep sessions through the switch; new sign-ins use Atlas tokens.', 'migration bridge');
|
|
56
|
+
return b.result(`PropelAuth project ${snap.authUrl}`, { bridge: { preset: 'propelauth', vars: { auth_url: snap.authUrl } } });
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=propelauth-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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EAAE,sJAAsJ,EAAE,OAAO,CAAC,CAAC;IAC3N,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;QACtB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,IAAI,CAAC,QAAQ,mBAAmB,EAAE,6HAA6H,EAAE,iBAAiB,CAAC,CAAC;IAC7N,CAAC;IACD,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI;QAC7B,CAAC,gDAAgD,EAAE,2BAA2B,CAAC;QAC/E,CAAC,+BAA+B,EAAE,sCAAsC,CAAC;QACzE,CAAC,6BAA6B,EAAE,iCAAiC,CAAC;QAClE,CAAC,6BAA6B,EAAE,oGAAoG,CAAC;QACrI,CAAC,mCAAmC,EAAE,kCAAkC,CAAC;QACzE,CAAC,mCAAmC,EAAE,yEAAyE,CAAC;QAChH,CAAC,qCAAqC,EAAE,sEAAsE,CAAC;KACvG,EAAE,CAAC;QACX,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,yBAAyB,EAAE,OAAO,EAAE,uEAAuE,KAAK,IAAI,CAAC,CAAC;IACxI,CAAC;IACD,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,wMAAwM,EAAE,kBAAkB,CAAC,CAAC;IAC5Q,OAAO,CAAC,CAAC,MAAM,CAAC,sBAAsB,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;AAChI,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { MigrationBundleWriter, RecordIssue } from '@atlasauth/migrate';
|
|
2
|
+
import type { ExportCursor, PluginContext } from '../framework/plugin';
|
|
3
|
+
/**
|
|
4
|
+
* Test harness for the PropelAuth and Userfront tracks: a fake vendor API
|
|
5
|
+
* (routes are `METHOD path?query` as the exporter sends it; unrouted calls
|
|
6
|
+
* answer 404, so an exporter that calls something unexpected degrades the way
|
|
7
|
+
* it would against a vendor that lacks the endpoint), a hand-built
|
|
8
|
+
* PluginContext and a bundle writer that records every call.
|
|
9
|
+
*/
|
|
10
|
+
export type Route = unknown | {
|
|
11
|
+
status: number;
|
|
12
|
+
body?: unknown;
|
|
13
|
+
} | ((req: {
|
|
14
|
+
url: URL;
|
|
15
|
+
body: unknown;
|
|
16
|
+
headers: Headers;
|
|
17
|
+
}) => unknown);
|
|
18
|
+
export interface FakeVendor {
|
|
19
|
+
fetchImpl: typeof fetch;
|
|
20
|
+
calls: Array<{
|
|
21
|
+
method: string;
|
|
22
|
+
url: string;
|
|
23
|
+
headers: Headers;
|
|
24
|
+
body: unknown;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
export declare function fakeVendor(origin: string, routes: Record<string, Route>): FakeVendor;
|
|
28
|
+
export declare const noSleep: () => Promise<undefined>;
|
|
29
|
+
export interface Harness {
|
|
30
|
+
p: PluginContext;
|
|
31
|
+
said: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare function context(opts?: {
|
|
34
|
+
values?: Record<string, unknown>;
|
|
35
|
+
env?: Record<string, string>;
|
|
36
|
+
files?: Record<string, string>;
|
|
37
|
+
fetch?: typeof fetch;
|
|
38
|
+
}): Harness;
|
|
39
|
+
export declare class FakeWriter {
|
|
40
|
+
described: unknown[];
|
|
41
|
+
warnings: string[];
|
|
42
|
+
omits: Array<[string, string, number]>;
|
|
43
|
+
adds: Array<{
|
|
44
|
+
model: string;
|
|
45
|
+
data: Record<string, unknown>;
|
|
46
|
+
}>;
|
|
47
|
+
issues: Record<string, RecordIssue[]>;
|
|
48
|
+
describe(fields: unknown): void;
|
|
49
|
+
warn(message: string): void;
|
|
50
|
+
omit(model: string, reason: string, count?: number): void;
|
|
51
|
+
add(model: string, data: unknown): Promise<RecordIssue[]>;
|
|
52
|
+
get writer(): MigrationBundleWriter;
|
|
53
|
+
ids(model: string): unknown[];
|
|
54
|
+
models(): string[];
|
|
55
|
+
}
|
|
56
|
+
export declare function resumeFrom(cursor?: ExportCursor | null): {
|
|
57
|
+
checkpoints: import("../../serialize").Json[];
|
|
58
|
+
resume: {
|
|
59
|
+
cursor: import("../../serialize").Json;
|
|
60
|
+
checkpoint: (c: ExportCursor) => undefined;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FakeWriter = exports.noSleep = void 0;
|
|
4
|
+
exports.fakeVendor = fakeVendor;
|
|
5
|
+
exports.context = context;
|
|
6
|
+
exports.resumeFrom = resumeFrom;
|
|
7
|
+
const errors_1 = require("../../errors");
|
|
8
|
+
const isStatus = (v) => typeof v === 'object' && v !== null && 'status' in v && typeof v.status === 'number' && Object.keys(v).every((k) => ['status', 'body'].includes(k));
|
|
9
|
+
function fakeVendor(origin, routes) {
|
|
10
|
+
const calls = [];
|
|
11
|
+
const fetchImpl = (async (input, init = {}) => {
|
|
12
|
+
const url = new URL(String(input));
|
|
13
|
+
const method = (init.method ?? 'GET').toUpperCase();
|
|
14
|
+
const headers = new Headers(init.headers);
|
|
15
|
+
let body = init.body;
|
|
16
|
+
if (typeof body === 'string') {
|
|
17
|
+
try {
|
|
18
|
+
body = JSON.parse(body);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// plain text: kept as the string
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
calls.push({ method, url: url.toString(), headers, body });
|
|
25
|
+
const key = url.origin === origin ? `${method} ${url.pathname}${url.search}` : `${method} ${url.toString()}`;
|
|
26
|
+
let route = routes[key];
|
|
27
|
+
if (route === undefined)
|
|
28
|
+
route = routes[`${method} ${url.pathname}`];
|
|
29
|
+
if (route === undefined)
|
|
30
|
+
return new Response(JSON.stringify({ message: `no route for ${key}` }), { status: 404 });
|
|
31
|
+
const value = typeof route === 'function' ? route({ url, body, headers }) : route;
|
|
32
|
+
const resolved = isStatus(value) ? value : { status: 200, body: value };
|
|
33
|
+
return new Response(resolved.body === undefined ? '' : JSON.stringify(resolved.body), { status: resolved.status, headers: { 'content-type': 'application/json' } });
|
|
34
|
+
});
|
|
35
|
+
return { fetchImpl, calls };
|
|
36
|
+
}
|
|
37
|
+
const noSleep = async () => undefined;
|
|
38
|
+
exports.noSleep = noSleep;
|
|
39
|
+
function context(opts = {}) {
|
|
40
|
+
const values = opts.values ?? {};
|
|
41
|
+
const env = opts.env ?? {};
|
|
42
|
+
const files = opts.files ?? {};
|
|
43
|
+
const said = [];
|
|
44
|
+
const p = {
|
|
45
|
+
ctx: {
|
|
46
|
+
env,
|
|
47
|
+
readFile: (path) => {
|
|
48
|
+
const text = files[path];
|
|
49
|
+
if (text === undefined)
|
|
50
|
+
throw new Error(`ENOENT: no such file, open '${path}'`);
|
|
51
|
+
return text;
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
args: { positionals: [], values },
|
|
55
|
+
project: '/project',
|
|
56
|
+
credential(spec) {
|
|
57
|
+
const name = spec.flag.replace(/^--/, '');
|
|
58
|
+
const raw = values[name];
|
|
59
|
+
const value = (typeof raw === 'string' && raw.trim() ? raw.trim() : undefined) ?? env[spec.env]?.trim();
|
|
60
|
+
if (value)
|
|
61
|
+
return value;
|
|
62
|
+
if (spec.required)
|
|
63
|
+
throw new errors_1.CliError(`${spec.label} is needed. Pass --set ${name}=<value> or set ${spec.env}.`);
|
|
64
|
+
return undefined;
|
|
65
|
+
},
|
|
66
|
+
fetch: opts.fetch ??
|
|
67
|
+
(async () => {
|
|
68
|
+
throw new Error('no vendor API in this test');
|
|
69
|
+
}),
|
|
70
|
+
say: (line) => void said.push(line),
|
|
71
|
+
dryRun: false,
|
|
72
|
+
};
|
|
73
|
+
return { p, said };
|
|
74
|
+
}
|
|
75
|
+
class FakeWriter {
|
|
76
|
+
described = [];
|
|
77
|
+
warnings = [];
|
|
78
|
+
omits = [];
|
|
79
|
+
adds = [];
|
|
80
|
+
issues = {};
|
|
81
|
+
describe(fields) {
|
|
82
|
+
this.described.push(fields);
|
|
83
|
+
}
|
|
84
|
+
warn(message) {
|
|
85
|
+
this.warnings.push(message);
|
|
86
|
+
}
|
|
87
|
+
omit(model, reason, count = 1) {
|
|
88
|
+
this.omits.push([model, reason, count]);
|
|
89
|
+
}
|
|
90
|
+
async add(model, data) {
|
|
91
|
+
this.adds.push({ model, data: data });
|
|
92
|
+
return this.issues[model] ?? [];
|
|
93
|
+
}
|
|
94
|
+
get writer() {
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
ids(model) {
|
|
98
|
+
return this.adds.filter((a) => a.model === model).map((a) => a.data.id);
|
|
99
|
+
}
|
|
100
|
+
models() {
|
|
101
|
+
return this.adds.map((a) => a.model);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.FakeWriter = FakeWriter;
|
|
105
|
+
function resumeFrom(cursor = null) {
|
|
106
|
+
const checkpoints = [];
|
|
107
|
+
return { checkpoints, resume: { cursor, checkpoint: (c) => void checkpoints.push(c) } };
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=propelauth-harness.test-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propelauth-harness.test-helper.js","sourceRoot":"","sources":["../../../src/migrate/export/propelauth-harness.test-helper.ts"],"names":[],"mappings":";;;AAuBA,gCAwBC;AASD,0BAiCC;AAkCD,gCAGC;AA3HD,yCAAwC;AAiBxC,MAAM,QAAQ,GAAG,CAAC,CAAU,EAA2C,EAAE,CACvE,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,QAAQ,IAAI,CAAC,IAAI,OAAQ,CAAyB,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC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