@rockcarver/frodo-cli 2.0.0-24 → 2.0.0-26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.0.0-25] - 2023-10-19
|
|
11
|
+
|
|
12
|
+
## [2.0.0-24] - 2023-10-15
|
|
13
|
+
|
|
10
14
|
## [2.0.0-23] - 2023-10-14
|
|
11
15
|
|
|
12
16
|
## [2.0.0-22] - 2023-10-12
|
|
@@ -1361,7 +1365,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1361
1365
|
- Fixed problem with adding connection profiles
|
|
1362
1366
|
- Miscellaneous bug fixes
|
|
1363
1367
|
|
|
1364
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-
|
|
1368
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-25...HEAD
|
|
1369
|
+
|
|
1370
|
+
[2.0.0-25]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-24...v2.0.0-25
|
|
1371
|
+
|
|
1372
|
+
[2.0.0-24]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-23...v2.0.0-24
|
|
1365
1373
|
|
|
1366
1374
|
[2.0.0-23]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-22...v2.0.0-23
|
|
1367
1375
|
|
|
@@ -14,25 +14,25 @@ async (host, realm, user, password, options, command) => {
|
|
|
14
14
|
// import by id
|
|
15
15
|
if (options.file && options.cotId && (await getTokens())) {
|
|
16
16
|
verboseMessage(`Importing circle of trust "${options.cotId}" into realm "${state.getRealm()}"...`);
|
|
17
|
-
const outcome = importCircleOfTrustFromFile(options.cotId, options.file);
|
|
17
|
+
const outcome = await importCircleOfTrustFromFile(options.cotId, options.file);
|
|
18
18
|
if (!outcome) process.exitCode = 1;
|
|
19
19
|
}
|
|
20
20
|
// --all -a
|
|
21
21
|
else if (options.all && options.file && (await getTokens())) {
|
|
22
22
|
verboseMessage(`Importing all circles of trust from a single file (${options.file})...`);
|
|
23
|
-
const outcome = importCirclesOfTrustFromFile(options.file);
|
|
23
|
+
const outcome = await importCirclesOfTrustFromFile(options.file);
|
|
24
24
|
if (!outcome) process.exitCode = 1;
|
|
25
25
|
}
|
|
26
26
|
// --all-separate -A
|
|
27
27
|
else if (options.allSeparate && !options.file && (await getTokens())) {
|
|
28
28
|
verboseMessage('Importing all circles of trust from separate files (*.saml.json) in current directory...');
|
|
29
|
-
const outcome = importCirclesOfTrustFromFiles();
|
|
29
|
+
const outcome = await importCirclesOfTrustFromFiles();
|
|
30
30
|
if (!outcome) process.exitCode = 1;
|
|
31
31
|
}
|
|
32
32
|
// import first from file
|
|
33
33
|
else if (options.file && (await getTokens())) {
|
|
34
34
|
verboseMessage(`Importing first circle of trust from file "${options.file}" into realm "${state.getRealm()}"...`);
|
|
35
|
-
const outcome = importFirstCircleOfTrustFromFile(options.file);
|
|
35
|
+
const outcome = await importFirstCircleOfTrustFromFile(options.file);
|
|
36
36
|
if (!outcome) process.exitCode = 1;
|
|
37
37
|
}
|
|
38
38
|
// unrecognized combination of options or no options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saml-cot-import.js","names":["frodo","state","Option","importCircleOfTrustFromFile","importCirclesOfTrustFromFile","importCirclesOfTrustFromFiles","importFirstCircleOfTrustFromFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","cotId","getRealm","outcome","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/saml/saml-cot-import.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importCircleOfTrustFromFile,\n importCirclesOfTrustFromFile,\n importCirclesOfTrustFromFiles,\n importFirstCircleOfTrustFromFile,\n} from '../../ops/CirclesOfTrustOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo saml cot import');\n\nprogram\n .description('Import SAML circles of trust.')\n .addOption(\n new Option(\n '-i, --cot-id <cot-id>',\n 'Circle of trust id. If specified, only one circle of trust is imported and the options -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import the circle(s) of trust from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all circles of trust from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all circles of trust from separate files (*.cot.saml.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .action(\n // implement program logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.cotId && (await getTokens())) {\n verboseMessage(\n `Importing circle of trust \"${\n options.cotId\n }\" into realm \"${state.getRealm()}\"...`\n );\n const outcome = importCircleOfTrustFromFile(\n options.cotId,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all circles of trust from a single file (${options.file})...`\n );\n const outcome = importCirclesOfTrustFromFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all circles of trust from separate files (*.saml.json) in current directory...'\n );\n const outcome = importCirclesOfTrustFromFiles();\n if (!outcome) process.exitCode = 1;\n }\n // import first from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first circle of trust from file \"${\n options.file\n }\" into realm \"${state.getRealm()}\"...`\n );\n const outcome = importFirstCircleOfTrustFromFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end program logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,2BAA2B,EAC3BC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,gCAAgC,QAC3B,6BAA6B;AACpC,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGV,KAAK,CAACW,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,uBAAuB,CAAC;AAEzDG,OAAO,CACJC,WAAW,CAAC,+BAA+B,CAAC,CAC5CC,SAAS,CACR,IAAIZ,MAAM,CACR,uBAAuB,EACvB,+GACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,yDACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,WAAW,EACX,gEACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,oBAAoB,EACpB,oHACF,CACF,CAAC,CACAa,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD;EACA,IAAID,OAAO,CAACG,IAAI,IAAIH,OAAO,CAACI,KAAK,KAAK,MAAMd,SAAS,CAAC,CAAC,CAAC,EAAE;IACxDF,cAAc,CACX,8BACCY,OAAO,CAACI,KACT,iBAAgBvB,KAAK,CAACwB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACD,MAAMC,OAAO,
|
|
1
|
+
{"version":3,"file":"saml-cot-import.js","names":["frodo","state","Option","importCircleOfTrustFromFile","importCirclesOfTrustFromFile","importCirclesOfTrustFromFiles","importFirstCircleOfTrustFromFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","cotId","getRealm","outcome","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/saml/saml-cot-import.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n importCircleOfTrustFromFile,\n importCirclesOfTrustFromFile,\n importCirclesOfTrustFromFiles,\n importFirstCircleOfTrustFromFile,\n} from '../../ops/CirclesOfTrustOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo saml cot import');\n\nprogram\n .description('Import SAML circles of trust.')\n .addOption(\n new Option(\n '-i, --cot-id <cot-id>',\n 'Circle of trust id. If specified, only one circle of trust is imported and the options -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import the circle(s) of trust from.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all circles of trust from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all circles of trust from separate files (*.cot.saml.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .action(\n // implement program logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.cotId && (await getTokens())) {\n verboseMessage(\n `Importing circle of trust \"${\n options.cotId\n }\" into realm \"${state.getRealm()}\"...`\n );\n const outcome = await importCircleOfTrustFromFile(\n options.cotId,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all circles of trust from a single file (${options.file})...`\n );\n const outcome = await importCirclesOfTrustFromFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all circles of trust from separate files (*.saml.json) in current directory...'\n );\n const outcome = await importCirclesOfTrustFromFiles();\n if (!outcome) process.exitCode = 1;\n }\n // import first from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first circle of trust from file \"${\n options.file\n }\" into realm \"${state.getRealm()}\"...`\n );\n const outcome = await importFirstCircleOfTrustFromFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end program logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,2BAA2B,EAC3BC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,gCAAgC,QAC3B,6BAA6B;AACpC,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGV,KAAK,CAACW,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,uBAAuB,CAAC;AAEzDG,OAAO,CACJC,WAAW,CAAC,+BAA+B,CAAC,CAC5CC,SAAS,CACR,IAAIZ,MAAM,CACR,uBAAuB,EACvB,+GACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,yDACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,WAAW,EACX,gEACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,o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KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CF,cAAc,CACX,8CACCY,OAAO,CAACG,IACT,iBAAgBtB,KAAK,CAACwB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACD,MAAMC,OAAO,GAAG,MAAMpB,gCAAgC,CAACc,OAAO,CAACG,IAAI,CAAC;IACpE,IAAI,CAACG,OAAO,EAAEC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHrB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACmB,IAAI,CAAC,CAAC;IACdJ,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHhB,OAAO,CAACoB,KAAK,CAAC,CAAC"}
|
|
@@ -166,19 +166,17 @@ export async function importCircleOfTrustFromFile(cotId, file) {
|
|
|
166
166
|
let outcome = false;
|
|
167
167
|
const filePath = getFilePath(file);
|
|
168
168
|
showSpinner(`Importing circle of trust ${cotId} from ${filePath}...`);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
});
|
|
169
|
+
try {
|
|
170
|
+
const data = fs.readFileSync(filePath, 'utf8');
|
|
171
|
+
const fileData = JSON.parse(data);
|
|
172
|
+
await importCircleOfTrust(cotId, fileData);
|
|
173
|
+
outcome = true;
|
|
174
|
+
succeedSpinner(`Imported circle of trust ${cotId} from ${filePath}.`);
|
|
175
|
+
} catch (error) {
|
|
176
|
+
var _error$response;
|
|
177
|
+
failSpinner(`Error importing circle of trust ${cotId} from ${filePath}.`);
|
|
178
|
+
printMessage(((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data) || error, 'error');
|
|
179
|
+
}
|
|
182
180
|
return outcome;
|
|
183
181
|
}
|
|
184
182
|
|
|
@@ -190,19 +188,17 @@ export async function importFirstCircleOfTrustFromFile(file) {
|
|
|
190
188
|
let outcome = false;
|
|
191
189
|
const filePath = getFilePath(file);
|
|
192
190
|
showSpinner(`Importing first circle of trust from ${filePath}...`);
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
});
|
|
191
|
+
try {
|
|
192
|
+
const data = fs.readFileSync(filePath, 'utf8');
|
|
193
|
+
const fileData = JSON.parse(data);
|
|
194
|
+
await importFirstCircleOfTrust(fileData);
|
|
195
|
+
outcome = true;
|
|
196
|
+
succeedSpinner(`Imported first circle of trust from ${filePath}.`);
|
|
197
|
+
} catch (error) {
|
|
198
|
+
var _error$response2;
|
|
199
|
+
failSpinner(`Error importing first circle of trust from ${filePath}.`);
|
|
200
|
+
printMessage(((_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data) || error, 'error');
|
|
201
|
+
}
|
|
206
202
|
return outcome;
|
|
207
203
|
}
|
|
208
204
|
|
|
@@ -214,19 +210,17 @@ export async function importCirclesOfTrustFromFile(file) {
|
|
|
214
210
|
let outcome = false;
|
|
215
211
|
const filePath = getFilePath(file);
|
|
216
212
|
showSpinner(`Importing circles of trust from ${filePath}...`);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
});
|
|
213
|
+
try {
|
|
214
|
+
const data = fs.readFileSync(filePath, 'utf8');
|
|
215
|
+
const fileData = JSON.parse(data);
|
|
216
|
+
await importCirclesOfTrust(fileData);
|
|
217
|
+
outcome = true;
|
|
218
|
+
succeedSpinner(`Imported circles of trust from ${filePath}.`);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
var _error$response3;
|
|
221
|
+
failSpinner(`Error importing circles of trust from ${filePath}.`);
|
|
222
|
+
printMessage(((_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data) || error, 'error');
|
|
223
|
+
}
|
|
230
224
|
return outcome;
|
|
231
225
|
}
|
|
232
226
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CirclesOfTrustOps.js","names":["frodo","state","fs","createProgressBar","createTable","debugMessage","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","getTypedFilename","saveJsonToFile","titleCase","getRealmName","getFilePath","getWorkingDirectory","utils","readCirclesOfTrust","exportCircleOfTrust","exportCirclesOfTrust","importCircleOfTrust","importCirclesOfTrust","importFirstCircleOfTrust","saml2","circlesOfTrust","getOneLineDescription","cotObj","description","_id","getTableHeaderMd","markdown","getTableRowMd","row","status","trustedProviders","map","provider","split","join","listCirclesOfTrust","long","outcome","cotList","error","sort","a","b","localeCompare","forEach","cot","table","push","toString","exportCircleOfTrustToFile","cotId","file","fileName","filePath","exportData","message","exportCirclesOfTrustToFile","getRealm","exportCirclesOfTrustToFiles","errors","cots","length","name","importCircleOfTrustFromFile","readFile","err","data","fileData","JSON","parse","_error$response","response","importFirstCircleOfTrustFromFile","_error$response2","importCirclesOfTrustFromFile","_error$response3","importCirclesOfTrustFromFiles","names","readdirSync","files","filter","toLowerCase","endsWith","total","readFileSync","count","Object","keys","saml"],"sources":["../../src/ops/CirclesOfTrustOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { type CircleOfTrustSkeleton } from '@rockcarver/frodo-lib/types/api/CirclesOfTrustApi';\nimport { type CirclesOfTrustExportInterface } from '@rockcarver/frodo-lib/types/ops/CirclesOfTrustOps';\nimport fs from 'fs';\n\nimport {\n createProgressBar,\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport {\n getTypedFilename,\n saveJsonToFile,\n titleCase,\n} from '../utils/ExportImportUtils';\n\nconst { getRealmName, getFilePath, getWorkingDirectory } = frodo.utils;\nconst {\n readCirclesOfTrust,\n exportCircleOfTrust,\n exportCirclesOfTrust,\n importCircleOfTrust,\n importCirclesOfTrust,\n importFirstCircleOfTrust,\n} = frodo.saml2.circlesOfTrust;\n\n/**\n * Get a one-line description of the circle of trust object\n * @param {CircleOfTrustSkeleton} cotObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(cotObj: CircleOfTrustSkeleton): string {\n const description = `[${cotObj._id['brightCyan']}]`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Name/Id | Status | Trusted Providers |\\n';\n markdown += '| ------- | ------ | ----------------- |';\n return markdown;\n}\n\n/**\n * Get a table-row of the circle of trust in markdown\n * @param {SocialIdpSkeleton} cotObj circle of trust object to describe\n * @returns {string} a table-row of the circle of trust in markdown\n */\nexport function getTableRowMd(cotObj: CircleOfTrustSkeleton): string {\n const row = `| ${cotObj._id} | ${\n cotObj.status === 'active'\n ? ':white_check_mark: `active`'\n : ':o: `inactive`'\n } | ${cotObj.trustedProviders\n .map((provider) => provider.split('|')[0])\n .join('<br>')} |`;\n return row;\n}\n\n/**\n * List entity providers\n * @param {String} long Long list format with details\n */\nexport async function listCirclesOfTrust(long = false): Promise<boolean> {\n let outcome = false;\n let cotList = [];\n try {\n cotList = await readCirclesOfTrust();\n } catch (error) {\n printMessage(`readCirclesOfTrust ERROR: ${error}`, 'error');\n printMessage(error, 'data');\n }\n cotList.sort((a, b) => a._id.localeCompare(b._id));\n if (!long) {\n cotList.forEach((cot) => {\n printMessage(`${cot._id}`, 'data');\n });\n outcome = true;\n } else {\n const table = createTable([\n 'Name'['brightCyan'],\n 'Description'['brightCyan'],\n 'Status'['brightCyan'],\n 'Trusted Providers'['brightCyan'],\n ]);\n cotList.forEach((cot) => {\n table.push([\n cot._id,\n cot.description,\n cot.status,\n cot.trustedProviders\n .map((provider) => provider.split('|')[0])\n .join('\\n'),\n ]);\n });\n printMessage(table.toString());\n outcome = true;\n }\n return outcome;\n}\n\n/**\n * Export a single circle of trust to file\n * @param {String} cotId circle of trust id/name\n * @param {String} file Optional filename\n */\nexport async function exportCircleOfTrustToFile(\n cotId: string,\n file: string = null\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.CirclesOfTrustOps.exportCircleOfTrustToFile: begin`);\n showSpinner(`Exporting ${cotId}...`);\n try {\n let fileName = getTypedFilename(cotId, 'cot.saml');\n if (file) {\n fileName = file;\n }\n const filePath = getFilePath(fileName, true);\n const exportData = await exportCircleOfTrust(cotId);\n saveJsonToFile(exportData, filePath);\n succeedSpinner(`Exported ${cotId} to ${filePath}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting ${cotId}: ${error.message}`);\n }\n debugMessage(`cli.CirclesOfTrustOps.exportCircleOfTrustToFile: end`);\n return outcome;\n}\n\n/**\n * Export all circles of trust to one file\n * @param {String} file Optional filename\n */\nexport async function exportCirclesOfTrustToFile(\n file: string = null\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.CirclesOfTrustOps.exportCirclesOfTrustToFile: begin`);\n showSpinner(`Exporting all circles of trust...`);\n try {\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}CirclesOfTrust`,\n 'cot.saml'\n );\n if (file) {\n fileName = file;\n }\n const filePath = getFilePath(fileName, true);\n const exportData = await exportCirclesOfTrust();\n saveJsonToFile(exportData, filePath);\n succeedSpinner(`Exported all circles of trust to ${filePath}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting circles of trust: ${error.message}`);\n }\n debugMessage(`cli.CirclesOfTrustOps.exportCirclesOfTrustToFile: end`);\n return outcome;\n}\n\n/**\n * Export all circles of trust to individual files\n */\nexport async function exportCirclesOfTrustToFiles(): Promise<boolean> {\n debugMessage(`cli.CirclesOfTrustOps.exportCirclesOfTrustToFiles: begin`);\n const errors = [];\n try {\n const cots: CircleOfTrustSkeleton[] = await readCirclesOfTrust();\n createProgressBar(cots.length, 'Exporting circles of trust...');\n for (const cot of cots) {\n const file = getTypedFilename(cot._id, 'cot.saml');\n try {\n const exportData: CirclesOfTrustExportInterface =\n await exportCircleOfTrust(cot._id);\n saveJsonToFile(exportData, getFilePath(file, true));\n updateProgressBar(`Exported ${cot.name}.`);\n } catch (error) {\n errors.push(error);\n updateProgressBar(`Error exporting ${cot.name}.`);\n }\n }\n stopProgressBar(`Export complete.`);\n } catch (error) {\n errors.push(error);\n stopProgressBar(`Error exporting circles of trust to files`);\n }\n debugMessage(`cli.CirclesOfTrustOps.exportCirclesOfTrustToFiles: end`);\n return 0 === errors.length;\n}\n\n/**\n * Import a SAML circle of trust by id/name from file\n * @param {String} cotId Circle of trust id/name\n * @param {String} file Import file name\n */\nexport async function importCircleOfTrustFromFile(\n cotId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n const filePath = getFilePath(file);\n showSpinner(`Importing circle of trust ${cotId} from ${filePath}...`);\n fs.readFile(filePath, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importCircleOfTrust(cotId, fileData);\n outcome = true;\n succeedSpinner(`Imported circle of trust ${cotId} from ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing circle of trust ${cotId} from ${filePath}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import first SAML circle of trust from file\n * @param {String} file Import file name\n */\nexport async function importFirstCircleOfTrustFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n const filePath = getFilePath(file);\n showSpinner(`Importing first circle of trust from ${filePath}...`);\n fs.readFile(filePath, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importFirstCircleOfTrust(fileData);\n outcome = true;\n succeedSpinner(`Imported first circle of trust from ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing first circle of trust from ${filePath}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import all SAML circles of trust from file\n * @param {String} file Import file name\n */\nexport async function importCirclesOfTrustFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n const filePath = getFilePath(file);\n showSpinner(`Importing circles of trust from ${filePath}...`);\n fs.readFile(filePath, 'utf8', async (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n await importCirclesOfTrust(fileData);\n outcome = true;\n succeedSpinner(`Imported circles of trust from ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing circles of trust from ${filePath}.`);\n printMessage(error.response?.data || error, 'error');\n }\n });\n return outcome;\n}\n\n/**\n * Import all SAML circles of trust from all *.cot.saml.json files in the current directory\n */\nexport async function importCirclesOfTrustFromFiles(): Promise<boolean> {\n const errors = [];\n try {\n debugMessage(`cli.CirclesOfTrustOps.importCirclesOfTrustFromFiles: begin`);\n const names = fs.readdirSync(getWorkingDirectory());\n const files = names\n .filter((name) => name.toLowerCase().endsWith('.cot.saml.json'))\n .map((name) => getFilePath(name));\n createProgressBar(files.length, 'Importing circles of trust...');\n let total = 0;\n for (const file of files) {\n try {\n const data = fs.readFileSync(file, 'utf8');\n const fileData: CirclesOfTrustExportInterface = JSON.parse(data);\n const count = Object.keys(fileData.saml.cot).length;\n total += count;\n await importCirclesOfTrust(fileData);\n updateProgressBar(`Imported ${count} circles of trust from ${file}`);\n } catch (error) {\n errors.push(error);\n updateProgressBar(`Error importing circles of trust from ${file}`);\n printMessage(error, 'error');\n }\n }\n stopProgressBar(\n `Imported ${total} circles of trust from ${files.length} files.`\n );\n } catch (error) {\n errors.push(error);\n stopProgressBar(`Error importing circles of trust from files.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.CirclesOfTrustOps.importCirclesOfTrustFromFiles: end`);\n return 0 === errors.length;\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,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0BAAyBlC,IAAK,EAAC,CAAC;MACtE,CAAC,CAAC,OAAOZ,KAAK,EAAE;QACdoB,MAAM,CAACZ,IAAI,CAACR,KAAK,CAAC;QAClBlC,iBAAiB,CAAE,yCAAwC8C,IAAK,EAAC,CAAC;QAClElD,YAAY,CAACsC,KAAK,EAAE,OAAO,CAAC;MAC9B;IACF;IACApC,eAAe,CACZ,YAAWgF,KAAM,0BAAyBJ,KAAK,CAAClB,MAAO,SAC1D,CAAC;EACH,CAAC,CAAC,OAAOtB,KAAK,EAAE;IACdoB,MAAM,CAACZ,IAAI,CAACR,KAAK,CAAC;IAClBpC,eAAe,CAAE,8CAA6C,CAAC;IAC/DF,YAAY,CAACsC,KAAK,EAAE,OAAO,CAAC;EAC9B;EACAxC,YAAY,CAAE,0DAAyD,CAAC;EACxE,OAAO,CAAC,KAAK4D,MAAM,CAACE,MAAM;AAC5B"}
|
|
1
|
+
{"version":3,"file":"CirclesOfTrustOps.js","names":["frodo","state","fs","createProgressBar","createTable","debugMessage","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","getTypedFilename","saveJsonToFile","titleCase","getRealmName","getFilePath","getWorkingDirectory","utils","readCirclesOfTrust","exportCircleOfTrust","exportCirclesOfTrust","importCircleOfTrust","importCirclesOfTrust","importFirstCircleOfTrust","saml2","circlesOfTrust","getOneLineDescription","cotObj","description","_id","getTableHeaderMd","markdown","getTableRowMd","row","status","trustedProviders","map","provider","split","join","listCirclesOfTrust","long","outcome","cotList","error","sort","a","b","localeCompare","forEach","cot","table","push","toString","exportCircleOfTrustToFile","cotId","file","fileName","filePath","exportData","message","exportCirclesOfTrustToFile","getRealm","exportCirclesOfTrustToFiles","errors","cots","length","name","importCircleOfTrustFromFile","data","readFileSync","fileData","JSON","parse","_error$response","response","importFirstCircleOfTrustFromFile","_error$response2","importCirclesOfTrustFromFile","_error$response3","importCirclesOfTrustFromFiles","names","readdirSync","files","filter","toLowerCase","endsWith","total","count","Object","keys","saml"],"sources":["../../src/ops/CirclesOfTrustOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { type CircleOfTrustSkeleton } from '@rockcarver/frodo-lib/types/api/CirclesOfTrustApi';\nimport { type CirclesOfTrustExportInterface } from '@rockcarver/frodo-lib/types/ops/CirclesOfTrustOps';\nimport fs from 'fs';\n\nimport {\n createProgressBar,\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport {\n getTypedFilename,\n saveJsonToFile,\n titleCase,\n} from '../utils/ExportImportUtils';\n\nconst { getRealmName, getFilePath, getWorkingDirectory } = frodo.utils;\nconst {\n readCirclesOfTrust,\n exportCircleOfTrust,\n exportCirclesOfTrust,\n importCircleOfTrust,\n importCirclesOfTrust,\n importFirstCircleOfTrust,\n} = frodo.saml2.circlesOfTrust;\n\n/**\n * Get a one-line description of the circle of trust object\n * @param {CircleOfTrustSkeleton} cotObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(cotObj: CircleOfTrustSkeleton): string {\n const description = `[${cotObj._id['brightCyan']}]`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Name/Id | Status | Trusted Providers |\\n';\n markdown += '| ------- | ------ | ----------------- |';\n return markdown;\n}\n\n/**\n * Get a table-row of the circle of trust in markdown\n * @param {SocialIdpSkeleton} cotObj circle of trust object to describe\n * @returns {string} a table-row of the circle of trust in markdown\n */\nexport function getTableRowMd(cotObj: CircleOfTrustSkeleton): string {\n const row = `| ${cotObj._id} | ${\n cotObj.status === 'active'\n ? ':white_check_mark: `active`'\n : ':o: `inactive`'\n } | ${cotObj.trustedProviders\n .map((provider) => provider.split('|')[0])\n .join('<br>')} |`;\n return row;\n}\n\n/**\n * List entity providers\n * @param {String} long Long list format with details\n */\nexport async function listCirclesOfTrust(long = false): Promise<boolean> {\n let outcome = false;\n let cotList = [];\n try {\n cotList = await readCirclesOfTrust();\n } catch (error) {\n printMessage(`readCirclesOfTrust ERROR: ${error}`, 'error');\n printMessage(error, 'data');\n }\n cotList.sort((a, b) => a._id.localeCompare(b._id));\n if (!long) {\n cotList.forEach((cot) => {\n printMessage(`${cot._id}`, 'data');\n });\n outcome = true;\n } else {\n const table = createTable([\n 'Name'['brightCyan'],\n 'Description'['brightCyan'],\n 'Status'['brightCyan'],\n 'Trusted Providers'['brightCyan'],\n ]);\n cotList.forEach((cot) => {\n table.push([\n cot._id,\n cot.description,\n cot.status,\n cot.trustedProviders\n .map((provider) => provider.split('|')[0])\n .join('\\n'),\n ]);\n });\n printMessage(table.toString());\n outcome = true;\n }\n return outcome;\n}\n\n/**\n * Export a single circle of trust to file\n * @param {String} cotId circle of trust id/name\n * @param {String} file Optional filename\n */\nexport async function exportCircleOfTrustToFile(\n cotId: string,\n file: string = null\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.CirclesOfTrustOps.exportCircleOfTrustToFile: begin`);\n showSpinner(`Exporting ${cotId}...`);\n try {\n let fileName = getTypedFilename(cotId, 'cot.saml');\n if (file) {\n fileName = file;\n }\n const filePath = getFilePath(fileName, true);\n const exportData = await exportCircleOfTrust(cotId);\n saveJsonToFile(exportData, filePath);\n succeedSpinner(`Exported ${cotId} to ${filePath}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting ${cotId}: ${error.message}`);\n }\n debugMessage(`cli.CirclesOfTrustOps.exportCircleOfTrustToFile: end`);\n return outcome;\n}\n\n/**\n * Export all circles of trust to one file\n * @param {String} file Optional filename\n */\nexport async function exportCirclesOfTrustToFile(\n file: string = null\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.CirclesOfTrustOps.exportCirclesOfTrustToFile: begin`);\n showSpinner(`Exporting all circles of trust...`);\n try {\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}CirclesOfTrust`,\n 'cot.saml'\n );\n if (file) {\n fileName = file;\n }\n const filePath = getFilePath(fileName, true);\n const exportData = await exportCirclesOfTrust();\n saveJsonToFile(exportData, filePath);\n succeedSpinner(`Exported all circles of trust to ${filePath}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting circles of trust: ${error.message}`);\n }\n debugMessage(`cli.CirclesOfTrustOps.exportCirclesOfTrustToFile: end`);\n return outcome;\n}\n\n/**\n * Export all circles of trust to individual files\n */\nexport async function exportCirclesOfTrustToFiles(): Promise<boolean> {\n debugMessage(`cli.CirclesOfTrustOps.exportCirclesOfTrustToFiles: begin`);\n const errors = [];\n try {\n const cots: CircleOfTrustSkeleton[] = await readCirclesOfTrust();\n createProgressBar(cots.length, 'Exporting circles of trust...');\n for (const cot of cots) {\n const file = getTypedFilename(cot._id, 'cot.saml');\n try {\n const exportData: CirclesOfTrustExportInterface =\n await exportCircleOfTrust(cot._id);\n saveJsonToFile(exportData, getFilePath(file, true));\n updateProgressBar(`Exported ${cot.name}.`);\n } catch (error) {\n errors.push(error);\n updateProgressBar(`Error exporting ${cot.name}.`);\n }\n }\n stopProgressBar(`Export complete.`);\n } catch (error) {\n errors.push(error);\n stopProgressBar(`Error exporting circles of trust to files`);\n }\n debugMessage(`cli.CirclesOfTrustOps.exportCirclesOfTrustToFiles: end`);\n return 0 === errors.length;\n}\n\n/**\n * Import a SAML circle of trust by id/name from file\n * @param {String} cotId Circle of trust id/name\n * @param {String} file Import file name\n */\nexport async function importCircleOfTrustFromFile(\n cotId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n const filePath = getFilePath(file);\n showSpinner(`Importing circle of trust ${cotId} from ${filePath}...`);\n try {\n const data = fs.readFileSync(filePath, 'utf8');\n const fileData = JSON.parse(data);\n await importCircleOfTrust(cotId, fileData);\n outcome = true;\n succeedSpinner(`Imported circle of trust ${cotId} from ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing circle of trust ${cotId} from ${filePath}.`);\n printMessage(error.response?.data || error, 'error');\n }\n return outcome;\n}\n\n/**\n * Import first SAML circle of trust from file\n * @param {String} file Import file name\n */\nexport async function importFirstCircleOfTrustFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n const filePath = getFilePath(file);\n showSpinner(`Importing first circle of trust from ${filePath}...`);\n try {\n const data = fs.readFileSync(filePath, 'utf8');\n const fileData = JSON.parse(data);\n await importFirstCircleOfTrust(fileData);\n outcome = true;\n succeedSpinner(`Imported first circle of trust from ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing first circle of trust from ${filePath}.`);\n printMessage(error.response?.data || error, 'error');\n }\n return outcome;\n}\n\n/**\n * Import all SAML circles of trust from file\n * @param {String} file Import file name\n */\nexport async function importCirclesOfTrustFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n const filePath = getFilePath(file);\n showSpinner(`Importing circles of trust from ${filePath}...`);\n try {\n const data = fs.readFileSync(filePath, 'utf8');\n const fileData = JSON.parse(data);\n await importCirclesOfTrust(fileData);\n outcome = true;\n succeedSpinner(`Imported circles of trust from ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing circles of trust from ${filePath}.`);\n printMessage(error.response?.data || error, 'error');\n }\n return outcome;\n}\n\n/**\n * Import all SAML circles of trust from all *.cot.saml.json files in the current directory\n */\nexport async function importCirclesOfTrustFromFiles(): Promise<boolean> {\n const errors = [];\n try {\n debugMessage(`cli.CirclesOfTrustOps.importCirclesOfTrustFromFiles: begin`);\n const names = fs.readdirSync(getWorkingDirectory());\n const files = names\n .filter((name) => name.toLowerCase().endsWith('.cot.saml.json'))\n .map((name) => getFilePath(name));\n createProgressBar(files.length, 'Importing circles of trust...');\n let total = 0;\n for (const file of files) {\n try {\n const data = fs.readFileSync(file, 'utf8');\n const fileData: CirclesOfTrustExportInterface = JSON.parse(data);\n const count = Object.keys(fileData.saml.cot).length;\n total += count;\n await importCirclesOfTrust(fileData);\n updateProgressBar(`Imported ${count} circles of trust from ${file}`);\n } catch (error) {\n errors.push(error);\n updateProgressBar(`Error importing circles of trust from ${file}`);\n printMessage(error, 'error');\n }\n }\n stopProgressBar(\n `Imported ${total} circles of trust from ${files.length} files.`\n );\n } catch (error) {\n errors.push(error);\n stopProgressBar(`Error importing circles of trust from files.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.CirclesOfTrustOps.importCirclesOfTrustFromFiles: end`);\n return 0 === errors.length;\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAGpD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,iBAAiB,QACZ,kBAAkB;AACzB,SACEC,gBAAgB,EAChBC,cAAc,EACdC,SAAS,QACJ,4BAA4B;AAEnC,MAAM;EAAEC,YAAY;EAAEC,WAAW;EAAEC;AAAoB,CAAC,GAAGjB,KAAK,CAACkB,KAAK;AACtE,MAAM;EACJC,kBAAkB;EAClBC,mBAAmB;EACnBC,oBAAoB;EACpBC,mBAAmB;EACnBC,oBAAoB;EACpBC;AACF,CAAC,GAAGxB,KAAK,CAACyB,KAAK,CAACC,cAAc;;AAE9B;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,MAA6B,EAAU;EAC3E,MAAMC,WAAW,GAAI,IAAGD,MAAM,CAACE,GAAG,CAAC,YAAY,CAAE,GAAE;EACnD,OAAOD,WAAW;AACpB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAAA,EAAW;EACzC,IAAIC,QAAQ,GAAG,EAAE;EACjBA,QAAQ,IAAI,4CAA4C;EACxDA,QAAQ,IAAI,0CAA0C;EACtD,OAAOA,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACL,MAA6B,EAAU;EACnE,MAAMM,GAAG,GAAI,KAAIN,MAAM,CAACE,GAAI,MAC1BF,MAA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AAMlE,oBAAoB,CAACiD,QAAQ,CAAC;QACpC7D,iBAAiB,CAAE,YAAW8E,KAAM,0BAAyBhC,IAAK,EAAC,CAAC;MACtE,CAAC,CAAC,OAAOZ,KAAK,EAAE;QACdoB,MAAM,CAACZ,IAAI,CAACR,KAAK,CAAC;QAClBlC,iBAAiB,CAAE,yCAAwC8C,IAAK,EAAC,CAAC;QAClElD,YAAY,CAACsC,KAAK,EAAE,OAAO,CAAC;MAC9B;IACF;IACApC,eAAe,CACZ,YAAW+E,KAAM,0BAAyBJ,KAAK,CAACjB,MAAO,SAC1D,CAAC;EACH,CAAC,CAAC,OAAOtB,KAAK,EAAE;IACdoB,MAAM,CAACZ,IAAI,CAACR,KAAK,CAAC;IAClBpC,eAAe,CAAE,8CAA6C,CAAC;IAC/DF,YAAY,CAACsC,KAAK,EAAE,OAAO,CAAC;EAC9B;EACAxC,YAAY,CAAE,0DAAyD,CAAC;EACxE,OAAO,CAAC,KAAK4D,MAAM,CAACE,MAAM;AAC5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockcarver/frodo-cli",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
|
|
6
6
|
"keywords": [
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
]
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@rockcarver/frodo-lib": "2.0.0-
|
|
110
|
+
"@rockcarver/frodo-lib": "2.0.0-43",
|
|
111
111
|
"chokidar": "^3.5.3",
|
|
112
112
|
"cli-progress": "^3.11.2",
|
|
113
113
|
"cli-table3": "^0.6.3",
|