@dxos/cli 0.1.54 → 0.1.55-main.0d3b09d
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 +178 -126
- package/dist/src/base-command.d.ts +9 -1
- package/dist/src/base-command.d.ts.map +1 -1
- package/dist/src/base-command.js +52 -9
- package/dist/src/base-command.js.map +1 -1
- package/dist/src/commands/agent/restart.js +2 -2
- package/dist/src/commands/agent/restart.js.map +1 -1
- package/dist/src/commands/agent/start.d.ts.map +1 -1
- package/dist/src/commands/agent/start.js +8 -3
- package/dist/src/commands/agent/start.js.map +1 -1
- package/dist/src/commands/agent/stop.d.ts.map +1 -1
- package/dist/src/commands/agent/stop.js +10 -5
- package/dist/src/commands/agent/stop.js.map +1 -1
- package/dist/src/commands/app/create.js +3 -3
- package/dist/src/commands/app/create.js.map +1 -1
- package/dist/src/commands/debug/{stats.d.ts → diagnostics.d.ts} +3 -3
- package/dist/src/commands/debug/diagnostics.d.ts.map +1 -0
- package/dist/src/commands/debug/diagnostics.js +54 -0
- package/dist/src/commands/debug/diagnostics.js.map +1 -0
- package/dist/src/commands/debug/generate.d.ts +22 -0
- package/dist/src/commands/debug/generate.d.ts.map +1 -0
- package/dist/src/commands/debug/generate.js +68 -0
- package/dist/src/commands/debug/generate.js.map +1 -0
- package/dist/src/commands/device/list.d.ts +17 -0
- package/dist/src/commands/device/list.d.ts.map +1 -1
- package/dist/src/commands/device/list.js +5 -0
- package/dist/src/commands/device/list.js.map +1 -1
- package/dist/src/commands/halo/credential/list.d.ts +8 -0
- package/dist/src/commands/halo/credential/list.d.ts.map +1 -1
- package/dist/src/commands/halo/credential/list.js +7 -7
- package/dist/src/commands/halo/credential/list.js.map +1 -1
- package/dist/src/commands/halo/{index.d.ts → info.d.ts} +2 -2
- package/dist/src/commands/halo/info.d.ts.map +1 -0
- package/dist/src/commands/halo/{index.js → info.js} +7 -6
- package/dist/src/commands/halo/info.js.map +1 -0
- package/dist/src/commands/halo/join.d.ts +1 -0
- package/dist/src/commands/halo/join.d.ts.map +1 -1
- package/dist/src/commands/halo/join.js +20 -13
- package/dist/src/commands/halo/join.js.map +1 -1
- package/dist/src/commands/halo/share.js +1 -1
- package/dist/src/commands/halo/share.js.map +1 -1
- package/dist/src/commands/kube/auth.js +1 -1
- package/dist/src/commands/kube/auth.js.map +1 -1
- package/dist/src/commands/kube/deploy.d.ts.map +1 -1
- package/dist/src/commands/kube/deploy.js +16 -25
- package/dist/src/commands/kube/deploy.js.map +1 -1
- package/dist/src/commands/reset/index.d.ts.map +1 -1
- package/dist/src/commands/reset/index.js +12 -7
- package/dist/src/commands/reset/index.js.map +1 -1
- package/dist/src/commands/shell/index.d.ts +0 -1
- package/dist/src/commands/shell/index.d.ts.map +1 -1
- package/dist/src/commands/shell/index.js +0 -4
- package/dist/src/commands/shell/index.js.map +1 -1
- package/dist/src/commands/space/create.d.ts.map +1 -1
- package/dist/src/commands/space/create.js +9 -5
- package/dist/src/commands/space/create.js.map +1 -1
- package/dist/src/commands/space/epoch.d.ts +0 -17
- package/dist/src/commands/space/epoch.d.ts.map +1 -1
- package/dist/src/commands/space/epoch.js +2 -21
- package/dist/src/commands/space/epoch.js.map +1 -1
- package/dist/src/commands/space/join.d.ts.map +1 -1
- package/dist/src/commands/space/join.js +18 -22
- package/dist/src/commands/space/join.js.map +1 -1
- package/dist/src/commands/space/list.d.ts.map +1 -1
- package/dist/src/commands/space/list.js +5 -4
- package/dist/src/commands/space/list.js.map +1 -1
- package/dist/src/commands/space/members.d.ts +3 -3
- package/dist/src/commands/space/members.d.ts.map +1 -1
- package/dist/src/commands/space/members.js +6 -19
- package/dist/src/commands/space/members.js.map +1 -1
- package/dist/src/commands/space/{invite.d.ts → query.d.ts} +4 -3
- package/dist/src/commands/space/query.d.ts.map +1 -0
- package/dist/src/commands/space/query.js +39 -0
- package/dist/src/commands/space/query.js.map +1 -0
- package/dist/src/commands/space/share.d.ts +20 -0
- package/dist/src/commands/space/share.d.ts.map +1 -0
- package/dist/src/commands/space/share.js +62 -0
- package/dist/src/commands/space/share.js.map +1 -0
- package/dist/src/commands/tunnel/list.d.ts.map +1 -1
- package/dist/src/commands/tunnel/list.js +3 -4
- package/dist/src/commands/tunnel/list.js.map +1 -1
- package/dist/src/commands/tunnel/set.d.ts.map +1 -1
- package/dist/src/commands/tunnel/set.js +1 -1
- package/dist/src/commands/tunnel/set.js.map +1 -1
- package/dist/src/errors.d.ts +4 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +13 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/timeouts.d.ts +2 -0
- package/dist/src/timeouts.d.ts.map +1 -0
- package/dist/src/timeouts.js +8 -0
- package/dist/src/timeouts.js.map +1 -0
- package/dist/src/util/index.d.ts +1 -0
- package/dist/src/util/index.d.ts.map +1 -1
- package/dist/src/util/index.js +1 -0
- package/dist/src/util/index.js.map +1 -1
- package/dist/src/util/invitation.js +1 -1
- package/dist/src/util/invitation.js.map +1 -1
- package/dist/src/util/print.d.ts +14 -2
- package/dist/src/util/print.d.ts.map +1 -1
- package/dist/src/util/print.js +78 -6
- package/dist/src/util/print.js.map +1 -1
- package/dist/src/util/provider/digital-ocean.js +11 -7
- package/dist/src/util/provider/digital-ocean.js.map +1 -1
- package/dist/src/util/random.d.ts +13 -0
- package/dist/src/util/random.d.ts.map +1 -0
- package/dist/src/util/random.js +27 -0
- package/dist/src/util/random.js.map +1 -0
- package/dist/src/util/telemetryrc.json +2 -2
- package/dist/src/util/util.d.ts +1 -0
- package/dist/src/util/util.d.ts.map +1 -1
- package/dist/src/util/util.js +25 -6
- package/dist/src/util/util.js.map +1 -1
- package/oclif.manifest.json +446 -259
- package/package.json +21 -21
- package/dist/src/commands/debug/stats.d.ts.map +0 -1
- package/dist/src/commands/debug/stats.js +0 -58
- package/dist/src/commands/debug/stats.js.map +0 -1
- package/dist/src/commands/halo/index.d.ts.map +0 -1
- package/dist/src/commands/halo/index.js.map +0 -1
- package/dist/src/commands/space/index.d.ts +0 -6
- package/dist/src/commands/space/index.d.ts.map +0 -1
- package/dist/src/commands/space/index.js +0 -19
- package/dist/src/commands/space/index.js.map +0 -1
- package/dist/src/commands/space/invite.d.ts.map +0 -1
- package/dist/src/commands/space/invite.js +0 -48
- package/dist/src/commands/space/invite.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../src/util/random.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,KAAK,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE;IAIrB,MAAM,CAAC,KAAK,GAAE,KAA2B;IAIzC,IAAI;CAOL"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2023 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Random = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Simple random generator that avoids dependency on faker.
|
|
9
|
+
*/
|
|
10
|
+
class Random {
|
|
11
|
+
element(values) {
|
|
12
|
+
return values[Math.floor(Math.random() * values.length)];
|
|
13
|
+
}
|
|
14
|
+
number(range = { min: 0, max: 10 }) {
|
|
15
|
+
var _a, _b, _c;
|
|
16
|
+
return ((_a = range.min) !== null && _a !== void 0 ? _a : 0) + Math.floor(Math.random() * (((_b = range.max) !== null && _b !== void 0 ? _b : 10) - ((_c = range.min) !== null && _c !== void 0 ? _c : 0)));
|
|
17
|
+
}
|
|
18
|
+
word() {
|
|
19
|
+
const consonants = ['k', 's', 't', 'n', 'h', 'm', 'y', 'r', 'w'];
|
|
20
|
+
const vowels = ['a', 'i', 'u', 'e', 'o'];
|
|
21
|
+
return Array.from({ length: this.number({ min: 1, max: 8 }) })
|
|
22
|
+
.map(() => this.element(consonants) + this.element(vowels))
|
|
23
|
+
.join('');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.Random = Random;
|
|
27
|
+
//# sourceMappingURL=random.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../../src/util/random.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAIF;;GAEG;AACH,MAAa,MAAM;IACjB,OAAO,CAAC,MAAa;QACnB,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,CAAC,QAAe,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;;QACvC,OAAO,CAAC,MAAA,KAAK,CAAC,GAAG,mCAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,MAAA,KAAK,CAAC,GAAG,mCAAI,EAAE,CAAC,GAAG,CAAC,MAAA,KAAK,CAAC,GAAG,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAED,IAAI;QACF,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;aAC3D,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aAC1D,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;CACF;AAhBD,wBAgBC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"DX_ENVIRONMENT": "
|
|
3
|
-
"DX_RELEASE": "@dxos/cli@0.1.
|
|
2
|
+
"DX_ENVIRONMENT": "staging",
|
|
3
|
+
"DX_RELEASE": "@dxos/cli@0.1.55-main.0d3b09d",
|
|
4
4
|
"SENTRY_DESTINATION": "https://2647916221e643869965e78469479aa4@o4504012000067584.ingest.sentry.io/4504012027265029",
|
|
5
5
|
"TELEMETRY_API_KEY": "B00QG6PtJJrJ0VVFe0H5a6bcUUShKyZM",
|
|
6
6
|
"IPDATA_API_KEY": "ccc5f0cd66dd34a7c31c2ddc61c2bbca2db73892a993982bb3a5f0e2"
|
package/dist/src/util/util.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ import { PublicKey } from '@dxos/keys';
|
|
|
3
3
|
export declare const maybeTruncateKey: (key: PublicKey, truncate?: boolean) => string;
|
|
4
4
|
export declare const safeParseInt: (value: string | undefined, defaultValue?: number) => number | undefined;
|
|
5
5
|
export declare const selectSpace: (spaces: Space[]) => Promise<any>;
|
|
6
|
+
export declare const waitForSpace: (space: Space, exceptionHandler?: ((err: Error) => void) | undefined) => Promise<void>;
|
|
6
7
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util/util.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAKvC,eAAO,MAAM,gBAAgB,QAAS,SAAS,+BAAkE,CAAC;AAElH,eAAO,MAAM,YAAY,UAAW,MAAM,GAAG,SAAS,iBAAiB,MAAM,KAAG,MAAM,GAAG,SAOxF,CAAC;AAMF,eAAO,MAAM,WAAW,WAAkB,KAAK,EAAE,iBAgBhD,CAAC;AAEF,eAAO,MAAM,YAAY,UAAiB,KAAK,4BAA2B,KAAK,KAAK,IAAI,+BAUvF,CAAC"}
|
package/dist/src/util/util.js
CHANGED
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
// Copyright 2022 DXOS.org
|
|
4
4
|
//
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.selectSpace = exports.safeParseInt = exports.maybeTruncateKey = void 0;
|
|
6
|
+
exports.waitForSpace = exports.selectSpace = exports.safeParseInt = exports.maybeTruncateKey = void 0;
|
|
7
|
+
const async_1 = require("@dxos/async");
|
|
7
8
|
const debug_1 = require("@dxos/debug");
|
|
9
|
+
const errors_1 = require("../errors");
|
|
10
|
+
const timeouts_1 = require("../timeouts");
|
|
8
11
|
const maybeTruncateKey = (key, truncate = false) => (truncate ? (0, debug_1.truncateKey)(key) : key.toHex());
|
|
9
12
|
exports.maybeTruncateKey = maybeTruncateKey;
|
|
10
13
|
const safeParseInt = (value, defaultValue) => {
|
|
@@ -21,7 +24,6 @@ exports.safeParseInt = safeParseInt;
|
|
|
21
24
|
// Spaces
|
|
22
25
|
//
|
|
23
26
|
const selectSpace = async (spaces) => {
|
|
24
|
-
await Promise.all(spaces.map((space) => space.waitUntilReady()));
|
|
25
27
|
// eslint-disable-next-line no-eval
|
|
26
28
|
const inquirer = (await eval('import("inquirer")')).default;
|
|
27
29
|
const { key } = await inquirer.prompt([
|
|
@@ -29,13 +31,30 @@ const selectSpace = async (spaces) => {
|
|
|
29
31
|
name: 'key',
|
|
30
32
|
type: 'list',
|
|
31
33
|
message: 'Select a space:',
|
|
32
|
-
choices: spaces.map((space) =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
choices: spaces.map((space) => {
|
|
35
|
+
var _a;
|
|
36
|
+
return ({
|
|
37
|
+
name: `[${(0, debug_1.truncateKey)(space.key)}] ${(_a = space.properties.name) !== null && _a !== void 0 ? _a : ''}`,
|
|
38
|
+
value: space.key,
|
|
39
|
+
});
|
|
40
|
+
}),
|
|
36
41
|
},
|
|
37
42
|
]);
|
|
38
43
|
return key;
|
|
39
44
|
};
|
|
40
45
|
exports.selectSpace = selectSpace;
|
|
46
|
+
const waitForSpace = async (space, exceptionHandler) => {
|
|
47
|
+
try {
|
|
48
|
+
await (0, async_1.asyncTimeout)(space.waitUntilReady(), timeouts_1.SPACE_WAIT_TIMEOUT, new errors_1.SpaceWaitTimeoutError());
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
if (exceptionHandler) {
|
|
52
|
+
exceptionHandler(err);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.waitForSpace = waitForSpace;
|
|
41
60
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/util/util.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/util/util.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uCAA2C;AAE3C,uCAA0C;AAG1C,sCAAkD;AAClD,0CAAiD;AAE1C,MAAM,gBAAgB,GAAG,CAAC,GAAc,EAAE,QAAQ,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAA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