@rockcarver/frodo-cli 0.23.1-4 → 0.23.1-6

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/esm/app.js +2 -0
  3. package/esm/app.js.map +1 -1
  4. package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js +13 -6
  5. package/esm/cli/admin/admin-create-oauth2-client-with-admin-privileges.js.map +1 -1
  6. package/esm/cli/authz/authz-policy-delete.js +43 -0
  7. package/esm/cli/authz/authz-policy-delete.js.map +1 -0
  8. package/esm/cli/authz/authz-policy-describe.js +30 -0
  9. package/esm/cli/authz/authz-policy-describe.js.map +1 -0
  10. package/esm/cli/authz/authz-policy-export.js +70 -0
  11. package/esm/cli/authz/authz-policy-export.js.map +1 -0
  12. package/esm/cli/authz/authz-policy-import.js +26 -0
  13. package/esm/cli/authz/authz-policy-import.js.map +1 -0
  14. package/esm/cli/authz/authz-policy-list.js +37 -0
  15. package/esm/cli/authz/authz-policy-list.js.map +1 -0
  16. package/esm/cli/authz/authz-policy.js +10 -0
  17. package/esm/cli/authz/authz-policy.js.map +1 -0
  18. package/esm/cli/authz/authz-set-delete.js +37 -0
  19. package/esm/cli/authz/authz-set-delete.js.map +1 -0
  20. package/esm/cli/authz/authz-set-describe.js +30 -0
  21. package/esm/cli/authz/authz-set-describe.js.map +1 -0
  22. package/esm/cli/authz/authz-set-export.js +52 -0
  23. package/esm/cli/authz/authz-set-export.js.map +1 -0
  24. package/esm/cli/authz/authz-set-import.js +57 -0
  25. package/esm/cli/authz/authz-set-import.js.map +1 -0
  26. package/esm/cli/authz/authz-set-list.js +25 -0
  27. package/esm/cli/authz/authz-set-list.js.map +1 -0
  28. package/esm/cli/authz/authz-set.js +10 -0
  29. package/esm/cli/authz/authz-set.js.map +1 -0
  30. package/esm/cli/authz/authz-type-delete.js +38 -0
  31. package/esm/cli/authz/authz-type-delete.js.map +1 -0
  32. package/esm/cli/authz/authz-type-describe.js +30 -0
  33. package/esm/cli/authz/authz-type-describe.js.map +1 -0
  34. package/esm/cli/authz/authz-type-export.js +22 -0
  35. package/esm/cli/authz/authz-type-export.js.map +1 -0
  36. package/esm/cli/authz/authz-type-import.js +22 -0
  37. package/esm/cli/authz/authz-type-import.js.map +1 -0
  38. package/esm/cli/authz/authz-type-list.js +32 -0
  39. package/esm/cli/authz/authz-type-list.js.map +1 -0
  40. package/esm/cli/authz/authz-type.js +10 -0
  41. package/esm/cli/authz/authz-type.js.map +1 -0
  42. package/esm/cli/authz/authz.js +12 -0
  43. package/esm/cli/authz/authz.js.map +1 -0
  44. package/esm/cli/email/email-template-import.js +4 -4
  45. package/esm/cli/email/email-template-import.js.map +1 -1
  46. package/esm/cli/idm/idm-import.js +8 -3
  47. package/esm/cli/idm/idm-import.js.map +1 -1
  48. package/esm/ops/EmailTemplateOps.js +79 -38
  49. package/esm/ops/EmailTemplateOps.js.map +1 -1
  50. package/esm/ops/IdmOps.js +25 -2
  51. package/esm/ops/IdmOps.js.map +1 -1
  52. package/esm/ops/PolicyOps.js +392 -0
  53. package/esm/ops/PolicyOps.js.map +1 -0
  54. package/esm/ops/PolicySetOps.js +373 -0
  55. package/esm/ops/PolicySetOps.js.map +1 -0
  56. package/esm/ops/ResourceTypeOps.js +323 -0
  57. package/esm/ops/ResourceTypeOps.js.map +1 -0
  58. package/esm/utils/Console.js +2 -0
  59. package/esm/utils/Console.js.map +1 -1
  60. package/package.json +2 -2
@@ -0,0 +1,323 @@
1
+ import fs from 'fs';
2
+ import { ResourceType, Utils, state } from '@rockcarver/frodo-lib';
3
+ import { createObjectTable, createProgressBar, debugMessage, failSpinner, printMessage, showSpinner, stopProgressBar, succeedSpinner, updateProgressBar } from '../utils/Console';
4
+ import { getTypedFilename, saveJsonToFile, titleCase } from '../utils/ExportImportUtils';
5
+ const {
6
+ deleteResourceType: _deleteResourceType,
7
+ getResourceTypes,
8
+ getResourceTypeByName,
9
+ exportResourceType,
10
+ exportResourceTypes,
11
+ importResourceType,
12
+ importFirstResourceType,
13
+ importResourceTypes
14
+ } = ResourceType;
15
+ const {
16
+ getRealmName
17
+ } = Utils;
18
+
19
+ /**
20
+ * List resource types
21
+ * @returns {Promise<boolean>} true if successful, false otherwise
22
+ */
23
+ export async function listResourceTypes() {
24
+ let outcome = false;
25
+ try {
26
+ const resourceTypes = await getResourceTypes();
27
+ resourceTypes.sort((a, b) => a.name.localeCompare(b.name));
28
+ for (const resourceType of resourceTypes) {
29
+ printMessage(`${resourceType.name}`, 'data');
30
+ }
31
+ outcome = true;
32
+ } catch (err) {
33
+ printMessage(`listResourceTypes ERROR: ${err.message}`, 'error');
34
+ printMessage(err, 'error');
35
+ }
36
+ return outcome;
37
+ }
38
+
39
+ /**
40
+ * Describe resource type
41
+ * @param {string} resourceTypeName resource type name
42
+ * @param {boolean} json JSON output
43
+ * @returns {Promise<boolean>} true if successful, false otherwise
44
+ */
45
+ export async function describeResourceType(resourceTypeName, json = false) {
46
+ let outcome = false;
47
+ try {
48
+ const resourceType = await getResourceTypeByName(resourceTypeName);
49
+ if (json) {
50
+ printMessage(resourceType, 'data');
51
+ } else {
52
+ const table = createObjectTable(resourceType);
53
+ printMessage(table.toString(), 'data');
54
+ }
55
+ outcome = true;
56
+ } catch (error) {
57
+ printMessage(error.message, 'error');
58
+ }
59
+ return outcome;
60
+ }
61
+
62
+ /**
63
+ * Delete resource type
64
+ * @param {string} resourceTypeId resource type id
65
+ * @returns {Promise<boolean>} true if successful, false otherwise
66
+ */
67
+ export async function deleteResourceType(resourceTypeId) {
68
+ debugMessage(`cli.ResourceTypeOps.deleteResourceType: begin`);
69
+ showSpinner(`Deleting ${resourceTypeId}...`);
70
+ let outcome = false;
71
+ const errors = [];
72
+ try {
73
+ debugMessage(`Deleting resource type ${resourceTypeId}`);
74
+ await _deleteResourceType(resourceTypeId);
75
+ } catch (error) {
76
+ printMessage(`Error deleting resource type ${resourceTypeId}: ${error}`, 'error');
77
+ }
78
+ if (errors.length) {
79
+ const errorMessages = errors.map(error => error.message).join('\n');
80
+ failSpinner(`Error deleting ${resourceTypeId}: ${errorMessages}`);
81
+ } else {
82
+ succeedSpinner(`Deleted ${resourceTypeId}.`);
83
+ outcome = true;
84
+ }
85
+ debugMessage(`cli.ResourceTypeOps.deleteResourceType: end [outcome=${outcome}]`);
86
+ return outcome;
87
+ }
88
+
89
+ /**
90
+ * Delete all resource types
91
+ * @returns {Promise<boolean>} true if successful, false otherwise
92
+ */
93
+ export async function deleteResourceTypes() {
94
+ debugMessage(`cli.ResourceTypeOps.deleteResourceTypes: begin`);
95
+ let outcome = false;
96
+ const errors = [];
97
+ let resourceTypes = [];
98
+ try {
99
+ showSpinner(`Retrieving all resource types...`);
100
+ try {
101
+ resourceTypes = await getResourceTypes();
102
+ succeedSpinner(`Found ${resourceTypes.length} resource types.`);
103
+ } catch (error) {
104
+ error.message = `Error retrieving all resource types: ${error.message}`;
105
+ failSpinner(error.message);
106
+ throw error;
107
+ }
108
+ if (resourceTypes.length) createProgressBar(resourceTypes.length, `Deleting ${resourceTypes.length} resource types...`);
109
+ for (const resourceType of resourceTypes) {
110
+ const resourceTypeId = resourceType.uuid;
111
+ try {
112
+ debugMessage(`Deleting resource type ${resourceTypeId}`);
113
+ await _deleteResourceType(resourceTypeId);
114
+ updateProgressBar(`Deleted ${resourceTypeId}`);
115
+ } catch (error) {
116
+ error.message = `Error deleting resource type ${resourceTypeId}: ${error}`;
117
+ updateProgressBar(error.message);
118
+ errors.push(error);
119
+ }
120
+ }
121
+ } catch (error) {
122
+ error.message = `Error deleting resource types: ${error}`;
123
+ errors.push(error);
124
+ } finally {
125
+ if (errors.length) {
126
+ const errorMessages = errors.map(error => error.message).join('\n');
127
+ if (resourceTypes.length) stopProgressBar(`Error deleting all resource types: ${errorMessages}`);
128
+ } else {
129
+ if (resourceTypes.length) stopProgressBar(`Deleted ${resourceTypes.length} resource types.`);
130
+ outcome = true;
131
+ }
132
+ }
133
+ debugMessage(`cli.ResourceTypeOps.deleteResourceTypes: end [outcome=${outcome}]`);
134
+ return outcome;
135
+ }
136
+
137
+ /**
138
+ * Export resource type to file
139
+ * @param {string} resourceTypeId resource type id
140
+ * @param {string} file file name
141
+ * @returns {Promise<boolean>} true if successful, false otherwise
142
+ */
143
+ export async function exportResourceTypeToFile(resourceTypeId, file) {
144
+ let outcome = false;
145
+ debugMessage(`cli.ResourceTypeOps.exportResourceTypeToFile: begin`);
146
+ showSpinner(`Exporting ${resourceTypeId}...`);
147
+ try {
148
+ let fileName = getTypedFilename(resourceTypeId, 'resourcetype.authz');
149
+ if (file) {
150
+ fileName = file;
151
+ }
152
+ const exportData = await exportResourceType(resourceTypeId);
153
+ saveJsonToFile(exportData, fileName);
154
+ succeedSpinner(`Exported ${resourceTypeId} to ${fileName}.`);
155
+ outcome = true;
156
+ } catch (error) {
157
+ failSpinner(`Error exporting ${resourceTypeId}: ${error.message}`);
158
+ }
159
+ debugMessage(`cli.ResourceTypeOps.exportResourceTypeToFile: end`);
160
+ return outcome;
161
+ }
162
+
163
+ /**
164
+ * Export resource types to file
165
+ * @param {string} file file name
166
+ * @returns {Promise<boolean>} true if successful, false otherwise
167
+ */
168
+ export async function exportResourceTypesToFile(file) {
169
+ let outcome = false;
170
+ debugMessage(`cli.ResourceTypeOps.exportResourceTypesToFile: begin`);
171
+ showSpinner(`Exporting all resource types...`);
172
+ try {
173
+ let fileName = getTypedFilename(`all${titleCase(getRealmName(state.getRealm()))}ResourceTypes`, 'resourcetype.authz');
174
+ if (file) {
175
+ fileName = file;
176
+ }
177
+ const exportData = await exportResourceTypes();
178
+ saveJsonToFile(exportData, fileName);
179
+ succeedSpinner(`Exported all resource types to ${fileName}.`);
180
+ outcome = true;
181
+ } catch (error) {
182
+ failSpinner(`Error exporting resource types: ${error.message}`);
183
+ }
184
+ debugMessage(`cli.ResourceTypeOps.exportResourceTypesToFile: end`);
185
+ return outcome;
186
+ }
187
+
188
+ /**
189
+ * Export all resource types to separate files
190
+ * @returns {Promise<boolean>} true if successful, false otherwise
191
+ */
192
+ export async function exportResourceTypesToFiles() {
193
+ debugMessage(`cli.ResourceTypeOps.exportResourceTypesToFiles: begin`);
194
+ const errors = [];
195
+ try {
196
+ const resourceTypes = await getResourceTypes();
197
+ createProgressBar(resourceTypes.length, 'Exporting resource types...');
198
+ for (const resourceType of resourceTypes) {
199
+ const file = getTypedFilename(resourceType.name, 'resourcetype.authz');
200
+ try {
201
+ const exportData = await exportResourceType(resourceType.uuid);
202
+ saveJsonToFile(exportData, file);
203
+ updateProgressBar(`Exported ${resourceType.name}.`);
204
+ } catch (error) {
205
+ errors.push(error);
206
+ updateProgressBar(`Error exporting ${resourceType.name}.`);
207
+ }
208
+ }
209
+ stopProgressBar(`Export complete.`);
210
+ } catch (error) {
211
+ errors.push(error);
212
+ stopProgressBar(`Error exporting resource types to files`);
213
+ }
214
+ debugMessage(`cli.ResourceTypeOps.exportResourceTypesToFiles: end`);
215
+ return 0 === errors.length;
216
+ }
217
+
218
+ /**
219
+ * Import resource type from file
220
+ * @param {string} resourceTypeId resource type id
221
+ * @param {string} file file name
222
+ * @returns {Promise<boolean>} true if successful, false otherwise
223
+ */
224
+ export async function importResourceTypeFromFile(resourceTypeId, file) {
225
+ let outcome = false;
226
+ debugMessage(`cli.ResourceTypeOps.importResourceTypeFromFile: begin`);
227
+ showSpinner(`Importing ${resourceTypeId}...`);
228
+ try {
229
+ const data = fs.readFileSync(file, 'utf8');
230
+ const fileData = JSON.parse(data);
231
+ await importResourceType(resourceTypeId, fileData);
232
+ outcome = true;
233
+ succeedSpinner(`Imported ${resourceTypeId}.`);
234
+ } catch (error) {
235
+ failSpinner(`Error importing ${resourceTypeId}.`);
236
+ printMessage(error, 'error');
237
+ }
238
+ debugMessage(`cli.ResourceTypeOps.importResourceTypeFromFile: end`);
239
+ return outcome;
240
+ }
241
+
242
+ /**
243
+ * Import first resource type from file
244
+ * @param {string} file file name
245
+ * @returns {Promise<boolean>} true if successful, false otherwise
246
+ */
247
+ export async function importFirstResourceTypeFromFile(file) {
248
+ let outcome = false;
249
+ debugMessage(`cli.ResourceTypeOps.importFirstResourceTypeFromFile: begin`);
250
+ showSpinner(`Importing ${file}...`);
251
+ try {
252
+ const data = fs.readFileSync(file, 'utf8');
253
+ const fileData = JSON.parse(data);
254
+ await importFirstResourceType(fileData);
255
+ outcome = true;
256
+ succeedSpinner(`Imported ${file}.`);
257
+ } catch (error) {
258
+ failSpinner(`Error importing ${file}.`);
259
+ printMessage(error, 'error');
260
+ }
261
+ debugMessage(`cli.ResourceTypeOps.importFirstResourceTypeFromFile: end`);
262
+ return outcome;
263
+ }
264
+
265
+ /**
266
+ * Import resource types from file
267
+ * @param {string} file file name
268
+ * @returns {Promise<boolean>} true if successful, false otherwise
269
+ */
270
+ export async function importResourceTypesFromFile(file) {
271
+ let outcome = false;
272
+ debugMessage(`cli.ResourceTypeOps.importResourceTypesFromFile: begin`);
273
+ showSpinner(`Importing ${file}...`);
274
+ try {
275
+ const data = fs.readFileSync(file, 'utf8');
276
+ const fileData = JSON.parse(data);
277
+ await importResourceTypes(fileData);
278
+ outcome = true;
279
+ succeedSpinner(`Imported ${file}.`);
280
+ } catch (error) {
281
+ failSpinner(`Error importing ${file}.`);
282
+ printMessage(error, 'error');
283
+ }
284
+ debugMessage(`cli.ResourceTypeOps.importResourceTypesFromFile: end`);
285
+ return outcome;
286
+ }
287
+
288
+ /**
289
+ * Import resource types from files
290
+ * @returns {Promise<boolean>} true if successful, false otherwise
291
+ */
292
+ export async function importResourceTypesFromFiles() {
293
+ const errors = [];
294
+ try {
295
+ debugMessage(`cli.ResourceTypeOps.importResourceTypesFromFiles: begin`);
296
+ const names = fs.readdirSync('.');
297
+ const files = names.filter(name => name.toLowerCase().endsWith('.resourcetype.authz.json'));
298
+ createProgressBar(files.length, 'Importing resource types...');
299
+ let total = 0;
300
+ for (const file of files) {
301
+ try {
302
+ const data = fs.readFileSync(file, 'utf8');
303
+ const fileData = JSON.parse(data);
304
+ const count = Object.keys(fileData.resourcetype).length;
305
+ total += count;
306
+ await importResourceTypes(fileData);
307
+ updateProgressBar(`Imported ${count} resource types from ${file}`);
308
+ } catch (error) {
309
+ errors.push(error);
310
+ updateProgressBar(`Error importing resource types from ${file}`);
311
+ printMessage(error, 'error');
312
+ }
313
+ }
314
+ stopProgressBar(`Finished importing ${total} resource types from ${files.length} files.`);
315
+ } catch (error) {
316
+ errors.push(error);
317
+ stopProgressBar(`Error importing resource types from files.`);
318
+ printMessage(error, 'error');
319
+ }
320
+ debugMessage(`cli.ResourceTypeOps.importResourceTypesFromFiles: end`);
321
+ return 0 === errors.length;
322
+ }
323
+ //# sourceMappingURL=ResourceTypeOps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceTypeOps.js","names":["fs","ResourceType","Utils","state","createObjectTable","createProgressBar","debugMessage","failSpinner","printMessage","showSpinner","stopProgressBar","succeedSpinner","updateProgressBar","getTypedFilename","saveJsonToFile","titleCase","deleteResourceType","_deleteResourceType","getResourceTypes","getResourceTypeByName","exportResourceType","exportResourceTypes","importResourceType","importFirstResourceType","importResourceTypes","getRealmName","listResourceTypes","outcome","resourceTypes","sort","a","b","name","localeCompare","resourceType","err","message","describeResourceType","resourceTypeName","json","table","toString","error","resourceTypeId","errors","length","errorMessages","map","join","deleteResourceTypes","uuid","push","exportResourceTypeToFile","file","fileName","exportData","exportResourceTypesToFile","getRealm","exportResourceTypesToFiles","importResourceTypeFromFile","data","readFileSync","fileData","JSON","parse","importFirstResourceTypeFromFile","importResourceTypesFromFile","importResourceTypesFromFiles","names","readdirSync","files","filter","toLowerCase","endsWith","total","count","Object","keys","resourcetype"],"sources":["ops/ResourceTypeOps.ts"],"sourcesContent":["import fs from 'fs';\nimport { ResourceTypeSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';\nimport { ResourceType, Utils, state } from '@rockcarver/frodo-lib';\nimport {\n createObjectTable,\n createProgressBar,\n debugMessage,\n failSpinner,\n printMessage,\n showSpinner,\n stopProgressBar,\n succeedSpinner,\n updateProgressBar,\n} from '../utils/Console';\nimport {\n getTypedFilename,\n saveJsonToFile,\n titleCase,\n} from '../utils/ExportImportUtils';\nimport { ResourceTypeExportInterface } from '@rockcarver/frodo-lib/types/ops/ResourceTypeOps';\n\nconst {\n deleteResourceType: _deleteResourceType,\n getResourceTypes,\n getResourceTypeByName,\n exportResourceType,\n exportResourceTypes,\n importResourceType,\n importFirstResourceType,\n importResourceTypes,\n} = ResourceType;\nconst { getRealmName } = Utils;\n\n/**\n * List resource types\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function listResourceTypes(): Promise<boolean> {\n let outcome = false;\n try {\n const resourceTypes = await getResourceTypes();\n resourceTypes.sort((a, b) => a.name.localeCompare(b.name));\n for (const resourceType of resourceTypes) {\n printMessage(`${resourceType.name}`, 'data');\n }\n outcome = true;\n } catch (err) {\n printMessage(`listResourceTypes ERROR: ${err.message}`, 'error');\n printMessage(err, 'error');\n }\n return outcome;\n}\n\n/**\n * Describe resource type\n * @param {string} resourceTypeName resource type name\n * @param {boolean} json JSON output\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function describeResourceType(\n resourceTypeName: string,\n json = false\n): Promise<boolean> {\n let outcome = false;\n try {\n const resourceType = await getResourceTypeByName(resourceTypeName);\n if (json) {\n printMessage(resourceType, 'data');\n } else {\n const table = createObjectTable(resourceType);\n printMessage(table.toString(), 'data');\n }\n outcome = true;\n } catch (error) {\n printMessage(error.message, 'error');\n }\n return outcome;\n}\n\n/**\n * Delete resource type\n * @param {string} resourceTypeId resource type id\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function deleteResourceType(\n resourceTypeId: string\n): Promise<boolean | ResourceTypeSkeleton> {\n debugMessage(`cli.ResourceTypeOps.deleteResourceType: begin`);\n showSpinner(`Deleting ${resourceTypeId}...`);\n let outcome = false;\n const errors = [];\n try {\n debugMessage(`Deleting resource type ${resourceTypeId}`);\n await _deleteResourceType(resourceTypeId);\n } catch (error) {\n printMessage(\n `Error deleting resource type ${resourceTypeId}: ${error}`,\n 'error'\n );\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n failSpinner(`Error deleting ${resourceTypeId}: ${errorMessages}`);\n } else {\n succeedSpinner(`Deleted ${resourceTypeId}.`);\n outcome = true;\n }\n debugMessage(\n `cli.ResourceTypeOps.deleteResourceType: end [outcome=${outcome}]`\n );\n return outcome;\n}\n\n/**\n * Delete all resource types\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function deleteResourceTypes(): Promise<\n boolean | ResourceTypeSkeleton\n> {\n debugMessage(`cli.ResourceTypeOps.deleteResourceTypes: begin`);\n let outcome = false;\n const errors = [];\n let resourceTypes: ResourceTypeSkeleton[] = [];\n try {\n showSpinner(`Retrieving all resource types...`);\n try {\n resourceTypes = await getResourceTypes();\n succeedSpinner(`Found ${resourceTypes.length} resource types.`);\n } catch (error) {\n error.message = `Error retrieving all resource types: ${error.message}`;\n failSpinner(error.message);\n throw error;\n }\n if (resourceTypes.length)\n createProgressBar(\n resourceTypes.length,\n `Deleting ${resourceTypes.length} resource types...`\n );\n for (const resourceType of resourceTypes) {\n const resourceTypeId = resourceType.uuid;\n try {\n debugMessage(`Deleting resource type ${resourceTypeId}`);\n await _deleteResourceType(resourceTypeId);\n updateProgressBar(`Deleted ${resourceTypeId}`);\n } catch (error) {\n error.message = `Error deleting resource type ${resourceTypeId}: ${error}`;\n updateProgressBar(error.message);\n errors.push(error);\n }\n }\n } catch (error) {\n error.message = `Error deleting resource types: ${error}`;\n errors.push(error);\n } finally {\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n if (resourceTypes.length)\n stopProgressBar(`Error deleting all resource types: ${errorMessages}`);\n } else {\n if (resourceTypes.length)\n stopProgressBar(`Deleted ${resourceTypes.length} resource types.`);\n outcome = true;\n }\n }\n debugMessage(\n `cli.ResourceTypeOps.deleteResourceTypes: end [outcome=${outcome}]`\n );\n return outcome;\n}\n\n/**\n * Export resource type to file\n * @param {string} resourceTypeId resource type id\n * @param {string} file file name\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportResourceTypeToFile(\n resourceTypeId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.ResourceTypeOps.exportResourceTypeToFile: begin`);\n showSpinner(`Exporting ${resourceTypeId}...`);\n try {\n let fileName = getTypedFilename(resourceTypeId, 'resourcetype.authz');\n if (file) {\n fileName = file;\n }\n const exportData = await exportResourceType(resourceTypeId);\n saveJsonToFile(exportData, fileName);\n succeedSpinner(`Exported ${resourceTypeId} to ${fileName}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting ${resourceTypeId}: ${error.message}`);\n }\n debugMessage(`cli.ResourceTypeOps.exportResourceTypeToFile: end`);\n return outcome;\n}\n\n/**\n * Export resource types to file\n * @param {string} file file name\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportResourceTypesToFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.ResourceTypeOps.exportResourceTypesToFile: begin`);\n showSpinner(`Exporting all resource types...`);\n try {\n let fileName = getTypedFilename(\n `all${titleCase(getRealmName(state.getRealm()))}ResourceTypes`,\n 'resourcetype.authz'\n );\n if (file) {\n fileName = file;\n }\n const exportData = await exportResourceTypes();\n saveJsonToFile(exportData, fileName);\n succeedSpinner(`Exported all resource types to ${fileName}.`);\n outcome = true;\n } catch (error) {\n failSpinner(`Error exporting resource types: ${error.message}`);\n }\n debugMessage(`cli.ResourceTypeOps.exportResourceTypesToFile: end`);\n return outcome;\n}\n\n/**\n * Export all resource types to separate files\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function exportResourceTypesToFiles(): Promise<boolean> {\n debugMessage(`cli.ResourceTypeOps.exportResourceTypesToFiles: begin`);\n const errors = [];\n try {\n const resourceTypes: ResourceTypeSkeleton[] = await getResourceTypes();\n createProgressBar(resourceTypes.length, 'Exporting resource types...');\n for (const resourceType of resourceTypes) {\n const file = getTypedFilename(resourceType.name, 'resourcetype.authz');\n try {\n const exportData: ResourceTypeExportInterface =\n await exportResourceType(resourceType.uuid);\n saveJsonToFile(exportData, file);\n updateProgressBar(`Exported ${resourceType.name}.`);\n } catch (error) {\n errors.push(error);\n updateProgressBar(`Error exporting ${resourceType.name}.`);\n }\n }\n stopProgressBar(`Export complete.`);\n } catch (error) {\n errors.push(error);\n stopProgressBar(`Error exporting resource types to files`);\n }\n debugMessage(`cli.ResourceTypeOps.exportResourceTypesToFiles: end`);\n return 0 === errors.length;\n}\n\n/**\n * Import resource type from file\n * @param {string} resourceTypeId resource type id\n * @param {string} file file name\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importResourceTypeFromFile(\n resourceTypeId: string,\n file: string\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.ResourceTypeOps.importResourceTypeFromFile: begin`);\n showSpinner(`Importing ${resourceTypeId}...`);\n try {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n await importResourceType(resourceTypeId, fileData);\n outcome = true;\n succeedSpinner(`Imported ${resourceTypeId}.`);\n } catch (error) {\n failSpinner(`Error importing ${resourceTypeId}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.ResourceTypeOps.importResourceTypeFromFile: end`);\n return outcome;\n}\n\n/**\n * Import first resource type from file\n * @param {string} file file name\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importFirstResourceTypeFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.ResourceTypeOps.importFirstResourceTypeFromFile: begin`);\n showSpinner(`Importing ${file}...`);\n try {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n await importFirstResourceType(fileData);\n outcome = true;\n succeedSpinner(`Imported ${file}.`);\n } catch (error) {\n failSpinner(`Error importing ${file}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.ResourceTypeOps.importFirstResourceTypeFromFile: end`);\n return outcome;\n}\n\n/**\n * Import resource types from file\n * @param {string} file file name\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importResourceTypesFromFile(\n file: string\n): Promise<boolean> {\n let outcome = false;\n debugMessage(`cli.ResourceTypeOps.importResourceTypesFromFile: begin`);\n showSpinner(`Importing ${file}...`);\n try {\n const data = fs.readFileSync(file, 'utf8');\n const fileData = JSON.parse(data);\n await importResourceTypes(fileData);\n outcome = true;\n succeedSpinner(`Imported ${file}.`);\n } catch (error) {\n failSpinner(`Error importing ${file}.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.ResourceTypeOps.importResourceTypesFromFile: end`);\n return outcome;\n}\n\n/**\n * Import resource types from files\n * @returns {Promise<boolean>} true if successful, false otherwise\n */\nexport async function importResourceTypesFromFiles(): Promise<boolean> {\n const errors = [];\n try {\n debugMessage(`cli.ResourceTypeOps.importResourceTypesFromFiles: begin`);\n const names = fs.readdirSync('.');\n const files = names.filter((name) =>\n name.toLowerCase().endsWith('.resourcetype.authz.json')\n );\n createProgressBar(files.length, 'Importing resource types...');\n let total = 0;\n for (const file of files) {\n try {\n const data = fs.readFileSync(file, 'utf8');\n const fileData: ResourceTypeExportInterface = JSON.parse(data);\n const count = Object.keys(fileData.resourcetype).length;\n total += count;\n await importResourceTypes(fileData);\n updateProgressBar(`Imported ${count} resource types from ${file}`);\n } catch (error) {\n errors.push(error);\n updateProgressBar(`Error importing resource types from ${file}`);\n printMessage(error, 'error');\n }\n }\n stopProgressBar(\n `Finished importing ${total} resource types from ${files.length} files.`\n );\n } catch (error) {\n errors.push(error);\n stopProgressBar(`Error importing resource types from files.`);\n printMessage(error, 'error');\n }\n debugMessage(`cli.ResourceTypeOps.importResourceTypesFromFiles: end`);\n return 0 === errors.length;\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AAEnB,SAASC,YAAY,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAClE,SACEC,iBAAiB,EACjB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CAAC,KAAKsC,MAAM,CAACC,MAAM;AAC5B"}
@@ -463,6 +463,7 @@ function hasValues(object) {
463
463
  * @param {number} depth total depth of initial object
464
464
  * @param {number} level current level
465
465
  * @param {any} table the object table to add the rows to
466
+ * @param {Object} keyMap optional JSON map to map raw config names to human readable names {'raw': 'readable'}
466
467
  * @returns the updated object table
467
468
  */
468
469
  function addRows(object, depth, level, table, keyMap) {
@@ -498,6 +499,7 @@ function addRows(object, depth, level, table, keyMap) {
498
499
  /**
499
500
  * Create and populate an object table from any JSON object. Use for describe commands.
500
501
  * @param {Object} object JSON object to create
502
+ * @param {Object} keyMap optional JSON map to map raw config names to human readable names {'raw': 'readable'}
501
503
  * @returns {any} a table that can be printed to the console
502
504
  */
503
505
  export function createObjectTable(object, keyMap = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"Console.js","names":["MultiBar","Presets","createSpinner","Table","ExportImportUtils","state","Color","enable","appendTextToFile","multiBarContainer","progressBar","spinner","data","message","newline","getOutputFile","JSON","stringify","console","dir","depth","log","process","stdout","write","text","error","stderr","info","warn","debug","curlirize","verboseMessage","getVerbose","debugMessage","getDebug","curlirizeMessage","getCurlirize","printMessage","type","createProgressBar","total","options","format","noTTYOutput","opt","legacy","create","updateProgressBar","increment","stopProgressBar","update","stop","showSpinner","start","stopSpinner","succeedSpinner","success","warnSpinner","failSpinner","spinSpinner","spin","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","status","createTable","head","table","chars","top","bottom","left","mid","right","style","createKeyValueTable","wordWrap","getObjectDepth","object","Object","Math","max","values","map","hasValues","has","keys","key","addRows","level","keyMap","space","push","brightCyan","hAlign","content","gray","indention","Array","fill","join","concat","createObjectTable"],"sources":["utils/Console.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { MultiBar, Presets } from 'cli-progress';\nimport { createSpinner } from 'nanospinner';\nimport Table from 'cli-table3';\nimport { ExportImportUtils, state } from '@rockcarver/frodo-lib';\nimport Color from 'colors';\n\nColor.enable();\n\nconst { appendTextToFile } = ExportImportUtils;\n\nlet multiBarContainer = null;\nlet progressBar = null;\nlet spinner = null;\n\n/**\n * Output a message in default color to stdout or append to `state.getOutputFile()`\n * @param {string | object} message the message\n */\nfunction data(message: string | object, newline = true) {\n if (!message) return;\n if (state.getOutputFile()) {\n if (typeof message === 'object') {\n message = JSON.stringify(message, null, 2);\n }\n if (newline) {\n message += '\\n';\n }\n appendTextToFile(message, state.getOutputFile());\n } else if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.log(message);\n } else {\n process.stdout.write(message);\n }\n}\n\n/**\n * Output a default color message to stderr\n * @param {Object} message the message\n */\nfunction text(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message);\n } else {\n process.stderr.write(message);\n }\n}\n\n/**\n * Output a message in bright cyan to stderr\n * @param {Object} message the message\n */\nfunction info(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['brightCyan']);\n } else {\n process.stderr.write(message['brightCyan']);\n }\n}\n\n/**\n * Output a message in yellow to stderr\n * @param {Object} message the message\n */\nfunction warn(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['yellow']);\n } else {\n process.stderr.write(message['yellow']);\n }\n}\n\n/**\n * Output a message in bright red to stderr\n * @param {Object} message the message\n */\nfunction error(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['brightRed']);\n } else {\n process.stderr.write(message['brightRed']);\n }\n}\n\n/**\n * Output a debug message\n * @param {string | object} message the message\n */\nfunction debug(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 6 });\n } else if (newline) {\n console.error(message['brightMagenta']);\n } else {\n process.stderr.write(message['brightMagenta']);\n }\n}\n\n/**\n * Output a curlirize message\n * @param {string} message the message\n */\nfunction curlirize(message: string) {\n if (!message) return;\n console.error(message['brightBlue']);\n}\n\n/**\n * Output a message in default color to stderr\n * @param {Object} message the message\n */\nexport function verboseMessage(message) {\n if (!message) return;\n if (state.getVerbose()) {\n text(message);\n }\n}\n\n/**\n * Output a debug message\n * @param {Object} message the message\n */\nexport function debugMessage(message) {\n if (!message) return;\n if (state.getDebug()) {\n debug(message);\n }\n}\n\n/**\n * Output a curlirize message\n * @param {Object} message the message\n */\nexport function curlirizeMessage(message) {\n if (!message) return;\n if (state.getCurlirize()) {\n curlirize(message);\n }\n}\n\n/**\n * Prints a string message to console\n *\n * @param {string} message The string message to print\n * @param {string} [type=text] \"text\", \"info\", \"warn\", \"error\" or \"data\". All but\n * type=\"data\" will be written to stderr.\n * @param {boolean} [newline=true] Whether to add a newline at the end of message\n *\n */\nexport function printMessage(message, type = 'text', newline = true) {\n switch (type) {\n case 'data':\n data(message, newline);\n break;\n case 'text':\n text(message, newline);\n break;\n case 'info':\n info(message, newline);\n break;\n case 'warn':\n warn(message, newline);\n break;\n case 'error':\n error(message, newline);\n break;\n default:\n text(message, newline);\n }\n}\n\n/**\n * Creates a progress bar on stderr\n *\n * Example:\n * [========================================] 100% | 49/49 | Analyzing journey - transactional_auth\n *\n * @param {Number} total The total number of entries to track progress for\n * @param {String} message optional progress bar message\n * @param {Object} options progress bar configuration options\n *\n */\nexport function createProgressBar(\n total,\n message = null,\n options = {\n format: '[{bar}] {percentage}% | {value}/{total} | {data}',\n noTTYOutput: true,\n }\n) {\n let opt = options;\n if (message == null) {\n opt = {\n format: '[{bar}] {percentage}% | {value}/{total}',\n noTTYOutput: true,\n };\n }\n // progressBar = new SingleBar(opt, Presets.legacy); // create only when needed\n // progressBar.start(total, 0, {\n // data: message,\n // });\n multiBarContainer = new MultiBar(opt, Presets.legacy);\n progressBar = multiBarContainer.create(total, 0, {\n data: message,\n });\n}\n\n/**\n * Updates the progress bar by 1\n * @param {string} message optional message to update the progress bar\n *\n */\nexport function updateProgressBar(message = null) {\n if (message)\n progressBar.increment({\n data: message,\n });\n else progressBar.increment();\n}\n\n/**\n * Stop and hide the progress bar\n * @param {*} message optional message to update the progress bar\n */\nexport function stopProgressBar(message = null) {\n if (message)\n progressBar.update({\n data: message,\n });\n // progressBar.stop();\n multiBarContainer.stop();\n multiBarContainer = null;\n}\n\n/**\n * Create the spinner\n * @param {String} message optional spinner message\n */\nexport function showSpinner(message) {\n spinner = createSpinner(message).start();\n}\n\n/**\n * Stop the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function stopSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.stop(options);\n }\n}\n\n/**\n * Succeed the spinner. Stop and render success checkmark with optional message.\n * @param {String} message optional message to update the spinner\n */\nexport function succeedSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.success(options);\n }\n}\n\n/**\n * Warn the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function warnSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.warn(options);\n }\n}\n\n/**\n * Fail the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function failSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.error(options);\n }\n}\n\n/**\n * Spin the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function spinSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.update(options);\n spinner.spin();\n }\n}\n\nexport function createProgressIndicator(\n type = 'determinate',\n total = 0,\n message = null\n) {\n if (type === 'determinate') {\n createProgressBar(total, message);\n } else {\n showSpinner(message);\n }\n}\n\nexport function updateProgressIndicator(message) {\n if (!progressBar) {\n spinSpinner(message);\n } else {\n updateProgressBar(message);\n }\n}\n\nexport function stopProgressIndicator(message, status = 'none') {\n if (!progressBar) {\n switch (status) {\n case 'none':\n stopSpinner(message);\n break;\n case 'success':\n succeedSpinner(message);\n break;\n case 'warn':\n warnSpinner(message);\n break;\n case 'fail':\n failSpinner(message);\n break;\n default:\n stopSpinner(message);\n break;\n }\n } else {\n stopProgressBar(message);\n }\n}\n\n/**\n * Create an empty table\n * @param {string[]} head header row as an array of strings\n * @returns {any} an empty table\n */\nexport function createTable(head) {\n const table = new Table({\n head,\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0, head: ['brightCyan'] },\n });\n return table;\n}\n\n/**\n * Create a new key/value table\n * @returns {any} an empty key/value table\n */\nexport function createKeyValueTable() {\n const table = new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0 },\n wordWrap: true,\n });\n return table;\n}\n\n/**\n * Helper function to determine the total depth of an object\n * @param {Object} object input object\n * @returns {Number} total depth of the input object\n */\nfunction getObjectDepth(object) {\n return Object(object) === object\n ? 1 + Math.max(-1, ...Object.values(object).map(getObjectDepth))\n : 0;\n}\n\n/**\n * Helper function to determine if an object has values\n * @param {Object} object input object\n * @returns {boolean} true of the object or any of its sub-objects contain values, false otherwise\n */\nfunction hasValues(object) {\n let has = false;\n const keys = Object.keys(object);\n for (const key of keys) {\n if (Object(object[key]) !== object[key]) {\n return true;\n }\n has = has || hasValues(object[key]);\n }\n return has;\n}\n\n/**\n * Helper function (recursive) to add rows to an object table\n * @param {object} object object to render\n * @param {number} depth total depth of initial object\n * @param {number} level current level\n * @param {any} table the object table to add the rows to\n * @returns the updated object table\n */\nfunction addRows(object, depth, level, table, keyMap) {\n const space = ' ';\n const keys = Object.keys(object);\n for (const key of keys) {\n if (Object(object[key]) !== object[key]) {\n if (level === 1) {\n table.push([\n keyMap[key] ? keyMap[key].brightCyan : key['brightCyan'],\n object[key],\n ]);\n } else {\n table.push([\n {\n hAlign: 'right',\n content: keyMap[key] ? keyMap[key].gray : key.gray,\n },\n object[key],\n ]);\n }\n }\n }\n for (const key of keys) {\n if (Object(object[key]) === object[key]) {\n // only print header if there are any values below\n if (hasValues(object[key])) {\n let indention = new Array(level).fill(space).join('');\n if (level < 3) indention = `\\n${indention}`;\n table.push([\n indention.concat(\n keyMap[key] ? keyMap[key].brightCyan : key['brightCyan']\n ),\n '',\n ]);\n }\n // eslint-disable-next-line no-param-reassign\n table = addRows(object[key], depth, level + 1, table, keyMap);\n }\n }\n return table;\n}\n\n/**\n * Create and populate an object table from any JSON object. Use for describe commands.\n * @param {Object} object JSON object to create\n * @returns {any} a table that can be printed to the console\n */\nexport function createObjectTable(object, keyMap = {}) {\n // eslint-disable-next-line no-param-reassign\n const depth = getObjectDepth(object);\n // eslint-disable-next-line no-param-reassign\n const level = 0;\n // eslint-disable-next-line no-param-reassign\n const table = new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0, head: ['brightCyan'] },\n });\n addRows(object, depth, level + 1, table, keyMap);\n return table;\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,OAAO,QAAQ,cAAc;AAChD,SAASC,aAAa,QAAQ,aAAa;AAC3C,OAAOC,KAAK,MAAM,YAAY;AAC9B,SAASC,iBAAiB,EAAEC,KAAK,QAAQ,uBAAuB;AAChE,OAAOC,KAAK,MAAM,QAAQ;AAE1BA,KAAK,CAACC,MAAM,EA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AAE,CACH,CAAC;MACJ;MACA;MACApB,KAAK,GAAGqB,OAAO,CAACV,MAAM,CAACS,GAAG,CAAC,EAAEpE,KAAK,EAAEsE,KAAK,GAAG,CAAC,EAAEtB,KAAK,EAAEuB,MAAM,CAAC;IAC/D;EACF;EACA,OAAOvB,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASmC,iBAAiB,CAACxB,MAAM,EAAEY,MAAM,GAAG,CAAC,CAAC,EAAE;EACrD;EACA,MAAMvE,KAAK,GAAG0D,cAAc,CAACC,MAAM,CAAC;EACpC;EACA,MAAMW,KAAK,GAAG,CAAC;EACf;EACA,MAAMtB,KAAK,GAAG,IAAIjE,KAAK,CAAC;IACtBkE,KAAK,EAAE;MACLC,GAAG,EAAE,EAAE;MACP,SAAS,EAAE,EAAE;MACb,UAAU,EAAE,EAAE;MACd,WAAW,EAAE,EAAE;MACfC,MAAM,EAAE,EAAE;MACV,YAAY,EAAE,EAAE;MAChB,aAAa,EAAE,EAAE;MACjB,cAAc,EAAE,EAAE;MAClBC,IAAI,EAAE,EAAE;MACR,UAAU,EAAE,EAAE;MACdC,GAAG,EAAE,EAAE;MACP,SAAS,EAAE,EAAE;MACbC,KAAK,EAAE,EAAE;MACT,WAAW,EAAE;IACf,CAAC;IACDC,KAAK,EAAE;MAAE,cAAc,EAAE,CAAC;MAAE,eAAe,EAAE,CAAC;MAAER,IAAI,EAAE,CAAC,YAAY;IAAE;EACvE,CAAC,CAAC;EACFsB,OAAO,CAACV,MAAM,EAAE3D,KAAK,EAAEsE,KAAK,GAAG,CAAC,EAAEtB,KAAK,EAAEuB,MAAM,CAAC;EAChD,OAAOvB,KAAK;AACd"}
1
+ {"version":3,"file":"Console.js","names":["MultiBar","Presets","createSpinner","Table","ExportImportUtils","state","Color","enable","appendTextToFile","multiBarContainer","progressBar","spinner","data","message","newline","getOutputFile","JSON","stringify","console","dir","depth","log","process","stdout","write","text","error","stderr","info","warn","debug","curlirize","verboseMessage","getVerbose","debugMessage","getDebug","curlirizeMessage","getCurlirize","printMessage","type","createProgressBar","total","options","format","noTTYOutput","opt","legacy","create","updateProgressBar","increment","stopProgressBar","update","stop","showSpinner","start","stopSpinner","succeedSpinner","success","warnSpinner","failSpinner","spinSpinner","spin","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","status","createTable","head","table","chars","top","bottom","left","mid","right","style","createKeyValueTable","wordWrap","getObjectDepth","object","Object","Math","max","values","map","hasValues","has","keys","key","addRows","level","keyMap","space","push","brightCyan","hAlign","content","gray","indention","Array","fill","join","concat","createObjectTable"],"sources":["utils/Console.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { MultiBar, Presets } from 'cli-progress';\nimport { createSpinner } from 'nanospinner';\nimport Table from 'cli-table3';\nimport { ExportImportUtils, state } from '@rockcarver/frodo-lib';\nimport Color from 'colors';\n\nColor.enable();\n\nconst { appendTextToFile } = ExportImportUtils;\n\nlet multiBarContainer = null;\nlet progressBar = null;\nlet spinner = null;\n\n/**\n * Output a message in default color to stdout or append to `state.getOutputFile()`\n * @param {string | object} message the message\n */\nfunction data(message: string | object, newline = true) {\n if (!message) return;\n if (state.getOutputFile()) {\n if (typeof message === 'object') {\n message = JSON.stringify(message, null, 2);\n }\n if (newline) {\n message += '\\n';\n }\n appendTextToFile(message, state.getOutputFile());\n } else if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.log(message);\n } else {\n process.stdout.write(message);\n }\n}\n\n/**\n * Output a default color message to stderr\n * @param {Object} message the message\n */\nfunction text(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message);\n } else {\n process.stderr.write(message);\n }\n}\n\n/**\n * Output a message in bright cyan to stderr\n * @param {Object} message the message\n */\nfunction info(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['brightCyan']);\n } else {\n process.stderr.write(message['brightCyan']);\n }\n}\n\n/**\n * Output a message in yellow to stderr\n * @param {Object} message the message\n */\nfunction warn(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['yellow']);\n } else {\n process.stderr.write(message['yellow']);\n }\n}\n\n/**\n * Output a message in bright red to stderr\n * @param {Object} message the message\n */\nfunction error(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 3 });\n } else if (newline) {\n console.error(message['brightRed']);\n } else {\n process.stderr.write(message['brightRed']);\n }\n}\n\n/**\n * Output a debug message\n * @param {string | object} message the message\n */\nfunction debug(message: string | object, newline = true) {\n if (!message) return;\n if (typeof message === 'object') {\n console.dir(message, { depth: 6 });\n } else if (newline) {\n console.error(message['brightMagenta']);\n } else {\n process.stderr.write(message['brightMagenta']);\n }\n}\n\n/**\n * Output a curlirize message\n * @param {string} message the message\n */\nfunction curlirize(message: string) {\n if (!message) return;\n console.error(message['brightBlue']);\n}\n\n/**\n * Output a message in default color to stderr\n * @param {Object} message the message\n */\nexport function verboseMessage(message) {\n if (!message) return;\n if (state.getVerbose()) {\n text(message);\n }\n}\n\n/**\n * Output a debug message\n * @param {Object} message the message\n */\nexport function debugMessage(message) {\n if (!message) return;\n if (state.getDebug()) {\n debug(message);\n }\n}\n\n/**\n * Output a curlirize message\n * @param {Object} message the message\n */\nexport function curlirizeMessage(message) {\n if (!message) return;\n if (state.getCurlirize()) {\n curlirize(message);\n }\n}\n\n/**\n * Prints a string message to console\n *\n * @param {string} message The string message to print\n * @param {string} [type=text] \"text\", \"info\", \"warn\", \"error\" or \"data\". All but\n * type=\"data\" will be written to stderr.\n * @param {boolean} [newline=true] Whether to add a newline at the end of message\n *\n */\nexport function printMessage(message, type = 'text', newline = true) {\n switch (type) {\n case 'data':\n data(message, newline);\n break;\n case 'text':\n text(message, newline);\n break;\n case 'info':\n info(message, newline);\n break;\n case 'warn':\n warn(message, newline);\n break;\n case 'error':\n error(message, newline);\n break;\n default:\n text(message, newline);\n }\n}\n\n/**\n * Creates a progress bar on stderr\n *\n * Example:\n * [========================================] 100% | 49/49 | Analyzing journey - transactional_auth\n *\n * @param {Number} total The total number of entries to track progress for\n * @param {String} message optional progress bar message\n * @param {Object} options progress bar configuration options\n *\n */\nexport function createProgressBar(\n total,\n message = null,\n options = {\n format: '[{bar}] {percentage}% | {value}/{total} | {data}',\n noTTYOutput: true,\n }\n) {\n let opt = options;\n if (message == null) {\n opt = {\n format: '[{bar}] {percentage}% | {value}/{total}',\n noTTYOutput: true,\n };\n }\n // progressBar = new SingleBar(opt, Presets.legacy); // create only when needed\n // progressBar.start(total, 0, {\n // data: message,\n // });\n multiBarContainer = new MultiBar(opt, Presets.legacy);\n progressBar = multiBarContainer.create(total, 0, {\n data: message,\n });\n}\n\n/**\n * Updates the progress bar by 1\n * @param {string} message optional message to update the progress bar\n *\n */\nexport function updateProgressBar(message = null) {\n if (message)\n progressBar.increment({\n data: message,\n });\n else progressBar.increment();\n}\n\n/**\n * Stop and hide the progress bar\n * @param {*} message optional message to update the progress bar\n */\nexport function stopProgressBar(message = null) {\n if (message)\n progressBar.update({\n data: message,\n });\n // progressBar.stop();\n multiBarContainer.stop();\n multiBarContainer = null;\n}\n\n/**\n * Create the spinner\n * @param {String} message optional spinner message\n */\nexport function showSpinner(message) {\n spinner = createSpinner(message).start();\n}\n\n/**\n * Stop the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function stopSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.stop(options);\n }\n}\n\n/**\n * Succeed the spinner. Stop and render success checkmark with optional message.\n * @param {String} message optional message to update the spinner\n */\nexport function succeedSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.success(options);\n }\n}\n\n/**\n * Warn the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function warnSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.warn(options);\n }\n}\n\n/**\n * Fail the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function failSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.error(options);\n }\n}\n\n/**\n * Spin the spinner\n * @param {String} message optional message to update the spinner\n */\nexport function spinSpinner(message = null) {\n if (spinner) {\n let options = {};\n if (message) options = { text: message };\n spinner.update(options);\n spinner.spin();\n }\n}\n\nexport function createProgressIndicator(\n type = 'determinate',\n total = 0,\n message = null\n) {\n if (type === 'determinate') {\n createProgressBar(total, message);\n } else {\n showSpinner(message);\n }\n}\n\nexport function updateProgressIndicator(message) {\n if (!progressBar) {\n spinSpinner(message);\n } else {\n updateProgressBar(message);\n }\n}\n\nexport function stopProgressIndicator(message, status = 'none') {\n if (!progressBar) {\n switch (status) {\n case 'none':\n stopSpinner(message);\n break;\n case 'success':\n succeedSpinner(message);\n break;\n case 'warn':\n warnSpinner(message);\n break;\n case 'fail':\n failSpinner(message);\n break;\n default:\n stopSpinner(message);\n break;\n }\n } else {\n stopProgressBar(message);\n }\n}\n\n/**\n * Create an empty table\n * @param {string[]} head header row as an array of strings\n * @returns {any} an empty table\n */\nexport function createTable(head) {\n const table = new Table({\n head,\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0, head: ['brightCyan'] },\n });\n return table;\n}\n\n/**\n * Create a new key/value table\n * @returns {any} an empty key/value table\n */\nexport function createKeyValueTable() {\n const table = new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0 },\n wordWrap: true,\n });\n return table;\n}\n\n/**\n * Helper function to determine the total depth of an object\n * @param {Object} object input object\n * @returns {Number} total depth of the input object\n */\nfunction getObjectDepth(object) {\n return Object(object) === object\n ? 1 + Math.max(-1, ...Object.values(object).map(getObjectDepth))\n : 0;\n}\n\n/**\n * Helper function to determine if an object has values\n * @param {Object} object input object\n * @returns {boolean} true of the object or any of its sub-objects contain values, false otherwise\n */\nfunction hasValues(object) {\n let has = false;\n const keys = Object.keys(object);\n for (const key of keys) {\n if (Object(object[key]) !== object[key]) {\n return true;\n }\n has = has || hasValues(object[key]);\n }\n return has;\n}\n\n/**\n * Helper function (recursive) to add rows to an object table\n * @param {object} object object to render\n * @param {number} depth total depth of initial object\n * @param {number} level current level\n * @param {any} table the object table to add the rows to\n * @param {Object} keyMap optional JSON map to map raw config names to human readable names {'raw': 'readable'}\n * @returns the updated object table\n */\nfunction addRows(object, depth, level, table, keyMap) {\n const space = ' ';\n const keys = Object.keys(object);\n for (const key of keys) {\n if (Object(object[key]) !== object[key]) {\n if (level === 1) {\n table.push([\n keyMap[key] ? keyMap[key].brightCyan : key['brightCyan'],\n object[key],\n ]);\n } else {\n table.push([\n {\n hAlign: 'right',\n content: keyMap[key] ? keyMap[key].gray : key.gray,\n },\n object[key],\n ]);\n }\n }\n }\n for (const key of keys) {\n if (Object(object[key]) === object[key]) {\n // only print header if there are any values below\n if (hasValues(object[key])) {\n let indention = new Array(level).fill(space).join('');\n if (level < 3) indention = `\\n${indention}`;\n table.push([\n indention.concat(\n keyMap[key] ? keyMap[key].brightCyan : key['brightCyan']\n ),\n '',\n ]);\n }\n // eslint-disable-next-line no-param-reassign\n table = addRows(object[key], depth, level + 1, table, keyMap);\n }\n }\n return table;\n}\n\n/**\n * Create and populate an object table from any JSON object. Use for describe commands.\n * @param {Object} object JSON object to create\n * @param {Object} keyMap optional JSON map to map raw config names to human readable names {'raw': 'readable'}\n * @returns {any} a table that can be printed to the console\n */\nexport function createObjectTable(object, keyMap = {}) {\n // eslint-disable-next-line no-param-reassign\n const depth = getObjectDepth(object);\n // eslint-disable-next-line no-param-reassign\n const level = 0;\n // eslint-disable-next-line no-param-reassign\n const table = new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n },\n style: { 'padding-left': 0, 'padding-right': 0, head: ['brightCyan'] },\n });\n addRows(object, depth, level + 1, table, keyMap);\n return table;\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,OAAO,QAAQ,cAAc;AAChD,SAASC,aAAa,QAAQ,aAAa;AAC3C,OAAOC,KAAK,MAAM,YAAY;AAC9B,SAASC,iBAAiB,EAAEC,KAAK,QAAQ,uBAAuB;AAChE,OAAOC,KAAK,MAAM,QAAQ;AAE1BA,KAAK,CAACC,MAAM,EAAE;AAEd,MAAM;EAAEC;AAAiB,CAAC,GAAGJ,iBAAiB;AAE9C,IAAIK,iBAAiB,GAAG,IAAI;AAC5B,IAAIC,WAAW,GAAG,IAAI;AACtB,IAAIC,OAAO,GAAG,IAAI;;AAElB;AACA;AACA;AACA;AACA,SAASC,IAAI,CAACC,OAAwB,EAAEC,OAAO,GAAG,IAAI,EAAE;EACtD,IAAI,CAACD,OAAO,EAAE;EACd,IAAIR,KAAK,CAACU,aAAa,EAAE,EAAE;IACzB,IAAI,OAAOF,OAAO,KAAK,QAAQ,EAAE;MAC/BA,OAAO,GAAGG,IAAI,CAACC,SAAS,CAACJ,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C;IACA,IAAIC,OAAO,EAAE;MACXD,OAAO,IAAI,IAAI;IACjB;IACAL,gBAAgB,CAACK,OAAO,EAAER,KAAK,CAACU,aAAa,EAAE,CAAC;EAClD,CAAC,MAAM,IAAI,OAAOF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;MACV,YAAY,EAAE,EAAE;MAChB,aAAa,EAAE,EAAE;MACjB,cAAc,EAAE,EAAE;MAClBC,IAAI,EAAE,EAAE;MACR,UAAU,EAAE,EAAE;MACdC,GAAG,EAAE,EAAE;MACP,SAAS,EAAE,EAAE;MACbC,KAAK,EAAE,EAAE;MACT,WAAW,EAAE;IACf,CAAC;IACDC,KAAK,EAAE;MAAE,cAAc,EAAE,CAAC;MAAE,eAAe,EAAE,CAAC;MAAER,IAAI,EAAE,CAAC,YAAY;IAAE;EACvE,CAAC,CAAC;EACFsB,OAAO,CAACV,MAAM,EAAE3D,KAAK,EAAEsE,KAAK,GAAG,CAAC,EAAEtB,KAAK,EAAEuB,MAAM,CAAC;EAChD,OAAOvB,KAAK;AACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rockcarver/frodo-cli",
3
- "version": "0.23.1-4",
3
+ "version": "0.23.1-6",
4
4
  "type": "module",
5
5
  "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
6
6
  "keywords": [
@@ -99,7 +99,7 @@
99
99
  ]
100
100
  },
101
101
  "dependencies": {
102
- "@rockcarver/frodo-lib": "0.18.9-4",
102
+ "@rockcarver/frodo-lib": "0.18.9-5",
103
103
  "chokidar": "^3.5.3",
104
104
  "cli-progress": "^3.11.2",
105
105
  "cli-table3": "^0.6.3",