@dishantlangayan/solace-cloud-cli 0.0.2 → 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.
- package/README.md +106 -23
- package/dist/commands/missionctrl/broker/create.d.ts +4 -3
- package/dist/commands/missionctrl/broker/create.js +7 -15
- package/dist/commands/missionctrl/broker/delete.d.ts +5 -3
- package/dist/commands/missionctrl/broker/delete.js +6 -3
- package/dist/commands/missionctrl/broker/display.d.ts +4 -3
- package/dist/commands/missionctrl/broker/display.js +11 -15
- package/dist/commands/missionctrl/broker/list.d.ts +4 -3
- package/dist/commands/missionctrl/broker/list.js +7 -4
- package/dist/commands/missionctrl/broker/opstatus.d.ts +15 -0
- package/dist/commands/missionctrl/broker/opstatus.js +109 -0
- package/dist/commands/platform/env/create.d.ts +4 -3
- package/dist/commands/platform/env/create.js +8 -15
- package/dist/commands/platform/env/delete.d.ts +5 -3
- package/dist/commands/platform/env/delete.js +19 -7
- package/dist/commands/platform/env/display.d.ts +4 -3
- package/dist/commands/platform/env/display.js +12 -17
- package/dist/commands/platform/env/list.d.ts +4 -3
- package/dist/commands/platform/env/list.js +21 -17
- package/dist/commands/platform/env/update.d.ts +4 -3
- package/dist/commands/platform/env/update.js +7 -15
- package/dist/types/broker.d.ts +25 -0
- package/dist/util/internal.d.ts +12 -0
- package/dist/util/internal.js +31 -0
- package/oclif.manifest.json +300 -11
- package/package.json +3 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
2
|
+
import { Environment } from '../../../types/environment.js';
|
|
3
|
+
export default class PlatformEnvCreate extends ScCommand<typeof PlatformEnvCreate> {
|
|
3
4
|
static args: {};
|
|
4
5
|
static description: string;
|
|
5
6
|
static examples: string[];
|
|
@@ -9,6 +10,6 @@ export default class PlatformEnvCreate extends Command {
|
|
|
9
10
|
isProduction: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
};
|
|
12
|
-
run(): Promise<
|
|
13
|
+
run(): Promise<Environment>;
|
|
13
14
|
private print;
|
|
14
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { camelCaseToTitleCase } from '../../../util/internal.js';
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
3
|
+
import { camelCaseToTitleCase, renderKeyValueTable } from '../../../util/internal.js';
|
|
4
4
|
import { ScConnection } from '../../../util/sc-connection.js';
|
|
5
|
-
export default class PlatformEnvCreate extends
|
|
5
|
+
export default class PlatformEnvCreate extends ScCommand {
|
|
6
6
|
static args = {};
|
|
7
7
|
static description = `Create a new environment.
|
|
8
8
|
|
|
@@ -49,22 +49,15 @@ export default class PlatformEnvCreate extends Command {
|
|
|
49
49
|
// Display results
|
|
50
50
|
this.log('Environment created successfully.');
|
|
51
51
|
this.print(resp.data);
|
|
52
|
+
// Return raw json if --json flag is set
|
|
53
|
+
return resp.data;
|
|
52
54
|
}
|
|
53
55
|
print(environment) {
|
|
54
|
-
this.log();
|
|
55
56
|
const tableRows = [
|
|
56
57
|
['Key', 'Value'],
|
|
57
58
|
...Object.entries(environment).map(([key, value]) => [camelCaseToTitleCase(key), value]),
|
|
58
59
|
];
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
columns: {
|
|
62
|
-
1: { width: 50, wrapWord: true },
|
|
63
|
-
},
|
|
64
|
-
drawHorizontalLine(lineIndex, rowCount) {
|
|
65
|
-
return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
this.log(table(tableRows, config));
|
|
60
|
+
this.log();
|
|
61
|
+
this.log(renderKeyValueTable(tableRows));
|
|
69
62
|
}
|
|
70
63
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class PlatformEnvDelete extends
|
|
1
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
2
|
+
export default class PlatformEnvDelete extends ScCommand<typeof PlatformEnvDelete> {
|
|
3
3
|
static args: {};
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
@@ -7,5 +7,7 @@ export default class PlatformEnvDelete extends Command {
|
|
|
7
7
|
'env-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
};
|
|
10
|
-
run(): Promise<
|
|
10
|
+
run(): Promise<{
|
|
11
|
+
message: string;
|
|
12
|
+
}>;
|
|
11
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
2
3
|
import { ScConnection } from '../../../util/sc-connection.js';
|
|
3
|
-
export default class PlatformEnvDelete extends
|
|
4
|
+
export default class PlatformEnvDelete extends ScCommand {
|
|
4
5
|
static args = {};
|
|
5
6
|
static description = `Delete an environment using either its name or unique identifier. The default environment cannot be deleted.
|
|
6
7
|
|
|
@@ -28,20 +29,31 @@ export default class PlatformEnvDelete extends Command {
|
|
|
28
29
|
let envIdToDelete = envId;
|
|
29
30
|
// If env name provided, get the environment matching provided name and delete. If more than one environment matches, an error will be thrown.
|
|
30
31
|
// If env id provided, delete environment with that id
|
|
32
|
+
let foundMultiple = false;
|
|
31
33
|
if (name) {
|
|
32
34
|
// API call to get environment by name
|
|
33
35
|
const getEnvApiUrl = `${apiUrl}?name=${name}`;
|
|
34
36
|
const resp = await conn.get(getEnvApiUrl);
|
|
35
37
|
if (resp.data.length > 1) {
|
|
36
|
-
|
|
38
|
+
foundMultiple = true;
|
|
37
39
|
}
|
|
38
40
|
else {
|
|
39
41
|
envIdToDelete = resp.data[0]?.id;
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
let message = '';
|
|
45
|
+
if (foundMultiple) {
|
|
46
|
+
message = `Multiple environments found with: ${name}. Exactly one environment must match the provided name.`;
|
|
47
|
+
this.warn(message);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// API call to delete environment by id
|
|
51
|
+
apiUrl += `/${envIdToDelete}`;
|
|
52
|
+
await conn.delete(apiUrl);
|
|
53
|
+
message = `Environment with id '${envIdToDelete}' has been deleted successfully.`;
|
|
54
|
+
this.log(message);
|
|
55
|
+
}
|
|
56
|
+
// Return raw json if --json flag is set
|
|
57
|
+
return { message };
|
|
46
58
|
}
|
|
47
59
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
2
|
+
import { Environment } from '../../../types/environment.js';
|
|
3
|
+
export default class PlatformEnvDisplay extends ScCommand<typeof PlatformEnvDisplay> {
|
|
3
4
|
static args: {};
|
|
4
5
|
static description: string;
|
|
5
6
|
static examples: string[];
|
|
@@ -7,6 +8,6 @@ export default class PlatformEnvDisplay extends Command {
|
|
|
7
8
|
'env-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
};
|
|
10
|
-
run(): Promise<
|
|
11
|
+
run(): Promise<Environment[]>;
|
|
11
12
|
private print;
|
|
12
13
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { camelCaseToTitleCase } from '../../../util/internal.js';
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
3
|
+
import { camelCaseToTitleCase, renderKeyValueTable } from '../../../util/internal.js';
|
|
4
4
|
import { ScConnection } from '../../../util/sc-connection.js';
|
|
5
|
-
export default class PlatformEnvDisplay extends
|
|
5
|
+
export default class PlatformEnvDisplay extends ScCommand {
|
|
6
6
|
static args = {};
|
|
7
7
|
static description = `Display information about an Environment.
|
|
8
8
|
|
|
9
9
|
Use either the Environment's ID (--env-id) or name of the Environment (--name).
|
|
10
10
|
|
|
11
|
-
Required token permissions: [ environments:view ]
|
|
12
|
-
`;
|
|
11
|
+
Required token permissions: [ environments:view ]`;
|
|
13
12
|
static examples = ['<%= config.bin %> <%= command.id %> --name=MyEnvName', '<%= config.bin %> <%= command.id %> --env-id=MyEnvId'];
|
|
14
13
|
static flags = {
|
|
15
14
|
'env-id': Flags.string({
|
|
@@ -32,11 +31,13 @@ export default class PlatformEnvDisplay extends Command {
|
|
|
32
31
|
// If env name provided, get all environments matching provided name
|
|
33
32
|
// If env id provided, get environment with that id
|
|
34
33
|
let apiUrl = `/platform/environments`;
|
|
34
|
+
let rawResp;
|
|
35
35
|
if (envId) {
|
|
36
36
|
// API call to get environment by id
|
|
37
37
|
apiUrl += `/${envId}`;
|
|
38
38
|
const resp = await conn.get(apiUrl);
|
|
39
39
|
this.print(resp.data);
|
|
40
|
+
rawResp = [resp.data];
|
|
40
41
|
}
|
|
41
42
|
else if (name) {
|
|
42
43
|
// API call to get environment by name
|
|
@@ -45,26 +46,20 @@ export default class PlatformEnvDisplay extends Command {
|
|
|
45
46
|
for (const env of resp.data) {
|
|
46
47
|
this.print(env);
|
|
47
48
|
}
|
|
49
|
+
rawResp = resp.data;
|
|
48
50
|
}
|
|
49
51
|
else {
|
|
50
52
|
this.error('Either --env-id or --name must be provided.');
|
|
51
53
|
}
|
|
54
|
+
// Return raw json if --json flag is set
|
|
55
|
+
return rawResp;
|
|
52
56
|
}
|
|
53
57
|
print(environment) {
|
|
54
|
-
this.log();
|
|
55
58
|
const tableRows = [
|
|
56
59
|
['Key', 'Value'],
|
|
57
60
|
...Object.entries(environment).map(([key, value]) => [camelCaseToTitleCase(key), value]),
|
|
58
61
|
];
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
columns: {
|
|
62
|
-
1: { width: 50, wrapWord: true },
|
|
63
|
-
},
|
|
64
|
-
drawHorizontalLine(lineIndex, rowCount) {
|
|
65
|
-
return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
this.log(table(tableRows, config));
|
|
62
|
+
this.log();
|
|
63
|
+
this.log(renderKeyValueTable(tableRows));
|
|
69
64
|
}
|
|
70
65
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
2
|
+
import { Environment } from '../../../types/environment.js';
|
|
3
|
+
export default class PlatformEnvList extends ScCommand<typeof PlatformEnvList> {
|
|
3
4
|
static args: {};
|
|
4
5
|
static description: string;
|
|
5
6
|
static examples: string[];
|
|
@@ -9,5 +10,5 @@ export default class PlatformEnvList extends Command {
|
|
|
9
10
|
pageSize: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
sort: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
};
|
|
12
|
-
run(): Promise<
|
|
13
|
+
run(): Promise<Environment[]>;
|
|
13
14
|
}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
3
|
+
import { renderTable } from '../../../util/internal.js';
|
|
3
4
|
import { ScConnection } from '../../../util/sc-connection.js';
|
|
4
|
-
export default class PlatformEnvList extends
|
|
5
|
+
export default class PlatformEnvList extends ScCommand {
|
|
5
6
|
static args = {};
|
|
6
7
|
static description = `Get a list of all Environments.
|
|
7
8
|
|
|
8
9
|
Required token permissions: [ environments:view ]`;
|
|
9
10
|
static examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --name=Default --pageNumber=1 --pageSize=10 --sort=name:ASC'];
|
|
10
11
|
static flags = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
name: Flags.string({
|
|
13
|
+
char: 'n',
|
|
14
|
+
description: 'Name of the environment to match on.'
|
|
15
|
+
}),
|
|
16
|
+
pageNumber: Flags.integer({
|
|
17
|
+
char: 'p',
|
|
18
|
+
description: 'The page number to get. Defaults to 10'
|
|
19
|
+
}),
|
|
16
20
|
pageSize: Flags.integer({
|
|
21
|
+
char: 's',
|
|
17
22
|
description: 'The number of environments to get per page. Defaults to 1',
|
|
18
23
|
max: 100,
|
|
19
24
|
min: 1,
|
|
20
25
|
}),
|
|
21
|
-
// sort (--sort=VALUE)
|
|
22
26
|
sort: Flags.string({
|
|
23
27
|
description: 'The query (fieldName:<ASC/DESC>) used to sort the environment list in the response.',
|
|
24
28
|
}),
|
|
@@ -36,20 +40,20 @@ export default class PlatformEnvList extends Command {
|
|
|
36
40
|
// API call
|
|
37
41
|
const resp = await conn.get(apiUrl);
|
|
38
42
|
// Array to output as table
|
|
39
|
-
const envArray = [
|
|
43
|
+
const envArray = [
|
|
44
|
+
['Name', 'Id', 'Is Default', 'Is Production', 'Description'],
|
|
45
|
+
...resp.data.map((item) => [
|
|
40
46
|
item.name,
|
|
41
47
|
item.id,
|
|
42
48
|
item.isDefault,
|
|
43
49
|
item.isProduction,
|
|
44
50
|
item.description,
|
|
45
|
-
])
|
|
51
|
+
])
|
|
52
|
+
];
|
|
46
53
|
// Display results as a table
|
|
47
|
-
const config = {
|
|
48
|
-
columns: {
|
|
49
|
-
4: { width: 50, wrapWord: true },
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
54
|
this.log();
|
|
53
|
-
this.log(
|
|
55
|
+
this.log(renderTable(envArray, { 4: { width: 50, wrapWord: true } }));
|
|
56
|
+
// Return raw json if --json flag is set
|
|
57
|
+
return resp.data;
|
|
54
58
|
}
|
|
55
59
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
2
|
+
import { Environment } from '../../../types/environment.js';
|
|
3
|
+
export default class PlatformEnvUpdate extends ScCommand<typeof PlatformEnvUpdate> {
|
|
3
4
|
static args: {};
|
|
4
5
|
static description: string;
|
|
5
6
|
static examples: string[];
|
|
@@ -10,6 +11,6 @@ export default class PlatformEnvUpdate extends Command {
|
|
|
10
11
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
'new-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
};
|
|
13
|
-
run(): Promise<
|
|
14
|
+
run(): Promise<Environment>;
|
|
14
15
|
private print;
|
|
15
16
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { camelCaseToTitleCase } from '../../../util/internal.js';
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { ScCommand } from '../../../sc-command.js';
|
|
3
|
+
import { camelCaseToTitleCase, renderKeyValueTable } from '../../../util/internal.js';
|
|
4
4
|
import { ScConnection } from '../../../util/sc-connection.js';
|
|
5
|
-
export default class PlatformEnvUpdate extends
|
|
5
|
+
export default class PlatformEnvUpdate extends ScCommand {
|
|
6
6
|
static args = {};
|
|
7
7
|
static description = `Modify an environment's attributes
|
|
8
8
|
|
|
@@ -69,22 +69,14 @@ export default class PlatformEnvUpdate extends Command {
|
|
|
69
69
|
const resp = await conn.put(apiUrl, body);
|
|
70
70
|
this.log(`Environment with id '${envIdToUdpate}' has been updated successfully.`);
|
|
71
71
|
this.print(resp.data);
|
|
72
|
+
return resp.data;
|
|
72
73
|
}
|
|
73
74
|
print(environment) {
|
|
74
|
-
this.log();
|
|
75
75
|
const tableRows = [
|
|
76
76
|
['Key', 'Value'],
|
|
77
77
|
...Object.entries(environment).map(([key, value]) => [camelCaseToTitleCase(key), value]),
|
|
78
78
|
];
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
columns: {
|
|
82
|
-
1: { width: 50, wrapWord: true },
|
|
83
|
-
},
|
|
84
|
-
drawHorizontalLine(lineIndex, rowCount) {
|
|
85
|
-
return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
this.log(table(tableRows, config));
|
|
79
|
+
this.log();
|
|
80
|
+
this.log(renderKeyValueTable(tableRows));
|
|
89
81
|
}
|
|
90
82
|
}
|
package/dist/types/broker.d.ts
CHANGED
|
@@ -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
|
+
}
|
package/dist/util/internal.d.ts
CHANGED
|
@@ -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>;
|
package/dist/util/internal.js
CHANGED
|
@@ -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
|
+
}
|