@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/dist/src/api/halo-proxy.d.ts +5 -3
- package/dist/src/api/halo-proxy.d.ts.map +1 -1
- package/dist/src/api/halo-proxy.js +8 -5
- package/dist/src/api/halo-proxy.js.map +1 -1
- package/dist/src/api/invitations/invitation-proxy.d.ts +1 -1
- package/dist/src/api/invitations/invitation-proxy.d.ts.map +1 -1
- package/dist/src/api/invitations/invitation-proxy.js.map +1 -1
- package/dist/src/api/party-proxy.d.ts +3 -1
- package/dist/src/api/party-proxy.d.ts.map +1 -1
- package/dist/src/api/party-proxy.js +6 -3
- package/dist/src/api/party-proxy.js.map +1 -1
- package/dist/src/client/service-host/service-host.js +1 -1
- package/dist/src/client/service-host/service-host.js.map +1 -1
- package/dist/src/client/service-host/services/halo.d.ts.map +1 -1
- package/dist/src/client/service-host/services/halo.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
- package/src/api/halo-proxy.ts +13 -8
- package/src/api/invitations/invitation-proxy.ts +1 -1
- package/src/api/party-proxy.ts +8 -4
- package/src/client/service-host/service-host.ts +1 -1
- package/src/client/service-host/services/halo.ts +0 -1
- package/src/proto/imports.proto +4 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client",
|
|
3
|
-
"version": "2.28.
|
|
4
|
-
"license": "
|
|
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.
|
|
14
|
-
"@dxos/codec-protobuf": "2.28.
|
|
15
|
-
"@dxos/config": "2.28.
|
|
16
|
-
"@dxos/credentials": "2.28.
|
|
17
|
-
"@dxos/crypto": "2.28.
|
|
18
|
-
"@dxos/debug": "2.28.
|
|
19
|
-
"@dxos/echo-db": "2.28.
|
|
20
|
-
"@dxos/echo-protocol": "2.28.
|
|
21
|
-
"@dxos/feed-store": "2.28.
|
|
22
|
-
"@dxos/model-factory": "2.28.
|
|
23
|
-
"@dxos/network-manager": "2.28.
|
|
24
|
-
"@dxos/object-model": "2.28.
|
|
25
|
-
"@dxos/
|
|
26
|
-
"@dxos/rpc": "2.28.
|
|
27
|
-
"@dxos/util": "2.28.
|
|
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.
|
|
45
|
-
"@dxos/testutils": "2.28.
|
|
46
|
-
"@dxos/toolchain-node-library": "2.28.
|
|
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",
|
package/src/api/halo-proxy.ts
CHANGED
|
@@ -15,21 +15,26 @@ export interface CreateInvitationOptions extends InvitationOptions {
|
|
|
15
15
|
onPinGenerated?: (pin: string) => void
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export class HaloProxy
|
|
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
|
-
|
|
28
|
+
constructor (
|
|
29
|
+
private readonly _serviceProvider: ClientServiceProvider
|
|
30
|
+
) {}
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
toString () {
|
|
33
|
+
return `HaloProxy(${this._profile?.publicKey})`;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
return
|
|
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
|
-
|
|
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();
|
package/src/api/party-proxy.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { PublicKey } from '@dxos/crypto';
|
|
6
6
|
import { failUndefined } from '@dxos/debug';
|
|
7
7
|
import {
|
|
8
|
-
|
|
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
|
|
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';
|
package/src/proto/imports.proto
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
|
-
import "@dxos/
|
|
4
|
-
import "@dxos/
|
|
5
|
-
import "@dxos/
|
|
6
|
-
import "@dxos/
|
|
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";
|