@dxos/client 2.33.5-dev.ea3876ba → 2.33.5-dev.ebc105f7
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/client.test.js +3 -5
- package/dist/src/api/client.test.js.map +1 -1
- package/dist/src/devtools/config.d.ts.map +1 -1
- package/dist/src/devtools/config.js +3 -5
- package/dist/src/devtools/config.js.map +1 -1
- package/dist/src/devtools/devtools-host.d.ts.map +1 -1
- package/dist/src/devtools/devtools-host.js +38 -68
- package/dist/src/devtools/devtools-host.js.map +1 -1
- package/dist/src/devtools/feeds.d.ts.map +1 -1
- package/dist/src/devtools/feeds.js +49 -50
- package/dist/src/devtools/feeds.js.map +1 -1
- package/dist/src/devtools/items.d.ts.map +1 -1
- package/dist/src/devtools/items.js +23 -25
- package/dist/src/devtools/items.js.map +1 -1
- package/dist/src/devtools/keys.d.ts.map +1 -1
- package/dist/src/devtools/keys.js +19 -23
- package/dist/src/devtools/keys.js.map +1 -1
- package/dist/src/devtools/network.d.ts.map +1 -1
- package/dist/src/devtools/network.js +51 -59
- package/dist/src/devtools/network.js.map +1 -1
- package/dist/src/devtools/parties.d.ts.map +1 -1
- package/dist/src/devtools/parties.js +23 -25
- package/dist/src/devtools/parties.js.map +1 -1
- package/dist/src/proto/gen/dxos/client.d.ts +1 -1
- package/dist/src/proto/gen/dxos/client.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/client.js.map +1 -1
- package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/config.js.map +1 -1
- package/dist/src/proto/gen/dxos/credentials.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/devtools.d.ts +1 -1
- package/dist/src/proto/gen/dxos/devtools.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/feed.d.ts +1 -13
- package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/feed.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/invitation.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/invitation.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/service.d.ts +1 -1
- package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +1 -1
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/timeframe.d.ts +13 -0
- package/dist/src/proto/gen/dxos/echo/timeframe.d.ts.map +1 -0
- package/dist/src/proto/gen/dxos/echo/timeframe.js +3 -0
- package/dist/src/proto/gen/dxos/echo/timeframe.js.map +1 -0
- package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/keys.js.map +1 -1
- package/dist/src/proto/gen/dxos/rpc.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/rpc.js.map +1 -1
- package/dist/src/proto/gen/google/protobuf.d.ts +4 -4
- package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
- package/dist/src/proto/gen/google/protobuf.js.map +1 -1
- package/dist/src/proto/gen/index.d.ts +3 -2
- package/dist/src/proto/gen/index.d.ts.map +1 -1
- package/dist/src/proto/gen/index.js +1 -1
- package/dist/src/proto/gen/index.js.map +1 -1
- package/dist/src/proto/substitutions.d.ts +1 -1
- package/dist/src/services/impl/halo.d.ts.map +1 -1
- package/dist/src/services/impl/halo.js +1 -3
- package/dist/src/services/impl/halo.js.map +1 -1
- package/dist/src/services/impl/party.d.ts.map +1 -1
- package/dist/src/services/impl/party.js +10 -16
- package/dist/src/services/impl/party.js.map +1 -1
- package/dist/src/services/impl/profile.d.ts.map +1 -1
- package/dist/src/services/impl/profile.js +1 -3
- package/dist/src/services/impl/profile.js.map +1 -1
- package/dist/src/services/impl/services.d.ts.map +1 -1
- package/dist/src/services/impl/services.js +14 -16
- package/dist/src/services/impl/services.js.map +1 -1
- package/dist/src/services/impl/system.d.ts.map +1 -1
- package/dist/src/services/impl/system.js +6 -10
- package/dist/src/services/impl/system.js.map +1 -1
- package/dist/src/util/subscription.d.ts +2 -2
- package/dist/src/util/subscription.d.ts.map +1 -1
- package/dist/src/util/subscription.js +6 -8
- package/dist/src/util/subscription.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/src/api/client.test.ts +3 -5
- package/src/devtools/config.ts +3 -5
- package/src/devtools/devtools-host.ts +38 -68
- package/src/devtools/feeds.ts +53 -57
- package/src/devtools/items.ts +25 -27
- package/src/devtools/keys.ts +19 -26
- package/src/devtools/network.ts +46 -54
- package/src/devtools/parties.ts +25 -27
- package/src/proto/gen/dxos/client.ts +2 -1
- package/src/proto/gen/dxos/config.ts +1 -0
- package/src/proto/gen/dxos/credentials.ts +1 -0
- package/src/proto/gen/dxos/devtools.ts +2 -1
- package/src/proto/gen/dxos/echo/feed.ts +2 -13
- package/src/proto/gen/dxos/echo/invitation.ts +1 -0
- package/src/proto/gen/dxos/echo/service.ts +2 -1
- package/src/proto/gen/dxos/echo/snapshot.ts +2 -1
- package/src/proto/gen/dxos/echo/timeframe.ts +25 -0
- package/src/proto/gen/dxos/halo/keys.ts +1 -0
- package/src/proto/gen/dxos/rpc.ts +1 -0
- package/src/proto/gen/google/protobuf.ts +5 -4
- package/src/proto/gen/index.ts +4 -3
- package/src/services/impl/halo.ts +1 -3
- package/src/services/impl/party.ts +10 -16
- package/src/services/impl/profile.ts +1 -3
- package/src/services/impl/services.ts +14 -16
- package/src/services/impl/system.ts +6 -10
- package/src/util/subscription.ts +6 -8
|
@@ -67,9 +67,7 @@ class PartyService implements IPartyService {
|
|
|
67
67
|
|
|
68
68
|
const party = this.echo.getParty(request.partyKey);
|
|
69
69
|
if (party) {
|
|
70
|
-
return new Stream(({ next }) =>
|
|
71
|
-
return party.update.on(() => update(next));
|
|
72
|
-
});
|
|
70
|
+
return new Stream(({ next }) => party.update.on(() => update(next)));
|
|
73
71
|
} else {
|
|
74
72
|
return new Stream(({ next }) => {
|
|
75
73
|
let unsubscribeParty: () => void;
|
|
@@ -91,16 +89,14 @@ class PartyService implements IPartyService {
|
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
subscribeParties () {
|
|
94
|
-
return resultSetToStream(this.echo.queryParties(), (parties): SubscribePartiesResponse => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
});
|
|
92
|
+
return resultSetToStream(this.echo.queryParties(), (parties): SubscribePartiesResponse => ({
|
|
93
|
+
parties: parties.map(party => ({
|
|
94
|
+
publicKey: party.key,
|
|
95
|
+
isOpen: party.isOpen,
|
|
96
|
+
isActive: party.isActive,
|
|
97
|
+
members: party.queryMembers().value
|
|
98
|
+
}))
|
|
99
|
+
}));
|
|
104
100
|
}
|
|
105
101
|
|
|
106
102
|
async getPartyDetails (request: GetPartyDetailsRequest): Promise<PartyDetails> {
|
|
@@ -277,6 +273,4 @@ class PartyService implements IPartyService {
|
|
|
277
273
|
}
|
|
278
274
|
}
|
|
279
275
|
|
|
280
|
-
export const createPartyService = ({ echo }: CreateServicesOpts): PartyService =>
|
|
281
|
-
return new PartyService(echo);
|
|
282
|
-
};
|
|
276
|
+
export const createPartyService = ({ echo }: CreateServicesOpts): PartyService => new PartyService(echo);
|
|
@@ -126,6 +126,4 @@ export class ProfileService implements IProfileService {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
export const createProfileService = ({ echo }: CreateServicesOpts): ProfileService =>
|
|
130
|
-
return new ProfileService(echo);
|
|
131
|
-
};
|
|
129
|
+
export const createProfileService = ({ echo }: CreateServicesOpts): ProfileService => new ProfileService(echo);
|
|
@@ -9,20 +9,18 @@ import { createProfileService } from './profile';
|
|
|
9
9
|
import { createSystemService } from './system';
|
|
10
10
|
import { CreateServicesOpts } from './types';
|
|
11
11
|
|
|
12
|
-
export const createServices = (opts: CreateServicesOpts): Omit<ClientServices, 'DevtoolsHost'> => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
throw new Error('Tracing not available.');
|
|
25
|
-
}
|
|
12
|
+
export const createServices = (opts: CreateServicesOpts): Omit<ClientServices, 'DevtoolsHost'> => ({
|
|
13
|
+
SystemService: createSystemService(opts),
|
|
14
|
+
ProfileService: createProfileService(opts),
|
|
15
|
+
HaloService: createHaloService(opts),
|
|
16
|
+
PartyService: createPartyService(opts),
|
|
17
|
+
DataService: opts.echo.dataService,
|
|
18
|
+
TracingService: {
|
|
19
|
+
setTracingOptions: () => {
|
|
20
|
+
throw new Error('Tracing not available.');
|
|
21
|
+
},
|
|
22
|
+
subscribeToRpcTrace: () => {
|
|
23
|
+
throw new Error('Tracing not available.');
|
|
26
24
|
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
@@ -5,14 +5,10 @@
|
|
|
5
5
|
import { SystemService } from '../../proto/gen/dxos/client';
|
|
6
6
|
import { CreateServicesOpts } from './types';
|
|
7
7
|
|
|
8
|
-
export const createSystemService = ({ config, echo }: CreateServicesOpts): SystemService => {
|
|
9
|
-
|
|
10
|
-
getConfig: async () => {
|
|
11
|
-
return config.values;
|
|
12
|
-
},
|
|
8
|
+
export const createSystemService = ({ config, echo }: CreateServicesOpts): SystemService => ({
|
|
9
|
+
getConfig: async () => config.values,
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
11
|
+
reset: async () => {
|
|
12
|
+
await echo.reset();
|
|
13
|
+
}
|
|
14
|
+
});
|
package/src/util/subscription.ts
CHANGED
|
@@ -6,14 +6,12 @@ import { Event } from '@dxos/async';
|
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
7
|
import { ResultSet } from '@dxos/echo-db';
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
}
|
|
9
|
+
export const resultSetToStream = <T, U>(resultSet: ResultSet<T>, map: (arg: T[]) => U): Stream<U> => new Stream(({ next }) => {
|
|
10
|
+
next(map(resultSet.value));
|
|
11
|
+
return resultSet.update.on(() => next(map(resultSet.value)));
|
|
12
|
+
});
|
|
15
13
|
|
|
16
|
-
export
|
|
14
|
+
export const streamToResultSet = <T, U>(stream: Stream<T>, map: (arg?: T) => U[]): ResultSet<U> => {
|
|
17
15
|
const event = new Event();
|
|
18
16
|
let lastItem: T | undefined;
|
|
19
17
|
stream.subscribe(data => {
|
|
@@ -21,4 +19,4 @@ export function streamToResultSet<T, U> (stream: Stream<T>, map: (arg?: T) => U[
|
|
|
21
19
|
event.emit();
|
|
22
20
|
}, () => {});
|
|
23
21
|
return new ResultSet(event, () => map(lastItem));
|
|
24
|
-
}
|
|
22
|
+
};
|