@dxos/echo-pipeline 0.8.2-main.f081794 → 0.8.2-main.fbd8ed0
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-32WDI3LB.mjs → chunk-TPEBUDNJ.mjs} +9 -9
- package/dist/lib/browser/{chunk-32WDI3LB.mjs.map → chunk-TPEBUDNJ.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +157 -156
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +11 -12
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-TC2PRBEU.cjs → chunk-QD3U65NM.cjs} +12 -12
- package/dist/lib/node/{chunk-TC2PRBEU.cjs.map → chunk-QD3U65NM.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +182 -180
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +20 -21
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node-esm/{chunk-UKOLB3LW.mjs → chunk-S5YERQ4D.mjs} +9 -9
- package/dist/lib/node-esm/{chunk-UKOLB3LW.mjs.map → chunk-S5YERQ4D.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +157 -156
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +11 -12
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/automerge/automerge-host.d.ts +5 -2
- package/dist/types/src/automerge/automerge-host.d.ts.map +1 -1
- package/dist/types/src/automerge/collection-synchronizer.d.ts +1 -1
- package/dist/types/src/automerge/collection-synchronizer.d.ts.map +1 -1
- package/dist/types/src/automerge/echo-data-monitor.d.ts +6 -6
- package/dist/types/src/automerge/echo-data-monitor.d.ts.map +1 -1
- package/dist/types/src/automerge/echo-network-adapter.d.ts +4 -1
- package/dist/types/src/automerge/echo-network-adapter.d.ts.map +1 -1
- package/dist/types/src/automerge/heads-store.d.ts +2 -2
- package/dist/types/src/automerge/heads-store.d.ts.map +1 -1
- package/dist/types/src/automerge/leveldb-storage-adapter.d.ts +1 -1
- package/dist/types/src/automerge/leveldb-storage-adapter.d.ts.map +1 -1
- package/dist/types/src/automerge/mesh-echo-replicator-connection.d.ts.map +1 -1
- package/dist/types/src/automerge/network-protocol.d.ts +1 -1
- package/dist/types/src/automerge/network-protocol.d.ts.map +1 -1
- package/dist/types/src/automerge/space-collection.d.ts +1 -1
- package/dist/types/src/automerge/space-collection.d.ts.map +1 -1
- package/dist/types/src/common/feeds.d.ts.map +1 -1
- package/dist/types/src/common/space-id.d.ts.map +1 -1
- package/dist/types/src/db-host/automerge-metrics.d.ts +1 -1
- package/dist/types/src/db-host/automerge-metrics.d.ts.map +1 -1
- package/dist/types/src/db-host/data-service.d.ts.map +1 -1
- package/dist/types/src/db-host/database-root.d.ts +3 -3
- package/dist/types/src/db-host/database-root.d.ts.map +1 -1
- package/dist/types/src/db-host/documents-iterator.d.ts.map +1 -1
- package/dist/types/src/db-host/documents-synchronizer.d.ts +2 -2
- package/dist/types/src/db-host/documents-synchronizer.d.ts.map +1 -1
- package/dist/types/src/db-host/echo-host.d.ts +1 -1
- package/dist/types/src/db-host/echo-host.d.ts.map +1 -1
- package/dist/types/src/db-host/query-service.d.ts.map +1 -1
- package/dist/types/src/db-host/query-state.d.ts.map +1 -1
- package/dist/types/src/db-host/space-state-manager.d.ts +1 -1
- package/dist/types/src/db-host/space-state-manager.d.ts.map +1 -1
- package/dist/types/src/edge/echo-edge-replicator.d.ts.map +1 -1
- package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
- package/dist/types/src/pipeline/message-selector.d.ts.map +1 -1
- package/dist/types/src/pipeline/timeframe-clock.d.ts.map +1 -1
- package/dist/types/src/space/space-manager.d.ts.map +1 -1
- package/dist/types/src/testing/change-metadata.d.ts.map +1 -1
- package/dist/types/src/testing/test-agent-builder.d.ts.map +1 -1
- package/dist/types/src/testing/test-network-adapter.d.ts +3 -2
- package/dist/types/src/testing/test-network-adapter.d.ts.map +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -34
- package/src/automerge/automerge-host.test.ts +7 -7
- package/src/automerge/automerge-host.ts +30 -23
- package/src/automerge/automerge-repo.test.ts +65 -65
- package/src/automerge/collection-synchronizer.test.ts +1 -1
- package/src/automerge/collection-synchronizer.ts +3 -2
- package/src/automerge/echo-data-monitor.ts +9 -8
- package/src/automerge/echo-network-adapter.test.ts +1 -1
- package/src/automerge/echo-network-adapter.ts +13 -6
- package/src/automerge/heads-store.ts +3 -2
- package/src/automerge/leveldb-storage-adapter.ts +1 -1
- package/src/automerge/mesh-echo-replicator-connection.ts +3 -2
- package/src/automerge/network-protocol.ts +2 -1
- package/src/automerge/space-collection.ts +2 -1
- package/src/db-host/automerge-metrics.ts +2 -1
- package/src/db-host/data-service.ts +2 -1
- package/src/db-host/database-root.ts +12 -16
- package/src/db-host/documents-iterator.ts +4 -3
- package/src/db-host/documents-synchronizer.test.ts +2 -2
- package/src/db-host/documents-synchronizer.ts +11 -9
- package/src/db-host/echo-host.ts +6 -3
- package/src/db-host/query-service.ts +6 -5
- package/src/db-host/query-state.ts +20 -13
- package/src/db-host/space-state-manager.ts +1 -1
- package/src/edge/echo-edge-replicator.test.ts +3 -3
- package/src/edge/echo-edge-replicator.ts +2 -1
- package/src/space/space-manager.ts +2 -1
- package/src/testing/test-network-adapter.ts +8 -5
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,62 +28,63 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
|
-
AuthExtension: () =>
|
|
32
|
-
AuthStatus: () =>
|
|
31
|
+
AuthExtension: () => import_chunk_QD3U65NM.AuthExtension,
|
|
32
|
+
AuthStatus: () => import_chunk_QD3U65NM.AuthStatus,
|
|
33
33
|
AutomergeHost: () => AutomergeHost,
|
|
34
|
-
CredentialRetrieverExtension: () =>
|
|
35
|
-
CredentialServerExtension: () =>
|
|
34
|
+
CredentialRetrieverExtension: () => import_chunk_QD3U65NM.CredentialRetrieverExtension,
|
|
35
|
+
CredentialServerExtension: () => import_chunk_QD3U65NM.CredentialServerExtension,
|
|
36
36
|
DataServiceImpl: () => DataServiceImpl,
|
|
37
37
|
DatabaseRoot: () => DatabaseRoot,
|
|
38
38
|
DocumentsSynchronizer: () => DocumentsSynchronizer,
|
|
39
39
|
EchoDataMonitor: () => EchoDataMonitor,
|
|
40
40
|
EchoEdgeReplicator: () => EchoEdgeReplicator,
|
|
41
41
|
EchoHost: () => EchoHost,
|
|
42
|
+
FIND_PARAMS: () => FIND_PARAMS,
|
|
42
43
|
LevelDBStorageAdapter: () => LevelDBStorageAdapter,
|
|
43
|
-
MOCK_AUTH_PROVIDER: () =>
|
|
44
|
-
MOCK_AUTH_VERIFIER: () =>
|
|
44
|
+
MOCK_AUTH_PROVIDER: () => import_chunk_QD3U65NM.MOCK_AUTH_PROVIDER,
|
|
45
|
+
MOCK_AUTH_VERIFIER: () => import_chunk_QD3U65NM.MOCK_AUTH_VERIFIER,
|
|
45
46
|
MeshEchoReplicator: () => MeshEchoReplicator,
|
|
46
|
-
MetadataStore: () =>
|
|
47
|
-
Pipeline: () =>
|
|
47
|
+
MetadataStore: () => import_chunk_QD3U65NM.MetadataStore,
|
|
48
|
+
Pipeline: () => import_chunk_QD3U65NM.Pipeline,
|
|
48
49
|
QueryServiceImpl: () => QueryServiceImpl,
|
|
49
50
|
QueryState: () => QueryState,
|
|
50
|
-
Space: () =>
|
|
51
|
+
Space: () => import_chunk_QD3U65NM.Space,
|
|
51
52
|
SpaceDocumentListUpdatedEvent: () => SpaceDocumentListUpdatedEvent,
|
|
52
|
-
SpaceManager: () =>
|
|
53
|
-
SpaceProtocol: () =>
|
|
54
|
-
SpaceProtocolSession: () =>
|
|
53
|
+
SpaceManager: () => import_chunk_QD3U65NM.SpaceManager,
|
|
54
|
+
SpaceProtocol: () => import_chunk_QD3U65NM.SpaceProtocol,
|
|
55
|
+
SpaceProtocolSession: () => import_chunk_QD3U65NM.SpaceProtocolSession,
|
|
55
56
|
SpaceStateManager: () => SpaceStateManager,
|
|
56
|
-
TimeframeClock: () =>
|
|
57
|
-
codec: () =>
|
|
58
|
-
createIdFromSpaceKey: () =>
|
|
59
|
-
createMappedFeedWriter: () =>
|
|
57
|
+
TimeframeClock: () => import_chunk_QD3U65NM.TimeframeClock,
|
|
58
|
+
codec: () => import_chunk_QD3U65NM.codec,
|
|
59
|
+
createIdFromSpaceKey: () => import_chunk_QD3U65NM.createIdFromSpaceKey,
|
|
60
|
+
createMappedFeedWriter: () => import_chunk_QD3U65NM.createMappedFeedWriter,
|
|
60
61
|
deriveCollectionIdFromSpaceId: () => deriveCollectionIdFromSpaceId,
|
|
61
62
|
diffCollectionState: () => diffCollectionState,
|
|
62
63
|
encodingOptions: () => encodingOptions,
|
|
63
64
|
findInlineObjectOfType: () => findInlineObjectOfType,
|
|
64
65
|
getSpaceIdFromCollectionId: () => getSpaceIdFromCollectionId,
|
|
65
66
|
getSpaceKeyFromDoc: () => getSpaceKeyFromDoc,
|
|
66
|
-
hasInvitationExpired: () =>
|
|
67
|
-
mapFeedIndexesToTimeframe: () =>
|
|
68
|
-
mapTimeframeToFeedIndexes: () =>
|
|
69
|
-
startAfter: () =>
|
|
70
|
-
valueEncoding: () =>
|
|
67
|
+
hasInvitationExpired: () => import_chunk_QD3U65NM.hasInvitationExpired,
|
|
68
|
+
mapFeedIndexesToTimeframe: () => import_chunk_QD3U65NM.mapFeedIndexesToTimeframe,
|
|
69
|
+
mapTimeframeToFeedIndexes: () => import_chunk_QD3U65NM.mapTimeframeToFeedIndexes,
|
|
70
|
+
startAfter: () => import_chunk_QD3U65NM.startAfter,
|
|
71
|
+
valueEncoding: () => import_chunk_QD3U65NM.valueEncoding
|
|
71
72
|
});
|
|
72
73
|
module.exports = __toCommonJS(node_exports);
|
|
73
|
-
var
|
|
74
|
+
var import_chunk_QD3U65NM = require("./chunk-QD3U65NM.cjs");
|
|
74
75
|
var import_async = require("@dxos/async");
|
|
75
76
|
var import_stream = require("@dxos/codec-protobuf/stream");
|
|
76
77
|
var import_invariant = require("@dxos/invariant");
|
|
77
78
|
var import_keys = require("@dxos/keys");
|
|
78
79
|
var import_log = require("@dxos/log");
|
|
80
|
+
var import_automerge = require("@automerge/automerge");
|
|
79
81
|
var import_async2 = require("@dxos/async");
|
|
80
|
-
var import_automerge = require("@dxos/automerge/automerge");
|
|
81
82
|
var import_context = require("@dxos/context");
|
|
82
83
|
var import_invariant2 = require("@dxos/invariant");
|
|
83
84
|
var import_log2 = require("@dxos/log");
|
|
85
|
+
var import_automerge2 = require("@automerge/automerge");
|
|
86
|
+
var import_automerge_repo = require("@automerge/automerge-repo");
|
|
84
87
|
var import_async3 = require("@dxos/async");
|
|
85
|
-
var import_automerge2 = require("@dxos/automerge/automerge");
|
|
86
|
-
var import_automerge_repo = require("@dxos/automerge/automerge-repo");
|
|
87
88
|
var import_context2 = require("@dxos/context");
|
|
88
89
|
var import_invariant3 = require("@dxos/invariant");
|
|
89
90
|
var import_keys2 = require("@dxos/keys");
|
|
@@ -91,14 +92,14 @@ var import_log3 = require("@dxos/log");
|
|
|
91
92
|
var import_protocols = require("@dxos/protocols");
|
|
92
93
|
var import_tracing = require("@dxos/tracing");
|
|
93
94
|
var import_util = require("@dxos/util");
|
|
95
|
+
var import_automerge3 = require("@automerge/automerge");
|
|
94
96
|
var import_async4 = require("@dxos/async");
|
|
95
|
-
var import_automerge3 = require("@dxos/automerge/automerge");
|
|
96
97
|
var import_context3 = require("@dxos/context");
|
|
97
98
|
var import_log4 = require("@dxos/log");
|
|
98
99
|
var import_tracing2 = require("@dxos/tracing");
|
|
99
100
|
var import_util2 = require("@dxos/util");
|
|
101
|
+
var import_automerge_repo2 = require("@automerge/automerge-repo");
|
|
100
102
|
var import_async5 = require("@dxos/async");
|
|
101
|
-
var import_automerge_repo2 = require("@dxos/automerge/automerge-repo");
|
|
102
103
|
var import_context4 = require("@dxos/context");
|
|
103
104
|
var import_invariant4 = require("@dxos/invariant");
|
|
104
105
|
var import_log5 = require("@dxos/log");
|
|
@@ -110,8 +111,8 @@ var import_invariant5 = require("@dxos/invariant");
|
|
|
110
111
|
var import_keys3 = require("@dxos/keys");
|
|
111
112
|
var import_log6 = require("@dxos/log");
|
|
112
113
|
var import_util4 = require("@dxos/util");
|
|
113
|
-
var A2 = __toESM(require("@
|
|
114
|
-
var import_automerge_repo3 = require("@
|
|
114
|
+
var A2 = __toESM(require("@automerge/automerge"));
|
|
115
|
+
var import_automerge_repo3 = require("@automerge/automerge-repo");
|
|
115
116
|
var import_context6 = require("@dxos/context");
|
|
116
117
|
var import_invariant6 = require("@dxos/invariant");
|
|
117
118
|
var import_log7 = require("@dxos/log");
|
|
@@ -127,14 +128,14 @@ var import_indexing2 = require("@dxos/indexing");
|
|
|
127
128
|
var import_invariant8 = require("@dxos/invariant");
|
|
128
129
|
var import_indexing3 = require("@dxos/protocols/proto/dxos/echo/indexing");
|
|
129
130
|
var import_tracing4 = require("@dxos/tracing");
|
|
130
|
-
var A3 = __toESM(require("@
|
|
131
|
+
var A3 = __toESM(require("@automerge/automerge"));
|
|
131
132
|
var import_context8 = require("@dxos/context");
|
|
132
133
|
var import_echo_protocol2 = require("@dxos/echo-protocol");
|
|
133
134
|
var import_invariant9 = require("@dxos/invariant");
|
|
134
135
|
var import_log8 = require("@dxos/log");
|
|
135
136
|
var import_protocols3 = require("@dxos/protocols");
|
|
137
|
+
var import_automerge4 = require("@automerge/automerge");
|
|
136
138
|
var import_async6 = require("@dxos/async");
|
|
137
|
-
var import_automerge4 = require("@dxos/automerge/automerge");
|
|
138
139
|
var import_stream2 = require("@dxos/codec-protobuf/stream");
|
|
139
140
|
var import_context9 = require("@dxos/context");
|
|
140
141
|
var import_log9 = require("@dxos/log");
|
|
@@ -147,17 +148,17 @@ var import_keys5 = require("@dxos/keys");
|
|
|
147
148
|
var import_protocols5 = require("@dxos/protocols");
|
|
148
149
|
var import_tracing6 = require("@dxos/tracing");
|
|
149
150
|
var import_util6 = require("@dxos/util");
|
|
151
|
+
var import_automerge_repo4 = require("@automerge/automerge-repo");
|
|
150
152
|
var import_lodash = __toESM(require("lodash.isequal"));
|
|
151
153
|
var import_async7 = require("@dxos/async");
|
|
152
|
-
var import_automerge_repo4 = require("@dxos/automerge/automerge-repo");
|
|
153
154
|
var import_context11 = require("@dxos/context");
|
|
154
|
-
var import_automerge_repo5 = require("@
|
|
155
|
+
var import_automerge_repo5 = require("@automerge/automerge-repo");
|
|
155
156
|
var import_echo_protocol4 = require("@dxos/echo-protocol");
|
|
156
157
|
var import_invariant11 = require("@dxos/invariant");
|
|
157
|
-
var A4 = __toESM(require("@
|
|
158
|
+
var A4 = __toESM(require("@automerge/automerge"));
|
|
158
159
|
var import_log10 = require("@dxos/log");
|
|
160
|
+
var import_automerge_repo6 = require("@automerge/automerge-repo");
|
|
159
161
|
var import_async8 = require("@dxos/async");
|
|
160
|
-
var import_automerge_repo6 = require("@dxos/automerge/automerge-repo");
|
|
161
162
|
var import_context12 = require("@dxos/context");
|
|
162
163
|
var import_crypto = require("@dxos/crypto");
|
|
163
164
|
var import_invariant12 = require("@dxos/invariant");
|
|
@@ -186,15 +187,15 @@ var DocumentsSynchronizer = class extends import_context.Resource {
|
|
|
186
187
|
documentIds
|
|
187
188
|
}, {
|
|
188
189
|
F: __dxlog_file,
|
|
189
|
-
L:
|
|
190
|
+
L: 50,
|
|
190
191
|
S: this,
|
|
191
192
|
C: (f, a) => f(...a)
|
|
192
193
|
});
|
|
193
194
|
return;
|
|
194
195
|
}
|
|
195
196
|
for (const documentId of documentIds) {
|
|
196
|
-
|
|
197
|
-
|
|
197
|
+
this._params.repo.find(documentId).then(async (doc) => {
|
|
198
|
+
await doc.whenReady();
|
|
198
199
|
this._startSync(doc);
|
|
199
200
|
this._pendingUpdates.add(doc.documentId);
|
|
200
201
|
this._sendUpdatesJob.trigger();
|
|
@@ -204,7 +205,7 @@ var DocumentsSynchronizer = class extends import_context.Resource {
|
|
|
204
205
|
error
|
|
205
206
|
}, {
|
|
206
207
|
F: __dxlog_file,
|
|
207
|
-
L:
|
|
208
|
+
L: 64,
|
|
208
209
|
S: this,
|
|
209
210
|
C: (f, a) => f(...a)
|
|
210
211
|
});
|
|
@@ -233,7 +234,7 @@ var DocumentsSynchronizer = class extends import_context.Resource {
|
|
|
233
234
|
update(updates) {
|
|
234
235
|
for (const { documentId, mutation, isNew } of updates) {
|
|
235
236
|
if (isNew) {
|
|
236
|
-
const doc = this._params.repo.
|
|
237
|
+
const { handle: doc } = this._params.repo.findWithProgress(documentId);
|
|
237
238
|
doc.update((doc2) => import_automerge.next.loadIncremental(doc2, mutation));
|
|
238
239
|
this._startSync(doc);
|
|
239
240
|
} else {
|
|
@@ -247,7 +248,7 @@ var DocumentsSynchronizer = class extends import_context.Resource {
|
|
|
247
248
|
documentId: doc.documentId
|
|
248
249
|
}, {
|
|
249
250
|
F: __dxlog_file,
|
|
250
|
-
L:
|
|
251
|
+
L: 103,
|
|
251
252
|
S: this,
|
|
252
253
|
C: (f, a) => f(...a)
|
|
253
254
|
});
|
|
@@ -290,17 +291,18 @@ var DocumentsSynchronizer = class extends import_context.Resource {
|
|
|
290
291
|
const syncState = this._syncStates.get(documentId);
|
|
291
292
|
(0, import_invariant2.invariant)(syncState, "Sync state for document not found", {
|
|
292
293
|
F: __dxlog_file,
|
|
293
|
-
L:
|
|
294
|
+
L: 144,
|
|
294
295
|
S: this,
|
|
295
296
|
A: [
|
|
296
297
|
"syncState",
|
|
297
298
|
"'Sync state for document not found'"
|
|
298
299
|
]
|
|
299
300
|
});
|
|
300
|
-
const
|
|
301
|
-
if (!doc) {
|
|
301
|
+
const handle = syncState.handle;
|
|
302
|
+
if (!handle || !handle.isReady() || !handle.doc()) {
|
|
302
303
|
return;
|
|
303
304
|
}
|
|
305
|
+
const doc = handle.doc();
|
|
304
306
|
const mutation = syncState.lastSentHead ? import_automerge.next.saveSince(doc, syncState.lastSentHead) : import_automerge.next.save(doc);
|
|
305
307
|
if (mutation.length === 0) {
|
|
306
308
|
return;
|
|
@@ -312,7 +314,7 @@ var DocumentsSynchronizer = class extends import_context.Resource {
|
|
|
312
314
|
const syncState = this._syncStates.get(documentId);
|
|
313
315
|
(0, import_invariant2.invariant)(syncState, "Sync state for document not found", {
|
|
314
316
|
F: __dxlog_file,
|
|
315
|
-
L:
|
|
317
|
+
L: 160,
|
|
316
318
|
S: this,
|
|
317
319
|
A: [
|
|
318
320
|
"syncState",
|
|
@@ -374,7 +376,7 @@ var CollectionSynchronizer = class extends import_context3.Resource {
|
|
|
374
376
|
state
|
|
375
377
|
}, {
|
|
376
378
|
F: __dxlog_file2,
|
|
377
|
-
L:
|
|
379
|
+
L: 76,
|
|
378
380
|
S: this,
|
|
379
381
|
C: (f, a) => f(...a)
|
|
380
382
|
});
|
|
@@ -393,7 +395,7 @@ var CollectionSynchronizer = class extends import_context3.Resource {
|
|
|
393
395
|
collectionId
|
|
394
396
|
}, {
|
|
395
397
|
F: __dxlog_file2,
|
|
396
|
-
L:
|
|
398
|
+
L: 90,
|
|
397
399
|
S: this,
|
|
398
400
|
C: (f, a) => f(...a)
|
|
399
401
|
});
|
|
@@ -476,7 +478,7 @@ var CollectionSynchronizer = class extends import_context3.Resource {
|
|
|
476
478
|
state
|
|
477
479
|
}, {
|
|
478
480
|
F: __dxlog_file2,
|
|
479
|
-
L:
|
|
481
|
+
L: 171,
|
|
480
482
|
S: this,
|
|
481
483
|
C: (f, a) => f(...a)
|
|
482
484
|
});
|
|
@@ -587,6 +589,13 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
587
589
|
this._connections = /* @__PURE__ */ new Map();
|
|
588
590
|
this._lifecycleState = import_context4.LifecycleState.CLOSED;
|
|
589
591
|
this._connected = new import_async5.Trigger();
|
|
592
|
+
this._ready = new import_async5.Trigger();
|
|
593
|
+
}
|
|
594
|
+
isReady() {
|
|
595
|
+
return this._lifecycleState === import_context4.LifecycleState.OPEN;
|
|
596
|
+
}
|
|
597
|
+
whenReady() {
|
|
598
|
+
return this._ready.wait();
|
|
590
599
|
}
|
|
591
600
|
connect(peerId, peerMetadata) {
|
|
592
601
|
this.peerId = peerId;
|
|
@@ -603,15 +612,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
603
612
|
return;
|
|
604
613
|
}
|
|
605
614
|
this._lifecycleState = import_context4.LifecycleState.OPEN;
|
|
606
|
-
(
|
|
607
|
-
F: __dxlog_file3,
|
|
608
|
-
L: 82,
|
|
609
|
-
S: this,
|
|
610
|
-
C: (f, a) => f(...a)
|
|
611
|
-
});
|
|
612
|
-
this.emit("ready", {
|
|
613
|
-
network: this
|
|
614
|
-
});
|
|
615
|
+
this._ready.wake();
|
|
615
616
|
}
|
|
616
617
|
async close() {
|
|
617
618
|
if (this._lifecycleState === import_context4.LifecycleState.CLOSED) {
|
|
@@ -621,6 +622,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
621
622
|
await replicator.disconnect();
|
|
622
623
|
}
|
|
623
624
|
this._replicators.clear();
|
|
625
|
+
this._ready.reset();
|
|
624
626
|
this._lifecycleState = import_context4.LifecycleState.CLOSED;
|
|
625
627
|
}
|
|
626
628
|
async whenConnected() {
|
|
@@ -631,7 +633,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
631
633
|
async addReplicator(replicator) {
|
|
632
634
|
(0, import_invariant4.invariant)(this._lifecycleState === import_context4.LifecycleState.OPEN, void 0, {
|
|
633
635
|
F: __dxlog_file3,
|
|
634
|
-
L:
|
|
636
|
+
L: 115,
|
|
635
637
|
S: this,
|
|
636
638
|
A: [
|
|
637
639
|
"this._lifecycleState === LifecycleState.OPEN",
|
|
@@ -640,7 +642,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
640
642
|
});
|
|
641
643
|
(0, import_invariant4.invariant)(this.peerId, void 0, {
|
|
642
644
|
F: __dxlog_file3,
|
|
643
|
-
L:
|
|
645
|
+
L: 116,
|
|
644
646
|
S: this,
|
|
645
647
|
A: [
|
|
646
648
|
"this.peerId",
|
|
@@ -649,7 +651,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
649
651
|
});
|
|
650
652
|
(0, import_invariant4.invariant)(!this._replicators.has(replicator), void 0, {
|
|
651
653
|
F: __dxlog_file3,
|
|
652
|
-
L:
|
|
654
|
+
L: 117,
|
|
653
655
|
S: this,
|
|
654
656
|
A: [
|
|
655
657
|
"!this._replicators.has(replicator)",
|
|
@@ -666,14 +668,14 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
666
668
|
getContainingSpaceForDocument: this._params.getContainingSpaceForDocument,
|
|
667
669
|
getContainingSpaceIdForDocument: async (documentId) => {
|
|
668
670
|
const key = await this._params.getContainingSpaceForDocument(documentId);
|
|
669
|
-
return key ? (0,
|
|
671
|
+
return key ? (0, import_chunk_QD3U65NM.createIdFromSpaceKey)(key) : null;
|
|
670
672
|
}
|
|
671
673
|
});
|
|
672
674
|
}
|
|
673
675
|
async removeReplicator(replicator) {
|
|
674
676
|
(0, import_invariant4.invariant)(this._lifecycleState === import_context4.LifecycleState.OPEN, void 0, {
|
|
675
677
|
F: __dxlog_file3,
|
|
676
|
-
L:
|
|
678
|
+
L: 136,
|
|
677
679
|
S: this,
|
|
678
680
|
A: [
|
|
679
681
|
"this._lifecycleState === LifecycleState.OPEN",
|
|
@@ -682,7 +684,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
682
684
|
});
|
|
683
685
|
(0, import_invariant4.invariant)(this._replicators.has(replicator), void 0, {
|
|
684
686
|
F: __dxlog_file3,
|
|
685
|
-
L:
|
|
687
|
+
L: 137,
|
|
686
688
|
S: this,
|
|
687
689
|
A: [
|
|
688
690
|
"this._replicators.has(replicator)",
|
|
@@ -738,7 +740,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
738
740
|
if (connectionEntry.isOpen) {
|
|
739
741
|
import_log5.log.catch(err, void 0, {
|
|
740
742
|
F: __dxlog_file3,
|
|
741
|
-
L:
|
|
743
|
+
L: 197,
|
|
742
744
|
S: this,
|
|
743
745
|
C: (f, a) => f(...a)
|
|
744
746
|
});
|
|
@@ -759,13 +761,13 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
759
761
|
peerId: connection.peerId
|
|
760
762
|
}, {
|
|
761
763
|
F: __dxlog_file3,
|
|
762
|
-
L:
|
|
764
|
+
L: 215,
|
|
763
765
|
S: this,
|
|
764
766
|
C: (f, a) => f(...a)
|
|
765
767
|
});
|
|
766
768
|
(0, import_invariant4.invariant)(!this._connections.has(connection.peerId), void 0, {
|
|
767
769
|
F: __dxlog_file3,
|
|
768
|
-
L:
|
|
770
|
+
L: 216,
|
|
769
771
|
S: this,
|
|
770
772
|
A: [
|
|
771
773
|
"!this._connections.has(connection.peerId as PeerId)",
|
|
@@ -794,7 +796,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
794
796
|
if (connectionEntry.isOpen) {
|
|
795
797
|
import_log5.log.catch(err, void 0, {
|
|
796
798
|
F: __dxlog_file3,
|
|
797
|
-
L:
|
|
799
|
+
L: 235,
|
|
798
800
|
S: this,
|
|
799
801
|
C: (f, a) => f(...a)
|
|
800
802
|
});
|
|
@@ -805,7 +807,7 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
805
807
|
peerId: connection.peerId
|
|
806
808
|
}, {
|
|
807
809
|
F: __dxlog_file3,
|
|
808
|
-
L:
|
|
810
|
+
L: 240,
|
|
809
811
|
S: this,
|
|
810
812
|
C: (f, a) => f(...a)
|
|
811
813
|
});
|
|
@@ -837,14 +839,14 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
837
839
|
peerId: connection.peerId
|
|
838
840
|
}, {
|
|
839
841
|
F: __dxlog_file3,
|
|
840
|
-
L:
|
|
842
|
+
L: 268,
|
|
841
843
|
S: this,
|
|
842
844
|
C: (f, a) => f(...a)
|
|
843
845
|
});
|
|
844
846
|
const entry = this._connections.get(connection.peerId);
|
|
845
847
|
(0, import_invariant4.invariant)(entry, void 0, {
|
|
846
848
|
F: __dxlog_file3,
|
|
847
|
-
L:
|
|
849
|
+
L: 270,
|
|
848
850
|
S: this,
|
|
849
851
|
A: [
|
|
850
852
|
"entry",
|
|
@@ -861,14 +863,14 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
861
863
|
peerId: connection.peerId
|
|
862
864
|
}, {
|
|
863
865
|
F: __dxlog_file3,
|
|
864
|
-
L:
|
|
866
|
+
L: 276,
|
|
865
867
|
S: this,
|
|
866
868
|
C: (f, a) => f(...a)
|
|
867
869
|
});
|
|
868
870
|
const entry = this._connections.get(connection.peerId);
|
|
869
871
|
(0, import_invariant4.invariant)(entry, void 0, {
|
|
870
872
|
F: __dxlog_file3,
|
|
871
|
-
L:
|
|
873
|
+
L: 278,
|
|
872
874
|
S: this,
|
|
873
875
|
A: [
|
|
874
876
|
"entry",
|
|
@@ -882,13 +884,13 @@ var EchoNetworkAdapter = class extends import_automerge_repo2.NetworkAdapter {
|
|
|
882
884
|
this._params.monitor?.recordPeerDisconnected(connection.peerId);
|
|
883
885
|
void entry.reader.cancel().catch((err) => import_log5.log.catch(err, void 0, {
|
|
884
886
|
F: __dxlog_file3,
|
|
885
|
-
L:
|
|
887
|
+
L: 284,
|
|
886
888
|
S: this,
|
|
887
889
|
C: (f, a) => f(...a)
|
|
888
890
|
}));
|
|
889
891
|
void entry.writer.abort().catch((err) => import_log5.log.catch(err, void 0, {
|
|
890
892
|
F: __dxlog_file3,
|
|
891
|
-
L:
|
|
893
|
+
L: 285,
|
|
892
894
|
S: this,
|
|
893
895
|
C: (f, a) => f(...a)
|
|
894
896
|
}));
|
|
@@ -1047,6 +1049,12 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
1047
1049
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1048
1050
|
}
|
|
1049
1051
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/automerge-host.ts";
|
|
1052
|
+
var FIND_PARAMS = {
|
|
1053
|
+
allowableStates: [
|
|
1054
|
+
"ready",
|
|
1055
|
+
"requesting"
|
|
1056
|
+
]
|
|
1057
|
+
};
|
|
1050
1058
|
var AutomergeHost = class extends import_context2.Resource {
|
|
1051
1059
|
constructor({ db, indexMetadataStore, dataMonitor, peerIdProvider, getSpaceKeyByRootDocumentId }) {
|
|
1052
1060
|
super();
|
|
@@ -1146,7 +1154,7 @@ var AutomergeHost = class extends import_context2.Resource {
|
|
|
1146
1154
|
handle = this._repo.handles[documentId];
|
|
1147
1155
|
}
|
|
1148
1156
|
if (!handle) {
|
|
1149
|
-
handle = this._repo.find(documentId);
|
|
1157
|
+
handle = await this._repo.find(documentId, FIND_PARAMS);
|
|
1150
1158
|
}
|
|
1151
1159
|
if (!handle.isReady()) {
|
|
1152
1160
|
if (!opts?.timeout) {
|
|
@@ -1202,12 +1210,12 @@ var AutomergeHost = class extends import_context2.Resource {
|
|
|
1202
1210
|
await Promise.all(headsToWait.map(async (entry, index) => {
|
|
1203
1211
|
const handle = await this.loadDoc(import_context2.Context.default(void 0, {
|
|
1204
1212
|
F: __dxlog_file4,
|
|
1205
|
-
L:
|
|
1213
|
+
L: 288
|
|
1206
1214
|
}), entry.documentId);
|
|
1207
1215
|
await waitForHeads(handle, entry.heads);
|
|
1208
1216
|
}));
|
|
1209
1217
|
}
|
|
1210
|
-
await this._repo.flush(documentIds.filter((documentId) =>
|
|
1218
|
+
await this._repo.flush(documentIds.filter((documentId) => this._repo.handles[documentId] && this._repo.handles[documentId].isReady()));
|
|
1211
1219
|
}
|
|
1212
1220
|
async reIndexHeads(documentIds) {
|
|
1213
1221
|
for (const documentId of documentIds) {
|
|
@@ -1215,46 +1223,30 @@ var AutomergeHost = class extends import_context2.Resource {
|
|
|
1215
1223
|
documentId
|
|
1216
1224
|
}, {
|
|
1217
1225
|
F: __dxlog_file4,
|
|
1218
|
-
L:
|
|
1226
|
+
L: 302,
|
|
1219
1227
|
S: this,
|
|
1220
1228
|
C: (f, a) => f(...a)
|
|
1221
1229
|
});
|
|
1222
|
-
const handle = this._repo.find(documentId);
|
|
1223
|
-
|
|
1224
|
-
"ready",
|
|
1225
|
-
"requesting"
|
|
1226
|
-
]);
|
|
1227
|
-
if (handle.inState([
|
|
1228
|
-
"requesting"
|
|
1229
|
-
])) {
|
|
1230
|
+
const handle = await this._repo.find(documentId, FIND_PARAMS);
|
|
1231
|
+
if (!handle.isReady()) {
|
|
1230
1232
|
import_log3.log.warn("document is not available locally, skipping", {
|
|
1231
1233
|
documentId
|
|
1232
1234
|
}, {
|
|
1233
1235
|
F: __dxlog_file4,
|
|
1234
|
-
L:
|
|
1236
|
+
L: 305,
|
|
1235
1237
|
S: this,
|
|
1236
1238
|
C: (f, a) => f(...a)
|
|
1237
1239
|
});
|
|
1238
1240
|
continue;
|
|
1239
1241
|
}
|
|
1240
|
-
const
|
|
1241
|
-
(0, import_invariant3.invariant)(doc, void 0, {
|
|
1242
|
-
F: __dxlog_file4,
|
|
1243
|
-
L: 303,
|
|
1244
|
-
S: this,
|
|
1245
|
-
A: [
|
|
1246
|
-
"doc",
|
|
1247
|
-
""
|
|
1248
|
-
]
|
|
1249
|
-
});
|
|
1250
|
-
const heads = (0, import_automerge2.getHeads)(doc);
|
|
1242
|
+
const heads = handle.heads();
|
|
1251
1243
|
const batch = this._db.batch();
|
|
1252
1244
|
this._headsStore.setHeads(documentId, heads, batch);
|
|
1253
1245
|
await batch.write();
|
|
1254
1246
|
}
|
|
1255
1247
|
import_log3.log.info("done re-indexing heads", void 0, {
|
|
1256
1248
|
F: __dxlog_file4,
|
|
1257
|
-
L:
|
|
1249
|
+
L: 314,
|
|
1258
1250
|
S: this,
|
|
1259
1251
|
C: (f, a) => f(...a)
|
|
1260
1252
|
});
|
|
@@ -1280,10 +1272,10 @@ var AutomergeHost = class extends import_context2.Resource {
|
|
|
1280
1272
|
}
|
|
1281
1273
|
async _beforeSave({ path, batch }) {
|
|
1282
1274
|
const handle = this._repo.handles[path[0]];
|
|
1283
|
-
if (!handle) {
|
|
1275
|
+
if (!handle || !handle.isReady()) {
|
|
1284
1276
|
return;
|
|
1285
1277
|
}
|
|
1286
|
-
const doc = handle.
|
|
1278
|
+
const doc = handle.doc();
|
|
1287
1279
|
if (!doc) {
|
|
1288
1280
|
return;
|
|
1289
1281
|
}
|
|
@@ -1317,7 +1309,7 @@ var AutomergeHost = class extends import_context2.Resource {
|
|
|
1317
1309
|
async _afterSave(path) {
|
|
1318
1310
|
this._indexMetadataStore.notifyMarkedDirty();
|
|
1319
1311
|
const documentId = path[0];
|
|
1320
|
-
const document = this._repo.handles[documentId]?.
|
|
1312
|
+
const document = this._repo.handles[documentId]?.doc();
|
|
1321
1313
|
if (document) {
|
|
1322
1314
|
const heads = (0, import_automerge2.getHeads)(document);
|
|
1323
1315
|
this._onHeadsChanged(documentId, heads);
|
|
@@ -1337,9 +1329,12 @@ var AutomergeHost = class extends import_context2.Resource {
|
|
|
1337
1329
|
return false;
|
|
1338
1330
|
}
|
|
1339
1331
|
async _getContainingSpaceForDocument(documentId) {
|
|
1340
|
-
const
|
|
1341
|
-
if (
|
|
1342
|
-
|
|
1332
|
+
const handle = this._repo.handles[documentId];
|
|
1333
|
+
if (handle.state === "loading") {
|
|
1334
|
+
await handle.whenReady();
|
|
1335
|
+
}
|
|
1336
|
+
if (handle && handle.isReady() && handle.doc()) {
|
|
1337
|
+
const spaceKeyHex = getSpaceKeyFromDoc(handle.doc());
|
|
1343
1338
|
if (spaceKeyHex) {
|
|
1344
1339
|
return import_keys2.PublicKey.from(spaceKeyHex);
|
|
1345
1340
|
}
|
|
@@ -1362,9 +1357,9 @@ var AutomergeHost = class extends import_context2.Resource {
|
|
|
1362
1357
|
const storeRequestIds = [];
|
|
1363
1358
|
const storeResultIndices = [];
|
|
1364
1359
|
for (const documentId of documentIds) {
|
|
1365
|
-
const
|
|
1366
|
-
if (doc) {
|
|
1367
|
-
result.push((0, import_automerge2.getHeads)(doc));
|
|
1360
|
+
const handle = this._repo.handles[documentId];
|
|
1361
|
+
if (handle && handle.isReady() && handle.doc()) {
|
|
1362
|
+
result.push((0, import_automerge2.getHeads)(handle.doc()));
|
|
1368
1363
|
} else {
|
|
1369
1364
|
storeRequestIds.push(documentId);
|
|
1370
1365
|
storeResultIndices.push(result.length);
|
|
@@ -1469,12 +1464,12 @@ var AutomergeHost = class extends import_context2.Resource {
|
|
|
1469
1464
|
count: toReplicate.length
|
|
1470
1465
|
}, {
|
|
1471
1466
|
F: __dxlog_file4,
|
|
1472
|
-
L:
|
|
1467
|
+
L: 556,
|
|
1473
1468
|
S: this,
|
|
1474
1469
|
C: (f, a) => f(...a)
|
|
1475
1470
|
});
|
|
1476
1471
|
for (const documentId of toReplicate) {
|
|
1477
|
-
this._repo.
|
|
1472
|
+
this._repo.findWithProgress(documentId);
|
|
1478
1473
|
}
|
|
1479
1474
|
}
|
|
1480
1475
|
_onHeadsChanged(documentId, heads) {
|
|
@@ -1523,7 +1518,7 @@ var waitForHeads = async (handle, heads) => {
|
|
|
1523
1518
|
await handle.whenReady();
|
|
1524
1519
|
await import_async3.Event.wrap(handle, "change").waitForCondition(() => {
|
|
1525
1520
|
for (const changeHash of unavailableHeads.values()) {
|
|
1526
|
-
if (changeIsPresentInDoc(handle.
|
|
1521
|
+
if (changeIsPresentInDoc(handle.doc(), changeHash)) {
|
|
1527
1522
|
unavailableHeads.delete(changeHash);
|
|
1528
1523
|
}
|
|
1529
1524
|
}
|
|
@@ -1536,7 +1531,7 @@ var changeIsPresentInDoc = (doc, changeHash) => {
|
|
|
1536
1531
|
var decodeCollectionState = (state) => {
|
|
1537
1532
|
(0, import_invariant3.invariant)(typeof state === "object" && state !== null, "Invalid state", {
|
|
1538
1533
|
F: __dxlog_file4,
|
|
1539
|
-
L:
|
|
1534
|
+
L: 617,
|
|
1540
1535
|
S: void 0,
|
|
1541
1536
|
A: [
|
|
1542
1537
|
"typeof state === 'object' && state !== null",
|
|
@@ -1568,7 +1563,7 @@ var MeshReplicatorConnection = class extends import_context6.Resource {
|
|
|
1568
1563
|
write: async (message, controller) => {
|
|
1569
1564
|
(0, import_invariant6.invariant)(this._isEnabled, "Writing to a disabled connection", {
|
|
1570
1565
|
F: __dxlog_file5,
|
|
1571
|
-
L:
|
|
1566
|
+
L: 51,
|
|
1572
1567
|
S: this,
|
|
1573
1568
|
A: [
|
|
1574
1569
|
"this._isEnabled",
|
|
@@ -1601,7 +1596,7 @@ var MeshReplicatorConnection = class extends import_context6.Resource {
|
|
|
1601
1596
|
remotePeerId: remotePeerId.toHex()
|
|
1602
1597
|
}, {
|
|
1603
1598
|
F: __dxlog_file5,
|
|
1604
|
-
L:
|
|
1599
|
+
L: 80,
|
|
1605
1600
|
S: this,
|
|
1606
1601
|
C: (f, a) => f(...a)
|
|
1607
1602
|
});
|
|
@@ -1628,7 +1623,7 @@ var MeshReplicatorConnection = class extends import_context6.Resource {
|
|
|
1628
1623
|
get peerId() {
|
|
1629
1624
|
(0, import_invariant6.invariant)(this._remotePeerId != null, "Remote peer has not connected yet.", {
|
|
1630
1625
|
F: __dxlog_file5,
|
|
1631
|
-
L:
|
|
1626
|
+
L: 106,
|
|
1632
1627
|
S: this,
|
|
1633
1628
|
A: [
|
|
1634
1629
|
"this._remotePeerId != null",
|
|
@@ -1653,7 +1648,7 @@ var MeshReplicatorConnection = class extends import_context6.Resource {
|
|
|
1653
1648
|
enable() {
|
|
1654
1649
|
(0, import_invariant6.invariant)(this._remotePeerId != null, "Remote peer has not connected yet.", {
|
|
1655
1650
|
F: __dxlog_file5,
|
|
1656
|
-
L:
|
|
1651
|
+
L: 127,
|
|
1657
1652
|
S: this,
|
|
1658
1653
|
A: [
|
|
1659
1654
|
"this._remotePeerId != null",
|
|
@@ -1684,7 +1679,7 @@ var logSendSync = (message) => {
|
|
|
1684
1679
|
};
|
|
1685
1680
|
}, {
|
|
1686
1681
|
F: __dxlog_file5,
|
|
1687
|
-
L:
|
|
1682
|
+
L: 140,
|
|
1688
1683
|
S: void 0,
|
|
1689
1684
|
C: (f, a) => f(...a)
|
|
1690
1685
|
});
|
|
@@ -1695,7 +1690,7 @@ var getSpaceIdFromCollectionId = (collectionId) => {
|
|
|
1695
1690
|
const spaceId = collectionId.split(":")[1];
|
|
1696
1691
|
(0, import_invariant7.invariant)(import_keys4.SpaceId.isValid(spaceId), void 0, {
|
|
1697
1692
|
F: __dxlog_file6,
|
|
1698
|
-
L:
|
|
1693
|
+
L: 16,
|
|
1699
1694
|
S: void 0,
|
|
1700
1695
|
A: [
|
|
1701
1696
|
"SpaceId.isValid(spaceId)",
|
|
@@ -1843,7 +1838,7 @@ var MeshEchoReplicator = class {
|
|
|
1843
1838
|
});
|
|
1844
1839
|
return remoteDocumentExists;
|
|
1845
1840
|
}
|
|
1846
|
-
const spaceId = await (0,
|
|
1841
|
+
const spaceId = await (0, import_chunk_QD3U65NM.createIdFromSpaceKey)(spaceKey);
|
|
1847
1842
|
const authorizedDevices = this._authorizedDevices.get(spaceId);
|
|
1848
1843
|
if (!connection.remoteDeviceKey) {
|
|
1849
1844
|
(0, import_log6.log)("device key not found for share policy check", {
|
|
@@ -1914,7 +1909,7 @@ var MeshEchoReplicator = class {
|
|
|
1914
1909
|
S: this,
|
|
1915
1910
|
C: (f, a) => f(...a)
|
|
1916
1911
|
});
|
|
1917
|
-
const spaceId = await (0,
|
|
1912
|
+
const spaceId = await (0, import_chunk_QD3U65NM.createIdFromSpaceKey)(spaceKey);
|
|
1918
1913
|
(0, import_util4.defaultMap)(this._authorizedDevices, spaceId, () => new import_util4.ComplexSet(import_keys3.PublicKey.hash)).add(deviceKey);
|
|
1919
1914
|
for (const connection of this._connections) {
|
|
1920
1915
|
if (connection.isEnabled && connection.remoteDeviceKey && connection.remoteDeviceKey.equals(deviceKey)) {
|
|
@@ -1943,7 +1938,7 @@ var EchoDataMonitor = class {
|
|
|
1943
1938
|
this._localTimeSeries = createLocalTimeSeries();
|
|
1944
1939
|
this._storageAverages = createStorageAverages();
|
|
1945
1940
|
this._replicationAverages = createNetworkAverages();
|
|
1946
|
-
this.
|
|
1941
|
+
this._sizeByMessage = {};
|
|
1947
1942
|
this._lastReceivedMessages = new import_util5.CircularBuffer(100);
|
|
1948
1943
|
this._lastSentMessages = new import_util5.CircularBuffer(100);
|
|
1949
1944
|
this._connectionsCount = 0;
|
|
@@ -1981,8 +1976,8 @@ var EchoDataMonitor = class {
|
|
|
1981
1976
|
countPerSecond: this._replicationAverages.sentPerSecond.average(),
|
|
1982
1977
|
failedPerSecond: this._replicationAverages.sendsFailedPerSecond.average()
|
|
1983
1978
|
},
|
|
1984
|
-
|
|
1985
|
-
|
|
1979
|
+
countByMessage: this._computeMessageHistogram("type"),
|
|
1980
|
+
avgSizeByMessage: (0, import_util5.mapValues)(this._sizeByMessage, (summary) => summary.average())
|
|
1986
1981
|
}
|
|
1987
1982
|
};
|
|
1988
1983
|
}
|
|
@@ -2187,7 +2182,7 @@ var EchoDataMonitor = class {
|
|
|
2187
2182
|
messageCounts.failed++;
|
|
2188
2183
|
}
|
|
2189
2184
|
_getStatsForType(message) {
|
|
2190
|
-
const messageSize = this.
|
|
2185
|
+
const messageSize = this._sizeByMessage[message.type] ??= createSlidingWindow();
|
|
2191
2186
|
const messageCounts = this._activeCounters.byType[message.type] ??= createMessageCounter();
|
|
2192
2187
|
return {
|
|
2193
2188
|
messageCounts,
|
|
@@ -2301,7 +2296,7 @@ var DataServiceImpl = class {
|
|
|
2301
2296
|
ready();
|
|
2302
2297
|
}).catch((err) => import_log.log.catch(err, void 0, {
|
|
2303
2298
|
F: __dxlog_file8,
|
|
2304
|
-
L:
|
|
2299
|
+
L: 71,
|
|
2305
2300
|
S: this,
|
|
2306
2301
|
C: (f, a) => f(...a)
|
|
2307
2302
|
}));
|
|
@@ -2312,7 +2307,7 @@ var DataServiceImpl = class {
|
|
|
2312
2307
|
const synchronizer = this._subscriptions.get(request.subscriptionId);
|
|
2313
2308
|
(0, import_invariant.invariant)(synchronizer, "Subscription not found", {
|
|
2314
2309
|
F: __dxlog_file8,
|
|
2315
|
-
L:
|
|
2310
|
+
L: 78,
|
|
2316
2311
|
S: this,
|
|
2317
2312
|
A: [
|
|
2318
2313
|
"synchronizer",
|
|
@@ -2333,7 +2328,7 @@ var DataServiceImpl = class {
|
|
|
2333
2328
|
const synchronizer = this._subscriptions.get(request.subscriptionId);
|
|
2334
2329
|
(0, import_invariant.invariant)(synchronizer, "Subscription not found", {
|
|
2335
2330
|
F: __dxlog_file8,
|
|
2336
|
-
L:
|
|
2331
|
+
L: 93,
|
|
2337
2332
|
S: this,
|
|
2338
2333
|
A: [
|
|
2339
2334
|
"synchronizer",
|
|
@@ -2378,7 +2373,7 @@ var DataServiceImpl = class {
|
|
|
2378
2373
|
const spaceId = request.spaceId;
|
|
2379
2374
|
(0, import_invariant.invariant)(import_keys.SpaceId.isValid(spaceId), void 0, {
|
|
2380
2375
|
F: __dxlog_file8,
|
|
2381
|
-
L:
|
|
2376
|
+
L: 133,
|
|
2382
2377
|
S: this,
|
|
2383
2378
|
A: [
|
|
2384
2379
|
"SpaceId.isValid(spaceId)",
|
|
@@ -2431,12 +2426,12 @@ var createSelectedDocumentsIterator = (automergeHost) => (
|
|
|
2431
2426
|
const { documentId, objectId } = import_protocols3.objectPointerCodec.decode(id);
|
|
2432
2427
|
const handle = await automergeHost.loadDoc(import_context8.Context.default(void 0, {
|
|
2433
2428
|
F: __dxlog_file9,
|
|
2434
|
-
L:
|
|
2429
|
+
L: 31
|
|
2435
2430
|
}), documentId);
|
|
2436
|
-
let doc = handle.
|
|
2431
|
+
let doc = handle.doc();
|
|
2437
2432
|
(0, import_invariant9.invariant)(doc, void 0, {
|
|
2438
2433
|
F: __dxlog_file9,
|
|
2439
|
-
L:
|
|
2434
|
+
L: 34,
|
|
2440
2435
|
S: this,
|
|
2441
2436
|
A: [
|
|
2442
2437
|
"doc",
|
|
@@ -2455,7 +2450,7 @@ var createSelectedDocumentsIterator = (automergeHost) => (
|
|
|
2455
2450
|
originalHeads: currentHeads
|
|
2456
2451
|
}, {
|
|
2457
2452
|
F: __dxlog_file9,
|
|
2458
|
-
L:
|
|
2453
|
+
L: 45,
|
|
2459
2454
|
S: this,
|
|
2460
2455
|
C: (f, a) => f(...a)
|
|
2461
2456
|
});
|
|
@@ -2490,7 +2485,7 @@ var createSelectedDocumentsIterator = (automergeHost) => (
|
|
|
2490
2485
|
error
|
|
2491
2486
|
}, {
|
|
2492
2487
|
F: __dxlog_file9,
|
|
2493
|
-
L:
|
|
2488
|
+
L: 71,
|
|
2494
2489
|
S: this,
|
|
2495
2490
|
C: (f, a) => f(...a)
|
|
2496
2491
|
});
|
|
@@ -2550,12 +2545,12 @@ var QueryState = class extends import_context10.Resource {
|
|
|
2550
2545
|
}
|
|
2551
2546
|
const handle = await this._params.automergeHost.loadDoc(import_context10.Context.default(void 0, {
|
|
2552
2547
|
F: __dxlog_file10,
|
|
2553
|
-
L:
|
|
2548
|
+
L: 118
|
|
2554
2549
|
}), documentId);
|
|
2555
2550
|
if (this._ctx.disposed) {
|
|
2556
2551
|
return;
|
|
2557
2552
|
}
|
|
2558
|
-
spaceKey = getSpaceKeyFromDoc(handle.
|
|
2553
|
+
spaceKey = getSpaceKeyFromDoc(handle.doc());
|
|
2559
2554
|
}
|
|
2560
2555
|
if (!spaceKey) {
|
|
2561
2556
|
return;
|
|
@@ -2563,13 +2558,17 @@ var QueryState = class extends import_context10.Resource {
|
|
|
2563
2558
|
if (this._params.request.filter.options?.spaces?.length && !this._params.request.filter.options.spaces.some((key) => key.equals(spaceKey))) {
|
|
2564
2559
|
return;
|
|
2565
2560
|
}
|
|
2561
|
+
const spaceId = await (0, import_echo_protocol3.createIdFromSpaceKey)(import_keys5.PublicKey.from(spaceKey));
|
|
2562
|
+
if (this._params.request.filter.options?.spaceIds?.length && !this._params.request.filter.options.spaceIds.includes(spaceId)) {
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2566
2565
|
if (this._firstRun) {
|
|
2567
2566
|
this.metrics.objectsReturned++;
|
|
2568
2567
|
}
|
|
2569
2568
|
return {
|
|
2570
2569
|
id: objectId,
|
|
2571
2570
|
documentId,
|
|
2572
|
-
spaceId
|
|
2571
|
+
spaceId,
|
|
2573
2572
|
spaceKey: import_keys5.PublicKey.from(spaceKey),
|
|
2574
2573
|
rank: result.rank
|
|
2575
2574
|
};
|
|
@@ -2622,27 +2621,28 @@ QueryState = _ts_decorate5([
|
|
|
2622
2621
|
import_tracing6.trace.resource()
|
|
2623
2622
|
], QueryState);
|
|
2624
2623
|
var filterToIndexQuery = (filter) => {
|
|
2625
|
-
|
|
2624
|
+
const { type = [], or = [] } = filter;
|
|
2625
|
+
(0, import_invariant10.invariant)(!(type.length > 0 && or.length > 0), "Cannot mix type and or filters.", {
|
|
2626
2626
|
F: __dxlog_file10,
|
|
2627
|
-
L:
|
|
2627
|
+
L: 194,
|
|
2628
2628
|
S: void 0,
|
|
2629
2629
|
A: [
|
|
2630
|
-
"!(
|
|
2630
|
+
"!(type.length > 0 && or.length > 0)",
|
|
2631
2631
|
"'Cannot mix type and or filters.'"
|
|
2632
2632
|
]
|
|
2633
2633
|
});
|
|
2634
|
-
(0, import_invariant10.invariant)(
|
|
2634
|
+
(0, import_invariant10.invariant)(or.every((subFilter) => !((subFilter.type ?? []).length > 0 && (subFilter.or ?? []).length > 0)), "Cannot mix type and or filters.", {
|
|
2635
2635
|
F: __dxlog_file10,
|
|
2636
|
-
L:
|
|
2636
|
+
L: 195,
|
|
2637
2637
|
S: void 0,
|
|
2638
2638
|
A: [
|
|
2639
|
-
"
|
|
2639
|
+
"or.every((subFilter) => !((subFilter.type ?? []).length > 0 && (subFilter.or ?? []).length > 0))",
|
|
2640
2640
|
"'Cannot mix type and or filters.'"
|
|
2641
2641
|
]
|
|
2642
2642
|
});
|
|
2643
|
-
if (
|
|
2643
|
+
if (type.length > 0 || or.length > 0 && (or ?? []).every((subFilter) => !subFilter.not && subFilter.type)) {
|
|
2644
2644
|
return {
|
|
2645
|
-
typenames:
|
|
2645
|
+
typenames: type.length > 0 ? type.map((type2) => dxnToIndexerTypename(import_keys5.DXN.parse(type2))) : or.flatMap((f) => (f.type ?? []).map((type2) => dxnToIndexerTypename(import_keys5.DXN.parse(type2))) ?? []).filter(import_util6.isNonNullable),
|
|
2646
2646
|
inverted: filter.not
|
|
2647
2647
|
};
|
|
2648
2648
|
} else {
|
|
@@ -2678,7 +2678,7 @@ var QueryServiceImpl = class extends import_context9.Resource {
|
|
|
2678
2678
|
} catch (err) {
|
|
2679
2679
|
import_log9.log.catch(err, void 0, {
|
|
2680
2680
|
F: __dxlog_file11,
|
|
2681
|
-
L:
|
|
2681
|
+
L: 53,
|
|
2682
2682
|
S: this,
|
|
2683
2683
|
C: (f, a) => f(...a)
|
|
2684
2684
|
});
|
|
@@ -2708,13 +2708,13 @@ var QueryServiceImpl = class extends import_context9.Resource {
|
|
|
2708
2708
|
if (this._params.indexer.initialized) {
|
|
2709
2709
|
import_log9.log.warn("Indexer already initialized.", void 0, {
|
|
2710
2710
|
F: __dxlog_file11,
|
|
2711
|
-
L:
|
|
2711
|
+
L: 87,
|
|
2712
2712
|
S: this,
|
|
2713
2713
|
C: (f, a) => f(...a)
|
|
2714
2714
|
});
|
|
2715
2715
|
return;
|
|
2716
2716
|
}
|
|
2717
|
-
this._params.indexer.setConfig(config);
|
|
2717
|
+
void this._params.indexer.setConfig(config);
|
|
2718
2718
|
}
|
|
2719
2719
|
execQuery(request) {
|
|
2720
2720
|
return new import_stream2.Stream(({ next, close, ctx }) => {
|
|
@@ -2750,7 +2750,7 @@ var QueryServiceImpl = class extends import_context9.Resource {
|
|
|
2750
2750
|
} catch (error) {
|
|
2751
2751
|
import_log9.log.catch(error, void 0, {
|
|
2752
2752
|
F: __dxlog_file11,
|
|
2753
|
-
L:
|
|
2753
|
+
L: 124,
|
|
2754
2754
|
S: this,
|
|
2755
2755
|
C: (f, a) => f(...a)
|
|
2756
2756
|
});
|
|
@@ -2765,7 +2765,7 @@ var QueryServiceImpl = class extends import_context9.Resource {
|
|
|
2765
2765
|
async reindex() {
|
|
2766
2766
|
import_log9.log.info("Reindexing all documents...", void 0, {
|
|
2767
2767
|
F: __dxlog_file11,
|
|
2768
|
-
L:
|
|
2768
|
+
L: 136,
|
|
2769
2769
|
S: this,
|
|
2770
2770
|
C: (f, a) => f(...a)
|
|
2771
2771
|
});
|
|
@@ -2780,7 +2780,7 @@ var QueryServiceImpl = class extends import_context9.Resource {
|
|
|
2780
2780
|
count: ids.size
|
|
2781
2781
|
}, {
|
|
2782
2782
|
F: __dxlog_file11,
|
|
2783
|
-
L:
|
|
2783
|
+
L: 144,
|
|
2784
2784
|
S: this,
|
|
2785
2785
|
C: (f, a) => f(...a)
|
|
2786
2786
|
});
|
|
@@ -2790,7 +2790,7 @@ var QueryServiceImpl = class extends import_context9.Resource {
|
|
|
2790
2790
|
count: ids.size
|
|
2791
2791
|
}, {
|
|
2792
2792
|
F: __dxlog_file11,
|
|
2793
|
-
L:
|
|
2793
|
+
L: 148,
|
|
2794
2794
|
S: this,
|
|
2795
2795
|
C: (f, a) => f(...a)
|
|
2796
2796
|
});
|
|
@@ -2805,10 +2805,10 @@ var createDocumentsIterator = (automergeHost) => (
|
|
|
2805
2805
|
async function* getAllDocuments() {
|
|
2806
2806
|
const visited = /* @__PURE__ */ new Set();
|
|
2807
2807
|
async function* getObjectsFromHandle(handle) {
|
|
2808
|
-
if (visited.has(handle.documentId)) {
|
|
2808
|
+
if (visited.has(handle.documentId) || !handle.isReady()) {
|
|
2809
2809
|
return;
|
|
2810
2810
|
}
|
|
2811
|
-
const doc = handle.
|
|
2811
|
+
const doc = handle.doc();
|
|
2812
2812
|
const spaceKey = getSpaceKeyFromDoc(doc) ?? void 0;
|
|
2813
2813
|
if (doc.objects) {
|
|
2814
2814
|
yield Object.entries(doc.objects).map(([objectId, object]) => {
|
|
@@ -2831,7 +2831,7 @@ var createDocumentsIterator = (automergeHost) => (
|
|
|
2831
2831
|
}
|
|
2832
2832
|
const linkHandle = await automergeHost.loadDoc(import_context9.Context.default(void 0, {
|
|
2833
2833
|
F: __dxlog_file11,
|
|
2834
|
-
L:
|
|
2834
|
+
L: 190
|
|
2835
2835
|
}), urlString);
|
|
2836
2836
|
for await (const result of getObjectsFromHandle(linkHandle)) {
|
|
2837
2837
|
yield result;
|
|
@@ -2866,7 +2866,7 @@ var measureDocMetrics = (doc) => {
|
|
|
2866
2866
|
elapsed: getAllChangesEnd - getAllChangesStart
|
|
2867
2867
|
}, {
|
|
2868
2868
|
F: __dxlog_file12,
|
|
2869
|
-
L:
|
|
2869
|
+
L: 31,
|
|
2870
2870
|
S: void 0,
|
|
2871
2871
|
C: (f, a) => f(...a)
|
|
2872
2872
|
});
|
|
@@ -2902,47 +2902,47 @@ var DatabaseRoot = class {
|
|
|
2902
2902
|
return this._rootHandle.url;
|
|
2903
2903
|
}
|
|
2904
2904
|
get isLoaded() {
|
|
2905
|
-
return
|
|
2905
|
+
return this._rootHandle.isReady();
|
|
2906
2906
|
}
|
|
2907
2907
|
get handle() {
|
|
2908
2908
|
return this._rootHandle;
|
|
2909
2909
|
}
|
|
2910
|
-
|
|
2911
|
-
return this._rootHandle.
|
|
2910
|
+
doc() {
|
|
2911
|
+
return this._rootHandle.isReady() ? this._rootHandle.doc() : null;
|
|
2912
2912
|
}
|
|
2913
2913
|
getVersion() {
|
|
2914
|
-
const doc = this.
|
|
2914
|
+
const doc = this.doc();
|
|
2915
2915
|
if (!doc) {
|
|
2916
2916
|
return null;
|
|
2917
2917
|
}
|
|
2918
2918
|
return doc.version ?? import_echo_protocol4.SpaceDocVersion.LEGACY;
|
|
2919
2919
|
}
|
|
2920
2920
|
getSpaceKey() {
|
|
2921
|
-
const doc = this.
|
|
2921
|
+
const doc = this.doc();
|
|
2922
2922
|
if (!doc) {
|
|
2923
2923
|
return null;
|
|
2924
2924
|
}
|
|
2925
2925
|
return getSpaceKeyFromDoc(doc);
|
|
2926
2926
|
}
|
|
2927
2927
|
getInlineObjectCount() {
|
|
2928
|
-
const doc = this.
|
|
2928
|
+
const doc = this.doc();
|
|
2929
2929
|
if (!doc) {
|
|
2930
2930
|
return null;
|
|
2931
2931
|
}
|
|
2932
2932
|
return Object.keys(doc.objects ?? {}).length;
|
|
2933
2933
|
}
|
|
2934
2934
|
getLinkedObjectCount() {
|
|
2935
|
-
const doc = this.
|
|
2935
|
+
const doc = this.doc();
|
|
2936
2936
|
if (!doc) {
|
|
2937
2937
|
return null;
|
|
2938
2938
|
}
|
|
2939
2939
|
return Object.keys(doc.links ?? {}).length;
|
|
2940
2940
|
}
|
|
2941
2941
|
getAllLinkedDocuments() {
|
|
2942
|
-
const doc = this.
|
|
2942
|
+
const doc = this.doc();
|
|
2943
2943
|
(0, import_invariant11.invariant)(doc, void 0, {
|
|
2944
2944
|
F: __dxlog_file13,
|
|
2945
|
-
L:
|
|
2945
|
+
L: 89,
|
|
2946
2946
|
S: this,
|
|
2947
2947
|
A: [
|
|
2948
2948
|
"doc",
|
|
@@ -2952,7 +2952,7 @@ var DatabaseRoot = class {
|
|
|
2952
2952
|
return Object.values(doc.links ?? {}).map((s) => s.toString());
|
|
2953
2953
|
}
|
|
2954
2954
|
measureMetrics() {
|
|
2955
|
-
const doc = this.
|
|
2955
|
+
const doc = this.doc();
|
|
2956
2956
|
if (!doc) {
|
|
2957
2957
|
return null;
|
|
2958
2958
|
}
|
|
@@ -3067,7 +3067,7 @@ var EchoHost = class extends import_context7.Resource {
|
|
|
3067
3067
|
loadDocuments: createSelectedDocumentsIterator(this._automergeHost),
|
|
3068
3068
|
indexCooldownTime: process.env.NODE_ENV === "test" ? 0 : void 0
|
|
3069
3069
|
});
|
|
3070
|
-
this._indexer.setConfig(INDEXER_CONFIG);
|
|
3070
|
+
void this._indexer.setConfig(INDEXER_CONFIG);
|
|
3071
3071
|
this._queryService = new QueryServiceImpl({
|
|
3072
3072
|
automergeHost: this._automergeHost,
|
|
3073
3073
|
indexer: this._indexer
|
|
@@ -3184,7 +3184,7 @@ var EchoHost = class extends import_context7.Resource {
|
|
|
3184
3184
|
async createSpaceRoot(spaceKey) {
|
|
3185
3185
|
(0, import_invariant8.invariant)(this._lifecycleState === import_context7.LifecycleState.OPEN, void 0, {
|
|
3186
3186
|
F: __dxlog_file15,
|
|
3187
|
-
L:
|
|
3187
|
+
L: 226,
|
|
3188
3188
|
S: this,
|
|
3189
3189
|
A: [
|
|
3190
3190
|
"this._lifecycleState === LifecycleState.OPEN",
|
|
@@ -3212,14 +3212,15 @@ var EchoHost = class extends import_context7.Resource {
|
|
|
3212
3212
|
async openSpaceRoot(spaceId, automergeUrl) {
|
|
3213
3213
|
(0, import_invariant8.invariant)(this._lifecycleState === import_context7.LifecycleState.OPEN, void 0, {
|
|
3214
3214
|
F: __dxlog_file15,
|
|
3215
|
-
L:
|
|
3215
|
+
L: 245,
|
|
3216
3216
|
S: this,
|
|
3217
3217
|
A: [
|
|
3218
3218
|
"this._lifecycleState === LifecycleState.OPEN",
|
|
3219
3219
|
""
|
|
3220
3220
|
]
|
|
3221
3221
|
});
|
|
3222
|
-
const handle = this._automergeHost.repo.find(automergeUrl);
|
|
3222
|
+
const handle = await this._automergeHost.repo.find(automergeUrl, FIND_PARAMS);
|
|
3223
|
+
await handle.whenReady();
|
|
3223
3224
|
return this._spaceStateManager.assignRootToSpace(spaceId, handle);
|
|
3224
3225
|
}
|
|
3225
3226
|
// TODO(dmaretskyi): Change to document id.
|
|
@@ -3373,14 +3374,14 @@ var EchoEdgeReplicator = class {
|
|
|
3373
3374
|
connectedSpaces: this._connectedSpaces.size
|
|
3374
3375
|
}, {
|
|
3375
3376
|
F: __dxlog_file17,
|
|
3376
|
-
L:
|
|
3377
|
+
L: 61,
|
|
3377
3378
|
S: this,
|
|
3378
3379
|
C: (f, a) => f(...a)
|
|
3379
3380
|
});
|
|
3380
3381
|
this._context = context;
|
|
3381
3382
|
this._ctx = import_context12.Context.default(void 0, {
|
|
3382
3383
|
F: __dxlog_file17,
|
|
3383
|
-
L:
|
|
3384
|
+
L: 64
|
|
3384
3385
|
});
|
|
3385
3386
|
this._ctx.onDispose(this._edgeConnection.onReconnected(() => {
|
|
3386
3387
|
this._ctx && (0, import_async8.scheduleMicroTask)(this._ctx, () => this._handleReconnect());
|
|
@@ -3459,7 +3460,7 @@ var EchoEdgeReplicator = class {
|
|
|
3459
3460
|
async _openConnection(spaceId, reconnects = 0) {
|
|
3460
3461
|
(0, import_invariant12.invariant)(this._context, void 0, {
|
|
3461
3462
|
F: __dxlog_file17,
|
|
3462
|
-
L:
|
|
3463
|
+
L: 125,
|
|
3463
3464
|
S: this,
|
|
3464
3465
|
A: [
|
|
3465
3466
|
"this._context",
|
|
@@ -3468,7 +3469,7 @@ var EchoEdgeReplicator = class {
|
|
|
3468
3469
|
});
|
|
3469
3470
|
(0, import_invariant12.invariant)(!this._connections.has(spaceId), void 0, {
|
|
3470
3471
|
F: __dxlog_file17,
|
|
3471
|
-
L:
|
|
3472
|
+
L: 126,
|
|
3472
3473
|
S: this,
|
|
3473
3474
|
A: [
|
|
3474
3475
|
"!this._connections.has(spaceId)",
|
|
@@ -3498,7 +3499,7 @@ var EchoEdgeReplicator = class {
|
|
|
3498
3499
|
restartDelay
|
|
3499
3500
|
}, {
|
|
3500
3501
|
F: __dxlog_file17,
|
|
3501
|
-
L:
|
|
3502
|
+
L: 149,
|
|
3502
3503
|
S: this,
|
|
3503
3504
|
C: (f, a) => f(...a)
|
|
3504
3505
|
});
|
|
@@ -3563,7 +3564,7 @@ var EdgeReplicatorConnection = class extends import_context12.Resource {
|
|
|
3563
3564
|
async _open(ctx) {
|
|
3564
3565
|
(0, import_log11.log)("opening...", void 0, {
|
|
3565
3566
|
F: __dxlog_file17,
|
|
3566
|
-
L:
|
|
3567
|
+
L: 252,
|
|
3567
3568
|
S: this,
|
|
3568
3569
|
C: (f, a) => f(...a)
|
|
3569
3570
|
});
|
|
@@ -3576,7 +3577,7 @@ var EdgeReplicatorConnection = class extends import_context12.Resource {
|
|
|
3576
3577
|
async _close() {
|
|
3577
3578
|
(0, import_log11.log)("closing...", void 0, {
|
|
3578
3579
|
F: __dxlog_file17,
|
|
3579
|
-
L:
|
|
3580
|
+
L: 267,
|
|
3580
3581
|
S: this,
|
|
3581
3582
|
C: (f, a) => f(...a)
|
|
3582
3583
|
});
|
|
@@ -3587,7 +3588,7 @@ var EdgeReplicatorConnection = class extends import_context12.Resource {
|
|
|
3587
3588
|
get peerId() {
|
|
3588
3589
|
(0, import_invariant12.invariant)(this._remotePeerId, "Not connected", {
|
|
3589
3590
|
F: __dxlog_file17,
|
|
3590
|
-
L:
|
|
3591
|
+
L: 276,
|
|
3591
3592
|
S: this,
|
|
3592
3593
|
A: [
|
|
3593
3594
|
"this._remotePeerId",
|
|
@@ -3612,7 +3613,7 @@ var EdgeReplicatorConnection = class extends import_context12.Resource {
|
|
|
3612
3613
|
remoteId: this._remotePeerId
|
|
3613
3614
|
}, {
|
|
3614
3615
|
F: __dxlog_file17,
|
|
3615
|
-
L:
|
|
3616
|
+
L: 291,
|
|
3616
3617
|
S: this,
|
|
3617
3618
|
C: (f, a) => f(...a)
|
|
3618
3619
|
});
|
|
@@ -3638,7 +3639,7 @@ var EdgeReplicatorConnection = class extends import_context12.Resource {
|
|
|
3638
3639
|
remoteId: this._remotePeerId
|
|
3639
3640
|
}, {
|
|
3640
3641
|
F: __dxlog_file17,
|
|
3641
|
-
L:
|
|
3642
|
+
L: 320,
|
|
3642
3643
|
S: this,
|
|
3643
3644
|
C: (f, a) => f(...a)
|
|
3644
3645
|
});
|
|
@@ -3661,7 +3662,7 @@ var EdgeReplicatorConnection = class extends import_context12.Resource {
|
|
|
3661
3662
|
remoteId: this._remotePeerId
|
|
3662
3663
|
}, {
|
|
3663
3664
|
F: __dxlog_file17,
|
|
3664
|
-
L:
|
|
3665
|
+
L: 349,
|
|
3665
3666
|
S: this,
|
|
3666
3667
|
C: (f, a) => f(...a)
|
|
3667
3668
|
});
|
|
@@ -3704,6 +3705,7 @@ var findInlineObjectOfType = (spaceDoc, typename) => {
|
|
|
3704
3705
|
EchoDataMonitor,
|
|
3705
3706
|
EchoEdgeReplicator,
|
|
3706
3707
|
EchoHost,
|
|
3708
|
+
FIND_PARAMS,
|
|
3707
3709
|
LevelDBStorageAdapter,
|
|
3708
3710
|
MOCK_AUTH_PROVIDER,
|
|
3709
3711
|
MOCK_AUTH_VERIFIER,
|