@rockcarver/frodo-cli 0.18.2-0 → 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 (135) hide show
  1. package/CHANGELOG.md +14 -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/cli/logging/logs-fetch.js +23 -4
  91. package/esm/cli/logging/logs-fetch.js.map +1 -1
  92. package/esm/cli/logging/logs-list.js +1 -1
  93. package/esm/cli/logging/logs-list.js.map +1 -1
  94. package/esm/cli/logging/logs-tail.js +1 -1
  95. package/esm/cli/logging/logs-tail.js.map +1 -1
  96. package/esm/cli/logging/logs.js +2 -1
  97. package/esm/cli/logging/logs.js.map +1 -1
  98. package/esm/ops/AgentOps.js +776 -0
  99. package/esm/ops/AgentOps.js.map +1 -0
  100. package/esm/utils/Console.js +19 -0
  101. package/esm/utils/Console.js.map +1 -1
  102. package/package.json +2 -2
  103. package/esm/cli/_template/cmd-delete.js +0 -22
  104. package/esm/cli/_template/cmd-delete.js.map +0 -1
  105. package/esm/cli/_template/cmd-describe.js.map +0 -1
  106. package/esm/cli/_template/cmd-export.js.map +0 -1
  107. package/esm/cli/_template/cmd-import.js +0 -22
  108. package/esm/cli/_template/cmd-import.js.map +0 -1
  109. package/esm/cli/_template/cmd-list.js +0 -22
  110. package/esm/cli/_template/cmd-list.js.map +0 -1
  111. package/esm/cli/_template/cmd-sub1-delete.js +0 -22
  112. package/esm/cli/_template/cmd-sub1-delete.js.map +0 -1
  113. package/esm/cli/_template/cmd-sub1-describe.js +0 -22
  114. package/esm/cli/_template/cmd-sub1-describe.js.map +0 -1
  115. package/esm/cli/_template/cmd-sub1-export.js.map +0 -1
  116. package/esm/cli/_template/cmd-sub1-import.js +0 -22
  117. package/esm/cli/_template/cmd-sub1-import.js.map +0 -1
  118. package/esm/cli/_template/cmd-sub1-list.js +0 -22
  119. package/esm/cli/_template/cmd-sub1-list.js.map +0 -1
  120. package/esm/cli/_template/cmd-sub1.js +0 -10
  121. package/esm/cli/_template/cmd-sub1.js.map +0 -1
  122. package/esm/cli/_template/cmd-sub2-delete.js +0 -22
  123. package/esm/cli/_template/cmd-sub2-delete.js.map +0 -1
  124. package/esm/cli/_template/cmd-sub2-describe.js +0 -22
  125. package/esm/cli/_template/cmd-sub2-describe.js.map +0 -1
  126. package/esm/cli/_template/cmd-sub2-export.js +0 -22
  127. package/esm/cli/_template/cmd-sub2-export.js.map +0 -1
  128. package/esm/cli/_template/cmd-sub2-import.js +0 -22
  129. package/esm/cli/_template/cmd-sub2-import.js.map +0 -1
  130. package/esm/cli/_template/cmd-sub2-list.js +0 -22
  131. package/esm/cli/_template/cmd-sub2-list.js.map +0 -1
  132. package/esm/cli/_template/cmd-sub2.js +0 -10
  133. package/esm/cli/_template/cmd-sub2.js.map +0 -1
  134. package/esm/cli/_template/cmd.js +0 -19
  135. package/esm/cli/_template/cmd.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"something-other-export.js","names":["Command","Option","Authenticate","state","common","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","parse"],"sources":["cli/_template/something-other-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo something other export');\n\nprogram\n .description('Export other.')\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, --other-id <other-id>',\n '[Other] id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export all [others] to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all [others] to separate files (*.[other].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 // code goes here\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,MAA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B,OAAN,CAAcC,OAAd,CAAsBK,iBAAtB,CAAwCP,OAAO,CAACQ,IAAhD;EACA/B,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBO,0BAAtB,CAAiDT,OAAO,CAACU,QAAzD;EACAjC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBS,UAAtB,CAAiCX,OAAO,CAACY,OAAzC;EACAnC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBW,QAAtB,CAA+Bb,OAAO,CAACc,KAAvC;EACArC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBa,YAAtB,CAAmCf,OAAO,CAACgB,SAA3C;;EACA,IAAI,MAAMrC,SAAS,EAAnB,EAAuB,CACrB;EACD;AACF,CA/CL,CAgDI;AAhDJ;AAmDAC,OAAO,CAACqC,KAAR"}
@@ -0,0 +1,25 @@
1
+ import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
3
+ import * as common from '../cmd_common.js';
4
+ const {
5
+ getTokens
6
+ } = Authenticate;
7
+ const program = new Command('frodo something other import');
8
+ program.description('Import other.').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, --other-id <other-id>', '[Other] id. If specified, only one [other] 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 [others] from single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Import all [others] from separate files (*.[other].json) in the current directory. Ignored with -i or -a.')).action( // implement command logic inside action handler
9
+ async (host, realm, user, password, options) => {
10
+ state.default.session.setTenant(host);
11
+ state.default.session.setRealm(realm);
12
+ state.default.session.setUsername(user);
13
+ state.default.session.setPassword(password);
14
+ state.default.session.setDeploymentType(options.type);
15
+ state.default.session.setAllowInsecureConnection(options.insecure);
16
+ state.default.session.setVerbose(options.verbose);
17
+ state.default.session.setDebug(options.debug);
18
+ state.default.session.setCurlirize(options.curlirize);
19
+
20
+ if (await getTokens()) {// code goes here
21
+ }
22
+ } // end command logic inside action handler
23
+ );
24
+ program.parse();
25
+ //# sourceMappingURL=something-other-import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"something-other-import.js","names":["Command","Option","Authenticate","state","common","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","parse"],"sources":["cli/_template/something-other-import.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo something other import');\n\nprogram\n .description('Import other.')\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, --other-id <other-id>',\n '[Other] id. If specified, only one [other] 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 [others] from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all [others] from separate files (*.[other].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 // code goes here\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;AAEA,MAAM;EAAEC;AAAF,IAAgBH,YAAtB;AAEA,MAAMI,OAAO,GAAG,IAAIN,OAAJ,CAAY,8BAAZ,CAAhB;AAEAM,OAAO,CACJC,WADH,CACe,eADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeN,MAAM,CAACO,aAJtB,EAKGD,WALH,CAKeN,MAAM,CAACQ,aALtB,EAMGF,WANH,CAMeN,MAAM,CAACS,YANtB,EAOGH,WAPH,CAOeN,MAAM,CAACU,gBAPtB,EAQGC,SARH,CAQaX,MAAM,CAACY,gBARpB,EASGD,SATH,CASaX,MAAM,CAACa,cATpB,EAUGF,SAVH,CAUaX,MAAM,CAACc,aAVpB,EAWGH,SAXH,CAWaX,MAAM,CAACe,WAXpB,EAYGJ,SAZH,CAYaX,MAAM,CAACgB,eAZpB,EAaGL,SAbH,CAcI,IAAId,MAAJ,CACE,2BADF,EAEE,+FAFF,CAdJ,EAmBGc,SAnBH,CAmBa,IAAId,MAAJ,CAAW,mBAAX,EAAgC,6BAAhC,CAnBb,EAoBGc,SApBH,CAqBI,IAAId,MAAJ,CACE,WADF,EAEE,wDAFF,CArBJ,EA0BGc,SA1BH,CA2BI,IAAId,MAAJ,CACE,oBADF,EAEE,2GAFF,CA3BJ,EAgCGoB,MAhCH,EAiCI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9CvB,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBC,SAAtB,CAAgCP,IAAhC;EACAnB,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBE,QAAtB,CAA+BP,KAA/B;EACApB,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBG,WAAtB,CAAkCP,IAAlC;EACArB,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBI,WAAtB,CAAkCP,QAAlC;EACAtB,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBK,iBAAtB,CAAwCP,OAAO,CAACQ,IAAhD;EACA/B,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBO,0BAAtB,CAAiDT,OAAO,CAACU,QAAzD;EACAjC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBS,UAAtB,CAAiCX,OAAO,CAACY,OAAzC;EACAnC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBW,QAAtB,CAA+Bb,OAAO,CAACc,KAAvC;EACArC,KAAK,CAACwB,OAAN,CAAcC,OAAd,CAAsBa,YAAtB,CAAmCf,OAAO,CAACgB,SAA3C;;EACA,IAAI,MAAMrC,SAAS,EAAnB,EAAuB,CACrB;EACD;AACF,CA/CL,CAgDI;AAhDJ;AAmDAC,OAAO,CAACqC,KAAR"}
@@ -4,8 +4,8 @@ import * as common from '../cmd_common.js';
4
4
  const {
5
5
  getTokens
6
6
  } = Authenticate;
7
- const program = new Command('frodo cmd export');
8
- program.description('Cmd export.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('-i, --cmd-id <cmd-id>', 'Cmd id. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export all cmds to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all cmds to separate files (*.cmd.json) in the current directory. Ignored with -i or -a.')).action( // implement command logic inside action handler
7
+ const program = new Command('frodo something other list');
8
+ program.description('List other.').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
9
9
  async (host, realm, user, password, options) => {
10
10
  state.default.session.setTenant(host);
11
11
  state.default.session.setRealm(realm);
@@ -13,10 +13,13 @@ async (host, realm, user, password, options) => {
13
13
  state.default.session.setPassword(password);
14
14
  state.default.session.setDeploymentType(options.type);
15
15
  state.default.session.setAllowInsecureConnection(options.insecure);
16
+ state.default.session.setVerbose(options.verbose);
17
+ state.default.session.setDebug(options.debug);
18
+ state.default.session.setCurlirize(options.curlirize);
16
19
 
17
20
  if (await getTokens()) {// code goes here
18
21
  }
19
22
  } // end command logic inside action handler
20
23
  );
21
24
  program.parse();
22
- //# sourceMappingURL=cmd-export.js.map
25
+ //# sourceMappingURL=something-other-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"something-other-list.js","names":["Command","Option","Authenticate","state","common","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","parse"],"sources":["cli/_template/something-other-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo something other list');\n\nprogram\n .description('List other.')\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 // code goes here\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;AAEA,MAAM;EAAEC;AAAF,IAAgBH,YAAtB;AAEA,MAAMI,OAAO,GAAG,IAAIN,OAAJ,CAAY,4BAAZ,CAAhB;AAEAM,OAAO,CACJC,WADH,CACe,aADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeN,MAAM,CAACO,aAJtB,EAKGD,WALH,CAKeN,MAAM,CAACQ,aALtB,EAMGF,WANH,CAMeN,MAAM,CAACS,YANtB,EAOGH,WAPH,CAOeN,MAAM,CAACU,gBAPtB,EAQGC,SARH,CAQaX,MAAM,CAACY,gBARpB,EASGD,SATH,CASaX,MAAM,CAACa,cATpB,EAUGF,SAVH,CAUaX,MAAM,CAACc,aAVpB,EAWGH,SAXH,CAWaX,MAAM,CAACe,WAXpB,EAYGJ,SAZH,CAYaX,MAAM,CAACgB,eAZpB,EAaGL,SAbH,CAcI,IAAId,MAAJ,CAAW,YAAX,EAAyB,uBAAzB,EAAkDoB,OAAlD,CAA0D,KAA1D,EAAiE,OAAjE,CAdJ,EAgBGC,MAhBH,EAiBI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9CxB,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBC,SAAtB,CAAgCN,IAAhC;EACApB,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBE,QAAtB,CAA+BN,KAA/B;EACArB,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBG,WAAtB,CAAkCN,IAAlC;EACAtB,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBI,WAAtB,CAAkCN,QAAlC;EACAvB,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACA/B,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;EACAjC,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBS,UAAtB,CAAiCV,OAAO,CAACW,OAAzC;EACAnC,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBW,QAAtB,CAA+BZ,OAAO,CAACa,KAAvC;EACArC,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBa,YAAtB,CAAmCd,OAAO,CAACe,SAA3C;;EACA,IAAI,MAAMrC,SAAS,EAAnB,EAAuB,CACrB;EACD;AACF,CA/BL,CAgCI;AAhCJ;AAmCAC,OAAO,CAACqC,KAAR"}
@@ -0,0 +1,10 @@
1
+ import { Command } from 'commander';
2
+ const program = new Command('frodo something other');
3
+ program.description('Manage other.').helpOption('-h, --help', 'Help').showHelpAfterError();
4
+ program.command('list', 'List other.').showHelpAfterError();
5
+ program.command('describe', 'Describe other.').showHelpAfterError();
6
+ program.command('export', 'Export other.').showHelpAfterError();
7
+ program.command('import', 'Import other.').showHelpAfterError();
8
+ program.command('delete', 'Delete other.').showHelpAfterError();
9
+ program.parse();
10
+ //# sourceMappingURL=something-other.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"something-other.js","names":["Command","program","description","helpOption","showHelpAfterError","command","parse"],"sources":["cli/_template/something-other.ts"],"sourcesContent":["import { Command } from 'commander';\n\nconst program = new Command('frodo something other');\n\nprogram\n .description('Manage other.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError();\n\nprogram.command('list', 'List other.').showHelpAfterError();\n\nprogram.command('describe', 'Describe other.').showHelpAfterError();\n\nprogram.command('export', 'Export other.').showHelpAfterError();\n\nprogram.command('import', 'Import other.').showHelpAfterError();\n\nprogram.command('delete', 'Delete other.').showHelpAfterError();\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,WAAxB;AAEA,MAAMC,OAAO,GAAG,IAAID,OAAJ,CAAY,uBAAZ,CAAhB;AAEAC,OAAO,CACJC,WADH,CACe,eADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH;AAKAH,OAAO,CAACI,OAAR,CAAgB,MAAhB,EAAwB,aAAxB,EAAuCD,kBAAvC;AAEAH,OAAO,CAACI,OAAR,CAAgB,UAAhB,EAA4B,iBAA5B,EAA+CD,kBAA/C;AAEAH,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,eAA1B,EAA2CD,kBAA3C;AAEAH,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,eAA1B,EAA2CD,kBAA3C;AAEAH,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,eAA1B,EAA2CD,kBAA3C;AAEAH,OAAO,CAACK,KAAR"}
@@ -0,0 +1,19 @@
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('something').helpOption('-h, --help', 'Help').description('Manage something.').executableDir(__dirname);
9
+ program.command('else', 'Manage something else.').showHelpAfterError();
10
+ program.command('other', 'Manage something other.').showHelpAfterError();
11
+ program.command('list', 'List something.').showHelpAfterError();
12
+ program.command('describe', 'Describe something.').showHelpAfterError();
13
+ program.command('export', 'Export something.').showHelpAfterError();
14
+ program.command('import', 'Import something.').showHelpAfterError();
15
+ program.command('delete', 'Delete something.').showHelpAfterError();
16
+ program.showHelpAfterError();
17
+ return program;
18
+ }
19
+ //# sourceMappingURL=something.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"something.js","names":["Command","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","helpOption","description","executableDir","command","showHelpAfterError"],"sources":["cli/_template/something.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('something')\n .helpOption('-h, --help', 'Help')\n .description('Manage something.')\n .executableDir(__dirname);\n\n program.command('else', 'Manage something else.').showHelpAfterError();\n\n program.command('other', 'Manage something other.').showHelpAfterError();\n\n program.command('list', 'List something.').showHelpAfterError();\n\n program.command('describe', 'Describe something.').showHelpAfterError();\n\n program.command('export', 'Export something.').showHelpAfterError();\n\n program.command('import', 'Import something.').showHelpAfterError();\n\n program.command('delete', 'Delete something.').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,WAAZ,EACbU,UADa,CACF,YADE,EACY,MADZ,EAEbC,WAFa,CAED,mBAFC,EAGbC,aAHa,CAGCT,SAHD,CAAhB;EAKAM,OAAO,CAACI,OAAR,CAAgB,MAAhB,EAAwB,wBAAxB,EAAkDC,kBAAlD;EAEAL,OAAO,CAACI,OAAR,CAAgB,OAAhB,EAAyB,yBAAzB,EAAoDC,kBAApD;EAEAL,OAAO,CAACI,OAAR,CAAgB,MAAhB,EAAwB,iBAAxB,EAA2CC,kBAA3C;EAEAL,OAAO,CAACI,OAAR,CAAgB,UAAhB,EAA4B,qBAA5B,EAAmDC,kBAAnD;EAEAL,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,mBAA1B,EAA+CC,kBAA/C;EAEAL,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,mBAA1B,EAA+CC,kBAA/C;EAEAL,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,mBAA1B,EAA+CC,kBAA/C;EAEAL,OAAO,CAACK,kBAAR;EACA,OAAOL,OAAP;AACD"}
@@ -0,0 +1,57 @@
1
+ import { Command, Option } from 'commander';
2
+ import { Authenticate, Agent, state } from '@rockcarver/frodo-lib';
3
+ import * as common from '../cmd_common.js';
4
+ import { printMessage, verboseMessage } from '../../utils/Console.js';
5
+ const {
6
+ getTokens
7
+ } = Authenticate;
8
+ const {
9
+ deleteAgents,
10
+ deleteAgent
11
+ } = Agent;
12
+ const program = new Command('frodo agent delete');
13
+ program.description('Delete agent.').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, -a is ignored.')).addOption(new Option('-a, --all', 'Delete all agents. Ignored with -i.')).action( // implement command logic inside action handler
14
+ async (host, realm, user, password, options) => {
15
+ state.default.session.setTenant(host);
16
+ state.default.session.setRealm(realm);
17
+ state.default.session.setUsername(user);
18
+ state.default.session.setPassword(password);
19
+ state.default.session.setDeploymentType(options.type);
20
+ state.default.session.setAllowInsecureConnection(options.insecure);
21
+ state.default.session.setVerbose(options.verbose);
22
+ state.default.session.setDebug(options.debug);
23
+ state.default.session.setCurlirize(options.curlirize);
24
+
25
+ if (await getTokens()) {
26
+ // delete by id
27
+ if (options.agentId) {
28
+ verboseMessage(`Deleting agent '${options.agentId}' in realm "${state.default.session.getRealm()}"...`);
29
+
30
+ try {
31
+ await deleteAgent(options.agentId);
32
+ } catch (error) {
33
+ printMessage(error.message, 'error');
34
+ process.exitCode = 1;
35
+ return;
36
+ }
37
+ } // --all -a
38
+ else if (options.all) {
39
+ verboseMessage('Deleting all agents...');
40
+
41
+ try {
42
+ await deleteAgents();
43
+ } catch (error) {
44
+ printMessage(error.message, 'error');
45
+ process.exitCode = 1;
46
+ return;
47
+ }
48
+ } // unrecognized combination of options or no options
49
+ else {
50
+ verboseMessage('Unrecognized combination of options or no options...');
51
+ program.help();
52
+ }
53
+ }
54
+ } // end command logic inside action handler
55
+ );
56
+ program.parse();
57
+ //# sourceMappingURL=agent-delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-delete.js","names":["Command","Option","Authenticate","Agent","state","common","printMessage","verboseMessage","getTokens","deleteAgents","deleteAgent","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","getRealm","error","message","process","exitCode","all","help","parse"],"sources":["cli/agent/agent-delete.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Agent, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { deleteAgents, deleteAgent } = Agent;\n\nconst program = new Command('frodo agent delete');\n\nprogram\n .description('Delete agent.')\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, -a is ignored.'\n )\n )\n .addOption(new Option('-a, --all', 'Delete all agents. Ignored with -i.'))\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 // delete by id\n if (options.agentId) {\n verboseMessage(\n `Deleting agent '${\n options.agentId\n }' in realm \"${state.default.session.getRealm()}\"...`\n );\n try {\n await deleteAgent(options.agentId);\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n return;\n }\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Deleting all agents...');\n try {\n await deleteAgents();\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n return;\n }\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,EAA8BC,KAA9B,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EACF;AACF,CAnEL,CAoEI;AApEJ;AAuEA5C,OAAO,CAAC6C,KAAR"}
@@ -5,7 +5,7 @@ const {
5
5
  getTokens
6
6
  } = Authenticate;
7
7
  const program = new Command('frodo cmd describe');
8
- program.description('Cmd describe.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('-i, --cmd-id <cmd-id>', 'Cmd id.')).action( // implement command logic inside action handler
8
+ program.description('Cmd describe.').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, --cmd-id <cmd-id>', 'Cmd id.')).action( // implement command logic inside action handler
9
9
  async (host, realm, user, password, options) => {
10
10
  state.default.session.setTenant(host);
11
11
  state.default.session.setRealm(realm);
@@ -13,10 +13,13 @@ async (host, realm, user, password, options) => {
13
13
  state.default.session.setPassword(password);
14
14
  state.default.session.setDeploymentType(options.type);
15
15
  state.default.session.setAllowInsecureConnection(options.insecure);
16
+ state.default.session.setVerbose(options.verbose);
17
+ state.default.session.setDebug(options.debug);
18
+ state.default.session.setCurlirize(options.curlirize);
16
19
 
17
20
  if (await getTokens()) {// code goes here
18
21
  }
19
22
  } // end command logic inside action handler
20
23
  );
21
24
  program.parse();
22
- //# sourceMappingURL=cmd-describe.js.map
25
+ //# sourceMappingURL=agent-describe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-describe.js","names":["Command","Option","Authenticate","state","common","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","parse"],"sources":["cli/agent/agent-describe.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo cmd describe');\n\nprogram\n .description('Cmd describe.')\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(new Option('-i, --cmd-id <cmd-id>', 'Cmd id.'))\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 // code goes here\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;AAEA,MAAM;EAAEC;AAAF,IAAgBH,YAAtB;AAEA,MAAMI,OAAO,GAAG,IAAIN,OAAJ,CAAY,oBAAZ,CAAhB;AAEAM,OAAO,CACJC,WADH,CACe,eADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeN,MAAM,CAACO,aAJtB,EAKGD,WALH,CAKeN,MAAM,CAACQ,aALtB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C,OAAO,CAACqC,KAAR"}
@@ -0,0 +1,44 @@
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 { exportAgentsToFile, exportAgentsToFiles, exportAgentToFile } from '../../ops/AgentOps.js';
6
+ const {
7
+ getTokens
8
+ } = Authenticate;
9
+ const program = new Command('frodo cmd export');
10
+ program.description('Cmd export.').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>', 'Cmd id. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export all cmds to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all cmds to separate files (*.cmd.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
+ // export
24
+ if (options.agentId) {
25
+ verboseMessage('Exporting agent...');
26
+ await exportAgentToFile(options.agentId, options.file);
27
+ } // --all -a
28
+ else if (options.all) {
29
+ verboseMessage('Exporting all agents to a single file...');
30
+ await exportAgentsToFile(options.file);
31
+ } // --all-separate -A
32
+ else if (options.allSeparate) {
33
+ verboseMessage('Exporting all agents to separate files...');
34
+ await exportAgentsToFiles();
35
+ } // unrecognized combination of options or no options
36
+ else {
37
+ verboseMessage('Unrecognized combination of options or no options...');
38
+ program.help();
39
+ }
40
+ }
41
+ } // end command logic inside action handler
42
+ );
43
+ program.parse();
44
+ //# sourceMappingURL=agent-export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-export.js","names":["Command","Option","Authenticate","state","common","verboseMessage","exportAgentsToFile","exportAgentsToFiles","exportAgentToFile","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-export.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 exportAgentsToFile,\n exportAgentsToFiles,\n exportAgentToFile,\n} from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo cmd export');\n\nprogram\n .description('Cmd export.')\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 'Cmd id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export all cmds to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all cmds to separate files (*.cmd.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 // export\n if (options.agentId) {\n verboseMessage('Exporting agent...');\n await exportAgentToFile(options.agentId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all agents to a single file...');\n await exportAgentsToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all agents to separate files...');\n await exportAgentsToFiles();\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,kBADF,EAEEC,mBAFF,EAGEC,iBAHF,QAIO,uBAJP;AAMA,MAAM;EAAEC;AAAF,IAAgBP,YAAtB;AAEA,MAAMQ,OAAO,GAAG,IAAIV,OAAJ,CAAY,kBAAZ,CAAhB;AAEAU,OAAO,CACJC,WADH,CACe,aADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeV,MAAM,CAACW,aAJtB,EAKGD,WALH,CAKeV,MAAM,CAACY,aALtB,EAMGF,WANH,CAMeV,MAAM,CAACa,YANtB,EAOGH,WAPH,CAOeV,MAAM,CAACc,gBAPtB,EAQGC,SARH,CAQaf,MAAM,CAACgB,gBARpB,EASGD,SATH,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Cf,OAAO,CAACgB,SAA3C;;EACA,IAAI,MAAMrC,SAAS,EAAnB,EAAuB;IACrB;IACA,IAAIqB,OAAO,CAACiB,OAAZ,EAAqB;MACnB1C,cAAc,CAAC,oBAAD,CAAd;MACA,MAAMG,iBAAiB,CAACsB,OAAO,CAACiB,OAAT,EAAkBjB,OAAO,CAACkB,IAA1B,CAAvB;IACD,CAHD,CAIA;IAJA,KAKK,IAAIlB,OAAO,CAACmB,GAAZ,EAAiB;MACpB5C,cAAc,CAAC,0CAAD,CAAd;MACA,MAAMC,kBAAkB,CAACwB,OAAO,CAACkB,IAAT,CAAxB;IACD,CAHI,CAIL;IAJK,KAKA,IAAIlB,OAAO,CAACoB,WAAZ,EAAyB;MAC5B7C,cAAc,CAAC,2CAAD,CAAd;MACA,MAAME,mBAAmB,EAAzB;IACD,CAHI,CAIL;IAJK,KAKA;MACHF,cAAc,CACZ,sDADY,CAAd;MAGAK,OAAO,CAACyC,IAAR;IACD;EACF;AACF,CApEL,CAqEI;AArEJ;AAwEAzC,OAAO,CAAC0C,KAAR"}
@@ -0,0 +1,57 @@
1
+ import { Command, Option } from 'commander';
2
+ import { Authenticate, Agent, state } from '@rockcarver/frodo-lib';
3
+ import * as common from '../cmd_common.js';
4
+ import { printMessage, verboseMessage } from '../../utils/Console.js';
5
+ const {
6
+ getTokens
7
+ } = Authenticate;
8
+ const {
9
+ deleteIdentityGatewayAgent,
10
+ deleteIdentityGatewayAgents
11
+ } = Agent;
12
+ const program = new Command('frodo agent gateway delete');
13
+ program.description('Delete identity gateway 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, -a is ignored.')).addOption(new Option('-a, --all', 'Delete all identity gateway agents. Ignored with -i.')).action( // implement command logic inside action handler
14
+ async (host, realm, user, password, options) => {
15
+ state.default.session.setTenant(host);
16
+ state.default.session.setRealm(realm);
17
+ state.default.session.setUsername(user);
18
+ state.default.session.setPassword(password);
19
+ state.default.session.setDeploymentType(options.type);
20
+ state.default.session.setAllowInsecureConnection(options.insecure);
21
+ state.default.session.setVerbose(options.verbose);
22
+ state.default.session.setDebug(options.debug);
23
+ state.default.session.setCurlirize(options.curlirize);
24
+
25
+ if (await getTokens()) {
26
+ // delete by id
27
+ if (options.agentId) {
28
+ verboseMessage(`Deleting agent '${options.agentId}' in realm "${state.default.session.getRealm()}"...`);
29
+
30
+ try {
31
+ await deleteIdentityGatewayAgent(options.agentId);
32
+ } catch (error) {
33
+ printMessage(error.message, 'error');
34
+ process.exitCode = 1;
35
+ return;
36
+ }
37
+ } // --all -a
38
+ else if (options.all) {
39
+ verboseMessage('Deleting all agents...');
40
+
41
+ try {
42
+ await deleteIdentityGatewayAgents();
43
+ } catch (error) {
44
+ printMessage(error.message, 'error');
45
+ process.exitCode = 1;
46
+ return;
47
+ }
48
+ } // unrecognized combination of options or no options
49
+ else {
50
+ verboseMessage('Unrecognized combination of options or no options...');
51
+ program.help();
52
+ }
53
+ }
54
+ } // end command logic inside action handler
55
+ );
56
+ program.parse();
57
+ //# sourceMappingURL=agent-gateway-delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-gateway-delete.js","names":["Command","Option","Authenticate","Agent","state","common","printMessage","verboseMessage","getTokens","deleteIdentityGatewayAgent","deleteIdentityGatewayAgents","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","getRealm","error","message","process","exitCode","all","help","parse"],"sources":["cli/agent/agent-gateway-delete.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Agent, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { deleteIdentityGatewayAgent, deleteIdentityGatewayAgents } = Agent;\n\nconst program = new Command('frodo agent gateway delete');\n\nprogram\n .description('Delete identity gateway 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, -a is ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all identity gateway agents. Ignored with -i.'\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 // delete by id\n if (options.agentId) {\n verboseMessage(\n `Deleting agent '${\n options.agentId\n }' in realm \"${state.default.session.getRealm()}\"...`\n );\n try {\n await deleteIdentityGatewayAgent(options.agentId);\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n return;\n }\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Deleting all agents...');\n try {\n await deleteIdentityGatewayAgents();\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n return;\n }\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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AZ;QACAC,OAAO,CAACC,QAAR,GAAmB,CAAnB;QACA;MACD;IACF,CATI,CAUL;IAVK,KAWA;MACH9C,cAAc,CACZ,sDADY,CAAd;MAGAI,OAAO,CAAC4C,IAAR;IACD;EACF;AACF,CAxEL,CAyEI;AAzEJ;AA4EA5C,OAAO,CAAC6C,KAAR"}
@@ -0,0 +1,25 @@
1
+ import { Command, Option } from 'commander';
2
+ import { Authenticate, state } from '@rockcarver/frodo-lib';
3
+ import * as common from '../cmd_common.js';
4
+ const {
5
+ getTokens
6
+ } = Authenticate;
7
+ const program = new Command('frodo agent gateway describe');
8
+ program.description('Describe gateway 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.')).action( // implement command logic inside action handler
9
+ async (host, realm, user, password, options) => {
10
+ state.default.session.setTenant(host);
11
+ state.default.session.setRealm(realm);
12
+ state.default.session.setUsername(user);
13
+ state.default.session.setPassword(password);
14
+ state.default.session.setDeploymentType(options.type);
15
+ state.default.session.setAllowInsecureConnection(options.insecure);
16
+ state.default.session.setVerbose(options.verbose);
17
+ state.default.session.setDebug(options.debug);
18
+ state.default.session.setCurlirize(options.curlirize);
19
+
20
+ if (await getTokens()) {// code goes here
21
+ }
22
+ } // end command logic inside action handler
23
+ );
24
+ program.parse();
25
+ //# sourceMappingURL=agent-gateway-describe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-gateway-describe.js","names":["Command","Option","Authenticate","state","common","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","parse"],"sources":["cli/agent/agent-gateway-describe.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo agent gateway describe');\n\nprogram\n .description('Describe gateway 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(new Option('-i, --agent-id <agent-id>', 'Agent id.'))\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 // code goes here\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;AAEA,MAAM;EAAEC;AAAF,IAAgBH,YAAtB;AAEA,MAAMI,OAAO,GAAG,IAAIN,OAAJ,CAAY,8BAAZ,CAAhB;AAEAM,OAAO,CACJC,WADH,CACe,0BADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeN,MAAM,CAACO,aAJtB,EAKGD,WALH,CAKeN,MAAM,CAACQ,aALtB,EAMGF,WANH,CA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,KAAR"}
@@ -0,0 +1,44 @@
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 { exportIdentityGatewayAgentsToFile, exportIdentityGatewayAgentsToFiles, exportIdentityGatewayAgentToFile } from '../../ops/AgentOps.js';
6
+ const {
7
+ getTokens
8
+ } = Authenticate;
9
+ const program = new Command('frodo agent gateway export');
10
+ program.description('Export gateway 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, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export all gateway agents to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all gateway agents to separate files (*.identitygatewayagent.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
+ // export
24
+ if (options.agentId) {
25
+ verboseMessage('Exporting identity gateway agent...');
26
+ await exportIdentityGatewayAgentToFile(options.agentId, options.file);
27
+ } // --all -a
28
+ else if (options.all) {
29
+ verboseMessage('Exporting all identity gateway agents to a single file...');
30
+ await exportIdentityGatewayAgentsToFile(options.file);
31
+ } // --all-separate -A
32
+ else if (options.allSeparate) {
33
+ verboseMessage('Exporting all identity gateway agents to separate files...');
34
+ await exportIdentityGatewayAgentsToFiles();
35
+ } // unrecognized combination of options or no options
36
+ else {
37
+ verboseMessage('Unrecognized combination of options or no options...');
38
+ program.help();
39
+ }
40
+ }
41
+ } // end command logic inside action handler
42
+ );
43
+ program.parse();
44
+ //# sourceMappingURL=agent-gateway-export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-gateway-export.js","names":["Command","Option","Authenticate","state","common","verboseMessage","exportIdentityGatewayAgentsToFile","exportIdentityGatewayAgentsToFiles","exportIdentityGatewayAgentToFile","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-gateway-export.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 exportIdentityGatewayAgentsToFile,\n exportIdentityGatewayAgentsToFiles,\n exportIdentityGatewayAgentToFile,\n} from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo agent gateway export');\n\nprogram\n .description('Export gateway 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, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export all gateway agents to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all gateway agents to separate files (*.identitygatewayagent.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 // export\n if (options.agentId) {\n verboseMessage('Exporting identity gateway agent...');\n await exportIdentityGatewayAgentToFile(options.agentId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage(\n 'Exporting all identity gateway agents to a single file...'\n );\n await exportIdentityGatewayAgentsToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage(\n 'Exporting all identity gateway agents to separate files...'\n );\n await exportIdentityGatewayAgentsToFiles();\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,iCADF,EAEEC,kCAFF,EAGEC,gCAHF,QAIO,uBAJP;AAMA,MAAM;EAAEC;AAAF,IAAgBP,YAAtB;AAEA,MAAMQ,OAAO,GAAG,IAAIV,OAAJ,CAAY,4BAAZ,CAAhB;AAEAU,OAAO,CACJC,WADH,CACe,wBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,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ArC,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBS,UAAtB,CAAiCX,OAAO,CAACY,OAAzC;EACAvC,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBW,QAAtB,CAA+Bb,OAAO,CAACc,KAAvC;EACAzC,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBa,YAAtB,CAAmCf,OAAO,CAACgB,SAA3C;;EACA,IAAI,MAAMrC,SAAS,EAAnB,EAAuB;IACrB;IACA,IAAIqB,OAAO,CAACiB,OAAZ,EAAqB;MACnB1C,cAAc,CAAC,qCAAD,CAAd;MACA,MAAMG,gCAAgC,CAACsB,OAAO,CAACiB,OAAT,EAAkBjB,OAAO,CAACkB,IAA1B,CAAtC;IACD,CAHD,CAIA;IAJA,KAKK,IAAIlB,OAAO,CAACmB,GAAZ,EAAiB;MACpB5C,cAAc,CACZ,2DADY,CAAd;MAGA,MAAMC,iCAAiC,CAACwB,OAAO,CAACkB,IAAT,CAAvC;IACD,CALI,CAML;IANK,KAOA,IAAIlB,OAAO,CAACoB,WAAZ,EAAyB;MAC5B7C,cAAc,CACZ,4DADY,CAAd;MAGA,MAAME,kCAAkC,EAAxC;IACD,CALI,CAML;IANK,KAOA;MACHF,cAAc,CACZ,sDADY,CAAd;MAGAK,OAAO,CAACyC,IAAR;IACD;EACF;AACF,CAxEL,CAyEI;AAzEJ;AA4EAzC,OAAO,CAAC0C,KAAR"}
@@ -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 { importFirstIdentityGatewayAgentFromFile, importIdentityGatewayAgentFromFile, importIdentityGatewayAgentsFromFile, importIdentityGatewayAgentsFromFiles } from '../../ops/AgentOps.js';
6
+ const {
7
+ getTokens
8
+ } = Authenticate;
9
+ const program = new Command('frodo agent gateway import');
10
+ program.description('Import gateway 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 (*.identitygatewayagent.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 importIdentityGatewayAgentFromFile(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 importIdentityGatewayAgentsFromFile(options.file);
31
+ } // --all-separate -A
32
+ else if (options.allSeparate && !options.file) {
33
+ verboseMessage('Importing all web agents from separate files...');
34
+ await importIdentityGatewayAgentsFromFiles();
35
+ } // import first journey in file
36
+ else if (options.file) {
37
+ verboseMessage('Importing first web agent in file...');
38
+ await importFirstIdentityGatewayAgentFromFile(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-gateway-import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-gateway-import.js","names":["Command","Option","Authenticate","state","common","verboseMessage","importFirstIdentityGatewayAgentFromFile","importIdentityGatewayAgentFromFile","importIdentityGatewayAgentsFromFile","importIdentityGatewayAgentsFromFiles","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-gateway-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 importFirstIdentityGatewayAgentFromFile,\n importIdentityGatewayAgentFromFile,\n importIdentityGatewayAgentsFromFile,\n importIdentityGatewayAgentsFromFiles,\n} from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo agent gateway import');\n\nprogram\n .description('Import gateway 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 (*.identitygatewayagent.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 importIdentityGatewayAgentFromFile(\n options.agentId,\n options.file\n );\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 importIdentityGatewayAgentsFromFile(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 importIdentityGatewayAgentsFromFiles();\n }\n // import first journey in file\n else if (options.file) {\n verboseMessage('Importing first web agent in file...');\n await importFirstIdentityGatewayAgentFromFile(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,uCADF,EAEEC,kCAFF,EAGEC,mCAHF,EAIEC,oCAJF,QAKO,uBALP;AAOA,MAAM;EAAEC;AAAF,IAAgBR,YAAtB;AAEA,MAAMS,OAAO,GAAG,IAAIX,OAAJ,CAAY,4BAAZ,CAAhB;AAEAW,OAAO,CACJC,WADH,CACe,wBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeX,MAAM,CAACY,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X,OAAO,CAACY,OAAzC;EACAxC,KAAK,CAAC6B,OAAN,CAAcC,OAAd,CAAsBW,QAAtB,CAA+Bb,OAAO,CAACc,KAAvC;EACA1C,KAAK,CAAC6B,OAAN,CAAcC,OAAd,CAAsBa,YAAtB,CAAmCf,OAAO,CAACgB,SAA3C;;EACA,IAAI,MAAMrC,SAAS,EAAnB,EAAuB;IACrB;IACA,IAAIqB,OAAO,CAACiB,OAAZ,EAAqB;MACnB3C,cAAc,CAAE,uBAAsB0B,OAAO,CAACiB,OAAQ,eAAxC,CAAd;MACA,MAAMzC,kCAAkC,CACtCwB,OAAO,CAACiB,OAD8B,EAEtCjB,OAAO,CAACkB,IAF8B,CAAxC;IAID,CAND,CAOA;IAPA,KAQK,IAAIlB,OAAO,CAACmB,GAAR,IAAenB,OAAO,CAACkB,IAA3B,EAAiC;MACpC5C,cAAc,CACX,gDAA+C0B,OAAO,CAACkB,IAAK,MADjD,CAAd;MAGA,MAAMzC,mCAAmC,CAACuB,OAAO,CAACkB,IAAT,CAAzC;IACD,CALI,CAML;IANK,KAOA,IAAIlB,OAAO,CAACoB,WAAR,IAAuB,CAACpB,OAAO,CAACkB,IAApC,EAA0C;MAC7C5C,cAAc,CAAC,iDAAD,CAAd;MACA,MAAMI,oCAAoC,EAA1C;IACD,CAHI,CAIL;IAJK,KAKA,IAAIsB,OAAO,CAACkB,IAAZ,EAAkB;MACrB5C,cAAc,CAAC,sCAAD,CAAd;MACA,MAAMC,uCAAuC,CAACyB,OAAO,CAACkB,IAAT,CAA7C;IACD,CAHI,CAIL;IAJK,KAKA;MACH5C,cAAc,CACZ,sDADY,CAAd;MAGAM,OAAO,CAACyC,IAAR;IACD;EACF;AACF,CA9EL,CA+EI;AA/EJ;AAkFAzC,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 { listIdentityGatewayAgents } from '../../ops/AgentOps.js';
5
+ const {
6
+ getTokens
7
+ } = Authenticate;
8
+ const program = new Command('frodo agent gateway list');
9
+ program.description('List gateway 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 listIdentityGatewayAgents(options.long);
23
+ }
24
+ } // end command logic inside action handler
25
+ );
26
+ program.parse();
27
+ //# sourceMappingURL=agent-gateway-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-gateway-list.js","names":["Command","Option","Authenticate","state","common","listIdentityGatewayAgents","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-gateway-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { listIdentityGatewayAgents } from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo agent gateway list');\n\nprogram\n .description('List gateway 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 listIdentityGatewayAgents(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,yBAAT,QAA0C,uBAA1C;AAEA,MAAM;EAAEC;AAAF,IAAgBJ,YAAtB;AAEA,MAAMK,OAAO,GAAG,IAAIP,OAAJ,CAAY,0BAAZ,CAAhB;AAEAO,OAAO,CACJC,WADH,CACe,sBADf,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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