@dxos/cli 0.6.13 → 0.6.14-staging.9e90729
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/bin/dev.js +26 -0
- package/bin/dx.js +12 -0
- package/dist/src/base.js +11 -16
- package/dist/src/base.js.map +1 -1
- package/dist/src/commands/agent/agent.node.test.d.ts +2 -0
- package/dist/src/commands/agent/agent.node.test.d.ts.map +1 -0
- package/dist/src/commands/agent/agent.node.test.js +178 -0
- package/dist/src/commands/agent/agent.node.test.js.map +1 -0
- package/dist/src/commands/agent/invitations.d.ts +11 -11
- package/dist/src/commands/agent/invitations.js +19 -24
- package/dist/src/commands/agent/invitations.js.map +1 -1
- package/dist/src/commands/agent/list.d.ts +12 -12
- package/dist/src/commands/agent/list.js +11 -13
- package/dist/src/commands/agent/list.js.map +1 -1
- package/dist/src/commands/agent/restart.d.ts +12 -12
- package/dist/src/commands/agent/restart.js +7 -9
- package/dist/src/commands/agent/restart.js.map +1 -1
- package/dist/src/commands/agent/start.d.ts +15 -15
- package/dist/src/commands/agent/start.js +38 -43
- package/dist/src/commands/agent/start.js.map +1 -1
- package/dist/src/commands/agent/status.d.ts +10 -10
- package/dist/src/commands/agent/status.js +7 -9
- package/dist/src/commands/agent/status.js.map +1 -1
- package/dist/src/commands/agent/stop.d.ts +13 -13
- package/dist/src/commands/agent/stop.js +10 -15
- package/dist/src/commands/agent/stop.js.map +1 -1
- package/dist/src/commands/app/app.node.test.d.ts +2 -0
- package/dist/src/commands/app/app.node.test.d.ts.map +1 -0
- package/dist/src/commands/app/app.node.test.js +22 -0
- package/dist/src/commands/app/app.node.test.js.map +1 -0
- package/dist/src/commands/app/create.d.ts +14 -14
- package/dist/src/commands/app/create.js +23 -52
- package/dist/src/commands/app/create.js.map +1 -1
- package/dist/src/commands/app/list.d.ts +10 -10
- package/dist/src/commands/app/list.js +10 -12
- package/dist/src/commands/app/list.js.map +1 -1
- package/dist/src/commands/app/open.d.ts +13 -13
- package/dist/src/commands/app/open.js +23 -28
- package/dist/src/commands/app/open.js.map +1 -1
- package/dist/src/commands/app/publish.d.ts +14 -14
- package/dist/src/commands/app/publish.js +19 -24
- package/dist/src/commands/app/publish.js.map +1 -1
- package/dist/src/commands/config/index.js +3 -5
- package/dist/src/commands/config/index.js.map +1 -1
- package/dist/src/commands/config/index.node.test.d.ts +2 -0
- package/dist/src/commands/config/index.node.test.d.ts.map +1 -0
- package/dist/src/commands/config/index.node.test.js +25 -0
- package/dist/src/commands/config/index.node.test.js.map +1 -0
- package/dist/src/commands/debug/diagnostics.d.ts +12 -12
- package/dist/src/commands/debug/diagnostics.js +15 -20
- package/dist/src/commands/debug/diagnostics.js.map +1 -1
- package/dist/src/commands/debug/error.js +5 -7
- package/dist/src/commands/debug/error.js.map +1 -1
- package/dist/src/commands/debug/generate.d.ts +16 -16
- package/dist/src/commands/debug/generate.js +20 -22
- package/dist/src/commands/debug/generate.js.map +1 -1
- package/dist/src/commands/debug/metrics.d.ts +1 -1
- package/dist/src/commands/debug/metrics.js +5 -7
- package/dist/src/commands/debug/metrics.js.map +1 -1
- package/dist/src/commands/debug/status.d.ts +11 -11
- package/dist/src/commands/debug/status.js +10 -15
- package/dist/src/commands/debug/status.js.map +1 -1
- package/dist/src/commands/device/info.js +11 -16
- package/dist/src/commands/device/info.js.map +1 -1
- package/dist/src/commands/device/list.d.ts +10 -10
- package/dist/src/commands/device/list.js +9 -11
- package/dist/src/commands/device/list.js.map +1 -1
- package/dist/src/commands/device/update.d.ts +11 -11
- package/dist/src/commands/device/update.js +11 -13
- package/dist/src/commands/device/update.js.map +1 -1
- package/dist/src/commands/function/list.js +15 -19
- package/dist/src/commands/function/list.js.map +1 -1
- package/dist/src/commands/function/logs.d.ts +1 -1
- package/dist/src/commands/function/logs.js +5 -7
- package/dist/src/commands/function/logs.js.map +1 -1
- package/dist/src/commands/function/trigger/list.d.ts +14 -14
- package/dist/src/commands/function/trigger/list.js +21 -28
- package/dist/src/commands/function/trigger/list.js.map +1 -1
- package/dist/src/commands/halo/create.d.ts +13 -13
- package/dist/src/commands/halo/create.js +10 -12
- package/dist/src/commands/halo/create.js.map +1 -1
- package/dist/src/commands/halo/credential/add.d.ts +1 -1
- package/dist/src/commands/halo/credential/add.js +9 -11
- package/dist/src/commands/halo/credential/add.js.map +1 -1
- package/dist/src/commands/halo/credential/list.d.ts +12 -12
- package/dist/src/commands/halo/credential/list.js +15 -17
- package/dist/src/commands/halo/credential/list.js.map +1 -1
- package/dist/src/commands/halo/identity.js +6 -11
- package/dist/src/commands/halo/identity.js.map +1 -1
- package/dist/src/commands/halo/join.d.ts +14 -14
- package/dist/src/commands/halo/join.d.ts.map +1 -1
- package/dist/src/commands/halo/join.js +34 -37
- package/dist/src/commands/halo/join.js.map +1 -1
- package/dist/src/commands/halo/keys.js +3 -5
- package/dist/src/commands/halo/keys.js.map +1 -1
- package/dist/src/commands/halo/recovery/generate.d.ts +7 -0
- package/dist/src/commands/halo/recovery/generate.d.ts.map +1 -0
- package/dist/src/commands/halo/recovery/generate.js +17 -0
- package/dist/src/commands/halo/recovery/generate.js.map +1 -0
- package/dist/src/commands/halo/recovery/use.d.ts +20 -0
- package/dist/src/commands/halo/recovery/use.d.ts.map +1 -0
- package/dist/src/commands/halo/recovery/use.js +22 -0
- package/dist/src/commands/halo/recovery/use.js.map +1 -0
- package/dist/src/commands/halo/share.d.ts +15 -15
- package/dist/src/commands/halo/share.js +27 -32
- package/dist/src/commands/halo/share.js.map +1 -1
- package/dist/src/commands/halo/update.d.ts +11 -11
- package/dist/src/commands/halo/update.js +11 -16
- package/dist/src/commands/halo/update.js.map +1 -1
- package/dist/src/commands/info.d.ts +10 -10
- package/dist/src/commands/info.d.ts.map +1 -1
- package/dist/src/commands/info.js +8 -13
- package/dist/src/commands/info.js.map +1 -1
- package/dist/src/commands/profile/import.d.ts +12 -12
- package/dist/src/commands/profile/import.js +20 -48
- package/dist/src/commands/profile/import.js.map +1 -1
- package/dist/src/commands/profile/inspect.d.ts +12 -12
- package/dist/src/commands/profile/inspect.js +14 -39
- package/dist/src/commands/profile/inspect.js.map +1 -1
- package/dist/src/commands/reset/index.d.ts +12 -12
- package/dist/src/commands/reset/index.js +22 -27
- package/dist/src/commands/reset/index.js.map +1 -1
- package/dist/src/commands/shell/index.d.ts.map +1 -1
- package/dist/src/commands/shell/index.js +11 -12
- package/dist/src/commands/shell/index.js.map +1 -1
- package/dist/src/commands/space/close.d.ts +1 -1
- package/dist/src/commands/space/close.js +5 -7
- package/dist/src/commands/space/close.js.map +1 -1
- package/dist/src/commands/space/create.d.ts +1 -1
- package/dist/src/commands/space/create.js +9 -14
- package/dist/src/commands/space/create.js.map +1 -1
- package/dist/src/commands/space/epoch.d.ts +1 -1
- package/dist/src/commands/space/epoch.js +5 -7
- package/dist/src/commands/space/epoch.js.map +1 -1
- package/dist/src/commands/space/info.d.ts +1 -1
- package/dist/src/commands/space/info.js +5 -7
- package/dist/src/commands/space/info.js.map +1 -1
- package/dist/src/commands/space/join.d.ts +12 -12
- package/dist/src/commands/space/join.d.ts.map +1 -1
- package/dist/src/commands/space/join.js +22 -25
- package/dist/src/commands/space/join.js.map +1 -1
- package/dist/src/commands/space/list.d.ts +11 -11
- package/dist/src/commands/space/list.js +16 -18
- package/dist/src/commands/space/list.js.map +1 -1
- package/dist/src/commands/space/members.d.ts +11 -11
- package/dist/src/commands/space/members.js +9 -11
- package/dist/src/commands/space/members.js.map +1 -1
- package/dist/src/commands/space/open.d.ts +1 -1
- package/dist/src/commands/space/open.js +5 -7
- package/dist/src/commands/space/open.js.map +1 -1
- package/dist/src/commands/space/query.d.ts +12 -12
- package/dist/src/commands/space/query.js +15 -17
- package/dist/src/commands/space/query.js.map +1 -1
- package/dist/src/commands/space/schema/list.d.ts +12 -12
- package/dist/src/commands/space/schema/list.js +11 -13
- package/dist/src/commands/space/schema/list.js.map +1 -1
- package/dist/src/commands/space/share.d.ts +17 -17
- package/dist/src/commands/space/share.js +30 -35
- package/dist/src/commands/space/share.js.map +1 -1
- package/dist/src/commands/tunnel/index.d.ts +11 -11
- package/dist/src/commands/tunnel/index.js +16 -18
- package/dist/src/commands/tunnel/index.js.map +1 -1
- package/dist/src/commands/tunnel/list.d.ts +10 -10
- package/dist/src/commands/tunnel/list.js +8 -10
- package/dist/src/commands/tunnel/list.js.map +1 -1
- package/dist/src/commands/userfunction/upload.d.ts +15 -15
- package/dist/src/commands/userfunction/upload.js +29 -34
- package/dist/src/commands/userfunction/upload.js.map +1 -1
- package/dist/src/components/App.js +11 -18
- package/dist/src/components/App.js.map +1 -1
- package/dist/src/components/SpaceTable.js +8 -38
- package/dist/src/components/SpaceTable.js.map +1 -1
- package/dist/src/components/SystemTable.js +6 -36
- package/dist/src/components/SystemTable.js.map +1 -1
- package/dist/src/components/index.js +3 -19
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/help.js +8 -15
- package/dist/src/help.js.map +1 -1
- package/dist/src/hooks/command-not-found.js +4 -9
- package/dist/src/hooks/command-not-found.js.map +1 -1
- package/dist/src/index.js +2 -19
- package/dist/src/index.js.map +1 -1
- package/dist/src/util/index.js +4 -20
- package/dist/src/util/index.js.map +1 -1
- package/dist/src/util/provider/digital-ocean.js +11 -18
- package/dist/src/util/provider/digital-ocean.js.map +1 -1
- package/dist/src/util/provider/index.js +2 -18
- package/dist/src/util/provider/index.js.map +1 -1
- package/dist/src/util/provider/provider.js +7 -12
- package/dist/src/util/provider/provider.js.map +1 -1
- package/dist/src/util/publish/build.js +7 -14
- package/dist/src/util/publish/build.js.map +1 -1
- package/dist/src/util/publish/common.js +6 -34
- package/dist/src/util/publish/common.js.map +1 -1
- package/dist/src/util/publish/config.js +14 -21
- package/dist/src/util/publish/config.js.map +1 -1
- package/dist/src/util/publish/index.js +6 -22
- package/dist/src/util/publish/index.js.map +1 -1
- package/dist/src/util/publish/ipfs-upload.js +11 -18
- package/dist/src/util/publish/ipfs-upload.js.map +1 -1
- package/dist/src/util/publish/publish.js +20 -27
- package/dist/src/util/publish/publish.js.map +1 -1
- package/dist/src/util/publish/publisher-rpc-peer.js +16 -23
- package/dist/src/util/publish/publisher-rpc-peer.js.map +1 -1
- package/dist/src/util/supervisor/index.js +1 -17
- package/dist/src/util/supervisor/index.js.map +1 -1
- package/dist/src/util/supervisor/supervisor-rpc-peer.js +16 -23
- package/dist/src/util/supervisor/supervisor-rpc-peer.js.map +1 -1
- package/dist/src/util/tunnel/common.js +5 -10
- package/dist/src/util/tunnel/common.js.map +1 -1
- package/dist/src/util/tunnel/index.js +2 -18
- package/dist/src/util/tunnel/index.js.map +1 -1
- package/dist/src/util/tunnel/tunnel-rpc-peer.js +16 -23
- package/dist/src/util/tunnel/tunnel-rpc-peer.js.map +1 -1
- package/oclif.manifest.json +273 -51
- package/package.json +43 -43
- package/bin/dev +0 -22
- package/bin/dx +0 -8
- package/dist/src/commands/agent/agent.test.d.ts +0 -2
- package/dist/src/commands/agent/agent.test.d.ts.map +0 -1
- package/dist/src/commands/agent/agent.test.js +0 -186
- package/dist/src/commands/agent/agent.test.js.map +0 -1
- package/dist/src/commands/app/app.test.d.ts +0 -2
- package/dist/src/commands/app/app.test.d.ts.map +0 -1
- package/dist/src/commands/app/app.test.js +0 -33
- package/dist/src/commands/app/app.test.js.map +0 -1
- package/dist/src/commands/config/index.test.d.ts +0 -2
- package/dist/src/commands/config/index.test.d.ts.map +0 -1
- package/dist/src/commands/config/index.test.js +0 -53
- package/dist/src/commands/config/index.test.js.map +0 -1
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SupervisorRpcPeer = void 0;
|
|
10
4
|
// TODO(egorgripasov): Factor out.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class SupervisorRpcPeer {
|
|
5
|
+
import WebSocket from 'isomorphic-ws';
|
|
6
|
+
import { Trigger, Event } from '@dxos/async';
|
|
7
|
+
import { log } from '@dxos/log';
|
|
8
|
+
import { schema } from '@dxos/protocols/proto';
|
|
9
|
+
import { createProtoRpcPeer } from '@dxos/rpc';
|
|
10
|
+
export class SupervisorRpcPeer {
|
|
17
11
|
constructor(_url) {
|
|
18
12
|
this._url = _url;
|
|
19
|
-
this._connectTrigger = new
|
|
20
|
-
this.connected = new
|
|
21
|
-
this.disconnected = new
|
|
22
|
-
this.error = new
|
|
23
|
-
this._socket = new
|
|
13
|
+
this._connectTrigger = new Trigger();
|
|
14
|
+
this.connected = new Event();
|
|
15
|
+
this.disconnected = new Event();
|
|
16
|
+
this.error = new Event();
|
|
17
|
+
this._socket = new WebSocket(this._url);
|
|
24
18
|
this._socket.onopen = async () => {
|
|
25
19
|
try {
|
|
26
20
|
await this._rpc.open();
|
|
27
|
-
|
|
21
|
+
log(`RPC open ${this._url}`);
|
|
28
22
|
this.connected.emit();
|
|
29
23
|
this._connectTrigger.wake();
|
|
30
24
|
}
|
|
@@ -33,7 +27,7 @@ class SupervisorRpcPeer {
|
|
|
33
27
|
}
|
|
34
28
|
};
|
|
35
29
|
this._socket.onclose = async () => {
|
|
36
|
-
|
|
30
|
+
log(`Disconnected ${this._url}`);
|
|
37
31
|
this.disconnected.emit();
|
|
38
32
|
try {
|
|
39
33
|
await this._rpc.close();
|
|
@@ -44,12 +38,12 @@ class SupervisorRpcPeer {
|
|
|
44
38
|
};
|
|
45
39
|
this._socket.onerror = (event) => {
|
|
46
40
|
var _a;
|
|
47
|
-
|
|
41
|
+
log(`Publisher socket error ${this._url} ${event.message}`);
|
|
48
42
|
this.error.emit((_a = event.error) !== null && _a !== void 0 ? _a : new Error(event.message));
|
|
49
43
|
};
|
|
50
|
-
this._rpc =
|
|
44
|
+
this._rpc = createProtoRpcPeer({
|
|
51
45
|
requested: {
|
|
52
|
-
Supervisor:
|
|
46
|
+
Supervisor: schema.getService('dxos.service.supervisor.Supervisor'),
|
|
53
47
|
},
|
|
54
48
|
exposed: {},
|
|
55
49
|
handlers: {},
|
|
@@ -84,5 +78,4 @@ class SupervisorRpcPeer {
|
|
|
84
78
|
}
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
|
-
exports.SupervisorRpcPeer = SupervisorRpcPeer;
|
|
88
81
|
//# sourceMappingURL=supervisor-rpc-peer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor-rpc-peer.js","sourceRoot":"","sources":["../../../../src/util/supervisor/supervisor-rpc-peer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"supervisor-rpc-peer.js","sourceRoot":"","sources":["../../../../src/util/supervisor/supervisor-rpc-peer.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,kCAAkC;AAClC,OAAO,SAAS,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAqB,MAAM,WAAW,CAAC;AAElE,MAAM,OAAO,iBAAiB;IAS5B,YAA6B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QANxB,oBAAe,GAAG,IAAI,OAAO,EAAE,CAAC;QAExC,cAAS,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,iBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;QAC3B,UAAK,GAAG,IAAI,KAAK,EAAS,CAAC;QAGlC,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,C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E;YACX,QAAQ,EAAE,EAAE;YACZ,WAAW,EAAE,IAAI;YACjB,OAAO,EAAE,OAAS;YAClB,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;oBACZ,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACzB,CAAC;gBACD,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE;oBAChB,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,GAA2B,EAAE,EAAE;wBAC7D,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;4BAC5D,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;wBAChD,CAAC;6BAAM,CAAC;4BACN,EAAE,CAAC,GAAG,CAAC,IAAW,CAAC,CAAC;wBACtB,CAAC;oBACH,CAAC,CAAC;gBACJ,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const cli_base_1 = require("@dxos/cli-base");
|
|
9
|
-
const mapTunnels = (tunnels) => {
|
|
4
|
+
import { ux } from '@oclif/core';
|
|
5
|
+
import { table } from '@dxos/cli-base';
|
|
6
|
+
export const mapTunnels = (tunnels) => {
|
|
10
7
|
return tunnels.map((tunnel) => ({
|
|
11
8
|
key: tunnel.name,
|
|
12
9
|
enabled: tunnel.enabled,
|
|
13
10
|
url: tunnel.url,
|
|
14
11
|
}));
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
core_1.ux.stdout((0, cli_base_1.table)((0, exports.mapTunnels)(tunnels), {
|
|
13
|
+
export const printTunnels = (tunnels, flags = {}) => {
|
|
14
|
+
ux.stdout(table(mapTunnels(tunnels), {
|
|
19
15
|
key: {
|
|
20
16
|
header: 'app',
|
|
21
17
|
},
|
|
@@ -27,5 +23,4 @@ const printTunnels = (tunnels, flags = {}) => {
|
|
|
27
23
|
},
|
|
28
24
|
}, flags));
|
|
29
25
|
};
|
|
30
|
-
exports.printTunnels = printTunnels;
|
|
31
26
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/util/tunnel/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/util/tunnel/common.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAmB,MAAM,gBAAgB,CAAC;AAGxD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAyB,EAAE,EAAE;IACtD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9B,GAAG,EAAE,MAAM,CAAC,IAAI;QAChB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,GAAG,EAAE,MAAM,CAAC,GAAG;KAChB,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAyB,EAAE,QAAoB,EAAE,EAAE,EAAE;IAChF,EAAE,CAAC,MAAM,CACP,KAAK,CACH,UAAU,CAAC,OAAO,CAAC,EACnB;QACE,GAAG,EAAE;YACH,MAAM,EAAE,KAAK;SACd;QACD,OAAO,EAAE;YACP,MAAM,EAAE,SAAS;SAClB;QACD,GAAG,EAAE;YACH,MAAM,EAAE,KAAK;SACd;KACF,EACD,KAAK,CACN,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./common"), exports);
|
|
21
|
-
__exportStar(require("./tunnel-rpc-peer"), exports);
|
|
4
|
+
export * from './common';
|
|
5
|
+
export * from './tunnel-rpc-peer';
|
|
22
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/util/tunnel/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/util/tunnel/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 DXOS.org
|
|
4
3
|
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TunnelRpcPeer = void 0;
|
|
10
4
|
// TODO(egorgripasov): Factor out.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class TunnelRpcPeer {
|
|
5
|
+
import WebSocket from 'isomorphic-ws';
|
|
6
|
+
import { Trigger, Event } from '@dxos/async';
|
|
7
|
+
import { log } from '@dxos/log';
|
|
8
|
+
import { schema } from '@dxos/protocols/proto';
|
|
9
|
+
import { createProtoRpcPeer } from '@dxos/rpc';
|
|
10
|
+
export class TunnelRpcPeer {
|
|
17
11
|
constructor(_url) {
|
|
18
12
|
this._url = _url;
|
|
19
|
-
this._connectTrigger = new
|
|
20
|
-
this.connected = new
|
|
21
|
-
this.disconnected = new
|
|
22
|
-
this.error = new
|
|
23
|
-
this._socket = new
|
|
13
|
+
this._connectTrigger = new Trigger();
|
|
14
|
+
this.connected = new Event();
|
|
15
|
+
this.disconnected = new Event();
|
|
16
|
+
this.error = new Event();
|
|
17
|
+
this._socket = new WebSocket(this._url);
|
|
24
18
|
this._socket.onopen = async () => {
|
|
25
19
|
try {
|
|
26
20
|
await this._rpc.open();
|
|
27
|
-
|
|
21
|
+
log(`RPC open ${this._url}`);
|
|
28
22
|
this.connected.emit();
|
|
29
23
|
this._connectTrigger.wake();
|
|
30
24
|
}
|
|
@@ -33,7 +27,7 @@ class TunnelRpcPeer {
|
|
|
33
27
|
}
|
|
34
28
|
};
|
|
35
29
|
this._socket.onclose = async () => {
|
|
36
|
-
|
|
30
|
+
log(`Disconnected ${this._url}`);
|
|
37
31
|
this.disconnected.emit();
|
|
38
32
|
try {
|
|
39
33
|
await this._rpc.close();
|
|
@@ -44,12 +38,12 @@ class TunnelRpcPeer {
|
|
|
44
38
|
};
|
|
45
39
|
this._socket.onerror = (event) => {
|
|
46
40
|
var _a;
|
|
47
|
-
|
|
41
|
+
log(`Publisher socket error ${this._url} ${event.message}`);
|
|
48
42
|
this.error.emit((_a = event.error) !== null && _a !== void 0 ? _a : new Error(event.message));
|
|
49
43
|
};
|
|
50
|
-
this._rpc =
|
|
44
|
+
this._rpc = createProtoRpcPeer({
|
|
51
45
|
requested: {
|
|
52
|
-
Tunnel:
|
|
46
|
+
Tunnel: schema.getService('dxos.service.tunnel.Tunnel'),
|
|
53
47
|
},
|
|
54
48
|
exposed: {},
|
|
55
49
|
handlers: {},
|
|
@@ -84,5 +78,4 @@ class TunnelRpcPeer {
|
|
|
84
78
|
}
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
|
-
exports.TunnelRpcPeer = TunnelRpcPeer;
|
|
88
81
|
//# sourceMappingURL=tunnel-rpc-peer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel-rpc-peer.js","sourceRoot":"","sources":["../../../../src/util/tunnel/tunnel-rpc-peer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tunnel-rpc-peer.js","sourceRoot":"","sources":["../../../../src/util/tunnel/tunnel-rpc-peer.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,kCAAkC;AAClC,OAAO,SAAS,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,O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