@rockcarver/frodo-cli 2.0.0-36 → 2.0.0-38
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 +9 -1
- package/esm/app.js +2 -0
- package/esm/app.js.map +1 -1
- package/esm/cli/admin/admin.js +0 -1
- package/esm/cli/admin/admin.js.map +1 -1
- package/esm/cli/config/config-delete.js +22 -0
- package/esm/cli/config/config-delete.js.map +1 -0
- package/esm/cli/config/config-describe.js +22 -0
- package/esm/cli/config/config-describe.js.map +1 -0
- package/esm/cli/{admin/admin-export-full-cloud-config.js → config/config-export.js} +3 -3
- package/esm/cli/config/config-export.js.map +1 -0
- package/esm/cli/config/config-import.js +22 -0
- package/esm/cli/config/config-import.js.map +1 -0
- package/esm/cli/config/config-list.js +22 -0
- package/esm/cli/config/config-list.js.map +1 -0
- package/esm/cli/config/config.js +20 -0
- package/esm/cli/config/config.js.map +1 -0
- package/esm/cli/esv/esv-secret-list.js +2 -2
- package/esm/cli/esv/esv-secret-list.js.map +1 -1
- package/esm/cli/esv/esv-variable-list.js +2 -2
- package/esm/cli/esv/esv-variable-list.js.map +1 -1
- package/esm/cli/script/script-list.js +2 -2
- package/esm/cli/script/script-list.js.map +1 -1
- package/esm/ops/AdminOps.js +1 -103
- package/esm/ops/AdminOps.js.map +1 -1
- package/esm/ops/ConfigOps.js +128 -0
- package/esm/ops/ConfigOps.js.map +1 -0
- package/esm/ops/IdmOps.js +6 -3
- package/esm/ops/IdmOps.js.map +1 -1
- package/esm/ops/ScriptOps.js +51 -22
- package/esm/ops/ScriptOps.js.map +1 -1
- package/esm/ops/SecretsOps.js +62 -40
- package/esm/ops/SecretsOps.js.map +1 -1
- package/esm/ops/VariablesOps.js +35 -15
- package/esm/ops/VariablesOps.js.map +1 -1
- package/esm/utils/Config.js +147 -1
- package/esm/utils/Config.js.map +1 -1
- package/package.json +2 -2
- package/esm/cli/admin/admin-export-full-cloud-config.js.map +0 -1
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-37] - 2023-12-06
|
|
11
|
+
|
|
12
|
+
## [2.0.0-36] - 2023-12-01
|
|
13
|
+
|
|
10
14
|
## [2.0.0-35] - 2023-11-30
|
|
11
15
|
|
|
12
16
|
## [2.0.0-34] - 2023-11-29
|
|
@@ -1437,7 +1441,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1437
1441
|
- Fixed problem with adding connection profiles
|
|
1438
1442
|
- Miscellaneous bug fixes
|
|
1439
1443
|
|
|
1440
|
-
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-
|
|
1444
|
+
[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-37...HEAD
|
|
1445
|
+
|
|
1446
|
+
[2.0.0-37]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-36...v2.0.0-37
|
|
1447
|
+
|
|
1448
|
+
[2.0.0-36]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-35...v2.0.0-36
|
|
1441
1449
|
|
|
1442
1450
|
[2.0.0-35]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-34...v2.0.0-35
|
|
1443
1451
|
|
package/esm/app.js
CHANGED
|
@@ -7,6 +7,7 @@ import agent from './cli/agent/agent';
|
|
|
7
7
|
import app from './cli/app/app';
|
|
8
8
|
import authn from './cli/authn/authn';
|
|
9
9
|
import authz from './cli/authz/authz';
|
|
10
|
+
import config from './cli/config/config';
|
|
10
11
|
import conn from './cli/conn/conn';
|
|
11
12
|
import email from './cli/email/email';
|
|
12
13
|
import esv from './cli/esv/esv';
|
|
@@ -43,6 +44,7 @@ const {
|
|
|
43
44
|
program.addCommand(authn());
|
|
44
45
|
program.addCommand(authz());
|
|
45
46
|
program.addCommand(app());
|
|
47
|
+
program.addCommand(config());
|
|
46
48
|
program.addCommand(conn());
|
|
47
49
|
program.addCommand(email());
|
|
48
50
|
program.addCommand(esv());
|
package/esm/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","names":["frodo","Command","admin","agent","app","authn","authz","conn","email","esv","idm","idp","info","journey","log","oauth","realm","saml","script","service","shell","theme","printMessage","getVersions","initConnectionProfiles","initTokenCache","cache","program","version","addCommand","showHelpAfterError","enablePositionalOptions","parse","e","process","exitCode","stack"],"sources":["../src/app.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Command } from 'commander';\n\n// commands\nimport admin from './cli/admin/admin';\nimport agent from './cli/agent/agent';\nimport app from './cli/app/app';\nimport authn from './cli/authn/authn';\nimport authz from './cli/authz/authz';\nimport conn from './cli/conn/conn';\nimport email from './cli/email/email';\nimport esv from './cli/esv/esv';\nimport idm from './cli/idm/idm';\nimport idp from './cli/idp/idp';\nimport info from './cli/info/info';\nimport journey from './cli/journey/journey';\nimport log from './cli/log/log';\nimport oauth from './cli/oauth/oauth';\nimport realm from './cli/realm/realm';\nimport saml from './cli/saml/saml';\nimport script from './cli/script/script';\nimport service from './cli/service/service';\nimport shell from './cli/shell/shell';\n// enable sample command template.\n// import something from './cli/_template/something';\nimport theme from './cli/theme/theme';\nimport { printMessage } from './utils/Console';\nimport { getVersions } from './utils/Version';\n\nconst { initConnectionProfiles } = frodo.conn;\nconst { initTokenCache } = frodo.cache;\n\n(async () => {\n try {\n const program = new Command('frodo').version(\n await getVersions(false),\n '-v, --version'\n );\n\n printMessage(await getVersions(true), 'text', false);\n\n await initConnectionProfiles();\n await initTokenCache();\n\n program.addCommand(admin());\n program.addCommand(agent());\n program.addCommand(authn());\n program.addCommand(authz());\n program.addCommand(app());\n program.addCommand(conn());\n program.addCommand(email());\n program.addCommand(esv());\n program.addCommand(idm());\n program.addCommand(idp());\n program.addCommand(info());\n program.addCommand(journey());\n program.addCommand(log());\n program.addCommand(oauth());\n program.addCommand(realm());\n program.addCommand(saml());\n program.addCommand(script());\n program.addCommand(service());\n program.addCommand(shell());\n program.addCommand(theme());\n // enable sample command template.\n // program.addCommand(something());\n\n program.showHelpAfterError();\n program.enablePositionalOptions();\n program.parse();\n } catch (e) {\n process.exitCode = 1;\n printMessage(`ERROR: exception running frodo - ${e}`, 'error');\n printMessage(e.stack, 'error');\n }\n})();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,OAAO,QAAQ,WAAW;;AAEnC;AACA,OAAOC,KAAK,MAAM,mBAAmB;AACrC,OAAOC,KAAK,MAAM,mBAAmB;AACrC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,KAAK,MAAM,mBAAmB;AACrC,OAAOC,KAAK,MAAM,mBAAmB;AACrC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,KAAK,MAAM,mBAAmB;AACrC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,KAAK,MAAM,mBAAmB;AACrC,OAAOC,KAAK,MAAM,mBAAmB;AACrC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,MAAM,MAAM,qBAAqB;AACxC,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,OAAOC,KAAK,MAAM,mBAAmB;AACrC;AACA;AACA,OAAOC,KAAK,MAAM,mBAAmB;AACrC,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,MAAM;EAAEC;AAAuB,CAAC,
|
|
1
|
+
{"version":3,"file":"app.js","names":["frodo","Command","admin","agent","app","authn","authz","config","conn","email","esv","idm","idp","info","journey","log","oauth","realm","saml","script","service","shell","theme","printMessage","getVersions","initConnectionProfiles","initTokenCache","cache","program","version","addCommand","showHelpAfterError","enablePositionalOptions","parse","e","process","exitCode","stack"],"sources":["../src/app.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Command } from 'commander';\n\n// commands\nimport admin from './cli/admin/admin';\nimport agent from './cli/agent/agent';\nimport app from './cli/app/app';\nimport authn from './cli/authn/authn';\nimport authz from './cli/authz/authz';\nimport config from './cli/config/config';\nimport conn from './cli/conn/conn';\nimport email from './cli/email/email';\nimport esv from './cli/esv/esv';\nimport idm from './cli/idm/idm';\nimport idp from './cli/idp/idp';\nimport info from './cli/info/info';\nimport journey from './cli/journey/journey';\nimport log from './cli/log/log';\nimport oauth from './cli/oauth/oauth';\nimport realm from './cli/realm/realm';\nimport saml from './cli/saml/saml';\nimport script from './cli/script/script';\nimport service from './cli/service/service';\nimport shell from './cli/shell/shell';\n// enable sample command template.\n// import something from './cli/_template/something';\nimport theme from './cli/theme/theme';\nimport { printMessage } from './utils/Console';\nimport { getVersions } from './utils/Version';\n\nconst { initConnectionProfiles } = frodo.conn;\nconst { initTokenCache } = frodo.cache;\n\n(async () => {\n try {\n const program = new Command('frodo').version(\n await getVersions(false),\n '-v, --version'\n );\n\n printMessage(await getVersions(true), 'text', false);\n\n await initConnectionProfiles();\n await initTokenCache();\n\n program.addCommand(admin());\n program.addCommand(agent());\n program.addCommand(authn());\n program.addCommand(authz());\n program.addCommand(app());\n program.addCommand(config());\n program.addCommand(conn());\n program.addCommand(email());\n program.addCommand(esv());\n program.addCommand(idm());\n program.addCommand(idp());\n program.addCommand(info());\n program.addCommand(journey());\n program.addCommand(log());\n program.addCommand(oauth());\n program.addCommand(realm());\n program.addCommand(saml());\n program.addCommand(script());\n program.addCommand(service());\n program.addCommand(shell());\n program.addCommand(theme());\n // enable sample command template.\n // program.addCommand(something());\n\n program.showHelpAfterError();\n program.enablePositionalOptions();\n program.parse();\n } catch (e) {\n process.exitCode = 1;\n printMessage(`ERROR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AACE,UAAU,CAACT,KAAK,CAAC,CAAC,CAAC;IAC3BO,OAAO,CAACE,UAAU,CAACR,KAAK,CAAC,CAAC,CAAC;IAC3B;IACA;;IAEAM,OAAO,CAACG,kBAAkB,CAAC,CAAC;IAC5BH,OAAO,CAACI,uBAAuB,CAAC,CAAC;IACjCJ,OAAO,CAACK,KAAK,CAAC,CAAC;EACjB,CAAC,CAAC,OAAOC,CAAC,EAAE;IACVC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACpBb,YAAY,CAAE,oCAAmCW,CAAE,EAAC,EAAE,OAAO,CAAC;IAC9DX,YAAY,CAACW,CAAC,CAACG,KAAK,EAAE,OAAO,CAAC;EAChC;AACF,CAAC,EAAE,CAAC"}
|
package/esm/cli/admin/admin.js
CHANGED
|
@@ -10,7 +10,6 @@ export default function setup() {
|
|
|
10
10
|
program.command('execute-rfc7523-authz-grant-flow', 'Execute RFC7523 authorization grant flow.');
|
|
11
11
|
program.command('get-access-token', 'Get an access token using client credentials grant type.');
|
|
12
12
|
program.command('list-oauth2-clients-with-admin-privileges', 'List oauth2 clients with admin privileges.');
|
|
13
|
-
program.command('export-full-cloud-config', 'Export full cloud configuration for all ops that currently support export.');
|
|
14
13
|
program.command('grant-oauth2-client-admin-privileges', 'Grant an oauth2 client admin privileges.');
|
|
15
14
|
program.command('revoke-oauth2-client-admin-privileges', 'Revoke admin privileges from an oauth2 client.');
|
|
16
15
|
program.command('list-oauth2-clients-with-custom-privileges', 'List oauth2 clients with custom privileges.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","names":["path","fileURLToPath","FrodoStubCommand","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["../../../src/cli/admin/admin.ts"],"sourcesContent":["import path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport { FrodoStubCommand } from '../FrodoCommand';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('admin')\n .description('Platform admin tasks.')\n .executableDir(__dirname);\n\n program.command('federation', 'Manage admin federation configuration.');\n\n program.command(\n 'create-oauth2-client-with-admin-privileges',\n 'Create an oauth2 client with admin privileges.'\n );\n\n program.command(\n 'generate-rfc7523-authz-grant-artefacts',\n 'Generate RFC7523 authorization grant artefacts.'\n );\n\n program.command(\n 'execute-rfc7523-authz-grant-flow',\n 'Execute RFC7523 authorization grant flow.'\n );\n\n program.command(\n 'get-access-token',\n 'Get an access token using client credentials grant type.'\n );\n\n program.command(\n 'list-oauth2-clients-with-admin-privileges',\n 'List oauth2 clients with admin privileges.'\n );\n\n program.command(\n '
|
|
1
|
+
{"version":3,"file":"admin.js","names":["path","fileURLToPath","FrodoStubCommand","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["../../../src/cli/admin/admin.ts"],"sourcesContent":["import path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport { FrodoStubCommand } from '../FrodoCommand';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('admin')\n .description('Platform admin tasks.')\n .executableDir(__dirname);\n\n program.command('federation', 'Manage admin federation configuration.');\n\n program.command(\n 'create-oauth2-client-with-admin-privileges',\n 'Create an oauth2 client with admin privileges.'\n );\n\n program.command(\n 'generate-rfc7523-authz-grant-artefacts',\n 'Generate RFC7523 authorization grant artefacts.'\n );\n\n program.command(\n 'execute-rfc7523-authz-grant-flow',\n 'Execute RFC7523 authorization grant flow.'\n );\n\n program.command(\n 'get-access-token',\n 'Get an access token using client credentials grant type.'\n );\n\n program.command(\n 'list-oauth2-clients-with-admin-privileges',\n 'List oauth2 clients with admin privileges.'\n );\n\n program.command(\n 'grant-oauth2-client-admin-privileges',\n 'Grant an oauth2 client admin privileges.'\n );\n\n program.command(\n 'revoke-oauth2-client-admin-privileges',\n 'Revoke admin privileges from an oauth2 client.'\n );\n\n program.command(\n 'list-oauth2-clients-with-custom-privileges',\n 'List oauth2 clients with custom privileges.'\n );\n\n program.command(\n 'list-static-user-mappings',\n 'List all subjects of static user mappings that are not oauth2 clients.'\n );\n\n program.command(\n 'remove-static-user-mapping',\n \"Remove a subject's static user mapping.\"\n );\n\n program.command(\n 'add-autoid-static-user-mapping',\n 'Add AutoId static user mapping to enable dashboards and other AutoId-based functionality.'\n );\n\n program.command(\n 'hide-generic-extension-attributes',\n 'Hide generic extension attributes.'\n );\n\n program.command(\n 'show-generic-extension-attributes',\n 'Show generic extension attributes.'\n );\n\n program.command('repair-org-model', 'Repair org model.');\n\n // program.command('train-auto-access-model', 'Train Auto Access model.');\n\n return program;\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,SAASC,gBAAgB,QAAQ,iBAAiB;AAElD,MAAMC,SAAS,GAAGH,IAAI,CAACI,OAAO,CAACH,aAAa,CAACI,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIP,gBAAgB,CAAC,OAAO,CAAC,CAC1CQ,WAAW,CAAC,uBAAuB,CAAC,CACpCC,aAAa,CAACR,SAAS,CAAC;EAE3BM,OAAO,CAACG,OAAO,CAAC,YAAY,EAAE,wCAAwC,CAAC;EAEvEH,OAAO,CAACG,OAAO,CACb,4CAA4C,EAC5C,gDACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,wCAAwC,EACxC,iDACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,kCAAkC,EAClC,2CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,kBAAkB,EAClB,0DACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,2CAA2C,EAC3C,4CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,sCAAsC,EACtC,0CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,uCAAuC,EACvC,gDACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,4CAA4C,EAC5C,6CACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,2BAA2B,EAC3B,wEACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,4BAA4B,EAC5B,yCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,gCAAgC,EAChC,2FACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,mCAAmC,EACnC,oCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CACb,mCAAmC,EACnC,oCACF,CAAC;EAEDH,OAAO,CAACG,OAAO,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;;EAExD;;EAEA,OAAOH,OAAO;AAChB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { frodo } from '@rockcarver/frodo-lib';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { FrodoCommand } from '../FrodoCommand';
|
|
4
|
+
const {
|
|
5
|
+
getTokens
|
|
6
|
+
} = frodo.login;
|
|
7
|
+
const program = new FrodoCommand('frodo config delete');
|
|
8
|
+
program.description('Delete full cloud configuration.').addOption(new Option('-i, --config-id <config-id>', 'Configuration id. If specified, -a and -A are ignored.')).addOption(new Option('-a, --all', 'Delete full cloud configuration. Ignored with -i.')).addOption(new Option('--no-deep', 'No deep delete. This leaves orphaned configuration artifacts behind.')).action(
|
|
9
|
+
// implement command logic inside action handler
|
|
10
|
+
async (host, realm, user, password, options, command) => {
|
|
11
|
+
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
12
|
+
if (await getTokens()) {
|
|
13
|
+
// code goes here
|
|
14
|
+
} else {
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// end command logic inside action handler
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
program.parse();
|
|
22
|
+
//# sourceMappingURL=config-delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-delete.js","names":["frodo","Option","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["../../../src/cli/config/config-delete.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config delete');\n\nprogram\n .description('Delete full cloud configuration.')\n .addOption(\n new Option(\n '-i, --config-id <config-id>',\n 'Configuration id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option('-a, --all', 'Delete full cloud configuration. Ignored with -i.')\n )\n .addOption(\n new Option(\n '--no-deep',\n 'No deep delete. This leaves orphaned configuration artifacts behind.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // code goes here\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGH,KAAK,CAACI,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,qBAAqB,CAAC;AAEvDG,OAAO,CACJC,WAAW,CAAC,kCAAkC,CAAC,CAC/CC,SAAS,CACR,IAAIN,MAAM,CACR,6BAA6B,EAC7B,wDACF,CACF,CAAC,CACAM,SAAS,CACR,IAAIN,MAAM,CAAC,WAAW,EAAE,mDAAmD,CAC7E,CAAC,CACAM,SAAS,CACR,IAAIN,MAAM,CACR,WAAW,EACX,sEACF,CACF,CAAC,CACAO,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrB;EAAA,CACD,MAAM;IACLa,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHZ,OAAO,CAACa,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { frodo } from '@rockcarver/frodo-lib';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { FrodoCommand } from '../FrodoCommand';
|
|
4
|
+
const {
|
|
5
|
+
getTokens
|
|
6
|
+
} = frodo.login;
|
|
7
|
+
const program = new FrodoCommand('frodo config describe');
|
|
8
|
+
program.description('Describe full cloud configuration.').addOption(new Option('-i, --config-id <config-id>', 'Configuration id.')).action(
|
|
9
|
+
// implement command logic inside action handler
|
|
10
|
+
async (host, realm, user, password, options, command) => {
|
|
11
|
+
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
12
|
+
if (await getTokens()) {
|
|
13
|
+
// code goes here
|
|
14
|
+
} else {
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// end command logic inside action handler
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
program.parse();
|
|
22
|
+
//# sourceMappingURL=config-describe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-describe.js","names":["frodo","Option","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["../../../src/cli/config/config-describe.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config describe');\n\nprogram\n .description('Describe full cloud configuration.')\n .addOption(new Option('-i, --config-id <config-id>', 'Configuration id.'))\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // code goes here\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGH,KAAK,CAACI,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,uBAAuB,CAAC;AAEzDG,OAAO,CACJC,WAAW,CAAC,oCAAoC,CAAC,CACjDC,SAAS,CAAC,IAAIN,MAAM,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC,CACzEO,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrB;EAAA,CACD,MAAM;IACLa,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHZ,OAAO,CAACa,KAAK,CAAC,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { frodo, state } from '@rockcarver/frodo-lib';
|
|
2
2
|
import { Option } from 'commander';
|
|
3
|
-
import { exportEverythingToFile, exportEverythingToFiles } from '../../ops/
|
|
3
|
+
import { exportEverythingToFile, exportEverythingToFiles } from '../../ops/ConfigOps';
|
|
4
4
|
import { printMessage, verboseMessage } from '../../utils/Console';
|
|
5
5
|
import { FrodoCommand } from '../FrodoCommand';
|
|
6
6
|
const {
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
|
-
const program = new FrodoCommand('frodo
|
|
9
|
+
const program = new FrodoCommand('frodo config export');
|
|
10
10
|
program.description('Export full cloud configuration for all ops that currently support export.').addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export everything to a single file.')).addOption(new Option('-A, --all-separate', 'Export everything to separate files in the -D directory. Ignored with -a.')).addOption(new Option('--use-string-arrays', 'Where applicable, use string arrays to store multi-line text (e.g. scripts).').default(false, 'off')).addOption(new Option('--no-decode', 'Do not include decoded variable value in variable export').default(false, 'false')).addOption(new Option('-x, --extract', 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
@@ -41,4 +41,4 @@ async (host, realm, user, password, options, command) => {
|
|
|
41
41
|
);
|
|
42
42
|
|
|
43
43
|
program.parse();
|
|
44
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=config-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-export.js","names":["frodo","state","Option","exportEverythingToFile","exportEverythingToFiles","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","all","file","useStringArrays","noDecode","decode","allSeparate","getDirectory","help","process","exitCode","extract","parse"],"sources":["../../../src/cli/config/config-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEverythingToFile,\n exportEverythingToFiles,\n} from '../../ops/ConfigOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config export');\n\nprogram\n .description(\n 'Export full cloud configuration for all ops that currently support export.'\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(new Option('-a, --all', 'Export everything to a single file.'))\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export everything to separate files in the -D directory. Ignored with -a.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-decode',\n 'Do not include decoded variable value in variable export'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-x, --extract',\n 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // --all -a\n if (options.all && (await getTokens())) {\n verboseMessage('Exporting everything to a single file...');\n await exportEverythingToFile(options.file, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n });\n // require --directory -D for all-separate function\n } else if (options.allSeparate && !state.getDirectory()) {\n printMessage(\n '-D or --directory required when using -A or --all-separate',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n // --all-separate -A\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting everything to separate files...');\n await exportEverythingToFiles(options.extract, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n });\n // unrecognized combination of options or no options\n } else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,sBAAsB,EACtBC,uBAAuB,QAClB,qBAAqB;AAC5B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KA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B,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACpB;EACF,CAAC,MAAM,IAAIZ,OAAO,CAACQ,WAAW,KAAK,MAAMnB,SAAS,CAAC,CAAC,CAAC,EAAE;IACrDF,cAAc,CAAC,2CAA2C,CAAC;IAC3D,MAAMF,uBAAuB,CAACe,OAAO,CAACa,OAAO,EAAE;MAC7CR,eAAe,EAAEL,OAAO,CAACK,eAAe;MACxCC,QAAQ,EAAEN,OAAO,CAACO;IACpB,CAAC,CAAC;IACF;EACF,CAAC,MAAM;IACLpB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACmB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHrB,OAAO,CAACuB,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { frodo } from '@rockcarver/frodo-lib';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { FrodoCommand } from '../FrodoCommand';
|
|
4
|
+
const {
|
|
5
|
+
getTokens
|
|
6
|
+
} = frodo.login;
|
|
7
|
+
const program = new FrodoCommand('frodo config import');
|
|
8
|
+
program.description('Import full cloud configuration.').addOption(new Option('-i, --config-id <config-id>', 'Configuration id. If specified, only one configuration 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 configuration from a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Import all configuration from separate (.json) files in the working directory. Ignored with -i or -a.')).action(
|
|
9
|
+
// implement command logic inside action handler
|
|
10
|
+
async (host, realm, user, password, options, command) => {
|
|
11
|
+
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
12
|
+
if (await getTokens()) {
|
|
13
|
+
// code goes here
|
|
14
|
+
} else {
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// end command logic inside action handler
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
program.parse();
|
|
22
|
+
//# sourceMappingURL=config-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-import.js","names":["frodo","Option","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["../../../src/cli/config/config-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config import');\n\nprogram\n .description('Import full cloud configuration.')\n .addOption(\n new Option(\n '-i, --config-id <config-id>',\n 'Configuration id. If specified, only one configuration 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 configuration from a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all configuration from separate (.json) files in the working directory. Ignored with -i or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // code goes here\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGH,KAAK,CAACI,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,qBAAqB,CAAC;AAEvDG,OAAO,CACJC,WAAW,CAAC,kCAAkC,CAAC,CAC/CC,SAAS,CACR,IAAIN,MAAM,CACR,6BAA6B,EAC7B,2GACF,CACF,CAAC,CACAM,SAAS,CAAC,IAAIN,MAAM,CAAC,mBAAmB,EAAE,6BAA6B,CAAC,CAAC,CACzEM,SAAS,CACR,IAAIN,MAAM,CACR,WAAW,EACX,+DACF,CACF,CAAC,CACAM,SAAS,CACR,IAAIN,MAAM,CACR,oBAAoB,EACpB,uGACF,CACF,CAAC,CACAO,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMX,SAAS,CAAC,CAAC,EAAE;IACrB;EAAA,CACD,MAAM;IACLa,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHZ,OAAO,CAACa,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { frodo } from '@rockcarver/frodo-lib';
|
|
2
|
+
import { Option } from 'commander';
|
|
3
|
+
import { FrodoCommand } from '../FrodoCommand';
|
|
4
|
+
const {
|
|
5
|
+
getTokens
|
|
6
|
+
} = frodo.login;
|
|
7
|
+
const program = new FrodoCommand('frodo config list');
|
|
8
|
+
program.description('List full cloud configuration.').addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).action(
|
|
9
|
+
// implement command logic inside action handler
|
|
10
|
+
async (host, realm, user, password, options, command) => {
|
|
11
|
+
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
12
|
+
if (await getTokens()) {
|
|
13
|
+
// code goes here
|
|
14
|
+
} else {
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// end command logic inside action handler
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
program.parse();
|
|
22
|
+
//# sourceMappingURL=config-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-list.js","names":["frodo","Option","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["../../../src/cli/config/config-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config list');\n\nprogram\n .description('List full cloud configuration.')\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, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // code goes here\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGH,KAAK,CAACI,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,mBAAmB,CAAC;AAErDG,OAAO,CACJC,WAAW,CAAC,gCAAgC,CAAC,CAC7CC,SAAS,CACR,IAAIN,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAACO,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1E,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrB;EAAA,CACD,MAAM;IACLc,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHb,OAAO,CAACc,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { FrodoStubCommand } from '../FrodoCommand';
|
|
4
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
export default function setup() {
|
|
6
|
+
const program = new FrodoStubCommand('config').description('Manage full cloud configuration.').executableDir(__dirname);
|
|
7
|
+
|
|
8
|
+
//program.command('list', 'List full cloud configuration.');
|
|
9
|
+
|
|
10
|
+
//program.command('describe', 'Describe full cloud configuration.');
|
|
11
|
+
|
|
12
|
+
program.command('export', 'Export full cloud configuration for all ops that currently support export..');
|
|
13
|
+
|
|
14
|
+
//program.command('import', 'Import full cloud configuration.');
|
|
15
|
+
|
|
16
|
+
//program.command('delete', 'Delete full cloud configuration.');
|
|
17
|
+
|
|
18
|
+
return program;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","names":["path","fileURLToPath","FrodoStubCommand","__dirname","dirname","import","meta","url","setup","program","description","executableDir","command"],"sources":["../../../src/cli/config/config.ts"],"sourcesContent":["import path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport { FrodoStubCommand } from '../FrodoCommand';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('config')\n .description('Manage full cloud configuration.')\n .executableDir(__dirname);\n\n //program.command('list', 'List full cloud configuration.');\n\n //program.command('describe', 'Describe full cloud configuration.');\n\n program.command(\n 'export',\n 'Export full cloud configuration for all ops that currently support export..'\n );\n\n //program.command('import', 'Import full cloud configuration.');\n\n //program.command('delete', 'Delete full cloud configuration.');\n\n return program;\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,SAASC,gBAAgB,QAAQ,iBAAiB;AAElD,MAAMC,SAAS,GAAGH,IAAI,CAACI,OAAO,CAACH,aAAa,CAACI,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIP,gBAAgB,CAAC,QAAQ,CAAC,CAC3CQ,WAAW,CAAC,kCAAkC,CAAC,CAC/CC,aAAa,CAACR,SAAS,CAAC;;EAE3B;;EAEA;;EAEAM,OAAO,CAACG,OAAO,CACb,QAAQ,EACR,6EACF,CAAC;;EAED;;EAEA;;EAEA,OAAOH,OAAO;AAChB"}
|
|
@@ -7,13 +7,13 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo esv secret list');
|
|
10
|
-
program.description('List secrets.').addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).action(
|
|
10
|
+
program.description('List secrets.').addOption(new Option('-l, --long', 'Long with all fields besides usage.').default(false, 'false')).addOption(new Option('-u, --usage', 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.').default(false, 'false')).addOption(new Option('-f, --file [file]', 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
if (await getTokens()) {
|
|
15
15
|
verboseMessage('Listing secrets...');
|
|
16
|
-
const outcome = await listSecrets(options.long);
|
|
16
|
+
const outcome = await listSecrets(options.long, options.usage, options.file);
|
|
17
17
|
if (!outcome) process.exitCode = 1;
|
|
18
18
|
} else {
|
|
19
19
|
process.exitCode = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esv-secret-list.js","names":["frodo","Option","listSecrets","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","process","exitCode","parse"],"sources":["../../../src/cli/esv/esv-secret-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listSecrets } from '../../ops/SecretsOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv secret list');\n\nprogram\n .description('List secrets.')\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, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing secrets...');\n const outcome = await listSecrets(options.long);\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,uBAAuB,CAAC;AAEzDG,OAAO,CACJC,WAAW,CAAC,eAAe,CAAC,CAC5BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"esv-secret-list.js","names":["frodo","Option","listSecrets","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","usage","file","process","exitCode","parse"],"sources":["../../../src/cli/esv/esv-secret-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listSecrets } from '../../ops/SecretsOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv secret list');\n\nprogram\n .description('List secrets.')\n .addOption(\n new Option('-l, --long', 'Long with all fields besides usage.').default(\n false,\n 'false'\n )\n )\n .addOption(\n new Option(\n '-u, --usage',\n 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing secrets...');\n const outcome = await listSecrets(\n options.long,\n options.usage,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,uBAAuB,CAAC;AAEzDG,OAAO,CACJC,WAAW,CAAC,eAAe,CAAC,CAC5BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,qCAAqC,CAAC,CAACS,OAAO,CACrE,KAAK,EACL,OACF,CACF,CAAC,CACAD,SAAS,CACR,IAAIR,MAAM,CACR,aAAa,EACb,+UACF,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1B,CAAC,CACAD,SAAS,CACR,IAAIR,MAAM,CACR,mBAAmB,EACnB,4HACF,CACF,CAAC,CACAU,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAC,oBAAoB,CAAC;IACpC,MAAMgB,OAAO,GAAG,MAAMjB,WAAW,CAC/Bc,OAAO,CAACI,IAAI,EACZJ,OAAO,CAACK,KAAK,EACbL,OAAO,CAACM,IACV,CAAC;IACD,IAAI,CAACH,OAAO,EAAEI,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHjB,OAAO,CAACkB,KAAK,CAAC,CAAC"}
|
|
@@ -7,13 +7,13 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo esv variable list');
|
|
10
|
-
program.description('List variables.').addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).action(
|
|
10
|
+
program.description('List variables.').addOption(new Option('-l, --long', 'Long with all fields besides usage.').default(false, 'false')).addOption(new Option('-u, --usage', 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.').default(false, 'false')).addOption(new Option('-f, --file [file]', 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
if (await getTokens()) {
|
|
15
15
|
verboseMessage('Listing variables...');
|
|
16
|
-
const outcome = await listVariables(options.long);
|
|
16
|
+
const outcome = await listVariables(options.long, options.usage, options.file);
|
|
17
17
|
if (!outcome) process.exitCode = 1;
|
|
18
18
|
} else {
|
|
19
19
|
process.exitCode = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esv-variable-list.js","names":["frodo","Option","listVariables","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","process","exitCode","parse"],"sources":["../../../src/cli/esv/esv-variable-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listVariables } from '../../ops/VariablesOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv variable list');\n\nprogram\n .description('List variables.')\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, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing variables...');\n const outcome = await listVariables(options.long);\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,yBAAyB,CAAC;AAE3DG,OAAO,CACJC,WAAW,CAAC,iBAAiB,CAAC,CAC9BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"esv-variable-list.js","names":["frodo","Option","listVariables","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","usage","file","process","exitCode","parse"],"sources":["../../../src/cli/esv/esv-variable-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listVariables } from '../../ops/VariablesOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv variable list');\n\nprogram\n .description('List variables.')\n .addOption(\n new Option('-l, --long', 'Long with all fields besides usage.').default(\n false,\n 'false'\n )\n )\n .addOption(\n new Option(\n '-u, --usage',\n 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing variables...');\n const outcome = await listVariables(\n options.long,\n options.usage,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\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C,CAAC"}
|
|
@@ -7,13 +7,13 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo script list');
|
|
10
|
-
program.description('List scripts.').addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).action(
|
|
10
|
+
program.description('List scripts.').addOption(new Option('-l, --long', 'Long with all fields besides usage.').default(false, 'false')).addOption(new Option('-u, --usage', 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.').default(false, 'false')).addOption(new Option('-f, --file [file]', 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
if (await getTokens()) {
|
|
15
15
|
verboseMessage(`Listing scripts in realm "${state.getRealm()}"...`);
|
|
16
|
-
const outcome = await listScripts(options.long);
|
|
16
|
+
const outcome = await listScripts(options.long, options.usage, options.file);
|
|
17
17
|
if (!outcome) process.exitCode = 1;
|
|
18
18
|
} else {
|
|
19
19
|
process.exitCode = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-list.js","names":["frodo","state","Option","listScripts","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","outcome","long","process","exitCode","parse"],"sources":["../../../src/cli/script/script-list.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listScripts } from '../../ops/ScriptOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo script list');\n\nprogram\n .description('List scripts.')\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, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing scripts in realm \"${state.getRealm()}\"...`);\n const outcome = await listScripts(options.long);\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGN,KAAK,CAACO,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,mBAAmB,CAAC;AAErDG,OAAO,CACJC,WAAW,CAAC,eAAe,CAAC,CAC5BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"script-list.js","names":["frodo","state","Option","listScripts","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","outcome","long","usage","file","process","exitCode","parse"],"sources":["../../../src/cli/script/script-list.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listScripts } from '../../ops/ScriptOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo script list');\n\nprogram\n .description('List scripts.')\n .addOption(\n new Option('-l, --long', 'Long with all fields besides usage.').default(\n false,\n 'false'\n )\n )\n .addOption(\n new Option(\n '-u, --usage',\n 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing scripts in realm \"${state.getRealm()}\"...`);\n const outcome = await listScripts(\n options.long,\n options.usage,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGN,KAAK,CAACO,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,mBAAmB,CAAC;AAErDG,OAAO,CACJC,WAAW,CAAC,eAAe,CAAC,CAC5BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,qCAAqC,CAAC,CAACS,OAAO,CACrE,KAAK,EACL,OACF,CACF,CAAC,CACAD,SAAS,CACR,IAAIR,MAAM,CACR,aAAa,EACb,+UACF,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1B,CAAC,CACAD,SAAS,CACR,IAAIR,MAAM,CACR,mBAAmB,EACnB,4HACF,CACF,CAAC,CACAU,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,6BAA4BH,KAAK,CAACmB,QAAQ,CAAC,CAAE,MAAK,CAAC;IACnE,MAAMC,OAAO,GAAG,MAAMlB,WAAW,CAC/Bc,OAAO,CAACK,IAAI,EACZL,OAAO,CAACM,KAAK,EACbN,OAAO,CAACO,IACV,CAAC;IACD,IAAI,CAACH,OAAO,EAAEI,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
|
package/esm/ops/AdminOps.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { frodo, state } from '@rockcarver/frodo-lib';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { cleanupProgressIndicators, createKeyValueTable, createProgressIndicator, printMessage, stopProgressIndicator, updateProgressIndicator } from '../utils/Console';
|
|
4
|
-
import { extractScriptToFile } from './ScriptOps';
|
|
5
4
|
const {
|
|
6
|
-
getRealmName,
|
|
7
5
|
getTypedFilename,
|
|
8
|
-
titleCase,
|
|
9
6
|
saveJsonToFile,
|
|
10
|
-
getFilePath
|
|
11
|
-
getWorkingDirectory
|
|
7
|
+
getFilePath
|
|
12
8
|
} = frodo.utils;
|
|
13
9
|
const {
|
|
14
|
-
exportFullConfiguration,
|
|
15
10
|
generateRfc7523AuthZGrantArtefacts: _generateRfc7523AuthZGrantArtefacts,
|
|
16
11
|
executeRfc7523AuthZGrantFlow: _executeRfc7523AuthZGrantFlow
|
|
17
12
|
} = frodo.admin;
|
|
@@ -153,101 +148,4 @@ export async function executeRfc7523AuthZGrantFlow(clientId, iss, jwk, sub, scop
|
|
|
153
148
|
}
|
|
154
149
|
return true;
|
|
155
150
|
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Export everything to separate files
|
|
159
|
-
* @param file file name
|
|
160
|
-
* @param {FullExportOptions} options export options
|
|
161
|
-
*/
|
|
162
|
-
export async function exportEverythingToFile(file, options = {
|
|
163
|
-
useStringArrays: true,
|
|
164
|
-
noDecode: false
|
|
165
|
-
}) {
|
|
166
|
-
const exportData = await exportFullConfiguration(options);
|
|
167
|
-
let fileName = getTypedFilename(`${titleCase(getRealmName(state.getRealm()))}`, `everything`);
|
|
168
|
-
if (file) {
|
|
169
|
-
fileName = file;
|
|
170
|
-
}
|
|
171
|
-
saveJsonToFile(exportData, getFilePath(fileName, true));
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Export everything to separate files
|
|
176
|
-
* @param extract Extracts the scripts from the exports into separate files if true
|
|
177
|
-
* @param {FullExportOptions} options export options
|
|
178
|
-
*/
|
|
179
|
-
export async function exportEverythingToFiles(extract = false, options = {
|
|
180
|
-
useStringArrays: true,
|
|
181
|
-
noDecode: false
|
|
182
|
-
}) {
|
|
183
|
-
const exportData = await exportFullConfiguration(options);
|
|
184
|
-
delete exportData.meta;
|
|
185
|
-
const baseDirectory = getWorkingDirectory(true);
|
|
186
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
187
|
-
Object.entries(exportData).forEach(([type, obj]) => {
|
|
188
|
-
if (obj) {
|
|
189
|
-
if (!fs.existsSync(`${baseDirectory}/${type}`)) {
|
|
190
|
-
fs.mkdirSync(`${baseDirectory}/${type}`);
|
|
191
|
-
}
|
|
192
|
-
if (type == 'saml') {
|
|
193
|
-
const samlData = {
|
|
194
|
-
saml: {
|
|
195
|
-
cot: {},
|
|
196
|
-
hosted: {},
|
|
197
|
-
metadata: {},
|
|
198
|
-
remote: {}
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
if (obj.cot) {
|
|
202
|
-
if (!fs.existsSync(`${baseDirectory}/cot`)) {
|
|
203
|
-
fs.mkdirSync(`${baseDirectory}/cot`);
|
|
204
|
-
}
|
|
205
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
206
|
-
Object.entries(obj.cot).forEach(([id, value]) => {
|
|
207
|
-
samlData.saml.cot = {
|
|
208
|
-
[id]: value
|
|
209
|
-
};
|
|
210
|
-
saveJsonToFile(samlData, `${baseDirectory}/cot/${getTypedFilename(id, 'cot.saml')}`);
|
|
211
|
-
});
|
|
212
|
-
samlData.saml.cot = {};
|
|
213
|
-
}
|
|
214
|
-
Object.entries(obj.hosted).concat(Object.entries(obj.remote))
|
|
215
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
216
|
-
.forEach(([id, value]) => {
|
|
217
|
-
const filename = getTypedFilename(value.entityId ? value.entityId : id, type);
|
|
218
|
-
const samlType = obj.hosted[id] ? 'hosted' : 'remote';
|
|
219
|
-
samlData.saml[samlType][id] = value;
|
|
220
|
-
samlData.saml.metadata = {
|
|
221
|
-
[id]: obj.metadata[id]
|
|
222
|
-
};
|
|
223
|
-
saveJsonToFile(samlData, `${baseDirectory}/${type}/${filename}`);
|
|
224
|
-
samlData.saml[samlType] = {};
|
|
225
|
-
});
|
|
226
|
-
} else if (type == 'authentication') {
|
|
227
|
-
const fileName = getTypedFilename(`${frodo.utils.getRealmName(state.getRealm())}Realm`, 'authentication.settings');
|
|
228
|
-
saveJsonToFile({
|
|
229
|
-
authentication: obj
|
|
230
|
-
}, `${baseDirectory}/${type}/${fileName}`);
|
|
231
|
-
} else {
|
|
232
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
233
|
-
Object.entries(obj).forEach(([id, value]) => {
|
|
234
|
-
const filename = type == 'config' ? `${id}.json` : getTypedFilename(value.name ? value.name : id, type);
|
|
235
|
-
if (type == 'config' && filename.includes('/')) {
|
|
236
|
-
fs.mkdirSync(`${baseDirectory}/${type}/${filename.slice(0, filename.lastIndexOf('/'))}`, {
|
|
237
|
-
recursive: true
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
if (extract && type == 'script') {
|
|
241
|
-
extractScriptToFile(exportData, id, type);
|
|
242
|
-
}
|
|
243
|
-
saveJsonToFile({
|
|
244
|
-
[type]: {
|
|
245
|
-
[id]: value
|
|
246
|
-
}
|
|
247
|
-
}, `${baseDirectory}/${type}/${filename}`);
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
151
|
//# sourceMappingURL=AdminOps.js.map
|