@rockcarver/frodo-cli 2.0.0-3 → 2.0.0-5
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 +9 -1
- package/esm/app.js +2 -2
- package/esm/app.js.map +1 -1
- package/esm/cli/FrodoCommand.js +3 -0
- package/esm/cli/FrodoCommand.js.map +1 -1
- package/esm/cli/conn/conn-save.js +6 -3
- package/esm/cli/conn/conn-save.js.map +1 -1
- package/esm/cli/info/info.js +5 -5
- package/esm/cli/info/info.js.map +1 -1
- package/esm/cli/{logging/logs-fetch.js → log/log-fetch.js} +3 -3
- package/esm/cli/log/log-fetch.js.map +1 -0
- package/esm/cli/log/log-key-delete.js +32 -0
- package/esm/cli/log/log-key-delete.js.map +1 -0
- package/esm/cli/log/log-key-describe.js +19 -0
- package/esm/cli/log/log-key-describe.js.map +1 -0
- package/esm/cli/log/log-key-list.js +23 -0
- package/esm/cli/log/log-key-list.js.map +1 -0
- package/esm/cli/log/log-key.js +8 -0
- package/esm/cli/log/log-key.js.map +1 -0
- package/esm/cli/{logging/logs-list.js → log/log-list.js} +2 -2
- package/esm/cli/log/log-list.js.map +1 -0
- package/esm/cli/{logging/logs-tail.js → log/log-tail.js} +3 -3
- package/esm/cli/log/log-tail.js.map +1 -0
- package/esm/cli/{logging/logs.js → log/log.js} +5 -2
- package/esm/cli/log/log.js.map +1 -0
- package/esm/help/SampleData.js +7 -0
- package/esm/help/SampleData.js.map +1 -0
- package/esm/ops/ConnectionProfileOps.js +1 -1
- package/esm/ops/ConnectionProfileOps.js.map +1 -1
- package/esm/ops/IdpOps.js +22 -10
- package/esm/ops/IdpOps.js.map +1 -1
- package/esm/ops/JourneyOps.js +10 -10
- package/esm/ops/JourneyOps.js.map +1 -1
- package/esm/ops/LogOps.js +77 -25
- package/esm/ops/LogOps.js.map +1 -1
- package/esm/ops/RealmOps.js +6 -4
- package/esm/ops/RealmOps.js.map +1 -1
- package/package.json +2 -2
- package/esm/cli/logging/logs-fetch.js.map +0 -1
- package/esm/cli/logging/logs-list.js.map +0 -1
- package/esm/cli/logging/logs-tail.js.map +0 -1
- package/esm/cli/logging/logs.js.map +0 -1
|
@@ -5,10 +5,13 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
6
|
export const sourcesOptionM = new Option('-c, --sources <sources>', 'Comma separated list of log sources').makeOptionMandatory().default('am-everything,idm-everything', 'Log everything');
|
|
7
7
|
export default function setup() {
|
|
8
|
-
const program = new FrodoStubCommand('
|
|
8
|
+
const program = new FrodoStubCommand('log')
|
|
9
|
+
// for backwards compatibility
|
|
10
|
+
.alias('logs').summary('List/View Identity Cloud logs').description(`View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.`).executableDir(__dirname);
|
|
9
11
|
program.command('list', 'List available ID Cloud log sources.');
|
|
10
12
|
program.command('tail', 'Tail Identity Cloud logs.');
|
|
11
13
|
program.command('fetch', 'Fetch Identity Cloud logs for a time window.');
|
|
14
|
+
program.command('key', 'Manage Identity Cloud log API keys.');
|
|
12
15
|
return program;
|
|
13
16
|
}
|
|
14
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","names":["FrodoStubCommand","Option","path","fileURLToPath","__dirname","dirname","import","meta","url","sourcesOptionM","makeOptionMandatory","default","setup","program","alias","summary","description","executableDir","command"],"sources":["cli/log/log.ts"],"sourcesContent":["import { FrodoStubCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport const sourcesOptionM = new Option(\n '-c, --sources <sources>',\n 'Comma separated list of log sources'\n)\n .makeOptionMandatory()\n .default('am-everything,idm-everything', 'Log everything');\n\nexport default function setup() {\n const program = new FrodoStubCommand('log')\n // for backwards compatibility\n .alias('logs')\n .summary('List/View Identity Cloud logs')\n .description(\n `View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.`\n )\n .executableDir(__dirname);\n\n program.command('list', 'List available ID Cloud log sources.');\n\n program.command('tail', 'Tail Identity Cloud logs.');\n\n program.command('fetch', 'Fetch Identity Cloud logs for a time window.');\n\n program.command('key', 'Manage Identity Cloud log API keys.');\n\n return program;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAO,CAACF,aAAa,CAACG,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,OAAO,MAAMC,cAAc,GAAG,IAAIR,MAAM,CACtC,yBAAyB,EACzB,qCACF,CAAC,CACES,mBAAmB,CAAC,CAAC,CACrBC,OAAO,CAAC,8BAA8B,EAAE,gBAAgB,CAAC;AAE5D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIb,gBAAgB,CAAC,KAAK;EACxC;EAAA,CACCc,KAAK,CAAC,MAAM,CAAC,CACbC,OAAO,CAAC,+BAA+B,CAAC,CACxCC,WAAW,CACT,oJACH,CAAC,CACAC,aAAa,CAACb,SAAS,CAAC;EAE3BS,OAAO,CAACK,OAAO,CAAC,MAAM,EAAE,sCAAsC,CAAC;EAE/DL,OAAO,CAACK,OAAO,CAAC,MAAM,EAAE,2BAA2B,CAAC;EAEpDL,OAAO,CAACK,OAAO,CAAC,OAAO,EAAE,8CAA8C,CAAC;EAExEL,OAAO,CAACK,OAAO,CAAC,KAAK,EAAE,qCAAqC,CAAC;EAE7D,OAAOL,OAAO;AAChB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const amBaseUrl = 'https://openam-matrix.id.forgerock.io/am';
|
|
2
|
+
export const connId = 'matrix';
|
|
3
|
+
export const username = 'thomas.anderson@metacortex.com';
|
|
4
|
+
export const password = 'Blu3P!ll3d';
|
|
5
|
+
export const saId = 'b672336b-41ef-428d-ae4a-e0c082875377';
|
|
6
|
+
export const saJwkFile = './matrix-sa_privateKey.jwk';
|
|
7
|
+
//# sourceMappingURL=SampleData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SampleData.js","names":["amBaseUrl","connId","username","password","saId","saJwkFile"],"sources":["help/SampleData.ts"],"sourcesContent":["export const amBaseUrl = 'https://openam-matrix.id.forgerock.io/am';\nexport const connId = 'matrix';\nexport const username = 'thomas.anderson@metacortex.com';\nexport const password = 'Blu3P!ll3d';\nexport const saId = 'b672336b-41ef-428d-ae4a-e0c082875377';\nexport const saJwkFile = './matrix-sa_privateKey.jwk';\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG,0CAA0C;AACnE,OAAO,MAAMC,MAAM,GAAG,QAAQ;AAC9B,OAAO,MAAMC,QAAQ,GAAG,gCAAgC;AACxD,OAAO,MAAMC,QAAQ,GAAG,YAAY;AACpC,OAAO,MAAMC,IAAI,GAAG,sCAAsC;AAC1D,OAAO,MAAMC,SAAS,GAAG,4BAA4B"}
|
|
@@ -86,7 +86,7 @@ export async function describeConnectionProfile(host, showSecrets) {
|
|
|
86
86
|
const table = createObjectTable(profile, keyMap);
|
|
87
87
|
printMessage(table.toString(), 'data');
|
|
88
88
|
if (showSecrets && jwk) {
|
|
89
|
-
printMessage(jwk, 'data');
|
|
89
|
+
printMessage(JSON.stringify(jwk), 'data');
|
|
90
90
|
}
|
|
91
91
|
} else {
|
|
92
92
|
printMessage(`No connection profile ${host} found`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionProfileOps.js","names":["fs","frodo","state","createObjectTable","createTable","debugMessage","failSpinner","printMessage","showSpinner","succeedSpinner","listConnectionProfiles","long","filename","conn","getConnectionProfilesPath","data","readFileSync","connectionsData","JSON","parse","Object","keys","length","table","forEach","c","push","svcacctName","svcacctId","username","logApiKey","toString","e","message","describeConnectionProfile","host","showSecrets","profile","getConnectionProfileByHost","present","jwk","svcacctJwk","password","logApiSecret","authenticationService","keyMap","tenant","authenticationHeaderOverrides","addExistingServiceAccount","serviceAccountId","privateKeyFile","validate","token","login","getAccessTokenForServiceAccount","setServiceAccountId","setServiceAccountJwk","err"],"sources":["ops/ConnectionProfileOps.ts"],"sourcesContent":["import fs from 'fs';\nimport { frodo, state } from '@rockcarver/frodo-lib';\nimport {\n createObjectTable,\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n succeedSpinner,\n} from '../utils/Console';\n\n/**\n * List connection profiles\n * @param {boolean} long Long list format with details\n * @param {State} state library state\n */\nexport function listConnectionProfiles(long = false) {\n const filename = frodo.conn.getConnectionProfilesPath();\n try {\n const data = fs.readFileSync(filename, 'utf8');\n const connectionsData = JSON.parse(data);\n if (Object.keys(connectionsData).length < 1) {\n printMessage(`No connections defined yet in ${filename}`, 'info');\n } else {\n if (long) {\n const table = createTable([\n 'Host',\n 'Service Account',\n 'Username',\n 'Log API Key',\n ]);\n Object.keys(connectionsData).forEach((c) => {\n table.push([\n c,\n connectionsData[c].svcacctName || connectionsData[c].svcacctId,\n connectionsData[c].username,\n connectionsData[c].logApiKey,\n ]);\n });\n printMessage(table.toString(), 'data');\n } else {\n Object.keys(connectionsData).forEach((c) => {\n printMessage(`${c}`, 'data');\n });\n // getUniqueNames(5, Object.keys(connectionsData));\n }\n printMessage(\n 'Any unique substring of a saved host can be used as the value for host parameter in all commands',\n 'info'\n );\n }\n } catch (e) {\n printMessage(`No connections found in ${filename} (${e.message})`, 'error');\n }\n}\n\n/**\n * Describe connection profile\n * @param {string} host Host URL or unique substring\n * @param {boolean} showSecrets Whether secrets should be shown in clear text or not\n */\nexport async function describeConnectionProfile(\n host: string,\n showSecrets: boolean\n) {\n debugMessage(`ConnectionProfileOps.describeConnectionProfile: start`);\n const profile = await frodo.conn.getConnectionProfileByHost(host);\n if (profile) {\n debugMessage(profile);\n const present = '[present]';\n const jwk = profile.svcacctJwk;\n if (!showSecrets) {\n if (profile.password) profile.password = present;\n if (profile.logApiSecret) profile.logApiSecret = present;\n if (profile.svcacctJwk) (profile as unknown)['svcacctJwk'] = present;\n }\n if (!profile.username) {\n delete profile.username;\n delete profile.password;\n }\n if (!profile.logApiKey) {\n delete profile.logApiKey;\n delete profile.logApiSecret;\n }\n if (!profile.svcacctId) {\n delete profile.svcacctId;\n delete profile.svcacctJwk;\n delete profile.svcacctName;\n }\n if (showSecrets && jwk) {\n (profile as unknown)['svcacctJwk'] = 'see below';\n }\n if (!profile.authenticationService) {\n delete profile.authenticationService;\n }\n const keyMap = {\n tenant: 'Host',\n username: 'Username',\n password: 'Password',\n logApiKey: 'Log API Key',\n logApiSecret: 'Log API Secret',\n authenticationService: 'Authentication Service',\n authenticationHeaderOverrides: 'Authentication Header Overrides',\n svcacctName: 'Service Account Name',\n svcacctId: 'Service Account Id',\n svcacctJwk: 'Service Account JWK',\n };\n const table = createObjectTable(profile, keyMap);\n printMessage(table.toString(), 'data');\n if (showSecrets && jwk) {\n printMessage(jwk, 'data');\n }\n } else {\n printMessage(`No connection profile ${host} found`);\n }\n debugMessage(`ConnectionProfileOps.describeConnectionProfile: end`);\n}\n\nexport async function addExistingServiceAccount(\n serviceAccountId: string,\n privateKeyFile: string,\n validate: boolean\n): Promise<boolean> {\n try {\n const data = fs.readFileSync(privateKeyFile);\n const jwk = JSON.parse(data.toString());\n if (validate) {\n showSpinner(`Validating service account ${serviceAccountId}...`);\n const token = await frodo.login.getAccessTokenForServiceAccount(\n serviceAccountId,\n jwk\n );\n if (token === null) {\n failSpinner(`Failed to validate service account ${serviceAccountId}.`);\n return false;\n } else {\n succeedSpinner(\n `Successfully validated service account ${serviceAccountId}.`\n );\n }\n }\n state.setServiceAccountId(serviceAccountId);\n state.setServiceAccountJwk(jwk);\n return true;\n } catch (err) {\n failSpinner(\n `Failed to validate service account ${serviceAccountId}: ${err}.`\n );\n }\n return false;\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,SAASC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SACEC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,cAAc,QACT,kBAAkB;;AAEzB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAACC,IAAI,GAAG,KAAK,EAAE;EACnD,MAAMC,QAAQ,GAAGX,KAAK,CAACY,IAAI,CAACC,yBAAyB,CAAC,CAAC;EACvD,IAAI;IACF,MAAMC,IAAI,GAAGf,EAAE,CAACgB,YAAY,CAACJ,QAAQ,EAAE,MAAM,CAAC;IAC9C,MAAMK,eAAe,GAAGC,IAAI,CAACC,KAAK,CAACJ,IAAI,CAAC;IACxC,IAAIK,MAAM,CAACC,IAAI,CAACJ,eAAe,CAAC,CAACK,MAAM,GAAG,CAAC,EAAE;MAC3Cf,YAAY,CAAE,iCAAgCK,QAAS,EAAC,EAAE,MAAM,CAAC;IACnE,CAAC,MAAM;MACL,IAAID,IAAI,EAAE;QACR,MAAMY,KAAK,GAAGnB,WAAW,CAAC,CACxB,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,aAAa,CACd,CAAC;QACFgB,MAAM,CAACC,IAAI,CAACJ,eAAe,CAAC,CAACO,OAAO,CAAEC,CAAC,IAAK;UAC1CF,KAAK,CAACG,IAAI,CAAC,CACTD,CAAC,EACDR,eAAe,CAACQ,CAAC,CAAC,CAACE,WAAW,IAAIV,eAAe,CAACQ,CAAC,CAAC,CAACG,SAAS,EAC9DX,eAAe,CAACQ,CAAC,CAAC,CAACI,QAAQ,EAC3BZ,eAAe,CAACQ,CAAC,CAAC,CAACK,SAAS,CAC7B,CAAC;QACJ,CAAC,CAAC;QACFvB,YAAY,CAACgB,KAAK,CAACQ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IACA,IAAI,CAACN,OAAO,CAACT,SAAS,EAAE;MACtB,OAAOS,OAAO,CAACT,SAAS;MACxB,OAAOS,OAAO,CAACI,UAAU;MACzB,OAAOJ,OAAO,CAACV,WAAW;IAC5B;IACA,IAAIS,WAAW,IAAII,GAAG,EAAE;MACrBH,OAAO,CAAa,YAAY,CAAC,GAAG,WAAW;IAClD;IACA,IAAI,CAACA,OAAO,CAACO,qBAAqB,EAAE;MAClC,OAAOP,OAAO,CAACO,qBAAqB;IACtC;IACA,MAAMC,MAAM,GAAG;MACbC,MAAM,EAAE,MAAM;MACdjB,QAAQ,EAAE,UAAU;MACpBa,QAAQ,EAAE,UAAU;MACpBZ,SAAS,EAAE,aAAa;MACxBa,YAAY,EAAE,gBAAgB;MAC9BC,qBAAqB,EAAE,wBAAwB;MAC/CG,6BAA6B,EAAE,iCAAiC;MAChEpB,WAAW,EAAE,sBAAsB;MACnCC,SAAS,EAAE,oBAAoB;MAC/Ba,UAAU,EAAE;IACd,CAAC;IACD,MAAMlB,KAAK,GAAGpB,iBAAiB,CAACkC,OAAO,EAAEQ,MAAM,CAAC;IAChDtC,YAAY,CAACgB,KAAK,CAACQ,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACtC,IAAIK,WAAW,IAAII,GAAG,EAAE;MACtBjC,YAAY,
|
|
1
|
+
{"version":3,"file":"ConnectionProfileOps.js","names":["fs","frodo","state","createObjectTable","createTable","debugMessage","failSpinner","printMessage","showSpinner","succeedSpinner","listConnectionProfiles","long","filename","conn","getConnectionProfilesPath","data","readFileSync","connectionsData","JSON","parse","Object","keys","length","table","forEach","c","push","svcacctName","svcacctId","username","logApiKey","toString","e","message","describeConnectionProfile","host","showSecrets","profile","getConnectionProfileByHost","present","jwk","svcacctJwk","password","logApiSecret","authenticationService","keyMap","tenant","authenticationHeaderOverrides","stringify","addExistingServiceAccount","serviceAccountId","privateKeyFile","validate","token","login","getAccessTokenForServiceAccount","setServiceAccountId","setServiceAccountJwk","err"],"sources":["ops/ConnectionProfileOps.ts"],"sourcesContent":["import fs from 'fs';\nimport { frodo, state } from '@rockcarver/frodo-lib';\nimport {\n createObjectTable,\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n succeedSpinner,\n} from '../utils/Console';\n\n/**\n * List connection profiles\n * @param {boolean} long Long list format with details\n * @param {State} state library state\n */\nexport function listConnectionProfiles(long = false) {\n const filename = frodo.conn.getConnectionProfilesPath();\n try {\n const data = fs.readFileSync(filename, 'utf8');\n const connectionsData = JSON.parse(data);\n if (Object.keys(connectionsData).length < 1) {\n printMessage(`No connections defined yet in ${filename}`, 'info');\n } else {\n if (long) {\n const table = createTable([\n 'Host',\n 'Service Account',\n 'Username',\n 'Log API Key',\n ]);\n Object.keys(connectionsData).forEach((c) => {\n table.push([\n c,\n connectionsData[c].svcacctName || connectionsData[c].svcacctId,\n connectionsData[c].username,\n connectionsData[c].logApiKey,\n ]);\n });\n printMessage(table.toString(), 'data');\n } else {\n Object.keys(connectionsData).forEach((c) => {\n printMessage(`${c}`, 'data');\n });\n // getUniqueNames(5, Object.keys(connectionsData));\n }\n printMessage(\n 'Any unique substring of a saved host can be used as the value for host parameter in all commands',\n 'info'\n );\n }\n } catch (e) {\n printMessage(`No connections found in ${filename} (${e.message})`, 'error');\n }\n}\n\n/**\n * Describe connection profile\n * @param {string} host Host URL or unique substring\n * @param {boolean} showSecrets Whether secrets should be shown in clear text or not\n */\nexport async function describeConnectionProfile(\n host: string,\n showSecrets: boolean\n) {\n debugMessage(`ConnectionProfileOps.describeConnectionProfile: start`);\n const profile = await frodo.conn.getConnectionProfileByHost(host);\n if (profile) {\n debugMessage(profile);\n const present = '[present]';\n const jwk = profile.svcacctJwk;\n if (!showSecrets) {\n if (profile.password) profile.password = present;\n if (profile.logApiSecret) profile.logApiSecret = present;\n if (profile.svcacctJwk) (profile as unknown)['svcacctJwk'] = present;\n }\n if (!profile.username) {\n delete profile.username;\n delete profile.password;\n }\n if (!profile.logApiKey) {\n delete profile.logApiKey;\n delete profile.logApiSecret;\n }\n if (!profile.svcacctId) {\n delete profile.svcacctId;\n delete profile.svcacctJwk;\n delete profile.svcacctName;\n }\n if (showSecrets && jwk) {\n (profile as unknown)['svcacctJwk'] = 'see below';\n }\n if (!profile.authenticationService) {\n delete profile.authenticationService;\n }\n const keyMap = {\n tenant: 'Host',\n username: 'Username',\n password: 'Password',\n logApiKey: 'Log API Key',\n logApiSecret: 'Log API Secret',\n authenticationService: 'Authentication Service',\n authenticationHeaderOverrides: 'Authentication Header Overrides',\n svcacctName: 'Service Account Name',\n svcacctId: 'Service Account Id',\n svcacctJwk: 'Service Account JWK',\n };\n const table = createObjectTable(profile, keyMap);\n printMessage(table.toString(), 'data');\n if (showSecrets && jwk) {\n printMessage(JSON.stringify(jwk), 'data');\n }\n } else {\n printMessage(`No connection profile ${host} found`);\n }\n debugMessage(`ConnectionProfileOps.describeConnectionProfile: end`);\n}\n\nexport async function addExistingServiceAccount(\n serviceAccountId: string,\n privateKeyFile: string,\n validate: boolean\n): Promise<boolean> {\n try {\n const data = fs.readFileSync(privateKeyFile);\n const jwk = JSON.parse(data.toString());\n if (validate) {\n showSpinner(`Validating service account ${serviceAccountId}...`);\n const token = await frodo.login.getAccessTokenForServiceAccount(\n serviceAccountId,\n jwk\n );\n if (token === null) {\n failSpinner(`Failed to validate service account ${serviceAccountId}.`);\n return false;\n } else {\n succeedSpinner(\n `Successfully validated service account ${serviceAccountId}.`\n );\n }\n }\n state.setServiceAccountId(serviceAccountId);\n state.setServiceAccountJwk(jwk);\n return true;\n } catch (err) {\n failSpinner(\n `Failed to validate service account ${serviceAccountId}: ${err}.`\n );\n }\n return false;\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,SAASC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SACEC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,cAAc,QACT,kBAAkB;;AA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QACtE,OAAO,KAAK;MACd,CAAC,MAAM;QACLzC,cAAc,CACX,0CAAyCyC,gBAAiB,GAC7D,CAAC;MACH;IACF;IACAhD,KAAK,CAACsD,mBAAmB,CAACN,gBAAgB,CAAC;IAC3ChD,KAAK,CAACuD,oBAAoB,CAACjB,GAAG,CAAC;IAC/B,OAAO,IAAI;EACb,CAAC,CAAC,OAAOkB,GAAG,EAAE;IACZpD,WAAW,CACR,sCAAqC4C,gBAAiB,KAAIQ,GAAI,GACjE,CAAC;EACH;EACA,OAAO,KAAK;AACd"}
|
package/esm/ops/IdpOps.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { frodo } from '@rockcarver/frodo-lib';
|
|
2
2
|
import fs from 'fs';
|
|
3
|
-
import { createProgressBar, failSpinner, printMessage, showSpinner, stopProgressBar, succeedSpinner, updateProgressBar } from '../utils/Console';
|
|
3
|
+
import { createProgressBar, debugMessage, failSpinner, printMessage, showSpinner, stopProgressBar, succeedSpinner, updateProgressBar } from '../utils/Console';
|
|
4
4
|
import { getRealmString, getTypedFilename, saveJsonToFile } from '../utils/ExportImportUtils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -56,6 +56,7 @@ export async function listSocialProviders() {
|
|
|
56
56
|
* @param {string} file optional export file name
|
|
57
57
|
*/
|
|
58
58
|
export async function exportSocialProviderToFile(providerId, file = '') {
|
|
59
|
+
debugMessage(`cli.IdpOps.exportSocialProviderToFile: start`);
|
|
59
60
|
let fileName = file;
|
|
60
61
|
if (!fileName) {
|
|
61
62
|
fileName = getTypedFilename(providerId, 'idp');
|
|
@@ -70,6 +71,7 @@ export async function exportSocialProviderToFile(providerId, file = '') {
|
|
|
70
71
|
stopProgressBar(`${err}`);
|
|
71
72
|
printMessage(`${err}`, 'error');
|
|
72
73
|
}
|
|
74
|
+
debugMessage(`cli.IdpOps.exportSocialProviderToFile: end`);
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
/**
|
|
@@ -89,16 +91,26 @@ export async function exportSocialProvidersToFile(file = '') {
|
|
|
89
91
|
* Export all providers to individual files
|
|
90
92
|
*/
|
|
91
93
|
export async function exportSocialProvidersToFiles() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
debugMessage(`cli.IdpOps.exportSocialProvidersToFiles: start`);
|
|
95
|
+
try {
|
|
96
|
+
const allIdpsData = await frodo.oauth2oidc.external.getSocialIdentityProviders();
|
|
97
|
+
createProgressBar(allIdpsData.length, 'Exporting providers');
|
|
98
|
+
for (const idpData of allIdpsData) {
|
|
99
|
+
try {
|
|
100
|
+
const fileName = getTypedFilename(idpData._id, 'idp');
|
|
101
|
+
const fileData = await frodo.oauth2oidc.external.exportSocialProvider(idpData._id);
|
|
102
|
+
saveJsonToFile(fileData, fileName);
|
|
103
|
+
updateProgressBar(`Exported provider ${idpData._id}`);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
printMessage(`Error exporting ${idpData._id}: ${error}`, 'error');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
stopProgressBar(`${allIdpsData.length} providers exported.`);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
stopProgressBar(`${error}`);
|
|
111
|
+
printMessage(`${error}`, 'error');
|
|
100
112
|
}
|
|
101
|
-
|
|
113
|
+
debugMessage(`cli.IdpOps.exportSocialProvidersToFiles: end`);
|
|
102
114
|
}
|
|
103
115
|
|
|
104
116
|
/**
|
package/esm/ops/IdpOps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdpOps.js","names":["frodo","fs","createProgressBar","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","getRealmString","getTypedFilename","saveJsonToFile","getOneLineDescription","socialIdpObj","description","_id","_type","getTableHeaderMd","markdown","getTableRowMd","row","enabled","name","listSocialProviders","providers","oauth2oidc","external","getSocialIdentityProviders","sort","a","b","localeCompare","forEach","socialIdentityProvider","err","message","exportSocialProviderToFile","providerId","file","fileName","fileData","exportSocialProvider","exportSocialProvidersToFile","exportSocialProviders","exportSocialProvidersToFiles","allIdpsData","length","idpData","importSocialProviderFromFile","outcome","readFile","data","JSON","parse","importSocialProvider","error","_error$response","response","importFirstSocialProviderFromFile","importFirstSocialProvider","_error$response2","importSocialProvidersFromFile","importSocialProviders","_error$response3","importSocialProvidersFromFiles","names","readdirSync","jsonFiles","filter","toLowerCase","endsWith","total","readFileSync","count","Object","keys","idp"],"sources":["ops/IdpOps.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport fs from 'fs';\nimport type { SocialIdpSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport {\n createProgressBar,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport {\n getRealmString,\n getTypedFilename,\n saveJsonToFile,\n} from '../utils/ExportImportUtils';\n\n/**\n * Get a one-line description of the social idp object\n * @param {SocialIdpSkeleton} socialIdpObj social idp object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(socialIdpObj: SocialIdpSkeleton): string {\n const description = `[${socialIdpObj._id['brightCyan']}] ${socialIdpObj._type._id}`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Name/Id | Status | Type |\\n';\n markdown += '| ------- | ------ | ---- |';\n return markdown;\n}\n\n/**\n * Get a table-row of the social idp in markdown\n * @param {SocialIdpSkeleton} socialIdpObj social idp object to describe\n * @returns {string} a table-row of the social idp in markdown\n */\nexport function getTableRowMd(socialIdpObj: SocialIdpSkeleton): string {\n const row = `| ${socialIdpObj._id} | ${\n socialIdpObj.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n } | ${socialIdpObj._type.name} |`;\n return row;\n}\n\n/**\n * List providers\n */\nexport async function listSocialProviders() {\n try {\n const providers =\n await frodo.oauth2oidc.external.getSocialIdentityProviders();\n providers.sort((a, b) => a._id.localeCompare(b._id));\n providers.forEach((socialIdentityProvider) => {\n printMessage(`${socialIdentityProvider._id}`, 'data');\n });\n } catch (err) {\n printMessage(`listSocialProviders ERROR: ${err.message}`, 'error');\n printMessage(err, 'error');\n }\n}\n\n/**\n * Export provider by id\n * @param {string} providerId provider id/name\n * @param {string} file optional export file name\n */\nexport async function exportSocialProviderToFile(\n providerId: string,\n file = ''\n) {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(providerId, 'idp');\n }\n createProgressBar(1, `Exporting ${providerId}`);\n try {\n updateProgressBar(`Writing file ${fileName}`);\n const fileData = await frodo.oauth2oidc.external.exportSocialProvider(\n providerId\n );\n saveJsonToFile(fileData, fileName);\n stopProgressBar(\n `Exported ${providerId['brightCyan']} to ${fileName['brightCyan']}.`\n );\n } catch (err) {\n stopProgressBar(`${err}`);\n printMessage(`${err}`, 'error');\n }\n}\n\n/**\n * Export all providers\n * @param {string} file optional export file name\n */\nexport async function exportSocialProvidersToFile(file = '') {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(`all${getRealmString()}Providers`, 'idp');\n }\n const fileData = await frodo.oauth2oidc.external.exportSocialProviders();\n saveJsonToFile(fileData, fileName);\n}\n\n/**\n * Export all providers to individual files\n */\nexport async function exportSocialProvidersToFiles() {\n const allIdpsData =\n await frodo.oauth2oidc.external.getSocialIdentityProviders();\n // printMessage(allIdpsData, 'data');\n createProgressBar(allIdpsData.length, 'Exporting providers');\n for (const idpData of allIdpsData) {\n updateProgressBar(`Writing provider ${idpData._id}`);\n const fileName = getTypedFilename(idpData._id, 'idp');\n const fileData = await frodo.oauth2oidc.external.exportSocialProvider(\n idpData._id\n );\n saveJsonToFile(fileData, fileName);\n }\n stopProgressBar(`${allIdpsData.length} providers exported.`);\n}\n\n/**\n * Import provider by id/name\n * @param {string} providerId provider id/name\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if provider was imported successfully, false otherwise\n */\nexport async function importSocialProviderFromFile(\n providerId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing provider ${providerId} from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importSocialProvider(\n providerId,\n fileData\n );\n succeedSpinner(\n `Successfully imported provider ${providerId} from ${file}.`\n );\n } catch (error) {\n failSpinner(`Error importing provider ${providerId} from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import first provider from file\n * @param {String} file import file name\n * @returns {Promise<boolean>} true if first provider was imported successfully, false otherwise\n */\nexport async function importFirstSocialProviderFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing first provider from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importFirstSocialProvider(\n fileData\n );\n succeedSpinner(`Successfully imported first provider from ${file}.`);\n } catch (error) {\n failSpinner(`Error importing first provider from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import all providers from file\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if all providers were imported successfully, false otherwise\n */\nexport async function importSocialProvidersFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing providers from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importSocialProviders(fileData);\n succeedSpinner(`Successfully imported providers from ${file}.`);\n } catch (error) {\n failSpinner(`Error importing providers from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import providers from *.idp.json files in current working directory\n */\nexport async function importSocialProvidersFromFiles() {\n const names = fs.readdirSync('.');\n const jsonFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.idp.json')\n );\n\n createProgressBar(jsonFiles.length, 'Importing providers...');\n let total = 0;\n for (const file of jsonFiles) {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n const count = Object.keys(fileData.idp).length;\n total += count;\n await frodo.oauth2oidc.external.importSocialProviders(fileData);\n updateProgressBar(`Imported ${count} provider(s) from ${file}`);\n }\n stopProgressBar(\n `Finished importing ${total} provider(s) from ${jsonFiles.length} file(s).`\n );\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,iBAAiB,QACZ,kBAAkB;AACzB,SACEC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,QACT,4BAA4B;;AAEnC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,YAA+B,EAAU;EAC7E,MAAMC,WAAW,GAAI,IAAGD,YAAY,CAACE,GAAG,CAAC,YAAY,CAAE,KAAIF,YAAY,CAACG,KAAK,CAACD,GAAI,EAAC;EACnF,OAAOD,WAAW;AACpB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASG,gBAAgBA,CAAA,EAAW;EACzC,IAAIC,QAAQ,GAAG,EAAE;EACjBA,QAAQ,IAAI,+BAA+B;EAC3CA,QAAQ,IAAI,6BAA6B;EACzC,OAAOA,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACN,YAA+B,EAAU;EACrE,MAAMO,GAAG,GAAI,KAAIP,YAAY,CAACE,GAAI,MAChCF,YAAY,CAACQ,OAAO,KAAK,KAAK,GAC1B,gBAAgB,GAChB,8BACL,MAAKR,YAAY,CAACG,KAAK,CAACM,IAAK,IAAG;EACjC,OAAOF,GAAG;AACZ;;AAEA;A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,GAAGhE,EAAE,CAACiE,WAAW,CAAC,GAAG,CAAC;EACjC,MAAMC,SAAS,GAAGF,KAAK,CAACG,MAAM,CAAE9C,IAAI,IAClCA,IAAI,CAAC+C,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,WAAW,CACzC,CAAC;EAEDpE,iBAAiB,CAACiE,SAAS,CAACrB,MAAM,EAAE,wBAAwB,CAAC;EAC7D,IAAIyB,KAAK,GAAG,CAAC;EACb,KAAK,MAAMjC,IAAI,IAAI6B,SAAS,EAAE;IAC5B,MAAMhB,IAAI,GAAGlD,EAAE,CAACuE,YAAY,CAAClC,IAAI,EAAE,MAAM,CAAC;IAC1C,MAAME,QAAQ,GAAGY,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC;IACjC,MAAMsB,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACnC,QAAQ,CAACoC,GAAG,CAAC,CAAC9B,MAAM;IAC9CyB,KAAK,IAAIE,KAAK;IACd,MAAMzE,KAAK,CAACyB,UAAU,CAACC,QAAQ,CAACoC,qBAAqB,CAACtB,QAAQ,CAAC;IAC/DhC,iBAAiB,CAAE,YAAWiE,KAAM,qBAAoBnC,IAAK,EAAC,CAAC;EACjE;EACAhC,eAAe,CACZ,sBAAqBiE,KAAM,qBAAoBJ,SAAS,CAACrB,MAAO,WACnE,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"IdpOps.js","names":["frodo","fs","createProgressBar","debugMessage","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","getRealmString","getTypedFilename","saveJsonToFile","getOneLineDescription","socialIdpObj","description","_id","_type","getTableHeaderMd","markdown","getTableRowMd","row","enabled","name","listSocialProviders","providers","oauth2oidc","external","getSocialIdentityProviders","sort","a","b","localeCompare","forEach","socialIdentityProvider","err","message","exportSocialProviderToFile","providerId","file","fileName","fileData","exportSocialProvider","exportSocialProvidersToFile","exportSocialProviders","exportSocialProvidersToFiles","allIdpsData","length","idpData","error","importSocialProviderFromFile","outcome","readFile","data","JSON","parse","importSocialProvider","_error$response","response","importFirstSocialProviderFromFile","importFirstSocialProvider","_error$response2","importSocialProvidersFromFile","importSocialProviders","_error$response3","importSocialProvidersFromFiles","names","readdirSync","jsonFiles","filter","toLowerCase","endsWith","total","readFileSync","count","Object","keys","idp"],"sources":["ops/IdpOps.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport fs from 'fs';\nimport type { SocialIdpSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport {\n createProgressBar,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport {\n getRealmString,\n getTypedFilename,\n saveJsonToFile,\n} from '../utils/ExportImportUtils';\n\n/**\n * Get a one-line description of the social idp object\n * @param {SocialIdpSkeleton} socialIdpObj social idp object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(socialIdpObj: SocialIdpSkeleton): string {\n const description = `[${socialIdpObj._id['brightCyan']}] ${socialIdpObj._type._id}`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Name/Id | Status | Type |\\n';\n markdown += '| ------- | ------ | ---- |';\n return markdown;\n}\n\n/**\n * Get a table-row of the social idp in markdown\n * @param {SocialIdpSkeleton} socialIdpObj social idp object to describe\n * @returns {string} a table-row of the social idp in markdown\n */\nexport function getTableRowMd(socialIdpObj: SocialIdpSkeleton): string {\n const row = `| ${socialIdpObj._id} | ${\n socialIdpObj.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n } | ${socialIdpObj._type.name} |`;\n return row;\n}\n\n/**\n * List providers\n */\nexport async function listSocialProviders() {\n try {\n const providers =\n await frodo.oauth2oidc.external.getSocialIdentityProviders();\n providers.sort((a, b) => a._id.localeCompare(b._id));\n providers.forEach((socialIdentityProvider) => {\n printMessage(`${socialIdentityProvider._id}`, 'data');\n });\n } catch (err) {\n printMessage(`listSocialProviders ERROR: ${err.message}`, 'error');\n printMessage(err, 'error');\n }\n}\n\n/**\n * Export provider by id\n * @param {string} providerId provider id/name\n * @param {string} file optional export file name\n */\nexport async function exportSocialProviderToFile(\n providerId: string,\n file = ''\n) {\n debugMessage(`cli.IdpOps.exportSocialProviderToFile: start`);\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(providerId, 'idp');\n }\n createProgressBar(1, `Exporting ${providerId}`);\n try {\n updateProgressBar(`Writing file ${fileName}`);\n const fileData = await frodo.oauth2oidc.external.exportSocialProvider(\n providerId\n );\n saveJsonToFile(fileData, fileName);\n stopProgressBar(\n `Exported ${providerId['brightCyan']} to ${fileName['brightCyan']}.`\n );\n } catch (err) {\n stopProgressBar(`${err}`);\n printMessage(`${err}`, 'error');\n }\n debugMessage(`cli.IdpOps.exportSocialProviderToFile: end`);\n}\n\n/**\n * Export all providers\n * @param {string} file optional export file name\n */\nexport async function exportSocialProvidersToFile(file = '') {\n let fileName = file;\n if (!fileName) {\n fileName = getTypedFilename(`all${getRealmString()}Providers`, 'idp');\n }\n const fileData = await frodo.oauth2oidc.external.exportSocialProviders();\n saveJsonToFile(fileData, fileName);\n}\n\n/**\n * Export all providers to individual files\n */\nexport async function exportSocialProvidersToFiles() {\n debugMessage(`cli.IdpOps.exportSocialProvidersToFiles: start`);\n try {\n const allIdpsData =\n await frodo.oauth2oidc.external.getSocialIdentityProviders();\n createProgressBar(allIdpsData.length, 'Exporting providers');\n for (const idpData of allIdpsData) {\n try {\n const fileName = getTypedFilename(idpData._id, 'idp');\n const fileData = await frodo.oauth2oidc.external.exportSocialProvider(\n idpData._id\n );\n saveJsonToFile(fileData, fileName);\n updateProgressBar(`Exported provider ${idpData._id}`);\n } catch (error) {\n printMessage(`Error exporting ${idpData._id}: ${error}`, 'error');\n }\n }\n stopProgressBar(`${allIdpsData.length} providers exported.`);\n } catch (error) {\n stopProgressBar(`${error}`);\n printMessage(`${error}`, 'error');\n }\n debugMessage(`cli.IdpOps.exportSocialProvidersToFiles: end`);\n}\n\n/**\n * Import provider by id/name\n * @param {string} providerId provider id/name\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if provider was imported successfully, false otherwise\n */\nexport async function importSocialProviderFromFile(\n providerId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing provider ${providerId} from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importSocialProvider(\n providerId,\n fileData\n );\n succeedSpinner(\n `Successfully imported provider ${providerId} from ${file}.`\n );\n } catch (error) {\n failSpinner(`Error importing provider ${providerId} from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import first provider from file\n * @param {String} file import file name\n * @returns {Promise<boolean>} true if first provider was imported successfully, false otherwise\n */\nexport async function importFirstSocialProviderFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing first provider from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importFirstSocialProvider(\n fileData\n );\n succeedSpinner(`Successfully imported first provider from ${file}.`);\n } catch (error) {\n failSpinner(`Error importing first provider from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import all providers from file\n * @param {string} file import file name\n * @returns {Promise<boolean>} true if all providers were imported successfully, false otherwise\n */\nexport async function importSocialProvidersFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n showSpinner(`Importing providers from ${file}...`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n outcome = await frodo.oauth2oidc.external.importSocialProviders(fileData);\n succeedSpinner(`Successfully imported providers from ${file}.`);\n } catch (error) {\n failSpinner(`Error importing providers from ${file}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import providers from *.idp.json files in current working directory\n */\nexport async function importSocialProvidersFromFiles() {\n const names = fs.readdirSync('.');\n const jsonFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.idp.json')\n );\n\n createProgressBar(jsonFiles.length, 'Importing providers...');\n let total = 0;\n for (const file of jsonFiles) {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n const count = Object.keys(fileData.idp).length;\n total += count;\n await frodo.oauth2oidc.external.importSocialProviders(fileData);\n updateProgressBar(`Imported ${count} provider(s) from ${file}`);\n }\n stopProgressBar(\n `Finished importing ${total} provider(s) from ${jsonFiles.length} file(s).`\n );\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,iBAAiB,EACjBC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,iBAAiB,QACZ,kBAAkB;AACzB,SACEC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,QACT,4BAA4B;;AAEnC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,YAA+B,EAAU;EAC7E,MAAMC,WAAW,GAAI,IAAGD,YAAY,CAACE,GAAG,CAAC,YAAY,CAAE,KAAIF,YAAY,CAACG,KAAK,CAACD,GAAI,EAAC;EACnF,OAAOD,WAAW;AACpB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASG,gBAAgBA,CAAA,EAAW;EACzC,IAAIC,QAAQ,GAAG,EAAE;EACjBA,QAAQ,IAAI,+BAA+B;EAC3CA,QAAQ,IAAI,6BAA6B;EACzC,OAAOA,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACN,YAA+B,EAAU;EACrE,MAAMO,GAAG,GAAI,KAAIP,YAAY,CAACE,GAAI,MAChCF,YAAY,C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BAAqB,CAACtB,QAAQ,CAAC;IAC/DhC,iBAAiB,CAAE,YAAWiE,KAAM,qBAAoBnC,IAAK,EAAC,CAAC;EACjE;EACAhC,eAAe,CACZ,sBAAqBiE,KAAM,qBAAoBJ,SAAS,CAACrB,MAAO,WACnE,CAAC;AACH"}
|
package/esm/ops/JourneyOps.js
CHANGED
|
@@ -298,16 +298,16 @@ export async function importJourneysFromFiles(options) {
|
|
|
298
298
|
* @returns {string[]} Colored string array of classifications
|
|
299
299
|
*/
|
|
300
300
|
export function getJourneyClassification(journey) {
|
|
301
|
-
return getJourneyClassification(journey).map(it => {
|
|
301
|
+
return frodo.authn.journey.getJourneyClassification(journey).map(it => {
|
|
302
302
|
switch (it) {
|
|
303
303
|
case 'standard':
|
|
304
|
-
return it
|
|
304
|
+
return it['brightGreen'];
|
|
305
305
|
case 'cloud':
|
|
306
|
-
return it
|
|
306
|
+
return it['brightMagenta'];
|
|
307
307
|
case 'custom':
|
|
308
|
-
return it
|
|
308
|
+
return it['brightRed'];
|
|
309
309
|
case 'premium':
|
|
310
|
-
return it
|
|
310
|
+
return it['brightYellow'];
|
|
311
311
|
}
|
|
312
312
|
});
|
|
313
313
|
}
|
|
@@ -318,16 +318,16 @@ export function getJourneyClassification(journey) {
|
|
|
318
318
|
* @returns {string[]} Colored string array of classifications
|
|
319
319
|
*/
|
|
320
320
|
export function getJourneyClassificationMd(journey) {
|
|
321
|
-
return getJourneyClassification(journey).map(it => {
|
|
321
|
+
return frodo.authn.journey.getJourneyClassification(journey).map(it => {
|
|
322
322
|
switch (it) {
|
|
323
323
|
case 'standard':
|
|
324
|
-
return `:green_circle: \`${it
|
|
324
|
+
return `:green_circle: \`${it}\``;
|
|
325
325
|
case 'cloud':
|
|
326
|
-
return `:purple_circle: \`${it
|
|
326
|
+
return `:purple_circle: \`${it}\``;
|
|
327
327
|
case 'custom':
|
|
328
|
-
return `:red_circle: \`${it
|
|
328
|
+
return `:red_circle: \`${it}\``;
|
|
329
329
|
case 'premium':
|
|
330
|
-
return `:yellow_circle: \`${it
|
|
330
|
+
return `:yellow_circle: \`${it}\``;
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
333
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JourneyOps.js","names":["frodo","state","fs","printMessage","createProgressBar","updateProgressBar","stopProgressBar","showSpinner","succeedSpinner","failSpinner","createTable","debugMessage","CirclesOfTrust","EmailTemplate","Idp","Node","Saml2","Script","Theme","wordwrap","cloneDeep","listJourneys","long","analyze","journeys","authn","journey","getJourneys","journeyStub","table","_journeyStub$uiConfig","push","_id","enabled","uiConfig","categories","JSON","parse","join","toString","exportPromises","exportJourney","useStringArrays","deps","journeyExports","Promise","all","journeyExport","_journeyExport$tree$u","tree","getJourneyClassification","error","response","data","_error$response","exportJourneyToFile","journeyId","file","options","verbose","getDebug","utils","impex","getTypedFilename","getDirectory","dir","replace","existsSync","mkdirSync","recursive","fileData","saveJsonToFile","exportJourneysToFile","fileName","getRealmString","trees","createMultiTreeExportTemplate","length","exportData","meta","exportJourneysToFiles","importJourneyFromFile","readFile","err","journeyData","installedJourneys","map","x","unresolvedJourneys","resolvedJourneys","resolveDependencies","Object","keys","importJourney","then","catch","importError","importFirstJourneyFromFile","treeId","hasOwnProperty","call","importJourneysFromFile","importAllJourneys","importJourneysFromFiles","names","readdirSync","jsonFiles","filter","name","toLowerCase","endsWith","allJourneysData","readFileSync","it","getJourneyClassificationMd","getOneLineDescription","treeObj","description","getOneLineDescriptionMd","describeTreeDescendents","descendents","depth","values","indent","Array","fill","descendent","describeTreeDescendentsMd","markdown","describeJourney","resolveTreeExport","onlineTreeExportResolver","_journeyData$meta","_journeyData$tree$uiC","_journeyData$themes","allNodes","nodes","innerNodes","nodeTypeMap","nodeData","_type","getAmVersion","originAmVersion","setAmVersion","getTreeDescendents","entries","nodeType","count","String","getNodeClassification","nodeObj","getNodeRef","themes","themeData","scripts","scriptData","emailTemplates","templateData","socialIdentityProviders","socialIdpData","saml2Entities","entityProviderData","circlesOfTrust","cotData","describeJourneyMd","_journeyData$meta2","_journeyData$tree$uiC2","_journeyData$themes2","getNodeClassificationMd","getTableHeaderMd","getTableRowMd"],"sources":["ops/JourneyOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport fs from 'fs';\nimport type {\n NodeSkeleton,\n TreeSkeleton,\n} from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport type {\n JourneyClassificationType,\n MultiTreeExportInterface,\n SingleTreeExportInterface,\n TreeDependencyMapInterface,\n TreeExportOptions,\n TreeExportResolverInterface,\n TreeImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/OpsTypes';\nimport {\n printMessage,\n createProgressBar,\n updateProgressBar,\n stopProgressBar,\n showSpinner,\n succeedSpinner,\n failSpinner,\n createTable,\n debugMessage,\n} from '../utils/Console';\nimport * as CirclesOfTrust from './CirclesOfTrustOps';\nimport * as EmailTemplate from './EmailTemplateOps';\nimport * as Idp from './IdpOps';\nimport * as Node from './NodeOps';\nimport * as Saml2 from './Saml2Ops';\nimport * as Script from './ScriptOps';\nimport * as Theme from './ThemeOps';\nimport wordwrap from './utils/Wordwrap';\nimport { cloneDeep } from './utils/OpsUtils';\n\n/**\n * List all the journeys/trees\n * @param {boolean} long Long version, all the fields\n * @param {boolean} analyze Analyze journeys/trees for custom nodes (expensive)\n * @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array journey objects\n */\nexport async function listJourneys(\n long = false,\n analyze = false\n): Promise<TreeSkeleton[]> {\n let journeys = [];\n try {\n journeys = await frodo.authn.journey.getJourneys();\n if (!long && !analyze) {\n for (const journeyStub of journeys) {\n printMessage(`${journeyStub['_id']}`, 'data');\n }\n } else {\n if (!analyze) {\n const table = createTable(['Name', 'Status', 'Tags']);\n for (const journeyStub of journeys) {\n table.push([\n `${journeyStub._id}`,\n journeyStub.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n journeyStub.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyStub.uiConfig.categories).join(', '),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n showSpinner('Retrieving details of all journeys...');\n const exportPromises = [];\n try {\n for (const journeyStub of journeys) {\n exportPromises.push(\n frodo.authn.journey.exportJourney(journeyStub['_id'], {\n useStringArrays: false,\n deps: false,\n })\n );\n }\n const journeyExports = await Promise.all(exportPromises);\n succeedSpinner('Retrieved details of all journeys.');\n const table = createTable([\n 'Name',\n 'Status',\n 'Classification',\n 'Tags',\n ]);\n for (const journeyExport of journeyExports) {\n table.push([\n `${journeyExport.tree._id}`,\n journeyExport.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n getJourneyClassification(journeyExport).join(', '),\n journeyExport.tree.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyExport.tree.uiConfig.categories).join(\n ', '\n ),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } catch (error) {\n failSpinner('Error retrieving details of all journeys.');\n printMessage(error.response.data, 'error');\n }\n }\n }\n } catch (error) {\n printMessage(error.response?.data, 'error');\n }\n return journeys;\n}\n\n/**\n * Export journey by id/name to file\n * @param {string} journeyId journey id/name\n * @param {string} file optional export file name\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneyToFile(\n journeyId: string,\n file: string,\n options: TreeExportOptions\n): Promise<void> {\n debugMessage(`exportJourneyToFile: start`);\n const verbose = state.getDebug();\n if (!file) {\n file = frodo.utils.impex.getTypedFilename(journeyId, 'journey');\n }\n if (state.getDirectory()) {\n const dir = state.getDirectory().replace(/\\/$/, '');\n debugMessage(`exportJourneyToFile: directory='${dir}'`);\n file = `${dir}/${file}`;\n // create directory if it doesn't exist\n if (!fs.existsSync(dir)) {\n debugMessage(`exportJourneyToFile: creating directory '${dir}'`);\n fs.mkdirSync(dir, { recursive: true });\n }\n }\n if (!verbose) showSpinner(`${journeyId}`);\n try {\n const fileData: SingleTreeExportInterface =\n await frodo.authn.journey.exportJourney(journeyId, options);\n if (verbose) showSpinner(`${journeyId}`);\n frodo.utils.impex.saveJsonToFile(fileData, file);\n succeedSpinner(\n `Exported ${journeyId['brightCyan']} to ${file['brightCyan']}.`\n );\n } catch (error) {\n if (verbose) showSpinner(`${journeyId}`);\n failSpinner(`Error exporting journey ${journeyId}: ${error}`);\n }\n}\n\n/**\n * Export all journeys to file\n * @param {string} file optional export file name\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFile(\n file: string,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n }\n): Promise<void> {\n let fileName = file;\n if (!fileName) {\n fileName = frodo.utils.impex.getTypedFilename(\n `all${frodo.utils.impex.getRealmString()}Journeys`,\n 'journeys'\n );\n }\n const trees = await frodo.authn.journey.getJourneys();\n const fileData: MultiTreeExportInterface =\n frodo.authn.journey.createMultiTreeExportTemplate();\n createProgressBar(trees.length, 'Exporting journeys...');\n for (const tree of trees) {\n updateProgressBar(`${tree._id}`);\n try {\n const exportData = await frodo.authn.journey.exportJourney(\n tree._id,\n options\n );\n delete exportData.meta;\n fileData.trees[tree._id] = exportData;\n } catch (error) {\n printMessage(`Error exporting journey ${tree._id}: ${error}`, 'error');\n }\n }\n frodo.utils.impex.saveJsonToFile(fileData, fileName);\n stopProgressBar(`Exported to ${fileName}`);\n}\n\n/**\n * Export all journeys to separate files\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFiles(\n options: TreeExportOptions\n): Promise<void> {\n const trees = await frodo.authn.journey.getJourneys();\n createProgressBar(trees.length, 'Exporting journeys...');\n for (const tree of trees) {\n updateProgressBar(`${tree._id}`);\n const fileName = frodo.utils.impex.getTypedFilename(\n `${tree._id}`,\n 'journey'\n );\n try {\n const exportData: SingleTreeExportInterface =\n await frodo.authn.journey.exportJourney(tree._id, options);\n frodo.utils.impex.saveJsonToFile(exportData, fileName);\n } catch (error) {\n // do we need to report status here?\n }\n }\n stopProgressBar('Done');\n}\n\n/**\n * Import a journey from file\n * @param {string} journeyId journey id/name\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneyFromFile(\n journeyId: string,\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getDebug();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n let journeyData = JSON.parse(data);\n // check if this is a file with multiple trees and get journey by id\n if (journeyData.trees && journeyData.trees[journeyId]) {\n journeyData = journeyData.trees[journeyId];\n } else if (journeyData.trees) {\n journeyData = null;\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId === journeyData.tree._id) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await frodo.authn.journey.getJourneys()).map(\n (x) => x._id\n );\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n showSpinner('Resolving dependencies');\n await frodo.authn.journey.resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n succeedSpinner(`Resolved all dependencies.`);\n\n if (!verbose) showSpinner(`Importing ${journeyId}...`);\n frodo.authn.journey\n .importJourney(journeyData, options)\n .then(() => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n succeedSpinner(`Imported ${journeyId}.`);\n })\n .catch((importError) => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${importError}`);\n });\n } else {\n failSpinner(`Unresolved dependencies:`);\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n // end dependency resolution for single tree import\n } else {\n showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${journeyId} not found!`);\n }\n });\n}\n\n/**\n * Import first journey from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importFirstJourneyFromFile(\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getDebug();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n let journeyData = cloneDeep(JSON.parse(data));\n let journeyId = null;\n // single tree\n if (journeyData.tree) {\n journeyId = cloneDeep(journeyData.tree._id);\n }\n // multiple trees, so get the first tree\n else if (journeyData.trees) {\n for (const treeId in journeyData.trees) {\n if (Object.hasOwnProperty.call(journeyData.trees, treeId)) {\n journeyId = treeId;\n journeyData = journeyData.trees[treeId];\n break;\n }\n }\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await frodo.authn.journey.getJourneys()).map(\n (x) => x._id\n );\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n showSpinner('Resolving dependencies');\n await frodo.authn.journey.resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n succeedSpinner(`Resolved all dependencies.`);\n\n if (!verbose) showSpinner(`Importing ${journeyId}...`);\n frodo.authn.journey\n .importJourney(journeyData, options)\n .then(() => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n succeedSpinner(`Imported ${journeyId}.`);\n })\n .catch((importError) => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${importError}`);\n });\n } else {\n failSpinner(`Unresolved dependencies:`);\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No journeys found!`);\n }\n // end dependency resolution for single tree import\n });\n}\n\n/**\n * Import all journeys from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFile(\n file: string,\n options: TreeImportOptions\n) {\n fs.readFile(file, 'utf8', (err, data) => {\n if (err) throw err;\n const fileData = JSON.parse(data);\n frodo.authn.journey.importAllJourneys(fileData.trees, options);\n });\n}\n\n/**\n * Import all journeys from separate files\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFiles(options: TreeImportOptions) {\n const names = fs.readdirSync('.');\n const jsonFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.journey.json')\n );\n const allJourneysData = { trees: {} };\n for (const file of jsonFiles) {\n const journeyData = JSON.parse(fs.readFileSync(file, 'utf8'));\n allJourneysData.trees[journeyData.tree._id] = journeyData;\n }\n frodo.authn.journey.importAllJourneys(\n allJourneysData.trees as MultiTreeExportInterface,\n options\n );\n}\n\n/**\n * Get journey classification\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassification(\n journey: SingleTreeExportInterface\n): JourneyClassificationType[] {\n return getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return it.toString()['brightGreen'];\n\n case 'cloud':\n return it.toString()['brightMagenta'];\n\n case 'custom':\n return it.toString()['brightRed'];\n\n case 'premium':\n return it.toString()['brightYellow'];\n }\n });\n}\n\n/**\n * Get journey classification in markdown\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassificationMd(\n journey: SingleTreeExportInterface\n): string[] {\n return getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return `:green_circle: \\`${it.toString()}\\``;\n\n case 'cloud':\n return `:purple_circle: \\`${it.toString()}\\``;\n\n case 'custom':\n return `:red_circle: \\`${it.toString()}\\``;\n\n case 'premium':\n return `:yellow_circle: \\`${it.toString()}\\``;\n }\n });\n}\n\n/**\n * Get a one-line description of the tree object\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(treeObj: TreeSkeleton): string {\n const description = `[${treeObj._id['brightCyan']}]`;\n return description;\n}\n\n/**\n * Get a one-line description of the tree object in markdown\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescriptionMd(treeObj: TreeSkeleton): string {\n const description = `${treeObj._id}`;\n return description;\n}\n\n/**\n * Helper function to render a nested list of dependent trees\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendents(\n descendents: TreeDependencyMapInterface,\n depth = 0\n) {\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n printMessage(\n `\\nInner Tree Dependencies (${Object.values(descendents)[0].length}):`,\n 'data'\n );\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n printMessage(`${indent}- ${tree['brightCyan']}`, 'data');\n for (const descendent of descendents[tree]) {\n describeTreeDescendents(descendent, depth + 1);\n }\n }\n}\n\n/**\n * Helper function to render a nested list of dependent trees in markdown\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendentsMd(\n descendents: TreeDependencyMapInterface,\n depth = 0\n): string {\n let markdown = '';\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n markdown += `## Inner Tree Dependencies (${\n Object.values(descendents)[0].length\n })\\n`;\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n markdown += `${indent}- ${tree}\\n`;\n for (const descendent of descendents[tree]) {\n markdown += describeTreeDescendentsMd(descendent, depth + 1);\n }\n return markdown;\n }\n return markdown;\n}\n\n/**\n * Describe a journey:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourney(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = frodo.authn.journey\n .onlineTreeExportResolver\n): Promise<void> {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(`${getOneLineDescription(journeyData.tree)}`, 'data');\n printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join(''));\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Status\n printMessage(\n `\\nStatus\\n${\n journeyData.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen']\n }`\n );\n\n // Classification\n if (state.getAmVersion()) {\n printMessage(\n `\\nClassification\\n${getJourneyClassification(journeyData).join(', ')}`,\n 'data'\n );\n }\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage('\\nCategories/Tags', 'data');\n printMessage(\n `${JSON.parse(journeyData.tree.uiConfig.categories).join(', ')}`,\n 'data'\n );\n }\n\n // Dependency Tree\n const descendents = await frodo.authn.journey.getTreeDescendents(\n journeyData,\n resolveTreeExport\n );\n describeTreeDescendents(descendents);\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `\\nNode Types (${Object.entries(nodeTypeMap).length}):`,\n 'data'\n );\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `- ${String(count)} [${\n nodeType['brightCyan']\n }] (${Node.getNodeClassification(nodeType).join(', ')})`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`\\nNodes (${Object.entries(allNodes).length}):`, 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `- ${Node.getOneLineDescription(\n nodeObj,\n frodo.authn.journey.getNodeRef(nodeObj, journeyData)\n )}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`\\nThemes (${journeyData.themes.length}):`, 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`- ${Theme.getOneLineDescription(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `\\nScripts (${Object.entries(journeyData.scripts).length}):`,\n 'data'\n );\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`- ${Script.getOneLineDescription(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `\\nEmail Templates (${\n Object.entries(journeyData.emailTemplates).length\n }):`,\n 'data'\n );\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(\n `- ${EmailTemplate.getOneLineDescription(templateData)}`,\n 'data'\n );\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `\\nSocial Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n }):`,\n 'data'\n );\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`- ${Idp.getOneLineDescription(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `\\nSAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n }):`,\n 'data'\n );\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(\n `- ${Saml2.getOneLineDescription(entityProviderData)}`,\n 'data'\n );\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `\\nSAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n }):`,\n 'data'\n );\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(\n `- ${CirclesOfTrust.getOneLineDescription(cotData)}`,\n 'data'\n );\n }\n }\n}\n\n/**\n * Describe a journey in markdown:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourneyMd(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = frodo.authn.journey\n .onlineTreeExportResolver\n) {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(\n `# ${getOneLineDescriptionMd(journeyData.tree)} - ${\n journeyData.tree.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n }, ${getJourneyClassificationMd(journeyData).join(', ')}`,\n 'data'\n );\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage(\n `\\`${JSON.parse(journeyData.tree.uiConfig.categories).join('`, `')}\\``,\n 'data'\n );\n }\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Journey image\n printMessage(`\\n[]()\\n`, 'data');\n\n // Dependency Tree\n const descendents = await frodo.authn.journey.getTreeDescendents(\n journeyData,\n resolveTreeExport\n );\n printMessage(describeTreeDescendentsMd(descendents), 'data');\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `## Node Types (${Object.entries(nodeTypeMap).length})`,\n 'data'\n );\n printMessage('| Count | Type | Classification |', 'data');\n printMessage('| -----:| ---- | -------------- |', 'data');\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `| ${String(count)} | ${nodeType} | ${Node.getNodeClassificationMd(\n nodeType\n ).join('<br>')} |`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');\n printMessage(Node.getTableHeaderMd(), 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `${Node.getTableRowMd(\n nodeObj,\n frodo.authn.journey.getNodeRef(nodeObj, journeyData)\n )}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`## Themes (${journeyData.themes.length})`, 'data');\n printMessage(Theme.getTableHeaderMd(), 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`${Theme.getTableRowMd(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `## Scripts (${Object.entries(journeyData.scripts).length})`,\n 'data'\n );\n printMessage(Script.getTableHeaderMd(), 'data');\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`${Script.getTableRowMd(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `## Email Templates (${\n Object.entries(journeyData.emailTemplates).length\n })`,\n 'data'\n );\n printMessage(EmailTemplate.getTableHeaderMd(), 'data');\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(`${EmailTemplate.getTableRowMd(templateData)}`, 'data');\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `## Social Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n })`,\n 'data'\n );\n printMessage(Idp.getTableHeaderMd(), 'data');\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`${Idp.getTableRowMd(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `## SAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n })`,\n 'data'\n );\n printMessage(Saml2.getTableHeaderMd(), 'data');\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(`${Saml2.getTableRowMd(entityProviderData)}`, 'data');\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `## SAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n })`,\n 'data'\n );\n printMessage(CirclesOfTrust.getTableHeaderMd(), 'data');\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(`${CirclesOfTrust.getTableRowMd(cotData)}`, 'data');\n }\n }\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,OAAOC,EAAE,MAAM,IAAI;AAcnB,SACEC,YAAY,EACZC,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACfC,WAAW,EACXC,cAAc,EACdC,WAAW,EACXC,WAAW,EACXC,YAAY,QACP,kBAAkB;AACzB,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,GAAG,MAAM,UAAU;AAC/B,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,kBAAkB;AACvC,SAASC,SAAS,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,YAAYA,CAChCC,IAAI,GAAG,KAAK,EACZC,OAAO,GAAG,KAAK,EACU;EACzB,IAAIC,QAAQ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,CAAC+B,MAAM,CAACtC,WAAW,CAAC8E,cAAc,CAAC,EAAE;MAC/D/J,YAAY,CAAE,GAAES,cAAc,CAAC8J,aAAa,CAACP,OAAO,CAAE,EAAC,EAAE,MAAM,CAAC;IAClE;EACF;AACF"}
|
|
1
|
+
{"version":3,"file":"JourneyOps.js","names":["frodo","state","fs","printMessage","createProgressBar","updateProgressBar","stopProgressBar","showSpinner","succeedSpinner","failSpinner","createTable","debugMessage","CirclesOfTrust","EmailTemplate","Idp","Node","Saml2","Script","Theme","wordwrap","cloneDeep","listJourneys","long","analyze","journeys","authn","journey","getJourneys","journeyStub","table","_journeyStub$uiConfig","push","_id","enabled","uiConfig","categories","JSON","parse","join","toString","exportPromises","exportJourney","useStringArrays","deps","journeyExports","Promise","all","journeyExport","_journeyExport$tree$u","tree","getJourneyClassification","error","response","data","_error$response","exportJourneyToFile","journeyId","file","options","verbose","getDebug","utils","impex","getTypedFilename","getDirectory","dir","replace","existsSync","mkdirSync","recursive","fileData","saveJsonToFile","exportJourneysToFile","fileName","getRealmString","trees","createMultiTreeExportTemplate","length","exportData","meta","exportJourneysToFiles","importJourneyFromFile","readFile","err","journeyData","installedJourneys","map","x","unresolvedJourneys","resolvedJourneys","resolveDependencies","Object","keys","importJourney","then","catch","importError","importFirstJourneyFromFile","treeId","hasOwnProperty","call","importJourneysFromFile","importAllJourneys","importJourneysFromFiles","names","readdirSync","jsonFiles","filter","name","toLowerCase","endsWith","allJourneysData","readFileSync","it","getJourneyClassificationMd","getOneLineDescription","treeObj","description","getOneLineDescriptionMd","describeTreeDescendents","descendents","depth","values","indent","Array","fill","descendent","describeTreeDescendentsMd","markdown","describeJourney","resolveTreeExport","onlineTreeExportResolver","_journeyData$meta","_journeyData$tree$uiC","_journeyData$themes","allNodes","nodes","innerNodes","nodeTypeMap","nodeData","_type","getAmVersion","originAmVersion","setAmVersion","getTreeDescendents","entries","nodeType","count","String","getNodeClassification","nodeObj","getNodeRef","themes","themeData","scripts","scriptData","emailTemplates","templateData","socialIdentityProviders","socialIdpData","saml2Entities","entityProviderData","circlesOfTrust","cotData","describeJourneyMd","_journeyData$meta2","_journeyData$tree$uiC2","_journeyData$themes2","getNodeClassificationMd","getTableHeaderMd","getTableRowMd"],"sources":["ops/JourneyOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport fs from 'fs';\nimport type {\n NodeSkeleton,\n TreeSkeleton,\n} from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport type {\n JourneyClassificationType,\n MultiTreeExportInterface,\n SingleTreeExportInterface,\n TreeDependencyMapInterface,\n TreeExportOptions,\n TreeExportResolverInterface,\n TreeImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/OpsTypes';\nimport {\n printMessage,\n createProgressBar,\n updateProgressBar,\n stopProgressBar,\n showSpinner,\n succeedSpinner,\n failSpinner,\n createTable,\n debugMessage,\n} from '../utils/Console';\nimport * as CirclesOfTrust from './CirclesOfTrustOps';\nimport * as EmailTemplate from './EmailTemplateOps';\nimport * as Idp from './IdpOps';\nimport * as Node from './NodeOps';\nimport * as Saml2 from './Saml2Ops';\nimport * as Script from './ScriptOps';\nimport * as Theme from './ThemeOps';\nimport wordwrap from './utils/Wordwrap';\nimport { cloneDeep } from './utils/OpsUtils';\n\n/**\n * List all the journeys/trees\n * @param {boolean} long Long version, all the fields\n * @param {boolean} analyze Analyze journeys/trees for custom nodes (expensive)\n * @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array journey objects\n */\nexport async function listJourneys(\n long = false,\n analyze = false\n): Promise<TreeSkeleton[]> {\n let journeys = [];\n try {\n journeys = await frodo.authn.journey.getJourneys();\n if (!long && !analyze) {\n for (const journeyStub of journeys) {\n printMessage(`${journeyStub['_id']}`, 'data');\n }\n } else {\n if (!analyze) {\n const table = createTable(['Name', 'Status', 'Tags']);\n for (const journeyStub of journeys) {\n table.push([\n `${journeyStub._id}`,\n journeyStub.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n journeyStub.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyStub.uiConfig.categories).join(', '),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n showSpinner('Retrieving details of all journeys...');\n const exportPromises = [];\n try {\n for (const journeyStub of journeys) {\n exportPromises.push(\n frodo.authn.journey.exportJourney(journeyStub['_id'], {\n useStringArrays: false,\n deps: false,\n })\n );\n }\n const journeyExports = await Promise.all(exportPromises);\n succeedSpinner('Retrieved details of all journeys.');\n const table = createTable([\n 'Name',\n 'Status',\n 'Classification',\n 'Tags',\n ]);\n for (const journeyExport of journeyExports) {\n table.push([\n `${journeyExport.tree._id}`,\n journeyExport.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n getJourneyClassification(journeyExport).join(', '),\n journeyExport.tree.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyExport.tree.uiConfig.categories).join(\n ', '\n ),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } catch (error) {\n failSpinner('Error retrieving details of all journeys.');\n printMessage(error.response.data, 'error');\n }\n }\n }\n } catch (error) {\n printMessage(error.response?.data, 'error');\n }\n return journeys;\n}\n\n/**\n * Export journey by id/name to file\n * @param {string} journeyId journey id/name\n * @param {string} file optional export file name\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneyToFile(\n journeyId: string,\n file: string,\n options: TreeExportOptions\n): Promise<void> {\n debugMessage(`exportJourneyToFile: start`);\n const verbose = state.getDebug();\n if (!file) {\n file = frodo.utils.impex.getTypedFilename(journeyId, 'journey');\n }\n if (state.getDirectory()) {\n const dir = state.getDirectory().replace(/\\/$/, '');\n debugMessage(`exportJourneyToFile: directory='${dir}'`);\n file = `${dir}/${file}`;\n // create directory if it doesn't exist\n if (!fs.existsSync(dir)) {\n debugMessage(`exportJourneyToFile: creating directory '${dir}'`);\n fs.mkdirSync(dir, { recursive: true });\n }\n }\n if (!verbose) showSpinner(`${journeyId}`);\n try {\n const fileData: SingleTreeExportInterface =\n await frodo.authn.journey.exportJourney(journeyId, options);\n if (verbose) showSpinner(`${journeyId}`);\n frodo.utils.impex.saveJsonToFile(fileData, file);\n succeedSpinner(\n `Exported ${journeyId['brightCyan']} to ${file['brightCyan']}.`\n );\n } catch (error) {\n if (verbose) showSpinner(`${journeyId}`);\n failSpinner(`Error exporting journey ${journeyId}: ${error}`);\n }\n}\n\n/**\n * Export all journeys to file\n * @param {string} file optional export file name\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFile(\n file: string,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n }\n): Promise<void> {\n let fileName = file;\n if (!fileName) {\n fileName = frodo.utils.impex.getTypedFilename(\n `all${frodo.utils.impex.getRealmString()}Journeys`,\n 'journeys'\n );\n }\n const trees = await frodo.authn.journey.getJourneys();\n const fileData: MultiTreeExportInterface =\n frodo.authn.journey.createMultiTreeExportTemplate();\n createProgressBar(trees.length, 'Exporting journeys...');\n for (const tree of trees) {\n updateProgressBar(`${tree._id}`);\n try {\n const exportData = await frodo.authn.journey.exportJourney(\n tree._id,\n options\n );\n delete exportData.meta;\n fileData.trees[tree._id] = exportData;\n } catch (error) {\n printMessage(`Error exporting journey ${tree._id}: ${error}`, 'error');\n }\n }\n frodo.utils.impex.saveJsonToFile(fileData, fileName);\n stopProgressBar(`Exported to ${fileName}`);\n}\n\n/**\n * Export all journeys to separate files\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFiles(\n options: TreeExportOptions\n): Promise<void> {\n const trees = await frodo.authn.journey.getJourneys();\n createProgressBar(trees.length, 'Exporting journeys...');\n for (const tree of trees) {\n updateProgressBar(`${tree._id}`);\n const fileName = frodo.utils.impex.getTypedFilename(\n `${tree._id}`,\n 'journey'\n );\n try {\n const exportData: SingleTreeExportInterface =\n await frodo.authn.journey.exportJourney(tree._id, options);\n frodo.utils.impex.saveJsonToFile(exportData, fileName);\n } catch (error) {\n // do we need to report status here?\n }\n }\n stopProgressBar('Done');\n}\n\n/**\n * Import a journey from file\n * @param {string} journeyId journey id/name\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneyFromFile(\n journeyId: string,\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getDebug();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n let journeyData = JSON.parse(data);\n // check if this is a file with multiple trees and get journey by id\n if (journeyData.trees && journeyData.trees[journeyId]) {\n journeyData = journeyData.trees[journeyId];\n } else if (journeyData.trees) {\n journeyData = null;\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId === journeyData.tree._id) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await frodo.authn.journey.getJourneys()).map(\n (x) => x._id\n );\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n showSpinner('Resolving dependencies');\n await frodo.authn.journey.resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n succeedSpinner(`Resolved all dependencies.`);\n\n if (!verbose) showSpinner(`Importing ${journeyId}...`);\n frodo.authn.journey\n .importJourney(journeyData, options)\n .then(() => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n succeedSpinner(`Imported ${journeyId}.`);\n })\n .catch((importError) => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${importError}`);\n });\n } else {\n failSpinner(`Unresolved dependencies:`);\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n // end dependency resolution for single tree import\n } else {\n showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${journeyId} not found!`);\n }\n });\n}\n\n/**\n * Import first journey from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importFirstJourneyFromFile(\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getDebug();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n let journeyData = cloneDeep(JSON.parse(data));\n let journeyId = null;\n // single tree\n if (journeyData.tree) {\n journeyId = cloneDeep(journeyData.tree._id);\n }\n // multiple trees, so get the first tree\n else if (journeyData.trees) {\n for (const treeId in journeyData.trees) {\n if (Object.hasOwnProperty.call(journeyData.trees, treeId)) {\n journeyId = treeId;\n journeyData = journeyData.trees[treeId];\n break;\n }\n }\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await frodo.authn.journey.getJourneys()).map(\n (x) => x._id\n );\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n showSpinner('Resolving dependencies');\n await frodo.authn.journey.resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n succeedSpinner(`Resolved all dependencies.`);\n\n if (!verbose) showSpinner(`Importing ${journeyId}...`);\n frodo.authn.journey\n .importJourney(journeyData, options)\n .then(() => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n succeedSpinner(`Imported ${journeyId}.`);\n })\n .catch((importError) => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${importError}`);\n });\n } else {\n failSpinner(`Unresolved dependencies:`);\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No journeys found!`);\n }\n // end dependency resolution for single tree import\n });\n}\n\n/**\n * Import all journeys from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFile(\n file: string,\n options: TreeImportOptions\n) {\n fs.readFile(file, 'utf8', (err, data) => {\n if (err) throw err;\n const fileData = JSON.parse(data);\n frodo.authn.journey.importAllJourneys(fileData.trees, options);\n });\n}\n\n/**\n * Import all journeys from separate files\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFiles(options: TreeImportOptions) {\n const names = fs.readdirSync('.');\n const jsonFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.journey.json')\n );\n const allJourneysData = { trees: {} };\n for (const file of jsonFiles) {\n const journeyData = JSON.parse(fs.readFileSync(file, 'utf8'));\n allJourneysData.trees[journeyData.tree._id] = journeyData;\n }\n frodo.authn.journey.importAllJourneys(\n allJourneysData.trees as MultiTreeExportInterface,\n options\n );\n}\n\n/**\n * Get journey classification\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassification(\n journey: SingleTreeExportInterface\n): JourneyClassificationType[] {\n return frodo.authn.journey.getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return it['brightGreen'];\n\n case 'cloud':\n return it['brightMagenta'];\n\n case 'custom':\n return it['brightRed'];\n\n case 'premium':\n return it['brightYellow'];\n }\n });\n}\n\n/**\n * Get journey classification in markdown\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassificationMd(\n journey: SingleTreeExportInterface\n): string[] {\n return frodo.authn.journey.getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return `:green_circle: \\`${it}\\``;\n\n case 'cloud':\n return `:purple_circle: \\`${it}\\``;\n\n case 'custom':\n return `:red_circle: \\`${it}\\``;\n\n case 'premium':\n return `:yellow_circle: \\`${it}\\``;\n }\n });\n}\n\n/**\n * Get a one-line description of the tree object\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(treeObj: TreeSkeleton): string {\n const description = `[${treeObj._id['brightCyan']}]`;\n return description;\n}\n\n/**\n * Get a one-line description of the tree object in markdown\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescriptionMd(treeObj: TreeSkeleton): string {\n const description = `${treeObj._id}`;\n return description;\n}\n\n/**\n * Helper function to render a nested list of dependent trees\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendents(\n descendents: TreeDependencyMapInterface,\n depth = 0\n) {\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n printMessage(\n `\\nInner Tree Dependencies (${Object.values(descendents)[0].length}):`,\n 'data'\n );\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n printMessage(`${indent}- ${tree['brightCyan']}`, 'data');\n for (const descendent of descendents[tree]) {\n describeTreeDescendents(descendent, depth + 1);\n }\n }\n}\n\n/**\n * Helper function to render a nested list of dependent trees in markdown\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendentsMd(\n descendents: TreeDependencyMapInterface,\n depth = 0\n): string {\n let markdown = '';\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n markdown += `## Inner Tree Dependencies (${\n Object.values(descendents)[0].length\n })\\n`;\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n markdown += `${indent}- ${tree}\\n`;\n for (const descendent of descendents[tree]) {\n markdown += describeTreeDescendentsMd(descendent, depth + 1);\n }\n return markdown;\n }\n return markdown;\n}\n\n/**\n * Describe a journey:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourney(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = frodo.authn.journey\n .onlineTreeExportResolver\n): Promise<void> {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(`${getOneLineDescription(journeyData.tree)}`, 'data');\n printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join(''));\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Status\n printMessage(\n `\\nStatus\\n${\n journeyData.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen']\n }`\n );\n\n // Classification\n if (state.getAmVersion()) {\n printMessage(\n `\\nClassification\\n${getJourneyClassification(journeyData).join(', ')}`,\n 'data'\n );\n }\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage('\\nCategories/Tags', 'data');\n printMessage(\n `${JSON.parse(journeyData.tree.uiConfig.categories).join(', ')}`,\n 'data'\n );\n }\n\n // Dependency Tree\n const descendents = await frodo.authn.journey.getTreeDescendents(\n journeyData,\n resolveTreeExport\n );\n describeTreeDescendents(descendents);\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `\\nNode Types (${Object.entries(nodeTypeMap).length}):`,\n 'data'\n );\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `- ${String(count)} [${\n nodeType['brightCyan']\n }] (${Node.getNodeClassification(nodeType).join(', ')})`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`\\nNodes (${Object.entries(allNodes).length}):`, 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `- ${Node.getOneLineDescription(\n nodeObj,\n frodo.authn.journey.getNodeRef(nodeObj, journeyData)\n )}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`\\nThemes (${journeyData.themes.length}):`, 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`- ${Theme.getOneLineDescription(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `\\nScripts (${Object.entries(journeyData.scripts).length}):`,\n 'data'\n );\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`- ${Script.getOneLineDescription(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `\\nEmail Templates (${\n Object.entries(journeyData.emailTemplates).length\n }):`,\n 'data'\n );\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(\n `- ${EmailTemplate.getOneLineDescription(templateData)}`,\n 'data'\n );\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `\\nSocial Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n }):`,\n 'data'\n );\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`- ${Idp.getOneLineDescription(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `\\nSAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n }):`,\n 'data'\n );\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(\n `- ${Saml2.getOneLineDescription(entityProviderData)}`,\n 'data'\n );\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `\\nSAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n }):`,\n 'data'\n );\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(\n `- ${CirclesOfTrust.getOneLineDescription(cotData)}`,\n 'data'\n );\n }\n }\n}\n\n/**\n * Describe a journey in markdown:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourneyMd(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = frodo.authn.journey\n .onlineTreeExportResolver\n) {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(\n `# ${getOneLineDescriptionMd(journeyData.tree)} - ${\n journeyData.tree.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n }, ${getJourneyClassificationMd(journeyData).join(', ')}`,\n 'data'\n );\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage(\n `\\`${JSON.parse(journeyData.tree.uiConfig.categories).join('`, `')}\\``,\n 'data'\n );\n }\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Journey image\n printMessage(`\\n[]()\\n`, 'data');\n\n // Dependency Tree\n const descendents = await frodo.authn.journey.getTreeDescendents(\n journeyData,\n resolveTreeExport\n );\n printMessage(describeTreeDescendentsMd(descendents), 'data');\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `## Node Types (${Object.entries(nodeTypeMap).length})`,\n 'data'\n );\n printMessage('| Count | Type | Classification |', 'data');\n printMessage('| -----:| ---- | -------------- |', 'data');\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `| ${String(count)} | ${nodeType} | ${Node.getNodeClassificationMd(\n nodeType\n ).join('<br>')} |`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');\n printMessage(Node.getTableHeaderMd(), 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `${Node.getTableRowMd(\n nodeObj,\n frodo.authn.journey.getNodeRef(nodeObj, journeyData)\n )}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`## Themes (${journeyData.themes.length})`, 'data');\n printMessage(Theme.getTableHeaderMd(), 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`${Theme.getTableRowMd(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `## Scripts (${Object.entries(journeyData.scripts).length})`,\n 'data'\n );\n printMessage(Script.getTableHeaderMd(), 'data');\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`${Script.getTableRowMd(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `## Email Templates (${\n Object.entries(journeyData.emailTemplates).length\n })`,\n 'data'\n );\n printMessage(EmailTemplate.getTableHeaderMd(), 'data');\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(`${EmailTemplate.getTableRowMd(templateData)}`, 'data');\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `## Social Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n })`,\n 'data'\n );\n printMessage(Idp.getTableHeaderMd(), 'data');\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`${Idp.getTableRowMd(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `## SAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n })`,\n 'data'\n );\n printMessage(Saml2.getTableHeaderMd(), 'data');\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(`${Saml2.getTableRowMd(entityProviderData)}`, 'data');\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `## SAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n })`,\n 'data'\n );\n printMessage(CirclesOfTrust.getTableHeaderMd(), 'data');\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(`${CirclesOfTrust.getTableRowMd(cotData)}`, 'data');\n }\n }\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,OAAOC,EAAE,MAAM,IAAI;AAcnB,SACEC,YAAY,EACZC,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACfC,WAAW,EACXC,cAAc,EACdC,WAAW,EACXC,WAAW,EACXC,YAAY,QACP,kBAAkB;AACzB,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,GAAG,MAAM,UAAU;AAC/B,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,kBAAkB;AACvC,SAASC,SAAS,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,YAAYA,CAChCC,IAAI,GAAG,KAAK,EACZC,OAAO,GAAG,KAAK,EACU;EAC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