@enbox/dwn-sdk-js 0.0.3 → 0.0.5
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 +135 -0
- package/dist/browser.mjs.map +7 -0
- package/dist/esm/generated/precompiled-validators.js +640 -510
- package/dist/esm/generated/precompiled-validators.js.map +1 -1
- package/dist/esm/src/core/auth.js +6 -1
- package/dist/esm/src/core/auth.js.map +1 -1
- package/dist/esm/src/core/dwn-error.js +3 -0
- package/dist/esm/src/core/dwn-error.js.map +1 -1
- package/dist/esm/src/core/protocol-authorization.js +4 -0
- package/dist/esm/src/core/protocol-authorization.js.map +1 -1
- package/dist/esm/src/dwn.js +14 -0
- package/dist/esm/src/dwn.js.map +1 -1
- package/dist/esm/src/handlers/protocols-configure.js.map +1 -1
- package/dist/esm/src/handlers/records-delete.js +13 -0
- package/dist/esm/src/handlers/records-delete.js.map +1 -1
- package/dist/esm/src/handlers/records-subscribe.js +121 -66
- package/dist/esm/src/handlers/records-subscribe.js.map +1 -1
- package/dist/esm/src/handlers/records-write.js +1 -1
- package/dist/esm/src/handlers/records-write.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/protocols-configure.js.map +1 -1
- package/dist/esm/src/interfaces/records-delete.js +1 -0
- package/dist/esm/src/interfaces/records-delete.js.map +1 -1
- package/dist/esm/src/interfaces/records-subscribe.js +2 -0
- package/dist/esm/src/interfaces/records-subscribe.js.map +1 -1
- package/dist/esm/src/interfaces/records-write.js +28 -45
- package/dist/esm/src/interfaces/records-write.js.map +1 -1
- package/dist/esm/src/jose/jws/general/verifier.js +9 -1
- package/dist/esm/src/jose/jws/general/verifier.js.map +1 -1
- package/dist/esm/src/smt/smt-utils.js +1 -1
- package/dist/esm/src/smt/smt-utils.js.map +1 -1
- package/dist/esm/src/types/records-types.js.map +1 -1
- package/dist/esm/src/utils/encryption.js +221 -78
- package/dist/esm/src/utils/encryption.js.map +1 -1
- package/dist/esm/src/utils/hd-key.js +6 -7
- package/dist/esm/src/utils/hd-key.js.map +1 -1
- package/dist/esm/src/utils/protocols.js +12 -10
- package/dist/esm/src/utils/protocols.js.map +1 -1
- package/dist/esm/src/utils/records.js +33 -44
- package/dist/esm/src/utils/records.js.map +1 -1
- package/dist/esm/tests/features/protocol-composition.spec.js +26 -21
- package/dist/esm/tests/features/protocol-composition.spec.js.map +1 -1
- package/dist/esm/tests/features/records-tags.spec.js +5 -5
- package/dist/esm/tests/features/records-tags.spec.js.map +1 -1
- package/dist/esm/tests/handlers/records-delete.spec.js +120 -2
- package/dist/esm/tests/handlers/records-delete.spec.js.map +1 -1
- package/dist/esm/tests/handlers/records-read.spec.js +25 -26
- package/dist/esm/tests/handlers/records-read.spec.js.map +1 -1
- package/dist/esm/tests/handlers/records-subscribe.spec.js +103 -0
- package/dist/esm/tests/handlers/records-subscribe.spec.js.map +1 -1
- package/dist/esm/tests/handlers/records-write.spec.js +124 -10
- package/dist/esm/tests/handlers/records-write.spec.js.map +1 -1
- package/dist/esm/tests/interfaces/messages-get.spec.js +3 -2
- package/dist/esm/tests/interfaces/messages-get.spec.js.map +1 -1
- package/dist/esm/tests/interfaces/records-write.spec.js +43 -34
- package/dist/esm/tests/interfaces/records-write.spec.js.map +1 -1
- package/dist/esm/tests/scenarios/end-to-end-tests.spec.js +4 -4
- package/dist/esm/tests/scenarios/end-to-end-tests.spec.js.map +1 -1
- package/dist/esm/tests/utils/encryption-callbacks.spec.js +21 -24
- package/dist/esm/tests/utils/encryption-callbacks.spec.js.map +1 -1
- package/dist/esm/tests/utils/encryption.spec.js +69 -66
- package/dist/esm/tests/utils/encryption.spec.js.map +1 -1
- package/dist/esm/tests/utils/filters.spec.js +1 -0
- package/dist/esm/tests/utils/filters.spec.js.map +1 -1
- package/dist/esm/tests/utils/test-data-generator.js +28 -7
- package/dist/esm/tests/utils/test-data-generator.js.map +1 -1
- package/dist/esm/tests/validation/json-schemas/protocols/protocols-configure.spec.js +1 -1
- package/dist/esm/tests/validation/json-schemas/protocols/protocols-configure.spec.js.map +1 -1
- package/dist/types/generated/precompiled-validators.d.ts.map +1 -1
- package/dist/types/src/core/auth.d.ts +3 -1
- package/dist/types/src/core/auth.d.ts.map +1 -1
- package/dist/types/src/core/dwn-error.d.ts +3 -0
- package/dist/types/src/core/dwn-error.d.ts.map +1 -1
- package/dist/types/src/core/protocol-authorization.d.ts.map +1 -1
- package/dist/types/src/dwn.d.ts +12 -0
- package/dist/types/src/dwn.d.ts.map +1 -1
- package/dist/types/src/handlers/protocols-configure.d.ts.map +1 -1
- package/dist/types/src/handlers/records-delete.d.ts.map +1 -1
- package/dist/types/src/handlers/records-subscribe.d.ts +17 -28
- package/dist/types/src/handlers/records-subscribe.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +4 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/interfaces/records-delete.d.ts +4 -0
- package/dist/types/src/interfaces/records-delete.d.ts.map +1 -1
- package/dist/types/src/interfaces/records-subscribe.d.ts +4 -1
- package/dist/types/src/interfaces/records-subscribe.d.ts.map +1 -1
- package/dist/types/src/interfaces/records-write.d.ts +23 -53
- package/dist/types/src/interfaces/records-write.d.ts.map +1 -1
- package/dist/types/src/jose/jws/general/verifier.d.ts.map +1 -1
- package/dist/types/src/types/encryption-types.d.ts +9 -8
- package/dist/types/src/types/encryption-types.d.ts.map +1 -1
- package/dist/types/src/types/protocols-types.d.ts +65 -16
- package/dist/types/src/types/protocols-types.d.ts.map +1 -1
- package/dist/types/src/types/records-types.d.ts +7 -26
- package/dist/types/src/types/records-types.d.ts.map +1 -1
- package/dist/types/src/utils/encryption.d.ts +157 -28
- package/dist/types/src/utils/encryption.d.ts.map +1 -1
- package/dist/types/src/utils/hd-key.d.ts +2 -3
- package/dist/types/src/utils/hd-key.d.ts.map +1 -1
- package/dist/types/src/utils/protocols.d.ts.map +1 -1
- package/dist/types/src/utils/records.d.ts +3 -4
- package/dist/types/src/utils/records.d.ts.map +1 -1
- package/dist/types/tests/features/protocol-composition.spec.d.ts.map +1 -1
- package/dist/types/tests/handlers/records-delete.spec.d.ts.map +1 -1
- package/dist/types/tests/handlers/records-read.spec.d.ts.map +1 -1
- package/dist/types/tests/handlers/records-subscribe.spec.d.ts.map +1 -1
- package/dist/types/tests/handlers/records-write.spec.d.ts.map +1 -1
- package/dist/types/tests/utils/test-data-generator.d.ts +7 -0
- package/dist/types/tests/utils/test-data-generator.d.ts.map +1 -1
- package/package.json +10 -21
- package/src/core/auth.ts +12 -1
- package/src/core/dwn-error.ts +3 -0
- package/src/core/protocol-authorization.ts +8 -0
- package/src/dwn.ts +15 -0
- package/src/handlers/protocols-configure.ts +4 -4
- package/src/handlers/records-delete.ts +12 -0
- package/src/handlers/records-subscribe.ts +174 -75
- package/src/handlers/records-write.ts +1 -1
- package/src/index.ts +4 -4
- package/src/interfaces/protocols-configure.ts +5 -5
- package/src/interfaces/records-delete.ts +9 -3
- package/src/interfaces/records-subscribe.ts +6 -1
- package/src/interfaces/records-write.ts +33 -105
- package/src/jose/jws/general/verifier.ts +11 -1
- package/src/smt/smt-utils.ts +1 -1
- package/src/types/encryption-types.ts +9 -8
- package/src/types/protocols-types.ts +72 -18
- package/src/types/records-types.ts +7 -29
- package/src/utils/encryption.ts +346 -88
- package/src/utils/hd-key.ts +9 -10
- package/src/utils/protocols.ts +15 -13
- package/src/utils/records.ts +47 -55
- package/dist/bundles/dwn.js +0 -151
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dwn.d.ts","sourceRoot":"","sources":["../../../src/dwn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM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;OAGG;mBACkB,gCAAgC;IAkBrD;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,+BAA+B;CA+F/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-delete.d.ts","sourceRoot":"","sources":["../../../../src/handlers/records-delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"records-delete.d.ts","sourceRoot":"","sources":["../../../../src/handlers/records-delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAe9E,qBAAa,oBAAqB,YAAW,aAAa;IAGtD,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,oBAAoB;gBAFpB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB;IAGvC,MAAM,CAAC,EAClB,MAAM,EACN,OAAO,EACR,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,oBAAoB,CAAA;KAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAmElF;;;;OAIG;mBACkB,sBAAsB;CAgC5C"}
|
|
@@ -15,45 +15,34 @@ export declare class RecordsSubscribeHandler implements MethodHandler {
|
|
|
15
15
|
subscriptionHandler: RecordSubscriptionHandler;
|
|
16
16
|
}): Promise<RecordsSubscribeReply>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Convert an incoming DateSort to a sort type accepted by MessageStore.
|
|
19
|
+
* Defaults to `dateCreated` ascending if no sort is supplied.
|
|
19
20
|
*/
|
|
20
|
-
private static
|
|
21
|
+
private static convertDateSort;
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* Filters can support emitting messages for both published and unpublished records,
|
|
25
|
-
* as well as explicitly only published or only unpublished records.
|
|
26
|
-
*
|
|
27
|
-
* A) BOTH published and unpublished:
|
|
28
|
-
* 1. published records; and
|
|
29
|
-
* 2. unpublished records intended for the subscription author (where `recipient` is the subscription author); and
|
|
30
|
-
* 3. unpublished records authorized by a protocol rule.
|
|
31
|
-
*
|
|
32
|
-
* B) PUBLISHED:
|
|
33
|
-
* 1. only published records;
|
|
34
|
-
*
|
|
35
|
-
* C) UNPUBLISHED:
|
|
36
|
-
* 1. unpublished records intended for the subscription author (where `recipient` is the subscription author); and
|
|
37
|
-
* 2. unpublished records authorized by a protocol rule.
|
|
23
|
+
* Build event filters for owner: all matching Write+Delete events.
|
|
38
24
|
*/
|
|
39
|
-
private static
|
|
25
|
+
private static buildOwnerEventFilters;
|
|
40
26
|
/**
|
|
41
|
-
*
|
|
27
|
+
* Build event filters for non-owner with visibility rules.
|
|
42
28
|
*/
|
|
43
|
-
private static
|
|
29
|
+
private static buildNonOwnerEventFilters;
|
|
44
30
|
/**
|
|
45
|
-
*
|
|
31
|
+
* Build a published-only event filter (Write+Delete).
|
|
46
32
|
*/
|
|
47
|
-
private static
|
|
33
|
+
private static buildPublishedEventFilter;
|
|
48
34
|
/**
|
|
49
|
-
*
|
|
50
|
-
* Validation that `protocol` and other required protocol-related fields occurs before this method.
|
|
35
|
+
* Build query filters for owner: latest writes matching the filter.
|
|
51
36
|
*/
|
|
52
|
-
private static
|
|
37
|
+
private static buildOwnerQueryFilters;
|
|
53
38
|
/**
|
|
54
|
-
*
|
|
39
|
+
* Build query filters for non-owner with visibility rules.
|
|
55
40
|
*/
|
|
56
|
-
private static
|
|
41
|
+
private static buildNonOwnerQueryFilters;
|
|
42
|
+
/**
|
|
43
|
+
* Build a published-only query filter (latest writes).
|
|
44
|
+
*/
|
|
45
|
+
private static buildPublishedQueryFilter;
|
|
57
46
|
/**
|
|
58
47
|
* @param messageStore Used to check if the grant has been revoked.
|
|
59
48
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-subscribe.d.ts","sourceRoot":"","sources":["../../../../src/handlers/records-subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"records-subscribe.d.ts","sourceRoot":"","sources":["../../../../src/handlers/records-subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,KAAK,EAAuC,uBAAuB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAShK,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAMtE,qBAAa,uBAAwB,YAAW,aAAa;IAE/C,OAAO,CAAC,WAAW;IAAe,OAAO,CAAC,YAAY;IAAgB,OAAO,CAAC,WAAW,CAAC;gBAAlF,WAAW,EAAE,WAAW,EAAU,YAAY,EAAE,YAAY,EAAU,WAAW,CAAC,EAAE,WAAW,YAAA;IAEtG,MAAM,CAAC,EAClB,MAAM,EACN,OAAO,EACP,mBAAmB,EACpB,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,uBAAuB,CAAC;QACjC,mBAAmB,EAAE,yBAAyB,CAAC;KAChD,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA0FlC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAwB9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IASrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAwCxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAcxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAUrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IA2CxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAWxC;;OAEG;WACiB,yBAAyB,CAC3C,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC;CAajB"}
|
|
@@ -3,8 +3,8 @@ export type { EventListener, EventStream, EventSubscription, MessageEvent, Subsc
|
|
|
3
3
|
export type { AuthorizationModel, Descriptor, DelegatedGrantRecordsWriteMessage, GenericMessage, GenericMessageReply, GenericSignaturePayload, MessageSort, MessageSubscription, Pagination, QueryResultEntry, Status } from './types/message-types.js';
|
|
4
4
|
export type { MessagesFilter, MessagesReadMessage as MessagesReadMessage, MessagesReadReply as MessagesReadReply, MessagesReadReplyEntry as MessagesReadReplyEntry, MessagesReadDescriptor, MessagesSubscribeDescriptor, MessagesSubscribeMessage, MessagesSubscribeReply, MessageSubscriptionHandler, MessagesSubscribeMessageOptions, MessagesSyncAction, MessagesSyncDescriptor, MessagesSyncMessage, MessagesSyncReply } from './types/messages-types.js';
|
|
5
5
|
export type { GT, LT, Filter, FilterValue, KeyValues, EqualFilter, OneOfFilter, RangeFilter, RangeCriterion, PaginationCursor, QueryOptions, RangeValue, StartsWithFilter } from './types/query-types.js';
|
|
6
|
-
export type { ProtocolsConfigureDescriptor, ProtocolDefinition, ProtocolTypes, ProtocolRuleSet, ProtocolsQueryFilter, ProtocolsConfigureMessage, ProtocolsQueryMessage, ProtocolsQueryReply, ProtocolActionRule, ProtocolPathEncryption, ProtocolsQueryDescriptor, ProtocolType, ProtocolUses } from './types/protocols-types.js';
|
|
7
|
-
export type { DataEncodedRecordsWriteMessage,
|
|
6
|
+
export type { ProtocolsConfigureDescriptor, ProtocolDefinition, ProtocolTypes, ProtocolRuleSet, ProtocolsQueryFilter, ProtocolsConfigureMessage, ProtocolsQueryMessage, ProtocolsQueryReply, ProtocolActionRule, ProtocolPathEncryption, ProtocolsQueryDescriptor, ProtocolSizeDefinition, ProtocolTagsDefinition, ProtocolTagSchema, ProtocolType, ProtocolUses } from './types/protocols-types.js';
|
|
7
|
+
export type { DataEncodedRecordsWriteMessage, RecordsCountDescriptor, RecordsCountMessage, RecordsCountReply, RecordsDeleteMessage, RecordsFilter, RecordsQueryMessage, RecordsQueryReply, RecordsQueryReplyEntry, RecordsReadMessage, RecordsReadReply, RecordsSubscribeDescriptor, RecordsSubscribeMessage, RecordsSubscribeReply, RecordSubscriptionHandler, RecordsWriteDescriptor, RecordsWriteTags, RecordsWriteTagValue, RecordsWriteMessage, RecordsWriteSignaturePayload, RecordsDeleteDescriptor, RecordsQueryDescriptor, RecordsReadDescriptor, RecordsSubscribeMessageOptions, RecordsWriteMessageOptions, InternalRecordsWriteMessage, RecordEvent, RecordsWriteTagsFilter } from './types/records-types.js';
|
|
8
8
|
export type { GeneralJws, SignatureEntry } from './types/jws-types.js';
|
|
9
9
|
export { authenticate } from './core/auth.js';
|
|
10
10
|
export { AllowAllTenantGate } from './core/tenant-gate.js';
|
|
@@ -27,8 +27,8 @@ export { DwnInterfaceName, DwnMethodName } from './enums/dwn-interface-method.js
|
|
|
27
27
|
export { Encoder } from './utils/encoder.js';
|
|
28
28
|
export { MessagesSubscribe as MessagesSubscribe } from './interfaces/messages-subscribe.js';
|
|
29
29
|
export type { MessagesSubscribeOptions as MessagesSubscribeOptions } from './interfaces/messages-subscribe.js';
|
|
30
|
-
export { Encryption,
|
|
31
|
-
export type {
|
|
30
|
+
export { Encryption, ContentEncryptionAlgorithm, KeyAgreementAlgorithm } from './utils/encryption.js';
|
|
31
|
+
export type { JweEncryption, JweRecipient, JweRecipientHeader, JweProtectedHeader, JweKeyUnwrapPayload } from './utils/encryption.js';
|
|
32
32
|
export { RecordsWrite } from './interfaces/records-write.js';
|
|
33
33
|
export type { EncryptionInput, KeyEncryptionInput, RecordsWriteOptions, CreateFromOptions } from './interfaces/records-write.js';
|
|
34
34
|
export { executeUnlessAborted } from './utils/abort.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,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC/H,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,YAA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AAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG1K,YAAY,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,wBAAwB,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"}
|
|
@@ -12,6 +12,10 @@ export type RecordsDeleteOptions = {
|
|
|
12
12
|
* Denotes if all the descendent records should be purged. Defaults to `false`.
|
|
13
13
|
*/
|
|
14
14
|
prune?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The ID of the permission grant authorizing this delete.
|
|
17
|
+
*/
|
|
18
|
+
permissionGrantId?: string;
|
|
15
19
|
/**
|
|
16
20
|
* The delegated grant to sign on behalf of the logical author, which is the grantor (`grantedBy`) of the delegated grant.
|
|
17
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-delete.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/records-delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAA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IAEf;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,cAAc,CAAC,EAAE,8BAA8B,CAAC;CACjD,CAAC;AAEF,qBAAa,aAAc,SAAQ,eAAe,CAAC,oBAAoB,CAAC;WAElD,KAAK,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC;IAchF;;;;OAIG;WACiB,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC;IA0BjF;;OAEG;IACI,gBAAgB,CACrB,YAAY,EAAE,mBAAmB,GAChC,SAAS;IAuBC,iBAAiB,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAWrH"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { MessageSigner } from '../types/signer.js';
|
|
2
2
|
import type { MessageStore } from '../types/message-store.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Pagination } from '../types/message-types.js';
|
|
4
|
+
import type { DataEncodedRecordsWriteMessage, DateSort, RecordsFilter, RecordsSubscribeMessage } from '../types/records-types.js';
|
|
4
5
|
import { AbstractMessage } from '../core/abstract-message.js';
|
|
5
6
|
export type RecordsSubscribeOptions = {
|
|
6
7
|
messageTimestamp?: string;
|
|
7
8
|
filter: RecordsFilter;
|
|
9
|
+
dateSort?: DateSort;
|
|
10
|
+
pagination?: Pagination;
|
|
8
11
|
signer?: MessageSigner;
|
|
9
12
|
protocolRole?: string;
|
|
10
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-subscribe.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/records-subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,8BAA8B,EAAE,aAAa,EAA8B,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"records-subscribe.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/records-subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,8BAA8B,EAAE,QAAQ,EAAE,aAAa,EAA8B,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAE9J,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAW9D,MAAM,MAAM,uBAAuB,GAAG;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,cAAc,CAAC,EAAE,8BAA8B,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,eAAe,CAAC,uBAAuB,CAAC;WAExD,KAAK,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;WA2BlE,MAAM,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAgCvF;;;KAGC;IACY,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAU1E"}
|
|
@@ -4,10 +4,9 @@ import type { MessageInterface } from '../types/message-interface.js';
|
|
|
4
4
|
import type { MessageSigner } from '../types/signer.js';
|
|
5
5
|
import type { MessageStore } from '../types/message-store.js';
|
|
6
6
|
import type { PublicKeyJwk } from '../types/jose-types.js';
|
|
7
|
-
import type { DataEncodedRecordsWriteMessage,
|
|
7
|
+
import type { DataEncodedRecordsWriteMessage, InternalRecordsWriteMessage, RecordsWriteDescriptor, RecordsWriteMessage, RecordsWriteSignaturePayload, RecordsWriteTags } from '../types/records-types.js';
|
|
8
|
+
import type { EncryptionInput, JweEncryption } from '../utils/encryption.js';
|
|
8
9
|
import type { GenericMessage, GenericSignaturePayload } from '../types/message-types.js';
|
|
9
|
-
import { EncryptionAlgorithm } from '../utils/encryption.js';
|
|
10
|
-
import { KeyDerivationScheme } from '../utils/hd-key.js';
|
|
11
10
|
export type RecordsWriteOptions = {
|
|
12
11
|
recipient?: string;
|
|
13
12
|
protocol?: string;
|
|
@@ -51,50 +50,7 @@ export type RecordsWriteOptions = {
|
|
|
51
50
|
publicKeyJwk: PublicKeyJwk;
|
|
52
51
|
};
|
|
53
52
|
};
|
|
54
|
-
|
|
55
|
-
* Input that describes how data is encrypted as spec-ed in TP18.
|
|
56
|
-
*/
|
|
57
|
-
export type EncryptionInput = {
|
|
58
|
-
/**
|
|
59
|
-
* Algorithm used for encrypting the Data. Uses {EncryptionAlgorithm.Aes256Ctr} if not given.
|
|
60
|
-
*/
|
|
61
|
-
algorithm?: EncryptionAlgorithm;
|
|
62
|
-
/**
|
|
63
|
-
* Initialization vector used for encrypting the data.
|
|
64
|
-
*/
|
|
65
|
-
initializationVector: Uint8Array;
|
|
66
|
-
/**
|
|
67
|
-
* Symmetric key used to encrypt the data.
|
|
68
|
-
*/
|
|
69
|
-
key: Uint8Array;
|
|
70
|
-
/**
|
|
71
|
-
* Array of input that specifies how the symmetric key is encrypted.
|
|
72
|
-
* Each entry in the array will result in a unique ciphertext of the symmetric key.
|
|
73
|
-
*/
|
|
74
|
-
keyEncryptionInputs: KeyEncryptionInput[];
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Input that specifies how a symmetric key is encrypted.
|
|
78
|
-
*/
|
|
79
|
-
export type KeyEncryptionInput = {
|
|
80
|
-
/**
|
|
81
|
-
* Key derivation scheme used to derive the public key to encrypt the symmetric key.
|
|
82
|
-
*/
|
|
83
|
-
derivationScheme: KeyDerivationScheme;
|
|
84
|
-
/**
|
|
85
|
-
* Fully qualified ID of root public key used derive the public key to be used to to encrypt the symmetric key.
|
|
86
|
-
* (e.g. did:example:abc#encryption-key-id)
|
|
87
|
-
*/
|
|
88
|
-
publicKeyId: string;
|
|
89
|
-
/**
|
|
90
|
-
* Public key to be used to encrypt the symmetric key.
|
|
91
|
-
*/
|
|
92
|
-
publicKey: PublicKeyJwk;
|
|
93
|
-
/**
|
|
94
|
-
* Algorithm used for encrypting the symmetric key. Uses {EncryptionAlgorithm.EciesSecp256k1} if not given.
|
|
95
|
-
*/
|
|
96
|
-
algorithm?: EncryptionAlgorithm;
|
|
97
|
-
};
|
|
53
|
+
export type { EncryptionInput, KeyEncryptionInput } from '../utils/encryption.js';
|
|
98
54
|
export type CreateFromOptions = {
|
|
99
55
|
recordsWriteMessage: RecordsWriteMessage;
|
|
100
56
|
data?: Uint8Array;
|
|
@@ -209,10 +165,10 @@ export declare class RecordsWrite implements MessageInterface<RecordsWriteMessag
|
|
|
209
165
|
/**
|
|
210
166
|
* Encrypts the symmetric encryption key using the public keys given and attach the resulting `encryption` property to the RecordsWrite.
|
|
211
167
|
*
|
|
212
|
-
* @param options.append - When `true`, appends new `
|
|
168
|
+
* @param options.append - When `true`, appends new `recipients` entries to the existing
|
|
213
169
|
* `encryption` property instead of replacing it. Requires `this._message.encryption` to
|
|
214
170
|
* already exist (i.e., the record must already be encrypted). This is used for the reactive
|
|
215
|
-
* root-record upgrade: adding a ProtocolContext
|
|
171
|
+
* root-record upgrade: adding a ProtocolContext recipient entry alongside an existing
|
|
216
172
|
* ProtocolPath entry so both the owner and context key holders can decrypt.
|
|
217
173
|
*/
|
|
218
174
|
encryptSymmetricEncryptionKey(encryptionInput: EncryptionInput, options?: {
|
|
@@ -250,7 +206,7 @@ export declare class RecordsWrite implements MessageInterface<RecordsWriteMessag
|
|
|
250
206
|
private validateIntegrity;
|
|
251
207
|
/**
|
|
252
208
|
* Validates the structural integrity of the `attestation` property.
|
|
253
|
-
* NOTE:
|
|
209
|
+
* NOTE: Cryptographic verification of attestation signatures is performed in `authenticate()`.
|
|
254
210
|
*/
|
|
255
211
|
private static validateAttestationIntegrity;
|
|
256
212
|
/**
|
|
@@ -281,8 +237,22 @@ export declare class RecordsWrite implements MessageInterface<RecordsWriteMessag
|
|
|
281
237
|
*/
|
|
282
238
|
static isInitialWrite(message: GenericMessage): Promise<boolean>;
|
|
283
239
|
/**
|
|
284
|
-
* Creates the `encryption` property if encryption input is given. Else `undefined` is returned.
|
|
285
|
-
*
|
|
240
|
+
* Creates the JWE `encryption` property if encryption input is given. Else `undefined` is returned.
|
|
241
|
+
* Uses ECDH-ES+A256KW key agreement with X25519 and AEAD content encryption (A256GCM or XC20P).
|
|
242
|
+
* @param descriptor Descriptor of the `RecordsWrite` message which contains the information needed by key path derivation schemes.
|
|
243
|
+
*/
|
|
244
|
+
/**
|
|
245
|
+
* Creates the JWE `encryption` property if encryption input is given. Else `undefined` is returned.
|
|
246
|
+
* Uses ECDH-ES+A256KW key agreement with X25519 and AEAD content encryption (A256GCM or XC20P).
|
|
247
|
+
* @param descriptor Descriptor of the `RecordsWrite` message which contains the information needed by key path derivation schemes.
|
|
248
|
+
* @param encryptionInput The encryption input containing CEK, IV, and recipient key encryption inputs.
|
|
249
|
+
* @param tag The authentication tag from the AEAD content encryption (stored in the JWE, separate from the ciphertext).
|
|
250
|
+
*/
|
|
251
|
+
/**
|
|
252
|
+
* Creates the JWE `encryption` property if encryption input is given. Else `undefined` is returned.
|
|
253
|
+
* Uses ECDH-ES+A256KW key agreement with X25519 and AEAD content encryption (A256GCM or XC20P).
|
|
254
|
+
* @param descriptor Descriptor of the `RecordsWrite` message which contains the information needed by key path derivation schemes.
|
|
255
|
+
* @param encryptionInput The encryption input containing CEK, IV, authentication tag, and recipient key encryption inputs.
|
|
286
256
|
*/
|
|
287
257
|
private static createEncryptionProperty;
|
|
288
258
|
/**
|
|
@@ -297,7 +267,7 @@ export declare class RecordsWrite implements MessageInterface<RecordsWriteMessag
|
|
|
297
267
|
contextId: string | undefined;
|
|
298
268
|
descriptorCid: string;
|
|
299
269
|
attestation: GeneralJws | undefined;
|
|
300
|
-
encryption:
|
|
270
|
+
encryption: JweEncryption | undefined;
|
|
301
271
|
signer: MessageSigner;
|
|
302
272
|
delegatedGrantId?: string;
|
|
303
273
|
permissionGrantId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-write.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/records-write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EACV,8BAA8B,
|
|
1
|
+
{"version":3,"file":"records-write.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/records-write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,E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Y,CAAC,EAAE,MAAM,CAAA;KACtB,GAAG,OAAO,CAAC,UAAU,CAAC;IA0BvB;;OAEG;WACiB,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAU7F;;;OAGG;WACW,mCAAmC,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,UAAU,EAAE,mBAAmB,GAAG,OAAO;IA2BtI;;OAEG;WACW,YAAY,CAAC,OAAO,EAAE,2BAA2B,GAAG,MAAM,EAAE;WAMtD,uBAAuB,CACzC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,CAAC;IAiB/B;;;OAGG;WACiB,wBAAwB,CAC1C,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAWpC;;;OAGG;WACiB,+BAA+B,CACjD,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;CAU5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../../../../../src/jose/jws/general/verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAyB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../../../../../src/jose/jws/general/verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAyB,MAAM,aAAa,CAAC;AAQtE,KAAK,kBAAkB,GAAG;IACxB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,qBAAa,kBAAkB;IAE7B,OAAO,CAAC,MAAM,CAAC,UAAU,CAAqB;IAE9C,KAAK,EAAE,KAAK,CAAC;IAEb,OAAO;IAIP,OAAO,CAAC,MAAM,KAAK,SAAS,GAM3B;IAED;;;OAGG;WACiB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI5G;;;OAGG;IACU,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAwCrG;;OAEG;mBACkB,YAAY;CA6BlC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JweKeyUnwrapPayload } from '../utils/encryption.js';
|
|
2
2
|
import type { KeyDerivationScheme } from '../utils/hd-key.js';
|
|
3
3
|
import type { PublicKeyJwk } from './jose-types.js';
|
|
4
4
|
/**
|
|
@@ -24,8 +24,8 @@ export interface EncryptionKeyDeriver {
|
|
|
24
24
|
derivePublicKey(fullDerivationPath: string[]): Promise<PublicKeyJwk>;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* A callback interface for decrypting
|
|
28
|
-
* The implementor performs HKDF key derivation and
|
|
27
|
+
* A callback interface for decrypting JWE-wrapped Content Encryption Keys (CEKs).
|
|
28
|
+
* The implementor performs HKDF key derivation, ECDH-ES key agreement, and AES Key Unwrap
|
|
29
29
|
* internally — the private key never leaves the implementation boundary.
|
|
30
30
|
*
|
|
31
31
|
* Analogous to `MessageSigner` for signing operations.
|
|
@@ -36,13 +36,14 @@ export interface KeyDecrypter {
|
|
|
36
36
|
/** The derivation scheme (e.g. KeyDerivationScheme.ProtocolPath) */
|
|
37
37
|
derivationScheme: KeyDerivationScheme;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
* leaf decryption key via HKDF through the given derivation path
|
|
39
|
+
* Unwraps a JWE-encrypted Content Encryption Key (CEK) after deriving the
|
|
40
|
+
* leaf decryption key via HKDF through the given derivation path, then
|
|
41
|
+
* performing ECDH-ES key agreement and AES-256 Key Unwrap.
|
|
41
42
|
*
|
|
42
43
|
* @param fullDerivationPath - The complete HKDF path to derive the leaf key
|
|
43
|
-
* @param
|
|
44
|
-
* @returns The
|
|
44
|
+
* @param jweKeyUnwrapPayload - The wrapped CEK and ephemeral public key from the JWE recipient
|
|
45
|
+
* @returns The unwrapped CEK bytes (typically 32 bytes for AES-256)
|
|
45
46
|
*/
|
|
46
|
-
decrypt(fullDerivationPath: string[],
|
|
47
|
+
decrypt(fullDerivationPath: string[], jweKeyUnwrapPayload: JweKeyUnwrapPayload): Promise<Uint8Array>;
|
|
47
48
|
}
|
|
48
49
|
//# sourceMappingURL=encryption-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-types.d.ts","sourceRoot":"","sources":["../../../../src/types/encryption-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"encryption-types.d.ts","sourceRoot":"","sources":["../../../../src/types/encryption-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,gBAAgB,EAAE,mBAAmB,CAAC;IACtC;;;;;;;OAOG;IACH,eAAe,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACtE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,gBAAgB,EAAE,mBAAmB,CAAC;IACtC;;;;;;;;OAQG;IACH,OAAO,CACL,kBAAkB,EAAE,MAAM,EAAE,EAC5B,mBAAmB,EAAE,mBAAmB,GACvC,OAAO,CAAC,UAAU,CAAC,CAAC;CACxB"}
|
|
@@ -42,7 +42,7 @@ export type ProtocolType = {
|
|
|
42
42
|
/**
|
|
43
43
|
* When `true`, records of this type **must** be encrypted at the DWN record
|
|
44
44
|
* level using the tenant's ProtocolPath-derived encryption key. The tenant
|
|
45
|
-
* DID must have
|
|
45
|
+
* DID must have an X25519 keyAgreement key; protocol installation will
|
|
46
46
|
* fail if it does not.
|
|
47
47
|
*
|
|
48
48
|
* When `false` or omitted, encryption is not required for this type.
|
|
@@ -94,9 +94,11 @@ export type ProtocolActionRule = {
|
|
|
94
94
|
/**
|
|
95
95
|
* May be 'anyone' | 'author' | 'recipient'.
|
|
96
96
|
* If `who` === 'anyone', then `of` must be omitted. Otherwise `of` must be present.
|
|
97
|
-
* Mutually exclusive with `role
|
|
97
|
+
* Mutually exclusive with `role`.
|
|
98
|
+
*
|
|
99
|
+
* Accepts both enum values (`ProtocolActor.Anyone`) and string literals (`'anyone'`).
|
|
98
100
|
*/
|
|
99
|
-
who?: string;
|
|
101
|
+
who?: ProtocolActor | `${ProtocolActor}` | (string & {});
|
|
100
102
|
/**
|
|
101
103
|
* The protocol path of a role record type marked with $role: true.
|
|
102
104
|
* Mutually exclusive with `who`
|
|
@@ -112,7 +114,7 @@ export type ProtocolActionRule = {
|
|
|
112
114
|
* See {ProtocolAction} for possible values.
|
|
113
115
|
* 'read' authorizes read, query, and subscribe access.
|
|
114
116
|
*/
|
|
115
|
-
can: string[];
|
|
117
|
+
can: (ProtocolAction | `${ProtocolAction}` | (string & {}))[];
|
|
116
118
|
};
|
|
117
119
|
/**
|
|
118
120
|
* Config for protocol-path encryption scheme.
|
|
@@ -127,6 +129,57 @@ export type ProtocolPathEncryption = {
|
|
|
127
129
|
*/
|
|
128
130
|
publicKeyJwk: PublicKeyJwk;
|
|
129
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* Size constraints for records at a given protocol path.
|
|
134
|
+
*/
|
|
135
|
+
export type ProtocolSizeDefinition = {
|
|
136
|
+
min?: number;
|
|
137
|
+
max?: number;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Tag rules for records at a given protocol path. Each non-`$`-prefixed property
|
|
141
|
+
* is a JSON Schema object constraining that tag's value.
|
|
142
|
+
*/
|
|
143
|
+
export type ProtocolTagsDefinition = {
|
|
144
|
+
/** Array of tag names that must be present on every record. */
|
|
145
|
+
$requiredTags?: string[];
|
|
146
|
+
/** When `false` (default), only tags explicitly listed are allowed. */
|
|
147
|
+
$allowUndefinedTags?: boolean;
|
|
148
|
+
/** JSON Schema definitions for individual tags. */
|
|
149
|
+
[tag: string]: ProtocolTagSchema | string[] | boolean | undefined;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* A JSON Schema object constraining a single tag value.
|
|
153
|
+
* Supports the subset of JSON Schema used by DWN tag validation.
|
|
154
|
+
*/
|
|
155
|
+
export type ProtocolTagSchema = {
|
|
156
|
+
type: 'string' | 'number' | 'integer' | 'boolean' | 'array';
|
|
157
|
+
items?: {
|
|
158
|
+
type: 'string' | 'number' | 'integer';
|
|
159
|
+
};
|
|
160
|
+
contains?: {
|
|
161
|
+
type: 'string' | 'number' | 'integer';
|
|
162
|
+
};
|
|
163
|
+
enum?: (string | number | boolean)[];
|
|
164
|
+
minimum?: number;
|
|
165
|
+
maximum?: number;
|
|
166
|
+
exclusiveMinimum?: number;
|
|
167
|
+
exclusiveMaximum?: number;
|
|
168
|
+
minLength?: number;
|
|
169
|
+
maxLength?: number;
|
|
170
|
+
minItems?: number;
|
|
171
|
+
maxItems?: number;
|
|
172
|
+
uniqueItems?: boolean;
|
|
173
|
+
minContains?: number;
|
|
174
|
+
maxContains?: number;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Union of all value types that can appear as properties of a `ProtocolRuleSet`.
|
|
178
|
+
* This includes:
|
|
179
|
+
* - `$`-prefixed directive values (`$encryption`, `$actions`, `$role`, `$ref`, `$size`, `$tags`)
|
|
180
|
+
* - Child `ProtocolRuleSet` entries (non-`$` keys)
|
|
181
|
+
*/
|
|
182
|
+
type ProtocolRuleSetValue = ProtocolRuleSet | ProtocolActionRule[] | ProtocolPathEncryption | ProtocolTagsDefinition | ProtocolSizeDefinition | boolean | string | undefined;
|
|
130
183
|
export type ProtocolRuleSet = {
|
|
131
184
|
/**
|
|
132
185
|
* Encryption setting for objects that are in this protocol path.
|
|
@@ -159,21 +212,16 @@ export type ProtocolRuleSet = {
|
|
|
159
212
|
/**
|
|
160
213
|
* If $size is set, the record size in bytes must be within the limits.
|
|
161
214
|
*/
|
|
162
|
-
$size?:
|
|
163
|
-
min?: number;
|
|
164
|
-
max?: number;
|
|
165
|
-
};
|
|
215
|
+
$size?: ProtocolSizeDefinition;
|
|
166
216
|
/**
|
|
167
217
|
* If $tags is set, the record must conform to the tag rules.
|
|
168
218
|
*/
|
|
169
|
-
$tags?:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
};
|
|
176
|
-
[key: string]: any;
|
|
219
|
+
$tags?: ProtocolTagsDefinition;
|
|
220
|
+
/**
|
|
221
|
+
* Non-`$`-prefixed keys are nested child `ProtocolRuleSet` entries.
|
|
222
|
+
* At runtime, JSON Schema validation ensures only valid child rule sets appear here.
|
|
223
|
+
*/
|
|
224
|
+
[key: string]: ProtocolRuleSetValue;
|
|
177
225
|
};
|
|
178
226
|
export type ProtocolsConfigureMessage = GenericMessage & {
|
|
179
227
|
authorization: AuthorizationModel;
|
|
@@ -195,4 +243,5 @@ export type ProtocolsQueryMessage = GenericMessage & {
|
|
|
195
243
|
export type ProtocolsQueryReply = GenericMessageReply & {
|
|
196
244
|
entries?: ProtocolsConfigureMessage[];
|
|
197
245
|
};
|
|
246
|
+
export {};
|
|
198
247
|
//# sourceMappingURL=protocols-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocols-types.d.ts","sourceRoot":"","sources":["../../../../src/types/protocols-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAExF,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAG,gBAAgB,CAAC,SAAS,CAAC;IACvC,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;KAChC,CAAA;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;I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AAyB,EAAE,CAAC;CACvC,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { EncryptionAlgorithm } from '../utils/encryption.js';
|
|
2
1
|
import type { GeneralJws } from './jws-types.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type { PublicKeyJwk } from './jose-types.js';
|
|
2
|
+
import type { JweEncryption } from '../utils/encryption.js';
|
|
5
3
|
import type { AuthorizationModel, GenericMessage, GenericMessageReply, GenericSignaturePayload, MessageSubscription, Pagination } from './message-types.js';
|
|
6
4
|
import type { DwnInterfaceName, DwnMethodName } from '../enums/dwn-interface-method.js';
|
|
7
5
|
import type { PaginationCursor, RangeCriterion, RangeFilter, StartsWithFilter } from './query-types.js';
|
|
@@ -47,7 +45,7 @@ export type InternalRecordsWriteMessage = GenericMessage & {
|
|
|
47
45
|
contextId?: string;
|
|
48
46
|
descriptor: RecordsWriteDescriptor;
|
|
49
47
|
attestation?: GeneralJws;
|
|
50
|
-
encryption?:
|
|
48
|
+
encryption?: JweEncryption;
|
|
51
49
|
};
|
|
52
50
|
export type RecordsWriteMessage = {
|
|
53
51
|
authorization: AuthorizationModel;
|
|
@@ -55,28 +53,7 @@ export type RecordsWriteMessage = {
|
|
|
55
53
|
contextId?: string;
|
|
56
54
|
descriptor: RecordsWriteDescriptor;
|
|
57
55
|
attestation?: GeneralJws;
|
|
58
|
-
encryption?:
|
|
59
|
-
};
|
|
60
|
-
export type EncryptionProperty = {
|
|
61
|
-
algorithm: EncryptionAlgorithm;
|
|
62
|
-
initializationVector: string;
|
|
63
|
-
keyEncryption: EncryptedKey[];
|
|
64
|
-
};
|
|
65
|
-
export type EncryptedKey = {
|
|
66
|
-
/**
|
|
67
|
-
* The fully qualified key ID (e.g. did:example:abc#encryption-key-id) of the root public key used to encrypt the symmetric encryption key.
|
|
68
|
-
*/
|
|
69
|
-
rootKeyId: string;
|
|
70
|
-
/**
|
|
71
|
-
* The actual derived public key.
|
|
72
|
-
*/
|
|
73
|
-
derivedPublicKey?: PublicKeyJwk;
|
|
74
|
-
derivationScheme: KeyDerivationScheme;
|
|
75
|
-
algorithm: EncryptionAlgorithm;
|
|
76
|
-
initializationVector: string;
|
|
77
|
-
ephemeralPublicKey: PublicKeyJwk;
|
|
78
|
-
messageAuthenticationCode: string;
|
|
79
|
-
encryptedKey: string;
|
|
56
|
+
encryption?: JweEncryption;
|
|
80
57
|
};
|
|
81
58
|
/**
|
|
82
59
|
* Data structure returned in a `RecordsQuery` reply entry.
|
|
@@ -128,6 +105,8 @@ export type RecordsSubscribeDescriptor = {
|
|
|
128
105
|
method: DwnMethodName.Subscribe;
|
|
129
106
|
messageTimestamp: string;
|
|
130
107
|
filter: RecordsFilter;
|
|
108
|
+
dateSort?: DateSort;
|
|
109
|
+
pagination?: Pagination;
|
|
131
110
|
};
|
|
132
111
|
export type RecordsFilter = {
|
|
133
112
|
/**
|
|
@@ -185,6 +164,8 @@ export type RecordsSubscribeMessage = GenericMessage & {
|
|
|
185
164
|
};
|
|
186
165
|
export type RecordsSubscribeReply = GenericMessageReply & {
|
|
187
166
|
subscription?: MessageSubscription;
|
|
167
|
+
entries?: RecordsQueryReplyEntry[];
|
|
168
|
+
cursor?: PaginationCursor;
|
|
188
169
|
};
|
|
189
170
|
export type RecordsReadMessage = {
|
|
190
171
|
authorization?: AuthorizationModel;
|