contensis-cli 1.0.0-beta.52 → 1.0.0-beta.53

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 (99) hide show
  1. package/.vscode/launch.json +15 -15
  2. package/README.md +1226 -1226
  3. package/dist/commands/connect.js +44 -0
  4. package/dist/commands/connect.js.map +7 -0
  5. package/dist/commands/create.js +75 -0
  6. package/dist/commands/create.js.map +7 -0
  7. package/dist/commands/diff.js +57 -0
  8. package/dist/commands/diff.js.map +7 -0
  9. package/dist/commands/get.js +170 -0
  10. package/dist/commands/get.js.map +7 -0
  11. package/dist/commands/globalOptions.js +144 -0
  12. package/dist/commands/globalOptions.js.map +7 -0
  13. package/dist/commands/import.js +121 -0
  14. package/dist/commands/import.js.map +7 -0
  15. package/dist/commands/index.js +89 -0
  16. package/dist/commands/index.js.map +7 -0
  17. package/dist/commands/list.js +99 -0
  18. package/dist/commands/list.js.map +7 -0
  19. package/dist/commands/login.js +56 -0
  20. package/dist/commands/login.js.map +7 -0
  21. package/dist/commands/push.js +137 -0
  22. package/dist/commands/push.js.map +7 -0
  23. package/dist/commands/release.js +47 -0
  24. package/dist/commands/release.js.map +7 -0
  25. package/dist/commands/remove.js +79 -0
  26. package/dist/commands/remove.js.map +7 -0
  27. package/dist/commands/set.js +96 -0
  28. package/dist/commands/set.js.map +7 -0
  29. package/dist/index.js +32 -0
  30. package/dist/index.js.map +7 -0
  31. package/dist/localisation/en-GB.js +253 -0
  32. package/dist/localisation/en-GB.js.map +7 -0
  33. package/dist/models/AppError.d.js +2 -0
  34. package/dist/models/AppError.d.js.map +7 -0
  35. package/dist/models/Cache.d.js +2 -0
  36. package/dist/models/Cache.d.js.map +7 -0
  37. package/dist/models/JsModules.d.js +2 -0
  38. package/dist/models/JsModules.d.js.map +7 -0
  39. package/dist/providers/CredentialProvider.js +116 -0
  40. package/dist/providers/CredentialProvider.js.map +7 -0
  41. package/dist/providers/SessionCacheProvider.js +111 -0
  42. package/dist/providers/SessionCacheProvider.js.map +7 -0
  43. package/dist/providers/file-provider.js +117 -0
  44. package/dist/providers/file-provider.js.map +7 -0
  45. package/dist/services/ContensisAuthService.js +75 -0
  46. package/dist/services/ContensisAuthService.js.map +7 -0
  47. package/dist/services/ContensisCliService.js +1374 -0
  48. package/dist/services/ContensisCliService.js.map +7 -0
  49. package/dist/shell.js +278 -0
  50. package/dist/shell.js.map +7 -0
  51. package/dist/util/console.printer.js +317 -0
  52. package/dist/util/console.printer.js.map +7 -0
  53. package/dist/util/csv.formatter.js +50 -0
  54. package/dist/util/csv.formatter.js.map +7 -0
  55. package/dist/util/index.js +97 -0
  56. package/dist/util/index.js.map +7 -0
  57. package/dist/util/json.formatter.js +29 -0
  58. package/dist/util/json.formatter.js.map +7 -0
  59. package/dist/util/logger.js +216 -0
  60. package/dist/util/logger.js.map +7 -0
  61. package/dist/util/xml.formatter.js +51 -0
  62. package/dist/util/xml.formatter.js.map +7 -0
  63. package/dist/version.js +29 -0
  64. package/dist/version.js.map +7 -0
  65. package/esbuild.config.js +49 -49
  66. package/headless-setup.sh +6 -6
  67. package/package.json +59 -59
  68. package/src/commands/connect.ts +24 -24
  69. package/src/commands/create.ts +70 -70
  70. package/src/commands/diff.ts +41 -41
  71. package/src/commands/get.ts +214 -214
  72. package/src/commands/globalOptions.ts +127 -127
  73. package/src/commands/import.ts +128 -128
  74. package/src/commands/index.ts +80 -80
  75. package/src/commands/list.ts +116 -116
  76. package/src/commands/login.ts +34 -34
  77. package/src/commands/push.ts +127 -127
  78. package/src/commands/release.ts +32 -32
  79. package/src/commands/remove.ts +85 -85
  80. package/src/commands/set.ts +96 -96
  81. package/src/index.ts +19 -19
  82. package/src/localisation/en-GB.ts +289 -289
  83. package/src/models/AppError.d.ts +40 -40
  84. package/src/models/Cache.d.ts +25 -25
  85. package/src/models/JsModules.d.ts +1 -1
  86. package/src/providers/CredentialProvider.ts +121 -121
  87. package/src/providers/SessionCacheProvider.ts +101 -101
  88. package/src/providers/file-provider.ts +76 -76
  89. package/src/services/ContensisAuthService.ts +70 -70
  90. package/src/services/ContensisCliService.ts +1745 -1745
  91. package/src/shell.ts +270 -270
  92. package/src/util/console.printer.ts +371 -371
  93. package/src/util/csv.formatter.ts +21 -21
  94. package/src/util/index.ts +73 -73
  95. package/src/util/json.formatter.ts +1 -1
  96. package/src/util/logger.ts +234 -234
  97. package/src/util/xml.formatter.ts +20 -20
  98. package/src/version.ts +1 -1
  99. package/tsconfig.json +22 -22
@@ -1,70 +1,70 @@
1
- import { NodejsClient } from 'contensis-management-api/lib/client';
2
- import { ClientGrants, ClientGrantType } from 'contensis-core-api';
3
-
4
- class ContensisAuthService {
5
- private client: NodejsClient;
6
-
7
- constructor({
8
- clientId = '',
9
- clientSecret = '',
10
- username,
11
- password,
12
- refreshToken,
13
- projectId,
14
- rootUrl,
15
- }: {
16
- clientId?: string;
17
- clientSecret?: string;
18
- username?: string;
19
- password?: string;
20
- refreshToken?: string;
21
- projectId: string;
22
- rootUrl: string;
23
- }) {
24
- let credentials: {
25
- clientType: ClientGrantType;
26
- clientDetails: ClientGrants;
27
- };
28
- if (username && password) {
29
- credentials = {
30
- clientType: 'contensis_classic',
31
- clientDetails: {
32
- username,
33
- password,
34
- },
35
- };
36
- } else if (refreshToken) {
37
- credentials = {
38
- clientType: 'contensis_classic_refresh_token',
39
- clientDetails: {
40
- refreshToken,
41
- },
42
- };
43
- } else {
44
- credentials = {
45
- clientType: 'client_credentials',
46
- clientDetails: {
47
- clientId,
48
- clientSecret,
49
- },
50
- };
51
- }
52
-
53
- this.client = NodejsClient.create({
54
- ...credentials,
55
- projectId,
56
- rootUrl,
57
- });
58
- }
59
-
60
- BearerToken = async () =>
61
- this.client.bearerToken || (await this.client.ensureBearerToken());
62
- RefreshToken = async () =>
63
- !this.client.isRefreshTokenExpired() ? this.client.refreshToken : null;
64
-
65
- /* PROJECTS */
66
- ProjectId = () => this.client.clientConfig.projectId;
67
- RootUrl = () => this.client.clientConfig.rootUrl;
68
- }
69
-
70
- export default ContensisAuthService;
1
+ import { NodejsClient } from 'contensis-management-api/lib/client';
2
+ import { ClientGrants, ClientGrantType } from 'contensis-core-api';
3
+
4
+ class ContensisAuthService {
5
+ private client: NodejsClient;
6
+
7
+ constructor({
8
+ clientId = '',
9
+ clientSecret = '',
10
+ username,
11
+ password,
12
+ refreshToken,
13
+ projectId,
14
+ rootUrl,
15
+ }: {
16
+ clientId?: string;
17
+ clientSecret?: string;
18
+ username?: string;
19
+ password?: string;
20
+ refreshToken?: string;
21
+ projectId: string;
22
+ rootUrl: string;
23
+ }) {
24
+ let credentials: {
25
+ clientType: ClientGrantType;
26
+ clientDetails: ClientGrants;
27
+ };
28
+ if (username && password) {
29
+ credentials = {
30
+ clientType: 'contensis_classic',
31
+ clientDetails: {
32
+ username,
33
+ password,
34
+ },
35
+ };
36
+ } else if (refreshToken) {
37
+ credentials = {
38
+ clientType: 'contensis_classic_refresh_token',
39
+ clientDetails: {
40
+ refreshToken,
41
+ },
42
+ };
43
+ } else {
44
+ credentials = {
45
+ clientType: 'client_credentials',
46
+ clientDetails: {
47
+ clientId,
48
+ clientSecret,
49
+ },
50
+ };
51
+ }
52
+
53
+ this.client = NodejsClient.create({
54
+ ...credentials,
55
+ projectId,
56
+ rootUrl,
57
+ });
58
+ }
59
+
60
+ BearerToken = async () =>
61
+ this.client.bearerToken || (await this.client.ensureBearerToken());
62
+ RefreshToken = async () =>
63
+ !this.client.isRefreshTokenExpired() ? this.client.refreshToken : null;
64
+
65
+ /* PROJECTS */
66
+ ProjectId = () => this.client.clientConfig.projectId;
67
+ RootUrl = () => this.client.clientConfig.rootUrl;
68
+ }
69
+
70
+ export default ContensisAuthService;