@dxos/client-services 0.4.5-main.f8d6c4e → 0.4.5-next.ea4f804
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-24GIRJ7Q.mjs → chunk-XFVKJNDO.mjs} +65 -33
- package/dist/lib/browser/chunk-XFVKJNDO.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-FVRRSRLI.cjs → chunk-YHMPI5TG.cjs} +167 -135
- package/dist/lib/node/chunk-YHMPI5TG.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/identity/identity-manager.d.ts +3 -1
- package/dist/types/src/packlets/identity/identity-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 +12 -1
- package/src/packlets/devices/devices-service.ts +1 -1
- package/src/packlets/identity/identity-manager.test.ts +19 -0
- package/src/packlets/identity/identity-manager.ts +27 -1
- package/src/packlets/services/service-host.ts +3 -3
- package/src/packlets/spaces/data-space-manager.ts +1 -1
- package/src/packlets/spaces/data-space.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-24GIRJ7Q.mjs.map +0 -7
- package/dist/lib/node/chunk-FVRRSRLI.cjs.map +0 -7
|
@@ -31,7 +31,7 @@ __export(testing_exports, {
|
|
|
31
31
|
syncItemsLocal: () => syncItemsLocal
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(testing_exports);
|
|
34
|
-
var
|
|
34
|
+
var import_chunk_YHMPI5TG = require("../../chunk-YHMPI5TG.cjs");
|
|
35
35
|
var import_credentials = require("@dxos/credentials");
|
|
36
36
|
var import_keys = require("@dxos/keys");
|
|
37
37
|
var import_async = require("@dxos/async");
|
|
@@ -209,7 +209,7 @@ var createInvitation = (host, options) => {
|
|
|
209
209
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
210
210
|
...options ?? {}
|
|
211
211
|
};
|
|
212
|
-
if (host instanceof
|
|
212
|
+
if (host instanceof import_chunk_YHMPI5TG.ServiceContext) {
|
|
213
213
|
const hostHandler = host.getInvitationHandler({
|
|
214
214
|
kind: import_services.Invitation.Kind.SPACE,
|
|
215
215
|
...options
|
|
@@ -220,7 +220,7 @@ var createInvitation = (host, options) => {
|
|
|
220
220
|
};
|
|
221
221
|
var acceptInvitation = (guest, invitation) => {
|
|
222
222
|
invitation = sanitizeInvitation(invitation);
|
|
223
|
-
if (guest instanceof
|
|
223
|
+
if (guest instanceof import_chunk_YHMPI5TG.ServiceContext) {
|
|
224
224
|
const guestHandler = guest.getInvitationHandler({
|
|
225
225
|
kind: invitation.kind
|
|
226
226
|
});
|
|
@@ -229,7 +229,7 @@ var acceptInvitation = (guest, invitation) => {
|
|
|
229
229
|
return guest.join(invitation);
|
|
230
230
|
};
|
|
231
231
|
var createServiceHost = (config, signalManagerContext) => {
|
|
232
|
-
return new
|
|
232
|
+
return new import_chunk_YHMPI5TG.ClientServicesHost({
|
|
233
233
|
config,
|
|
234
234
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
235
235
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -243,8 +243,8 @@ var createServiceContext = ({ signalContext = new import_messaging.MemorySignalM
|
|
|
243
243
|
signalManager,
|
|
244
244
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
245
245
|
});
|
|
246
|
-
const modelFactory = (0,
|
|
247
|
-
return new
|
|
246
|
+
const modelFactory = (0, import_chunk_YHMPI5TG.createDefaultModelFactory)();
|
|
247
|
+
return new import_chunk_YHMPI5TG.ServiceContext(storage, networkManager, signalManager, modelFactory);
|
|
248
248
|
};
|
|
249
249
|
var createPeers = async (numPeers) => {
|
|
250
250
|
const signalContext = new import_messaging.MemorySignalManagerContext();
|
|
@@ -328,7 +328,7 @@ var TestPeer = class {
|
|
|
328
328
|
feedStore: this.feedStore,
|
|
329
329
|
networkManager: this.networkManager,
|
|
330
330
|
metadataStore: this.metadataStore,
|
|
331
|
-
modelFactory: (0,
|
|
331
|
+
modelFactory: (0, import_chunk_YHMPI5TG.createDefaultModelFactory)(),
|
|
332
332
|
snapshotStore: this.snapshotStore,
|
|
333
333
|
blobStore: this.blobStore
|
|
334
334
|
});
|
|
@@ -340,7 +340,7 @@ var TestPeer = class {
|
|
|
340
340
|
return this._props.automergeHost ??= new import_echo_pipeline.AutomergeHost(this.storage.createDirectory("automerge"));
|
|
341
341
|
}
|
|
342
342
|
get dataSpaceManager() {
|
|
343
|
-
return this._props.dataSpaceManager ??= new
|
|
343
|
+
return this._props.dataSpaceManager ??= new import_chunk_YHMPI5TG.DataSpaceManager(this.spaceManager, this.metadataStore, new import_echo_pipeline.DataServiceSubscriptions(), this.keyring, this.identity, this.feedStore, this.automergeHost);
|
|
344
344
|
}
|
|
345
345
|
async createIdentity() {
|
|
346
346
|
this._props.signingContext ??= await createSigningContext(this.keyring);
|
|
@@ -4,8 +4,9 @@ import { type MetadataStore, type SpaceManager } from '@dxos/echo-pipeline';
|
|
|
4
4
|
import { type FeedStore } from '@dxos/feed-store';
|
|
5
5
|
import { type Keyring } from '@dxos/keyring';
|
|
6
6
|
import { PublicKey } from '@dxos/keys';
|
|
7
|
+
import { type Device } from '@dxos/protocols/proto/dxos/client/services';
|
|
7
8
|
import { type FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
8
|
-
import { type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
9
|
+
import { type DeviceProfileDocument, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
9
10
|
import { Timeframe } from '@dxos/timeframe';
|
|
10
11
|
import { Identity } from './identity';
|
|
11
12
|
export type JoinIdentityParams = {
|
|
@@ -44,6 +45,7 @@ export declare class IdentityManager {
|
|
|
44
45
|
* Update the profile document of an existing identity.
|
|
45
46
|
*/
|
|
46
47
|
updateProfile(profile: ProfileDocument): Promise<ProfileDocument>;
|
|
48
|
+
updateDeviceProfile(profile: DeviceProfileDocument): Promise<Device>;
|
|
47
49
|
private _constructIdentity;
|
|
48
50
|
private _constructSpace;
|
|
49
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-manager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,
|
|
1
|
+
{"version":3,"file":"identity-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-manager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,SAAS,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,SAAS,CAAC;IACxB,kBAAkB,EAAE,SAAS,CAAC;IAC9B,cAAc,EAAE,SAAS,CAAC;IAC1B,WAAW,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF,qBACa,eAAe;IAQxB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAVhC,QAAQ,CAAC,WAAW,cAAe;IAEnC,OAAO,CAAC,SAAS,CAAC,CAAW;gBAKV,cAAc,EAAE,aAAa,EAC7B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,SAAS,CAAC,WAAW,CAAC,EAClC,aAAa,EAAE,YAAY;IAG9C,IAAI,QAAQ,yBAEX;IAGK,IAAI,CAAC,GAAG,EAAE,OAAO;IAmBjB,KAAK;IAIL,cAAc,CAAC,EAAE,WAAW,EAAE,GAAE,qBAA0B;IA6EhE;;OAEG;IACG,cAAc,CAAC,MAAM,EAAE,kBAAkB;IA+B/C;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,eAAe;IAiBtC,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;YAqB5D,kBAAkB;YA2ClB,eAAe;CAc9B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.4.5-
|
|
1
|
+
export declare const DXOS_VERSION = "0.4.5-next.ea4f804";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.4.5-
|
|
3
|
+
"version": "0.4.5-next.ea4f804",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -22,44 +22,44 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"platform": "^1.3.6",
|
|
25
|
-
"@dxos/async": "0.4.5-
|
|
26
|
-
"@dxos/codec-protobuf": "0.4.5-
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/crypto": "0.4.5-
|
|
32
|
-
"@dxos/debug": "0.4.5-
|
|
33
|
-
"@dxos/document-model": "0.4.5-
|
|
34
|
-
"@dxos/echo-db": "0.4.5-
|
|
35
|
-
"@dxos/echo-
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/keys": "0.4.5-
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/network-manager": "0.4.5-
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/teleport-extension-gossip": "0.4.5-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/tracing": "0.4.5-
|
|
56
|
-
"@dxos/util": "0.4.5-
|
|
57
|
-
"@dxos/websocket-rpc": "0.4.5-
|
|
25
|
+
"@dxos/async": "0.4.5-next.ea4f804",
|
|
26
|
+
"@dxos/codec-protobuf": "0.4.5-next.ea4f804",
|
|
27
|
+
"@dxos/config": "0.4.5-next.ea4f804",
|
|
28
|
+
"@dxos/context": "0.4.5-next.ea4f804",
|
|
29
|
+
"@dxos/client-protocol": "0.4.5-next.ea4f804",
|
|
30
|
+
"@dxos/credentials": "0.4.5-next.ea4f804",
|
|
31
|
+
"@dxos/crypto": "0.4.5-next.ea4f804",
|
|
32
|
+
"@dxos/debug": "0.4.5-next.ea4f804",
|
|
33
|
+
"@dxos/document-model": "0.4.5-next.ea4f804",
|
|
34
|
+
"@dxos/echo-db": "0.4.5-next.ea4f804",
|
|
35
|
+
"@dxos/echo-schema": "0.4.5-next.ea4f804",
|
|
36
|
+
"@dxos/feed-store": "0.4.5-next.ea4f804",
|
|
37
|
+
"@dxos/echo-pipeline": "0.4.5-next.ea4f804",
|
|
38
|
+
"@dxos/keyring": "0.4.5-next.ea4f804",
|
|
39
|
+
"@dxos/invariant": "0.4.5-next.ea4f804",
|
|
40
|
+
"@dxos/keys": "0.4.5-next.ea4f804",
|
|
41
|
+
"@dxos/lock-file": "0.4.5-next.ea4f804",
|
|
42
|
+
"@dxos/log": "0.4.5-next.ea4f804",
|
|
43
|
+
"@dxos/model-factory": "0.4.5-next.ea4f804",
|
|
44
|
+
"@dxos/messaging": "0.4.5-next.ea4f804",
|
|
45
|
+
"@dxos/network-manager": "0.4.5-next.ea4f804",
|
|
46
|
+
"@dxos/protocols": "0.4.5-next.ea4f804",
|
|
47
|
+
"@dxos/random-access-storage": "0.4.5-next.ea4f804",
|
|
48
|
+
"@dxos/node-std": "0.4.5-next.ea4f804",
|
|
49
|
+
"@dxos/teleport": "0.4.5-next.ea4f804",
|
|
50
|
+
"@dxos/teleport-extension-gossip": "0.4.5-next.ea4f804",
|
|
51
|
+
"@dxos/rpc": "0.4.5-next.ea4f804",
|
|
52
|
+
"@dxos/text-model": "0.4.5-next.ea4f804",
|
|
53
|
+
"@dxos/timeframe": "0.4.5-next.ea4f804",
|
|
54
|
+
"@dxos/teleport-extension-object-sync": "0.4.5-next.ea4f804",
|
|
55
|
+
"@dxos/tracing": "0.4.5-next.ea4f804",
|
|
56
|
+
"@dxos/util": "0.4.5-next.ea4f804",
|
|
57
|
+
"@dxos/websocket-rpc": "0.4.5-next.ea4f804"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/platform": "^1.3.4",
|
|
61
61
|
"@types/readable-stream": "^2.3.9",
|
|
62
|
-
"@dxos/signal": "0.4.5-
|
|
62
|
+
"@dxos/signal": "0.4.5-next.ea4f804"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
@@ -27,7 +27,18 @@ describe('DevicesService', () => {
|
|
|
27
27
|
await serviceContext.close();
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
describe
|
|
30
|
+
describe('updateDevice', () => {
|
|
31
|
+
test.skip('updates device profile', async () => {
|
|
32
|
+
const query = devicesService.queryDevices();
|
|
33
|
+
const device = await devicesService.updateDevice({ label: 'test-device' });
|
|
34
|
+
const result = new Trigger<Device[] | undefined>();
|
|
35
|
+
query.subscribe(({ devices }) => {
|
|
36
|
+
result.wake(devices);
|
|
37
|
+
});
|
|
38
|
+
afterTest(() => query.close());
|
|
39
|
+
expect(device.profile?.label).to.equal('test-device');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
31
42
|
|
|
32
43
|
describe('queryDevices', () => {
|
|
33
44
|
test('returns empty list if no identity is available', async () => {
|
|
@@ -18,7 +18,7 @@ export class DevicesServiceImpl implements DevicesService {
|
|
|
18
18
|
constructor(private readonly _identityManager: IdentityManager) {}
|
|
19
19
|
|
|
20
20
|
async updateDevice(profile: DeviceProfileDocument): Promise<Device> {
|
|
21
|
-
|
|
21
|
+
return this._identityManager.updateDeviceProfile(profile);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
queryDevices(): Stream<QueryDevicesResponse> {
|
|
@@ -163,4 +163,23 @@ describe('identity/identity-manager', () => {
|
|
|
163
163
|
|
|
164
164
|
expect(!!identity.authorizedDeviceKeys.get(identity.deviceKey)?.platform).is.true;
|
|
165
165
|
});
|
|
166
|
+
|
|
167
|
+
test('updates device profile', async () => {
|
|
168
|
+
const signalContext = new MemorySignalManagerContext();
|
|
169
|
+
|
|
170
|
+
const peer = await setupPeer({ signalContext });
|
|
171
|
+
|
|
172
|
+
const identity = await peer.identityManager.createIdentity();
|
|
173
|
+
|
|
174
|
+
// Note: Waiting for device profile credential to be processed.
|
|
175
|
+
await identity.stateUpdate.waitForCount(1);
|
|
176
|
+
|
|
177
|
+
const deviceProfile = identity.authorizedDeviceKeys.get(identity.deviceKey);
|
|
178
|
+
expect(deviceProfile).to.exist;
|
|
179
|
+
|
|
180
|
+
deviceProfile!.label = 'updated profile';
|
|
181
|
+
await peer.identityManager.updateDeviceProfile(deviceProfile!);
|
|
182
|
+
|
|
183
|
+
expect(identity.authorizedDeviceKeys.get(identity.deviceKey)?.label).to.equal('updated profile');
|
|
184
|
+
});
|
|
166
185
|
});
|
|
@@ -14,9 +14,14 @@ import { type Keyring } from '@dxos/keyring';
|
|
|
14
14
|
import { PublicKey } from '@dxos/keys';
|
|
15
15
|
import { log } from '@dxos/log';
|
|
16
16
|
import { trace } from '@dxos/protocols';
|
|
17
|
+
import { type Device, DeviceKind } from '@dxos/protocols/proto/dxos/client/services';
|
|
17
18
|
import { type FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
18
19
|
import { type IdentityRecord, type SpaceMetadata } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
19
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
AdmittedFeed,
|
|
22
|
+
type DeviceProfileDocument,
|
|
23
|
+
type ProfileDocument,
|
|
24
|
+
} from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
20
25
|
import { Timeframe } from '@dxos/timeframe';
|
|
21
26
|
import { trace as Trace } from '@dxos/tracing';
|
|
22
27
|
import { deferFunction } from '@dxos/util';
|
|
@@ -224,6 +229,27 @@ export class IdentityManager {
|
|
|
224
229
|
return profile;
|
|
225
230
|
}
|
|
226
231
|
|
|
232
|
+
async updateDeviceProfile(profile: DeviceProfileDocument): Promise<Device> {
|
|
233
|
+
invariant(this._identity, 'Identity not initialized.');
|
|
234
|
+
|
|
235
|
+
// TODO(nf): CredentialGenerator doesn't work when not updating own device.
|
|
236
|
+
// const generator = new CredentialGenerator(this._keyring, this._identity.identityKey, this._identity.deviceKey);
|
|
237
|
+
// const credential = await generator.createDeviceProfile(profile);
|
|
238
|
+
|
|
239
|
+
const credential = await this._identity.getIdentityCredentialSigner().createCredential({
|
|
240
|
+
subject: this._identity.deviceKey,
|
|
241
|
+
assertion: {
|
|
242
|
+
'@type': 'dxos.halo.credentials.DeviceProfile',
|
|
243
|
+
profile,
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const receipt = await this._identity.controlPipeline.writer.write({ credential: { credential } });
|
|
248
|
+
await this._identity.controlPipeline.state.waitUntilTimeframe(new Timeframe([[receipt.feedKey, receipt.seq]]));
|
|
249
|
+
this.stateUpdate.emit();
|
|
250
|
+
return { deviceKey: this._identity.deviceKey, kind: DeviceKind.CURRENT, profile };
|
|
251
|
+
}
|
|
252
|
+
|
|
227
253
|
private async _constructIdentity(identityRecord: IdentityRecord) {
|
|
228
254
|
invariant(!this._identity);
|
|
229
255
|
log('constructing identity', { identityRecord });
|
|
@@ -8,7 +8,7 @@ import { type Config } from '@dxos/config';
|
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
9
|
import { DocumentModel } from '@dxos/document-model';
|
|
10
10
|
import { DataServiceImpl } from '@dxos/echo-pipeline';
|
|
11
|
-
import { type TypedObject, base, getRawDoc, type
|
|
11
|
+
import { type TypedObject, base, getRawDoc, type DocStructure } from '@dxos/echo-schema';
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
13
|
import { PublicKey } from '@dxos/keys';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
@@ -348,10 +348,10 @@ export class ClientServicesHost {
|
|
|
348
348
|
|
|
349
349
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
350
350
|
invariant(automergeIndex);
|
|
351
|
-
const document = await this._serviceContext.automergeHost.repo.find<
|
|
351
|
+
const document = await this._serviceContext.automergeHost.repo.find<DocStructure>(automergeIndex as any);
|
|
352
352
|
await document.whenReady();
|
|
353
353
|
|
|
354
|
-
document.change((doc:
|
|
354
|
+
document.change((doc: DocStructure) => {
|
|
355
355
|
assignDeep(doc, ['objects', obj[base]._id], getRawDoc(obj).handle.docSync());
|
|
356
356
|
});
|
|
357
357
|
|
|
@@ -143,7 +143,7 @@ export class DataSpaceManager {
|
|
|
143
143
|
|
|
144
144
|
const automergeRoot = this._automergeHost.repo.create();
|
|
145
145
|
automergeRoot.change((doc: any) => {
|
|
146
|
-
doc.
|
|
146
|
+
doc.experimental_spaceKey = spaceKey.toHex();
|
|
147
147
|
});
|
|
148
148
|
|
|
149
149
|
const space = await this._constructSpace(metadata);
|
|
@@ -391,9 +391,9 @@ export class DataSpace {
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
const doc = handle.docSync() ?? failedInvariant();
|
|
394
|
-
if (!doc.
|
|
394
|
+
if (!doc.experimental_spaceKey) {
|
|
395
395
|
handle.change((doc: any) => {
|
|
396
|
-
doc.
|
|
396
|
+
doc.experimental_spaceKey = this.key.toHex();
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
} catch (err) {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.4.5-
|
|
1
|
+
export const DXOS_VERSION = "0.4.5-next.ea4f804";
|