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