@dxos/client-services 0.9.1-main.c7dcc2e112 → 0.10.0
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-7KG6VMEU.mjs → chunk-XU5R2BMF.mjs} +60 -54
- package/dist/lib/browser/chunk-XU5R2BMF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +3 -3
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{chunk-KG56NFCZ.mjs → chunk-H5YTUD35.mjs} +60 -54
- package/dist/lib/node-esm/chunk-H5YTUD35.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +3 -3
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/sqlite-storage.d.ts +1 -1
- package/dist/types/src/packlets/services/sqlite-storage.d.ts.map +1 -1
- package/dist/types/src/packlets/space-export/serialized-space-writer.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +42 -42
- package/src/packlets/agents/edge-agent-manager.ts +2 -2
- package/src/packlets/identity/identity-manager.test.ts +1 -1
- package/src/packlets/identity/identity.test.ts +4 -4
- package/src/packlets/identity/identity.ts +7 -7
- package/src/packlets/invitations/invitations-manager.ts +1 -1
- package/src/packlets/services/feed-syncer.test.ts +1 -1
- package/src/packlets/services/feed-syncer.ts +2 -2
- package/src/packlets/services/service-context.ts +3 -3
- package/src/packlets/services/service-host.ts +1 -1
- package/src/packlets/services/sqlite-storage.ts +18 -8
- package/src/packlets/space-export/serialized-space-writer.ts +1 -1
- package/src/packlets/space-export/space-archive.test.ts +8 -8
- package/src/packlets/spaces/data-space-manager.test.ts +1 -1
- package/src/packlets/spaces/data-space-manager.ts +2 -2
- package/src/packlets/spaces/data-space.ts +8 -8
- package/src/packlets/spaces/edge-feed-replicator.ts +1 -1
- package/src/packlets/spaces/genesis.ts +20 -20
- package/src/packlets/spaces/spaces-service.ts +3 -3
- package/src/packlets/storage/profile-archive-sqlite.test.ts +1 -1
- package/src/packlets/testing/credential-utils.ts +2 -2
- package/src/version.ts +5 -1
- package/dist/lib/browser/chunk-7KG6VMEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KG56NFCZ.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -52,57 +52,57 @@
|
|
|
52
52
|
"src"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@automerge/automerge": "3.3.0-fragments.
|
|
56
|
-
"@automerge/automerge-repo": "2.6.0-subduction.
|
|
55
|
+
"@automerge/automerge": "3.3.0-fragments.2",
|
|
56
|
+
"@automerge/automerge-repo": "2.6.0-subduction.37",
|
|
57
57
|
"@effect/experimental": "0.60.0",
|
|
58
58
|
"@effect/sql": "0.51.1",
|
|
59
59
|
"@obsidize/tar-browserify": "^5.2.0",
|
|
60
60
|
"cbor-x": "^1.5.4",
|
|
61
|
-
"effect": "3.21.
|
|
61
|
+
"effect": "3.21.4",
|
|
62
62
|
"platform": "^1.3.6",
|
|
63
|
-
"@dxos/async": "0.
|
|
64
|
-
"@dxos/client-protocol": "0.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/context": "0.
|
|
68
|
-
"@dxos/credentials": "0.
|
|
69
|
-
"@dxos/crypto": "0.
|
|
70
|
-
"@dxos/debug": "0.
|
|
71
|
-
"@dxos/echo
|
|
72
|
-
"@dxos/echo": "0.
|
|
73
|
-
"@dxos/echo-host": "0.
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/edge-client": "0.
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/feed": "0.
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/kv-store": "0.
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/network-manager": "0.
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/teleport
|
|
93
|
-
"@dxos/teleport-extension-
|
|
94
|
-
"@dxos/
|
|
95
|
-
"@dxos/tracing": "0.
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/
|
|
98
|
-
"@dxos/websocket-rpc": "0.
|
|
63
|
+
"@dxos/async": "0.10.0",
|
|
64
|
+
"@dxos/client-protocol": "0.10.0",
|
|
65
|
+
"@dxos/config": "0.10.0",
|
|
66
|
+
"@dxos/codec-protobuf": "0.10.0",
|
|
67
|
+
"@dxos/context": "0.10.0",
|
|
68
|
+
"@dxos/credentials": "0.10.0",
|
|
69
|
+
"@dxos/crypto": "0.10.0",
|
|
70
|
+
"@dxos/debug": "0.10.0",
|
|
71
|
+
"@dxos/echo": "0.10.0",
|
|
72
|
+
"@dxos/echo-client": "0.10.0",
|
|
73
|
+
"@dxos/echo-host": "0.10.0",
|
|
74
|
+
"@dxos/echo-protocol": "0.10.0",
|
|
75
|
+
"@dxos/edge-client": "0.10.0",
|
|
76
|
+
"@dxos/effect": "0.10.0",
|
|
77
|
+
"@dxos/feed": "0.10.0",
|
|
78
|
+
"@dxos/feed-store": "0.10.0",
|
|
79
|
+
"@dxos/invariant": "0.10.0",
|
|
80
|
+
"@dxos/keys": "0.10.0",
|
|
81
|
+
"@dxos/keyring": "0.10.0",
|
|
82
|
+
"@dxos/kv-store": "0.10.0",
|
|
83
|
+
"@dxos/lock-file": "0.10.0",
|
|
84
|
+
"@dxos/messaging": "0.10.0",
|
|
85
|
+
"@dxos/network-manager": "0.10.0",
|
|
86
|
+
"@dxos/log": "0.10.0",
|
|
87
|
+
"@dxos/node-std": "0.10.0",
|
|
88
|
+
"@dxos/protocols": "0.10.0",
|
|
89
|
+
"@dxos/random-access-storage": "0.10.0",
|
|
90
|
+
"@dxos/rpc": "0.10.0",
|
|
91
|
+
"@dxos/sql-sqlite": "0.10.0",
|
|
92
|
+
"@dxos/teleport": "0.10.0",
|
|
93
|
+
"@dxos/teleport-extension-gossip": "0.10.0",
|
|
94
|
+
"@dxos/teleport-extension-object-sync": "0.10.0",
|
|
95
|
+
"@dxos/tracing": "0.10.0",
|
|
96
|
+
"@dxos/timeframe": "0.10.0",
|
|
97
|
+
"@dxos/util": "0.10.0",
|
|
98
|
+
"@dxos/websocket-rpc": "0.10.0"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@types/platform": "^1.3.4",
|
|
102
102
|
"@types/readable-stream": "^2.3.9",
|
|
103
103
|
"get-port-please": "^3.1.1",
|
|
104
|
-
"@dxos/signal": "0.
|
|
105
|
-
"@dxos/test-utils": "0.
|
|
104
|
+
"@dxos/signal": "0.10.0",
|
|
105
|
+
"@dxos/test-utils": "0.10.0"
|
|
106
106
|
},
|
|
107
107
|
"publishConfig": {
|
|
108
108
|
"access": "public"
|
|
@@ -57,7 +57,7 @@ export class EdgeAgentManager extends Resource {
|
|
|
57
57
|
invariant(this._edgeFeatures?.agents);
|
|
58
58
|
|
|
59
59
|
const response = await this._edgeHttpClient.createAgent(ctx, {
|
|
60
|
-
|
|
60
|
+
identityDid: this._identity.did,
|
|
61
61
|
haloSpaceId: this._identity.haloSpaceId,
|
|
62
62
|
haloSpaceKey: this._identity.haloSpaceKey.toHex(),
|
|
63
63
|
});
|
|
@@ -123,7 +123,7 @@ export class EdgeAgentManager extends Resource {
|
|
|
123
123
|
try {
|
|
124
124
|
log('fetching agent status');
|
|
125
125
|
const { agent } = await this._edgeHttpClient.getAgentStatus(ctx, {
|
|
126
|
-
|
|
126
|
+
ownerIdentityDid: this._identity.did,
|
|
127
127
|
});
|
|
128
128
|
const wasAgentCreatedDuringQuery = this._agentStatus === EdgeAgentStatus.ACTIVE;
|
|
129
129
|
if (!wasAgentCreatedDuringQuery) {
|
|
@@ -124,7 +124,7 @@ describe('identity/identity-manager', () => {
|
|
|
124
124
|
subject: deviceKey,
|
|
125
125
|
assertion: {
|
|
126
126
|
'@type': 'dxos.halo.credentials.AuthorizedDevice',
|
|
127
|
-
identityKey: identity1.identityKey,
|
|
127
|
+
'identityKey': identity1.identityKey,
|
|
128
128
|
deviceKey,
|
|
129
129
|
},
|
|
130
130
|
});
|
|
@@ -8,9 +8,9 @@ import { Event } from '@dxos/async';
|
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
9
|
import { CredentialGenerator, createDidFromIdentityKey, verifyCredential } from '@dxos/credentials';
|
|
10
10
|
import {
|
|
11
|
+
MetadataStore,
|
|
11
12
|
MOCK_AUTH_PROVIDER,
|
|
12
13
|
MOCK_AUTH_VERIFIER,
|
|
13
|
-
MetadataStore,
|
|
14
14
|
Space,
|
|
15
15
|
SpaceProtocol,
|
|
16
16
|
createIdFromSpaceKey,
|
|
@@ -56,7 +56,7 @@ describe('identity/identity', () => {
|
|
|
56
56
|
subject: setup.identityKey,
|
|
57
57
|
assertion: {
|
|
58
58
|
'@type': 'dxos.halo.credentials.IdentityProfile',
|
|
59
|
-
profile: {
|
|
59
|
+
'profile': {
|
|
60
60
|
displayName: 'Alice',
|
|
61
61
|
},
|
|
62
62
|
},
|
|
@@ -93,8 +93,8 @@ describe('identity/identity', () => {
|
|
|
93
93
|
subject: secondDevice.deviceKey,
|
|
94
94
|
assertion: {
|
|
95
95
|
'@type': 'dxos.halo.credentials.AuthorizedDevice',
|
|
96
|
-
identityKey: owner.identityKey,
|
|
97
|
-
deviceKey: secondDevice.deviceKey,
|
|
96
|
+
'identityKey': owner.identityKey,
|
|
97
|
+
'deviceKey': secondDevice.deviceKey,
|
|
98
98
|
},
|
|
99
99
|
}),
|
|
100
100
|
},
|
|
@@ -210,7 +210,7 @@ export class Identity {
|
|
|
210
210
|
subject: deviceKey,
|
|
211
211
|
assertion: {
|
|
212
212
|
'@type': 'dxos.halo.credentials.AuthorizedDevice',
|
|
213
|
-
identityKey: this.identityKey,
|
|
213
|
+
'identityKey': this.identityKey,
|
|
214
214
|
deviceKey,
|
|
215
215
|
},
|
|
216
216
|
});
|
|
@@ -222,20 +222,20 @@ export class Identity {
|
|
|
222
222
|
subject: controlFeedKey,
|
|
223
223
|
assertion: {
|
|
224
224
|
'@type': 'dxos.halo.credentials.AdmittedFeed',
|
|
225
|
-
spaceKey: this.haloSpaceKey,
|
|
225
|
+
'spaceKey': this.haloSpaceKey,
|
|
226
226
|
deviceKey,
|
|
227
|
-
identityKey: this.identityKey,
|
|
228
|
-
designation: AdmittedFeed.Designation.CONTROL,
|
|
227
|
+
'identityKey': this.identityKey,
|
|
228
|
+
'designation': AdmittedFeed.Designation.CONTROL,
|
|
229
229
|
},
|
|
230
230
|
}),
|
|
231
231
|
await signer.createCredential({
|
|
232
232
|
subject: dataFeedKey,
|
|
233
233
|
assertion: {
|
|
234
234
|
'@type': 'dxos.halo.credentials.AdmittedFeed',
|
|
235
|
-
spaceKey: this.haloSpaceKey,
|
|
235
|
+
'spaceKey': this.haloSpaceKey,
|
|
236
236
|
deviceKey,
|
|
237
|
-
identityKey: this.identityKey,
|
|
238
|
-
designation: AdmittedFeed.Designation.DATA,
|
|
237
|
+
'identityKey': this.identityKey,
|
|
238
|
+
'designation': AdmittedFeed.Designation.DATA,
|
|
239
239
|
},
|
|
240
240
|
}),
|
|
241
241
|
].map((credential): FeedMessage.Payload => ({ credential: { credential } })),
|
|
@@ -182,7 +182,7 @@ export class FeedSyncer extends Resource {
|
|
|
182
182
|
this.#edgeClient.onReconnected(async () => {
|
|
183
183
|
log('feed sync edge reconnected', {
|
|
184
184
|
peerKey: this.#edgeClient.peerKey,
|
|
185
|
-
|
|
185
|
+
identityDid: this.#edgeClient.identityDid,
|
|
186
186
|
});
|
|
187
187
|
if (this.#backgroundSync) {
|
|
188
188
|
this.#resetSpacesToPoll();
|
|
@@ -401,7 +401,7 @@ export class FeedSyncer extends Resource {
|
|
|
401
401
|
ctx,
|
|
402
402
|
createBuf(MessageSchema, {
|
|
403
403
|
source: {
|
|
404
|
-
|
|
404
|
+
identityDid: this.#edgeClient.identityDid,
|
|
405
405
|
peerKey: this.#edgeClient.peerKey,
|
|
406
406
|
},
|
|
407
407
|
serviceId,
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
EchoHost,
|
|
16
16
|
type EdgeAutomergeReplicator,
|
|
17
17
|
MeshEchoReplicator,
|
|
18
|
-
runSqliteHealthCheck,
|
|
19
|
-
SqliteMetadataStore,
|
|
20
18
|
SpaceManager,
|
|
19
|
+
SqliteMetadataStore,
|
|
20
|
+
runSqliteHealthCheck,
|
|
21
21
|
valueEncoding,
|
|
22
22
|
} from '@dxos/echo-host';
|
|
23
23
|
import { createChainEdgeIdentity, createEphemeralEdgeIdentity } from '@dxos/edge-client';
|
|
@@ -558,7 +558,7 @@ export class ServiceContext extends Resource {
|
|
|
558
558
|
this._edgeConnection?.setIdentity(edgeIdentity);
|
|
559
559
|
this._edgeHttpClient?.setIdentity(edgeIdentity);
|
|
560
560
|
this.networkManager.setPeerInfo({
|
|
561
|
-
|
|
561
|
+
identityDid: edgeIdentity.identityDid,
|
|
562
562
|
peerKey: edgeIdentity.peerKey,
|
|
563
563
|
});
|
|
564
564
|
log('_setNetworkIdentity: done');
|
|
@@ -264,7 +264,7 @@ export class ClientServicesHost {
|
|
|
264
264
|
signalManager,
|
|
265
265
|
peerInfo: this._edgeConnection
|
|
266
266
|
? {
|
|
267
|
-
|
|
267
|
+
identityDid: this._edgeConnection.identityDid,
|
|
268
268
|
peerKey: this._edgeConnection.peerKey,
|
|
269
269
|
}
|
|
270
270
|
: undefined,
|
|
@@ -9,7 +9,7 @@ import type { Callback, FileStat, RandomAccessStorage } from 'random-access-stor
|
|
|
9
9
|
|
|
10
10
|
import { RuntimeProvider } from '@dxos/effect';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
|
-
import { Directory, type File,
|
|
12
|
+
import { Directory, type File, type Storage, StorageType, wrapFile } from '@dxos/random-access-storage';
|
|
13
13
|
import { SqlTransaction } from '@dxos/sql-sqlite';
|
|
14
14
|
|
|
15
15
|
// SqlTransaction.SqlTransaction is the Tag class exported from the SqlTransaction namespace.
|
|
@@ -167,13 +167,23 @@ class SqliteRandomAccessFile extends BaseEventEmitter implements RandomAccessSto
|
|
|
167
167
|
|
|
168
168
|
private async _loadFromDb(): Promise<void> {
|
|
169
169
|
const filePath = this.filePath;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
try {
|
|
171
|
+
const rows = await RuntimeProvider.runPromise(this.runtime)(
|
|
172
|
+
Effect.gen(function* () {
|
|
173
|
+
const sql = yield* SqlClient.SqlClient;
|
|
174
|
+
return yield* sql<{ data: Uint8Array }>`SELECT data FROM hypercore_files WHERE path = ${filePath}`;
|
|
175
|
+
}),
|
|
176
|
+
);
|
|
177
|
+
this.#buffer = rows.length > 0 ? Buffer.from(rows[0].data) : Buffer.alloc(0);
|
|
178
|
+
} catch (err) {
|
|
179
|
+
// The SQL connection may close mid-read during teardown (the `#closed` guard in `_ensureLoaded`
|
|
180
|
+
// only catches reads that have not yet started). A read racing teardown rejects with
|
|
181
|
+
// "database connection is not open"; swallow it once closed and fall back to the empty buffer,
|
|
182
|
+
// otherwise surface the genuine error.
|
|
183
|
+
if (!this.#closed) {
|
|
184
|
+
throw err;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
177
187
|
this.#loaded = true;
|
|
178
188
|
}
|
|
179
189
|
|
|
@@ -10,7 +10,7 @@ import { type SerializedFeed, type SerializedSpace } from '@dxos/echo-client';
|
|
|
10
10
|
import { type EchoHost } from '@dxos/echo-host';
|
|
11
11
|
import { type DatabaseDirectory, type EntityStructure } from '@dxos/echo-protocol';
|
|
12
12
|
import { assertState, invariant } from '@dxos/invariant';
|
|
13
|
-
import { DXN, type
|
|
13
|
+
import { DXN, type EntityId, type IdentityDid, type SpaceId } from '@dxos/keys';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
15
15
|
import { FeedProtocol } from '@dxos/protocols';
|
|
16
16
|
import { SpaceArchive } from '@dxos/protocols/proto/dxos/client/services';
|
|
@@ -367,7 +367,7 @@ describe('SpaceArchive', () => {
|
|
|
367
367
|
id,
|
|
368
368
|
'@type': 'dxn:example.Thing',
|
|
369
369
|
'@meta': { keys: [] },
|
|
370
|
-
title: 'hello',
|
|
370
|
+
'title': 'hello',
|
|
371
371
|
},
|
|
372
372
|
];
|
|
373
373
|
const directory = buildDatabaseDirectoryFromObjects(objects as any);
|
|
@@ -413,8 +413,8 @@ describe('SpaceArchive', () => {
|
|
|
413
413
|
test('orderObjJsonFields reorders feed queue messages with id/@type/@meta first', () => {
|
|
414
414
|
const id = EntityId.random();
|
|
415
415
|
const message = {
|
|
416
|
-
payload: { value: 'x' },
|
|
417
|
-
timestamp: 1000,
|
|
416
|
+
'payload': { value: 'x' },
|
|
417
|
+
'timestamp': 1000,
|
|
418
418
|
id,
|
|
419
419
|
'@meta': { keys: [] },
|
|
420
420
|
'@type': 'dxn:example.Message',
|
|
@@ -428,7 +428,7 @@ describe('SpaceArchive', () => {
|
|
|
428
428
|
test('orderObjJsonFields preserves unknown @-prefixed fields between system and data', () => {
|
|
429
429
|
const id = EntityId.random();
|
|
430
430
|
const obj = {
|
|
431
|
-
data: 1,
|
|
431
|
+
'data': 1,
|
|
432
432
|
'@custom': 'extension',
|
|
433
433
|
'@type': 'dxn:example.Thing',
|
|
434
434
|
id,
|
|
@@ -465,10 +465,10 @@ describe('SpaceArchive', () => {
|
|
|
465
465
|
id,
|
|
466
466
|
'@type': 'dxn:org.dxos.type.schema:0.1.0',
|
|
467
467
|
'@meta': { keys: [] },
|
|
468
|
-
name: 'Custom Type',
|
|
469
|
-
typename: 'example.type.custom',
|
|
470
|
-
version: '0.1.0',
|
|
471
|
-
jsonSchema: { $id: `echo:/${id}`, type: 'object', properties: {} },
|
|
468
|
+
'name': 'Custom Type',
|
|
469
|
+
'typename': 'example.type.custom',
|
|
470
|
+
'version': '0.1.0',
|
|
471
|
+
'jsonSchema': { $id: `echo:/${id}`, type: 'object', properties: {} },
|
|
472
472
|
},
|
|
473
473
|
];
|
|
474
474
|
const directory = buildDatabaseDirectoryFromObjects(objects as any);
|
|
@@ -147,7 +147,7 @@ describe('DataSpaceManager', () => {
|
|
|
147
147
|
inc();
|
|
148
148
|
});
|
|
149
149
|
|
|
150
|
-
await space1.postMessage('test', { '@type': 'google.protobuf.Any', test: true });
|
|
150
|
+
await space1.postMessage('test', { '@type': 'google.protobuf.Any', 'test': true });
|
|
151
151
|
await receivedMessage();
|
|
152
152
|
});
|
|
153
153
|
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
DatabaseRoot,
|
|
23
23
|
type EchoHost,
|
|
24
24
|
type EdgeAutomergeReplicator,
|
|
25
|
-
type MeshEchoReplicator,
|
|
26
25
|
type IMetadataStore,
|
|
26
|
+
type MeshEchoReplicator,
|
|
27
27
|
type Space,
|
|
28
28
|
type SpaceManager,
|
|
29
29
|
type SpaceProtocol,
|
|
@@ -429,7 +429,7 @@ export class DataSpaceManager extends Resource {
|
|
|
429
429
|
assertion: {
|
|
430
430
|
'@type': 'dxos.halo.credentials.SpaceDeleted',
|
|
431
431
|
spaceKey,
|
|
432
|
-
deletedAt: new Date(),
|
|
432
|
+
'deletedAt': new Date(),
|
|
433
433
|
},
|
|
434
434
|
});
|
|
435
435
|
await this._signingContext.recordCredential(credential);
|
|
@@ -435,10 +435,10 @@ export class DataSpace {
|
|
|
435
435
|
subject: controlFeed.key,
|
|
436
436
|
assertion: {
|
|
437
437
|
'@type': 'dxos.halo.credentials.AdmittedFeed',
|
|
438
|
-
spaceKey: this.key,
|
|
439
|
-
deviceKey: this._signingContext.deviceKey,
|
|
440
|
-
identityKey: this._signingContext.identityKey,
|
|
441
|
-
designation: AdmittedFeed.Designation.CONTROL,
|
|
438
|
+
'spaceKey': this.key,
|
|
439
|
+
'deviceKey': this._signingContext.deviceKey,
|
|
440
|
+
'identityKey': this._signingContext.identityKey,
|
|
441
|
+
'designation': AdmittedFeed.Designation.CONTROL,
|
|
442
442
|
},
|
|
443
443
|
}),
|
|
444
444
|
);
|
|
@@ -455,10 +455,10 @@ export class DataSpace {
|
|
|
455
455
|
subject: dataFeed.key,
|
|
456
456
|
assertion: {
|
|
457
457
|
'@type': 'dxos.halo.credentials.AdmittedFeed',
|
|
458
|
-
spaceKey: this.key,
|
|
459
|
-
deviceKey: this._signingContext.deviceKey,
|
|
460
|
-
identityKey: this._signingContext.identityKey,
|
|
461
|
-
designation: AdmittedFeed.Designation.DATA,
|
|
458
|
+
'spaceKey': this.key,
|
|
459
|
+
'deviceKey': this._signingContext.deviceKey,
|
|
460
|
+
'identityKey': this._signingContext.identityKey,
|
|
461
|
+
'designation': AdmittedFeed.Designation.DATA,
|
|
462
462
|
},
|
|
463
463
|
}),
|
|
464
464
|
);
|
|
@@ -163,7 +163,7 @@ export class EdgeFeedReplicator extends Resource {
|
|
|
163
163
|
ctx,
|
|
164
164
|
buf.create(RouterMessageSchema, {
|
|
165
165
|
source: {
|
|
166
|
-
|
|
166
|
+
identityDid: this._messenger.identityDid,
|
|
167
167
|
peerKey: this._messenger.peerKey,
|
|
168
168
|
},
|
|
169
169
|
serviceId: `${EdgeService.FEED_REPLICATOR}:${this._spaceId}`,
|
|
@@ -27,9 +27,9 @@ export const spaceGenesis = async (
|
|
|
27
27
|
subject: space.key,
|
|
28
28
|
assertion: {
|
|
29
29
|
'@type': 'dxos.halo.credentials.SpaceGenesis',
|
|
30
|
-
spaceKey: space.key,
|
|
31
|
-
tags: tags ?? [],
|
|
32
|
-
membershipPolicy: membershipPolicy ?? MembershipPolicy.INVITE,
|
|
30
|
+
'spaceKey': space.key,
|
|
31
|
+
'tags': tags ?? [],
|
|
32
|
+
'membershipPolicy': membershipPolicy ?? MembershipPolicy.INVITE,
|
|
33
33
|
},
|
|
34
34
|
}),
|
|
35
35
|
|
|
@@ -39,11 +39,11 @@ export const spaceGenesis = async (
|
|
|
39
39
|
subject: signingContext.identityKey,
|
|
40
40
|
assertion: {
|
|
41
41
|
'@type': 'dxos.halo.credentials.SpaceMember',
|
|
42
|
-
spaceKey: space.key,
|
|
43
|
-
role: SpaceMember.Role.OWNER,
|
|
44
|
-
profile: signingContext.getProfile(),
|
|
45
|
-
genesisFeedKey: space.controlFeedKey ?? failUndefined(),
|
|
46
|
-
tags: tags ?? [],
|
|
42
|
+
'spaceKey': space.key,
|
|
43
|
+
'role': SpaceMember.Role.OWNER,
|
|
44
|
+
'profile': signingContext.getProfile(),
|
|
45
|
+
'genesisFeedKey': space.controlFeedKey ?? failUndefined(),
|
|
46
|
+
'tags': tags ?? [],
|
|
47
47
|
},
|
|
48
48
|
}),
|
|
49
49
|
|
|
@@ -51,10 +51,10 @@ export const spaceGenesis = async (
|
|
|
51
51
|
subject: space.controlFeedKey ?? failUndefined(),
|
|
52
52
|
assertion: {
|
|
53
53
|
'@type': 'dxos.halo.credentials.AdmittedFeed',
|
|
54
|
-
spaceKey: space.key,
|
|
55
|
-
identityKey: signingContext.identityKey,
|
|
56
|
-
deviceKey: signingContext.deviceKey,
|
|
57
|
-
designation: AdmittedFeed.Designation.CONTROL,
|
|
54
|
+
'spaceKey': space.key,
|
|
55
|
+
'identityKey': signingContext.identityKey,
|
|
56
|
+
'deviceKey': signingContext.deviceKey,
|
|
57
|
+
'designation': AdmittedFeed.Designation.CONTROL,
|
|
58
58
|
},
|
|
59
59
|
}),
|
|
60
60
|
|
|
@@ -62,10 +62,10 @@ export const spaceGenesis = async (
|
|
|
62
62
|
subject: space.dataFeedKey ?? failUndefined(),
|
|
63
63
|
assertion: {
|
|
64
64
|
'@type': 'dxos.halo.credentials.AdmittedFeed',
|
|
65
|
-
spaceKey: space.key,
|
|
66
|
-
identityKey: signingContext.identityKey,
|
|
67
|
-
deviceKey: signingContext.deviceKey,
|
|
68
|
-
designation: AdmittedFeed.Designation.DATA,
|
|
65
|
+
'spaceKey': space.key,
|
|
66
|
+
'identityKey': signingContext.identityKey,
|
|
67
|
+
'deviceKey': signingContext.deviceKey,
|
|
68
|
+
'designation': AdmittedFeed.Designation.DATA,
|
|
69
69
|
},
|
|
70
70
|
}),
|
|
71
71
|
|
|
@@ -73,10 +73,10 @@ export const spaceGenesis = async (
|
|
|
73
73
|
subject: space.key ?? failUndefined(),
|
|
74
74
|
assertion: {
|
|
75
75
|
'@type': 'dxos.halo.credentials.Epoch',
|
|
76
|
-
number: 0,
|
|
77
|
-
previousId: undefined,
|
|
78
|
-
timeframe: new Timeframe(),
|
|
79
|
-
snapshotCid: undefined,
|
|
76
|
+
'number': 0,
|
|
77
|
+
'previousId': undefined,
|
|
78
|
+
'timeframe': new Timeframe(),
|
|
79
|
+
'snapshotCid': undefined,
|
|
80
80
|
automergeRoot,
|
|
81
81
|
},
|
|
82
82
|
}),
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
type ContactAdmission,
|
|
35
35
|
type CreateEpochRequest,
|
|
36
36
|
type CreateEpochResponse,
|
|
37
|
+
type CreateSpaceRequest,
|
|
37
38
|
type ExportSpaceRequest,
|
|
38
39
|
type ExportSpaceResponse,
|
|
39
40
|
type ImportSpaceRequest,
|
|
@@ -46,11 +47,10 @@ import {
|
|
|
46
47
|
type Space,
|
|
47
48
|
SpaceArchive,
|
|
48
49
|
SpaceMember,
|
|
49
|
-
SpaceState,
|
|
50
50
|
type SpacesService,
|
|
51
|
+
SpaceState,
|
|
51
52
|
type SubscribeMessagesRequest,
|
|
52
53
|
type UpdateMemberRoleRequest,
|
|
53
|
-
type CreateSpaceRequest,
|
|
54
54
|
type UpdateSpaceRequest,
|
|
55
55
|
type WriteCredentialsRequest,
|
|
56
56
|
} from '@dxos/protocols/proto/dxos/client/services';
|
|
@@ -64,9 +64,9 @@ import {
|
|
|
64
64
|
SpaceArchiveWriter,
|
|
65
65
|
detectSpaceArchiveFormat,
|
|
66
66
|
extractSpaceArchive,
|
|
67
|
+
objJsonToObjectStructure,
|
|
67
68
|
readSerializedSpaceArchive,
|
|
68
69
|
writeSerializedSpaceArchive,
|
|
69
|
-
objJsonToObjectStructure,
|
|
70
70
|
} from '../space-export';
|
|
71
71
|
import { type DataSpace } from './data-space';
|
|
72
72
|
import { type DataSpaceManager } from './data-space-manager';
|
|
@@ -9,10 +9,10 @@ import { ProfileArchiveEntryType } from '@dxos/protocols';
|
|
|
9
9
|
|
|
10
10
|
import { decodeProfileArchive, encodeProfileArchive } from './profile-archive';
|
|
11
11
|
import {
|
|
12
|
+
OPFS_SQLITE_DB_FILENAME,
|
|
12
13
|
createSqliteProfileArchive,
|
|
13
14
|
getSqliteProfileEntries,
|
|
14
15
|
isValidSqliteDatabase,
|
|
15
|
-
OPFS_SQLITE_DB_FILENAME,
|
|
16
16
|
} from './profile-archive-sqlite';
|
|
17
17
|
|
|
18
18
|
const sqliteHeader = (): Uint8Array => {
|
|
@@ -20,9 +20,9 @@ export const createMockCredential = async ({
|
|
|
20
20
|
subject: new PublicKey(Buffer.from('test')),
|
|
21
21
|
assertion: {
|
|
22
22
|
'@type': 'example.testing.rpc.MessageWithAny',
|
|
23
|
-
payload: {
|
|
23
|
+
'payload': {
|
|
24
24
|
'@type': 'google.protobuf.Any',
|
|
25
|
-
value: Buffer.from('test'),
|
|
25
|
+
'value': Buffer.from('test'),
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
});
|
package/src/version.ts
CHANGED