@rockcarver/frodo-cli 0.13.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/babel.config.esm.json +6 -0
  3. package/package.json +14 -7
  4. package/src/{app.js → app.ts} +14 -14
  5. package/src/cli/_template/{cmd-delete.js → cmd-delete.ts} +0 -0
  6. package/src/cli/_template/{cmd-describe.js → cmd-describe.ts} +0 -0
  7. package/src/cli/_template/{cmd-export.js → cmd-export.ts} +0 -0
  8. package/src/cli/_template/{cmd-import.js → cmd-import.ts} +0 -0
  9. package/src/cli/_template/{cmd-list.js → cmd-list.ts} +0 -0
  10. package/src/cli/_template/{cmd-sub1-delete.js → cmd-sub1-delete.ts} +0 -0
  11. package/src/cli/_template/{cmd-sub1-describe.js → cmd-sub1-describe.ts} +0 -0
  12. package/src/cli/_template/{cmd-sub1-export.js → cmd-sub1-export.ts} +0 -0
  13. package/src/cli/_template/{cmd-sub1-import.js → cmd-sub1-import.ts} +0 -0
  14. package/src/cli/_template/{cmd-sub1-list.js → cmd-sub1-list.ts} +0 -0
  15. package/src/cli/_template/{cmd-sub1.js → cmd-sub1.ts} +0 -0
  16. package/src/cli/_template/{cmd-sub2-delete.js → cmd-sub2-delete.ts} +0 -0
  17. package/src/cli/_template/{cmd-sub2-describe.js → cmd-sub2-describe.ts} +0 -0
  18. package/src/cli/_template/{cmd-sub2-export.js → cmd-sub2-export.ts} +0 -0
  19. package/src/cli/_template/{cmd-sub2-import.js → cmd-sub2-import.ts} +0 -0
  20. package/src/cli/_template/{cmd-sub2-list.js → cmd-sub2-list.ts} +0 -0
  21. package/src/cli/_template/{cmd-sub2.js → cmd-sub2.ts} +0 -0
  22. package/src/cli/_template/{cmd.js → cmd.ts} +0 -0
  23. package/src/cli/admin/{admin-add-autoid-static-user-mapping.js → admin-add-autoid-static-user-mapping.ts} +0 -0
  24. package/src/cli/admin/{admin-create-oauth2-client-with-admin-privileges.js → admin-create-oauth2-client-with-admin-privileges.ts} +0 -0
  25. package/src/cli/admin/{admin-get-access-token.js → admin-get-access-token.ts} +0 -0
  26. package/src/cli/admin/{admin-grant-oauth2-client-admin-privileges.js → admin-grant-oauth2-client-admin-privileges.ts} +0 -0
  27. package/src/cli/admin/{admin-hide-generic-extension-attributes.js → admin-hide-generic-extension-attributes.ts} +0 -0
  28. package/src/cli/admin/{admin-list-oauth2-clients-with-admin-privileges.js → admin-list-oauth2-clients-with-admin-privileges.ts} +0 -0
  29. package/src/cli/admin/{admin-list-oauth2-clients-with-custom-privileges.js → admin-list-oauth2-clients-with-custom-privileges.ts} +0 -0
  30. package/src/cli/admin/{admin-list-static-user-mappings.js → admin-list-static-user-mappings.ts} +0 -0
  31. package/src/cli/admin/{admin-remove-static-user-mapping.js → admin-remove-static-user-mapping.ts} +0 -0
  32. package/src/cli/admin/{admin-repair-org-model.js → admin-repair-org-model.ts} +7 -1
  33. package/src/cli/admin/{admin-revoke-oauth2-client-admin-privileges.js → admin-revoke-oauth2-client-admin-privileges.ts} +0 -0
  34. package/src/cli/admin/{admin-show-generic-extension-attributes.js → admin-show-generic-extension-attributes.ts} +0 -0
  35. package/src/cli/admin/{admin.js → admin.ts} +0 -0
  36. package/src/cli/app/{app-delete.js → app-delete.ts} +0 -0
  37. package/src/cli/app/{app-describe.js → app-describe.ts} +0 -0
  38. package/src/cli/app/{app-export.js → app-export.ts} +0 -0
  39. package/src/cli/app/{app-import.js → app-import.ts} +0 -0
  40. package/src/cli/app/{app-list.js → app-list.ts} +0 -0
  41. package/src/cli/app/{app.js → app.ts} +0 -0
  42. package/src/cli/{cmd_common.js → cmd_common.ts} +0 -0
  43. package/src/cli/conn/{conn-add.js → conn-add.ts} +0 -0
  44. package/src/cli/conn/{conn-delete.js → conn-delete.ts} +0 -0
  45. package/src/cli/conn/{conn-describe.js → conn-describe.ts} +0 -0
  46. package/src/cli/conn/{conn-list.js → conn-list.ts} +0 -0
  47. package/src/cli/conn/{conn.js → conn.ts} +0 -0
  48. package/src/cli/email/{email-template-export.js → email-template-export.ts} +0 -0
  49. package/src/cli/email/{email-template-import.js → email-template-import.ts} +0 -0
  50. package/src/cli/email/{email-template-list.js → email-template-list.ts} +0 -0
  51. package/src/cli/email/{email-template.js → email-template.ts} +0 -0
  52. package/src/cli/email/{email.js → email.ts} +0 -0
  53. package/src/cli/esv/{esv-apply.js → esv-apply.ts} +0 -0
  54. package/src/cli/esv/{esv-secret-create.js → esv-secret-create.ts} +0 -0
  55. package/src/cli/esv/{esv-secret-delete.js → esv-secret-delete.ts} +0 -0
  56. package/src/cli/esv/{esv-secret-describe.js → esv-secret-describe.ts} +0 -0
  57. package/src/cli/esv/{esv-secret-export.js → esv-secret-export.ts} +0 -0
  58. package/src/cli/esv/{esv-secret-import.js → esv-secret-import.ts} +0 -0
  59. package/src/cli/esv/{esv-secret-list.js → esv-secret-list.ts} +0 -0
  60. package/src/cli/esv/{esv-secret-set.js → esv-secret-set.ts} +0 -0
  61. package/src/cli/esv/{esv-secret-version-activate.js → esv-secret-version-activate.ts} +0 -0
  62. package/src/cli/esv/{esv-secret-version-create.js → esv-secret-version-create.ts} +0 -0
  63. package/src/cli/esv/{esv-secret-version-deactivate.js → esv-secret-version-deactivate.ts} +0 -0
  64. package/src/cli/esv/{esv-secret-version-delete.js → esv-secret-version-delete.ts} +0 -0
  65. package/src/cli/esv/{esv-secret-version-list.js → esv-secret-version-list.ts} +0 -0
  66. package/src/cli/esv/{esv-secret-version.js → esv-secret-version.ts} +0 -0
  67. package/src/cli/esv/{esv-secret.js → esv-secret.ts} +0 -0
  68. package/src/cli/esv/{esv-variable-create.js → esv-variable-create.ts} +0 -0
  69. package/src/cli/esv/{esv-variable-delete.js → esv-variable-delete.ts} +0 -0
  70. package/src/cli/esv/{esv-variable-describe.js → esv-variable-describe.ts} +0 -0
  71. package/src/cli/esv/{esv-variable-export.js → esv-variable-export.ts} +0 -0
  72. package/src/cli/esv/{esv-variable-import.js → esv-variable-import.ts} +0 -0
  73. package/src/cli/esv/{esv-variable-list.js → esv-variable-list.ts} +0 -0
  74. package/src/cli/esv/{esv-variable-set.js → esv-variable-set.ts} +0 -0
  75. package/src/cli/esv/{esv-variable.js → esv-variable.ts} +0 -0
  76. package/src/cli/esv/{esv.js → esv.ts} +0 -0
  77. package/src/cli/idm/{idm-count.js → idm-count.ts} +0 -0
  78. package/src/cli/idm/{idm-export.js → idm-export.ts} +0 -0
  79. package/src/cli/idm/{idm-list.js → idm-list.ts} +0 -0
  80. package/src/cli/idm/{idm.js → idm.ts} +0 -0
  81. package/src/cli/idp/{idp-export.js → idp-export.ts} +0 -0
  82. package/src/cli/idp/{idp-import.js → idp-import.ts} +0 -0
  83. package/src/cli/idp/{idp-list.js → idp-list.ts} +0 -0
  84. package/src/cli/idp/{idp.js → idp.ts} +0 -0
  85. package/src/cli/info/{info.js → info.ts} +1 -1
  86. package/src/cli/journey/journey-delete.e2e.test_.ts +380 -0
  87. package/src/cli/journey/{journey-delete.js → journey-delete.ts} +0 -0
  88. package/src/cli/journey/{journey-describe.js → journey-describe.ts} +60 -12
  89. package/src/cli/journey/{journey-export.js → journey-export.ts} +0 -0
  90. package/src/cli/journey/{journey-import.js → journey-import.ts} +0 -0
  91. package/src/cli/journey/journey-list.e2e.test_.ts +142 -0
  92. package/src/cli/journey/{journey-list.js → journey-list.ts} +0 -0
  93. package/src/cli/journey/{journey-prune.js → journey-prune.ts} +0 -0
  94. package/src/cli/journey/{journey.js → journey.ts} +0 -0
  95. package/src/cli/logging/{logs-list.js → logs-list.ts} +0 -0
  96. package/src/cli/logging/{logs-tail.js → logs-tail.ts} +0 -0
  97. package/src/cli/logging/{logs.js → logs.ts} +0 -0
  98. package/src/cli/realm/{realm-add-custom-domain.js → realm-add-custom-domain.ts} +0 -0
  99. package/src/cli/realm/{realm-describe.js → realm-describe.ts} +0 -0
  100. package/src/cli/realm/{realm-list.js → realm-list.ts} +0 -0
  101. package/src/cli/realm/{realm-remove-custom-domain.js → realm-remove-custom-domain.ts} +0 -0
  102. package/src/cli/realm/{realm.js → realm.ts} +0 -0
  103. package/src/cli/saml/{saml-cot-export.js → saml-cot-export.ts} +0 -0
  104. package/src/cli/saml/{saml-cot-import.js → saml-cot-import.ts} +0 -0
  105. package/src/cli/saml/{saml-cot-list.js → saml-cot-list.ts} +0 -0
  106. package/src/cli/saml/{saml-cot.js → saml-cot.ts} +0 -0
  107. package/src/cli/saml/{saml-describe.js → saml-describe.ts} +0 -0
  108. package/src/cli/saml/{saml-export.js → saml-export.ts} +0 -0
  109. package/src/cli/saml/{saml-import.js → saml-import.ts} +0 -0
  110. package/src/cli/saml/{saml-list.js → saml-list.ts} +0 -0
  111. package/src/cli/saml/{saml-metadata-export.js → saml-metadata-export.ts} +0 -0
  112. package/src/cli/saml/{saml-metadata.js → saml-metadata.ts} +0 -0
  113. package/src/cli/saml/{saml.js → saml.ts} +0 -0
  114. package/src/cli/script/{script-delete.js → script-delete.ts} +0 -0
  115. package/src/cli/script/{script-describe.js → script-describe.ts} +0 -0
  116. package/src/cli/script/{script-export.js → script-export.ts} +0 -0
  117. package/src/cli/script/{script-import.js → script-import.ts} +0 -0
  118. package/src/cli/script/{script-list.js → script-list.ts} +0 -0
  119. package/src/cli/script/{script.js → script.ts} +0 -0
  120. package/src/cli/theme/theme-delete.e2e.test_.ts +178 -0
  121. package/src/cli/theme/{theme-delete.js → theme-delete.ts} +0 -0
  122. package/src/cli/theme/{theme-export.js → theme-export.ts} +0 -0
  123. package/src/cli/theme/{theme-import.js → theme-import.ts} +0 -0
  124. package/src/cli/theme/theme-list.e2e.test_.ts +119 -0
  125. package/src/cli/theme/{theme-list.js → theme-list.ts} +0 -0
  126. package/src/cli/theme/{theme.js → theme.ts} +0 -0
  127. package/src/ops/CirclesOfTrustOps.ts +12 -0
  128. package/src/ops/EmailTemplateOps.ts +19 -0
  129. package/src/ops/IdpOps.ts +11 -0
  130. package/src/ops/JourneyOps.ts +278 -0
  131. package/src/ops/NodeOps.ts +47 -0
  132. package/src/ops/Saml2Ops.ts +24 -0
  133. package/src/ops/ScriptOps.ts +11 -0
  134. package/src/ops/ThemeOps.ts +17 -0
  135. package/src/ops/utils/Wordwrap.ts +11 -0
  136. package/src/storage/{StaticStorage.js → StaticStorage.ts} +0 -0
  137. package/src/utils/{Console.js → Console.ts} +3 -2
  138. package/tsconfig.json +6 -6
@@ -0,0 +1,47 @@
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
+ }
@@ -0,0 +1,24 @@
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
+ }
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,17 @@
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
+ }
@@ -0,0 +1,11 @@
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,9 +1,10 @@
1
1
  import { SingleBar, Presets } from 'cli-progress';
2
2
  import { createSpinner } from 'nanospinner';
3
3
  import Table from 'cli-table3';
4
- // eslint-disable-next-line no-unused-vars
5
- import * as colors from '@colors/colors';
6
4
  import { state } from '@rockcarver/frodo-lib';
5
+ import Color from 'colors';
6
+
7
+ Color.enable();
7
8
 
8
9
  /**
9
10
  * Output a data message
package/tsconfig.json CHANGED
@@ -7,7 +7,7 @@
7
7
  // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
8
  // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
9
  // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
- "disableSolutionSearching": false /* Opt a project out of multi-project reference checking when editing. */,
10
+ // "disableSolutionSearching": true /* Opt a project out of multi-project reference checking when editing. */,
11
11
  // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
12
 
13
13
  /* Language and Environment */
@@ -41,14 +41,14 @@
41
41
 
42
42
  /* JavaScript Support */
43
43
  "allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
44
- "checkJs": true /* Enable error reporting in type-checked JavaScript files. */,
44
+ // "checkJs": true /* Enable error reporting in type-checked JavaScript files. */,
45
45
  // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
46
46
 
47
47
  /* Emit */
48
48
  // "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
49
49
  // "declarationMap": true /* Create sourcemaps for d.ts files. */,
50
50
  // "emitDeclarationOnly": true /* Only output d.ts files and not JavaScript files. */,
51
- // "sourceMap": true /* Create source map files for emitted JavaScript files. */,
51
+ "sourceMap": true /* Create source map files for emitted JavaScript files. */,
52
52
  // "outFile": "./types/index.d.ts" /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */,
53
53
  // "removeComments": true, /* Disable emitting comments. */
54
54
  "noEmit": true /* Disable emitting files from a compilation. */,
@@ -100,7 +100,7 @@
100
100
  "skipDefaultLibCheck": true /* Skip type checking .d.ts files that are included with TypeScript. */,
101
101
  "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
102
  },
103
- "files": ["src/app.js"],
104
- "include": ["src/**/*.js"],
105
- "exclude": ["src/**/*.test.js", "src/**/*.test_.js"]
103
+ "files": ["src/app.ts"],
104
+ "include": ["src/**/*.ts"],
105
+ "exclude": ["src/**/*.test.ts", "src/**/*.test_.ts"]
106
106
  }