@rockcarver/frodo-cli 2.0.0-2 → 2.0.0-4
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/cli/FrodoCommand.js +3 -0
- package/esm/cli/FrodoCommand.js.map +1 -1
- package/esm/cli/info/info.js +6 -5
- package/esm/cli/info/info.js.map +1 -1
- package/esm/ops/ConnectionProfileOps.js +1 -1
- package/esm/ops/ConnectionProfileOps.js.map +1 -1
- package/esm/ops/JourneyOps.js +10 -10
- package/esm/ops/JourneyOps.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.0.0-4] - 2023-06-16
|
|
11
|
+
|
|
12
|
+
## [2.0.0-3] - 2023-06-15
|
|
13
|
+
|
|
10
14
|
## [2.0.0-2] - 2023-06-15
|
|
11
15
|
|
|
12
16
|
## [2.0.0-1] - 2023-06-15
|
|
@@ -1204,7 +1208,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1204
1208
|
- Fixed problem with adding connection profiles
|
|
1205
1209
|
- Miscellaneous bug fixes
|
|
1206
1210
|
|
|
1207
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-
|
|
1211
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-4...HEAD
|
|
1212
|
+
|
|
1213
|
+
[2.0.0-4]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-3...v2.0.0-4
|
|
1214
|
+
|
|
1215
|
+
[2.0.0-3]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-2...v2.0.0-3
|
|
1208
1216
|
|
|
1209
1217
|
[2.0.0-2]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-1...v2.0.0-2
|
|
1210
1218
|
|
package/esm/cli/FrodoCommand.js
CHANGED
|
@@ -98,6 +98,9 @@ export class FrodoCommand extends FrodoStubCommand {
|
|
|
98
98
|
for (const opt of defaultOpts) {
|
|
99
99
|
if (!omits.includes(opt.name())) this.addOption(opt);
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
// additional help
|
|
103
|
+
this.addHelpText('after', `\nEvironment Variables:\n` + ` FRODO_HOST: Access Management base URL. Overrides 'host' argument.\n` + ` FRODO_REALM: Realm. Overrides 'realm' argument.\n` + ` FRODO_USERNAME: Username. Overrides 'username' argument.\n` + ` FRODO_PASSWORD: Password. Overrides 'password' argument.\n` + ` FRODO_SA_ID: Service account uuid. Overrides '--sa-id' option.\n` + ` FRODO_SA_JWK: Service account JWK. Overrides '--sa-jwk-file' option but takes the actual JWK as a value, not a file name.\n` + ('frodo conn save' === this.name() ? ` FRODO_LOG_KEY: Log API key. Overrides '--log-api-key' option.\n` + ` FRODO_LOG_SECRET: Log API secret. Overrides '--log-api-secret' option.\n` : ``) + (this.name().startsWith('frodo logs') ? ` FRODO_LOG_KEY: Log API key. Overrides 'username' argument.\n` + ` FRODO_LOG_SECRET: Log API secret. Overrides 'password' argument.\n` : ``) + ` FRODO_AUTHENTICATION_SERVICE: Name of a login journey to use.\n` + ` FRODO_DEBUG: Set to any value to enable debug output. Same as '--debug'.\n`);
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrodoCommand.js","names":["Argument","Command","Option","globalConfig","state","fs","printMessage","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","verboseMessage","debugMessage","curlirizeMessage","hostArgument","realmArgument","default","process","env","FRODO_REALM","DEFAULT_REALM_KEY","usernameArgument","passwordArgument","serviceAccountIdOption","serviceAccountJwkFileOption","deploymentOption","choices","DEPLOYMENT_TYPES","insecureOption","verboseOption","debugOption","curlirizeOption","defaultArgs","defaultOpts","stateMap","name","host","setHost","realm","setRealm","username","setUsername","password","setPassword","attributeName","saId","setServiceAccountId","file","data","readFileSync","jwk","JSON","parse","toString","setServiceAccountJwk","error","message","type","setDeploymentType","insecure","setAllowInsecureConnection","verbose","setVerbose","debug","setDebug","curlirize","setCurlirize","FrodoStubCommand","constructor","helpOption","showHelpAfterError","configureHelp","sortSubcommands","sortOptions","setPrintHandler","setVerboseHandler","setDebugHandler","setCurlirizeHandler","setCreateProgressHandler","setUpdateProgressHandler","setStopProgressHandler","FrodoCommand","omits","arg","includes","addArgument","opt","addOption","handleDefaultArgsAndOpts","args","command","pop","options","i","v","entries","_args","length","Object","keys","handler","k"],"sources":["cli/FrodoCommand.ts"],"sourcesContent":["import { Argument, Command, Option } from 'commander';\nimport * as globalConfig from '../storage/StaticStorage';\nimport { state } from '@rockcarver/frodo-lib';\nimport fs from 'fs';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n verboseMessage,\n debugMessage,\n curlirizeMessage,\n} from '../utils/Console.js';\n\nconst hostArgument = new Argument(\n '[host]',\n 'Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring.'\n);\n\nconst realmArgument = new Argument(\n '[realm]',\n \"Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise.\"\n).default(\n // must check for FRODO_REALM env variable here because otherwise cli will overwrite realm with default value\n process.env.FRODO_REALM || globalConfig.DEFAULT_REALM_KEY,\n '\"alpha\" for Identity Cloud tenants, \"/\" otherwise.'\n);\n\nconst usernameArgument = new Argument(\n '[username]',\n 'Username to login with. Must be an admin user with appropriate rights to manage authentication journeys/trees.'\n);\n\nconst passwordArgument = new Argument('[password]', 'Password.');\n\nconst serviceAccountIdOption = new Option(\n '--sa-id <sa-id>',\n 'Service account id.'\n);\n\nconst serviceAccountJwkFileOption = new Option(\n '--sa-jwk-file <file>',\n 'File containing the JSON Web Key (JWK) associated with the the service account.'\n);\n\nconst deploymentOption = new Option(\n '-m, --type <type>',\n 'Override auto-detected deployment type. Valid values for type: \\n\\\nclassic: A classic Access Management-only deployment with custom layout and configuration. \\n\\\ncloud: A ForgeRock Identity Cloud environment. \\n\\\nforgeops: A ForgeOps CDK or CDM deployment. \\n\\\nThe detected or provided deployment type controls certain behavior like obtaining an Identity \\\nManagement admin token or not and whether to export/import referenced email templates or how \\\nto walk through the tenant admin login flow of Identity Cloud and handle MFA'\n).choices(globalConfig.DEPLOYMENT_TYPES);\n\nconst insecureOption = new Option(\n '-k, --insecure',\n 'Allow insecure connections when using SSL/TLS. Has no effect when using a network proxy for https (HTTPS_PROXY=http://<host>:<port>), in that case the proxy must provide this capability.'\n).default(false, \"Don't allow insecure connections\");\n\nconst verboseOption = new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n);\n\nconst debugOption = new Option(\n '--debug',\n 'Debug output during command execution. If specified, may or may not produce additional output helpful for troubleshooting.'\n);\n\nconst curlirizeOption = new Option(\n '--curlirize',\n 'Output all network calls in curl format.'\n);\n\nconst defaultArgs = [\n hostArgument,\n realmArgument,\n usernameArgument,\n passwordArgument,\n];\n\nconst defaultOpts = [\n serviceAccountIdOption,\n serviceAccountJwkFileOption,\n deploymentOption,\n insecureOption,\n verboseOption,\n debugOption,\n curlirizeOption,\n];\n\nconst stateMap = {\n [hostArgument.name()]: (host: string) => state.setHost(host),\n [realmArgument.name()]: (realm: string) => state.setRealm(realm),\n [usernameArgument.name()]: (username: string) => state.setUsername(username),\n [passwordArgument.name()]: (password: string) => state.setPassword(password),\n [serviceAccountIdOption.attributeName()]: (saId: string) =>\n state.setServiceAccountId(saId),\n [serviceAccountJwkFileOption.attributeName()]: (file: string) => {\n try {\n const data = fs.readFileSync(file);\n const jwk = JSON.parse(data.toString());\n state.setServiceAccountJwk(jwk);\n } catch (error) {\n printMessage(\n `Error parsing JWK from file ${file}: ${error.message}`,\n 'error'\n );\n }\n },\n [deploymentOption.attributeName()]: (type: string) =>\n state.setDeploymentType(type),\n [insecureOption.attributeName()]: (insecure: boolean) =>\n state.setAllowInsecureConnection(insecure),\n [verboseOption.attributeName()]: (verbose: boolean) =>\n state.setVerbose(verbose),\n [debugOption.attributeName()]: (debug: boolean) => state.setDebug(debug),\n [curlirizeOption.attributeName()]: (curlirize: boolean) =>\n state.setCurlirize(curlirize),\n};\n\n/**\n * Command with default options\n */\nexport class FrodoStubCommand extends Command {\n /**\n * Creates a new FrodoCommand instance\n * @param name Name of the command\n * @param omits Array of default argument names and default option names that should not be added to this command\n */\n constructor(name: string) {\n super(name);\n\n // other default settings\n this.helpOption('-h, --help', 'Help');\n this.showHelpAfterError();\n this.configureHelp({\n sortSubcommands: true,\n sortOptions: true,\n });\n\n // register default handlers\n state.setPrintHandler(printMessage);\n state.setVerboseHandler(verboseMessage);\n state.setDebugHandler(debugMessage);\n state.setCurlirizeHandler(curlirizeMessage);\n state.setCreateProgressHandler(createProgressIndicator);\n state.setUpdateProgressHandler(updateProgressIndicator);\n state.setStopProgressHandler(stopProgressIndicator);\n }\n}\n\n/**\n * Command with default options\n */\nexport class FrodoCommand extends FrodoStubCommand {\n /**\n * Creates a new FrodoCommand instance\n * @param name Name of the command\n * @param omits Array of default argument names and default option names that should not be added to this command\n */\n constructor(name: string, omits: string[] = []) {\n super(name);\n\n // register default arguments\n for (const arg of defaultArgs) {\n if (!omits.includes(arg.name())) this.addArgument(arg);\n }\n\n // register default options\n for (const opt of defaultOpts) {\n if (!omits.includes(opt.name())) this.addOption(opt);\n }\n }\n\n /**\n *\n * @param args\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handleDefaultArgsAndOpts(...args: any) {\n const command = args.pop();\n const options = args.pop();\n\n // handle arguments first\n for (const [i, v] of command.args.entries()) {\n if (!command._args[i]) {\n printMessage(\n `${command.args.length} arguments supplied but command only supports ${command._args.length}.`,\n 'warn'\n );\n break;\n }\n const arg = command._args[i].name();\n // handle only default arguments\n if (Object.keys(stateMap).includes(arg)) {\n debugMessage(\n `FrodoCommand.handleDefaultArgsAndOpts: Handling default argument '${arg}'.`\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handler: any = stateMap[arg];\n handler(v);\n } else {\n debugMessage(\n `FrodoCommand.handleDefaultArgsAndOpts: Ignoring non-default argument '${arg}'.`\n );\n }\n }\n\n // handle options\n for (const [k, v] of Object.entries(options)) {\n // handle only default options\n if (Object.keys(stateMap).includes(k)) {\n debugMessage(\n `FrodoCommand.handleDefaultArgsAndOpts: Handling default option '${k}'.`\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handler: any = stateMap[k];\n handler(v);\n } else {\n debugMessage(\n `FrodoCommand.handleDefaultArgsAndOpts: Ignoring non-default option '${k}'.`\n );\n }\n }\n }\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,MAAM,QAAQ,WAAW;AACrD,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,OAAOC,EAAE,MAAM,IAAI;AACnB,SACEC,YAAY,EACZC,uBAAuB,EACvBC,uBAAuB,EACvBC,qBAAqB,EACrBC,cAAc,EACdC,YAAY,EACZC,gBAAgB,QACX,qBAAqB;AAE5B,MAAMC,YAAY,GAAG,IAAIb,QAAQ,CAC/B,QAAQ,EACR,iIACF,CAAC;AAED,MAAMc,aAAa,GAAG,IAAId,QAAQ,CAChC,SAAS,EACT,yFACF,CAAC,CAACe,OAAO;AACP;AACAC,OAAO,CAACC,GAAG,CAACC,WAAW,IAAIf,YAAY,CAACgB,iBAAiB,EACzD,oDACF,CAAC;AAED,MAAMC,gBAAgB,GAAG,IAAIpB,QAAQ,CACnC,YAAY,EACZ,gHACF,CAAC;AAED,MAAMqB,gBAAgB,GAAG,IAAIrB,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;AAEhE,MAAMsB,sBAAsB,GAAG,IAAIpB,MAAM,CACvC,iBAAiB,EACjB,qBACF,CAAC;AAED,MAAMqB,2BAA2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GAAG,CAAC,CAAC;;IAE1B;IACA,KAAK,MAAM,CAACE,CAAC,EAAEC,CAAC,CAAC,IAAIJ,OAAO,CAACD,IAAI,CAACM,OAAO,CAAC,CAAC,EAAE;MAC3C,IAAI,CAACL,OAAO,CAACM,KAAK,CAACH,CAAC,CAAC,EAAE;QACrBtF,YAAY,CACT,GAAEmF,OAAO,CAACD,IAAI,CAACQ,MAAO,iDAAgDP,OAAO,CAACM,KAAK,CAACC,MAAO,GAAE,EAC9F,MACF,CAAC;QACD;MACF;MACA,MAAMd,GAAG,GAAGO,OAAO,CAACM,KAAK,CAACH,CAAC,CAAC,CAAC1D,IAAI,CAAC,CAAC;MACnC;MACA,IAAI+D,MAAM,CAACC,IAAI,CAACjE,QAAQ,CAAC,CAACkD,QAAQ,CAACD,GAAG,CAAC,EAAE;QACvCvE,YAAY,CACT,qEAAoEuE,GAAI,IAC3E,CAAC;QACD;QACA,MAAMiB,OAAY,GAAGlE,QAAQ,CAACiD,GAAG,CAAC;QAClCiB,OAAO,CAACN,CAAC,CAAC;MACZ,CAAC,MAAM;QACLlF,YAAY,CACT,yEAAwEuE,GAAI,IAC/E,CAAC;MACH;IACF;;IAEA;IACA,KAAK,MAAM,CAACkB,CAAC,EAAEP,CAAC,CAAC,IAAII,MAAM,CAACH,OAAO,CAACH,OAAO,CAAC,EAAE;MAC5C;MACA,IAAIM,MAAM,CAACC,IAAI,CAACjE,QAAQ,CAAC,CAACkD,QAAQ,CAACiB,CAAC,CAAC,EAAE;QACrCzF,YAAY,CACT,mEAAkEyF,CAAE,IACvE,CAAC;QACD;QACA,MAAMD,OAAY,GAAGlE,QAAQ,CAACmE,CAAC,CAAC;QAChCD,OAAO,CAACN,CAAC,CAAC;MACZ,CAAC,MAAM;QACLlF,YAAY,CACT,uEAAsEyF,CAAE,IAC3E,CAAC;MACH;IACF;EACF;AACF"}
|
|
1
|
+
{"version":3,"file":"FrodoCommand.js","names":["Argument","Command","Option","globalConfig","state","fs","printMessage","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","verboseMessage","debugMessage","curlirizeMessage","hostArgument","realmArgument","default","process","env","FRODO_REALM","DEFAULT_REALM_KEY","usernameArgument","passwordArgument","serviceAccountIdOption","serviceAccountJwkFileOption","deploymentOption","choices","DEPLOYMENT_TYPES","insecureOption","verboseOption","debugOption","curlirizeOption","defaultArgs","defaultOpts","stateMap","name","host","setHost","realm","setRealm","username","setUsername","password","setPassword","attributeName","saId","setServiceAccountId","file","data","readFileSync","jwk","JSON","parse","toString","setServiceAccountJwk","error","message","type","setDeploymentType","insecure","setAllowInsecureConnection","verbose","setVerbose","debug","setDebug","curlirize","setCurlirize","FrodoStubCommand","constructor","helpOption","showHelpAfterError","configureHelp","sortSubcommands","sortOptions","setPrintHandler","setVerboseHandler","setDebugHandler","setCurlirizeHandler","setCreateProgressHandler","setUpdateProgressHandler","setStopProgressHandler","FrodoCommand","omits","arg","includes","addArgument","opt","addOption","addHelpText","startsWith","handleDefaultArgsAndOpts","args","command","pop","options","i","v","entries","_args","length","Object","keys","handler","k"],"sources":["cli/FrodoCommand.ts"],"sourcesContent":["import { Argument, Command, Option } from 'commander';\nimport * as globalConfig from '../storage/StaticStorage';\nimport { state } from '@rockcarver/frodo-lib';\nimport fs from 'fs';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n verboseMessage,\n debugMessage,\n curlirizeMessage,\n} from '../utils/Console.js';\n\nconst hostArgument = new Argument(\n '[host]',\n 'Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring.'\n);\n\nconst realmArgument = new Argument(\n '[realm]',\n \"Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise.\"\n).default(\n // must check for FRODO_REALM env variable here because otherwise cli will overwrite realm with default value\n process.env.FRODO_REALM || globalConfig.DEFAULT_REALM_KEY,\n '\"alpha\" for Identity Cloud tenants, \"/\" otherwise.'\n);\n\nconst usernameArgument = new Argument(\n '[username]',\n 'Username to login with. Must be an admin user with appropriate rights to manage authentication journeys/trees.'\n);\n\nconst passwordArgument = new Argument('[password]', 'Password.');\n\nconst serviceAccountIdOption = new Option(\n '--sa-id <sa-id>',\n 'Service account id.'\n);\n\nconst serviceAccountJwkFileOption = new Option(\n '--sa-jwk-file <file>',\n 'File containing the JSON Web Key (JWK) associated with the the service account.'\n);\n\nconst deploymentOption = new Option(\n '-m, --type <type>',\n 'Override auto-detected deployment type. Valid values for type: \\n\\\nclassic: A classic Access Management-only deployment with custom layout and configuration. \\n\\\ncloud: A ForgeRock Identity Cloud environment. \\n\\\nforgeops: A ForgeOps CDK or CDM deployment. \\n\\\nThe detected or provided deployment type controls certain behavior like obtaining an Identity \\\nManagement admin token or not and whether to export/import referenced email templates or how \\\nto walk through the tenant admin login flow of Identity Cloud and handle MFA'\n).choices(globalConfig.DEPLOYMENT_TYPES);\n\nconst insecureOption = new Option(\n '-k, --insecure',\n 'Allow insecure connections when using SSL/TLS. Has no effect when using a network proxy for https (HTTPS_PROXY=http://<host>:<port>), in that case the proxy must provide this capability.'\n).default(false, \"Don't allow insecure connections\");\n\nconst verboseOption = new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n);\n\nconst debugOption = new Option(\n '--debug',\n 'Debug output during command execution. If specified, may or may not produce additional output helpful for troubleshooting.'\n);\n\nconst curlirizeOption = new Option(\n '--curlirize',\n 'Output all network calls in curl format.'\n);\n\nconst defaultArgs = [\n hostArgument,\n realmArgument,\n usernameArgument,\n passwordArgument,\n];\n\nconst defaultOpts = [\n serviceAccountIdOption,\n serviceAccountJwkFileOption,\n deploymentOption,\n insecureOption,\n verboseOption,\n debugOption,\n curlirizeOption,\n];\n\nconst stateMap = {\n [hostArgument.name()]: (host: string) => state.setHost(host),\n [realmArgument.name()]: (realm: string) => state.setRealm(realm),\n [usernameArgument.name()]: (username: string) => state.setUsername(username),\n [passwordArgument.name()]: (password: string) => state.setPassword(password),\n [serviceAccountIdOption.attributeName()]: (saId: string) =>\n state.setServiceAccountId(saId),\n [serviceAccountJwkFileOption.attributeName()]: (file: string) => {\n try {\n const data = fs.readFileSync(file);\n const jwk = JSON.parse(data.toString());\n state.setServiceAccountJwk(jwk);\n } catch (error) {\n printMessage(\n `Error parsing JWK from file ${file}: ${error.message}`,\n 'error'\n );\n }\n },\n [deploymentOption.attributeName()]: (type: string) =>\n state.setDeploymentType(type),\n [insecureOption.attributeName()]: (insecure: boolean) =>\n state.setAllowInsecureConnection(insecure),\n [verboseOption.attributeName()]: (verbose: boolean) =>\n state.setVerbose(verbose),\n [debugOption.attributeName()]: (debug: boolean) => state.setDebug(debug),\n [curlirizeOption.attributeName()]: (curlirize: boolean) =>\n state.setCurlirize(curlirize),\n};\n\n/**\n * Command with default options\n */\nexport class FrodoStubCommand extends Command {\n /**\n * Creates a new FrodoCommand instance\n * @param name Name of the command\n * @param omits Array of default argument names and default option names that should not be added to this command\n */\n constructor(name: string) {\n super(name);\n\n // other default settings\n this.helpOption('-h, --help', 'Help');\n this.showHelpAfterError();\n this.configureHelp({\n sortSubcommands: true,\n sortOptions: true,\n });\n\n // register default handlers\n state.setPrintHandler(printMessage);\n state.setVerboseHandler(verboseMessage);\n state.setDebugHandler(debugMessage);\n state.setCurlirizeHandler(curlirizeMessage);\n state.setCreateProgressHandler(createProgressIndicator);\n state.setUpdateProgressHandler(updateProgressIndicator);\n state.setStopProgressHandler(stopProgressIndicator);\n }\n}\n\n/**\n * Command with default options\n */\nexport class FrodoCommand extends FrodoStubCommand {\n /**\n * Creates a new FrodoCommand instance\n * @param name Name of the command\n * @param omits Array of default argument names and default option names that should not be added to this command\n */\n constructor(name: string, omits: string[] = []) {\n super(name);\n\n // register default arguments\n for (const arg of defaultArgs) {\n if (!omits.includes(arg.name())) this.addArgument(arg);\n }\n\n // register default options\n for (const opt of defaultOpts) {\n if (!omits.includes(opt.name())) this.addOption(opt);\n }\n\n // additional help\n this.addHelpText(\n 'after',\n `\\nEvironment Variables:\\n` +\n ` FRODO_HOST: Access Management base URL. Overrides 'host' argument.\\n` +\n ` FRODO_REALM: Realm. Overrides 'realm' argument.\\n` +\n ` FRODO_USERNAME: Username. Overrides 'username' argument.\\n` +\n ` FRODO_PASSWORD: Password. Overrides 'password' argument.\\n` +\n ` FRODO_SA_ID: Service account uuid. Overrides '--sa-id' option.\\n` +\n ` FRODO_SA_JWK: Service account JWK. Overrides '--sa-jwk-file' option but takes the actual JWK as a value, not a file name.\\n` +\n ('frodo conn save' === this.name()\n ? ` FRODO_LOG_KEY: Log API key. Overrides '--log-api-key' option.\\n` +\n ` FRODO_LOG_SECRET: Log API secret. Overrides '--log-api-secret' option.\\n`\n : ``) +\n (this.name().startsWith('frodo logs')\n ? ` FRODO_LOG_KEY: Log API key. Overrides 'username' argument.\\n` +\n ` FRODO_LOG_SECRET: Log API secret. Overrides 'password' argument.\\n`\n : ``) +\n ` FRODO_AUTHENTICATION_SERVICE: Name of a login journey to use.\\n` +\n ` FRODO_DEBUG: Set to any value to enable debug output. Same as '--debug'.\\n`\n );\n }\n\n /**\n *\n * @param args\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handleDefaultArgsAndOpts(...args: any) {\n const command = args.pop();\n const options = args.pop();\n\n // handle arguments first\n for (const [i, v] of command.args.entries()) {\n if (!command._args[i]) {\n printMessage(\n `${command.args.length} arguments supplied but command only supports ${command._args.length}.`,\n 'warn'\n );\n break;\n }\n const arg = command._args[i].name();\n // handle only default arguments\n if (Object.keys(stateMap).includes(arg)) {\n debugMessage(\n `FrodoCommand.handleDefaultArgsAndOpts: Handling default argument '${arg}'.`\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handler: any = stateMap[arg];\n handler(v);\n } else {\n debugMessage(\n `FrodoCommand.handleDefaultArgsAndOpts: Ignoring non-default argument '${arg}'.`\n );\n }\n }\n\n // handle options\n for (const [k, v] of Object.entries(options)) {\n // handle only default options\n if (Object.keys(stateMap).includes(k)) {\n debugMessage(\n `FrodoCommand.handleDefaultArgsAndOpts: Handling default option '${k}'.`\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handler: any = stateMap[k];\n handler(v);\n } else {\n debugMessage(\n `FrodoCommand.handleDefaultArgsAndOpts: Ignoring non-default option '${k}'.`\n );\n }\n }\n }\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,MAAM,QAAQ,WAAW;AACrD,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,OAAOC,EAAE,MAAM,IAAI;AACnB,SACEC,YAAY,EACZC,uBAAuB,EACvBC,uBAAuB,EACvBC,qBAAqB,EACrBC,cAAc,EACdC,YAAY,EACZC,gBAAgB,QACX,qBAAqB;AAE5B,MAAMC,YAAY,GAAG,IAAIb,QAAQ,CAC/B,QAAQ,EACR,iIACF,CAAC;AAED,MAAMc,aAAa,GAAG,IAAId,QAAQ,CAChC,SAAS,EACT,yFACF,CAAC,CAACe,OAAO;AACP;AACAC,OAAO,CAACC,GAAG,CAACC,WAAW,IAAIf,YAAY,CAACgB,iBAAiB,EACzD,oDACF,CAAC;AAED,MAAMC,gBAAgB,GAAG,IAAIpB,QAAQ,CACnC,YAAY,EACZ,gHACF,CAAC;AAED,MAAMqB,gBAAgB,GAAG,IAAIrB,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;AAEhE,MAAMsB,sBAAsB,GAAG,IAAIpB,MAAM,CACvC,iBAAiB,EACjB,qBACF,CAAC;AAED,MAAMqB,2BAA2B,GAAG,IAAIrB,MAAM,CAC5C,sBAAsB,EACtB,iFACF,CAAC;AAED,MAAMsB,gBAAgB,GAAG,IAAItB,MAAM,CACjC,mBAAmB,EACnB;AACF;AACA;AACA;AACA;AACA;AACA,6EACA,CAAC,CAACuB,OAAO,CAACtB,YAAY,CAACuB,gBAAgB,CAAC;AAExC,MAAMC,cAAc,GAAG,IAAIzB,MAAM,CAC/B,gBAAgB,EAChB,4LACF,CAAC,CAACa,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AAC;MACH;IACF;EACF;AACF"}
|
package/esm/cli/info/info.js
CHANGED
|
@@ -3,12 +3,12 @@ import { Option } from 'commander';
|
|
|
3
3
|
import { frodo, state } from '@rockcarver/frodo-lib';
|
|
4
4
|
import { createObjectTable, printMessage, verboseMessage } from '../../utils/Console';
|
|
5
5
|
export default function setup() {
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const program = new FrodoCommand('info', ['realm']);
|
|
7
|
+
program.description('Print versions and tokens.').addOption(new Option('--json', 'Output in JSON format.')).addOption(new Option('-s, --scriptFriendly', 'Send output of operation to STDOUT in a script-friendly format (JSON) which can be piped to other commands. User messages/warnings are output to STDERR, and are not piped. For example, to only get bearer token: \n<<< frodo info my-tenant -s 2>/dev/null | jq -r .bearerToken >>>').default(false, 'Output as plain text').hideHelp()).action(async (host, user, password, options, command) => {
|
|
8
8
|
command.handleDefaultArgsAndOpts(host, user, password, options, command);
|
|
9
9
|
if (await frodo.login.getTokens()) {
|
|
10
10
|
const info = await frodo.info.getInfo();
|
|
11
|
-
if (!options.scriptFriendly) {
|
|
11
|
+
if (!options.scriptFriendly && !options.json) {
|
|
12
12
|
verboseMessage('Printing info, versions, and tokens...');
|
|
13
13
|
delete info.sessionToken;
|
|
14
14
|
delete info.bearerToken;
|
|
@@ -40,9 +40,10 @@ export default function setup() {
|
|
|
40
40
|
}
|
|
41
41
|
} else {
|
|
42
42
|
process.exitCode = 1;
|
|
43
|
+
program.help();
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
-
return
|
|
46
|
+
program.showHelpAfterError();
|
|
47
|
+
return program;
|
|
47
48
|
}
|
|
48
49
|
//# sourceMappingURL=info.js.map
|
package/esm/cli/info/info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","names":["FrodoCommand","Option","frodo","state","createObjectTable","printMessage","verboseMessage","setup","
|
|
1
|
+
{"version":3,"file":"info.js","names":["FrodoCommand","Option","frodo","state","createObjectTable","printMessage","verboseMessage","setup","program","description","addOption","default","hideHelp","action","host","user","password","options","command","handleDefaultArgsAndOpts","login","getTokens","info","getInfo","scriptFriendly","json","sessionToken","bearerToken","labels","amVersion","authenticatedSubject","config_promotion_done","cookieName","deploymentType","immutable","locked","placeholder_management","region","tier","table","toString","getCookieValue","getBearerToken","JSON","stringify","process","exitCode","help","showHelpAfterError"],"sources":["cli/info/info.ts"],"sourcesContent":["import { FrodoCommand } from '../FrodoCommand';\nimport { Option } from 'commander';\nimport { frodo, state } from '@rockcarver/frodo-lib';\nimport {\n createObjectTable,\n printMessage,\n verboseMessage,\n} from '../../utils/Console';\n\nexport default function setup() {\n const program = new FrodoCommand('info', ['realm']);\n program\n .description('Print versions and tokens.')\n .addOption(new Option('--json', 'Output in JSON format.'))\n .addOption(\n new Option(\n '-s, --scriptFriendly',\n 'Send output of operation to STDOUT in a script-friendly format (JSON) which can be piped to other commands. User messages/warnings are output to STDERR, and are not piped. For example, to only get bearer token: \\n<<< frodo info my-tenant -s 2>/dev/null | jq -r .bearerToken >>>'\n )\n .default(false, 'Output as plain text')\n .hideHelp()\n )\n .action(async (host, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(host, user, password, options, command);\n if (await frodo.login.getTokens()) {\n const info = await frodo.info.getInfo();\n if (!options.scriptFriendly && !options.json) {\n verboseMessage('Printing info, versions, and tokens...');\n delete info.sessionToken;\n delete info.bearerToken;\n const labels = {\n amVersion: 'AM Version',\n authenticatedSubject: 'Subject (Type)',\n config_promotion_done: 'Promotion Done',\n cookieName: 'Cookie Name',\n deploymentType: 'Deployment Type',\n host: 'Host URL',\n immutable: 'Immutable',\n locked: 'Locked',\n placeholder_management: 'Placeholder Management',\n region: 'Region',\n tier: 'Tier',\n };\n const table = createObjectTable(info, labels);\n printMessage(`\\n${table.toString()}`);\n if (state.getCookieValue()) {\n printMessage(`\\nSession token:`, 'info');\n printMessage(`${state.getCookieValue()}`);\n }\n if (state.getBearerToken()) {\n printMessage(`\\nBearer token:`, 'info');\n printMessage(`${state.getBearerToken()}`);\n }\n } else {\n printMessage(JSON.stringify(info, null, 2), 'data');\n }\n } else {\n process.exitCode = 1;\n program.help();\n }\n });\n program.showHelpAfterError();\n return program;\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SACEC,iBAAiB,EACjBC,YAAY,EACZC,cAAc,QACT,qBAAqB;AAE5B,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIR,YAAY,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;EACnDQ,OAAO,CACJC,WAAW,CAAC,4BAA4B,CAAC,CACzCC,SAAS,CAAC,IAAIT,MAAM,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC,CACzDS,SAAS,CACR,IAAIT,MAAM,CACR,sBAAsB,EACtB,uRACF,CAAC,CACEU,OAAO,CAAC,KAAK,EAAE,sBAAsB,CAAC,CACtCC,QAAQ,CAAC,CACd,CAAC,CACAC,MAAM,CAAC,OAAOC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;IACxDA,OAAO,CAACC,wBAAwB,CAACL,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,CAAC;IACxE,IAAI,MAAMhB,KAAK,CAACkB,KAAK,CAACC,SAAS,CAAC,CAAC,EAAE;MACjC,MAAMC,IAAI,GAAG,MAAMpB,KAAK,CAACoB,IAAI,CAACC,OAAO,CAAC,CAAC;MACvC,IAAI,CAACN,OAAO,CAACO,cAAc,IAAI,CAACP,OAAO,CAACQ,IAAI,EAAE;QAC5CnB,cAAc,CAAC,wCAAwC,CAAC;QACxD,OAAOgB,IAAI,CAACI,YAAY;QACxB,OAAOJ,IAAI,CAACK,WAAW;QACvB,MAAMC,MAAM,GAAG;UACbC,SAAS,EAAE,YAAY;UACvBC,oBAAoB,EAAE,gBAAgB;UACtCC,qBAAqB,EAAE,gBAAgB;UACvCC,UAAU,EAAE,aAAa;UACzBC,cAAc,EAAE,iBAAiB;UACjCnB,IAAI,EAAE,UAAU;UAChBoB,SAAS,EAAE,WAAW;UACtBC,MAAM,EAAE,QAAQ;UAChBC,sBAAsB,EAAE,wBAAwB;UAChDC,MAAM,EAAE,QAAQ;UAChBC,IAAI,EAAE;QACR,CAAC;QACD,MAAMC,KAAK,GAAGnC,iBAAiB,CAACkB,IAAI,EAAEM,MAAM,CAAC;QAC7CvB,YAAY,CAAE,KAAIkC,KAAK,CAACC,QAAQ,CAAC,CAAE,EAAC,CAAC;QACrC,IAAIrC,KAAK,CAACsC,cAAc,CAAC,CAAC,EAAE;UAC1BpC,YAAY,CAAE,kBAAiB,EAAE,MAAM,CAAC;UACxCA,YAAY,CAAE,GAAEF,KAAK,CAACsC,cAAc,CAAC,CAAE,EAAC,CAAC;QAC3C;QACA,IAAItC,KAAK,CAACuC,cAAc,CAAC,CAAC,EAAE;UAC1BrC,YAAY,CAAE,iBAAgB,EAAE,MAAM,CAAC;UACvCA,YAAY,CAAE,GAAEF,KAAK,CAACuC,cAAc,CAAC,CAAE,EAAC,CAAC;QAC3C;MACF,CAAC,MAAM;QACLrC,YAAY,CAACsC,IAAI,CAACC,SAAS,CAACtB,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC;MACrD;IACF,CAAC,MAAM;MACLuB,OAAO,CAACC,QAAQ,GAAG,CAAC;MACpBtC,OAAO,CAACuC,IAAI,CAAC,CAAC;IAChB;EACF,CAAC,CAAC;EACJvC,OAAO,CAACwC,kBAAkB,CAAC,CAAC;EAC5B,OAAOxC,OAAO;AAChB"}
|
|
@@ -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,OAA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;MACxD,IAAIF,OAAO,CAACI,UAAU,EAAGJ,OAAO,CAAa,YAAY,CAAC,GAAGE,OAAO;IACtE;IACA,IAAI,CAACF,OAAO,CAACR,QAAQ,EAAE;MACrB,OAAOQ,OAAO,CAACR,QAAQ;MACvB,OAAOQ,OAAO,CAACK,QAAQ;IACzB;IACA,IAAI,CAACL,OAAO,CAACP,SAAS,EAAE;MACtB,OAAOO,OAAO,CAACP,SAAS;MACxB,OAAOO,OAAO,CAACM,YAAY;IAC7B;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;;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;Q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,IAAI,CAACgB,QAAQ,CAAC,CAAC,CAAC;IACvC,IAAIqB,QAAQ,EAAE;MACZ5C,WAAW,CAAE,8BAA6B0C,gBAAiB,KAAI,CAAC;MAChE,MAAMG,KAAK,GAAG,MAAMpD,KAAK,CAACqD,KAAK,CAACC,+BAA+B,CAC7DL,gBAAgB,EAChBV,GACF,CAAC;MACD,IAAIa,KAAK,KAAK,IAAI,EAAE;QAClB/C,WAAW,CAAE,sCAAqC4C,gBAAiB,GAAE,CAAC;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/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,kBAAk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AM,CAACtC,WAAW,CAAC4E,aAAa,CAAC,EAAE;MACzE7J,YAAY,CAAE,GAAEa,KAAK,CAAC0J,aAAa,CAACT,kBAAkB,CAAE,EAAC,EAAE,MAAM,CAAC;IACpE;EACF;;EAEA;EACA,IAAItE,MAAM,CAACsD,OAAO,CAAC7D,WAAW,CAAC8E,cAAc,CAAC,CAACrF,MAAM,EAAE;IACrD1E,YAAY,CACT,8BACCwF,MAAM,CAACsD,OAAO,CAAC7D,WAAW,CAAC8E,cAAc,CAAC,CAACrF,MAC5C,GAAE,EACH,MACF,CAAC;IACD1E,YAAY,CAACS,cAAc,CAAC6J,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC;IACvD,KAAK,MAAMN,OAAO,IAAIxE,MAAM,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,Y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E;EACF;;EAEA;EACA,IAAItE,MAAM,CAACsD,OAAO,CAAC7D,WAAW,CAAC8E,cAAc,CAAC,CAACrF,MAAM,EAAE;IACrD1E,YAAY,CACT,8BACCwF,MAAM,CAACsD,OAAO,CAAC7D,WAAW,CAAC8E,cAAc,CAAC,CAACrF,MAC5C,GAAE,EACH,MACF,CAAC;IACD1E,YAAY,CAACS,cAAc,CAAC6J,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC;IACvD,KAAK,MAAMN,OAAO,IAAIxE,MAAM,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockcarver/frodo-cli",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
|
|
6
6
|
"keywords": [
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@rockcarver/frodo-lib": "2.0.0-
|
|
102
|
+
"@rockcarver/frodo-lib": "2.0.0-5",
|
|
103
103
|
"chokidar": "^3.5.3",
|
|
104
104
|
"cli-progress": "^3.11.2",
|
|
105
105
|
"cli-table3": "^0.6.3",
|