@rockcarver/frodo-cli 0.18.2-4 → 0.18.2-6
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-add-autoid-static-user-mapping.js +4 -1
- package/esm/cli/admin/admin-add-autoid-static-user-mapping.js.map +1 -1
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +4 -1
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-get-access-token.js +4 -1
- package/esm/cli/admin/admin-get-access-token.js.map +1 -1
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js +4 -1
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js +4 -1
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js.map +1 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +4 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +4 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js.map +1 -1
- package/esm/cli/admin/admin-list-static-user-mappings.js +4 -1
- package/esm/cli/admin/admin-list-static-user-mappings.js.map +1 -1
- package/esm/cli/admin/admin-remove-static-user-mapping.js +4 -1
- package/esm/cli/admin/admin-remove-static-user-mapping.js.map +1 -1
- package/esm/cli/admin/admin-repair-org-model.js +4 -1
- package/esm/cli/admin/admin-repair-org-model.js.map +1 -1
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +4 -1
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-show-generic-extension-attributes.js +4 -1
- package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +1 -1
- package/esm/cli/agent/agent-export.js +1 -1
- package/esm/cli/agent/agent-export.js.map +1 -1
- package/esm/cli/service/service-delete.js +29 -0
- package/esm/cli/service/service-delete.js.map +1 -0
- package/esm/cli/service/service-export.js +40 -0
- package/esm/cli/service/service-export.js.map +1 -0
- package/esm/cli/service/service-import.js +46 -0
- package/esm/cli/service/service-import.js.map +1 -0
- package/esm/cli/service/service-list.js +27 -0
- package/esm/cli/service/service-list.js.map +1 -0
- package/esm/cli/service/service.js +16 -0
- package/esm/cli/service/service.js.map +1 -0
- package/esm/cli/theme/theme-delete.js +19 -19
- package/esm/cli/theme/theme-delete.js.map +1 -1
- package/esm/cli/theme/theme-export.js +23 -23
- package/esm/cli/theme/theme-export.js.map +1 -1
- package/esm/cli/theme/theme-import.js +26 -28
- package/esm/cli/theme/theme-import.js.map +1 -1
- package/esm/cli/theme/theme-list.js +4 -1
- package/esm/cli/theme/theme-list.js.map +1 -1
- package/esm/ops/ServiceOps.js +234 -0
- package/esm/ops/ServiceOps.js.map +1 -0
- package/esm/utils/Console.js +19 -0
- package/esm/utils/Console.js.map +1 -1
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ const {
|
|
|
9
9
|
revokeOAuth2ClientAdminPrivileges
|
|
10
10
|
} = Admin;
|
|
11
11
|
const program = new Command('frodo admin revoke-oauth2-client-admin-privileges');
|
|
12
|
-
program.description('Revoke admin privileges from an oauth2 client.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('-t, --target <target name or id>', 'Name of the oauth2 client.')).action( // implement command logic inside action handler
|
|
12
|
+
program.description('Revoke admin privileges from an oauth2 client.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-t, --target <target name or id>', 'Name of the oauth2 client.')).action( // implement command logic inside action handler
|
|
13
13
|
async (host, realm, user, password, options) => {
|
|
14
14
|
state.default.session.setTenant(host);
|
|
15
15
|
state.default.session.setRealm(realm);
|
|
@@ -17,6 +17,9 @@ async (host, realm, user, password, options) => {
|
|
|
17
17
|
state.default.session.setPassword(password);
|
|
18
18
|
state.default.session.setDeploymentType(options.type);
|
|
19
19
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
20
|
+
state.default.session.setVerbose(options.verbose);
|
|
21
|
+
state.default.session.setDebug(options.debug);
|
|
22
|
+
state.default.session.setCurlirize(options.curlirize);
|
|
20
23
|
|
|
21
24
|
if (await getTokens()) {
|
|
22
25
|
printMessage(`Revoking admin privileges from oauth2 client "${options.target}" in realm "${state.default.session.getRealm()}"...`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-revoke-oauth2-client-admin-privileges.js","names":["Command","Option","Admin","Authenticate","state","common","printMessage","getTokens","revokeOAuth2ClientAdminPrivileges","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","target","getRealm","parse"],"sources":["cli/admin/admin-revoke-oauth2-client-admin-privileges.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Admin, Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { revokeOAuth2ClientAdminPrivileges } = Admin;\n\nconst program = new Command(\n 'frodo admin revoke-oauth2-client-admin-privileges'\n);\n\nprogram\n .description('Revoke admin privileges from an oauth2 client.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option('-t, --target <target name or id>', 'Name of the oauth2 client.')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n printMessage(\n `Revoking admin privileges from oauth2 client \"${\n options.target\n }\" in realm \"${state.default.session.getRealm()}\"...`\n );\n await revokeOAuth2ClientAdminPrivileges(options.target);\n printMessage('Done.');\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,KAAT,EAAgBC,YAAhB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBJ,YAAtB;AACA,MAAM;EAAEK;AAAF,IAAwCN,KAA9C;AAEA,MAAMO,OAAO,GAAG,IAAIT,OAAJ,CACd,mDADc,CAAhB;AAIAS,OAAO,CACJC,WADH,CACe,gDADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeR,MAAM,CAACS,aAJtB,EAKGD,WALH,CAKeR,MAAM,CAACU,aALtB,EAMGF,WANH,CAMeR,MAAM,CAACW,YANtB,EAOGH,WAPH,CAOeR,MAAM,CAACY,gBAPtB,EAQGC,SARH,CAQab,MAAM,CAACc,gBARpB,EASGD,SATH,CASab,MAAM,CAACe,cATpB,EAUGF,SAVH,
|
|
1
|
+
{"version":3,"file":"admin-revoke-oauth2-client-admin-privileges.js","names":["Command","Option","Admin","Authenticate","state","common","printMessage","getTokens","revokeOAuth2ClientAdminPrivileges","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","target","getRealm","parse"],"sources":["cli/admin/admin-revoke-oauth2-client-admin-privileges.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Admin, Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { revokeOAuth2ClientAdminPrivileges } = Admin;\n\nconst program = new Command(\n 'frodo admin revoke-oauth2-client-admin-privileges'\n);\n\nprogram\n .description('Revoke admin privileges from an oauth2 client.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option('-t, --target <target name or id>', 'Name of the oauth2 client.')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (await getTokens()) {\n printMessage(\n `Revoking admin privileges from oauth2 client \"${\n options.target\n }\" in realm \"${state.default.session.getRealm()}\"...`\n );\n await revokeOAuth2ClientAdminPrivileges(options.target);\n printMessage('Done.');\n }\n }\n // end command logic inside action handler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I,WAAtB,CAAkCP,QAAlC;EACAxB,KAAK,CAAC0B,OAAN,CAAcC,OAAd,CAAsBK,iBAAtB,CAAwCP,OAAO,CAACQ,IAAhD;EACAjC,KAAK,CAAC0B,OAAN,CAAcC,OAAd,CAAsBO,0BAAtB,CAAiDT,OAAO,CAACU,QAAzD;EACAnC,KAAK,CAAC0B,OAAN,CAAcC,OAAd,CAAsBS,UAAtB,CAAiCX,OAAO,CAACY,OAAzC;EACArC,KAAK,CAAC0B,OAAN,CAAcC,OAAd,CAAsBW,QAAtB,CAA+Bb,OAAO,CAACc,KAAvC;EACAvC,KAAK,CAAC0B,OAAN,CAAcC,OAAd,CAAsBa,YAAtB,CAAmCf,OAAO,CAACgB,SAA3C;;EACA,IAAI,MAAMtC,SAAS,EAAnB,EAAuB;IACrBD,YAAY,CACT,iDACCuB,OAAO,CAACiB,MACT,eAAc1C,KAAK,CAAC0B,OAAN,CAAcC,OAAd,CAAsBgB,QAAtB,EAAiC,MAHtC,CAAZ;IAKA,MAAMvC,iCAAiC,CAACqB,OAAO,CAACiB,MAAT,CAAvC;IACAxC,YAAY,CAAC,OAAD,CAAZ;EACD;AACF,CArCL,CAsCI;AAtCJ;AAyCAG,OAAO,CAACuC,KAAR"}
|
|
@@ -9,7 +9,7 @@ const {
|
|
|
9
9
|
getTokens
|
|
10
10
|
} = Authenticate;
|
|
11
11
|
const program = new Command('frodo admin show-generic-extension-attributes');
|
|
12
|
-
program.description('Show generic extension attributes.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('--include-customized', 'Include customized attributes.').default(false, 'false')).addOption(new Option('--dry-run', 'Dry-run only, do not perform changes.').default(false, 'false')).action( // implement command logic inside action handler
|
|
12
|
+
program.description('Show generic extension attributes.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('--include-customized', 'Include customized attributes.').default(false, 'false')).addOption(new Option('--dry-run', 'Dry-run only, do not perform changes.').default(false, 'false')).action( // implement command logic inside action handler
|
|
13
13
|
async (host, realm, user, password, options) => {
|
|
14
14
|
state.default.session.setTenant(host);
|
|
15
15
|
state.default.session.setRealm(realm);
|
|
@@ -17,6 +17,9 @@ async (host, realm, user, password, options) => {
|
|
|
17
17
|
state.default.session.setPassword(password);
|
|
18
18
|
state.default.session.setDeploymentType(options.type);
|
|
19
19
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
20
|
+
state.default.session.setVerbose(options.verbose);
|
|
21
|
+
state.default.session.setDebug(options.debug);
|
|
22
|
+
state.default.session.setCurlirize(options.curlirize);
|
|
20
23
|
|
|
21
24
|
if (await getTokens()) {
|
|
22
25
|
printMessage(`Showing generic extension attributes in realm "${state.default.session.getRealm()}"...`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-show-generic-extension-attributes.js","names":["Command","Option","Authenticate","Admin","state","common","printMessage","showGenericExtensionAttributes","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","getRealm","includeCustomized","dryRun","parse"],"sources":["cli/admin/admin-show-generic-extension-attributes.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Admin, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { showGenericExtensionAttributes } = Admin;\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo admin show-generic-extension-attributes');\n\nprogram\n .description('Show generic extension attributes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option(\n '--include-customized',\n 'Include customized attributes.'\n ).default(false, 'false')\n )\n .addOption(\n new Option('--dry-run', 'Dry-run only, do not perform changes.').default(\n false,\n 'false'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n printMessage(\n `Showing generic extension attributes in realm \"${state.default.session.getRealm()}\"...`\n );\n await showGenericExtensionAttributes(\n options.includeCustomized,\n options.dryRun\n );\n printMessage('Done.');\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAqCJ,KAA3C;AACA,MAAM;EAAEK;AAAF,IAAgBN,YAAtB;AAEA,MAAMO,OAAO,GAAG,IAAIT,OAAJ,CAAY,+CAAZ,CAAhB;AAEAS,OAAO,CACJC,WADH,CACe,oCADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeR,MAAM,CAACS,aAJtB,EAKGD,WALH,CAKeR,MAAM,CAACU,aALtB,EAMGF,WANH,CAMeR,MAAM,CAACW,YANtB,EAOGH,WAPH,CAOeR,MAAM,CAACY,gBAPtB,EAQGC,SARH,CAQab,MAAM,CAACc,gBARpB,EASGD,SATH,CASab,MAAM,CAACe,cATpB,EAUGF,SAVH,
|
|
1
|
+
{"version":3,"file":"admin-show-generic-extension-attributes.js","names":["Command","Option","Authenticate","Admin","state","common","printMessage","showGenericExtensionAttributes","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","getRealm","includeCustomized","dryRun","parse"],"sources":["cli/admin/admin-show-generic-extension-attributes.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Admin, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { showGenericExtensionAttributes } = Admin;\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo admin show-generic-extension-attributes');\n\nprogram\n .description('Show generic extension attributes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '--include-customized',\n 'Include customized attributes.'\n ).default(false, 'false')\n )\n .addOption(\n new Option('--dry-run', 'Dry-run only, do not perform changes.').default(\n false,\n 'false'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (await getTokens()) {\n printMessage(\n `Showing generic extension attributes in realm \"${state.default.session.getRealm()}\"...`\n );\n await showGenericExtensionAttributes(\n options.includeCustomized,\n options.dryRun\n );\n printMessage('Done.');\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAqCJ,KAA3C;AACA,MAAM;EAAEK;AAAF,IAAgBN,YAAtB;AAEA,MAAMO,OAAO,GAAG,IAAIT,OAAJ,CAAY,+CAAZ,CAAhB;AAEAS,OAAO,CACJC,WADH,CACe,oCADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeR,MAAM,CAACS,aAJtB,EAKGD,WALH,CAKeR,MAAM,CAACU,aALtB,EAMGF,WANH,CAMeR,MAAM,CAACW,YANtB,EAOGH,WAPH,CAOeR,MAAM,CAACY,gBAPtB,EAQGC,SARH,CAQab,MAAM,CAACc,gBARpB,EASGD,SATH,CASab,MAAM,CAACe,cATpB,EAUGF,SAVH,CAUab,MAAM,CAACgB,aAVpB,EAWGH,SAXH,CAWab,MAAM,CAACiB,WAXpB,EAYGJ,SAZH,CAYab,MAAM,CAACkB,eAZpB,EAaGL,SAbH,CAcI,IAAIjB,MAAJ,CACE,sBADF,EAEE,gCAFF,EAGEuB,OAHF,CAGU,KAHV,EAGiB,OAHjB,CAdJ,EAmBGN,SAnBH,CAoBI,IAAIjB,MAAJ,CAAW,WAAX,EAAwB,uCAAxB,EAAiEuB,OAAjE,CACE,KADF,EAEE,OAFF,CApBJ,EAyBGC,MAzBH,EA0BI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9C1B,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBC,SAAtB,CAAgCN,IAAhC;EACAtB,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBE,QAAtB,CAA+BN,KAA/B;EACAvB,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBG,WAAtB,CAAkCN,IAAlC;EACAxB,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBI,WAAtB,CAAkCN,QAAlC;EACAzB,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACAjC,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;EACAnC,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBS,UAAtB,CAAiCV,OAAO,CAACW,OAAzC;EACArC,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBW,QAAtB,CAA+BZ,OAAO,CAACa,KAAvC;EACAvC,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBa,YAAtB,CAAmCd,OAAO,CAACe,SAA3C;;EACA,IAAI,MAAMrC,SAAS,EAAnB,EAAuB;IACrBF,YAAY,CACT,kDAAiDF,KAAK,CAACoB,OAAN,CAAcO,OAAd,CAAsBe,QAAtB,EAAiC,MADzE,CAAZ;IAGA,MAAMvC,8BAA8B,CAClCuB,OAAO,CAACiB,iBAD0B,EAElCjB,OAAO,CAACkB,MAF0B,CAApC;IAIA1C,YAAY,CAAC,OAAD,CAAZ;EACD;AACF,CA/CL,CAgDI;AAhDJ;AAmDAG,OAAO,CAACwC,KAAR"}
|
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = Authenticate;
|
|
9
9
|
const program = new Command('frodo cmd export');
|
|
10
|
-
program.description('
|
|
10
|
+
program.description('Agent export.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-i, --agent-id <agent-id>', 'Agent id. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export all agents to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all agents to separate files (*.<type>.agent.json) in the current directory. Ignored with -i or -a.')).action( // implement command logic inside action handler
|
|
11
11
|
async (host, realm, user, password, options) => {
|
|
12
12
|
state.default.session.setTenant(host);
|
|
13
13
|
state.default.session.setRealm(realm);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-export.js","names":["Command","Option","Authenticate","state","common","verboseMessage","exportAgentsToFile","exportAgentsToFiles","exportAgentToFile","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","agentId","file","all","allSeparate","help","parse"],"sources":["cli/agent/agent-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { verboseMessage } from '../../utils/Console.js';\nimport {\n exportAgentsToFile,\n exportAgentsToFiles,\n exportAgentToFile,\n} from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo cmd export');\n\nprogram\n .description('
|
|
1
|
+
{"version":3,"file":"agent-export.js","names":["Command","Option","Authenticate","state","common","verboseMessage","exportAgentsToFile","exportAgentsToFiles","exportAgentToFile","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","agentId","file","all","allSeparate","help","parse"],"sources":["cli/agent/agent-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { verboseMessage } from '../../utils/Console.js';\nimport {\n exportAgentsToFile,\n exportAgentsToFiles,\n exportAgentToFile,\n} from '../../ops/AgentOps.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo cmd export');\n\nprogram\n .description('Agent export.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-i, --agent-id <agent-id>',\n 'Agent id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export all agents to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all agents to separate files (*.<type>.agent.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (await getTokens()) {\n // export\n if (options.agentId) {\n verboseMessage('Exporting agent...');\n await exportAgentToFile(options.agentId, options.file);\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all agents to a single file...');\n await exportAgentsToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all agents to separate files...');\n await exportAgentsToFiles();\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage(\n 'Unrecognized combination of options or no options...'\n );\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,cAAT,QAA+B,wBAA/B;AACA,SACEC,kBADF,EAEEC,mBAFF,EAGEC,iBAHF,QAIO,uBAJP;AAMA,MAAM;EAAEC;AAAF,IAAgBP,YAAtB;AAEA,MAAMQ,OAAO,GAAG,IAAIV,OAAJ,CAAY,kBAAZ,CAAhB;AAEAU,OAAO,CACJC,WADH,CACe,eADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeV,MAAM,CAACW,aAJtB,EAKGD,WALH,CAKeV,MAAM,CAACY,aALtB,EAMGF,WANH,CAMeV,MAAM,CAACa,YANtB,EAOGH,WAPH,CAOeV,MAAM,CAACc,gBAPtB,EAQGC,SARH,CAQaf,MAAM,CAACgB,gBARpB,EASGD,SATH,CASaf,MAAM,CAACiB,cATpB,EAUGF,SAVH,CAUaf,MAAM,CAACkB,aAVpB,EAWGH,SAXH,CAWaf,MAAM,CAACmB,WAXpB,EAYGJ,SAZH,CAYaf,MAAM,CAACoB,eAZpB,EAaGL,SAbH,CAcI,IAAIlB,MAAJ,CACE,2BADF,EAEE,gDAFF,CAdJ,EAmBGkB,SAnBH,CAmBa,IAAIlB,MAAJ,CAAW,mBAAX,EAAgC,0BAAhC,CAnBb,EAoBGkB,S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,cAAc,CAAC,0CAAD,CAAd;MACA,MAAMC,kBAAkB,CAACwB,OAAO,CAACkB,IAAT,CAAxB;IACD,CAHI,CAIL;IAJK,KAKA,IAAIlB,OAAO,CAACoB,WAAZ,EAAyB;MAC5B7C,cAAc,CAAC,2CAAD,CAAd;MACA,MAAME,mBAAmB,EAAzB;IACD,CAHI,CAIL;IAJK,KAKA;MACHF,cAAc,CACZ,sDADY,CAAd;MAGAK,OAAO,CAACyC,IAAR;IACD;EACF;AACF,CApEL,CAqEI;AArEJ;AAwEAzC,OAAO,CAAC0C,KAAR"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
2
|
+
import { Command, Option } from 'commander';
|
|
3
|
+
import { deleteService, deleteServices } from '../../ops/ServiceOps.js';
|
|
4
|
+
import * as common from '../cmd_common.js';
|
|
5
|
+
const {
|
|
6
|
+
getTokens
|
|
7
|
+
} = Authenticate;
|
|
8
|
+
const program = new Command('frodo service delete');
|
|
9
|
+
program.description('Delete AM services.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-i, --id <id>', 'Id of Service to be deleted.')).addOption(new Option('-a, --all', 'Delete all services. Ignored with -i.')).action(async (host, realm, user, password, options) => {
|
|
10
|
+
state.default.session.setTenant(host);
|
|
11
|
+
state.default.session.setRealm(realm);
|
|
12
|
+
state.default.session.setUsername(user);
|
|
13
|
+
state.default.session.setPassword(password);
|
|
14
|
+
state.default.session.setDeploymentType(options.type);
|
|
15
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
16
|
+
state.default.session.setVerbose(options.verbose);
|
|
17
|
+
state.default.session.setDebug(options.debug);
|
|
18
|
+
state.default.session.setCurlirize(options.curlirize);
|
|
19
|
+
|
|
20
|
+
if (options.id && (await getTokens())) {
|
|
21
|
+
await deleteService(options.id);
|
|
22
|
+
} else if (options.all && (await getTokens())) {
|
|
23
|
+
await deleteServices();
|
|
24
|
+
} else {
|
|
25
|
+
program.help();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
program.parse();
|
|
29
|
+
//# sourceMappingURL=service-delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-delete.js","names":["Authenticate","state","Command","Option","deleteService","deleteServices","common","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","id","all","help","parse"],"sources":["cli/service/service-delete.ts"],"sourcesContent":["import { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { Command, Option } from 'commander';\nimport { deleteService, deleteServices } from '../../ops/ServiceOps.js';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo service delete');\n\ninterface ServiceDeleteOptions {\n id?: string;\n type?: string;\n insecure?: boolean;\n verbose?: boolean;\n debug?: boolean;\n curlirize?: boolean;\n all?: boolean;\n}\n\nprogram\n .description('Delete AM services.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(new Option('-i, --id <id>', 'Id of Service to be deleted.'))\n .addOption(new Option('-a, --all', 'Delete all services. Ignored with -i.'))\n .action(\n async (\n host: string,\n realm: string,\n user: string,\n password: string,\n options: ServiceDeleteOptions\n ) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (options.id && (await getTokens())) {\n await deleteService(options.id);\n } else if (options.all && (await getTokens())) {\n await deleteServices();\n } else {\n program.help();\n }\n }\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,aAAT,EAAwBC,cAAxB,QAA8C,yBAA9C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AAEA,MAAM;EAAEC;AAAF,IAAgBP,YAAtB;AAEA,MAAMQ,OAAO,GAAG,IAAIN,OAAJ,CAAY,sBAAZ,CAAhB;AAYAM,OAAO,CACJC,WADH,CACe,qBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeN,MAAM,CAACO,aAJtB,EAKGD,WALH,CAKeN,MAAM,CAACQ,aALtB,EAMGF,WANH,CAMeN,MAAM,CAACS,YANtB,EAOGH,WAPH,CAOeN,MAAM,CAACU,gBAPtB,EAQGC,SARH,CAQaX,MAAM,CAACY,gBARpB,EASGD,SATH,CASaX,MAAM,CAACa,cATpB,EAUGF,SAVH,CAUaX,MAAM,CAACc,aAVpB,EAWGH,SAXH,CAWaX,MAAM,CAACe,WAXpB,EAYGJ,SAZH,CAYaX,MAAM,CAACgB,eAZpB,EAaGL,SAbH,CAaa,IAAId,MAAJ,CAAW,eAAX,EAA4B,8BAA5B,CAbb,EAcGc,SAdH,CAca,IAAId,MAAJ,CAAW,WAAX,EAAwB,uCAAxB,CAdb,EAeGoB,MAfH,CAgBI,OACEC,IADF,EAEEC,KAFF,EAGEC,IAHF,EAIEC,QAJF,EAKEC,OALF,KAMK;EACH3B,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBC,SAAtB,CAAgCP,IAAhC;EACAvB,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBE,QAAtB,CAA+BP,KAA/B;EACAxB,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBG,WAAtB,CAAkCP,IAAlC;EACAzB,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBI,WAAtB,CAAkCP,QAAlC;EACA1B,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBK,iBAAtB,CAAwCP,OAAO,CAACQ,IAAhD;EACAnC,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBO,0BAAtB,CAAiDT,OAAO,CAACU,QAAzD;EACArC,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBS,UAAtB,CAAiCX,OAAO,CAACY,OAAzC;EACAvC,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBW,QAAtB,CAA+Bb,OAAO,CAACc,KAAvC;EACAzC,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBa,YAAtB,CAAmCf,OAAO,CAACgB,SAA3C;;EACA,IAAIhB,OAAO,CAACiB,EAAR,KAAe,MAAMtC,SAAS,EAA9B,CAAJ,EAAuC;IACrC,MAAMH,aAAa,CAACwB,OAAO,CAACiB,EAAT,CAAnB;EACD,CAFD,MAEO,IAAIjB,OAAO,CAACkB,GAAR,KAAgB,MAAMvC,SAAS,EAA/B,CAAJ,EAAwC;IAC7C,MAAMF,cAAc,EAApB;EACD,CAFM,MAEA;IACLG,OAAO,CAACuC,IAAR;EACD;AACF,CAvCL;AA0CAvC,OAAO,CAACwC,KAAR"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
2
|
+
import { Command, Option } from 'commander';
|
|
3
|
+
import { exportServicesToFile, exportServicesToFiles, exportServiceToFile } from '../../ops/ServiceOps.js';
|
|
4
|
+
import { printMessage, verboseMessage } from '../../utils/Console.js';
|
|
5
|
+
import * as common from '../cmd_common.js';
|
|
6
|
+
const {
|
|
7
|
+
getTokens
|
|
8
|
+
} = Authenticate;
|
|
9
|
+
const program = new Command('frodo service export');
|
|
10
|
+
program.description('Export AM services.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-i, --service-id <service-id>', 'Service id. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export all services to a single file.')).addOption(new Option('-A, --all-separate', 'Export all services to separate files (*.service.json) in the current directory. Ignored with -a.')).action(async (host, realm, user, password, options) => {
|
|
11
|
+
state.default.session.setTenant(host);
|
|
12
|
+
state.default.session.setRealm(realm);
|
|
13
|
+
state.default.session.setUsername(user);
|
|
14
|
+
state.default.session.setPassword(password);
|
|
15
|
+
state.default.session.setDeploymentType(options.type);
|
|
16
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
17
|
+
state.default.session.setVerbose(options.verbose);
|
|
18
|
+
state.default.session.setDebug(options.debug);
|
|
19
|
+
state.default.session.setCurlirize(options.curlirize); // export by name
|
|
20
|
+
|
|
21
|
+
if (options.serviceId && (await getTokens())) {
|
|
22
|
+
verboseMessage('Exporting service...');
|
|
23
|
+
await exportServiceToFile(options.serviceId, options.file);
|
|
24
|
+
} // -a / --all
|
|
25
|
+
else if (options.all && (await getTokens())) {
|
|
26
|
+
verboseMessage('Exporting all services to a single file...');
|
|
27
|
+
await exportServicesToFile(options.file);
|
|
28
|
+
} // -A / --all-separate
|
|
29
|
+
else if (options.allSeparate && (await getTokens())) {
|
|
30
|
+
verboseMessage('Exporting all services to separate files...');
|
|
31
|
+
await exportServicesToFiles();
|
|
32
|
+
} // unrecognized combination of options or no options
|
|
33
|
+
else {
|
|
34
|
+
printMessage('Unrecognized combination of options or no options...', 'error');
|
|
35
|
+
program.help();
|
|
36
|
+
}
|
|
37
|
+
} // end command logic inside action handler
|
|
38
|
+
);
|
|
39
|
+
program.parse();
|
|
40
|
+
//# sourceMappingURL=service-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-export.js","names":["Authenticate","state","Command","Option","exportServicesToFile","exportServicesToFiles","exportServiceToFile","printMessage","verboseMessage","common","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","serviceId","file","all","allSeparate","help","parse"],"sources":["cli/service/service-export.ts"],"sourcesContent":["import { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { Command, Option } from 'commander';\nimport {\n exportServicesToFile,\n exportServicesToFiles,\n exportServiceToFile,\n} from '../../ops/ServiceOps.js';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo service export');\n\ninterface ServiceExportOptions {\n file?: string;\n all?: boolean;\n serviceId?: string;\n allSeparate?: boolean;\n type?: string;\n insecure?: boolean;\n verbose?: boolean;\n debug?: boolean;\n curlirize?: boolean;\n}\n\nprogram\n .description('Export AM services.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-i, --service-id <service-id>',\n 'Service id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(new Option('-a, --all', 'Export all services to a single file.'))\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all services to separate files (*.service.json) in the current directory. Ignored with -a.'\n )\n )\n .action(\n async (\n host: string,\n realm: string,\n user: string,\n password: string,\n options: ServiceExportOptions\n ) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n // export by name\n if (options.serviceId && (await getTokens())) {\n verboseMessage('Exporting service...');\n await exportServiceToFile(options.serviceId, options.file);\n }\n // -a / --all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all services to a single file...');\n await exportServicesToFile(options.file);\n }\n // -A / --all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all services to separate files...');\n await exportServicesToFiles();\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 }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SACEC,oBADF,EAEEC,qBAFF,EAGEC,mBAHF,QAIO,yBAJP;AAKA,SAASC,YAAT,EAAuBC,cAAvB,QAA6C,wBAA7C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AAEA,MAAM;EAAEC;AAAF,IAAgBV,YAAtB;AAEA,MAAMW,OAAO,GAAG,IAAIT,OAAJ,CAAY,sBAAZ,CAAhB;AAcAS,OAAO,CACJC,WADH,CACe,qBADf,EAEGC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AAzD;EACAxC,KAAK,CAAC+B,OAAN,CAAcC,OAAd,CAAsBS,UAAtB,CAAiCX,OAAO,CAACY,OAAzC;EACA1C,KAAK,CAAC+B,OAAN,CAAcC,OAAd,CAAsBW,QAAtB,CAA+Bb,OAAO,CAACc,KAAvC;EACA5C,KAAK,CAAC+B,OAAN,CAAcC,OAAd,CAAsBa,YAAtB,CAAmCf,OAAO,CAACgB,SAA3C,EATG,CAUH;;EACA,IAAIhB,OAAO,CAACiB,SAAR,KAAsB,MAAMtC,SAAS,EAArC,CAAJ,EAA8C;IAC5CF,cAAc,CAAC,sBAAD,CAAd;IACA,MAAMF,mBAAmB,CAACyB,OAAO,CAACiB,SAAT,EAAoBjB,OAAO,CAACkB,IAA5B,CAAzB;EACD,CAHD,CAIA;EAJA,KAKK,IAAIlB,OAAO,CAACmB,GAAR,KAAgB,MAAMxC,SAAS,EAA/B,CAAJ,EAAwC;IAC3CF,cAAc,CAAC,4CAAD,CAAd;IACA,MAAMJ,oBAAoB,CAAC2B,OAAO,CAACkB,IAAT,CAA1B;EACD,CAHI,CAIL;EAJK,KAKA,IAAIlB,OAAO,CAACoB,WAAR,KAAwB,MAAMzC,SAAS,EAAvC,CAAJ,EAAgD;IACnDF,cAAc,CAAC,6CAAD,CAAd;IACA,MAAMH,qBAAqB,EAA3B;EACD,CAHI,CAIL;EAJK,KAKA;IACHE,YAAY,CACV,sDADU,EAEV,OAFU,CAAZ;IAIAI,OAAO,CAACyC,IAAR;EACD;AACF,CAnEL,CAoEI;AApEJ;AAuEAzC,OAAO,CAAC0C,KAAR"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
2
|
+
import { Command, Option } from 'commander';
|
|
3
|
+
import { importFirstServiceFromFile, importServiceFromFile, importServicesFromFile, importServicesFromFiles } from '../../ops/ServiceOps.js';
|
|
4
|
+
import { printMessage, verboseMessage } from '../../utils/Console.js';
|
|
5
|
+
import * as common from '../cmd_common.js';
|
|
6
|
+
const {
|
|
7
|
+
getTokens
|
|
8
|
+
} = Authenticate;
|
|
9
|
+
const program = new Command('frodo service import');
|
|
10
|
+
program.description('Import AM services.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-i, --service-id <service-id>', 'Service id. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to import SAML Entity(s) from. Ignored with -A.')).addOption(new Option('-a, --all', 'Import all services from a single file.')).addOption(new Option('-C, --clean', 'Remove existing service(s) before importing.')).addOption(new Option('-A, --all-separate', 'Import all services from separate files <id>.service.json.')).addOption(new Option('-D, --directory <directory>', 'Working directory.')).action(async (host, realm, user, password, options) => {
|
|
11
|
+
state.default.session.setTenant(host);
|
|
12
|
+
state.default.session.setRealm(realm);
|
|
13
|
+
state.default.session.setUsername(user);
|
|
14
|
+
state.default.session.setPassword(password);
|
|
15
|
+
state.default.session.setDeploymentType(options.type);
|
|
16
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
17
|
+
state.default.session.setVerbose(options.verbose);
|
|
18
|
+
state.default.session.setDebug(options.debug);
|
|
19
|
+
state.default.session.setCurlirize(options.curlirize);
|
|
20
|
+
state.default.session.setDirectory(options.directory || '.');
|
|
21
|
+
const clean = options.clean ?? false; // import by id
|
|
22
|
+
|
|
23
|
+
if (options.serviceId && options.file && (await getTokens())) {
|
|
24
|
+
verboseMessage('Importing service...');
|
|
25
|
+
await importServiceFromFile(options.serviceId, options.file, clean);
|
|
26
|
+
} // -a / --all
|
|
27
|
+
else if (options.all && options.file && (await getTokens())) {
|
|
28
|
+
verboseMessage('Importing all services from a single file...');
|
|
29
|
+
await importServicesFromFile(options.file, clean);
|
|
30
|
+
} // -A / --all-separate
|
|
31
|
+
else if (options.allSeparate && (await getTokens())) {
|
|
32
|
+
verboseMessage('Importing all services from separate files...');
|
|
33
|
+
await importServicesFromFiles(clean);
|
|
34
|
+
} // import file
|
|
35
|
+
else if (options.file && (await getTokens())) {
|
|
36
|
+
verboseMessage('Importing service...');
|
|
37
|
+
await importFirstServiceFromFile(options.file, clean);
|
|
38
|
+
} // unrecognized combination of options or no options
|
|
39
|
+
else {
|
|
40
|
+
printMessage('Unrecognized combination of options or no options...', 'error');
|
|
41
|
+
program.help();
|
|
42
|
+
}
|
|
43
|
+
} // end command logic inside action handler
|
|
44
|
+
);
|
|
45
|
+
program.parse();
|
|
46
|
+
//# sourceMappingURL=service-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-import.js","names":["Authenticate","state","Command","Option","importFirstServiceFromFile","importServiceFromFile","importServicesFromFile","importServicesFromFiles","printMessage","verboseMessage","common","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","setDirectory","directory","clean","serviceId","file","all","allSeparate","help","parse"],"sources":["cli/service/service-import.ts"],"sourcesContent":["import { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { Command, Option } from 'commander';\nimport {\n importFirstServiceFromFile,\n importServiceFromFile,\n importServicesFromFile,\n importServicesFromFiles,\n} from '../../ops/ServiceOps.js';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo service import');\n\ninterface ServiceImportOptions {\n file?: string;\n all?: boolean;\n serviceId?: string;\n allSeparate?: boolean;\n type?: string;\n insecure?: boolean;\n clean?: boolean;\n directory?: string;\n verbose?: boolean;\n debug?: boolean;\n curlirize?: boolean;\n}\n\nprogram\n .description('Import AM services.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-i, --service-id <service-id>',\n 'Service id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import SAML Entity(s) from. Ignored with -A.'\n )\n )\n .addOption(new Option('-a, --all', 'Import all services from a single file.'))\n .addOption(\n new Option('-C, --clean', 'Remove existing service(s) before importing.')\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all services from separate files <id>.service.json.'\n )\n )\n .addOption(new Option('-D, --directory <directory>', 'Working directory.'))\n .action(\n async (\n host: string,\n realm: string,\n user: string,\n password: string,\n options: ServiceImportOptions\n ) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n state.default.session.setDirectory(options.directory || '.');\n\n const clean = options.clean ?? false;\n\n // import by id\n if (options.serviceId && options.file && (await getTokens())) {\n verboseMessage('Importing service...');\n await importServiceFromFile(options.serviceId, options.file, clean);\n }\n // -a / --all\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage('Importing all services from a single file...');\n await importServicesFromFile(options.file, clean);\n }\n // -A / --all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Importing all services from separate files...');\n await importServicesFromFiles(clean);\n }\n // import file\n else if (options.file && (await getTokens())) {\n verboseMessage('Importing service...');\n await importFirstServiceFromFile(options.file, clean);\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 }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SACEC,0BADF,EAEEC,qBAFF,EAGEC,sBAHF,EAIEC,uBAJF,QAKO,yBALP;AAMA,SAASC,YAAT,EAAuBC,cAAvB,QAA6C,wBAA7C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AAEA,MAAM;EAAEC;AAAF,IAAgBX,YAAtB;AAEA,MAAMY,OAAO,GAAG,IAAIV,OAAJ,CAAY,sBAAZ,CAAhB;AAgBAU,OAAO,CACJC,WADH,CACe,qBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeN,MAAM,CAACO,aAJtB,EAKGD,WALH,CAKeN,MAAM,CAACQ,aALtB,EAMGF,WANH,CAMeN,MAAM,CAACS,YANtB,EAOGH,WAPH,CAOeN,MAAM,CAACU,gBAPtB,EAQGC,SARH,CAQaX,MAAM,CAACY,gBARpB,EASGD,SATH,CASaX,MAAM,CAACa,cATpB,EAUGF,SAVH,CAUaX,MAAM,CAACc,aAVpB,EAWGH,SAXH,CAWaX,MAAM,CAACe,WAXpB,EAYGJ,SAZH,CAYaX,MAAM,CAACgB,eAZpB,EAaGL,SAbH,CAcI,IAAIlB,MAAJ,CACE,+BADF,EAEE,kDAFF,CAdJ,EAmBGkB,SAnBH,CAoBI,IAAIlB,MAAJ,CACE,mBADF,EAEE,kEAFF,CApBJ,EAyBGkB,SAzBH,CAyBa,IAAIlB,MAAJ,CAAW,WAAX,EAAwB,yCAAxB,CAzBb,EA0BGkB,SA1BH,CA2BI,IAAIlB,MAAJ,CAAW,aAAX,EAA0B,8CAA1B,CA3BJ,EA6BGkB,SA7BH,CA8BI,IAAIlB,MA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,qBAAqB,CAAC2B,OAAO,CAACoB,SAAT,EAAoBpB,OAAO,CAACqB,IAA5B,EAAkCF,KAAlC,CAA3B;EACD,CAHD,CAIA;EAJA,KAKK,IAAInB,OAAO,CAACsB,GAAR,IAAetB,OAAO,CAACqB,IAAvB,KAAgC,MAAM1C,SAAS,EAA/C,CAAJ,EAAwD;IAC3DF,cAAc,CAAC,8CAAD,CAAd;IACA,MAAMH,sBAAsB,CAAC0B,OAAO,CAACqB,IAAT,EAAeF,KAAf,CAA5B;EACD,CAHI,CAIL;EAJK,KAKA,IAAInB,OAAO,CAACuB,WAAR,KAAwB,MAAM5C,SAAS,EAAvC,CAAJ,EAAgD;IACnDF,cAAc,CAAC,+CAAD,CAAd;IACA,MAAMF,uBAAuB,CAAC4C,KAAD,CAA7B;EACD,CAHI,CAIL;EAJK,KAKA,IAAInB,OAAO,CAACqB,IAAR,KAAiB,MAAM1C,SAAS,EAAhC,CAAJ,EAAyC;IAC5CF,cAAc,CAAC,sBAAD,CAAd;IACA,MAAML,0BAA0B,CAAC4B,OAAO,CAACqB,IAAT,EAAeF,KAAf,CAAhC;EACD,CAHI,CAIL;EAJK,KAKA;IACH3C,YAAY,CACV,sDADU,EAEV,OAFU,CAAZ;IAIAI,OAAO,CAAC4C,IAAR;EACD;AACF,CArFL,CAsFI;AAtFJ;AAyFA5C,OAAO,CAAC6C,KAAR"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
2
|
+
import { Command, Option } from 'commander';
|
|
3
|
+
import { listServices } from '../../ops/ServiceOps.js';
|
|
4
|
+
import { verboseMessage } from '../../utils/Console.js';
|
|
5
|
+
import * as common from '../cmd_common.js';
|
|
6
|
+
const {
|
|
7
|
+
getTokens
|
|
8
|
+
} = Authenticate;
|
|
9
|
+
const program = new Command('frodo service list');
|
|
10
|
+
program.description('List AM services.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).action(async (host, realm, user, password, options) => {
|
|
11
|
+
state.default.session.setTenant(host);
|
|
12
|
+
state.default.session.setRealm(realm);
|
|
13
|
+
state.default.session.setUsername(user);
|
|
14
|
+
state.default.session.setPassword(password);
|
|
15
|
+
state.default.session.setDeploymentType(options.type);
|
|
16
|
+
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
17
|
+
state.default.session.setVerbose(options.verbose);
|
|
18
|
+
state.default.session.setDebug(options.debug);
|
|
19
|
+
state.default.session.setCurlirize(options.curlirize);
|
|
20
|
+
|
|
21
|
+
if (await getTokens()) {
|
|
22
|
+
verboseMessage(`Listing all AM services for realm: ${realm}`);
|
|
23
|
+
await listServices(options.long);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
program.parse();
|
|
27
|
+
//# sourceMappingURL=service-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-list.js","names":["Authenticate","state","Command","Option","listServices","verboseMessage","common","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","long","parse"],"sources":["cli/service/service-list.ts"],"sourcesContent":["import { Authenticate, state } from '@rockcarver/frodo-lib';\nimport { Command, Option } from 'commander';\nimport { listServices } from '../../ops/ServiceOps.js';\nimport { verboseMessage } from '../../utils/Console.js';\nimport * as common from '../cmd_common.js';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo service list');\n\nprogram\n .description('List AM services.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .action(async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n if (await getTokens()) {\n verboseMessage(`Listing all AM services for realm: ${realm}`);\n await listServices(options.long);\n }\n });\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,QAA6B,yBAA7B;AACA,SAASC,cAAT,QAA+B,wBAA/B;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AAEA,MAAM;EAAEC;AAAF,IAAgBP,YAAtB;AAEA,MAAMQ,OAAO,GAAG,IAAIN,OAAJ,CAAY,oBAAZ,CAAhB;AAEAM,OAAO,CACJC,WADH,CACe,mBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeN,MAAM,CAACO,aAJtB,EAKGD,WALH,CAKeN,MAAM,CAACQ,aALtB,EAMGF,WANH,CAMeN,MAAM,CAACS,YANtB,EAOGH,WAPH,CAOeN,MAAM,CAACU,gBAPtB,EAQGC,SARH,CAQaX,MAAM,CAACY,gBARpB,EASGD,SATH,CASaX,MAAM,CAACa,cATpB,EAUGF,SAVH,CAUaX,MAAM,CAACc,aAVpB,EAWGH,SAXH,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
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
7
|
+
export default function setup() {
|
|
8
|
+
const program = new Command('service').helpOption('-h, --help', 'Help').description('Manage AM services.').executableDir(__dirname);
|
|
9
|
+
program.command('list', 'List AM services.').showHelpAfterError();
|
|
10
|
+
program.command('export', 'Export AM services.').showHelpAfterError();
|
|
11
|
+
program.command('import', 'Import AM services.').showHelpAfterError();
|
|
12
|
+
program.command('delete', 'Delete AM services.').showHelpAfterError();
|
|
13
|
+
program.showHelpAfterError();
|
|
14
|
+
return program;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","names":["Command","path","fileURLToPath","__dirname","dirname","import","meta","url","setup","program","helpOption","description","executableDir","command","showHelpAfterError"],"sources":["cli/service/service.ts"],"sourcesContent":["import { Command } from 'commander';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new Command('service')\n .helpOption('-h, --help', 'Help')\n .description('Manage AM services.')\n .executableDir(__dirname);\n\n program.command('list', 'List AM services.').showHelpAfterError();\n\n program.command('export', 'Export AM services.').showHelpAfterError();\n\n program.command('import', 'Import AM services.').showHelpAfterError();\n\n program.command('delete', 'Delete AM services.').showHelpAfterError();\n\n program.showHelpAfterError();\n return program;\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,WAAxB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,aAAT,QAA8B,KAA9B;;AAEA,MAAMC,SAAS,GAAGF,IAAI,CAACG,OAAL,CAAaF,aAAa,CAACG,MAAM,CAACC,IAAP,CAAYC,GAAb,CAA1B,CAAlB;;AAEA,eAAe,SAASC,KAAT,GAAiB;EAC9B,MAAMC,OAAO,GAAG,IAAIT,OAAJ,CAAY,SAAZ,EACbU,UADa,CACF,YADE,EACY,MADZ,EAEbC,WAFa,CAED,qBAFC,EAGbC,aAHa,CAGCT,SAHD,CAAhB;EAKAM,OAAO,CAACI,OAAR,CAAgB,MAAhB,EAAwB,mBAAxB,EAA6CC,kBAA7C;EAEAL,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,qBAA1B,EAAiDC,kBAAjD;EAEAL,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,qBAA1B,EAAiDC,kBAAjD;EAEAL,OAAO,CAACI,OAAR,CAAgB,QAAhB,EAA0B,qBAA1B,EAAiDC,kBAAjD;EAEAL,OAAO,CAACK,kBAAR;EACA,OAAOL,OAAP;AACD"}
|
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
deleteThemesCmd
|
|
12
12
|
} = Theme;
|
|
13
13
|
const program = new Command('frodo theme delete');
|
|
14
|
-
program.description('Delete themes.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('-n, --theme-name <name>', 'Name of the theme. If specified, -a and -A are ignored.')).addOption(new Option('-i, --theme-id <uuid>', 'Uuid of the theme. If specified, -a and -A are ignored.')).addOption(new Option('-a, --all', 'Delete all the themes in the realm. Ignored with -n and -i.')).action( // implement command logic inside action handler
|
|
14
|
+
program.description('Delete themes.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-n, --theme-name <name>', 'Name of the theme. If specified, -a and -A are ignored.')).addOption(new Option('-i, --theme-id <uuid>', 'Uuid of the theme. If specified, -a and -A are ignored.')).addOption(new Option('-a, --all', 'Delete all the themes in the realm. Ignored with -n and -i.')).action( // implement command logic inside action handler
|
|
15
15
|
async (host, realm, user, password, options) => {
|
|
16
16
|
state.default.session.setTenant(host);
|
|
17
17
|
state.default.session.setRealm(realm);
|
|
@@ -19,25 +19,25 @@ async (host, realm, user, password, options) => {
|
|
|
19
19
|
state.default.session.setPassword(password);
|
|
20
20
|
state.default.session.setDeploymentType(options.type);
|
|
21
21
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
22
|
+
state.default.session.setVerbose(options.verbose);
|
|
23
|
+
state.default.session.setDebug(options.debug);
|
|
24
|
+
state.default.session.setCurlirize(options.curlirize); // delete by name
|
|
22
25
|
|
|
23
|
-
if (await getTokens()) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
printMessage('Unrecognized combination of options or no options...');
|
|
39
|
-
program.help();
|
|
40
|
-
}
|
|
26
|
+
if (options.themeName && (await getTokens())) {
|
|
27
|
+
printMessage(`Deleting theme with name "${options.themeName}" from realm "${state.default.session.getRealm()}"...`);
|
|
28
|
+
deleteThemeByNameCmd(options.themeName);
|
|
29
|
+
} // delete by id
|
|
30
|
+
else if (options.themeId && (await getTokens())) {
|
|
31
|
+
printMessage(`Deleting theme with id "${options.themeId}" from realm "${state.default.session.getRealm()}"...`);
|
|
32
|
+
deleteThemeCmd(options.themeId);
|
|
33
|
+
} // --all -a
|
|
34
|
+
else if (options.all && (await getTokens())) {
|
|
35
|
+
printMessage(`Deleting all themes from realm "${state.default.session.getRealm()}"...`);
|
|
36
|
+
deleteThemesCmd();
|
|
37
|
+
} // unrecognized combination of options or no options
|
|
38
|
+
else {
|
|
39
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
40
|
+
program.help();
|
|
41
41
|
}
|
|
42
42
|
} // end command logic inside action handler
|
|
43
43
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-delete.js","names":["Command","Option","Authenticate","Theme","state","common","printMessage","getTokens","deleteThemeByNameCmd","deleteThemeCmd","deleteThemesCmd","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","themeName","getRealm","themeId","all","help","parse"],"sources":["cli/theme/theme-delete.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { deleteThemeByNameCmd, deleteThemeCmd, deleteThemesCmd } = Theme;\n\nconst program = new Command('frodo theme delete');\n\nprogram\n .description('Delete themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the themes in the realm. Ignored with -n and -i.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n
|
|
1
|
+
{"version":3,"file":"theme-delete.js","names":["Command","Option","Authenticate","Theme","state","common","printMessage","getTokens","deleteThemeByNameCmd","deleteThemeCmd","deleteThemesCmd","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","themeName","getRealm","themeId","all","help","parse"],"sources":["cli/theme/theme-delete.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { deleteThemeByNameCmd, deleteThemeCmd, deleteThemesCmd } = Theme;\n\nconst program = new Command('frodo theme delete');\n\nprogram\n .description('Delete themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the themes in the realm. Ignored with -n and -i.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n // delete by name\n if (options.themeName && (await getTokens())) {\n printMessage(\n `Deleting theme with name \"${\n options.themeName\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemeByNameCmd(options.themeName);\n }\n // delete by id\n else if (options.themeId && (await getTokens())) {\n printMessage(\n `Deleting theme with id \"${\n options.themeId\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemeCmd(options.themeId);\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n printMessage(\n `Deleting all themes from realm \"${state.default.session.getRealm()}\"...`\n );\n deleteThemesCmd();\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EAAEM,oBAAF;EAAwBC,cAAxB;EAAwCC;AAAxC,IAA4DP,KAAlE;AAEA,MAAMQ,OAAO,GAAG,IAAIX,OAAJ,CAAY,oBAAZ,CAAhB;AAEAW,OAAO,CACJC,WADH,CACe,gBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeV,MAAM,CAACW,aAJtB,EAKGD,WALH,CAKeV,MAAM,CAACY,aALtB,EAMGF,WANH,CAMeV,MAAM,CAACa,YANtB,EAOGH,WAPH,CAOeV,MAAM,CAACc,gBAPtB,EAQGC,SARH,CAQaf,MAAM,CAACgB,gBARpB,EASGD,SATH,CASaf,MAAM,CAACiB,cATpB,EAUGF,SAVH,CAUaf,MAAM,CAACkB,aAVpB,EAWGH,SAXH,CAWaf,MAAM,CAACmB,WAXpB,EAYGJ,SAZH,CAYaf,MAAM,CAACoB,eAZpB,EAaGL,SAbH,CAcI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KAzC,oBAAoB,CAACuB,OAAO,CAACiB,SAAT,CAApB;EACD,CAPD,CAQA;EARA,KASK,IAAIjB,OAAO,CAACmB,OAAR,KAAoB,MAAM3C,SAAS,EAAnC,CAAJ,EAA4C;IAC/CD,YAAY,CACT,2BACCyB,OAAO,CAACmB,OACT,iBAAgB9C,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBgB,QAAtB,EAAiC,MAHxC,CAAZ;IAKAxC,cAAc,CAACsB,OAAO,CAACmB,OAAT,CAAd;EACD,CAPI,CAQL;EARK,KASA,IAAInB,OAAO,CAACoB,GAAR,KAAgB,MAAM5C,SAAS,EAA/B,CAAJ,EAAwC;IAC3CD,YAAY,CACT,mCAAkCF,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBgB,QAAtB,EAAiC,MAD1D,CAAZ;IAGAvC,eAAe;EAChB,CALI,CAML;EANK,KAOA;IACHJ,YAAY,CAAC,sDAAD,CAAZ;IACAK,OAAO,CAACyC,IAAR;EACD;AACF,CAzEL,CA0EI;AA1EJ;AA6EAzC,OAAO,CAAC0C,KAAR"}
|
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
exportThemesToFiles
|
|
13
13
|
} = Theme;
|
|
14
14
|
const program = new Command('frodo theme export');
|
|
15
|
-
program.description('Export themes.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('-n, --theme-name <name>', 'Name of the theme. If specified, -a and -A are ignored.')).addOption(new Option('-i, --theme-id <uuid>', 'Uuid of the theme. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file [file]', 'Name of the file to write the exported theme(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the themes in a realm to a single file. Ignored with -n and -i.')).addOption(new Option('-A, --all-separate', 'Export all the themes in a realm as separate files <theme name>.theme.json. Ignored with -n, -i, and -a.')).action( // implement command logic inside action handler
|
|
15
|
+
program.description('Export themes.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(common.curlirizeOption).addOption(new Option('-n, --theme-name <name>', 'Name of the theme. If specified, -a and -A are ignored.')).addOption(new Option('-i, --theme-id <uuid>', 'Uuid of the theme. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file [file]', 'Name of the file to write the exported theme(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the themes in a realm to a single file. Ignored with -n and -i.')).addOption(new Option('-A, --all-separate', 'Export all the themes in a realm as separate files <theme name>.theme.json. Ignored with -n, -i, and -a.')).action( // implement command logic inside action handler
|
|
16
16
|
async (host, realm, user, password, options) => {
|
|
17
17
|
state.default.session.setTenant(host);
|
|
18
18
|
state.default.session.setRealm(realm);
|
|
@@ -20,29 +20,29 @@ async (host, realm, user, password, options) => {
|
|
|
20
20
|
state.default.session.setPassword(password);
|
|
21
21
|
state.default.session.setDeploymentType(options.type);
|
|
22
22
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
23
|
+
state.default.session.setVerbose(options.verbose);
|
|
24
|
+
state.default.session.setDebug(options.debug);
|
|
25
|
+
state.default.session.setCurlirize(options.curlirize); // export by name
|
|
23
26
|
|
|
24
|
-
if (await getTokens()) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
printMessage('Unrecognized combination of options or no options...', 'error');
|
|
44
|
-
program.help();
|
|
45
|
-
}
|
|
27
|
+
if (options.themeName && (await getTokens())) {
|
|
28
|
+
printMessage(`Exporting theme "${options.themeName}" from realm "${state.default.session.getRealm()}"...`);
|
|
29
|
+
exportThemeByName(options.themeName, options.file);
|
|
30
|
+
} // export by id
|
|
31
|
+
else if (options.themeId && (await getTokens())) {
|
|
32
|
+
printMessage(`Exporting theme "${options.themeId}" from realm "${state.default.session.getRealm()}"...`);
|
|
33
|
+
exportThemeById(options.themeId, options.file);
|
|
34
|
+
} // --all -a
|
|
35
|
+
else if (options.all && (await getTokens())) {
|
|
36
|
+
printMessage('Exporting all themes to a single file...');
|
|
37
|
+
exportThemesToFile(options.file);
|
|
38
|
+
} // --all-separate -A
|
|
39
|
+
else if (options.allSeparate && (await getTokens())) {
|
|
40
|
+
printMessage('Exporting all themes to separate files...');
|
|
41
|
+
exportThemesToFiles();
|
|
42
|
+
} // unrecognized combination of options or no options
|
|
43
|
+
else {
|
|
44
|
+
printMessage('Unrecognized combination of options or no options...', 'error');
|
|
45
|
+
program.help();
|
|
46
46
|
}
|
|
47
47
|
} // end command logic inside action handler
|
|
48
48
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-export.js","names":["Command","Option","Authenticate","Theme","state","common","printMessage","getTokens","exportThemeById","exportThemeByName","exportThemesToFile","exportThemesToFiles","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","themeName","getRealm","file","themeId","all","allSeparate","help","parse"],"sources":["cli/theme/theme-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst {\n exportThemeById,\n exportThemeByName,\n exportThemesToFile,\n exportThemesToFiles,\n} = Theme;\n\nconst program = new Command('frodo theme export');\n\nprogram\n .description('Export themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the file to write the exported theme(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the themes in a realm to a single file. Ignored with -n and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the themes in a realm as separate files <theme name>.theme.json. Ignored with -n, -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n
|
|
1
|
+
{"version":3,"file":"theme-export.js","names":["Command","Option","Authenticate","Theme","state","common","printMessage","getTokens","exportThemeById","exportThemeByName","exportThemesToFile","exportThemesToFiles","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","curlirizeOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","setCurlirize","curlirize","themeName","getRealm","file","themeId","all","allSeparate","help","parse"],"sources":["cli/theme/theme-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Theme, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst {\n exportThemeById,\n exportThemeByName,\n exportThemesToFile,\n exportThemesToFiles,\n} = Theme;\n\nconst program = new Command('frodo theme export');\n\nprogram\n .description('Export themes.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(common.curlirizeOption)\n .addOption(\n new Option(\n '-n, --theme-name <name>',\n 'Name of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-i, --theme-id <uuid>',\n 'Uuid of the theme. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the file to write the exported theme(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the themes in a realm to a single file. Ignored with -n and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the themes in a realm as separate files <theme name>.theme.json. Ignored with -n, -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n state.default.session.setCurlirize(options.curlirize);\n // export by name\n if (options.themeName && (await getTokens())) {\n printMessage(\n `Exporting theme \"${\n options.themeName\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n exportThemeByName(options.themeName, options.file);\n }\n // export by id\n else if (options.themeId && (await getTokens())) {\n printMessage(\n `Exporting theme \"${\n options.themeId\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n exportThemeById(options.themeId, options.file);\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n printMessage('Exporting all themes to a single file...');\n exportThemesToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && (await getTokens())) {\n printMessage('Exporting all themes to separate files...');\n exportThemesToFiles();\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 }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,EAA8BC,KAA9B,QAA2C,uBAA3C;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AAEA,MAAM;EACJM,eADI;EAEJC,iBAFI;EAGJC,kBAHI;EAIJC;AAJI,IAKFR,KALJ;AAOA,MAAMS,OAAO,GAAG,IAAIZ,OAAJ,CAAY,oBAAZ,CAAhB;AAEAY,OAAO,CACJC,WADH,CACe,gBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeX,MAAM,CAACY,aAJtB,EAKGD,WALH,CAKeX,MAAM,CAACa,aALtB,EAMGF,WANH,CAMeX,MAAM,CAACc,YANtB,EAOGH,WAPH,CAOeX,MAAM,CAACe,gBAPtB,EAQGC,SARH,CAQahB,MAAM,CAACiB,gBARpB,EASGD,SATH,CASahB,MAAM,CAACkB,cATpB,EAUGF,SAVH,CAUahB,MAAM,CAACmB,aAVpB,EAWGH,SAXH,CAWahB,MAAM,CAACoB,WAXpB,EAYGJ,SAZH,CAYahB,MAAM,CAACqB,eAZpB,EAaGL,SAbH,CAcI,IAAIpB,MAAJ,CACE,yBADF,EAEE,yDAFF,CAdJ,EAmBGoB,SAnBH,CAoBI,IAAIpB,MAAJ,CACE,uBADF,EAEE,yDAFF,CApBJ,EAyBGoB,SAzBH,C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