@dxos/client-services 0.4.10-main.b39148d → 0.4.10-main.b3cf40d
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-W4HHBGR4.mjs → chunk-4ECD5R24.mjs} +44 -39
- package/dist/lib/browser/{chunk-W4HHBGR4.mjs.map → chunk-4ECD5R24.mjs.map} +3 -3
- 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-UW65NO7Q.cjs → chunk-OYV4Y6T4.cjs} +44 -39
- package/dist/lib/node/{chunk-UW65NO7Q.cjs.map → chunk-OYV4Y6T4.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +37 -37
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +6 -6
- package/dist/types/src/packlets/indexing/util.d.ts +2 -2
- package/dist/types/src/packlets/indexing/util.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -34
- package/src/packlets/indexing/util.ts +4 -4
- package/src/packlets/services/service-context.ts +3 -3
- package/src/packlets/services/service-host.ts +11 -7
- package/src/version.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.4.10-main.
|
|
3
|
+
"version": "0.4.10-main.b3cf40d",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -22,43 +22,43 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"platform": "^1.3.6",
|
|
25
|
-
"@dxos/
|
|
26
|
-
"@dxos/
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/codec-protobuf": "0.4.10-main.
|
|
29
|
-
"@dxos/config": "0.4.10-main.
|
|
30
|
-
"@dxos/context": "0.4.10-main.
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/debug": "0.4.10-main.
|
|
34
|
-
"@dxos/echo-pipeline": "0.4.10-main.
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/echo-
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/invariant": "0.4.10-main.
|
|
40
|
-
"@dxos/keyring": "0.4.10-main.
|
|
41
|
-
"@dxos/keys": "0.4.10-main.
|
|
42
|
-
"@dxos/lock-file": "0.4.10-main.
|
|
43
|
-
"@dxos/log": "0.4.10-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/teleport
|
|
51
|
-
"@dxos/teleport": "0.4.10-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
25
|
+
"@dxos/async": "0.4.10-main.b3cf40d",
|
|
26
|
+
"@dxos/client-protocol": "0.4.10-main.b3cf40d",
|
|
27
|
+
"@dxos/automerge": "0.4.10-main.b3cf40d",
|
|
28
|
+
"@dxos/codec-protobuf": "0.4.10-main.b3cf40d",
|
|
29
|
+
"@dxos/config": "0.4.10-main.b3cf40d",
|
|
30
|
+
"@dxos/context": "0.4.10-main.b3cf40d",
|
|
31
|
+
"@dxos/crypto": "0.4.10-main.b3cf40d",
|
|
32
|
+
"@dxos/credentials": "0.4.10-main.b3cf40d",
|
|
33
|
+
"@dxos/debug": "0.4.10-main.b3cf40d",
|
|
34
|
+
"@dxos/echo-pipeline": "0.4.10-main.b3cf40d",
|
|
35
|
+
"@dxos/feed-store": "0.4.10-main.b3cf40d",
|
|
36
|
+
"@dxos/echo-db": "0.4.10-main.b3cf40d",
|
|
37
|
+
"@dxos/echo-schema": "0.4.10-main.b3cf40d",
|
|
38
|
+
"@dxos/indexing": "0.4.10-main.b3cf40d",
|
|
39
|
+
"@dxos/invariant": "0.4.10-main.b3cf40d",
|
|
40
|
+
"@dxos/keyring": "0.4.10-main.b3cf40d",
|
|
41
|
+
"@dxos/keys": "0.4.10-main.b3cf40d",
|
|
42
|
+
"@dxos/lock-file": "0.4.10-main.b3cf40d",
|
|
43
|
+
"@dxos/log": "0.4.10-main.b3cf40d",
|
|
44
|
+
"@dxos/network-manager": "0.4.10-main.b3cf40d",
|
|
45
|
+
"@dxos/node-std": "0.4.10-main.b3cf40d",
|
|
46
|
+
"@dxos/messaging": "0.4.10-main.b3cf40d",
|
|
47
|
+
"@dxos/protocols": "0.4.10-main.b3cf40d",
|
|
48
|
+
"@dxos/rpc": "0.4.10-main.b3cf40d",
|
|
49
|
+
"@dxos/random-access-storage": "0.4.10-main.b3cf40d",
|
|
50
|
+
"@dxos/teleport": "0.4.10-main.b3cf40d",
|
|
51
|
+
"@dxos/teleport-extension-object-sync": "0.4.10-main.b3cf40d",
|
|
52
|
+
"@dxos/timeframe": "0.4.10-main.b3cf40d",
|
|
53
|
+
"@dxos/tracing": "0.4.10-main.b3cf40d",
|
|
54
|
+
"@dxos/websocket-rpc": "0.4.10-main.b3cf40d",
|
|
55
|
+
"@dxos/util": "0.4.10-main.b3cf40d",
|
|
56
|
+
"@dxos/teleport-extension-gossip": "0.4.10-main.b3cf40d"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/platform": "^1.3.4",
|
|
60
60
|
"@types/readable-stream": "^2.3.9",
|
|
61
|
-
"@dxos/signal": "0.4.10-main.
|
|
61
|
+
"@dxos/signal": "0.4.10-main.b3cf40d"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
@@ -12,7 +12,7 @@ import { idCodec } from '@dxos/protocols';
|
|
|
12
12
|
/**
|
|
13
13
|
* Factory for `loadDocuments` iterator.
|
|
14
14
|
*/
|
|
15
|
-
export const
|
|
15
|
+
export const createSelectedDocumentsIterator = (automergeHost: AutomergeHost) =>
|
|
16
16
|
/**
|
|
17
17
|
* Get object data blobs from Automerge Repo by ids.
|
|
18
18
|
* @param ids
|
|
@@ -25,14 +25,14 @@ export const createLoadDocuments = (automergeHost: AutomergeHost) =>
|
|
|
25
25
|
await warnAfterTimeout(5000, 'to long to load doc', () => handle.whenReady());
|
|
26
26
|
const doc = handle.docSync();
|
|
27
27
|
const hash = getHeads(doc).join('');
|
|
28
|
-
yield [{ id, object: doc.objects[objectId], currentHash: hash }];
|
|
28
|
+
yield doc.objects?.[objectId] ? [{ id, object: doc.objects[objectId], currentHash: hash }] : [];
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Factory for `getAllDocuments` iterator.
|
|
34
34
|
*/
|
|
35
|
-
export const
|
|
35
|
+
export const createDocumentsIterator = (automergeHost: AutomergeHost) =>
|
|
36
36
|
/**
|
|
37
37
|
* Recursively get all object data blobs from Automerge Repo.
|
|
38
38
|
* @param ids
|
|
@@ -57,7 +57,7 @@ export const createGetAllDocuments = (automergeHost: AutomergeHost) =>
|
|
|
57
57
|
return {
|
|
58
58
|
id: idCodec.encode({ documentId: handle.documentId, objectId }),
|
|
59
59
|
object,
|
|
60
|
-
currentHash: heads.
|
|
60
|
+
currentHash: heads.join(''),
|
|
61
61
|
};
|
|
62
62
|
});
|
|
63
63
|
}
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
type IdentityManagerRuntimeParams,
|
|
31
31
|
type JoinIdentityParams,
|
|
32
32
|
} from '../identity';
|
|
33
|
-
import {
|
|
33
|
+
import { createDocumentsIterator, createSelectedDocumentsIterator } from '../indexing';
|
|
34
34
|
import {
|
|
35
35
|
DeviceInvitationProtocol,
|
|
36
36
|
InvitationsHandler,
|
|
@@ -125,8 +125,8 @@ export class ServiceContext {
|
|
|
125
125
|
this.indexer = new Indexer({
|
|
126
126
|
indexStore: new IndexStore({ directory: storage.createDirectory('index-store') }),
|
|
127
127
|
metadataStore: this.indexMetadata,
|
|
128
|
-
loadDocuments:
|
|
129
|
-
getAllDocuments:
|
|
128
|
+
loadDocuments: createSelectedDocumentsIterator(this.automergeHost),
|
|
129
|
+
getAllDocuments: createDocumentsIterator(this.automergeHost),
|
|
130
130
|
});
|
|
131
131
|
|
|
132
132
|
this.invitations = new InvitationsHandler(this.networkManager);
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// Copyright 2021 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Event, synchronized } from '@dxos/async';
|
|
6
|
-
import {
|
|
5
|
+
import { Event, sleep, synchronized } from '@dxos/async';
|
|
6
|
+
import { clientServiceBundle, defaultKey, type ClientServices, PropertiesSchema } from '@dxos/client-protocol';
|
|
7
7
|
import { type Config } from '@dxos/config';
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
9
|
import { DataServiceImpl, type SpaceDoc } from '@dxos/echo-pipeline';
|
|
10
|
-
import
|
|
10
|
+
import * as E from '@dxos/echo-schema';
|
|
11
|
+
import { createRawObjectDoc } from '@dxos/echo-schema';
|
|
11
12
|
import { IndexServiceImpl } from '@dxos/indexing';
|
|
12
13
|
import { invariant } from '@dxos/invariant';
|
|
13
14
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -347,17 +348,20 @@ export class ClientServicesHost {
|
|
|
347
348
|
await this._serviceContext.initialized.wait();
|
|
348
349
|
const space = await this._serviceContext.dataSpaceManager!.createSpace();
|
|
349
350
|
|
|
350
|
-
const obj: TypedObject = new Properties(undefined);
|
|
351
|
-
obj[defaultKey] = identity.identityKey.toHex();
|
|
352
|
-
|
|
353
351
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
354
352
|
invariant(automergeIndex);
|
|
355
353
|
const document = await this._serviceContext.automergeHost.repo.find<SpaceDoc>(automergeIndex as any);
|
|
356
354
|
await document.whenReady();
|
|
357
355
|
|
|
356
|
+
const objectDocument = createRawObjectDoc(
|
|
357
|
+
{ [defaultKey]: identity.identityKey.toHex() },
|
|
358
|
+
{ type: E.getTypeReference(PropertiesSchema) },
|
|
359
|
+
);
|
|
358
360
|
document.change((doc: SpaceDoc) => {
|
|
359
|
-
assignDeep(doc, ['objects',
|
|
361
|
+
assignDeep(doc, ['objects', objectDocument.id], objectDocument.handle.docSync());
|
|
360
362
|
});
|
|
363
|
+
// TODO: replace with flush when supported by automerge-repo
|
|
364
|
+
await sleep(200);
|
|
361
365
|
|
|
362
366
|
return identity;
|
|
363
367
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.4.10-main.
|
|
1
|
+
export const DXOS_VERSION = "0.4.10-main.b3cf40d";
|