@interop/wallet-core 0.97.0 → 0.99.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 +23 -18
- package/dist/clientAnnex/establish.d.ts +1 -1
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +1 -1
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forgetLast.js +1 -1
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/generationRung.d.ts +41 -0
- package/dist/clientAnnex/generationRung.d.ts.map +1 -0
- package/dist/clientAnnex/generationRung.js +66 -0
- package/dist/clientAnnex/generationRung.js.map +1 -0
- package/dist/clientAnnex/heal.d.ts +1 -1
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +2 -1
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +15 -15
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +15 -14
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +2 -1
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +2 -1
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +16 -1
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +28 -9
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +1 -1
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/zcap.js +1 -1
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/connections/grants.d.ts +18 -0
- package/dist/connections/grants.d.ts.map +1 -1
- package/dist/connections/grants.js +30 -0
- package/dist/connections/grants.js.map +1 -1
- package/dist/connections/index.d.ts +1 -1
- package/dist/connections/index.d.ts.map +1 -1
- package/dist/connections/index.js +1 -1
- package/dist/connections/index.js.map +1 -1
- package/dist/connections/store.d.ts +5 -11
- package/dist/connections/store.d.ts.map +1 -1
- package/dist/connections/store.js +5 -9
- package/dist/connections/store.js.map +1 -1
- package/dist/keyring/index.d.ts +9 -7
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +9 -7
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +45 -4
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +71 -19
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/menders/ids.d.ts +3 -2
- package/dist/menders/ids.d.ts.map +1 -1
- package/dist/menders/ids.js +6 -3
- package/dist/menders/ids.js.map +1 -1
- package/dist/recovery/continuation.d.ts.map +1 -1
- package/dist/recovery/continuation.js +3 -4
- package/dist/recovery/continuation.js.map +1 -1
- package/dist/recovery/recoveryCode.js +1 -1
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +6 -5
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +10 -21
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/document.d.ts +69 -52
- package/dist/resourceLog/document.d.ts.map +1 -1
- package/dist/resourceLog/document.js +77 -84
- package/dist/resourceLog/document.js.map +1 -1
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -1
- package/dist/resourceLog/ladderRungs.js +7 -47
- package/dist/resourceLog/ladderRungs.js.map +1 -1
- package/dist/space/activity.d.ts +27 -0
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +30 -0
- package/dist/space/activity.js.map +1 -1
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/index.js.map +1 -1
- package/dist/sync/pull.d.ts.map +1 -1
- package/dist/sync/pull.js +3 -2
- package/dist/sync/pull.js.map +1 -1
- package/dist/unlock/index.d.ts +1 -1
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +1 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +1 -1
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +4 -6
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/unlock/unlockRecord.d.ts +7 -2
- package/dist/unlock/unlockRecord.d.ts.map +1 -1
- package/dist/unlock/unlockRecord.js +9 -2
- package/dist/unlock/unlockRecord.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +2 -2
- package/dist/webvh/accountEntry.d.ts.map +1 -1
- package/dist/webvh/accountEntry.js +1 -6
- package/dist/webvh/accountEntry.js.map +1 -1
- package/dist/webvh/documentDids.d.ts +46 -0
- package/dist/webvh/documentDids.d.ts.map +1 -0
- package/dist/webvh/documentDids.js +50 -0
- package/dist/webvh/documentDids.js.map +1 -0
- package/dist/webvh/index.d.ts +11 -1
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +9 -1
- package/dist/webvh/index.js.map +1 -1
- package/dist/{clientAnnex → webvh}/ladder.d.ts +1 -27
- package/dist/webvh/ladder.d.ts.map +1 -0
- package/dist/{clientAnnex → webvh}/ladder.js +3 -29
- package/dist/webvh/ladder.js.map +1 -0
- package/dist/{unlock → webvh}/ladderDerivation.d.ts +17 -25
- package/dist/webvh/ladderDerivation.d.ts.map +1 -0
- package/dist/{unlock → webvh}/ladderDerivation.js +8 -45
- package/dist/webvh/ladderDerivation.js.map +1 -0
- package/dist/webvh/revokeClient.js +1 -1
- package/dist/webvh/revokeClient.js.map +1 -1
- package/package.json +10 -10
- package/dist/clientAnnex/ladder.d.ts.map +0 -1
- package/dist/clientAnnex/ladder.js.map +0 -1
- package/dist/unlock/ladderDerivation.d.ts.map +0 -1
- package/dist/unlock/ladderDerivation.js.map +0 -1
|
@@ -17,7 +17,7 @@ import { unlockKeyVerificationMethod, unlockKeyVmId } from '../unlock/standingWe
|
|
|
17
17
|
import { RECOVERY_CODE_SPEND_REFUSALS, recoveryContinuationOnce, spendOutcome } from '../recovery/continuation.js';
|
|
18
18
|
import { ceremonyEvents } from '../ceremonyEvents.js';
|
|
19
19
|
import { log } from '../log.js';
|
|
20
|
-
import { ladderRung, ladderVmKeyMultibase } from '
|
|
20
|
+
import { ladderRung, ladderVmKeyMultibase } from '../webvh/ladderDerivation.js';
|
|
21
21
|
import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
|
|
22
22
|
/**
|
|
23
23
|
* THE TRANSIENT-RECOVERY CONTINUATION (run by the code-derived client through
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,2BAA2B,EAC3B,aAAa,EAEd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,YAAY,EACb,MAAM,6BAA6B,CAAA;AAQpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,EAAE,iB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G,IAAI,WAAW,EAAE,CAAA;YAC1C,MAAM,cAAc,GAAG,aAAa,CAAC;gBACnC,GAAG;gBACH,YAAY,EAAE,sBAAsB;aACrC,CAAC,CAAA;YACF,OAAO;gBACL,OAAO,EAAE;oBACP,wBAAwB,CAAC;wBACvB,UAAU,EAAE,GAAG;wBACf,kBAAkB,EAAE,WAAW;qBAChC,CAAC;oBACF,2BAA2B,CAAC;wBAC1B,GAAG;wBACH,YAAY,EAAE,sBAAsB;wBACpC,gBAAgB;qBACjB,CAAC;iBACH;gBACD,eAAe,EAAE,CAAC,UAAU,CAAC;gBAC7B,YAAY,EAAE,CAAC,cAAc,CAAC;gBAC9B,oBAAoB,EAAE,CAAC,UAAU,CAAC;gBAClC,QAAQ,EAAE,4BAA4B,CAAC;oBACrC,GAAG;oBACH,UAAU,EAAE,GAAG;oBACf,cAAc,EAAE,SAAS,CAAC,cAAc;iBACzC,CAAC;aACH,CAAA;QACH,CAAC;QACD,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM;KACP,CAAC,CACH,EACH,YAAY,CACb,CAAA;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
package/dist/clientAnnex/zcap.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { Ed25519VerificationKey } from '@interop/ed25519-verification-key';
|
|
12
12
|
import { zcapClientForSigner } from '@interop/was-client';
|
|
13
|
-
import { ladderVmSeed } from '
|
|
13
|
+
import { ladderVmSeed } from '../webvh/ladderDerivation.js';
|
|
14
14
|
/**
|
|
15
15
|
* What the ladder VM's key material amounts to for a caller: its public
|
|
16
16
|
* multibase and a bound `sign`, generated once from the seed. Both entry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcap.js","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"zcap.js","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D;;;;;;;;;GASG;AACH,KAAK,UAAU,mBAAmB,CAAC,EAAE,UAAU,EAA8B;IAC3E,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,QAAQ,CAAC;QACpD,IAAI,EAAE,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;KACnC,CAAC,CAAA;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,CAAA;IACxC,OAAO;QACL,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,IAAI,EAAE,CAAC,OAA6B,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;KACjE,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,KAAK,UAAU,cAAc,CAAC,EAC5B,UAAU,EACV,UAAU,EAIX;IACC,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;IAC1D,OAAO,uBAAuB,CAAC;QAC7B,QAAQ;QACR,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAA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AAM;QACvB,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7B,IAAI,EAAE,4BAA4B;YAClC,UAAU,EAAE,GAAG;YACf,kBAAkB;SACnB,CAAC;KACH,CAAA;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EACpC,UAAU,EACV,UAAU,EAIX;IACC,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;IAC1D,MAAM,EAAE,MAAM,EAAE,GAAG,uBAAuB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;IACpE,OAAO;QACL,KAAK,EAAE,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;QACpC,UAAU,EAAE,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5C,CAAA;AACH,CAAC"}
|
|
@@ -54,6 +54,24 @@ export declare function connectionGrants({ entry, spaceUrl }: {
|
|
|
54
54
|
entry: ConnectionEntry;
|
|
55
55
|
spaceUrl: string;
|
|
56
56
|
}): ConnectionGrant[];
|
|
57
|
+
/**
|
|
58
|
+
* The Collection a capability target addresses when it is exactly a
|
|
59
|
+
* Collection container URL of the given Space (`<spaceUrl><collectionId>/`),
|
|
60
|
+
* else `undefined`: a Resource, a sub-resource, the Space itself, and a
|
|
61
|
+
* target outside the Space all read as none. The target is normalized by URL
|
|
62
|
+
* parsing first, as `isTargetInSpace` does, and the segment is
|
|
63
|
+
* percent-decoded.
|
|
64
|
+
*
|
|
65
|
+
* @param options {object}
|
|
66
|
+
* @param options.target {string}
|
|
67
|
+
* @param options.spaceUrl {string} the Space's container URL, with its
|
|
68
|
+
* trailing slash
|
|
69
|
+
* @returns {string | undefined}
|
|
70
|
+
*/
|
|
71
|
+
export declare function collectionIdInSpace({ target, spaceUrl }: {
|
|
72
|
+
target: string;
|
|
73
|
+
spaceUrl: string;
|
|
74
|
+
}): string | undefined;
|
|
57
75
|
/**
|
|
58
76
|
* The distinct targets of a set of grants, in first-seen order.
|
|
59
77
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/connections/grants.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE5E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,SAAS,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,IAAI,EAAE,cAAc,CAAA;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,EACT,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,OAAO,CAaV;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,eAAe,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,eAAe,EAAE,CAyBpB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACP,EAAE;IACD,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B,GAAG,MAAM,EAAE,CAEX;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,GAAgB,EACjB,EAAE;IACD,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,GAAG,CAAC,EAAE,IAAI,CAAA;CACX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CAAA;CACjB,GAAG,MAAM,GAAG,SAAS,CAcrB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACP,EAAE;IACD,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B,GAAG,MAAM,EAAE,CAEX;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,GAAgB,EACjB,EAAE;IACD,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,GAAG,CAAC,EAAE,IAAI,CAAA;CACX,GAAG;IAAE,IAAI,EAAE,eAAe,EAAE,CAAC;IAAC,OAAO,EAAE,eAAe,EAAE,CAAA;CAAE,CAc1D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACN,EAAE;IACD,KAAK,EAAE,eAAe,CAAA;CACvB,GAAG,MAAM,GAAG,SAAS,CAErB"}
|
|
@@ -73,6 +73,36 @@ export function connectionGrants({ entry, spaceUrl }) {
|
|
|
73
73
|
}
|
|
74
74
|
return grants;
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* The Collection a capability target addresses when it is exactly a
|
|
78
|
+
* Collection container URL of the given Space (`<spaceUrl><collectionId>/`),
|
|
79
|
+
* else `undefined`: a Resource, a sub-resource, the Space itself, and a
|
|
80
|
+
* target outside the Space all read as none. The target is normalized by URL
|
|
81
|
+
* parsing first, as `isTargetInSpace` does, and the segment is
|
|
82
|
+
* percent-decoded.
|
|
83
|
+
*
|
|
84
|
+
* @param options {object}
|
|
85
|
+
* @param options.target {string}
|
|
86
|
+
* @param options.spaceUrl {string} the Space's container URL, with its
|
|
87
|
+
* trailing slash
|
|
88
|
+
* @returns {string | undefined}
|
|
89
|
+
*/
|
|
90
|
+
export function collectionIdInSpace({ target, spaceUrl }) {
|
|
91
|
+
if (!isTargetInSpace({ target, spaceUrl })) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
const rest = new URL(target).href.slice(new URL(spaceUrl).href.length);
|
|
95
|
+
const segment = /^([^/?#]+)\/$/.exec(rest)?.[1];
|
|
96
|
+
if (segment === undefined) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
return decodeURIComponent(segment);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
76
106
|
/**
|
|
77
107
|
* The distinct targets of a set of grants, in first-seen order.
|
|
78
108
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.js","sourceRoot":"","sources":["../../src/connections/grants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AA8BxC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,EAIT;IACC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,SAAS,CACjB,iDAAiD,QAAQ,IAAI,CAC9D,CAAA;IACH,CAAC;IACD,IAAI,UAAkB,CAAA;IACtB,IAAI,CAAC;QACH,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAA;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA;AACtD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EAIT;IACC,MAAM,MAAM,GAAsB,EAAE,CAAA;IACpC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC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AA;AAC1D,CAAC"}
|
|
@@ -34,7 +34,7 @@ export { wasConnectionsStore } from './store.js';
|
|
|
34
34
|
export type { ConnectionsStore, StoredConnection } from './store.js';
|
|
35
35
|
export { findConnection, readConnections } from './read.js';
|
|
36
36
|
export type { ConnectionsListing, ReadConnection } from './read.js';
|
|
37
|
-
export { connectionGrants, grantRecipientKid, grantTargets, isTargetInSpace, splitGrantsByExpiry } from './grants.js';
|
|
37
|
+
export { collectionIdInSpace, connectionGrants, grantRecipientKid, grantTargets, isTargetInSpace, splitGrantsByExpiry } from './grants.js';
|
|
38
38
|
export type { ConnectionGrant } from './grants.js';
|
|
39
39
|
export { connectionRecipientKid, signingKeyMultibaseOfDid } from './didKey.js';
|
|
40
40
|
export { ConnectionKindMismatchError } from './errors.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,SAAS,EACV,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC7E,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACnE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAChF,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,SAAS,EACV,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC7E,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACnE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAChF,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -30,7 +30,7 @@ export { CONNECTION_ENTRY_VERSION, CONNECTION_KINDS, CONNECTION_WRITER_POLICY, G
|
|
|
30
30
|
export { CONNECTIONS_ID_PREFIX, connectionResourceId } from './resourceId.js';
|
|
31
31
|
export { wasConnectionsStore } from './store.js';
|
|
32
32
|
export { findConnection, readConnections } from './read.js';
|
|
33
|
-
export { connectionGrants, grantRecipientKid, grantTargets, isTargetInSpace, splitGrantsByExpiry } from './grants.js';
|
|
33
|
+
export { collectionIdInSpace, connectionGrants, grantRecipientKid, grantTargets, isTargetInSpace, splitGrantsByExpiry } from './grants.js';
|
|
34
34
|
export { connectionRecipientKid, signingKeyMultibaseOfDid } from './didKey.js';
|
|
35
35
|
export { ConnectionKindMismatchError } from './errors.js';
|
|
36
36
|
export { recordGrants, removeGrants, retireConnection, setConnectionLabel, unretireConnection } from './upsert.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,YAAY,CAAA;AAUnB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,cAAc,CAAA;AASrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,YAAY,CAAA;AAUnB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,cAAc,CAAA;AASrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -69,23 +69,17 @@ export interface ConnectionsStore {
|
|
|
69
69
|
}): Promise<{
|
|
70
70
|
etag?: string;
|
|
71
71
|
}>;
|
|
72
|
-
/**
|
|
73
|
-
* Deletes one resource, conditional on `ifMatch` when given.
|
|
74
|
-
*/
|
|
75
|
-
delete(options: {
|
|
76
|
-
resourceId: string;
|
|
77
|
-
ifMatch?: string;
|
|
78
|
-
}): Promise<void>;
|
|
79
72
|
}
|
|
80
73
|
/**
|
|
81
74
|
* Builds the directory store over the `connections` collection handle.
|
|
82
75
|
*
|
|
83
76
|
* A listing reads the collection's documents feed, bodies and ETags, one
|
|
84
77
|
* request per page, and opens each envelope with `cipher` under the resource
|
|
85
|
-
* id the feed served it at. A `get
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
78
|
+
* id the feed served it at. A `get` and a `put` go through the handle, whose
|
|
79
|
+
* encryption provider opens a read and seals a write. A `put` at an id with
|
|
80
|
+
* no resource yet creates the resource there, sealed under the collection's
|
|
81
|
+
* current epoch. The seam has no delete: an entry is retired and never
|
|
82
|
+
* deleted while the account stands.
|
|
89
83
|
*
|
|
90
84
|
* @param options {object}
|
|
91
85
|
* @param options.collection {Collection} the account data Space's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/connections/store.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,qBAAqB,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAE/D;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,IAAI,OA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AC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAA;IACzD;;;OAGG;IACH,GAAG,CAAC,OAAO,EAAE;QACX,UAAU,EAAE,MAAM,CAAA;QAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,WAAW,CAAC,EAAE,OAAO,CAAA;KACtB,GAAG,OAAO,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACP,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;CACnC,GAAG,gBAAgB,CA0CnB"}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A listing reads the collection's documents feed, bodies and ETags, one
|
|
5
5
|
* request per page, and opens each envelope with `cipher` under the resource
|
|
6
|
-
* id the feed served it at. A `get
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* id the feed served it at. A `get` and a `put` go through the handle, whose
|
|
7
|
+
* encryption provider opens a read and seals a write. A `put` at an id with
|
|
8
|
+
* no resource yet creates the resource there, sealed under the collection's
|
|
9
|
+
* current epoch. The seam has no delete: an entry is retired and never
|
|
10
|
+
* deleted while the account stands.
|
|
10
11
|
*
|
|
11
12
|
* @param options {object}
|
|
12
13
|
* @param options.collection {Collection} the account data Space's
|
|
@@ -56,11 +57,6 @@ export function wasConnectionsStore({ collection, cipher }) {
|
|
|
56
57
|
...(ifMatch !== undefined && { ifMatch }),
|
|
57
58
|
...(ifNoneMatch === true && { ifNoneMatch })
|
|
58
59
|
});
|
|
59
|
-
},
|
|
60
|
-
async delete({ resourceId, ifMatch }) {
|
|
61
|
-
await collection
|
|
62
|
-
.resource(resourceId)
|
|
63
|
-
.delete(ifMatch !== undefined ? { ifMatch } : {});
|
|
64
60
|
}
|
|
65
61
|
};
|
|
66
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/connections/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/connections/store.ts"],"names":[],"mappings":"AAsEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EAIP;IACC,OAAO;QACL,KAAK,CAAC,IAAI;YACR,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,SAAS,EAAE,CAAA;YAC9C,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;gBACvB,OAAO,IAAI,CAAA;YACb,CAAC;YACD,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,CAAA;YACzC,OAAO,OAAO,CAAC,GAAG,CAChB,SAAS,CAAC,GAAG,CAAC,KAAK,EAAC,GAAG,EAAC,EAAE;gBACxB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;gBAC7D,IAAI,CAAC;oBACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;wBAChC,EAAE,EAAE,GAAG,CAAC,EAAE;wBACV,QAAQ,EAAE,GAAG,CAAC,IAAY;wBAC1B,OAAO;qBACR,CAAC,CAAA;oBACF,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAAA;gBAC9C,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAA;gBACxD,CAAC;YACH,CAAC,CAAC,CACH,CAAA;QACH,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE;YACtB,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAA;YAClE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBACpB,OAAO,SAAS,CAAA;YAClB,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;aACxD,CAAA;QACH,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE;YAClD,OAAO,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,IAAkB,EAAE;gBACpD,WAAW,EAAE,kBAAkB;gBAC/B,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,CAAC;gBACzC,GAAG,CAAC,WAAW,KAAK,IAAI,IAAI,EAAE,WAAW,EAAE,CAAC;aAC7C,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/keyring/index.d.ts
CHANGED
|
@@ -31,12 +31,14 @@
|
|
|
31
31
|
* way (under their own cipher context) rather than re-deriving the
|
|
32
32
|
* construction. These live in `recordEnvelope.ts`, whose runtime imports
|
|
33
33
|
* are was-client's EDV subpath and the system collections leaf alone.
|
|
34
|
-
* - `ensureUnlockSpace` / `getUnlockKeyring` / `
|
|
35
|
-
* `deleteUnlockSpace` -- the unlock Space's lifecycle
|
|
36
|
-
* The read, write, and delete each take an optional
|
|
37
|
-
* management zcap the unlock identity delegated at bind
|
|
38
|
-
* ceremony that reaches the Space without its secret; the
|
|
39
|
-
* 404 as an outcome rather than deciding it.
|
|
34
|
+
* - `ensureUnlockSpace` / `getUnlockKeyring` / `getUnlockKeyringWithEtag` /
|
|
35
|
+
* `putUnlockKeyring` / `deleteUnlockSpace` -- the unlock Space's lifecycle
|
|
36
|
+
* and its one resource. The read, write, and delete each take an optional
|
|
37
|
+
* `capability` (the management zcap the unlock identity delegated at bind
|
|
38
|
+
* time) for a ceremony that reaches the Space without its secret; the
|
|
39
|
+
* delete reports a 404 as an outcome rather than deciding it. The etag read
|
|
40
|
+
* and the write's optional `ifMatch` make a re-bind of an existing record a
|
|
41
|
+
* compare-and-swap.
|
|
40
42
|
* - `fetchKeyringRecord` -- the composed lookup (derive, read, unwrap); an
|
|
41
43
|
* app's caching, pinning, and client-key persistence wrap around it.
|
|
42
44
|
*
|
|
@@ -51,6 +53,6 @@ export { KEYRING_RECORD_VERSION, mintRecordEncryption, parseRecordCreatedAt, par
|
|
|
51
53
|
export type { AccountPointer, KeyringRecordContents, RecordProof, SignedRecord } from './recordEnvelope.js';
|
|
52
54
|
export { recordProofKeyMultibase, recordSignerFromAgent, recordSignerFromSeed, signRecordFrame, unwrapKeyringRecord, verifyRecordProof, wrapKeyringRecord } from './record.js';
|
|
53
55
|
export type { RecordSigner } from './record.js';
|
|
54
|
-
export { deleteUnlockSpace, ensureUnlockSpace, getUnlockKeyring, putUnlockKeyring, UNLOCK_SPACE_NAME, UNLOCK_SPACE_TYPE } from './unlockSpace.js';
|
|
56
|
+
export { deleteUnlockSpace, ensureUnlockSpace, getUnlockKeyring, getUnlockKeyringWithEtag, putUnlockKeyring, UNLOCK_SPACE_NAME, UNLOCK_SPACE_TYPE } from './unlockSpace.js';
|
|
55
57
|
export { fetchKeyringRecord } from './fetch.js';
|
|
56
58
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC/E,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,YAAY,EACb,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/keyring/index.js
CHANGED
|
@@ -31,12 +31,14 @@
|
|
|
31
31
|
* way (under their own cipher context) rather than re-deriving the
|
|
32
32
|
* construction. These live in `recordEnvelope.ts`, whose runtime imports
|
|
33
33
|
* are was-client's EDV subpath and the system collections leaf alone.
|
|
34
|
-
* - `ensureUnlockSpace` / `getUnlockKeyring` / `
|
|
35
|
-
* `deleteUnlockSpace` -- the unlock Space's lifecycle
|
|
36
|
-
* The read, write, and delete each take an optional
|
|
37
|
-
* management zcap the unlock identity delegated at bind
|
|
38
|
-
* ceremony that reaches the Space without its secret; the
|
|
39
|
-
* 404 as an outcome rather than deciding it.
|
|
34
|
+
* - `ensureUnlockSpace` / `getUnlockKeyring` / `getUnlockKeyringWithEtag` /
|
|
35
|
+
* `putUnlockKeyring` / `deleteUnlockSpace` -- the unlock Space's lifecycle
|
|
36
|
+
* and its one resource. The read, write, and delete each take an optional
|
|
37
|
+
* `capability` (the management zcap the unlock identity delegated at bind
|
|
38
|
+
* time) for a ceremony that reaches the Space without its secret; the
|
|
39
|
+
* delete reports a 404 as an outcome rather than deciding it. The etag read
|
|
40
|
+
* and the write's optional `ifMatch` make a re-bind of an existing record a
|
|
41
|
+
* compare-and-swap.
|
|
40
42
|
* - `fetchKeyringRecord` -- the composed lookup (derive, read, unwrap); an
|
|
41
43
|
* app's caching, pinning, and client-key persistence wrap around it.
|
|
42
44
|
*
|
|
@@ -47,6 +49,6 @@ export { BACKUP_CREDENTIAL_KDF, deriveUnlockSeed, KEYRING_KDF } from './kdf.js';
|
|
|
47
49
|
export { deriveUnlockIdentity, unlockIdentityFromSeed, UNLOCK_HANDLE, UNLOCK_KEY_NAME, unlockSpaceIdFor } from './unlockIdentity.js';
|
|
48
50
|
export { KEYRING_RECORD_VERSION, mintRecordEncryption, parseRecordCreatedAt, parseRecordFrame, parseRecordPointer, recordCipher, recordCreatedAtStamp, recordEnvelopeId, RecordProofError, recordSealCipher } from './recordEnvelope.js';
|
|
49
51
|
export { recordProofKeyMultibase, recordSignerFromAgent, recordSignerFromSeed, signRecordFrame, unwrapKeyringRecord, verifyRecordProof, wrapKeyringRecord } from './record.js';
|
|
50
|
-
export { deleteUnlockSpace, ensureUnlockSpace, getUnlockKeyring, putUnlockKeyring, UNLOCK_SPACE_NAME, UNLOCK_SPACE_TYPE } from './unlockSpace.js';
|
|
52
|
+
export { deleteUnlockSpace, ensureUnlockSpace, getUnlockKeyring, getUnlockKeyringWithEtag, putUnlockKeyring, UNLOCK_SPACE_NAME, UNLOCK_SPACE_TYPE } from './unlockSpace.js';
|
|
51
53
|
export { fetchKeyringRecord } from './fetch.js';
|
|
52
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG/E,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAQ5B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -98,7 +98,43 @@ export declare function getUnlockKeyring({ storageServerUrl, zcapClient, service
|
|
|
98
98
|
capability?: IZcap;
|
|
99
99
|
}): Promise<unknown | null>;
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* Reads the keyring record from the unlock Space together with its `ETag`
|
|
102
|
+
* validator, or returns `null` when it does not exist yet. The read half of a
|
|
103
|
+
* compare-and-swap re-bind: a writer that rebuilds the record from what it
|
|
104
|
+
* read passes this `etag` to {@link putUnlockKeyring}'s `ifMatch`, so a
|
|
105
|
+
* concurrent writer's record is never overwritten unseen. Same request,
|
|
106
|
+
* errors, and `capability` semantics as {@link getUnlockKeyring}.
|
|
107
|
+
*
|
|
108
|
+
* @param options {object}
|
|
109
|
+
* @param options.storageServerUrl {string}
|
|
110
|
+
* @param options.zcapClient {ZcapClient}
|
|
111
|
+
* @param [options.serviceDescription] {ServiceDescription} the server's
|
|
112
|
+
* service description a client the caller already holds discovered
|
|
113
|
+
* (`(await was.service()).description`), so this one skips discovery
|
|
114
|
+
* @param options.spaceId {string} the unlock Space id
|
|
115
|
+
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
116
|
+
* absent, the read is a root invocation
|
|
117
|
+
* @returns {Promise<{ record: unknown; etag?: string } | null>} `etag` is
|
|
118
|
+
* absent only where the header did not reach the client
|
|
119
|
+
*/
|
|
120
|
+
export declare function getUnlockKeyringWithEtag({ storageServerUrl, zcapClient, serviceDescription, spaceId, capability }: {
|
|
121
|
+
storageServerUrl: string;
|
|
122
|
+
zcapClient: ZcapClient;
|
|
123
|
+
serviceDescription?: ServiceDescription;
|
|
124
|
+
spaceId: string;
|
|
125
|
+
capability?: IZcap;
|
|
126
|
+
}): Promise<{
|
|
127
|
+
record: unknown;
|
|
128
|
+
etag?: string;
|
|
129
|
+
} | null>;
|
|
130
|
+
/**
|
|
131
|
+
* Writes the keyring record into the unlock Space as a JSON document. A plain
|
|
132
|
+
* upsert unless `ifMatch` is given: then the write is a compare-and-swap
|
|
133
|
+
* against the `etag` a {@link getUnlockKeyringWithEtag} read returned, and a
|
|
134
|
+
* record another writer replaced in between fails with was-client's
|
|
135
|
+
* `PreconditionFailedError` (412, matched by `err.name`) rather than being
|
|
136
|
+
* overwritten. A first bind of a fresh record has no `etag` to name and stays
|
|
137
|
+
* an upsert.
|
|
102
138
|
*
|
|
103
139
|
* With a `capability`, the `zcapClient` is an enrolled client's rather than
|
|
104
140
|
* the unlock identity's, and the attached management zcap (delegated by the
|
|
@@ -118,16 +154,21 @@ export declare function getUnlockKeyring({ storageServerUrl, zcapClient, service
|
|
|
118
154
|
* @param options.record {object} the keyring record
|
|
119
155
|
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
120
156
|
* absent, the write is a root invocation
|
|
121
|
-
* @
|
|
157
|
+
* @param [options.ifMatch] {string} the `ETag` of the record this write
|
|
158
|
+
* replaces; absent, the write is an unconditional upsert
|
|
159
|
+
* @returns {Promise<{ etag?: string }>} the stored record's new `ETag`
|
|
122
160
|
*/
|
|
123
|
-
export declare function putUnlockKeyring({ storageServerUrl, zcapClient, serviceDescription, spaceId, record, capability }: {
|
|
161
|
+
export declare function putUnlockKeyring({ storageServerUrl, zcapClient, serviceDescription, spaceId, record, capability, ifMatch }: {
|
|
124
162
|
storageServerUrl: string;
|
|
125
163
|
zcapClient: ZcapClient;
|
|
126
164
|
serviceDescription?: ServiceDescription;
|
|
127
165
|
spaceId: string;
|
|
128
166
|
record: object;
|
|
129
167
|
capability?: IZcap;
|
|
130
|
-
|
|
168
|
+
ifMatch?: string;
|
|
169
|
+
}): Promise<{
|
|
170
|
+
etag?: string;
|
|
171
|
+
}>;
|
|
131
172
|
/**
|
|
132
173
|
* Deletes the whole unlock Space (what retires an old passphrase on a
|
|
133
174
|
* passphrase change, or a lost unlock method). The server's answer is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unlockSpace.d.ts","sourceRoot":"","sources":["../../src/keyring/unlockSpace.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,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,kBAAkB,EAClB,OAAO,EACP,UAAU,EACX,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,CAAC,CAOhD"}
|
|
@@ -80,11 +80,13 @@ async function ensurePlaintextCollection({ was, spaceId, collectionId, name }) {
|
|
|
80
80
|
.configure({ name, force: true });
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* Reads a single plaintext JSON record from a Space collection
|
|
84
|
-
* it does not exist yet (a missing Space,
|
|
85
|
-
* as a 404-shaped `null` from
|
|
86
|
-
*
|
|
87
|
-
*
|
|
83
|
+
* Reads a single plaintext JSON record from a Space collection together with
|
|
84
|
+
* its `ETag` validator, or `null` when it does not exist yet (a missing Space,
|
|
85
|
+
* collection, or resource all surface as a 404-shaped `null` from
|
|
86
|
+
* `resource.getWithEtag()`). A network / unreachable error propagates, so
|
|
87
|
+
* callers can distinguish "no record" from "could not check". The explicit
|
|
88
|
+
* `plaintext` override is load-bearing (see the module doc): it is also what
|
|
89
|
+
* lets the validator reach the server unchanged on a conditional write.
|
|
88
90
|
*
|
|
89
91
|
* @param options {object}
|
|
90
92
|
* @param options.was {WasClient} the unlock Space client
|
|
@@ -93,7 +95,8 @@ async function ensurePlaintextCollection({ was, spaceId, collectionId, name }) {
|
|
|
93
95
|
* @param options.resourceId {string}
|
|
94
96
|
* @param [options.capability] {IZcap} an invocation capability the GET
|
|
95
97
|
* rides; absent, the request invokes the root capability
|
|
96
|
-
* @returns {Promise<unknown | null>}
|
|
98
|
+
* @returns {Promise<{ record: unknown; etag?: string } | null>} `etag` is
|
|
99
|
+
* absent only where the header did not reach the client
|
|
97
100
|
*/
|
|
98
101
|
async function getPlaintextRecord({ was, spaceId, collectionId, resourceId, capability }) {
|
|
99
102
|
const result = await plaintextCollection({
|
|
@@ -103,12 +106,20 @@ async function getPlaintextRecord({ was, spaceId, collectionId, resourceId, capa
|
|
|
103
106
|
capability
|
|
104
107
|
})
|
|
105
108
|
.resource(resourceId)
|
|
106
|
-
.
|
|
107
|
-
|
|
109
|
+
.getWithEtag();
|
|
110
|
+
if (result === null) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
return result.etag !== undefined
|
|
114
|
+
? { record: result.data, etag: result.etag }
|
|
115
|
+
: { record: result.data };
|
|
108
116
|
}
|
|
109
117
|
/**
|
|
110
|
-
* Writes
|
|
111
|
-
*
|
|
118
|
+
* Writes a single plaintext JSON record into a Space collection. Serialized to
|
|
119
|
+
* bytes with an explicit `application/json` content-type. A plain upsert
|
|
120
|
+
* unless `ifMatch` is given, in which case the write lands only while the
|
|
121
|
+
* stored record's `ETag` still matches, and a mismatch throws was-client's
|
|
122
|
+
* `PreconditionFailedError` (412) unchanged.
|
|
112
123
|
*
|
|
113
124
|
* @param options {object}
|
|
114
125
|
* @param options.was {WasClient} the unlock Space client
|
|
@@ -118,13 +129,15 @@ async function getPlaintextRecord({ was, spaceId, collectionId, resourceId, capa
|
|
|
118
129
|
* @param options.record {object}
|
|
119
130
|
* @param [options.capability] {IZcap} an invocation capability the PUT
|
|
120
131
|
* rides; absent, the request invokes the root capability
|
|
121
|
-
* @
|
|
132
|
+
* @param [options.ifMatch] {string} the `ETag` a prior read returned; the
|
|
133
|
+
* write is conditional on it
|
|
134
|
+
* @returns {Promise<{ etag?: string }>} the stored record's new `ETag`
|
|
122
135
|
*/
|
|
123
|
-
async function putPlaintextRecord({ was, spaceId, collectionId, resourceId, record, capability }) {
|
|
136
|
+
async function putPlaintextRecord({ was, spaceId, collectionId, resourceId, record, capability, ifMatch }) {
|
|
124
137
|
const body = new TextEncoder().encode(JSON.stringify(record));
|
|
125
|
-
|
|
138
|
+
return plaintextCollection({ was, spaceId, collectionId, capability })
|
|
126
139
|
.resource(resourceId)
|
|
127
|
-
.put(body, { contentType: 'application/json' });
|
|
140
|
+
.put(body, { contentType: 'application/json', ifMatch });
|
|
128
141
|
}
|
|
129
142
|
/**
|
|
130
143
|
* Ensures the unlock Space and its single `keyring` collection exist
|
|
@@ -185,6 +198,36 @@ export async function ensureUnlockSpace({ storageServerUrl, zcapClient, serviceD
|
|
|
185
198
|
* @returns {Promise<unknown | null>}
|
|
186
199
|
*/
|
|
187
200
|
export async function getUnlockKeyring({ storageServerUrl, zcapClient, serviceDescription, spaceId, capability }) {
|
|
201
|
+
const result = await getUnlockKeyringWithEtag({
|
|
202
|
+
storageServerUrl,
|
|
203
|
+
zcapClient,
|
|
204
|
+
serviceDescription,
|
|
205
|
+
spaceId,
|
|
206
|
+
capability
|
|
207
|
+
});
|
|
208
|
+
return result === null ? null : result.record;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Reads the keyring record from the unlock Space together with its `ETag`
|
|
212
|
+
* validator, or returns `null` when it does not exist yet. The read half of a
|
|
213
|
+
* compare-and-swap re-bind: a writer that rebuilds the record from what it
|
|
214
|
+
* read passes this `etag` to {@link putUnlockKeyring}'s `ifMatch`, so a
|
|
215
|
+
* concurrent writer's record is never overwritten unseen. Same request,
|
|
216
|
+
* errors, and `capability` semantics as {@link getUnlockKeyring}.
|
|
217
|
+
*
|
|
218
|
+
* @param options {object}
|
|
219
|
+
* @param options.storageServerUrl {string}
|
|
220
|
+
* @param options.zcapClient {ZcapClient}
|
|
221
|
+
* @param [options.serviceDescription] {ServiceDescription} the server's
|
|
222
|
+
* service description a client the caller already holds discovered
|
|
223
|
+
* (`(await was.service()).description`), so this one skips discovery
|
|
224
|
+
* @param options.spaceId {string} the unlock Space id
|
|
225
|
+
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
226
|
+
* absent, the read is a root invocation
|
|
227
|
+
* @returns {Promise<{ record: unknown; etag?: string } | null>} `etag` is
|
|
228
|
+
* absent only where the header did not reach the client
|
|
229
|
+
*/
|
|
230
|
+
export async function getUnlockKeyringWithEtag({ storageServerUrl, zcapClient, serviceDescription, spaceId, capability }) {
|
|
188
231
|
return getPlaintextRecord({
|
|
189
232
|
was: unlockSpaceClient({
|
|
190
233
|
storageServerUrl,
|
|
@@ -198,7 +241,13 @@ export async function getUnlockKeyring({ storageServerUrl, zcapClient, serviceDe
|
|
|
198
241
|
});
|
|
199
242
|
}
|
|
200
243
|
/**
|
|
201
|
-
* Writes
|
|
244
|
+
* Writes the keyring record into the unlock Space as a JSON document. A plain
|
|
245
|
+
* upsert unless `ifMatch` is given: then the write is a compare-and-swap
|
|
246
|
+
* against the `etag` a {@link getUnlockKeyringWithEtag} read returned, and a
|
|
247
|
+
* record another writer replaced in between fails with was-client's
|
|
248
|
+
* `PreconditionFailedError` (412, matched by `err.name`) rather than being
|
|
249
|
+
* overwritten. A first bind of a fresh record has no `etag` to name and stays
|
|
250
|
+
* an upsert.
|
|
202
251
|
*
|
|
203
252
|
* With a `capability`, the `zcapClient` is an enrolled client's rather than
|
|
204
253
|
* the unlock identity's, and the attached management zcap (delegated by the
|
|
@@ -218,10 +267,12 @@ export async function getUnlockKeyring({ storageServerUrl, zcapClient, serviceDe
|
|
|
218
267
|
* @param options.record {object} the keyring record
|
|
219
268
|
* @param [options.capability] {IZcap} the delegated management zcap;
|
|
220
269
|
* absent, the write is a root invocation
|
|
221
|
-
* @
|
|
270
|
+
* @param [options.ifMatch] {string} the `ETag` of the record this write
|
|
271
|
+
* replaces; absent, the write is an unconditional upsert
|
|
272
|
+
* @returns {Promise<{ etag?: string }>} the stored record's new `ETag`
|
|
222
273
|
*/
|
|
223
|
-
export async function putUnlockKeyring({ storageServerUrl, zcapClient, serviceDescription, spaceId, record, capability }) {
|
|
224
|
-
|
|
274
|
+
export async function putUnlockKeyring({ storageServerUrl, zcapClient, serviceDescription, spaceId, record, capability, ifMatch }) {
|
|
275
|
+
return putPlaintextRecord({
|
|
225
276
|
was: unlockSpaceClient({
|
|
226
277
|
storageServerUrl,
|
|
227
278
|
zcapClient,
|
|
@@ -231,7 +282,8 @@ export async function putUnlockKeyring({ storageServerUrl, zcapClient, serviceDe
|
|
|
231
282
|
collectionId: KEYRING_COLLECTION.id,
|
|
232
283
|
resourceId: KEYRING_RESOURCE,
|
|
233
284
|
record,
|
|
234
|
-
capability
|
|
285
|
+
capability,
|
|
286
|
+
ifMatch
|
|
235
287
|
});
|
|
236
288
|
}
|
|
237
289
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unlockSpace.js","sourceRoot":"","sources":["../../src/keyring/unlockSpace.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,SAAS,EAA2B,MAAM,qBAAqB,CAAA;AAGxE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAErE;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,oBAAoB,CAAA;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA;AAE3E;;;;;;;;;;;;GAYG;AACH,SAAS,iBAAiB,CAAC,EACzB,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAKnB;IACC,OAAO,IAAI,SAAS,CAAC;QACnB,SAAS,EAAE,gBAAgB;QAC3B,UAAU;QACV,kBAAkB;KACnB,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,KAAK,UAAU,yBAAyB,CAAC,EACvC,GAAG,EACH,OAAO,EACP,YAAY,EACZ,IAAI,EAML;IACC,MAAM,GAAG;SACN,KAAK,CAAC,OAAO,CAAC;SACd,UAAU,CAAC,YAAY,CAAC;SACxB,SAAS,CAAC,EAAE,IAAI,EA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kB,CAAC,EAAE;QACnC,UAAU,EAAE,gBAAgB;QAC5B,MAAM;QACN,UAAU;QACV,OAAO;KACR,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EACtC,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,OAAO,EACP,UAAU,EAOX;IACC,MAAM,GAAG,GAAG,iBAAiB,CAAC;QAC5B,gBAAgB;QAChB,UAAU;QACV,kBAAkB;KACnB,CAAC,CAAA;IACF,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAA;AAC/D,CAAC"}
|
package/dist/menders/ids.d.ts
CHANGED
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
* (`ceremonyEvents.ts`) is a separate diagnostics surface, and its mender
|
|
11
11
|
* events do carry them.
|
|
12
12
|
* Numbered in the order the design table assigned them, and a new one takes
|
|
13
|
-
* the next free number rather than renumbering.
|
|
13
|
+
* the next free number rather than renumbering. A retired id leaves its
|
|
14
|
+
* number empty, and no later id takes it.
|
|
14
15
|
*/
|
|
15
16
|
/**
|
|
16
17
|
* Every invariant id, in design-table order.
|
|
17
18
|
*/
|
|
18
|
-
export declare const INVARIANT_IDS: readonly ["roster-wraps-exactly-the-document-key-set", "governed-log-heads-anchor-past-the-membership-change", "collection-epochs-name-the-current-user-key", "unlock-registry-opens-under-the-current-user-key", "registry-passphrase-entry-names-the-standing-credential", "passkey-entry-carries-its-standing-configuration", "registry-lists-the-passphrase-method", "standing-delegations-verify-under-the-current-document", "registry-records-the-committed-ladder-rung", "unlock-record-points-at-the-account-did", "account-pointer-names-the-account-did", "space-controller-is-the-account-did", "roster-and-collection-epochs-exist", "registry-records-the-establishing-credential", "annex-generation-is-reachable", "generation-delegation-is-current", "acting-credential-manage-zcap-is-current", "did-web-projection-matches-the-log", "no-annex-generation-outlives-its-pointer", "
|
|
19
|
+
export declare const INVARIANT_IDS: readonly ["roster-wraps-exactly-the-document-key-set", "governed-log-heads-anchor-past-the-membership-change", "collection-epochs-name-the-current-user-key", "unlock-registry-opens-under-the-current-user-key", "registry-passphrase-entry-names-the-standing-credential", "passkey-entry-carries-its-standing-configuration", "registry-lists-the-passphrase-method", "standing-delegations-verify-under-the-current-document", "registry-records-the-committed-ladder-rung", "unlock-record-points-at-the-account-did", "account-pointer-names-the-account-did", "space-controller-is-the-account-did", "roster-and-collection-epochs-exist", "registry-records-the-establishing-credential", "annex-generation-is-reachable", "generation-delegation-is-current", "acting-credential-manage-zcap-is-current", "did-web-projection-matches-the-log", "no-annex-generation-outlives-its-pointer", "client-key-record-matches-the-pointed-account", "this-browser-is-still-an-enrolled-client", "no-client-key-record-stays-pending", "recovery-spend-is-completed", "retired-credential-leaves-no-annex-inventory", "document-lists-the-acting-credential", "keystore-controller-is-the-account-did", "account-document-publishes-an-authentication-key", "every-document-key-agreement-entry-has-a-locatable-credential", "no-unlock-space-outlives-its-credential", "no-keystore-outlives-its-account", "saved-recovery-codes-locate-their-account", "standard-collections-are-provisioned", "no-auxiliary-space-stands-unnamed", "no-registered-writer-outlives-its-expiry", "every-party-with-authority-has-a-connection-entry"];
|
|
19
20
|
/**
|
|
20
21
|
* One id from {@link INVARIANT_IDS}.
|
|
21
22
|
*/
|