@rockcarver/frodo-cli 2.0.0-37 → 2.0.0-39
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/cli/_template/something-else-export.js +1 -1
- package/esm/cli/_template/something-else-export.js.map +1 -1
- package/esm/cli/_template/something-export.js +1 -1
- package/esm/cli/_template/something-export.js.map +1 -1
- package/esm/cli/_template/something-other-export.js +1 -1
- package/esm/cli/_template/something-other-export.js.map +1 -1
- package/esm/cli/admin/admin-federation-export.js +4 -4
- package/esm/cli/admin/admin-federation-export.js.map +1 -1
- package/esm/cli/agent/agent-export.js +4 -4
- package/esm/cli/agent/agent-export.js.map +1 -1
- package/esm/cli/agent/agent-gateway-export.js +4 -4
- package/esm/cli/agent/agent-gateway-export.js.map +1 -1
- package/esm/cli/agent/agent-java-export.js +4 -4
- package/esm/cli/agent/agent-java-export.js.map +1 -1
- package/esm/cli/agent/agent-web-export.js +4 -4
- package/esm/cli/agent/agent-web-export.js.map +1 -1
- package/esm/cli/app/app-export.js +4 -4
- package/esm/cli/app/app-export.js.map +1 -1
- package/esm/cli/authn/authn-export.js +2 -2
- package/esm/cli/authn/authn-export.js.map +1 -1
- package/esm/cli/authz/authz-policy-export.js +6 -6
- package/esm/cli/authz/authz-policy-export.js.map +1 -1
- package/esm/cli/authz/authz-set-export.js +4 -4
- package/esm/cli/authz/authz-set-export.js.map +1 -1
- package/esm/cli/authz/authz-type-export.js +5 -5
- package/esm/cli/authz/authz-type-export.js.map +1 -1
- package/esm/cli/config/config-export.js +3 -3
- package/esm/cli/config/config-export.js.map +1 -1
- package/esm/cli/email/email-template-export.js +4 -4
- package/esm/cli/email/email-template-export.js.map +1 -1
- package/esm/cli/esv/esv-secret-export.js +4 -4
- package/esm/cli/esv/esv-secret-export.js.map +1 -1
- package/esm/cli/esv/esv-secret-list.js +2 -2
- package/esm/cli/esv/esv-secret-list.js.map +1 -1
- package/esm/cli/esv/esv-variable-export.js +4 -4
- package/esm/cli/esv/esv-variable-export.js.map +1 -1
- package/esm/cli/esv/esv-variable-list.js +2 -2
- package/esm/cli/esv/esv-variable-list.js.map +1 -1
- package/esm/cli/idp/idp-export.js +4 -4
- package/esm/cli/idp/idp-export.js.map +1 -1
- package/esm/cli/journey/journey-describe.js +3 -1
- package/esm/cli/journey/journey-describe.js.map +1 -1
- package/esm/cli/journey/journey-export.js +4 -4
- package/esm/cli/journey/journey-export.js.map +1 -1
- package/esm/cli/oauth/oauth-client-export.js +4 -4
- package/esm/cli/oauth/oauth-client-export.js.map +1 -1
- package/esm/cli/saml/saml-cot-export.js +4 -4
- package/esm/cli/saml/saml-cot-export.js.map +1 -1
- package/esm/cli/saml/saml-export.js +4 -4
- package/esm/cli/saml/saml-export.js.map +1 -1
- package/esm/cli/script/script-export.js +4 -4
- package/esm/cli/script/script-export.js.map +1 -1
- package/esm/cli/script/script-list.js +2 -2
- package/esm/cli/script/script-list.js.map +1 -1
- package/esm/cli/service/service-export.js +4 -4
- package/esm/cli/service/service-export.js.map +1 -1
- package/esm/cli/theme/theme-export.js +5 -5
- package/esm/cli/theme/theme-export.js.map +1 -1
- package/esm/ops/AdminFederationOps.js +11 -7
- package/esm/ops/AdminFederationOps.js.map +1 -1
- package/esm/ops/AgentOps.js +39 -25
- package/esm/ops/AgentOps.js.map +1 -1
- package/esm/ops/ApplicationOps.js +11 -8
- package/esm/ops/ApplicationOps.js.map +1 -1
- package/esm/ops/AuthenticationSettingsOps.js +4 -3
- package/esm/ops/AuthenticationSettingsOps.js.map +1 -1
- package/esm/ops/CirclesOfTrustOps.js +12 -7
- package/esm/ops/CirclesOfTrustOps.js.map +1 -1
- package/esm/ops/ConfigOps.js +9 -7
- package/esm/ops/ConfigOps.js.map +1 -1
- package/esm/ops/EmailTemplateOps.js +11 -7
- package/esm/ops/EmailTemplateOps.js.map +1 -1
- package/esm/ops/IdmOps.js +3 -2
- package/esm/ops/IdmOps.js.map +1 -1
- package/esm/ops/IdpOps.js +14 -7
- package/esm/ops/IdpOps.js.map +1 -1
- package/esm/ops/JourneyOps.js +15 -6
- package/esm/ops/JourneyOps.js.map +1 -1
- package/esm/ops/OAuth2ClientOps.js +10 -7
- package/esm/ops/OAuth2ClientOps.js.map +1 -1
- package/esm/ops/PolicyOps.js +18 -11
- package/esm/ops/PolicyOps.js.map +1 -1
- package/esm/ops/PolicySetOps.js +12 -7
- package/esm/ops/PolicySetOps.js.map +1 -1
- package/esm/ops/ResourceTypeOps.js +15 -9
- package/esm/ops/ResourceTypeOps.js.map +1 -1
- package/esm/ops/Saml2Ops.js +10 -7
- package/esm/ops/Saml2Ops.js.map +1 -1
- package/esm/ops/ScriptOps.js +73 -36
- package/esm/ops/ScriptOps.js.map +1 -1
- package/esm/ops/SecretsOps.js +76 -48
- package/esm/ops/SecretsOps.js.map +1 -1
- package/esm/ops/ServiceOps.js +10 -9
- package/esm/ops/ServiceOps.js.map +1 -1
- package/esm/ops/ThemeOps.js +15 -9
- package/esm/ops/ThemeOps.js.map +1 -1
- package/esm/ops/VariablesOps.js +49 -23
- package/esm/ops/VariablesOps.js.map +1 -1
- package/esm/utils/Config.js +147 -1
- package/esm/utils/Config.js.map +1 -1
- package/package.json +2 -2
- package/esm/utils/ExportImportUtils.js +0 -48
- package/esm/utils/ExportImportUtils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-policy-export.js","names":["frodo","Option","exportPoliciesByPolicySetToFile","exportPoliciesByPolicySetToFiles","exportPoliciesToFile","exportPoliciesToFiles","exportPolicyToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","policyId","outcome","file","deps","prereqs","useStringArrays","process","exitCode","setId","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-policy-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportPoliciesByPolicySetToFile,\n exportPoliciesByPolicySetToFiles,\n exportPoliciesToFile,\n exportPoliciesToFiles,\n exportPolicyToFile,\n} from '../../ops/PolicyOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz policy export');\n\nprogram\n .description('Export authorization policies.')\n .addOption(\n new Option(\n '-i, --policy-id <policy-id>',\n 'Policy id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '--set-id <set-id>',\n 'Export policies in policy set only. Ignored with -i.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export policies to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export policies to separate files (*.policy.authz.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(new Option('--no-deps', 'Do not include dependencies (scripts).'))\n .addOption(\n new Option(\n '--prereqs',\n 'Include prerequisites (policy sets, resource types).'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export\n if (options.policyId && (await getTokens())) {\n verboseMessage('Exporting authorization policy to file...');\n const outcome = await exportPolicyToFile(\n options.policyId,\n options.file,\n {\n deps: options.deps,\n prereqs: options.prereqs,\n useStringArrays: true,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all by policy set\n else if (options.setId && options.all && (await getTokens())) {\n verboseMessage(\n `Exporting all authorization policies in policy set ${options.setId} to file...`\n );\n const outcome = await exportPoliciesByPolicySetToFile(\n options.setId,\n options.file,\n {\n deps: options.deps,\n prereqs: options.prereqs,\n useStringArrays: true,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all authorization policies to file...');\n const outcome = await exportPoliciesToFile(options.file
|
|
1
|
+
{"version":3,"file":"authz-policy-export.js","names":["frodo","Option","exportPoliciesByPolicySetToFile","exportPoliciesByPolicySetToFiles","exportPoliciesToFile","exportPoliciesToFiles","exportPolicyToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","policyId","outcome","file","metadata","deps","prereqs","useStringArrays","process","exitCode","setId","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-policy-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportPoliciesByPolicySetToFile,\n exportPoliciesByPolicySetToFiles,\n exportPoliciesToFile,\n exportPoliciesToFiles,\n exportPolicyToFile,\n} from '../../ops/PolicyOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz policy export');\n\nprogram\n .description('Export authorization policies.')\n .addOption(\n new Option(\n '-i, --policy-id <policy-id>',\n 'Policy id. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '--set-id <set-id>',\n 'Export policies in policy set only. Ignored with -i.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export policies to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export policies to separate files (*.policy.authz.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .addOption(new Option('--no-deps', 'Do not include dependencies (scripts).'))\n .addOption(\n new Option(\n '--prereqs',\n 'Include prerequisites (policy sets, resource types).'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export\n if (options.policyId && (await getTokens())) {\n verboseMessage('Exporting authorization policy to file...');\n const outcome = await exportPolicyToFile(\n options.policyId,\n options.file,\n options.metadata,\n {\n deps: options.deps,\n prereqs: options.prereqs,\n useStringArrays: true,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all by policy set\n else if (options.setId && options.all && (await getTokens())) {\n verboseMessage(\n `Exporting all authorization policies in policy set ${options.setId} to file...`\n );\n const outcome = await exportPoliciesByPolicySetToFile(\n options.setId,\n options.file,\n options.metadata,\n {\n deps: options.deps,\n prereqs: options.prereqs,\n useStringArrays: true,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all authorization policies to file...');\n const outcome = await exportPoliciesToFile(\n options.file,\n options.metadata,\n {\n deps: options.deps,\n prereqs: options.prereqs,\n useStringArrays: true,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate by policy set\n else if (options.setId && options.allSeparate && (await getTokens())) {\n verboseMessage(\n `Exporting all authorization policies in policy set ${options.setId} to separate files...`\n );\n const outcome = await exportPoliciesByPolicySetToFiles(\n options.setId,\n options.metadata,\n {\n deps: options.deps,\n prereqs: options.prereqs,\n useStringArrays: true,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n 'Exporting all authorization policies to separate files...'\n );\n const outcome = await exportPoliciesToFiles(options.metadata, {\n deps: options.deps,\n prereqs: options.prereqs,\n useStringArrays: true,\n });\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,+BAA+B,EAC/BC,gCAAgC,EAChCC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,qBA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AC;IACD,MAAMR,OAAO,GAAG,MAAMpB,gCAAgC,CACpDgB,OAAO,CAACY,KAAK,EACbZ,OAAO,CAACM,QAAQ,EAChB;MACEC,IAAI,EAAEP,OAAO,CAACO,IAAI;MAClBC,OAAO,EAAER,OAAO,CAACQ,OAAO;MACxBC,eAAe,EAAE;IACnB,CACF,CAAC;IACD,IAAI,CAACL,OAAO,EAAEM,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIX,OAAO,CAACc,WAAW,KAAK,MAAMxB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CACZ,2DACF,CAAC;IACD,MAAMgB,OAAO,GAAG,MAAMlB,qBAAqB,CAACc,OAAO,CAACM,QAAQ,EAAE;MAC5DC,IAAI,EAAEP,OAAO,CAACO,IAAI;MAClBC,OAAO,EAAER,OAAO,CAACQ,OAAO;MACxBC,eAAe,EAAE;IACnB,CAAC,CAAC;IACF,IAAI,CAACL,OAAO,EAAEM,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHvB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACuB,IAAI,CAAC,CAAC;IACdL,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHnB,OAAO,CAACwB,KAAK,CAAC,CAAC"}
|
|
@@ -7,14 +7,14 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo authz set export');
|
|
10
|
-
program.description('Export authorization policy sets.').addOption(new Option('-i, --set-id <set-id>', 'Policy set id/name. 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 applications/policy sets to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all applications/policy sets to separate files (*.authz.json) in the current directory. Ignored with -i or -a.')).addOption(new Option('--no-deps', 'Do not include any dependencies (policies, scripts).')).addOption(new Option('--prereqs', 'Include prerequisites (resource types).')).action(
|
|
10
|
+
program.description('Export authorization policy sets.').addOption(new Option('-i, --set-id <set-id>', 'Policy set id/name. 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 applications/policy sets to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all applications/policy sets to separate files (*.authz.json) in the current directory. Ignored with -i or -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).addOption(new Option('--no-deps', 'Do not include any dependencies (policies, scripts).')).addOption(new Option('--prereqs', 'Include prerequisites (resource types).')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
// export
|
|
15
15
|
if (options.setId && (await getTokens())) {
|
|
16
16
|
verboseMessage('Exporting authorization policy set to file...');
|
|
17
|
-
const outcome = await exportPolicySetToFile(options.setId, options.file, {
|
|
17
|
+
const outcome = await exportPolicySetToFile(options.setId, options.file, options.metadata, {
|
|
18
18
|
useStringArrays: true,
|
|
19
19
|
deps: options.deps,
|
|
20
20
|
prereqs: options.prereqs
|
|
@@ -24,7 +24,7 @@ async (host, realm, user, password, options, command) => {
|
|
|
24
24
|
// -a/--all
|
|
25
25
|
else if (options.all && (await getTokens())) {
|
|
26
26
|
verboseMessage('Exporting all authorization policy sets to file...');
|
|
27
|
-
const outcome = await exportPolicySetsToFile(options.file, {
|
|
27
|
+
const outcome = await exportPolicySetsToFile(options.file, options.metadata, {
|
|
28
28
|
useStringArrays: true,
|
|
29
29
|
deps: options.deps,
|
|
30
30
|
prereqs: options.prereqs
|
|
@@ -34,7 +34,7 @@ async (host, realm, user, password, options, command) => {
|
|
|
34
34
|
// -A/--all-separate
|
|
35
35
|
else if (options.allSeparate && (await getTokens())) {
|
|
36
36
|
verboseMessage('Exporting all authorization policy sets to separate files...');
|
|
37
|
-
const outcome = await exportPolicySetsToFiles({
|
|
37
|
+
const outcome = await exportPolicySetsToFiles(options.metadata, {
|
|
38
38
|
useStringArrays: true,
|
|
39
39
|
deps: options.deps,
|
|
40
40
|
prereqs: options.prereqs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-set-export.js","names":["frodo","Option","exportPolicySetsToFile","exportPolicySetsToFiles","exportPolicySetToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","setId","outcome","file","useStringArrays","deps","prereqs","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-set-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportPolicySetsToFile,\n exportPolicySetsToFiles,\n exportPolicySetToFile,\n} from '../../ops/PolicySetOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz set export');\n\nprogram\n .description('Export authorization policy sets.')\n .addOption(\n new Option(\n '-i, --set-id <set-id>',\n 'Policy set id/name. 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 applications/policy sets to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all applications/policy sets to separate files (*.authz.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (policies, scripts).'\n )\n )\n .addOption(new Option('--prereqs', 'Include prerequisites (resource types).'))\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export\n if (options.setId && (await getTokens())) {\n verboseMessage('Exporting authorization policy set to file...');\n const outcome = await exportPolicySetToFile(\n options.setId,\n options.file,\n {\n useStringArrays: true,\n deps: options.deps,\n prereqs: options.prereqs,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all authorization policy sets to file...');\n const outcome = await exportPolicySetsToFile(options.file
|
|
1
|
+
{"version":3,"file":"authz-set-export.js","names":["frodo","Option","exportPolicySetsToFile","exportPolicySetsToFiles","exportPolicySetToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","setId","outcome","file","metadata","useStringArrays","deps","prereqs","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-set-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportPolicySetsToFile,\n exportPolicySetsToFiles,\n exportPolicySetToFile,\n} from '../../ops/PolicySetOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz set export');\n\nprogram\n .description('Export authorization policy sets.')\n .addOption(\n new Option(\n '-i, --set-id <set-id>',\n 'Policy set id/name. 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 applications/policy sets to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all applications/policy sets to separate files (*.authz.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (policies, scripts).'\n )\n )\n .addOption(new Option('--prereqs', 'Include prerequisites (resource types).'))\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export\n if (options.setId && (await getTokens())) {\n verboseMessage('Exporting authorization policy set to file...');\n const outcome = await exportPolicySetToFile(\n options.setId,\n options.file,\n options.metadata,\n {\n useStringArrays: true,\n deps: options.deps,\n prereqs: options.prereqs,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all authorization policy sets to file...');\n const outcome = await exportPolicySetsToFile(\n options.file,\n options.metadata,\n {\n useStringArrays: true,\n deps: options.deps,\n prereqs: options.prereqs,\n }\n );\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n 'Exporting all authorization policy sets to separate files...'\n );\n const outcome = await exportPolicySetsToFiles(options.metadata, {\n useStringArrays: true,\n deps: options.deps,\n prereqs: options.prereqs,\n });\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,sBAAsB,EACtBC,uBAAuB,EACvBC,qBAAqB,QAChB,wBAAwB;AAC/B,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGP,KAAK,CAACQ,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,wBAAwB,CAAC;AAE1DG,OAAO,CACJC,WAAW,CAAC,mCAAmC,CAAC,CAChDC,SAAS,CACR,IAAIV,MAAM,CACR,uBAAuB,EACvB,0DACF,CACF,CAAC,CACAU,SAAS,CAAC,IAAIV,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEU,SAAS,CACR,IAAIV,MA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EAAET,OAAO,CAACS;IACnB,CACF,CAAC;IACD,IAAI,CAACL,OAAO,EAAEM,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIX,OAAO,CAACa,WAAW,KAAK,MAAMvB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CACZ,8DACF,CAAC;IACD,MAAMgB,OAAO,GAAG,MAAMlB,uBAAuB,CAACc,OAAO,CAACM,QAAQ,EAAE;MAC9DC,eAAe,EAAE,IAAI;MACrBC,IAAI,EAAER,OAAO,CAACQ,IAAI;MAClBC,OAAO,EAAET,OAAO,CAACS;IACnB,CAAC,CAAC;IACF,IAAI,CAACL,OAAO,EAAEM,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHvB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACsB,IAAI,CAAC,CAAC;IACdJ,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHnB,OAAO,CAACuB,KAAK,CAAC,CAAC"}
|
|
@@ -7,32 +7,32 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo authz type export');
|
|
10
|
-
program.description('Export authorization resource types.').addOption(new Option('-i, --type-id <type-uuid>', 'Resource type uuid. If specified, -a and -A are ignored.')).addOption(new Option('-n, --type-name <type-name>', 'Resource type name. 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 resource types to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all resource types to separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.')).action(
|
|
10
|
+
program.description('Export authorization resource types.').addOption(new Option('-i, --type-id <type-uuid>', 'Resource type uuid. If specified, -a and -A are ignored.')).addOption(new Option('-n, --type-name <type-name>', 'Resource type name. 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 resource types to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all resource types to separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
// export by uuid
|
|
15
15
|
if (options.typeId && (await getTokens())) {
|
|
16
16
|
verboseMessage('Exporting authorization resource type to file...');
|
|
17
|
-
const outcome = await exportResourceTypeToFile(options.typeId, options.file);
|
|
17
|
+
const outcome = await exportResourceTypeToFile(options.typeId, options.file, options.metadata);
|
|
18
18
|
if (!outcome) process.exitCode = 1;
|
|
19
19
|
}
|
|
20
20
|
// export by name
|
|
21
21
|
else if (options.typeName && (await getTokens())) {
|
|
22
22
|
verboseMessage('Exporting authorization resource type to file...');
|
|
23
|
-
const outcome = await exportResourceTypeByNameToFile(options.typeName, options.file);
|
|
23
|
+
const outcome = await exportResourceTypeByNameToFile(options.typeName, options.file, options.metadata);
|
|
24
24
|
if (!outcome) process.exitCode = 1;
|
|
25
25
|
}
|
|
26
26
|
// -a/--all
|
|
27
27
|
else if (options.all && (await getTokens())) {
|
|
28
28
|
verboseMessage('Exporting all authorization resource types to file...');
|
|
29
|
-
const outcome = await exportResourceTypesToFile(options.file);
|
|
29
|
+
const outcome = await exportResourceTypesToFile(options.file, options.metadata);
|
|
30
30
|
if (!outcome) process.exitCode = 1;
|
|
31
31
|
}
|
|
32
32
|
// -A/--all-separate
|
|
33
33
|
else if (options.allSeparate && (await getTokens())) {
|
|
34
34
|
verboseMessage('Exporting all authorization resource types to separate files...');
|
|
35
|
-
const outcome = await exportResourceTypesToFiles();
|
|
35
|
+
const outcome = await exportResourceTypesToFiles(options.metadata);
|
|
36
36
|
if (!outcome) process.exitCode = 1;
|
|
37
37
|
}
|
|
38
38
|
// unrecognized combination of options or no options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authz-type-export.js","names":["frodo","Option","exportResourceTypeByNameToFile","exportResourceTypesToFile","exportResourceTypesToFiles","exportResourceTypeToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","typeId","outcome","file","process","exitCode","typeName","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-type-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportResourceTypeByNameToFile,\n exportResourceTypesToFile,\n exportResourceTypesToFiles,\n exportResourceTypeToFile,\n} from '../../ops/ResourceTypeOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz type export');\n\nprogram\n .description('Export authorization resource types.')\n .addOption(\n new Option(\n '-i, --type-id <type-uuid>',\n 'Resource type uuid. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-n, --type-name <type-name>',\n 'Resource type name. 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 resource types to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all resource types to separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by uuid\n if (options.typeId && (await getTokens())) {\n verboseMessage('Exporting authorization resource type to file...');\n const outcome = await exportResourceTypeToFile(\n options.typeId,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // export by name\n else if (options.typeName && (await getTokens())) {\n verboseMessage('Exporting authorization resource type to file...');\n const outcome = await exportResourceTypeByNameToFile(\n options.typeName,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all authorization resource types to file...');\n const outcome = await exportResourceTypesToFile(options.file);\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n 'Exporting all authorization resource types to separate files...'\n );\n const outcome = await exportResourceTypesToFiles();\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,8BAA8B,EAC9BC,yBAAyB,EACzBC,0BAA0B,EAC1BC,wBAAwB,QACnB,2BAA2B;AAClC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,yBAAyB,CAAC;AAE3DG,OAAO,CACJC,WAAW,CAAC,sCAAsC,CAAC,CACnDC,SAAS,CACR,IAAIX,MAAM,CACR,2BAA2B,EAC3B,0DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,6BAA6B,EAC7B,0DACF,CACF,CAAC,CACAW,SAAS,CAAC,IAAIX,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,8DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,+HACF,CACF,CAAC,CACAY,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD;EACA,IAAID,OAAO,CAACG,MAAM,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IACzCF,cAAc,CAAC,kDAAkD,CAAC;IAClE,MAAMgB,OAAO,GAAG,MAAMjB,wBAAwB,CAC5Ca,OAAO,CAACG,MAAM,EACdH,OAAO,CAACK,
|
|
1
|
+
{"version":3,"file":"authz-type-export.js","names":["frodo","Option","exportResourceTypeByNameToFile","exportResourceTypesToFile","exportResourceTypesToFiles","exportResourceTypeToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","typeId","outcome","file","metadata","process","exitCode","typeName","all","allSeparate","help","parse"],"sources":["../../../src/cli/authz/authz-type-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportResourceTypeByNameToFile,\n exportResourceTypesToFile,\n exportResourceTypesToFiles,\n exportResourceTypeToFile,\n} from '../../ops/ResourceTypeOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo authz type export');\n\nprogram\n .description('Export authorization resource types.')\n .addOption(\n new Option(\n '-i, --type-id <type-uuid>',\n 'Resource type uuid. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-n, --type-name <type-name>',\n 'Resource type name. 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 resource types to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all resource types to separate files (*.resourcetype.authz.json) in the current directory. Ignored with -i, -n, or -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by uuid\n if (options.typeId && (await getTokens())) {\n verboseMessage('Exporting authorization resource type to file...');\n const outcome = await exportResourceTypeToFile(\n options.typeId,\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // export by name\n else if (options.typeName && (await getTokens())) {\n verboseMessage('Exporting authorization resource type to file...');\n const outcome = await exportResourceTypeByNameToFile(\n options.typeName,\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all authorization resource types to file...');\n const outcome = await exportResourceTypesToFile(\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage(\n 'Exporting all authorization resource types to separate files...'\n );\n const outcome = await exportResourceTypesToFiles(options.metadata);\n if (!outcome) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,8BAA8B,EAC9BC,yBAAyB,EACzBC,0BAA0B,EAC1BC,wBAAwB,QACnB,2BAA2B;AAClC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,yBAAyB,CAAC;AAE3DG,OAAO,CACJC,W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ACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIR,OAAO,CAACU,GAAG,KAAK,MAAMpB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,uDAAuD,CAAC;IACvE,MAAMgB,OAAO,GAAG,MAAMnB,yBAAyB,CAC7Ce,OAAO,CAACK,IAAI,EACZL,OAAO,CAACM,QACV,CAAC;IACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK,IAAIR,OAAO,CAACW,WAAW,KAAK,MAAMrB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CACZ,iEACF,CAAC;IACD,MAAMgB,OAAO,GAAG,MAAMlB,0BAA0B,CAACc,OAAO,CAACM,QAAQ,CAAC;IAClE,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC;EACA;EAAA,KACK;IACHpB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACoB,IAAI,CAAC,CAAC;IACdL,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHhB,OAAO,CAACqB,KAAK,CAAC,CAAC"}
|
|
@@ -7,14 +7,14 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo config export');
|
|
10
|
-
program.description('Export full cloud configuration for all ops that currently support export.').addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export everything to a single file.')).addOption(new Option('-A, --all-separate', 'Export everything to separate files in the -D directory. Ignored with -a.')).addOption(new Option('--use-string-arrays', 'Where applicable, use string arrays to store multi-line text (e.g. scripts).').default(false, 'off')).addOption(new Option('--no-decode', 'Do not include decoded variable value in variable export').default(false, 'false')).addOption(new Option('-x, --extract', 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.')).action(
|
|
10
|
+
program.description('Export full cloud configuration for all ops that currently support export.').addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export everything to a single file.')).addOption(new Option('-A, --all-separate', 'Export everything to separate files in the -D directory. Ignored with -a.')).addOption(new Option('--use-string-arrays', 'Where applicable, use string arrays to store multi-line text (e.g. scripts).').default(false, 'off')).addOption(new Option('--no-decode', 'Do not include decoded variable value in variable export').default(false, 'false')).addOption(new Option('-x, --extract', 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
// --all -a
|
|
15
15
|
if (options.all && (await getTokens())) {
|
|
16
16
|
verboseMessage('Exporting everything to a single file...');
|
|
17
|
-
await exportEverythingToFile(options.file, {
|
|
17
|
+
await exportEverythingToFile(options.file, options.metadata, {
|
|
18
18
|
useStringArrays: options.useStringArrays,
|
|
19
19
|
noDecode: options.decode
|
|
20
20
|
});
|
|
@@ -26,7 +26,7 @@ async (host, realm, user, password, options, command) => {
|
|
|
26
26
|
// --all-separate -A
|
|
27
27
|
} else if (options.allSeparate && (await getTokens())) {
|
|
28
28
|
verboseMessage('Exporting everything to separate files...');
|
|
29
|
-
await exportEverythingToFiles(options.extract, {
|
|
29
|
+
await exportEverythingToFiles(options.extract, options.metadata, {
|
|
30
30
|
useStringArrays: options.useStringArrays,
|
|
31
31
|
noDecode: options.decode
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-export.js","names":["frodo","state","Option","exportEverythingToFile","exportEverythingToFiles","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","all","file","useStringArrays","noDecode","decode","allSeparate","getDirectory","help","process","exitCode","extract","parse"],"sources":["../../../src/cli/config/config-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEverythingToFile,\n exportEverythingToFiles,\n} from '../../ops/ConfigOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config export');\n\nprogram\n .description(\n 'Export full cloud configuration for all ops that currently support export.'\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(new Option('-a, --all', 'Export everything to a single file.'))\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export everything to separate files in the -D directory. Ignored with -a.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-decode',\n 'Do not include decoded variable value in variable export'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-x, --extract',\n 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // --all -a\n if (options.all && (await getTokens())) {\n verboseMessage('Exporting everything to a single file...');\n await exportEverythingToFile(options.file, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n });\n // require --directory -D for all-separate function\n } else if (options.allSeparate && !state.getDirectory()) {\n printMessage(\n '-D or --directory required when using -A or --all-separate',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n // --all-separate -A\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting everything to separate files...');\n await exportEverythingToFiles(options.extract, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n });\n // unrecognized combination of options or no options\n } else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram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gB,OAAO,CAACI,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"config-export.js","names":["frodo","state","Option","exportEverythingToFile","exportEverythingToFiles","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","all","file","metadata","useStringArrays","noDecode","decode","allSeparate","getDirectory","help","process","exitCode","extract","parse"],"sources":["../../../src/cli/config/config-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEverythingToFile,\n exportEverythingToFiles,\n} from '../../ops/ConfigOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config export');\n\nprogram\n .description(\n 'Export full cloud configuration for all ops that currently support export.'\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(new Option('-a, --all', 'Export everything to a single file.'))\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export everything to separate files in the -D directory. Ignored with -a.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-decode',\n 'Do not include decoded variable value in variable export'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-x, --extract',\n 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // --all -a\n if (options.all && (await getTokens())) {\n verboseMessage('Exporting everything to a single file...');\n await exportEverythingToFile(options.file, options.metadata, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n });\n // require --directory -D for all-separate function\n } else if (options.allSeparate && !state.getDirectory()) {\n printMessage(\n '-D or --directory required when using -A or --all-separate',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n // --all-separate -A\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting everything to separate files...');\n await exportEverythingToFiles(options.extract, options.metadata, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n });\n // unrecognized combination of options or no options\n } else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,sBAAsB,EACtBC,uBAAuB,QAClB,qBAAqB;AAC5B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,qBAAqB,CAAC;AAEvDG,OAAO,CACJC,WAAW,CACV,4EACF,CAAC,CACAC,SAAS,CAAC,IAAIV,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEU,SAAS,CAAC,IAAIV,MAAM,CAAC,WAAW,EAAE,qCAAqC,CAAC,CAAC,CACzEU,SAAS,CACR,IAAIV,MAAM,CACR,oBAAoB,EACpB,2EACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,qBAAqB,EACrB,8EACF,CAAC,CAACW,OAAO,CAAC,KAAK,EAAE,KAAK,CACxB,CAAC,CACAD,SAAS,CACR,IAAIV,MAAM,CACR,aAAa,EACb,0DACF,CAAC,CAACW,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1B,CAAC,CACAD,SAAS,CACR,IAAIV,MAAM,CACR,eAAe,EACf,0FACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAA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CAACwB,KAAK,CAAC,CAAC"}
|
|
@@ -7,24 +7,24 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo email template export');
|
|
10
|
-
program.description('Export email templates.').addOption(new Option('-i, --template-id <template-id>', 'Email template id/name. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file [file]', 'Name of the export file. Ignored with -A. Defaults to <template-id>.template.email.json.')).addOption(new Option('-a, --all', 'Export all email templates to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all email templates as separate files <template-id>.template.email.json. Ignored with -i, and -a.')).action(
|
|
10
|
+
program.description('Export email templates.').addOption(new Option('-i, --template-id <template-id>', 'Email template id/name. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file [file]', 'Name of the export file. Ignored with -A. Defaults to <template-id>.template.email.json.')).addOption(new Option('-a, --all', 'Export all email templates to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all email templates as separate files <template-id>.template.email.json. Ignored with -i, and -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
// export by id/name
|
|
15
15
|
if (options.templateId && (await getTokens())) {
|
|
16
16
|
verboseMessage(`Exporting email template "${options.templateId}" from realm "${state.getRealm()}"...`);
|
|
17
|
-
await exportEmailTemplateToFile(options.templateId, options.file);
|
|
17
|
+
await exportEmailTemplateToFile(options.templateId, options.file, options.metadata);
|
|
18
18
|
}
|
|
19
19
|
// --all -a
|
|
20
20
|
else if (options.all && (await getTokens())) {
|
|
21
21
|
verboseMessage('Exporting all email templates to a single file...');
|
|
22
|
-
await exportEmailTemplatesToFile(options.file);
|
|
22
|
+
await exportEmailTemplatesToFile(options.file, options.metadata);
|
|
23
23
|
}
|
|
24
24
|
// --all-separate -A
|
|
25
25
|
else if (options.allSeparate && (await getTokens())) {
|
|
26
26
|
verboseMessage('Exporting all email templates to separate files...');
|
|
27
|
-
await exportEmailTemplatesToFiles();
|
|
27
|
+
await exportEmailTemplatesToFiles(options.metadata);
|
|
28
28
|
}
|
|
29
29
|
// unrecognized combination of options or no options
|
|
30
30
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-template-export.js","names":["frodo","state","Option","exportEmailTemplatesToFile","exportEmailTemplatesToFiles","exportEmailTemplateToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","templateId","getRealm","file","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/email/email-template-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEmailTemplatesToFile,\n exportEmailTemplatesToFiles,\n exportEmailTemplateToFile,\n} from '../../ops/EmailTemplateOps';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo email template export');\n\nprogram\n .description('Export email templates.')\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, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by id/name\n if (options.templateId && (await getTokens())) {\n verboseMessage(\n `Exporting email template \"${\n options.templateId\n }\" from realm \"${state.getRealm()}\"...`\n );\n await exportEmailTemplateToFile(options.templateId
|
|
1
|
+
{"version":3,"file":"email-template-export.js","names":["frodo","state","Option","exportEmailTemplatesToFile","exportEmailTemplatesToFiles","exportEmailTemplateToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","templateId","getRealm","file","metadata","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/email/email-template-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEmailTemplatesToFile,\n exportEmailTemplatesToFiles,\n exportEmailTemplateToFile,\n} from '../../ops/EmailTemplateOps';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo email template export');\n\nprogram\n .description('Export email templates.')\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 .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export by id/name\n if (options.templateId && (await getTokens())) {\n verboseMessage(\n `Exporting email template \"${\n options.templateId\n }\" from realm \"${state.getRealm()}\"...`\n );\n await exportEmailTemplateToFile(\n options.templateId,\n options.file,\n options.metadata\n );\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all email templates to a single file...');\n await exportEmailTemplatesToFile(options.file, options.metadata);\n }\n // --all-separate -A\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all email templates to separate files...');\n await exportEmailTemplatesToFiles(options.metadata);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,yBAAyB,QACpB,4BAA4B;AACnC,SAASC,YAAY,EAAEC,cAAc,QAAQ,wBAAwB;AACrE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,6BAA6B,CAAC;AAE/DG,OAAO,CACJC,WAAW,CAAC,yBAAyB,CAAC,CACtCC,SAAS,CACR,IAAIX,MAAM,CACR,iCAAiC,EACjC,8DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,0FACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,+DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,0GACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,+CACF,CACF,CAAC,CACAY,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD;EACA,IAAID,OAAO,CAACG,UAAU,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IAC7CF,cAAc,CACX,6BACCY,OAAO,CAACG,UACT,iBAAgBrB,KAAK,CAACsB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACD,MAAMlB,yBAAyB,CAC7Bc,OAAO,CAACG,UAAU,EAClBH,OAAO,CAACK,IAAI,EACZL,OAAO,CAACM,QACV,CAAC;EACH;EACA;EAAA,KACK,IAAIN,OAAO,CAACO,GAAG,KAAK,MAAMjB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,mDAAmD,CAAC;IACnE,MAAMJ,0BAA0B,CAACgB,OAAO,CAACK,IAAI,EAAEL,OAAO,CAACM,QAAQ,CAAC;EAClE;EACA;EAAA,KACK,IAAIN,OAAO,CAACQ,WAAW,KAAK,MAAMlB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CAAC,oDAAoD,CAAC;IACpE,MAAMH,2BAA2B,CAACe,OAAO,CAACM,QAAQ,CAAC;EACrD;EACA;EAAA,KACK;IACHnB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACiB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHnB,OAAO,CAACoB,KAAK,CAAC,CAAC"}
|
|
@@ -7,21 +7,21 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo esv secret export');
|
|
10
|
-
program.description('Export secrets.').addOption(new Option('-i, --secret-id <secret-id>', 'Secret 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 secrets to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all sub1s to separate files (*.secret.json) in the current directory. Ignored with -i or -a.')).action(
|
|
10
|
+
program.description('Export secrets.').addOption(new Option('-i, --secret-id <secret-id>', 'Secret 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 secrets to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all sub1s to separate files (*.secret.json) in the current directory. Ignored with -i or -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
if (options.secretId && (await getTokens())) {
|
|
15
15
|
verboseMessage(`Exporting secret "${options.secretId}" from realm "${state.getRealm()}"...`);
|
|
16
|
-
const outcome = await exportSecretToFile(options.secretId, options.file);
|
|
16
|
+
const outcome = await exportSecretToFile(options.secretId, options.file, options.metadata);
|
|
17
17
|
if (!outcome) process.exitCode = 1;
|
|
18
18
|
} else if (options.all && (await getTokens())) {
|
|
19
19
|
verboseMessage('Exporting all secrets to a single file...');
|
|
20
|
-
const outcome = await exportSecretsToFile(options.file);
|
|
20
|
+
const outcome = await exportSecretsToFile(options.file, options.metadata);
|
|
21
21
|
if (!outcome) process.exitCode = 1;
|
|
22
22
|
} else if (options.allSeparate && (await getTokens())) {
|
|
23
23
|
verboseMessage('Exporting all secrets to separate files...');
|
|
24
|
-
const outcome = await exportSecretsToFiles();
|
|
24
|
+
const outcome = await exportSecretsToFiles(options.metadata);
|
|
25
25
|
if (!outcome) process.exitCode = 1;
|
|
26
26
|
} else {
|
|
27
27
|
printMessage('Unrecognized combination of options or no options...', 'error');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esv-secret-export.js","names":["frodo","state","Option","exportSecretsToFile","exportSecretsToFiles","exportSecretToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","secretId","getRealm","outcome","file","process","exitCode","all","allSeparate","parse"],"sources":["../../../src/cli/esv/esv-secret-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportSecretsToFile,\n exportSecretsToFiles,\n exportSecretToFile,\n} from '../../ops/SecretsOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv secret export');\n\nprogram\n .description('Export secrets.')\n .addOption(\n new Option(\n '-i, --secret-id <secret-id>',\n 'Secret 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 secrets to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all sub1s to separate files (*.secret.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, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (options.secretId && (await getTokens())) {\n verboseMessage(\n `Exporting secret \"${\n options.secretId\n }\" from realm \"${state.getRealm()}\"...`\n );\n const outcome = await exportSecretToFile(\n options.secretId,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n } else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all secrets to a single file...');\n const outcome = await exportSecretsToFile(options.file);\n if (!outcome) process.exitCode = 1;\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all secrets to separate files...');\n const outcome = await exportSecretsToFiles();\n if (!outcome) process.exitCode = 1;\n } else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,mBAAmB,EACnBC,oBAAoB,EACpBC,kBAAkB,QACb,sBAAsB;AAC7B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,yBAAyB,CAAC;AAE3DG,OAAO,CACJC,WAAW,CAAC,iBAAiB,CAAC,CAC9BC,SAAS,CACR,IAAIX,MAAM,CACR,6BAA6B,EAC7B,iDACF,CACF,CAAC,CACAW,SAAS,CAAC,IAAIX,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,uDACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,qGACF,CACF,CAAC,CACAY,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAID,OAAO,CAACG,QAAQ,KAAK,MAAMb,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CACX,qBACCY,OAAO,CAACG,QACT,iBAAgBrB,KAAK,CAACsB,QAAQ,CAAC,CAAE,MACpC,CAAC;IACD,MAAMC,OAAO,GAAG,MAAMnB,kBAAkB,CACtCc,OAAO,CAACG,QAAQ,EAChBH,OAAO,CAACM,
|
|
1
|
+
{"version":3,"file":"esv-secret-export.js","names":["frodo","state","Option","exportSecretsToFile","exportSecretsToFiles","exportSecretToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","secretId","getRealm","outcome","file","metadata","process","exitCode","all","allSeparate","parse"],"sources":["../../../src/cli/esv/esv-secret-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportSecretsToFile,\n exportSecretsToFiles,\n exportSecretToFile,\n} from '../../ops/SecretsOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv secret export');\n\nprogram\n .description('Export secrets.')\n .addOption(\n new Option(\n '-i, --secret-id <secret-id>',\n 'Secret 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 secrets to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all sub1s to separate files (*.secret.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (options.secretId && (await getTokens())) {\n verboseMessage(\n `Exporting secret \"${\n options.secretId\n }\" from realm \"${state.getRealm()}\"...`\n );\n const outcome = await exportSecretToFile(\n options.secretId,\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n } else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all secrets to a single file...');\n const outcome = await exportSecretsToFile(\n options.file,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all secrets to separate files...');\n const outcome = await exportSecretsToFiles(options.metadata);\n if (!outcome) process.exitCode = 1;\n } else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"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,QACV,CAAC;IACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM,IAAIT,OAAO,CAACU,GAAG,KAAK,MAAMpB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC7CF,cAAc,CAAC,2CAA2C,CAAC;IAC3D,MAAMiB,OAAO,GAAG,MAAMrB,mBAAmB,CACvCgB,OAAO,CAACM,IAAI,EACZN,OAAO,CAACO,QACV,CAAC;IACD,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM,IAAIT,OAAO,CAACW,WAAW,KAAK,MAAMrB,SAAS,CAAC,CAAC,CAAC,EAAE;IACrDF,cAAc,CAAC,4CAA4C,CAAC;IAC5D,MAAMiB,OAAO,GAAG,MAAMpB,oBAAoB,CAACe,OAAO,CAACO,QAAQ,CAAC;IAC5D,IAAI,CAACF,OAAO,EAAEG,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLtB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDqB,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHjB,OAAO,CAACoB,KAAK,CAAC,CAAC"}
|
|
@@ -7,13 +7,13 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo esv secret list');
|
|
10
|
-
program.description('List secrets.').addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).action(
|
|
10
|
+
program.description('List secrets.').addOption(new Option('-l, --long', 'Long with all fields besides usage.').default(false, 'false')).addOption(new Option('-u, --usage', 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.').default(false, 'false')).addOption(new Option('-f, --file [file]', 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
if (await getTokens()) {
|
|
15
15
|
verboseMessage('Listing secrets...');
|
|
16
|
-
const outcome = await listSecrets(options.long);
|
|
16
|
+
const outcome = await listSecrets(options.long, options.usage, options.file);
|
|
17
17
|
if (!outcome) process.exitCode = 1;
|
|
18
18
|
} else {
|
|
19
19
|
process.exitCode = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esv-secret-list.js","names":["frodo","Option","listSecrets","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","process","exitCode","parse"],"sources":["../../../src/cli/esv/esv-secret-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listSecrets } from '../../ops/SecretsOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv secret list');\n\nprogram\n .description('List secrets.')\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing secrets...');\n const outcome = await listSecrets(options.long);\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,uBAAuB,CAAC;AAEzDG,OAAO,CACJC,WAAW,CAAC,eAAe,CAAC,CAC5BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"esv-secret-list.js","names":["frodo","Option","listSecrets","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","usage","file","process","exitCode","parse"],"sources":["../../../src/cli/esv/esv-secret-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listSecrets } from '../../ops/SecretsOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv secret list');\n\nprogram\n .description('List secrets.')\n .addOption(\n new Option('-l, --long', 'Long with all fields besides usage.').default(\n false,\n 'false'\n )\n )\n .addOption(\n new Option(\n '-u, --usage',\n 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing secrets...');\n const outcome = await listSecrets(\n options.long,\n options.usage,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ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|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo esv variable export');
|
|
10
|
-
program.description('Export variables.').addOption(new Option('-i, --variable-id <variable-id>', 'Variable 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 variables to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all variables to separate files (*.variable.json) in the current directory. Ignored with -i or -a.')).addOption(new Option('--no-decode', 'Do not include decoded variable value in export').default(false, 'false')).action(
|
|
10
|
+
program.description('Export variables.').addOption(new Option('-i, --variable-id <variable-id>', 'Variable 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 variables to a single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all variables to separate files (*.variable.json) in the current directory. Ignored with -i or -a.')).addOption(new Option('--no-decode', 'Do not include decoded variable value in export').default(false, 'false')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
if (options.variableId && (await getTokens())) {
|
|
15
15
|
verboseMessage(`Exporting variable "${options.variableId}" from realm "${state.getRealm()}"...`);
|
|
16
|
-
const outcome = await exportVariableToFile(options.variableId, options.file, options.decode);
|
|
16
|
+
const outcome = await exportVariableToFile(options.variableId, options.file, options.decode, options.metadata);
|
|
17
17
|
if (!outcome) process.exitCode = 1;
|
|
18
18
|
} else if (options.all && (await getTokens())) {
|
|
19
19
|
verboseMessage('Exporting all variables to a single file...');
|
|
20
|
-
const outcome = await exportVariablesToFile(options.file, options.decode);
|
|
20
|
+
const outcome = await exportVariablesToFile(options.file, options.decode, options.metadata);
|
|
21
21
|
if (!outcome) process.exitCode = 1;
|
|
22
22
|
} else if (options.allSeparate && (await getTokens())) {
|
|
23
23
|
verboseMessage('Exporting all variables to separate files...');
|
|
24
|
-
const outcome = await exportVariablesToFiles(options.decode);
|
|
24
|
+
const outcome = await exportVariablesToFiles(options.decode, options.metadata);
|
|
25
25
|
if (!outcome) process.exitCode = 1;
|
|
26
26
|
} else {
|
|
27
27
|
printMessage('Unrecognized combination of options or no options...', 'error');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esv-variable-export.js","names":["frodo","state","Option","exportVariablesToFile","exportVariablesToFiles","exportVariableToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","variableId","getRealm","outcome","file","decode","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/esv/esv-variable-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportVariablesToFile,\n exportVariablesToFiles,\n exportVariableToFile,\n} from '../../ops/VariablesOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv variable export');\n\nprogram\n .description('Export variables.')\n .addOption(\n new Option(\n '-i, --variable-id <variable-id>',\n 'Variable 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 variables to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all variables to separate files (*.variable.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--no-decode',\n 'Do not include decoded variable value in export'\n ).default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (options.variableId && (await getTokens())) {\n verboseMessage(\n `Exporting variable \"${\n options.variableId\n }\" from realm \"${state.getRealm()}\"...`\n );\n const outcome = await exportVariableToFile(\n options.variableId,\n options.file,\n options.decode\n );\n if (!outcome) process.exitCode = 1;\n } else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all variables to a single file...');\n const outcome = await exportVariablesToFile(\n options.file,\n options.decode\n );\n if (!outcome) process.exitCode = 1;\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all variables to separate files...');\n const outcome = await exportVariablesToFiles(options.decode);\n if (!outcome) process.exitCode = 1;\n } else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,qBAAqB,EACrBC,sBAAsB,EACtBC,oBAAoB,QACf,wBAAwB;AAC/B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,2BAA2B,CAAC;AAE7DG,OAAO,CACJC,WAAW,CAAC,mBAAmB,CAAC,CAChCC,SAAS,CACR,IAAIX,MAAM,CACR,iCAAiC,EACjC,mDACF,CACF,CAAC,CACAW,SAAS,CAAC,IAAIX,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,yDACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,2GACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,aAAa,EACb,iDACF,CAAC,CAACY,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1B,CAAC,
|
|
1
|
+
{"version":3,"file":"esv-variable-export.js","names":["frodo","state","Option","exportVariablesToFile","exportVariablesToFiles","exportVariableToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","variableId","getRealm","outcome","file","decode","metadata","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/esv/esv-variable-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportVariablesToFile,\n exportVariablesToFiles,\n exportVariableToFile,\n} from '../../ops/VariablesOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv variable export');\n\nprogram\n .description('Export variables.')\n .addOption(\n new Option(\n '-i, --variable-id <variable-id>',\n 'Variable 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 variables to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all variables to separate files (*.variable.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--no-decode',\n 'Do not include decoded variable value in export'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (options.variableId && (await getTokens())) {\n verboseMessage(\n `Exporting variable \"${\n options.variableId\n }\" from realm \"${state.getRealm()}\"...`\n );\n const outcome = await exportVariableToFile(\n options.variableId,\n options.file,\n options.decode,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n } else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all variables to a single file...');\n const outcome = await exportVariablesToFile(\n options.file,\n options.decode,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all variables to separate files...');\n const outcome = await exportVariablesToFiles(\n options.decode,\n options.metadata\n );\n if (!outcome) process.exitCode = 1;\n } else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,qBAAqB,EACrBC,sBAAsB,EACtBC,oBAAoB,QACf,wBAAwB;AAC/B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,2BAA2B,CAAC;AAE7DG,OAAO,CACJC,WAAW,CAAC,mBAAmB,CAAC,CAChCC,SAAS,CACR,IAAIX,MAAM,CACR,iCAAiC,EACjC,mDACF,CACF,CAAC,CACAW,SAAS,CAAC,IAAIX,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,yDACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,2GACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,aAAa,EACb,iDACF,CAAC,CAACY,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1B,CAAC,CACAD,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,+CACF,CACF,CAAC,CACAa,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAAC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HnB,OAAO,CAACuB,KAAK,CAAC,CAAC"}
|
|
@@ -7,13 +7,13 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo esv variable list');
|
|
10
|
-
program.description('List variables.').addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).action(
|
|
10
|
+
program.description('List variables.').addOption(new Option('-l, --long', 'Long with all fields besides usage.').default(false, 'false')).addOption(new Option('-u, --usage', 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.').default(false, 'false')).addOption(new Option('-f, --file [file]', 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
14
14
|
if (await getTokens()) {
|
|
15
15
|
verboseMessage('Listing variables...');
|
|
16
|
-
const outcome = await listVariables(options.long);
|
|
16
|
+
const outcome = await listVariables(options.long, options.usage, options.file);
|
|
17
17
|
if (!outcome) process.exitCode = 1;
|
|
18
18
|
} else {
|
|
19
19
|
process.exitCode = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esv-variable-list.js","names":["frodo","Option","listVariables","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","process","exitCode","parse"],"sources":["../../../src/cli/esv/esv-variable-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listVariables } from '../../ops/VariablesOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv variable list');\n\nprogram\n .description('List variables.')\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing variables...');\n const outcome = await listVariables(options.long);\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,yBAAyB,CAAC;AAE3DG,OAAO,CACJC,WAAW,CAAC,iBAAiB,CAAC,CAC9BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"esv-variable-list.js","names":["frodo","Option","listVariables","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","outcome","long","usage","file","process","exitCode","parse"],"sources":["../../../src/cli/esv/esv-variable-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport { listVariables } from '../../ops/VariablesOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo esv variable list');\n\nprogram\n .description('List variables.')\n .addOption(\n new Option('-l, --long', 'Long with all fields besides usage.').default(\n false,\n 'false'\n )\n )\n .addOption(\n new Option(\n '-u, --usage',\n 'Display usage field. If a file is provided with -f or --file, it will search for usage in the file. If a directory is provided with -D or --directory, it will search for usage in all .json files in the directory and sub-directories. If no file or directory is provided, it will perform a full export automatically to determine usage.'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-f, --file [file]',\n 'Optional export file to use to determine usage. Overrides -D, --directory. Only used if -u or --usage is provided as well.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage('Listing variables...');\n const outcome = await listVariables(\n options.long,\n options.usage,\n options.file\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGL,KAAK,CAACM,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,yBAAyB,CAAC;AAE3DG,OAAO,CACJC,WAAW,CAAC,iBAAiB,CAAC,CAC9BC,SAAS,CACR,IAAIR,MAAM,CAAC,YAAY,EAAE,qCAAqC,CAAC,CAACS,OAAO,CACrE,KAAK,EACL,OACF,CACF,CAAC,CACAD,SAAS,CACR,IAAIR,MAAM,CACR,aAAa,EACb,+UACF,CAAC,CAACS,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1B,CAAC,CACAD,SAAS,CACR,IAAIR,MAAM,CACR,mBAAmB,EACnB,4HACF,CACF,CAAC,CACAU,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMZ,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAC,sBAAsB,CAAC;IACtC,MAAMgB,OAAO,GAAG,MAAMjB,aAAa,CACjCc,OAAO,CAACI,IAAI,EACZJ,OAAO,CAACK,KAAK,EACbL,OAAO,CAACM,IACV,CAAC;IACD,IAAI,CAACH,OAAO,EAAEI,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;;AAEHjB,OAAO,CAACkB,KAAK,CAAC,CAAC"}
|
|
@@ -7,7 +7,7 @@ const {
|
|
|
7
7
|
getTokens
|
|
8
8
|
} = frodo.login;
|
|
9
9
|
const program = new FrodoCommand('frodo idp export');
|
|
10
|
-
program.description('Export (social) identity providers.').addOption(new Option('-i, --idp-id <idp-id>', 'Id/name of a provider. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file [file]', 'Name of the file to write the exported provider(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the providers in a realm to a single file. Ignored with -t and -i.')).addOption(new Option('-A, --all-separate', 'Export all the providers in a realm as separate files <provider name>.idp.json. Ignored with -t, -i, and -a.')).action(
|
|
10
|
+
program.description('Export (social) identity providers.').addOption(new Option('-i, --idp-id <idp-id>', 'Id/name of a provider. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file [file]', 'Name of the file to write the exported provider(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the providers in a realm to a single file. Ignored with -t and -i.')).addOption(new Option('-A, --all-separate', 'Export all the providers in a realm as separate files <provider name>.idp.json. Ignored with -t, -i, and -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).action(
|
|
11
11
|
// implement command logic inside action handler
|
|
12
12
|
async (host, realm, user, password, options, command) => {
|
|
13
13
|
command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
|
|
@@ -15,17 +15,17 @@ async (host, realm, user, password, options, command) => {
|
|
|
15
15
|
// export by id/name
|
|
16
16
|
if (options.idpId) {
|
|
17
17
|
verboseMessage(`Exporting provider "${options.idpId}" from realm "${state.getRealm()}"...`);
|
|
18
|
-
await exportSocialIdentityProviderToFile(options.idpId, options.file);
|
|
18
|
+
await exportSocialIdentityProviderToFile(options.idpId, options.file, options.metadata);
|
|
19
19
|
}
|
|
20
20
|
// --all -a
|
|
21
21
|
else if (options.all) {
|
|
22
22
|
verboseMessage('Exporting all providers to a single file...');
|
|
23
|
-
await exportSocialIdentityProvidersToFile(options.file);
|
|
23
|
+
await exportSocialIdentityProvidersToFile(options.file, options.metadata);
|
|
24
24
|
}
|
|
25
25
|
// --all-separate -A
|
|
26
26
|
else if (options.allSeparate) {
|
|
27
27
|
verboseMessage('Exporting all providers to separate files...');
|
|
28
|
-
await exportSocialIdentityProvidersToFiles();
|
|
28
|
+
await exportSocialIdentityProvidersToFiles(options.metadata);
|
|
29
29
|
}
|
|
30
30
|
// unrecognized combination of options or no options
|
|
31
31
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idp-export.js","names":["frodo","state","Option","exportSocialIdentityProvidersToFile","exportSocialIdentityProvidersToFiles","exportSocialIdentityProviderToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","idpId","getRealm","file","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportSocialIdentityProvidersToFile,\n exportSocialIdentityProvidersToFiles,\n exportSocialIdentityProviderToFile,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idp export');\n\nprogram\n .description('Export (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <idp-id>',\n 'Id/name of a provider. 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 provider(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the providers in a realm to a single file. Ignored with -t and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the providers in a realm as separate files <provider name>.idp.json. Ignored with -t, -i, and -a.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // export by id/name\n if (options.idpId) {\n verboseMessage(\n `Exporting provider \"${\n options.idpId\n }\" from realm \"${state.getRealm()}\"...`\n );\n await exportSocialIdentityProviderToFile(options.idpId
|
|
1
|
+
{"version":3,"file":"idp-export.js","names":["frodo","state","Option","exportSocialIdentityProvidersToFile","exportSocialIdentityProvidersToFiles","exportSocialIdentityProviderToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","idpId","getRealm","file","metadata","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/idp/idp-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportSocialIdentityProvidersToFile,\n exportSocialIdentityProvidersToFiles,\n exportSocialIdentityProviderToFile,\n} from '../../ops/IdpOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo idp export');\n\nprogram\n .description('Export (social) identity providers.')\n .addOption(\n new Option(\n '-i, --idp-id <idp-id>',\n 'Id/name of a provider. 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 provider(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the providers in a realm to a single file. Ignored with -t and -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the providers in a realm as separate files <provider name>.idp.json. Ignored with -t, -i, and -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // export by id/name\n if (options.idpId) {\n verboseMessage(\n `Exporting provider \"${\n options.idpId\n }\" from realm \"${state.getRealm()}\"...`\n );\n await exportSocialIdentityProviderToFile(\n options.idpId,\n options.file,\n options.metadata\n );\n }\n // --all -a\n else if (options.all) {\n verboseMessage('Exporting all providers to a single file...');\n await exportSocialIdentityProvidersToFile(\n options.file,\n options.metadata\n );\n }\n // --all-separate -A\n else if (options.allSeparate) {\n verboseMessage('Exporting all providers to separate files...');\n await exportSocialIdentityProvidersToFiles(options.metadata);\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,mCAAmC,EACnCC,oCAAoC,EACpCC,kCAAkC,QAC7B,kBAAkB;AACzB,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,kBAAkB,CAAC;AAEpDG,OAAO,CACJC,WAAW,CAAC,qCAAqC,CAAC,C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CAAC;MACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;IACtB;EACF;AACF;AACA;AACF,CAAC;;AAEHnB,OAAO,CAACoB,KAAK,CAAC,CAAC"}
|
|
@@ -3,8 +3,10 @@ import { Option } from 'commander';
|
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import { describeJourney, describeJourneyMd } from '../../ops/JourneyOps';
|
|
5
5
|
import { printMessage, verboseMessage } from '../../utils/Console';
|
|
6
|
-
import { saveTextToFile } from '../../utils/ExportImportUtils';
|
|
7
6
|
import { FrodoCommand } from '../FrodoCommand';
|
|
7
|
+
const {
|
|
8
|
+
saveTextToFile
|
|
9
|
+
} = frodo.utils;
|
|
8
10
|
const {
|
|
9
11
|
getTokens
|
|
10
12
|
} = frodo.login;
|