@dxos/client-services 0.4.7-main.0aeacda → 0.4.7-main.6b81200
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/lib/browser/{chunk-N4RGR7MX.mjs → chunk-CWD6SLTL.mjs} +133 -202
- package/dist/lib/browser/chunk-CWD6SLTL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-IG3MUK6Q.cjs → chunk-TG6QYWRX.cjs} +125 -194
- package/dist/lib/node/chunk-TG6QYWRX.cjs.map +7 -0
- package/dist/lib/node/index.cjs +37 -37
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/devices/devices-service.d.ts +1 -1
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +2 -8
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +1 -5
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +3 -5
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +2 -4
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -7
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -35
- package/src/packlets/devices/devices-service.test.ts +4 -8
- package/src/packlets/devices/devices-service.ts +11 -47
- package/src/packlets/identity/identity-manager.ts +5 -47
- package/src/packlets/identity/identity.ts +1 -9
- package/src/packlets/services/service-context.ts +3 -17
- package/src/packlets/services/service-host.ts +1 -6
- package/src/packlets/spaces/data-space-manager.ts +3 -18
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-N4RGR7MX.mjs.map +0 -7
- package/dist/lib/node/chunk-IG3MUK6Q.cjs.map +0 -7
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
type ProfileDocument,
|
|
26
26
|
} from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
27
27
|
import { type DeviceAdmissionRequest } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
28
|
-
import { type Presence } from '@dxos/teleport-extension-gossip';
|
|
29
28
|
import { trace } from '@dxos/tracing';
|
|
30
29
|
import { type ComplexMap, ComplexSet } from '@dxos/util';
|
|
31
30
|
|
|
@@ -36,7 +35,6 @@ export type IdentityParams = {
|
|
|
36
35
|
deviceKey: PublicKey;
|
|
37
36
|
signer: Signer;
|
|
38
37
|
space: Space;
|
|
39
|
-
presence?: Presence;
|
|
40
38
|
};
|
|
41
39
|
|
|
42
40
|
/**
|
|
@@ -46,7 +44,6 @@ export type IdentityParams = {
|
|
|
46
44
|
export class Identity {
|
|
47
45
|
public readonly space: Space;
|
|
48
46
|
private readonly _signer: Signer;
|
|
49
|
-
private readonly _presence?: Presence;
|
|
50
47
|
private readonly _deviceStateMachine: DeviceStateMachine;
|
|
51
48
|
private readonly _profileStateMachine: ProfileStateMachine;
|
|
52
49
|
public readonly authVerifier: TrustedKeySetAuthVerifier;
|
|
@@ -56,10 +53,9 @@ export class Identity {
|
|
|
56
53
|
|
|
57
54
|
public readonly stateUpdate = new Event();
|
|
58
55
|
|
|
59
|
-
constructor({ space, signer, identityKey, deviceKey
|
|
56
|
+
constructor({ space, signer, identityKey, deviceKey }: IdentityParams) {
|
|
60
57
|
this.space = space;
|
|
61
58
|
this._signer = signer;
|
|
62
|
-
this._presence = presence;
|
|
63
59
|
|
|
64
60
|
this.identityKey = identityKey;
|
|
65
61
|
this.deviceKey = deviceKey;
|
|
@@ -132,10 +128,6 @@ export class Identity {
|
|
|
132
128
|
return this._deviceStateMachine.deviceCredentialChain;
|
|
133
129
|
}
|
|
134
130
|
|
|
135
|
-
get presence() {
|
|
136
|
-
return this._presence;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
131
|
/**
|
|
140
132
|
* Issues credentials as identity.
|
|
141
133
|
* Requires identity to be ready.
|
|
@@ -31,21 +31,15 @@ import { BlobStore } from '@dxos/teleport-extension-object-sync';
|
|
|
31
31
|
import { trace as Trace } from '@dxos/tracing';
|
|
32
32
|
import { safeInstanceof } from '@dxos/util';
|
|
33
33
|
|
|
34
|
-
import {
|
|
35
|
-
type CreateIdentityOptions,
|
|
36
|
-
IdentityManager,
|
|
37
|
-
type IdentityManagerRuntimeParams,
|
|
38
|
-
type JoinIdentityParams,
|
|
39
|
-
} from '../identity';
|
|
34
|
+
import { type CreateIdentityOptions, IdentityManager, type JoinIdentityParams } from '../identity';
|
|
40
35
|
import {
|
|
41
36
|
DeviceInvitationProtocol,
|
|
42
37
|
InvitationsHandler,
|
|
43
38
|
type InvitationProtocol,
|
|
44
39
|
SpaceInvitationProtocol,
|
|
45
40
|
} from '../invitations';
|
|
46
|
-
import { DataSpaceManager, type
|
|
41
|
+
import { DataSpaceManager, type SigningContext } from '../spaces';
|
|
47
42
|
|
|
48
|
-
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams;
|
|
49
43
|
/**
|
|
50
44
|
* Shared backend for all client services.
|
|
51
45
|
*/
|
|
@@ -86,7 +80,6 @@ export class ServiceContext {
|
|
|
86
80
|
public readonly networkManager: NetworkManager,
|
|
87
81
|
public readonly signalManager: SignalManager,
|
|
88
82
|
public readonly modelFactory: ModelFactory,
|
|
89
|
-
public readonly _runtimeParams?: IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams,
|
|
90
83
|
) {
|
|
91
84
|
// TODO(burdon): Move strings to constants.
|
|
92
85
|
this.metadataStore = new MetadataStore(storage.createDirectory('metadata'));
|
|
@@ -114,13 +107,7 @@ export class ServiceContext {
|
|
|
114
107
|
snapshotStore: this.snapshotStore,
|
|
115
108
|
});
|
|
116
109
|
|
|
117
|
-
this.identityManager = new IdentityManager(
|
|
118
|
-
this.metadataStore,
|
|
119
|
-
this.keyring,
|
|
120
|
-
this.feedStore,
|
|
121
|
-
this.spaceManager,
|
|
122
|
-
this._runtimeParams as IdentityManagerRuntimeParams,
|
|
123
|
-
);
|
|
110
|
+
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager);
|
|
124
111
|
|
|
125
112
|
this.automergeHost = new AutomergeHost(storage.createDirectory('automerge'));
|
|
126
113
|
|
|
@@ -234,7 +221,6 @@ export class ServiceContext {
|
|
|
234
221
|
signingContext,
|
|
235
222
|
this.feedStore,
|
|
236
223
|
this.automergeHost,
|
|
237
|
-
this._runtimeParams as DataSpaceManagerRuntimeParams,
|
|
238
224
|
);
|
|
239
225
|
await this.dataSpaceManager.open();
|
|
240
226
|
|
|
@@ -24,7 +24,7 @@ import { assignDeep } from '@dxos/util';
|
|
|
24
24
|
import { WebsocketRpcClient } from '@dxos/websocket-rpc';
|
|
25
25
|
|
|
26
26
|
import { createDiagnostics } from './diagnostics';
|
|
27
|
-
import { ServiceContext
|
|
27
|
+
import { ServiceContext } from './service-context';
|
|
28
28
|
import { ServiceRegistry } from './service-registry';
|
|
29
29
|
import { DevicesServiceImpl } from '../devices';
|
|
30
30
|
import { DevtoolsServiceImpl, DevtoolsHostEvents } from '../devtools';
|
|
@@ -54,7 +54,6 @@ export type ClientServicesHostParams = {
|
|
|
54
54
|
storage?: Storage;
|
|
55
55
|
lockKey?: string;
|
|
56
56
|
callbacks?: ClientServicesHostCallbacks;
|
|
57
|
-
runtimeParams?: ServiceContextRuntimeParams;
|
|
58
57
|
};
|
|
59
58
|
|
|
60
59
|
export type ClientServicesHostCallbacks = {
|
|
@@ -89,7 +88,6 @@ export class ClientServicesHost {
|
|
|
89
88
|
private _devtoolsProxy?: WebsocketRpcClient<{}, ClientServices>;
|
|
90
89
|
|
|
91
90
|
private _serviceContext!: ServiceContext;
|
|
92
|
-
private readonly _runtimeParams?: ServiceContextRuntimeParams;
|
|
93
91
|
|
|
94
92
|
@Trace.info()
|
|
95
93
|
private _opening = false;
|
|
@@ -106,12 +104,10 @@ export class ClientServicesHost {
|
|
|
106
104
|
// TODO(wittjosiah): Turn this on by default.
|
|
107
105
|
lockKey,
|
|
108
106
|
callbacks,
|
|
109
|
-
runtimeParams,
|
|
110
107
|
}: ClientServicesHostParams = {}) {
|
|
111
108
|
this._storage = storage;
|
|
112
109
|
this._modelFactory = modelFactory;
|
|
113
110
|
this._callbacks = callbacks;
|
|
114
|
-
this._runtimeParams = runtimeParams;
|
|
115
111
|
|
|
116
112
|
if (config) {
|
|
117
113
|
this.initialize({ config, transportFactory, signalManager });
|
|
@@ -243,7 +239,6 @@ export class ClientServicesHost {
|
|
|
243
239
|
this._networkManager,
|
|
244
240
|
this._signalManager,
|
|
245
241
|
this._modelFactory,
|
|
246
|
-
this._runtimeParams,
|
|
247
242
|
);
|
|
248
243
|
|
|
249
244
|
this._serviceRegistry.setServices({
|
|
@@ -59,11 +59,6 @@ export type AcceptSpaceOptions = {
|
|
|
59
59
|
dataTimeframe?: Timeframe;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
export type DataSpaceManagerRuntimeParams = {
|
|
63
|
-
spaceMemberPresenceAnnounceInterval?: number;
|
|
64
|
-
spaceMemberPresenceOfflineTimeout?: number;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
62
|
@trackLeaks('open', 'close')
|
|
68
63
|
export class DataSpaceManager {
|
|
69
64
|
private readonly _ctx = new Context();
|
|
@@ -74,8 +69,6 @@ export class DataSpaceManager {
|
|
|
74
69
|
|
|
75
70
|
private _isOpen = false;
|
|
76
71
|
private readonly _instanceId = PublicKey.random().toHex();
|
|
77
|
-
private readonly _spaceMemberPresenceAnnounceInterval: number;
|
|
78
|
-
private readonly _spaceMemberPresenceOfflineTimeout: number;
|
|
79
72
|
|
|
80
73
|
constructor(
|
|
81
74
|
private readonly _spaceManager: SpaceManager,
|
|
@@ -85,15 +78,7 @@ export class DataSpaceManager {
|
|
|
85
78
|
private readonly _signingContext: SigningContext,
|
|
86
79
|
private readonly _feedStore: FeedStore<FeedMessage>,
|
|
87
80
|
private readonly _automergeHost: AutomergeHost,
|
|
88
|
-
|
|
89
|
-
) {
|
|
90
|
-
const {
|
|
91
|
-
spaceMemberPresenceAnnounceInterval = PRESENCE_ANNOUNCE_INTERVAL,
|
|
92
|
-
spaceMemberPresenceOfflineTimeout = PRESENCE_OFFLINE_TIMEOUT,
|
|
93
|
-
} = params ?? {};
|
|
94
|
-
this._spaceMemberPresenceAnnounceInterval = spaceMemberPresenceAnnounceInterval;
|
|
95
|
-
this._spaceMemberPresenceOfflineTimeout = spaceMemberPresenceOfflineTimeout;
|
|
96
|
-
}
|
|
81
|
+
) {}
|
|
97
82
|
|
|
98
83
|
// TODO(burdon): Remove.
|
|
99
84
|
get spaces() {
|
|
@@ -219,8 +204,8 @@ export class DataSpaceManager {
|
|
|
219
204
|
localPeerId: this._signingContext.deviceKey,
|
|
220
205
|
});
|
|
221
206
|
const presence = new Presence({
|
|
222
|
-
announceInterval:
|
|
223
|
-
offlineTimeout:
|
|
207
|
+
announceInterval: PRESENCE_ANNOUNCE_INTERVAL,
|
|
208
|
+
offlineTimeout: PRESENCE_OFFLINE_TIMEOUT, // TODO(burdon): Config.
|
|
224
209
|
identityKey: this._signingContext.identityKey,
|
|
225
210
|
gossip,
|
|
226
211
|
});
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.4.7-main.
|
|
1
|
+
export const DXOS_VERSION = "0.4.7-main.6b81200";
|