@rockcarver/frodo-cli 2.0.0-32 → 2.0.0-33
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 +5 -1
- package/esm/cli/FrodoCommand.js +8 -1
- package/esm/cli/FrodoCommand.js.map +1 -1
- package/esm/cli/admin/admin-export-full-cloud-config.js +44 -0
- package/esm/cli/admin/admin-export-full-cloud-config.js.map +1 -0
- package/esm/cli/admin/admin.js +1 -0
- package/esm/cli/admin/admin.js.map +1 -1
- package/esm/cli/authz/authz-policy-export.js +1 -1
- package/esm/cli/authz/authz-policy-export.js.map +1 -1
- package/esm/cli/authz/authz-policy-import.js +1 -1
- package/esm/cli/authz/authz-policy-import.js.map +1 -1
- package/esm/cli/authz/authz-policy-list.js +2 -2
- package/esm/cli/authz/authz-policy-list.js.map +1 -1
- package/esm/cli/authz/authz-set-delete.js +2 -2
- package/esm/cli/authz/authz-set-delete.js.map +1 -1
- package/esm/cli/authz/authz-set-export.js +1 -1
- package/esm/cli/authz/authz-set-export.js.map +1 -1
- package/esm/cli/authz/authz-set-import.js +1 -1
- package/esm/cli/authz/authz-set-import.js.map +1 -1
- package/esm/cli/authz/authz-set-list.js +1 -1
- package/esm/cli/authz/authz-set-list.js.map +1 -1
- package/esm/cli/authz/authz-type-delete.js +3 -3
- package/esm/cli/authz/authz-type-delete.js.map +1 -1
- package/esm/cli/authz/authz-type-export.js +2 -2
- package/esm/cli/authz/authz-type-export.js.map +1 -1
- package/esm/cli/authz/authz-type-import.js +2 -2
- package/esm/cli/authz/authz-type-import.js.map +1 -1
- package/esm/cli/authz/authz-type-list.js +1 -1
- package/esm/cli/authz/authz-type-list.js.map +1 -1
- package/esm/cli/email/email-template-export.js +3 -3
- package/esm/cli/email/email-template-export.js.map +1 -1
- package/esm/cli/email/email-template-import.js +4 -4
- package/esm/cli/email/email-template-import.js.map +1 -1
- package/esm/cli/email/email-template-list.js +1 -1
- package/esm/cli/email/email-template-list.js.map +1 -1
- package/esm/cli/idm/idm-count.js +1 -1
- package/esm/cli/idm/idm-count.js.map +1 -1
- package/esm/cli/idm/idm-export.js +3 -3
- package/esm/cli/idm/idm-export.js.map +1 -1
- package/esm/cli/idm/idm-list.js +2 -2
- package/esm/cli/idm/idm-list.js.map +1 -1
- package/esm/cli/idp/idp-export.js +3 -3
- package/esm/cli/idp/idp-export.js.map +1 -1
- package/esm/cli/idp/idp-import.js +4 -4
- package/esm/cli/idp/idp-import.js.map +1 -1
- package/esm/cli/idp/idp-list.js +1 -1
- package/esm/cli/idp/idp-list.js.map +1 -1
- package/esm/cli/journey/journey-delete.js +6 -2
- package/esm/cli/journey/journey-delete.js.map +1 -1
- package/esm/cli/journey/journey-disable.js +4 -10
- package/esm/cli/journey/journey-disable.js.map +1 -1
- package/esm/cli/journey/journey-enable.js +4 -10
- package/esm/cli/journey/journey-enable.js.map +1 -1
- package/esm/cli/journey/journey-import.js +4 -4
- package/esm/cli/journey/journey-import.js.map +1 -1
- package/esm/cli/journey/journey-list.js +1 -1
- package/esm/cli/journey/journey-list.js.map +1 -1
- package/esm/cli/saml/saml-cot-export.js +3 -3
- package/esm/cli/saml/saml-cot-export.js.map +1 -1
- package/esm/cli/saml/saml-cot-list.js +1 -1
- package/esm/cli/saml/saml-cot-list.js.map +1 -1
- package/esm/cli/saml/saml-describe.js +1 -1
- package/esm/cli/saml/saml-describe.js.map +1 -1
- package/esm/cli/saml/saml-import.js +4 -4
- package/esm/cli/saml/saml-import.js.map +1 -1
- package/esm/cli/saml/saml-list.js +1 -1
- package/esm/cli/saml/saml-list.js.map +1 -1
- package/esm/cli/saml/saml-metadata-export.js +1 -1
- package/esm/cli/saml/saml-metadata-export.js.map +1 -1
- package/esm/cli/script/script-export.js +2 -6
- package/esm/cli/script/script-export.js.map +1 -1
- package/esm/cli/theme/theme-delete.js +3 -3
- package/esm/cli/theme/theme-delete.js.map +1 -1
- package/esm/cli/theme/theme-export.js +4 -4
- package/esm/cli/theme/theme-export.js.map +1 -1
- package/esm/cli/theme/theme-import.js +4 -4
- package/esm/cli/theme/theme-import.js.map +1 -1
- package/esm/cli/theme/theme-list.js +1 -1
- package/esm/cli/theme/theme-list.js.map +1 -1
- package/esm/ops/AdminFederationOps.js +28 -26
- package/esm/ops/AdminFederationOps.js.map +1 -1
- package/esm/ops/AdminOps.js +112 -0
- package/esm/ops/AdminOps.js.map +1 -0
- package/esm/ops/AgentOps.js +59 -51
- package/esm/ops/AgentOps.js.map +1 -1
- package/esm/ops/ApplicationOps.js +19 -13
- package/esm/ops/ApplicationOps.js.map +1 -1
- package/esm/ops/CirclesOfTrustOps.js +28 -26
- package/esm/ops/CirclesOfTrustOps.js.map +1 -1
- package/esm/ops/EmailTemplateOps.js +78 -94
- package/esm/ops/EmailTemplateOps.js.map +1 -1
- package/esm/ops/IdmOps.js +8 -31
- package/esm/ops/IdmOps.js.map +1 -1
- package/esm/ops/IdpOps.js +49 -54
- package/esm/ops/IdpOps.js.map +1 -1
- package/esm/ops/JourneyOps.js +91 -70
- package/esm/ops/JourneyOps.js.map +1 -1
- package/esm/ops/OAuth2ClientOps.js +13 -11
- package/esm/ops/OAuth2ClientOps.js.map +1 -1
- package/esm/ops/PolicyOps.js +31 -26
- package/esm/ops/PolicyOps.js.map +1 -1
- package/esm/ops/PolicySetOps.js +42 -39
- package/esm/ops/PolicySetOps.js.map +1 -1
- package/esm/ops/ResourceTypeOps.js +19 -16
- package/esm/ops/ResourceTypeOps.js.map +1 -1
- package/esm/ops/Saml2Ops.js +49 -45
- package/esm/ops/Saml2Ops.js.map +1 -1
- package/esm/ops/ScriptOps.js +36 -55
- package/esm/ops/ScriptOps.js.map +1 -1
- package/esm/ops/SecretsOps.js +13 -11
- package/esm/ops/SecretsOps.js.map +1 -1
- package/esm/ops/ThemeOps.js +111 -130
- package/esm/ops/ThemeOps.js.map +1 -1
- package/esm/ops/VariablesOps.js +14 -12
- package/esm/ops/VariablesOps.js.map +1 -1
- package/esm/utils/Console.js +68 -30
- package/esm/utils/Console.js.map +1 -1
- package/esm/utils/ExportImportUtils.js +4 -12
- package/esm/utils/ExportImportUtils.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JourneyOps.js","names":["frodo","state","fs","createProgressBar","createTable","debugMessage","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","CirclesOfTrust","EmailTemplate","Idp","Node","Saml2","Script","Theme","cloneDeep","wordwrap","getTypedFilename","saveJsonToFile","getRealmString","getFilePath","getWorkingDirectory","utils","readJourneys","exportJourney","createMultiTreeExportTemplate","resolveDependencies","importJourneys","importJourney","getTreeDescendents","getNodeRef","onlineTreeExportResolver","getJourneyClassification","_getJourneyClassification","authn","journey","listJourneys","long","analyze","journeys","journeyStub","table","_journeyStub$uiConfig","push","_id","enabled","uiConfig","categories","JSON","parse","join","toString","exportPromises","useStringArrays","deps","journeyExports","Promise","all","journeyExport","_journeyExport$tree$u","tree","error","response","data","_error$response","exportJourneyToFile","journeyId","file","options","verbose","getVerbose","filePath","fileData","exportJourneysToFile","trees","length","exportData","meta","exportJourneysToFiles","fileName","importJourneyFromFile","readFile","err","journeyData","installedJourneys","map","x","unresolvedJourneys","resolvedJourneys","Object","keys","then","catch","importError","importFirstJourneyFromFile","treeId","hasOwnProperty","call","importJourneysFromFile","name","message","type","importJourneysFromFiles","names","readdirSync","jsonFiles","filter","toLowerCase","endsWith","allJourneysData","readFileSync","_error$response2","it","getJourneyClassificationMd","getOneLineDescription","treeObj","description","getOneLineDescriptionMd","describeTreeDescendents","descendents","depth","values","indent","Array","fill","descendent","describeTreeDescendentsMd","markdown","describeJourney","resolveTreeExport","_journeyData$meta","_journeyData$tree$uiC","_journeyData$themes","allNodes","nodes","innerNodes","nodeTypeMap","nodeData","_type","getAmVersion","originAmVersion","setAmVersion","stack","entries","nodeType","count","String","getNodeClassification","nodeObj","themes","themeData","scripts","scriptData","emailTemplates","templateData","socialIdentityProviders","socialIdpData","saml2Entities","entityProviderData","circlesOfTrust","cotData","describeJourneyMd","_journeyData$meta2","_journeyData$tree$uiC2","_journeyData$themes2","getNodeClassificationMd","getTableHeaderMd","getTableRowMd"],"sources":["../../src/ops/JourneyOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { type NodeSkeleton } from '@rockcarver/frodo-lib/types/api/NodeApi';\nimport { type TreeSkeleton } from '@rockcarver/frodo-lib/types/api/TreeApi';\nimport {\n type JourneyClassificationType,\n type MultiTreeExportInterface,\n type SingleTreeExportInterface,\n type TreeDependencyMapInterface,\n type TreeExportOptions,\n type TreeExportResolverInterface,\n type TreeImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/JourneyOps';\nimport fs from 'fs';\n\nimport {\n createProgressBar,\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport * as CirclesOfTrust from './CirclesOfTrustOps';\nimport * as EmailTemplate from './EmailTemplateOps';\nimport * as Idp from './IdpOps';\nimport * as Node from './NodeOps';\nimport * as Saml2 from './Saml2Ops';\nimport * as Script from './ScriptOps';\nimport * as Theme from './ThemeOps';\nimport { cloneDeep } from './utils/OpsUtils';\nimport wordwrap from './utils/Wordwrap';\n\nconst {\n getTypedFilename,\n saveJsonToFile,\n getRealmString,\n getFilePath,\n getWorkingDirectory,\n} = frodo.utils;\nconst {\n readJourneys,\n exportJourney,\n createMultiTreeExportTemplate,\n resolveDependencies,\n importJourneys,\n importJourney,\n getTreeDescendents,\n getNodeRef,\n onlineTreeExportResolver,\n getJourneyClassification: _getJourneyClassification,\n} = frodo.authn.journey;\n\n/**\n * List all the journeys/trees\n * @param {boolean} long Long version, all the fields\n * @param {boolean} analyze Analyze journeys/trees for custom nodes (expensive)\n * @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array journey objects\n */\nexport async function listJourneys(\n long = false,\n analyze = false\n): Promise<TreeSkeleton[]> {\n let journeys = [];\n try {\n journeys = await readJourneys();\n if (!long && !analyze) {\n for (const journeyStub of journeys) {\n printMessage(`${journeyStub['_id']}`, 'data');\n }\n } else {\n if (!analyze) {\n const table = createTable(['Name', 'Status', 'Tags']);\n for (const journeyStub of journeys) {\n table.push([\n `${journeyStub._id}`,\n journeyStub.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n journeyStub.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyStub.uiConfig.categories).join(', '),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n showSpinner('Retrieving details of all journeys...');\n const exportPromises = [];\n try {\n for (const journeyStub of journeys) {\n exportPromises.push(\n exportJourney(journeyStub['_id'], {\n useStringArrays: false,\n deps: false,\n })\n );\n }\n const journeyExports = await Promise.all(exportPromises);\n succeedSpinner('Retrieved details of all journeys.');\n const table = createTable([\n 'Name',\n 'Status',\n 'Classification',\n 'Tags',\n ]);\n for (const journeyExport of journeyExports) {\n table.push([\n `${journeyExport.tree._id}`,\n journeyExport.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n getJourneyClassification(journeyExport).join(', '),\n journeyExport.tree.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyExport.tree.uiConfig.categories).join(\n ', '\n ),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } catch (error) {\n failSpinner('Error retrieving details of all journeys.');\n printMessage(error.response.data, 'error');\n }\n }\n }\n } catch (error) {\n printMessage(error.response?.data, 'error');\n }\n return journeys;\n}\n\n/**\n * Export journey by id/name to file\n * @param {string} journeyId journey id/name\n * @param {string} file optional export file name\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneyToFile(\n journeyId: string,\n file: string,\n options: TreeExportOptions\n): Promise<void> {\n debugMessage(`exportJourneyToFile: start`);\n const verbose = state.getVerbose();\n if (!file) {\n file = getTypedFilename(journeyId, 'journey');\n }\n const filePath = getFilePath(file, true);\n if (!verbose) showSpinner(`${journeyId}`);\n try {\n const fileData: SingleTreeExportInterface = await exportJourney(\n journeyId,\n options\n );\n if (verbose) showSpinner(`${journeyId}`);\n saveJsonToFile(fileData, filePath);\n succeedSpinner(\n `Exported ${journeyId['brightCyan']} to ${filePath['brightCyan']}.`\n );\n } catch (error) {\n if (verbose) showSpinner(`${journeyId}`);\n failSpinner(`Error exporting journey ${journeyId}: ${error}`);\n }\n}\n\n/**\n * Export all journeys to file\n * @param {string} file optional export file name\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFile(\n file: string,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n }\n): Promise<void> {\n if (!file) {\n file = getTypedFilename(`all${getRealmString()}Journeys`, 'journey');\n }\n const filePath = getFilePath(file, true);\n const trees = await readJourneys();\n const fileData: MultiTreeExportInterface = createMultiTreeExportTemplate();\n createProgressBar(trees.length, 'Exporting journeys...');\n for (const tree of trees) {\n updateProgressBar(`${tree._id}`);\n try {\n const exportData = await exportJourney(tree._id, options);\n delete exportData.meta;\n fileData.trees[tree._id] = exportData;\n } catch (error) {\n printMessage(`Error exporting journey ${tree._id}: ${error}`, 'error');\n }\n }\n saveJsonToFile(fileData, filePath);\n stopProgressBar(`Exported to ${filePath}`);\n}\n\n/**\n * Export all journeys to separate files\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFiles(\n options: TreeExportOptions\n): Promise<void> {\n const trees = await readJourneys();\n createProgressBar(trees.length, 'Exporting journeys...');\n for (const tree of trees) {\n updateProgressBar(`${tree._id}`);\n const fileName = getTypedFilename(`${tree._id}`, 'journey');\n try {\n const exportData: SingleTreeExportInterface = await exportJourney(\n tree._id,\n options\n );\n saveJsonToFile(exportData, getFilePath(fileName, true));\n } catch (error) {\n // do we need to report status here?\n }\n }\n stopProgressBar('Done');\n}\n\n/**\n * Import a journey from file\n * @param {string} journeyId journey id/name\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneyFromFile(\n journeyId: string,\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getVerbose();\n fs.readFile(getFilePath(file), 'utf8', async (err, data) => {\n if (err) throw err;\n let journeyData = JSON.parse(data);\n // check if this is a file with multiple trees and get journey by id\n if (journeyData.trees && journeyData.trees[journeyId]) {\n journeyData = journeyData.trees[journeyId];\n } else if (journeyData.trees) {\n journeyData = null;\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId === journeyData.tree._id) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await readJourneys()).map((x) => x._id);\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n showSpinner('Resolving dependencies');\n await resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n succeedSpinner(`Resolved all dependencies.`);\n\n if (!verbose) showSpinner(`Importing ${journeyId}...`);\n importJourney(journeyData, options)\n .then(() => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n succeedSpinner(`Imported ${journeyId}.`);\n })\n .catch((importError) => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${importError}`);\n });\n } else {\n failSpinner(`Unresolved dependencies:`);\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n // end dependency resolution for single tree import\n } else {\n showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${journeyId} not found!`);\n }\n });\n}\n\n/**\n * Import first journey from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importFirstJourneyFromFile(\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getVerbose();\n fs.readFile(getFilePath(file), 'utf8', async (err, data) => {\n if (err) throw err;\n let journeyData = cloneDeep(JSON.parse(data));\n let journeyId = null;\n // single tree\n if (journeyData.tree) {\n journeyId = cloneDeep(journeyData.tree._id);\n }\n // multiple trees, so get the first tree\n else if (journeyData.trees) {\n for (const treeId in journeyData.trees) {\n if (Object.hasOwnProperty.call(journeyData.trees, treeId)) {\n journeyId = treeId;\n journeyData = journeyData.trees[treeId];\n break;\n }\n }\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await readJourneys()).map((x) => x._id);\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n showSpinner('Resolving dependencies');\n await resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n succeedSpinner(`Resolved all dependencies.`);\n\n if (!verbose) showSpinner(`Importing ${journeyId}...`);\n importJourney(journeyData, options)\n .then(() => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n succeedSpinner(`Imported ${journeyId}.`);\n })\n .catch((importError) => {\n if (verbose) showSpinner(`Importing ${journeyId}...`);\n failSpinner(`${importError}`);\n });\n } else {\n failSpinner(`Unresolved dependencies:`);\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n } else {\n showSpinner(`Importing...`);\n failSpinner(`No journeys found!`);\n }\n // end dependency resolution for single tree import\n });\n}\n\n/**\n * Import all journeys from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFile(\n file: string,\n options: TreeImportOptions\n) {\n fs.readFile(getFilePath(file), 'utf8', (err, data) => {\n if (err) throw err;\n try {\n const fileData = JSON.parse(data);\n importJourneys(fileData.trees, options);\n } catch (error) {\n if (error.name === 'UnresolvedDependenciesError') {\n for (const journey of Object.keys(error.unresolvedJourneys)) {\n printMessage({\n message: ` - ${journey} requires ${error.unresolvedJourneys[journey]}`,\n type: 'info',\n state,\n });\n }\n } else {\n printMessage(`${error.message}`, 'error');\n }\n }\n });\n}\n\n/**\n * Import all journeys from separate files\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFiles(options: TreeImportOptions) {\n const names = fs.readdirSync(getWorkingDirectory());\n const jsonFiles = names\n .filter((name) => name.toLowerCase().endsWith('.journey.json'))\n .map((name) => getFilePath(name));\n const allJourneysData = { trees: {} };\n for (const file of jsonFiles) {\n const journeyData = JSON.parse(fs.readFileSync(file, 'utf8'));\n allJourneysData.trees[journeyData.tree._id] = journeyData;\n }\n try {\n await importJourneys(\n allJourneysData.trees as MultiTreeExportInterface,\n options\n );\n } catch (error) {\n printMessage(`${error.response?.data?.message || error.message}`, 'error');\n }\n}\n\n/**\n * Get journey classification\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassification(\n journey: SingleTreeExportInterface\n): JourneyClassificationType[] {\n return _getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return it['brightGreen'];\n\n case 'cloud':\n return it['brightMagenta'];\n\n case 'custom':\n return it['brightRed'];\n\n case 'premium':\n return it['brightYellow'];\n }\n });\n}\n\n/**\n * Get journey classification in markdown\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassificationMd(\n journey: SingleTreeExportInterface\n): string[] {\n return _getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return `:green_circle: \\`${it}\\``;\n\n case 'cloud':\n return `:purple_circle: \\`${it}\\``;\n\n case 'custom':\n return `:red_circle: \\`${it}\\``;\n\n case 'premium':\n return `:yellow_circle: \\`${it}\\``;\n }\n });\n}\n\n/**\n * Get a one-line description of the tree object\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(treeObj: TreeSkeleton): string {\n const description = `[${treeObj._id['brightCyan']}]`;\n return description;\n}\n\n/**\n * Get a one-line description of the tree object in markdown\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescriptionMd(treeObj: TreeSkeleton): string {\n const description = `${treeObj._id}`;\n return description;\n}\n\n/**\n * Helper function to render a nested list of dependent trees\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendents(\n descendents: TreeDependencyMapInterface,\n depth = 0\n) {\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n printMessage(\n `\\nInner Tree Dependencies (${Object.values(descendents)[0].length}):`,\n 'data'\n );\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n printMessage(`${indent}- ${tree['brightCyan']}`, 'data');\n for (const descendent of descendents[tree]) {\n describeTreeDescendents(descendent, depth + 1);\n }\n }\n}\n\n/**\n * Helper function to render a nested list of dependent trees in markdown\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendentsMd(\n descendents: TreeDependencyMapInterface,\n depth = 0\n): string {\n let markdown = '';\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n markdown += `## Inner Tree Dependencies (${\n Object.values(descendents)[0].length\n })\\n`;\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n markdown += `${indent}- ${tree}\\n`;\n for (const descendent of descendents[tree]) {\n markdown += describeTreeDescendentsMd(descendent, depth + 1);\n }\n return markdown;\n }\n return markdown;\n}\n\n/**\n * Describe a journey:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourney(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver\n): Promise<void> {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(`${getOneLineDescription(journeyData.tree)}`, 'data');\n printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join(''));\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Status\n printMessage(\n `\\nStatus\\n${\n journeyData.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen']\n }`\n );\n\n // Classification\n if (state.getAmVersion()) {\n printMessage(\n `\\nClassification\\n${getJourneyClassification(journeyData).join(', ')}`,\n 'data'\n );\n }\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage('\\nCategories/Tags', 'data');\n printMessage(\n `${JSON.parse(journeyData.tree.uiConfig.categories).join(', ')}`,\n 'data'\n );\n }\n\n // Dependency Tree\n try {\n const descendents = await getTreeDescendents(\n journeyData,\n resolveTreeExport\n );\n describeTreeDescendents(descendents);\n } catch (error) {\n printMessage(`Error resolving inner tree dependencies:`, 'error');\n printMessage(error.stack, 'error');\n }\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `\\nNode Types (${Object.entries(nodeTypeMap).length}):`,\n 'data'\n );\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `- ${String(count)} [${\n nodeType['brightCyan']\n }] (${Node.getNodeClassification(nodeType).join(', ')})`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`\\nNodes (${Object.entries(allNodes).length}):`, 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `- ${Node.getOneLineDescription(\n nodeObj,\n getNodeRef(nodeObj, journeyData)\n )}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`\\nThemes (${journeyData.themes.length}):`, 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`- ${Theme.getOneLineDescription(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `\\nScripts (${Object.entries(journeyData.scripts).length}):`,\n 'data'\n );\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`- ${Script.getOneLineDescription(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `\\nEmail Templates (${\n Object.entries(journeyData.emailTemplates).length\n }):`,\n 'data'\n );\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(\n `- ${EmailTemplate.getOneLineDescription(templateData)}`,\n 'data'\n );\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `\\nSocial Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n }):`,\n 'data'\n );\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`- ${Idp.getOneLineDescription(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `\\nSAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n }):`,\n 'data'\n );\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(\n `- ${Saml2.getOneLineDescription(entityProviderData)}`,\n 'data'\n );\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `\\nSAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n }):`,\n 'data'\n );\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(\n `- ${CirclesOfTrust.getOneLineDescription(cotData)}`,\n 'data'\n );\n }\n }\n}\n\n/**\n * Describe a journey in markdown:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourneyMd(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver\n) {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(\n `# ${getOneLineDescriptionMd(journeyData.tree)} - ${\n journeyData.tree.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n }, ${getJourneyClassificationMd(journeyData).join(', ')}`,\n 'data'\n );\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage(\n `\\`${JSON.parse(journeyData.tree.uiConfig.categories).join('`, `')}\\``,\n 'data'\n );\n }\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Journey image\n printMessage(`\\n[]()\\n`, 'data');\n\n // Dependency Tree\n const descendents = await getTreeDescendents(journeyData, resolveTreeExport);\n printMessage(describeTreeDescendentsMd(descendents), 'data');\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `## Node Types (${Object.entries(nodeTypeMap).length})`,\n 'data'\n );\n printMessage('| Count | Type | Classification |', 'data');\n printMessage('| -----:| ---- | -------------- |', 'data');\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `| ${String(count)} | ${nodeType} | ${Node.getNodeClassificationMd(\n nodeType\n ).join('<br>')} |`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');\n printMessage(Node.getTableHeaderMd(), 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `${Node.getTableRowMd(nodeObj, getNodeRef(nodeObj, journeyData))}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`## Themes (${journeyData.themes.length})`, 'data');\n printMessage(Theme.getTableHeaderMd(), 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`${Theme.getTableRowMd(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `## Scripts (${Object.entries(journeyData.scripts).length})`,\n 'data'\n );\n printMessage(Script.getTableHeaderMd(), 'data');\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`${Script.getTableRowMd(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `## Email Templates (${\n Object.entries(journeyData.emailTemplates).length\n })`,\n 'data'\n );\n printMessage(EmailTemplate.getTableHeaderMd(), 'data');\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(`${EmailTemplate.getTableRowMd(templateData)}`, 'data');\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `## Social Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n })`,\n 'data'\n );\n printMessage(Idp.getTableHeaderMd(), 'data');\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`${Idp.getTableRowMd(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `## SAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n })`,\n 'data'\n );\n printMessage(Saml2.getTableHeaderMd(), 'data');\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(`${Saml2.getTableRowMd(entityProviderData)}`, 'data');\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `## SAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n })`,\n 'data'\n );\n printMessage(CirclesOfTrust.getTableHeaderMd(), 'data');\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(`${CirclesOfTrust.getTableRowMd(cotData)}`, 'data');\n }\n }\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAYpD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,iBAAiB,QACZ,kBAAkB;AACzB,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,GAAG,MAAM,UAAU;AAC/B,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,QAAQ,MAAM,kBAAkB;AAEvC,MAAM;EACJC,gBAAgB;EAChBC,cAAc;EACdC,cAAc;EACdC,WAAW;EACXC;AACF,CAAC,GAAGzB,KA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AAW,CAACwE,uBACd,CAAC,EAAE;MACDxJ,YAAY,CAAE,GAAEO,GAAG,CAAC6J,aAAa,CAACX,aAAa,CAAE,EAAC,EAAE,MAAM,CAAC;IAC7D;EACF;;EAEA;EACA,IAAInE,MAAM,CAACsD,OAAO,CAAC5D,WAAW,CAAC0E,aAAa,CAAC,CAAClF,MAAM,EAAE;IACpDxE,YAAY,CACT,8BACCsF,MAAM,CAACsD,OAAO,CAAC5D,WAAW,CAAC0E,aAAa,CAAC,CAAClF,MAC3C,GAAE,EACH,MACF,CAAC;IACDxE,YAAY,CAACS,KAAK,CAAC0J,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC;IAC9C,KAAK,MAAMR,kBAAkB,IAAIrE,MAAM,CAACgC,MAAM,CAACtC,WAAW,CAAC0E,aAAa,CAAC,EAAE;MACzE1J,YAAY,CAAE,GAAES,KAAK,CAAC2J,aAAa,CAACT,kBAAkB,CAAE,EAAC,EAAE,MAAM,CAAC;IACpE;EACF;;EAEA;EACA,IAAIrE,MAAM,CAACsD,OAAO,CAAC5D,WAAW,CAAC4E,cAAc,CAAC,CAACpF,MAAM,EAAE;IACrDxE,YAAY,CACT,8BACCsF,MAAM,CAACsD,OAAO,CAAC5D,WAAW,CAAC4E,cAAc,CAAC,CAACpF,MAC5C,GAAE,EACH,MACF,CAAC;IACDxE,YAAY,CAACK,cAAc,CAAC8J,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC;IACvD,KAAK,MAAMN,OAAO,IAAIvE,MAAM,CAACgC,MAAM,CAACtC,WAAW,CAAC4E,cAAc,CAAC,EAAE;MAC/D5J,YAAY,CAAE,GAAEK,cAAc,CAAC+J,aAAa,CAACP,OAAO,CAAE,EAAC,EAAE,MAAM,CAAC;IAClE;EACF;AACF"}
|
|
1
|
+
{"version":3,"file":"JourneyOps.js","names":["frodo","state","fs","createProgressIndicator","createTable","debugMessage","printMessage","stopProgressIndicator","updateProgressIndicator","CirclesOfTrust","EmailTemplate","Idp","Node","Saml2","Script","Theme","cloneDeep","wordwrap","getTypedFilename","saveJsonToFile","getRealmString","getFilePath","getWorkingDirectory","utils","readJourneys","exportJourney","exportJourneys","resolveDependencies","importJourneys","importJourney","getTreeDescendents","getNodeRef","onlineTreeExportResolver","getJourneyClassification","_getJourneyClassification","disableJourney","_disableJourney","enableJourney","_enableJourney","authn","journey","listJourneys","long","analyze","journeys","journeyStub","table","_journeyStub$uiConfig","push","_id","enabled","uiConfig","categories","JSON","parse","join","toString","spinnerId","exportPromises","useStringArrays","deps","journeyExports","Promise","all","journeyExport","_journeyExport$tree$u","tree","error","response","data","_error$response","exportJourneyToFile","journeyId","file","options","verbose","getVerbose","filePath","fileData","exportJourneysToFile","exportJourneysToFiles","journeysExport","trees","Object","entries","treeId","treeValue","indicatorId","meta","importJourneyFromFile","readFileSync","journeyData","installedJourneys","map","x","unresolvedJourneys","resolvedJourneys","indicatorId1","keys","length","indicatorId2","importError","indicatorId3","importFirstJourneyFromFile","hasOwnProperty","call","depSpinnerId","importSpinnerId","importJourneysFromFile","name","message","type","importJourneysFromFiles","names","readdirSync","jsonFiles","filter","toLowerCase","endsWith","allJourneysData","_error$response2","it","getJourneyClassificationMd","getOneLineDescription","treeObj","description","getOneLineDescriptionMd","describeTreeDescendents","descendents","depth","values","indent","Array","fill","descendent","describeTreeDescendentsMd","markdown","describeJourney","resolveTreeExport","_journeyData$meta","_journeyData$tree$uiC","_journeyData$themes","allNodes","nodes","innerNodes","nodeTypeMap","nodeData","_type","getAmVersion","originAmVersion","setAmVersion","stack","nodeType","count","String","getNodeClassification","nodeObj","themes","themeData","scripts","scriptData","emailTemplates","templateData","socialIdentityProviders","socialIdpData","saml2Entities","entityProviderData","circlesOfTrust","cotData","describeJourneyMd","_journeyData$meta2","_journeyData$tree$uiC2","_journeyData$themes2","getNodeClassificationMd","getTableHeaderMd","getTableRowMd"],"sources":["../../src/ops/JourneyOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { type NodeSkeleton } from '@rockcarver/frodo-lib/types/api/NodeApi';\nimport { type TreeSkeleton } from '@rockcarver/frodo-lib/types/api/TreeApi';\nimport {\n type JourneyClassificationType,\n type MultiTreeExportInterface,\n type SingleTreeExportInterface,\n type TreeDependencyMapInterface,\n type TreeExportOptions,\n type TreeExportResolverInterface,\n type TreeImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/JourneyOps';\nimport fs from 'fs';\n\nimport {\n createProgressIndicator,\n createTable,\n debugMessage,\n printMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n} from '../utils/Console';\nimport * as CirclesOfTrust from './CirclesOfTrustOps';\nimport * as EmailTemplate from './EmailTemplateOps';\nimport * as Idp from './IdpOps';\nimport * as Node from './NodeOps';\nimport * as Saml2 from './Saml2Ops';\nimport * as Script from './ScriptOps';\nimport * as Theme from './ThemeOps';\nimport { cloneDeep } from './utils/OpsUtils';\nimport wordwrap from './utils/Wordwrap';\n\nconst {\n getTypedFilename,\n saveJsonToFile,\n getRealmString,\n getFilePath,\n getWorkingDirectory,\n} = frodo.utils;\nconst {\n readJourneys,\n exportJourney,\n exportJourneys,\n resolveDependencies,\n importJourneys,\n importJourney,\n getTreeDescendents,\n getNodeRef,\n onlineTreeExportResolver,\n getJourneyClassification: _getJourneyClassification,\n disableJourney: _disableJourney,\n enableJourney: _enableJourney,\n} = frodo.authn.journey;\n\n/**\n * List all the journeys/trees\n * @param {boolean} long Long version, all the fields\n * @param {boolean} analyze Analyze journeys/trees for custom nodes (expensive)\n * @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array journey objects\n */\nexport async function listJourneys(\n long = false,\n analyze = false\n): Promise<TreeSkeleton[]> {\n let journeys = [];\n try {\n journeys = await readJourneys();\n if (!long && !analyze) {\n for (const journeyStub of journeys) {\n printMessage(`${journeyStub['_id']}`, 'data');\n }\n } else {\n if (!analyze) {\n const table = createTable(['Name', 'Status', 'Tags']);\n for (const journeyStub of journeys) {\n table.push([\n `${journeyStub._id}`,\n journeyStub.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n journeyStub.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyStub.uiConfig.categories).join(', '),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n const spinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Retrieving details of all journeys...`\n );\n const exportPromises = [];\n try {\n for (const journeyStub of journeys) {\n exportPromises.push(\n exportJourney(journeyStub['_id'], {\n useStringArrays: false,\n deps: false,\n })\n );\n }\n const journeyExports = await Promise.all(exportPromises);\n stopProgressIndicator(\n spinnerId,\n 'Retrieved details of all journeys.',\n 'success'\n );\n const table = createTable([\n 'Name',\n 'Status',\n 'Classification',\n 'Tags',\n ]);\n for (const journeyExport of journeyExports) {\n table.push([\n `${journeyExport.tree._id}`,\n journeyExport.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n getJourneyClassification(journeyExport).join(', '),\n journeyExport.tree.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyExport.tree.uiConfig.categories).join(\n ', '\n ),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } catch (error) {\n stopProgressIndicator(\n spinnerId,\n 'Error retrieving details of all journeys.',\n 'fail'\n );\n printMessage(error.response.data, 'error');\n }\n }\n }\n } catch (error) {\n printMessage(error.response?.data, 'error');\n }\n return journeys;\n}\n\n/**\n * Export journey by id/name to file\n * @param {string} journeyId journey id/name\n * @param {string} file optional export file name\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneyToFile(\n journeyId: string,\n file: string,\n options: TreeExportOptions\n): Promise<void> {\n debugMessage(`exportJourneyToFile: start`);\n const verbose = state.getVerbose();\n if (!file) {\n file = getTypedFilename(journeyId, 'journey');\n }\n const filePath = getFilePath(file, true);\n let spinnerId: string;\n if (!verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n try {\n const fileData: SingleTreeExportInterface = await exportJourney(\n journeyId,\n options\n );\n if (verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n saveJsonToFile(fileData, filePath);\n stopProgressIndicator(\n spinnerId,\n `Exported ${journeyId['brightCyan']} to ${filePath['brightCyan']}.`,\n 'success'\n );\n } catch (error) {\n if (verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n stopProgressIndicator(\n spinnerId,\n `Error exporting journey ${journeyId}: ${error}`,\n 'fail'\n );\n }\n}\n\n/**\n * Export all journeys to file\n * @param {string} file optional export file name\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFile(\n file: string,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n }\n): Promise<void> {\n if (!file) {\n file = getTypedFilename(`all${getRealmString()}Journeys`, 'journey');\n }\n const filePath = getFilePath(file, true);\n const fileData: MultiTreeExportInterface = await exportJourneys(options);\n saveJsonToFile(fileData, filePath);\n}\n\n/**\n * Export all journeys to separate files\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFiles(\n options: TreeExportOptions\n): Promise<void> {\n const journeysExport = await exportJourneys(options);\n const trees = Object.entries(journeysExport.trees);\n for (const [treeId, treeValue] of trees) {\n const indicatorId = createProgressIndicator(\n 'determinate',\n 1,\n `Saving ${treeId}...`\n );\n const file = getFilePath(getTypedFilename(`${treeId}`, 'journey'), true);\n treeValue['meta'] = journeysExport.meta;\n try {\n updateProgressIndicator(indicatorId, `Saving ${treeId} to ${file}`);\n saveJsonToFile(treeValue, file);\n stopProgressIndicator(indicatorId, `${treeId} saved to ${file}`);\n } catch (error) {\n stopProgressIndicator(indicatorId, `Error saving ${treeId} to ${file}`);\n }\n }\n}\n\n/**\n * Import a journey from file\n * @param {string} journeyId journey id/name\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneyFromFile(\n journeyId: string,\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getVerbose();\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n let journeyData = JSON.parse(data);\n // check if this is a file with multiple trees and get journey by id\n if (journeyData.trees && journeyData.trees[journeyId]) {\n journeyData = journeyData.trees[journeyId];\n } else if (journeyData.trees) {\n journeyData = null;\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId === journeyData.tree._id) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await readJourneys()).map((x) => x._id);\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n const indicatorId1 = createProgressIndicator(\n 'indeterminate',\n 0,\n 'Resolving dependencies'\n );\n await resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n stopProgressIndicator(\n indicatorId1,\n `Resolved all dependencies.`,\n 'success'\n );\n\n let indicatorId2: string;\n if (!verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n try {\n await importJourney(journeyData, options);\n if (verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(\n indicatorId2,\n `Imported ${journeyId}.`,\n 'success'\n );\n } catch (importError) {\n if (verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(indicatorId2, `${importError}`, 'fail');\n }\n } else {\n stopProgressIndicator(indicatorId1, `Unresolved dependencies:`, 'fail');\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n // end dependency resolution for single tree import\n } else {\n const indicatorId3 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(indicatorId3, `${journeyId} not found!`, 'fail');\n }\n } catch (error) {\n printMessage(`Error importing journey ${journeyId}: ${error}`, 'error');\n }\n}\n\n/**\n * Import first journey from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importFirstJourneyFromFile(\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getVerbose();\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n let journeyData = cloneDeep(JSON.parse(data));\n let journeyId = null;\n // single tree\n if (journeyData.tree) {\n journeyId = cloneDeep(journeyData.tree._id);\n }\n // multiple trees, so get the first tree\n else if (journeyData.trees) {\n for (const treeId in journeyData.trees) {\n if (Object.hasOwnProperty.call(journeyData.trees, treeId)) {\n journeyId = treeId;\n journeyData = journeyData.trees[treeId];\n break;\n }\n }\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await readJourneys()).map((x) => x._id);\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n const depSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n 'Resolving dependencies'\n );\n await resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n stopProgressIndicator(\n depSpinnerId,\n `Resolved all dependencies.`,\n 'success'\n );\n\n let importSpinnerId: string;\n if (!verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n try {\n await importJourney(journeyData, options);\n if (verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(\n importSpinnerId,\n `Imported ${journeyId}.`,\n 'success'\n );\n } catch (importError) {\n if (verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(importSpinnerId, `${importError}`, 'fail');\n }\n } else {\n stopProgressIndicator(depSpinnerId, `Unresolved dependencies:`, 'fail');\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n } else {\n const importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing...`\n );\n stopProgressIndicator(importSpinnerId, `No journeys found!`, 'fail');\n }\n // end dependency resolution for single tree import\n } catch (error) {\n printMessage(`Error importing first journey: ${error}`, 'error');\n }\n}\n\n/**\n * Import all journeys from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFile(\n file: string,\n options: TreeImportOptions\n) {\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n try {\n const fileData = JSON.parse(data);\n await importJourneys(fileData.trees, options);\n } catch (error) {\n if (error.name === 'UnresolvedDependenciesError') {\n for (const journey of Object.keys(error.unresolvedJourneys)) {\n printMessage({\n message: ` - ${journey} requires ${error.unresolvedJourneys[journey]}`,\n type: 'info',\n state,\n });\n }\n } else {\n printMessage(`${error.message}`, 'error');\n }\n }\n } catch (error) {\n printMessage(`Error importing journeys: ${error}`, 'error');\n }\n}\n\n/**\n * Import all journeys from separate files\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFiles(options: TreeImportOptions) {\n const names = fs.readdirSync(getWorkingDirectory());\n const jsonFiles = names\n .filter((name) => name.toLowerCase().endsWith('.journey.json'))\n .map((name) => getFilePath(name));\n const allJourneysData = { trees: {} };\n for (const file of jsonFiles) {\n const journeyData = JSON.parse(fs.readFileSync(file, 'utf8'));\n allJourneysData.trees[journeyData.tree._id] = journeyData;\n }\n try {\n await importJourneys(\n allJourneysData.trees as MultiTreeExportInterface,\n options\n );\n } catch (error) {\n printMessage(`${error.response?.data?.message || error.message}`, 'error');\n }\n}\n\n/**\n * Get journey classification\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassification(\n journey: SingleTreeExportInterface\n): JourneyClassificationType[] {\n return _getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return it['brightGreen'];\n\n case 'cloud':\n return it['brightMagenta'];\n\n case 'custom':\n return it['brightRed'];\n\n case 'premium':\n return it['brightYellow'];\n }\n });\n}\n\n/**\n * Get journey classification in markdown\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassificationMd(\n journey: SingleTreeExportInterface\n): string[] {\n return _getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return `:green_circle: \\`${it}\\``;\n\n case 'cloud':\n return `:purple_circle: \\`${it}\\``;\n\n case 'custom':\n return `:red_circle: \\`${it}\\``;\n\n case 'premium':\n return `:yellow_circle: \\`${it}\\``;\n }\n });\n}\n\n/**\n * Get a one-line description of the tree object\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(treeObj: TreeSkeleton): string {\n const description = `[${treeObj._id['brightCyan']}]`;\n return description;\n}\n\n/**\n * Get a one-line description of the tree object in markdown\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescriptionMd(treeObj: TreeSkeleton): string {\n const description = `${treeObj._id}`;\n return description;\n}\n\n/**\n * Helper function to render a nested list of dependent trees\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendents(\n descendents: TreeDependencyMapInterface,\n depth = 0\n) {\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n printMessage(\n `\\nInner Tree Dependencies (${Object.values(descendents)[0].length}):`,\n 'data'\n );\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n printMessage(`${indent}- ${tree['brightCyan']}`, 'data');\n for (const descendent of descendents[tree]) {\n describeTreeDescendents(descendent, depth + 1);\n }\n }\n}\n\n/**\n * Helper function to render a nested list of dependent trees in markdown\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendentsMd(\n descendents: TreeDependencyMapInterface,\n depth = 0\n): string {\n let markdown = '';\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n markdown += `## Inner Tree Dependencies (${\n Object.values(descendents)[0].length\n })\\n`;\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n markdown += `${indent}- ${tree}\\n`;\n for (const descendent of descendents[tree]) {\n markdown += describeTreeDescendentsMd(descendent, depth + 1);\n }\n return markdown;\n }\n return markdown;\n}\n\n/**\n * Describe a journey:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourney(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver\n): Promise<void> {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(`${getOneLineDescription(journeyData.tree)}`, 'data');\n printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join(''));\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Status\n printMessage(\n `\\nStatus\\n${\n journeyData.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen']\n }`\n );\n\n // Classification\n if (state.getAmVersion()) {\n printMessage(\n `\\nClassification\\n${getJourneyClassification(journeyData).join(', ')}`,\n 'data'\n );\n }\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage('\\nCategories/Tags', 'data');\n printMessage(\n `${JSON.parse(journeyData.tree.uiConfig.categories).join(', ')}`,\n 'data'\n );\n }\n\n // Dependency Tree\n try {\n const descendents = await getTreeDescendents(\n journeyData,\n resolveTreeExport\n );\n describeTreeDescendents(descendents);\n } catch (error) {\n printMessage(`Error resolving inner tree dependencies:`, 'error');\n printMessage(error.stack, 'error');\n }\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `\\nNode Types (${Object.entries(nodeTypeMap).length}):`,\n 'data'\n );\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `- ${String(count)} [${\n nodeType['brightCyan']\n }] (${Node.getNodeClassification(nodeType).join(', ')})`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`\\nNodes (${Object.entries(allNodes).length}):`, 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `- ${Node.getOneLineDescription(\n nodeObj,\n getNodeRef(nodeObj, journeyData)\n )}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`\\nThemes (${journeyData.themes.length}):`, 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`- ${Theme.getOneLineDescription(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `\\nScripts (${Object.entries(journeyData.scripts).length}):`,\n 'data'\n );\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`- ${Script.getOneLineDescription(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `\\nEmail Templates (${\n Object.entries(journeyData.emailTemplates).length\n }):`,\n 'data'\n );\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(\n `- ${EmailTemplate.getOneLineDescription(templateData)}`,\n 'data'\n );\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `\\nSocial Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n }):`,\n 'data'\n );\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`- ${Idp.getOneLineDescription(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `\\nSAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n }):`,\n 'data'\n );\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(\n `- ${Saml2.getOneLineDescription(entityProviderData)}`,\n 'data'\n );\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `\\nSAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n }):`,\n 'data'\n );\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(\n `- ${CirclesOfTrust.getOneLineDescription(cotData)}`,\n 'data'\n );\n }\n }\n}\n\n/**\n * Describe a journey in markdown:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourneyMd(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver\n) {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(\n `# ${getOneLineDescriptionMd(journeyData.tree)} - ${\n journeyData.tree.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n }, ${getJourneyClassificationMd(journeyData).join(', ')}`,\n 'data'\n );\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage(\n `\\`${JSON.parse(journeyData.tree.uiConfig.categories).join('`, `')}\\``,\n 'data'\n );\n }\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Journey image\n printMessage(`\\n[]()\\n`, 'data');\n\n // Dependency Tree\n const descendents = await getTreeDescendents(journeyData, resolveTreeExport);\n printMessage(describeTreeDescendentsMd(descendents), 'data');\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `## Node Types (${Object.entries(nodeTypeMap).length})`,\n 'data'\n );\n printMessage('| Count | Type | Classification |', 'data');\n printMessage('| -----:| ---- | -------------- |', 'data');\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `| ${String(count)} | ${nodeType} | ${Node.getNodeClassificationMd(\n nodeType\n ).join('<br>')} |`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');\n printMessage(Node.getTableHeaderMd(), 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `${Node.getTableRowMd(nodeObj, getNodeRef(nodeObj, journeyData))}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`## Themes (${journeyData.themes.length})`, 'data');\n printMessage(Theme.getTableHeaderMd(), 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`${Theme.getTableRowMd(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `## Scripts (${Object.entries(journeyData.scripts).length})`,\n 'data'\n );\n printMessage(Script.getTableHeaderMd(), 'data');\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`${Script.getTableRowMd(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `## Email Templates (${\n Object.entries(journeyData.emailTemplates).length\n })`,\n 'data'\n );\n printMessage(EmailTemplate.getTableHeaderMd(), 'data');\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(`${EmailTemplate.getTableRowMd(templateData)}`, 'data');\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `## Social Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n })`,\n 'data'\n );\n printMessage(Idp.getTableHeaderMd(), 'data');\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`${Idp.getTableRowMd(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `## SAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n })`,\n 'data'\n );\n printMessage(Saml2.getTableHeaderMd(), 'data');\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(`${Saml2.getTableRowMd(entityProviderData)}`, 'data');\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `## SAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n })`,\n 'data'\n );\n printMessage(CirclesOfTrust.getTableHeaderMd(), 'data');\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(`${CirclesOfTrust.getTableRowMd(cotData)}`, 'data');\n }\n }\n}\n\nexport async function enableJourney(journeyId: string): Promise<boolean> {\n const indicatorId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Enabling journey ${journeyId}...`\n );\n if (_enableJourney(journeyId)) {\n stopProgressIndicator(\n indicatorId,\n `Enabled journey ${journeyId}.`,\n 'success'\n );\n return true;\n } else {\n stopProgressIndicator(\n indicatorId,\n `Error enabling journey ${journeyId}`,\n 'fail'\n );\n return false;\n }\n}\n\nexport async function disableJourney(journeyId: string): Promise<boolean> {\n const indicatorId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Disabling journey ${journeyId}...`\n );\n if (_disableJourney(journeyId)) {\n stopProgressIndicator(\n indicatorId,\n `Disabled journey ${journeyId}.`,\n 'success'\n );\n return true;\n } else {\n stopProgressIndicator(\n indicatorId,\n `Error disabling journey ${journeyId}`,\n 'fail'\n );\n return false;\n }\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAYpD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,uBAAuB,EACvBC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,qBAAqB,EACrBC,uBAAuB,QAClB,kBAAkB;AACzB,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,GAAG,MAAM,UAAU;AAC/B,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,QAAQ,MAAM,kBAAkB;AAEvC,MAAM;EACJC,gBAAgB;EAChBC,cAAc;EACdC,cAAc;EACdC,WAAW;EACXC;AACF,CAAC,GAAGtB,KAAK,CAACuB,KAAK;AACf,MAAM;EACJC,YAAY;EACZC,aAAa;EACbC,cAAc;EACdC,mBAAmB;EACnBC,cAAc;EAC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,6 @@
|
|
|
1
1
|
import { frodo, state } from '@rockcarver/frodo-lib';
|
|
2
2
|
import fs from 'fs';
|
|
3
|
-
import {
|
|
3
|
+
import { createProgressIndicator, createTable, debugMessage, failSpinner, printMessage, showSpinner, stopProgressIndicator, succeedSpinner, updateProgressIndicator } from '../utils/Console';
|
|
4
4
|
import { saveJsonToFile } from '../utils/ExportImportUtils';
|
|
5
5
|
const {
|
|
6
6
|
getTypedFilename,
|
|
@@ -132,24 +132,25 @@ export async function exportOAuth2ClientsToFiles(options = {
|
|
|
132
132
|
}) {
|
|
133
133
|
debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientsToFiles: begin`);
|
|
134
134
|
const errors = [];
|
|
135
|
+
let indicatorId;
|
|
135
136
|
try {
|
|
136
137
|
const clients = await readOAuth2Clients();
|
|
137
|
-
|
|
138
|
+
indicatorId = createProgressIndicator('determinate', clients.length, 'Exporting clients...');
|
|
138
139
|
for (const client of clients) {
|
|
139
140
|
const file = getTypedFilename(client._id, 'oauth2.app');
|
|
140
141
|
try {
|
|
141
142
|
const exportData = await exportOAuth2Client(client._id, options);
|
|
142
143
|
saveJsonToFile(exportData, getFilePath(file, true));
|
|
143
|
-
|
|
144
|
+
updateProgressIndicator(indicatorId, `Exported ${client._id}.`);
|
|
144
145
|
} catch (error) {
|
|
145
146
|
errors.push(error);
|
|
146
|
-
|
|
147
|
+
updateProgressIndicator(indicatorId, `Error exporting ${client._id}.`);
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
+
stopProgressIndicator(indicatorId, `Export complete.`);
|
|
150
151
|
} catch (error) {
|
|
151
152
|
errors.push(error);
|
|
152
|
-
|
|
153
|
+
stopProgressIndicator(indicatorId, `Error exporting client(s) to file(s)`);
|
|
153
154
|
}
|
|
154
155
|
debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientsToFiles: end`);
|
|
155
156
|
return 0 === errors.length;
|
|
@@ -245,11 +246,12 @@ export async function importOAuth2ClientsFromFiles(options = {
|
|
|
245
246
|
deps: true
|
|
246
247
|
}) {
|
|
247
248
|
const errors = [];
|
|
249
|
+
let indicatorId;
|
|
248
250
|
try {
|
|
249
251
|
debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFiles: begin`);
|
|
250
252
|
const names = fs.readdirSync(getWorkingDirectory());
|
|
251
253
|
const files = names.filter(name => name.toLowerCase().endsWith('.oauth2.app.json')).map(name => getFilePath(name));
|
|
252
|
-
|
|
254
|
+
indicatorId = createProgressIndicator('determinate', files.length, 'Importing clients...');
|
|
253
255
|
let total = 0;
|
|
254
256
|
for (const file of files) {
|
|
255
257
|
try {
|
|
@@ -258,17 +260,17 @@ export async function importOAuth2ClientsFromFiles(options = {
|
|
|
258
260
|
const count = Object.keys(fileData.application).length;
|
|
259
261
|
total += count;
|
|
260
262
|
await importOAuth2Clients(fileData, options);
|
|
261
|
-
|
|
263
|
+
updateProgressIndicator(indicatorId, `Imported ${count} client(s) from ${file}`);
|
|
262
264
|
} catch (error) {
|
|
263
265
|
errors.push(error);
|
|
264
|
-
|
|
266
|
+
updateProgressIndicator(indicatorId, `Error importing client(s) from ${file}`);
|
|
265
267
|
printMessage(error, 'error');
|
|
266
268
|
}
|
|
267
269
|
}
|
|
268
|
-
|
|
270
|
+
stopProgressIndicator(indicatorId, `Finished importing ${total} client(s) from ${files.length} file(s).`);
|
|
269
271
|
} catch (error) {
|
|
270
272
|
errors.push(error);
|
|
271
|
-
|
|
273
|
+
stopProgressIndicator(indicatorId, `Error importing client(s) from file(s).`);
|
|
272
274
|
printMessage(error, 'error');
|
|
273
275
|
}
|
|
274
276
|
debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFiles: end`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuth2ClientOps.js","names":["frodo","state","fs","createProgressBar","createTable","debugMessage","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","saveJsonToFile","getTypedFilename","titleCase","getFilePath","getWorkingDirectory","utils","readOAuth2Clients","exportOAuth2Client","exportOAuth2Clients","importOAuth2Client","importFirstOAuth2Client","importOAuth2Clients","oauth2oidc","client","listOAuth2Clients","long","clients","sort","a","b","_id","localeCompare","table","grantTypesMap","authorization_code","client_credentials","refresh_token","password","implicit","forEach","push","coreOAuth2ClientConfig","status","clientType","advancedOAuth2ClientConfig","grantTypes","map","type","join","scopes","redirectionUris","toString","error","exportOAuth2ClientToFile","clientId","file","options","useStringArrays","deps","outcome","fileName","filePath","exportData","message","exportOAuth2ClientsToFile","getRealmName","getRealm","exportOAuth2ClientsToFiles","errors","length","importOAuth2ClientFromFile","data","readFileSync","fileData","JSON","parse","importFirstOAuth2ClientFromFile","importOAuth2ClientsFromFile","clientData","importOAuth2ClientsFromFiles","names","readdirSync","files","filter","name","toLowerCase","endsWith","total","count","Object","keys","application"],"sources":["../../src/ops/OAuth2ClientOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Readable } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport type {\n OAuth2ClientExportInterface,\n OAuth2ClientExportOptions,\n OAuth2ClientImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/OAuth2ClientOps';\nimport fs from 'fs';\n\nimport {\n createProgressBar,\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport { saveJsonToFile } from '../utils/ExportImportUtils';\n\nconst { getTypedFilename, titleCase, getFilePath, getWorkingDirectory } =\n frodo.utils;\nconst {\n readOAuth2Clients,\n exportOAuth2Client,\n exportOAuth2Clients,\n importOAuth2Client,\n importFirstOAuth2Client,\n importOAuth2Clients,\n} = frodo.oauth2oidc.client;\n\n/**\n * List OAuth2 clients\n */\nexport async function listOAuth2Clients(long = false) {\n try {\n const clients = await readOAuth2Clients();\n clients.sort((a, b) => a._id.localeCompare(b._id));\n if (long) {\n const table = createTable([\n 'Client Id',\n 'Status',\n 'Client Type',\n 'Grant Types',\n 'Scopes',\n 'Redirect URIs',\n // 'Description',\n ]);\n const grantTypesMap = {\n authorization_code: 'Authz Code',\n client_credentials: 'Client Creds',\n refresh_token: 'Refresh Token',\n password: 'ROPC',\n 'urn:ietf:params:oauth:grant-type:uma-ticket': 'UMA',\n implicit: 'Implicit',\n 'urn:ietf:params:oauth:grant-type:device_code': 'Device Code',\n 'urn:ietf:params:oauth:grant-type:saml2-bearer': 'SAML2 Bearer',\n 'urn:openid:params:grant-type:ciba': 'CIBA',\n 'urn:ietf:params:oauth:grant-type:token-exchange': 'Token Exchange',\n 'urn:ietf:params:oauth:grant-type:jwt-bearer': 'JWT Bearer',\n };\n clients.forEach((client) => {\n table.push([\n client._id,\n client.coreOAuth2ClientConfig.status === 'Active'\n ? 'Active'['brightGreen']\n : (client.coreOAuth2ClientConfig.status as string)['brightRed'],\n client.coreOAuth2ClientConfig.clientType,\n (client.advancedOAuth2ClientConfig.grantTypes as Readable<string[]>)\n .map((type) => grantTypesMap[type])\n .join('\\n'),\n (client.coreOAuth2ClientConfig.scopes as Readable<string[]>).join(\n '\\n'\n ),\n (client.coreOAuth2ClientConfig.redirectionUris as string[]).join(\n '\\n'\n ),\n // wordwrap(client.description, 30),\n ]);\n });\n printMessage(table.toString(), 'data');\n } else {\n clients.forEach((client) => {\n printMessage(`${client._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing oauth2 clients - ${error}`, 'error');\n }\n}\n\n/**\n * Export OAuth2 client to file\n * @param {string} clientId client id\n * @param {string} file file name\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportOAuth2ClientToFile(\n clientId: string,\n file: string,\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n) {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientToFile: begin`);\n showSpinner(`Exporting ${clientId}...`);\n try {\n let fileName = getTypedFilename(clientId, 'oauth2.app');\n if (file) {\n fileName = file;\n }\n const filePath = getFilePath(fileName, true);\n const exportData = await exportOAuth2Client(clientId, options);\n saveJsonToFile(exportData, filePath);\n succeedSpinner(`Exported ${clientId} to ${filePath}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting ${clientId}: ${error.message}`);\n }\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientToFile: end`);\n return outcome;\n}\n\n/**\n * Export all OAuth2 clients to file\n * @param {string} file file name\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportOAuth2ClientsToFile(\n file: string,\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientsToFile: begin`);\n showSpinner(`Exporting all clients...`);\n try {\n let fileName = getTypedFilename(\n `all${titleCase(frodo.utils.getRealmName(state.getRealm()))}Applications`,\n 'oauth2.app'\n );\n if (file) {\n fileName = file;\n }\n const filePath = getFilePath(fileName, true);\n const exportData = await exportOAuth2Clients(options);\n saveJsonToFile(exportData, filePath);\n succeedSpinner(`Exported all clients to ${filePath}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting all clients`);\n printMessage(`${error.message}`, 'error');\n }\n debugMessage(\n `cli.OAuth2ClientOps.exportOAuth2ClientsToFile: end [${outcome}]`\n );\n return outcome;\n}\n\n/**\n * Export all OAuth2 clients to separate files\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportOAuth2ClientsToFiles(\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n) {\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientsToFiles: begin`);\n const errors = [];\n try {\n const clients = await readOAuth2Clients();\n createProgressBar(clients.length, 'Exporting clients...');\n for (const client of clients) {\n const file = getTypedFilename(client._id, 'oauth2.app');\n try {\n const exportData: OAuth2ClientExportInterface =\n await exportOAuth2Client(client._id, options);\n saveJsonToFile(exportData, getFilePath(file, true));\n updateProgressBar(`Exported ${client._id}.`);\n } catch (error) {\n errors.push(error);\n updateProgressBar(`Error exporting ${client._id}.`);\n }\n }\n stopProgressBar(`Export complete.`);\n } catch (error) {\n errors.push(error);\n stopProgressBar(`Error exporting client(s) to file(s)`);\n }\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientsToFiles: end`);\n return 0 === errors.length;\n}\n\n/**\n * Import first OAuth2 client from file\n * @param {string} clientId client id\n * @param {string} file file name\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importOAuth2ClientFromFile(\n clientId: string,\n file: string,\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientFromFile: begin`);\n showSpinner(`Importing ${clientId}...`);\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n const fileData = JSON.parse(data);\n await importOAuth2Client(clientId, fileData, options);\n outcome = true;\n succeedSpinner(`Imported ${clientId}.`);\n } catch (error) {\n failSpinner(`Error importing ${clientId}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientFromFile: end`);\n return outcome;\n}\n\n/**\n * Import first OAuth2 client from file\n * @param {string} file file name\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importFirstOAuth2ClientFromFile(\n file: string,\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.importFirstOAuth2ClientFromFile: begin`);\n const filePath = getFilePath(file);\n showSpinner(`Importing ${filePath}...`);\n try {\n const data = fs.readFileSync(filePath, 'utf8');\n const fileData = JSON.parse(data);\n await importFirstOAuth2Client(fileData, options);\n outcome = true;\n succeedSpinner(`Imported ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing ${filePath}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.OAuth2ClientOps.importFirstOAuth2ClientFromFile: end`);\n return outcome;\n}\n\n/**\n * Import OAuth2 clients from file\n * @param {string} file file name\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importOAuth2ClientsFromFile(\n file: string,\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFile: begin`);\n const filePath = getFilePath(file);\n showSpinner(`Importing ${filePath}...`);\n try {\n const data = fs.readFileSync(filePath, 'utf8');\n const clientData = JSON.parse(data);\n await importOAuth2Clients(clientData, options);\n outcome = true;\n succeedSpinner(`Imported ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing ${filePath}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFile: end`);\n return outcome;\n}\n\n/**\n * Import OAuth2 clients from files\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importOAuth2ClientsFromFiles(\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<boolean> {\n const errors = [];\n try {\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFiles: begin`);\n const names = fs.readdirSync(getWorkingDirectory());\n const files = names\n .filter((name) => name.toLowerCase().endsWith('.oauth2.app.json'))\n .map((name) => getFilePath(name));\n createProgressBar(files.length, 'Importing clients...');\n let total = 0;\n for (const file of files) {\n try {\n const data = fs.readFileSync(file, 'utf8');\n const fileData: OAuth2ClientExportInterface = JSON.parse(data);\n const count = Object.keys(fileData.application).length;\n total += count;\n await importOAuth2Clients(fileData, options);\n updateProgressBar(`Imported ${count} client(s) from ${file}`);\n } catch (error) {\n errors.push(error);\n updateProgressBar(`Error importing client(s) from ${file}`);\n printMessage(error, 'error');\n }\n }\n stopProgressBar(\n `Finished importing ${total} client(s) from ${files.length} file(s).`\n );\n } catch (error) {\n errors.push(error);\n stopProgressBar(`Error importing client(s) from file(s).`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFiles: end`);\n return 0 === errors.length;\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAOpD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,iBAAiB,EACjBC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,iBAAiB,QACZ,kBAAkB;AACzB,SAASC,cAAc,QAAQ,4BAA4B;AAE3D,MAAM;EAAEC,gBAAgB;EAAEC,SAAS;EAAEC,WAAW;EAAEC;AAAoB,CAAC,GACrEhB,KAAK,CAACiB,KAAK;AACb,MAAM;EACJC,iBAAiB;EACjBC,kBAAkB;EAClBC,mBAAmB;EACnBC,kBAAkB;EAClBC,uBAAuB;EACvBC;AACF,CAAC,GAAGvB,KAAK,CAACwB,UAAU,CAACC,MAAM;;AAE3B;AACA;AACA;AACA,OAAO,eAAeC,iBAAiBA,CAACC,IAAI,GAAG,KAAK,EAAE;EACpD,IAAI;IACF,MAAMC,OAAO,GAAG,MAAMV,iBAAiB,CAAC,CAAC;IACzCU,OAAO,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,GAAG,CAACC,aAAa,CAACF,CAAC,CAACC,GAAG,CAAC,CAAC;IAClD,IAAIL,IAAI,EAAE;MACR,MAAMO,KAAK,GAAG9B,WAAW,CAAC,CACxB,WAAW,EACX,QAAQ,EACR,aAAa,EACb,aAAa,EACb,QAAQ,EACR;MACA;MAAA,CACD,CAAC;;MACF,MAAM+B,aAAa,GAAG;QACpBC,kBAAkB,EAAE,YAAY;QAChCC,kBAAkB,EAAE,cAAc;QAClCC,aAAa,EAAE,eAAe;QAC9BC,QAAQ,EAAE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ACoD,QAAQ,EAAEjB,OAAO,CAAC;QAC5C/C,iBAAiB,CAAE,YAAW+E,KAAM,mBAAkBjC,IAAK,EAAC,CAAC;MAC/D,CAAC,CAAC,OAAOH,KAAK,EAAE;QACdgB,MAAM,CAAC5B,IAAI,CAACY,KAAK,CAAC;QAClB3C,iBAAiB,CAAE,kCAAiC8C,IAAK,EAAC,CAAC;QAC3DlD,YAAY,CAAC+C,KAAK,EAAE,OAAO,CAAC;MAC9B;IACF;IACA7C,eAAe,CACZ,sBAAqBgF,KAAM,mBAAkBL,KAAK,CAACb,MAAO,WAC7D,CAAC;EACH,CAAC,CAAC,OAAOjB,KAAK,EAAE;IACdgB,MAAM,CAAC5B,IAAI,CAACY,KAAK,CAAC;IAClB7C,eAAe,CAAE,yCAAwC,CAAC;IAC1DF,YAAY,CAAC+C,KAAK,EAAE,OAAO,CAAC;EAC9B;EACAjD,YAAY,CAAE,uDAAsD,CAAC;EACrE,OAAO,CAAC,KAAKiE,MAAM,CAACC,MAAM;AAC5B"}
|
|
1
|
+
{"version":3,"file":"OAuth2ClientOps.js","names":["frodo","state","fs","createProgressIndicator","createTable","debugMessage","failSpinner","printMessage","showSpinner","stopProgressIndicator","succeedSpinner","updateProgressIndicator","saveJsonToFile","getTypedFilename","titleCase","getFilePath","getWorkingDirectory","utils","readOAuth2Clients","exportOAuth2Client","exportOAuth2Clients","importOAuth2Client","importFirstOAuth2Client","importOAuth2Clients","oauth2oidc","client","listOAuth2Clients","long","clients","sort","a","b","_id","localeCompare","table","grantTypesMap","authorization_code","client_credentials","refresh_token","password","implicit","forEach","push","coreOAuth2ClientConfig","status","clientType","advancedOAuth2ClientConfig","grantTypes","map","type","join","scopes","redirectionUris","toString","error","exportOAuth2ClientToFile","clientId","file","options","useStringArrays","deps","outcome","fileName","filePath","exportData","message","exportOAuth2ClientsToFile","getRealmName","getRealm","exportOAuth2ClientsToFiles","errors","indicatorId","length","importOAuth2ClientFromFile","data","readFileSync","fileData","JSON","parse","importFirstOAuth2ClientFromFile","importOAuth2ClientsFromFile","clientData","importOAuth2ClientsFromFiles","names","readdirSync","files","filter","name","toLowerCase","endsWith","total","count","Object","keys","application"],"sources":["../../src/ops/OAuth2ClientOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Readable } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport type {\n OAuth2ClientExportInterface,\n OAuth2ClientExportOptions,\n OAuth2ClientImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/OAuth2ClientOps';\nimport fs from 'fs';\n\nimport {\n createProgressIndicator,\n createTable,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressIndicator,\n succeedSpinner,\n updateProgressIndicator,\n} from '../utils/Console';\nimport { saveJsonToFile } from '../utils/ExportImportUtils';\n\nconst { getTypedFilename, titleCase, getFilePath, getWorkingDirectory } =\n frodo.utils;\nconst {\n readOAuth2Clients,\n exportOAuth2Client,\n exportOAuth2Clients,\n importOAuth2Client,\n importFirstOAuth2Client,\n importOAuth2Clients,\n} = frodo.oauth2oidc.client;\n\n/**\n * List OAuth2 clients\n */\nexport async function listOAuth2Clients(long = false) {\n try {\n const clients = await readOAuth2Clients();\n clients.sort((a, b) => a._id.localeCompare(b._id));\n if (long) {\n const table = createTable([\n 'Client Id',\n 'Status',\n 'Client Type',\n 'Grant Types',\n 'Scopes',\n 'Redirect URIs',\n // 'Description',\n ]);\n const grantTypesMap = {\n authorization_code: 'Authz Code',\n client_credentials: 'Client Creds',\n refresh_token: 'Refresh Token',\n password: 'ROPC',\n 'urn:ietf:params:oauth:grant-type:uma-ticket': 'UMA',\n implicit: 'Implicit',\n 'urn:ietf:params:oauth:grant-type:device_code': 'Device Code',\n 'urn:ietf:params:oauth:grant-type:saml2-bearer': 'SAML2 Bearer',\n 'urn:openid:params:grant-type:ciba': 'CIBA',\n 'urn:ietf:params:oauth:grant-type:token-exchange': 'Token Exchange',\n 'urn:ietf:params:oauth:grant-type:jwt-bearer': 'JWT Bearer',\n };\n clients.forEach((client) => {\n table.push([\n client._id,\n client.coreOAuth2ClientConfig.status === 'Active'\n ? 'Active'['brightGreen']\n : (client.coreOAuth2ClientConfig.status as string)['brightRed'],\n client.coreOAuth2ClientConfig.clientType,\n (client.advancedOAuth2ClientConfig.grantTypes as Readable<string[]>)\n .map((type) => grantTypesMap[type])\n .join('\\n'),\n (client.coreOAuth2ClientConfig.scopes as Readable<string[]>).join(\n '\\n'\n ),\n (client.coreOAuth2ClientConfig.redirectionUris as string[]).join(\n '\\n'\n ),\n // wordwrap(client.description, 30),\n ]);\n });\n printMessage(table.toString(), 'data');\n } else {\n clients.forEach((client) => {\n printMessage(`${client._id}`, 'data');\n });\n }\n } catch (error) {\n printMessage(`Error listing oauth2 clients - ${error}`, 'error');\n }\n}\n\n/**\n * Export OAuth2 client to file\n * @param {string} clientId client id\n * @param {string} file file name\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportOAuth2ClientToFile(\n clientId: string,\n file: string,\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n) {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientToFile: begin`);\n showSpinner(`Exporting ${clientId}...`);\n try {\n let fileName = getTypedFilename(clientId, 'oauth2.app');\n if (file) {\n fileName = file;\n }\n const filePath = getFilePath(fileName, true);\n const exportData = await exportOAuth2Client(clientId, options);\n saveJsonToFile(exportData, filePath);\n succeedSpinner(`Exported ${clientId} to ${filePath}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting ${clientId}: ${error.message}`);\n }\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientToFile: end`);\n return outcome;\n}\n\n/**\n * Export all OAuth2 clients to file\n * @param {string} file file name\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportOAuth2ClientsToFile(\n file: string,\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientsToFile: begin`);\n showSpinner(`Exporting all clients...`);\n try {\n let fileName = getTypedFilename(\n `all${titleCase(frodo.utils.getRealmName(state.getRealm()))}Applications`,\n 'oauth2.app'\n );\n if (file) {\n fileName = file;\n }\n const filePath = getFilePath(fileName, true);\n const exportData = await exportOAuth2Clients(options);\n saveJsonToFile(exportData, filePath);\n succeedSpinner(`Exported all clients to ${filePath}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting all clients`);\n printMessage(`${error.message}`, 'error');\n }\n debugMessage(\n `cli.OAuth2ClientOps.exportOAuth2ClientsToFile: end [${outcome}]`\n );\n return outcome;\n}\n\n/**\n * Export all OAuth2 clients to separate files\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportOAuth2ClientsToFiles(\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n) {\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientsToFiles: begin`);\n const errors = [];\n let indicatorId: string;\n try {\n const clients = await readOAuth2Clients();\n indicatorId = createProgressIndicator(\n 'determinate',\n clients.length,\n 'Exporting clients...'\n );\n for (const client of clients) {\n const file = getTypedFilename(client._id, 'oauth2.app');\n try {\n const exportData: OAuth2ClientExportInterface =\n await exportOAuth2Client(client._id, options);\n saveJsonToFile(exportData, getFilePath(file, true));\n updateProgressIndicator(indicatorId, `Exported ${client._id}.`);\n } catch (error) {\n errors.push(error);\n updateProgressIndicator(indicatorId, `Error exporting ${client._id}.`);\n }\n }\n stopProgressIndicator(indicatorId, `Export complete.`);\n } catch (error) {\n errors.push(error);\n stopProgressIndicator(indicatorId, `Error exporting client(s) to file(s)`);\n }\n debugMessage(`cli.OAuth2ClientOps.exportOAuth2ClientsToFiles: end`);\n return 0 === errors.length;\n}\n\n/**\n * Import first OAuth2 client from file\n * @param {string} clientId client id\n * @param {string} file file name\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importOAuth2ClientFromFile(\n clientId: string,\n file: string,\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientFromFile: begin`);\n showSpinner(`Importing ${clientId}...`);\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n const fileData = JSON.parse(data);\n await importOAuth2Client(clientId, fileData, options);\n outcome = true;\n succeedSpinner(`Imported ${clientId}.`);\n } catch (error) {\n failSpinner(`Error importing ${clientId}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientFromFile: end`);\n return outcome;\n}\n\n/**\n * Import first OAuth2 client from file\n * @param {string} file file name\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importFirstOAuth2ClientFromFile(\n file: string,\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.importFirstOAuth2ClientFromFile: begin`);\n const filePath = getFilePath(file);\n showSpinner(`Importing ${filePath}...`);\n try {\n const data = fs.readFileSync(filePath, 'utf8');\n const fileData = JSON.parse(data);\n await importFirstOAuth2Client(fileData, options);\n outcome = true;\n succeedSpinner(`Imported ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing ${filePath}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.OAuth2ClientOps.importFirstOAuth2ClientFromFile: end`);\n return outcome;\n}\n\n/**\n * Import OAuth2 clients from file\n * @param {string} file file name\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importOAuth2ClientsFromFile(\n file: string,\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFile: begin`);\n const filePath = getFilePath(file);\n showSpinner(`Importing ${filePath}...`);\n try {\n const data = fs.readFileSync(filePath, 'utf8');\n const clientData = JSON.parse(data);\n await importOAuth2Clients(clientData, options);\n outcome = true;\n succeedSpinner(`Imported ${filePath}.`);\n } catch (error) {\n failSpinner(`Error importing ${filePath}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFile: end`);\n return outcome;\n}\n\n/**\n * Import OAuth2 clients from files\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importOAuth2ClientsFromFiles(\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<boolean> {\n const errors = [];\n let indicatorId: string;\n try {\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFiles: begin`);\n const names = fs.readdirSync(getWorkingDirectory());\n const files = names\n .filter((name) => name.toLowerCase().endsWith('.oauth2.app.json'))\n .map((name) => getFilePath(name));\n indicatorId = createProgressIndicator(\n 'determinate',\n files.length,\n 'Importing clients...'\n );\n let total = 0;\n for (const file of files) {\n try {\n const data = fs.readFileSync(file, 'utf8');\n const fileData: OAuth2ClientExportInterface = JSON.parse(data);\n const count = Object.keys(fileData.application).length;\n total += count;\n await importOAuth2Clients(fileData, options);\n updateProgressIndicator(\n indicatorId,\n `Imported ${count} client(s) from ${file}`\n );\n } catch (error) {\n errors.push(error);\n updateProgressIndicator(\n indicatorId,\n `Error importing client(s) from ${file}`\n );\n printMessage(error, 'error');\n }\n }\n stopProgressIndicator(\n indicatorId,\n `Finished importing ${total} client(s) from ${files.length} file(s).`\n );\n } catch (error) {\n errors.push(error);\n stopProgressIndicator(\n indicatorId,\n `Error importing client(s) from file(s).`\n );\n printMessage(error, 'error');\n }\n debugMessage(`cli.OAuth2ClientOps.importOAuth2ClientsFromFiles: end`);\n return 0 === errors.length;\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;A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