@rockcarver/frodo-cli 0.18.2-1 → 0.18.2-2

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.
Files changed (127) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/esm/app.js +2 -0
  3. package/esm/app.js.map +1 -1
  4. package/esm/cli/_template/something-delete.js +25 -0
  5. package/esm/cli/_template/something-delete.js.map +1 -0
  6. package/esm/cli/_template/something-describe.js +25 -0
  7. package/esm/cli/_template/something-describe.js.map +1 -0
  8. package/esm/cli/_template/something-else-delete.js +25 -0
  9. package/esm/cli/_template/something-else-delete.js.map +1 -0
  10. package/esm/cli/_template/something-else-describe.js +25 -0
  11. package/esm/cli/_template/something-else-describe.js.map +1 -0
  12. package/esm/cli/_template/something-else-export.js +25 -0
  13. package/esm/cli/_template/something-else-export.js.map +1 -0
  14. package/esm/cli/_template/something-else-import.js +25 -0
  15. package/esm/cli/_template/something-else-import.js.map +1 -0
  16. package/esm/cli/_template/something-else-list.js +25 -0
  17. package/esm/cli/_template/something-else-list.js.map +1 -0
  18. package/esm/cli/_template/something-else.js +10 -0
  19. package/esm/cli/_template/something-else.js.map +1 -0
  20. package/esm/cli/_template/something-export.js +25 -0
  21. package/esm/cli/_template/something-export.js.map +1 -0
  22. package/esm/cli/_template/something-import.js +25 -0
  23. package/esm/cli/_template/something-import.js.map +1 -0
  24. package/esm/cli/_template/something-list.js +25 -0
  25. package/esm/cli/_template/something-list.js.map +1 -0
  26. package/esm/cli/_template/something-other-delete.js +25 -0
  27. package/esm/cli/_template/something-other-delete.js.map +1 -0
  28. package/esm/cli/_template/something-other-describe.js +25 -0
  29. package/esm/cli/_template/something-other-describe.js.map +1 -0
  30. package/esm/cli/_template/something-other-export.js +25 -0
  31. package/esm/cli/_template/something-other-export.js.map +1 -0
  32. package/esm/cli/_template/something-other-import.js +25 -0
  33. package/esm/cli/_template/something-other-import.js.map +1 -0
  34. package/esm/cli/_template/{cmd-export.js → something-other-list.js} +6 -3
  35. package/esm/cli/_template/something-other-list.js.map +1 -0
  36. package/esm/cli/_template/something-other.js +10 -0
  37. package/esm/cli/_template/something-other.js.map +1 -0
  38. package/esm/cli/_template/something.js +19 -0
  39. package/esm/cli/_template/something.js.map +1 -0
  40. package/esm/cli/agent/agent-delete.js +57 -0
  41. package/esm/cli/agent/agent-delete.js.map +1 -0
  42. package/esm/cli/{_template/cmd-describe.js → agent/agent-describe.js} +5 -2
  43. package/esm/cli/agent/agent-describe.js.map +1 -0
  44. package/esm/cli/agent/agent-export.js +44 -0
  45. package/esm/cli/agent/agent-export.js.map +1 -0
  46. package/esm/cli/agent/agent-gateway-delete.js +57 -0
  47. package/esm/cli/agent/agent-gateway-delete.js.map +1 -0
  48. package/esm/cli/agent/agent-gateway-describe.js +25 -0
  49. package/esm/cli/agent/agent-gateway-describe.js.map +1 -0
  50. package/esm/cli/agent/agent-gateway-export.js +44 -0
  51. package/esm/cli/agent/agent-gateway-export.js.map +1 -0
  52. package/esm/cli/agent/agent-gateway-import.js +48 -0
  53. package/esm/cli/agent/agent-gateway-import.js.map +1 -0
  54. package/esm/cli/agent/agent-gateway-list.js +27 -0
  55. package/esm/cli/agent/agent-gateway-list.js.map +1 -0
  56. package/esm/cli/agent/agent-gateway.js +10 -0
  57. package/esm/cli/agent/agent-gateway.js.map +1 -0
  58. package/esm/cli/agent/agent-import.js +48 -0
  59. package/esm/cli/agent/agent-import.js.map +1 -0
  60. package/esm/cli/agent/agent-java-delete.js +57 -0
  61. package/esm/cli/agent/agent-java-delete.js.map +1 -0
  62. package/esm/cli/agent/agent-java-describe.js +25 -0
  63. package/esm/cli/agent/agent-java-describe.js.map +1 -0
  64. package/esm/cli/agent/agent-java-export.js +44 -0
  65. package/esm/cli/agent/agent-java-export.js.map +1 -0
  66. package/esm/cli/agent/agent-java-import.js +48 -0
  67. package/esm/cli/agent/agent-java-import.js.map +1 -0
  68. package/esm/cli/agent/agent-java-list.js +27 -0
  69. package/esm/cli/agent/agent-java-list.js.map +1 -0
  70. package/esm/cli/agent/agent-java.js +10 -0
  71. package/esm/cli/agent/agent-java.js.map +1 -0
  72. package/esm/cli/{_template/cmd-sub1-export.js → agent/agent-list.js} +9 -4
  73. package/esm/cli/agent/agent-list.js.map +1 -0
  74. package/esm/cli/agent/agent-web-delete.js +57 -0
  75. package/esm/cli/agent/agent-web-delete.js.map +1 -0
  76. package/esm/cli/agent/agent-web-describe.js +25 -0
  77. package/esm/cli/agent/agent-web-describe.js.map +1 -0
  78. package/esm/cli/agent/agent-web-export.js +44 -0
  79. package/esm/cli/agent/agent-web-export.js.map +1 -0
  80. package/esm/cli/agent/agent-web-import.js +48 -0
  81. package/esm/cli/agent/agent-web-import.js.map +1 -0
  82. package/esm/cli/agent/agent-web-list.js +27 -0
  83. package/esm/cli/agent/agent-web-list.js.map +1 -0
  84. package/esm/cli/agent/agent-web.js +10 -0
  85. package/esm/cli/agent/agent-web.js.map +1 -0
  86. package/esm/cli/agent/agent.js +20 -0
  87. package/esm/cli/agent/agent.js.map +1 -0
  88. package/esm/cli/cmd_common.js +3 -1
  89. package/esm/cli/cmd_common.js.map +1 -1
  90. package/esm/ops/AgentOps.js +776 -0
  91. package/esm/ops/AgentOps.js.map +1 -0
  92. package/esm/utils/Console.js +19 -0
  93. package/esm/utils/Console.js.map +1 -1
  94. package/package.json +2 -2
  95. package/esm/cli/_template/cmd-delete.js +0 -22
  96. package/esm/cli/_template/cmd-delete.js.map +0 -1
  97. package/esm/cli/_template/cmd-describe.js.map +0 -1
  98. package/esm/cli/_template/cmd-export.js.map +0 -1
  99. package/esm/cli/_template/cmd-import.js +0 -22
  100. package/esm/cli/_template/cmd-import.js.map +0 -1
  101. package/esm/cli/_template/cmd-list.js +0 -22
  102. package/esm/cli/_template/cmd-list.js.map +0 -1
  103. package/esm/cli/_template/cmd-sub1-delete.js +0 -22
  104. package/esm/cli/_template/cmd-sub1-delete.js.map +0 -1
  105. package/esm/cli/_template/cmd-sub1-describe.js +0 -22
  106. package/esm/cli/_template/cmd-sub1-describe.js.map +0 -1
  107. package/esm/cli/_template/cmd-sub1-export.js.map +0 -1
  108. package/esm/cli/_template/cmd-sub1-import.js +0 -22
  109. package/esm/cli/_template/cmd-sub1-import.js.map +0 -1
  110. package/esm/cli/_template/cmd-sub1-list.js +0 -22
  111. package/esm/cli/_template/cmd-sub1-list.js.map +0 -1
  112. package/esm/cli/_template/cmd-sub1.js +0 -10
  113. package/esm/cli/_template/cmd-sub1.js.map +0 -1
  114. package/esm/cli/_template/cmd-sub2-delete.js +0 -22
  115. package/esm/cli/_template/cmd-sub2-delete.js.map +0 -1
  116. package/esm/cli/_template/cmd-sub2-describe.js +0 -22
  117. package/esm/cli/_template/cmd-sub2-describe.js.map +0 -1
  118. package/esm/cli/_template/cmd-sub2-export.js +0 -22
  119. package/esm/cli/_template/cmd-sub2-export.js.map +0 -1
  120. package/esm/cli/_template/cmd-sub2-import.js +0 -22
  121. package/esm/cli/_template/cmd-sub2-import.js.map +0 -1
  122. package/esm/cli/_template/cmd-sub2-list.js +0 -22
  123. package/esm/cli/_template/cmd-sub2-list.js.map +0 -1
  124. package/esm/cli/_template/cmd-sub2.js +0 -10
  125. package/esm/cli/_template/cmd-sub2.js.map +0 -1
  126. package/esm/cli/_template/cmd.js +0 -19
  127. package/esm/cli/_template/cmd.js.map +0 -1
@@ -0,0 +1,48 @@
1
+ import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
3
+ import * as common from '../cmd_common.js';
4
+ import { verboseMessage } from '../../utils/Console.js';
5
+ import { importFirstWebAgentFromFile, importWebAgentFromFile, importWebAgentsFromFile, importWebAgentsFromFiles } from '../../ops/AgentOps.js';
6
+ const {
7
+ getTokens
8
+ } = Authenticate;
9
+ const program = new Command('frodo agent web import');
10
+ program.description('Import web agents.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-i, --agent-id <agent-id>', 'Agent id. If specified, only one agent is imported and the options -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to import.')).addOption(new Option('-a, --all', 'Import all agents from single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Import all agents from separate files (*.webagent.json) in the current directory. Ignored with -i or -a.')).action( // implement command logic inside action handler
11
+ async (host, realm, user, password, options) => {
12
+ state.default.session.setTenant(host);
13
+ state.default.session.setRealm(realm);
14
+ state.default.session.setUsername(user);
15
+ state.default.session.setPassword(password);
16
+ state.default.session.setDeploymentType(options.type);
17
+ state.default.session.setAllowInsecureConnection(options.insecure);
18
+ state.default.session.setVerbose(options.verbose);
19
+ state.default.session.setDebug(options.debug);
20
+ state.default.session.setCurlirize(options.curlirize);
21
+
22
+ if (await getTokens()) {
23
+ // import
24
+ if (options.agentId) {
25
+ verboseMessage(`Importing web agent ${options.agentId} from file...`);
26
+ await importWebAgentFromFile(options.agentId, options.file);
27
+ } // --all -a
28
+ else if (options.all && options.file) {
29
+ verboseMessage(`Importing all web agents from a single file (${options.file})...`);
30
+ await importWebAgentsFromFile(options.file);
31
+ } // --all-separate -A
32
+ else if (options.allSeparate && !options.file) {
33
+ verboseMessage('Importing all web agents from separate files...');
34
+ await importWebAgentsFromFiles();
35
+ } // import first journey in file
36
+ else if (options.file) {
37
+ verboseMessage('Importing first web agent in file...');
38
+ await importFirstWebAgentFromFile(options.file);
39
+ } // unrecognized combination of options or no options
40
+ else {
41
+ verboseMessage('Unrecognized combination of options or no options...');
42
+ program.help();
43
+ }
44
+ }
45
+ } // end command logic inside action handler
46
+ );
47
+ program.parse();
48
+ //# sourceMappingURL=agent-web-import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-web-import.js","names":["Command","Option","Authenticate","state","common","verboseMessage","importFirstWebAgentFromFile","importWebAgentFromFile","importWebAgentsFromFile","importWebAgentsFromFiles","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","agentId","file","all","allSeparate","help","parse"],"sources":["cli/agent/agent-web-import.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { verboseMessage } from '../../utils/Console.js';\nimport {\n importFirstWebAgentFromFile,\n importWebAgentFromFile,\n importWebAgentsFromFile,\n importWebAgentsFromFiles,\n} from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo agent web import');\n\nprogram\n .description('Import web agents.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-i, --agent-id <agent-id>',\n 'Agent id. If specified, only one agent is imported and the options -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the file to import.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Import all agents from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all agents from separate files (*.webagent.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (await getTokens()) {\n // import\n if (options.agentId) {\n verboseMessage(`Importing web agent ${options.agentId} from file...`);\n await importWebAgentFromFile(options.agentId, options.file);\n }\n // --all -a\n else if (options.all && options.file) {\n verboseMessage(\n `Importing all web agents from a single file (${options.file})...`\n );\n await importWebAgentsFromFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file) {\n verboseMessage('Importing all web agents from separate files...');\n await importWebAgentsFromFiles();\n }\n // import first journey in file\n else if (options.file) {\n verboseMessage('Importing first web agent in file...');\n await importFirstWebAgentFromFile(options.file);\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage(\n 'Unrecognized combination of options or no options...'\n );\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,cAAT,QAA+B,wBAA/B;AACA,SACEC,2BADF,EAEEC,sBAFF,EAGEC,uBAHF,EAIEC,wBAJF,QAKO,uBALP;AAOA,MAAM;EAAEC;AAAF,IAAgBR,YAAtB;AAEA,MAAMS,OAAO,GAAG,IAAIX,OAAJ,CAAY,wBAAZ,CAAhB;AAEAW,OAAO,CACJC,WADH,CACe,oBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeX,MAAM,CAACY,aAJtB,EAKGD,WALH,CAKeX,MAAM,CAACa,aALtB,EAMGF,WANH,CAMeX,MAAM,CAACc,YANtB,EAOGH,WAPH,CAOeX,MAAM,CAACe,gBAPtB,EAQGC,SARH,CAQahB,MAAM,CAACiB,gBARpB,EASGD,SATH,CASahB,MAAM,CAACkB,cATpB,EAUGF,SAVH,CAUahB,MAAM,CAACmB,aAV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rB;IACA,IAAIqB,OAAO,CAACiB,OAAZ,EAAqB;MACnB3C,cAAc,CAAE,uBAAsB0B,OAAO,CAACiB,OAAQ,eAAxC,CAAd;MACA,MAAMzC,sBAAsB,CAACwB,OAAO,CAACiB,OAAT,EAAkBjB,OAAO,CAACkB,IAA1B,CAA5B;IACD,CAHD,CAIA;IAJA,KAKK,IAAIlB,OAAO,CAACmB,GAAR,IAAenB,OAAO,CAACkB,IAA3B,EAAiC;MACpC5C,cAAc,CACX,gDAA+C0B,OAAO,CAACkB,IAAK,MADjD,CAAd;MAGA,MAAMzC,uBAAuB,CAACuB,OAAO,CAACkB,IAAT,CAA7B;IACD,CALI,CAML;IANK,KAOA,IAAIlB,OAAO,CAACoB,WAAR,IAAuB,CAACpB,OAAO,CAACkB,IAApC,EAA0C;MAC7C5C,cAAc,CAAC,iDAAD,CAAd;MACA,MAAMI,wBAAwB,EAA9B;IACD,CAHI,CAIL;IAJK,KAKA,IAAIsB,OAAO,CAACkB,IAAZ,EAAkB;MACrB5C,cAAc,CAAC,sCAAD,CAAd;MACA,MAAMC,2BAA2B,CAACyB,OAAO,CAACkB,IAAT,CAAjC;IACD,CAHI,CAIL;IAJK,KAKA;MACH5C,cAAc,CACZ,sDADY,CAAd;MAGAM,OAAO,CAACyC,IAAR;IACD;EACF;AACF,CA3EL,CA4EI;AA5EJ;AA+EAzC,OAAO,CAAC0C,KAAR"}
@@ -0,0 +1,27 @@
1
+ import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
3
+ import * as common from '../cmd_common.js';
4
+ import { listWebAgents } from '../../ops/AgentOps.js';
5
+ const {
6
+ getTokens
7
+ } = Authenticate;
8
+ const program = new Command('frodo agent web list');
9
+ program.description('List web agents.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).action( // implement command logic inside action handler
10
+ async (host, realm, user, password, options) => {
11
+ state.default.session.setTenant(host);
12
+ state.default.session.setRealm(realm);
13
+ state.default.session.setUsername(user);
14
+ state.default.session.setPassword(password);
15
+ state.default.session.setDeploymentType(options.type);
16
+ state.default.session.setAllowInsecureConnection(options.insecure);
17
+ state.default.session.setVerbose(options.verbose);
18
+ state.default.session.setDebug(options.debug);
19
+ state.default.session.setCurlirize(options.curlirize);
20
+
21
+ if (await getTokens()) {
22
+ await listWebAgents(options.long);
23
+ }
24
+ } // end command logic inside action handler
25
+ );
26
+ program.parse();
27
+ //# sourceMappingURL=agent-web-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-web-list.js","names":["Command","Option","Authenticate","state","common","listWebAgents","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","long","parse"],"sources":["cli/agent/agent-web-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { listWebAgents } from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo agent web list');\n\nprogram\n .description('List web agents.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (await getTokens()) {\n await listWebAgents(options.long);\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,aAAT,QAA8B,uBAA9B;AAEA,MAAM;EAAEC;AAAF,IAAgBJ,YAAtB;AAEA,MAAMK,OAAO,GAAG,IAAIP,OAAJ,CAAY,sBAAZ,CAAhB;AAEAO,OAAO,CACJC,WADH,CACe,kBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeP,MAAM,CAACQ,aAJtB,EAKGD,WALH,CAKeP,MAAM,CAACS,aALtB,EAMGF,WANH,CAMeP,MAAM,CAACU,YANtB,EAOGH,WAPH,CAOeP,MAAM,CAACW,gBAPtB,EAQGC,SARH,CAQaZ,MAAM,CAACa,gBARpB,EASGD,SATH,CASaZ,MAAM,CAACc,cATpB,EAUGF,SAVH,CAUaZ,MAAM,CAACe,aAVpB,EAWGH,SAXH,CAWaZ,MAAM,CAACgB,WAXpB,EAYGJ,SAZH,CAYaZ,MAAM,CAACiB,eAZpB,EAaGL,SAbH,CAcI,IAAIf,MAAJ,CAAW,YAAX,EAAyB,uBAAzB,EAAkDqB,OAAlD,CAA0D,KAA1D,EAAiE,OAAjE,CAdJ,EAgBGC,MAhBH,EAiBI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9CzB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBC,SAAtB,CAAgCN,IAAhC;EACArB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBE,QAAtB,CAA+BN,KAA/B;EACAtB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBG,WAAtB,CAAkCN,IAAlC;EACAvB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBI,WAAtB,CAAkCN,QAAlC;EACAxB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACAhC,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;EACAlC,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBS,UAAtB,CAAiCV,OAAO,CAACW,OAAzC;EACApC,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBW,QAAtB,CAA+BZ,OAAO,CAACa,KAAvC;EACAtC,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBa,YAAtB,CAAmCd,OAAO,CAACe,SAA3C;;EACA,IAAI,MAAMrC,SAAS,EAAnB,EAAuB;IACrB,MAAMD,aAAa,CAACuB,OAAO,CAACgB,IAAT,CAAnB;EACD;AACF,CA/BL,CAgCI;AAhCJ;AAmCArC,OAAO,CAACsC,KAAR"}
@@ -0,0 +1,10 @@
1
+ import { Command } from 'commander';
2
+ const program = new Command('frodo agent web');
3
+ program.description('Manage web agents.').alias('ig').helpOption('-h, --help', 'Help').showHelpAfterError();
4
+ program.command('list', 'List web agents.').showHelpAfterError();
5
+ program.command('describe', 'Describe web agents.').showHelpAfterError();
6
+ program.command('export', 'Export web agents.').showHelpAfterError();
7
+ program.command('import', 'Import web agents.').showHelpAfterError();
8
+ program.command('delete', 'Delete web agents.').showHelpAfterError();
9
+ program.parse();
10
+ //# sourceMappingURL=agent-web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-web.js","names":["Command","program","description","alias","helpOption","showHelpAfterError","command","parse"],"sources":["cli/agent/agent-web.ts"],"sourcesContent":["import { Command } from 'commander';\n\nconst program = new Command('frodo agent web');\n\nprogram\n .description('Manage web agents.')\n .alias('ig')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError();\n\nprogram.command('list', 'List web agents.').showHelpAfterError();\n\nprogram.command('describe', 'Describe web agents.').showHelpAfterError();\n\nprogram.command('export', 'Export web agents.').showHelpAfterError();\n\nprogram.command('import', 'Import web agents.').showHelpAfterError();\n\nprogram.command('delete', 'Delete web agents.').showHelpAfterError();\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,WAAxB;AAEA,MAAMC,OAAO,GAAG,IAAID,OAAJ,CAAY,iBAAZ,CAAhB;AAEAC,OAAO,CACJC,WADH,CACe,oBADf,EAEGC,KAFH,CAES,IAFT,EAGGC,UAHH,CAGc,YAHd,EAG4B,MAH5B,EAIGC,kBAJH;AAMAJ,OAAO,CAACK,OAAR,CAAgB,MAAhB,EAAwB,kBAAxB,EAA4CD,kBAA5C;AAEAJ,OAAO,CAACK,OAAR,CAAgB,UAAhB,EAA4B,sBAA5B,EAAoDD,kBAApD;AAEAJ,OAAO,CAACK,OAAR,CAAgB,QAAhB,EAA0B,oBAA1B,EAAgDD,kBAAhD;AAEAJ,OAAO,CAACK,OAAR,CAAgB,QAAhB,EAA0B,oBAA1B,EAAgDD,kBAAhD;AAEAJ,OAAO,CAACK,OAAR,CAAgB,QAAhB,EAA0B,oBAA1B,EAAgDD,kBAAhD;AAEAJ,OAAO,CAACM,KAAR"}
@@ -0,0 +1,20 @@
1
+ import { Command } from 'commander';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
+
7
+ export default function setup() {
8
+ const program = new Command('agent').helpOption('-h, --help', 'Help').description('Manage agents.').executableDir(__dirname);
9
+ program.command('gateway', 'Manage gateway agents.').alias('ig').showHelpAfterError();
10
+ program.command('java', 'Manage java agents.').showHelpAfterError();
11
+ program.command('web', 'Manage web agents.').showHelpAfterError();
12
+ program.command('list', 'List agents.').showHelpAfterError();
13
+ program.command('describe', 'Describe agents.').showHelpAfterError();
14
+ program.command('export', 'Export agents.').showHelpAfterError();
15
+ program.command('import', 'Import agents.').showHelpAfterError();
16
+ program.command('delete', 'Delete agents.').showHelpAfterError();
17
+ program.showHelpAfterError();
18
+ return program;
19
+ }
20
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","names":["Command","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","helpOption","description","executableDir","command","alias","showHelpAfterError"],"sources":["cli/agent/agent.ts"],"sourcesContent":["import { Command } from 'commander';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new Command('agent')\n .helpOption('-h, --help', 'Help')\n .description('Manage agents.')\n .executableDir(__dirname);\n\n program\n .command('gateway', 'Manage gateway agents.')\n .alias('ig')\n .showHelpAfterError();\n\n program.command('java', 'Manage java agents.').showHelpAfterError();\n\n program.command('web', 'Manage web agents.').showHelpAfterError();\n\n program.command('list', 'List agents.').showHelpAfterError();\n\n program.command('describe', 'Describe agents.').showHelpAfterError();\n\n program.command('export', 'Export agents.').showHelpAfterError();\n\n program.command('import', 'Import agents.').showHelpAfterError();\n\n program.command('delete', 'Delete agents.').showHelpAfterError();\n\n program.showHelpAfterError();\n return program;\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,WAAxB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,aAAT,QAA8B,KAA9B;;AAEA,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAL,CAAaF,aAAa,CAACG,MAAM,CAACC,IAAP,CAAYC,GAAb,CAA1B,CAAlB;;AAEA,eAAe,SAASC,KAAT,GAAiB;EAC9B,MAAMC,OAAO,GAAG,IAAIT,OAAJ,CAAY,OAAZ,EACbU,UADa,CACF,YADE,EACY,MADZ,EAEbC,WAFa,CAED,gBAFC,EAGbC,aAHa,CAGCT,SAHD,CAAhB;EAKAM,OAAO,CACJI,OADH,CACW,SADX,EACsB,wBADtB,EAEGC,KAFH,CAES,IAFT,EAGGC,kBAHH;EAKAN,OAAO,CAACI,OAAR,CAAgB,MAAhB,EAAwB,qBAAxB,EAA+CE,kBAA/C;EAEAN,OAAO,CAACI,OAAR,CAAgB,KAAhB,EAAuB,oBAAvB,EAA6CE,kBAA7C;EAEAN,OAAO,CAACI,OAAR,CAAgB,MAAhB,EAAwB,cAAxB,EAAwCE,kBAAxC;EAEAN,OAAO,CAACI,OAAR,CAAgB,UAAhB,EAA4B,kBAA5B,EAAgDE,kBAAhD;EAEAN,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,gBAA1B,EAA4CE,kBAA5C;EAEAN,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,gBAA1B,EAA4CE,kBAA5C;EAEAN,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,gBAA1B,EAA4CE,kBAA5C;EAEAN,OAAO,CAACM,kBAAR;EACA,OAAON,OAAP;AACD"}
@@ -1,10 +1,11 @@
1
1
  import { Argument, Option } from 'commander';
2
2
  import { state } from '@rockcarver/frodo-lib';
3
3
  import * as global from '../storage/StaticStorage.js';
4
- import { printMessage, createProgressIndicator, updateProgressIndicator, stopProgressIndicator, verboseMessage, debugMessage } from '../utils/Console.js';
4
+ import { printMessage, createProgressIndicator, updateProgressIndicator, stopProgressIndicator, verboseMessage, debugMessage, curlirizeMessage } from '../utils/Console.js';
5
5
  state.default.session.setPrintHandler(printMessage);
6
6
  state.default.session.setVerboseHandler(verboseMessage);
7
7
  state.default.session.setDebugHandler(debugMessage);
8
+ state.default.session.setCurlirizeHandler(curlirizeMessage);
8
9
  state.default.session.setCreateProgressHandler(createProgressIndicator);
9
10
  state.default.session.setUpdateProgressHandler(updateProgressIndicator);
10
11
  state.default.session.setStopProgressHandler(stopProgressIndicator);
@@ -45,6 +46,7 @@ export const deploymentOptionM = new Option('-m, --type <type>', deploymentOptio
45
46
  export const insecureOption = new Option('-k, --insecure', '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.').default(false, "Don't allow insecure connections");
46
47
  export const verboseOption = new Option('--verbose', 'Verbose output during command execution. If specified, may or may not produce additional output.');
47
48
  export const debugOption = new Option('--debug', 'Debug output during command execution. If specified, may or may not produce additional output helpful for troubleshooting.');
49
+ export const curlirizeOption = new Option('--curlirize', 'Output all network calls in curl format.');
48
50
  export const managedNameOption = new Option('-N, --name <name>', 'Managed object name to be operated on. Examples are \
49
51
  user, role, alpha_user, alpha_role etc.');
50
52
  export const managedNameOptionM = new Option('-N, --name <name>', 'Managed object name to be operated on. Examples are \
@@ -1 +1 @@
1
- {"version":3,"file":"cmd_common.js","names":["Argument","Option","state","global","printMessage","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","verboseMessage","debugMessage","default","session","setPrintHandler","setVerboseHandler","setDebugHandler","setCreateProgressHandler","setUpdateProgressHandler","setStopProgressHandler","init","hostArgumentDescription","hostArgument","hostArgumentM","realmArgumentDescription","realmArgument","DEFAULT_REALM_KEY","realmArgumentM","userArgumentDescription","userArgument","userArgumentM","passwordArgumentDescription","passwordArgument","passwordArgumentM","apiKeyArgumentDescription","apiKeyArgument","apiSecretArgumentDescription","apiSecretArgument","treeOptionDescription","treeOption","treeOptionM","fileOptionDescription","fileOption","fileOptionM","deploymentOptionDescription","deploymentOption","choices","DEPLOYMENT_TYPES","deploymentOptionM","insecureOption","verboseOption","debugOption","managedNameOption","managedNameOptionM","dirOptionDescription","dirOption","dirOptionM","entitiesFileOptionDescription","entitiesFileOption","entitiesFileOptionM","envFileOptionDescription","envFileOption","envFileOptionM","sourcesOptionDescription","sourcesOptionDefaultValueDescription","sourcesOptionM","scriptFriendlyOption","makeOptionMandatory"],"sources":["cli/cmd_common.ts"],"sourcesContent":["import { Argument, Option } from 'commander';\nimport { state } from '@rockcarver/frodo-lib';\nimport * as global from '../storage/StaticStorage.js';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n verboseMessage,\n debugMessage,\n} from '../utils/Console.js';\n\nstate.default.session.setPrintHandler(printMessage);\nstate.default.session.setVerboseHandler(verboseMessage);\nstate.default.session.setDebugHandler(debugMessage);\nstate.default.session.setCreateProgressHandler(createProgressIndicator);\nstate.default.session.setUpdateProgressHandler(updateProgressIndicator);\nstate.default.session.setStopProgressHandler(stopProgressIndicator);\n\nexport function init() {\n // pseudo functions for commands that do not otherwise need to import\n // this file but need to trigger print and progress handler registration\n}\n\nconst hostArgumentDescription =\n 'Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring.';\nexport const hostArgument = new Argument('[host]', hostArgumentDescription);\nexport const hostArgumentM = new Argument('<host>', hostArgumentDescription);\n\nconst realmArgumentDescription =\n \"Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise.\";\nexport const realmArgument = new Argument(\n '[realm]',\n realmArgumentDescription\n).default(\n global.DEFAULT_REALM_KEY,\n '\"alpha\" for Identity Cloud tenants, \"/\" otherwise.'\n);\nexport const realmArgumentM = new Argument('<realm>', realmArgumentDescription);\n\nconst userArgumentDescription =\n 'Username to login with. Must be an admin user with appropriate rights to manage authentication journeys/trees.';\nexport const userArgument = new Argument('[user]', userArgumentDescription);\nexport const userArgumentM = new Argument('<user>', userArgumentDescription);\n\nconst passwordArgumentDescription = 'Password.';\nexport const passwordArgument = new Argument(\n '[password]',\n passwordArgumentDescription\n);\nexport const passwordArgumentM = new Argument(\n '<password>',\n passwordArgumentDescription\n);\n\nconst apiKeyArgumentDescription = 'API key for logging API.';\nexport const apiKeyArgument = new Argument('[key]', apiKeyArgumentDescription);\n\nconst apiSecretArgumentDescription = 'API secret for logging API.';\nexport const apiSecretArgument = new Argument(\n '[secret]',\n apiSecretArgumentDescription\n);\n\nconst treeOptionDescription =\n 'Specify the name of an authentication journey/tree.';\nexport const treeOption = new Option(\n '-t, --tree <tree>',\n treeOptionDescription\n);\nexport const treeOptionM = new Option(\n '-t, --tree <tree>',\n treeOptionDescription\n);\n\nconst fileOptionDescription = 'File name.';\nexport const fileOption = new Option(\n '-f, --file <file>',\n fileOptionDescription\n);\nexport const fileOptionM = new Option(\n '-f, --file <file>',\n fileOptionDescription\n);\n\nconst deploymentOptionDescription =\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';\nexport const deploymentOption = new Option(\n '-m, --type <type>',\n deploymentOptionDescription\n).choices(global.DEPLOYMENT_TYPES);\nexport const deploymentOptionM = new Option(\n '-m, --type <type>',\n deploymentOptionDescription\n).choices(global.DEPLOYMENT_TYPES);\n\nexport const 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\nexport const verboseOption = new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n);\n\nexport const 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\nexport const managedNameOption = new Option(\n '-N, --name <name>',\n 'Managed object name to be operated on. Examples are \\\nuser, role, alpha_user, alpha_role etc.'\n);\nexport const managedNameOptionM = new Option(\n '-N, --name <name>',\n 'Managed object name to be operated on. Examples are \\\nuser, role, alpha_user, alpha_role etc.'\n);\n\nconst dirOptionDescription =\n 'Directory for exporting all configuration entities to.';\nexport const dirOption = new Option(\n '-D, --directory <directory>',\n dirOptionDescription\n);\nexport const dirOptionM = new Option(\n '-D, --directory <directory>',\n dirOptionDescription\n);\n\nconst entitiesFileOptionDescription =\n 'JSON file that specifies the config entities to export/import.';\nexport const entitiesFileOption = new Option(\n '-E, --entitiesFile <file>',\n entitiesFileOptionDescription\n);\nexport const entitiesFileOptionM = new Option(\n '-E, --entitiesFile <file>',\n entitiesFileOptionDescription\n);\n\nconst envFileOptionDescription =\n 'File that defines environment specific variables for replacement during configuration export/import.';\nexport const envFileOption = new Option(\n '-e, --envFile <file>',\n envFileOptionDescription\n);\nexport const envFileOptionM = new Option(\n '-e, --envFile <file>',\n envFileOptionDescription\n);\n\nconst sourcesOptionDescription = 'Comma separated list of log sources';\nconst sourcesOptionDefaultValueDescription = 'Log everything';\nexport const sourcesOptionM = new Option(\n '-c, --sources <sources>',\n sourcesOptionDescription\n).default('am-everything,idm-everything', sourcesOptionDefaultValueDescription);\n\nexport const scriptFriendlyOption = new Option(\n '-s, --scriptFriendly',\n 'Send output of operation to STDOUT in a script-friendly format (JSON) which can be piped to other \\\ncommands. User messages/warnings are output to STDERR, and are not piped. For example, to only get \\\nbearer token: \\n\\\n<<< frodo info my-tenant -s 2>/dev/null | jq -r .bearerToken >>>'\n).default(false, 'Output as plain text');\n\ntreeOptionM.makeOptionMandatory();\nfileOptionM.makeOptionMandatory();\ndeploymentOptionM.makeOptionMandatory();\ndirOptionM.makeOptionMandatory();\nentitiesFileOptionM.makeOptionMandatory();\nenvFileOptionM.makeOptionMandatory();\nmanagedNameOptionM.makeOptionMandatory();\nsourcesOptionM.makeOptionMandatory();\n"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,MAAnB,QAAiC,WAAjC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,OAAO,KAAKC,MAAZ,MAAwB,6BAAxB;AACA,SACEC,YADF,EAEEC,uBAFF,E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,CAAvB;AAKP,OAAO,MAAME,oBAAoB,GAAG,IAAI/D,MAAJ,CAClC,sBADkC,EAElC;AACF;AACA;AACA,iEALoC,EAMlCS,OANkC,CAM1B,KAN0B,EAMnB,sBANmB,CAA7B;AAQP4B,WAAW,CAAC2B,mBAAZ;AACAxB,WAAW,CAACwB,mBAAZ;AACAnB,iBAAiB,CAACmB,mBAAlB;AACAX,UAAU,CAACW,mBAAX;AACAR,mBAAmB,CAACQ,mBAApB;AACAL,cAAc,CAACK,mBAAf;AACAd,kBAAkB,CAACc,mBAAnB;AACAF,cAAc,CAACE,mBAAf"}
1
+ {"version":3,"file":"cmd_common.js","names":["Argument","Option","state","global","printMessage","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","verboseMessage","debugMessage","curlirizeMessage","default","session","setPrintHandler","setVerboseHandler","setDebugHandler","setCurlirizeHandler","setCreateProgressHandler","setUpdateProgressHandler","setStopProgressHandler","init","hostArgumentDescription","hostArgument","hostArgumentM","realmArgumentDescription","realmArgument","DEFAULT_REALM_KEY","realmArgumentM","userArgumentDescription","userArgument","userArgumentM","passwordArgumentDescription","passwordArgument","passwordArgumentM","apiKeyArgumentDescription","apiKeyArgument","apiSecretArgumentDescription","apiSecretArgument","treeOptionDescription","treeOption","treeOptionM","fileOptionDescription","fileOption","fileOptionM","deploymentOptionDescription","deploymentOption","choices","DEPLOYMENT_TYPES","deploymentOptionM","insecureOption","verboseOption","debugOption","curlirizeOption","managedNameOption","managedNameOptionM","dirOptionDescription","dirOption","dirOptionM","entitiesFileOptionDescription","entitiesFileOption","entitiesFileOptionM","envFileOptionDescription","envFileOption","envFileOptionM","sourcesOptionDescription","sourcesOptionDefaultValueDescription","sourcesOptionM","scriptFriendlyOption","makeOptionMandatory"],"sources":["cli/cmd_common.ts"],"sourcesContent":["import { Argument, Option } from 'commander';\nimport { state } from '@rockcarver/frodo-lib';\nimport * as global from '../storage/StaticStorage.js';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n verboseMessage,\n debugMessage,\n curlirizeMessage,\n} from '../utils/Console.js';\n\nstate.default.session.setPrintHandler(printMessage);\nstate.default.session.setVerboseHandler(verboseMessage);\nstate.default.session.setDebugHandler(debugMessage);\nstate.default.session.setCurlirizeHandler(curlirizeMessage);\nstate.default.session.setCreateProgressHandler(createProgressIndicator);\nstate.default.session.setUpdateProgressHandler(updateProgressIndicator);\nstate.default.session.setStopProgressHandler(stopProgressIndicator);\n\nexport function init() {\n // pseudo functions for commands that do not otherwise need to import\n // this file but need to trigger print and progress handler registration\n}\n\nconst hostArgumentDescription =\n 'Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring.';\nexport const hostArgument = new Argument('[host]', hostArgumentDescription);\nexport const hostArgumentM = new Argument('<host>', hostArgumentDescription);\n\nconst realmArgumentDescription =\n \"Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise.\";\nexport const realmArgument = new Argument(\n '[realm]',\n realmArgumentDescription\n).default(\n global.DEFAULT_REALM_KEY,\n '\"alpha\" for Identity Cloud tenants, \"/\" otherwise.'\n);\nexport const realmArgumentM = new Argument('<realm>', realmArgumentDescription);\n\nconst userArgumentDescription =\n 'Username to login with. Must be an admin user with appropriate rights to manage authentication journeys/trees.';\nexport const userArgument = new Argument('[user]', userArgumentDescription);\nexport const userArgumentM = new Argument('<user>', userArgumentDescription);\n\nconst passwordArgumentDescription = 'Password.';\nexport const passwordArgument = new Argument(\n '[password]',\n passwordArgumentDescription\n);\nexport const passwordArgumentM = new Argument(\n '<password>',\n passwordArgumentDescription\n);\n\nconst apiKeyArgumentDescription = 'API key for logging API.';\nexport const apiKeyArgument = new Argument('[key]', apiKeyArgumentDescription);\n\nconst apiSecretArgumentDescription = 'API secret for logging API.';\nexport const apiSecretArgument = new Argument(\n '[secret]',\n apiSecretArgumentDescription\n);\n\nconst treeOptionDescription =\n 'Specify the name of an authentication journey/tree.';\nexport const treeOption = new Option(\n '-t, --tree <tree>',\n treeOptionDescription\n);\nexport const treeOptionM = new Option(\n '-t, --tree <tree>',\n treeOptionDescription\n);\n\nconst fileOptionDescription = 'File name.';\nexport const fileOption = new Option(\n '-f, --file <file>',\n fileOptionDescription\n);\nexport const fileOptionM = new Option(\n '-f, --file <file>',\n fileOptionDescription\n);\n\nconst deploymentOptionDescription =\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';\nexport const deploymentOption = new Option(\n '-m, --type <type>',\n deploymentOptionDescription\n).choices(global.DEPLOYMENT_TYPES);\nexport const deploymentOptionM = new Option(\n '-m, --type <type>',\n deploymentOptionDescription\n).choices(global.DEPLOYMENT_TYPES);\n\nexport const 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\nexport const verboseOption = new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n);\n\nexport const 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\nexport const curlirizeOption = new Option(\n '--curlirize',\n 'Output all network calls in curl format.'\n);\n\nexport const managedNameOption = new Option(\n '-N, --name <name>',\n 'Managed object name to be operated on. Examples are \\\nuser, role, alpha_user, alpha_role etc.'\n);\nexport const managedNameOptionM = new Option(\n '-N, --name <name>',\n 'Managed object name to be operated on. Examples are \\\nuser, role, alpha_user, alpha_role etc.'\n);\n\nconst dirOptionDescription =\n 'Directory for exporting all configuration entities to.';\nexport const dirOption = new Option(\n '-D, --directory <directory>',\n dirOptionDescription\n);\nexport const dirOptionM = new Option(\n '-D, --directory <directory>',\n dirOptionDescription\n);\n\nconst entitiesFileOptionDescription =\n 'JSON file that specifies the config entities to export/import.';\nexport const entitiesFileOption = new Option(\n '-E, --entitiesFile <file>',\n entitiesFileOptionDescription\n);\nexport const entitiesFileOptionM = new Option(\n '-E, --entitiesFile <file>',\n entitiesFileOptionDescription\n);\n\nconst envFileOptionDescription =\n 'File that defines environment specific variables for replacement during configuration export/import.';\nexport const envFileOption = new Option(\n '-e, --envFile <file>',\n envFileOptionDescription\n);\nexport const envFileOptionM = new Option(\n '-e, --envFile <file>',\n envFileOptionDescription\n);\n\nconst sourcesOptionDescription = 'Comma separated list of log sources';\nconst sourcesOptionDefaultValueDescription = 'Log everything';\nexport const sourcesOptionM = new Option(\n '-c, --sources <sources>',\n sourcesOptionDescription\n).default('am-everything,idm-everything', sourcesOptionDefaultValueDescription);\n\nexport const scriptFriendlyOption = new Option(\n '-s, --scriptFriendly',\n 'Send output of operation to STDOUT in a script-friendly format (JSON) which can be piped to other \\\ncommands. User messages/warnings are output to STDERR, and are not piped. For example, to only get \\\nbearer token: \\n\\\n<<< frodo info my-tenant -s 2>/dev/null | jq -r .bearerToken >>>'\n).default(false, 'Output as plain text');\n\ntreeOptionM.makeOptionMandatory();\nfileOptionM.makeOptionMandatory();\ndeploymentOptionM.makeOptionMandatory();\ndirOptionM.makeOptionMandatory();\nentitiesFileOptionM.makeOptionMandatory();\nenvFileOptionM.makeOptionMandatory();\nmanagedNameOptionM.makeOptionMandatory();\nsourcesOptionM.makeOptionMandatory();\n"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,MAAnB,QAAiC,WAAjC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,OAAO,KAAKC,MAAZ,MAAwB,6BAAxB;AACA,SACEC,YADF,EAEEC,uBAFF,EAGEC,uBAHF,EAIEC,qBAJF,EAKEC,cALF,EAMEC,YANF,EAOEC,gBAPF,QAQO,qBARP;AAUAR,KAAK,CA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