@enbox/dwn-sdk-js 0.3.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.mjs +11 -11
- package/dist/browser.mjs.map +4 -4
- package/dist/esm/generated/precompiled-validators.js +175 -512
- package/dist/esm/generated/precompiled-validators.js.map +1 -1
- package/dist/esm/src/core/dwn-error.js +1 -3
- package/dist/esm/src/core/dwn-error.js.map +1 -1
- package/dist/esm/src/core/messages-grant-authorization.js +1 -17
- package/dist/esm/src/core/messages-grant-authorization.js.map +1 -1
- package/dist/esm/src/core/protocol-authorization-validation.js +1 -1
- package/dist/esm/src/core/protocol-authorization-validation.js.map +1 -1
- package/dist/esm/src/core/replication-apply.js +200 -0
- package/dist/esm/src/core/replication-apply.js.map +1 -0
- package/dist/esm/src/dwn.js +212 -0
- package/dist/esm/src/dwn.js.map +1 -1
- package/dist/esm/src/handlers/messages-sync.js +66 -369
- package/dist/esm/src/handlers/messages-sync.js.map +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/interfaces/messages-sync.js +0 -11
- package/dist/esm/src/interfaces/messages-sync.js.map +1 -1
- package/dist/esm/tests/core/replication-apply.spec.js +220 -0
- package/dist/esm/tests/core/replication-apply.spec.js.map +1 -0
- package/dist/esm/tests/dwn.spec.js +139 -2
- package/dist/esm/tests/dwn.spec.js.map +1 -1
- package/dist/esm/tests/handlers/messages-sync.spec.js +1 -684
- package/dist/esm/tests/handlers/messages-sync.spec.js.map +1 -1
- package/dist/esm/tests/handlers/records-write.spec.js +2 -2
- package/dist/esm/tests/handlers/records-write.spec.js.map +1 -1
- package/dist/esm/tests/test-suite.js +0 -2
- package/dist/esm/tests/test-suite.js.map +1 -1
- package/dist/types/generated/precompiled-validators.d.ts.map +1 -1
- package/dist/types/src/core/dwn-error.d.ts +1 -3
- package/dist/types/src/core/dwn-error.d.ts.map +1 -1
- package/dist/types/src/core/messages-grant-authorization.d.ts +0 -1
- package/dist/types/src/core/messages-grant-authorization.d.ts.map +1 -1
- package/dist/types/src/core/replication-apply.d.ts +93 -0
- package/dist/types/src/core/replication-apply.d.ts.map +1 -0
- package/dist/types/src/dwn.d.ts +22 -1
- package/dist/types/src/dwn.d.ts.map +1 -1
- package/dist/types/src/handlers/messages-sync.d.ts +10 -54
- package/dist/types/src/handlers/messages-sync.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/interfaces/messages-sync.d.ts +0 -3
- package/dist/types/src/interfaces/messages-sync.d.ts.map +1 -1
- package/dist/types/src/types/messages-types.d.ts +0 -18
- package/dist/types/src/types/messages-types.d.ts.map +1 -1
- package/dist/types/tests/core/replication-apply.spec.d.ts +2 -0
- package/dist/types/tests/core/replication-apply.spec.d.ts.map +1 -0
- package/dist/types/tests/dwn.spec.d.ts.map +1 -1
- package/dist/types/tests/handlers/messages-sync.spec.d.ts.map +1 -1
- package/dist/types/tests/test-suite.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/dwn-error.ts +1 -3
- package/src/core/messages-grant-authorization.ts +1 -31
- package/src/core/protocol-authorization-validation.ts +2 -2
- package/src/core/replication-apply.ts +272 -0
- package/src/dwn.ts +296 -2
- package/src/handlers/messages-sync.ts +92 -585
- package/src/index.ts +3 -4
- package/src/interfaces/messages-sync.ts +8 -25
- package/src/types/messages-types.ts +0 -20
- package/dist/esm/src/sync/records-projection.js +0 -228
- package/dist/esm/src/sync/records-projection.js.map +0 -1
- package/dist/esm/tests/sync/records-projection.spec.js +0 -245
- package/dist/esm/tests/sync/records-projection.spec.js.map +0 -1
- package/dist/types/src/sync/records-projection.d.ts +0 -98
- package/dist/types/src/sync/records-projection.d.ts.map +0 -1
- package/dist/types/tests/sync/records-projection.spec.d.ts +0 -2
- package/dist/types/tests/sync/records-projection.spec.d.ts.map +0 -1
- package/src/sync/records-projection.ts +0 -328
|
@@ -22,7 +22,6 @@ import { testRecordsCountHandler } from './handlers/records-count.spec.js';
|
|
|
22
22
|
import { testRecordsDeleteHandler } from './handlers/records-delete.spec.js';
|
|
23
23
|
import { testRecordsDelivery } from './features/records-delivery.spec.js';
|
|
24
24
|
import { testRecordsImmutable } from './features/records-immutable.spec.js';
|
|
25
|
-
import { testRecordsProjection } from './sync/records-projection.spec.js';
|
|
26
25
|
import { testRecordsPrune } from './features/records-prune.spec.js';
|
|
27
26
|
import { testRecordsPruneCrossProtocol } from './features/records-prune-cross-protocol.spec.js';
|
|
28
27
|
import { testRecordsQueryHandler } from './handlers/records-query.spec.js';
|
|
@@ -62,7 +61,6 @@ export class TestSuite {
|
|
|
62
61
|
testRecordsReadHandler();
|
|
63
62
|
testRecordsSubscribeHandler();
|
|
64
63
|
testRecordsWriteHandler();
|
|
65
|
-
testRecordsProjection();
|
|
66
64
|
// feature tests
|
|
67
65
|
testAuthorDelegatedGrant();
|
|
68
66
|
testOwnerDelegatedGrant();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-suite.js","sourceRoot":"","sources":["../../../tests/test-suite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,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AAE,CAAC;QAChC,sBAAsB,EAAE,CAAC;QACzB,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,CAAC;QAClB,kBAAkB,EAAE,CAAC;QAErB,iBAAiB;QACjB,0BAA0B,EAAE,CAAC;QAC7B,qBAAqB,EAAE,CAAC;QACxB,uBAAuB,EAAE,CAAC;QAC1B,yBAAyB,EAAE,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"precompiled-validators.d.ts","sourceRoot":"","sources":["../../../generated/precompiled-validators.js"],"names":[],"mappings":"AAC66K;;;;YAA+tC;;;;;;;;AAMs+Z;;;;YAA2wD;;;;;;;;;;;;AANinhB;;;;YAGt9jC;;;;;;;;;;;;AAG0jrE;;;;YAA8kM;;;;;;;;;;;;AAAm5B;;;;YAA+lN;;;;;;;;;;;;AAAukD;;;;YAAovW;;;;;;;;;;;;AAAgxD;;;;YAA61f;;;;;;;;;;;;AAA8X;;;;YAAgkD;;;;;;;;;;;;AAAx+rG;;;;YAAkhE;;;;;;;;;;;;AAH17e;;;;YAG8ua;;;;;;;;;;;;;;;;;;;AAAshuG;;;;YAAinB;;;;;;;;;;AAAwG;;;;YAAk5e;;;;;;;;;;AAN38uI;;;;YAAi1I;;;;;;;;;;;;AAMwxnI;;;;YAAsnH;;;;;;;;;;;;AAAm2B;;;;YAA2hN;;;;;;;;;;;;AAA25B;;;;YAAo7O;;;;;;;;;;;;AAA4gC;;;;YAA85X;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"precompiled-validators.d.ts","sourceRoot":"","sources":["../../../generated/precompiled-validators.js"],"names":[],"mappings":"AAC66K;;;;YAA+tC;;;;;;;;AAMs+Z;;;;YAA2wD;;;;;;;;;;;;AANinhB;;;;YAGt9jC;;;;;;;;;;;;AAG0jrE;;;;YAA8kM;;;;;;;;;;;;AAAm5B;;;;YAA+lN;;;;;;;;;;;;AAAukD;;;;YAAovW;;;;;;;;;;;;AAAgxD;;;;YAA61f;;;;;;;;;;;;AAA8X;;;;YAAgkD;;;;;;;;;;;;AAAx+rG;;;;YAAkhE;;;;;;;;;;;;AAH17e;;;;YAG8ua;;;;;;;;;;;;;;;;;;;AAAshuG;;;;YAAinB;;;;;;;;;;AAAwG;;;;YAAk5e;;;;;;;;;;AAN38uI;;;;YAAi1I;;;;;;;;;;;;AAMwxnI;;;;YAAsnH;;;;;;;;;;;;AAAm2B;;;;YAA2hN;;;;;;;;;;;;AAA25B;;;;YAAo7O;;;;;;;;;;;;AAA4gC;;;;YAA85X;;;;;;;;;;;;AAAykD;;;;YAAw4c;;;;;;;;;;;;AAA4H;;;;YAA8sK;;;;;;;;;;;;AAA2H;;;;YAAqvE;;;;;;;;;;;;AAAwH;;;;YAAq2H;;;;;;;;;;;;AAA+kiD;;;;YAAk8O;;;;;;;;;;;;AAAm/5C;;;;YAAyiI;;;;;;;;;;;;AAA6X;;;;YAAgtC;;;;;;;;;;;;AAAi6C;;;;YAA6nB;;;;;;;;;;AAA4/F;;;;YAA+nB;;;;;;;;;;AAAis/B;;;;YAAm2P;;;;;;;;;;;;AAAj4kC;;;;YAA880B;;;;;;;;;;;;AAAg6R;;;;YAAksM;;;;;;;;;;;;AAA2/B;;;;YAAovQ;;;;;;;;;;;;AAAgjC;;;;YAA8/N;;;;;;;;;;;;AAA/i4V;;;;YAAo2/C;;;;;;;;;;;;AANtq2D;;;;YAAwivB;;;;;;;;;;AAMg+hV;;;;YAAg1I;;;;;;;;;;;;AAAmsB;;;;YAA6mJ;;;;;;;;;;;;AAA4H;;;;YAAkiK"}
|
|
@@ -19,8 +19,6 @@ export declare enum DwnErrorCode {
|
|
|
19
19
|
EventLogNotOpenError = "EventLogNotOpenError",
|
|
20
20
|
EventLogProgressGap = "EventLogProgressGap",
|
|
21
21
|
MessagesGrantAuthorizationMismatchedProtocol = "MessagesGrantAuthorizationMismatchedProtocol",
|
|
22
|
-
MessagesGrantAuthorizationProjectionInfrastructureProtocol = "MessagesGrantAuthorizationProjectionInfrastructureProtocol",
|
|
23
|
-
MessagesGrantAuthorizationProjectionScopeMismatch = "MessagesGrantAuthorizationProjectionScopeMismatch",
|
|
24
22
|
MessagesGrantAuthorizationProtocolSyncInfrastructureProtocol = "MessagesGrantAuthorizationProtocolSyncInfrastructureProtocol",
|
|
25
23
|
MessagesGrantAuthorizationSubscribeProtocolMismatch = "MessagesGrantAuthorizationSubscribeProtocolMismatch",
|
|
26
24
|
MessagesGrantAuthorizationUnfilteredSubscribeProtocolScope = "MessagesGrantAuthorizationUnfilteredSubscribeProtocolScope",
|
|
@@ -58,7 +56,6 @@ export declare enum DwnErrorCode {
|
|
|
58
56
|
MessagesReadVerifyScopeFailed = "MessagesReadVerifyScopeFailed",
|
|
59
57
|
MessagesSyncAuthorizationFailed = "MessagesSyncAuthorizationFailed",
|
|
60
58
|
MessagesSyncInvalidPrefix = "MessagesSyncInvalidPrefix",
|
|
61
|
-
MessagesSyncUnsupportedProjectionRootVersion = "MessagesSyncUnsupportedProjectionRootVersion",
|
|
62
59
|
ParseCidCodecNotSupported = "ParseCidCodecNotSupported",
|
|
63
60
|
ParseCidMultihashNotSupported = "ParseCidMultihashNotSupported",
|
|
64
61
|
PermissionsProtocolCreateGrantScopeContextIdProtocolPathConflict = "PermissionsProtocolCreateGrantScopeContextIdProtocolPathConflict",
|
|
@@ -110,6 +107,7 @@ export declare enum DwnErrorCode {
|
|
|
110
107
|
ProtocolAuthorizationStoredInitialWriteRoleMissingRecipient = "ProtocolAuthorizationStoredInitialWriteRoleMissingRecipient",
|
|
111
108
|
ProtocolAuthorizationMissingContextId = "ProtocolAuthorizationMissingContextId",
|
|
112
109
|
ProtocolAuthorizationMissingRuleSet = "ProtocolAuthorizationMissingRuleSet",
|
|
110
|
+
ProtocolAuthorizationParentRecordNotFound = "ProtocolAuthorizationParentRecordNotFound",
|
|
113
111
|
ProtocolAuthorizationParentlessIncorrectProtocolPath = "ProtocolAuthorizationParentlessIncorrectProtocolPath",
|
|
114
112
|
ProtocolAuthorizationNotARole = "ProtocolAuthorizationNotARole",
|
|
115
113
|
ProtocolAuthorizationParentNotFoundConstructingRecordChain = "ProtocolAuthorizationParentNotFoundConstructingRecordChain",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dwn-error.d.ts","sourceRoot":"","sources":["../../../../src/core/dwn-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACb,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAKlD;AAED;;GAEG;AACH,oBAAY,YAAY;IACtB,sBAAsB,2BAA2B;IACjD,iCAAiC,sCAAsC;IACvE,8CAA8C,mDAAmD;IACjG,+BAA+B,oCAAoC;IACnE,2BAA2B,gCAAgC;IAC3D,+BAA+B,oCAAoC;IACnE,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,4CAA4C,iDAAiD;IAC7F,
|
|
1
|
+
{"version":3,"file":"dwn-error.d.ts","sourceRoot":"","sources":["../../../../src/core/dwn-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACb,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAKlD;AAED;;GAEG;AACH,oBAAY,YAAY;IACtB,sBAAsB,2BAA2B;IACjD,iCAAiC,sCAAsC;IACvE,8CAA8C,mDAAmD;IACjG,+BAA+B,oCAAoC;IACnE,2BAA2B,gCAAgC;IAC3D,+BAA+B,oCAAoC;IACnE,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,4CAA4C,iDAAiD;IAC7F,4DAA4D,iEAAiE;IAC7H,mDAAmD,wDAAwD;IAC3G,0DAA0D,+DAA+D;IACzH,oCAAoC,yCAAyC;IAC7E,4CAA4C,iDAAiD;IAC7F,sCAA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C;IAC3E,oCAAoC,yCAAyC;IAC7E,yBAAyB,8BAA8B;IACvD,iCAAiC,sCAAsC;IACvE,wCAAwC,6CAA6C;IACrF,6BAA6B,kCAAkC;IAE/D,iCAAiC,sCAAsC;IACvE,kCAAkC,uCAAuC;IACzE,4CAA4C,iDAAiD;IAC7F,oCAAoC,yCAAyC;IAC7E,gDAAgD,qDAAqD;IACrG,8CAA8C,mDAAmD;IACjG,iEAAiE,sEAAsE;IACvI,gDAAgD,qDAAqD;IACrG,kDAAkD,uDAAuD;IACzG,iDAAiD,sDAAsD;IACvG,2CAA2C,gDAAgD;IAC3F,sBAAsB,2BAA2B;IACjD,6BAA6B,kCAAkC;IAC/D,4CAA4C,iDAAiD;IAC7F,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,wBAAwB,6BAA6B;IACrD,0BAA0B,+BAA+B;IACzD,sBAAsB,2BAA2B;IACjD,+BAA+B,oCAAoC;CACpE"}
|
|
@@ -29,7 +29,6 @@ export declare class MessagesGrantAuthorization {
|
|
|
29
29
|
}): Promise<void>;
|
|
30
30
|
private static authorizeSyncScope;
|
|
31
31
|
private static authorizeProtocolSyncScope;
|
|
32
|
-
private static authorizeProjectionScopes;
|
|
33
32
|
private static authorizeSubscribeScope;
|
|
34
33
|
private static someScopeMatches;
|
|
35
34
|
private static hasUnscopedGrant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-grant-authorization.d.ts","sourceRoot":"","sources":["../../../../src/core/messages-grant-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAIxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAWrH,qBAAa,0BAA0B;WAEjB,qBAAqB,CACvC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,MAAM,EAAE,GAC3B,OAAO,CAAC,eAAe,EAAE,CAAC;IAM7B;;;OAGG;WACiB,qBAAqB,CAAC,KAAK,EAAE;QAC/C,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,aAAa,EAAE,cAAc,CAAC;QAC9B,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,eAAe,EAAE,CAAC;QACpC,YAAY,EAAE,YAAY,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBjB;;;OAGG;WACiB,wBAAwB,CAAC,KAAK,EAAE;QAClD,eAAe,EAAE,wBAAwB,GAAG,mBAAmB,CAAC;QAChE,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,eAAe,EAAE,CAAC;QACpC,YAAY,EAAE,YAAY,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBjB,OAAO,CAAC,MAAM,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"messages-grant-authorization.d.ts","sourceRoot":"","sources":["../../../../src/core/messages-grant-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAIxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAWrH,qBAAa,0BAA0B;WAEjB,qBAAqB,CACvC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,MAAM,EAAE,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,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAMpC,OAAO,CAAC,MAAM,CAAC,cAAc;CAG9B"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { GenericMessage } from '../types/message-types.js';
|
|
2
|
+
import type { ProtocolDefinition } from '../types/protocols-types.js';
|
|
3
|
+
export type ReplicationApplyOptions = {
|
|
4
|
+
dataStream?: ReadableStream<Uint8Array>;
|
|
5
|
+
};
|
|
6
|
+
export type ReplicationApplyResult = {
|
|
7
|
+
kind: 'Applied';
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'Duplicate';
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'Superseded';
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'Incomplete';
|
|
14
|
+
missing: DependencyRef[];
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'Invalid';
|
|
17
|
+
reason: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'Deferred';
|
|
20
|
+
reason: 'tenant-inactive' | 'resolver-unavailable' | 'storage';
|
|
21
|
+
};
|
|
22
|
+
export type ReplicationApplyResultContext = {
|
|
23
|
+
protocolDefinition?: ProtocolDefinition;
|
|
24
|
+
};
|
|
25
|
+
export type DependencyRef = {
|
|
26
|
+
type: 'Protocol';
|
|
27
|
+
protocol: string;
|
|
28
|
+
messageCid?: string;
|
|
29
|
+
terminal?: boolean;
|
|
30
|
+
} | {
|
|
31
|
+
type: 'InitialWrite';
|
|
32
|
+
recordId: string;
|
|
33
|
+
protocol?: string;
|
|
34
|
+
messageCid?: string;
|
|
35
|
+
terminal?: boolean;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'Parent';
|
|
38
|
+
recordId: string;
|
|
39
|
+
protocol: string;
|
|
40
|
+
messageCid?: string;
|
|
41
|
+
terminal?: boolean;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'Ancestor';
|
|
44
|
+
recordId: string;
|
|
45
|
+
protocol?: string;
|
|
46
|
+
messageCid?: string;
|
|
47
|
+
terminal?: boolean;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'Role';
|
|
50
|
+
protocol: string;
|
|
51
|
+
protocolPath: string;
|
|
52
|
+
recipient: string;
|
|
53
|
+
contextPrefix?: string;
|
|
54
|
+
messageCid?: string;
|
|
55
|
+
terminal?: boolean;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'Grant';
|
|
58
|
+
permissionGrantId: string;
|
|
59
|
+
messageCid?: string;
|
|
60
|
+
terminal?: boolean;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'KeyDelivery';
|
|
63
|
+
protocol: string;
|
|
64
|
+
contextId: string;
|
|
65
|
+
messageCid?: string;
|
|
66
|
+
terminal?: boolean;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'CrossProtocolRef';
|
|
69
|
+
protocol: string;
|
|
70
|
+
recordId: string;
|
|
71
|
+
messageCid?: string;
|
|
72
|
+
terminal?: boolean;
|
|
73
|
+
} | {
|
|
74
|
+
type: 'RecordData';
|
|
75
|
+
recordId: string;
|
|
76
|
+
dataCid: string;
|
|
77
|
+
protocol?: string;
|
|
78
|
+
messageCid?: string;
|
|
79
|
+
terminal?: boolean;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Converts a regular handler reply into the structured result consumed by
|
|
83
|
+
* replication sync. The DWN handler remains the dependency authority; this
|
|
84
|
+
* adapter only gives the sync transport a typed way to distinguish missing
|
|
85
|
+
* dependencies from terminal invalid messages.
|
|
86
|
+
*/
|
|
87
|
+
export declare function replicationApplyResultFromReply(message: GenericMessage, reply: {
|
|
88
|
+
status: {
|
|
89
|
+
code: number;
|
|
90
|
+
detail?: string;
|
|
91
|
+
};
|
|
92
|
+
}, context?: ReplicationApplyResultContext): ReplicationApplyResult;
|
|
93
|
+
//# sourceMappingURL=replication-apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replication-apply.d.ts","sourceRoot":"","sources":["../../../../src/core/replication-apply.ts"],"names":[],"mappings":"A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AAc,EACvB,KAAK,EAAE;IAAE,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EACpD,OAAO,GAAE,6BAAkC,GAC1C,sBAAsB,CA6BxB"}
|
package/dist/types/src/dwn.d.ts
CHANGED
|
@@ -6,10 +6,11 @@ import type { StateIndex } from './types/state-index.js';
|
|
|
6
6
|
import type { TenantGate } from './core/tenant-gate.js';
|
|
7
7
|
import type { UnionMessageReply } from './core/message-reply.js';
|
|
8
8
|
import type { EventLog, SubscriptionListener } from './types/subscriptions.js';
|
|
9
|
-
import type { GenericMessageReply } from './types/message-types.js';
|
|
9
|
+
import type { GenericMessage, GenericMessageReply } from './types/message-types.js';
|
|
10
10
|
import type { MessagesReadMessage, MessagesReadReply, MessagesSubscribeMessage, MessagesSubscribeMessageOptions, MessagesSubscribeReply, MessagesSyncMessage, MessagesSyncReply } from './types/messages-types.js';
|
|
11
11
|
import type { ProtocolsConfigureMessage, ProtocolsQueryMessage, ProtocolsQueryReply } from './types/protocols-types.js';
|
|
12
12
|
import type { RecordsCountMessage, RecordsCountReply, RecordsDeleteMessage, RecordsQueryMessage, RecordsQueryReply, RecordsReadMessage, RecordsReadReply, RecordsSubscribeMessage, RecordsSubscribeMessageOptions, RecordsSubscribeReply, RecordsWriteMessage, RecordsWriteMessageOptions } from './types/records-types.js';
|
|
13
|
+
import type { ReplicationApplyOptions, ReplicationApplyResult } from './core/replication-apply.js';
|
|
13
14
|
import { CoreProtocolRegistry } from './core/core-protocol.js';
|
|
14
15
|
export declare class Dwn {
|
|
15
16
|
private readonly methodHandlers;
|
|
@@ -69,6 +70,26 @@ export declare class Dwn {
|
|
|
69
70
|
processMessage(tenant: string, rawMessage: RecordsReadMessage): Promise<RecordsReadReply>;
|
|
70
71
|
processMessage(tenant: string, rawMessage: RecordsWriteMessage, options?: RecordsWriteMessageOptions): Promise<GenericMessageReply>;
|
|
71
72
|
processMessage(tenant: string, rawMessage: unknown, options?: MessageOptions): Promise<UnionMessageReply>;
|
|
73
|
+
/**
|
|
74
|
+
* Applies a message obtained through replication and returns a structured
|
|
75
|
+
* outcome instead of an HTTP-like handler status. Normal authoring still
|
|
76
|
+
* uses `processMessage`; sync uses this entry point so missing local
|
|
77
|
+
* dependencies can be fetched and retried without treating the replicated
|
|
78
|
+
* message as permanently invalid.
|
|
79
|
+
*/
|
|
80
|
+
applyReplicatedMessage(tenant: string, rawMessage: GenericMessage, options?: ReplicationApplyOptions): Promise<ReplicationApplyResult>;
|
|
81
|
+
private getReplicationApplyProtocolDefinition;
|
|
82
|
+
private static getMessageProtocolForReplicationApply;
|
|
83
|
+
private replicatedMessageAlreadyStored;
|
|
84
|
+
private getExistingMessagesForReplicationDedup;
|
|
85
|
+
private static existingReplicatedWriteMayNeedDataCompletion;
|
|
86
|
+
private repairReplicationIndexesForDuplicate;
|
|
87
|
+
private eventLogHasMessage;
|
|
88
|
+
private constructReplicationIndexRepair;
|
|
89
|
+
private static isNewestStoredMessage;
|
|
90
|
+
private static getStoredMessageForCid;
|
|
91
|
+
private getInitialWriteForReplicationEvent;
|
|
92
|
+
private static replicatedWriteHasQueryableData;
|
|
72
93
|
/**
|
|
73
94
|
* Checks tenant gate to see if tenant is allowed.
|
|
74
95
|
* @param tenant The tenant DID to route the given message to.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dwn.d.ts","sourceRoot":"","sources":["../../../src/dwn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"dwn.d.ts","sourceRoot":"","sources":["../../../src/dwn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAA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B;IAS9C;;;;OAIG;IACU,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAUrF;;;;;;;OAOG;IACU,wBAAwB,CACnC,UAAU,EAAE,GAAG,GACd,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;CAmB5C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACxC,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,CAAC"}
|
|
@@ -2,81 +2,37 @@ import type { HandlerDependencies, MethodHandler } from '../types/method-handler
|
|
|
2
2
|
import type { MessagesSyncMessage, MessagesSyncReply } from '../types/messages-types.js';
|
|
3
3
|
export declare class MessagesSyncHandler implements MethodHandler {
|
|
4
4
|
private readonly deps;
|
|
5
|
+
private _defaultHashHexCache?;
|
|
5
6
|
constructor(deps: HandlerDependencies);
|
|
6
7
|
handle({ tenant, message }: {
|
|
7
8
|
tenant: string;
|
|
8
9
|
message: MessagesSyncMessage;
|
|
9
10
|
}): Promise<MessagesSyncReply>;
|
|
10
11
|
private handleRoot;
|
|
11
|
-
private getRootHex;
|
|
12
|
-
private getIndexedRootHash;
|
|
13
12
|
private handleSubtree;
|
|
14
13
|
private handleLeaves;
|
|
15
|
-
private getSubtreeHash;
|
|
16
|
-
private getLeaves;
|
|
17
|
-
private getIndexedSubtreeHash;
|
|
18
|
-
private getIndexedLeaves;
|
|
19
14
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* set difference in a single round-trip.
|
|
23
|
-
*
|
|
24
|
-
* Response includes:
|
|
25
|
-
* - `onlyRemote`: messages the server has that the client doesn't, with
|
|
26
|
-
* inline data for small payloads.
|
|
27
|
-
* - `onlyLocal`: bit prefixes where the client has entries the server
|
|
28
|
-
* doesn't (client can enumerate its own leaves for these prefixes).
|
|
15
|
+
* Computes a single-round diff between the client's sparse Merkle tree view
|
|
16
|
+
* and this DWN's full/protocol StateIndex tree.
|
|
29
17
|
*/
|
|
30
18
|
private handleDiff;
|
|
19
|
+
private getIndexedRootHash;
|
|
31
20
|
/**
|
|
32
|
-
*
|
|
33
|
-
* subtree hashes
|
|
21
|
+
* Walks this DWN's StateIndex tree to the requested depth and returns only
|
|
22
|
+
* non-empty subtree hashes keyed by bit prefix.
|
|
34
23
|
*/
|
|
35
24
|
private collectSubtreeHashes;
|
|
36
|
-
private
|
|
37
|
-
private static
|
|
38
|
-
private static getServerSubtreeHash;
|
|
39
|
-
private static getIndexedLeavesFromStateIndex;
|
|
40
|
-
private static getIndexedSubtreeHashFromStateIndex;
|
|
41
|
-
/**
|
|
42
|
-
* Get the hex-encoded default hash for a given depth. Lazily cached.
|
|
43
|
-
*/
|
|
44
|
-
private _defaultHashHexCache?;
|
|
25
|
+
private static getIndexedLeaves;
|
|
26
|
+
private static getIndexedSubtreeHash;
|
|
45
27
|
private getDefaultHashHex;
|
|
46
28
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* payloads, inlines the data as base64url.
|
|
29
|
+
* Builds diff entries and inlines data when it is small enough for the
|
|
30
|
+
* MessagesSync response. Large record data remains fetch-by-CID.
|
|
50
31
|
*/
|
|
51
32
|
private buildDiffEntries;
|
|
52
|
-
private buildProjectedDependencyEntries;
|
|
53
|
-
private readRecordsDeleteInitialWrite;
|
|
54
|
-
private static addRecordsInitialWriteDependency;
|
|
55
|
-
private addProtocolConfigClosureDependencies;
|
|
56
|
-
private getCachedGoverningProtocolsConfigure;
|
|
57
|
-
private static addProtocolConfigDependencies;
|
|
58
|
-
private static addProtocolConfigDependency;
|
|
59
|
-
private static takeNextUnvisitedProtocol;
|
|
60
|
-
private static queueUnvisitedProtocols;
|
|
61
|
-
private static protocolsConfigureUses;
|
|
62
|
-
private readGoverningProtocolsConfigure;
|
|
63
|
-
private static recordsWriteProtocolMetadata;
|
|
64
|
-
private static recordsDeleteRecordId;
|
|
65
|
-
private static toWireMessage;
|
|
66
|
-
/**
|
|
67
|
-
* Read a message and its data from the MessageStore + DataStore by CID.
|
|
68
|
-
*/
|
|
69
33
|
private readMessageByCid;
|
|
70
34
|
private static hasEncodedData;
|
|
71
|
-
private static getProjectionScopes;
|
|
72
|
-
private withProjectionSnapshot;
|
|
73
|
-
/**
|
|
74
|
-
* Read a ReadableStream to completion and return the bytes.
|
|
75
|
-
*/
|
|
76
35
|
private static streamToBytes;
|
|
77
|
-
/**
|
|
78
|
-
* Parse a bit prefix string (e.g. "0110101") into a boolean array.
|
|
79
|
-
*/
|
|
80
36
|
private static parseBitPrefix;
|
|
81
37
|
private static authorizeMessagesSync;
|
|
82
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-sync.d.ts","sourceRoot":"","sources":["../../../../src/handlers/messages-sync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"messages-sync.d.ts","sourceRoot":"","sources":["../../../../src/handlers/messages-sync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAyB,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAqBhH,qBAAa,mBAAoB,YAAW,aAAa;IAI3C,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,oBAAoB,CAAC,CAAsB;gBAEtB,IAAI,EAAE,mBAAmB;IAEzC,MAAM,CAAC,EAClB,MAAM,EACN,OAAO,EACR,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,mBAAmB,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAwClE,UAAU;YAWV,aAAa;YAkBb,YAAY;IAkB1B;;;OAGG;YACW,UAAU;YA8DV,kBAAkB;IAWhC;;;OAGG;YACW,oBAAoB;mBAqCb,gBAAgB;mBAahB,qBAAqB;YAa5B,iBAAiB;IAY/B;;;OAGG;YACW,gBAAgB;YA6BhB,gBAAgB;IA2B9B,OAAO,CAAC,MAAM,CAAC,cAAc;mBAIR,aAAa;IAqBlC,OAAO,CAAC,MAAM,CAAC,cAAc;mBAgBR,qBAAqB;CAwB3C"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export type { DwnConfig } from './dwn.js';
|
|
2
2
|
export type { EventListener, EventLog, EventLogEntry, EventLogReadOptions, EventLogReadResult, EventLogSubscribeOptions, EventSubscription, MessageEvent, ProgressGapInfo, ProgressGapReason, ProgressToken, SubscriptionEose, SubscriptionError, SubscriptionEvent, SubscriptionListener, SubscriptionMessage, SubscriptionReply } from './types/subscriptions.js';
|
|
3
3
|
export type { AuthorizationModel, Descriptor, DelegatedGrantRecordsWriteMessage, GenericMessage, GenericMessageReply, GenericSignaturePayload, MessageSort, MessageSubscription, Pagination, QueryResultEntry, Status } from './types/message-types.js';
|
|
4
|
-
export type {
|
|
4
|
+
export type { DependencyRef, ReplicationApplyOptions, ReplicationApplyResult, ReplicationApplyResultContext } from './core/replication-apply.js';
|
|
5
|
+
export { replicationApplyResultFromReply } from './core/replication-apply.js';
|
|
6
|
+
export type { MessagesFilter, MessagesReadMessage, MessagesReadReply, MessagesReadReplyEntry, MessagesReadDescriptor, MessagesSubscribeDescriptor, MessagesSubscribeMessage, MessagesSubscribeReply, MessagesSubscribeMessageOptions, MessagesSyncAction, MessagesSyncDescriptor, MessagesSyncDiffEntry, MessagesSyncMessage, MessagesSyncReply } from './types/messages-types.js';
|
|
5
7
|
export type { GT, LT, Filter, FilterValue, KeyValues, EqualFilter, OneOfFilter, RangeFilter, RangeCriterion, PaginationCursor, QueryOptions, RangeValue, StartsWithFilter } from './types/query-types.js';
|
|
6
8
|
export type { ProtocolsConfigureDescriptor, ProtocolDefinition, ProtocolTypes, ProtocolRuleSet, ProtocolsQueryFilter, ProtocolsConfigureMessage, ProtocolsQueryMessage, ProtocolsQueryReply, ProtocolActionRule, ProtocolDeliveryStrategy, ProtocolPathEncryption, ProtocolsQueryDescriptor, ProtocolRecordLimitDefinition, ProtocolSizeDefinition, ProtocolTagsDefinition, ProtocolTagSchema, ProtocolType, ProtocolUses } from './types/protocols-types.js';
|
|
7
9
|
export { ProtocolRecordLimitStrategy } from './types/protocols-types.js';
|
|
@@ -98,8 +100,6 @@ export { SMTStoreLevel } from './smt/smt-store-level.js';
|
|
|
98
100
|
export { SMTStoreMemory } from './smt/smt-store-memory.js';
|
|
99
101
|
export type { Hash, SMTNode, SMTInternalNode, SMTLeafNode, SMTProof, SMTDiffResult, SMTNodeStore } from './types/smt-types.js';
|
|
100
102
|
export { hashChildren, hashEquals, hashKey, hashLeaf, hashToHex, hexToHash, getBit, initDefaultHashes, getDefaultHashes, SMT_DEPTH, ZERO_HASH } from './smt/smt-utils.js';
|
|
101
|
-
export { RECORDS_PROJECTION_ROOT_VERSION, RecordsProjection } from './sync/records-projection.js';
|
|
102
|
-
export type { NormalizedRecordsProjectionScope, RecordsProjectionInput, RecordsProjectionScope, RecordsProjectionSnapshot, RecordsProjectionTreeInput } from './sync/records-projection.js';
|
|
103
103
|
export type { GenerateFromRecordsWriteInput, GenerateFromRecordsWriteOut, GenerateGrantCreateInput, GenerateGrantCreateOutput, GenerateMessagesReadInput, GenerateMessagesReadOutput, GenerateMessagesSubscribeInput, GenerateMessagesSubscribeOutput, GenerateProtocolsConfigureInput, GenerateProtocolsConfigureOutput, GenerateProtocolsQueryInput, GenerateProtocolsQueryOutput, GenerateRecordsCountInput, GenerateRecordsCountOutput, GenerateRecordsDeleteInput, GenerateRecordsDeleteOutput, GenerateRecordsQueryInput, GenerateRecordsQueryOutput, GenerateRecordsSubscribeInput, GenerateRecordsSubscribeOutput, GenerateRecordsWriteInput, GenerateRecordsWriteOutput, Persona } from '../tests/utils/test-data-generator.js';
|
|
104
104
|
export { TestDataGenerator } from '../tests/utils/test-data-generator.js';
|
|
105
105
|
export { Poller } from '../tests/utils/poller.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpW,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,iCAAiC,EAAE,cAAc,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACxP,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":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BAAwB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,gCAAgC,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AACzsB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { MessageSigner } from '../types/signer.js';
|
|
2
|
-
import type { RecordsProjectionScope } from '../sync/records-projection.js';
|
|
3
2
|
import type { MessagesSyncAction, MessagesSyncMessage } from '../types/messages-types.js';
|
|
4
3
|
import { AbstractMessage } from '../core/abstract-message.js';
|
|
5
4
|
export type MessagesSyncOptions = {
|
|
6
5
|
signer: MessageSigner;
|
|
7
6
|
action: MessagesSyncAction;
|
|
8
7
|
protocol?: string;
|
|
9
|
-
projectionRootVersion?: string;
|
|
10
|
-
projectionScopes?: RecordsProjectionScope[];
|
|
11
8
|
prefix?: string;
|
|
12
9
|
messageTimestamp?: string;
|
|
13
10
|
permissionGrantIds?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-sync.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/messages-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"messages-sync.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/messages-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAA0B,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAElH,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAO9D,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAG,aAAa,CAAC;IACvB,MAAM,EAAG,kBAAkB,CAAC;IAC5B,QAAQ,CAAC,EAAG,MAAM,CAAC;IACnB,MAAM,CAAC,EAAG,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAG,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAG,MAAM,EAAE,CAAC;IAC/B,gEAAgE;IAChE,MAAM,CAAC,EAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,qEAAqE;IACrE,KAAK,CAAC,EAAG,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,YAAa,SAAQ,eAAe,CAAC,mBAAmB,CAAC;WAEhD,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;WAW1D,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;CAgChF"}
|
|
@@ -43,12 +43,6 @@ export type MessagesSyncDescriptor = {
|
|
|
43
43
|
messageTimestamp: string;
|
|
44
44
|
action: MessagesSyncAction;
|
|
45
45
|
protocol?: string;
|
|
46
|
-
projectionRootVersion?: string;
|
|
47
|
-
projectionScopes?: {
|
|
48
|
-
protocol: string;
|
|
49
|
-
protocolPath?: string;
|
|
50
|
-
contextId?: string;
|
|
51
|
-
}[];
|
|
52
46
|
prefix?: string;
|
|
53
47
|
permissionGrantIds?: string[];
|
|
54
48
|
/**
|
|
@@ -81,16 +75,6 @@ export type MessagesSyncDiffEntry = {
|
|
|
81
75
|
/** Base64url-encoded data for small RecordsWrite payloads (≤ maxInlineDataSize). */
|
|
82
76
|
encodedData?: string;
|
|
83
77
|
};
|
|
84
|
-
export type MessagesSyncDependencyClass = 'protocolsConfigure' | 'recordsInitialWrite';
|
|
85
|
-
/**
|
|
86
|
-
* Advisory dependency hint returned with projected diff responses. Dependency
|
|
87
|
-
* entries are not part of the projected root; clients must rederive that the
|
|
88
|
-
* dependency is required by the referenced primary before applying it.
|
|
89
|
-
*/
|
|
90
|
-
export type MessagesSyncDependencyEntry = MessagesSyncDiffEntry & {
|
|
91
|
-
dependencyClass: MessagesSyncDependencyClass;
|
|
92
|
-
rootMessageCid: string;
|
|
93
|
-
};
|
|
94
78
|
export type MessagesSyncReply = GenericMessageReply & {
|
|
95
79
|
root?: string;
|
|
96
80
|
hash?: string;
|
|
@@ -99,8 +83,6 @@ export type MessagesSyncReply = GenericMessageReply & {
|
|
|
99
83
|
onlyRemote?: MessagesSyncDiffEntry[];
|
|
100
84
|
/** For 'diff' action: bit prefixes where the client has entries the server doesn't. */
|
|
101
85
|
onlyLocal?: string[];
|
|
102
|
-
/** Advisory dependency messages needed to apply projected `onlyRemote` primary entries. */
|
|
103
|
-
dependencies?: MessagesSyncDependencyEntry[];
|
|
104
86
|
};
|
|
105
87
|
export type MessagesSubscribeMessageOptions = {
|
|
106
88
|
subscriptionHandler: SubscriptionListener;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-types.d.ts","sourceRoot":"","sources":["../../../../src/types/messages-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAA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,wBAAwB,GAAG;IACrC,aAAa,EAAE,kBAAkB,CAAC;IAClC,UAAU,EAAE,2BAA2B,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GAAG;IACzD,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,iEAAiE;IACjE,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,aAAa,CAAA;KAAE,GAAG,eAAe,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,gBAAgB,CAAC,QAAQ,CAAC;IACrC,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replication-apply.spec.d.ts","sourceRoot":"","sources":["../../../../tests/core/replication-apply.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dwn.spec.d.ts","sourceRoot":"","sources":["../../../tests/dwn.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dwn.spec.d.ts","sourceRoot":"","sources":["../../../tests/dwn.spec.ts"],"names":[],"mappings":"AAgBA,wBAAgB,YAAY,IAAI,IAAI,CAqTnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-sync.spec.d.ts","sourceRoot":"","sources":["../../../../tests/handlers/messages-sync.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"messages-sync.spec.d.ts","sourceRoot":"","sources":["../../../../tests/handlers/messages-sync.spec.ts"],"names":[],"mappings":"AAoCA,wBAAgB,uBAAuB,IAAI,IAAI,CAwuC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-suite.d.ts","sourceRoot":"","sources":["../../../tests/test-suite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-suite.d.ts","sourceRoot":"","sources":["../../../tests/test-suite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAwCzG;;GAEG;AACH,qBAAa,SAAS;IAEpB;;;OAGG;WACW,2BAA2B,CAAC,SAAS,CAAC,EAAE;QACpD,YAAY,CAAC,EAAE,YAAY,CAAC;QAC5B,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;KACzC,GAAG,IAAI;CA+CT"}
|
package/package.json
CHANGED
package/src/core/dwn-error.ts
CHANGED
|
@@ -23,8 +23,6 @@ export enum DwnErrorCode {
|
|
|
23
23
|
EventLogNotOpenError = 'EventLogNotOpenError',
|
|
24
24
|
EventLogProgressGap = 'EventLogProgressGap',
|
|
25
25
|
MessagesGrantAuthorizationMismatchedProtocol = 'MessagesGrantAuthorizationMismatchedProtocol',
|
|
26
|
-
MessagesGrantAuthorizationProjectionInfrastructureProtocol = 'MessagesGrantAuthorizationProjectionInfrastructureProtocol',
|
|
27
|
-
MessagesGrantAuthorizationProjectionScopeMismatch = 'MessagesGrantAuthorizationProjectionScopeMismatch',
|
|
28
26
|
MessagesGrantAuthorizationProtocolSyncInfrastructureProtocol = 'MessagesGrantAuthorizationProtocolSyncInfrastructureProtocol',
|
|
29
27
|
MessagesGrantAuthorizationSubscribeProtocolMismatch = 'MessagesGrantAuthorizationSubscribeProtocolMismatch',
|
|
30
28
|
MessagesGrantAuthorizationUnfilteredSubscribeProtocolScope = 'MessagesGrantAuthorizationUnfilteredSubscribeProtocolScope',
|
|
@@ -62,7 +60,6 @@ export enum DwnErrorCode {
|
|
|
62
60
|
MessagesReadVerifyScopeFailed = 'MessagesReadVerifyScopeFailed',
|
|
63
61
|
MessagesSyncAuthorizationFailed = 'MessagesSyncAuthorizationFailed',
|
|
64
62
|
MessagesSyncInvalidPrefix = 'MessagesSyncInvalidPrefix',
|
|
65
|
-
MessagesSyncUnsupportedProjectionRootVersion = 'MessagesSyncUnsupportedProjectionRootVersion',
|
|
66
63
|
ParseCidCodecNotSupported = 'ParseCidCodecNotSupported',
|
|
67
64
|
ParseCidMultihashNotSupported = 'ParseCidMultihashNotSupported',
|
|
68
65
|
PermissionsProtocolCreateGrantScopeContextIdProtocolPathConflict = 'PermissionsProtocolCreateGrantScopeContextIdProtocolPathConflict',
|
|
@@ -114,6 +111,7 @@ export enum DwnErrorCode {
|
|
|
114
111
|
ProtocolAuthorizationStoredInitialWriteRoleMissingRecipient = 'ProtocolAuthorizationStoredInitialWriteRoleMissingRecipient',
|
|
115
112
|
ProtocolAuthorizationMissingContextId = 'ProtocolAuthorizationMissingContextId',
|
|
116
113
|
ProtocolAuthorizationMissingRuleSet = 'ProtocolAuthorizationMissingRuleSet',
|
|
114
|
+
ProtocolAuthorizationParentRecordNotFound = 'ProtocolAuthorizationParentRecordNotFound',
|
|
117
115
|
ProtocolAuthorizationParentlessIncorrectProtocolPath = 'ProtocolAuthorizationParentlessIncorrectProtocolPath',
|
|
118
116
|
ProtocolAuthorizationNotARole = 'ProtocolAuthorizationNotARole',
|
|
119
117
|
ProtocolAuthorizationParentNotFoundConstructingRecordChain = 'ProtocolAuthorizationParentNotFoundConstructingRecordChain',
|
|
@@ -99,14 +99,7 @@ export class MessagesGrantAuthorization {
|
|
|
99
99
|
syncMessage: MessagesSyncMessage,
|
|
100
100
|
scopes: MessagesPermissionScope[]
|
|
101
101
|
): void {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (projectionScopes === undefined) {
|
|
105
|
-
MessagesGrantAuthorization.authorizeProtocolSyncScope(scopes, protocol);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
MessagesGrantAuthorization.authorizeProjectionScopes(scopes, projectionScopes);
|
|
102
|
+
MessagesGrantAuthorization.authorizeProtocolSyncScope(scopes, syncMessage.descriptor.protocol);
|
|
110
103
|
}
|
|
111
104
|
|
|
112
105
|
private static authorizeProtocolSyncScope(
|
|
@@ -128,29 +121,6 @@ export class MessagesGrantAuthorization {
|
|
|
128
121
|
}
|
|
129
122
|
}
|
|
130
123
|
|
|
131
|
-
private static authorizeProjectionScopes(
|
|
132
|
-
scopes: MessagesPermissionScope[],
|
|
133
|
-
projectionScopes: ProtocolScope[],
|
|
134
|
-
): void {
|
|
135
|
-
for (const projectionScope of projectionScopes) {
|
|
136
|
-
if (isRecordsPrimaryProjectionExcludedProtocol(projectionScope.protocol)) {
|
|
137
|
-
throw new DwnError(
|
|
138
|
-
DwnErrorCode.MessagesGrantAuthorizationProjectionInfrastructureProtocol,
|
|
139
|
-
`Projected MessagesSync cannot authorize infrastructure protocol ${projectionScope.protocol}`
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (MessagesGrantAuthorization.someScopeMatches(scopes, projectionScope)) {
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
throw new DwnError(
|
|
148
|
-
DwnErrorCode.MessagesGrantAuthorizationProjectionScopeMismatch,
|
|
149
|
-
`No permission grant scope matches projection scope ${JSON.stringify(projectionScope)}`
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
124
|
private static authorizeSubscribeScope(
|
|
155
125
|
subscribeMessage: MessagesSubscribeMessage,
|
|
156
126
|
scopes: MessagesPermissionScope[]
|