@rockcarver/frodo-cli 0.18.1 → 0.18.2-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -1
- package/esm/cli/admin/admin-add-autoid-static-user-mapping.js +3 -2
- 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 +5 -4
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-get-access-token.js +3 -2
- package/esm/cli/admin/admin-get-access-token.js.map +1 -1
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js +3 -2
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- package/esm/cli/admin/admin-list-static-user-mappings.js.map +1 -1
- package/esm/cli/admin/admin-remove-static-user-mapping.js +3 -2
- package/esm/cli/admin/admin-remove-static-user-mapping.js.map +1 -1
- package/esm/cli/admin/admin-repair-org-model.js +3 -2
- package/esm/cli/admin/admin-repair-org-model.js.map +1 -1
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +3 -2
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-show-generic-extension-attributes.js +3 -2
- package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +1 -1
- package/esm/cli/app/app-export.js +5 -4
- package/esm/cli/app/app-export.js.map +1 -1
- package/esm/cli/app/app-import.js +2 -1
- package/esm/cli/app/app-import.js.map +1 -1
- package/esm/cli/app/app-list.js +2 -1
- package/esm/cli/app/app-list.js.map +1 -1
- package/esm/cli/cmd_common.js +4 -4
- package/esm/cli/cmd_common.js.map +1 -1
- package/esm/cli/email/email-template-export.js +5 -4
- package/esm/cli/email/email-template-export.js.map +1 -1
- package/esm/cli/email/email-template-import.js +6 -5
- package/esm/cli/email/email-template-import.js.map +1 -1
- package/esm/cli/email/email-template-list.js +2 -1
- package/esm/cli/email/email-template-list.js.map +1 -1
- package/esm/cli/esv/esv-secret-create.js +2 -1
- package/esm/cli/esv/esv-secret-create.js.map +1 -1
- package/esm/cli/esv/esv-secret-delete.js +4 -3
- package/esm/cli/esv/esv-secret-delete.js.map +1 -1
- package/esm/cli/esv/esv-secret-describe.js +2 -1
- package/esm/cli/esv/esv-secret-describe.js.map +1 -1
- package/esm/cli/esv/esv-secret-list.js +2 -1
- package/esm/cli/esv/esv-secret-list.js.map +1 -1
- package/esm/cli/esv/esv-secret-set.js +2 -1
- package/esm/cli/esv/esv-secret-set.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-activate.js +3 -2
- package/esm/cli/esv/esv-secret-version-activate.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-create.js +2 -1
- package/esm/cli/esv/esv-secret-version-create.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-deactivate.js +3 -2
- package/esm/cli/esv/esv-secret-version-deactivate.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-delete.js +4 -3
- package/esm/cli/esv/esv-secret-version-delete.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-list.js +2 -1
- package/esm/cli/esv/esv-secret-version-list.js.map +1 -1
- package/esm/cli/esv/esv-variable-create.js +2 -1
- package/esm/cli/esv/esv-variable-create.js.map +1 -1
- package/esm/cli/esv/esv-variable-delete.js +4 -3
- package/esm/cli/esv/esv-variable-delete.js.map +1 -1
- package/esm/cli/esv/esv-variable-describe.js +2 -1
- package/esm/cli/esv/esv-variable-describe.js.map +1 -1
- package/esm/cli/esv/esv-variable-list.js +2 -1
- package/esm/cli/esv/esv-variable-list.js.map +1 -1
- package/esm/cli/esv/esv-variable-set.js +4 -3
- package/esm/cli/esv/esv-variable-set.js.map +1 -1
- package/esm/cli/idm/idm-count.js +2 -1
- package/esm/cli/idm/idm-count.js.map +1 -1
- package/esm/cli/idm/idm-export.js +5 -4
- package/esm/cli/idm/idm-export.js.map +1 -1
- package/esm/cli/idm/idm-list.js +3 -2
- package/esm/cli/idm/idm-list.js.map +1 -1
- package/esm/cli/idp/idp-export.js +6 -5
- package/esm/cli/idp/idp-export.js.map +1 -1
- package/esm/cli/idp/idp-import.js +7 -6
- package/esm/cli/idp/idp-import.js.map +1 -1
- package/esm/cli/idp/idp-list.js +3 -2
- package/esm/cli/idp/idp-list.js.map +1 -1
- package/esm/cli/info/info.js +7 -6
- package/esm/cli/info/info.js.map +1 -1
- package/esm/cli/journey/journey-delete.e2e.test_.js.map +1 -1
- package/esm/cli/journey/journey-delete.js +5 -4
- package/esm/cli/journey/journey-delete.js.map +1 -1
- package/esm/cli/journey/journey-describe.js.map +1 -1
- package/esm/cli/journey/journey-disable.js +3 -3
- package/esm/cli/journey/journey-disable.js.map +1 -1
- package/esm/cli/journey/journey-enable.js +3 -3
- package/esm/cli/journey/journey-enable.js.map +1 -1
- package/esm/cli/journey/journey-export.js +15 -18
- package/esm/cli/journey/journey-export.js.map +1 -1
- package/esm/cli/journey/journey-import.js +16 -22
- package/esm/cli/journey/journey-import.js.map +1 -1
- package/esm/cli/journey/journey-list.e2e.test_.js.map +1 -1
- package/esm/cli/journey/journey-list.js +5 -6
- package/esm/cli/journey/journey-list.js.map +1 -1
- package/esm/cli/journey/journey-prune.js +4 -3
- package/esm/cli/journey/journey-prune.js.map +1 -1
- package/esm/cli/journey/journey.js.map +1 -1
- package/esm/cli/logging/logs-fetch.js +28 -9
- package/esm/cli/logging/logs-fetch.js.map +1 -1
- package/esm/cli/logging/logs-list.js +11 -10
- package/esm/cli/logging/logs-list.js.map +1 -1
- package/esm/cli/logging/logs-tail.js +6 -5
- package/esm/cli/logging/logs-tail.js.map +1 -1
- package/esm/cli/logging/logs.js +2 -1
- package/esm/cli/logging/logs.js.map +1 -1
- package/esm/cli/realm/realm-add-custom-domain.js +3 -2
- package/esm/cli/realm/realm-add-custom-domain.js.map +1 -1
- package/esm/cli/realm/realm-describe.js +3 -2
- package/esm/cli/realm/realm-describe.js.map +1 -1
- package/esm/cli/realm/realm-list.js +3 -2
- package/esm/cli/realm/realm-list.js.map +1 -1
- package/esm/cli/realm/realm-remove-custom-domain.js +3 -2
- package/esm/cli/realm/realm-remove-custom-domain.js.map +1 -1
- package/esm/cli/saml/saml-cot-export.js +6 -5
- package/esm/cli/saml/saml-cot-export.js.map +1 -1
- package/esm/cli/saml/saml-cot-import.js +7 -6
- package/esm/cli/saml/saml-cot-import.js.map +1 -1
- package/esm/cli/saml/saml-cot-list.js +3 -2
- package/esm/cli/saml/saml-cot-list.js.map +1 -1
- package/esm/cli/saml/saml-describe.js +3 -2
- package/esm/cli/saml/saml-describe.js.map +1 -1
- package/esm/cli/saml/saml-export.js +6 -5
- package/esm/cli/saml/saml-export.js.map +1 -1
- package/esm/cli/saml/saml-import.js +7 -6
- package/esm/cli/saml/saml-import.js.map +1 -1
- package/esm/cli/saml/saml-list.js +3 -2
- package/esm/cli/saml/saml-list.js.map +1 -1
- package/esm/cli/saml/saml-metadata-export.js +5 -4
- package/esm/cli/saml/saml-metadata-export.js.map +1 -1
- package/esm/cli/script/script-delete.js +1 -1
- package/esm/cli/script/script-delete.js.map +1 -1
- package/esm/cli/script/script-describe.js +1 -1
- package/esm/cli/script/script-describe.js.map +1 -1
- package/esm/cli/script/script-export.js +6 -5
- package/esm/cli/script/script-export.js.map +1 -1
- package/esm/cli/script/script-import.js +3 -2
- package/esm/cli/script/script-import.js.map +1 -1
- package/esm/cli/script/script-list.js +3 -2
- package/esm/cli/script/script-list.js.map +1 -1
- package/esm/cli/theme/theme-delete.e2e.test_.js.map +1 -1
- package/esm/cli/theme/theme-delete.js +6 -5
- package/esm/cli/theme/theme-delete.js.map +1 -1
- package/esm/cli/theme/theme-export.js +7 -6
- package/esm/cli/theme/theme-export.js.map +1 -1
- package/esm/cli/theme/theme-import.js +8 -7
- package/esm/cli/theme/theme-import.js.map +1 -1
- package/esm/cli/theme/theme-list.e2e.test_.js.map +1 -1
- package/esm/cli/theme/theme-list.js +3 -2
- package/esm/cli/theme/theme-list.js.map +1 -1
- package/esm/ops/JourneyOps.js +325 -2
- package/esm/ops/JourneyOps.js.map +1 -1
- package/esm/ops/NodeOps.js.map +1 -1
- package/esm/ops/Saml2Ops.js.map +1 -1
- package/esm/ops/ScriptOps.js.map +1 -1
- package/esm/utils/Config.js.map +1 -1
- package/esm/utils/Console.js +1 -0
- package/esm/utils/Console.js.map +1 -1
- package/esm/utils/Version.js +1 -1
- package/esm/utils/Version.js.map +1 -1
- package/package.json +9 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, Admin, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
showGenericExtensionAttributes
|
|
6
7
|
} = Admin;
|
|
@@ -18,9 +19,9 @@ async (host, realm, user, password, options) => {
|
|
|
18
19
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
19
20
|
|
|
20
21
|
if (await getTokens()) {
|
|
21
|
-
|
|
22
|
+
printMessage(`Showing generic extension attributes in realm "${state.default.session.getRealm()}"...`);
|
|
22
23
|
await showGenericExtensionAttributes(options.includeCustomized, options.dryRun);
|
|
23
|
-
|
|
24
|
+
printMessage('Done.');
|
|
24
25
|
}
|
|
25
26
|
} // end command logic inside action handler
|
|
26
27
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-show-generic-extension-attributes.js","names":["Command","Option","Authenticate","Admin","state","common","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","
|
|
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,CAWI,IAAIjB,MAAJ,CACE,sBADF,EAEE,gCAFF,EAGEoB,OAHF,CAGU,KAHV,EAGiB,OAHjB,CAXJ,EAgBGH,SAhBH,CAiBI,IAAIjB,MAAJ,CAAW,WAAX,EAAwB,uCAAxB,EAAiEoB,OAAjE,CACE,KADF,EAEE,OAFF,CAjBJ,EAsBGC,MAtBH,EAuBI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9CvB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBC,SAAtB,CAAgCN,IAAhC;EACAnB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBE,QAAtB,CAA+BN,KAA/B;EACApB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBG,WAAtB,CAAkCN,IAAlC;EACArB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBI,WAAtB,CAAkCN,QAAlC;EACAtB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACA9B,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;;EACA,IAAI,MAAM5B,SAAS,EAAnB,EAAuB;IACrBF,YAAY,CACT,kDAAiDF,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBS,QAAtB,EAAiC,MADzE,CAAZ;IAGA,MAAM9B,8BAA8B,CAClCoB,OAAO,CAACW,iBAD0B,EAElCX,OAAO,CAACY,MAF0B,CAApC;IAIAjC,YAAY,CAAC,OAAD,CAAZ;EACD;AACF,CAzCL,CA0CI;AA1CJ;AA6CAG,OAAO,CAAC+B,KAAR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -22,19 +23,19 @@ async (host, realm, user, password, options) => {
|
|
|
22
23
|
if (await getTokens()) {
|
|
23
24
|
// export
|
|
24
25
|
if (options.appId) {
|
|
25
|
-
|
|
26
|
+
printMessage('Exporting OAuth2 application...');
|
|
26
27
|
exportOAuth2ClientToFile(options.appId, options.file);
|
|
27
28
|
} // -a/--all
|
|
28
29
|
else if (options.all) {
|
|
29
|
-
|
|
30
|
+
printMessage('Exporting all OAuth2 applications to file...');
|
|
30
31
|
exportOAuth2ClientsToFile(options.file);
|
|
31
32
|
} // -A/--all-separate
|
|
32
33
|
else if (options.allSeparate) {
|
|
33
|
-
|
|
34
|
+
printMessage('Exporting all applications to separate files...');
|
|
34
35
|
exportOAuth2ClientsToFiles();
|
|
35
36
|
} // unrecognized combination of options or no options
|
|
36
37
|
else {
|
|
37
|
-
|
|
38
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
38
39
|
program.help();
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-export.js","names":["Command","Option","Authenticate","OAuth2Client","state","common","getTokens","exportOAuth2ClientsToFile","exportOAuth2ClientsToFiles","exportOAuth2ClientToFile","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","appId","
|
|
1
|
+
{"version":3,"file":"app-export.js","names":["Command","Option","Authenticate","OAuth2Client","state","common","printMessage","getTokens","exportOAuth2ClientsToFile","exportOAuth2ClientsToFiles","exportOAuth2ClientToFile","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","appId","file","all","allSeparate","help","parse"],"sources":["cli/app/app-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst {\n exportOAuth2ClientsToFile,\n exportOAuth2ClientsToFiles,\n exportOAuth2ClientToFile,\n} = OAuth2Client;\n\nconst program = new Command('frodo app export');\n\nprogram\n .description('Export OAuth2 applications.')\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 '-i, --app-id <app-id>',\n 'App 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 OAuth2 apps to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all OAuth2 apps to separate files (*.oauth2.app.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 if (await getTokens()) {\n // export\n if (options.appId) {\n printMessage('Exporting OAuth2 application...');\n exportOAuth2ClientToFile(options.appId, options.file);\n }\n // -a/--all\n else if (options.all) {\n printMessage('Exporting all OAuth2 applications to file...');\n exportOAuth2ClientsToFile(options.file);\n }\n // -A/--all-separate\n else if (options.allSeparate) {\n printMessage('Exporting all applications to separate files...');\n exportOAuth2ClientsToFiles();\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 }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,YAAvB,EAAqCC,KAArC,QAAkD,uBAAlD;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EACJM,yBADI;EAEJC,0BAFI;EAGJC;AAHI,IAIFP,YAJJ;AAMA,M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M/B,SAAS,EAAnB,EAAuB;IACrB;IACA,IAAIqB,OAAO,CAACW,KAAZ,EAAmB;MACjBjC,YAAY,CAAC,iCAAD,CAAZ;MACAI,wBAAwB,CAACkB,OAAO,CAACW,KAAT,EAAgBX,OAAO,CAACY,IAAxB,CAAxB;IACD,CAHD,CAIA;IAJA,KAKK,IAAIZ,OAAO,CAACa,GAAZ,EAAiB;MACpBnC,YAAY,CAAC,8CAAD,CAAZ;MACAE,yBAAyB,CAACoB,OAAO,CAACY,IAAT,CAAzB;IACD,CAHI,CAIL;IAJK,KAKA,IAAIZ,OAAO,CAACc,WAAZ,EAAyB;MAC5BpC,YAAY,CAAC,iDAAD,CAAZ;MACAG,0BAA0B;IAC3B,CAHI,CAIL;IAJK,KAKA;MACHH,YAAY,CAAC,sDAAD,CAAZ;MACAK,OAAO,CAACgC,IAAR;IACD;EACF;AACF,CA5DL,CA6DI;AA7DJ;AAgEAhC,OAAO,CAACiC,KAAR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -36,7 +37,7 @@ async (host, realm, user, password, options) => {
|
|
|
36
37
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
37
38
|
|
|
38
39
|
if (await getTokens()) {
|
|
39
|
-
|
|
40
|
+
printMessage(`Importing OAuth2 application(s) ...`);
|
|
40
41
|
importOAuth2ClientsFromFile(options.file);
|
|
41
42
|
}
|
|
42
43
|
} // end command logic inside action handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-import.js","names":["Command","Option","Authenticate","OAuth2Client","state","common","getTokens","importOAuth2ClientsFromFile","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","
|
|
1
|
+
{"version":3,"file":"app-import.js","names":["Command","Option","Authenticate","OAuth2Client","state","common","printMessage","getTokens","importOAuth2ClientsFromFile","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","file","parse"],"sources":["cli/app/app-import.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { importOAuth2ClientsFromFile } = OAuth2Client;\n\nconst program = new Command('frodo app import');\n\nprogram\n .description('Import OAuth2 applications.')\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 // '-i, --cmd-id <cmd-id>',\n // 'Cmd id. If specified, only one cmd 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 cmds from single file. Ignored with -i.'\n // )\n // )\n // .addOption(\n // new Option(\n // '-A, --all-separate',\n // 'Import all cmds from separate files (*.cmd.json) in the current directory. Ignored with -i or -a.'\n // )\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n printMessage(`Importing OAuth2 application(s) ...`);\n importOAuth2ClientsFromFile(options.file);\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,YAAvB,EAAqCC,KAArC,QAAkD,uBAAlD;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EAAEM;AAAF,IAAkCL,YAAxC;AAEA,MAAMM,OAAO,GAAG,IAAIT,OAAJ,CAAY,kBAAZ,CAAhB;AAEAS,OAAO,CACJC,WADH,CACe,6BADf,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,EAUE;AACA;AACA;AACA;AACA;AACA;AAfF,CAgBGF,SAhBH,CAgBa,IAAIjB,MAAJ,CAAW,mBAAX,EAAgC,6BAAhC,CAhBb,EAiBE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA5BF,CA6BGoB,MA7BH,EA8BI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9CtB,KAAK,CAACuB,OAAN,CAAcC,OAAd,CAAsBC,SAAtB,CAAgCP,IAAhC;EACAlB,KAAK,CAACuB,OAAN,CAAcC,OAAd,CAAsBE,QAAtB,CAA+BP,KAA/B;EACAnB,KAAK,CAACuB,OAAN,CAAcC,OAAd,CAAsBG,WAAtB,CAAkCP,IAAlC;EACApB,KAAK,CAACuB,OAAN,CAAcC,OAAd,CAAsBI,WAAtB,CAAkCP,QAAlC;EACArB,KAAK,CAACuB,OAAN,CAAcC,OAAd,CAAsBK,iBAAtB,CAAwCP,OAAO,CAACQ,IAAhD;EACA9B,KAAK,CAACuB,OAAN,CAAcC,OAAd,CAAsBO,0BAAtB,CAAiDT,OAAO,CAACU,QAAzD;;EACA,IAAI,MAAM7B,SAAS,EAAnB,EAAuB;IACrBD,YAAY,CAAE,qCAAF,CAAZ;IACAE,2BAA2B,CAACkB,OAAO,CAACW,IAAT,CAA3B;EACD;AACF,CA1CL,CA2CI;AA3CJ;AA8CA5B,OAAO,CAAC6B,KAAR"}
|
package/esm/cli/app/app-list.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -18,7 +19,7 @@ async (host, realm, user, password, options) => {
|
|
|
18
19
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
19
20
|
|
|
20
21
|
if (await getTokens()) {
|
|
21
|
-
|
|
22
|
+
printMessage(`Listing OAuth2 applications...`);
|
|
22
23
|
listOAuth2Clients(options.long);
|
|
23
24
|
}
|
|
24
25
|
} // end command logic inside action handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-list.js","names":["Command","Option","Authenticate","OAuth2Client","state","common","getTokens","listOAuth2Clients","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","
|
|
1
|
+
{"version":3,"file":"app-list.js","names":["Command","Option","Authenticate","OAuth2Client","state","common","printMessage","getTokens","listOAuth2Clients","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","long","parse"],"sources":["cli/app/app-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, OAuth2Client, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { listOAuth2Clients } = OAuth2Client;\n\nconst program = new Command('frodo app list');\n\nprogram\n .description('List OAuth2 applications.')\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('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n printMessage(`Listing OAuth2 applications...`);\n listOAuth2Clients(options.long);\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,YAAvB,EAAqCC,KAArC,QAAkD,uBAAlD;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EAAEM;AAA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O,CAAC6B,KAAR"}
|
package/esm/cli/cmd_common.js
CHANGED
|
@@ -7,10 +7,10 @@ state.default.session.setVerboseHandler(verboseMessage);
|
|
|
7
7
|
state.default.session.setDebugHandler(debugMessage);
|
|
8
8
|
state.default.session.setCreateProgressHandler(createProgressIndicator);
|
|
9
9
|
state.default.session.setUpdateProgressHandler(updateProgressIndicator);
|
|
10
|
-
state.default.session.setStopProgressHandler(stopProgressIndicator);
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
state.default.session.setStopProgressHandler(stopProgressIndicator);
|
|
11
|
+
export function init() {// pseudo functions for commands that do not otherwise need to import
|
|
12
|
+
// this file but need to trigger print and progress handler registration
|
|
13
|
+
}
|
|
14
14
|
const hostArgumentDescription = 'Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring.';
|
|
15
15
|
export const hostArgument = new Argument('[host]', hostArgumentDescription);
|
|
16
16
|
export const hostArgumentM = new Argument('<host>', hostArgumentDescription);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd_common.js","names":["Argument","Option","state","global","printMessage","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","verboseMessage","debugMessage","default","session","setPrintHandler","setVerboseHandler","setDebugHandler","setCreateProgressHandler","setUpdateProgressHandler","setStopProgressHandler","init","hostArgumentDescription","hostArgument","hostArgumentM","realmArgumentDescription","realmArgument","DEFAULT_REALM_KEY","realmArgumentM","userArgumentDescription","userArgument","userArgumentM","passwordArgumentDescription","passwordArgument","passwordArgumentM","apiKeyArgumentDescription","apiKeyArgument","apiSecretArgumentDescription","apiSecretArgument","treeOptionDescription","treeOption","treeOptionM","fileOptionDescription","fileOption","fileOptionM","deploymentOptionDescription","deploymentOption","choices","DEPLOYMENT_TYPES","deploymentOptionM","insecureOption","verboseOption","debugOption","managedNameOption","managedNameOptionM","dirOptionDescription","dirOption","dirOptionM","entitiesFileOptionDescription","entitiesFileOption","entitiesFileOptionM","envFileOptionDescription","envFileOption","envFileOptionM","sourcesOptionDescription","sourcesOptionDefaultValueDescription","sourcesOptionM","scriptFriendlyOption","makeOptionMandatory"],"sources":["cli/cmd_common.ts"],"sourcesContent":["import { Argument, Option } from 'commander';\nimport { state } from '@rockcarver/frodo-lib';\nimport * as global from '../storage/StaticStorage.js';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n verboseMessage,\n debugMessage,\n} from '../utils/Console.js';\n\nstate.default.session.setPrintHandler(printMessage);\nstate.default.session.setVerboseHandler(verboseMessage);\nstate.default.session.setDebugHandler(debugMessage);\nstate.default.session.setCreateProgressHandler(createProgressIndicator);\nstate.default.session.setUpdateProgressHandler(updateProgressIndicator);\nstate.default.session.setStopProgressHandler(stopProgressIndicator);\n\n// pseudo functions for commands that do not otherwise need to import\n// this file but need to trigger print and progress handler registration\nexport function init() {}\n\nconst hostArgumentDescription =\n 'Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring.';\nexport const hostArgument = new Argument('[host]', hostArgumentDescription);\nexport const hostArgumentM = new Argument('<host>', hostArgumentDescription);\n\nconst realmArgumentDescription =\n \"Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise.\";\nexport const realmArgument = new Argument(\n '[realm]',\n realmArgumentDescription\n).default(\n global.DEFAULT_REALM_KEY,\n '\"alpha\" for Identity Cloud tenants, \"/\" otherwise.'\n);\nexport const realmArgumentM = new Argument('<realm>', realmArgumentDescription);\n\nconst userArgumentDescription =\n 'Username to login with. Must be an admin user with appropriate rights to manage authentication journeys/trees.';\nexport const userArgument = new Argument('[user]', userArgumentDescription);\nexport const userArgumentM = new Argument('<user>', userArgumentDescription);\n\nconst passwordArgumentDescription = 'Password.';\nexport const passwordArgument = new Argument(\n '[password]',\n passwordArgumentDescription\n);\nexport const passwordArgumentM = new Argument(\n '<password>',\n passwordArgumentDescription\n);\n\nconst apiKeyArgumentDescription = 'API key for logging API.';\nexport const apiKeyArgument = new Argument('[key]', apiKeyArgumentDescription);\n\nconst apiSecretArgumentDescription = 'API secret for logging API.';\nexport const apiSecretArgument = new Argument(\n '[secret]',\n apiSecretArgumentDescription\n);\n\nconst treeOptionDescription =\n 'Specify the name of an authentication journey/tree.';\nexport const treeOption = new Option(\n '-t, --tree <tree>',\n treeOptionDescription\n);\nexport const treeOptionM = new Option(\n '-t, --tree <tree>',\n treeOptionDescription\n);\n\nconst fileOptionDescription = 'File name.';\nexport const fileOption = new Option(\n '-f, --file <file>',\n fileOptionDescription\n);\nexport const fileOptionM = new Option(\n '-f, --file <file>',\n fileOptionDescription\n);\n\nconst deploymentOptionDescription =\n 'Override auto-detected deployment type. Valid values for type: \\n\\\nclassic: A classic Access Management-only deployment with custom layout and configuration. \\n\\\ncloud: A ForgeRock Identity Cloud environment. \\n\\\nforgeops: A ForgeOps CDK or CDM deployment. \\n\\\nThe detected or provided deployment type controls certain behavior like obtaining an Identity \\\nManagement admin token or not and whether to export/import referenced email templates or how \\\nto walk through the tenant admin login flow of Identity Cloud and handle MFA';\nexport const deploymentOption = new Option(\n '-m, --type <type>',\n deploymentOptionDescription\n).choices(global.DEPLOYMENT_TYPES);\nexport const deploymentOptionM = new Option(\n '-m, --type <type>',\n deploymentOptionDescription\n).choices(global.DEPLOYMENT_TYPES);\n\nexport const insecureOption = new Option(\n '-k, --insecure',\n 'Allow insecure connections when using SSL/TLS. Has no effect when using a network proxy for https (HTTPS_PROXY=http://<host>:<port>), in that case the proxy must provide this capability.'\n).default(false, \"Don't allow insecure connections\");\n\nexport const verboseOption = new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n);\n\nexport const debugOption = new Option(\n '--debug',\n 'Debug output during command execution. If specified, may or may not produce additional output helpful for troubleshooting.'\n);\n\nexport const managedNameOption = new Option(\n '-N, --name <name>',\n 'Managed object name to be operated on. Examples are \\\nuser, role, alpha_user, alpha_role etc.'\n);\nexport const managedNameOptionM = new Option(\n '-N, --name <name>',\n 'Managed object name to be operated on. Examples are \\\nuser, role, alpha_user, alpha_role etc.'\n);\n\nconst dirOptionDescription =\n 'Directory for exporting all configuration entities to.';\nexport const dirOption = new Option(\n '-D, --directory <directory>',\n dirOptionDescription\n);\nexport const dirOptionM = new Option(\n '-D, --directory <directory>',\n dirOptionDescription\n);\n\nconst entitiesFileOptionDescription =\n 'JSON file that specifies the config entities to export/import.';\nexport const entitiesFileOption = new Option(\n '-E, --entitiesFile <file>',\n entitiesFileOptionDescription\n);\nexport const entitiesFileOptionM = new Option(\n '-E, --entitiesFile <file>',\n entitiesFileOptionDescription\n);\n\nconst envFileOptionDescription =\n 'File that defines environment specific variables for replacement during configuration export/import.';\nexport const envFileOption = new Option(\n '-e, --envFile <file>',\n envFileOptionDescription\n);\nexport const envFileOptionM = new Option(\n '-e, --envFile <file>',\n envFileOptionDescription\n);\n\nconst sourcesOptionDescription = 'Comma separated list of log sources';\nconst sourcesOptionDefaultValueDescription = 'Log everything';\nexport const sourcesOptionM = new Option(\n '-c, --sources <sources>',\n sourcesOptionDescription\n).default('am-everything,idm-everything', sourcesOptionDefaultValueDescription);\n\nexport const scriptFriendlyOption = new Option(\n '-s, --scriptFriendly',\n 'Send output of operation to STDOUT in a script-friendly format (JSON) which can be piped to other \\\ncommands. User messages/warnings are output to STDERR, and are not piped. For example, to only get \\\nbearer token: \\n\\\n<<< frodo info my-tenant -s 2>/dev/null | jq -r .bearerToken >>>'\n).default(false, 'Output as plain text');\n\ntreeOptionM.makeOptionMandatory();\nfileOptionM.makeOptionMandatory();\ndeploymentOptionM.makeOptionMandatory();\ndirOptionM.makeOptionMandatory();\nentitiesFileOptionM.makeOptionMandatory();\nenvFileOptionM.makeOptionMandatory();\nmanagedNameOptionM.makeOptionMandatory();\nsourcesOptionM.makeOptionMandatory();\n"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,MAAnB,QAAiC,WAAjC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,OAAO,KAAKC,MAAZ,MA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B,EAG5BnD,OAH4B,CAGpB,8BAHoB,EAGYoD,oCAHZ,CAAvB;AAKP,OAAO,MAAME,oBAAoB,GAAG,IAAI/D,MAAJ,CAClC,sBADkC,EAElC;AACF;AACA;AACA,iEALoC,EAMlCS,OANkC,CAM1B,KAN0B,EAMnB,sBANmB,CAA7B;AAQP4B,WAAW,CAAC2B,mBAAZ;AACAxB,WAAW,CAACwB,mBAAZ;AACAnB,iBAAiB,CAACmB,mBAAlB;AACAX,UAAU,CAACW,mBAAX;AACAR,mBAAmB,CAACQ,mBAApB;AACAL,cAAc,CAACK,mBAAf;AACAd,kBAAkB,CAACc,mBAAnB;AACAF,cAAc,CAACE,mBAAf"}
|
|
1
|
+
{"version":3,"file":"cmd_common.js","names":["Argument","Option","state","global","printMessage","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","verboseMessage","debugMessage","default","session","setPrintHandler","setVerboseHandler","setDebugHandler","setCreateProgressHandler","setUpdateProgressHandler","setStopProgressHandler","init","hostArgumentDescription","hostArgument","hostArgumentM","realmArgumentDescription","realmArgument","DEFAULT_REALM_KEY","realmArgumentM","userArgumentDescription","userArgument","userArgumentM","passwordArgumentDescription","passwordArgument","passwordArgumentM","apiKeyArgumentDescription","apiKeyArgument","apiSecretArgumentDescription","apiSecretArgument","treeOptionDescription","treeOption","treeOptionM","fileOptionDescription","fileOption","fileOptionM","deploymentOptionDescription","deploymentOption","choices","DEPLOYMENT_TYPES","deploymentOptionM","insecureOption","verboseOption","debugOption","managedNameOption","managedNameOptionM","dirOptionDescription","dirOption","dirOptionM","entitiesFileOptionDescription","entitiesFileOption","entitiesFileOptionM","envFileOptionDescription","envFileOption","envFileOptionM","sourcesOptionDescription","sourcesOptionDefaultValueDescription","sourcesOptionM","scriptFriendlyOption","makeOptionMandatory"],"sources":["cli/cmd_common.ts"],"sourcesContent":["import { Argument, Option } from 'commander';\nimport { state } from '@rockcarver/frodo-lib';\nimport * as global from '../storage/StaticStorage.js';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n verboseMessage,\n debugMessage,\n} from '../utils/Console.js';\n\nstate.default.session.setPrintHandler(printMessage);\nstate.default.session.setVerboseHandler(verboseMessage);\nstate.default.session.setDebugHandler(debugMessage);\nstate.default.session.setCreateProgressHandler(createProgressIndicator);\nstate.default.session.setUpdateProgressHandler(updateProgressIndicator);\nstate.default.session.setStopProgressHandler(stopProgressIndicator);\n\nexport function init() {\n // pseudo functions for commands that do not otherwise need to import\n // this file but need to trigger print and progress handler registration\n}\n\nconst hostArgumentDescription =\n 'Access Management base URL, e.g.: https://cdk.iam.example.com/am. To use a connection profile, just specify a unique substring.';\nexport const hostArgument = new Argument('[host]', hostArgumentDescription);\nexport const hostArgumentM = new Argument('<host>', hostArgumentDescription);\n\nconst realmArgumentDescription =\n \"Realm. Specify realm as '/' for the root realm or 'realm' or '/parent/child' otherwise.\";\nexport const realmArgument = new Argument(\n '[realm]',\n realmArgumentDescription\n).default(\n global.DEFAULT_REALM_KEY,\n '\"alpha\" for Identity Cloud tenants, \"/\" otherwise.'\n);\nexport const realmArgumentM = new Argument('<realm>', realmArgumentDescription);\n\nconst userArgumentDescription =\n 'Username to login with. Must be an admin user with appropriate rights to manage authentication journeys/trees.';\nexport const userArgument = new Argument('[user]', userArgumentDescription);\nexport const userArgumentM = new Argument('<user>', userArgumentDescription);\n\nconst passwordArgumentDescription = 'Password.';\nexport const passwordArgument = new Argument(\n '[password]',\n passwordArgumentDescription\n);\nexport const passwordArgumentM = new Argument(\n '<password>',\n passwordArgumentDescription\n);\n\nconst apiKeyArgumentDescription = 'API key for logging API.';\nexport const apiKeyArgument = new Argument('[key]', apiKeyArgumentDescription);\n\nconst apiSecretArgumentDescription = 'API secret for logging API.';\nexport const apiSecretArgument = new Argument(\n '[secret]',\n apiSecretArgumentDescription\n);\n\nconst treeOptionDescription =\n 'Specify the name of an authentication journey/tree.';\nexport const treeOption = new Option(\n '-t, --tree <tree>',\n treeOptionDescription\n);\nexport const treeOptionM = new Option(\n '-t, --tree <tree>',\n treeOptionDescription\n);\n\nconst fileOptionDescription = 'File name.';\nexport const fileOption = new Option(\n '-f, --file <file>',\n fileOptionDescription\n);\nexport const fileOptionM = new Option(\n '-f, --file <file>',\n fileOptionDescription\n);\n\nconst deploymentOptionDescription =\n 'Override auto-detected deployment type. Valid values for type: \\n\\\nclassic: A classic Access Management-only deployment with custom layout and configuration. \\n\\\ncloud: A ForgeRock Identity Cloud environment. \\n\\\nforgeops: A ForgeOps CDK or CDM deployment. \\n\\\nThe detected or provided deployment type controls certain behavior like obtaining an Identity \\\nManagement admin token or not and whether to export/import referenced email templates or how \\\nto walk through the tenant admin login flow of Identity Cloud and handle MFA';\nexport const deploymentOption = new Option(\n '-m, --type <type>',\n deploymentOptionDescription\n).choices(global.DEPLOYMENT_TYPES);\nexport const deploymentOptionM = new Option(\n '-m, --type <type>',\n deploymentOptionDescription\n).choices(global.DEPLOYMENT_TYPES);\n\nexport const insecureOption = new Option(\n '-k, --insecure',\n 'Allow insecure connections when using SSL/TLS. Has no effect when using a network proxy for https (HTTPS_PROXY=http://<host>:<port>), in that case the proxy must provide this capability.'\n).default(false, \"Don't allow insecure connections\");\n\nexport const verboseOption = new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n);\n\nexport const debugOption = new Option(\n '--debug',\n 'Debug output during command execution. If specified, may or may not produce additional output helpful for troubleshooting.'\n);\n\nexport const managedNameOption = new Option(\n '-N, --name <name>',\n 'Managed object name to be operated on. Examples are \\\nuser, role, alpha_user, alpha_role etc.'\n);\nexport const managedNameOptionM = new Option(\n '-N, --name <name>',\n 'Managed object name to be operated on. Examples are \\\nuser, role, alpha_user, alpha_role etc.'\n);\n\nconst dirOptionDescription =\n 'Directory for exporting all configuration entities to.';\nexport const dirOption = new Option(\n '-D, --directory <directory>',\n dirOptionDescription\n);\nexport const dirOptionM = new Option(\n '-D, --directory <directory>',\n dirOptionDescription\n);\n\nconst entitiesFileOptionDescription =\n 'JSON file that specifies the config entities to export/import.';\nexport const entitiesFileOption = new Option(\n '-E, --entitiesFile <file>',\n entitiesFileOptionDescription\n);\nexport const entitiesFileOptionM = new Option(\n '-E, --entitiesFile <file>',\n entitiesFileOptionDescription\n);\n\nconst envFileOptionDescription =\n 'File that defines environment specific variables for replacement during configuration export/import.';\nexport const envFileOption = new Option(\n '-e, --envFile <file>',\n envFileOptionDescription\n);\nexport const envFileOptionM = new Option(\n '-e, --envFile <file>',\n envFileOptionDescription\n);\n\nconst sourcesOptionDescription = 'Comma separated list of log sources';\nconst sourcesOptionDefaultValueDescription = 'Log everything';\nexport const sourcesOptionM = new Option(\n '-c, --sources <sources>',\n sourcesOptionDescription\n).default('am-everything,idm-everything', sourcesOptionDefaultValueDescription);\n\nexport const scriptFriendlyOption = new Option(\n '-s, --scriptFriendly',\n 'Send output of operation to STDOUT in a script-friendly format (JSON) which can be piped to other \\\ncommands. User messages/warnings are output to STDERR, and are not piped. For example, to only get \\\nbearer token: \\n\\\n<<< frodo info my-tenant -s 2>/dev/null | jq -r .bearerToken >>>'\n).default(false, 'Output as plain text');\n\ntreeOptionM.makeOptionMandatory();\nfileOptionM.makeOptionMandatory();\ndeploymentOptionM.makeOptionMandatory();\ndirOptionM.makeOptionMandatory();\nentitiesFileOptionM.makeOptionMandatory();\nenvFileOptionM.makeOptionMandatory();\nmanagedNameOptionM.makeOptionMandatory();\nsourcesOptionM.makeOptionMandatory();\n"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,MAAnB,QAAiC,WAAjC;AACA,SAASC,KAAT,QAAsB,uBAAtB;AACA,OAAO,KAAKC,MAAZ,MAAwB,6BAAxB;AACA,SACEC,YADF,EAEEC,uBAFF,EAGEC,uBAHF,EAIEC,qBAJF,EAKEC,cALF,EAMEC,YANF,QAOO,qBAPP;AASAP,KAAK,CAACQ,OAAN,CAAcC,OAAd,CAAsBC,eAAtB,CAAsCR,YAAtC;AACAF,KAAK,CAACQ,OAAN,CAAcC,OAAd,C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AZ;AACAxB,WAAW,CAACwB,mBAAZ;AACAnB,iBAAiB,CAACmB,mBAAlB;AACAX,UAAU,CAACW,mBAAX;AACAR,mBAAmB,CAACQ,mBAApB;AACAL,cAAc,CAACK,mBAAf;AACAd,kBAAkB,CAACc,mBAAnB;AACAF,cAAc,CAACE,mBAAf"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -22,19 +23,19 @@ async (host, realm, user, password, options) => {
|
|
|
22
23
|
if (await getTokens()) {
|
|
23
24
|
// export by id/name
|
|
24
25
|
if (options.templateId) {
|
|
25
|
-
|
|
26
|
+
printMessage(`Exporting email template "${options.templateId}" from realm "${state.default.session.getRealm()}"...`);
|
|
26
27
|
exportEmailTemplateToFile(options.templateId, options.file);
|
|
27
28
|
} // --all -a
|
|
28
29
|
else if (options.all) {
|
|
29
|
-
|
|
30
|
+
printMessage('Exporting all email templates to a single file...');
|
|
30
31
|
exportEmailTemplatesToFile(options.file);
|
|
31
32
|
} // --all-separate -A
|
|
32
33
|
else if (options.allSeparate) {
|
|
33
|
-
|
|
34
|
+
printMessage('Exporting all email templates to separate files...');
|
|
34
35
|
exportEmailTemplatesToFiles();
|
|
35
36
|
} // unrecognized combination of options or no options
|
|
36
37
|
else {
|
|
37
|
-
|
|
38
|
+
printMessage('Unrecognized combination of options or no options...', 'error');
|
|
38
39
|
program.help();
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template-export.js","names":["Command","Option","Authenticate","EmailTemplate","state","common","getTokens","exportEmailTemplatesToFile","exportEmailTemplatesToFiles","exportEmailTemplateToFile","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","templateId","
|
|
1
|
+
{"version":3,"file":"email-template-export.js","names":["Command","Option","Authenticate","EmailTemplate","state","common","printMessage","getTokens","exportEmailTemplatesToFile","exportEmailTemplatesToFiles","exportEmailTemplateToFile","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","templateId","getRealm","file","all","allSeparate","help","parse"],"sources":["cli/email/email-template-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst {\n exportEmailTemplatesToFile,\n exportEmailTemplatesToFiles,\n exportEmailTemplateToFile,\n} = EmailTemplate;\n\nconst program = new Command('frodo email template export');\n\nprogram\n .description('Export email templates.')\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 '-i, --template-id <template-id>',\n 'Email template id/name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Name of the export file. Ignored with -A. Defaults to <template-id>.template.email.json.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all email templates to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all email templates as separate files <template-id>.template.email.json. Ignored with -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 if (await getTokens()) {\n // export by id/name\n if (options.templateId) {\n printMessage(\n `Exporting email template \"${\n options.templateId\n }\" from realm \"${state.default.session.getRealm()}\"...`\n );\n exportEmailTemplateToFile(options.templateId, options.file);\n }\n // --all -a\n else if (options.all) {\n printMessage('Exporting all email templates to a single file...');\n exportEmailTemplatesToFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate) {\n printMessage('Exporting all email templates to separate files...');\n exportEmailTemplatesToFiles();\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 }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,aAAvB,EAAsCC,KAAtC,QAAmD,uBAAnD;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EACJM,0BADI;EAEJC,2BAFI;EAGJC;AAHI,IAIFP,aAJJ;AAMA,MAAMQ,OAAO,GAAG,IAAIX,OAAJ,CAAY,6BAAZ,CAAhB;AAEAW,OAAO,CACJC,WADH,CACe,yBADf,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,cAT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BAA0B,CAACoB,OAAO,CAACa,IAAT,CAA1B;IACD,CAHI,CAIL;IAJK,KAKA,IAAIb,OAAO,CAACe,WAAZ,EAAyB;MAC5BrC,YAAY,CAAC,oDAAD,CAAZ;MACAG,2BAA2B;IAC5B,CAHI,CAIL;IAJK,KAKA;MACHH,YAAY,CACV,sDADU,EAEV,OAFU,CAAZ;MAIAK,OAAO,CAACiC,IAAR;IACD;EACF;AACF,CAxEL,CAyEI;AAzEJ;AA4EAjC,OAAO,CAACkC,KAAR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -23,23 +24,23 @@ async (host, realm, user, password, options) => {
|
|
|
23
24
|
if (await getTokens()) {
|
|
24
25
|
// import by id
|
|
25
26
|
if (options.file && options.templateId) {
|
|
26
|
-
|
|
27
|
+
printMessage(`Importing email template "${options.templateId}"...`);
|
|
27
28
|
importEmailTemplateFromFile(options.templateId, options.file);
|
|
28
29
|
} // --all -a
|
|
29
30
|
else if (options.all && options.file) {
|
|
30
|
-
|
|
31
|
+
printMessage(`Importing all email templates from a single file (${options.file})...`);
|
|
31
32
|
importEmailTemplatesFromFile(options.file);
|
|
32
33
|
} // --all-separate -A
|
|
33
34
|
else if (options.allSeparate && !options.file) {
|
|
34
|
-
|
|
35
|
+
printMessage('Importing all email templates from separate files (*.template.email.json) in current directory...');
|
|
35
36
|
importEmailTemplatesFromFiles();
|
|
36
37
|
} // import first template from file
|
|
37
38
|
else if (options.file) {
|
|
38
|
-
|
|
39
|
+
printMessage(`Importing first email template from file "${options.file}"...`);
|
|
39
40
|
importFirstEmailTemplateFromFile(options.file);
|
|
40
41
|
} // unrecognized combination of options or no options
|
|
41
42
|
else {
|
|
42
|
-
|
|
43
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
43
44
|
program.help();
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template-import.js","names":["Command","Option","Authenticate","EmailTemplate","state","common","getTokens","importEmailTemplateFromFile","importEmailTemplatesFromFile","importEmailTemplatesFromFiles","importFirstEmailTemplateFromFile","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","file","templateId","
|
|
1
|
+
{"version":3,"file":"email-template-import.js","names":["Command","Option","Authenticate","EmailTemplate","state","common","printMessage","getTokens","importEmailTemplateFromFile","importEmailTemplatesFromFile","importEmailTemplatesFromFiles","importFirstEmailTemplateFromFile","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","file","templateId","all","allSeparate","help","parse"],"sources":["cli/email/email-template-import.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst {\n importEmailTemplateFromFile,\n importEmailTemplatesFromFile,\n importEmailTemplatesFromFiles,\n importFirstEmailTemplateFromFile,\n} = EmailTemplate;\n\nconst program = new Command('frodo email template import');\n\nprogram\n .description('Import email templates.')\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 '-i, --template-id <template-id>',\n 'Email template id/name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the import file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Import all email templates from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all email templates from separate files (*.template.email.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .action(\n // implement program logic inside action handler\n async (host, realm, user, password, options) => {\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 // import by id\n if (options.file && options.templateId) {\n printMessage(`Importing email template \"${options.templateId}\"...`);\n importEmailTemplateFromFile(options.templateId, options.file);\n }\n // --all -a\n else if (options.all && options.file) {\n printMessage(\n `Importing all email templates from a single file (${options.file})...`\n );\n importEmailTemplatesFromFile(options.file);\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file) {\n printMessage(\n 'Importing all email templates from separate files (*.template.email.json) in current directory...'\n );\n importEmailTemplatesFromFiles();\n }\n // import first template from file\n else if (options.file) {\n printMessage(\n `Importing first email template from file \"${options.file}\"...`\n );\n importFirstEmailTemplateFromFile(options.file);\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 }\n // end program logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,aAAvB,EAAsCC,KAAtC,QAAmD,uBAAnD;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EACJM,2BADI;EAEJC,4BAFI;EAGJC,6BAHI;EAIJC;AAJI,IAKFR,aALJ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AAzD;;EACA,IAAI,MAAMhC,SAAS,EAAnB,EAAuB;IACrB;IACA,IAAIsB,OAAO,CAACW,IAAR,IAAgBX,OAAO,CAACY,UAA5B,EAAwC;MACtCnC,YAAY,CAAE,6BAA4BuB,OAAO,CAACY,UAAW,MAAjD,CAAZ;MACAjC,2BAA2B,CAACqB,OAAO,CAACY,UAAT,EAAqBZ,OAAO,CAACW,IAA7B,CAA3B;IACD,CAHD,CAIA;IAJA,KAKK,IAAIX,OAAO,CAACa,GAAR,IAAeb,OAAO,CAACW,IAA3B,EAAiC;MACpClC,YAAY,CACT,qDAAoDuB,OAAO,CAACW,IAAK,MADxD,CAAZ;MAGA/B,4BAA4B,CAACoB,OAAO,CAACW,IAAT,CAA5B;IACD,CALI,CAML;IANK,KAOA,IAAIX,OAAO,CAACc,WAAR,IAAuB,CAACd,OAAO,CAACW,IAApC,EAA0C;MAC7ClC,YAAY,CACV,mGADU,CAAZ;MAGAI,6BAA6B;IAC9B,CALI,CAML;IANK,KAOA,IAAImB,OAAO,CAACW,IAAZ,EAAkB;MACrBlC,YAAY,CACT,6CAA4CuB,OAAO,CAACW,IAAK,MADhD,CAAZ;MAGA7B,gCAAgC,CAACkB,OAAO,CAACW,IAAT,CAAhC;IACD,CALI,CAML;IANK,KAOA;MACHlC,YAAY,CAAC,sDAAD,CAAZ;MACAM,OAAO,CAACgC,IAAR;IACD;EACF;AACF,CAvEL,CAwEI;AAxEJ;AA2EAhC,OAAO,CAACiC,KAAR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -18,7 +19,7 @@ async (host, realm, user, password, options) => {
|
|
|
18
19
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
19
20
|
|
|
20
21
|
if (await getTokens()) {
|
|
21
|
-
|
|
22
|
+
printMessage(`Listing email templates ...`);
|
|
22
23
|
listEmailTemplates(options.long);
|
|
23
24
|
}
|
|
24
25
|
} // end command logic inside action handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template-list.js","names":["Command","Option","Authenticate","EmailTemplate","state","common","getTokens","listEmailTemplates","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","
|
|
1
|
+
{"version":3,"file":"email-template-list.js","names":["Command","Option","Authenticate","EmailTemplate","state","common","printMessage","getTokens","listEmailTemplates","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","long","parse"],"sources":["cli/email/email-template-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, EmailTemplate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { listEmailTemplates } = EmailTemplate;\n\nconst program = new Command('frodo email template list');\n\nprogram\n .description('List email templates.')\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('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n printMessage(`Listing email templates ...`);\n listEmailTemplates(options.long);\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,aAAvB,EAAsCC,KAAtC,QAAmD,uBAAnD;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EAAEM;AAAF,IAAyBL,aAA/B;AAEA,MAAMM,OAAO,GAAG,IAAIT,OAAJ,CAAY,2BAAZ,CAAhB;AAEAS,OAAO,CACJC,WADH,CACe,uBADf,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,CAWI,IAAIjB,MAAJ,CAAW,YAAX,EAAyB,uBAAzB,EAAkDoB,OAAlD,CAA0D,KAA1D,EAAiE,OAAjE,CAXJ,EAaGC,MAbH,EAcI;AACA,OAAOC,IAAP,EAAaC,KAAb,EAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,OAApC,KAAgD;EAC9CvB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBC,SAAtB,CAAgCN,IAAhC;EACAnB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBE,QAAtB,CAA+BN,KAA/B;EACApB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBG,WAAtB,CAAkCN,IAAlC;EACArB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBI,WAAtB,CAAkCN,QAAlC;EACAtB,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACA9B,KAAK,CAACiB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;;EACA,IAAI,MAAM7B,SAAS,EAAnB,EAAuB;IACrBD,YAAY,CAAE,6BAAF,CAAZ;IACAE,kBAAkB,CAACmB,OAAO,CAACU,IAAT,CAAlB;EACD;AACF,CA1BL,CA2BI;AA3BJ;AA8BA5B,OAAO,CAAC6B,KAAR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -18,7 +19,7 @@ async (host, realm, user, password, options) => {
|
|
|
18
19
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
19
20
|
|
|
20
21
|
if (await getTokens()) {
|
|
21
|
-
|
|
22
|
+
printMessage('Creating secret...');
|
|
22
23
|
createSecret(options.secretId, options.value, options.description, options.encoding, options.useInPlaceholders);
|
|
23
24
|
}
|
|
24
25
|
} // end command logic inside action handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esv-secret-create.js","names":["Command","Option","Authenticate","Secrets","state","common","getTokens","createSecret","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","requiredOption","option","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","
|
|
1
|
+
{"version":3,"file":"esv-secret-create.js","names":["Command","Option","Authenticate","Secrets","state","common","printMessage","getTokens","createSecret","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","requiredOption","option","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","secretId","value","encoding","useInPlaceholders","parse"],"sources":["cli/esv/esv-secret-create.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { createSecret } = Secrets;\n\nconst program = new Command('frodo esv secret create');\n\nprogram\n .description('Create secrets.')\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 .requiredOption('-i, --secret-id <secret-id>', 'Secret id.')\n .requiredOption('--value <value>', 'Secret value.')\n .option('--description [description]', 'Secret description.')\n .addOption(\n new Option(\n '--encoding [encoding]',\n 'Secret encoding. Must be one of \"generic\", \"pem\", \"base64hmac\"'\n ).default('generic', 'generic')\n )\n .addOption(\n new Option(\n '--no-use-in-placeholders',\n 'Secret cannot be used in placeholders.'\n )\n )\n .addOption(\n new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n ).default(false, 'off')\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('Creating secret...');\n createSecret(\n options.secretId,\n options.value,\n options.description,\n options.encoding,\n options.useInPlaceholders\n );\n }\n }\n // end command logic inside action handler\n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Ad,CAAsBC,SAAtB,CAAgCN,IAAhC;EACArB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBE,QAAtB,CAA+BN,KAA/B;EACAtB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBG,WAAtB,CAAkCN,IAAlC;EACAvB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBI,WAAtB,CAAkCN,QAAlC;EACAxB,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACAhC,KAAK,CAACmB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;;EACA,IAAI,MAAM/B,SAAS,EAAnB,EAAuB;IACrBD,YAAY,CAAC,oBAAD,CAAZ;IACAE,YAAY,CACVqB,OAAO,CAACU,QADE,EAEVV,OAAO,CAACW,KAFE,EAGVX,OAAO,CAACnB,WAHE,EAIVmB,OAAO,CAACY,QAJE,EAKVZ,OAAO,CAACa,iBALE,CAAZ;EAOD;AACF,CAlDL,CAmDI;AAnDJ;AAsDAjC,OAAO,CAACkC,KAAR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -21,15 +22,15 @@ async (host, realm, user, password, options) => {
|
|
|
21
22
|
if (await getTokens()) {
|
|
22
23
|
// delete by id
|
|
23
24
|
if (options.secretId) {
|
|
24
|
-
|
|
25
|
+
printMessage('Deleting secret...');
|
|
25
26
|
deleteSecretCmd(options.secretId);
|
|
26
27
|
} // --all -a
|
|
27
28
|
else if (options.all) {
|
|
28
|
-
|
|
29
|
+
printMessage('Deleting all secrets...');
|
|
29
30
|
deleteSecretsCmd();
|
|
30
31
|
} // unrecognized combination of options or no options
|
|
31
32
|
else {
|
|
32
|
-
|
|
33
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
33
34
|
program.help();
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esv-secret-delete.js","names":["Command","Option","Authenticate","Secrets","state","common","getTokens","deleteSecretCmd","deleteSecretsCmd","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","secretId","
|
|
1
|
+
{"version":3,"file":"esv-secret-delete.js","names":["Command","Option","Authenticate","Secrets","state","common","printMessage","getTokens","deleteSecretCmd","deleteSecretsCmd","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","secretId","all","help","parse"],"sources":["cli/esv/esv-secret-delete.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console.js';\n\nconst { getTokens } = Authenticate;\nconst { deleteSecretCmd, deleteSecretsCmd } = Secrets;\n\nconst program = new Command('frodo esv secret delete');\n\nprogram\n .description('Delete secrets.')\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 '-i, --secret-id <secret-id>',\n 'Secret id. If specified, -a is ignored.'\n )\n )\n .addOption(\n new Option('-a, --all', 'Delete all secrets in a realm. Ignored with -i.')\n )\n .addOption(\n new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n ).default(false, 'off')\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 // delete by id\n if (options.secretId) {\n printMessage('Deleting secret...');\n deleteSecretCmd(options.secretId);\n }\n // --all -a\n else if (options.all) {\n printMessage('Deleting all secrets...');\n deleteSecretsCmd();\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 }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,OAAvB,EAAgCC,KAAhC,QAA6C,uBAA7C;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBL,YAAtB;AACA,MAAM;EAAEM,eAAF;EAAmBC;AAAnB,IAAwCN,OAA9C;AAEA,MAAMO,OAAO,GAAG,IAAIV,OAAJ,CAAY,yBAAZ,CAAhB;AAEAU,OAAO,CACJC,WADH,CACe,iBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeT,MAAM,CAACU,aAJtB,EAKGD,WALH,CAKeT,MAAM,CAACW,aALtB,EAMGF,WANH,CAMeT,MAAM,CAACY,YANtB,EAOGH,WAPH,CAOeT,MAAM,CAACa,gBAPtB,EAQGC,SARH,CAQad,MAAM,CAACe,gBARpB,EASGD,SATH,CASad,MAAM,CAACgB,cATpB,EAUGF,SAVH,CAWI,IAAIlB,MAAJ,CACE,6BADF,EAEE,yCAFF,CAXJ,EAgBG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|
2
2
|
import { Authenticate, Secrets, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import * as common from '../cmd_common.js';
|
|
4
|
+
import { printMessage } from '../../utils/Console.js';
|
|
4
5
|
const {
|
|
5
6
|
getTokens
|
|
6
7
|
} = Authenticate;
|
|
@@ -18,7 +19,7 @@ async (host, realm, user, password, options) => {
|
|
|
18
19
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
19
20
|
|
|
20
21
|
if (await getTokens()) {
|
|
21
|
-
|
|
22
|
+
printMessage(`Describing secret ${options.secretId}...`);
|
|
22
23
|
describeSecret(options.secretId);
|
|
23
24
|
}
|
|
24
25
|
} // end command logic inside action handler
|