@dxos/echo-pipeline 0.6.2-main.8a232a5 → 0.6.2-main.d41f0d2
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-UJQ5VS5V.mjs → chunk-SJUDZ3CQ.mjs} +17 -7
- package/dist/lib/browser/chunk-SJUDZ3CQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +562 -57
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-RH6TDRML.cjs → chunk-NLHNTXVQ.cjs} +20 -10
- package/dist/lib/node/chunk-NLHNTXVQ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +582 -79
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +11 -11
- package/dist/types/src/automerge/automerge-doc-loader.d.ts +71 -0
- package/dist/types/src/automerge/automerge-doc-loader.d.ts.map +1 -0
- package/dist/types/src/automerge/automerge-doc-loader.test.d.ts +2 -0
- package/dist/types/src/automerge/automerge-doc-loader.test.d.ts.map +1 -0
- package/dist/types/src/automerge/automerge-host.d.ts +17 -2
- package/dist/types/src/automerge/automerge-host.d.ts.map +1 -1
- package/dist/types/src/automerge/echo-network-adapter.d.ts +1 -1
- package/dist/types/src/automerge/index.d.ts +2 -0
- package/dist/types/src/automerge/index.d.ts.map +1 -1
- package/dist/types/src/automerge/local-host-network-adapter.d.ts +30 -0
- package/dist/types/src/automerge/local-host-network-adapter.d.ts.map +1 -0
- package/dist/types/src/db-host/data-service.d.ts +5 -2
- package/dist/types/src/db-host/data-service.d.ts.map +1 -1
- package/dist/types/src/db-host/documents-synchronizer.d.ts +1 -1
- package/dist/types/src/db-host/documents-synchronizer.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/automerge/automerge-doc-loader.test.ts +103 -0
- package/src/automerge/automerge-doc-loader.ts +267 -0
- package/src/automerge/automerge-host.ts +56 -6
- package/src/automerge/automerge-repo.test.ts +1 -124
- package/src/automerge/echo-network-adapter.ts +1 -1
- package/src/automerge/index.ts +2 -0
- package/src/automerge/local-host-network-adapter.ts +115 -0
- package/src/db-host/data-service.ts +20 -3
- package/src/db-host/documents-synchronizer.test.ts +1 -1
- package/src/db-host/documents-synchronizer.ts +1 -1
- package/dist/lib/browser/chunk-UJQ5VS5V.mjs.map +0 -7
- package/dist/lib/node/chunk-RH6TDRML.cjs.map +0 -7
|
@@ -26,14 +26,14 @@ import {
|
|
|
26
26
|
mapTimeframeToFeedIndexes,
|
|
27
27
|
startAfter,
|
|
28
28
|
valueEncoding
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-SJUDZ3CQ.mjs";
|
|
30
30
|
|
|
31
31
|
// packages/core/echo/echo-pipeline/src/automerge/automerge-host.ts
|
|
32
32
|
import { Event, asyncTimeout } from "@dxos/async";
|
|
33
|
-
import { next as automerge, getBackend, getHeads, isAutomerge, equals as headsEquals
|
|
33
|
+
import { next as automerge, getBackend, getHeads, isAutomerge, save, equals as headsEquals } from "@dxos/automerge/automerge";
|
|
34
34
|
import { Repo } from "@dxos/automerge/automerge-repo";
|
|
35
35
|
import { Context, Resource as Resource2, cancelWithContext } from "@dxos/context";
|
|
36
|
-
import { invariant as
|
|
36
|
+
import { invariant as invariant3 } from "@dxos/invariant";
|
|
37
37
|
import { PublicKey } from "@dxos/keys";
|
|
38
38
|
import { log as log2 } from "@dxos/log";
|
|
39
39
|
import { objectPointerCodec } from "@dxos/protocols";
|
|
@@ -106,7 +106,7 @@ var EchoNetworkAdapter = class extends NetworkAdapter {
|
|
|
106
106
|
}
|
|
107
107
|
async close() {
|
|
108
108
|
if (this._lifecycleState === LifecycleState.CLOSED) {
|
|
109
|
-
return
|
|
109
|
+
return;
|
|
110
110
|
}
|
|
111
111
|
for (const replicator of this._replicators) {
|
|
112
112
|
await replicator.disconnect();
|
|
@@ -456,6 +456,144 @@ var encodingOptions = {
|
|
|
456
456
|
};
|
|
457
457
|
var isLevelDbNotFoundError = (err) => err.code === "LEVEL_NOT_FOUND";
|
|
458
458
|
|
|
459
|
+
// packages/core/echo/echo-pipeline/src/automerge/local-host-network-adapter.ts
|
|
460
|
+
import { Trigger as Trigger2 } from "@dxos/async";
|
|
461
|
+
import { NetworkAdapter as NetworkAdapter2, cbor } from "@dxos/automerge/automerge-repo";
|
|
462
|
+
import { Stream } from "@dxos/codec-protobuf";
|
|
463
|
+
import { invariant as invariant2 } from "@dxos/invariant";
|
|
464
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/local-host-network-adapter.ts";
|
|
465
|
+
var LocalHostNetworkAdapter = class extends NetworkAdapter2 {
|
|
466
|
+
constructor() {
|
|
467
|
+
super(...arguments);
|
|
468
|
+
this._peers = /* @__PURE__ */ new Map();
|
|
469
|
+
this._connected = new Trigger2();
|
|
470
|
+
this._isConnected = false;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Emits `ready` event. That signals to `Repo` that it can start using the adapter.
|
|
474
|
+
*/
|
|
475
|
+
ready() {
|
|
476
|
+
this.emit("ready", {
|
|
477
|
+
network: this
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Called by `Repo` to connect to the network.
|
|
482
|
+
*
|
|
483
|
+
* @param peerId Our peer Id.
|
|
484
|
+
*/
|
|
485
|
+
connect(peerId) {
|
|
486
|
+
this.peerId = peerId;
|
|
487
|
+
this._isConnected = true;
|
|
488
|
+
this._connected.wake();
|
|
489
|
+
}
|
|
490
|
+
send(message) {
|
|
491
|
+
const peer = this._peers.get(message.targetId);
|
|
492
|
+
invariant2(peer, "Peer not found.", {
|
|
493
|
+
F: __dxlog_file2,
|
|
494
|
+
L: 51,
|
|
495
|
+
S: this,
|
|
496
|
+
A: [
|
|
497
|
+
"peer",
|
|
498
|
+
"'Peer not found.'"
|
|
499
|
+
]
|
|
500
|
+
});
|
|
501
|
+
peer.send(message);
|
|
502
|
+
}
|
|
503
|
+
async close() {
|
|
504
|
+
this._peers.forEach((peer) => peer.disconnect());
|
|
505
|
+
this.emit("close");
|
|
506
|
+
}
|
|
507
|
+
disconnect() {
|
|
508
|
+
}
|
|
509
|
+
async whenConnected() {
|
|
510
|
+
await this._connected.wait({
|
|
511
|
+
timeout: 1e4
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
syncRepo({ id, syncMessage }) {
|
|
515
|
+
const peerId = this._getPeerId(id);
|
|
516
|
+
return new Stream(({ next, close }) => {
|
|
517
|
+
invariant2(!this._peers.has(peerId), "Peer already connected.", {
|
|
518
|
+
F: __dxlog_file2,
|
|
519
|
+
L: 73,
|
|
520
|
+
S: this,
|
|
521
|
+
A: [
|
|
522
|
+
"!this._peers.has(peerId)",
|
|
523
|
+
"'Peer already connected.'"
|
|
524
|
+
]
|
|
525
|
+
});
|
|
526
|
+
this._peers.set(peerId, {
|
|
527
|
+
connected: true,
|
|
528
|
+
send: (message) => {
|
|
529
|
+
next({
|
|
530
|
+
syncMessage: cbor.encode(message)
|
|
531
|
+
});
|
|
532
|
+
},
|
|
533
|
+
disconnect: () => {
|
|
534
|
+
this._peers.delete(peerId);
|
|
535
|
+
close();
|
|
536
|
+
this.emit("peer-disconnected", {
|
|
537
|
+
peerId
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
invariant2(this._isConnected, void 0, {
|
|
542
|
+
F: __dxlog_file2,
|
|
543
|
+
L: 90,
|
|
544
|
+
S: this,
|
|
545
|
+
A: [
|
|
546
|
+
"this._isConnected",
|
|
547
|
+
""
|
|
548
|
+
]
|
|
549
|
+
});
|
|
550
|
+
this.emit("peer-candidate", {
|
|
551
|
+
peerMetadata: {},
|
|
552
|
+
peerId
|
|
553
|
+
});
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
async sendSyncMessage({ id, syncMessage }) {
|
|
557
|
+
invariant2(this._isConnected, void 0, {
|
|
558
|
+
F: __dxlog_file2,
|
|
559
|
+
L: 99,
|
|
560
|
+
S: this,
|
|
561
|
+
A: [
|
|
562
|
+
"this._isConnected",
|
|
563
|
+
""
|
|
564
|
+
]
|
|
565
|
+
});
|
|
566
|
+
const message = cbor.decode(syncMessage);
|
|
567
|
+
this.emit("message", message);
|
|
568
|
+
}
|
|
569
|
+
async getHostInfo() {
|
|
570
|
+
invariant2(this._isConnected, void 0, {
|
|
571
|
+
F: __dxlog_file2,
|
|
572
|
+
L: 105,
|
|
573
|
+
S: this,
|
|
574
|
+
A: [
|
|
575
|
+
"this._isConnected",
|
|
576
|
+
""
|
|
577
|
+
]
|
|
578
|
+
});
|
|
579
|
+
invariant2(this.peerId, "Peer id not set.", {
|
|
580
|
+
F: __dxlog_file2,
|
|
581
|
+
L: 106,
|
|
582
|
+
S: this,
|
|
583
|
+
A: [
|
|
584
|
+
"this.peerId",
|
|
585
|
+
"'Peer id not set.'"
|
|
586
|
+
]
|
|
587
|
+
});
|
|
588
|
+
return {
|
|
589
|
+
peerId: this.peerId
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
_getPeerId(id) {
|
|
593
|
+
return id;
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
|
|
459
597
|
// packages/core/echo/echo-pipeline/src/automerge/automerge-host.ts
|
|
460
598
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
461
599
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -467,7 +605,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
467
605
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
468
606
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
469
607
|
}
|
|
470
|
-
var
|
|
608
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/automerge-host.ts";
|
|
471
609
|
var AutomergeHost = class extends Resource2 {
|
|
472
610
|
constructor({ db, indexMetadataStore }) {
|
|
473
611
|
super();
|
|
@@ -490,20 +628,26 @@ var AutomergeHost = class extends Resource2 {
|
|
|
490
628
|
async _open() {
|
|
491
629
|
this._peerId = `host-${PublicKey.random().toHex()}`;
|
|
492
630
|
await this._storage.open?.();
|
|
631
|
+
this._clientNetwork = new LocalHostNetworkAdapter();
|
|
493
632
|
this._repo = new Repo({
|
|
494
633
|
peerId: this._peerId,
|
|
495
634
|
sharePolicy: this._sharePolicy.bind(this),
|
|
496
635
|
storage: this._storage,
|
|
497
636
|
network: [
|
|
637
|
+
// Downstream client.
|
|
638
|
+
this._clientNetwork,
|
|
498
639
|
// Upstream swarm.
|
|
499
640
|
this._echoNetworkAdapter
|
|
500
641
|
]
|
|
501
642
|
});
|
|
643
|
+
this._clientNetwork.ready();
|
|
502
644
|
await this._echoNetworkAdapter.open();
|
|
645
|
+
await this._clientNetwork.whenConnected();
|
|
503
646
|
await this._echoNetworkAdapter.whenConnected();
|
|
504
647
|
}
|
|
505
648
|
async _close() {
|
|
506
649
|
await this._storage.close?.();
|
|
650
|
+
await this._clientNetwork.close();
|
|
507
651
|
await this._echoNetworkAdapter.close();
|
|
508
652
|
await this._ctx.dispose();
|
|
509
653
|
}
|
|
@@ -565,8 +709,8 @@ var AutomergeHost = class extends Resource2 {
|
|
|
565
709
|
return;
|
|
566
710
|
}
|
|
567
711
|
const handle = await this.loadDoc(Context.default(void 0, {
|
|
568
|
-
F:
|
|
569
|
-
L:
|
|
712
|
+
F: __dxlog_file3,
|
|
713
|
+
L: 207
|
|
570
714
|
}), documentId);
|
|
571
715
|
await waitForHeads(handle, heads2);
|
|
572
716
|
}) ?? []);
|
|
@@ -577,8 +721,8 @@ var AutomergeHost = class extends Resource2 {
|
|
|
577
721
|
log2.info("re-indexing heads for document", {
|
|
578
722
|
documentId
|
|
579
723
|
}, {
|
|
580
|
-
F:
|
|
581
|
-
L:
|
|
724
|
+
F: __dxlog_file3,
|
|
725
|
+
L: 218,
|
|
582
726
|
S: this,
|
|
583
727
|
C: (f, a) => f(...a)
|
|
584
728
|
});
|
|
@@ -593,17 +737,17 @@ var AutomergeHost = class extends Resource2 {
|
|
|
593
737
|
log2.warn("document is not available locally, skipping", {
|
|
594
738
|
documentId
|
|
595
739
|
}, {
|
|
596
|
-
F:
|
|
597
|
-
L:
|
|
740
|
+
F: __dxlog_file3,
|
|
741
|
+
L: 222,
|
|
598
742
|
S: this,
|
|
599
743
|
C: (f, a) => f(...a)
|
|
600
744
|
});
|
|
601
745
|
continue;
|
|
602
746
|
}
|
|
603
747
|
const doc = handle.docSync();
|
|
604
|
-
|
|
605
|
-
F:
|
|
606
|
-
L:
|
|
748
|
+
invariant3(doc, void 0, {
|
|
749
|
+
F: __dxlog_file3,
|
|
750
|
+
L: 227,
|
|
607
751
|
S: this,
|
|
608
752
|
A: [
|
|
609
753
|
"doc",
|
|
@@ -616,8 +760,8 @@ var AutomergeHost = class extends Resource2 {
|
|
|
616
760
|
await batch.write();
|
|
617
761
|
}
|
|
618
762
|
log2.info("done re-indexing heads", void 0, {
|
|
619
|
-
F:
|
|
620
|
-
L:
|
|
763
|
+
F: __dxlog_file3,
|
|
764
|
+
L: 234,
|
|
621
765
|
S: this,
|
|
622
766
|
C: (f, a) => f(...a)
|
|
623
767
|
});
|
|
@@ -710,8 +854,17 @@ var AutomergeHost = class extends Resource2 {
|
|
|
710
854
|
/**
|
|
711
855
|
* Flush documents to disk.
|
|
712
856
|
*/
|
|
713
|
-
async flush({
|
|
714
|
-
|
|
857
|
+
async flush({ states } = {}) {
|
|
858
|
+
if (states) {
|
|
859
|
+
await Promise.all(states.map(async ({ heads, documentId }) => {
|
|
860
|
+
if (!heads) {
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
const handle = this._repo.handles[documentId] ?? this._repo.find(documentId);
|
|
864
|
+
await waitForHeads(handle, heads);
|
|
865
|
+
}) ?? []);
|
|
866
|
+
}
|
|
867
|
+
await this._repo.flush(states?.map(({ documentId }) => documentId));
|
|
715
868
|
}
|
|
716
869
|
async getHeads(documentId) {
|
|
717
870
|
const handle = this._repo.handles[documentId];
|
|
@@ -725,6 +878,24 @@ var AutomergeHost = class extends Resource2 {
|
|
|
725
878
|
return this._headsStore.getHeads(documentId);
|
|
726
879
|
}
|
|
727
880
|
}
|
|
881
|
+
/**
|
|
882
|
+
* Host <-> Client sync.
|
|
883
|
+
*/
|
|
884
|
+
syncRepo(request) {
|
|
885
|
+
return this._clientNetwork.syncRepo(request);
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Host <-> Client sync.
|
|
889
|
+
*/
|
|
890
|
+
sendSyncMessage(request) {
|
|
891
|
+
return this._clientNetwork.sendSyncMessage(request);
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Host <-> Client sync.
|
|
895
|
+
*/
|
|
896
|
+
async getHostInfo() {
|
|
897
|
+
return this._clientNetwork.getHostInfo();
|
|
898
|
+
}
|
|
728
899
|
};
|
|
729
900
|
_ts_decorate2([
|
|
730
901
|
trace.info()
|
|
@@ -770,19 +941,351 @@ var changeIsPresentInDoc = (doc, changeHash) => {
|
|
|
770
941
|
return !!getBackend(doc).getChangeByHash(changeHash);
|
|
771
942
|
};
|
|
772
943
|
|
|
773
|
-
// packages/core/echo/echo-pipeline/src/automerge/
|
|
944
|
+
// packages/core/echo/echo-pipeline/src/automerge/automerge-doc-loader.ts
|
|
945
|
+
import { Event as Event2 } from "@dxos/async";
|
|
946
|
+
import { interpretAsDocumentId } from "@dxos/automerge/automerge-repo";
|
|
947
|
+
import { cancelWithContext as cancelWithContext2 } from "@dxos/context";
|
|
948
|
+
import { warnAfterTimeout } from "@dxos/debug";
|
|
949
|
+
import { SpaceDocVersion } from "@dxos/echo-protocol";
|
|
774
950
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
951
|
+
import { log as log3 } from "@dxos/log";
|
|
952
|
+
import { trace as trace2 } from "@dxos/tracing";
|
|
953
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
954
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
955
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
956
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
957
|
+
else
|
|
958
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
959
|
+
if (d = decorators[i])
|
|
960
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
961
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
962
|
+
}
|
|
963
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/automerge-doc-loader.ts";
|
|
964
|
+
var AutomergeDocumentLoaderImpl = class {
|
|
965
|
+
constructor(_spaceId, _repo, _spaceKey) {
|
|
966
|
+
this._spaceId = _spaceId;
|
|
967
|
+
this._repo = _repo;
|
|
968
|
+
this._spaceKey = _spaceKey;
|
|
969
|
+
this._spaceRootDocHandle = null;
|
|
970
|
+
this._objectDocumentHandles = /* @__PURE__ */ new Map();
|
|
971
|
+
this._objectsPendingDocumentLoad = /* @__PURE__ */ new Set();
|
|
972
|
+
this.onObjectDocumentLoaded = new Event2();
|
|
973
|
+
}
|
|
974
|
+
getAllHandles() {
|
|
975
|
+
return this._spaceRootDocHandle != null ? [
|
|
976
|
+
this._spaceRootDocHandle,
|
|
977
|
+
...new Set(this._objectDocumentHandles.values())
|
|
978
|
+
] : [];
|
|
979
|
+
}
|
|
980
|
+
async loadSpaceRootDocHandle(ctx, spaceState) {
|
|
981
|
+
if (this._spaceRootDocHandle != null) {
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
if (!spaceState.rootUrl) {
|
|
985
|
+
throw new Error("Database opened with no rootUrl");
|
|
986
|
+
}
|
|
987
|
+
const existingDocHandle = await this._initDocHandle(ctx, spaceState.rootUrl);
|
|
988
|
+
const doc = existingDocHandle.docSync();
|
|
989
|
+
invariant4(doc, void 0, {
|
|
990
|
+
F: __dxlog_file4,
|
|
991
|
+
L: 84,
|
|
992
|
+
S: this,
|
|
993
|
+
A: [
|
|
994
|
+
"doc",
|
|
995
|
+
""
|
|
996
|
+
]
|
|
997
|
+
});
|
|
998
|
+
invariant4(doc.version === SpaceDocVersion.CURRENT, void 0, {
|
|
999
|
+
F: __dxlog_file4,
|
|
1000
|
+
L: 85,
|
|
1001
|
+
S: this,
|
|
1002
|
+
A: [
|
|
1003
|
+
"doc.version === SpaceDocVersion.CURRENT",
|
|
1004
|
+
""
|
|
1005
|
+
]
|
|
1006
|
+
});
|
|
1007
|
+
if (doc.access == null) {
|
|
1008
|
+
this._initDocAccess(existingDocHandle);
|
|
1009
|
+
}
|
|
1010
|
+
this._spaceRootDocHandle = existingDocHandle;
|
|
1011
|
+
}
|
|
1012
|
+
loadObjectDocument(objectIdOrMany) {
|
|
1013
|
+
const objectIds = Array.isArray(objectIdOrMany) ? objectIdOrMany : [
|
|
1014
|
+
objectIdOrMany
|
|
1015
|
+
];
|
|
1016
|
+
let hasUrlsToLoad = false;
|
|
1017
|
+
const urlsToLoad = {};
|
|
1018
|
+
for (const objectId of objectIds) {
|
|
1019
|
+
invariant4(this._spaceRootDocHandle, void 0, {
|
|
1020
|
+
F: __dxlog_file4,
|
|
1021
|
+
L: 97,
|
|
1022
|
+
S: this,
|
|
1023
|
+
A: [
|
|
1024
|
+
"this._spaceRootDocHandle",
|
|
1025
|
+
""
|
|
1026
|
+
]
|
|
1027
|
+
});
|
|
1028
|
+
if (this._objectDocumentHandles.has(objectId) || this._objectsPendingDocumentLoad.has(objectId)) {
|
|
1029
|
+
continue;
|
|
1030
|
+
}
|
|
1031
|
+
const spaceRootDoc = this._spaceRootDocHandle.docSync();
|
|
1032
|
+
invariant4(spaceRootDoc, void 0, {
|
|
1033
|
+
F: __dxlog_file4,
|
|
1034
|
+
L: 102,
|
|
1035
|
+
S: this,
|
|
1036
|
+
A: [
|
|
1037
|
+
"spaceRootDoc",
|
|
1038
|
+
""
|
|
1039
|
+
]
|
|
1040
|
+
});
|
|
1041
|
+
const documentUrl = (spaceRootDoc.links ?? {})[objectId];
|
|
1042
|
+
if (documentUrl == null) {
|
|
1043
|
+
this._objectsPendingDocumentLoad.add(objectId);
|
|
1044
|
+
log3.info("loading delayed until object links are initialized", {
|
|
1045
|
+
objectId
|
|
1046
|
+
}, {
|
|
1047
|
+
F: __dxlog_file4,
|
|
1048
|
+
L: 106,
|
|
1049
|
+
S: this,
|
|
1050
|
+
C: (f, a) => f(...a)
|
|
1051
|
+
});
|
|
1052
|
+
} else {
|
|
1053
|
+
urlsToLoad[objectId] = documentUrl;
|
|
1054
|
+
hasUrlsToLoad = true;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
if (hasUrlsToLoad) {
|
|
1058
|
+
this._loadLinkedObjects(urlsToLoad);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
getObjectDocumentId(objectId) {
|
|
1062
|
+
invariant4(this._spaceRootDocHandle, void 0, {
|
|
1063
|
+
F: __dxlog_file4,
|
|
1064
|
+
L: 118,
|
|
1065
|
+
S: this,
|
|
1066
|
+
A: [
|
|
1067
|
+
"this._spaceRootDocHandle",
|
|
1068
|
+
""
|
|
1069
|
+
]
|
|
1070
|
+
});
|
|
1071
|
+
const spaceRootDoc = this._spaceRootDocHandle.docSync();
|
|
1072
|
+
invariant4(spaceRootDoc, void 0, {
|
|
1073
|
+
F: __dxlog_file4,
|
|
1074
|
+
L: 120,
|
|
1075
|
+
S: this,
|
|
1076
|
+
A: [
|
|
1077
|
+
"spaceRootDoc",
|
|
1078
|
+
""
|
|
1079
|
+
]
|
|
1080
|
+
});
|
|
1081
|
+
if (spaceRootDoc.objects?.[objectId]) {
|
|
1082
|
+
return this._spaceRootDocHandle.documentId;
|
|
1083
|
+
}
|
|
1084
|
+
const documentUrl = (spaceRootDoc.links ?? {})[objectId];
|
|
1085
|
+
return documentUrl && interpretAsDocumentId(documentUrl);
|
|
1086
|
+
}
|
|
1087
|
+
onObjectLinksUpdated(links) {
|
|
1088
|
+
if (!links) {
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
const linksAwaitingLoad = Object.entries(links).filter(([objectId]) => this._objectsPendingDocumentLoad.has(objectId));
|
|
1092
|
+
this._loadLinkedObjects(Object.fromEntries(linksAwaitingLoad));
|
|
1093
|
+
linksAwaitingLoad.forEach(([objectId]) => this._objectsPendingDocumentLoad.delete(objectId));
|
|
1094
|
+
}
|
|
1095
|
+
getSpaceRootDocHandle() {
|
|
1096
|
+
invariant4(this._spaceRootDocHandle, void 0, {
|
|
1097
|
+
F: __dxlog_file4,
|
|
1098
|
+
L: 140,
|
|
1099
|
+
S: this,
|
|
1100
|
+
A: [
|
|
1101
|
+
"this._spaceRootDocHandle",
|
|
1102
|
+
""
|
|
1103
|
+
]
|
|
1104
|
+
});
|
|
1105
|
+
return this._spaceRootDocHandle;
|
|
1106
|
+
}
|
|
1107
|
+
createDocumentForObject(objectId) {
|
|
1108
|
+
invariant4(this._spaceRootDocHandle, void 0, {
|
|
1109
|
+
F: __dxlog_file4,
|
|
1110
|
+
L: 145,
|
|
1111
|
+
S: this,
|
|
1112
|
+
A: [
|
|
1113
|
+
"this._spaceRootDocHandle",
|
|
1114
|
+
""
|
|
1115
|
+
]
|
|
1116
|
+
});
|
|
1117
|
+
const spaceDocHandle = this._repo.create({
|
|
1118
|
+
version: SpaceDocVersion.CURRENT
|
|
1119
|
+
});
|
|
1120
|
+
this._initDocAccess(spaceDocHandle);
|
|
1121
|
+
this.onObjectBoundToDocument(spaceDocHandle, objectId);
|
|
1122
|
+
this._spaceRootDocHandle.change((newDoc) => {
|
|
1123
|
+
newDoc.links ??= {};
|
|
1124
|
+
newDoc.links[objectId] = spaceDocHandle.url;
|
|
1125
|
+
});
|
|
1126
|
+
return spaceDocHandle;
|
|
1127
|
+
}
|
|
1128
|
+
onObjectBoundToDocument(handle, objectId) {
|
|
1129
|
+
this._objectDocumentHandles.set(objectId, handle);
|
|
1130
|
+
}
|
|
1131
|
+
clearHandleReferences() {
|
|
1132
|
+
const objectsWithHandles = [
|
|
1133
|
+
...this._objectDocumentHandles.keys()
|
|
1134
|
+
];
|
|
1135
|
+
this._objectDocumentHandles.clear();
|
|
1136
|
+
this._spaceRootDocHandle = null;
|
|
1137
|
+
return objectsWithHandles;
|
|
1138
|
+
}
|
|
1139
|
+
_loadLinkedObjects(links) {
|
|
1140
|
+
if (!links) {
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
for (const [objectId, automergeUrl] of Object.entries(links)) {
|
|
1144
|
+
const logMeta = {
|
|
1145
|
+
objectId,
|
|
1146
|
+
automergeUrl
|
|
1147
|
+
};
|
|
1148
|
+
const objectDocumentHandle = this._objectDocumentHandles.get(objectId);
|
|
1149
|
+
if (objectDocumentHandle != null && objectDocumentHandle.url !== automergeUrl) {
|
|
1150
|
+
log3.warn("object already inlined in a different document, ignoring the link", {
|
|
1151
|
+
...logMeta,
|
|
1152
|
+
actualDocumentUrl: objectDocumentHandle.url
|
|
1153
|
+
}, {
|
|
1154
|
+
F: __dxlog_file4,
|
|
1155
|
+
L: 177,
|
|
1156
|
+
S: this,
|
|
1157
|
+
C: (f, a) => f(...a)
|
|
1158
|
+
});
|
|
1159
|
+
continue;
|
|
1160
|
+
}
|
|
1161
|
+
if (objectDocumentHandle?.url === automergeUrl) {
|
|
1162
|
+
log3.warn("object document was already loaded", logMeta, {
|
|
1163
|
+
F: __dxlog_file4,
|
|
1164
|
+
L: 184,
|
|
1165
|
+
S: this,
|
|
1166
|
+
C: (f, a) => f(...a)
|
|
1167
|
+
});
|
|
1168
|
+
continue;
|
|
1169
|
+
}
|
|
1170
|
+
const handle = this._repo.find(automergeUrl);
|
|
1171
|
+
log3.debug("document loading triggered", logMeta, {
|
|
1172
|
+
F: __dxlog_file4,
|
|
1173
|
+
L: 188,
|
|
1174
|
+
S: this,
|
|
1175
|
+
C: (f, a) => f(...a)
|
|
1176
|
+
});
|
|
1177
|
+
this._objectDocumentHandles.set(objectId, handle);
|
|
1178
|
+
void this._createObjectOnDocumentLoad(handle, objectId);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
async _initDocHandle(ctx, url) {
|
|
1182
|
+
const docHandle = this._repo.find(url);
|
|
1183
|
+
while (true) {
|
|
1184
|
+
try {
|
|
1185
|
+
await warnAfterTimeout(5e3, "Automerge root doc load timeout (CoreDatabase)", async () => {
|
|
1186
|
+
await cancelWithContext2(ctx, docHandle.whenReady());
|
|
1187
|
+
});
|
|
1188
|
+
break;
|
|
1189
|
+
} catch (err) {
|
|
1190
|
+
if (`${err}`.includes("Timeout")) {
|
|
1191
|
+
log3.info("wraparound", {
|
|
1192
|
+
id: docHandle.documentId,
|
|
1193
|
+
state: docHandle.state
|
|
1194
|
+
}, {
|
|
1195
|
+
F: __dxlog_file4,
|
|
1196
|
+
L: 204,
|
|
1197
|
+
S: this,
|
|
1198
|
+
C: (f, a) => f(...a)
|
|
1199
|
+
});
|
|
1200
|
+
continue;
|
|
1201
|
+
}
|
|
1202
|
+
throw err;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
if (docHandle.state === "unavailable") {
|
|
1206
|
+
throw new Error("Automerge document is unavailable");
|
|
1207
|
+
}
|
|
1208
|
+
return docHandle;
|
|
1209
|
+
}
|
|
1210
|
+
_initDocAccess(handle) {
|
|
1211
|
+
handle.change((newDoc) => {
|
|
1212
|
+
newDoc.access ??= {
|
|
1213
|
+
spaceKey: this._spaceKey.toHex()
|
|
1214
|
+
};
|
|
1215
|
+
newDoc.access.spaceKey = this._spaceKey.toHex();
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
async _createObjectOnDocumentLoad(handle, objectId) {
|
|
1219
|
+
try {
|
|
1220
|
+
await handle.whenReady();
|
|
1221
|
+
const logMeta = {
|
|
1222
|
+
objectId,
|
|
1223
|
+
docUrl: handle.url
|
|
1224
|
+
};
|
|
1225
|
+
if (this.onObjectDocumentLoaded.listenerCount() === 0) {
|
|
1226
|
+
log3.info("document loaded after all listeners were removed", logMeta, {
|
|
1227
|
+
F: __dxlog_file4,
|
|
1228
|
+
L: 231,
|
|
1229
|
+
S: this,
|
|
1230
|
+
C: (f, a) => f(...a)
|
|
1231
|
+
});
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
1234
|
+
const objectDocHandle = this._objectDocumentHandles.get(objectId);
|
|
1235
|
+
if (objectDocHandle?.url !== handle.url) {
|
|
1236
|
+
log3.warn("object was rebound while a document was loading, discarding handle", logMeta, {
|
|
1237
|
+
F: __dxlog_file4,
|
|
1238
|
+
L: 236,
|
|
1239
|
+
S: this,
|
|
1240
|
+
C: (f, a) => f(...a)
|
|
1241
|
+
});
|
|
1242
|
+
return;
|
|
1243
|
+
}
|
|
1244
|
+
this.onObjectDocumentLoaded.emit({
|
|
1245
|
+
handle,
|
|
1246
|
+
objectId
|
|
1247
|
+
});
|
|
1248
|
+
} catch (err) {
|
|
1249
|
+
const shouldRetryLoading = this.onObjectDocumentLoaded.listenerCount() > 0;
|
|
1250
|
+
log3.warn("failed to load a document", {
|
|
1251
|
+
objectId,
|
|
1252
|
+
automergeUrl: handle.url,
|
|
1253
|
+
retryLoading: shouldRetryLoading,
|
|
1254
|
+
err
|
|
1255
|
+
}, {
|
|
1256
|
+
F: __dxlog_file4,
|
|
1257
|
+
L: 242,
|
|
1258
|
+
S: this,
|
|
1259
|
+
C: (f, a) => f(...a)
|
|
1260
|
+
});
|
|
1261
|
+
if (shouldRetryLoading) {
|
|
1262
|
+
await this._createObjectOnDocumentLoad(handle, objectId);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
_ts_decorate3([
|
|
1268
|
+
trace2.span({
|
|
1269
|
+
showInBrowserTimeline: true
|
|
1270
|
+
})
|
|
1271
|
+
], AutomergeDocumentLoaderImpl.prototype, "loadSpaceRootDocHandle", null);
|
|
1272
|
+
AutomergeDocumentLoaderImpl = _ts_decorate3([
|
|
1273
|
+
trace2.resource()
|
|
1274
|
+
], AutomergeDocumentLoaderImpl);
|
|
1275
|
+
|
|
1276
|
+
// packages/core/echo/echo-pipeline/src/automerge/mesh-echo-replicator.ts
|
|
1277
|
+
import { invariant as invariant6 } from "@dxos/invariant";
|
|
775
1278
|
import { PublicKey as PublicKey2 } from "@dxos/keys";
|
|
776
|
-
import { log as
|
|
1279
|
+
import { log as log5 } from "@dxos/log";
|
|
777
1280
|
import { ComplexMap, ComplexSet, defaultMap } from "@dxos/util";
|
|
778
1281
|
|
|
779
1282
|
// packages/core/echo/echo-pipeline/src/automerge/mesh-echo-replicator-connection.ts
|
|
780
|
-
import { cbor } from "@dxos/automerge/automerge-repo";
|
|
1283
|
+
import { cbor as cbor2 } from "@dxos/automerge/automerge-repo";
|
|
781
1284
|
import { Resource as Resource3 } from "@dxos/context";
|
|
782
|
-
import { invariant as
|
|
783
|
-
import { log as
|
|
1285
|
+
import { invariant as invariant5 } from "@dxos/invariant";
|
|
1286
|
+
import { log as log4 } from "@dxos/log";
|
|
784
1287
|
import { AutomergeReplicator } from "@dxos/teleport-extension-automerge-replicator";
|
|
785
|
-
var
|
|
1288
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/mesh-echo-replicator-connection.ts";
|
|
786
1289
|
var DEFAULT_FACTORY = (params) => new AutomergeReplicator(...params);
|
|
787
1290
|
var MeshReplicatorConnection = class extends Resource3 {
|
|
788
1291
|
constructor(_params) {
|
|
@@ -800,8 +1303,8 @@ var MeshReplicatorConnection = class extends Resource3 {
|
|
|
800
1303
|
});
|
|
801
1304
|
this.writable = new WritableStream({
|
|
802
1305
|
write: async (message, controller) => {
|
|
803
|
-
|
|
804
|
-
F:
|
|
1306
|
+
invariant5(this._isEnabled, "Writing to a disabled connection", {
|
|
1307
|
+
F: __dxlog_file5,
|
|
805
1308
|
L: 47,
|
|
806
1309
|
S: this,
|
|
807
1310
|
A: [
|
|
@@ -811,7 +1314,7 @@ var MeshReplicatorConnection = class extends Resource3 {
|
|
|
811
1314
|
});
|
|
812
1315
|
try {
|
|
813
1316
|
await this.replicatorExtension.sendSyncMessage({
|
|
814
|
-
payload:
|
|
1317
|
+
payload: cbor2.encode(message)
|
|
815
1318
|
});
|
|
816
1319
|
} catch (err) {
|
|
817
1320
|
controller.error(err);
|
|
@@ -828,12 +1331,12 @@ var MeshReplicatorConnection = class extends Resource3 {
|
|
|
828
1331
|
onStartReplication: async (info, remotePeerId) => {
|
|
829
1332
|
this.remoteDeviceKey = remotePeerId;
|
|
830
1333
|
this._remotePeerId = info.id;
|
|
831
|
-
|
|
1334
|
+
log4("onStartReplication", {
|
|
832
1335
|
id: info.id,
|
|
833
1336
|
thisPeerId: this.peerId,
|
|
834
1337
|
remotePeerId: remotePeerId.toHex()
|
|
835
1338
|
}, {
|
|
836
|
-
F:
|
|
1339
|
+
F: __dxlog_file5,
|
|
837
1340
|
L: 81,
|
|
838
1341
|
S: this,
|
|
839
1342
|
C: (f, a) => f(...a)
|
|
@@ -844,7 +1347,7 @@ var MeshReplicatorConnection = class extends Resource3 {
|
|
|
844
1347
|
if (!this._isEnabled) {
|
|
845
1348
|
return;
|
|
846
1349
|
}
|
|
847
|
-
const message =
|
|
1350
|
+
const message = cbor2.decode(payload);
|
|
848
1351
|
readableStreamController.enqueue(message);
|
|
849
1352
|
},
|
|
850
1353
|
onClose: async () => {
|
|
@@ -859,8 +1362,8 @@ var MeshReplicatorConnection = class extends Resource3 {
|
|
|
859
1362
|
}
|
|
860
1363
|
}
|
|
861
1364
|
get peerId() {
|
|
862
|
-
|
|
863
|
-
F:
|
|
1365
|
+
invariant5(this._remotePeerId != null, "Remote peer has not connected yet.", {
|
|
1366
|
+
F: __dxlog_file5,
|
|
864
1367
|
L: 107,
|
|
865
1368
|
S: this,
|
|
866
1369
|
A: [
|
|
@@ -878,8 +1381,8 @@ var MeshReplicatorConnection = class extends Resource3 {
|
|
|
878
1381
|
* Call after the remote peer has connected.
|
|
879
1382
|
*/
|
|
880
1383
|
enable() {
|
|
881
|
-
|
|
882
|
-
F:
|
|
1384
|
+
invariant5(this._remotePeerId != null, "Remote peer has not connected yet.", {
|
|
1385
|
+
F: __dxlog_file5,
|
|
883
1386
|
L: 120,
|
|
884
1387
|
S: this,
|
|
885
1388
|
A: [
|
|
@@ -898,7 +1401,7 @@ var MeshReplicatorConnection = class extends Resource3 {
|
|
|
898
1401
|
};
|
|
899
1402
|
|
|
900
1403
|
// packages/core/echo/echo-pipeline/src/automerge/mesh-echo-replicator.ts
|
|
901
|
-
var
|
|
1404
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/mesh-echo-replicator.ts";
|
|
902
1405
|
var MeshEchoReplicator = class {
|
|
903
1406
|
constructor() {
|
|
904
1407
|
this._connections = /* @__PURE__ */ new Set();
|
|
@@ -924,8 +1427,8 @@ var MeshEchoReplicator = class {
|
|
|
924
1427
|
this._context = null;
|
|
925
1428
|
}
|
|
926
1429
|
createExtension(extensionFactory) {
|
|
927
|
-
|
|
928
|
-
F:
|
|
1430
|
+
invariant6(this._context, void 0, {
|
|
1431
|
+
F: __dxlog_file6,
|
|
929
1432
|
L: 51,
|
|
930
1433
|
S: this,
|
|
931
1434
|
A: [
|
|
@@ -937,16 +1440,16 @@ var MeshEchoReplicator = class {
|
|
|
937
1440
|
ownPeerId: this._context.peerId,
|
|
938
1441
|
replicatorFactory: extensionFactory,
|
|
939
1442
|
onRemoteConnected: async () => {
|
|
940
|
-
|
|
1443
|
+
log5("onRemoteConnected", {
|
|
941
1444
|
peerId: connection.peerId
|
|
942
1445
|
}, {
|
|
943
|
-
F:
|
|
1446
|
+
F: __dxlog_file6,
|
|
944
1447
|
L: 57,
|
|
945
1448
|
S: this,
|
|
946
1449
|
C: (f, a) => f(...a)
|
|
947
1450
|
});
|
|
948
|
-
|
|
949
|
-
F:
|
|
1451
|
+
invariant6(this._context, void 0, {
|
|
1452
|
+
F: __dxlog_file6,
|
|
950
1453
|
L: 58,
|
|
951
1454
|
S: this,
|
|
952
1455
|
A: [
|
|
@@ -963,10 +1466,10 @@ var MeshEchoReplicator = class {
|
|
|
963
1466
|
}
|
|
964
1467
|
},
|
|
965
1468
|
onRemoteDisconnected: async () => {
|
|
966
|
-
|
|
1469
|
+
log5("onRemoteDisconnected", {
|
|
967
1470
|
peerId: connection.peerId
|
|
968
1471
|
}, {
|
|
969
|
-
F:
|
|
1472
|
+
F: __dxlog_file6,
|
|
970
1473
|
L: 69,
|
|
971
1474
|
S: this,
|
|
972
1475
|
C: (f, a) => f(...a)
|
|
@@ -977,17 +1480,17 @@ var MeshEchoReplicator = class {
|
|
|
977
1480
|
this._connections.delete(connection);
|
|
978
1481
|
},
|
|
979
1482
|
shouldAdvertise: async (params) => {
|
|
980
|
-
|
|
1483
|
+
log5("shouldAdvertise", {
|
|
981
1484
|
peerId: connection.peerId,
|
|
982
1485
|
documentId: params.documentId
|
|
983
1486
|
}, {
|
|
984
|
-
F:
|
|
1487
|
+
F: __dxlog_file6,
|
|
985
1488
|
L: 76,
|
|
986
1489
|
S: this,
|
|
987
1490
|
C: (f, a) => f(...a)
|
|
988
1491
|
});
|
|
989
|
-
|
|
990
|
-
F:
|
|
1492
|
+
invariant6(this._context, void 0, {
|
|
1493
|
+
F: __dxlog_file6,
|
|
991
1494
|
L: 77,
|
|
992
1495
|
S: this,
|
|
993
1496
|
A: [
|
|
@@ -998,11 +1501,11 @@ var MeshEchoReplicator = class {
|
|
|
998
1501
|
try {
|
|
999
1502
|
const spaceKey = await this._context.getContainingSpaceForDocument(params.documentId);
|
|
1000
1503
|
if (!spaceKey) {
|
|
1001
|
-
|
|
1504
|
+
log5("space key not found for share policy check", {
|
|
1002
1505
|
peerId: connection.peerId,
|
|
1003
1506
|
documentId: params.documentId
|
|
1004
1507
|
}, {
|
|
1005
|
-
F:
|
|
1508
|
+
F: __dxlog_file6,
|
|
1006
1509
|
L: 81,
|
|
1007
1510
|
S: this,
|
|
1008
1511
|
C: (f, a) => f(...a)
|
|
@@ -1011,11 +1514,11 @@ var MeshEchoReplicator = class {
|
|
|
1011
1514
|
}
|
|
1012
1515
|
const authorizedDevices = this._authorizedDevices.get(spaceKey);
|
|
1013
1516
|
if (!connection.remoteDeviceKey) {
|
|
1014
|
-
|
|
1517
|
+
log5("device key not found for share policy check", {
|
|
1015
1518
|
peerId: connection.peerId,
|
|
1016
1519
|
documentId: params.documentId
|
|
1017
1520
|
}, {
|
|
1018
|
-
F:
|
|
1521
|
+
F: __dxlog_file6,
|
|
1019
1522
|
L: 91,
|
|
1020
1523
|
S: this,
|
|
1021
1524
|
C: (f, a) => f(...a)
|
|
@@ -1023,7 +1526,7 @@ var MeshEchoReplicator = class {
|
|
|
1023
1526
|
return false;
|
|
1024
1527
|
}
|
|
1025
1528
|
const isAuthorized = authorizedDevices?.has(connection.remoteDeviceKey) ?? false;
|
|
1026
|
-
|
|
1529
|
+
log5("share policy check", {
|
|
1027
1530
|
localPeer: this._context.peerId,
|
|
1028
1531
|
remotePeer: connection.peerId,
|
|
1029
1532
|
documentId: params.documentId,
|
|
@@ -1031,15 +1534,15 @@ var MeshEchoReplicator = class {
|
|
|
1031
1534
|
spaceKey,
|
|
1032
1535
|
isAuthorized
|
|
1033
1536
|
}, {
|
|
1034
|
-
F:
|
|
1537
|
+
F: __dxlog_file6,
|
|
1035
1538
|
L: 99,
|
|
1036
1539
|
S: this,
|
|
1037
1540
|
C: (f, a) => f(...a)
|
|
1038
1541
|
});
|
|
1039
1542
|
return isAuthorized;
|
|
1040
1543
|
} catch (err) {
|
|
1041
|
-
|
|
1042
|
-
F:
|
|
1544
|
+
log5.catch(err, void 0, {
|
|
1545
|
+
F: __dxlog_file6,
|
|
1043
1546
|
L: 109,
|
|
1044
1547
|
S: this,
|
|
1045
1548
|
C: (f, a) => f(...a)
|
|
@@ -1052,11 +1555,11 @@ var MeshEchoReplicator = class {
|
|
|
1052
1555
|
return connection.replicatorExtension;
|
|
1053
1556
|
}
|
|
1054
1557
|
authorizeDevice(spaceKey, deviceKey) {
|
|
1055
|
-
|
|
1558
|
+
log5("authorizeDevice", {
|
|
1056
1559
|
spaceKey,
|
|
1057
1560
|
deviceKey
|
|
1058
1561
|
}, {
|
|
1059
|
-
F:
|
|
1562
|
+
F: __dxlog_file6,
|
|
1060
1563
|
L: 120,
|
|
1061
1564
|
S: this,
|
|
1062
1565
|
C: (f, a) => f(...a)
|
|
@@ -1074,12 +1577,14 @@ var MeshEchoReplicator = class {
|
|
|
1074
1577
|
export {
|
|
1075
1578
|
AuthExtension,
|
|
1076
1579
|
AuthStatus,
|
|
1580
|
+
AutomergeDocumentLoaderImpl,
|
|
1077
1581
|
AutomergeHost,
|
|
1078
1582
|
CredentialRetrieverExtension,
|
|
1079
1583
|
CredentialServerExtension,
|
|
1080
1584
|
DataServiceImpl,
|
|
1081
1585
|
DocumentsSynchronizer,
|
|
1082
1586
|
LevelDBStorageAdapter,
|
|
1587
|
+
LocalHostNetworkAdapter,
|
|
1083
1588
|
MOCK_AUTH_PROVIDER,
|
|
1084
1589
|
MOCK_AUTH_VERIFIER,
|
|
1085
1590
|
MeshEchoReplicator,
|