@interop/wallet-core 0.101.1 → 0.103.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/README.md +33 -17
- package/dist/audiences/audienceGrant.d.ts +49 -0
- package/dist/audiences/audienceGrant.d.ts.map +1 -0
- package/dist/audiences/audienceGrant.js +46 -0
- package/dist/audiences/audienceGrant.js.map +1 -0
- package/dist/audiences/index.d.ts +10 -0
- package/dist/audiences/index.d.ts.map +1 -0
- package/dist/audiences/index.js +10 -0
- package/dist/audiences/index.js.map +1 -0
- package/dist/clientAnnex/grantRevocation.d.ts +0 -10
- package/dist/clientAnnex/grantRevocation.d.ts.map +1 -1
- package/dist/clientAnnex/grantRevocation.js +1 -23
- package/dist/clientAnnex/grantRevocation.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +1 -1
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +1 -1
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +2 -1
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +5 -2
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +3 -1
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/connections/didKey.d.ts +27 -0
- package/dist/connections/didKey.d.ts.map +1 -1
- package/dist/connections/didKey.js +42 -6
- package/dist/connections/didKey.js.map +1 -1
- package/dist/connections/entry.d.ts +95 -13
- package/dist/connections/entry.d.ts.map +1 -1
- package/dist/connections/entry.js +102 -16
- package/dist/connections/entry.js.map +1 -1
- package/dist/connections/grants.d.ts +225 -3
- package/dist/connections/grants.d.ts.map +1 -1
- package/dist/connections/grants.js +293 -8
- package/dist/connections/grants.js.map +1 -1
- package/dist/connections/index.d.ts +15 -8
- package/dist/connections/index.d.ts.map +1 -1
- package/dist/connections/index.js +13 -6
- package/dist/connections/index.js.map +1 -1
- package/dist/connections/read.d.ts.map +1 -1
- package/dist/connections/read.js +2 -1
- package/dist/connections/read.js.map +1 -1
- package/dist/connections/resourceId.d.ts +33 -0
- package/dist/connections/resourceId.d.ts.map +1 -1
- package/dist/connections/resourceId.js +88 -8
- package/dist/connections/resourceId.js.map +1 -1
- package/dist/connections/upsert.d.ts +219 -7
- package/dist/connections/upsert.d.ts.map +1 -1
- package/dist/connections/upsert.js +628 -41
- package/dist/connections/upsert.js.map +1 -1
- package/dist/connections/writers.js +2 -1
- package/dist/connections/writers.js.map +1 -1
- package/dist/descriptors/index.d.ts +5 -0
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +5 -0
- package/dist/descriptors/index.js.map +1 -1
- package/dist/descriptors/logSource.d.ts +9 -4
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +13 -6
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/jsonObject.d.ts +16 -0
- package/dist/jsonObject.d.ts.map +1 -0
- package/dist/jsonObject.js +18 -0
- package/dist/jsonObject.js.map +1 -0
- package/dist/keys/index.d.ts +13 -9
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +11 -7
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +46 -0
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +153 -65
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +60 -7
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +165 -47
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +1 -0
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/menders/ids.d.ts +1 -1
- package/dist/menders/ids.d.ts.map +1 -1
- package/dist/menders/ids.js +20 -4
- package/dist/menders/ids.js.map +1 -1
- package/dist/space/collections.d.ts +23 -3
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +26 -2
- package/dist/space/collections.js.map +1 -1
- package/dist/space/inboxMessage.d.ts +47 -0
- package/dist/space/inboxMessage.d.ts.map +1 -0
- package/dist/space/inboxMessage.js +86 -0
- package/dist/space/inboxMessage.js.map +1 -0
- package/dist/space/index.d.ts +6 -1
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +5 -1
- package/dist/space/index.js.map +1 -1
- package/dist/sync/contactsConflict.d.ts +23 -10
- package/dist/sync/contactsConflict.d.ts.map +1 -1
- package/dist/sync/contactsConflict.js +40 -21
- package/dist/sync/contactsConflict.js.map +1 -1
- package/dist/webvh/didWebProjection.d.ts +38 -5
- package/dist/webvh/didWebProjection.d.ts.map +1 -1
- package/dist/webvh/didWebProjection.js +35 -22
- package/dist/webvh/didWebProjection.js.map +1 -1
- package/dist/webvh/index.d.ts +4 -3
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +4 -3
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +19 -2
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +31 -3
- package/dist/webvh/standingZcap.js.map +1 -1
- package/package.json +11 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAC7E,OAAO,
|
|
1
|
+
{"version":3,"file":"r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AAO,EACP,UAAU,EACV,IAAI,EACJ,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EACjB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,KAAK,EAAE,yBAAyB,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;IACxC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAC,CAgHD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isSealableDescriptorStore, readUserKeyRoster } from '../keys/index.js';
|
|
2
|
+
import { convergeUserKeyRosterToDocument } from '../keys/userKeyRoster.js';
|
|
2
3
|
import { log } from '../log.js';
|
|
3
4
|
import { isResourceLogRefusal } from '../resourceLog/errors.js';
|
|
4
5
|
import { verifyAccountLog } from '../webvh/index.js';
|
|
@@ -172,6 +173,7 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
|
|
|
172
173
|
const result = await convergeUserKeyRosterToDocument({
|
|
173
174
|
store,
|
|
174
175
|
document: doc,
|
|
176
|
+
did: pointer.did,
|
|
175
177
|
descriptor,
|
|
176
178
|
...(etag !== undefined ? { etag } : {}),
|
|
177
179
|
// The escrow direction needs a key that unwraps every epoch, and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AA4DA,OAAO,EACL
|
|
1
|
+
{"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AA4DA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,IAAI,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,IAAI,GAAI,GAAiC,EAAE,IAAI,CAAA;IACrD,OAAO,CACL,IAAI,KAAK,8BAA8B;QACvC,IAAI,KAAK,6BAA6B;QACtC,IAAI,KAAK,0BAA0B,CACpC,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,EAC9C,KAAK,EACL,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,YAAY,EAOb;IACC,IAAI,IAAoC,CAAA;IACxC,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,iBAAiB,CAAC;YAC7B,KAAK;YACL,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/B,qBAAqB;YACrB,aAAa;SACd,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,C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AAC,wCAAwC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;QAC7D,CAAC;IACH,CAAC;IAED,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,GAAG,CAAC,IAAI,CACN,sEAAsE;YACpE,qCAAqC,EACvC,EAAE,sBAAsB,EAAE,oBAAoB,CAAC,MAAM,EAAE,CACxD,CAAA;IACH,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAA;IACvD,CAAC;IACD,GAAG,CAAC,IAAI,CACN,oEAAoE;QAClE,sEAAsE,EACxE,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAClD,CAAA;IAED,uEAAuE;IACvE,0EAA0E;IAC1E,2EAA2E;IAC3E,yEAAyE;IACzE,yEAAyE;IACzE,wEAAwE;IACxE,0EAA0E;IAC1E,eAAe;IACf,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC;QACnC,KAAK;QACL,UAAU,EAAE,SAAU;QACtB,OAAO;QACP,qBAAqB;QACrB,aAAa;KACd,CAAC,CAAA;IACF,MAAM,gBAAgB,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM;QACN,iBAAiB;QACjB,oBAAoB;QACpB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { CapabilityAgent } from '@interop/capability-agent';
|
|
2
|
+
import type { ZcapClient } from '@interop/ezcap';
|
|
3
|
+
import type { ConnectionIdKey } from './resourceId.js';
|
|
1
4
|
/**
|
|
2
5
|
* The signing-key multibase an Ed25519 did:key carries, or `undefined` for any
|
|
3
6
|
* other DID. The one join key between a wallet client's directory entry and
|
|
@@ -22,4 +25,28 @@ export declare function signingKeyMultibaseOfDid({ did }: {
|
|
|
22
25
|
export declare function connectionRecipientKid({ did }: {
|
|
23
26
|
did: string;
|
|
24
27
|
}): string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The wallet's pairwise did:key toward a party, and the signer behind it:
|
|
30
|
+
* was-client's `agentsFromSeed` over the entry's stored `seed`, after the
|
|
31
|
+
* seed's tag verifies under the directory's blinded-index key. A seed whose
|
|
32
|
+
* tag fails is refused with an `Error`, and the caller fails closed: a host
|
|
33
|
+
* that planted a seed is misbehaving, so the seed is not read as absent.
|
|
34
|
+
*
|
|
35
|
+
* @param options {object}
|
|
36
|
+
* @param options.hmacKey {ConnectionIdKey} the collection's blinded-index
|
|
37
|
+
* key
|
|
38
|
+
* @param options.seed {string} the entry's `seed`
|
|
39
|
+
* @param options.seedTag {string} the entry's `seedTag`
|
|
40
|
+
* @returns {Promise<object>} the did:key, the `ZcapClient` that signs as
|
|
41
|
+
* it, and the `CapabilityAgent` behind both
|
|
42
|
+
*/
|
|
43
|
+
export declare function connectionDidKey({ hmacKey, seed, seedTag }: {
|
|
44
|
+
hmacKey: ConnectionIdKey;
|
|
45
|
+
seed: string;
|
|
46
|
+
seedTag: string;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
did: string;
|
|
49
|
+
zcapClient: ZcapClient;
|
|
50
|
+
keyAgent: CapabilityAgent;
|
|
51
|
+
}>;
|
|
25
52
|
//# sourceMappingURL=didKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didKey.d.ts","sourceRoot":"","sources":["../../src/connections/didKey.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"didKey.d.ts","sourceRoot":"","sources":["../../src/connections/didKey.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAIhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAItD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,MAAM,GAAG,SAAS,CAErB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,MAAM,GAAG,SAAS,CAUrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,OAAO,EACP,IAAI,EACJ,OAAO,EACR,EAAE;IACD,OAAO,EAAE,eAAe,CAAA;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,OAAO,CAAC;IACV,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,eAAe,CAAA;CAC1B,CAAC,CAeD"}
|
|
@@ -2,17 +2,24 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
5
|
+
* The values a directory reader derives from a did:key rather than stores:
|
|
6
6
|
* the signing-key multibase a wallet client's entry joins the account
|
|
7
|
-
* document on,
|
|
7
|
+
* document on, the key-epoch recipient kid a grantee is admitted under, and
|
|
8
|
+
* the wallet's own pairwise did:key toward a party, derived from the seed on
|
|
9
|
+
* the party's entry.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* A wallet client's entry `id` is its did:key, whose method-specific part is
|
|
12
|
+
* the `publicKeyMultibase` the account document's verification method
|
|
13
|
+
* carries. A grantee's recipient key is the X25519 twin was-client derives
|
|
14
|
+
* from the same DID. The pairwise key comes from was-client's
|
|
15
|
+
* `agentsFromSeed` under its pinned bootstrap names, so every client of the
|
|
16
|
+
* account derives the same did:key from the same stored seed.
|
|
13
17
|
*/
|
|
14
18
|
import { isEd25519DidKey, x25519RecipientFromDidKey } from '@interop/was-client/edv/cipher';
|
|
19
|
+
import { agentsFromSeed } from '@interop/was-client/identity';
|
|
15
20
|
import { rosterRecipientKid } from '../keys/rosterRecipientKid.js';
|
|
21
|
+
import { decodeConnectionSeed } from './entry.js';
|
|
22
|
+
import { verifyConnectionSeedTag } from './resourceId.js';
|
|
16
23
|
const DID_KEY_PREFIX = 'did:key:';
|
|
17
24
|
/**
|
|
18
25
|
* The signing-key multibase an Ed25519 did:key carries, or `undefined` for any
|
|
@@ -46,4 +53,33 @@ export function connectionRecipientKid({ did }) {
|
|
|
46
53
|
keyAgreementKeyMultibase: publicKeyMultibase
|
|
47
54
|
});
|
|
48
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* The wallet's pairwise did:key toward a party, and the signer behind it:
|
|
58
|
+
* was-client's `agentsFromSeed` over the entry's stored `seed`, after the
|
|
59
|
+
* seed's tag verifies under the directory's blinded-index key. A seed whose
|
|
60
|
+
* tag fails is refused with an `Error`, and the caller fails closed: a host
|
|
61
|
+
* that planted a seed is misbehaving, so the seed is not read as absent.
|
|
62
|
+
*
|
|
63
|
+
* @param options {object}
|
|
64
|
+
* @param options.hmacKey {ConnectionIdKey} the collection's blinded-index
|
|
65
|
+
* key
|
|
66
|
+
* @param options.seed {string} the entry's `seed`
|
|
67
|
+
* @param options.seedTag {string} the entry's `seedTag`
|
|
68
|
+
* @returns {Promise<object>} the did:key, the `ZcapClient` that signs as
|
|
69
|
+
* it, and the `CapabilityAgent` behind both
|
|
70
|
+
*/
|
|
71
|
+
export async function connectionDidKey({ hmacKey, seed, seedTag }) {
|
|
72
|
+
if (!(await verifyConnectionSeedTag({ hmacKey, seed, seedTag }))) {
|
|
73
|
+
throw new Error("The connections entry's seed tag does not verify under this " +
|
|
74
|
+
"directory's key; the seed is refused.");
|
|
75
|
+
}
|
|
76
|
+
const seedBytes = decodeConnectionSeed(seed);
|
|
77
|
+
if (seedBytes === undefined) {
|
|
78
|
+
throw new TypeError('A connection seed decodes to 32 bytes.');
|
|
79
|
+
}
|
|
80
|
+
const { controllerDid, zcapClient, keyAgent } = await agentsFromSeed({
|
|
81
|
+
seed: seedBytes
|
|
82
|
+
});
|
|
83
|
+
return { did: controllerDid, zcapClient, keyAgent };
|
|
84
|
+
}
|
|
49
85
|
//# sourceMappingURL=didKey.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didKey.js","sourceRoot":"","sources":["../../src/connections/didKey.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"didKey.js","sourceRoot":"","sources":["../../src/connections/didKey.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,eAAe,EACf,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAG7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAGzD,MAAM,cAAc,GAAG,UAAU,CAAA;AAEjC;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,GAAG,EAGJ;IACC,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC5E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,EACrC,GAAG,EAGJ;IACC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IAC7D,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,EAAE,kBAAkB,EAAE,GAAG,yBAAyB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IACjE,OAAO,kBAAkB,CAAC;QACxB,mBAAmB;QACnB,wBAAwB,EAAE,kBAAkB;KAC7C,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,OAAO,EACP,IAAI,EACJ,OAAO,EAKR;IAKC,IAAI,CAAC,CAAC,MAAM,uBAAuB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CACb,8DAA8D;YAC5D,uCAAuC,CAC1C,CAAA;IACH,CAAC;IACD,MAAM,SAAS,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAC5C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAA;IAC/D,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,cAAc,CAAC;QACnE,IAAI,EAAE,SAAS;KAChB,CAAC,CAAA;IACF,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAA;AACrD,CAAC"}
|
|
@@ -21,18 +21,35 @@ export declare const GRANT_KINDS: readonly ["grant", "share"];
|
|
|
21
21
|
* One value of {@link GRANT_KINDS}.
|
|
22
22
|
*/
|
|
23
23
|
export type GrantKind = (typeof GRANT_KINDS)[number];
|
|
24
|
+
/**
|
|
25
|
+
* The `grantKind` vocabulary of `grantsReceived`, the capabilities a party
|
|
26
|
+
* handed the wallet: `'inbox'` is the party's POST capability on its own
|
|
27
|
+
* inbox, the channel a push goes through. An unknown stored value is kept as
|
|
28
|
+
* stored.
|
|
29
|
+
*/
|
|
30
|
+
export declare const RECEIVED_GRANT_KINDS: readonly ["inbox"];
|
|
31
|
+
/**
|
|
32
|
+
* One value of {@link RECEIVED_GRANT_KINDS}.
|
|
33
|
+
*/
|
|
34
|
+
export type ReceivedGrantKind = (typeof RECEIVED_GRANT_KINDS)[number];
|
|
35
|
+
/**
|
|
36
|
+
* The byte length of the pairwise seed, and the length of its base64url
|
|
37
|
+
* no-pad text.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CONNECTION_SEED_BYTES = 32;
|
|
24
40
|
/**
|
|
25
41
|
* The delegated capability a grant wrapper stores verbatim. Only the members
|
|
26
42
|
* the directory's readers take are typed. The rest of the document (its
|
|
27
43
|
* proof and chain) rides along untouched, since revocation POSTs it as it
|
|
28
|
-
* stands.
|
|
44
|
+
* stands. `expires` is required: a capability with no expiry is not a grant
|
|
45
|
+
* the directory records.
|
|
29
46
|
*/
|
|
30
47
|
export type ConnectionZcap = {
|
|
31
48
|
id: string;
|
|
32
49
|
controller: string;
|
|
33
50
|
invocationTarget: string;
|
|
34
51
|
allowedAction?: string | string[];
|
|
35
|
-
expires
|
|
52
|
+
expires: string;
|
|
36
53
|
[member: string]: unknown;
|
|
37
54
|
};
|
|
38
55
|
/**
|
|
@@ -44,9 +61,42 @@ export type ConnectionGrantRecord = {
|
|
|
44
61
|
zcap: ConnectionZcap;
|
|
45
62
|
grantKind: string;
|
|
46
63
|
/**
|
|
47
|
-
* ISO 8601 UTC time of the consent that wrote the grant.
|
|
64
|
+
* ISO 8601 UTC time of the consent that wrote the grant. A renewed record
|
|
65
|
+
* keeps the consent's time.
|
|
48
66
|
*/
|
|
49
67
|
grantedAt: string;
|
|
68
|
+
/**
|
|
69
|
+
* ISO 8601 UTC time of the renewal that minted this record, present on a
|
|
70
|
+
* record `recordRenewedGrants` wrote.
|
|
71
|
+
*/
|
|
72
|
+
renewedAt?: string;
|
|
73
|
+
[member: string]: unknown;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* One member of an entry's `grantsReceived`: a capability the party handed
|
|
77
|
+
* the wallet, verbatim, the kind of grant it is, and when it was stored.
|
|
78
|
+
* `grantKind` is kept as stored.
|
|
79
|
+
*/
|
|
80
|
+
export type ConnectionReceivedGrantRecord = {
|
|
81
|
+
zcap: ConnectionZcap;
|
|
82
|
+
grantKind: string;
|
|
83
|
+
/**
|
|
84
|
+
* ISO 8601 UTC time the record was stored.
|
|
85
|
+
*/
|
|
86
|
+
receivedAt: string;
|
|
87
|
+
[member: string]: unknown;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* One member of an entry's `outbox`: a pending envelope to the party,
|
|
91
|
+
* verbatim, and the time it was queued. The item names no channel; a push
|
|
92
|
+
* resolves the channel from `grantsReceived` at push time.
|
|
93
|
+
*/
|
|
94
|
+
export type ConnectionOutboxItem = {
|
|
95
|
+
message: Record<string, unknown>;
|
|
96
|
+
/**
|
|
97
|
+
* ISO 8601 UTC time the item was queued.
|
|
98
|
+
*/
|
|
99
|
+
createdAt: string;
|
|
50
100
|
[member: string]: unknown;
|
|
51
101
|
};
|
|
52
102
|
/**
|
|
@@ -110,7 +160,33 @@ export type ConnectionEntry = {
|
|
|
110
160
|
* ISO 8601 UTC time the relationship ended. Present once retired.
|
|
111
161
|
*/
|
|
112
162
|
retired?: string;
|
|
163
|
+
/**
|
|
164
|
+
* ISO 8601 UTC time the owner declined this party's offer. Present while
|
|
165
|
+
* the decline stands; a fresh consent clears it.
|
|
166
|
+
*/
|
|
167
|
+
declined?: string;
|
|
168
|
+
/**
|
|
169
|
+
* The wallet's pairwise seed toward this party: 32 random bytes, base64url
|
|
170
|
+
* with no padding. Written once, and always beside `seedTag`.
|
|
171
|
+
*/
|
|
172
|
+
seed?: string;
|
|
173
|
+
/**
|
|
174
|
+
* The tag over `seed` under the directory's blinded-index key
|
|
175
|
+
* (`connectionSeedTag`), base64url with no padding. A site that turns the
|
|
176
|
+
* seed into a key verifies it first.
|
|
177
|
+
*/
|
|
178
|
+
seedTag?: string;
|
|
113
179
|
grants: ConnectionGrantRecord[];
|
|
180
|
+
/**
|
|
181
|
+
* The capabilities the party handed the wallet. Absent on a body an older
|
|
182
|
+
* build wrote, which reads as empty.
|
|
183
|
+
*/
|
|
184
|
+
grantsReceived: ConnectionReceivedGrantRecord[];
|
|
185
|
+
/**
|
|
186
|
+
* The pending envelopes to the party. Absent on a body an older build
|
|
187
|
+
* wrote, which reads as empty.
|
|
188
|
+
*/
|
|
189
|
+
outbox: ConnectionOutboxItem[];
|
|
114
190
|
writers: ConnectionWriter[];
|
|
115
191
|
};
|
|
116
192
|
/**
|
|
@@ -188,20 +264,23 @@ export declare function newConnectionEntry({ kind, did, now }: {
|
|
|
188
264
|
*/
|
|
189
265
|
export declare function isWritableConnectionEntry(entry: ConnectionEntry): boolean;
|
|
190
266
|
/**
|
|
191
|
-
*
|
|
267
|
+
* Reads a stored capability's known members, or `undefined` when one of them
|
|
268
|
+
* has the wrong shape or `expires` is absent. The capability itself is
|
|
269
|
+
* returned verbatim.
|
|
192
270
|
*
|
|
193
271
|
* @param value {unknown}
|
|
194
|
-
* @returns {
|
|
272
|
+
* @returns {ConnectionZcap | undefined}
|
|
195
273
|
*/
|
|
196
|
-
export declare function
|
|
274
|
+
export declare function parseConnectionZcap(value: unknown): ConnectionZcap | undefined;
|
|
197
275
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
276
|
+
* The seed bytes a stored `seed` member decodes to, or `undefined` when it
|
|
277
|
+
* is not 43 characters of base64url with no padding decoding to 32 bytes.
|
|
278
|
+
* The same rule reads a stored `seedTag`, which has the same length.
|
|
200
279
|
*
|
|
201
280
|
* @param value {unknown}
|
|
202
|
-
* @returns {
|
|
281
|
+
* @returns {Uint8Array | undefined}
|
|
203
282
|
*/
|
|
204
|
-
export declare function
|
|
283
|
+
export declare function decodeConnectionSeed(value: unknown): Uint8Array | undefined;
|
|
205
284
|
/**
|
|
206
285
|
* Reads a stored body as a directory entry, or `undefined` when it is not
|
|
207
286
|
* one. A body fails when any member this build knows has the wrong shape:
|
|
@@ -209,9 +288,12 @@ export declare function parseConnectionZcap(value: unknown): ConnectionZcap | un
|
|
|
209
288
|
* is not a DID, a `name`, `label`, or writer `label` outside the display-name
|
|
210
289
|
* rule (1 to 64 code points once the control and bidi characters are stripped
|
|
211
290
|
* and the result trimmed), a timestamp `Date.parse` cannot read, a malformed
|
|
212
|
-
* grant wrapper
|
|
213
|
-
*
|
|
214
|
-
*
|
|
291
|
+
* grant wrapper, received-grant wrapper, outbox item, or writer member, a
|
|
292
|
+
* `seed` or `seedTag` that is not 43 characters of base64url decoding to 32
|
|
293
|
+
* bytes, a `seed` with no `seedTag` (or the reverse), or no `id` beside
|
|
294
|
+
* anything but exactly one writer. Every display string a view renders is
|
|
295
|
+
* held to that one rule. An absent `grantsReceived` or `outbox` (a body an
|
|
296
|
+
* older build wrote) reads as empty. Unknown members are ignored. A body with a `version` above this build's
|
|
215
297
|
* that passes every check is returned for display;
|
|
216
298
|
* {@link isWritableConnectionEntry} says it cannot be written.
|
|
217
299
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/connections/entry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/connections/entry.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAA;AAEzC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,uDAKnB,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9D;;;;GAIG;AACH,eAAO,MAAM,WAAW,6BAA8B,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,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AAe,EAAE,MAAM,CAAA;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,sBAItC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GACvC,sBAAsB,CAExB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,eAAe,GACrB,cAAc,GAAG,SAAS,CAI5B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAEnE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,GAAG,EACH,GAAG,EACJ,EAAE;IACD,IAAI,EAAE,cAAc,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,IAAI,CAAA;CACV,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAa1B;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAEzE;AAsBD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,GACb,cAAc,GAAG,SAAS,CAqB5B;AAkED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAc3E;AA6BD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,OAAO,GACZ,eAAe,GAAG,SAAS,CA+F7B"}
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
* its writer, so the storage host can plant one. The grant checks in
|
|
20
20
|
* `grants.ts` bound what a planted grant can steer.
|
|
21
21
|
*/
|
|
22
|
+
import { base64urlnopad } from '@scure/base';
|
|
23
|
+
import { isJsonObject } from '../jsonObject.js';
|
|
22
24
|
import { normalizeDisplayName } from '../labelText.js';
|
|
23
25
|
/**
|
|
24
26
|
* The entry version this build reads for writing and writes.
|
|
@@ -40,6 +42,19 @@ export const CONNECTION_KINDS = [
|
|
|
40
42
|
* capability. A reader treats any other stored value as a plain grant.
|
|
41
43
|
*/
|
|
42
44
|
export const GRANT_KINDS = ['grant', 'share'];
|
|
45
|
+
/**
|
|
46
|
+
* The `grantKind` vocabulary of `grantsReceived`, the capabilities a party
|
|
47
|
+
* handed the wallet: `'inbox'` is the party's POST capability on its own
|
|
48
|
+
* inbox, the channel a push goes through. An unknown stored value is kept as
|
|
49
|
+
* stored.
|
|
50
|
+
*/
|
|
51
|
+
export const RECEIVED_GRANT_KINDS = ['inbox'];
|
|
52
|
+
/**
|
|
53
|
+
* The byte length of the pairwise seed, and the length of its base64url
|
|
54
|
+
* no-pad text.
|
|
55
|
+
*/
|
|
56
|
+
export const CONNECTION_SEED_BYTES = 32;
|
|
57
|
+
const CONNECTION_SEED_TEXT_LENGTH = 43;
|
|
43
58
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
44
59
|
/**
|
|
45
60
|
* The writer policy: inactive after 90 days, at most 8 writers per entry,
|
|
@@ -103,6 +118,8 @@ export function newConnectionEntry({ kind, did, now }) {
|
|
|
103
118
|
firstSeen: stamp,
|
|
104
119
|
lastSeen: stamp,
|
|
105
120
|
grants: [],
|
|
121
|
+
grantsReceived: [],
|
|
122
|
+
outbox: [],
|
|
106
123
|
writers: []
|
|
107
124
|
};
|
|
108
125
|
}
|
|
@@ -116,15 +133,6 @@ export function newConnectionEntry({ kind, did, now }) {
|
|
|
116
133
|
export function isWritableConnectionEntry(entry) {
|
|
117
134
|
return entry.version === CONNECTION_ENTRY_VERSION;
|
|
118
135
|
}
|
|
119
|
-
/**
|
|
120
|
-
* Whether a value is a plain JSON object (not null, not an array).
|
|
121
|
-
*
|
|
122
|
-
* @param value {unknown}
|
|
123
|
-
* @returns {boolean}
|
|
124
|
-
*/
|
|
125
|
-
export function isJsonObject(value) {
|
|
126
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
127
|
-
}
|
|
128
136
|
/**
|
|
129
137
|
* Whether a value is a string `Date.parse` reads as a time.
|
|
130
138
|
*
|
|
@@ -145,7 +153,8 @@ function isOptionalString(value) {
|
|
|
145
153
|
}
|
|
146
154
|
/**
|
|
147
155
|
* Reads a stored capability's known members, or `undefined` when one of them
|
|
148
|
-
* has the wrong shape. The capability itself is
|
|
156
|
+
* has the wrong shape or `expires` is absent. The capability itself is
|
|
157
|
+
* returned verbatim.
|
|
149
158
|
*
|
|
150
159
|
* @param value {unknown}
|
|
151
160
|
* @returns {ConnectionZcap | undefined}
|
|
@@ -163,7 +172,7 @@ export function parseConnectionZcap(value) {
|
|
|
163
172
|
typeof allowedAction !== 'string' &&
|
|
164
173
|
!(Array.isArray(allowedAction) &&
|
|
165
174
|
allowedAction.every(action => typeof action === 'string'))) ||
|
|
166
|
-
|
|
175
|
+
!isTimestamp(expires)) {
|
|
167
176
|
return undefined;
|
|
168
177
|
}
|
|
169
178
|
return value;
|
|
@@ -181,11 +190,70 @@ function parseGrantRecord(value) {
|
|
|
181
190
|
}
|
|
182
191
|
if (parseConnectionZcap(value.zcap) === undefined ||
|
|
183
192
|
typeof value.grantKind !== 'string' ||
|
|
184
|
-
!isTimestamp(value.grantedAt)
|
|
193
|
+
!isTimestamp(value.grantedAt) ||
|
|
194
|
+
(value.renewedAt !== undefined && !isTimestamp(value.renewedAt))) {
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
return value;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Reads one stored received-grant wrapper, or `undefined` when a known
|
|
201
|
+
* member has the wrong shape. The wrapper is returned verbatim, unknown
|
|
202
|
+
* members included.
|
|
203
|
+
*
|
|
204
|
+
* @param value {unknown}
|
|
205
|
+
* @returns {ConnectionReceivedGrantRecord | undefined}
|
|
206
|
+
*/
|
|
207
|
+
function parseReceivedGrantRecord(value) {
|
|
208
|
+
if (!isJsonObject(value)) {
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
if (parseConnectionZcap(value.zcap) === undefined ||
|
|
212
|
+
typeof value.grantKind !== 'string' ||
|
|
213
|
+
!isTimestamp(value.receivedAt)) {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
return value;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Reads one stored outbox item, or `undefined` when a known member has the
|
|
220
|
+
* wrong shape: `message` must be a JSON object and `createdAt` a timestamp.
|
|
221
|
+
* The item is returned verbatim.
|
|
222
|
+
*
|
|
223
|
+
* @param value {unknown}
|
|
224
|
+
* @returns {ConnectionOutboxItem | undefined}
|
|
225
|
+
*/
|
|
226
|
+
function parseOutboxItem(value) {
|
|
227
|
+
if (!isJsonObject(value)) {
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
if (!isJsonObject(value.message) || !isTimestamp(value.createdAt)) {
|
|
185
231
|
return undefined;
|
|
186
232
|
}
|
|
187
233
|
return value;
|
|
188
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* The seed bytes a stored `seed` member decodes to, or `undefined` when it
|
|
237
|
+
* is not 43 characters of base64url with no padding decoding to 32 bytes.
|
|
238
|
+
* The same rule reads a stored `seedTag`, which has the same length.
|
|
239
|
+
*
|
|
240
|
+
* @param value {unknown}
|
|
241
|
+
* @returns {Uint8Array | undefined}
|
|
242
|
+
*/
|
|
243
|
+
export function decodeConnectionSeed(value) {
|
|
244
|
+
if (typeof value !== 'string' ||
|
|
245
|
+
value.length !== CONNECTION_SEED_TEXT_LENGTH) {
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
let bytes;
|
|
249
|
+
try {
|
|
250
|
+
bytes = base64urlnopad.decode(value);
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
return undefined;
|
|
254
|
+
}
|
|
255
|
+
return bytes.length === CONNECTION_SEED_BYTES ? bytes : undefined;
|
|
256
|
+
}
|
|
189
257
|
/**
|
|
190
258
|
* Reads one stored writer member, or `undefined` when a known member has the
|
|
191
259
|
* wrong shape. The member is returned verbatim, unknown members included.
|
|
@@ -217,9 +285,12 @@ function parseWriter(value) {
|
|
|
217
285
|
* is not a DID, a `name`, `label`, or writer `label` outside the display-name
|
|
218
286
|
* rule (1 to 64 code points once the control and bidi characters are stripped
|
|
219
287
|
* and the result trimmed), a timestamp `Date.parse` cannot read, a malformed
|
|
220
|
-
* grant wrapper
|
|
221
|
-
*
|
|
222
|
-
*
|
|
288
|
+
* grant wrapper, received-grant wrapper, outbox item, or writer member, a
|
|
289
|
+
* `seed` or `seedTag` that is not 43 characters of base64url decoding to 32
|
|
290
|
+
* bytes, a `seed` with no `seedTag` (or the reverse), or no `id` beside
|
|
291
|
+
* anything but exactly one writer. Every display string a view renders is
|
|
292
|
+
* held to that one rule. An absent `grantsReceived` or `outbox` (a body an
|
|
293
|
+
* older build wrote) reads as empty. Unknown members are ignored. A body with a `version` above this build's
|
|
223
294
|
* that passes every check is returned for display;
|
|
224
295
|
* {@link isWritableConnectionEntry} says it cannot be written.
|
|
225
296
|
*
|
|
@@ -234,7 +305,7 @@ export function parseConnectionEntry(body) {
|
|
|
234
305
|
if (!isJsonObject(body)) {
|
|
235
306
|
return undefined;
|
|
236
307
|
}
|
|
237
|
-
const { version, kind, id, name, label, origin, url, appKey, firstSeen, lastSeen, retired, grants, writers } = body;
|
|
308
|
+
const { version, kind, id, name, label, origin, url, appKey, firstSeen, lastSeen, retired, declined, seed, seedTag, grants, grantsReceived, outbox, writers } = body;
|
|
238
309
|
if (typeof version !== 'number' ||
|
|
239
310
|
!Number.isInteger(version) ||
|
|
240
311
|
version < 1 ||
|
|
@@ -249,7 +320,13 @@ export function parseConnectionEntry(body) {
|
|
|
249
320
|
!isTimestamp(firstSeen) ||
|
|
250
321
|
!isTimestamp(lastSeen) ||
|
|
251
322
|
(retired !== undefined && !isTimestamp(retired)) ||
|
|
323
|
+
(declined !== undefined && !isTimestamp(declined)) ||
|
|
324
|
+
(seed !== undefined && decodeConnectionSeed(seed) === undefined) ||
|
|
325
|
+
(seedTag !== undefined && decodeConnectionSeed(seedTag) === undefined) ||
|
|
326
|
+
(seed === undefined) !== (seedTag === undefined) ||
|
|
252
327
|
!Array.isArray(grants) ||
|
|
328
|
+
(grantsReceived !== undefined && !Array.isArray(grantsReceived)) ||
|
|
329
|
+
(outbox !== undefined && !Array.isArray(outbox)) ||
|
|
253
330
|
!Array.isArray(writers)) {
|
|
254
331
|
return undefined;
|
|
255
332
|
}
|
|
@@ -260,8 +337,12 @@ export function parseConnectionEntry(body) {
|
|
|
260
337
|
return undefined;
|
|
261
338
|
}
|
|
262
339
|
const parsedGrants = grants.map(parseGrantRecord);
|
|
340
|
+
const parsedReceived = (grantsReceived ?? []).map(parseReceivedGrantRecord);
|
|
341
|
+
const parsedOutbox = (outbox ?? []).map(parseOutboxItem);
|
|
263
342
|
const parsedWriters = writers.map(parseWriter);
|
|
264
343
|
if (parsedGrants.some(grant => grant === undefined) ||
|
|
344
|
+
parsedReceived.some(grant => grant === undefined) ||
|
|
345
|
+
parsedOutbox.some(item => item === undefined) ||
|
|
265
346
|
parsedWriters.some(writer => writer === undefined)) {
|
|
266
347
|
return undefined;
|
|
267
348
|
}
|
|
@@ -280,7 +361,12 @@ export function parseConnectionEntry(body) {
|
|
|
280
361
|
firstSeen,
|
|
281
362
|
lastSeen,
|
|
282
363
|
...(retired !== undefined && { retired }),
|
|
364
|
+
...(declined !== undefined && { declined }),
|
|
365
|
+
...(seed !== undefined && { seed: seed }),
|
|
366
|
+
...(seedTag !== undefined && { seedTag: seedTag }),
|
|
283
367
|
grants: parsedGrants,
|
|
368
|
+
grantsReceived: parsedReceived,
|
|
369
|
+
outbox: parsedOutbox,
|
|
284
370
|
writers: parsedWriters
|
|
285
371
|
};
|
|
286
372
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/connections/ent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