@rockcarver/frodo-cli 0.14.0 → 0.14.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 +10 -2
- package/package.json +1 -1
- package/babel.config.esm.json +0 -6
- package/src/app.ts +0 -63
- package/src/cli/_template/cmd-delete.ts +0 -56
- package/src/cli/_template/cmd-describe.ts +0 -36
- package/src/cli/_template/cmd-export.ts +0 -54
- package/src/cli/_template/cmd-import.ts +0 -54
- package/src/cli/_template/cmd-list.ts +0 -38
- package/src/cli/_template/cmd-sub1-delete.ts +0 -56
- package/src/cli/_template/cmd-sub1-describe.ts +0 -36
- package/src/cli/_template/cmd-sub1-export.ts +0 -54
- package/src/cli/_template/cmd-sub1-import.ts +0 -54
- package/src/cli/_template/cmd-sub1-list.ts +0 -38
- package/src/cli/_template/cmd-sub1.ts +0 -20
- package/src/cli/_template/cmd-sub2-delete.ts +0 -56
- package/src/cli/_template/cmd-sub2-describe.ts +0 -36
- package/src/cli/_template/cmd-sub2-export.ts +0 -54
- package/src/cli/_template/cmd-sub2-import.ts +0 -54
- package/src/cli/_template/cmd-sub2-list.ts +0 -38
- package/src/cli/_template/cmd-sub2.ts +0 -20
- package/src/cli/_template/cmd.ts +0 -29
- package/src/cli/admin/admin-add-autoid-static-user-mapping.ts +0 -40
- package/src/cli/admin/admin-create-oauth2-client-with-admin-privileges.ts +0 -121
- package/src/cli/admin/admin-get-access-token.ts +0 -59
- package/src/cli/admin/admin-grant-oauth2-client-admin-privileges.ts +0 -45
- package/src/cli/admin/admin-hide-generic-extension-attributes.ts +0 -47
- package/src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.ts +0 -45
- package/src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.ts +0 -46
- package/src/cli/admin/admin-list-static-user-mappings.ts +0 -53
- package/src/cli/admin/admin-remove-static-user-mapping.ts +0 -38
- package/src/cli/admin/admin-repair-org-model.ts +0 -53
- package/src/cli/admin/admin-revoke-oauth2-client-admin-privileges.ts +0 -47
- package/src/cli/admin/admin-show-generic-extension-attributes.ts +0 -55
- package/src/cli/admin/admin.ts +0 -94
- package/src/cli/app/app-delete.ts +0 -56
- package/src/cli/app/app-describe.ts +0 -36
- package/src/cli/app/app-export.ts +0 -78
- package/src/cli/app/app-import.ts +0 -56
- package/src/cli/app/app-list.ts +0 -40
- package/src/cli/app/app.ts +0 -29
- package/src/cli/cmd_common.ts +0 -181
- package/src/cli/conn/conn-add.ts +0 -65
- package/src/cli/conn/conn-delete.ts +0 -22
- package/src/cli/conn/conn-describe.ts +0 -23
- package/src/cli/conn/conn-list.ts +0 -27
- package/src/cli/conn/conn.ts +0 -28
- package/src/cli/email/email-template-export.ts +0 -90
- package/src/cli/email/email-template-import.ts +0 -90
- package/src/cli/email/email-template-list.ts +0 -40
- package/src/cli/email/email-template.ts +0 -16
- package/src/cli/email/email.ts +0 -17
- package/src/cli/esv/esv-apply.ts +0 -120
- package/src/cli/esv/esv-secret-create.ts +0 -64
- package/src/cli/esv/esv-secret-delete.ts +0 -65
- package/src/cli/esv/esv-secret-describe.ts +0 -43
- package/src/cli/esv/esv-secret-export.ts +0 -54
- package/src/cli/esv/esv-secret-import.ts +0 -54
- package/src/cli/esv/esv-secret-list.ts +0 -40
- package/src/cli/esv/esv-secret-set.ts +0 -45
- package/src/cli/esv/esv-secret-version-activate.ts +0 -53
- package/src/cli/esv/esv-secret-version-create.ts +0 -45
- package/src/cli/esv/esv-secret-version-deactivate.ts +0 -53
- package/src/cli/esv/esv-secret-version-delete.ts +0 -66
- package/src/cli/esv/esv-secret-version-list.ts +0 -41
- package/src/cli/esv/esv-secret-version.ts +0 -20
- package/src/cli/esv/esv-secret.ts +0 -26
- package/src/cli/esv/esv-variable-create.ts +0 -46
- package/src/cli/esv/esv-variable-delete.ts +0 -71
- package/src/cli/esv/esv-variable-describe.ts +0 -43
- package/src/cli/esv/esv-variable-export.ts +0 -54
- package/src/cli/esv/esv-variable-import.ts +0 -54
- package/src/cli/esv/esv-variable-list.ts +0 -40
- package/src/cli/esv/esv-variable-set.ts +0 -62
- package/src/cli/esv/esv-variable.ts +0 -24
- package/src/cli/esv/esv.ts +0 -21
- package/src/cli/idm/idm-count.ts +0 -42
- package/src/cli/idm/idm-export.ts +0 -116
- package/src/cli/idm/idm-list.ts +0 -40
- package/src/cli/idm/idm.ts +0 -28
- package/src/cli/idp/idp-export.ts +0 -90
- package/src/cli/idp/idp-import.ts +0 -101
- package/src/cli/idp/idp-list.ts +0 -42
- package/src/cli/idp/idp.ts +0 -21
- package/src/cli/info/info.ts +0 -55
- package/src/cli/journey/journey-delete.e2e.test_.ts +0 -380
- package/src/cli/journey/journey-delete.ts +0 -78
- package/src/cli/journey/journey-describe.ts +0 -148
- package/src/cli/journey/journey-export.ts +0 -110
- package/src/cli/journey/journey-import.ts +0 -127
- package/src/cli/journey/journey-list.e2e.test_.ts +0 -142
- package/src/cli/journey/journey-list.ts +0 -43
- package/src/cli/journey/journey-prune.ts +0 -52
- package/src/cli/journey/journey.ts +0 -37
- package/src/cli/logging/logs-list.ts +0 -77
- package/src/cli/logging/logs-tail.ts +0 -85
- package/src/cli/logging/logs.ts +0 -21
- package/src/cli/realm/realm-add-custom-domain.ts +0 -47
- package/src/cli/realm/realm-describe.ts +0 -40
- package/src/cli/realm/realm-list.ts +0 -40
- package/src/cli/realm/realm-remove-custom-domain.ts +0 -50
- package/src/cli/realm/realm.ts +0 -33
- package/src/cli/saml/saml-cot-export.ts +0 -90
- package/src/cli/saml/saml-cot-import.ts +0 -101
- package/src/cli/saml/saml-cot-list.ts +0 -42
- package/src/cli/saml/saml-cot.ts +0 -16
- package/src/cli/saml/saml-describe.ts +0 -42
- package/src/cli/saml/saml-export.ts +0 -91
- package/src/cli/saml/saml-import.ts +0 -102
- package/src/cli/saml/saml-list.ts +0 -42
- package/src/cli/saml/saml-metadata-export.ts +0 -76
- package/src/cli/saml/saml-metadata.ts +0 -12
- package/src/cli/saml/saml.ts +0 -29
- package/src/cli/script/script-delete.ts +0 -56
- package/src/cli/script/script-describe.ts +0 -36
- package/src/cli/script/script-export.ts +0 -95
- package/src/cli/script/script-import.ts +0 -64
- package/src/cli/script/script-list.ts +0 -42
- package/src/cli/script/script.ts +0 -25
- package/src/cli/theme/theme-delete.e2e.test_.ts +0 -178
- package/src/cli/theme/theme-delete.ts +0 -83
- package/src/cli/theme/theme-export.ts +0 -107
- package/src/cli/theme/theme-import.ts +0 -118
- package/src/cli/theme/theme-list.e2e.test_.ts +0 -119
- package/src/cli/theme/theme-list.ts +0 -42
- package/src/cli/theme/theme.ts +0 -23
- package/src/ops/CirclesOfTrustOps.ts +0 -12
- package/src/ops/EmailTemplateOps.ts +0 -19
- package/src/ops/IdpOps.ts +0 -11
- package/src/ops/JourneyOps.ts +0 -278
- package/src/ops/NodeOps.ts +0 -47
- package/src/ops/Saml2Ops.ts +0 -24
- package/src/ops/ScriptOps.ts +0 -11
- package/src/ops/ThemeOps.ts +0 -17
- package/src/ops/utils/Wordwrap.ts +0 -11
- package/src/storage/StaticStorage.ts +0 -15
- package/src/utils/Console.ts +0 -483
- package/tsconfig.json +0 -106
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EmailTemplateSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Get a one-line description of the email template
|
|
5
|
-
* @param {EmailTemplateSkeleton} templateObj email template object to describe
|
|
6
|
-
* @returns {string} a one-line description
|
|
7
|
-
*/
|
|
8
|
-
export function getOneLineDescription(
|
|
9
|
-
templateObj: EmailTemplateSkeleton
|
|
10
|
-
): string {
|
|
11
|
-
const description = `[${templateObj._id.split('/')[1]['brightCyan']}] ${
|
|
12
|
-
templateObj.displayName ? templateObj.displayName : ''
|
|
13
|
-
} - ${
|
|
14
|
-
templateObj.defaultLocale
|
|
15
|
-
? templateObj.subject[templateObj.defaultLocale]
|
|
16
|
-
: Object.values(templateObj.subject)[0]
|
|
17
|
-
}`;
|
|
18
|
-
return description;
|
|
19
|
-
}
|
package/src/ops/IdpOps.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SocialIdpSkeleton } from "@rockcarver/frodo-lib/types/api/ApiTypes";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Get a one-line description of the social idp object
|
|
5
|
-
* @param {SocialIdpSkeleton} socialIdpObj social idp object to describe
|
|
6
|
-
* @returns {string} a one-line description
|
|
7
|
-
*/
|
|
8
|
-
export function getOneLineDescription(socialIdpObj: SocialIdpSkeleton): string {
|
|
9
|
-
const description = `[${socialIdpObj._id['brightCyan']}] ${socialIdpObj._type._id}`;
|
|
10
|
-
return description;
|
|
11
|
-
}
|
package/src/ops/JourneyOps.ts
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NodeSkeleton,
|
|
3
|
-
TreeSkeleton,
|
|
4
|
-
} from '@rockcarver/frodo-lib/types/api/ApiTypes';
|
|
5
|
-
import {
|
|
6
|
-
SingleTreeExportInterface,
|
|
7
|
-
TreeDependencyMapInterface,
|
|
8
|
-
TreeExportResolverInterface,
|
|
9
|
-
} from '@rockcarver/frodo-lib/types/ops/OpsTypes';
|
|
10
|
-
import { printMessage } from '../utils/Console';
|
|
11
|
-
import { Journey, Types, state } from '@rockcarver/frodo-lib';
|
|
12
|
-
import * as CirclesOfTrust from './CirclesOfTrustOps';
|
|
13
|
-
import * as EmailTemplate from './EmailTemplateOps';
|
|
14
|
-
import * as Idp from './IdpOps';
|
|
15
|
-
import * as Node from './NodeOps';
|
|
16
|
-
import * as Saml2 from './Saml2Ops';
|
|
17
|
-
import * as Script from './ScriptOps';
|
|
18
|
-
import * as Theme from './ThemeOps';
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
onlineTreeExportResolver,
|
|
22
|
-
getTreeDescendents,
|
|
23
|
-
getNodeRef,
|
|
24
|
-
} = Journey;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Get journey classification
|
|
28
|
-
* @param {SingleTreeExportInterface} journey journey export
|
|
29
|
-
* @returns {stringp[]} Colored string array of classifications
|
|
30
|
-
*/
|
|
31
|
-
export function getJourneyClassification(journey: SingleTreeExportInterface): string[] {
|
|
32
|
-
return Journey.getJourneyClassification(journey).map((it) => {
|
|
33
|
-
switch (it) {
|
|
34
|
-
case Types.JourneyClassification.STANDARD:
|
|
35
|
-
return it.toString()['brightGreen'];
|
|
36
|
-
|
|
37
|
-
case Types.JourneyClassification.CLOUD:
|
|
38
|
-
return it.toString()['brightMagenta'];
|
|
39
|
-
|
|
40
|
-
case Types.JourneyClassification.CUSTOM:
|
|
41
|
-
return it.toString()['brightRed'];
|
|
42
|
-
|
|
43
|
-
case Types.JourneyClassification.PREMIUM:
|
|
44
|
-
return it.toString()['brightYellow'];
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Get a one-line description of the tree object
|
|
51
|
-
* @param {TreeSkeleton} treeObj circle of trust object to describe
|
|
52
|
-
* @returns {string} a one-line description
|
|
53
|
-
*/
|
|
54
|
-
export function getOneLineDescription(treeObj: TreeSkeleton): string {
|
|
55
|
-
const description = `[${treeObj._id['brightCyan']}]`;
|
|
56
|
-
return description;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Helper function to render a nested list of dependent trees
|
|
61
|
-
* @param {TreeDependencyMapInterface} descendents tree dependency map
|
|
62
|
-
* @param {number} depth level of nesting
|
|
63
|
-
*/
|
|
64
|
-
function describeTreeDescendents(
|
|
65
|
-
descendents: TreeDependencyMapInterface,
|
|
66
|
-
depth = 0
|
|
67
|
-
) {
|
|
68
|
-
if (depth || Object.values(descendents)[0].length) {
|
|
69
|
-
// heading
|
|
70
|
-
if (depth === 0) {
|
|
71
|
-
printMessage(
|
|
72
|
-
`\nInner Tree Dependencies (${Object.values(descendents)[0].length}):`,
|
|
73
|
-
'data'
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
const indent = Array(depth * 2)
|
|
77
|
-
.fill(' ')
|
|
78
|
-
.join('');
|
|
79
|
-
const [tree] = Object.keys(descendents);
|
|
80
|
-
printMessage(`${indent}- ${tree['brightCyan']}`, 'data');
|
|
81
|
-
for (const descendent of descendents[tree]) {
|
|
82
|
-
describeTreeDescendents(descendent, depth + 1);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Describe a journey:
|
|
89
|
-
* - Properties, tags, description, name, metadata
|
|
90
|
-
* - Inner tree dependency tree
|
|
91
|
-
* - Node type summary
|
|
92
|
-
* - Nodes
|
|
93
|
-
* - Themes
|
|
94
|
-
* - Scripts
|
|
95
|
-
* - Email templates
|
|
96
|
-
* - Social identity providers
|
|
97
|
-
* - SAML2 entity providers
|
|
98
|
-
* - SAML2 circles of trust
|
|
99
|
-
* @param {SingleTreeExportInterface} journeyData journey export object
|
|
100
|
-
* @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function
|
|
101
|
-
*/
|
|
102
|
-
export async function describeJourney(
|
|
103
|
-
journeyData: SingleTreeExportInterface,
|
|
104
|
-
resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver
|
|
105
|
-
): Promise<void> {
|
|
106
|
-
const allNodes = {
|
|
107
|
-
...journeyData.nodes,
|
|
108
|
-
...journeyData.innerNodes,
|
|
109
|
-
};
|
|
110
|
-
const nodeTypeMap = {};
|
|
111
|
-
|
|
112
|
-
for (const nodeData of Object.values(allNodes)) {
|
|
113
|
-
if (nodeTypeMap[nodeData._type._id]) {
|
|
114
|
-
nodeTypeMap[nodeData._type._id] += 1;
|
|
115
|
-
} else {
|
|
116
|
-
nodeTypeMap[nodeData._type._id] = 1;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Journey Name
|
|
121
|
-
printMessage(`${getOneLineDescription(journeyData.tree)}`, 'data');
|
|
122
|
-
printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join(''));
|
|
123
|
-
|
|
124
|
-
// Description
|
|
125
|
-
if (journeyData.tree.description) {
|
|
126
|
-
printMessage(`\n${journeyData.tree.description}`, 'data');
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Status
|
|
130
|
-
printMessage(
|
|
131
|
-
`\nStatus\n${
|
|
132
|
-
journeyData.tree.enabled === false
|
|
133
|
-
? 'disabled'['brightRed']
|
|
134
|
-
: 'enabled'['brightGreen']
|
|
135
|
-
}`
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
// Classification
|
|
139
|
-
if (
|
|
140
|
-
!state.default.session.getAmVersion() &&
|
|
141
|
-
journeyData.meta?.originAmVersion
|
|
142
|
-
) {
|
|
143
|
-
state.default.session.setAmVersion(journeyData.meta.originAmVersion);
|
|
144
|
-
}
|
|
145
|
-
if (state.default.session.getAmVersion()) {
|
|
146
|
-
printMessage(
|
|
147
|
-
`\nClassification\n${getJourneyClassification(journeyData).join(', ')}`,
|
|
148
|
-
'data'
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Categories/Tags
|
|
153
|
-
if (journeyData.tree.uiConfig?.categories && journeyData.tree.uiConfig.categories != '[]') {
|
|
154
|
-
printMessage('\nCategories/Tags', 'data');
|
|
155
|
-
printMessage(
|
|
156
|
-
`${
|
|
157
|
-
JSON.parse(journeyData.tree.uiConfig.categories).join(', ')
|
|
158
|
-
}`,
|
|
159
|
-
'data'
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Dependency Tree
|
|
164
|
-
const descendents = await getTreeDescendents(journeyData, resolveTreeExport);
|
|
165
|
-
describeTreeDescendents(descendents);
|
|
166
|
-
|
|
167
|
-
// Node Types
|
|
168
|
-
if (Object.entries(nodeTypeMap).length) {
|
|
169
|
-
printMessage(
|
|
170
|
-
`\nNode Types (${Object.entries(nodeTypeMap).length}):`,
|
|
171
|
-
'data'
|
|
172
|
-
);
|
|
173
|
-
for (const [nodeType, count] of Object.entries(nodeTypeMap)) {
|
|
174
|
-
printMessage(
|
|
175
|
-
`- ${String(count)} [${
|
|
176
|
-
nodeType['brightCyan']
|
|
177
|
-
}] (${Node.getNodeClassification(nodeType).join(', ')})`,
|
|
178
|
-
'data'
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Nodes
|
|
184
|
-
if (Object.entries(allNodes).length) {
|
|
185
|
-
printMessage(`\nNodes (${Object.entries(allNodes).length}):`, 'data');
|
|
186
|
-
for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {
|
|
187
|
-
printMessage(
|
|
188
|
-
`- ${Node.getOneLineDescription(
|
|
189
|
-
nodeObj,
|
|
190
|
-
getNodeRef(nodeObj, journeyData)
|
|
191
|
-
)}`,
|
|
192
|
-
'data'
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Themes
|
|
198
|
-
if (journeyData.themes?.length) {
|
|
199
|
-
printMessage(`\nThemes (${journeyData.themes.length}):`, 'data');
|
|
200
|
-
for (const themeData of journeyData.themes) {
|
|
201
|
-
printMessage(`- ${Theme.getOneLineDescription(themeData)}`, 'data');
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Scripts
|
|
206
|
-
if (Object.entries(journeyData.scripts).length) {
|
|
207
|
-
printMessage(
|
|
208
|
-
`\nScripts (${Object.entries(journeyData.scripts).length}):`,
|
|
209
|
-
'data'
|
|
210
|
-
);
|
|
211
|
-
for (const scriptData of Object.values(journeyData.scripts)) {
|
|
212
|
-
printMessage(`- ${Script.getOneLineDescription(scriptData)}`, 'data');
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// Email Templates
|
|
217
|
-
if (Object.entries(journeyData.emailTemplates).length) {
|
|
218
|
-
printMessage(
|
|
219
|
-
`\nEmail Templates (${
|
|
220
|
-
Object.entries(journeyData.emailTemplates).length
|
|
221
|
-
}):`,
|
|
222
|
-
'data'
|
|
223
|
-
);
|
|
224
|
-
for (const templateData of Object.values(journeyData.emailTemplates)) {
|
|
225
|
-
printMessage(
|
|
226
|
-
`- ${EmailTemplate.getOneLineDescription(templateData)}`,
|
|
227
|
-
'data'
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Social Identity Providers
|
|
233
|
-
if (Object.entries(journeyData.socialIdentityProviders).length) {
|
|
234
|
-
printMessage(
|
|
235
|
-
`\nSocial Identity Providers (${
|
|
236
|
-
Object.entries(journeyData.socialIdentityProviders).length
|
|
237
|
-
}):`,
|
|
238
|
-
'data'
|
|
239
|
-
);
|
|
240
|
-
for (const socialIdpData of Object.values(
|
|
241
|
-
journeyData.socialIdentityProviders
|
|
242
|
-
)) {
|
|
243
|
-
printMessage(`- ${Idp.getOneLineDescription(socialIdpData)}`, 'data');
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// SAML2 Entity Providers
|
|
248
|
-
if (Object.entries(journeyData.saml2Entities).length) {
|
|
249
|
-
printMessage(
|
|
250
|
-
`\nSAML2 Entity Providers (${
|
|
251
|
-
Object.entries(journeyData.saml2Entities).length
|
|
252
|
-
}):`,
|
|
253
|
-
'data'
|
|
254
|
-
);
|
|
255
|
-
for (const entityProviderData of Object.values(journeyData.saml2Entities)) {
|
|
256
|
-
printMessage(
|
|
257
|
-
`- ${Saml2.getOneLineDescription(entityProviderData)}`,
|
|
258
|
-
'data'
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// SAML2 Circles Of Trust
|
|
264
|
-
if (Object.entries(journeyData.circlesOfTrust).length) {
|
|
265
|
-
printMessage(
|
|
266
|
-
`\nSAML2 Circles Of Trust (${
|
|
267
|
-
Object.entries(journeyData.circlesOfTrust).length
|
|
268
|
-
}):`,
|
|
269
|
-
'data'
|
|
270
|
-
);
|
|
271
|
-
for (const cotData of Object.values(journeyData.circlesOfTrust)) {
|
|
272
|
-
printMessage(
|
|
273
|
-
`- ${CirclesOfTrust.getOneLineDescription(cotData)}`,
|
|
274
|
-
'data'
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
package/src/ops/NodeOps.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
InnerNodeRefSkeletonInterface,
|
|
3
|
-
NodeRefSkeletonInterface,
|
|
4
|
-
NodeSkeleton,
|
|
5
|
-
} from '@rockcarver/frodo-lib/types/api/ApiTypes';
|
|
6
|
-
import { Node, Types } from '@rockcarver/frodo-lib';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Get node classification
|
|
10
|
-
* @param {string} nodeType node type
|
|
11
|
-
* @returns {stringp[]} Colored string array of classifications
|
|
12
|
-
*/
|
|
13
|
-
export function getNodeClassification(nodeType: string): string[] {
|
|
14
|
-
return Node.getNodeClassification(nodeType).map((it) => {
|
|
15
|
-
switch (it) {
|
|
16
|
-
case Types.NodeClassification.STANDARD:
|
|
17
|
-
return it.toString()['brightGreen'];
|
|
18
|
-
|
|
19
|
-
case Types.NodeClassification.CLOUD:
|
|
20
|
-
return it.toString()['brightMagenta'];
|
|
21
|
-
|
|
22
|
-
case Types.NodeClassification.CUSTOM:
|
|
23
|
-
return it.toString()['brightRed'];
|
|
24
|
-
|
|
25
|
-
case Types.NodeClassification.PREMIUM:
|
|
26
|
-
return it.toString()['brightYellow'];
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Get a one-line description of the node
|
|
33
|
-
* @param {NodeSkeleton} nodeObj node object to describe
|
|
34
|
-
* @param {NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface} nodeRef node reference object
|
|
35
|
-
* @returns {string} a one-line description
|
|
36
|
-
*/
|
|
37
|
-
export function getOneLineDescription(
|
|
38
|
-
nodeObj: NodeSkeleton,
|
|
39
|
-
nodeRef?: NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface
|
|
40
|
-
): string {
|
|
41
|
-
const description = `[${nodeObj._id['brightCyan']}] (${getNodeClassification(
|
|
42
|
-
nodeObj._type._id
|
|
43
|
-
).join(', ')}) ${nodeObj._type._id}${
|
|
44
|
-
nodeRef ? ' - ' + nodeRef?.displayName : ''
|
|
45
|
-
}`;
|
|
46
|
-
return description;
|
|
47
|
-
}
|
package/src/ops/Saml2Ops.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Saml2ProviderSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';
|
|
2
|
-
import { Saml2 } from '@rockcarver/frodo-lib';
|
|
3
|
-
|
|
4
|
-
const { roleMap } = Saml2;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Get a one-line description of the saml2 provider object
|
|
8
|
-
* @param {Saml2ProviderSkeleton} saml2ProviderObj saml2 provider object to describe
|
|
9
|
-
* @returns {string} a one-line description
|
|
10
|
-
*/
|
|
11
|
-
export function getOneLineDescription(
|
|
12
|
-
saml2ProviderObj: Saml2ProviderSkeleton
|
|
13
|
-
): string {
|
|
14
|
-
const roles: string[] = [];
|
|
15
|
-
for (const [key, value] of Object.entries(roleMap)) {
|
|
16
|
-
if (saml2ProviderObj[key]) {
|
|
17
|
-
roles.push(value);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const description = `[${saml2ProviderObj.entityId['brightCyan']}]${
|
|
21
|
-
' (' + saml2ProviderObj.entityLocation
|
|
22
|
-
}${roles.length ? ' ' + roles.join(', ') + ')' : ')'}`;
|
|
23
|
-
return description;
|
|
24
|
-
}
|
package/src/ops/ScriptOps.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ScriptSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Get a one-line description of the script object
|
|
5
|
-
* @param {ScriptSkeleton} scriptObj script object to describe
|
|
6
|
-
* @returns {string} a one-line description
|
|
7
|
-
*/
|
|
8
|
-
export function getOneLineDescription(scriptObj: ScriptSkeleton): string {
|
|
9
|
-
const description = `[${scriptObj._id['brightCyan']}] ${scriptObj.context} - ${scriptObj.name}`;
|
|
10
|
-
return description;
|
|
11
|
-
}
|
package/src/ops/ThemeOps.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ThemeSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Get a one-line description of the theme
|
|
5
|
-
* @param {ThemeSkeleton} themeObj theme object to describe
|
|
6
|
-
* @returns {string} a one-line description
|
|
7
|
-
*/
|
|
8
|
-
export function getOneLineDescription(themeObj: ThemeSkeleton): string {
|
|
9
|
-
const description = `[${themeObj._id['brightCyan']}] ${
|
|
10
|
-
themeObj.name
|
|
11
|
-
}${
|
|
12
|
-
themeObj.linkedTrees
|
|
13
|
-
? ' (' + themeObj.linkedTrees.join(', ')['brightCyan'] + ')'
|
|
14
|
-
: ''
|
|
15
|
-
}`;
|
|
16
|
-
return description;
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default function wordwrap(str, len, indent = undefined) {
|
|
2
|
-
if (!str) return '';
|
|
3
|
-
return (
|
|
4
|
-
str.match(
|
|
5
|
-
new RegExp(
|
|
6
|
-
`(\\S.{0,${len - 1 - (indent ? indent.length : 0)}})(?=\\s+|$)`,
|
|
7
|
-
'g'
|
|
8
|
-
)
|
|
9
|
-
) || []
|
|
10
|
-
).join(indent ? `\n${indent}` : '\n');
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_REALM_KEY = '__default__realm__';
|
|
2
|
-
export const CLASSIC_DEPLOYMENT_TYPE_KEY = 'classic';
|
|
3
|
-
export const CLOUD_DEPLOYMENT_TYPE_KEY = 'cloud';
|
|
4
|
-
export const FORGEOPS_DEPLOYMENT_TYPE_KEY = 'forgeops';
|
|
5
|
-
export const DEPLOYMENT_TYPES = [
|
|
6
|
-
CLASSIC_DEPLOYMENT_TYPE_KEY,
|
|
7
|
-
CLOUD_DEPLOYMENT_TYPE_KEY,
|
|
8
|
-
FORGEOPS_DEPLOYMENT_TYPE_KEY,
|
|
9
|
-
];
|
|
10
|
-
export const DEPLOYMENT_TYPE_REALM_MAP = {
|
|
11
|
-
[CLASSIC_DEPLOYMENT_TYPE_KEY]: '/',
|
|
12
|
-
[CLOUD_DEPLOYMENT_TYPE_KEY]: 'alpha',
|
|
13
|
-
[FORGEOPS_DEPLOYMENT_TYPE_KEY]: '/',
|
|
14
|
-
};
|
|
15
|
-
export const FRODO_METADATA_ID = 'frodo';
|