@dxos/echo-db 2.33.2-dev.8bbf1b5a → 2.33.2
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/src/echo.d.ts +8 -8
- package/dist/src/echo.d.ts.map +1 -1
- package/dist/src/echo.js +15 -16
- package/dist/src/echo.js.map +1 -1
- package/dist/src/echo.test.js +7 -13
- package/dist/src/echo.test.js.map +1 -1
- package/dist/src/halo/contact-manager.d.ts +4 -4
- package/dist/src/halo/contact-manager.d.ts.map +1 -1
- package/dist/src/halo/contact-manager.js +10 -4
- package/dist/src/halo/contact-manager.js.map +1 -1
- package/dist/src/halo/halo-factory.d.ts +14 -9
- package/dist/src/halo/halo-factory.d.ts.map +1 -1
- package/dist/src/halo/halo-factory.js +47 -14
- package/dist/src/halo/halo-factory.js.map +1 -1
- package/dist/src/halo/halo-party.d.ts +35 -7
- package/dist/src/halo/halo-party.d.ts.map +1 -1
- package/dist/src/halo/halo-party.js +97 -18
- package/dist/src/halo/halo-party.js.map +1 -1
- package/dist/src/halo/halo.d.ts +14 -12
- package/dist/src/halo/halo.d.ts.map +1 -1
- package/dist/src/halo/halo.js +31 -29
- package/dist/src/halo/halo.js.map +1 -1
- package/dist/src/halo/halo.test.d.ts +2 -0
- package/dist/src/halo/halo.test.d.ts.map +1 -0
- package/dist/src/halo/halo.test.js +162 -0
- package/dist/src/halo/halo.test.js.map +1 -0
- package/dist/src/halo/identity-manager.d.ts +10 -8
- package/dist/src/halo/identity-manager.d.ts.map +1 -1
- package/dist/src/halo/identity-manager.js +24 -20
- package/dist/src/halo/identity-manager.js.map +1 -1
- package/dist/src/halo/identity.d.ts +12 -6
- package/dist/src/halo/identity.d.ts.map +1 -1
- package/dist/src/halo/identity.js +11 -15
- package/dist/src/halo/identity.js.map +1 -1
- package/dist/src/halo/index.d.ts +1 -1
- package/dist/src/halo/index.d.ts.map +1 -1
- package/dist/src/halo/index.js +1 -1
- package/dist/src/halo/index.js.map +1 -1
- package/dist/src/halo/party-opener.js +1 -1
- package/dist/src/halo/party-opener.js.map +1 -1
- package/dist/src/halo/preferences.d.ts +9 -9
- package/dist/src/halo/preferences.d.ts.map +1 -1
- package/dist/src/halo/preferences.js +25 -15
- package/dist/src/halo/preferences.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/invitations/greeting-initiator.d.ts +14 -4
- package/dist/src/invitations/greeting-initiator.d.ts.map +1 -1
- package/dist/src/invitations/greeting-initiator.js +15 -16
- package/dist/src/invitations/greeting-initiator.js.map +1 -1
- package/dist/src/invitations/greeting-responder.d.ts +3 -3
- package/dist/src/invitations/greeting-responder.d.ts.map +1 -1
- package/dist/src/invitations/greeting-responder.js +3 -4
- package/dist/src/invitations/greeting-responder.js.map +1 -1
- package/dist/src/invitations/halo-recovery-initiator.d.ts +6 -4
- package/dist/src/invitations/halo-recovery-initiator.d.ts.map +1 -1
- package/dist/src/invitations/halo-recovery-initiator.js +15 -26
- package/dist/src/invitations/halo-recovery-initiator.js.map +1 -1
- package/dist/src/invitations/index.d.ts +1 -1
- package/dist/src/invitations/index.js +1 -1
- package/dist/src/invitations/{invitation-manager.d.ts → invitation-factory.d.ts} +5 -6
- package/dist/src/invitations/invitation-factory.d.ts.map +1 -0
- package/dist/src/invitations/{invitation-manager.js → invitation-factory.js} +9 -15
- package/dist/src/invitations/invitation-factory.js.map +1 -0
- package/dist/src/invitations/offline-invitation-claimer.d.ts +3 -3
- package/dist/src/invitations/offline-invitation-claimer.js +1 -1
- package/dist/src/parties/{party-internal.d.ts → data-party.d.ts} +13 -11
- package/dist/src/parties/data-party.d.ts.map +1 -0
- package/dist/src/parties/{party-internal.js → data-party.js} +27 -37
- package/dist/src/parties/data-party.js.map +1 -0
- package/dist/src/parties/index.d.ts +1 -2
- package/dist/src/parties/index.d.ts.map +1 -1
- package/dist/src/parties/index.js +1 -2
- package/dist/src/parties/index.js.map +1 -1
- package/dist/src/parties/party-factory.d.ts +10 -11
- package/dist/src/parties/party-factory.d.ts.map +1 -1
- package/dist/src/parties/party-factory.js +25 -16
- package/dist/src/parties/party-factory.js.map +1 -1
- package/dist/src/parties/party-manager.d.ts +9 -9
- package/dist/src/parties/party-manager.d.ts.map +1 -1
- package/dist/src/parties/party-manager.js +13 -13
- package/dist/src/parties/party-manager.js.map +1 -1
- package/dist/src/parties/party-manager.test.js +69 -68
- package/dist/src/parties/party-manager.test.js.map +1 -1
- package/dist/src/{halo → parties}/party-preferences.d.ts +3 -3
- package/dist/src/parties/party-preferences.d.ts.map +1 -0
- package/dist/src/{halo → parties}/party-preferences.js +3 -3
- package/dist/src/parties/party-preferences.js.map +1 -0
- package/dist/src/pipeline/index.d.ts +3 -1
- package/dist/src/pipeline/index.d.ts.map +1 -1
- package/dist/src/pipeline/index.js +3 -1
- package/dist/src/pipeline/index.js.map +1 -1
- package/dist/src/{metadata → pipeline}/metadata-store.d.ts +0 -0
- package/dist/src/{metadata → pipeline}/metadata-store.d.ts.map +1 -1
- package/dist/src/{metadata → pipeline}/metadata-store.js +0 -0
- package/dist/src/{metadata → pipeline}/metadata-store.js.map +1 -1
- package/dist/src/{metadata → pipeline}/metadata-store.test.d.ts +0 -0
- package/dist/src/pipeline/metadata-store.test.d.ts.map +1 -0
- package/dist/src/{metadata → pipeline}/metadata-store.test.js +0 -0
- package/dist/src/{metadata → pipeline}/metadata-store.test.js.map +1 -1
- package/dist/src/{parties → pipeline}/party-core.d.ts +0 -0
- package/dist/src/pipeline/party-core.d.ts.map +1 -0
- package/dist/src/{parties → pipeline}/party-core.js +8 -4
- package/dist/src/pipeline/party-core.js.map +1 -0
- package/dist/src/{parties → pipeline}/party-core.test.d.ts +0 -0
- package/dist/src/pipeline/party-core.test.d.ts.map +1 -0
- package/dist/src/{parties → pipeline}/party-core.test.js +3 -4
- package/dist/src/pipeline/party-core.test.js.map +1 -0
- package/dist/src/pipeline/party-feed-provider.d.ts +3 -2
- package/dist/src/pipeline/party-feed-provider.d.ts.map +1 -1
- package/dist/src/pipeline/party-feed-provider.js +40 -19
- package/dist/src/pipeline/party-feed-provider.js.map +1 -1
- package/dist/src/protocol/auth-plugin.d.ts +7 -0
- package/dist/src/protocol/auth-plugin.d.ts.map +1 -0
- package/dist/src/protocol/auth-plugin.js +16 -0
- package/dist/src/protocol/auth-plugin.js.map +1 -0
- package/dist/src/protocol/authenticator.d.ts +14 -0
- package/dist/src/protocol/authenticator.d.ts.map +1 -0
- package/dist/src/protocol/authenticator.js +31 -0
- package/dist/src/protocol/authenticator.js.map +1 -0
- package/dist/src/protocol/authenticator.test.d.ts +2 -0
- package/dist/src/protocol/authenticator.test.d.ts.map +1 -0
- package/dist/src/protocol/authenticator.test.js +45 -0
- package/dist/src/protocol/authenticator.test.js.map +1 -0
- package/dist/src/protocol/credentials-signer.d.ts +31 -0
- package/dist/src/protocol/credentials-signer.d.ts.map +1 -0
- package/dist/src/protocol/credentials-signer.js +53 -0
- package/dist/src/protocol/credentials-signer.js.map +1 -0
- package/dist/src/protocol/halo-recovery-plugin.d.ts +10 -0
- package/dist/src/protocol/halo-recovery-plugin.d.ts.map +1 -0
- package/dist/src/protocol/halo-recovery-plugin.js +18 -0
- package/dist/src/protocol/halo-recovery-plugin.js.map +1 -0
- package/dist/src/protocol/index.d.ts +7 -0
- package/dist/src/protocol/index.d.ts.map +1 -0
- package/dist/src/{metadata → protocol}/index.js +7 -2
- package/dist/src/protocol/index.js.map +1 -0
- package/dist/src/protocol/offline-invitation-plugin.d.ts +9 -0
- package/dist/src/protocol/offline-invitation-plugin.d.ts.map +1 -0
- package/dist/src/protocol/offline-invitation-plugin.js +17 -0
- package/dist/src/protocol/offline-invitation-plugin.js.map +1 -0
- package/dist/src/{pipeline → protocol}/party-protocol-factory.d.ts +7 -17
- package/dist/src/protocol/party-protocol-factory.d.ts.map +1 -0
- package/dist/src/{pipeline → protocol}/party-protocol-factory.js +7 -47
- package/dist/src/protocol/party-protocol-factory.js.map +1 -0
- package/dist/src/snapshots/snapshot-generator.d.ts +1 -1
- package/dist/src/snapshots/snapshot-generator.d.ts.map +1 -1
- package/dist/src/testing/testing-factories.js.map +1 -1
- package/dist/src/testing/testing.d.ts +2 -2
- package/dist/src/testing/testing.d.ts.map +1 -1
- package/dist/src/testing/testing.js +1 -7
- package/dist/src/testing/testing.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
- package/src/echo.test.ts +8 -14
- package/src/echo.ts +107 -109
- package/src/halo/contact-manager.ts +9 -5
- package/src/halo/halo-factory.ts +82 -19
- package/src/halo/halo-party.ts +137 -21
- package/src/halo/halo.test.ts +198 -0
- package/src/halo/halo.ts +40 -38
- package/src/halo/identity-manager.ts +33 -28
- package/src/halo/identity.ts +19 -23
- package/src/halo/index.ts +1 -1
- package/src/halo/party-opener.ts +1 -1
- package/src/halo/preferences.ts +29 -18
- package/src/index.ts +1 -1
- package/src/invitations/greeting-initiator.ts +37 -32
- package/src/invitations/greeting-responder.ts +4 -5
- package/src/invitations/halo-recovery-initiator.ts +16 -24
- package/src/invitations/index.ts +1 -1
- package/src/invitations/{invitation-manager.ts → invitation-factory.ts} +8 -15
- package/src/invitations/offline-invitation-claimer.ts +3 -3
- package/src/parties/{party-internal.ts → data-party.ts} +30 -55
- package/src/parties/index.ts +1 -2
- package/src/parties/party-factory.ts +31 -21
- package/src/parties/party-manager.test.ts +99 -73
- package/src/parties/party-manager.ts +17 -17
- package/src/{halo → parties}/party-preferences.ts +3 -3
- package/src/pipeline/index.ts +3 -1
- package/src/{metadata → pipeline}/metadata-store.test.ts +0 -0
- package/src/{metadata → pipeline}/metadata-store.ts +0 -0
- package/src/{parties → pipeline}/party-core.test.ts +1 -2
- package/src/{parties → pipeline}/party-core.ts +12 -7
- package/src/pipeline/party-feed-provider.ts +32 -21
- package/src/protocol/auth-plugin.ts +14 -0
- package/src/protocol/authenticator.test.ts +66 -0
- package/src/protocol/authenticator.ts +56 -0
- package/src/protocol/credentials-signer.ts +60 -0
- package/src/protocol/halo-recovery-plugin.ts +20 -0
- package/src/protocol/index.ts +10 -0
- package/src/protocol/offline-invitation-plugin.ts +19 -0
- package/src/{pipeline → protocol}/party-protocol-factory.ts +10 -82
- package/src/snapshots/snapshot-generator.ts +1 -1
- package/src/testing/testing-factories.ts +2 -2
- package/src/testing/testing.ts +3 -9
- package/dist/src/halo/party-preferences.d.ts.map +0 -1
- package/dist/src/halo/party-preferences.js.map +0 -1
- package/dist/src/invitations/invitation-manager.d.ts.map +0 -1
- package/dist/src/invitations/invitation-manager.js.map +0 -1
- package/dist/src/metadata/index.d.ts +0 -2
- package/dist/src/metadata/index.d.ts.map +0 -1
- package/dist/src/metadata/index.js.map +0 -1
- package/dist/src/metadata/metadata-store.test.d.ts.map +0 -1
- package/dist/src/parties/authenticator.d.ts +0 -5
- package/dist/src/parties/authenticator.d.ts.map +0 -1
- package/dist/src/parties/authenticator.js +0 -27
- package/dist/src/parties/authenticator.js.map +0 -1
- package/dist/src/parties/party-core.d.ts.map +0 -1
- package/dist/src/parties/party-core.js.map +0 -1
- package/dist/src/parties/party-core.test.d.ts.map +0 -1
- package/dist/src/parties/party-core.test.js.map +0 -1
- package/dist/src/parties/party-internal.d.ts.map +0 -1
- package/dist/src/parties/party-internal.js.map +0 -1
- package/dist/src/pipeline/party-protocol-factory.d.ts.map +0 -1
- package/dist/src/pipeline/party-protocol-factory.js.map +0 -1
- package/src/metadata/index.ts +0 -5
- package/src/parties/authenticator.ts +0 -31
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createHaloRecoveryPlugin = void 0;
|
|
7
|
+
const credentials_1 = require("@dxos/credentials");
|
|
8
|
+
const invitations_1 = require("../invitations");
|
|
9
|
+
/**
|
|
10
|
+
* Creates network protocol plugin that allows peers to recover access to their HALO.
|
|
11
|
+
* Plugin is intended to be used in HALO party swarm.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
function createHaloRecoveryPlugin(identityKey, invitationFactory, peerId) {
|
|
15
|
+
return new credentials_1.GreetingCommandPlugin(peerId.asBuffer(), invitations_1.HaloRecoveryInitiator.createHaloInvitationClaimHandler(identityKey, invitationFactory));
|
|
16
|
+
}
|
|
17
|
+
exports.createHaloRecoveryPlugin = createHaloRecoveryPlugin;
|
|
18
|
+
//# sourceMappingURL=halo-recovery-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"halo-recovery-plugin.js","sourceRoot":"","sources":["../../../src/protocol/halo-recovery-plugin.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,mDAA0D;AAG1D,gDAA0E;AAE1E;;;;GAIG;AACH,SAAgB,wBAAwB,CAAE,WAAsB,EAAE,iBAAoC,EAAE,MAAiB;IACvH,OAAO,IAAI,mCAAqB,CAC9B,MAAM,CAAC,QAAQ,EAAE,EACjB,mCAAqB,CAAC,gCAAgC,CAAC,WAAW,EAAE,iBAAiB,CAAC,CACvF,CAAC;AACJ,CAAC;AALD,4DAKC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './authenticator';
|
|
2
|
+
export * from './credentials-signer';
|
|
3
|
+
export * from './auth-plugin';
|
|
4
|
+
export * from './halo-recovery-plugin';
|
|
5
|
+
export * from './offline-invitation-plugin';
|
|
6
|
+
export * from './party-protocol-factory';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/protocol/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
//
|
|
3
|
-
// Copyright
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
4
|
//
|
|
5
5
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
@@ -13,5 +13,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
13
13
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
__exportStar(require("./
|
|
16
|
+
__exportStar(require("./authenticator"), exports);
|
|
17
|
+
__exportStar(require("./credentials-signer"), exports);
|
|
18
|
+
__exportStar(require("./auth-plugin"), exports);
|
|
19
|
+
__exportStar(require("./halo-recovery-plugin"), exports);
|
|
20
|
+
__exportStar(require("./offline-invitation-plugin"), exports);
|
|
21
|
+
__exportStar(require("./party-protocol-factory"), exports);
|
|
17
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/protocol/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;AAEF,kDAAgC;AAChC,uDAAqC;AACrC,gDAA8B;AAC9B,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GreetingCommandPlugin } from '@dxos/credentials';
|
|
2
|
+
import { PublicKey } from '@dxos/crypto';
|
|
3
|
+
import { InvitationFactory } from '../invitations';
|
|
4
|
+
/**
|
|
5
|
+
* Creates network protocol plugin that allows peers to claim offline invitations.
|
|
6
|
+
* Plugin is intended to be used in data-party swarms.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createOfflineInvitationPlugin(invitationFactory: InvitationFactory, peerId: PublicKey): GreetingCommandPlugin;
|
|
9
|
+
//# sourceMappingURL=offline-invitation-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-invitation-plugin.d.ts","sourceRoot":"","sources":["../../../src/protocol/offline-invitation-plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAA4B,MAAM,gBAAgB,CAAC;AAE7E;;;GAGG;AACH,wBAAgB,6BAA6B,CAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,SAAS,yBAKrG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createOfflineInvitationPlugin = void 0;
|
|
7
|
+
const credentials_1 = require("@dxos/credentials");
|
|
8
|
+
const invitations_1 = require("../invitations");
|
|
9
|
+
/**
|
|
10
|
+
* Creates network protocol plugin that allows peers to claim offline invitations.
|
|
11
|
+
* Plugin is intended to be used in data-party swarms.
|
|
12
|
+
*/
|
|
13
|
+
function createOfflineInvitationPlugin(invitationFactory, peerId) {
|
|
14
|
+
return new credentials_1.GreetingCommandPlugin(peerId.asBuffer(), invitations_1.OfflineInvitationClaimer.createOfflineInvitationClaimHandler(invitationFactory));
|
|
15
|
+
}
|
|
16
|
+
exports.createOfflineInvitationPlugin = createOfflineInvitationPlugin;
|
|
17
|
+
//# sourceMappingURL=offline-invitation-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-invitation-plugin.js","sourceRoot":"","sources":["../../../src/protocol/offline-invitation-plugin.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,mDAA0D;AAG1D,gDAA6E;AAE7E;;;GAGG;AACH,SAAgB,6BAA6B,CAAE,iBAAoC,EAAE,MAAiB;IACpG,OAAO,IAAI,mCAAqB,CAC9B,MAAM,CAAC,QAAQ,EAAE,EACjB,sCAAwB,CAAC,mCAAmC,CAAC,iBAAiB,CAAC,CAChF,CAAC;AACJ,CAAC;AALD,sEAKC"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { Authenticator } from '@dxos/credentials';
|
|
1
|
+
import { PublicKey } from '@dxos/crypto';
|
|
3
2
|
import { FeedSetProvider, PartyKey } from '@dxos/echo-protocol';
|
|
4
|
-
import { NetworkManager } from '@dxos/network-manager';
|
|
3
|
+
import { NetworkManager, Plugin } from '@dxos/network-manager';
|
|
5
4
|
import { Replicator } from '@dxos/protocol-plugin-replicator';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { PartyFeedProvider } from './party-feed-provider';
|
|
9
|
-
export interface CredentialsProvider {
|
|
10
|
-
/**
|
|
11
|
-
* The credentials (e.g., a serialized AuthMessage) as a bytes.
|
|
12
|
-
*/
|
|
13
|
-
get(): Buffer;
|
|
14
|
-
}
|
|
5
|
+
import { CredentialsProvider } from '.';
|
|
6
|
+
import { PartyFeedProvider } from '../pipeline/party-feed-provider';
|
|
15
7
|
/**
|
|
16
8
|
* Manages the party's connection to the network swarm.
|
|
17
9
|
*/
|
|
@@ -19,15 +11,13 @@ export declare class PartyProtocolFactory {
|
|
|
19
11
|
private readonly _partyKey;
|
|
20
12
|
private readonly _networkManager;
|
|
21
13
|
private readonly _feedProvider;
|
|
22
|
-
private readonly _identityProvider;
|
|
23
|
-
private readonly _credentials;
|
|
24
14
|
private readonly _peerId;
|
|
15
|
+
private readonly _credentials;
|
|
25
16
|
private readonly _presencePlugin;
|
|
26
|
-
private readonly _haloProtocolPluginFactory;
|
|
27
17
|
private readonly _replicatorProtocolPluginFactory;
|
|
28
18
|
private _started;
|
|
29
|
-
constructor(_partyKey: PartyKey, _networkManager: NetworkManager, _feedProvider: PartyFeedProvider,
|
|
30
|
-
start(): Promise<(() => Promise<void>) | undefined>;
|
|
19
|
+
constructor(_partyKey: PartyKey, _networkManager: NetworkManager, _feedProvider: PartyFeedProvider, _peerId: PublicKey, _credentials: CredentialsProvider, activeFeeds: FeedSetProvider);
|
|
20
|
+
start(plugins: Plugin[]): Promise<(() => Promise<void>) | undefined>;
|
|
31
21
|
stop(): Promise<void>;
|
|
32
22
|
private _createProtocol;
|
|
33
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"party-protocol-factory.d.ts","sourceRoot":"","sources":["../../../src/protocol/party-protocol-factory.ts"],"names":[],"mappings":"AAOA,OAAO,EAA6B,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAW,eAAe,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGzE,OAAO,EAAgB,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIpE;;GAEG;AACH,qBAAa,oBAAoB;IAO7B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAV/B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+C;IAC/E,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAkC;IAEnF,OAAO,CAAC,QAAQ,CAAS;gBAGN,SAAS,EAAE,QAAQ,EACnB,eAAe,EAAE,cAAc,EAC/B,aAAa,EAAE,iBAAiB,EAChC,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,mBAAmB,EAClD,WAAW,EAAE,eAAe;IAOxB,KAAK,CAAE,OAAO,EAAE,MAAM,EAAE;IAwBxB,IAAI;IAUV,OAAO,CAAC,eAAe;CA4CxB;AAED;;GAEG;AACH,qBAAa,+BAA+B;IAExC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,aAAa,EAAE,iBAAiB,EAChC,YAAY,EAAE,eAAe;IAGhD,aAAa;YA8BC,SAAS;CAIxB"}
|
|
@@ -13,38 +13,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ReplicatorProtocolPluginFactory = exports.PartyProtocolFactory = void 0;
|
|
16
|
-
const assert_1 = __importDefault(require("assert"));
|
|
17
16
|
const debug_1 = __importDefault(require("debug"));
|
|
18
17
|
const async_1 = require("@dxos/async");
|
|
19
|
-
const credentials_1 = require("@dxos/credentials");
|
|
20
18
|
const crypto_1 = require("@dxos/crypto");
|
|
21
19
|
const mesh_protocol_1 = require("@dxos/mesh-protocol");
|
|
22
20
|
const network_manager_1 = require("@dxos/network-manager");
|
|
23
21
|
const protocol_plugin_presence_1 = require("@dxos/protocol-plugin-presence");
|
|
24
22
|
const protocol_plugin_replicator_1 = require("@dxos/protocol-plugin-replicator");
|
|
25
|
-
const invitations_1 = require("../invitations");
|
|
26
23
|
const log = (0, debug_1.default)('dxos:echo-db:party-protocol-factory');
|
|
27
24
|
/**
|
|
28
25
|
* Manages the party's connection to the network swarm.
|
|
29
26
|
*/
|
|
30
27
|
class PartyProtocolFactory {
|
|
31
|
-
constructor(_partyKey, _networkManager, _feedProvider,
|
|
28
|
+
constructor(_partyKey, _networkManager, _feedProvider, _peerId, _credentials, activeFeeds) {
|
|
32
29
|
this._partyKey = _partyKey;
|
|
33
30
|
this._networkManager = _networkManager;
|
|
34
31
|
this._feedProvider = _feedProvider;
|
|
35
|
-
this.
|
|
32
|
+
this._peerId = _peerId;
|
|
36
33
|
this._credentials = _credentials;
|
|
37
|
-
this._peerId = crypto_1.PublicKey.random(); // TODO(marik-d): Should this be a specific peer id?
|
|
38
34
|
this._presencePlugin = new protocol_plugin_presence_1.PresencePlugin(this._peerId.asBuffer());
|
|
39
35
|
this._started = false;
|
|
40
|
-
// Authentication.
|
|
41
|
-
this._haloProtocolPluginFactory =
|
|
42
|
-
new HaloProtocolPluginFactory(this._partyKey, this._identityProvider, invitationManager, authenticator);
|
|
43
36
|
// Replication.
|
|
44
37
|
this._replicatorProtocolPluginFactory =
|
|
45
38
|
new ReplicatorProtocolPluginFactory(this._feedProvider, activeFeeds);
|
|
46
39
|
}
|
|
47
|
-
async start() {
|
|
40
|
+
async start(plugins) {
|
|
48
41
|
if (this._started) {
|
|
49
42
|
return;
|
|
50
43
|
}
|
|
@@ -57,7 +50,7 @@ class PartyProtocolFactory {
|
|
|
57
50
|
};
|
|
58
51
|
log(`Joining swarm: ${this._partyKey.toHex()}`);
|
|
59
52
|
return this._networkManager.joinProtocolSwarm({
|
|
60
|
-
protocol: ({ channel, initiator }) => this._createProtocol(channel, { initiator }),
|
|
53
|
+
protocol: ({ channel, initiator }) => this._createProtocol(channel, { initiator }, plugins),
|
|
61
54
|
peerId: this._peerId,
|
|
62
55
|
topic: this._partyKey,
|
|
63
56
|
presence: this._presencePlugin,
|
|
@@ -73,11 +66,10 @@ class PartyProtocolFactory {
|
|
|
73
66
|
log(`Leaving swarm: ${this._partyKey.toHex()}`);
|
|
74
67
|
await this._networkManager.leaveProtocolSwarm(this._partyKey);
|
|
75
68
|
}
|
|
76
|
-
_createProtocol(channel, opts) {
|
|
77
|
-
(0, assert_1.default)(this._identityProvider().deviceKey);
|
|
69
|
+
_createProtocol(channel, opts, extraPlugins) {
|
|
78
70
|
const plugins = [
|
|
79
|
-
...this._haloProtocolPluginFactory.createPlugins(),
|
|
80
71
|
...this._replicatorProtocolPluginFactory.createPlugins(),
|
|
72
|
+
...extraPlugins,
|
|
81
73
|
this._presencePlugin
|
|
82
74
|
];
|
|
83
75
|
const protocol = new mesh_protocol_1.Protocol({
|
|
@@ -98,7 +90,7 @@ class PartyProtocolFactory {
|
|
|
98
90
|
},
|
|
99
91
|
userSession: {
|
|
100
92
|
// TODO(burdon): See deprecated `protocolFactory` in HALO.
|
|
101
|
-
peerId: (0, crypto_1.keyToString)(this.
|
|
93
|
+
peerId: (0, crypto_1.keyToString)(this._peerId.asBuffer()),
|
|
102
94
|
// TODO(telackey): This ought to be the CredentialsProvider itself, so that fresh credentials can be minted.
|
|
103
95
|
credentials: this._credentials.get().toString('base64')
|
|
104
96
|
},
|
|
@@ -154,36 +146,4 @@ __decorate([
|
|
|
154
146
|
async_1.synchronized
|
|
155
147
|
], ReplicatorProtocolPluginFactory.prototype, "_openFeed", null);
|
|
156
148
|
exports.ReplicatorProtocolPluginFactory = ReplicatorProtocolPluginFactory;
|
|
157
|
-
/**
|
|
158
|
-
* Creates protocol plugins for HALO authentication and invitations.
|
|
159
|
-
*/
|
|
160
|
-
class HaloProtocolPluginFactory {
|
|
161
|
-
constructor(_partyKey, _identityProvider, _invitationManager, _authenticator) {
|
|
162
|
-
this._partyKey = _partyKey;
|
|
163
|
-
this._identityProvider = _identityProvider;
|
|
164
|
-
this._invitationManager = _invitationManager;
|
|
165
|
-
this._authenticator = _authenticator;
|
|
166
|
-
}
|
|
167
|
-
get _identity() {
|
|
168
|
-
return this._identityProvider();
|
|
169
|
-
}
|
|
170
|
-
createPlugins() {
|
|
171
|
-
(0, assert_1.default)(this._identity.identityKey);
|
|
172
|
-
(0, assert_1.default)(this._identity.deviceKey);
|
|
173
|
-
const plugins = [
|
|
174
|
-
new credentials_1.AuthPlugin(this._identity.deviceKey.publicKey.asBuffer(), this._authenticator, [protocol_plugin_replicator_1.Replicator.extension])
|
|
175
|
-
];
|
|
176
|
-
// Determine if this party is the main HALO.
|
|
177
|
-
const isHalo = this._identity.identityKey.publicKey.equals(this._partyKey);
|
|
178
|
-
if (isHalo) {
|
|
179
|
-
// Enables devices to re-join the HALO using a recovery seed phrase.
|
|
180
|
-
plugins.push(new credentials_1.GreetingCommandPlugin(this._identity.deviceKey.publicKey.asBuffer(), invitations_1.HaloRecoveryInitiator.createHaloInvitationClaimHandler(this._identityProvider)));
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
// Enables peers to join the party.
|
|
184
|
-
plugins.push(new credentials_1.GreetingCommandPlugin(this._identity.deviceKey.publicKey.asBuffer(), invitations_1.OfflineInvitationClaimer.createOfflineInvitationClaimHandler(this._invitationManager)));
|
|
185
|
-
}
|
|
186
|
-
return plugins;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
149
|
//# sourceMappingURL=party-protocol-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"party-protocol-factory.js","sourceRoot":"","sources":["../../../src/protocol/party-protocol-factory.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;AAEF,kDAA0B;AAE1B,uCAA2C;AAC3C,yCAAoE;AAGpE,uDAA+C;AAC/C,2DAA6E;AAC7E,6EAAgE;AAChE,iFAA8D;AAK9D,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,qCAAqC,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAa,oBAAoB;IAM/B,YACmB,SAAmB,EACnB,eAA+B,EAC/B,aAAgC,EAChC,OAAkB,EAClB,YAAiC,EAClD,WAA4B;QALX,cAAS,GAAT,SAAS,CAAU;QACnB,oBAAe,GAAf,eAAe,CAAgB;QAC/B,kBAAa,GAAb,aAAa,CAAmB;QAChC,YAAO,GAAP,OAAO,CAAW;QAClB,iBAAY,GAAZ,YAAY,CAAqB;QAVnC,oBAAe,GAAG,IAAI,yCAAc,CAAC,IAAI,CAAC,OAAO,CAAC,Q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IAAI,CAAC,OAAO,WAAW,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;oBACrG,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBACtF,CAAC;aACF,CAAC;SACH,CAAC;IACJ,CAAC;IAGO,KAAK,CAAC,SAAS,CAAE,GAAY;QACnC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;QAC1E,OAAO,UAAU,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAJC;IADC,oBAAY;gEAIZ;AAvCH,0EAwCC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TimeframeClock } from '../database';
|
|
2
|
-
import { PartyCore } from '../
|
|
2
|
+
import { PartyCore } from '../pipeline';
|
|
3
3
|
import { SnapshotStore } from './snapshot-store';
|
|
4
4
|
export declare function createAutomaticSnapshots(party: PartyCore, clock: TimeframeClock, store: SnapshotStore, interval: number): () => void;
|
|
5
5
|
//# sourceMappingURL=snapshot-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot-generator.d.ts","sourceRoot":"","sources":["../../../src/snapshots/snapshot-generator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"snapshot-generator.d.ts","sourceRoot":"","sources":["../../../src/snapshots/snapshot-generator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAehF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing-factories.js","sourceRoot":"","sources":["../../../src/testing/testing-factories.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAG5B,qDAAiD;AACjD,qCAAmC;AAKnC,uCAA+D;AAW/D,SAAS,WAAW,CAAK,GAAM,EAAE,IAAc;IAC5C,GAAW,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC7B,OAAO,GAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,aAAa,GAAG,KAAK,EAAE,SAAS,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"testing-factories.js","sourceRoot":"","sources":["../../../src/testing/testing-factories.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAG5B,qDAAiD;AACjD,qCAAmC;AAKnC,uCAA+D;AAW/D,SAAS,WAAW,CAAK,GAAM,EAAE,IAAc;IAC5C,GAAW,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC7B,OAAO,GAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,aAAa,GAAG,KAAK,EAAE,SAAS,GAAG,CAAC,EAAkE,EAAE;IAC5G,IAAA,gBAAM,EAAC,SAAS,IAAI,CAAC,CAAC,CAAC;IAEvB,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAA,YAAK,EAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAA,4BAAkB,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,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ED,kCAAkC;IAClC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3D,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,KAAK,EAAC,EAAE;QAC1C,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACnC,OAAO;SACR;QAED,MAAM,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC,CAAC;IAEJ,MAAM,KAAK,GAAG,OAAO;SAClB,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAE,CAAC;SAC9C,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE5D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC,CAAC;AA3BW,QAAA,oBAAoB,wBA2B/B"}
|
|
@@ -2,7 +2,7 @@ import debug from 'debug';
|
|
|
2
2
|
import { NetworkManagerOptions } from '@dxos/network-manager';
|
|
3
3
|
import { IStorage } from '@dxos/random-access-multi-storage';
|
|
4
4
|
import { ECHO } from '../echo';
|
|
5
|
-
import {
|
|
5
|
+
import { DataParty } from '../parties';
|
|
6
6
|
export declare const log: debug.Debugger;
|
|
7
7
|
export declare const messageLogger: (tag: string) => (message: any) => void;
|
|
8
8
|
export interface TestOptions {
|
|
@@ -23,5 +23,5 @@ export declare const createTestInstance: ({ verboseLogging, initialize, storage,
|
|
|
23
23
|
* Invites a test peer to the party.
|
|
24
24
|
* @returns Party instance on provided test instance.
|
|
25
25
|
*/
|
|
26
|
-
export declare const inviteTestPeer: (party:
|
|
26
|
+
export declare const inviteTestPeer: (party: DataParty, peer: ECHO) => Promise<DataParty>;
|
|
27
27
|
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing/testing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing/testing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAG7D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,eAAO,MAAM,GAAG,gBAAgC,CAAC;AAEjD,eAAO,MAAM,aAAa,QAAS,MAAM,eAAe,GAAG,SAE1D,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,GAAG,CAAA;IACb,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAE7C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,QAAQ,CAAA;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,8HAS5B,WAAW,kBAkBb,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,UAAiB,SAAS,QAAQ,IAAI,KAAG,QAAQ,SAAS,CAMpF,CAAC"}
|
|
@@ -8,7 +8,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.inviteTestPeer = exports.createTestInstance = exports.messageLogger = exports.log = void 0;
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
|
-
const crypto_1 = require("@dxos/crypto");
|
|
12
11
|
const util_1 = require("@dxos/util");
|
|
13
12
|
const echo_1 = require("../echo");
|
|
14
13
|
const util_2 = require("../util");
|
|
@@ -33,12 +32,7 @@ const createTestInstance = async ({ verboseLogging = false, initialize = false,
|
|
|
33
32
|
});
|
|
34
33
|
if (initialize) {
|
|
35
34
|
await echo.open();
|
|
36
|
-
|
|
37
|
-
await echo.halo.createIdentity((0, crypto_1.createKeyPair)());
|
|
38
|
-
}
|
|
39
|
-
if (!echo.halo.isInitialized) {
|
|
40
|
-
await echo.halo.create();
|
|
41
|
-
}
|
|
35
|
+
await echo.halo.createProfile();
|
|
42
36
|
}
|
|
43
37
|
return echo;
|
|
44
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/testing/testing.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,kDAA0B;
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/testing/testing.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,kDAA0B;AAI1B,qCAA0C;AAE1C,kCAA+B;AAE/B,kCAA2C;AAE9B,QAAA,GAAG,GAAG,IAAA,eAAK,EAAC,sBAAsB,CAAC,CAAC;AAE1C,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,OAAY,EAAE,EAAE;IAC7D,IAAA,WAA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