@rockcarver/frodo-cli 2.0.0-19 → 2.0.0-20

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 CHANGED
@@ -7,6 +7,8 @@ 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-19] - 2023-10-02
11
+
10
12
  ## [2.0.0-18] - 2023-10-02
11
13
 
12
14
  ## [2.0.0-17] - 2023-09-29
@@ -1351,7 +1353,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1351
1353
  - Fixed problem with adding connection profiles
1352
1354
  - Miscellaneous bug fixes
1353
1355
 
1354
- [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-18...HEAD
1356
+ [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-19...HEAD
1357
+
1358
+ [2.0.0-19]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-18...v2.0.0-19
1355
1359
 
1356
1360
  [2.0.0-18]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-17...v2.0.0-18
1357
1361
 
@@ -57,16 +57,17 @@ export class FrodoStubCommand extends Command {
57
57
  */
58
58
  constructor(name) {
59
59
  super(name);
60
-
61
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
- process.on('unhandledRejection', error => {
63
- var _error$config, _error$config2, _error$response;
64
- printMessage(`${(_error$config = error.config) !== null && _error$config !== void 0 && _error$config.method ? error.config.method + ' ' : ''}${(_error$config2 = error.config) !== null && _error$config2 !== void 0 && _error$config2.url ? error.config.url : ''}`, 'error');
65
- printMessage((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data, 'error');
66
- printMessage(error.stack, 'error');
67
- printMessage(`Please report this unhandled error here: https://github.com/rockcarver/frodo-cli/issues`, 'error');
68
- process.exitCode = 1;
69
- });
60
+ if (!process.listenerCount('unhandledRejection')) {
61
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
+ process.on('unhandledRejection', error => {
63
+ var _error$config, _error$config2, _error$response;
64
+ printMessage(`${(_error$config = error.config) !== null && _error$config !== void 0 && _error$config.method ? error.config.method + ' ' : ''}${(_error$config2 = error.config) !== null && _error$config2 !== void 0 && _error$config2.url ? error.config.url : ''}`, 'error');
65
+ printMessage((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data, 'error');
66
+ printMessage(error.stack, 'error');
67
+ printMessage(`Please report this unhandled error here: https://github.com/rockcarver/frodo-cli/issues`, 'error');
68
+ process.exitCode = 1;
69
+ });
70
+ }
70
71
 
71
72
  // other default settings
72
73
  this.helpOption('-h, --help', 'Help');
@@ -1 +1 @@
1
- {"version":3,"file":"FrodoCommand.js","names":["state","Argument","Command","Option","fs","globalConfig","createProgressIndicator","curlirizeMessage","debugMessage","printMessage","stopProgressIndicator","updateProgressIndicator","verboseMessage","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","on","_error$config","_error$config2","_error$response","config","method","url","response","stack","exitCode","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":["../../src/cli/FrodoCommand.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\nimport { Argument, Command, Option } from 'commander';\nimport fs from 'fs';\n\nimport * as globalConfig from '../storage/StaticStorage';\nimport {\n createProgressIndicator,\n curlirizeMessage,\n debugMessage,\n printMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n verboseMessage,\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n process.on('unhandledRejection', (error: any) => {\n printMessage(\n `${error.config?.method ? error.config.method + ' ' : ''}${\n error.config?.url ? error.config.url : ''\n }`,\n 'error'\n );\n printMessage(error.response?.data, 'error');\n printMessage(error.stack, 'error');\n printMessage(\n `Please report this unhandled error here: https://github.com/rockcarver/frodo-cli/issues`,\n 'error'\n );\n process.exitCode = 1;\n });\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 log')\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_CONNECTION_PROFILES_PATH: Use this connection profiles file instead of '~/.frodo/Connections.json'.\\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 ` FRODO_MASTER_KEY_PATH: Use this master key file instead of '~/.frodo/masterkey.key' file.\\n` +\n ` FRODO_MASTER_KEY: Use this master key instead of '~/.frodo/masterkey.key' file. Takes precedence over FRODO_MASTER_KEY_PATH.\\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 }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AC,EAAE;QACvCpF,YAAY,CACT,qEAAoEoF,GAAI,IAC3E,CAAC;QACD;QACA,MAAMmB,OAAY,GAAG9E,QAAQ,CAAC2D,GAAG,CAAC;QAClCmB,OAAO,CAACN,CAAC,CAAC;MACZ,CAAC,MAAM;QACLjG,YAAY,CACT,yEAAwEoF,GAAI,IAC/E,CAAC;MACH;IACF;;IAEA;IACA,KAAK,MAAM,CAACoB,CAAC,EAAEP,CAAC,CAAC,IAAII,MAAM,CAACH,OAAO,CAACH,OAAO,CAAC,EAAE;MAC5C;MACA,IAAIM,MAAM,CAACC,IAAI,CAAC7E,QAAQ,CAAC,CAAC4D,QAAQ,CAACmB,CAAC,CAAC,EAAE;QACrCxG,YAAY,CACT,mEAAkEwG,CAAE,IACvE,CAAC;QACD;QACA,MAAMD,OAAY,GAAG9E,QAAQ,CAAC+E,CAAC,CAAC;QAChCD,OAAO,CAACN,CAAC,CAAC;MACZ,CAAC,MAAM;QACLjG,YAAY,CACT,uEAAsEwG,CAAE,IAC3E,CAAC;MACH;IACF;EACF;AACF"}
1
+ {"version":3,"file":"FrodoCommand.js","names":["state","Argument","Command","Option","fs","globalConfig","createProgressIndicator","curlirizeMessage","debugMessage","printMessage","stopProgressIndicator","updateProgressIndicator","verboseMessage","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","listenerCount","on","_error$config","_error$config2","_error$response","config","method","url","response","stack","exitCode","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":["../../src/cli/FrodoCommand.ts"],"sourcesContent":["import { state } from '@rockcarver/frodo-lib';\nimport { Argument, Command, Option } from 'commander';\nimport fs from 'fs';\n\nimport * as globalConfig from '../storage/StaticStorage';\nimport {\n createProgressIndicator,\n curlirizeMessage,\n debugMessage,\n printMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n verboseMessage,\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 if (!process.listenerCount('unhandledRejection')) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n process.on('unhandledRejection', (error: any) => {\n printMessage(\n `${error.config?.method ? error.config.method + ' ' : ''}${\n error.config?.url ? error.config.url : ''\n }`,\n 'error'\n );\n printMessage(error.response?.data, 'error');\n printMessage(error.stack, 'error');\n printMessage(\n `Please report this unhandled error here: https://github.com/rockcarver/frodo-cli/issues`,\n 'error'\n );\n process.exitCode = 1;\n });\n }\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 log')\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_CONNECTION_PROFILES_PATH: Use this connection profiles file instead of '~/.frodo/Connections.json'.\\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 ` FRODO_MASTER_KEY_PATH: Use this master key file instead of '~/.frodo/masterkey.key' file.\\n` +\n ` FRODO_MASTER_KEY: Use this master key instead of '~/.frodo/masterkey.key' file. Takes precedence over FRODO_MASTER_KEY_PATH.\\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,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,QAAQ,WAAW;AACrD,OAAOC,EAAE,MAAM,IAAI;AAEnB,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AACxD,SACEC,uBAAuB,EACvBC,gBAAgB,EAChBC,YAAY,EACZC,YAAY,EACZC,qBAAqB,EACrBC,uBAAuB,EACvBC,cAAc,QACT,qBAAqB;AAE5B,MAAMC,YAAY,GAAG,IAAIZ,QAAQ,CAC/B,QAAQ,EACR,iIACF,CAAC;AAED,MAAMa,aAAa,GAAG,IAAIb,QAAQ,CAChC,SAAS,EACT,yFACF,CAAC,CAACc,OAAO;AACP;AACAC,OAAO,CAACC,GAAG,CAACC,WAAW,IAAIb,YAAY,CAACc,iBAAiB,EACzD,oDACF,CAAC;AAED,MAAMC,gBAAgB,GAAG,IAAInB,QAAQ,CACnC,YAAY,EACZ,gHACF,CAAC;AAED,MAAMoB,gBAAgB,GAAG,IAAIpB,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;AAEhE,MAAMqB,sBAAsB,GAAG,IAAInB,MAAM,CACvC,iBAAiB,EACjB,qBACF,CAAC;AAED,MAAMoB,2BAA2B,GAAG,IAAIpB,MAAM,CAC5C,sBAAsB,EACtB,iFACF,CAAC;AAED,MAAMqB,gBAAgB,GAAG,IAAIrB,MAAM,CACjC,mBAAmB,EACnB;AACF;AACA;AACA;AACA;AACA;AACA,6EACA,CAAC,CAACsB,OAAO,CAACpB,YAAY,CAACqB,gBAAgB,CAAC;AAExC,M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ACrBhG,YAAY,CACT,GAAE6F,OAAO,CAACD,IAAI,CAACQ,MAAO,iDAAgDP,OAAO,CAACM,KAAK,CAACC,MAAO,GAAE,EAC9F,MACF,CAAC;QACD;MACF;MACA,MAAMhB,GAAG,GAAGS,OAAO,CAACM,KAAK,CAACH,CAAC,CAAC,CAACvE,IAAI,CAAC,CAAC;MACnC;MACA,IAAI4E,MAAM,CAACC,IAAI,CAAC9E,QAAQ,CAAC,CAAC6D,QAAQ,CAACD,GAAG,CAAC,EAAE;QACvCrF,YAAY,CACT,qEAAoEqF,GAAI,IAC3E,CAAC;QACD;QACA,MAAMmB,OAAY,GAAG/E,QAAQ,CAAC4D,GAAG,CAAC;QAClCmB,OAAO,CAACN,CAAC,CAAC;MACZ,CAAC,MAAM;QACLlG,YAAY,CACT,yEAAwEqF,GAAI,IAC/E,CAAC;MACH;IACF;;IAEA;IACA,KAAK,MAAM,CAACoB,CAAC,EAAEP,CAAC,CAAC,IAAII,MAAM,CAACH,OAAO,CAACH,OAAO,CAAC,EAAE;MAC5C;MACA,IAAIM,MAAM,CAACC,IAAI,CAAC9E,QAAQ,CAAC,CAAC6D,QAAQ,CAACmB,CAAC,CAAC,EAAE;QACrCzG,YAAY,CACT,mEAAkEyG,CAAE,IACvE,CAAC;QACD;QACA,MAAMD,OAAY,GAAG/E,QAAQ,CAACgF,CAAC,CAAC;QAChCD,OAAO,CAACN,CAAC,CAAC;MACZ,CAAC,MAAM;QACLlG,YAAY,CACT,uEAAsEyG,CAAE,IAC3E,CAAC;MACH;IACF;EACF;AACF"}
@@ -7,7 +7,7 @@ const {
7
7
  getTokens
8
8
  } = frodo.login;
9
9
  const program = new FrodoCommand('frodo idm count');
10
- program.description('Count managed objects.').addOption(new Option('-m, --managed-object <type>', 'Type of managed object to count. E.g. "alpha_user", "alpha_role", "user", "role".')).action(
10
+ program.description('Count managed objects.').addOption(new Option('-o, --managed-object <type>', 'Type of managed object to count. E.g. "alpha_user", "alpha_role", "user", "role".')).action(
11
11
  // implement command logic inside action handler
12
12
  async (host, realm, user, password, options, command) => {
13
13
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -1 +1 @@
1
- {"version":3,"file":"idm-count.js","names":["frodo","Option","countManagedObjects","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","managedObject","process","exitCode","parse"],"sources":["../../../src/cli/idm/idm-count.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { countManagedObjects } from '../../ops/IdmOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm count');\n\nprogram\n .description('Count managed objects.')\n .addOption(\n new Option(\n '-m, --managed-object <type>',\n 'Type of managed object to count. E.g. \"alpha_user\", \"alpha_role\", \"user\", \"role\".'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Counting managed ${options.managedObject} objects...`);\n countManagedObjects(options.managedObject);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,iBAAiB,CAAC;AAEnDG,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIR,MAAM,CACR,6BAA6B,EAC7B,mFACF,CACF,CAAC,CACAS,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,oBAAmBY,OAAO,CAACG,aAAc,aAAY,CAAC;IACtEhB,mBAAmB,CAACa,OAAO,CAACG,aAAa,CAAC;EAC5C,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHb,OAAO,CAACc,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idm-count.js","names":["frodo","Option","countManagedObjects","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","managedObject","process","exitCode","parse"],"sources":["../../../src/cli/idm/idm-count.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { countManagedObjects } from '../../ops/IdmOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm count');\n\nprogram\n .description('Count managed objects.')\n .addOption(\n new Option(\n '-o, --managed-object <type>',\n 'Type of managed object to count. E.g. \"alpha_user\", \"alpha_role\", \"user\", \"role\".'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Counting managed ${options.managedObject} objects...`);\n countManagedObjects(options.managedObject);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,iBAAiB,CAAC;AAEnDG,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIR,MAAM,CACR,6BAA6B,EAC7B,mFACF,CACF,CAAC,CACAS,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,oBAAmBY,OAAO,CAACG,aAAc,aAAY,CAAC;IACtEhB,mBAAmB,CAACa,OAAO,CAACG,aAAa,CAAC;EAC5C,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHb,OAAO,CAACc,KAAK,CAAC,CAAC"}
@@ -17,7 +17,7 @@ async (host, realm, user, password, options, command) => {
17
17
  await importConfigEntityByIdFromFile(options.name, options.file);
18
18
  }
19
19
  // import from file
20
- if (options.file && (await getTokens())) {
20
+ else if (options.file && (await getTokens())) {
21
21
  verboseMessage(`Importing object from file...`);
22
22
  await importConfigEntityFromFile(options.file);
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"idm-import.js","names":["frodo","Option","importAllConfigEntities","importAllRawConfigEntities","importConfigEntityByIdFromFile","importConfigEntityFromFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","name","file","allSeparate","directory","entitiesFile","envFile","help","process","exitCode","parse"],"sources":["../../../src/cli/idm/idm-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importAllConfigEntities,\n importAllRawConfigEntities,\n importConfigEntityByIdFromFile,\n importConfigEntityFromFile,\n} from '../../ops/IdmOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm import');\n\ninterface IdmImportOptions {\n type?: string;\n insecure?: boolean;\n verbose?: boolean;\n debug?: boolean;\n curlirize?: boolean;\n name?: string;\n file?: string;\n entitiesFile?: string;\n envFile?: string;\n all?: string;\n allSeparate?: string;\n directory?: string;\n}\n\nprogram\n .description('Import IDM configuration objects.')\n .addOption(\n new Option(\n '-N, --name <name>',\n 'Config entity name. E.g. \"managed\", \"sync\", \"provisioner-<connector-name>\", etc.'\n )\n )\n .addOption(new Option('-f, --file [file]', 'Import file. Ignored with -A.'))\n .addOption(\n new Option(\n '-E, --entities-file [entities-file]',\n 'Name of the entity file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-e, --env-file [envfile]',\n 'Name of the env file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all IDM configuration objects from separate files in directory -D. Ignored with -N, and -a.'\n )\n )\n .addOption(\n new Option(\n '-D, --directory <directory>',\n 'Import directory. Required with and ignored without -a/-A.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (\n host: string,\n realm: string,\n user: string,\n password: string,\n options: IdmImportOptions,\n command\n ) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id/name\n if (options.name && (await getTokens())) {\n verboseMessage(`Importing object \"${options.name}\"...`);\n await importConfigEntityByIdFromFile(options.name, options.file);\n }\n // import from file\n if (options.file && (await getTokens())) {\n verboseMessage(`Importing object from file...`);\n await importConfigEntityFromFile(options.file);\n }\n // --all-separate -A\n else if (\n options.allSeparate &&\n options.directory &&\n options.entitiesFile &&\n options.envFile &&\n (await getTokens())\n ) {\n verboseMessage(\n `Importing IDM configuration objects specified in ${options.entitiesFile} into separate files in ${options.directory} using ${options.envFile} for variable replacement...`\n );\n await importAllConfigEntities(\n options.directory,\n options.entitiesFile,\n options.envFile\n );\n }\n // --all-separate -A without variable replacement\n else if (\n options.allSeparate &&\n options.directory &&\n (await getTokens())\n ) {\n verboseMessage(\n `Importing all IDM configuration objects from separate files in ${options.directory}...`\n );\n await importAllRawConfigEntities(options.directory);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,uBAAuB,EACvBC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,0BAA0B,QACrB,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,kBAAkB,CAAC;AAiBpDG,OAAO,CACJC,WAAW,CAAC,mCAAmC,CAAC,CAChDC,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,kFACF,CACF,CAAC,CACAY,SAAS,CAAC,IAAIZ,MAAM,CAAC,mBAAmB,EAAE,+BAA+B,CAAC,CAAC,CAC3EY,SAAS,CACR,IAAIZ,MAAM,CACR,qCAAqC,EACrC,2CACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,0BAA0B,EAC1B,wCACF,CACF,CA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EACnB;IACAF,cAAc,CACX,kEAAiEY,OAAO,CAACM,SAAU,KACtF,CAAC;IACD,MAAMtB,0BAA0B,CAACgB,OAAO,CAACM,SAAS,CAAC;EACrD;EACA;EAAA,KACK;IACHnB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACiB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHnB,OAAO,CAACoB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"idm-import.js","names":["frodo","Option","importAllConfigEntities","importAllRawConfigEntities","importConfigEntityByIdFromFile","importConfigEntityFromFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","name","file","allSeparate","directory","entitiesFile","envFile","help","process","exitCode","parse"],"sources":["../../../src/cli/idm/idm-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importAllConfigEntities,\n importAllRawConfigEntities,\n importConfigEntityByIdFromFile,\n importConfigEntityFromFile,\n} from '../../ops/IdmOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idm import');\n\ninterface IdmImportOptions {\n type?: string;\n insecure?: boolean;\n verbose?: boolean;\n debug?: boolean;\n curlirize?: boolean;\n name?: string;\n file?: string;\n entitiesFile?: string;\n envFile?: string;\n all?: string;\n allSeparate?: string;\n directory?: string;\n}\n\nprogram\n .description('Import IDM configuration objects.')\n .addOption(\n new Option(\n '-N, --name <name>',\n 'Config entity name. E.g. \"managed\", \"sync\", \"provisioner-<connector-name>\", etc.'\n )\n )\n .addOption(new Option('-f, --file [file]', 'Import file. Ignored with -A.'))\n .addOption(\n new Option(\n '-E, --entities-file [entities-file]',\n 'Name of the entity file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-e, --env-file [envfile]',\n 'Name of the env file. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all IDM configuration objects from separate files in directory -D. Ignored with -N, and -a.'\n )\n )\n .addOption(\n new Option(\n '-D, --directory <directory>',\n 'Import directory. Required with and ignored without -a/-A.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (\n host: string,\n realm: string,\n user: string,\n password: string,\n options: IdmImportOptions,\n command\n ) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id/name\n if (options.name && (await getTokens())) {\n verboseMessage(`Importing object \"${options.name}\"...`);\n await importConfigEntityByIdFromFile(options.name, options.file);\n }\n // import from file\n else if (options.file && (await getTokens())) {\n verboseMessage(`Importing object from file...`);\n await importConfigEntityFromFile(options.file);\n }\n // --all-separate -A\n else if (\n options.allSeparate &&\n options.directory &&\n options.entitiesFile &&\n options.envFile &&\n (await getTokens())\n ) {\n verboseMessage(\n `Importing IDM configuration objects specified in ${options.entitiesFile} into separate files in ${options.directory} using ${options.envFile} for variable replacement...`\n );\n await importAllConfigEntities(\n options.directory,\n options.entitiesFile,\n options.envFile\n );\n }\n // --all-separate -A without variable replacement\n else if (\n options.allSeparate &&\n options.directory &&\n (await getTokens())\n ) {\n verboseMessage(\n `Importing all IDM configuration objects from separate files in ${options.directory}...`\n );\n await importAllRawConfigEntities(options.directory);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,uBAAuB,EACvBC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,0BAA0B,QACrB,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAAS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,IACHJ,OAAO,CAACK,WAAW,IACnBL,OAAO,CAACM,SAAS,IACjBN,OAAO,CAACO,YAAY,IACpBP,OAAO,CAACQ,OAAO,KACd,MAAMlB,SAAS,CAAC,CAAC,CAAC,EACnB;IACAF,cAAc,CACX,oDAAmDY,OAAO,CAACO,YAAa,2BAA0BP,OAAO,CAACM,SAAU,UAASN,OAAO,CAACQ,OAAQ,8BAChJ,CAAC;IACD,MAAMzB,uBAAuB,CAC3BiB,OAAO,CAACM,SAAS,EACjBN,OAAO,CAACO,YAAY,EACpBP,OAAO,CAACQ,OACV,CAAC;EACH;EACA;EAAA,KACK,IACHR,OAAO,CAACK,WAAW,IACnBL,OAAO,CAACM,SAAS,KAChB,MAAMhB,SAAS,CAAC,CAAC,CAAC,EACnB;IACAF,cAAc,CACX,kEAAiEY,OAAO,CAACM,SAAU,KACtF,CAAC;IACD,MAAMtB,0BAA0B,CAACgB,OAAO,CAACM,SAAS,CAAC;EACrD;EACA;EAAA,KACK;IACHnB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACiB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHnB,OAAO,CAACoB,KAAK,CAAC,CAAC"}
@@ -310,15 +310,17 @@ export async function importAgentFromFile(agentId, file) {
310
310
  const verbose = state.getVerbose();
311
311
  fs.readFile(file, 'utf8', async (err, data) => {
312
312
  if (err) throw err;
313
- let importData = JSON.parse(data);
313
+ const importData = JSON.parse(data);
314
314
  // check if this is a file with multiple agents and get agent by id
315
315
  if (importData.agents && importData.agents[agentId]) {
316
- importData = importData.agents[agentId];
316
+ const agent = importData.agents[agentId];
317
+ importData.agents = {};
318
+ importData.agents[agentId] = agent;
317
319
  } else if (importData.agents) {
318
- importData = null;
320
+ importData.agents = null;
319
321
  }
320
322
  // if an agentId was specified, only import the matching agent
321
- if (importData && agentId === importData.agents._id) {
323
+ if (importData.agents) {
322
324
  if (!verbose) showSpinner(`Importing ${agentId}...`);
323
325
  try {
324
326
  if (verbose) showSpinner(`Importing ${agentId}...`);
@@ -405,15 +407,17 @@ export async function importIdentityGatewayAgentFromFile(agentId, file) {
405
407
  const verbose = state.getVerbose();
406
408
  fs.readFile(file, 'utf8', async (err, data) => {
407
409
  if (err) throw err;
408
- let importData = JSON.parse(data);
410
+ const importData = JSON.parse(data);
409
411
  // check if this is a file with multiple agents and get agent by id
410
412
  if (importData.agents && importData.agents[agentId]) {
411
- importData = importData.agents[agentId];
413
+ const agent = importData.agents[agentId];
414
+ importData.agents = {};
415
+ importData.agents[agentId] = agent;
412
416
  } else if (importData.agents) {
413
- importData = null;
417
+ importData.agents = null;
414
418
  }
415
419
  // if an agentId was specified, only import the matching agent
416
- if (importData && agentId === importData.agents._id) {
420
+ if (importData.agents) {
417
421
  if (!verbose) showSpinner(`Importing ${agentId}...`);
418
422
  try {
419
423
  if (verbose) showSpinner(`Importing ${agentId}...`);
@@ -503,15 +507,17 @@ export async function importJavaAgentFromFile(agentId, file) {
503
507
  const verbose = state.getVerbose();
504
508
  fs.readFile(file, 'utf8', async (err, data) => {
505
509
  if (err) throw err;
506
- let importData = JSON.parse(data);
510
+ const importData = JSON.parse(data);
507
511
  // check if this is a file with multiple agents and get agent by id
508
512
  if (importData.agents && importData.agents[agentId]) {
509
- importData = importData.agents[agentId];
513
+ const agent = importData.agents[agentId];
514
+ importData.agents = {};
515
+ importData.agents[agentId] = agent;
510
516
  } else if (importData.agents) {
511
- importData = null;
517
+ importData.agents = null;
512
518
  }
513
519
  // if an agentId was specified, only import the matching agent
514
- if (importData && agentId === importData.agents._id) {
520
+ if (importData.agents) {
515
521
  if (!verbose) showSpinner(`Importing ${agentId}...`);
516
522
  try {
517
523
  if (verbose) showSpinner(`Importing ${agentId}...`);
@@ -601,15 +607,17 @@ export async function importWebAgentFromFile(agentId, file) {
601
607
  const verbose = state.getVerbose();
602
608
  fs.readFile(file, 'utf8', async (err, data) => {
603
609
  if (err) throw err;
604
- let importData = JSON.parse(data);
610
+ const importData = JSON.parse(data);
605
611
  // check if this is a file with multiple agents and get agent by id
606
612
  if (importData.agents && importData.agents[agentId]) {
607
- importData = importData.agents[agentId];
613
+ const agent = importData.agents[agentId];
614
+ importData.agents = {};
615
+ importData.agents[agentId] = agent;
608
616
  } else if (importData.agents) {
609
- importData = null;
617
+ importData.agents = null;
610
618
  }
611
619
  // if an agentId was specified, only import the matching agent
612
- if (importData && agentId === importData.agents._id) {
620
+ if (importData.agents) {
613
621
  if (!verbose) showSpinner(`Importing ${agentId}...`);
614
622
  try {
615
623
  if (verbose) showSpinner(`Importing ${agentId}...`);
@@ -1 +1 @@
1
- {"version":3,"file":"AgentOps.js","names":["frodo","state","fs","createTable","debugMessage","failSpinner","printMessage","showSpinner","succeedSpinner","getTypedFilename","saveJsonToFile","titleCase","getRealmName","utils","createAgentExportTemplate","readAgents","readIdentityGatewayAgents","readJavaAgents","readWebAgents","exportAgents","exportIdentityGatewayAgents","exportJavaAgents","exportWebAgents","exportAgent","exportIdentityGatewayAgent","exportJavaAgent","exportWebAgent","importAgent","importIdentityGatewayAgent","importJavaAgent","importWebAgent","importAgents","importIdentityGatewayAgents","importJavaAgents","importWebAgents","agent","agentTypeToFileIdMap","IdentityGatewayAgent","J2EEAgent","WebAgent","listAgents","long","agents","table","status","_type","_id","push","name","toString","forEach","error","stack","listIdentityGatewayAgents","listJavaAgents","listWebAgents","exportAgentsToFile","file","exportData","fileName","getRealm","exportIdentityGatewayAgentsToFile","exportJavaAgentsToFile","exportWebAgentsToFile","exportAgentToFile","agentId","exportIdentityGatewayAgentToFile","exportJavaAgentToFile","exportWebAgentToFile","exportAgentsToFiles","length","exportIdentityGatewayAgentsToFiles","exportJavaAgentsToFiles","exportWebAgentsToFiles","importAgentFromFile","verbose","getVerbose","readFile","err","data","importData","JSON","parse","importError","importFirstAgentFromFile","Object","keys","values","importAgentsFromFile","message","response","importAgentsFromFiles","names","readdirSync","agentFiles","filter","toLowerCase","endsWith","importIdentityGatewayAgentFromFile","importFirstIdentityGatewayAgentFromFile","importIdentityGatewayAgentsFromFile","importIdentityGatewayAgentsFromFiles","importJavaAgentFromFile","importFirstJavaAgentFromFile","importJavaAgentsFromFile","importJavaAgentsFromFiles","importWebAgentFromFile","importFirstWebAgentFromFile","importWebAgentsFromFile","importWebAgentsFromFiles"],"sources":["../../src/ops/AgentOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { type AgentExportInterface } from '@rockcarver/frodo-lib/types/ops/AgentOps';\nimport fs from 'fs';\n\nimport {\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n succeedSpinner,\n} from '../utils/Console';\nimport {\n getTypedFilename,\n saveJsonToFile,\n titleCase,\n} from '../utils/ExportImportUtils';\n\nconst { getRealmName } = frodo.utils;\nconst {\n createAgentExportTemplate,\n readAgents,\n readIdentityGatewayAgents,\n readJavaAgents,\n readWebAgents,\n exportAgents,\n exportIdentityGatewayAgents,\n exportJavaAgents,\n exportWebAgents,\n exportAgent,\n exportIdentityGatewayAgent,\n exportJavaAgent,\n exportWebAgent,\n importAgent,\n importIdentityGatewayAgent,\n importJavaAgent,\n importWebAgent,\n importAgents,\n importIdentityGatewayAgents,\n importJavaAgents,\n importWebAgents,\n} = frodo.agent;\n\nconst agentTypeToFileIdMap = {\n IdentityGatewayAgent: 'gateway.agent',\n J2EEAgent: 'java.agent',\n WebAgent: 'web.agent',\n};\n\n/**\n * List agents\n */\nexport async function listAgents(long = false) {\n try {\n const agents = await readAgents();\n if (long) {\n const table = createTable(['Agent Id', 'Status', 'Agent Type']);\n for (const agent of agents) {\n let status = 'Unknown';\n switch (agent._type._id) {\n case 'J2EEAgent':\n status = agent['globalJ2EEAgentConfig']['status'];\n break;\n case 'WebAgent':\n status = agent['globalWebAgentConfig']['status'];\n break;\n default:\n status = agent.status as string;\n break;\n }\n table.push([\n agent._id,\n status === 'Active' ? 'Active'['brightGreen'] : status['brightRed'],\n agent._type.name,\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n agents.forEach((agent) => {\n printMessage(`${agent._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing agents - ${error}`, 'error');\n printMessage(error.stack, 'error');\n }\n}\n\n/**\n * List identity gateway agents\n */\nexport async function listIdentityGatewayAgents(long = false) {\n try {\n const agents = await readIdentityGatewayAgents();\n if (long) {\n const table = createTable(['Gateway Agent Id', 'Status']);\n for (const agent of agents) {\n table.push([\n agent._id,\n agent.status === 'Active'\n ? 'Active'['brightGreen']\n : agent.status['brightRed'],\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n agents.forEach((agent) => {\n printMessage(`${agent._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing gateway agents - ${error}`, 'error');\n printMessage(error.stack, 'error');\n }\n}\n\n/**\n * List java agents\n */\nexport async function listJavaAgents(long = false) {\n try {\n const agents = await readJavaAgents();\n if (long) {\n const table = createTable(['Java Agent Id', 'Status']);\n for (const agent of agents) {\n table.push([\n agent._id,\n agent['globalJ2EEAgentConfig']['status'] === 'Active'\n ? 'Active'['brightGreen']\n : agent['globalJ2EEAgentConfig']['status']['brightRed'],\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n agents.forEach((agent) => {\n printMessage(`${agent._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing java agents - ${error}`, 'error');\n printMessage(error.stack, 'error');\n }\n}\n\n/**\n * List web agents\n */\nexport async function listWebAgents(long = false) {\n try {\n const agents = await readWebAgents();\n if (long) {\n const table = createTable(['Web Agent Id', 'Status']);\n for (const agent of agents) {\n table.push([\n agent._id,\n agent['globalWebAgentConfig']['status'] === 'Active'\n ? 'Active'['brightGreen']\n : agent['globalWebAgentConfig']['status']['brightRed'],\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n agents.forEach((agent) => {\n printMessage(`${agent._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing web agents - ${error}`, 'error');\n printMessage(error.stack, 'error');\n }\n}\n\n/**\n * Export all agents to file\n * @param {string} file file name\n */\nexport async function exportAgentsToFile(file) {\n const exportData = await exportAgents();\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}Agents`,\n 'agent'\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export all identity gateway agents to file\n * @param {string} file file name\n */\nexport async function exportIdentityGatewayAgentsToFile(file) {\n const exportData = await exportIdentityGatewayAgents();\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}Agents`,\n agentTypeToFileIdMap['IdentityGatewayAgent']\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export all java agents to file\n * @param {string} file file name\n */\nexport async function exportJavaAgentsToFile(file) {\n const exportData = await exportJavaAgents();\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}Agents`,\n agentTypeToFileIdMap['J2EEAgent']\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export all web agents to file\n * @param {string} file file name\n */\nexport async function exportWebAgentsToFile(file) {\n const exportData = await exportWebAgents();\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}Agents`,\n agentTypeToFileIdMap['WebAgent']\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export agent to file\n * @param {string} agentId agent id\n * @param {string} file file name\n */\nexport async function exportAgentToFile(agentId, file) {\n const exportData = await exportAgent(agentId);\n let fileName = getTypedFilename(\n agentId,\n agentTypeToFileIdMap[exportData.agents[agentId]._type._id]\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export identity gateway agent to file\n * @param {string} agentId agent id\n * @param {string} file file name\n */\nexport async function exportIdentityGatewayAgentToFile(agentId, file) {\n const exportData = await exportIdentityGatewayAgent(agentId);\n let fileName = getTypedFilename(\n agentId,\n agentTypeToFileIdMap[exportData.agents[agentId]._type._id]\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export java agent to file\n * @param {string} agentId agent id\n * @param {string} file file name\n */\nexport async function exportJavaAgentToFile(agentId, file) {\n const exportData = await exportJavaAgent(agentId);\n let fileName = getTypedFilename(\n agentId,\n agentTypeToFileIdMap[exportData.agents[agentId]._type._id]\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export web agent to file\n * @param {string} agentId agent id\n * @param {string} file file name\n */\nexport async function exportWebAgentToFile(agentId, file) {\n const exportData = await exportWebAgent(agentId);\n let fileName = getTypedFilename(\n agentId,\n agentTypeToFileIdMap[exportData.agents[agentId]._type._id]\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export all agents to separate files\n */\nexport async function exportAgentsToFiles() {\n const agents = await readAgents();\n debugMessage(`exportAgentsToFiles: ${agents.length} agents`);\n for (const agent of agents) {\n const fileName = getTypedFilename(\n agent._id,\n agentTypeToFileIdMap[agent._type._id]\n );\n const exportData = createAgentExportTemplate();\n exportData.agents[agent._id] = agent;\n debugMessage(`exportAgentsToFiles: exporting ${agent._id} to ${fileName}`);\n saveJsonToFile(exportData, fileName);\n }\n debugMessage(`exportAgentsToFiles: done.`);\n}\n\n/**\n * Export all identity gateway agents to separate files\n */\nexport async function exportIdentityGatewayAgentsToFiles() {\n const agents = await readIdentityGatewayAgents();\n for (const agent of agents) {\n const fileName = getTypedFilename(\n agent._id,\n agentTypeToFileIdMap[agent._type._id]\n );\n const exportData = createAgentExportTemplate();\n exportData.agents[agent._id] = agent;\n saveJsonToFile(exportData, fileName);\n }\n}\n\n/**\n * Export all java agents to separate files\n */\nexport async function exportJavaAgentsToFiles() {\n const agents = await readJavaAgents();\n for (const agent of agents) {\n const fileName = getTypedFilename(\n agent._id,\n agentTypeToFileIdMap[agent._type._id]\n );\n const exportData = createAgentExportTemplate();\n exportData.agents[agent._id] = agent;\n saveJsonToFile(exportData, fileName);\n }\n}\n\n/**\n * Export all web agents to separate files\n */\nexport async function exportWebAgentsToFiles() {\n const agents = await readWebAgents();\n for (const agent of agents) {\n const fileName = getTypedFilename(\n agent._id,\n agentTypeToFileIdMap[agent._type._id]\n );\n const exportData = createAgentExportTemplate();\n exportData.agents[agent._id] = agent;\n saveJsonToFile(exportData, fileName);\n }\n}\n\n/**\n * Import an agent from file\n * @param {string} agentId agent id/name\n * @param {string} file import file name\n */\nexport async function importAgentFromFile(agentId: string, file: string) {\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n let importData = JSON.parse(data);\n // check if this is a file with multiple agents and get agent by id\n if (importData.agents && importData.agents[agentId]) {\n importData = importData.agents[agentId];\n } else if (importData.agents) {\n importData = null;\n }\n // if an agentId was specified, only import the matching agent\n if (importData && agentId === importData.agents._id) {\n if (!verbose) showSpinner(`Importing ${agentId}...`);\n try {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n await importAgent(agentId, importData);\n succeedSpinner(`Imported ${agentId}.`);\n } catch (importError) {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n failSpinner(`${importError}`);\n }\n } else {\n showSpinner(`Importing ${agentId}...`);\n failSpinner(`${agentId} not found!`);\n }\n });\n}\n\n/**\n * Import first agent from file\n * @param {string} file import file name\n */\nexport async function importFirstAgentFromFile(file: string) {\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n if (Object.keys(importData.agents).length > 0) {\n for (const agent of Object.values(importData.agents)) {\n if (!verbose) showSpinner(`Importing ${agent['_id']}...`);\n try {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n await importAgent(agent['_id'], importData);\n succeedSpinner(`Imported ${agent['_id']}.`);\n } catch (importError) {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n failSpinner(`${importError}`);\n }\n return;\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No agents found!`);\n }\n });\n}\n\n/**\n * Import agents from file\n * @param {String} file file name\n */\nexport async function importAgentsFromFile(file) {\n debugMessage(`importAgentsFromFile: start`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n debugMessage(`importAgentsFromFile: importing ${file}`);\n const importData = JSON.parse(data) as AgentExportInterface;\n try {\n await importAgents(importData);\n } catch (error) {\n printMessage(`${error.message}`, 'error');\n printMessage(error.response.status, 'error');\n }\n debugMessage(`importAgentsFromFile: end`);\n });\n}\n\n/**\n * Import all agents from separate files\n */\nexport async function importAgentsFromFiles() {\n const names = fs.readdirSync('.');\n const agentFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.agent.json')\n );\n for (const file of agentFiles) {\n await importAgentsFromFile(file);\n }\n}\n\n/**\n * Import an identity gateway agent from file\n * @param {string} agentId agent id/name\n * @param {string} file import file name\n */\nexport async function importIdentityGatewayAgentFromFile(\n agentId: string,\n file: string\n) {\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n let importData = JSON.parse(data);\n // check if this is a file with multiple agents and get agent by id\n if (importData.agents && importData.agents[agentId]) {\n importData = importData.agents[agentId];\n } else if (importData.agents) {\n importData = null;\n }\n // if an agentId was specified, only import the matching agent\n if (importData && agentId === importData.agents._id) {\n if (!verbose) showSpinner(`Importing ${agentId}...`);\n try {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n await importIdentityGatewayAgent(agentId, importData);\n succeedSpinner(`Imported ${agentId}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n } else {\n showSpinner(`Importing ${agentId}...`);\n failSpinner(`${agentId} not found!`);\n }\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentFromFile: end`);\n });\n}\n\n/**\n * Import first identity gateway agent from file\n * @param {string} file import file name\n */\nexport async function importFirstIdentityGatewayAgentFromFile(file: string) {\n debugMessage(`cli.AgentOps.importFirstIdentityGatewayAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n if (Object.keys(importData.agents).length > 0) {\n for (const agent of Object.values(importData.agents)) {\n if (!verbose) showSpinner(`Importing ${agent['_id']}...`);\n try {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n await importIdentityGatewayAgent(agent['_id'], importData);\n succeedSpinner(`Imported ${agent['_id']}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n return;\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No agents found!`);\n }\n debugMessage(`cli.AgentOps.importFirstIdentityGatewayAgentFromFile: end`);\n });\n}\n\n/**\n * Import identity gateway agents from file\n * @param {String} file file name\n */\nexport async function importIdentityGatewayAgentsFromFile(file) {\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentsFromFile: start`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n debugMessage(\n `cli.AgentOps.importIdentityGatewayAgentsFromFile: importing ${file}`\n );\n const importData = JSON.parse(data) as AgentExportInterface;\n try {\n await importIdentityGatewayAgents(importData);\n } catch (error) {\n printMessage(`${error.message}`, 'error');\n printMessage(error.response.status, 'error');\n }\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentsFromFile: end`);\n });\n}\n\n/**\n * Import all identity gateway agents from separate files\n */\nexport async function importIdentityGatewayAgentsFromFiles() {\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentsFromFiles: start`);\n const names = fs.readdirSync('.');\n const agentFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.agent.json')\n );\n for (const file of agentFiles) {\n await importIdentityGatewayAgentsFromFile(file);\n }\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentsFromFiles: end`);\n}\n\n/**\n * Import an java agent from file\n * @param {string} agentId agent id/name\n * @param {string} file import file name\n */\nexport async function importJavaAgentFromFile(agentId: string, file: string) {\n debugMessage(`cli.AgentOps.importJavaAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n let importData = JSON.parse(data);\n // check if this is a file with multiple agents and get agent by id\n if (importData.agents && importData.agents[agentId]) {\n importData = importData.agents[agentId];\n } else if (importData.agents) {\n importData = null;\n }\n // if an agentId was specified, only import the matching agent\n if (importData && agentId === importData.agents._id) {\n if (!verbose) showSpinner(`Importing ${agentId}...`);\n try {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n await importJavaAgent(agentId, importData);\n succeedSpinner(`Imported ${agentId}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n } else {\n showSpinner(`Importing ${agentId}...`);\n failSpinner(`${agentId} not found!`);\n }\n debugMessage(`cli.AgentOps.importJavaAgentFromFile: end`);\n });\n}\n\n/**\n * Import first java agent from file\n * @param {string} file import file name\n */\nexport async function importFirstJavaAgentFromFile(file: string) {\n debugMessage(`cli.AgentOps.importFirstJavaAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n if (Object.keys(importData.agents).length > 0) {\n for (const agent of Object.values(importData.agents)) {\n if (!verbose) showSpinner(`Importing ${agent['_id']}...`);\n try {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n await importJavaAgent(agent['_id'], importData);\n succeedSpinner(`Imported ${agent['_id']}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n return;\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No agents found!`);\n }\n debugMessage(`cli.AgentOps.importFirstJavaAgentFromFile: end`);\n });\n}\n\n/**\n * Import java agents from file\n * @param {String} file file name\n */\nexport async function importJavaAgentsFromFile(file) {\n debugMessage(`cli.AgentOps.importJavaAgentsFromFile: start`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n debugMessage(`cli.AgentOps.importJavaAgentsFromFile: importing ${file}`);\n const importData = JSON.parse(data) as AgentExportInterface;\n try {\n await importJavaAgents(importData);\n } catch (error) {\n printMessage(`${error.message}`, 'error');\n printMessage(error.response.status, 'error');\n }\n debugMessage(`cli.AgentOps.importJavaAgentsFromFile: end`);\n });\n}\n\n/**\n * Import all java agents from separate files\n */\nexport async function importJavaAgentsFromFiles() {\n debugMessage(`cli.AgentOps.importJavaAgentsFromFiles: start`);\n const names = fs.readdirSync('.');\n const agentFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.agent.json')\n );\n for (const file of agentFiles) {\n await importJavaAgentsFromFile(file);\n }\n debugMessage(`cli.AgentOps.importJavaAgentsFromFiles: end`);\n}\n\n/**\n * Import an web agent from file\n * @param {string} agentId agent id/name\n * @param {string} file import file name\n */\nexport async function importWebAgentFromFile(agentId: string, file: string) {\n debugMessage(`cli.AgentOps.importWebAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n let importData = JSON.parse(data);\n // check if this is a file with multiple agents and get agent by id\n if (importData.agents && importData.agents[agentId]) {\n importData = importData.agents[agentId];\n } else if (importData.agents) {\n importData = null;\n }\n // if an agentId was specified, only import the matching agent\n if (importData && agentId === importData.agents._id) {\n if (!verbose) showSpinner(`Importing ${agentId}...`);\n try {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n await importWebAgent(agentId, importData);\n succeedSpinner(`Imported ${agentId}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n } else {\n showSpinner(`Importing ${agentId}...`);\n failSpinner(`${agentId} not found!`);\n }\n debugMessage(`cli.AgentOps.importWebAgentFromFile: end`);\n });\n}\n\n/**\n * Import web gateway agent from file\n * @param {string} file import file name\n */\nexport async function importFirstWebAgentFromFile(file: string) {\n debugMessage(`cli.AgentOps.importFirstWebAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n if (Object.keys(importData.agents).length > 0) {\n for (const agent of Object.values(importData.agents)) {\n if (!verbose) showSpinner(`Importing ${agent['_id']}...`);\n try {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n await importWebAgent(agent['_id'], importData);\n succeedSpinner(`Imported ${agent['_id']}.`);\n } catch (importError) {\n failSpinner(`caught it here ${importError}`);\n }\n break;\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No agents found!`);\n }\n debugMessage(`cli.AgentOps.importFirstWebAgentFromFile: end`);\n });\n}\n\n/**\n * Import web agents from file\n * @param {String} file file name\n */\nexport async function importWebAgentsFromFile(file) {\n debugMessage(`cli.AgentOps.importWebAgentsFromFile: start`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n debugMessage(`cli.AgentOps.importWebAgentsFromFile: importing ${file}`);\n const importData = JSON.parse(data) as AgentExportInterface;\n try {\n await importWebAgents(importData);\n } catch (error) {\n printMessage(`${error.message}`, 'error');\n printMessage(error.response.status, 'error');\n }\n debugMessage(`cli.AgentOps.importWebAgentsFromFile: end`);\n });\n}\n\n/**\n * Import all web agents from separate files\n */\nexport async function importWebAgentsFromFiles() {\n debugMessage(`cli.AgentOps.importWebAgentsFromFiles: start`);\n const names = fs.readdirSync('.');\n const agentFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.agent.json')\n );\n for (const file of agentFiles) {\n await importWebAgentsFromFile(file);\n }\n debugMessage(`cli.AgentOps.importWebAgentsFromFiles: end`);\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAEpD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,cAAc,QACT,kBAAkB;AACzB,SACEC,gBAAgB,EAChBC,cAAc,EACdC,SAAS,QACJ,4BAA4B;AAEnC,MAAM;EAAEC;AAAa,CAAC,GAAGZ,KAAK,CAAC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;;AAEA;AACA;AACA;AACA;AACA,OAAO,eAAewG,uBAAuBA,CAACnD,IAAI,EAAE;EAClDrD,YAAY,CAAE,6CAA4C,CAAC;EAC3DF,EAAE,CAAC2E,QAAQ,CAACpB,IAAI,EAAE,MAAM,EAAE,OAAOqB,GAAG,EAAEC,IAAI,KAAK;IAC7C,IAAID,GAAG,EAAE,MAAMA,GAAG;IAClB1E,YAAY,CAAE,mDAAkDqD,IAAK,EAAC,CAAC;IACvE,MAAMuB,UAAU,GAAGC,IAAI,CAACC,KAAK,CAACH,IAAI,CAAyB;IAC3D,IAAI;MACF,MAAM7C,eAAe,CAAC8C,UAAU,CAAC;IACnC,CAAC,CAAC,OAAO7B,KAAK,EAAE;MACd7C,YAAY,CAAE,GAAE6C,KAAK,CAACsC,OAAQ,EAAC,EAAE,OAAO,CAAC;MACzCnF,YAAY,CAAC6C,KAAK,CAACuC,QAAQ,CAAC9C,MAAM,EAAE,OAAO,CAAC;IAC9C;IACAxC,YAAY,CAAE,2CAA0C,CAAC;EAC3D,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA,OAAO,eAAeyG,wBAAwBA,CAAA,EAAG;EAC/CzG,YAAY,CAAE,8CAA6C,CAAC;EAC5D,MAAMwF,KAAK,GAAG1F,EAAE,CAAC2F,WAAW,CAAC,GAAG,CAAC;EACjC,MAAMC,UAAU,GAAGF,KAAK,CAACG,MAAM,CAAE/C,IAAI,IACnCA,IAAI,CAACgD,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,aAAa,CAC3C,CAAC;EACD,KAAK,MAAMxC,IAAI,IAAIqC,UAAU,EAAE;IAC7B,MAAMc,uBAAuB,CAACnD,IAAI,CAAC;EACrC;EACArD,YAAY,CAAE,4CAA2C,CAAC;AAC5D"}
1
+ {"version":3,"file":"AgentOps.js","names":["frodo","state","fs","createTable","debugMessage","failSpinner","printMessage","showSpinner","succeedSpinner","getTypedFilename","saveJsonToFile","titleCase","getRealmName","utils","createAgentExportTemplate","readAgents","readIdentityGatewayAgents","readJavaAgents","readWebAgents","exportAgents","exportIdentityGatewayAgents","exportJavaAgents","exportWebAgents","exportAgent","exportIdentityGatewayAgent","exportJavaAgent","exportWebAgent","importAgent","importIdentityGatewayAgent","importJavaAgent","importWebAgent","importAgents","importIdentityGatewayAgents","importJavaAgents","importWebAgents","agent","agentTypeToFileIdMap","IdentityGatewayAgent","J2EEAgent","WebAgent","listAgents","long","agents","table","status","_type","_id","push","name","toString","forEach","error","stack","listIdentityGatewayAgents","listJavaAgents","listWebAgents","exportAgentsToFile","file","exportData","fileName","getRealm","exportIdentityGatewayAgentsToFile","exportJavaAgentsToFile","exportWebAgentsToFile","exportAgentToFile","agentId","exportIdentityGatewayAgentToFile","exportJavaAgentToFile","exportWebAgentToFile","exportAgentsToFiles","length","exportIdentityGatewayAgentsToFiles","exportJavaAgentsToFiles","exportWebAgentsToFiles","importAgentFromFile","verbose","getVerbose","readFile","err","data","importData","JSON","parse","importError","importFirstAgentFromFile","Object","keys","values","importAgentsFromFile","message","response","importAgentsFromFiles","names","readdirSync","agentFiles","filter","toLowerCase","endsWith","importIdentityGatewayAgentFromFile","importFirstIdentityGatewayAgentFromFile","importIdentityGatewayAgentsFromFile","importIdentityGatewayAgentsFromFiles","importJavaAgentFromFile","importFirstJavaAgentFromFile","importJavaAgentsFromFile","importJavaAgentsFromFiles","importWebAgentFromFile","importFirstWebAgentFromFile","importWebAgentsFromFile","importWebAgentsFromFiles"],"sources":["../../src/ops/AgentOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { type AgentExportInterface } from '@rockcarver/frodo-lib/types/ops/AgentOps';\nimport fs from 'fs';\n\nimport {\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n succeedSpinner,\n} from '../utils/Console';\nimport {\n getTypedFilename,\n saveJsonToFile,\n titleCase,\n} from '../utils/ExportImportUtils';\n\nconst { getRealmName } = frodo.utils;\nconst {\n createAgentExportTemplate,\n readAgents,\n readIdentityGatewayAgents,\n readJavaAgents,\n readWebAgents,\n exportAgents,\n exportIdentityGatewayAgents,\n exportJavaAgents,\n exportWebAgents,\n exportAgent,\n exportIdentityGatewayAgent,\n exportJavaAgent,\n exportWebAgent,\n importAgent,\n importIdentityGatewayAgent,\n importJavaAgent,\n importWebAgent,\n importAgents,\n importIdentityGatewayAgents,\n importJavaAgents,\n importWebAgents,\n} = frodo.agent;\n\nconst agentTypeToFileIdMap = {\n IdentityGatewayAgent: 'gateway.agent',\n J2EEAgent: 'java.agent',\n WebAgent: 'web.agent',\n};\n\n/**\n * List agents\n */\nexport async function listAgents(long = false) {\n try {\n const agents = await readAgents();\n if (long) {\n const table = createTable(['Agent Id', 'Status', 'Agent Type']);\n for (const agent of agents) {\n let status = 'Unknown';\n switch (agent._type._id) {\n case 'J2EEAgent':\n status = agent['globalJ2EEAgentConfig']['status'];\n break;\n case 'WebAgent':\n status = agent['globalWebAgentConfig']['status'];\n break;\n default:\n status = agent.status as string;\n break;\n }\n table.push([\n agent._id,\n status === 'Active' ? 'Active'['brightGreen'] : status['brightRed'],\n agent._type.name,\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n agents.forEach((agent) => {\n printMessage(`${agent._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing agents - ${error}`, 'error');\n printMessage(error.stack, 'error');\n }\n}\n\n/**\n * List identity gateway agents\n */\nexport async function listIdentityGatewayAgents(long = false) {\n try {\n const agents = await readIdentityGatewayAgents();\n if (long) {\n const table = createTable(['Gateway Agent Id', 'Status']);\n for (const agent of agents) {\n table.push([\n agent._id,\n agent.status === 'Active'\n ? 'Active'['brightGreen']\n : agent.status['brightRed'],\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n agents.forEach((agent) => {\n printMessage(`${agent._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing gateway agents - ${error}`, 'error');\n printMessage(error.stack, 'error');\n }\n}\n\n/**\n * List java agents\n */\nexport async function listJavaAgents(long = false) {\n try {\n const agents = await readJavaAgents();\n if (long) {\n const table = createTable(['Java Agent Id', 'Status']);\n for (const agent of agents) {\n table.push([\n agent._id,\n agent['globalJ2EEAgentConfig']['status'] === 'Active'\n ? 'Active'['brightGreen']\n : agent['globalJ2EEAgentConfig']['status']['brightRed'],\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n agents.forEach((agent) => {\n printMessage(`${agent._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing java agents - ${error}`, 'error');\n printMessage(error.stack, 'error');\n }\n}\n\n/**\n * List web agents\n */\nexport async function listWebAgents(long = false) {\n try {\n const agents = await readWebAgents();\n if (long) {\n const table = createTable(['Web Agent Id', 'Status']);\n for (const agent of agents) {\n table.push([\n agent._id,\n agent['globalWebAgentConfig']['status'] === 'Active'\n ? 'Active'['brightGreen']\n : agent['globalWebAgentConfig']['status']['brightRed'],\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n agents.forEach((agent) => {\n printMessage(`${agent._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing web agents - ${error}`, 'error');\n printMessage(error.stack, 'error');\n }\n}\n\n/**\n * Export all agents to file\n * @param {string} file file name\n */\nexport async function exportAgentsToFile(file) {\n const exportData = await exportAgents();\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}Agents`,\n 'agent'\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export all identity gateway agents to file\n * @param {string} file file name\n */\nexport async function exportIdentityGatewayAgentsToFile(file) {\n const exportData = await exportIdentityGatewayAgents();\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}Agents`,\n agentTypeToFileIdMap['IdentityGatewayAgent']\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export all java agents to file\n * @param {string} file file name\n */\nexport async function exportJavaAgentsToFile(file) {\n const exportData = await exportJavaAgents();\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}Agents`,\n agentTypeToFileIdMap['J2EEAgent']\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export all web agents to file\n * @param {string} file file name\n */\nexport async function exportWebAgentsToFile(file) {\n const exportData = await exportWebAgents();\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}Agents`,\n agentTypeToFileIdMap['WebAgent']\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export agent to file\n * @param {string} agentId agent id\n * @param {string} file file name\n */\nexport async function exportAgentToFile(agentId, file) {\n const exportData = await exportAgent(agentId);\n let fileName = getTypedFilename(\n agentId,\n agentTypeToFileIdMap[exportData.agents[agentId]._type._id]\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export identity gateway agent to file\n * @param {string} agentId agent id\n * @param {string} file file name\n */\nexport async function exportIdentityGatewayAgentToFile(agentId, file) {\n const exportData = await exportIdentityGatewayAgent(agentId);\n let fileName = getTypedFilename(\n agentId,\n agentTypeToFileIdMap[exportData.agents[agentId]._type._id]\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export java agent to file\n * @param {string} agentId agent id\n * @param {string} file file name\n */\nexport async function exportJavaAgentToFile(agentId, file) {\n const exportData = await exportJavaAgent(agentId);\n let fileName = getTypedFilename(\n agentId,\n agentTypeToFileIdMap[exportData.agents[agentId]._type._id]\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export web agent to file\n * @param {string} agentId agent id\n * @param {string} file file name\n */\nexport async function exportWebAgentToFile(agentId, file) {\n const exportData = await exportWebAgent(agentId);\n let fileName = getTypedFilename(\n agentId,\n agentTypeToFileIdMap[exportData.agents[agentId]._type._id]\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, fileName);\n}\n\n/**\n * Export all agents to separate files\n */\nexport async function exportAgentsToFiles() {\n const agents = await readAgents();\n debugMessage(`exportAgentsToFiles: ${agents.length} agents`);\n for (const agent of agents) {\n const fileName = getTypedFilename(\n agent._id,\n agentTypeToFileIdMap[agent._type._id]\n );\n const exportData = createAgentExportTemplate();\n exportData.agents[agent._id] = agent;\n debugMessage(`exportAgentsToFiles: exporting ${agent._id} to ${fileName}`);\n saveJsonToFile(exportData, fileName);\n }\n debugMessage(`exportAgentsToFiles: done.`);\n}\n\n/**\n * Export all identity gateway agents to separate files\n */\nexport async function exportIdentityGatewayAgentsToFiles() {\n const agents = await readIdentityGatewayAgents();\n for (const agent of agents) {\n const fileName = getTypedFilename(\n agent._id,\n agentTypeToFileIdMap[agent._type._id]\n );\n const exportData = createAgentExportTemplate();\n exportData.agents[agent._id] = agent;\n saveJsonToFile(exportData, fileName);\n }\n}\n\n/**\n * Export all java agents to separate files\n */\nexport async function exportJavaAgentsToFiles() {\n const agents = await readJavaAgents();\n for (const agent of agents) {\n const fileName = getTypedFilename(\n agent._id,\n agentTypeToFileIdMap[agent._type._id]\n );\n const exportData = createAgentExportTemplate();\n exportData.agents[agent._id] = agent;\n saveJsonToFile(exportData, fileName);\n }\n}\n\n/**\n * Export all web agents to separate files\n */\nexport async function exportWebAgentsToFiles() {\n const agents = await readWebAgents();\n for (const agent of agents) {\n const fileName = getTypedFilename(\n agent._id,\n agentTypeToFileIdMap[agent._type._id]\n );\n const exportData = createAgentExportTemplate();\n exportData.agents[agent._id] = agent;\n saveJsonToFile(exportData, fileName);\n }\n}\n\n/**\n * Import an agent from file\n * @param {string} agentId agent id/name\n * @param {string} file import file name\n */\nexport async function importAgentFromFile(agentId: string, file: string) {\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n // check if this is a file with multiple agents and get agent by id\n if (importData.agents && importData.agents[agentId]) {\n const agent = importData.agents[agentId];\n importData.agents = {};\n importData.agents[agentId] = agent;\n } else if (importData.agents) {\n importData.agents = null;\n }\n // if an agentId was specified, only import the matching agent\n if (importData.agents) {\n if (!verbose) showSpinner(`Importing ${agentId}...`);\n try {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n await importAgent(agentId, importData);\n succeedSpinner(`Imported ${agentId}.`);\n } catch (importError) {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n failSpinner(`${importError}`);\n }\n } else {\n showSpinner(`Importing ${agentId}...`);\n failSpinner(`${agentId} not found!`);\n }\n });\n}\n\n/**\n * Import first agent from file\n * @param {string} file import file name\n */\nexport async function importFirstAgentFromFile(file: string) {\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n if (Object.keys(importData.agents).length > 0) {\n for (const agent of Object.values(importData.agents)) {\n if (!verbose) showSpinner(`Importing ${agent['_id']}...`);\n try {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n await importAgent(agent['_id'], importData);\n succeedSpinner(`Imported ${agent['_id']}.`);\n } catch (importError) {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n failSpinner(`${importError}`);\n }\n return;\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No agents found!`);\n }\n });\n}\n\n/**\n * Import agents from file\n * @param {String} file file name\n */\nexport async function importAgentsFromFile(file) {\n debugMessage(`importAgentsFromFile: start`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n debugMessage(`importAgentsFromFile: importing ${file}`);\n const importData = JSON.parse(data) as AgentExportInterface;\n try {\n await importAgents(importData);\n } catch (error) {\n printMessage(`${error.message}`, 'error');\n printMessage(error.response.status, 'error');\n }\n debugMessage(`importAgentsFromFile: end`);\n });\n}\n\n/**\n * Import all agents from separate files\n */\nexport async function importAgentsFromFiles() {\n const names = fs.readdirSync('.');\n const agentFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.agent.json')\n );\n for (const file of agentFiles) {\n await importAgentsFromFile(file);\n }\n}\n\n/**\n * Import an identity gateway agent from file\n * @param {string} agentId agent id/name\n * @param {string} file import file name\n */\nexport async function importIdentityGatewayAgentFromFile(\n agentId: string,\n file: string\n) {\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n // check if this is a file with multiple agents and get agent by id\n if (importData.agents && importData.agents[agentId]) {\n const agent = importData.agents[agentId];\n importData.agents = {};\n importData.agents[agentId] = agent;\n } else if (importData.agents) {\n importData.agents = null;\n }\n // if an agentId was specified, only import the matching agent\n if (importData.agents) {\n if (!verbose) showSpinner(`Importing ${agentId}...`);\n try {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n await importIdentityGatewayAgent(agentId, importData);\n succeedSpinner(`Imported ${agentId}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n } else {\n showSpinner(`Importing ${agentId}...`);\n failSpinner(`${agentId} not found!`);\n }\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentFromFile: end`);\n });\n}\n\n/**\n * Import first identity gateway agent from file\n * @param {string} file import file name\n */\nexport async function importFirstIdentityGatewayAgentFromFile(file: string) {\n debugMessage(`cli.AgentOps.importFirstIdentityGatewayAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n if (Object.keys(importData.agents).length > 0) {\n for (const agent of Object.values(importData.agents)) {\n if (!verbose) showSpinner(`Importing ${agent['_id']}...`);\n try {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n await importIdentityGatewayAgent(agent['_id'], importData);\n succeedSpinner(`Imported ${agent['_id']}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n return;\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No agents found!`);\n }\n debugMessage(`cli.AgentOps.importFirstIdentityGatewayAgentFromFile: end`);\n });\n}\n\n/**\n * Import identity gateway agents from file\n * @param {String} file file name\n */\nexport async function importIdentityGatewayAgentsFromFile(file) {\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentsFromFile: start`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n debugMessage(\n `cli.AgentOps.importIdentityGatewayAgentsFromFile: importing ${file}`\n );\n const importData = JSON.parse(data) as AgentExportInterface;\n try {\n await importIdentityGatewayAgents(importData);\n } catch (error) {\n printMessage(`${error.message}`, 'error');\n printMessage(error.response.status, 'error');\n }\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentsFromFile: end`);\n });\n}\n\n/**\n * Import all identity gateway agents from separate files\n */\nexport async function importIdentityGatewayAgentsFromFiles() {\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentsFromFiles: start`);\n const names = fs.readdirSync('.');\n const agentFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.agent.json')\n );\n for (const file of agentFiles) {\n await importIdentityGatewayAgentsFromFile(file);\n }\n debugMessage(`cli.AgentOps.importIdentityGatewayAgentsFromFiles: end`);\n}\n\n/**\n * Import an java agent from file\n * @param {string} agentId agent id/name\n * @param {string} file import file name\n */\nexport async function importJavaAgentFromFile(agentId: string, file: string) {\n debugMessage(`cli.AgentOps.importJavaAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n // check if this is a file with multiple agents and get agent by id\n if (importData.agents && importData.agents[agentId]) {\n const agent = importData.agents[agentId];\n importData.agents = {};\n importData.agents[agentId] = agent;\n } else if (importData.agents) {\n importData.agents = null;\n }\n // if an agentId was specified, only import the matching agent\n if (importData.agents) {\n if (!verbose) showSpinner(`Importing ${agentId}...`);\n try {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n await importJavaAgent(agentId, importData);\n succeedSpinner(`Imported ${agentId}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n } else {\n showSpinner(`Importing ${agentId}...`);\n failSpinner(`${agentId} not found!`);\n }\n debugMessage(`cli.AgentOps.importJavaAgentFromFile: end`);\n });\n}\n\n/**\n * Import first java agent from file\n * @param {string} file import file name\n */\nexport async function importFirstJavaAgentFromFile(file: string) {\n debugMessage(`cli.AgentOps.importFirstJavaAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n if (Object.keys(importData.agents).length > 0) {\n for (const agent of Object.values(importData.agents)) {\n if (!verbose) showSpinner(`Importing ${agent['_id']}...`);\n try {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n await importJavaAgent(agent['_id'], importData);\n succeedSpinner(`Imported ${agent['_id']}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n return;\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No agents found!`);\n }\n debugMessage(`cli.AgentOps.importFirstJavaAgentFromFile: end`);\n });\n}\n\n/**\n * Import java agents from file\n * @param {String} file file name\n */\nexport async function importJavaAgentsFromFile(file) {\n debugMessage(`cli.AgentOps.importJavaAgentsFromFile: start`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n debugMessage(`cli.AgentOps.importJavaAgentsFromFile: importing ${file}`);\n const importData = JSON.parse(data) as AgentExportInterface;\n try {\n await importJavaAgents(importData);\n } catch (error) {\n printMessage(`${error.message}`, 'error');\n printMessage(error.response.status, 'error');\n }\n debugMessage(`cli.AgentOps.importJavaAgentsFromFile: end`);\n });\n}\n\n/**\n * Import all java agents from separate files\n */\nexport async function importJavaAgentsFromFiles() {\n debugMessage(`cli.AgentOps.importJavaAgentsFromFiles: start`);\n const names = fs.readdirSync('.');\n const agentFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.agent.json')\n );\n for (const file of agentFiles) {\n await importJavaAgentsFromFile(file);\n }\n debugMessage(`cli.AgentOps.importJavaAgentsFromFiles: end`);\n}\n\n/**\n * Import an web agent from file\n * @param {string} agentId agent id/name\n * @param {string} file import file name\n */\nexport async function importWebAgentFromFile(agentId: string, file: string) {\n debugMessage(`cli.AgentOps.importWebAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n // check if this is a file with multiple agents and get agent by id\n if (importData.agents && importData.agents[agentId]) {\n const agent = importData.agents[agentId];\n importData.agents = {};\n importData.agents[agentId] = agent;\n } else if (importData.agents) {\n importData.agents = null;\n }\n // if an agentId was specified, only import the matching agent\n if (importData.agents) {\n if (!verbose) showSpinner(`Importing ${agentId}...`);\n try {\n if (verbose) showSpinner(`Importing ${agentId}...`);\n await importWebAgent(agentId, importData);\n succeedSpinner(`Imported ${agentId}.`);\n } catch (importError) {\n failSpinner(`${importError}`);\n }\n } else {\n showSpinner(`Importing ${agentId}...`);\n failSpinner(`${agentId} not found!`);\n }\n debugMessage(`cli.AgentOps.importWebAgentFromFile: end`);\n });\n}\n\n/**\n * Import web gateway agent from file\n * @param {string} file import file name\n */\nexport async function importFirstWebAgentFromFile(file: string) {\n debugMessage(`cli.AgentOps.importFirstWebAgentFromFile: start`);\n const verbose = state.getVerbose();\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n const importData = JSON.parse(data);\n if (Object.keys(importData.agents).length > 0) {\n for (const agent of Object.values(importData.agents)) {\n if (!verbose) showSpinner(`Importing ${agent['_id']}...`);\n try {\n if (verbose) showSpinner(`Importing ${agent['_id']}...`);\n await importWebAgent(agent['_id'], importData);\n succeedSpinner(`Imported ${agent['_id']}.`);\n } catch (importError) {\n failSpinner(`caught it here ${importError}`);\n }\n break;\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No agents found!`);\n }\n debugMessage(`cli.AgentOps.importFirstWebAgentFromFile: end`);\n });\n}\n\n/**\n * Import web agents from file\n * @param {String} file file name\n */\nexport async function importWebAgentsFromFile(file) {\n debugMessage(`cli.AgentOps.importWebAgentsFromFile: start`);\n fs.readFile(file, 'utf8', async (err, data) => {\n if (err) throw err;\n debugMessage(`cli.AgentOps.importWebAgentsFromFile: importing ${file}`);\n const importData = JSON.parse(data) as AgentExportInterface;\n try {\n await importWebAgents(importData);\n } catch (error) {\n printMessage(`${error.message}`, 'error');\n printMessage(error.response.status, 'error');\n }\n debugMessage(`cli.AgentOps.importWebAgentsFromFile: end`);\n });\n}\n\n/**\n * Import all web agents from separate files\n */\nexport async function importWebAgentsFromFiles() {\n debugMessage(`cli.AgentOps.importWebAgentsFromFiles: start`);\n const names = fs.readdirSync('.');\n const agentFiles = names.filter((name) =>\n name.toLowerCase().endsWith('.agent.json')\n );\n for (const file of agentFiles) {\n await importWebAgentsFromFile(file);\n }\n debugMessage(`cli.AgentOps.importWebAgentsFromFiles: end`);\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAEpD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,cAAc,QACT,kBAAkB;AACzB,SACEC,gBAAgB,EAChBC,cAAc,EACdC,SAAS,QACJ,4BAA4B;AAEnC,MAAM;EAAEC;AAAa,CAAC,GAAGZ,KAAK,CAACa,KAAK;AACpC,MAAM;EACJC,yBAAyB;EACzBC,UAAU;EACVC,yBAAyB;EACzBC,cAAc;EACdC,aAAa;EACbC,YAAY;EACZC,2BAA2B;EAC3BC,gBAAgB;EAChBC,eAAe;EACfC,WAAW;EACXC,0BAA0B;EAC1BC,eAAe;EACfC,cAAc;EACdC,WAAW;EACXC,0BAA0B;EAC1BC,eAAe;EACfC,cAAc;EACdC,YAAY;EACZC,2BAA2B;EAC3BC,gBAAgB;EAChBC;AACF,CAAC,GAAGlC,KAAK,CAACmC,KAAK;AAEf,MAAMC,oBAAoB,GAAG;EAC3BC,oBAAoB,EAAE,eAAe;EACrCC,SAAS,EAAE,YAAY;EACvBC,QAAQ,EAAE;AACZ,CAAC;;AAED;A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CAAC;EAC3DF,EAAE,CAAC2E,QAAQ,CAACpB,IAAI,EAAE,MAAM,EAAE,OAAOqB,GAAG,EAAEC,IAAI,KAAK;IAC7C,IAAID,GAAG,EAAE,MAAMA,GAAG;IAClB1E,YAAY,CAAE,mDAAkDqD,IAAK,EAAC,CAAC;IACvE,MAAMuB,UAAU,GAAGC,IAAI,CAACC,KAAK,CAACH,IAAI,CAAyB;IAC3D,IAAI;MACF,MAAM7C,eAAe,CAAC8C,UAAU,CAAC;IACnC,CAAC,CAAC,OAAO7B,KAAK,EAAE;MACd7C,YAAY,CAAE,GAAE6C,KAAK,CAACsC,OAAQ,EAAC,EAAE,OAAO,CAAC;MACzCnF,YAAY,CAAC6C,KAAK,CAACuC,QAAQ,CAAC9C,MAAM,EAAE,OAAO,CAAC;IAC9C;IACAxC,YAAY,CAAE,2CAA0C,CAAC;EAC3D,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA,OAAO,eAAeyG,wBAAwBA,CAAA,EAAG;EAC/CzG,YAAY,CAAE,8CAA6C,CAAC;EAC5D,MAAMwF,KAAK,GAAG1F,EAAE,CAAC2F,WAAW,CAAC,GAAG,CAAC;EACjC,MAAMC,UAAU,GAAGF,KAAK,CAACG,MAAM,CAAE/C,IAAI,IACnCA,IAAI,CAACgD,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,aAAa,CAC3C,CAAC;EACD,KAAK,MAAMxC,IAAI,IAAIqC,UAAU,EAAE;IAC7B,MAAMc,uBAAuB,CAACnD,IAAI,CAAC;EACrC;EACArD,YAAY,CAAE,4CAA2C,CAAC;AAC5D"}
@@ -231,7 +231,7 @@ export async function importCirclesOfTrustFromFiles() {
231
231
  try {
232
232
  debugMessage(`cli.CirclesOfTrustOps.importCirclesOfTrustFromFiles: begin`);
233
233
  const names = fs.readdirSync('.');
234
- const files = names.filter(name => name.toLowerCase().endsWith('.policy.authz.json'));
234
+ const files = names.filter(name => name.toLowerCase().endsWith('.cot.saml.json'));
235
235
  createProgressBar(files.length, 'Importing circles of trust...');
236
236
  let total = 0;
237
237
  for (const file of files) {