@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.
- package/CHANGELOG.md +14 -1
- package/esm/app.js +2 -0
- package/esm/app.js.map +1 -1
- package/esm/cli/_template/something-delete.js +25 -0
- package/esm/cli/_template/something-delete.js.map +1 -0
- package/esm/cli/_template/something-describe.js +25 -0
- package/esm/cli/_template/something-describe.js.map +1 -0
- package/esm/cli/_template/something-else-delete.js +25 -0
- package/esm/cli/_template/something-else-delete.js.map +1 -0
- package/esm/cli/_template/something-else-describe.js +25 -0
- package/esm/cli/_template/something-else-describe.js.map +1 -0
- package/esm/cli/_template/something-else-export.js +25 -0
- package/esm/cli/_template/something-else-export.js.map +1 -0
- package/esm/cli/_template/something-else-import.js +25 -0
- package/esm/cli/_template/something-else-import.js.map +1 -0
- package/esm/cli/_template/something-else-list.js +25 -0
- package/esm/cli/_template/something-else-list.js.map +1 -0
- package/esm/cli/_template/something-else.js +10 -0
- package/esm/cli/_template/something-else.js.map +1 -0
- package/esm/cli/_template/something-export.js +25 -0
- package/esm/cli/_template/something-export.js.map +1 -0
- package/esm/cli/_template/something-import.js +25 -0
- package/esm/cli/_template/something-import.js.map +1 -0
- package/esm/cli/_template/something-list.js +25 -0
- package/esm/cli/_template/something-list.js.map +1 -0
- package/esm/cli/_template/something-other-delete.js +25 -0
- package/esm/cli/_template/something-other-delete.js.map +1 -0
- package/esm/cli/_template/something-other-describe.js +25 -0
- package/esm/cli/_template/something-other-describe.js.map +1 -0
- package/esm/cli/_template/something-other-export.js +25 -0
- package/esm/cli/_template/something-other-export.js.map +1 -0
- package/esm/cli/_template/something-other-import.js +25 -0
- package/esm/cli/_template/something-other-import.js.map +1 -0
- package/esm/cli/_template/{cmd-export.js → something-other-list.js} +6 -3
- package/esm/cli/_template/something-other-list.js.map +1 -0
- package/esm/cli/_template/something-other.js +10 -0
- package/esm/cli/_template/something-other.js.map +1 -0
- package/esm/cli/_template/something.js +19 -0
- package/esm/cli/_template/something.js.map +1 -0
- package/esm/cli/agent/agent-delete.js +57 -0
- package/esm/cli/agent/agent-delete.js.map +1 -0
- package/esm/cli/{_template/cmd-describe.js → agent/agent-describe.js} +5 -2
- package/esm/cli/agent/agent-describe.js.map +1 -0
- package/esm/cli/agent/agent-export.js +44 -0
- package/esm/cli/agent/agent-export.js.map +1 -0
- package/esm/cli/agent/agent-gateway-delete.js +57 -0
- package/esm/cli/agent/agent-gateway-delete.js.map +1 -0
- package/esm/cli/agent/agent-gateway-describe.js +25 -0
- package/esm/cli/agent/agent-gateway-describe.js.map +1 -0
- package/esm/cli/agent/agent-gateway-export.js +44 -0
- package/esm/cli/agent/agent-gateway-export.js.map +1 -0
- package/esm/cli/agent/agent-gateway-import.js +48 -0
- package/esm/cli/agent/agent-gateway-import.js.map +1 -0
- package/esm/cli/agent/agent-gateway-list.js +27 -0
- package/esm/cli/agent/agent-gateway-list.js.map +1 -0
- package/esm/cli/agent/agent-gateway.js +10 -0
- package/esm/cli/agent/agent-gateway.js.map +1 -0
- package/esm/cli/agent/agent-import.js +48 -0
- package/esm/cli/agent/agent-import.js.map +1 -0
- package/esm/cli/agent/agent-java-delete.js +57 -0
- package/esm/cli/agent/agent-java-delete.js.map +1 -0
- package/esm/cli/agent/agent-java-describe.js +25 -0
- package/esm/cli/agent/agent-java-describe.js.map +1 -0
- package/esm/cli/agent/agent-java-export.js +44 -0
- package/esm/cli/agent/agent-java-export.js.map +1 -0
- package/esm/cli/agent/agent-java-import.js +48 -0
- package/esm/cli/agent/agent-java-import.js.map +1 -0
- package/esm/cli/agent/agent-java-list.js +27 -0
- package/esm/cli/agent/agent-java-list.js.map +1 -0
- package/esm/cli/agent/agent-java.js +10 -0
- package/esm/cli/agent/agent-java.js.map +1 -0
- package/esm/cli/{_template/cmd-sub1-export.js → agent/agent-list.js} +9 -4
- package/esm/cli/agent/agent-list.js.map +1 -0
- package/esm/cli/agent/agent-web-delete.js +57 -0
- package/esm/cli/agent/agent-web-delete.js.map +1 -0
- package/esm/cli/agent/agent-web-describe.js +25 -0
- package/esm/cli/agent/agent-web-describe.js.map +1 -0
- package/esm/cli/agent/agent-web-export.js +44 -0
- package/esm/cli/agent/agent-web-export.js.map +1 -0
- package/esm/cli/agent/agent-web-import.js +48 -0
- package/esm/cli/agent/agent-web-import.js.map +1 -0
- package/esm/cli/agent/agent-web-list.js +27 -0
- package/esm/cli/agent/agent-web-list.js.map +1 -0
- package/esm/cli/agent/agent-web.js +10 -0
- package/esm/cli/agent/agent-web.js.map +1 -0
- package/esm/cli/agent/agent.js +20 -0
- package/esm/cli/agent/agent.js.map +1 -0
- package/esm/cli/cmd_common.js +3 -1
- package/esm/cli/cmd_common.js.map +1 -1
- package/esm/cli/logging/logs-fetch.js +23 -4
- package/esm/cli/logging/logs-fetch.js.map +1 -1
- package/esm/cli/logging/logs-list.js +1 -1
- package/esm/cli/logging/logs-list.js.map +1 -1
- package/esm/cli/logging/logs-tail.js +1 -1
- package/esm/cli/logging/logs-tail.js.map +1 -1
- package/esm/cli/logging/logs.js +2 -1
- package/esm/cli/logging/logs.js.map +1 -1
- package/esm/ops/AgentOps.js +776 -0
- package/esm/ops/AgentOps.js.map +1 -0
- package/esm/utils/Console.js +19 -0
- package/esm/utils/Console.js.map +1 -1
- package/package.json +2 -2
- package/esm/cli/_template/cmd-delete.js +0 -22
- package/esm/cli/_template/cmd-delete.js.map +0 -1
- package/esm/cli/_template/cmd-describe.js.map +0 -1
- package/esm/cli/_template/cmd-export.js.map +0 -1
- package/esm/cli/_template/cmd-import.js +0 -22
- package/esm/cli/_template/cmd-import.js.map +0 -1
- package/esm/cli/_template/cmd-list.js +0 -22
- package/esm/cli/_template/cmd-list.js.map +0 -1
- package/esm/cli/_template/cmd-sub1-delete.js +0 -22
- package/esm/cli/_template/cmd-sub1-delete.js.map +0 -1
- package/esm/cli/_template/cmd-sub1-describe.js +0 -22
- package/esm/cli/_template/cmd-sub1-describe.js.map +0 -1
- package/esm/cli/_template/cmd-sub1-export.js.map +0 -1
- package/esm/cli/_template/cmd-sub1-import.js +0 -22
- package/esm/cli/_template/cmd-sub1-import.js.map +0 -1
- package/esm/cli/_template/cmd-sub1-list.js +0 -22
- package/esm/cli/_template/cmd-sub1-list.js.map +0 -1
- package/esm/cli/_template/cmd-sub1.js +0 -10
- package/esm/cli/_template/cmd-sub1.js.map +0 -1
- package/esm/cli/_template/cmd-sub2-delete.js +0 -22
- package/esm/cli/_template/cmd-sub2-delete.js.map +0 -1
- package/esm/cli/_template/cmd-sub2-describe.js +0 -22
- package/esm/cli/_template/cmd-sub2-describe.js.map +0 -1
- package/esm/cli/_template/cmd-sub2-export.js +0 -22
- package/esm/cli/_template/cmd-sub2-export.js.map +0 -1
- package/esm/cli/_template/cmd-sub2-import.js +0 -22
- package/esm/cli/_template/cmd-sub2-import.js.map +0 -1
- package/esm/cli/_template/cmd-sub2-list.js +0 -22
- package/esm/cli/_template/cmd-sub2-list.js.map +0 -1
- package/esm/cli/_template/cmd-sub2.js +0 -10
- package/esm/cli/_template/cmd-sub2.js.map +0 -1
- package/esm/cli/_template/cmd.js +0 -19
- package/esm/cli/_template/cmd.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-web-export.js","names":["Command","Option","Authenticate","state","common","verboseMessage","exportWebAgentsToFile","exportWebAgentsToFiles","exportWebAgentToFile","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-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 exportWebAgentsToFile,\n exportWebAgentsToFiles,\n exportWebAgentToFile,\n} from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo agent web export');\n\nprogram\n .description('Export 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, -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 web agents to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all web agents to 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 // export\n if (options.agentId) {\n verboseMessage('Exporting web agent...');\n await exportWebAgentToFile(options.agentId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all web agents to a single file...');\n await exportWebAgentsToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all web agents to separate files...');\n await exportWebAgentsToFiles();\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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,CAACyC,IAAR;IACD;EACF;AACF,CApEL,CAqEI;AArEJ;AAwEAzC,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 { 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,aAVpB,EAWGH,SAXH,CAWahB,MAAM,CAACoB,WAXpB,EAYGJ,SAZH,CAYahB,MAAM,CAACqB,eAZpB,EAaGL,SAbH,CAcI,IAAInB,MAAJ,CACE,2BADF,EAEE,2FAFF,CAdJ,EAmBGmB,SAnBH,CAmBa,IAAInB,MAAJ,CAAW,mBAAX,EAAgC,6BAAhC,CAnBb,EAoBGmB,SApBH,CAqBI,IAAInB,MAAJ,CACE,WADF,EAEE,sDAFF,CArBJ,EA0BGmB,SA1BH,CA2BI,IAAInB,MAAJ,CACE,oBADF,EAEE,0GAFF,CA3BJ,EAgCGyB,MAhC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AAO,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"}
|
package/esm/cli/cmd_common.js
CHANGED
|
@@ -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,EAGEC,uBAHF,EAIEC,qBAJF,EAKEC,cALF,EAMEC,YANF,QAOO,qBAPP;AASAP,KAAK,CAACQ,OAAN,CAAcC,OAAd,CAAsBC,eAAtB,CAAsCR,YAAtC;AACAF,KAAK,CAACQ,OAAN,CAAcC,OAAd,CAAsBE,iBAAtB,CAAwCL,cAAxC;AACAN,KAAK,CAACQ,OAAN,CAAcC,OAAd,CAAsBG,eAAtB,CAAsCL,YAAtC;AACAP,KAAK,CAACQ,OAAN,CAAcC,OAAd,CAAsBI,wBAAtB,CAA+CV,uBAA/C;AACAH,KAAK,CAACQ,OAAN,CAAcC,OAAd,CAAsBK,wBAAtB,CAA+CV,uBAA/C;AACAJ,KAAK,CAACQ,OAAN,CAAcC,OAAd,CAAsBM,sBAAtB,CAA6CV,qBAA7C;AAEA,OAAO,SAASW,IAAT,GAAgB,CACrB;EACA;AACD;AAED,MAAMC,uBAAuB,GAC3B,iIADF;AAEA,OAAO,MAAMC,YAAY,GAAG,IAAIpB,QAAJ,CAAa,QAAb,EAAuBmB,uBAAvB,CAArB;AACP,OAAO,MAAME,aAAa,GAAG,IAAIrB,QAAJ,CAAa,QAAb,EAAuBmB,uBAAvB,CAAtB;AAEP,MAAMG,wBAAwB,GAC5B,yFADF;AAEA,OAAO,MAAMC,aAAa,GAAG,IAAIvB,QAAJ,CAC3B,SAD2B,EAE3BsB,wBAF2B,EAG3BZ,OAH2B,CAI3BP,MAAM,CAACqB,iBAJoB,EAK3B,oDAL2B,CAAtB;AAOP,OAAO,MAAMC,cAAc,GAAG,IAA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,MAAME,cAAc,GAAG,IAAI3D,MAAJ,CAC5B,sBAD4B,EAE5ByD,wBAF4B,CAAvB;AAKP,MAAMG,wBAAwB,GAAG,qCAAjC;AACA,MAAMC,oCAAoC,GAAG,gBAA7C;AACA,OAAO,MAAMC,cAAc,GAAG,IAAI9D,MAAJ,CAC5B,yBAD4B,EAE5B4D,wBAF4B,EAG5BnD,OAH4B,CAGpB,8BAHoB,EAGYoD,oCAHZ,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();\n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Aa,GAAG,IAAI7D,MAAJ,CAC3B,sBAD2B,EAE3B4D,wBAF2B,CAAtB;AAIP,OAAO,MAAME,cAAc,GAAG,IAAI9D,MAAJ,CAC5B,sBAD4B,EAE5B4D,wBAF4B,CAAvB;AAKP,MAAMG,wBAAwB,GAAG,qCAAjC;AACA,MAAMC,oCAAoC,GAAG,gBAA7C;AACA,OAAO,MAAMC,cAAc,GAAG,IAAIjE,MAAJ,CAC5B,yBAD4B,EAE5B+D,wBAF4B,EAG5BrD,OAH4B,CAGpB,8BAHoB,EAGYsD,oCAHZ,CAAvB;AAKP,OAAO,MAAME,oBAAoB,GAAG,IAAIlE,MAAJ,CAClC,sBADkC,EAElC;AACF;AACA;AACA,iEALoC,EAMlCU,OANkC,CAM1B,KAN0B,EAMnB,sBANmB,CAA7B;AAQP6B,WAAW,CAAC4B,mBAAZ;AACAzB,WAAW,CAACyB,mBAAZ;AACApB,iBAAiB,CAACoB,mBAAlB;AACAX,UAAU,CAACW,mBAAX;AACAR,mBAAmB,CAACQ,mBAApB;AACAL,cAAc,CAACK,mBAAf;AACAd,kBAAkB,CAACc,mBAAnB;AACAF,cAAc,CAACE,mBAAf"}
|
|
@@ -21,12 +21,13 @@ const LOG_TIME_WINDOW_MAX = SECONDS_IN_30_DAYS;
|
|
|
21
21
|
const LOG_TIME_WINDOW_INCREMENT = SECONDS_IN_1_HOUR;
|
|
22
22
|
const program = new Command('frodo logs fetch');
|
|
23
23
|
program.description('Fetch Identity Cloud logs between a specified begin and end time period.\
|
|
24
|
-
WARNING: depending on filters and time period specified, this could take substantial time to complete.').helpOption('-h, --help', 'Help').addArgument(common.hostArgumentM).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.insecureOption).addOption(common.sourcesOptionM).addOption(new Option('-l, --level <level>', 'Set log level filter. You can specify the level as a number or a string. \
|
|
24
|
+
WARNING: depending on filters and time period specified, this could take substantial time to complete.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.insecureOption).addOption(common.sourcesOptionM).addOption(new Option('-l, --level <level>', 'Set log level filter. You can specify the level as a number or a string. \
|
|
25
25
|
Following values are possible (values on the same line are equivalent): \
|
|
26
26
|
\n0, SEVERE, FATAL, or ERROR\n1, WARNING, WARN or CONFIG\
|
|
27
27
|
\n2, INFO or INFORMATION\n3, DEBUG, FINE, FINER or FINEST\
|
|
28
28
|
\n4 or ALL').default('ERROR', `${resolveLevel('ERROR')}`)).addOption(new Option('-t, --transaction-id <txid>', 'Filter by transactionId')).addOption(new Option('-b, --begin-timestamp <beginTs>', 'Begin timestamp for period (in ISO8601, example: "2022-10-13T19:06:28Z", or "2022-09.30". \
|
|
29
|
-
Cannot be more than 30 days in the past.
|
|
29
|
+
Cannot be more than 30 days in the past. If not specified, logs from one hour ago are fetched \
|
|
30
|
+
(-e is ignored)')).addOption(new Option('-e, --end-timestamp <endTs>', 'End timestamp for period. Default: "now"')).addOption(new Option('-s, --search-string <ss>', 'Filter by a specific string (ANDed with transactionID filter)')).addOption(new Option('-d, --defaults', 'Use default logging noise filters').default(false, `Use custom logging noise filters defined in ${config.getConfigPath()}/${config.FRODO_LOG_NOISEFILTER_FILENAME}`)).action(async (host, user, password, options, command) => {
|
|
30
31
|
let credsFromParameters = true;
|
|
31
32
|
state.default.session.setTenant(host);
|
|
32
33
|
state.default.session.setUsername(user);
|
|
@@ -58,6 +59,26 @@ Cannot be more than 30 days in the past.')).addOption(new Option('-e, --end-time
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
const now = Date.now() / 1000;
|
|
63
|
+
|
|
64
|
+
if (typeof options.beginTimestamp === 'undefined' || !options.beginTimestamp) {
|
|
65
|
+
// no beginTimestamp value specified, default is 1 hour ago
|
|
66
|
+
const tempStartDate = new Date();
|
|
67
|
+
tempStartDate.setTime((now - SECONDS_IN_1_HOUR) * 1000);
|
|
68
|
+
options.beginTimestamp = tempStartDate.toISOString(); // also override endTimestamp to now
|
|
69
|
+
|
|
70
|
+
const tempEndDate = new Date();
|
|
71
|
+
tempEndDate.setTime(now * 1000);
|
|
72
|
+
options.endTimestamp = tempEndDate;
|
|
73
|
+
printMessage('No timestamps specified, defaulting to logs from 1 hour ago', 'info');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (typeof options.endTimestamp === 'undefined' || !options.endTimestamp) {
|
|
77
|
+
// no endTimestamp value specified, default is now
|
|
78
|
+
options.endTimestamp = now * 1000;
|
|
79
|
+
printMessage('No end timestamp specified, defaulting end timestamp to "now"', 'info');
|
|
80
|
+
}
|
|
81
|
+
|
|
61
82
|
let beginTs = Date.parse(options.beginTimestamp) / 1000;
|
|
62
83
|
|
|
63
84
|
if (Date.parse(options.endTimestamp) / 1000 < beginTs) {
|
|
@@ -65,8 +86,6 @@ Cannot be more than 30 days in the past.')).addOption(new Option('-e, --end-time
|
|
|
65
86
|
return;
|
|
66
87
|
}
|
|
67
88
|
|
|
68
|
-
const now = Date.now() / 1000;
|
|
69
|
-
|
|
70
89
|
if (now - beginTs > LOG_TIME_WINDOW_MAX) {
|
|
71
90
|
printMessage('Begin timestamp can not be more than 30 days in the past', 'error');
|
|
72
91
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-fetch.js","names":["Command","Option","Authenticate","ConnectionProfile","Log","state","common","config","printMessage","provisionCreds","fetchLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","SECONDS_IN_30_DAYS","SECONDS_IN_1_HOUR","LOG_TIME_WINDOW_MAX","LOG_TIME_WINDOW_INCREMENT","program","description","helpOption","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","sourcesOptionM","default","getConfigPath","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","credsFromParameters","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","beginTs","Date","parse","beginTimestamp","endTimestamp","now","intermediateEndTs","opts","sources","level","toISOString","transactionId","searchString","getNoiseFilters","defaults"],"sources":["cli/logging/logs-fetch.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, fetchLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst SECONDS_IN_30_DAYS = 2592000;\nconst SECONDS_IN_1_HOUR = 3600;\nconst LOG_TIME_WINDOW_MAX = SECONDS_IN_30_DAYS;\nconst LOG_TIME_WINDOW_INCREMENT = SECONDS_IN_1_HOUR;\n\nconst program = new Command('frodo logs fetch');\nprogram\n .description(\n 'Fetch Identity Cloud logs between a specified begin and end time period.\\\n WARNING: depending on filters and time period specified, this could take substantial time to complete.'\n )\n .helpOption('-h, --help', 'Help')\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .addOption(common.sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option(\n '-b, --begin-timestamp <beginTs>',\n 'Begin timestamp for period (in ISO8601, example: \"2022-10-13T19:06:28Z\", or \"2022-09.30\". \\\nCannot be more than 30 days in the past.'\n )\n )\n .addOption(\n new Option('-e, --end-timestamp <endTs>', 'End timestamp for period')\n )\n .addOption(\n new Option(\n '-s, --search-string <ss>',\n 'Filter by a specific string (ANDed with transactionID filter)'\n )\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in ${config.getConfigPath()}/${\n config.FRODO_LOG_NOISEFILTER_FILENAME\n }`\n )\n )\n .action(async (host, user, password, options, command) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n let beginTs = Date.parse(options.beginTimestamp) / 1000;\n if (Date.parse(options.endTimestamp) / 1000 < beginTs) {\n printMessage('End timestamp can not be before begin timestamp', 'error');\n return;\n }\n const now = Date.now() / 1000;\n if (now - beginTs > LOG_TIME_WINDOW_MAX) {\n printMessage(\n 'Begin timestamp can not be more than 30 days in the past',\n 'error'\n );\n return;\n }\n let intermediateEndTs = 0;\n printMessage(\n `Fetching ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}]...`\n );\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n\n do {\n intermediateEndTs = beginTs + LOG_TIME_WINDOW_INCREMENT;\n await fetchLogs(\n command.opts().sources,\n new Date(beginTs * 1000).toISOString(),\n new Date(intermediateEndTs * 1000).toISOString(),\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n command.opts().searchString,\n null,\n config.getNoiseFilters(options.defaults)\n );\n beginTs = intermediateEndTs;\n } while (intermediateEndTs < Date.parse(options.endTimestamp) / 1000);\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SACEC,YADF,EAEEC,iBAFF,EAGEC,GAHF,EAIEC,KAJF,QAKO,uBALP;AAMA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,OAAO,KAAKC,MAAZ,MAAwB,oBAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC,cAAF;EAAkBC,SAAlB;EAA6BC;AAA7B,IAA8CP,GAApD;AACA,MAAM;EAAEQ,oBAAF;EAAwBC;AAAxB,IAAkDV,iBAAxD;AACA,MAAM;EAAEW;AAAF,IAAgBZ,YAAtB;AAEA,MAAMa,kBAAkB,GAAG,OAA3B;AACA,MAAMC,iBAAiB,GAAG,IAA1B;AACA,MAAMC,mBAAmB,GAAGF,kBAA5B;AACA,MAAMG,yBAAyB,GAAGF,iBAAlC;AAEA,MAAMG,OAAO,GAAG,IAAInB,OAAJ,CAAY,kBAAZ,CAAhB;AACAmB,OAAO,CACJC,WADH,CAEI;AACJ,wGAHA,EAKGC,UALH,CAKc,YALd,EAK4B,MAL5B,EAMGC,WANH,CAMehB,MAAM,CAACiB,aANtB,EAOGD,WAPH,CAOehB,MAAM,CAACkB,YAPtB,EAQGF,WARH,CAQehB,MAAM,CAACmB,gBARtB,EASGC,SATH,CASapB,MAAM,CAACqB,cATpB,EAUGD,SAVH,CAUapB,MAAM,CAACsB,cAVpB,EAWGF,SAXH,CAYI,IAAIzB,MAAJ,CACE,qBADF,EAEE;AACN;AACA;AACA;AACA,WANI,EAOE4B,OAPF,CAOU,OAPV,EAOoB,GAAElB,YAAY,CAAC,OAAD,CAAU,EA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L,OAAN,GAAgBxC,mBAApB,EAAyC;IACvCT,YAAY,CACV,0DADU,EAEV,OAFU,CAAZ;IAIA;EACD;;EACD,IAAIuD,iBAAiB,GAAG,CAAxB;EACAvD,YAAY,CACT,sDACC6B,OAAO,CAAC2B,IAAR,GAAeC,OAChB,gBAAetD,YAAY,CAAC0B,OAAO,CAAC2B,IAAR,GAAeE,KAAhB,CAAuB,MAHzC,CAAZ;EAKA,IAAI5B,mBAAJ,EAAyB,MAAMzB,qBAAqB,EAA3B,CAtD+B,CAsDA;;EAExD,GAAG;IACDkD,iBAAiB,GAAGN,OAAO,GAAGvC,yBAA9B;IACA,MAAMR,SAAS,CACb2B,OAAO,CAAC2B,IAAR,GAAeC,OADF,EAEb,IAAIP,IAAJ,CAASD,OAAO,GAAG,IAAnB,EAAyBU,WAAzB,EAFa,EAGb,IAAIT,IAAJ,CAASK,iBAAiB,GAAG,IAA7B,EAAmCI,WAAnC,EAHa,EAIbxD,YAAY,CAAC0B,OAAO,CAAC2B,IAAR,GAAeE,KAAhB,CAJC,EAKb7B,OAAO,CAAC2B,IAAR,GAAeI,aALF,EAMb/B,OAAO,CAAC2B,IAAR,GAAeK,YANF,EAOb,IAPa,EAQb9D,MAAM,CAAC+D,eAAP,CAAuBlC,OAAO,CAACmC,QAA/B,CARa,CAAf;IAUAd,OAAO,GAAGM,iBAAV;EACD,CAbD,QAaSA,iBAAiB,GAAGL,IAAI,CAACC,KAAL,CAAWvB,OAAO,CAACyB,YAAnB,IAAmC,IAbhE;AAcD,CAtHH;AAwHA1C,OAAO,CAACwC,KAAR"}
|
|
1
|
+
{"version":3,"file":"logs-fetch.js","names":["Command","Option","Authenticate","ConnectionProfile","Log","state","common","config","printMessage","provisionCreds","fetchLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","SECONDS_IN_30_DAYS","SECONDS_IN_1_HOUR","LOG_TIME_WINDOW_MAX","LOG_TIME_WINDOW_INCREMENT","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","sourcesOptionM","default","getConfigPath","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","credsFromParameters","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","now","Date","beginTimestamp","tempStartDate","setTime","toISOString","tempEndDate","endTimestamp","beginTs","parse","intermediateEndTs","opts","sources","level","transactionId","searchString","getNoiseFilters","defaults"],"sources":["cli/logging/logs-fetch.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, fetchLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst SECONDS_IN_30_DAYS = 2592000;\nconst SECONDS_IN_1_HOUR = 3600;\nconst LOG_TIME_WINDOW_MAX = SECONDS_IN_30_DAYS;\nconst LOG_TIME_WINDOW_INCREMENT = SECONDS_IN_1_HOUR;\n\nconst program = new Command('frodo logs fetch');\nprogram\n .description(\n 'Fetch Identity Cloud logs between a specified begin and end time period.\\\n WARNING: depending on filters and time period specified, this could take substantial time to complete.'\n )\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .addOption(common.sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option(\n '-b, --begin-timestamp <beginTs>',\n 'Begin timestamp for period (in ISO8601, example: \"2022-10-13T19:06:28Z\", or \"2022-09.30\". \\\nCannot be more than 30 days in the past. If not specified, logs from one hour ago are fetched \\\n(-e is ignored)'\n )\n )\n .addOption(\n new Option(\n '-e, --end-timestamp <endTs>',\n 'End timestamp for period. Default: \"now\"'\n )\n )\n .addOption(\n new Option(\n '-s, --search-string <ss>',\n 'Filter by a specific string (ANDed with transactionID filter)'\n )\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in ${config.getConfigPath()}/${\n config.FRODO_LOG_NOISEFILTER_FILENAME\n }`\n )\n )\n .action(async (host, user, password, options, command) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n const now = Date.now() / 1000;\n if (\n typeof options.beginTimestamp === 'undefined' ||\n !options.beginTimestamp\n ) {\n // no beginTimestamp value specified, default is 1 hour ago\n const tempStartDate = new Date();\n tempStartDate.setTime((now - SECONDS_IN_1_HOUR) * 1000);\n options.beginTimestamp = tempStartDate.toISOString();\n // also override endTimestamp to now\n const tempEndDate = new Date();\n tempEndDate.setTime(now * 1000);\n options.endTimestamp = tempEndDate;\n printMessage(\n 'No timestamps specified, defaulting to logs from 1 hour ago',\n 'info'\n );\n }\n if (typeof options.endTimestamp === 'undefined' || !options.endTimestamp) {\n // no endTimestamp value specified, default is now\n options.endTimestamp = now * 1000;\n printMessage(\n 'No end timestamp specified, defaulting end timestamp to \"now\"',\n 'info'\n );\n }\n let beginTs = Date.parse(options.beginTimestamp) / 1000;\n if (Date.parse(options.endTimestamp) / 1000 < beginTs) {\n printMessage('End timestamp can not be before begin timestamp', 'error');\n return;\n }\n if (now - beginTs > LOG_TIME_WINDOW_MAX) {\n printMessage(\n 'Begin timestamp can not be more than 30 days in the past',\n 'error'\n );\n return;\n }\n let intermediateEndTs = 0;\n printMessage(\n `Fetching ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}]...`\n );\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n\n do {\n intermediateEndTs = beginTs + LOG_TIME_WINDOW_INCREMENT;\n await fetchLogs(\n command.opts().sources,\n new Date(beginTs * 1000).toISOString(),\n new Date(intermediateEndTs * 1000).toISOString(),\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n command.opts().searchString,\n null,\n config.getNoiseFilters(options.defaults)\n );\n beginTs = intermediateEndTs;\n } while (intermediateEndTs < Date.parse(options.endTimestamp) / 1000);\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SACEC,YADF,EAEEC,iBAFF,EAGEC,GAHF,EAIEC,KAJF,QAKO,uBALP;AAMA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,OAAO,KAAKC,MAAZ,MAAwB,oBAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC,cAAF;EAAkBC,SAAlB;EAA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|
|
14
14
|
getTokens
|
|
15
15
|
} = Authenticate;
|
|
16
16
|
const program = new Command('frodo logs list');
|
|
17
|
-
program.description('List available ID Cloud log sources.').helpOption('-h, --help', 'Help').addArgument(common.hostArgumentM).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.insecureOption).action(async (host, user, password, options) => {
|
|
17
|
+
program.description('List available ID Cloud log sources.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.insecureOption).action(async (host, user, password, options) => {
|
|
18
18
|
let credsFromParameters = true;
|
|
19
19
|
state.default.session.setTenant(host);
|
|
20
20
|
state.default.session.setUsername(user);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-list.js","names":["Authenticate","ConnectionProfile","Log","state","Command","printMessage","common","provisionCreds","getLogSources","getConnectionProfile","saveConnectionProfile","getTokens","program","description","helpOption","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","action","host","user","password","options","credsFromParameters","default","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","sources","length","forEach","source","parse"],"sources":["cli/logging/logs-list.ts"],"sourcesContent":["import {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport { Command } from 'commander';\nimport { printMessage } from '../../utils/Console';\nimport * as common from '../cmd_common';\n\nconst { provisionCreds, getLogSources } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo logs list');\nprogram\n .description('List available ID Cloud log sources.')\n .helpOption('-h, --help', 'Help')\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .action(async (host, user, password, options) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n printMessage('Listing available ID Cloud log sources...');\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n\n const sources = await getLogSources();\n if (sources.length === 0) {\n printMessage(\n \"Can't get sources, possible cause - wrong API key or secret\",\n 'error'\n );\n } else {\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n printMessage('Available log sources:');\n sources.forEach((source) => {\n printMessage(`${source}`, 'info');\n });\n printMessage('You can use any combination of comma separated sources.');\n printMessage('For example:');\n printMessage(`$ frodo logs tail -c am-core,idm-core ${host}`, 'info');\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SACEA,YADF,EAEEC,iBAFF,EAGEC,GAHF,EAIEC,KAJF,QAKO,uBALP;AAMA,SAASC,OAAT,QAAwB,WAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AAEA,MAAM;EAAEC,cAAF;EAAkBC;AAAlB,IAAoCN,GAA1C;AACA,MAAM;EAAEO,oBAAF;EAAwBC;AAAxB,IAAkDT,iBAAxD;AACA,MAAM;EAAEU;AAAF,IAAgBX,YAAtB;AAEA,MAAMY,OAAO,GAAG,IAAIR,OAAJ,CAAY,iBAAZ,CAAhB;AACAQ,OAAO,CACJC,WADH,CACe,sCADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,
|
|
1
|
+
{"version":3,"file":"logs-list.js","names":["Authenticate","ConnectionProfile","Log","state","Command","printMessage","common","provisionCreds","getLogSources","getConnectionProfile","saveConnectionProfile","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","action","host","user","password","options","credsFromParameters","default","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","sources","length","forEach","source","parse"],"sources":["cli/logging/logs-list.ts"],"sourcesContent":["import {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport { Command } from 'commander';\nimport { printMessage } from '../../utils/Console';\nimport * as common from '../cmd_common';\n\nconst { provisionCreds, getLogSources } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo logs list');\nprogram\n .description('List available ID Cloud log sources.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .action(async (host, user, password, options) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n printMessage('Listing available ID Cloud log sources...');\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n\n const sources = await getLogSources();\n if (sources.length === 0) {\n printMessage(\n \"Can't get sources, possible cause - wrong API key or secret\",\n 'error'\n );\n } else {\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n printMessage('Available log sources:');\n sources.forEach((source) => {\n printMessage(`${source}`, 'info');\n });\n printMessage('You can use any combination of comma separated sources.');\n printMessage('For example:');\n printMessage(`$ frodo logs tail -c am-core,idm-core ${host}`, 'info');\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SACEA,YADF,EAEEC,iBAFF,EAGEC,GAHF,EAIEC,KAJF,QAKO,uBALP;AAMA,SAASC,OAAT,QAAwB,WAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AAEA,MAAM;EAAEC,cAAF;EAAkBC;AAAlB,IAAoCN,GAA1C;AACA,MAAM;EAAEO,oBAAF;EAAwBC;AAAxB,IAAkDT,iBAAxD;AACA,MAAM;EAAEU;AAAF,IAAgBX,YAAtB;AAEA,MAAMY,OAAO,GAAG,IAAIR,OAAJ,CAAY,iBAAZ,CAAhB;AACAQ,OAAO,CACJC,WADH,CACe,sCADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeV,MAAM,CAACW,aAJtB,EAKGD,WALH,CAKeV,MAAM,CAACY,YALtB,EAMGF,WANH,CAMeV,MAAM,CAACa,gBANtB,EAOGC,SAPH,CAOad,MAAM,CAACe,cAPpB,EAQGC,MARH,CAQU,OAAOC,IAAP,EAAaC,IAAb,EAAmBC,QAAnB,EAA6BC,OAA7B,KAAyC;EAC/C,IAAIC,mBAAmB,GAAG,IAA1B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WAAtB,CAAkCG,IAAI,CAACV,QAAvC;IACD;;IACD,IAAI,MAAMd,SAAS,EAAnB,EAAuB;MACrB,MAAMiC,KAAK,GAAG,MAAMrC,cAAc,EAAlC;MACAJ,KAAK,CAACyB,OAAN,CAAcC,OAAd,CAAsBU,YAAtB,CAAmCK,KAAK,CAACC,UAAzC;MACA1C,KAAK,CAACyB,OAAN,CAAcC,OAAd,CAAsBW,eAAtB,CAAsCI,KAAK,CAACE,cAA5C;IACD;EACF;;EAED,MAAMC,OAAO,GAAG,MAAMvC,aAAa,EAAnC;;EACA,IAAIuC,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;IACxB3C,YAAY,CACV,6DADU,EAEV,OAFU,CAAZ;EAID,CALD,MAKO;IACL,IAAIsB,mBAAJ,EAAyB,MAAMjB,qBAAqB,EAA3B,CADpB,CACmD;;IACxDL,YAAY,CAAC,wBAAD,CAAZ;IACA0C,OAAO,CAACE,OAAR,CAAiBC,MAAD,IAAY;MAC1B7C,YAAY,CAAE,GAAE6C,MAAO,EAAX,EAAc,MAAd,CAAZ;IACD,CAFD;IAGA7C,YAAY,CAAC,yDAAD,CAAZ;IACAA,YAAY,CAAC,cAAD,CAAZ;IACAA,YAAY,CAAE,yCAAwCkB,IAAK,EAA/C,EAAkD,MAAlD,CAAZ;EACD;AACF,CA7DH;AA+DAX,OAAO,CAACuC,KAAR"}
|
|
@@ -16,7 +16,7 @@ const {
|
|
|
16
16
|
getTokens
|
|
17
17
|
} = Authenticate;
|
|
18
18
|
const program = new Command('frodo logs tail');
|
|
19
|
-
program.description('Tail Identity Cloud logs.').helpOption('-h, --help', 'Help').addArgument(common.hostArgumentM).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.insecureOption).addOption(common.sourcesOptionM).addOption(new Option('-l, --level <level>', 'Set log level filter. You can specify the level as a number or a string. \
|
|
19
|
+
program.description('Tail Identity Cloud logs.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.insecureOption).addOption(common.sourcesOptionM).addOption(new Option('-l, --level <level>', 'Set log level filter. You can specify the level as a number or a string. \
|
|
20
20
|
Following values are possible (values on the same line are equivalent): \
|
|
21
21
|
\n0, SEVERE, FATAL, or ERROR\n1, WARNING, WARN or CONFIG\
|
|
22
22
|
\n2, INFO or INFORMATION\n3, DEBUG, FINE, FINER or FINEST\
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-tail.js","names":["Command","Option","Authenticate","ConnectionProfile","Log","state","common","config","printMessage","provisionCreds","tailLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","program","description","helpOption","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","sourcesOptionM","default","getConfigPath","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","credsFromParameters","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","opts","sources","level","transactionId","getNoiseFilters","defaults","parse"],"sources":["cli/logging/logs-tail.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, tailLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo logs tail');\nprogram\n .description('Tail Identity Cloud logs.')\n .helpOption('-h, --help', 'Help')\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .addOption(common.sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in ${config.getConfigPath()}/${\n config.FRODO_LOG_NOISEFILTER_FILENAME\n }`\n )\n )\n .action(async (host, user, password, options, command) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n printMessage(\n `Tailing ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}]...`\n );\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n await tailLogs(\n command.opts().sources,\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n null,\n config.getNoiseFilters(options.defaults)\n );\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SACEC,YADF,EAEEC,iBAFF,EAGEC,GAHF,EAIEC,KAJF,QAKO,uBALP;AAMA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,OAAO,KAAKC,MAAZ,MAAwB,oBAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC,cAAF;EAAkBC,QAAlB;EAA4BC;AAA5B,IAA6CP,GAAnD;AACA,MAAM;EAAEQ,oBAAF;EAAwBC;AAAxB,IAAkDV,iBAAxD;AACA,MAAM;EAAEW;AAAF,IAAgBZ,YAAtB;AAEA,MAAMa,OAAO,GAAG,IAAIf,OAAJ,CAAY,iBAAZ,CAAhB;AACAe,OAAO,CACJC,WADH,CACe,2BADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,
|
|
1
|
+
{"version":3,"file":"logs-tail.js","names":["Command","Option","Authenticate","ConnectionProfile","Log","state","common","config","printMessage","provisionCreds","tailLogs","resolveLevel","getConnectionProfile","saveConnectionProfile","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","userArgument","passwordArgument","addOption","insecureOption","sourcesOptionM","default","getConfigPath","FRODO_LOG_NOISEFILTER_FILENAME","action","host","user","password","options","command","credsFromParameters","session","setTenant","setUsername","setPassword","setAllowInsecureConnection","insecure","conn","tenant","key","secret","setLogApiKey","setLogApiSecret","username","getUsername","getPassword","creds","api_key_id","api_key_secret","opts","sources","level","transactionId","getNoiseFilters","defaults","parse"],"sources":["cli/logging/logs-tail.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport {\n Authenticate,\n ConnectionProfile,\n Log,\n state,\n} from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport * as config from '../../utils/Config';\nimport { printMessage } from '../../utils/Console';\n\nconst { provisionCreds, tailLogs, resolveLevel } = Log;\nconst { getConnectionProfile, saveConnectionProfile } = ConnectionProfile;\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo logs tail');\nprogram\n .description('Tail Identity Cloud logs.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.insecureOption)\n .addOption(common.sourcesOptionM)\n .addOption(\n new Option(\n '-l, --level <level>',\n 'Set log level filter. You can specify the level as a number or a string. \\\nFollowing values are possible (values on the same line are equivalent): \\\n\\n0, SEVERE, FATAL, or ERROR\\n1, WARNING, WARN or CONFIG\\\n\\n2, INFO or INFORMATION\\n3, DEBUG, FINE, FINER or FINEST\\\n\\n4 or ALL'\n ).default('ERROR', `${resolveLevel('ERROR')}`)\n )\n .addOption(\n new Option('-t, --transaction-id <txid>', 'Filter by transactionId')\n )\n .addOption(\n new Option('-d, --defaults', 'Use default logging noise filters').default(\n false,\n `Use custom logging noise filters defined in ${config.getConfigPath()}/${\n config.FRODO_LOG_NOISEFILTER_FILENAME\n }`\n )\n )\n .action(async (host, user, password, options, command) => {\n let credsFromParameters = true;\n state.default.session.setTenant(host);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setAllowInsecureConnection(options.insecure);\n const conn = await getConnectionProfile();\n state.default.session.setTenant(conn.tenant);\n if (conn.key != null && conn.secret != null) {\n credsFromParameters = false;\n state.default.session.setLogApiKey(conn.key);\n state.default.session.setLogApiSecret(conn.secret);\n } else {\n if (conn.username == null && conn.password == null) {\n if (\n !state.default.session.getUsername() &&\n !state.default.session.getPassword()\n ) {\n credsFromParameters = false;\n printMessage(\n 'User credentials not specified as parameters and no saved API key and secret found!',\n 'warn'\n );\n return;\n }\n } else {\n state.default.session.setUsername(conn.username);\n state.default.session.setPassword(conn.password);\n }\n if (await getTokens()) {\n const creds = await provisionCreds();\n state.default.session.setLogApiKey(creds.api_key_id);\n state.default.session.setLogApiSecret(creds.api_key_secret);\n }\n }\n printMessage(\n `Tailing ID Cloud logs from the following sources: ${\n command.opts().sources\n } and levels [${resolveLevel(command.opts().level)}]...`\n );\n if (credsFromParameters) await saveConnectionProfile(); // save new values if they were specified on CLI\n await tailLogs(\n command.opts().sources,\n resolveLevel(command.opts().level),\n command.opts().transactionId,\n null,\n config.getNoiseFilters(options.defaults)\n );\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SACEC,YADF,EAEEC,iBAFF,EAGEC,GAHF,EAIEC,KAJF,QAKO,uBALP;AAMA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,OAAO,KAAKC,MAAZ,MAAwB,oBAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC,cAAF;EAAkBC,QAAlB;EAA4BC;AAA5B,IAA6CP,GAAnD;AACA,MAAM;EAAEQ,oBAAF;EAAwBC;AAAxB,IAAkDV,iBAAxD;AACA,MAAM;EAAEW;AAAF,IAAgBZ,YAAtB;AAEA,MAAMa,OAAO,GAAG,IAAIf,OAAJ,CAAY,iBAAZ,CAAhB;AACAe,OAAO,CACJC,WADH,CACe,2BADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeb,MAAM,CAACc,aAJtB,EAKGD,WALH,CAKeb,MAAM,CAACe,YALtB,EAMGF,WANH,CAMeb,MAAM,CAACgB,gBANtB,EAOGC,SAPH,CAOajB,MAAM,CAACkB,cAPpB,EAQGD,SARH,CAQajB,MAAM,CAACmB,cARpB,EASGF,SATH,CAUI,IAAItB,MAAJ,CACE,qBADF,EAEE;AACN;AACA;AACA;AACA,WANI,EAOEyB,OAPF,CAOU,OAPV,EAOoB,GAAEf,YAAY,CAAC,OAAD,CAAU,EAP5C,CAVJ,EAmBGY,SAnBH,CAoBI,IAAItB,MAAJ,CAAW,6BAAX,EAA0C,yBAA1C,CApBJ,EAsBGsB,SAtBH,CAuBI,IAAItB,MAAJ,CAAW,gBAAX,EAA6B,mCAA7B,EAAkEyB,OAAlE,CACE,KADF,EAEG,+CAA8CnB,MAAM,CAACoB,aAAP,EAAuB,IACpEpB,MAAM,CAACq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ACLH,KAAK,CAACqB,OAAN,CAAcU,OAAd,CAAsBE,WAAtB,CAAkCI,IAAI,CAACM,QAAvC;MACA3C,KAAK,CAACqB,OAAN,CAAcU,OAAd,CAAsBG,WAAtB,CAAkCG,IAAI,CAACV,QAAvC;IACD;;IACD,IAAI,MAAMlB,SAAS,EAAnB,EAAuB;MACrB,MAAMqC,KAAK,GAAG,MAAM1C,cAAc,EAAlC;MACAJ,KAAK,CAACqB,OAAN,CAAcU,OAAd,CAAsBU,YAAtB,CAAmCK,KAAK,CAACC,UAAzC;MACA/C,KAAK,CAACqB,OAAN,CAAcU,OAAd,CAAsBW,eAAtB,CAAsCI,KAAK,CAACE,cAA5C;IACD;EACF;;EACD7C,YAAY,CACT,qDACC0B,OAAO,CAACoB,IAAR,GAAeC,OAChB,gBAAe5C,YAAY,CAACuB,OAAO,CAACoB,IAAR,GAAeE,KAAhB,CAAuB,MAHzC,CAAZ;EAKA,IAAIrB,mBAAJ,EAAyB,MAAMtB,qBAAqB,EAA3B,CAxC+B,CAwCA;;EACxD,MAAMH,QAAQ,CACZwB,OAAO,CAACoB,IAAR,GAAeC,OADH,EAEZ5C,YAAY,CAACuB,OAAO,CAACoB,IAAR,GAAeE,KAAhB,CAFA,EAGZtB,OAAO,CAACoB,IAAR,GAAeG,aAHH,EAIZ,IAJY,EAKZlD,MAAM,CAACmD,eAAP,CAAuBzB,OAAO,CAAC0B,QAA/B,CALY,CAAd;AAOD,CA9EH;AAgFA5C,OAAO,CAAC6C,KAAR"}
|
package/esm/cli/logging/logs.js
CHANGED
|
@@ -8,7 +8,8 @@ export default function setup() {
|
|
|
8
8
|
const program = new Command('logs').summary('List/View Identity Cloud logs').description(`View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.`).helpOption('-h, --help', 'Help').executableDir(__dirname);
|
|
9
9
|
program.command('list', 'List available ID Cloud log sources.').showHelpAfterError();
|
|
10
10
|
program.command('tail', 'Tail Identity Cloud logs.').showHelpAfterError();
|
|
11
|
-
program.command('fetch', 'Fetch Identity Cloud logs for a given time period.').showHelpAfterError();
|
|
11
|
+
program.command('fetch', 'Fetch Identity Cloud logs for a given time period.').showHelpAfterError(); // program.showHelpAfterError();
|
|
12
|
+
|
|
12
13
|
return program;
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=logs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","names":["Command","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","summary","description","helpOption","executableDir","command","showHelpAfterError"],"sources":["cli/logging/logs.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('logs')\n .summary('List/View Identity Cloud logs')\n .description(\n `View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.`\n )\n .helpOption('-h, --help', 'Help')\n .executableDir(__dirname);\n\n program\n .command('list', 'List available ID Cloud log sources.')\n .showHelpAfterError();\n program.command('tail', 'Tail Identity Cloud logs.').showHelpAfterError();\n program\n .command('fetch', 'Fetch Identity Cloud logs for a given time period.')\n .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,MAAZ,EACbU,OADa,CACL,+BADK,EAEbC,WAFa,CAGX,oJAHW,EAKbC,UALa,CAKF,YALE,EAKY,MALZ,EAMbC,aANa,CAMCV,SAND,CAAhB;EAQAM,OAAO,CACJK,OADH,CACW,MADX,EACmB,sCADnB,EAEGC,kBAFH;EAGAN,OAAO,CAACK,OAAR,CAAgB,MAAhB,EAAwB,2BAAxB,EAAqDC,kBAArD;EACAN,OAAO,CACJK,OADH,CACW,OADX,EACoB,oDADpB,EAEGC,kBAFH
|
|
1
|
+
{"version":3,"file":"logs.js","names":["Command","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","summary","description","helpOption","executableDir","command","showHelpAfterError"],"sources":["cli/logging/logs.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('logs')\n .summary('List/View Identity Cloud logs')\n .description(\n `View Identity Cloud logs. If valid tenant admin credentials are specified, a log API key and secret are automatically created for that admin user.`\n )\n .helpOption('-h, --help', 'Help')\n .executableDir(__dirname);\n\n program\n .command('list', 'List available ID Cloud log sources.')\n .showHelpAfterError();\n program.command('tail', 'Tail Identity Cloud logs.').showHelpAfterError();\n program\n .command('fetch', 'Fetch Identity Cloud logs for a given time period.')\n .showHelpAfterError();\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,MAAZ,EACbU,OADa,CACL,+BADK,EAEbC,WAFa,CAGX,oJAHW,EAKbC,UALa,CAKF,YALE,EAKY,MALZ,EAMbC,aANa,CAMCV,SAND,CAAhB;EAQAM,OAAO,CACJK,OADH,CACW,MADX,EACmB,sCADnB,EAEGC,kBAFH;EAGAN,OAAO,CAACK,OAAR,CAAgB,MAAhB,EAAwB,2BAAxB,EAAqDC,kBAArD;EACAN,OAAO,CACJK,OADH,CACW,OADX,EACoB,oDADpB,EAEGC,kBAFH,GAb8B,CAgB9B;;EACA,OAAON,OAAP;AACD"}
|