@dxos/client 2.25.1-dev.0ff9b5c9 → 2.25.1-dev.3e7251f9

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 (33) hide show
  1. package/dist/src/api/echo-proxy.js +6 -6
  2. package/dist/src/api/halo-proxy.js +10 -10
  3. package/dist/src/api/party-proxy.js +5 -5
  4. package/dist/src/client/client-services.test.js +5 -5
  5. package/dist/src/client/client.js +1 -1
  6. package/dist/src/client/service-host/services/halo.d.ts +3 -3
  7. package/dist/src/client/service-host/services/halo.js +3 -3
  8. package/dist/src/client/service-host/services/party.d.ts +10 -10
  9. package/dist/src/client/service-host/services/party.js +10 -10
  10. package/dist/src/client/service-host/services/profile.d.ts +6 -6
  11. package/dist/src/client/service-host/services/profile.js +6 -6
  12. package/dist/src/client/service-host/services/services.js +2 -2
  13. package/dist/src/client/service-host/services/system.js +2 -2
  14. package/dist/src/devtools/devtools-host.js +19 -19
  15. package/dist/src/proto/gen/dxos/client.d.ts +21 -21
  16. package/dist/src/proto/gen/dxos/devtools.d.ts +21 -21
  17. package/dist/src/proto/gen/dxos/echo/service.d.ts +3 -3
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/package.json +17 -17
  20. package/src/api/echo-proxy.ts +6 -6
  21. package/src/api/halo-proxy.ts +10 -10
  22. package/src/api/party-proxy.ts +5 -5
  23. package/src/client/client-services.test.ts +5 -5
  24. package/src/client/client.ts +1 -1
  25. package/src/client/service-host/services/halo.ts +3 -3
  26. package/src/client/service-host/services/party.ts +10 -10
  27. package/src/client/service-host/services/profile.ts +6 -6
  28. package/src/client/service-host/services/services.ts +2 -2
  29. package/src/client/service-host/services/system.ts +2 -2
  30. package/src/devtools/devtools-host.ts +19 -19
  31. package/src/proto/gen/dxos/client.ts +21 -21
  32. package/src/proto/gen/dxos/devtools.ts +21 -21
  33. package/src/proto/gen/dxos/echo/service.ts +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/client",
3
- "version": "2.25.1-dev.0ff9b5c9",
3
+ "version": "2.25.1-dev.3e7251f9",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "DXOS.org",
6
6
  "main": "dist/src/index.js",
@@ -10,21 +10,21 @@
10
10
  "src"
11
11
  ],
12
12
  "dependencies": {
13
- "@dxos/async": "2.25.1-dev.0ff9b5c9",
14
- "@dxos/codec-protobuf": "2.25.1-dev.0ff9b5c9",
15
- "@dxos/config": "2.25.1-dev.0ff9b5c9",
16
- "@dxos/credentials": "2.25.1-dev.0ff9b5c9",
17
- "@dxos/crypto": "2.25.1-dev.0ff9b5c9",
18
- "@dxos/debug": "2.25.1-dev.0ff9b5c9",
19
- "@dxos/echo-db": "2.25.1-dev.0ff9b5c9",
20
- "@dxos/echo-protocol": "2.25.1-dev.0ff9b5c9",
21
- "@dxos/feed-store": "2.25.1-dev.0ff9b5c9",
22
- "@dxos/model-factory": "2.25.1-dev.0ff9b5c9",
23
- "@dxos/network-manager": "2.25.1-dev.0ff9b5c9",
24
- "@dxos/object-model": "2.25.1-dev.0ff9b5c9",
25
- "@dxos/proto": "2.25.1-dev.0ff9b5c9",
26
- "@dxos/rpc": "2.25.1-dev.0ff9b5c9",
27
- "@dxos/util": "2.25.1-dev.0ff9b5c9",
13
+ "@dxos/async": "2.25.1-dev.3e7251f9",
14
+ "@dxos/codec-protobuf": "2.25.1-dev.3e7251f9",
15
+ "@dxos/config": "2.25.1-dev.3e7251f9",
16
+ "@dxos/credentials": "2.25.1-dev.3e7251f9",
17
+ "@dxos/crypto": "2.25.1-dev.3e7251f9",
18
+ "@dxos/debug": "2.25.1-dev.3e7251f9",
19
+ "@dxos/echo-db": "2.25.1-dev.3e7251f9",
20
+ "@dxos/echo-protocol": "2.25.1-dev.3e7251f9",
21
+ "@dxos/feed-store": "2.25.1-dev.3e7251f9",
22
+ "@dxos/model-factory": "2.25.1-dev.3e7251f9",
23
+ "@dxos/network-manager": "2.25.1-dev.3e7251f9",
24
+ "@dxos/object-model": "2.25.1-dev.3e7251f9",
25
+ "@dxos/proto": "2.25.1-dev.3e7251f9",
26
+ "@dxos/rpc": "2.25.1-dev.3e7251f9",
27
+ "@dxos/util": "2.25.1-dev.3e7251f9",
28
28
  "@polkadot/keyring": "6.11.1",
29
29
  "@polkadot/util": "6.11.1",
30
30
  "@polkadot/util-crypto": "6.11.1",
@@ -41,7 +41,7 @@
41
41
  "uuid": "^8.3.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@dxos/random-access-multi-storage": "2.25.1-dev.0ff9b5c9",
44
+ "@dxos/random-access-multi-storage": "2.25.1-dev.3e7251f9",
45
45
  "@dxos/testutils": "2.25.0",
46
46
  "@dxos/toolchain-node-library": "2.25.0",
47
47
  "@types/debug": "^4.1.7",
@@ -66,7 +66,7 @@ export class EchoProxy {
66
66
  async _open () {
67
67
  const gotParties = this._partiesChanged.waitForCount(1);
68
68
 
69
- const partiesStream = this._serviceProvider.services.PartyService.SubscribeParties();
69
+ const partiesStream = this._serviceProvider.services.PartyService.subscribeParties();
70
70
  partiesStream.subscribe(async data => {
71
71
  for (const party of data.parties ?? []) {
72
72
  if (!this._parties.has(party.publicKey)) {
@@ -81,7 +81,7 @@ export class EchoProxy {
81
81
  }
82
82
  });
83
83
 
84
- const partyStream = this._serviceProvider.services.PartyService.SubscribeToParty({ partyKey: party.publicKey });
84
+ const partyStream = this._serviceProvider.services.PartyService.subscribeToParty({ partyKey: party.publicKey });
85
85
  partyStream.subscribe(async ({ party }) => {
86
86
  if (!party) {
87
87
  return;
@@ -121,7 +121,7 @@ export class EchoProxy {
121
121
  async createParty (): Promise<Party> {
122
122
  const [partyReceivedPromise, partyReceived] = latch();
123
123
 
124
- const party = await this._serviceProvider.services.PartyService.CreateParty();
124
+ const party = await this._serviceProvider.services.PartyService.createParty();
125
125
 
126
126
  const handler = () => {
127
127
  if (this._parties.has(party.publicKey)) {
@@ -142,7 +142,7 @@ export class EchoProxy {
142
142
  async cloneParty (snapshot: PartySnapshot): Promise<Party> {
143
143
  const [partyReceivedPromise, partyReceived] = latch();
144
144
 
145
- const party = await this._serviceProvider.services.PartyService.CloneParty(snapshot);
145
+ const party = await this._serviceProvider.services.PartyService.cloneParty(snapshot);
146
146
 
147
147
  const handler = () => {
148
148
  if (this._parties.has(party.publicKey)) {
@@ -174,12 +174,12 @@ export class EchoProxy {
174
174
  * To be used with `party.createInvitation` on the inviter side.
175
175
  */
176
176
  acceptInvitation (invitationDescriptor: InvitationDescriptor): PartyInvitation {
177
- const invitationProcessStream = this._serviceProvider.services.PartyService.AcceptInvitation(invitationDescriptor.toProto());
177
+ const invitationProcessStream = this._serviceProvider.services.PartyService.acceptInvitation(invitationDescriptor.toProto());
178
178
  const { authenticate, waitForFinish } = InvitationProxy.handleInvitationRedemption({
179
179
  stream: invitationProcessStream,
180
180
  invitationDescriptor,
181
181
  onAuthenticate: async (request) => {
182
- await this._serviceProvider.services.PartyService.AuthenticateInvitation(request);
182
+ await this._serviceProvider.services.PartyService.authenticateInvitation(request);
183
183
  }
184
184
  });
185
185
 
@@ -43,7 +43,7 @@ export class HaloProxy extends InvitationProxy {
43
43
  * Reset the identity and delete all key records.
44
44
  */
45
45
  async reset () {
46
- await this._serviceProvider.services.SystemService.Reset();
46
+ await this._serviceProvider.services.SystemService.reset();
47
47
  this._profileChanged.emit();
48
48
  }
49
49
 
@@ -58,7 +58,7 @@ export class HaloProxy extends InvitationProxy {
58
58
  * @returns User profile info.
59
59
  */
60
60
  async createProfile ({ publicKey, secretKey, username }: CreateProfileOptions = {}): Promise<Profile> {
61
- this._profile = await this._serviceProvider.services.ProfileService.CreateProfile({ publicKey, secretKey, username });
61
+ this._profile = await this._serviceProvider.services.ProfileService.createProfile({ publicKey, secretKey, username });
62
62
  return this._profile;
63
63
  }
64
64
 
@@ -73,7 +73,7 @@ export class HaloProxy extends InvitationProxy {
73
73
  * Joins an existing identity HALO from a recovery seed phrase.
74
74
  */
75
75
  async recoverProfile (seedPhrase: string) {
76
- this._profile = await this._serviceProvider.services.ProfileService.RecoverProfile({ seedPhrase });
76
+ this._profile = await this._serviceProvider.services.ProfileService.recoverProfile({ seedPhrase });
77
77
  return this._profile;
78
78
  }
79
79
 
@@ -86,7 +86,7 @@ export class HaloProxy extends InvitationProxy {
86
86
  * To be used with `client.halo.joinHaloInvitation` on the invitee side.
87
87
  */
88
88
  async createInvitation (): Promise<InvitationRequest> {
89
- const stream = await this._serviceProvider.services.ProfileService.CreateInvitation();
89
+ const stream = await this._serviceProvider.services.ProfileService.createInvitation();
90
90
  return this.createInvitationRequest({ stream });
91
91
  }
92
92
 
@@ -99,12 +99,12 @@ export class HaloProxy extends InvitationProxy {
99
99
  * To be used with `client.halo.createHaloInvitation` on the inviter side.
100
100
  */
101
101
  acceptInvitation (invitationDescriptor: InvitationDescriptor): Invitation {
102
- const invitationProcessStream = this._serviceProvider.services.ProfileService.AcceptInvitation(invitationDescriptor.toProto());
102
+ const invitationProcessStream = this._serviceProvider.services.ProfileService.acceptInvitation(invitationDescriptor.toProto());
103
103
  const { authenticate, waitForFinish } = InvitationProxy.handleInvitationRedemption({
104
104
  stream: invitationProcessStream,
105
105
  invitationDescriptor,
106
106
  onAuthenticate: async (request) => {
107
- await this._serviceProvider.services.ProfileService.AuthenticateInvitation(request);
107
+ await this._serviceProvider.services.ProfileService.authenticateInvitation(request);
108
108
  }
109
109
  });
110
110
 
@@ -121,11 +121,11 @@ export class HaloProxy extends InvitationProxy {
121
121
  }
122
122
 
123
123
  async addKeyRecord (keyRecord: KeyRecord) {
124
- await this._serviceProvider.services.HaloService.AddKeyRecord({ keyRecord });
124
+ await this._serviceProvider.services.HaloService.addKeyRecord({ keyRecord });
125
125
  }
126
126
 
127
127
  async sign (request: SignRequest) {
128
- return await this._serviceProvider.services.HaloService.Sign(request);
128
+ return await this._serviceProvider.services.HaloService.sign(request);
129
129
  }
130
130
 
131
131
  /**
@@ -137,14 +137,14 @@ export class HaloProxy extends InvitationProxy {
137
137
  const gotProfile = this._profileChanged.waitForCount(1);
138
138
  const gotContacts = this._contactsChanged.waitForCount(1);
139
139
 
140
- const profileStream = this._serviceProvider.services.ProfileService.SubscribeProfile();
140
+ const profileStream = this._serviceProvider.services.ProfileService.subscribeProfile();
141
141
  profileStream.subscribe(data => {
142
142
  this._profile = data.profile;
143
143
  this._profileChanged.emit();
144
144
  }, () => {});
145
145
  this._subscriptions.push(() => profileStream.close());
146
146
 
147
- const contactsStream = this._serviceProvider.services.HaloService.SubscribeContacts();
147
+ const contactsStream = this._serviceProvider.services.HaloService.subscribeContacts();
148
148
  contactsStream.subscribe(data => {
149
149
  this._contacts = data.contacts as PartyMember[];
150
150
  this._contactsChanged.emit();
@@ -109,7 +109,7 @@ export class Party extends InvitationProxy {
109
109
  }
110
110
 
111
111
  async setOpen (open: boolean) {
112
- await this._serviceProvider.services.PartyService.SetPartyState({
112
+ await this._serviceProvider.services.PartyService.setPartyState({
113
113
  partyKey: this.key,
114
114
  open
115
115
  });
@@ -118,7 +118,7 @@ export class Party extends InvitationProxy {
118
118
  async setActive (active: boolean, options: ActivationOptions) {
119
119
  const activeGlobal = options.global ? active : undefined;
120
120
  const activeDevice = options.device ? active : undefined;
121
- await this._serviceProvider.services.PartyService.SetPartyState({
121
+ await this._serviceProvider.services.PartyService.setPartyState({
122
122
  partyKey: this.key,
123
123
  activeGlobal,
124
124
  activeDevice
@@ -143,13 +143,13 @@ export class Party extends InvitationProxy {
143
143
  * @param inviteeKey Public key of the invitee. In this case no secret exchange is required, but only the specified recipient can accept the invitation.
144
144
  */
145
145
  async createInvitation ({ inviteeKey }: CreationInvitationOptions = {}): Promise<InvitationRequest> {
146
- const stream = this._serviceProvider.services.PartyService.CreateInvitation({ partyKey: this.key, inviteeKey });
146
+ const stream = this._serviceProvider.services.PartyService.createInvitation({ partyKey: this.key, inviteeKey });
147
147
  return this.createInvitationRequest({ stream });
148
148
  }
149
149
 
150
150
  queryMembers () {
151
151
  return streamToResultSet(
152
- this._serviceProvider.services.PartyService.SubscribeMembers({ partyKey: this.key }),
152
+ this._serviceProvider.services.PartyService.subscribeMembers({ partyKey: this.key }),
153
153
  (response) => response?.members ?? []
154
154
  );
155
155
  }
@@ -176,6 +176,6 @@ export class Party extends InvitationProxy {
176
176
  }
177
177
 
178
178
  createSnapshot () {
179
- return this._serviceProvider.services.PartyService.CreateSnapshot({ partyKey: this.key });
179
+ return this._serviceProvider.services.PartyService.createSnapshot({ partyKey: this.key });
180
180
  }
181
181
  }
@@ -31,24 +31,24 @@ describe('Client Services', () => {
31
31
  const invitee = await setup();
32
32
  afterTest(() => invitee.client.destroy());
33
33
 
34
- await inviter.services.ProfileService.CreateProfile({ username: 'test-user' });
34
+ await inviter.services.ProfileService.createProfile({ username: 'test-user' });
35
35
 
36
36
  const invitation = await new Promise<InvitationRequest>((resolve, reject) => {
37
- inviter.services.ProfileService.CreateInvitation().subscribe(resolve, reject);
37
+ inviter.services.ProfileService.createInvitation().subscribe(resolve, reject);
38
38
  });
39
39
  assert(invitation.descriptor);
40
40
 
41
41
  const redeemedInvitation = await new Promise<RedeemedInvitation>((resolve, reject) => {
42
- invitee.services.ProfileService.AcceptInvitation(invitation.descriptor!).subscribe(resolve, reject);
42
+ invitee.services.ProfileService.acceptInvitation(invitation.descriptor!).subscribe(resolve, reject);
43
43
  });
44
44
 
45
- await invitee.services.ProfileService.AuthenticateInvitation({
45
+ await invitee.services.ProfileService.authenticateInvitation({
46
46
  processId: redeemedInvitation.id,
47
47
  secret: invitation.descriptor.secret
48
48
  });
49
49
 
50
50
  const [inviteeProfileLatch, inviteeProfileTrigger] = latch();
51
- invitee.services.ProfileService.SubscribeProfile().subscribe(inviteeProfile => {
51
+ invitee.services.ProfileService.subscribeProfile().subscribe(inviteeProfile => {
52
52
  if (inviteeProfile.profile?.username === 'test-user') {
53
53
  inviteeProfileTrigger();
54
54
  }
@@ -233,7 +233,7 @@ export class Client {
233
233
  // Recreate echo instance? Big impact on hooks. Test.
234
234
  @synchronized
235
235
  async reset () {
236
- await this.services.SystemService.Reset();
236
+ await this.services.SystemService.reset();
237
237
  this._initialized = false;
238
238
  }
239
239
 
@@ -19,7 +19,7 @@ import { CreateServicesOpts } from './interfaces';
19
19
  export class HaloService implements IHaloService {
20
20
  constructor (private echo: ECHO) {}
21
21
 
22
- SubscribeContacts (): Stream<Contacts> {
22
+ subscribeContacts (): Stream<Contacts> {
23
23
  if (this.echo.halo.isInitialized) {
24
24
  return resultSetToStream(this.echo.halo.queryContacts(), (contacts): Contacts => ({ contacts }));
25
25
  } else {
@@ -44,7 +44,7 @@ export class HaloService implements IHaloService {
44
44
  }
45
45
  }
46
46
 
47
- async AddKeyRecord (request: AddKeyRecordRequest): Promise<void> {
47
+ async addKeyRecord (request: AddKeyRecordRequest): Promise<void> {
48
48
  assert(request.keyRecord && request.keyRecord.publicKey, 'Missing key record.');
49
49
  await this.echo.halo.keyring.addKeyRecord(request.keyRecord);
50
50
  assert(await this.echo.halo.keyring.getKey(request.keyRecord.publicKey), 'Key not inserted correctly.');
@@ -64,7 +64,7 @@ export class HaloService implements IHaloService {
64
64
  };
65
65
  }
66
66
 
67
- async Sign (request: SignRequest): Promise<SignResponse> {
67
+ async sign (request: SignRequest): Promise<SignResponse> {
68
68
  assert(request.publicKey, 'Provide a publicKey of the key that should be used for signing.');
69
69
  const key = await this.echo.halo.keyring.getFullKey(request.publicKey);
70
70
  assert(key, 'Key not found.');
@@ -37,7 +37,7 @@ class PartyService implements IPartyService {
37
37
 
38
38
  constructor (private echo: ECHO) {}
39
39
 
40
- SubscribeToParty (request: SubscribePartyRequest): Stream<SubscribePartyResponse> {
40
+ subscribeToParty (request: SubscribePartyRequest): Stream<SubscribePartyResponse> {
41
41
  const update = (next: (message: SubscribePartyResponse) => void) => {
42
42
  try {
43
43
  const party = this.echo.getParty(request.partyKey);
@@ -83,7 +83,7 @@ class PartyService implements IPartyService {
83
83
  }
84
84
  }
85
85
 
86
- SubscribeParties () {
86
+ subscribeParties () {
87
87
  return resultSetToStream(this.echo.queryParties(), (parties): SubscribePartiesResponse => {
88
88
  return ({
89
89
  parties: parties.map(party => ({
@@ -96,7 +96,7 @@ class PartyService implements IPartyService {
96
96
  });
97
97
  }
98
98
 
99
- async CreateParty () {
99
+ async createParty () {
100
100
  const party = await this.echo.createParty();
101
101
  return {
102
102
  publicKey: party.key,
@@ -105,7 +105,7 @@ class PartyService implements IPartyService {
105
105
  };
106
106
  }
107
107
 
108
- async CloneParty (snapshot: PartySnapshot): Promise<Party> {
108
+ async cloneParty (snapshot: PartySnapshot): Promise<Party> {
109
109
  const party = await this.echo.cloneParty(snapshot);
110
110
  return {
111
111
  publicKey: party.key,
@@ -114,7 +114,7 @@ class PartyService implements IPartyService {
114
114
  };
115
115
  }
116
116
 
117
- async SetPartyState (request: SetPartyStateRequest) {
117
+ async setPartyState (request: SetPartyStateRequest) {
118
118
  const party = this.echo.getParty(request.partyKey);
119
119
  if (!party) {
120
120
  throw new Error('Party not found');
@@ -144,7 +144,7 @@ class PartyService implements IPartyService {
144
144
  };
145
145
  }
146
146
 
147
- CreateInvitation (request: CreateInvitationRequest): Stream<InvitationRequest> {
147
+ createInvitation (request: CreateInvitationRequest): Stream<InvitationRequest> {
148
148
  return new Stream(({ next, close }) => {
149
149
  const party = this.echo.getParty(request.partyKey) ?? raise(new PartyNotFoundError(request.partyKey));
150
150
  setImmediate(async () => {
@@ -185,7 +185,7 @@ class PartyService implements IPartyService {
185
185
  });
186
186
  }
187
187
 
188
- AcceptInvitation (request: InvitationDescriptorProto): Stream<RedeemedInvitation> {
188
+ acceptInvitation (request: InvitationDescriptorProto): Stream<RedeemedInvitation> {
189
189
  return new Stream(({ next, close }) => {
190
190
  const id = v4();
191
191
  const [secretLatch, secretTrigger] = latch();
@@ -221,7 +221,7 @@ class PartyService implements IPartyService {
221
221
  });
222
222
  }
223
223
 
224
- async AuthenticateInvitation (request: AuthenticateInvitationRequest) {
224
+ async authenticateInvitation (request: AuthenticateInvitationRequest) {
225
225
  assert(request.processId, 'Process ID is missing.');
226
226
  const invitation = this.inviteeInvitations.get(request.processId);
227
227
  assert(invitation, 'Invitation not found.');
@@ -232,7 +232,7 @@ class PartyService implements IPartyService {
232
232
  invitation.secretTrigger?.();
233
233
  }
234
234
 
235
- SubscribeMembers (request: SubscribeMembersRequest): Stream<SubscribeMembersResponse> {
235
+ subscribeMembers (request: SubscribeMembersRequest): Stream<SubscribeMembersResponse> {
236
236
  const party = this.echo.getParty(request.partyKey);
237
237
  if (party) {
238
238
  return resultSetToStream(party.queryMembers(), (members): SubscribeMembersResponse => ({ members }));
@@ -256,7 +256,7 @@ class PartyService implements IPartyService {
256
256
  }
257
257
  }
258
258
 
259
- async CreateSnapshot (request: CreateSnaspotRequest): Promise<PartySnapshot> {
259
+ async createSnapshot (request: CreateSnaspotRequest): Promise<PartySnapshot> {
260
260
  assert(request.partyKey);
261
261
  const party = this.echo.getParty(request.partyKey) ?? raise(new PartyNotFoundError(request.partyKey));
262
262
  return party.createSnapshot();
@@ -21,7 +21,7 @@ export class ProfileService implements IProfileService {
21
21
 
22
22
  constructor (private echo: ECHO) {}
23
23
 
24
- SubscribeProfile (): Stream<SubscribeProfileResponse> {
24
+ subscribeProfile (): Stream<SubscribeProfileResponse> {
25
25
  return new Stream(({ next }) => {
26
26
  const emitNext = () => next({
27
27
  profile: this.echo.halo.isInitialized ? this.echo.halo.getProfile() : undefined
@@ -32,11 +32,11 @@ export class ProfileService implements IProfileService {
32
32
  });
33
33
  }
34
34
 
35
- async CreateProfile (request: CreateProfileRequest) {
35
+ async createProfile (request: CreateProfileRequest) {
36
36
  return this.echo.halo.createProfile(request);
37
37
  }
38
38
 
39
- async RecoverProfile (request: RecoverProfileRequest): Promise<Profile> {
39
+ async recoverProfile (request: RecoverProfileRequest): Promise<Profile> {
40
40
  if (!request.seedPhrase) {
41
41
  throw new Error('Recovery SeedPhrase not provided.');
42
42
  }
@@ -47,7 +47,7 @@ export class ProfileService implements IProfileService {
47
47
  return profile;
48
48
  }
49
49
 
50
- CreateInvitation (): Stream<InvitationRequest> {
50
+ createInvitation (): Stream<InvitationRequest> {
51
51
  return new Stream(({ next, close }) => {
52
52
  setImmediate(async () => {
53
53
  const secret = Buffer.from(generatePasscode());
@@ -71,7 +71,7 @@ export class ProfileService implements IProfileService {
71
71
  });
72
72
  }
73
73
 
74
- AcceptInvitation (request: InvitationDescriptorProto): Stream<RedeemedInvitation> {
74
+ acceptInvitation (request: InvitationDescriptorProto): Stream<RedeemedInvitation> {
75
75
  return new Stream(({ next, close }) => {
76
76
  const id = v4();
77
77
  const [secretLatch, secretTrigger] = latch();
@@ -101,7 +101,7 @@ export class ProfileService implements IProfileService {
101
101
  });
102
102
  }
103
103
 
104
- async AuthenticateInvitation (request: AuthenticateInvitationRequest) {
104
+ async authenticateInvitation (request: AuthenticateInvitationRequest) {
105
105
  assert(request.processId, 'Process ID is missing.');
106
106
  const invitation = this.inviteeInvitations.get(request.processId);
107
107
  assert(invitation, 'Invitation not found.');
@@ -17,10 +17,10 @@ export const createServices = (opts: CreateServicesOpts): Omit<ClientServices, '
17
17
  PartyService: createPartyService(opts),
18
18
  DataService: opts.echo.dataService,
19
19
  TracingService: {
20
- SetTracingOptions: () => {
20
+ setTracingOptions: () => {
21
21
  throw new Error('Tracing not available');
22
22
  },
23
- SubscribeToRpcTrace: () => {
23
+ subscribeToRpcTrace: () => {
24
24
  throw new Error('Tracing not available');
25
25
  }
26
26
  }
@@ -7,7 +7,7 @@ import { CreateServicesOpts } from './interfaces';
7
7
 
8
8
  export const createSystemService = ({ config, echo }: CreateServicesOpts): SystemService => {
9
9
  return {
10
- GetConfig: async () => {
10
+ getConfig: async () => {
11
11
  return {
12
12
  ...config.values,
13
13
  build: {
@@ -16,7 +16,7 @@ export const createSystemService = ({ config, echo }: CreateServicesOpts): Syste
16
16
  }
17
17
  };
18
18
  },
19
- Reset: async () => {
19
+ reset: async () => {
20
20
  await echo.reset();
21
21
  }
22
22
  };
@@ -24,68 +24,68 @@ import { resetStorage } from './storage';
24
24
 
25
25
  export const createDevtoolsHost = (context: DevtoolsServiceDependencies, events: DevtoolsHostEvents) : DevtoolsHost => {
26
26
  return {
27
- Events: () => {
27
+ events: () => {
28
28
  return new Stream<ClientAPIEvent>(({ next }) => {
29
29
  events.ready.on(() => {
30
30
  next({ ready: {} });
31
31
  });
32
32
  });
33
33
  },
34
- GetConfig: async () => {
34
+ getConfig: async () => {
35
35
  const config = getConfig(context);
36
36
  return config;
37
37
  },
38
- ResetStorage: async () => {
38
+ resetStorage: async () => {
39
39
  await resetStorage(context);
40
40
  },
41
- EnableDebugLogging: async (request) => {
41
+ enableDebugLogging: async (request) => {
42
42
  enableDebugLogging(context, request);
43
43
  return {};
44
44
  },
45
- DisableDebugLogging: async () => {
45
+ disableDebugLogging: async () => {
46
46
  disableDebugLogging(context);
47
47
  return {};
48
48
  },
49
- SubscribeToKeyringKeys: () => {
49
+ subscribeToKeyringKeys: () => {
50
50
  return subscribeToKeyringKeys(context);
51
51
  },
52
- SubscribeToCredentialMessages: (request) => {
52
+ subscribeToCredentialMessages: (request) => {
53
53
  return subscribeToCredentialMessages(context, request);
54
54
  },
55
- SubscribeToParties: () => {
55
+ subscribeToParties: () => {
56
56
  return subscribeToParties(context);
57
57
  },
58
- SubscribeToItems: () => {
58
+ subscribeToItems: () => {
59
59
  return subscribeToItems(context);
60
60
  },
61
- SubscribeToFeeds: () => {
61
+ subscribeToFeeds: () => {
62
62
  return subscribeToFeeds(context);
63
63
  },
64
- SubscribeToFeed: (request) => {
64
+ subscribeToFeed: (request) => {
65
65
  return subscribeToFeed(context, request);
66
66
  },
67
- GetPartySnapshot: async (request) => {
67
+ getPartySnapshot: async (request) => {
68
68
  return getPartySnapshot(context, request);
69
69
  },
70
- SavePartySnapshot: async (request) => {
70
+ savePartySnapshot: async (request) => {
71
71
  return savePartySnapshot(context, request);
72
72
  },
73
- ClearSnapshots: async () => {
73
+ clearSnapshots: async () => {
74
74
  await context.echo.snapshotStore.clear();
75
75
  },
76
- GetNetworkPeers: async (request) => {
76
+ getNetworkPeers: async (request) => {
77
77
  return getNetworkPeers(context, request);
78
78
  },
79
- SubscribeToNetworkTopics: () => {
79
+ subscribeToNetworkTopics: () => {
80
80
  return subscribeToNetworkTopics(context);
81
81
  },
82
- SubscribeToSignalStatus: () => {
82
+ subscribeToSignalStatus: () => {
83
83
  return subscribeToNetworkStatus(context);
84
84
  },
85
- SubscribeToSignalTrace: () => {
85
+ subscribeToSignalTrace: () => {
86
86
  return subscribeToSignalTrace(context);
87
87
  },
88
- SubscribeToSwarmInfo: () => {
88
+ subscribeToSwarmInfo: () => {
89
89
  return subscribeToSwarmInfo(context);
90
90
  }
91
91
  };
@@ -11,8 +11,8 @@ import * as dxos_halo_keys from "./halo/keys";
11
11
  import * as dxos_rpc from "./rpc";
12
12
  import * as google_protobuf from "../google/protobuf";
13
13
  export interface SystemService {
14
- GetConfig: (request: void) => Promise<dxos_config.Config>;
15
- Reset: (request: void) => Promise<void>;
14
+ getConfig: (request: void) => Promise<dxos_config.Config>;
15
+ reset: (request: void) => Promise<void>;
16
16
  }
17
17
  export enum InvitationState {
18
18
  WAITING_FOR_CONNECTION = 1,
@@ -76,12 +76,12 @@ export interface Contacts {
76
76
  contacts?: Contact[];
77
77
  }
78
78
  export interface ProfileService {
79
- SubscribeProfile: (request: void) => Stream<SubscribeProfileResponse>;
80
- CreateProfile: (request: CreateProfileRequest) => Promise<Profile>;
81
- RecoverProfile: (request: RecoverProfileRequest) => Promise<Profile>;
82
- CreateInvitation: (request: void) => Stream<InvitationRequest>;
83
- AcceptInvitation: (request: dxos_echo_invitation.InvitationDescriptor) => Stream<RedeemedInvitation>;
84
- AuthenticateInvitation: (request: AuthenticateInvitationRequest) => Promise<void>;
79
+ subscribeProfile: (request: void) => Stream<SubscribeProfileResponse>;
80
+ createProfile: (request: CreateProfileRequest) => Promise<Profile>;
81
+ recoverProfile: (request: RecoverProfileRequest) => Promise<Profile>;
82
+ createInvitation: (request: void) => Stream<InvitationRequest>;
83
+ acceptInvitation: (request: dxos_echo_invitation.InvitationDescriptor) => Stream<RedeemedInvitation>;
84
+ authenticateInvitation: (request: AuthenticateInvitationRequest) => Promise<void>;
85
85
  }
86
86
  export interface AddKeyRecordRequest {
87
87
  keyRecord?: dxos_halo_keys.KeyRecord;
@@ -97,9 +97,9 @@ export interface SignResponse {
97
97
  signed?: ReturnType<typeof substitutions["google.protobuf.Any"]["decode"]>;
98
98
  }
99
99
  export interface HaloService {
100
- SubscribeContacts: (request: void) => Stream<Contacts>;
101
- AddKeyRecord: (request: AddKeyRecordRequest) => Promise<void>;
102
- Sign: (request: SignRequest) => Promise<SignResponse>;
100
+ subscribeContacts: (request: void) => Stream<Contacts>;
101
+ addKeyRecord: (request: AddKeyRecordRequest) => Promise<void>;
102
+ sign: (request: SignRequest) => Promise<SignResponse>;
103
103
  }
104
104
  export interface Party {
105
105
  publicKey: ReturnType<typeof substitutions["dxos.halo.keys.PubKey"]["decode"]>;
@@ -155,17 +155,17 @@ export interface CreateSnaspotRequest {
155
155
  partyKey?: ReturnType<typeof substitutions["dxos.halo.keys.PubKey"]["decode"]>;
156
156
  }
157
157
  export interface PartyService {
158
- SubscribeToParty: (request: SubscribePartyRequest) => Stream<SubscribePartyResponse>;
159
- SubscribeParties: (request: void) => Stream<SubscribePartiesResponse>;
160
- CreateParty: (request: void) => Promise<Party>;
161
- CloneParty: (request: dxos_echo_snapshot.PartySnapshot) => Promise<Party>;
158
+ subscribeToParty: (request: SubscribePartyRequest) => Stream<SubscribePartyResponse>;
159
+ subscribeParties: (request: void) => Stream<SubscribePartiesResponse>;
160
+ createParty: (request: void) => Promise<Party>;
161
+ cloneParty: (request: dxos_echo_snapshot.PartySnapshot) => Promise<Party>;
162
162
  /**
163
163
  * Open and close or activate and deactivate a party.
164
164
  */
165
- SetPartyState: (request: SetPartyStateRequest) => Promise<Party>;
166
- CreateInvitation: (request: CreateInvitationRequest) => Stream<InvitationRequest>;
167
- AcceptInvitation: (request: dxos_echo_invitation.InvitationDescriptor) => Stream<RedeemedInvitation>;
168
- AuthenticateInvitation: (request: AuthenticateInvitationRequest) => Promise<void>;
169
- SubscribeMembers: (request: SubscribeMembersRequest) => Stream<SubscribeMembersResponse>;
170
- CreateSnapshot: (request: CreateSnaspotRequest) => Promise<dxos_echo_snapshot.PartySnapshot>;
165
+ setPartyState: (request: SetPartyStateRequest) => Promise<Party>;
166
+ createInvitation: (request: CreateInvitationRequest) => Stream<InvitationRequest>;
167
+ acceptInvitation: (request: dxos_echo_invitation.InvitationDescriptor) => Stream<RedeemedInvitation>;
168
+ authenticateInvitation: (request: AuthenticateInvitationRequest) => Promise<void>;
169
+ subscribeMembers: (request: SubscribeMembersRequest) => Stream<SubscribeMembersResponse>;
170
+ createSnapshot: (request: CreateSnaspotRequest) => Promise<dxos_echo_snapshot.PartySnapshot>;
171
171
  }