@dxos/client-services 0.5.1-main.accecb9 → 0.5.1-main.af17cdd
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/dist/lib/browser/{chunk-RTQUETYN.mjs → chunk-PSH5AK5I.mjs} +144 -123
- package/dist/lib/browser/chunk-PSH5AK5I.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +31 -2
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-FYA6YJPS.cjs → chunk-M4E2ORMR.cjs} +166 -145
- package/dist/lib/node/chunk-M4E2ORMR.cjs.map +7 -0
- package/dist/lib/node/index.cjs +73 -44
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/diagnostics/diagnostics-collector.d.ts.map +1 -1
- package/dist/types/src/packlets/diagnostics/diagnostics.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +2 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts +10 -2
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +36 -36
- package/src/packlets/diagnostics/diagnostics-collector.ts +14 -9
- package/src/packlets/diagnostics/diagnostics.ts +78 -68
- package/src/packlets/invitations/invitations-manager.ts +3 -0
- package/src/packlets/invitations/space-invitation-protocol.ts +4 -2
- package/src/packlets/services/service-host.ts +2 -2
- package/src/packlets/spaces/data-space.ts +2 -1
- package/src/packlets/spaces/genesis.ts +1 -1
- package/src/packlets/spaces/spaces-service.ts +12 -6
- package/src/packlets/vault/shell-runtime.ts +40 -2
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-RTQUETYN.mjs.map +0 -7
- package/dist/lib/node/chunk-FYA6YJPS.cjs.map +0 -7
|
@@ -6,7 +6,12 @@ import { Event } from '@dxos/async';
|
|
|
6
6
|
import { appServiceBundle, type AppServiceBundle, type ShellRuntime, shellServiceBundle } from '@dxos/client-protocol';
|
|
7
7
|
import { invariant } from '@dxos/invariant';
|
|
8
8
|
import { type PublicKey } from '@dxos/keys';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
type AppContextRequest,
|
|
11
|
+
type LayoutRequest,
|
|
12
|
+
ShellLayout,
|
|
13
|
+
type InvitationUrlRequest,
|
|
14
|
+
} from '@dxos/protocols/proto/dxos/iframe';
|
|
10
15
|
import { createProtoRpcPeer, type ProtoRpcPeer, type RpcPort } from '@dxos/rpc';
|
|
11
16
|
|
|
12
17
|
/**
|
|
@@ -14,11 +19,19 @@ import { createProtoRpcPeer, type ProtoRpcPeer, type RpcPort } from '@dxos/rpc';
|
|
|
14
19
|
*/
|
|
15
20
|
export class ShellRuntimeImpl implements ShellRuntime {
|
|
16
21
|
readonly layoutUpdate = new Event<LayoutRequest>();
|
|
22
|
+
readonly invitationUrlUpdate = new Event<InvitationUrlRequest>();
|
|
23
|
+
|
|
17
24
|
private _appRpc?: ProtoRpcPeer<AppServiceBundle>;
|
|
18
25
|
private _layout = ShellLayout.DEFAULT;
|
|
19
|
-
private _invitationCode?: string;
|
|
20
26
|
private _spaceKey?: PublicKey;
|
|
21
27
|
|
|
28
|
+
private _invitationCode?: string;
|
|
29
|
+
private _invitationUrl? = typeof window !== 'undefined' ? window.location.origin : undefined;
|
|
30
|
+
|
|
31
|
+
// TODO(burdon): Change to using underscores (coordinate with @dxos/web-auth).
|
|
32
|
+
private _deviceInvitationParam = 'deviceInvitationCode'; // TODO(burdon): device_invitation_code
|
|
33
|
+
private _spaceInvitationParam = 'spaceInvitationCode'; // TODO(burdon): space_invitation_code
|
|
34
|
+
|
|
22
35
|
constructor(private readonly _port: RpcPort) {}
|
|
23
36
|
|
|
24
37
|
get layout() {
|
|
@@ -33,6 +46,18 @@ export class ShellRuntimeImpl implements ShellRuntime {
|
|
|
33
46
|
return this._spaceKey;
|
|
34
47
|
}
|
|
35
48
|
|
|
49
|
+
get invitationUrl() {
|
|
50
|
+
return this._invitationUrl!;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get deviceInvitationParam() {
|
|
54
|
+
return this._deviceInvitationParam;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get spaceInvitationParam() {
|
|
58
|
+
return this._spaceInvitationParam;
|
|
59
|
+
}
|
|
60
|
+
|
|
36
61
|
setLayout({ layout, invitationCode, spaceKey }: LayoutRequest) {
|
|
37
62
|
this._layout = layout;
|
|
38
63
|
this._invitationCode = invitationCode;
|
|
@@ -40,6 +65,13 @@ export class ShellRuntimeImpl implements ShellRuntime {
|
|
|
40
65
|
this.layoutUpdate.emit({ layout, invitationCode, spaceKey });
|
|
41
66
|
}
|
|
42
67
|
|
|
68
|
+
setInvitationUrl({ invitationUrl, deviceInvitationParam, spaceInvitationParam }: InvitationUrlRequest) {
|
|
69
|
+
this._invitationUrl = invitationUrl;
|
|
70
|
+
this._deviceInvitationParam = deviceInvitationParam;
|
|
71
|
+
this._spaceInvitationParam = spaceInvitationParam;
|
|
72
|
+
this.invitationUrlUpdate.emit({ invitationUrl, deviceInvitationParam, spaceInvitationParam });
|
|
73
|
+
}
|
|
74
|
+
|
|
43
75
|
async setAppContext(context: AppContextRequest) {
|
|
44
76
|
invariant(this._appRpc, 'runtime not open');
|
|
45
77
|
|
|
@@ -58,6 +90,12 @@ export class ShellRuntimeImpl implements ShellRuntime {
|
|
|
58
90
|
this._spaceKey = request.spaceKey;
|
|
59
91
|
this.layoutUpdate.emit(request);
|
|
60
92
|
},
|
|
93
|
+
setInvitationUrl: async (request) => {
|
|
94
|
+
this._invitationUrl = request.invitationUrl;
|
|
95
|
+
this._deviceInvitationParam = request.deviceInvitationParam;
|
|
96
|
+
this._spaceInvitationParam = request.spaceInvitationParam;
|
|
97
|
+
this.invitationUrlUpdate.emit(request);
|
|
98
|
+
},
|
|
61
99
|
},
|
|
62
100
|
},
|
|
63
101
|
port: this._port,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.5.1-main.
|
|
1
|
+
export const DXOS_VERSION = "0.5.1-main.af17cdd";
|