@dishantlangayan/solace-cloud-cli 0.0.1 → 0.0.3

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.
@@ -58,3 +58,28 @@ export interface EventBrokerServiceDetail {
58
58
  serviceClassId?: string;
59
59
  type?: string;
60
60
  }
61
+ /**
62
+ * For Broker Operation Status
63
+ */
64
+ export interface OperationResponse {
65
+ data: OperationData;
66
+ }
67
+ export interface OperationData {
68
+ id: string;
69
+ type: "operation";
70
+ operationType: string;
71
+ createdBy: string;
72
+ createdTime: string;
73
+ completedTime: string;
74
+ resourceId: string;
75
+ resourceType: string;
76
+ progressLogs?: ProgressLog[];
77
+ status: string;
78
+ }
79
+ export interface ProgressLog {
80
+ step: string;
81
+ message: string;
82
+ timestamp: string;
83
+ stepId: string;
84
+ status: string;
85
+ }
@@ -4,3 +4,15 @@
4
4
  * @param text Text to transform.
5
5
  */
6
6
  export declare function camelCaseToTitleCase(text: string): string;
7
+ export interface ColumnConfig {
8
+ width?: number;
9
+ wrapWord?: boolean;
10
+ }
11
+ export declare function renderTable<T>(data: T[][], columnConfig?: Record<number, ColumnConfig>): string;
12
+ export declare function renderKeyValueTable<T>(data: T[][], columnConfig?: Record<number, ColumnConfig>): string;
13
+ /**
14
+ * Sleep function.
15
+ * @param ms Num of milliseconds to wait
16
+ * @returns
17
+ */
18
+ export declare function sleep(ms: number): Promise<void>;
@@ -1,3 +1,4 @@
1
+ import { table } from 'table';
1
2
  /**
2
3
  * Formats a camel case style `string` into a title case.
3
4
  *
@@ -10,3 +11,33 @@ export function camelCaseToTitleCase(text) {
10
11
  .replaceAll(/\s{2,}/g, ' ')
11
12
  .trim();
12
13
  }
14
+ export function renderTable(data, columnConfig) {
15
+ // Table config
16
+ const tableConfig = {
17
+ columns: columnConfig
18
+ };
19
+ const tableStr = table(data, tableConfig);
20
+ return tableStr;
21
+ }
22
+ export function renderKeyValueTable(data, columnConfig) {
23
+ if (columnConfig === undefined) {
24
+ columnConfig = { 1: { width: 50, wrapWord: true } };
25
+ }
26
+ // Table config
27
+ const tableConfig = {
28
+ columns: columnConfig,
29
+ drawHorizontalLine(lineIndex, rowCount) {
30
+ return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;
31
+ },
32
+ };
33
+ const tableStr = table(data, tableConfig);
34
+ return tableStr;
35
+ }
36
+ /**
37
+ * Sleep function.
38
+ * @param ms Num of milliseconds to wait
39
+ * @returns
40
+ */
41
+ export function sleep(ms) {
42
+ return new Promise(resolve => setTimeout(resolve, ms));
43
+ }
@@ -5,9 +5,32 @@
5
5
  "args": {},
6
6
  "description": "Create an event broker service. You must provide a unique name and select a service class and datacenter. You can optionally define other properties for the event broker service.\n\nYour token must have one of the permissions listed in the Token Permissions.\n\nToken Permissions: [ `services:post` ]",
7
7
  "examples": [
8
- "<%= config.bin %> <%= command.id %> --datacenter-id=MyDatacenterId --name=MyBrokerName --service-class-id=DEVELOPER"
8
+ "<%= config.bin %> <%= command.id %> --name=MyBrokerName --datacenter-id=eks-ca-central-1a --service-class-id=DEVELOPER"
9
9
  ],
10
10
  "flags": {
11
+ "json": {
12
+ "description": "Format output as json.",
13
+ "helpGroup": "GLOBAL",
14
+ "name": "json",
15
+ "allowNo": false,
16
+ "type": "boolean"
17
+ },
18
+ "log-level": {
19
+ "helpGroup": "GLOBAL",
20
+ "name": "log-level",
21
+ "summary": "Specify level for logging.",
22
+ "default": "info",
23
+ "hasDynamicHelp": false,
24
+ "multiple": false,
25
+ "options": [
26
+ "debug",
27
+ "warn",
28
+ "error",
29
+ "info",
30
+ "trace"
31
+ ],
32
+ "type": "option"
33
+ },
11
34
  "datacenter-id": {
12
35
  "char": "d",
13
36
  "description": "The identifier of the datacenter.",
@@ -19,7 +42,7 @@
19
42
  },
20
43
  "env-name": {
21
44
  "char": "e",
22
- "description": "The name of the environment environment where you want to create the service. If no name is provided, the service will be created in the default environment.",
45
+ "description": "The name of the environment environment where you want to create the service. \n You can only specify an environment identifier when creating services in a Public Region. \n You cannot specify an environment identifier when creating a service in a Dedicated Region. \n If no name is provided, the service will be created in the default environment.",
23
46
  "name": "env-name",
24
47
  "hasDynamicHelp": false,
25
48
  "multiple": false,
@@ -57,6 +80,13 @@
57
80
  "multiple": false,
58
81
  "type": "option"
59
82
  },
83
+ "redundancy-group-ssl-enabled": {
84
+ "char": "r",
85
+ "description": "Enable or disable SSL for the redundancy group (for mate-link encryption). The default value is false (disabled)",
86
+ "name": "redundancy-group-ssl-enabled",
87
+ "allowNo": false,
88
+ "type": "boolean"
89
+ },
60
90
  "service-class-id": {
61
91
  "char": "c",
62
92
  "description": "Supported service classes.",
@@ -82,7 +112,7 @@
82
112
  "pluginName": "@dishantlangayan/solace-cloud-cli",
83
113
  "pluginType": "core",
84
114
  "strict": true,
85
- "enableJsonFlag": false,
115
+ "enableJsonFlag": true,
86
116
  "isESM": true,
87
117
  "relativePath": [
88
118
  "dist",
@@ -101,6 +131,29 @@
101
131
  "<%= config.bin %> <%= command.id %> --name=MyBrokerName"
102
132
  ],
103
133
  "flags": {
134
+ "json": {
135
+ "description": "Format output as json.",
136
+ "helpGroup": "GLOBAL",
137
+ "name": "json",
138
+ "allowNo": false,
139
+ "type": "boolean"
140
+ },
141
+ "log-level": {
142
+ "helpGroup": "GLOBAL",
143
+ "name": "log-level",
144
+ "summary": "Specify level for logging.",
145
+ "default": "info",
146
+ "hasDynamicHelp": false,
147
+ "multiple": false,
148
+ "options": [
149
+ "debug",
150
+ "warn",
151
+ "error",
152
+ "info",
153
+ "trace"
154
+ ],
155
+ "type": "option"
156
+ },
104
157
  "broker-id": {
105
158
  "char": "b",
106
159
  "description": "Id of the event broker service.",
@@ -125,7 +178,7 @@
125
178
  "pluginName": "@dishantlangayan/solace-cloud-cli",
126
179
  "pluginType": "core",
127
180
  "strict": true,
128
- "enableJsonFlag": false,
181
+ "enableJsonFlag": true,
129
182
  "isESM": true,
130
183
  "relativePath": [
131
184
  "dist",
@@ -143,6 +196,29 @@
143
196
  "<%= config.bin %> <%= command.id %>"
144
197
  ],
145
198
  "flags": {
199
+ "json": {
200
+ "description": "Format output as json.",
201
+ "helpGroup": "GLOBAL",
202
+ "name": "json",
203
+ "allowNo": false,
204
+ "type": "boolean"
205
+ },
206
+ "log-level": {
207
+ "helpGroup": "GLOBAL",
208
+ "name": "log-level",
209
+ "summary": "Specify level for logging.",
210
+ "default": "info",
211
+ "hasDynamicHelp": false,
212
+ "multiple": false,
213
+ "options": [
214
+ "debug",
215
+ "warn",
216
+ "error",
217
+ "info",
218
+ "trace"
219
+ ],
220
+ "type": "option"
221
+ },
146
222
  "broker-id": {
147
223
  "char": "b",
148
224
  "description": "Id of the event broker service.",
@@ -167,7 +243,7 @@
167
243
  "pluginName": "@dishantlangayan/solace-cloud-cli",
168
244
  "pluginType": "core",
169
245
  "strict": true,
170
- "enableJsonFlag": false,
246
+ "enableJsonFlag": true,
171
247
  "isESM": true,
172
248
  "relativePath": [
173
249
  "dist",
@@ -185,6 +261,29 @@
185
261
  "<%= config.bin %> <%= command.id %> --name=MyBrokerName --pageNumber=1 --pageSize=10 --sort=name:asc"
186
262
  ],
187
263
  "flags": {
264
+ "json": {
265
+ "description": "Format output as json.",
266
+ "helpGroup": "GLOBAL",
267
+ "name": "json",
268
+ "allowNo": false,
269
+ "type": "boolean"
270
+ },
271
+ "log-level": {
272
+ "helpGroup": "GLOBAL",
273
+ "name": "log-level",
274
+ "summary": "Specify level for logging.",
275
+ "default": "info",
276
+ "hasDynamicHelp": false,
277
+ "multiple": false,
278
+ "options": [
279
+ "debug",
280
+ "warn",
281
+ "error",
282
+ "info",
283
+ "trace"
284
+ ],
285
+ "type": "option"
286
+ },
188
287
  "name": {
189
288
  "char": "n",
190
289
  "description": "Name of the event broker service to match on.",
@@ -222,7 +321,7 @@
222
321
  "pluginName": "@dishantlangayan/solace-cloud-cli",
223
322
  "pluginType": "core",
224
323
  "strict": true,
225
- "enableJsonFlag": false,
324
+ "enableJsonFlag": true,
226
325
  "isESM": true,
227
326
  "relativePath": [
228
327
  "dist",
@@ -232,6 +331,86 @@
232
331
  "list.js"
233
332
  ]
234
333
  },
334
+ "missionctrl:broker:opstatus": {
335
+ "aliases": [],
336
+ "args": {},
337
+ "description": "Get the status of an operation that being performed on an event broker service. \n To get the operation, you provide identifier of the operation and the identifier of the event broker service.\n\n Token Permissions: [ mission_control:access or services:get or services:get:self or services:view or services:view:self ]",
338
+ "examples": [
339
+ "<%= config.bin %> <%= command.id %>"
340
+ ],
341
+ "flags": {
342
+ "json": {
343
+ "description": "Format output as json.",
344
+ "helpGroup": "GLOBAL",
345
+ "name": "json",
346
+ "allowNo": false,
347
+ "type": "boolean"
348
+ },
349
+ "log-level": {
350
+ "helpGroup": "GLOBAL",
351
+ "name": "log-level",
352
+ "summary": "Specify level for logging.",
353
+ "default": "info",
354
+ "hasDynamicHelp": false,
355
+ "multiple": false,
356
+ "options": [
357
+ "debug",
358
+ "warn",
359
+ "error",
360
+ "info",
361
+ "trace"
362
+ ],
363
+ "type": "option"
364
+ },
365
+ "broker-id": {
366
+ "char": "b",
367
+ "description": "Id of the event broker service.",
368
+ "name": "broker-id",
369
+ "hasDynamicHelp": false,
370
+ "multiple": false,
371
+ "type": "option"
372
+ },
373
+ "name": {
374
+ "char": "n",
375
+ "description": "Name of the event broker service.",
376
+ "name": "name",
377
+ "hasDynamicHelp": false,
378
+ "multiple": false,
379
+ "type": "option"
380
+ },
381
+ "operation-id": {
382
+ "char": "o",
383
+ "description": "The identifier of the operation being performed on the event broker service.",
384
+ "name": "operation-id",
385
+ "hasDynamicHelp": false,
386
+ "multiple": false,
387
+ "type": "option"
388
+ },
389
+ "show-progress": {
390
+ "char": "p",
391
+ "description": "Displays a status bar of the in-progress operation. The command will wait for completion of each step of the operation.",
392
+ "name": "show-progress",
393
+ "allowNo": false,
394
+ "type": "boolean"
395
+ }
396
+ },
397
+ "hasDynamicHelp": false,
398
+ "hiddenAliases": [],
399
+ "id": "missionctrl:broker:opstatus",
400
+ "pluginAlias": "@dishantlangayan/solace-cloud-cli",
401
+ "pluginName": "@dishantlangayan/solace-cloud-cli",
402
+ "pluginType": "core",
403
+ "strict": true,
404
+ "enableJsonFlag": true,
405
+ "isESM": true,
406
+ "relativePath": [
407
+ "dist",
408
+ "commands",
409
+ "missionctrl",
410
+ "broker",
411
+ "opstatus.js"
412
+ ]
413
+ },
235
414
  "platform:env:create": {
236
415
  "aliases": [],
237
416
  "args": {},
@@ -240,6 +419,29 @@
240
419
  "<%= config.bin %> <%= command.id %> --name=MyEnvironment --desc=\"My environment description\" --isDefault --isProduction"
241
420
  ],
242
421
  "flags": {
422
+ "json": {
423
+ "description": "Format output as json.",
424
+ "helpGroup": "GLOBAL",
425
+ "name": "json",
426
+ "allowNo": false,
427
+ "type": "boolean"
428
+ },
429
+ "log-level": {
430
+ "helpGroup": "GLOBAL",
431
+ "name": "log-level",
432
+ "summary": "Specify level for logging.",
433
+ "default": "info",
434
+ "hasDynamicHelp": false,
435
+ "multiple": false,
436
+ "options": [
437
+ "debug",
438
+ "warn",
439
+ "error",
440
+ "info",
441
+ "trace"
442
+ ],
443
+ "type": "option"
444
+ },
243
445
  "desc": {
244
446
  "char": "d",
245
447
  "description": "Description of the environment to create.",
@@ -277,7 +479,7 @@
277
479
  "pluginName": "@dishantlangayan/solace-cloud-cli",
278
480
  "pluginType": "core",
279
481
  "strict": true,
280
- "enableJsonFlag": false,
482
+ "enableJsonFlag": true,
281
483
  "isESM": true,
282
484
  "relativePath": [
283
485
  "dist",
@@ -296,6 +498,29 @@
296
498
  "<%= config.bin %> <%= command.id %> --env-id=MyEnvId"
297
499
  ],
298
500
  "flags": {
501
+ "json": {
502
+ "description": "Format output as json.",
503
+ "helpGroup": "GLOBAL",
504
+ "name": "json",
505
+ "allowNo": false,
506
+ "type": "boolean"
507
+ },
508
+ "log-level": {
509
+ "helpGroup": "GLOBAL",
510
+ "name": "log-level",
511
+ "summary": "Specify level for logging.",
512
+ "default": "info",
513
+ "hasDynamicHelp": false,
514
+ "multiple": false,
515
+ "options": [
516
+ "debug",
517
+ "warn",
518
+ "error",
519
+ "info",
520
+ "trace"
521
+ ],
522
+ "type": "option"
523
+ },
299
524
  "env-id": {
300
525
  "char": "e",
301
526
  "description": "Id of the environment.",
@@ -320,7 +545,7 @@
320
545
  "pluginName": "@dishantlangayan/solace-cloud-cli",
321
546
  "pluginType": "core",
322
547
  "strict": true,
323
- "enableJsonFlag": false,
548
+ "enableJsonFlag": true,
324
549
  "isESM": true,
325
550
  "relativePath": [
326
551
  "dist",
@@ -333,12 +558,35 @@
333
558
  "platform:env:display": {
334
559
  "aliases": [],
335
560
  "args": {},
336
- "description": "Display information about an Environment.\n \n Use either the Environment's ID (--env-id) or name of the Environment (--name).\n \n Required token permissions: [ environments:view ]\n ",
561
+ "description": "Display information about an Environment.\n \n Use either the Environment's ID (--env-id) or name of the Environment (--name).\n \n Required token permissions: [ environments:view ]",
337
562
  "examples": [
338
563
  "<%= config.bin %> <%= command.id %> --name=MyEnvName",
339
564
  "<%= config.bin %> <%= command.id %> --env-id=MyEnvId"
340
565
  ],
341
566
  "flags": {
567
+ "json": {
568
+ "description": "Format output as json.",
569
+ "helpGroup": "GLOBAL",
570
+ "name": "json",
571
+ "allowNo": false,
572
+ "type": "boolean"
573
+ },
574
+ "log-level": {
575
+ "helpGroup": "GLOBAL",
576
+ "name": "log-level",
577
+ "summary": "Specify level for logging.",
578
+ "default": "info",
579
+ "hasDynamicHelp": false,
580
+ "multiple": false,
581
+ "options": [
582
+ "debug",
583
+ "warn",
584
+ "error",
585
+ "info",
586
+ "trace"
587
+ ],
588
+ "type": "option"
589
+ },
342
590
  "env-id": {
343
591
  "char": "e",
344
592
  "description": "Id of the environment.",
@@ -363,7 +611,7 @@
363
611
  "pluginName": "@dishantlangayan/solace-cloud-cli",
364
612
  "pluginType": "core",
365
613
  "strict": true,
366
- "enableJsonFlag": false,
614
+ "enableJsonFlag": true,
367
615
  "isESM": true,
368
616
  "relativePath": [
369
617
  "dist",
@@ -414,6 +662,7 @@
414
662
  "type": "option"
415
663
  },
416
664
  "pageNumber": {
665
+ "char": "p",
417
666
  "description": "The page number to get. Defaults to 10",
418
667
  "name": "pageNumber",
419
668
  "hasDynamicHelp": false,
@@ -421,6 +670,7 @@
421
670
  "type": "option"
422
671
  },
423
672
  "pageSize": {
673
+ "char": "s",
424
674
  "description": "The number of environments to get per page. Defaults to 1",
425
675
  "name": "pageSize",
426
676
  "hasDynamicHelp": false,
@@ -461,6 +711,29 @@
461
711
  "<%= config.bin %> <%= command.id %> --env-id=MyEnvId --new-name=MyNewEnvName --desc=\"My description to update\" --isDefault"
462
712
  ],
463
713
  "flags": {
714
+ "json": {
715
+ "description": "Format output as json.",
716
+ "helpGroup": "GLOBAL",
717
+ "name": "json",
718
+ "allowNo": false,
719
+ "type": "boolean"
720
+ },
721
+ "log-level": {
722
+ "helpGroup": "GLOBAL",
723
+ "name": "log-level",
724
+ "summary": "Specify level for logging.",
725
+ "default": "info",
726
+ "hasDynamicHelp": false,
727
+ "multiple": false,
728
+ "options": [
729
+ "debug",
730
+ "warn",
731
+ "error",
732
+ "info",
733
+ "trace"
734
+ ],
735
+ "type": "option"
736
+ },
464
737
  "desc": {
465
738
  "char": "d",
466
739
  "description": "Description of the environment to update.",
@@ -506,7 +779,7 @@
506
779
  "pluginName": "@dishantlangayan/solace-cloud-cli",
507
780
  "pluginType": "core",
508
781
  "strict": true,
509
- "enableJsonFlag": false,
782
+ "enableJsonFlag": true,
510
783
  "isESM": true,
511
784
  "relativePath": [
512
785
  "dist",
@@ -517,5 +790,5 @@
517
790
  ]
518
791
  }
519
792
  },
520
- "version": "0.0.1"
793
+ "version": "0.0.3"
521
794
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dishantlangayan/solace-cloud-cli",
3
3
  "description": "The Solace Cloud CLI",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "author": "Dishant Langayan",
6
6
  "bin": {
7
7
  "sc": "./bin/run.js"
@@ -11,7 +11,9 @@
11
11
  "@oclif/core": "^4",
12
12
  "@oclif/plugin-help": "^6",
13
13
  "@oclif/plugin-plugins": "^5",
14
+ "@types/cli-progress": "^3.11.6",
14
15
  "axios": "^1.9.0",
16
+ "cli-progress": "^3.12.0",
15
17
  "table": "^6.9.0"
16
18
  },
17
19
  "devDependencies": {