@dxos/client-services 0.5.1-main.295efe4 → 0.5.1-main.2daa51f

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.
Files changed (35) hide show
  1. package/dist/lib/browser/{chunk-PSHHL2B3.mjs → chunk-W4AH2PLH.mjs} +144 -123
  2. package/dist/lib/browser/chunk-W4AH2PLH.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +31 -2
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/packlets/testing/index.mjs +1 -1
  7. package/dist/lib/node/{chunk-U3IMWNHD.cjs → chunk-ZZBYATE2.cjs} +166 -145
  8. package/dist/lib/node/chunk-ZZBYATE2.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +73 -44
  10. package/dist/lib/node/index.cjs.map +3 -3
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/packlets/testing/index.cjs +8 -8
  13. package/dist/types/src/packlets/diagnostics/diagnostics-collector.d.ts.map +1 -1
  14. package/dist/types/src/packlets/diagnostics/diagnostics.d.ts.map +1 -1
  15. package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -1
  16. package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
  17. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  18. package/dist/types/src/packlets/spaces/spaces-service.d.ts +2 -1
  19. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  20. package/dist/types/src/packlets/vault/shell-runtime.d.ts +10 -2
  21. package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
  22. package/dist/types/src/version.d.ts +1 -1
  23. package/package.json +36 -36
  24. package/src/packlets/diagnostics/diagnostics-collector.ts +14 -9
  25. package/src/packlets/diagnostics/diagnostics.ts +78 -68
  26. package/src/packlets/invitations/invitations-manager.ts +3 -0
  27. package/src/packlets/invitations/space-invitation-protocol.ts +4 -2
  28. package/src/packlets/services/service-host.ts +2 -2
  29. package/src/packlets/spaces/data-space.ts +2 -1
  30. package/src/packlets/spaces/genesis.ts +1 -1
  31. package/src/packlets/spaces/spaces-service.ts +12 -6
  32. package/src/packlets/vault/shell-runtime.ts +40 -2
  33. package/src/version.ts +1 -1
  34. package/dist/lib/browser/chunk-PSHHL2B3.mjs.map +0 -7
  35. package/dist/lib/node/chunk-U3IMWNHD.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 { type AppContextRequest, type LayoutRequest, ShellLayout } from '@dxos/protocols/proto/dxos/iframe';
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.295efe4";
1
+ export const DXOS_VERSION = "0.5.1-main.2daa51f";