@dxos/client 2.28.1-dev.f858bec7 → 2.28.2-dev.5bd59700

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxos/client",
3
- "version": "2.28.1-dev.f858bec7",
4
- "license": "AGPL-3.0",
3
+ "version": "2.28.2-dev.5bd59700",
4
+ "license": "MIT",
5
5
  "author": "DXOS.org",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -10,21 +10,21 @@
10
10
  "src"
11
11
  ],
12
12
  "dependencies": {
13
- "@dxos/async": "2.28.1-dev.f858bec7",
14
- "@dxos/codec-protobuf": "2.28.1-dev.f858bec7",
15
- "@dxos/config": "2.28.1-dev.f858bec7",
16
- "@dxos/credentials": "2.28.1-dev.f858bec7",
17
- "@dxos/crypto": "2.28.1-dev.f858bec7",
18
- "@dxos/debug": "2.28.1-dev.f858bec7",
19
- "@dxos/echo-db": "2.28.1-dev.f858bec7",
20
- "@dxos/echo-protocol": "2.28.1-dev.f858bec7",
21
- "@dxos/feed-store": "2.28.1-dev.f858bec7",
22
- "@dxos/model-factory": "2.28.1-dev.f858bec7",
23
- "@dxos/network-manager": "2.28.1-dev.f858bec7",
24
- "@dxos/object-model": "2.28.1-dev.f858bec7",
25
- "@dxos/protocol": "2.28.1-dev.f858bec7",
26
- "@dxos/rpc": "2.28.1-dev.f858bec7",
27
- "@dxos/util": "2.28.1-dev.f858bec7",
13
+ "@dxos/async": "2.28.2-dev.5bd59700",
14
+ "@dxos/codec-protobuf": "2.28.2-dev.5bd59700",
15
+ "@dxos/config": "2.28.2-dev.5bd59700",
16
+ "@dxos/credentials": "2.28.2-dev.5bd59700",
17
+ "@dxos/crypto": "2.28.2-dev.5bd59700",
18
+ "@dxos/debug": "2.28.2-dev.5bd59700",
19
+ "@dxos/echo-db": "2.28.2-dev.5bd59700",
20
+ "@dxos/echo-protocol": "2.28.2-dev.5bd59700",
21
+ "@dxos/feed-store": "2.28.2-dev.5bd59700",
22
+ "@dxos/model-factory": "2.28.2-dev.5bd59700",
23
+ "@dxos/network-manager": "2.28.2-dev.5bd59700",
24
+ "@dxos/object-model": "2.28.2-dev.5bd59700",
25
+ "@dxos/protocols": "2.28.2-dev.5bd59700",
26
+ "@dxos/rpc": "2.28.2-dev.5bd59700",
27
+ "@dxos/util": "2.28.2-dev.5bd59700",
28
28
  "@polkadot/keyring": "6.11.1",
29
29
  "@polkadot/util": "6.11.1",
30
30
  "@polkadot/util-crypto": "6.11.1",
@@ -41,9 +41,9 @@
41
41
  "uuid": "^8.3.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@dxos/random-access-multi-storage": "2.28.1-dev.f858bec7",
45
- "@dxos/testutils": "2.28.0",
46
- "@dxos/toolchain-node-library": "2.28.0",
44
+ "@dxos/random-access-multi-storage": "2.28.2-dev.5bd59700",
45
+ "@dxos/testutils": "2.28.1",
46
+ "@dxos/toolchain-node-library": "2.28.1",
47
47
  "@types/debug": "^4.1.7",
48
48
  "@types/jest": "^26.0.7",
49
49
  "@types/level-js": "~4.0.1",
@@ -15,21 +15,26 @@ export interface CreateInvitationOptions extends InvitationOptions {
15
15
  onPinGenerated?: (pin: string) => void
16
16
  }
17
17
 
18
- export class HaloProxy extends InvitationProxy {
18
+ export class HaloProxy {
19
+ private readonly _invitationProxy = new InvitationProxy();
20
+ private readonly _subscriptions = new SubscriptionGroup();
21
+
19
22
  private _profile?: Profile;
20
23
  private _contacts: PartyMember[] = [];
21
24
 
22
- public readonly profileChanged = new Event();
23
25
  private readonly _contactsChanged = new Event();
26
+ public readonly profileChanged = new Event();
24
27
 
25
- private readonly _subscriptions = new SubscriptionGroup();
28
+ constructor (
29
+ private readonly _serviceProvider: ClientServiceProvider
30
+ ) {}
26
31
 
27
- constructor (private readonly _serviceProvider: ClientServiceProvider) {
28
- super();
32
+ toString () {
33
+ return `HaloProxy(${this._profile?.publicKey})`;
29
34
  }
30
35
 
31
- override toString () {
32
- return `HaloProxy(${this._profile?.publicKey})`;
36
+ get invitationProxy () {
37
+ return this._invitationProxy;
33
38
  }
34
39
 
35
40
  /**
@@ -87,7 +92,7 @@ export class HaloProxy extends InvitationProxy {
87
92
  */
88
93
  async createInvitation (): Promise<InvitationRequest> {
89
94
  const stream = await this._serviceProvider.services.ProfileService.createInvitation();
90
- return this.createInvitationRequest({ stream });
95
+ return this._invitationProxy.createInvitationRequest({ stream });
91
96
  }
92
97
 
93
98
  /**
@@ -32,7 +32,7 @@ export class InvitationProxy {
32
32
  readonly activeInvitations: InvitationRequest[] = [];
33
33
  readonly invitationsUpdate = new Event();
34
34
 
35
- protected async createInvitationRequest ({ stream }: CreateInvitationRequestOpts): Promise<InvitationRequest> {
35
+ async createInvitationRequest ({ stream }: CreateInvitationRequestOpts): Promise<InvitationRequest> {
36
36
  return new Promise((resolve, reject) => {
37
37
  const connected = new Event();
38
38
  const finished = new Event();
@@ -5,7 +5,7 @@
5
5
  import { PublicKey } from '@dxos/crypto';
6
6
  import { failUndefined } from '@dxos/debug';
7
7
  import {
8
- ActivationOptions, Database, PARTY_ITEM_TYPE, PARTY_TITLE_PROPERTY, RemoteDatabaseBackend, RootSelector
8
+ PARTY_ITEM_TYPE, PARTY_TITLE_PROPERTY, ActivationOptions, Database, RemoteDatabaseBackend, RootSelector
9
9
  } from '@dxos/echo-db';
10
10
  import { PartyKey } from '@dxos/echo-protocol';
11
11
  import { ModelFactory } from '@dxos/model-factory';
@@ -21,8 +21,9 @@ export interface CreationInvitationOptions {
21
21
  inviteeKey?: PublicKey
22
22
  }
23
23
 
24
- export class Party extends InvitationProxy {
24
+ export class Party {
25
25
  private readonly _database?: Database;
26
+ private readonly _invitationProxy = new InvitationProxy();
26
27
 
27
28
  private _key: PartyKey;
28
29
  private _isOpen: boolean;
@@ -37,7 +38,6 @@ export class Party extends InvitationProxy {
37
38
  party: PartyProto,
38
39
  memberKey: PublicKey
39
40
  ) {
40
- super();
41
41
  this._key = party.publicKey;
42
42
  this._isOpen = party.isOpen;
43
43
  this._isActive = party.isActive;
@@ -60,6 +60,10 @@ export class Party extends InvitationProxy {
60
60
  }
61
61
  }
62
62
 
63
+ get invitationProxy () {
64
+ return this._invitationProxy;
65
+ }
66
+
63
67
  async init () {
64
68
  if (this._database && this._serviceProvider instanceof ClientServiceProxy) {
65
69
  await this._database.init();
@@ -146,7 +150,7 @@ export class Party extends InvitationProxy {
146
150
  */
147
151
  async createInvitation ({ inviteeKey }: CreationInvitationOptions = {}): Promise<InvitationRequest> {
148
152
  const stream = this._serviceProvider.services.PartyService.createInvitation({ partyKey: this.key, inviteeKey });
149
- return this.createInvitationRequest({ stream });
153
+ return this._invitationProxy.createInvitationRequest({ stream });
150
154
  }
151
155
 
152
156
  queryMembers () {
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { Config } from '@dxos/config';
6
- import * as debug from '@dxos/debug'; // TODO(burdon): ???
6
+ import * as debug from '@dxos/debug'; // TODO(burdon): Why import *?
7
7
  import { ECHO, OpenProgress } from '@dxos/echo-db';
8
8
 
9
9
  import { createDevtoolsHost, DevtoolsHostEvents, DevtoolsServiceDependencies } from '../../devtools';
@@ -21,7 +21,6 @@ import {
21
21
  SetPreferenceRequest,
22
22
  GetPreferenceRequest,
23
23
  GetPreferenceResponse
24
-
25
24
  } from '../../../proto/gen/dxos/client';
26
25
  import { resultSetToStream } from '../../../util';
27
26
  import { CreateServicesOpts } from './interfaces';
@@ -1,6 +1,6 @@
1
1
  syntax = "proto3";
2
2
 
3
- import "@dxos/protocol/src/proto/dxos/client.proto";
4
- import "@dxos/protocol/src/proto/dxos/devtools.proto";
5
- import "@dxos/protocol/src/proto/dxos/config.proto";
6
- import "@dxos/protocol/src/proto/dxos/echo/service.proto";
3
+ import "@dxos/protocols/src/proto/dxos/client.proto";
4
+ import "@dxos/protocols/src/proto/dxos/devtools.proto";
5
+ import "@dxos/protocols/src/proto/dxos/config.proto";
6
+ import "@dxos/protocols/src/proto/dxos/echo/service.proto";