@dxos/cli 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
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/LICENSE +3 -3
- package/bin/dx.js +29 -12
- package/package.json +14 -129
- package/README.md +0 -145
- package/bin/agent_entrypoint +0 -22
- package/bin/dev.cmd +0 -3
- package/bin/dev.js +0 -26
- package/bin/handle_invitation +0 -18
- package/bin/run.cmd +0 -3
- package/dist/src/base.d.ts +0 -18
- package/dist/src/base.d.ts.map +0 -1
- package/dist/src/base.js +0 -76
- package/dist/src/base.js.map +0 -1
- package/dist/src/commands/agent/agent.node.test.d.ts +0 -2
- package/dist/src/commands/agent/agent.node.test.d.ts.map +0 -1
- package/dist/src/commands/agent/agent.node.test.js +0 -178
- package/dist/src/commands/agent/agent.node.test.js.map +0 -1
- package/dist/src/commands/agent/invitations.d.ts +0 -20
- package/dist/src/commands/agent/invitations.d.ts.map +0 -1
- package/dist/src/commands/agent/invitations.js +0 -89
- package/dist/src/commands/agent/invitations.js.map +0 -1
- package/dist/src/commands/agent/list.d.ts +0 -22
- package/dist/src/commands/agent/list.d.ts.map +0 -1
- package/dist/src/commands/agent/list.js +0 -46
- package/dist/src/commands/agent/list.js.map +0 -1
- package/dist/src/commands/agent/restart.d.ts +0 -21
- package/dist/src/commands/agent/restart.d.ts.map +0 -1
- package/dist/src/commands/agent/restart.js +0 -27
- package/dist/src/commands/agent/restart.js.map +0 -1
- package/dist/src/commands/agent/start.d.ts +0 -33
- package/dist/src/commands/agent/start.d.ts.map +0 -1
- package/dist/src/commands/agent/start.js +0 -209
- package/dist/src/commands/agent/start.js.map +0 -1
- package/dist/src/commands/agent/status.d.ts +0 -19
- package/dist/src/commands/agent/status.d.ts.map +0 -1
- package/dist/src/commands/agent/status.js +0 -31
- package/dist/src/commands/agent/status.js.map +0 -1
- package/dist/src/commands/agent/stop.d.ts +0 -22
- package/dist/src/commands/agent/stop.d.ts.map +0 -1
- package/dist/src/commands/agent/stop.js +0 -50
- package/dist/src/commands/agent/stop.js.map +0 -1
- package/dist/src/commands/config/index.d.ts +0 -7
- package/dist/src/commands/config/index.d.ts.map +0 -1
- package/dist/src/commands/config/index.js +0 -18
- package/dist/src/commands/config/index.js.map +0 -1
- package/dist/src/commands/config/index.node.test.d.ts +0 -2
- package/dist/src/commands/config/index.node.test.d.ts.map +0 -1
- package/dist/src/commands/config/index.node.test.js +0 -25
- package/dist/src/commands/config/index.node.test.js.map +0 -1
- package/dist/src/commands/debug/diagnostics.d.ts +0 -25
- package/dist/src/commands/debug/diagnostics.d.ts.map +0 -1
- package/dist/src/commands/debug/diagnostics.js +0 -54
- package/dist/src/commands/debug/diagnostics.js.map +0 -1
- package/dist/src/commands/debug/error.d.ts +0 -6
- package/dist/src/commands/debug/error.d.ts.map +0 -1
- package/dist/src/commands/debug/error.js +0 -24
- package/dist/src/commands/debug/error.js.map +0 -1
- package/dist/src/commands/debug/generate.d.ts +0 -27
- package/dist/src/commands/debug/generate.d.ts.map +0 -1
- package/dist/src/commands/debug/generate.js +0 -73
- package/dist/src/commands/debug/generate.js.map +0 -1
- package/dist/src/commands/debug/metrics.d.ts +0 -10
- package/dist/src/commands/debug/metrics.d.ts.map +0 -1
- package/dist/src/commands/debug/metrics.js +0 -41
- package/dist/src/commands/debug/metrics.js.map +0 -1
- package/dist/src/commands/debug/status.d.ts +0 -20
- package/dist/src/commands/debug/status.d.ts.map +0 -1
- package/dist/src/commands/debug/status.js +0 -29
- package/dist/src/commands/debug/status.js.map +0 -1
- package/dist/src/commands/device/info.d.ts +0 -7
- package/dist/src/commands/device/info.d.ts.map +0 -1
- package/dist/src/commands/device/info.js +0 -32
- package/dist/src/commands/device/info.js.map +0 -1
- package/dist/src/commands/device/list.d.ts +0 -20
- package/dist/src/commands/device/list.d.ts.map +0 -1
- package/dist/src/commands/device/list.js +0 -24
- package/dist/src/commands/device/list.js.map +0 -1
- package/dist/src/commands/device/update.d.ts +0 -19
- package/dist/src/commands/device/update.d.ts.map +0 -1
- package/dist/src/commands/device/update.js +0 -34
- package/dist/src/commands/device/update.js.map +0 -1
- package/dist/src/commands/function/list.d.ts +0 -9
- package/dist/src/commands/function/list.d.ts.map +0 -1
- package/dist/src/commands/function/list.js +0 -38
- package/dist/src/commands/function/list.js.map +0 -1
- package/dist/src/commands/function/logs.d.ts +0 -14
- package/dist/src/commands/function/logs.d.ts.map +0 -1
- package/dist/src/commands/function/logs.js +0 -40
- package/dist/src/commands/function/logs.js.map +0 -1
- package/dist/src/commands/function/trigger/list.d.ts +0 -26
- package/dist/src/commands/function/trigger/list.d.ts.map +0 -1
- package/dist/src/commands/function/trigger/list.js +0 -52
- package/dist/src/commands/function/trigger/list.js.map +0 -1
- package/dist/src/commands/function/upload.d.ts +0 -34
- package/dist/src/commands/function/upload.d.ts.map +0 -1
- package/dist/src/commands/function/upload.js +0 -153
- package/dist/src/commands/function/upload.js.map +0 -1
- package/dist/src/commands/function/watch.d.ts +0 -29
- package/dist/src/commands/function/watch.d.ts.map +0 -1
- package/dist/src/commands/function/watch.js +0 -130
- package/dist/src/commands/function/watch.js.map +0 -1
- package/dist/src/commands/halo/create.d.ts +0 -24
- package/dist/src/commands/halo/create.d.ts.map +0 -1
- package/dist/src/commands/halo/create.js +0 -37
- package/dist/src/commands/halo/create.js.map +0 -1
- package/dist/src/commands/halo/credential/add.d.ts +0 -9
- package/dist/src/commands/halo/credential/add.d.ts.map +0 -1
- package/dist/src/commands/halo/credential/add.js +0 -43
- package/dist/src/commands/halo/credential/add.js.map +0 -1
- package/dist/src/commands/halo/credential/list.d.ts +0 -23
- package/dist/src/commands/halo/credential/list.d.ts.map +0 -1
- package/dist/src/commands/halo/credential/list.js +0 -63
- package/dist/src/commands/halo/credential/list.js.map +0 -1
- package/dist/src/commands/halo/identity.d.ts +0 -8
- package/dist/src/commands/halo/identity.d.ts.map +0 -1
- package/dist/src/commands/halo/identity.js +0 -32
- package/dist/src/commands/halo/identity.js.map +0 -1
- package/dist/src/commands/halo/join.d.ts +0 -23
- package/dist/src/commands/halo/join.d.ts.map +0 -1
- package/dist/src/commands/halo/join.js +0 -96
- package/dist/src/commands/halo/join.js.map +0 -1
- package/dist/src/commands/halo/keys.d.ts +0 -7
- package/dist/src/commands/halo/keys.d.ts.map +0 -1
- package/dist/src/commands/halo/keys.js +0 -15
- package/dist/src/commands/halo/keys.js.map +0 -1
- package/dist/src/commands/halo/recovery/generate.d.ts +0 -7
- package/dist/src/commands/halo/recovery/generate.d.ts.map +0 -1
- package/dist/src/commands/halo/recovery/generate.js +0 -17
- package/dist/src/commands/halo/recovery/generate.js.map +0 -1
- package/dist/src/commands/halo/recovery/use.d.ts +0 -20
- package/dist/src/commands/halo/recovery/use.d.ts.map +0 -1
- package/dist/src/commands/halo/recovery/use.js +0 -22
- package/dist/src/commands/halo/recovery/use.js.map +0 -1
- package/dist/src/commands/halo/share.d.ts +0 -24
- package/dist/src/commands/halo/share.d.ts.map +0 -1
- package/dist/src/commands/halo/share.js +0 -74
- package/dist/src/commands/halo/share.js.map +0 -1
- package/dist/src/commands/halo/update.d.ts +0 -19
- package/dist/src/commands/halo/update.d.ts.map +0 -1
- package/dist/src/commands/halo/update.js +0 -36
- package/dist/src/commands/halo/update.js.map +0 -1
- package/dist/src/commands/info.d.ts +0 -19
- package/dist/src/commands/info.d.ts.map +0 -1
- package/dist/src/commands/info.js +0 -24
- package/dist/src/commands/info.js.map +0 -1
- package/dist/src/commands/profile/import.d.ts +0 -20
- package/dist/src/commands/profile/import.d.ts.map +0 -1
- package/dist/src/commands/profile/import.js +0 -67
- package/dist/src/commands/profile/import.js.map +0 -1
- package/dist/src/commands/profile/inspect.d.ts +0 -20
- package/dist/src/commands/profile/inspect.d.ts.map +0 -1
- package/dist/src/commands/profile/inspect.js +0 -38
- package/dist/src/commands/profile/inspect.js.map +0 -1
- package/dist/src/commands/reset/index.d.ts +0 -20
- package/dist/src/commands/reset/index.d.ts.map +0 -1
- package/dist/src/commands/reset/index.js +0 -76
- package/dist/src/commands/reset/index.js.map +0 -1
- package/dist/src/commands/shell/index.d.ts +0 -6
- package/dist/src/commands/shell/index.d.ts.map +0 -1
- package/dist/src/commands/shell/index.js +0 -26
- package/dist/src/commands/shell/index.js.map +0 -1
- package/dist/src/commands/space/close.d.ts +0 -9
- package/dist/src/commands/space/close.d.ts.map +0 -1
- package/dist/src/commands/space/close.js +0 -18
- package/dist/src/commands/space/close.js.map +0 -1
- package/dist/src/commands/space/create.d.ts +0 -10
- package/dist/src/commands/space/create.d.ts.map +0 -1
- package/dist/src/commands/space/create.js +0 -26
- package/dist/src/commands/space/create.js.map +0 -1
- package/dist/src/commands/space/epoch.d.ts +0 -10
- package/dist/src/commands/space/epoch.d.ts.map +0 -1
- package/dist/src/commands/space/epoch.js +0 -19
- package/dist/src/commands/space/epoch.js.map +0 -1
- package/dist/src/commands/space/info.d.ts +0 -10
- package/dist/src/commands/space/info.d.ts.map +0 -1
- package/dist/src/commands/space/info.js +0 -27
- package/dist/src/commands/space/info.js.map +0 -1
- package/dist/src/commands/space/join.d.ts +0 -21
- package/dist/src/commands/space/join.d.ts.map +0 -1
- package/dist/src/commands/space/join.js +0 -73
- package/dist/src/commands/space/join.js.map +0 -1
- package/dist/src/commands/space/list.d.ts +0 -24
- package/dist/src/commands/space/list.d.ts.map +0 -1
- package/dist/src/commands/space/list.js +0 -91
- package/dist/src/commands/space/list.js.map +0 -1
- package/dist/src/commands/space/members.d.ts +0 -23
- package/dist/src/commands/space/members.d.ts.map +0 -1
- package/dist/src/commands/space/members.js +0 -28
- package/dist/src/commands/space/members.js.map +0 -1
- package/dist/src/commands/space/open.d.ts +0 -9
- package/dist/src/commands/space/open.d.ts.map +0 -1
- package/dist/src/commands/space/open.js +0 -18
- package/dist/src/commands/space/open.js.map +0 -1
- package/dist/src/commands/space/query.d.ts +0 -25
- package/dist/src/commands/space/query.d.ts.map +0 -1
- package/dist/src/commands/space/query.js +0 -46
- package/dist/src/commands/space/query.js.map +0 -1
- package/dist/src/commands/space/schema/list.d.ts +0 -21
- package/dist/src/commands/space/schema/list.d.ts.map +0 -1
- package/dist/src/commands/space/schema/list.js +0 -60
- package/dist/src/commands/space/schema/list.js.map +0 -1
- package/dist/src/commands/space/share.d.ts +0 -27
- package/dist/src/commands/space/share.d.ts.map +0 -1
- package/dist/src/commands/space/share.js +0 -81
- package/dist/src/commands/space/share.js.map +0 -1
- package/dist/src/commands/tunnel/index.d.ts +0 -22
- package/dist/src/commands/tunnel/index.d.ts.map +0 -1
- package/dist/src/commands/tunnel/index.js +0 -46
- package/dist/src/commands/tunnel/index.js.map +0 -1
- package/dist/src/commands/tunnel/list.d.ts +0 -21
- package/dist/src/commands/tunnel/list.d.ts.map +0 -1
- package/dist/src/commands/tunnel/list.js +0 -32
- package/dist/src/commands/tunnel/list.js.map +0 -1
- package/dist/src/components/App.d.ts +0 -10
- package/dist/src/components/App.d.ts.map +0 -1
- package/dist/src/components/App.js +0 -31
- package/dist/src/components/App.js.map +0 -1
- package/dist/src/components/SpaceTable.d.ts +0 -10
- package/dist/src/components/SpaceTable.d.ts.map +0 -1
- package/dist/src/components/SpaceTable.js +0 -33
- package/dist/src/components/SpaceTable.js.map +0 -1
- package/dist/src/components/SystemTable.d.ts +0 -8
- package/dist/src/components/SystemTable.d.ts.map +0 -1
- package/dist/src/components/SystemTable.js +0 -51
- package/dist/src/components/SystemTable.js.map +0 -1
- package/dist/src/components/index.d.ts +0 -4
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -7
- package/dist/src/components/index.js.map +0 -1
- package/dist/src/help.d.ts +0 -6
- package/dist/src/help.d.ts.map +0 -1
- package/dist/src/help.js +0 -37
- package/dist/src/help.js.map +0 -1
- package/dist/src/hooks/command-not-found.d.ts +0 -4
- package/dist/src/hooks/command-not-found.d.ts.map +0 -1
- package/dist/src/hooks/command-not-found.js +0 -16
- package/dist/src/hooks/command-not-found.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -6
- package/dist/src/index.js.map +0 -1
- package/dist/src/util/function/bundle.d.ts +0 -5
- package/dist/src/util/function/bundle.d.ts.map +0 -1
- package/dist/src/util/function/bundle.js +0 -13
- package/dist/src/util/function/bundle.js.map +0 -1
- package/dist/src/util/function/index.d.ts +0 -3
- package/dist/src/util/function/index.d.ts.map +0 -1
- package/dist/src/util/function/index.js +0 -6
- package/dist/src/util/function/index.js.map +0 -1
- package/dist/src/util/function/lookup.d.ts +0 -18
- package/dist/src/util/function/lookup.d.ts.map +0 -1
- package/dist/src/util/function/lookup.js +0 -14
- package/dist/src/util/function/lookup.js.map +0 -1
- package/dist/src/util/index.d.ts +0 -6
- package/dist/src/util/index.d.ts.map +0 -1
- package/dist/src/util/index.js +0 -9
- package/dist/src/util/index.js.map +0 -1
- package/dist/src/util/provider/digital-ocean.d.ts +0 -14
- package/dist/src/util/provider/digital-ocean.d.ts.map +0 -1
- package/dist/src/util/provider/digital-ocean.js +0 -123
- package/dist/src/util/provider/digital-ocean.js.map +0 -1
- package/dist/src/util/provider/index.d.ts +0 -3
- package/dist/src/util/provider/index.d.ts.map +0 -1
- package/dist/src/util/provider/index.js +0 -6
- package/dist/src/util/provider/index.js.map +0 -1
- package/dist/src/util/provider/provider.d.ts +0 -27
- package/dist/src/util/provider/provider.d.ts.map +0 -1
- package/dist/src/util/provider/provider.js +0 -24
- package/dist/src/util/provider/provider.js.map +0 -1
- package/dist/src/util/publish/build.d.ts +0 -11
- package/dist/src/util/publish/build.d.ts.map +0 -1
- package/dist/src/util/publish/build.js +0 -25
- package/dist/src/util/publish/build.js.map +0 -1
- package/dist/src/util/publish/common.d.ts +0 -11
- package/dist/src/util/publish/common.d.ts.map +0 -1
- package/dist/src/util/publish/common.js +0 -23
- package/dist/src/util/publish/common.js.map +0 -1
- package/dist/src/util/publish/config.d.ts +0 -3
- package/dist/src/util/publish/config.d.ts.map +0 -1
- package/dist/src/util/publish/config.js +0 -28
- package/dist/src/util/publish/config.js.map +0 -1
- package/dist/src/util/publish/index.d.ts +0 -7
- package/dist/src/util/publish/index.d.ts.map +0 -1
- package/dist/src/util/publish/index.js +0 -10
- package/dist/src/util/publish/index.js.map +0 -1
- package/dist/src/util/publish/ipfs-upload.d.ts +0 -8
- package/dist/src/util/publish/ipfs-upload.d.ts.map +0 -1
- package/dist/src/util/publish/ipfs-upload.js +0 -50
- package/dist/src/util/publish/ipfs-upload.js.map +0 -1
- package/dist/src/util/publish/publish.d.ts +0 -14
- package/dist/src/util/publish/publish.d.ts.map +0 -1
- package/dist/src/util/publish/publish.js +0 -52
- package/dist/src/util/publish/publish.js.map +0 -1
- package/dist/src/util/publish/publisher-rpc-peer.d.ts +0 -15
- package/dist/src/util/publish/publisher-rpc-peer.d.ts.map +0 -1
- package/dist/src/util/publish/publisher-rpc-peer.js +0 -80
- package/dist/src/util/publish/publisher-rpc-peer.js.map +0 -1
- package/dist/src/util/supervisor/index.d.ts +0 -2
- package/dist/src/util/supervisor/index.d.ts.map +0 -1
- package/dist/src/util/supervisor/index.js +0 -5
- package/dist/src/util/supervisor/index.js.map +0 -1
- package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts +0 -15
- package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts.map +0 -1
- package/dist/src/util/supervisor/supervisor-rpc-peer.js +0 -81
- package/dist/src/util/supervisor/supervisor-rpc-peer.js.map +0 -1
- package/dist/src/util/tunnel/common.d.ts +0 -9
- package/dist/src/util/tunnel/common.d.ts.map +0 -1
- package/dist/src/util/tunnel/common.js +0 -26
- package/dist/src/util/tunnel/common.js.map +0 -1
- package/dist/src/util/tunnel/index.d.ts +0 -3
- package/dist/src/util/tunnel/index.d.ts.map +0 -1
- package/dist/src/util/tunnel/index.js +0 -6
- package/dist/src/util/tunnel/index.js.map +0 -1
- package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts +0 -15
- package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts.map +0 -1
- package/dist/src/util/tunnel/tunnel-rpc-peer.js +0 -81
- package/dist/src/util/tunnel/tunnel-rpc-peer.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/oclif.manifest.json +0 -5718
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Inspect extends BaseCommand<typeof Inspect> {
|
|
3
|
-
static description: string;
|
|
4
|
-
static flags: {
|
|
5
|
-
file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
-
storage: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
agent: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
'json-log': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
'json-logfile': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
-
};
|
|
18
|
-
run(): Promise<any>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/inspect.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,WAAW,CAAC,OAAO,OAAO,CAAC;IAC9D,OAAgB,WAAW,SAAqB;IAChD,OAAgB,KAAK;;;;;;;;;;;;;MAUnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAoB1B"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { Flags } from '@oclif/core';
|
|
5
|
-
import { readFile } from 'fs/promises';
|
|
6
|
-
import { ProfileArchiveEntryType } from '@dxos/protocols';
|
|
7
|
-
import { arrayToBuffer } from '@dxos/util';
|
|
8
|
-
import { BaseCommand } from '../../base';
|
|
9
|
-
class Inspect extends BaseCommand {
|
|
10
|
-
async run() {
|
|
11
|
-
const { file, storage } = this.flags;
|
|
12
|
-
const { decodeProfileArchive } = await import('@dxos/client-services');
|
|
13
|
-
const data = await readFile(file);
|
|
14
|
-
const archive = decodeProfileArchive(data);
|
|
15
|
-
console.log(archive.meta);
|
|
16
|
-
if (storage) {
|
|
17
|
-
console.log('\nStorage entires:\n');
|
|
18
|
-
for (const entry of archive.storage) {
|
|
19
|
-
const key = typeof entry.key === 'string' ? entry.key : JSON.stringify(arrayToBuffer(entry.key).toString()).slice(1, -1);
|
|
20
|
-
console.log(` ${ProfileArchiveEntryType[entry.type]} ${key}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
Inspect.description = 'Import profile.';
|
|
26
|
-
Inspect.flags = {
|
|
27
|
-
...BaseCommand.flags,
|
|
28
|
-
file: Flags.string({
|
|
29
|
-
description: 'Archive filename.',
|
|
30
|
-
required: true,
|
|
31
|
-
}),
|
|
32
|
-
storage: Flags.boolean({
|
|
33
|
-
description: 'List storage entries.',
|
|
34
|
-
default: false,
|
|
35
|
-
}),
|
|
36
|
-
};
|
|
37
|
-
export default Inspect;
|
|
38
|
-
//# sourceMappingURL=inspect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../../../src/commands/profile/inspect.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAqB,OAAQ,SAAQ,WAA2B;IAc9D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAErC,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;QAEvE,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAE3C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE1B,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YACpC,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpC,MAAM,GAAG,GACP,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;gBAE/G,OAAO,CAAC,GAAG,CAAC,KAAK,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;IACH,CAAC;;AAhCe,mBAAW,GAAG,iBAAiB,CAAC;AAChC,aAAK,GAAG;IACtB,GAAG,WAAW,CAAC,KAAK;IACpB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,mBAAmB;QAChC,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAC;eAZiB,OAAO"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Reset extends BaseCommand<typeof Reset> {
|
|
3
|
-
static description: string;
|
|
4
|
-
static flags: {
|
|
5
|
-
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
|
-
'default-config': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
agent: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
'json-log': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
'json-logfile': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
-
};
|
|
18
|
-
run(): Promise<any>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/reset/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IAC1D,OAAgB,WAAW,SAAsB;IACjD,OAAgB,KAAK;;;;;;;;;;;;;MAUnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CA8D1B"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { Flags } from '@oclif/core';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import inquirer from 'inquirer';
|
|
8
|
-
import { DX_CACHE, DX_CONFIG, DX_DATA, DX_RUNTIME, DX_STATE, getProfilePath } from '@dxos/client-protocol';
|
|
9
|
-
import { BaseCommand } from '../../base';
|
|
10
|
-
class Reset extends BaseCommand {
|
|
11
|
-
async run() {
|
|
12
|
-
var _a;
|
|
13
|
-
const storage = (_a = this.clientConfig) === null || _a === void 0 ? void 0 : _a.get('runtime.client.storage.dataRoot');
|
|
14
|
-
const profile = this.flags.profile;
|
|
15
|
-
const paths = [
|
|
16
|
-
...new Set([
|
|
17
|
-
getProfilePath(DX_CACHE, profile),
|
|
18
|
-
getProfilePath(DX_DATA, profile),
|
|
19
|
-
getProfilePath(DX_STATE, profile),
|
|
20
|
-
getProfilePath(DX_RUNTIME, profile),
|
|
21
|
-
this.flags['default-config'] && getProfilePath(DX_CONFIG, profile) + '.yml',
|
|
22
|
-
storage,
|
|
23
|
-
]
|
|
24
|
-
.sort()
|
|
25
|
-
.filter(Boolean)),
|
|
26
|
-
];
|
|
27
|
-
if (storage && storage !== getProfilePath(DX_DATA, profile)) {
|
|
28
|
-
this.warn(chalk `The storage path does not match the default:\n- config: {yellow ${storage}}\n- expected: {green ${getProfilePath(DX_DATA, profile)}}`);
|
|
29
|
-
}
|
|
30
|
-
let dryRun = this.flags['dry-run'];
|
|
31
|
-
if (!dryRun && !this.flags.force) {
|
|
32
|
-
const { confirm } = await inquirer.prompt({
|
|
33
|
-
type: 'confirm',
|
|
34
|
-
name: 'confirm',
|
|
35
|
-
default: false,
|
|
36
|
-
message: chalk `{red Delete all data? {white (Profile: ${profile})}}`,
|
|
37
|
-
});
|
|
38
|
-
dryRun = !confirm;
|
|
39
|
-
}
|
|
40
|
-
if (!dryRun) {
|
|
41
|
-
await this.execWithDaemon(async (daemon) => {
|
|
42
|
-
await daemon.stop(this.flags.profile, { force: this.flags.force });
|
|
43
|
-
}, true);
|
|
44
|
-
await this.execWithDaemon(async (daemon) => {
|
|
45
|
-
if (await daemon.isRunning(this.flags.profile)) {
|
|
46
|
-
await daemon.stop(this.flags.profile, { force: this.flags.force });
|
|
47
|
-
}
|
|
48
|
-
}, false);
|
|
49
|
-
if (this.flags.verbose) {
|
|
50
|
-
this.log(chalk `{red Deleting files...}`);
|
|
51
|
-
paths.forEach((path) => this.log(`- ${path}`));
|
|
52
|
-
}
|
|
53
|
-
paths.forEach((path) => {
|
|
54
|
-
fs.rmSync(path, { recursive: true, force: true });
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
this.log('Files', paths);
|
|
59
|
-
}
|
|
60
|
-
return paths;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
Reset.description = 'Reset user data.';
|
|
64
|
-
Reset.flags = {
|
|
65
|
-
...BaseCommand.flags,
|
|
66
|
-
force: Flags.boolean({
|
|
67
|
-
description: 'Force delete.',
|
|
68
|
-
default: false,
|
|
69
|
-
}),
|
|
70
|
-
'default-config': Flags.boolean({
|
|
71
|
-
description: 'Replace config with defaults.',
|
|
72
|
-
default: false,
|
|
73
|
-
}),
|
|
74
|
-
};
|
|
75
|
-
export default Reset;
|
|
76
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/reset/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE3G,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAqB,KAAM,SAAQ,WAAyB;IAc1D,KAAK,CAAC,GAAG;;QACP,MAAM,OAAO,GAAG,MAAA,IAAI,CAAC,YAAY,0CAAE,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC1E,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QACnC,MAAM,KAAK,GAAG;YACZ,GAAG,IAAI,GAAG,CACR;gBACE,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC;gBACjC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC;gBAChC,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC;gBACjC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC;gBACnC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,MAAM;gBAC3E,OAAO;aACR;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AAO,CAAC,IAAI,CAAC;CAgB3B"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { run } from '@oclif/core';
|
|
5
|
-
import inquirer from 'inquirer';
|
|
6
|
-
import { BaseCommand } from '../../base';
|
|
7
|
-
class Shell extends BaseCommand {
|
|
8
|
-
async run() {
|
|
9
|
-
while (true) {
|
|
10
|
-
// https://github.com/oclif/cli-ux
|
|
11
|
-
const { command } = await inquirer.prompt({
|
|
12
|
-
name: 'command',
|
|
13
|
-
type: 'input',
|
|
14
|
-
message: 'Command',
|
|
15
|
-
});
|
|
16
|
-
if (command === 'quit') {
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
// https://oclif.io/docs/running_programmatically
|
|
20
|
-
await run(command.split(' '));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
Shell.description = 'Interactive shell.';
|
|
25
|
-
export default Shell;
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/shell/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAqB,KAAM,SAAQ,WAAyB;IAG1D,KAAK,CAAC,GAAG;QACP,OAAO,IAAI,EAAE,CAAC;YACZ,kCAAkC;YAClC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAsB;gBAC7D,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,SAAS;aACnB,CAAC,CAAC;YACH,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;gBACvB,MAAM;YACR,CAAC;YAED,iDAAiD;YACjD,MAAM,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;;AAjBe,iBAAW,GAAG,oBAAoB,CAAC;eADhC,KAAK"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Close extends BaseCommand<typeof Close> {
|
|
3
|
-
static description: string;
|
|
4
|
-
static args: {
|
|
5
|
-
key: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
|
-
};
|
|
7
|
-
run(): Promise<any>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=close.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../../src/commands/space/close.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IAC1D,OAAgB,WAAW,SAAkB;IAC7C,OAAgB,IAAI;;MAAkB;IAEhC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAO1B"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { ARG_SPACE_KEYS } from '@dxos/cli-base';
|
|
5
|
-
import { BaseCommand } from '../../base';
|
|
6
|
-
class Close extends BaseCommand {
|
|
7
|
-
async run() {
|
|
8
|
-
const { key } = this.args;
|
|
9
|
-
return await this.execWithClient(async ({ client }) => {
|
|
10
|
-
const space = await this.getSpace(client, key, false);
|
|
11
|
-
await space.close();
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
Close.description = 'Close space.';
|
|
16
|
-
Close.args = ARG_SPACE_KEYS;
|
|
17
|
-
export default Close;
|
|
18
|
-
//# sourceMappingURL=close.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"close.js","sourceRoot":"","sources":["../../../../src/commands/space/close.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAqB,KAAM,SAAQ,WAAyB;IAI1D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACpD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACtD,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;;AATe,iBAAW,GAAG,cAAc,CAAC;AAC7B,UAAI,GAAG,cAAc,CAAC;eAFnB,KAAK"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Create extends BaseCommand<typeof Create> {
|
|
3
|
-
static enableJsonFlag: boolean;
|
|
4
|
-
static description: string;
|
|
5
|
-
static args: {
|
|
6
|
-
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
-
};
|
|
8
|
-
run(): Promise<any>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/commands/space/create.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAAmB;IAC9C,OAAgB,IAAI;;MAA2B;IAEzC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAa1B"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { ux, Args } from '@oclif/core';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import { waitForSpace } from '@dxos/cli-base';
|
|
7
|
-
import { BaseCommand } from '../../base';
|
|
8
|
-
class Create extends BaseCommand {
|
|
9
|
-
async run() {
|
|
10
|
-
return await this.execWithClient(async ({ client }) => {
|
|
11
|
-
const space = await client.spaces.create();
|
|
12
|
-
await waitForSpace(space, this.flags.timeout, (err) => this.catch(err));
|
|
13
|
-
space.properties.name = this.args.name;
|
|
14
|
-
ux.stdout(chalk `{green Created}: ${space.key.truncate()}`);
|
|
15
|
-
return {
|
|
16
|
-
key: space.key,
|
|
17
|
-
name: space.properties.name,
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
Create.enableJsonFlag = true;
|
|
23
|
-
Create.description = 'Create space.';
|
|
24
|
-
Create.args = { name: Args.string() };
|
|
25
|
-
export default Create;
|
|
26
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/space/create.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAqB,MAAO,SAAQ,WAA0B;IAK5D,KAAK,CAAC,GAAG;QACP,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACpD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC3C,MAAM,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YACxE,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAEvC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAA,oBAAoB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAC3D,OAAO;gBACL,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI;aAC5B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;;AAhBe,qBAAc,GAAG,IAAI,CAAC;AACtB,kBAAW,GAAG,eAAe,CAAC;AAC9B,WAAI,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;eAH5B,MAAM"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Epoch extends BaseCommand<typeof Epoch> {
|
|
3
|
-
static enableJsonFlag: boolean;
|
|
4
|
-
static description: string;
|
|
5
|
-
static args: {
|
|
6
|
-
key: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
-
};
|
|
8
|
-
run(): Promise<any>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=epoch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"epoch.d.ts","sourceRoot":"","sources":["../../../../src/commands/space/epoch.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IAC1D,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAAuB;IAClD,OAAgB,IAAI;;MAAkB;IAEhC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAO1B"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { ARG_SPACE_KEYS } from '@dxos/cli-base';
|
|
5
|
-
import { BaseCommand } from '../../base';
|
|
6
|
-
class Epoch extends BaseCommand {
|
|
7
|
-
async run() {
|
|
8
|
-
const { key } = this.args;
|
|
9
|
-
return await this.execWithClient(async ({ client }) => {
|
|
10
|
-
const space = await this.getSpace(client, key);
|
|
11
|
-
await space.internal.createEpoch();
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
Epoch.enableJsonFlag = true;
|
|
16
|
-
Epoch.description = 'Create new epoch.';
|
|
17
|
-
Epoch.args = ARG_SPACE_KEYS;
|
|
18
|
-
export default Epoch;
|
|
19
|
-
//# sourceMappingURL=epoch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"epoch.js","sourceRoot":"","sources":["../../../../src/commands/space/epoch.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAqB,KAAM,SAAQ,WAAyB;IAK1D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACpD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC/C,MAAM,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC;;AAVe,oBAAc,GAAG,IAAI,CAAC;AACtB,iBAAW,GAAG,mBAAmB,CAAC;AAClC,UAAI,GAAG,cAAc,CAAC;eAHnB,KAAK"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Info extends BaseCommand<typeof Info> {
|
|
3
|
-
static enableJsonFlag: boolean;
|
|
4
|
-
static description: string;
|
|
5
|
-
static args: {
|
|
6
|
-
key: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
-
};
|
|
8
|
-
run(): Promise<any>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=info.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../../src/commands/space/info.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAAsB;IACjD,OAAgB,IAAI;;MAAkB;IAEhC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAc1B"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { ARG_SPACE_KEYS } from '@dxos/cli-base';
|
|
5
|
-
import { BaseCommand } from '../../base';
|
|
6
|
-
class Info extends BaseCommand {
|
|
7
|
-
async run() {
|
|
8
|
-
const { key } = this.args;
|
|
9
|
-
return await this.execWithClient(async ({ client }) => {
|
|
10
|
-
const space = await this.getSpace(client, key, false);
|
|
11
|
-
// await space.waitUntilReady();
|
|
12
|
-
// TODO(burdon): Factor out info (from diagnostics).
|
|
13
|
-
const data = space.internal.data.metrics;
|
|
14
|
-
if (this.flags.json) {
|
|
15
|
-
return data;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
this.log(JSON.stringify(data, undefined, 2));
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
Info.enableJsonFlag = true;
|
|
24
|
-
Info.description = 'Show space info.';
|
|
25
|
-
Info.args = ARG_SPACE_KEYS;
|
|
26
|
-
export default Info;
|
|
27
|
-
//# sourceMappingURL=info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../../src/commands/space/info.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAqB,IAAK,SAAQ,WAAwB;IAKxD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACpD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACtD,gCAAgC;YAChC,oDAAoD;YACpD,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;YACzC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAjBe,mBAAc,GAAG,IAAI,CAAC;AACtB,gBAAW,GAAG,kBAAkB,CAAC;AACjC,SAAI,GAAG,cAAc,CAAC;eAHnB,IAAI"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Join extends BaseCommand<typeof Join> {
|
|
3
|
-
static enableJsonFlag: boolean;
|
|
4
|
-
static description: string;
|
|
5
|
-
static flags: {
|
|
6
|
-
invitation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
secret: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
-
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
-
agent: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
'json-log': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
-
'json-logfile': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
-
};
|
|
19
|
-
run(): Promise<any>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=join.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../../../src/commands/space/join.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAA2B;IACtD,OAAgB,KAAK;;;;;;;;;;;;;MAQnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAoD1B"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { Flags, ux } from '@oclif/core';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import inquirer from 'inquirer';
|
|
7
|
-
import { sleep, Trigger } from '@dxos/async';
|
|
8
|
-
import { acceptInvitation } from '@dxos/cli-base';
|
|
9
|
-
import { BaseCommand } from '../../base';
|
|
10
|
-
class Join extends BaseCommand {
|
|
11
|
-
async run() {
|
|
12
|
-
return await this.execWithClient(async ({ client }) => {
|
|
13
|
-
var _a;
|
|
14
|
-
let { invitation: encoded, secret } = this.flags;
|
|
15
|
-
if (!encoded) {
|
|
16
|
-
const { invitation } = await inquirer.prompt({
|
|
17
|
-
type: 'input',
|
|
18
|
-
name: 'invitation',
|
|
19
|
-
message: 'Invitation',
|
|
20
|
-
});
|
|
21
|
-
encoded = invitation;
|
|
22
|
-
}
|
|
23
|
-
if (encoded.startsWith('http') || encoded.startsWith('socket')) {
|
|
24
|
-
const searchParams = new URLSearchParams(encoded.substring(encoded.lastIndexOf('?')));
|
|
25
|
-
encoded = (_a = searchParams.get('spaceInvitationCode')) !== null && _a !== void 0 ? _a : encoded;
|
|
26
|
-
}
|
|
27
|
-
ux.action.start('Waiting for peer to connect');
|
|
28
|
-
const done = new Trigger();
|
|
29
|
-
// TODO(burdon): Error code if joining same space (don't throw!)
|
|
30
|
-
const invitation = await acceptInvitation({
|
|
31
|
-
observable: client.spaces.join(encoded),
|
|
32
|
-
callbacks: {
|
|
33
|
-
onConnecting: async () => ux.action.stop(),
|
|
34
|
-
onReadyForAuth: async () => {
|
|
35
|
-
if (!secret) {
|
|
36
|
-
const { secret } = await inquirer.prompt({
|
|
37
|
-
type: 'input',
|
|
38
|
-
name: 'secret',
|
|
39
|
-
message: chalk `\n{red Secret}`,
|
|
40
|
-
});
|
|
41
|
-
return secret;
|
|
42
|
-
}
|
|
43
|
-
return secret;
|
|
44
|
-
},
|
|
45
|
-
onSuccess: async () => {
|
|
46
|
-
done.wake();
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
await done.wait();
|
|
51
|
-
// TODO(burdon): Race condition.
|
|
52
|
-
await sleep(1000);
|
|
53
|
-
const space = client.spaces.get(invitation.spaceKey);
|
|
54
|
-
ux.stdout(chalk `{green Joined successfully.}`);
|
|
55
|
-
return {
|
|
56
|
-
key: space.key,
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
Join.enableJsonFlag = true;
|
|
62
|
-
Join.description = 'Join space invitation';
|
|
63
|
-
Join.flags = {
|
|
64
|
-
...BaseCommand.flags,
|
|
65
|
-
invitation: Flags.string({
|
|
66
|
-
description: 'Invitation code',
|
|
67
|
-
}),
|
|
68
|
-
secret: Flags.string({
|
|
69
|
-
description: 'Invitation secret',
|
|
70
|
-
}),
|
|
71
|
-
};
|
|
72
|
-
export default Join;
|
|
73
|
-
//# sourceMappingURL=join.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"join.js","sourceRoot":"","sources":["../../../../src/commands/space/join.ts"],"names":[],"mappings":"AAA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,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE,mBAAmB;KACjC,CAAC;CACH,CAAC;eAXiB,IAAI"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type Client } from '@dxos/client';
|
|
2
|
-
import { BaseCommand } from '../../base';
|
|
3
|
-
export default class List extends BaseCommand<typeof List> {
|
|
4
|
-
static enableJsonFlag: boolean;
|
|
5
|
-
static description: string;
|
|
6
|
-
static flags: {
|
|
7
|
-
live: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
noWait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
extended: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
-
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
-
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
-
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
-
target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
-
agent: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
-
'json-log': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
-
'json-logfile': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
-
};
|
|
21
|
-
run(): Promise<any>;
|
|
22
|
-
_startLiveUpdate(client: Client): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/space/list.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAAkB;IAC7C,OAAgB,KAAK;;;;;;;;;;;;;;MAenB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAkBnB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAkDtD"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { Flags } from '@oclif/core';
|
|
5
|
-
import { Event } from '@dxos/async';
|
|
6
|
-
import { mapSpaces, printSpaces, TABLE_FLAGS } from '@dxos/cli-base';
|
|
7
|
-
import { Context } from '@dxos/context';
|
|
8
|
-
import { Filter } from '@dxos/echo';
|
|
9
|
-
import { BaseCommand } from '../../base';
|
|
10
|
-
class List extends BaseCommand {
|
|
11
|
-
async run() {
|
|
12
|
-
return await this.execWithClient(async ({ client }) => {
|
|
13
|
-
const spaces = await this.getSpaces(client, { wait: !this.flags.noWait });
|
|
14
|
-
if (this.flags.json) {
|
|
15
|
-
return mapSpaces(spaces);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
await printSpaces(spaces, this.flags);
|
|
19
|
-
if (this.flags.live) {
|
|
20
|
-
// TODO(burdon): Use https://www.npmjs.com/package/ansi-escapes to reset screen.
|
|
21
|
-
console.clear();
|
|
22
|
-
await this._startLiveUpdate(client);
|
|
23
|
-
await new Promise((resolve, reject) => { });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
async _startLiveUpdate(client) {
|
|
29
|
-
const ctx = new Context();
|
|
30
|
-
const subscriptions = new Map();
|
|
31
|
-
ctx.onDispose(() => subscriptions.forEach((subscription) => subscription.unsubscribe()));
|
|
32
|
-
const update = new Event();
|
|
33
|
-
update.debounce(1000).on(ctx, async () => {
|
|
34
|
-
console.clear();
|
|
35
|
-
await printSpaces(spaces, this.flags);
|
|
36
|
-
});
|
|
37
|
-
const subscribeToSpaceUpdate = (space) => {
|
|
38
|
-
const sub1 = space.pipeline.subscribe({
|
|
39
|
-
next: () => {
|
|
40
|
-
update.emit();
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
const sub2 = space.db.query(Filter.everything()).subscribe(() => {
|
|
44
|
-
update.emit();
|
|
45
|
-
});
|
|
46
|
-
return {
|
|
47
|
-
unsubscribe: () => {
|
|
48
|
-
sub1.unsubscribe();
|
|
49
|
-
sub2();
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
// Monitor space updates.
|
|
54
|
-
let spaces = await this.getSpaces(client);
|
|
55
|
-
spaces.forEach((space) => {
|
|
56
|
-
subscriptions.set(space.key.toHex(), subscribeToSpaceUpdate(space));
|
|
57
|
-
});
|
|
58
|
-
// Monitor new spaces.
|
|
59
|
-
subscriptions.set('client', client.spaces.subscribe({
|
|
60
|
-
next: async () => {
|
|
61
|
-
spaces = await this.getSpaces(client);
|
|
62
|
-
// Monitor space updates for new spaces.
|
|
63
|
-
spaces
|
|
64
|
-
.filter((space) => !subscriptions.has(space.key.toHex()))
|
|
65
|
-
.forEach((space) => {
|
|
66
|
-
subscriptions.set(space.key.toHex(), subscribeToSpaceUpdate(space));
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
List.enableJsonFlag = true;
|
|
73
|
-
List.description = 'List spaces.';
|
|
74
|
-
List.flags = {
|
|
75
|
-
...BaseCommand.flags,
|
|
76
|
-
...TABLE_FLAGS,
|
|
77
|
-
live: Flags.boolean({
|
|
78
|
-
description: 'Live update.',
|
|
79
|
-
}),
|
|
80
|
-
// TODO(dmaretskyi): Inverted flags?
|
|
81
|
-
noWait: Flags.boolean({
|
|
82
|
-
description: 'Do not wait for spaces to be ready.',
|
|
83
|
-
}),
|
|
84
|
-
timeout: Flags.integer({
|
|
85
|
-
description: 'Timeout (ms).',
|
|
86
|
-
default: 1000,
|
|
87
|
-
aliases: ['t'],
|
|
88
|
-
}),
|
|
89
|
-
};
|
|
90
|
-
export default List;
|
|
91
|
-
//# sourceMappingURL=list.js.map
|