contensis-cli 1.0.0-beta.5

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 (95) hide show
  1. package/.vscode/launch.json +15 -0
  2. package/README.md +631 -0
  3. package/cli.js +7 -0
  4. package/dist/commands/connect.js +44 -0
  5. package/dist/commands/connect.js.map +7 -0
  6. package/dist/commands/create.js +55 -0
  7. package/dist/commands/create.js.map +7 -0
  8. package/dist/commands/get.js +121 -0
  9. package/dist/commands/get.js.map +7 -0
  10. package/dist/commands/globalOptions.js +139 -0
  11. package/dist/commands/globalOptions.js.map +7 -0
  12. package/dist/commands/import.js +95 -0
  13. package/dist/commands/import.js.map +7 -0
  14. package/dist/commands/index.js +81 -0
  15. package/dist/commands/index.js.map +7 -0
  16. package/dist/commands/list.js +88 -0
  17. package/dist/commands/list.js.map +7 -0
  18. package/dist/commands/login.js +56 -0
  19. package/dist/commands/login.js.map +7 -0
  20. package/dist/commands/push.js +133 -0
  21. package/dist/commands/push.js.map +7 -0
  22. package/dist/commands/remove.js +77 -0
  23. package/dist/commands/remove.js.map +7 -0
  24. package/dist/commands/set.js +55 -0
  25. package/dist/commands/set.js.map +7 -0
  26. package/dist/index.js +32 -0
  27. package/dist/index.js.map +7 -0
  28. package/dist/localisation/en-GB.js +203 -0
  29. package/dist/localisation/en-GB.js.map +7 -0
  30. package/dist/models/AppError.d.js +2 -0
  31. package/dist/models/AppError.d.js.map +7 -0
  32. package/dist/models/Cache.d.js +2 -0
  33. package/dist/models/Cache.d.js.map +7 -0
  34. package/dist/models/JsModules.d.js +2 -0
  35. package/dist/models/JsModules.d.js.map +7 -0
  36. package/dist/providers/CredentialProvider.js +87 -0
  37. package/dist/providers/CredentialProvider.js.map +7 -0
  38. package/dist/providers/SessionCacheProvider.js +91 -0
  39. package/dist/providers/SessionCacheProvider.js.map +7 -0
  40. package/dist/providers/file-provider.js +113 -0
  41. package/dist/providers/file-provider.js.map +7 -0
  42. package/dist/services/ContensisAuthService.js +75 -0
  43. package/dist/services/ContensisAuthService.js.map +7 -0
  44. package/dist/services/ContensisCliService.js +1110 -0
  45. package/dist/services/ContensisCliService.js.map +7 -0
  46. package/dist/shell.js +261 -0
  47. package/dist/shell.js.map +7 -0
  48. package/dist/util/console.printer.js +194 -0
  49. package/dist/util/console.printer.js.map +7 -0
  50. package/dist/util/csv.formatter.js +50 -0
  51. package/dist/util/csv.formatter.js.map +7 -0
  52. package/dist/util/index.js +94 -0
  53. package/dist/util/index.js.map +7 -0
  54. package/dist/util/json.formatter.js +29 -0
  55. package/dist/util/json.formatter.js.map +7 -0
  56. package/dist/util/logger.js +184 -0
  57. package/dist/util/logger.js.map +7 -0
  58. package/dist/util/xml.formatter.js +51 -0
  59. package/dist/util/xml.formatter.js.map +7 -0
  60. package/dist/version.js +29 -0
  61. package/dist/version.js.map +7 -0
  62. package/esbuild.config.js +49 -0
  63. package/headless-setup.sh +7 -0
  64. package/package.json +59 -0
  65. package/patches/inquirer-command-prompt+0.1.0.patch +27 -0
  66. package/src/commands/connect.ts +23 -0
  67. package/src/commands/create.ts +41 -0
  68. package/src/commands/get.ts +139 -0
  69. package/src/commands/globalOptions.ts +126 -0
  70. package/src/commands/import.ts +89 -0
  71. package/src/commands/index.ts +72 -0
  72. package/src/commands/list.ts +90 -0
  73. package/src/commands/login.ts +33 -0
  74. package/src/commands/push.ts +120 -0
  75. package/src/commands/remove.ts +77 -0
  76. package/src/commands/set.ts +40 -0
  77. package/src/index.ts +19 -0
  78. package/src/localisation/en-GB.ts +211 -0
  79. package/src/models/AppError.d.ts +40 -0
  80. package/src/models/Cache.d.ts +25 -0
  81. package/src/models/JsModules.d.ts +1 -0
  82. package/src/providers/CredentialProvider.ts +88 -0
  83. package/src/providers/SessionCacheProvider.ts +74 -0
  84. package/src/providers/file-provider.ts +72 -0
  85. package/src/services/ContensisAuthService.ts +70 -0
  86. package/src/services/ContensisCliService.ts +1390 -0
  87. package/src/shell.ts +250 -0
  88. package/src/util/console.printer.ts +203 -0
  89. package/src/util/csv.formatter.ts +21 -0
  90. package/src/util/index.ts +67 -0
  91. package/src/util/json.formatter.ts +1 -0
  92. package/src/util/logger.ts +165 -0
  93. package/src/util/xml.formatter.ts +20 -0
  94. package/src/version.ts +1 -0
  95. package/tsconfig.json +22 -0
@@ -0,0 +1,20 @@
1
+ import xml2js from 'xml2js';
2
+ import cleaner from 'deep-cleaner';
3
+ import { Logger } from './logger';
4
+
5
+ export const xmlFormatter = <T>(entries: T | T[]) => {
6
+ try {
7
+ const cleanedEntries = cleaner(cleaner(entries, ['workflow']));
8
+
9
+ const builder = new xml2js.Builder({
10
+ cdata: true,
11
+ rootName: 'Items',
12
+ });
13
+ const xml = builder.buildObject({ Entry: cleanedEntries });
14
+
15
+ return xml;
16
+ } catch (ex) {
17
+ Logger.error(`Problem building XML from entries`, ex);
18
+ return '';
19
+ }
20
+ };
package/src/version.ts ADDED
@@ -0,0 +1 @@
1
+ export const LIB_VERSION = "1.0.0-beta.4";
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "module": "CommonJS",
5
+ "esModuleInterop": true,
6
+ "target": "esnext",
7
+ "noImplicitAny": true,
8
+ "moduleResolution": "node",
9
+ "skipLibCheck": true,
10
+ "sourceMap": true,
11
+ "strict": true,
12
+ "declaration": true,
13
+ "resolveJsonModule": true,
14
+ "outDir": "dist",
15
+ "baseUrl": ".",
16
+ "paths": {
17
+ "~/*": ["src/*", "dist/*"]
18
+ }
19
+ },
20
+ "include": ["src/**/*"],
21
+ "exclude": ["src/tests/**/*"]
22
+ }