@rockcarver/frodo-cli 0.16.2-1 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -1
- package/esm/cli/cmd_common.js +4 -4
- package/esm/cli/cmd_common.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/journey/journey-describe.js +47 -16
- package/esm/cli/journey/journey-describe.js.map +1 -1
- package/esm/ops/CirclesOfTrustOps.js +21 -0
- package/esm/ops/CirclesOfTrustOps.js.map +1 -1
- package/esm/ops/EmailTemplateOps.js +26 -0
- package/esm/ops/EmailTemplateOps.js.map +1 -1
- package/esm/ops/IdpOps.js +21 -0
- package/esm/ops/IdpOps.js.map +1 -1
- package/esm/ops/JourneyOps.js +203 -5
- package/esm/ops/JourneyOps.js.map +1 -1
- package/esm/ops/NodeOps.js +56 -0
- package/esm/ops/NodeOps.js.map +1 -1
- package/esm/ops/Saml2Ops.js +29 -0
- package/esm/ops/Saml2Ops.js.map +1 -1
- package/esm/ops/ScriptOps.js +27 -0
- package/esm/ops/ScriptOps.js.map +1 -1
- package/esm/ops/ThemeOps.js +21 -0
- package/esm/ops/ThemeOps.js.map +1 -1
- package/esm/utils/Console.js +91 -115
- package/esm/utils/Console.js.map +1 -1
- package/package.json +2 -2
package/esm/ops/JourneyOps.js
CHANGED
|
@@ -15,7 +15,7 @@ const {
|
|
|
15
15
|
/**
|
|
16
16
|
* Get journey classification
|
|
17
17
|
* @param {SingleTreeExportInterface} journey journey export
|
|
18
|
-
* @returns {
|
|
18
|
+
* @returns {string[]} Colored string array of classifications
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
export function getJourneyClassification(journey) {
|
|
@@ -35,6 +35,29 @@ export function getJourneyClassification(journey) {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Get journey classification in markdown
|
|
40
|
+
* @param {SingleTreeExportInterface} journey journey export
|
|
41
|
+
* @returns {string[]} Colored string array of classifications
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
export function getJourneyClassificationMd(journey) {
|
|
45
|
+
return Journey.getJourneyClassification(journey).map(it => {
|
|
46
|
+
switch (it) {
|
|
47
|
+
case Types.JourneyClassification.STANDARD:
|
|
48
|
+
return `:green_circle: \`${it.toString()}\``;
|
|
49
|
+
|
|
50
|
+
case Types.JourneyClassification.CLOUD:
|
|
51
|
+
return `:purple_circle: \`${it.toString()}\``;
|
|
52
|
+
|
|
53
|
+
case Types.JourneyClassification.CUSTOM:
|
|
54
|
+
return `:red_circle: \`${it.toString()}\``;
|
|
55
|
+
|
|
56
|
+
case Types.JourneyClassification.PREMIUM:
|
|
57
|
+
return `:yellow_circle: \`${it.toString()}\``;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
38
61
|
/**
|
|
39
62
|
* Get a one-line description of the tree object
|
|
40
63
|
* @param {TreeSkeleton} treeObj circle of trust object to describe
|
|
@@ -45,6 +68,16 @@ export function getOneLineDescription(treeObj) {
|
|
|
45
68
|
const description = `[${treeObj._id['brightCyan']}]`;
|
|
46
69
|
return description;
|
|
47
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Get a one-line description of the tree object in markdown
|
|
73
|
+
* @param {TreeSkeleton} treeObj circle of trust object to describe
|
|
74
|
+
* @returns {string} a one-line description
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
export function getOneLineDescriptionMd(treeObj) {
|
|
78
|
+
const description = `${treeObj._id}`;
|
|
79
|
+
return description;
|
|
80
|
+
}
|
|
48
81
|
/**
|
|
49
82
|
* Helper function to render a nested list of dependent trees
|
|
50
83
|
* @param {TreeDependencyMapInterface} descendents tree dependency map
|
|
@@ -67,6 +100,35 @@ function describeTreeDescendents(descendents, depth = 0) {
|
|
|
67
100
|
}
|
|
68
101
|
}
|
|
69
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Helper function to render a nested list of dependent trees in markdown
|
|
105
|
+
* @param {TreeDependencyMapInterface} descendents tree dependency map
|
|
106
|
+
* @param {number} depth level of nesting
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
function describeTreeDescendentsMd(descendents, depth = 0) {
|
|
111
|
+
let markdown = '';
|
|
112
|
+
|
|
113
|
+
if (depth || Object.values(descendents)[0].length) {
|
|
114
|
+
// heading
|
|
115
|
+
if (depth === 0) {
|
|
116
|
+
markdown += `## Inner Tree Dependencies (${Object.values(descendents)[0].length})\n`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const indent = Array(depth * 2).fill(' ').join('');
|
|
120
|
+
const [tree] = Object.keys(descendents);
|
|
121
|
+
markdown += `${indent}- ${tree}\n`;
|
|
122
|
+
|
|
123
|
+
for (const descendent of descendents[tree]) {
|
|
124
|
+
markdown += describeTreeDescendentsMd(descendent, depth + 1);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return markdown;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return markdown;
|
|
131
|
+
}
|
|
70
132
|
/**
|
|
71
133
|
* Describe a journey:
|
|
72
134
|
* - Properties, tags, description, name, metadata
|
|
@@ -98,6 +160,11 @@ export async function describeJourney(journeyData, resolveTreeExport = onlineTre
|
|
|
98
160
|
} else {
|
|
99
161
|
nodeTypeMap[nodeData._type._id] = 1;
|
|
100
162
|
}
|
|
163
|
+
} // initialize AM version from file
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
if (!state.default.session.getAmVersion() && (_journeyData$meta = journeyData.meta) !== null && _journeyData$meta !== void 0 && _journeyData$meta.originAmVersion) {
|
|
167
|
+
state.default.session.setAmVersion(journeyData.meta.originAmVersion);
|
|
101
168
|
} // Journey Name
|
|
102
169
|
|
|
103
170
|
|
|
@@ -111,10 +178,6 @@ export async function describeJourney(journeyData, resolveTreeExport = onlineTre
|
|
|
111
178
|
|
|
112
179
|
printMessage(`\nStatus\n${journeyData.tree.enabled === false ? 'disabled'['brightRed'] : 'enabled'['brightGreen']}`); // Classification
|
|
113
180
|
|
|
114
|
-
if (!state.default.session.getAmVersion() && (_journeyData$meta = journeyData.meta) !== null && _journeyData$meta !== void 0 && _journeyData$meta.originAmVersion) {
|
|
115
|
-
state.default.session.setAmVersion(journeyData.meta.originAmVersion);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
181
|
if (state.default.session.getAmVersion()) {
|
|
119
182
|
printMessage(`\nClassification\n${getJourneyClassification(journeyData).join(', ')}`, 'data');
|
|
120
183
|
} // Categories/Tags
|
|
@@ -200,4 +263,139 @@ export async function describeJourney(journeyData, resolveTreeExport = onlineTre
|
|
|
200
263
|
}
|
|
201
264
|
}
|
|
202
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* Describe a journey in markdown:
|
|
268
|
+
* - Properties, tags, description, name, metadata
|
|
269
|
+
* - Inner tree dependency tree
|
|
270
|
+
* - Node type summary
|
|
271
|
+
* - Nodes
|
|
272
|
+
* - Themes
|
|
273
|
+
* - Scripts
|
|
274
|
+
* - Email templates
|
|
275
|
+
* - Social identity providers
|
|
276
|
+
* - SAML2 entity providers
|
|
277
|
+
* - SAML2 circles of trust
|
|
278
|
+
* @param {SingleTreeExportInterface} journeyData journey export object
|
|
279
|
+
* @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function
|
|
280
|
+
*/
|
|
281
|
+
|
|
282
|
+
export async function describeJourneyMd(journeyData, resolveTreeExport = onlineTreeExportResolver) {
|
|
283
|
+
var _journeyData$meta2, _journeyData$tree$uiC2, _journeyData$themes2;
|
|
284
|
+
|
|
285
|
+
const allNodes = { ...journeyData.nodes,
|
|
286
|
+
...journeyData.innerNodes
|
|
287
|
+
};
|
|
288
|
+
const nodeTypeMap = {};
|
|
289
|
+
|
|
290
|
+
for (const nodeData of Object.values(allNodes)) {
|
|
291
|
+
if (nodeTypeMap[nodeData._type._id]) {
|
|
292
|
+
nodeTypeMap[nodeData._type._id] += 1;
|
|
293
|
+
} else {
|
|
294
|
+
nodeTypeMap[nodeData._type._id] = 1;
|
|
295
|
+
}
|
|
296
|
+
} // initialize AM version from file
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
if (!state.default.session.getAmVersion() && (_journeyData$meta2 = journeyData.meta) !== null && _journeyData$meta2 !== void 0 && _journeyData$meta2.originAmVersion) {
|
|
300
|
+
state.default.session.setAmVersion(journeyData.meta.originAmVersion);
|
|
301
|
+
} // Journey Name
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
printMessage(`# ${getOneLineDescriptionMd(journeyData.tree)} - ${journeyData.tree.enabled === false ? ':o: `disabled`' : ':white_check_mark: `enabled`'}, ${getJourneyClassificationMd(journeyData).join(', ')}`, 'data'); // Categories/Tags
|
|
305
|
+
|
|
306
|
+
if ((_journeyData$tree$uiC2 = journeyData.tree.uiConfig) !== null && _journeyData$tree$uiC2 !== void 0 && _journeyData$tree$uiC2.categories && journeyData.tree.uiConfig.categories != '[]') {
|
|
307
|
+
printMessage(`\`${JSON.parse(journeyData.tree.uiConfig.categories).join('`, `')}\``, 'data');
|
|
308
|
+
} // Description
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
if (journeyData.tree.description) {
|
|
312
|
+
printMessage(`\n${journeyData.tree.description}`, 'data');
|
|
313
|
+
} // Journey image
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
printMessage(`\n[]()\n`, 'data'); // Dependency Tree
|
|
317
|
+
|
|
318
|
+
const descendents = await getTreeDescendents(journeyData, resolveTreeExport);
|
|
319
|
+
printMessage(describeTreeDescendentsMd(descendents), 'data'); // Node Types
|
|
320
|
+
|
|
321
|
+
if (Object.entries(nodeTypeMap).length) {
|
|
322
|
+
printMessage(`## Node Types (${Object.entries(nodeTypeMap).length})`, 'data');
|
|
323
|
+
printMessage('| Count | Type | Classification |', 'data');
|
|
324
|
+
printMessage('| -----:| ---- | -------------- |', 'data');
|
|
325
|
+
|
|
326
|
+
for (const [nodeType, count] of Object.entries(nodeTypeMap)) {
|
|
327
|
+
printMessage(`| ${String(count)} | ${nodeType} | ${Node.getNodeClassificationMd(nodeType).join('<br>')} |`, 'data');
|
|
328
|
+
}
|
|
329
|
+
} // Nodes
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
if (Object.entries(allNodes).length) {
|
|
333
|
+
printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');
|
|
334
|
+
printMessage(Node.getTableHeaderMd(), 'data');
|
|
335
|
+
|
|
336
|
+
for (const nodeObj of Object.values(allNodes)) {
|
|
337
|
+
printMessage(`${Node.getTableRowMd(nodeObj, getNodeRef(nodeObj, journeyData))}`, 'data');
|
|
338
|
+
}
|
|
339
|
+
} // Themes
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
if ((_journeyData$themes2 = journeyData.themes) !== null && _journeyData$themes2 !== void 0 && _journeyData$themes2.length) {
|
|
343
|
+
printMessage(`## Themes (${journeyData.themes.length})`, 'data');
|
|
344
|
+
printMessage(Theme.getTableHeaderMd(), 'data');
|
|
345
|
+
|
|
346
|
+
for (const themeData of journeyData.themes) {
|
|
347
|
+
printMessage(`${Theme.getTableRowMd(themeData)}`, 'data');
|
|
348
|
+
}
|
|
349
|
+
} // Scripts
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
if (Object.entries(journeyData.scripts).length) {
|
|
353
|
+
printMessage(`## Scripts (${Object.entries(journeyData.scripts).length})`, 'data');
|
|
354
|
+
printMessage(Script.getTableHeaderMd(), 'data');
|
|
355
|
+
|
|
356
|
+
for (const scriptData of Object.values(journeyData.scripts)) {
|
|
357
|
+
printMessage(`${Script.getTableRowMd(scriptData)}`, 'data');
|
|
358
|
+
}
|
|
359
|
+
} // Email Templates
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
if (Object.entries(journeyData.emailTemplates).length) {
|
|
363
|
+
printMessage(`## Email Templates (${Object.entries(journeyData.emailTemplates).length})`, 'data');
|
|
364
|
+
printMessage(EmailTemplate.getTableHeaderMd(), 'data');
|
|
365
|
+
|
|
366
|
+
for (const templateData of Object.values(journeyData.emailTemplates)) {
|
|
367
|
+
printMessage(`${EmailTemplate.getTableRowMd(templateData)}`, 'data');
|
|
368
|
+
}
|
|
369
|
+
} // Social Identity Providers
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
if (Object.entries(journeyData.socialIdentityProviders).length) {
|
|
373
|
+
printMessage(`## Social Identity Providers (${Object.entries(journeyData.socialIdentityProviders).length})`, 'data');
|
|
374
|
+
printMessage(Idp.getTableHeaderMd(), 'data');
|
|
375
|
+
|
|
376
|
+
for (const socialIdpData of Object.values(journeyData.socialIdentityProviders)) {
|
|
377
|
+
printMessage(`${Idp.getTableRowMd(socialIdpData)}`, 'data');
|
|
378
|
+
}
|
|
379
|
+
} // SAML2 Entity Providers
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
if (Object.entries(journeyData.saml2Entities).length) {
|
|
383
|
+
printMessage(`## SAML2 Entity Providers (${Object.entries(journeyData.saml2Entities).length})`, 'data');
|
|
384
|
+
printMessage(Saml2.getTableHeaderMd(), 'data');
|
|
385
|
+
|
|
386
|
+
for (const entityProviderData of Object.values(journeyData.saml2Entities)) {
|
|
387
|
+
printMessage(`${Saml2.getTableRowMd(entityProviderData)}`, 'data');
|
|
388
|
+
}
|
|
389
|
+
} // SAML2 Circles Of Trust
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
if (Object.entries(journeyData.circlesOfTrust).length) {
|
|
393
|
+
printMessage(`## SAML2 Circles Of Trust (${Object.entries(journeyData.circlesOfTrust).length})`, 'data');
|
|
394
|
+
printMessage(CirclesOfTrust.getTableHeaderMd(), 'data');
|
|
395
|
+
|
|
396
|
+
for (const cotData of Object.values(journeyData.circlesOfTrust)) {
|
|
397
|
+
printMessage(`${CirclesOfTrust.getTableRowMd(cotData)}`, 'data');
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
203
401
|
//# sourceMappingURL=JourneyOps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JourneyOps.js","names":["printMessage","Journey","Types","state","CirclesOfTrust","EmailTemplate","Idp","Node","Saml2","Script","Theme","onlineTreeExportResolver","getTreeDescendents","getNodeRef","getJourneyClassification","journey","map","it","JourneyClassification","STANDARD","toString","CLOUD","CUSTOM","PREMIUM","getOneLineDescription","treeObj","description","_id","describeTreeDescendents","descendents","depth","Object","values","length","indent","Array","fill","join","tree","keys","descendent","describeJourney","journeyData","resolveTreeExport","allNodes","nodes","innerNodes","nodeTypeMap","nodeData","_type","enabled","default","session","getAmVersion","meta","originAmVersion","setAmVersion","uiConfig","categories","JSON","parse","entries","nodeType","count","String","getNodeClassification","nodeObj","themes","themeData","scripts","scriptData","emailTemplates","templateData","socialIdentityProviders","socialIdpData","saml2Entities","entityProviderData","circlesOfTrust","cotData"],"sources":["ops/JourneyOps.ts"],"sourcesContent":["import {\n NodeSkeleton,\n TreeSkeleton,\n} from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport {\n SingleTreeExportInterface,\n TreeDependencyMapInterface,\n TreeExportResolverInterface,\n} from '@rockcarver/frodo-lib/types/ops/OpsTypes';\nimport { printMessage } from '../utils/Console';\nimport { Journey, Types, state } from '@rockcarver/frodo-lib';\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';\n\nconst {\n onlineTreeExportResolver,\n getTreeDescendents,\n getNodeRef,\n} = Journey;\n\n/**\n * Get journey classification\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {stringp[]} Colored string array of classifications\n */\nexport function getJourneyClassification(journey: SingleTreeExportInterface): string[] {\n return Journey.getJourneyClassification(journey).map((it) => {\n switch (it) {\n case Types.JourneyClassification.STANDARD:\n return it.toString()['brightGreen'];\n\n case Types.JourneyClassification.CLOUD:\n return it.toString()['brightMagenta'];\n\n case Types.JourneyClassification.CUSTOM:\n return it.toString()['brightRed'];\n\n case Types.JourneyClassification.PREMIUM:\n return it.toString()['brightYellow'];\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 * 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 * 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 // 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 (\n !state.default.session.getAmVersion() &&\n journeyData.meta?.originAmVersion\n ) {\n state.default.session.setAmVersion(journeyData.meta.originAmVersion);\n }\n if (state.default.session.getAmVersion()) {\n printMessage(\n `\\nClassification\\n${getJourneyClassification(journeyData).join(', ')}`,\n 'data'\n );\n }\n\n // Categories/Tags\n if (journeyData.tree.uiConfig?.categories && journeyData.tree.uiConfig.categories != '[]') {\n printMessage('\\nCategories/Tags', 'data');\n printMessage(\n `${\n JSON.parse(journeyData.tree.uiConfig.categories).join(', ')\n }`,\n 'data'\n );\n }\n\n // Dependency Tree\n const descendents = await getTreeDescendents(journeyData, resolveTreeExport);\n describeTreeDescendents(descendents);\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"],"mappings":"AASA,SAASA,YAAT,QAA6B,kBAA7B;AACA,SAASC,OAAT,EAAkBC,KAAlB,EAAyBC,KAAzB,QAAsC,uBAAtC;AACA,OAAO,KAAKC,cAAZ,MAAgC,qBAAhC;AACA,OAAO,KAAKC,a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AAqCsD,OAArC,CAA8C,EADzC,EAEV,MAFU,CAAZ;IAID;EACF;AACF"}
|
|
1
|
+
{"version":3,"file":"JourneyOps.js","names":["printMessage","Journey","Types","state","CirclesOfTrust","EmailTemplate","Idp","Node","Saml2","Script","Theme","onlineTreeExportResolver","getTreeDescendents","getNodeRef","getJourneyClassification","journey","map","it","JourneyClassification","STANDARD","toString","CLOUD","CUSTOM","PREMIUM","getJourneyClassificationMd","getOneLineDescription","treeObj","description","_id","getOneLineDescriptionMd","describeTreeDescendents","descendents","depth","Object","values","length","indent","Array","fill","join","tree","keys","descendent","describeTreeDescendentsMd","markdown","describeJourney","journeyData","resolveTreeExport","allNodes","nodes","innerNodes","nodeTypeMap","nodeData","_type","default","session","getAmVersion","meta","originAmVersion","setAmVersion","enabled","uiConfig","categories","JSON","parse","entries","nodeType","count","String","getNodeClassification","nodeObj","themes","themeData","scripts","scriptData","emailTemplates","templateData","socialIdentityProviders","socialIdpData","saml2Entities","entityProviderData","circlesOfTrust","cotData","describeJourneyMd","getNodeClassificationMd","getTableHeaderMd","getTableRowMd"],"sources":["ops/JourneyOps.ts"],"sourcesContent":["import {\n NodeSkeleton,\n TreeSkeleton,\n} from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport {\n SingleTreeExportInterface,\n TreeDependencyMapInterface,\n TreeExportResolverInterface,\n} from '@rockcarver/frodo-lib/types/ops/OpsTypes';\nimport { printMessage } from '../utils/Console';\nimport { Journey, Types, state } from '@rockcarver/frodo-lib';\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';\n\nconst { onlineTreeExportResolver, getTreeDescendents, getNodeRef } = Journey;\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): string[] {\n return Journey.getJourneyClassification(journey).map((it) => {\n switch (it) {\n case Types.JourneyClassification.STANDARD:\n return it.toString()['brightGreen'];\n\n case Types.JourneyClassification.CLOUD:\n return it.toString()['brightMagenta'];\n\n case Types.JourneyClassification.CUSTOM:\n return it.toString()['brightRed'];\n\n case Types.JourneyClassification.PREMIUM:\n return it.toString()['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 Journey.getJourneyClassification(journey).map((it) => {\n switch (it) {\n case Types.JourneyClassification.STANDARD:\n return `:green_circle: \\`${it.toString()}\\``;\n\n case Types.JourneyClassification.CLOUD:\n return `:purple_circle: \\`${it.toString()}\\``;\n\n case Types.JourneyClassification.CUSTOM:\n return `:red_circle: \\`${it.toString()}\\``;\n\n case Types.JourneyClassification.PREMIUM:\n return `:yellow_circle: \\`${it.toString()}\\``;\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 (\n !state.default.session.getAmVersion() &&\n journeyData.meta?.originAmVersion\n ) {\n state.default.session.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.default.session.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 const descendents = await getTreeDescendents(journeyData, resolveTreeExport);\n describeTreeDescendents(descendents);\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 (\n !state.default.session.getAmVersion() &&\n journeyData.meta?.originAmVersion\n ) {\n state.default.session.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":"AASA,SAASA,YAAT,QAA6B,kBAA7B;AACA,SAASC,OAAT,EAAkBC,KAAlB,EAAyBC,KAAzB,QAAsC,uBAAtC;AACA,OAAO,KAAKC,cAAZ,MAAgC,qBAAhC;AACA,OAAO,KAAKC,aAAZ,MAA+B,oBAA/B;AACA,OAAO,KAAKC,GAAZ,MAAqB,UAArB;AACA,OAAO,KAAKC,IAAZ,MAAsB,WAAtB;AACA,OAAO,KAAKC,KAAZ,MAAuB,YAAvB;AACA,OAAO,KAAKC,MAAZ,MAAwB,aAAxB;AACA,OAAO,KAAKC,KAAZ,MAAuB,YAAvB;AAEA,MAAM;EAAEC,wBAAF;EAA4BC,kBAA5B;EAAgDC;AAAhD,IAA+DZ,OAArE;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASa,wBAAT,CACLC,OADK,EAEK;EACV,OAAOd,OAAO,CAACa,wBAAR,CAAiCC,OAAjC,EAA0CC,GAA1C,CAA+CC,EAAD,IAAQ;IAC3D,QAAQA,EAAR;MACE,KAAKf,KAAK,CAACgB,qBAAN,CAA4BC,QAAjC;QACE,OAAOF,EAAE,CAACG,QAAH,GAAc,aAAd,CAAP;;MAEF,KAAKlB,KAAK,CAACgB,qBAAN,CAA4BG,KAAjC;QACE,OAAOJ,EAAE,CAACG,QAAH,GAAc,eAAd,CAAP;;MAEF,KAAKlB,KAAK,CAACgB,qBAAN,CAA4BI,MAAjC;QACE,OAAOL,EAAE,CAACG,QAAH,GAAc,WAAd,CAAP;;MAEF,KAAKlB,KAAK,CAACgB,qBAAN,CAA4BK,OAAjC;QACE,OAAON,EAA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AACgC,OAAP,CAAenB,WAAW,CAACmC,cAA3B,EAA2C9C,MAA/C,EAAuD;IACrDnC,YAAY,CACT,8BACCiC,MAAM,CAACgC,OAAP,CAAenB,WAAW,CAACmC,cAA3B,EAA2C9C,MAC5C,GAHS,EAIV,MAJU,CAAZ;IAMAnC,YAAY,CAACI,cAAc,CAACiF,gBAAf,EAAD,EAAoC,MAApC,CAAZ;;IACA,KAAK,MAAMH,OAAX,IAAsBjD,MAAM,CAACC,MAAP,CAAcY,WAAW,CAACmC,cAA1B,CAAtB,EAAiE;MAC/DjF,YAAY,CAAE,GAAEI,cAAc,CAACkF,aAAf,CAA6BJ,OAA7B,CAAsC,EAA1C,EAA6C,MAA7C,CAAZ;IACD;EACF;AACF"}
|
package/esm/ops/NodeOps.js
CHANGED
|
@@ -22,6 +22,29 @@ export function getNodeClassification(nodeType) {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Get node classification in markdown
|
|
27
|
+
* @param {string} nodeType node type
|
|
28
|
+
* @returns {stringp[]} Colored string array of classifications
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export function getNodeClassificationMd(nodeType) {
|
|
32
|
+
return Node.getNodeClassification(nodeType).map(it => {
|
|
33
|
+
switch (it) {
|
|
34
|
+
case Types.NodeClassification.STANDARD:
|
|
35
|
+
return `:green_circle: \`${it.toString()}\``;
|
|
36
|
+
|
|
37
|
+
case Types.NodeClassification.CLOUD:
|
|
38
|
+
return `:purple_circle: \`${it.toString()}\``;
|
|
39
|
+
|
|
40
|
+
case Types.NodeClassification.CUSTOM:
|
|
41
|
+
return `:red_circle: \`${it.toString()}\``;
|
|
42
|
+
|
|
43
|
+
case Types.NodeClassification.PREMIUM:
|
|
44
|
+
return `:yellow_circle: \`${it.toString()}\``;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
25
48
|
/**
|
|
26
49
|
* Get a one-line description of the node
|
|
27
50
|
* @param {NodeSkeleton} nodeObj node object to describe
|
|
@@ -33,4 +56,37 @@ export function getOneLineDescription(nodeObj, nodeRef) {
|
|
|
33
56
|
const description = `[${nodeObj._id['brightCyan']}] (${getNodeClassification(nodeObj._type._id).join(', ')}) ${nodeObj._type._id}${nodeRef ? ' - ' + (nodeRef === null || nodeRef === void 0 ? void 0 : nodeRef.displayName) : ''}`;
|
|
34
57
|
return description;
|
|
35
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Get a one-line description of the node in markdown
|
|
61
|
+
* @param {NodeSkeleton} nodeObj node object to describe
|
|
62
|
+
* @param {NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface} nodeRef node reference object
|
|
63
|
+
* @returns {string} a one-line description in markdown
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
export function getOneLineDescriptionMd(nodeObj, nodeRef) {
|
|
67
|
+
const description = `${nodeObj._id} (${getNodeClassificationMd(nodeObj._type._id).join(', ')}) ${nodeObj._type._id}${nodeRef ? ' - ' + (nodeRef === null || nodeRef === void 0 ? void 0 : nodeRef.displayName) : ''}`;
|
|
68
|
+
return description;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get markdown table header
|
|
72
|
+
* @returns {string} markdown table header
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
export function getTableHeaderMd() {
|
|
76
|
+
let markdown = '';
|
|
77
|
+
markdown += '| Display Name | Type | Classification | Id |\n';
|
|
78
|
+
markdown += '| ------------ | ---- | -------------- | ---|';
|
|
79
|
+
return markdown;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get a table-row of the node in markdown
|
|
83
|
+
* @param {NodeSkeleton} nodeObj node object to describe
|
|
84
|
+
* @param {NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface} nodeRef node reference object
|
|
85
|
+
* @returns {string} a table-row of the node in markdown
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export function getTableRowMd(nodeObj, nodeRef) {
|
|
89
|
+
const row = `| ${nodeRef ? nodeRef.displayName : ''} | ${nodeObj._type._id} | ${getNodeClassificationMd(nodeObj._type._id).join('<br>')} | \`${nodeObj._id}\` |`;
|
|
90
|
+
return row;
|
|
91
|
+
}
|
|
36
92
|
//# sourceMappingURL=NodeOps.js.map
|
package/esm/ops/NodeOps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeOps.js","names":["Node","Types","getNodeClassification","nodeType","map","it","NodeClassification","STANDARD","toString","CLOUD","CUSTOM","PREMIUM","getOneLineDescription","nodeObj","nodeRef","description","_id","_type","join","displayName"],"sources":["ops/NodeOps.ts"],"sourcesContent":["import {\n InnerNodeRefSkeletonInterface,\n NodeRefSkeletonInterface,\n NodeSkeleton,\n} from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport { Node, Types } from '@rockcarver/frodo-lib';\n\n/**\n * Get node classification\n * @param {string} nodeType node type\n * @returns {stringp[]} Colored string array of classifications\n */\nexport function getNodeClassification(nodeType: string): string[] {\n return Node.getNodeClassification(nodeType).map((it) => {\n switch (it) {\n case Types.NodeClassification.STANDARD:\n return it.toString()['brightGreen'];\n\n case Types.NodeClassification.CLOUD:\n return it.toString()['brightMagenta'];\n\n case Types.NodeClassification.CUSTOM:\n return it.toString()['brightRed'];\n\n case Types.NodeClassification.PREMIUM:\n return it.toString()['brightYellow'];\n }\n });\n}\n\n/**\n * Get a one-line description of the node\n * @param {NodeSkeleton} nodeObj node object to describe\n * @param {NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface} nodeRef node reference object\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(\n nodeObj: NodeSkeleton,\n nodeRef?: NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface\n): string {\n const description = `[${nodeObj._id['brightCyan']}] (${getNodeClassification(\n nodeObj._type._id\n ).join(', ')}) ${nodeObj._type._id}${\n nodeRef ? ' - ' + nodeRef?.displayName : ''\n }`;\n return description;\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,KAAf,QAA4B,uBAA5B;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,qBAAT,CAA+BC,QAA/B,EAA2D;EAChE,OAAOH,IAAI,CAACE,qBAAL,CAA2BC,QAA3B,EAAqCC,GAArC,CAA0CC,EAAD,IAAQ;IACtD,QAAQA,EAAR;MACE,KAAKJ,KAAK,CAACK,kBAAN,CAAyBC,QAA9B;QACE,OAAOF,EAAE,CAACG,QAAH,GAAc,aAAd,CAAP;;MAEF,KAAKP,KAAK,CAACK,kBAAN,CAAyBG,KAA9B;QACE,OAAOJ,EAAE,CAACG,QAAH,GAAc,eAAd,CAAP;;MAEF,KAAKP,KAAK,CAACK,kBAAN,CAAyBI,MAA9B;QACE,OAAOL,EAAE,CAACG,QAAH,GAAc,WAAd,CAAP;;MAEF,KAAKP,KAAK,CAACK,kBAAN,CAAyBK,OAA9B;QACE,OAAON,EAAE,CAACG,QAAH,GAAc,cAAd,CAAP;IAXJ;EAaD,CAdM,CAAP;AAeD;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"NodeOps.js","names":["Node","Types","getNodeClassification","nodeType","map","it","NodeClassification","STANDARD","toString","CLOUD","CUSTOM","PREMIUM","getNodeClassificationMd","getOneLineDescription","nodeObj","nodeRef","description","_id","_type","join","displayName","getOneLineDescriptionMd","getTableHeaderMd","markdown","getTableRowMd","row"],"sources":["ops/NodeOps.ts"],"sourcesContent":["import {\n InnerNodeRefSkeletonInterface,\n NodeRefSkeletonInterface,\n NodeSkeleton,\n} from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport { Node, Types } from '@rockcarver/frodo-lib';\n\n/**\n * Get node classification\n * @param {string} nodeType node type\n * @returns {stringp[]} Colored string array of classifications\n */\nexport function getNodeClassification(nodeType: string): string[] {\n return Node.getNodeClassification(nodeType).map((it) => {\n switch (it) {\n case Types.NodeClassification.STANDARD:\n return it.toString()['brightGreen'];\n\n case Types.NodeClassification.CLOUD:\n return it.toString()['brightMagenta'];\n\n case Types.NodeClassification.CUSTOM:\n return it.toString()['brightRed'];\n\n case Types.NodeClassification.PREMIUM:\n return it.toString()['brightYellow'];\n }\n });\n}\n\n/**\n * Get node classification in markdown\n * @param {string} nodeType node type\n * @returns {stringp[]} Colored string array of classifications\n */\nexport function getNodeClassificationMd(nodeType: string): string[] {\n return Node.getNodeClassification(nodeType).map((it) => {\n switch (it) {\n case Types.NodeClassification.STANDARD:\n return `:green_circle: \\`${it.toString()}\\``;\n\n case Types.NodeClassification.CLOUD:\n return `:purple_circle: \\`${it.toString()}\\``;\n\n case Types.NodeClassification.CUSTOM:\n return `:red_circle: \\`${it.toString()}\\``;\n\n case Types.NodeClassification.PREMIUM:\n return `:yellow_circle: \\`${it.toString()}\\``;\n }\n });\n}\n\n/**\n * Get a one-line description of the node\n * @param {NodeSkeleton} nodeObj node object to describe\n * @param {NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface} nodeRef node reference object\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(\n nodeObj: NodeSkeleton,\n nodeRef?: NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface\n): string {\n const description = `[${nodeObj._id['brightCyan']}] (${getNodeClassification(\n nodeObj._type._id\n ).join(', ')}) ${nodeObj._type._id}${\n nodeRef ? ' - ' + nodeRef?.displayName : ''\n }`;\n return description;\n}\n\n/**\n * Get a one-line description of the node in markdown\n * @param {NodeSkeleton} nodeObj node object to describe\n * @param {NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface} nodeRef node reference object\n * @returns {string} a one-line description in markdown\n */\nexport function getOneLineDescriptionMd(\n nodeObj: NodeSkeleton,\n nodeRef?: NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface\n): string {\n const description = `${nodeObj._id} (${getNodeClassificationMd(\n nodeObj._type._id\n ).join(', ')}) ${nodeObj._type._id}${\n nodeRef ? ' - ' + nodeRef?.displayName : ''\n }`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Display Name | Type | Classification | Id |\\n';\n markdown += '| ------------ | ---- | -------------- | ---|';\n return markdown;\n}\n\n/**\n * Get a table-row of the node in markdown\n * @param {NodeSkeleton} nodeObj node object to describe\n * @param {NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface} nodeRef node reference object\n * @returns {string} a table-row of the node in markdown\n */\nexport function getTableRowMd(\n nodeObj: NodeSkeleton,\n nodeRef?: NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface\n): string {\n const row = `| ${\n nodeRef ? nodeRef.displayName : ''\n } | ${nodeObj._type._id} | ${getNodeClassificationMd(\n nodeObj._type._id\n ).join('<br>')} | \\`${nodeObj._id}\\` |`;\n return row;\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,KAAf,QAA4B,uBAA5B;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,qBAAT,CAA+BC,QAA/B,EAA2D;EAChE,OAAOH,IAAI,CAACE,qBAAL,CAA2BC,QAA3B,EAAqCC,GAArC,CAA0CC,EAAD,IAAQ;IACtD,QAAQA,EAAR;MACE,KAAKJ,KAAK,CAACK,kBAAN,CAAyBC,QAA9B;QACE,OAAOF,EAAE,CAACG,QAAH,GAAc,aAAd,CAAP;;MAEF,KAAKP,KAAK,CAACK,kBAAN,CAAyBG,KAA9B;QACE,OAAOJ,EAAE,CAACG,QAAH,GAAc,eAAd,CAAP;;MAEF,KAAKP,KAAK,CAACK,kBAAN,CAAyBI,MAA9B;QACE,OAAOL,EAAE,CAACG,QAAH,GAAc,WAAd,CAAP;;MAEF,KAAKP,KAAK,CAACK,kBAAN,CAAyBK,OAA9B;QACE,OAAON,EAAE,CAACG,QAAH,GAAc,cAAd,CAAP;IAXJ;EAaD,CAdM,CAAP;AAeD;AAED;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,uBAAT,CAAiCT,QAAjC,EAA6D;EAClE,O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AAO,GAAG,SAAQA,OAAR,aAAQA,OAAR,uBAAQA,OAAO,CAAEK,WAAjB,CAAH,GAAkC,EAC1C,EAJD;EAKA,OAAOJ,WAAP;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASM,gBAAT,GAAoC;EACzC,IAAIC,QAAQ,GAAG,EAAf;EACAA,QAAQ,IAAI,iDAAZ;EACAA,QAAQ,IAAI,+CAAZ;EACA,OAAOA,QAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,CACLV,OADK,EAELC,OAFK,EAGG;EACR,MAAMU,GAAG,GAAI,KACXV,OAAO,GAAGA,OAAO,CAACK,WAAX,GAAyB,EACjC,MAAKN,OAAO,CAACI,KAAR,CAAcD,GAAI,MAAKL,uBAAuB,CAClDE,OAAO,CAACI,KAAR,CAAcD,GADoC,CAAvB,CAE3BE,IAF2B,CAEtB,MAFsB,CAEd,QAAOL,OAAO,CAACG,GAAI,MAJlC;EAKA,OAAOQ,GAAP;AACD"}
|
package/esm/ops/Saml2Ops.js
CHANGED
|
@@ -20,4 +20,33 @@ export function getOneLineDescription(saml2ProviderObj) {
|
|
|
20
20
|
const description = `[${saml2ProviderObj.entityId['brightCyan']}]${' (' + saml2ProviderObj.entityLocation}${roles.length ? ' ' + roles.join(', ') + ')' : ')'}`;
|
|
21
21
|
return description;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Get markdown table header
|
|
25
|
+
* @returns {string} markdown table header
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
export function getTableHeaderMd() {
|
|
29
|
+
let markdown = '';
|
|
30
|
+
markdown += '| Entity Id | Location | Role(s) |\n';
|
|
31
|
+
markdown += '| --------- | -------- | ------- |';
|
|
32
|
+
return markdown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get a table-row of the saml2 provider in markdown
|
|
36
|
+
* @param {Saml2ProviderSkeleton} saml2ProviderObj saml2 provider object to describe
|
|
37
|
+
* @returns {string} a table-row of the saml2 provider in markdown
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
export function getTableRowMd(saml2ProviderObj) {
|
|
41
|
+
const roles = [];
|
|
42
|
+
|
|
43
|
+
for (const [key, value] of Object.entries(roleMap)) {
|
|
44
|
+
if (saml2ProviderObj[key]) {
|
|
45
|
+
roles.push(value);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const row = `| ${saml2ProviderObj.entityId} | ${saml2ProviderObj.entityLocation} | ${roles.length ? roles.join(', ') : ''} |`;
|
|
50
|
+
return row;
|
|
51
|
+
}
|
|
23
52
|
//# sourceMappingURL=Saml2Ops.js.map
|
package/esm/ops/Saml2Ops.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Saml2Ops.js","names":["Saml2","roleMap","getOneLineDescription","saml2ProviderObj","roles","key","value","Object","entries","push","description","entityId","entityLocation","length","join"],"sources":["ops/Saml2Ops.ts"],"sourcesContent":["import { Saml2ProviderSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport { Saml2 } from '@rockcarver/frodo-lib';\n\nconst { roleMap } = Saml2;\n\n/**\n * Get a one-line description of the saml2 provider object\n * @param {Saml2ProviderSkeleton} saml2ProviderObj saml2 provider object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(\n saml2ProviderObj: Saml2ProviderSkeleton\n): string {\n const roles: string[] = [];\n for (const [key, value] of Object.entries(roleMap)) {\n if (saml2ProviderObj[key]) {\n roles.push(value);\n }\n }\n const description = `[${saml2ProviderObj.entityId['brightCyan']}]${\n ' (' + saml2ProviderObj.entityLocation\n }${roles.length ? ' ' + roles.join(', ') + ')' : ')'}`;\n return description;\n}\n"],"mappings":"AACA,SAASA,KAAT,QAAsB,uBAAtB;AAEA,MAAM;EAAEC;AAAF,IAAcD,KAApB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,qBAAT,CACLC,gBADK,EAEG;EACR,MAAMC,KAAe,GAAG,EAAxB;;EACA,KAAK,MAAM,CAACC,GAAD,EAAMC,KAAN,CAAX,IAA2BC,MAAM,CAACC,OAAP,CAAeP,OAAf,CAA3B,EAAoD;IAClD,IAAIE,gBAAgB,CAACE,GAAD,CAApB,EAA2B;MACzBD,KAAK,CAACK,IAAN,CAAWH,KAAX;IACD;EACF;;EACD,MAAMI,WAAW,GAAI,IAAGP,gBAAgB,CAACQ,QAAjB,CAA0B,YAA1B,CAAwC,IAC9D,OAAOR,gBAAgB,CAACS,cACzB,GAAER,KAAK,CAACS,MAAN,GAAe,MAAMT,KAAK,CAACU,IAAN,CAAW,IAAX,CAAN,GAAyB,GAAxC,GAA8C,GAAI,EAFrD;EAGA,OAAOJ,WAAP;AACD"}
|
|
1
|
+
{"version":3,"file":"Saml2Ops.js","names":["Saml2","roleMap","getOneLineDescription","saml2ProviderObj","roles","key","value","Object","entries","push","description","entityId","entityLocation","length","join","getTableHeaderMd","markdown","getTableRowMd","row"],"sources":["ops/Saml2Ops.ts"],"sourcesContent":["import { Saml2ProviderSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport { Saml2 } from '@rockcarver/frodo-lib';\n\nconst { roleMap } = Saml2;\n\n/**\n * Get a one-line description of the saml2 provider object\n * @param {Saml2ProviderSkeleton} saml2ProviderObj saml2 provider object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(\n saml2ProviderObj: Saml2ProviderSkeleton\n): string {\n const roles: string[] = [];\n for (const [key, value] of Object.entries(roleMap)) {\n if (saml2ProviderObj[key]) {\n roles.push(value);\n }\n }\n const description = `[${saml2ProviderObj.entityId['brightCyan']}]${\n ' (' + saml2ProviderObj.entityLocation\n }${roles.length ? ' ' + roles.join(', ') + ')' : ')'}`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Entity Id | Location | Role(s) |\\n';\n markdown += '| --------- | -------- | ------- |';\n return markdown;\n}\n\n/**\n * Get a table-row of the saml2 provider in markdown\n * @param {Saml2ProviderSkeleton} saml2ProviderObj saml2 provider object to describe\n * @returns {string} a table-row of the saml2 provider in markdown\n */\nexport function getTableRowMd(saml2ProviderObj: Saml2ProviderSkeleton): string {\n const roles: string[] = [];\n for (const [key, value] of Object.entries(roleMap)) {\n if (saml2ProviderObj[key]) {\n roles.push(value);\n }\n }\n const row = `| ${saml2ProviderObj.entityId} | ${saml2ProviderObj.entityLocation} | ${roles.length ? roles.join(', ') : ''} |`;\n return row;\n}\n"],"mappings":"AACA,SAASA,KAAT,QAAsB,uBAAtB;AAEA,MAAM;EAAEC;AAAF,IAAcD,KAApB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,qBAAT,CACLC,gBADK,EAEG;EACR,MAAMC,KAAe,GAAG,EAAxB;;EACA,KAAK,MAAM,CAACC,GAAD,EAAMC,KAAN,CAAX,IAA2BC,MAAM,CAACC,OAAP,CAAeP,OAAf,CAA3B,EAAoD;IAClD,IAAIE,gBAAgB,CAACE,GAAD,CAApB,EAA2B;MACzBD,KAAK,CAACK,IAAN,CAAWH,KAAX;IACD;EACF;;EACD,MAAMI,WAAW,GAAI,IAAGP,gBAAgB,CAACQ,QAAjB,CAA0B,YAA1B,CAAwC,IAC9D,OAAOR,gBAAgB,CAACS,cACzB,GAAER,KAAK,CAACS,MAAN,GAAe,MAAMT,KAAK,CAACU,IAAN,CAAW,IAAX,CAAN,GAAyB,GAAxC,GAA8C,GAAI,EAFrD;EAGA,OAAOJ,WAAP;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASK,gBAAT,GAAoC;EACzC,IAAIC,QAAQ,GAAG,EAAf;EACAA,QAAQ,IAAI,sCAAZ;EACAA,QAAQ,IAAI,oCAAZ;EACA,OAAOA,QAAP;AACD;AAED;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,CAAuBd,gBAAvB,EAAwE;EAC7E,MAAMC,KAAe,GAAG,EAAxB;;EACA,KAAK,MAAM,CAACC,GAAD,EAAMC,KAAN,CAAX,IAA2BC,MAAM,CAACC,OAAP,CAAeP,OAAf,CAA3B,EAAoD;IAClD,IAAIE,gBAAgB,CAACE,GAAD,CAApB,EAA2B;MACzBD,KAAK,CAACK,IAAN,CAAWH,KAAX;IACD;EACF;;EACD,MAAMY,GAAG,GAAI,KAAIf,gBAAgB,CAACQ,QAAS,MAAKR,gBAAgB,CAACS,cAAe,MAAKR,KAAK,CAACS,MAAN,GAAeT,KAAK,CAACU,IAAN,CAAW,IAAX,CAAf,GAAkC,EAAG,IAA1H;EACA,OAAOI,GAAP;AACD"}
|
package/esm/ops/ScriptOps.js
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
|
+
import { ExportImportUtils } from '@rockcarver/frodo-lib';
|
|
1
2
|
/**
|
|
2
3
|
* Get a one-line description of the script object
|
|
3
4
|
* @param {ScriptSkeleton} scriptObj script object to describe
|
|
4
5
|
* @returns {string} a one-line description
|
|
5
6
|
*/
|
|
7
|
+
|
|
6
8
|
export function getOneLineDescription(scriptObj) {
|
|
7
9
|
const description = `[${scriptObj._id['brightCyan']}] ${scriptObj.context} - ${scriptObj.name}`;
|
|
8
10
|
return description;
|
|
9
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Get markdown table header
|
|
14
|
+
* @returns {string} markdown table header
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export function getTableHeaderMd() {
|
|
18
|
+
let markdown = '';
|
|
19
|
+
markdown += '| Name | Language | Type | Id |\n';
|
|
20
|
+
markdown += '| ---- | -------- | ---- | ---|';
|
|
21
|
+
return markdown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get a one-line description of the script object in markdown
|
|
25
|
+
* @param {ScriptSkeleton} scriptObj script object to describe
|
|
26
|
+
* @returns {string} markdown table row
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export function getTableRowMd(scriptObj) {
|
|
30
|
+
const langMap = {
|
|
31
|
+
JAVASCRIPT: 'JavaSscript',
|
|
32
|
+
GROOVY: 'Groovy'
|
|
33
|
+
};
|
|
34
|
+
const description = `| ${scriptObj.name} | ${langMap[scriptObj.language]} | ${ExportImportUtils.titleCase(scriptObj.context.split('_').join(' '))} | \`${scriptObj._id}\` |`;
|
|
35
|
+
return description;
|
|
36
|
+
}
|
|
10
37
|
//# sourceMappingURL=ScriptOps.js.map
|
package/esm/ops/ScriptOps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptOps.js","names":["getOneLineDescription","scriptObj","description","_id","context","name"],"sources":["ops/ScriptOps.ts"],"sourcesContent":["import { ScriptSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\n\n/**\n * Get a one-line description of the script object\n * @param {ScriptSkeleton} scriptObj script object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(scriptObj: ScriptSkeleton): string {\n const description = `[${scriptObj._id['brightCyan']}] ${scriptObj.context} - ${scriptObj.name}`;\n return description;\n}\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"ScriptOps.js","names":["ExportImportUtils","getOneLineDescription","scriptObj","description","_id","context","name","getTableHeaderMd","markdown","getTableRowMd","langMap","JAVASCRIPT","GROOVY","language","titleCase","split","join"],"sources":["ops/ScriptOps.ts"],"sourcesContent":["import { ScriptSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport { ExportImportUtils } from '@rockcarver/frodo-lib';\n\n/**\n * Get a one-line description of the script object\n * @param {ScriptSkeleton} scriptObj script object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(scriptObj: ScriptSkeleton): string {\n const description = `[${scriptObj._id['brightCyan']}] ${scriptObj.context} - ${scriptObj.name}`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Name | Language | Type | Id |\\n';\n markdown += '| ---- | -------- | ---- | ---|';\n return markdown;\n}\n\n/**\n * Get a one-line description of the script object in markdown\n * @param {ScriptSkeleton} scriptObj script object to describe\n * @returns {string} markdown table row\n */\nexport function getTableRowMd(scriptObj: ScriptSkeleton): string {\n const langMap = { JAVASCRIPT: 'JavaSscript', GROOVY: 'Groovy' };\n const description = `| ${scriptObj.name} | ${langMap[scriptObj.language]} | ${ExportImportUtils.titleCase(\n scriptObj.context.split('_').join(' ')\n )} | \\`${scriptObj._id}\\` |`;\n return description;\n}\n"],"mappings":"AACA,SAASA,iBAAT,QAAkC,uBAAlC;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,qBAAT,CAA+BC,SAA/B,EAAkE;EACvE,MAAMC,WAAW,GAAI,IAAGD,SAAS,CAACE,GAAV,CAAc,YAAd,CAA4B,KAAIF,SAAS,CAACG,OAAQ,MAAKH,SAAS,CAACI,IAAK,EAA9F;EACA,OAAOH,WAAP;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASI,gBAAT,GAAoC;EACzC,IAAIC,QAAQ,GAAG,EAAf;EACAA,QAAQ,IAAI,mCAAZ;EACAA,QAAQ,IAAI,iCAAZ;EACA,OAAOA,QAAP;AACD;AAED;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,CAAuBP,SAAvB,EAA0D;EAC/D,MAAMQ,OAAO,GAAG;IAAEC,UAAU,EAAE,aAAd;IAA6BC,MAAM,EAAE;EAArC,CAAhB;EACA,MAAMT,WAAW,GAAI,KAAID,SAAS,CAACI,IAAK,MAAKI,OAAO,CAACR,SAAS,CAACW,QAAX,CAAqB,MAAKb,iBAAiB,CAACc,SAAlB,CAC5EZ,SAAS,CAACG,OAAV,CAAkBU,KAAlB,CAAwB,GAAxB,EAA6BC,IAA7B,CAAkC,GAAlC,CAD4E,CAE5E,QAAOd,SAAS,CAACE,GAAI,MAFvB;EAGA,OAAOD,WAAP;AACD"}
|
package/esm/ops/ThemeOps.js
CHANGED
|
@@ -7,4 +7,25 @@ export function getOneLineDescription(themeObj) {
|
|
|
7
7
|
const description = `[${themeObj._id['brightCyan']}] ${themeObj.name}${themeObj.linkedTrees ? ' (' + themeObj.linkedTrees.join(', ')['brightCyan'] + ')' : ''}`;
|
|
8
8
|
return description;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Get markdown table header
|
|
12
|
+
* @returns {string} markdown table header
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export function getTableHeaderMd() {
|
|
16
|
+
let markdown = '';
|
|
17
|
+
markdown += '| Name | Linked Journey(s) | Id |\n';
|
|
18
|
+
markdown += '| ---- | ----------------- | ---|';
|
|
19
|
+
return markdown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get a table-row of the theme in markdown
|
|
23
|
+
* @param {ThemeSkeleton} themeObj theme object to describe
|
|
24
|
+
* @returns {string} a table-row of the theme in markdown
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export function getTableRowMd(themeObj) {
|
|
28
|
+
const row = `| ${themeObj.name} | ${themeObj.linkedTrees ? themeObj.linkedTrees.join(', ') : ''} | \`${themeObj._id}\` |`;
|
|
29
|
+
return row;
|
|
30
|
+
}
|
|
10
31
|
//# sourceMappingURL=ThemeOps.js.map
|
package/esm/ops/ThemeOps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeOps.js","names":["getOneLineDescription","themeObj","description","_id","name","linkedTrees","join"],"sources":["ops/ThemeOps.ts"],"sourcesContent":["import { ThemeSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\n\n/**\n * Get a one-line description of the theme\n * @param {ThemeSkeleton} themeObj theme object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(themeObj: ThemeSkeleton): string {\n const description = `[${themeObj._id['brightCyan']}] ${
|
|
1
|
+
{"version":3,"file":"ThemeOps.js","names":["getOneLineDescription","themeObj","description","_id","name","linkedTrees","join","getTableHeaderMd","markdown","getTableRowMd","row"],"sources":["ops/ThemeOps.ts"],"sourcesContent":["import { ThemeSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\n\n/**\n * Get a one-line description of the theme\n * @param {ThemeSkeleton} themeObj theme object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(themeObj: ThemeSkeleton): string {\n const description = `[${themeObj._id['brightCyan']}] ${themeObj.name}${\n themeObj.linkedTrees\n ? ' (' + themeObj.linkedTrees.join(', ')['brightCyan'] + ')'\n : ''\n }`;\n return description;\n}\n\n/**\n * Get markdown table header\n * @returns {string} markdown table header\n */\nexport function getTableHeaderMd(): string {\n let markdown = '';\n markdown += '| Name | Linked Journey(s) | Id |\\n';\n markdown += '| ---- | ----------------- | ---|';\n return markdown;\n}\n\n/**\n * Get a table-row of the theme in markdown\n * @param {ThemeSkeleton} themeObj theme object to describe\n * @returns {string} a table-row of the theme in markdown\n */\nexport function getTableRowMd(themeObj: ThemeSkeleton): string {\n const row = `| ${themeObj.name} | ${\n themeObj.linkedTrees ? themeObj.linkedTrees.join(', ') : ''\n } | \\`${themeObj._id}\\` |`;\n return row;\n}\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,qBAAT,CAA+BC,QAA/B,EAAgE;EACrE,MAAMC,WAAW,GAAI,IAAGD,QAAQ,CAACE,GAAT,CAAa,YAAb,CAA2B,KAAIF,QAAQ,CAACG,IAAK,GACnEH,QAAQ,CAACI,WAAT,GACI,OAAOJ,QAAQ,CAACI,WAAT,CAAqBC,IAArB,CAA0B,IAA1B,EAAgC,YAAhC,CAAP,GAAuD,GAD3D,GAEI,EACL,EAJD;EAKA,OAAOJ,WAAP;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASK,gBAAT,GAAoC;EACzC,IAAIC,QAAQ,GAAG,EAAf;EACAA,QAAQ,IAAI,qCAAZ;EACAA,QAAQ,IAAI,mCAAZ;EACA,OAAOA,QAAP;AACD;AAED;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,CAAuBR,QAAvB,EAAwD;EAC7D,MAAMS,GAAG,GAAI,KAAIT,QAAQ,CAACG,IAAK,MAC7BH,QAAQ,CAACI,WAAT,GAAuBJ,QAAQ,CAACI,WAAT,CAAqBC,IAArB,CAA0B,IAA1B,CAAvB,GAAyD,EAC1D,QAAOL,QAAQ,CAACE,GAAI,MAFrB;EAGA,OAAOO,GAAP;AACD"}
|