@rockcarver/frodo-cli 0.18.0 → 0.18.2-0
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 +13 -1
- package/esm/cli/admin/admin-add-autoid-static-user-mapping.js +3 -2
- package/esm/cli/admin/admin-add-autoid-static-user-mapping.js.map +1 -1
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +5 -4
- package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-get-access-token.js +3 -2
- package/esm/cli/admin/admin-get-access-token.js.map +1 -1
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js +3 -2
- package/esm/cli/admin/admin-grant-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js +3 -2
- package/esm/cli/admin/admin-hide-generic-extension-attributes.js.map +1 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js +3 -2
- package/esm/cli/admin/admin-list-oauth2-clients-with-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js +3 -2
- package/esm/cli/admin/admin-list-oauth2-clients-with-custom-privileges.js.map +1 -1
- package/esm/cli/admin/admin-list-static-user-mappings.js +3 -2
- package/esm/cli/admin/admin-list-static-user-mappings.js.map +1 -1
- package/esm/cli/admin/admin-remove-static-user-mapping.js +3 -2
- package/esm/cli/admin/admin-remove-static-user-mapping.js.map +1 -1
- package/esm/cli/admin/admin-repair-org-model.js +3 -2
- package/esm/cli/admin/admin-repair-org-model.js.map +1 -1
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js +3 -2
- package/esm/cli/admin/admin-revoke-oauth2-client-admin-privileges.js.map +1 -1
- package/esm/cli/admin/admin-show-generic-extension-attributes.js +3 -2
- package/esm/cli/admin/admin-show-generic-extension-attributes.js.map +1 -1
- package/esm/cli/app/app-export.js +5 -4
- package/esm/cli/app/app-export.js.map +1 -1
- package/esm/cli/app/app-import.js +2 -1
- package/esm/cli/app/app-import.js.map +1 -1
- package/esm/cli/app/app-list.js +2 -1
- package/esm/cli/app/app-list.js.map +1 -1
- package/esm/cli/cmd_common.js +4 -4
- package/esm/cli/cmd_common.js.map +1 -1
- package/esm/cli/email/email-template-export.js +5 -4
- package/esm/cli/email/email-template-export.js.map +1 -1
- package/esm/cli/email/email-template-import.js +6 -5
- package/esm/cli/email/email-template-import.js.map +1 -1
- package/esm/cli/email/email-template-list.js +2 -1
- package/esm/cli/email/email-template-list.js.map +1 -1
- package/esm/cli/esv/esv-secret-create.js +2 -1
- package/esm/cli/esv/esv-secret-create.js.map +1 -1
- package/esm/cli/esv/esv-secret-delete.js +4 -3
- package/esm/cli/esv/esv-secret-delete.js.map +1 -1
- package/esm/cli/esv/esv-secret-describe.js +2 -1
- package/esm/cli/esv/esv-secret-describe.js.map +1 -1
- package/esm/cli/esv/esv-secret-list.js +2 -1
- package/esm/cli/esv/esv-secret-list.js.map +1 -1
- package/esm/cli/esv/esv-secret-set.js +2 -1
- package/esm/cli/esv/esv-secret-set.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-activate.js +3 -2
- package/esm/cli/esv/esv-secret-version-activate.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-create.js +2 -1
- package/esm/cli/esv/esv-secret-version-create.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-deactivate.js +3 -2
- package/esm/cli/esv/esv-secret-version-deactivate.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-delete.js +4 -3
- package/esm/cli/esv/esv-secret-version-delete.js.map +1 -1
- package/esm/cli/esv/esv-secret-version-list.js +2 -1
- package/esm/cli/esv/esv-secret-version-list.js.map +1 -1
- package/esm/cli/esv/esv-variable-create.js +2 -1
- package/esm/cli/esv/esv-variable-create.js.map +1 -1
- package/esm/cli/esv/esv-variable-delete.js +4 -3
- package/esm/cli/esv/esv-variable-delete.js.map +1 -1
- package/esm/cli/esv/esv-variable-describe.js +2 -1
- package/esm/cli/esv/esv-variable-describe.js.map +1 -1
- package/esm/cli/esv/esv-variable-list.js +2 -1
- package/esm/cli/esv/esv-variable-list.js.map +1 -1
- package/esm/cli/esv/esv-variable-set.js +4 -3
- package/esm/cli/esv/esv-variable-set.js.map +1 -1
- package/esm/cli/idm/idm-count.js +2 -1
- package/esm/cli/idm/idm-count.js.map +1 -1
- package/esm/cli/idm/idm-export.js +5 -4
- package/esm/cli/idm/idm-export.js.map +1 -1
- package/esm/cli/idm/idm-list.js +3 -2
- package/esm/cli/idm/idm-list.js.map +1 -1
- package/esm/cli/idp/idp-export.js +6 -5
- package/esm/cli/idp/idp-export.js.map +1 -1
- package/esm/cli/idp/idp-import.js +7 -6
- package/esm/cli/idp/idp-import.js.map +1 -1
- package/esm/cli/idp/idp-list.js +3 -2
- package/esm/cli/idp/idp-list.js.map +1 -1
- package/esm/cli/info/info.js +7 -6
- package/esm/cli/info/info.js.map +1 -1
- package/esm/cli/journey/journey-delete.e2e.test_.js.map +1 -1
- package/esm/cli/journey/journey-delete.js +5 -4
- package/esm/cli/journey/journey-delete.js.map +1 -1
- package/esm/cli/journey/journey-describe.js.map +1 -1
- package/esm/cli/journey/journey-disable.js +3 -3
- package/esm/cli/journey/journey-disable.js.map +1 -1
- package/esm/cli/journey/journey-enable.js +3 -3
- package/esm/cli/journey/journey-enable.js.map +1 -1
- package/esm/cli/journey/journey-export.js +15 -18
- package/esm/cli/journey/journey-export.js.map +1 -1
- package/esm/cli/journey/journey-import.js +16 -22
- package/esm/cli/journey/journey-import.js.map +1 -1
- package/esm/cli/journey/journey-list.e2e.test_.js.map +1 -1
- package/esm/cli/journey/journey-list.js +5 -6
- package/esm/cli/journey/journey-list.js.map +1 -1
- package/esm/cli/journey/journey-prune.js +4 -3
- package/esm/cli/journey/journey-prune.js.map +1 -1
- package/esm/cli/journey/journey.js.map +1 -1
- package/esm/cli/logging/logs-fetch.js +5 -5
- package/esm/cli/logging/logs-fetch.js.map +1 -1
- package/esm/cli/logging/logs-list.js +10 -9
- package/esm/cli/logging/logs-list.js.map +1 -1
- package/esm/cli/logging/logs-tail.js +5 -4
- package/esm/cli/logging/logs-tail.js.map +1 -1
- package/esm/cli/logging/logs.js.map +1 -1
- package/esm/cli/realm/realm-add-custom-domain.js +3 -2
- package/esm/cli/realm/realm-add-custom-domain.js.map +1 -1
- package/esm/cli/realm/realm-describe.js +3 -2
- package/esm/cli/realm/realm-describe.js.map +1 -1
- package/esm/cli/realm/realm-list.js +3 -2
- package/esm/cli/realm/realm-list.js.map +1 -1
- package/esm/cli/realm/realm-remove-custom-domain.js +3 -2
- package/esm/cli/realm/realm-remove-custom-domain.js.map +1 -1
- package/esm/cli/saml/saml-cot-export.js +6 -5
- package/esm/cli/saml/saml-cot-export.js.map +1 -1
- package/esm/cli/saml/saml-cot-import.js +7 -6
- package/esm/cli/saml/saml-cot-import.js.map +1 -1
- package/esm/cli/saml/saml-cot-list.js +3 -2
- package/esm/cli/saml/saml-cot-list.js.map +1 -1
- package/esm/cli/saml/saml-describe.js +3 -2
- package/esm/cli/saml/saml-describe.js.map +1 -1
- package/esm/cli/saml/saml-export.js +6 -5
- package/esm/cli/saml/saml-export.js.map +1 -1
- package/esm/cli/saml/saml-import.js +7 -6
- package/esm/cli/saml/saml-import.js.map +1 -1
- package/esm/cli/saml/saml-list.js +3 -2
- package/esm/cli/saml/saml-list.js.map +1 -1
- package/esm/cli/saml/saml-metadata-export.js +5 -4
- package/esm/cli/saml/saml-metadata-export.js.map +1 -1
- package/esm/cli/script/script-delete.js +1 -1
- package/esm/cli/script/script-delete.js.map +1 -1
- package/esm/cli/script/script-describe.js +1 -1
- package/esm/cli/script/script-describe.js.map +1 -1
- package/esm/cli/script/script-export.js +6 -5
- package/esm/cli/script/script-export.js.map +1 -1
- package/esm/cli/script/script-import.js +3 -2
- package/esm/cli/script/script-import.js.map +1 -1
- package/esm/cli/script/script-list.js +3 -2
- package/esm/cli/script/script-list.js.map +1 -1
- package/esm/cli/theme/theme-delete.e2e.test_.js.map +1 -1
- package/esm/cli/theme/theme-delete.js +6 -5
- package/esm/cli/theme/theme-delete.js.map +1 -1
- package/esm/cli/theme/theme-export.js +7 -6
- package/esm/cli/theme/theme-export.js.map +1 -1
- package/esm/cli/theme/theme-import.js +8 -7
- package/esm/cli/theme/theme-import.js.map +1 -1
- package/esm/cli/theme/theme-list.e2e.test_.js.map +1 -1
- package/esm/cli/theme/theme-list.js +3 -2
- package/esm/cli/theme/theme-list.js.map +1 -1
- package/esm/ops/JourneyOps.js +325 -2
- package/esm/ops/JourneyOps.js.map +1 -1
- package/esm/ops/NodeOps.js.map +1 -1
- package/esm/ops/Saml2Ops.js.map +1 -1
- package/esm/ops/ScriptOps.js.map +1 -1
- package/esm/utils/Config.js.map +1 -1
- package/esm/utils/Console.js +1 -0
- package/esm/utils/Console.js.map +1 -1
- package/esm/utils/Version.js +1 -1
- package/esm/utils/Version.js.map +1 -1
- package/package.json +9 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-delete.js","names":["Command","Option","Authenticate","Journey","state","common","getTokens","deleteJourney","deleteJourneys","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","journeyId","
|
|
1
|
+
{"version":3,"file":"journey-delete.js","names":["Command","Option","Authenticate","Journey","state","common","printMessage","getTokens","deleteJourney","deleteJourneys","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","journeyId","getRealm","all","help","parse"],"sources":["cli/journey/journey-delete.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { deleteJourney, deleteJourneys } = Journey;\n\nconst program = new Command('frodo journey delete');\n\nprogram\n .description('Delete journeys/trees.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a is ignored.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Delete all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '--no-deep',\n 'No deep delete. This leaves orphaned configuration artifacts behind.'\n )\n )\n .addOption(\n new Option(\n '--verbose',\n 'Verbose output during command execution. If specified, may or may not produce additional output.'\n ).default(false, 'off')\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n // delete by id\n if (options.journeyId) {\n printMessage(\n `Deleting journey ${\n options.journeyId\n } in realm \"${state.default.session.getRealm()}\"...`\n );\n deleteJourney(options.journeyId, options);\n }\n // --all -a\n else if (options.all) {\n printMessage('Deleting all journeys...');\n deleteJourneys(options);\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,OAAvB,EAAgCC,KAAhC,QAA6C,uBAA7C;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SAASC,YAAT,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,OAAd,CAAsBK,iBAAtB,CAAwCN,OAAO,CAACO,IAAhD;EACA/B,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBO,0BAAtB,CAAiDR,OAAO,CAACS,QAAzD;;EACA,IAAI,MAAM9B,SAAS,EAAnB,EAAuB;IACrB;IACA,IAAIqB,OAAO,CAACU,SAAZ,EAAuB;MACrBhC,YAAY,CACT,oBACCsB,OAAO,CAACU,SACT,cAAalC,KAAK,CAACkB,OAAN,CAAcO,OAAd,CAAsBU,QAAtB,EAAiC,MAHrC,CAAZ;MAKA/B,aAAa,CAACoB,OAAO,CAACU,SAAT,EAAoBV,OAApB,CAAb;IACD,CAPD,CAQA;IARA,KASK,IAAIA,OAAO,CAACY,GAAZ,EAAiB;MACpBlC,YAAY,CAAC,0BAAD,CAAZ;MACAG,cAAc,CAACmB,OAAD,CAAd;IACD,CAHI,CAIL;IAJK,KAKA;MACHtB,YAAY,CAAC,sDAAD,CAAZ;MACAI,OAAO,CAAC+B,IAAR;IACD;EACF;AACF,CAhEL,CAiEI;AAjEJ;AAoEA/B,OAAO,CAACgC,KAAR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-describe.js","names":["fs","Command","Option","Authenticate","ExportImportUtils","Journey","state","describeJourney","describeJourneyMd","common","printMessage","getTokens","getJourneys","exportJourney","createFileParamTreeExportResolver","saveTextToFile","program","description","helpOption","showHelpAfterError","addArgument","hostArgument","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","outputFile","setOutputFile","file","process","exitCode","overrideVersion","setAmVersion","fileData","JSON","parse","readFileSync","journeyData","journeyId","trees","Object","values","tree","_id","Error","markdown","error","message","getRealm","journeys","journey","treeData"],"sources":["cli/journey/journey-describe.ts"],"sourcesContent":["import fs from 'fs';\nimport { Command, Option } from 'commander';\nimport {\n Authenticate,\n ExportImportUtils,\n Journey,\n state,\n} from '@rockcarver/frodo-lib';\nimport { describeJourney, describeJourneyMd } from '../../ops/JourneyOps';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { getJourneys, exportJourney, createFileParamTreeExportResolver } =\n Journey;\nconst { saveTextToFile } = ExportImportUtils;\n\nconst program = new Command('frodo journey describe');\n\nprogram\n .description(\n 'If -h is supplied, describe the journey/tree indicated by -i, or all journeys/trees in the realm if no -i is supplied, otherwise describe the journey/tree export file indicated by -f.'\n )\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgument)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the journey export file to describe. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-F, --output-file <file>',\n 'Name of the file to write the output to.'\n )\n )\n .addOption(new Option('--markdown', 'Output in markdown.'))\n .addOption(\n new Option(\n '-o, --override-version <version>',\n \"Override version. Notation: '<major>.<minor>.<patch>' e.g. '7.2.0'. Override detected version with any version. This is helpful in order to check if journeys in one environment would be compatible running in another environment (e.g. in preparation of migrating from on-prem to ForgeRock Identity Cloud.\"\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n if (options.outputFile)\n state.default.session.setOutputFile(options.outputFile);\n // TODO: review checks for arguments\n if (typeof host === 'undefined' || typeof options.file !== 'undefined') {\n if (\n typeof host === 'undefined' &&\n typeof options.file === 'undefined'\n ) {\n printMessage('Need either [host] or -f.', 'error');\n process.exitCode = 1;\n return;\n }\n printMessage(`Describing local journey file ${options.file}...`);\n try {\n // override version\n if (typeof options.overrideVersion !== 'undefined') {\n state.default.session.setAmVersion(options.overrideVersion);\n }\n const fileData = JSON.parse(fs.readFileSync(options.file, 'utf8'));\n let journeyData;\n // single or multi tree export?\n // multi - by id\n if (\n typeof options.journeyId !== 'undefined' &&\n fileData.trees &&\n fileData.trees[options.journeyId]\n ) {\n journeyData = fileData.trees[options.journeyId];\n }\n // multi - first\n else if (typeof options.journeyId === 'undefined' && fileData.trees) {\n [journeyData] = Object.values(fileData.trees);\n }\n // single - by id\n else if (\n typeof options.journeyId !== 'undefined' &&\n options.journeyId === fileData.tree?._id\n ) {\n journeyData = fileData;\n }\n // single\n else if (\n typeof options.journeyId === 'undefined' &&\n fileData.tree?._id\n ) {\n journeyData = fileData;\n }\n // no journey/tree found\n else {\n throw new Error(\n typeof options.journeyId === 'undefined'\n ? `No journey found in ${options.file}`\n : `Journey '${options.journeyId}' not found in ${options.file}`\n );\n }\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(\n journeyData,\n createFileParamTreeExportResolver(options.file)\n );\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(\n journeyData,\n createFileParamTreeExportResolver(options.file)\n );\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n } else if (await getTokens()) {\n printMessage(\n `Describing journey(s) in realm \"${state.default.session.getRealm()}\"...`\n );\n // override version\n if (typeof options.overrideVersion !== 'undefined') {\n state.default.session.setAmVersion(options.overrideVersion);\n }\n if (typeof options.journeyId === 'undefined') {\n let journeys: any[] = [];\n journeys = await getJourneys();\n for (const journey of journeys) {\n try {\n // eslint-disable-next-line no-await-in-loop, dot-notation\n const treeData = await exportJourney(journey['_id']);\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(treeData);\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(treeData);\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n }\n } else {\n try {\n const treeData = await exportJourney(options.journeyId);\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(treeData);\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(treeData);\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,OAAOA,EAAP,MAAe,IAAf;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SACEC,YADF,EAEEC,iBAFF,EAGEC,OAHF,EAIEC,KAJF,QAKO,uBALP;AAMA,SAASC,eAAT,EAA0BC,iBAA1B,QAAmD,sBAAnD;AACA,OAAO,KAAKC,MAAZ,MAAwB,kBAAxB;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBR,YAAtB;AACA,MAAM;EAAES,WAAF;EAAeC,aAAf;EAA8BC;AAA9B,IACJT,OADF;AAEA,MAAM;EAAEU;AAAF,IAAqBX,iBAA3B;AAEA,MAAMY,OAAO,GAAG,IAAIf,OAAJ,CAAY,wBAAZ,CAAhB;AAEAe,OAAO,CACJC,WADH,CAEI,yLAFJ,EAIGC,UAJH,CAIc,YAJd,EAI4B,MAJ5B,EAKGC,kBALH,GAMGC,WANH,CAMeX,MAAM,CAACY,YANtB,EAOGD,WAPH,CAOeX,MAAM,CAACa,aAPtB,EAQGF,WARH,CAQeX,MAAM,CAACc,YARtB,EASGH,WATH,CASeX,MAAM,CAACe,gBATtB,EAUGC,SAVH,CAUahB,MAAM,CAACiB,gBAVpB,EAWGD,SAX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,CAAvB;QACD;MACF,CAZD,CAYE,OAAOL,KAAP,EAAc;QACd5D,YAAY,CAAC4D,KAAK,CAACC,OAAP,EAAgB,OAAhB,CAAZ;QACAlB,OAAO,CAACC,QAAR,GAAmB,CAAnB;MACD;IACF;EACF;AACF,CA9KL,CA+KI;AA/KJ;AAkLAtC,OAAO,CAAC2C,KAAR"}
|
|
1
|
+
{"version":3,"file":"journey-describe.js","names":["fs","Command","Option","Authenticate","ExportImportUtils","Journey","state","describeJourney","describeJourneyMd","common","printMessage","getTokens","getJourneys","exportJourney","createFileParamTreeExportResolver","saveTextToFile","program","description","helpOption","showHelpAfterError","addArgument","hostArgument","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","outputFile","setOutputFile","file","process","exitCode","overrideVersion","setAmVersion","fileData","JSON","parse","readFileSync","journeyData","journeyId","trees","Object","values","tree","_id","Error","markdown","error","message","getRealm","journeys","journey","treeData"],"sources":["cli/journey/journey-describe.ts"],"sourcesContent":["import fs from 'fs';\nimport { Command, Option } from 'commander';\nimport {\n Authenticate,\n ExportImportUtils,\n Journey,\n state,\n} from '@rockcarver/frodo-lib';\nimport { describeJourney, describeJourneyMd } from '../../ops/JourneyOps';\nimport * as common from '../cmd_common.js';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { getJourneys, exportJourney, createFileParamTreeExportResolver } =\n Journey;\nconst { saveTextToFile } = ExportImportUtils;\n\nconst program = new Command('frodo journey describe');\n\nprogram\n .description(\n 'If -h is supplied, describe the journey/tree indicated by -i, or all journeys/trees in the realm if no -i is supplied, otherwise describe the journey/tree export file indicated by -f.'\n )\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgument)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the journey export file to describe. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-F, --output-file <file>',\n 'Name of the file to write the output to.'\n )\n )\n .addOption(new Option('--markdown', 'Output in markdown.'))\n .addOption(\n new Option(\n '-o, --override-version <version>',\n \"Override version. Notation: '<major>.<minor>.<patch>' e.g. '7.2.0'. Override detected version with any version. This is helpful in order to check if journeys in one environment would be compatible running in another environment (e.g. in preparation of migrating from on-prem to ForgeRock Identity Cloud.\"\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n if (options.outputFile)\n state.default.session.setOutputFile(options.outputFile);\n // TODO: review checks for arguments\n if (typeof host === 'undefined' || typeof options.file !== 'undefined') {\n if (\n typeof host === 'undefined' &&\n typeof options.file === 'undefined'\n ) {\n printMessage('Need either [host] or -f.', 'error');\n process.exitCode = 1;\n return;\n }\n printMessage(`Describing local journey file ${options.file}...`);\n try {\n // override version\n if (typeof options.overrideVersion !== 'undefined') {\n state.default.session.setAmVersion(options.overrideVersion);\n }\n const fileData = JSON.parse(fs.readFileSync(options.file, 'utf8'));\n let journeyData;\n // single or multi tree export?\n // multi - by id\n if (\n typeof options.journeyId !== 'undefined' &&\n fileData.trees &&\n fileData.trees[options.journeyId]\n ) {\n journeyData = fileData.trees[options.journeyId];\n }\n // multi - first\n else if (typeof options.journeyId === 'undefined' && fileData.trees) {\n [journeyData] = Object.values(fileData.trees);\n }\n // single - by id\n else if (\n typeof options.journeyId !== 'undefined' &&\n options.journeyId === fileData.tree?._id\n ) {\n journeyData = fileData;\n }\n // single\n else if (\n typeof options.journeyId === 'undefined' &&\n fileData.tree?._id\n ) {\n journeyData = fileData;\n }\n // no journey/tree found\n else {\n throw new Error(\n typeof options.journeyId === 'undefined'\n ? `No journey found in ${options.file}`\n : `Journey '${options.journeyId}' not found in ${options.file}`\n );\n }\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(\n journeyData,\n createFileParamTreeExportResolver(options.file)\n );\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(\n journeyData,\n createFileParamTreeExportResolver(options.file)\n );\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n } else if (await getTokens()) {\n printMessage(\n `Describing journey(s) in realm \"${state.default.session.getRealm()}\"...`\n );\n // override version\n if (typeof options.overrideVersion !== 'undefined') {\n state.default.session.setAmVersion(options.overrideVersion);\n }\n if (typeof options.journeyId === 'undefined') {\n let journeys = [];\n journeys = await getJourneys();\n for (const journey of journeys) {\n try {\n // eslint-disable-next-line no-await-in-loop, dot-notation\n const treeData = await exportJourney(journey['_id']);\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(treeData);\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(treeData);\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n }\n } else {\n try {\n const treeData = await exportJourney(options.journeyId);\n // ANSI text output\n if (!options.markdown) {\n await describeJourney(treeData);\n }\n // Markdown output\n else {\n // reset output file\n if (options.outputFile) saveTextToFile('', options.outputFile);\n await describeJourneyMd(treeData);\n }\n } catch (error) {\n printMessage(error.message, 'error');\n process.exitCode = 1;\n }\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,OAAOA,EAAP,MAAe,IAAf;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ACkC,QAAb,EAAuB;YACrB,MAAM9D,eAAe,CAACoE,QAAD,CAArB;UACD,CAFD,CAGA;UAHA,KAIK;YACH;YACA,IAAIxC,OAAO,CAACe,UAAZ,EAAwBnC,cAAc,CAAC,EAAD,EAAKoB,OAAO,CAACe,UAAb,CAAd;YACxB,MAAM1C,iBAAiB,CAACmE,QAAD,CAAvB;UACD;QACF,CAbD,CAaE,OAAOL,KAAP,EAAc;UACd5D,YAAY,CAAC4D,KAAK,CAACC,OAAP,EAAgB,OAAhB,CAAZ;UACAlB,OAAO,CAACC,QAAR,GAAmB,CAAnB;QACD;MACF;IACF,CAtBD,MAsBO;MACL,IAAI;QACF,MAAMqB,QAAQ,GAAG,MAAM9D,aAAa,CAACsB,OAAO,CAAC2B,SAAT,CAApC,CADE,CAEF;;QACA,IAAI,CAAC3B,OAAO,CAACkC,QAAb,EAAuB;UACrB,MAAM9D,eAAe,CAACoE,QAAD,CAArB;QACD,CAFD,CAGA;QAHA,KAIK;UACH;UACA,IAAIxC,OAAO,CAACe,UAAZ,EAAwBnC,cAAc,CAAC,EAAD,EAAKoB,OAAO,CAACe,UAAb,CAAd;UACxB,MAAM1C,iBAAiB,CAACmE,QAAD,CAAvB;QACD;MACF,CAZD,CAYE,OAAOL,KAAP,EAAc;QACd5D,YAAY,CAAC4D,KAAK,CAACC,OAAP,EAAgB,OAAhB,CAAZ;QACAlB,OAAO,CAACC,QAAR,GAAmB,CAAnB;MACD;IACF;EACF;AACF,CA9KL,CA+KI;AA/KJ;AAkLAtC,OAAO,CAAC2C,KAAR"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, Journey, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common
|
|
4
|
-
import { showSpinner, failSpinner, succeedSpinner } from '../../utils/Console';
|
|
3
|
+
import * as common from '../cmd_common';
|
|
4
|
+
import { showSpinner, failSpinner, succeedSpinner, printMessage } from '../../utils/Console';
|
|
5
5
|
const {
|
|
6
6
|
getTokens
|
|
7
7
|
} = Authenticate;
|
|
@@ -36,7 +36,7 @@ async (host, realm, user, password, options) => {
|
|
|
36
36
|
}
|
|
37
37
|
} // unrecognized combination of options or no options
|
|
38
38
|
else {
|
|
39
|
-
|
|
39
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
40
40
|
program.help();
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-disable.js","names":["Command","Option","Authenticate","Journey","state","common","showSpinner","failSpinner","succeedSpinner","getTokens","disableJourney","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","journeyId","
|
|
1
|
+
{"version":3,"file":"journey-disable.js","names":["Command","Option","Authenticate","Journey","state","common","showSpinner","failSpinner","succeedSpinner","printMessage","getTokens","disableJourney","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","journeyId","help","parse"],"sources":["cli/journey/journey-disable.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport {\n showSpinner,\n failSpinner,\n succeedSpinner,\n printMessage,\n} from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { disableJourney } = Journey;\n\nconst program = new Command('frodo journey disable');\n\nprogram\n .description('Disable journeys/trees.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option('-i, --journey-id <journey>', 'Name of a journey/tree.')\n )\n // .addOption(\n // new Option(\n // '-a, --all',\n // 'Disable all the journeys/trees in a realm. Ignored with -i.'\n // )\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n // enable\n if (options.journeyId) {\n showSpinner(`Disabling journey ${options.journeyId}...`);\n if (await disableJourney(options.journeyId)) {\n succeedSpinner(`Disabled journey ${options.journeyId}.`);\n } else {\n failSpinner(`Disabling journey ${options.journeyId} failed.`);\n }\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,OAAvB,EAAgCC,KAAhC,QAA6C,uBAA7C;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SACEC,WADF,EAEEC,WAFF,EAGEC,cAHF,EAIEC,YAJF,QAKO,qBALP;AAOA,MAAM;EAAEC;AAAF,IAAgBR,YAAtB;AACA,MAAM;EAAES;AAAF,IAAqBR,OAA3B;AAEA,MAAMS,OAAO,GAAG,IAAIZ,OAAJ,CAAY,uBAAZ,CAAhB;AAEAY,OAAO,CACJC,WADH,CACe,yBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeX,MAAM,CAACY,aAJtB,EAKGD,WALH,CAKeX,MAAM,CAACa,aALtB,EAMGF,WANH,CAMeX,MAAM,CAACc,YANtB,EAOGH,WAPH,CAOeX,MAAM,CAACe,gBAPtB,EAQGC,SARH,CAQahB,MAAM,CAACiB,g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R"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { Authenticate, Journey, state } from '@rockcarver/frodo-lib';
|
|
3
|
-
import * as common from '../cmd_common
|
|
4
|
-
import { showSpinner, failSpinner, succeedSpinner } from '../../utils/Console';
|
|
3
|
+
import * as common from '../cmd_common';
|
|
4
|
+
import { showSpinner, failSpinner, succeedSpinner, printMessage } from '../../utils/Console';
|
|
5
5
|
const {
|
|
6
6
|
getTokens
|
|
7
7
|
} = Authenticate;
|
|
@@ -36,7 +36,7 @@ async (host, realm, user, password, options) => {
|
|
|
36
36
|
}
|
|
37
37
|
} // unrecognized combination of options or no options
|
|
38
38
|
else {
|
|
39
|
-
|
|
39
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
40
40
|
program.help();
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-enable.js","names":["Command","Option","Authenticate","Journey","state","common","showSpinner","failSpinner","succeedSpinner","getTokens","enableJourney","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","journeyId","
|
|
1
|
+
{"version":3,"file":"journey-enable.js","names":["Command","Option","Authenticate","Journey","state","common","showSpinner","failSpinner","succeedSpinner","printMessage","getTokens","enableJourney","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","action","host","realm","user","password","options","default","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","journeyId","help","parse"],"sources":["cli/journey/journey-enable.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, Journey, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport {\n showSpinner,\n failSpinner,\n succeedSpinner,\n printMessage,\n} from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\nconst { enableJourney } = Journey;\n\nconst program = new Command('frodo journey enable');\n\nprogram\n .description('Enable journeys/trees.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option('-i, --journey-id <journey>', 'Name of a journey/tree.')\n )\n // .addOption(\n // new Option(\n // '-a, --all',\n // 'Enable all the journeys/trees in a realm. Ignored with -i.'\n // )\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n // enable\n if (options.journeyId) {\n showSpinner(`Enabling journey ${options.journeyId}...`);\n if (await enableJourney(options.journeyId)) {\n succeedSpinner(`Enabled journey ${options.journeyId}.`);\n } else {\n failSpinner(`Enabling journey ${options.journeyId} failed.`);\n }\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,OAAvB,EAAgCC,KAAhC,QAA6C,uBAA7C;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SACEC,WADF,EAEEC,WAFF,EAGEC,cAHF,EAIEC,YAJF,QAKO,qBALP;AAOA,MAAM;EAAEC;AAAF,IAAgBR,YAAtB;AACA,MAAM;EAAES;AAAF,IAAoBR,OAA1B;AAEA,MAAMS,OAAO,GAAG,IAAIZ,OAAJ,CAAY,sBAAZ,CAAhB;AAEAY,O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qB,OAAO,CAACW,SAAU,GAAtC,CAAd;MACD,CAFD,MAEO;QACLjC,WAAW,CAAE,oBAAmBsB,OAAO,CAACW,SAAU,UAAvC,CAAX;MACD;IACF,CAPD,CAQA;IARA,KASK;MACH/B,YAAY,CAAC,sDAAD,CAAZ;MACAG,OAAO,CAAC6B,IAAR;IACD;EACF;AACF,CA5CL,CA6CI;AA7CJ;AAgDA7B,OAAO,CAAC8B,KAAR"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate,
|
|
3
|
-
import * as common from '../cmd_common
|
|
2
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
+
import * as common from '../cmd_common';
|
|
4
|
+
import { exportJourneyToFile, exportJourneysToFile, exportJourneysToFiles } from '../../ops/JourneyOps';
|
|
5
|
+
import { printMessage } from '../../utils/Console';
|
|
4
6
|
const {
|
|
5
7
|
getTokens
|
|
6
8
|
} = Authenticate;
|
|
7
|
-
const {
|
|
8
|
-
exportJourneyToFile,
|
|
9
|
-
exportJourneysToFile,
|
|
10
|
-
exportJourneysToFiles
|
|
11
|
-
} = Journey;
|
|
12
9
|
const program = new Command('frodo journey export');
|
|
13
|
-
program.description('Export journeys/trees.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to write the exported journey(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the journeys/trees in a realm. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -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-deps', 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).')).addOption(new Option('--
|
|
10
|
+
program.description('Export journeys/trees.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to write the exported journey(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the journeys/trees in a realm. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -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-deps', 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).')).addOption(new Option('-D, --directory <directory>', 'Destination directory.')).addOption(new Option('-O, --organize <method>', 'Organize exports into folders using the indicated method. Valid values for method:\n' + 'id: folders named by id of exported object\n' + 'type: folders named by type (e.g. script, journey, idp)\n' + 'type/id: folders named by type with sub-folders named by id')).action( // implement command logic inside action handler
|
|
14
11
|
async (host, realm, user, password, options) => {
|
|
15
12
|
state.default.session.setTenant(host);
|
|
16
13
|
state.default.session.setRealm(realm);
|
|
@@ -18,35 +15,35 @@ async (host, realm, user, password, options) => {
|
|
|
18
15
|
state.default.session.setPassword(password);
|
|
19
16
|
state.default.session.setDeploymentType(options.type);
|
|
20
17
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
18
|
+
state.default.session.setVerbose(options.verbose);
|
|
19
|
+
state.default.session.setDebug(options.debug);
|
|
20
|
+
if (options.directory) state.default.session.setDirectory(options.directory);
|
|
21
21
|
|
|
22
22
|
if (await getTokens()) {
|
|
23
23
|
// export
|
|
24
24
|
if (options.journeyId) {
|
|
25
|
-
|
|
25
|
+
printMessage('Exporting journey...');
|
|
26
26
|
await exportJourneyToFile(options.journeyId, options.file, {
|
|
27
27
|
useStringArrays: options.useStringArrays,
|
|
28
|
-
deps: options.deps
|
|
29
|
-
verbose: options.verbose
|
|
28
|
+
deps: options.deps
|
|
30
29
|
});
|
|
31
30
|
} // --all -a
|
|
32
31
|
else if (options.all) {
|
|
33
|
-
|
|
32
|
+
printMessage('Exporting all journeys to a single file...');
|
|
34
33
|
await exportJourneysToFile(options.file, {
|
|
35
34
|
useStringArrays: options.useStringArrays,
|
|
36
|
-
deps: options.deps
|
|
37
|
-
verbose: options.verbose
|
|
35
|
+
deps: options.deps
|
|
38
36
|
});
|
|
39
37
|
} // --all-separate -A
|
|
40
38
|
else if (options.allSeparate) {
|
|
41
|
-
|
|
39
|
+
printMessage('Exporting all journeys to separate files...');
|
|
42
40
|
await exportJourneysToFiles({
|
|
43
41
|
useStringArrays: options.useStringArrays,
|
|
44
|
-
deps: options.deps
|
|
45
|
-
verbose: options.verbose
|
|
42
|
+
deps: options.deps
|
|
46
43
|
});
|
|
47
44
|
} // unrecognized combination of options or no options
|
|
48
45
|
else {
|
|
49
|
-
|
|
46
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
50
47
|
program.help();
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-export.js","names":["Command","Option","Authenticate","
|
|
1
|
+
{"version":3,"file":"journey-export.js","names":["Command","Option","Authenticate","state","common","exportJourneyToFile","exportJourneysToFile","exportJourneysToFiles","printMessage","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","directory","setDirectory","journeyId","file","useStringArrays","deps","all","allSeparate","help","parse"],"sources":["cli/journey/journey-export.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport {\n exportJourneyToFile,\n exportJourneysToFile,\n exportJourneysToFiles,\n} from '../../ops/JourneyOps';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo journey export');\n\nprogram\n .description('Export journeys/trees.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. 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 journey(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -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-deps',\n 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'\n )\n )\n .addOption(\n new Option('-D, --directory <directory>', 'Destination directory.')\n )\n .addOption(\n new Option(\n '-O, --organize <method>',\n 'Organize exports into folders using the indicated method. Valid values for method:\\n' +\n 'id: folders named by id of exported object\\n' +\n 'type: folders named by type (e.g. script, journey, idp)\\n' +\n 'type/id: folders named by type with sub-folders named by id'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n if (options.directory)\n state.default.session.setDirectory(options.directory);\n if (await getTokens()) {\n // export\n if (options.journeyId) {\n printMessage('Exporting journey...');\n await exportJourneyToFile(options.journeyId, options.file, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // --all -a\n else if (options.all) {\n printMessage('Exporting all journeys to a single file...');\n await exportJourneysToFile(options.file, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // --all-separate -A\n else if (options.allSeparate) {\n printMessage('Exporting all journeys to separate files...');\n await exportJourneysToFiles({\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SACEC,mBADF,EAEEC,oBAFF,EAGEC,qBAHF,QAIO,sBAJP;AAKA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBP,YAAtB;AAEA,MAAMQ,OAAO,GAAG,IAAIV,OAAJ,CAAY,sBAAZ,CAAhB;AAEAU,OAAO,CACJC,WADH,CACe,wBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeV,MAAM,CAACW,aAJtB,EAKGD,WALH,CAKeV,MAAM,CAACY,aALtB,EAMGF,WANH,CAMeV,MAAM,CAACa,YANtB,EAOGH,WAPH,CAOeV,MAAM,CAACc,gBAPtB,EAQGC,SARH,CAQaf,MAAM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AAC0C,IAAR;IACD;EACF;AACF,CAxGL,CAyGI;AAzGJ;AA4GA1C,OAAO,CAAC2C,KAAR"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate,
|
|
3
|
-
import * as common from '../cmd_common
|
|
2
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
+
import * as common from '../cmd_common';
|
|
4
|
+
import { importJourneyFromFile, importJourneysFromFile, importJourneysFromFiles, importFirstJourneyFromFile } from '../../ops/JourneyOps';
|
|
5
|
+
import { printMessage } from '../../utils/Console';
|
|
4
6
|
const {
|
|
5
7
|
getTokens
|
|
6
8
|
} = Authenticate;
|
|
7
|
-
const {
|
|
8
|
-
importJourneyFromFile,
|
|
9
|
-
importJourneysFromFile,
|
|
10
|
-
importJourneysFromFiles,
|
|
11
|
-
importFirstJourneyFromFile
|
|
12
|
-
} = Journey;
|
|
13
9
|
const program = new Command('frodo journey import');
|
|
14
|
-
program.description('Import journey/tree.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to import the journey(s) from. Ignored with -A.')).addOption(new Option('-a, --all', 'Import all the journeys/trees from single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Import all the journeys/trees from separate files (*.json) in the current directory. Ignored with -i or -a.')).addOption(new Option('--re-uuid', 'Generate new UUIDs for all nodes during import.').default(false, 'off')).addOption(new Option('--no-deps', 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).')).
|
|
10
|
+
program.description('Import journey/tree.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(common.verboseOption).addOption(common.debugOption).addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to import the journey(s) from. Ignored with -A.')).addOption(new Option('-a, --all', 'Import all the journeys/trees from single file. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Import all the journeys/trees from separate files (*.json) in the current directory. Ignored with -i or -a.')).addOption(new Option('--re-uuid', 'Generate new UUIDs for all nodes during import.').default(false, 'off')).addOption(new Option('--no-deps', 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).')).action( // implement command logic inside action handler
|
|
15
11
|
async (host, realm, user, password, options) => {
|
|
16
12
|
state.default.session.setTenant(host);
|
|
17
13
|
state.default.session.setRealm(realm);
|
|
@@ -19,43 +15,41 @@ async (host, realm, user, password, options) => {
|
|
|
19
15
|
state.default.session.setPassword(password);
|
|
20
16
|
state.default.session.setDeploymentType(options.type);
|
|
21
17
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
18
|
+
state.default.session.setVerbose(options.verbose);
|
|
19
|
+
state.default.session.setDebug(options.debug);
|
|
22
20
|
|
|
23
21
|
if (await getTokens()) {
|
|
24
22
|
// import
|
|
25
23
|
if (options.journeyId) {
|
|
26
|
-
|
|
24
|
+
printMessage(`Importing journey ${options.journeyId}...`);
|
|
27
25
|
importJourneyFromFile(options.journeyId, options.file, {
|
|
28
26
|
reUuid: options.reUuid,
|
|
29
|
-
deps: options.deps
|
|
30
|
-
verbose: options.verbose
|
|
27
|
+
deps: options.deps
|
|
31
28
|
});
|
|
32
29
|
} // --all -a
|
|
33
30
|
else if (options.all && options.file) {
|
|
34
|
-
|
|
31
|
+
printMessage(`Importing all journeys from a single file (${options.file})...`);
|
|
35
32
|
importJourneysFromFile(options.file, {
|
|
36
33
|
reUuid: options.reUuid,
|
|
37
|
-
deps: options.deps
|
|
38
|
-
verbose: options.verbose
|
|
34
|
+
deps: options.deps
|
|
39
35
|
});
|
|
40
36
|
} // --all-separate -A
|
|
41
37
|
else if (options.allSeparate && !options.file) {
|
|
42
|
-
|
|
38
|
+
printMessage('Importing all journeys from separate files in current directory...');
|
|
43
39
|
importJourneysFromFiles({
|
|
44
40
|
reUuid: options.reUuid,
|
|
45
|
-
deps: options.deps
|
|
46
|
-
verbose: options.verbose
|
|
41
|
+
deps: options.deps
|
|
47
42
|
});
|
|
48
43
|
} // import first journey in file
|
|
49
44
|
else if (options.file) {
|
|
50
|
-
|
|
45
|
+
printMessage('Importing first journey in file...');
|
|
51
46
|
importFirstJourneyFromFile(options.file, {
|
|
52
47
|
reUuid: options.reUuid,
|
|
53
|
-
deps: options.deps
|
|
54
|
-
verbose: options.verbose
|
|
48
|
+
deps: options.deps
|
|
55
49
|
});
|
|
56
50
|
} // unrecognized combination of options or no options
|
|
57
51
|
else {
|
|
58
|
-
|
|
52
|
+
printMessage('Unrecognized combination of options or no options...');
|
|
59
53
|
program.help();
|
|
60
54
|
}
|
|
61
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-import.js","names":["Command","Option","Authenticate","
|
|
1
|
+
{"version":3,"file":"journey-import.js","names":["Command","Option","Authenticate","state","common","importJourneyFromFile","importJourneysFromFile","importJourneysFromFiles","importFirstJourneyFromFile","printMessage","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","verboseOption","debugOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","setVerbose","verbose","setDebug","debug","journeyId","file","reUuid","deps","all","allSeparate","help","parse"],"sources":["cli/journey/journey-import.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport {\n importJourneyFromFile,\n importJourneysFromFile,\n importJourneysFromFiles,\n importFirstJourneyFromFile,\n} from '../../ops/JourneyOps';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo journey import');\n\nprogram\n .description('Import journey/tree.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(common.verboseOption)\n .addOption(common.debugOption)\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to import the journey(s) from. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Import all the journeys/trees from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all the journeys/trees from separate files (*.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '--re-uuid',\n 'Generate new UUIDs for all nodes during import.'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n state.default.session.setVerbose(options.verbose);\n state.default.session.setDebug(options.debug);\n if (await getTokens()) {\n // import\n if (options.journeyId) {\n printMessage(`Importing journey ${options.journeyId}...`);\n importJourneyFromFile(options.journeyId, options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // --all -a\n else if (options.all && options.file) {\n printMessage(\n `Importing all journeys from a single file (${options.file})...`\n );\n importJourneysFromFile(options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file) {\n printMessage(\n 'Importing all journeys from separate files in current directory...'\n );\n importJourneysFromFiles({\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // import first journey in file\n else if (options.file) {\n printMessage('Importing first journey in file...');\n importFirstJourneyFromFile(options.file, {\n reUuid: options.reUuid,\n deps: options.deps,\n });\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n }\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SACEC,qBADF,EAEEC,sBAFF,EAGEC,uBAHF,EAIEC,0BAJF,QAKO,sBALP;AAMA,SAASC,YAAT,QAA6B,qBAA7B;AAEA,MAAM;EAAEC;AAAF,IAAgBR,YAAtB;AAEA,MAAMS,OAAO,GAAG,IAAIX,OAAJ,CAAY,sBAAZ,CAAhB;AAEAW,OAAO,CACJC,WADH,CACe,sBADf,EAEGC,UAFH,CAEc,YAFd,EAE4B,MAF5B,EAGGC,kBAHH,GAIGC,WAJH,CAIeX,MAAM,CAACY,aAJtB,EAKGD,WALH,CAKeX,MAAM,CAACa,aALtB,EAMGF,WANH,CAMeX,MAAM,CAACc,YANtB,EAOGH,WAPH,CAOeX,MAAM,CAACe,gBAPtB,EAQGC,SARH,CAQahB,MAAM,CAACiB,gBARpB,EASGD,SATH,CASahB,MAAM,CAACkB,cATpB,EAUGF,SAVH,CAUahB,MAAM,CAACmB,aAVpB,EAWGH,SAXH,CAWahB,MAAM,CAACoB,WAXpB,EAYGJ,SAZH,CAaI,IAAInB,MAAJ,CACE,4BADF,EAEE,8DAFF,CAbJ,EAkBGmB,SAlBH,CAmBI,IAAInB,MAAJ,CACE,mBADF,EAEE,kEAFF,C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,CAACc,SAAT,EAAoBd,OAAO,CAACe,IAA5B,EAAkC;QACrDC,MAAM,EAAEhB,OAAO,CAACgB,MADqC;QAErDC,IAAI,EAAEjB,OAAO,CAACiB;MAFuC,CAAlC,CAArB;IAID,CAND,CAOA;IAPA,KAQK,IAAIjB,OAAO,CAACkB,GAAR,IAAelB,OAAO,CAACe,IAA3B,EAAiC;MACpCrC,YAAY,CACT,8CAA6CsB,OAAO,CAACe,IAAK,MADjD,CAAZ;MAGAxC,sBAAsB,CAACyB,OAAO,CAACe,IAAT,EAAe;QACnCC,MAAM,EAAEhB,OAAO,CAACgB,MADmB;QAEnCC,IAAI,EAAEjB,OAAO,CAACiB;MAFqB,CAAf,CAAtB;IAID,CARI,CASL;IATK,KAUA,IAAIjB,OAAO,CAACmB,WAAR,IAAuB,CAACnB,OAAO,CAACe,IAApC,EAA0C;MAC7CrC,YAAY,CACV,oEADU,CAAZ;MAGAF,uBAAuB,CAAC;QACtBwC,MAAM,EAAEhB,OAAO,CAACgB,MADM;QAEtBC,IAAI,EAAEjB,OAAO,CAACiB;MAFQ,CAAD,CAAvB;IAID,CARI,CASL;IATK,KAUA,IAAIjB,OAAO,CAACe,IAAZ,EAAkB;MACrBrC,YAAY,CAAC,oCAAD,CAAZ;MACAD,0BAA0B,CAACuB,OAAO,CAACe,IAAT,EAAe;QACvCC,MAAM,EAAEhB,OAAO,CAACgB,MADuB;QAEvCC,IAAI,EAAEjB,OAAO,CAACiB;MAFyB,CAAf,CAA1B;IAID,CANI,CAOL;IAPK,KAQA;MACHvC,YAAY,CAAC,sDAAD,CAAZ;MACAE,OAAO,CAACwC,IAAR;IACD;EACF;AACF,CAtGL,CAuGI;AAvGJ;AA0GAxC,OAAO,CAACyC,KAAR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-list.e2e.test_.js","names":["spawn","spawnSync","ansiEscapeCodes","beforeAll","deleteJourneysCmd","status","console","error","stderr","toString","log","stdout","importBaselineJourneysCmd","cwd","importTestJourneysCmd","describe","it","done","journeyList","expected","join","chunks","on","chunk","push","output","Buffer","concat","expect","toBe","expectedLong","replace"],"sources":["cli/journey/journey-list.e2e.test_.ts"],"sourcesContent":["// import { jest } from '@jest/globals';\nimport { spawn, spawnSync } from 'child_process';\n\nconst ansiEscapeCodes =\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n\n/**\n * delete all journeys and import baseline and additional test journeys\n */\nbeforeAll(async () => {\n // delete all journeys\n const deleteJourneysCmd = spawnSync('frodo', [\n 'journey',\n 'delete',\n '--all',\n 'frodo-dev',\n ]);\n if (deleteJourneysCmd.status > 0) {\n console.error(deleteJourneysCmd.stderr.toString());\n console.log(deleteJourneysCmd.stdout.toString());\n }\n\n // import baseline journeys\n const importBaselineJourneysCmd = spawnSync(\n 'frodo',\n ['journey', 'import', '--all-separate', 'frodo-dev'],\n {\n cwd: `test/e2e/journey/baseline`,\n }\n );\n if (importBaselineJourneysCmd.status > 0) {\n console.error(importBaselineJourneysCmd.stderr.toString());\n console.log(importBaselineJourneysCmd.stdout.toString());\n }\n\n // import additional test journeys\n const importTestJourneysCmd = spawnSync(\n 'frodo',\n ['journey', 'import', '--all-separate', 'frodo-dev'],\n {\n cwd: `test/e2e/journey/list`,\n }\n );\n if (importTestJourneysCmd.status > 0) {\n console.error(importTestJourneysCmd.stderr.toString());\n console.log(importTestJourneysCmd.stdout.toString());\n }\n});\n\ndescribe('frodo journey list', () => {\n it('\"frodo journey list\": should list the names of the default journeys', (done) => {\n const journeyList = spawn('frodo', ['journey', 'list', 'frodo-dev']);\n const expected = [\n 'Disabled',\n 'ForgottenUsername',\n 'Login',\n 'PasswordGrant',\n 'ProgressiveProfile',\n 'Registration',\n 'ResetPassword',\n 'UpdatePassword',\n '',\n ].join('\\n');\n\n const chunks = [];\n journeyList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n journeyList.stdout.on('end', () => {\n const output = Buffer.concat(chunks).toString();\n try {\n expect(output).toBe(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n const expectedLong = [\n 'Listing journeys in realm \"alpha\"...',\n 'Name │Status │Tags ',\n 'Disabled │disabled│Prototype ',\n 'ForgottenUsername │enabled │Username Reset ',\n 'Login │enabled │Authentication ',\n 'PasswordGrant │enabled │ ',\n 'ProgressiveProfile│enabled │Progressive Profile',\n 'Registration │enabled │Registration ',\n 'ResetPassword │enabled │Password Reset ',\n 'UpdatePassword │enabled │Password Reset ',\n '',\n ].join('\\n');\n\n it('\"frodo journey list -l\": should list the names, status, and tags of the default journeys', (done) => {\n const journeyList = spawn('frodo', ['journey', 'list', '-l', 'frodo-dev']);\n\n const chunks = [];\n journeyList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n journeyList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expectedLong);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo journey list --long\": should list the names, status, and tags of the default journeys', (done) => {\n const journeyList = spawn('frodo', [\n 'journey',\n 'list',\n '--long',\n 'frodo-dev',\n ]);\n\n const chunks = [];\n journeyList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n journeyList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expectedLong);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n});\n"],"mappings":"AAAA;AACA,SAASA,KAAT,EAAgBC,SAAhB,QAAiC,eAAjC;AAEA,MAAMC,eAAe,GACnB;AACA,6EAFF;AAIA;AACA;AACA;;AACAC,SAAS,CAAC,YAAY;EACpB;EACA,MAAMC,iBAAiB,GAAGH,SAAS,CAAC,OAAD,EAAU,CAC3C,SAD2C,EAE3C,QAF2C,EAG3C,OAH2C,EAI3C,WAJ2C,CAAV,CAAnC;;EAMA,IAAIG,iBAAiB,CAACC,MAAlB,GAA2B,
|
|
1
|
+
{"version":3,"file":"journey-list.e2e.test_.js","names":["spawn","spawnSync","ansiEscapeCodes","beforeAll","deleteJourneysCmd","status","console","error","stderr","toString","log","stdout","importBaselineJourneysCmd","cwd","importTestJourneysCmd","describe","it","done","journeyList","expected","join","chunks","on","chunk","push","output","Buffer","concat","expect","toBe","expectedLong","replace"],"sources":["cli/journey/journey-list.e2e.test_.ts"],"sourcesContent":["/* eslint-disable no-console */\n// import { jest } from '@jest/globals';\nimport { spawn, spawnSync } from 'child_process';\n\nconst ansiEscapeCodes =\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n\n/**\n * delete all journeys and import baseline and additional test journeys\n */\nbeforeAll(async () => {\n // delete all journeys\n const deleteJourneysCmd = spawnSync('frodo', [\n 'journey',\n 'delete',\n '--all',\n 'frodo-dev',\n ]);\n if (deleteJourneysCmd.status && deleteJourneysCmd.status > 0) {\n console.error(deleteJourneysCmd.stderr.toString());\n console.log(deleteJourneysCmd.stdout.toString());\n }\n\n // import baseline journeys\n const importBaselineJourneysCmd = spawnSync(\n 'frodo',\n ['journey', 'import', '--all-separate', 'frodo-dev'],\n {\n cwd: `test/e2e/journey/baseline`,\n }\n );\n if (\n importBaselineJourneysCmd.status &&\n importBaselineJourneysCmd.status > 0\n ) {\n console.error(importBaselineJourneysCmd.stderr.toString());\n console.log(importBaselineJourneysCmd.stdout.toString());\n }\n\n // import additional test journeys\n const importTestJourneysCmd = spawnSync(\n 'frodo',\n ['journey', 'import', '--all-separate', 'frodo-dev'],\n {\n cwd: `test/e2e/journey/list`,\n }\n );\n if (importTestJourneysCmd.status && importTestJourneysCmd.status > 0) {\n console.error(importTestJourneysCmd.stderr.toString());\n console.log(importTestJourneysCmd.stdout.toString());\n }\n});\n\ndescribe('frodo journey list', () => {\n it('\"frodo journey list\": should list the names of the default journeys', (done) => {\n const journeyList = spawn('frodo', ['journey', 'list', 'frodo-dev']);\n const expected = [\n 'Disabled',\n 'ForgottenUsername',\n 'Login',\n 'PasswordGrant',\n 'ProgressiveProfile',\n 'Registration',\n 'ResetPassword',\n 'UpdatePassword',\n '',\n ].join('\\n');\n\n const chunks: Uint8Array[] = [];\n journeyList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n journeyList.stdout.on('end', () => {\n const output = Buffer.concat(chunks).toString();\n try {\n expect(output).toBe(expected);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n const expectedLong = [\n 'Listing journeys in realm \"alpha\"...',\n 'Name │Status │Tags ',\n 'Disabled │disabled│Prototype ',\n 'ForgottenUsername │enabled │Username Reset ',\n 'Login │enabled │Authentication ',\n 'PasswordGrant │enabled │ ',\n 'ProgressiveProfile│enabled │Progressive Profile',\n 'Registration │enabled │Registration ',\n 'ResetPassword │enabled │Password Reset ',\n 'UpdatePassword │enabled │Password Reset ',\n '',\n ].join('\\n');\n\n it('\"frodo journey list -l\": should list the names, status, and tags of the default journeys', (done) => {\n const journeyList = spawn('frodo', ['journey', 'list', '-l', 'frodo-dev']);\n\n const chunks: Uint8Array[] = [];\n journeyList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n journeyList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expectedLong);\n done();\n } catch (error) {\n done(error);\n }\n });\n });\n\n it('\"frodo journey list --long\": should list the names, status, and tags of the default journeys', (done) => {\n const journeyList = spawn('frodo', [\n 'journey',\n 'list',\n '--long',\n 'frodo-dev',\n ]);\n\n const chunks: Uint8Array[] = [];\n journeyList.stdout.on('data', (chunk) => {\n chunks.push(chunk);\n });\n\n journeyList.stdout.on('end', () => {\n const output = Buffer.concat(chunks)\n .toString()\n .replace(ansiEscapeCodes, '');\n try {\n expect(output).toBe(expectedLong);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AFb,CAAf;;MAGA,IAAI;QACF0B,MAAM,CAACH,MAAD,CAAN,CAAeI,IAAf,CAAoBC,YAApB;QACAb,IAAI;MACL,CAHD,CAGE,OAAOV,KAAP,EAAc;QACdU,IAAI,CAACV,KAAD,CAAJ;MACD;IACF,CAVD;EAWD,CAxBC,CAAF;AAyBD,CA3FO,CAAR"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
-
import { Authenticate,
|
|
3
|
-
import * as common from '../cmd_common
|
|
2
|
+
import { Authenticate, state } from '@rockcarver/frodo-lib';
|
|
3
|
+
import * as common from '../cmd_common';
|
|
4
|
+
import { listJourneys } from '../../ops/JourneyOps';
|
|
5
|
+
import { printMessage } from '../../utils/Console';
|
|
4
6
|
const {
|
|
5
7
|
getTokens
|
|
6
8
|
} = Authenticate;
|
|
7
|
-
const {
|
|
8
|
-
listJourneys
|
|
9
|
-
} = Journey;
|
|
10
9
|
const program = new Command('frodo journey list');
|
|
11
10
|
program.description('List journeys/trees.').helpOption('-h, --help', 'Help').showHelpAfterError().addArgument(common.hostArgumentM).addArgument(common.realmArgument).addArgument(common.userArgument).addArgument(common.passwordArgument).addOption(common.deploymentOption).addOption(common.insecureOption).addOption(new Option('-l, --long', 'Long with all fields.').default(false, 'false')).addOption(new Option('-a, --analyze', 'Analyze journeys for custom nodes.')).action( // implement command logic inside action handler
|
|
12
11
|
async (host, realm, user, password, options) => {
|
|
@@ -18,7 +17,7 @@ async (host, realm, user, password, options) => {
|
|
|
18
17
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
19
18
|
|
|
20
19
|
if (await getTokens()) {
|
|
21
|
-
|
|
20
|
+
printMessage(`Listing journeys in realm "${state.default.session.getRealm()}"...`);
|
|
22
21
|
listJourneys(options.long, options.analyze);
|
|
23
22
|
}
|
|
24
23
|
} // end command logic inside action handler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-list.js","names":["Command","Option","Authenticate","
|
|
1
|
+
{"version":3,"file":"journey-list.js","names":["Command","Option","Authenticate","state","common","listJourneys","printMessage","getTokens","program","description","helpOption","showHelpAfterError","addArgument","hostArgumentM","realmArgument","userArgument","passwordArgument","addOption","deploymentOption","insecureOption","default","action","host","realm","user","password","options","session","setTenant","setRealm","setUsername","setPassword","setDeploymentType","type","setAllowInsecureConnection","insecure","getRealm","long","analyze","parse"],"sources":["cli/journey/journey-list.ts"],"sourcesContent":["import { Command, Option } from 'commander';\nimport { Authenticate, state } from '@rockcarver/frodo-lib';\nimport * as common from '../cmd_common';\nimport { listJourneys } from '../../ops/JourneyOps';\nimport { printMessage } from '../../utils/Console';\n\nconst { getTokens } = Authenticate;\n\nconst program = new Command('frodo journey list');\n\nprogram\n .description('List journeys/trees.')\n .helpOption('-h, --help', 'Help')\n .showHelpAfterError()\n .addArgument(common.hostArgumentM)\n .addArgument(common.realmArgument)\n .addArgument(common.userArgument)\n .addArgument(common.passwordArgument)\n .addOption(common.deploymentOption)\n .addOption(common.insecureOption)\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .addOption(new Option('-a, --analyze', 'Analyze journeys for custom nodes.'))\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options) => {\n state.default.session.setTenant(host);\n state.default.session.setRealm(realm);\n state.default.session.setUsername(user);\n state.default.session.setPassword(password);\n state.default.session.setDeploymentType(options.type);\n state.default.session.setAllowInsecureConnection(options.insecure);\n if (await getTokens()) {\n printMessage(\n `Listing journeys in realm \"${state.default.session.getRealm()}\"...`\n );\n listJourneys(options.long, options.analyze);\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,MAAlB,QAAgC,WAAhC;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AACA,SAASC,YAAT,QAA6B,sBAA7B;AACA,SAASC,YAAT,QAA6B,qBAA7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AK,CAACiB,OAAN,CAAcO,OAAd,CAAsBS,QAAtB,EAAiC,MADrD,CAAZ;IAGA/B,YAAY,CAACqB,OAAO,CAACW,IAAT,EAAeX,OAAO,CAACY,OAAvB,CAAZ;EACD;AACF,CA7BL,CA8BI;AA9BJ;AAiCA9B,OAAO,CAAC+B,KAAR"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { Authenticate, Journey, state } from '@rockcarver/frodo-lib';
|
|
3
3
|
import yesno from 'yesno';
|
|
4
|
-
import * as common from '../cmd_common
|
|
4
|
+
import * as common from '../cmd_common';
|
|
5
|
+
import { printMessage } from '../../utils/Console';
|
|
5
6
|
const {
|
|
6
7
|
getTokens
|
|
7
8
|
} = Authenticate;
|
|
@@ -20,7 +21,7 @@ async (host, realm, user, password, options) => {
|
|
|
20
21
|
state.default.session.setAllowInsecureConnection(options.insecure);
|
|
21
22
|
|
|
22
23
|
if (await getTokens()) {
|
|
23
|
-
|
|
24
|
+
printMessage(`Pruning orphaned configuration artifacts in realm "${state.default.session.getRealm()}"...`);
|
|
24
25
|
const orphanedNodes = await findOrphanedNodes();
|
|
25
26
|
|
|
26
27
|
if (orphanedNodes.length > 0) {
|
|
@@ -32,7 +33,7 @@ async (host, realm, user, password, options) => {
|
|
|
32
33
|
await removeOrphanedNodes(orphanedNodes);
|
|
33
34
|
}
|
|
34
35
|
} else {
|
|
35
|
-
|
|
36
|
+
printMessage('No orphaned nodes found.');
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
} // end command logic inside action handler
|