@interop/wallet-core 0.61.0 → 0.65.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 +41 -16
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +55 -34
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +102 -56
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +16 -2
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +11 -9
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +126 -35
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +208 -60
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/gc.d.ts +3 -2
- package/dist/clientAnnex/gc.d.ts.map +1 -1
- package/dist/clientAnnex/gc.js +7 -7
- package/dist/clientAnnex/gc.js.map +1 -1
- package/dist/clientAnnex/heal.d.ts +101 -33
- package/dist/clientAnnex/heal.d.ts.map +1 -1
- package/dist/clientAnnex/heal.js +559 -212
- package/dist/clientAnnex/heal.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +21 -5
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +24 -5
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladder.d.ts +304 -18
- package/dist/clientAnnex/ladder.d.ts.map +1 -1
- package/dist/clientAnnex/ladder.js +942 -64
- package/dist/clientAnnex/ladder.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +261 -28
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +521 -295
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +193 -38
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +445 -190
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clientAnnex/mend.d.ts +12 -6
- package/dist/clientAnnex/mend.d.ts.map +1 -1
- package/dist/clientAnnex/mend.js +26 -12
- package/dist/clientAnnex/mend.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts +38 -11
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +177 -55
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/spaceCapability.d.ts +123 -0
- package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
- package/dist/clientAnnex/spaceCapability.js +152 -0
- package/dist/clientAnnex/spaceCapability.js.map +1 -0
- package/dist/clientAnnex/stages.d.ts +63 -0
- package/dist/clientAnnex/stages.d.ts.map +1 -0
- package/dist/clientAnnex/stages.js +64 -0
- package/dist/clientAnnex/stages.js.map +1 -0
- package/dist/clientAnnex/zcap.d.ts +1 -1
- package/dist/clientAnnex/zcap.d.ts.map +1 -1
- package/dist/clientAnnex/zcap.js +42 -35
- package/dist/clientAnnex/zcap.js.map +1 -1
- package/dist/clients/policy.d.ts +15 -1
- package/dist/clients/policy.d.ts.map +1 -1
- package/dist/clients/policy.js +12 -6
- package/dist/clients/policy.js.map +1 -1
- package/dist/clients/revocation.d.ts +18 -10
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +13 -5
- package/dist/clients/revocation.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts +10 -2
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +41 -24
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/descriptors/acquire.d.ts.map +1 -1
- package/dist/descriptors/acquire.js +6 -23
- package/dist/descriptors/acquire.js.map +1 -1
- package/dist/descriptors/cipher.d.ts.map +1 -1
- package/dist/descriptors/cipher.js +5 -0
- package/dist/descriptors/cipher.js.map +1 -1
- package/dist/descriptors/errors.d.ts +43 -0
- package/dist/descriptors/errors.d.ts.map +1 -0
- package/dist/descriptors/errors.js +45 -0
- package/dist/descriptors/errors.js.map +1 -0
- 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/enrollment/enrollment.d.ts +37 -10
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +52 -15
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/genesis/accountGenesis.d.ts +42 -11
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +80 -22
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/index.d.ts +3 -1
- package/dist/genesis/index.d.ts.map +1 -1
- package/dist/genesis/index.js +3 -1
- package/dist/genesis/index.js.map +1 -1
- package/dist/identity/agents.d.ts +17 -1
- package/dist/identity/agents.d.ts.map +1 -1
- package/dist/identity/agents.js +24 -8
- package/dist/identity/agents.js.map +1 -1
- package/dist/identity/index.d.ts +3 -1
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +3 -1
- package/dist/identity/index.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/keyring/index.d.ts +2 -1
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +2 -1
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/record.d.ts.map +1 -1
- package/dist/keyring/record.js +3 -6
- package/dist/keyring/record.js.map +1 -1
- package/dist/keyring/unlockSpace.d.ts +14 -5
- package/dist/keyring/unlockSpace.d.ts.map +1 -1
- package/dist/keyring/unlockSpace.js +31 -36
- package/dist/keyring/unlockSpace.js.map +1 -1
- package/dist/keys/index.d.ts +10 -6
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +9 -5
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rosterLogStore.d.ts +12 -11
- package/dist/keys/rosterLogStore.d.ts.map +1 -1
- package/dist/keys/rosterLogStore.js +15 -13
- package/dist/keys/rosterLogStore.js.map +1 -1
- package/dist/keys/rosterStore.d.ts +3 -6
- package/dist/keys/rosterStore.d.ts.map +1 -1
- package/dist/keys/rosterStore.js +10 -9
- package/dist/keys/rosterStore.js.map +1 -1
- package/dist/keys/spaceEpochs.d.ts.map +1 -1
- package/dist/keys/spaceEpochs.js +2 -3
- package/dist/keys/spaceEpochs.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +89 -9
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +262 -19
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts +7 -6
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +7 -6
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/keys/wasLabelsStore.d.ts +9 -2
- package/dist/keys/wasLabelsStore.d.ts.map +1 -1
- package/dist/keys/wasLabelsStore.js +14 -6
- package/dist/keys/wasLabelsStore.js.map +1 -1
- package/dist/log.d.ts +7 -2
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +6 -1
- package/dist/log.js.map +1 -1
- package/dist/recovery/index.d.ts +12 -8
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +11 -7
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryCode.d.ts +27 -7
- package/dist/recovery/recoveryCode.d.ts.map +1 -1
- package/dist/recovery/recoveryCode.js +18 -6
- package/dist/recovery/recoveryCode.js.map +1 -1
- package/dist/recovery/recoveryDelegation.d.ts +4 -1
- package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
- package/dist/recovery/recoveryDelegation.js +25 -36
- package/dist/recovery/recoveryDelegation.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +117 -65
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +279 -126
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/request/classify.d.ts +32 -8
- package/dist/request/classify.d.ts.map +1 -1
- package/dist/request/classify.js +39 -14
- package/dist/request/classify.js.map +1 -1
- package/dist/request/ephemeralExchange.d.ts +1 -6
- package/dist/request/ephemeralExchange.d.ts.map +1 -1
- package/dist/request/ephemeralExchange.js.map +1 -1
- package/dist/request/onboarding.d.ts.map +1 -1
- package/dist/request/onboarding.js +2 -2
- package/dist/request/onboarding.js.map +1 -1
- package/dist/request/parse.d.ts.map +1 -1
- package/dist/request/parse.js +2 -3
- package/dist/request/parse.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +34 -12
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +79 -86
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/document.d.ts +182 -0
- package/dist/resourceLog/document.d.ts.map +1 -0
- package/dist/resourceLog/document.js +159 -0
- package/dist/resourceLog/document.js.map +1 -0
- package/dist/resourceLog/errors.d.ts +47 -8
- package/dist/resourceLog/errors.d.ts.map +1 -1
- package/dist/resourceLog/errors.js +54 -8
- package/dist/resourceLog/errors.js.map +1 -1
- package/dist/resourceLog/index.d.ts +7 -3
- package/dist/resourceLog/index.d.ts.map +1 -1
- package/dist/resourceLog/index.js +7 -3
- package/dist/resourceLog/index.js.map +1 -1
- package/dist/resourceLog/ladderRungs.d.ts +35 -0
- package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
- package/dist/resourceLog/ladderRungs.js +352 -0
- package/dist/resourceLog/ladderRungs.js.map +1 -0
- package/dist/resourceLog/license.d.ts +42 -17
- package/dist/resourceLog/license.d.ts.map +1 -1
- package/dist/resourceLog/license.js +38 -24
- package/dist/resourceLog/license.js.map +1 -1
- package/dist/space/activity.d.ts +15 -15
- package/dist/space/activity.d.ts.map +1 -1
- package/dist/space/activity.js +15 -15
- package/dist/space/activity.js.map +1 -1
- package/dist/space/collections.d.ts +11 -0
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +13 -0
- package/dist/space/collections.js.map +1 -1
- package/dist/space/deleteSpace.d.ts +28 -0
- package/dist/space/deleteSpace.d.ts.map +1 -0
- package/dist/space/deleteSpace.js +44 -0
- package/dist/space/deleteSpace.js.map +1 -0
- package/dist/space/errors.d.ts.map +1 -1
- package/dist/space/errors.js +0 -1
- package/dist/space/errors.js.map +1 -1
- package/dist/space/index.d.ts +6 -0
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +6 -0
- package/dist/space/index.js.map +1 -1
- package/dist/space/plaintextCollection.d.ts +43 -0
- package/dist/space/plaintextCollection.d.ts.map +1 -0
- package/dist/space/plaintextCollection.js +17 -0
- package/dist/space/plaintextCollection.js.map +1 -0
- package/dist/stages.d.ts +23 -0
- package/dist/stages.d.ts.map +1 -0
- package/dist/stages.js +23 -0
- package/dist/stages.js.map +1 -0
- package/dist/sync/index.d.ts +7 -0
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +7 -0
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push.js +4 -4
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/remint.js +2 -2
- package/dist/sync/remint.js.map +1 -1
- package/dist/sync/types.d.ts +41 -1
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/types.js +47 -1
- package/dist/sync/types.js.map +1 -1
- package/dist/unlock/index.d.ts +6 -2
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +5 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +95 -14
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +102 -10
- package/dist/unlock/retire.js.map +1 -1
- package/dist/unlock/standingClient.d.ts.map +1 -1
- package/dist/unlock/standingClient.js +5 -1
- package/dist/unlock/standingClient.js.map +1 -1
- package/dist/unlock/standingWebvh.d.ts +341 -49
- package/dist/unlock/standingWebvh.d.ts.map +1 -1
- package/dist/unlock/standingWebvh.js +608 -164
- package/dist/unlock/standingWebvh.js.map +1 -1
- package/dist/webvh/accountEntry.d.ts +146 -0
- package/dist/webvh/accountEntry.d.ts.map +1 -0
- package/dist/webvh/accountEntry.js +239 -0
- package/dist/webvh/accountEntry.js.map +1 -0
- package/dist/webvh/didWeb.d.ts +12 -7
- package/dist/webvh/didWeb.d.ts.map +1 -1
- package/dist/webvh/didWeb.js +2 -2
- package/dist/webvh/didWeb.js.map +1 -1
- package/dist/webvh/didWebProjection.d.ts +164 -0
- package/dist/webvh/didWebProjection.d.ts.map +1 -0
- package/dist/webvh/didWebProjection.js +230 -0
- package/dist/webvh/didWebProjection.js.map +1 -0
- package/dist/webvh/didWebvh.d.ts +278 -138
- package/dist/webvh/didWebvh.d.ts.map +1 -1
- package/dist/webvh/didWebvh.js +314 -345
- package/dist/webvh/didWebvh.js.map +1 -1
- package/dist/webvh/enrollClient.d.ts +65 -0
- package/dist/webvh/enrollClient.d.ts.map +1 -0
- package/dist/webvh/enrollClient.js +172 -0
- package/dist/webvh/enrollClient.js.map +1 -0
- package/dist/webvh/index.d.ts +37 -12
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +33 -10
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/listClients.d.ts +1 -33
- package/dist/webvh/listClients.d.ts.map +1 -1
- package/dist/webvh/listClients.js +2 -28
- package/dist/webvh/listClients.js.map +1 -1
- package/dist/webvh/revokeClient.d.ts +89 -11
- package/dist/webvh/revokeClient.d.ts.map +1 -1
- package/dist/webvh/revokeClient.js +182 -47
- package/dist/webvh/revokeClient.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +61 -14
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +91 -0
- package/dist/webvh/standingZcap.js.map +1 -1
- package/dist/webvh/verifyLog.d.ts +59 -5
- package/dist/webvh/verifyLog.d.ts.map +1 -1
- package/dist/webvh/verifyLog.js +76 -11
- package/dist/webvh/verifyLog.js.map +1 -1
- package/dist/webvh/wasIdStore.d.ts +8 -8
- package/dist/webvh/wasIdStore.d.ts.map +1 -1
- package/dist/webvh/wasIdStore.js +39 -14
- package/dist/webvh/wasIdStore.js.map +1 -1
- package/dist/webvh/zcap.d.ts +14 -1
- package/dist/webvh/zcap.d.ts.map +1 -1
- package/dist/webvh/zcap.js +3 -27
- package/dist/webvh/zcap.js.map +1 -1
- package/package.json +5 -5
- package/dist/webvh/keyAgreement.d.ts +0 -72
- package/dist/webvh/keyAgreement.d.ts.map +0 -1
- package/dist/webvh/keyAgreement.js +0 -47
- package/dist/webvh/keyAgreement.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plaintextCollection.d.ts","sourceRoot":"","sources":["../../src/space/plaintextCollection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEvE;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,OAAO,EACP,YAAY,EACZ,UAAU,EACX,EAAE;IACD,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB,GAAG,UAAU,CAIb"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lazy handle to one of the wallet's plaintext system collections. No I/O.
|
|
3
|
+
*
|
|
4
|
+
* @param options {object}
|
|
5
|
+
* @param options.was {WasClient} the storage client to address it through
|
|
6
|
+
* @param options.spaceId {string} the Space holding the collection
|
|
7
|
+
* @param options.collectionId {string}
|
|
8
|
+
* @param [options.capability] {IZcap} an invocation capability every request
|
|
9
|
+
* through the handle rides; absent, requests invoke the root capability
|
|
10
|
+
* @returns {Collection}
|
|
11
|
+
*/
|
|
12
|
+
export function plaintextCollection({ was, spaceId, collectionId, capability }) {
|
|
13
|
+
return was
|
|
14
|
+
.space(spaceId)
|
|
15
|
+
.collection(collectionId, { capability, encryption: 'plaintext' });
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=plaintextCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plaintextCollection.js","sourceRoot":"","sources":["../../src/space/plaintextCollection.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,GAAG,EACH,OAAO,EACP,YAAY,EACZ,UAAU,EAMX;IACC,OAAO,GAAG;SACP,KAAK,CAAC,OAAO,CAAC;SACd,UAAU,CAAC,YAAY,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAA;AACtE,CAAC"}
|
package/dist/stages.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The ceremony stage tokens more than one subpath emits, and nothing else.
|
|
6
|
+
* This module imports nothing, so any layer may take a name from it and a
|
|
7
|
+
* progress display importing one pulls in no ceremony code. A vocabulary only
|
|
8
|
+
* one subpath emits stays with that subpath (`clientAnnex/stages.ts`).
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The KMS-authentication stage, emitted at the join where a genesis waits on
|
|
12
|
+
* the binding it folds into its entry. Both genesis ceremonies emit it at
|
|
13
|
+
* that same boundary, which is why the name lives here rather than in either
|
|
14
|
+
* of them.
|
|
15
|
+
*
|
|
16
|
+
* It fires whether or not the caller supplied a thunk, since it is a stage
|
|
17
|
+
* boundary of the ceremony rather than a report that a key was minted. It
|
|
18
|
+
* marks the join and not the thunk's own completion: the KMS stage overlaps
|
|
19
|
+
* Space provisioning, and a thunk that finished first would mark out of
|
|
20
|
+
* order.
|
|
21
|
+
*/
|
|
22
|
+
export declare const KMS_AUTHENTICATION_STAGE = "kms-authentication";
|
|
23
|
+
//# sourceMappingURL=stages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stages.d.ts","sourceRoot":"","sources":["../src/stages.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,uBAAuB,CAAA"}
|
package/dist/stages.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The ceremony stage tokens more than one subpath emits, and nothing else.
|
|
6
|
+
* This module imports nothing, so any layer may take a name from it and a
|
|
7
|
+
* progress display importing one pulls in no ceremony code. A vocabulary only
|
|
8
|
+
* one subpath emits stays with that subpath (`clientAnnex/stages.ts`).
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The KMS-authentication stage, emitted at the join where a genesis waits on
|
|
12
|
+
* the binding it folds into its entry. Both genesis ceremonies emit it at
|
|
13
|
+
* that same boundary, which is why the name lives here rather than in either
|
|
14
|
+
* of them.
|
|
15
|
+
*
|
|
16
|
+
* It fires whether or not the caller supplied a thunk, since it is a stage
|
|
17
|
+
* boundary of the ceremony rather than a report that a key was minted. It
|
|
18
|
+
* marks the join and not the thunk's own completion: the KMS stage overlaps
|
|
19
|
+
* Space provisioning, and a thunk that finished first would mark out of
|
|
20
|
+
* order.
|
|
21
|
+
*/
|
|
22
|
+
export const KMS_AUTHENTICATION_STAGE = 'kms-authentication';
|
|
23
|
+
//# sourceMappingURL=stages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stages.js","sourceRoot":"","sources":["../src/stages.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAA"}
|
package/dist/sync/index.d.ts
CHANGED
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
* `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
|
|
12
12
|
* `@interop/was-client/sync` and are re-exported here so an engine consumer
|
|
13
13
|
* imports one package.
|
|
14
|
+
* - `isSyncConflictError` / `isSyncNotFoundError` / `isUnknownEpochError` are
|
|
15
|
+
* how those three signals are classified. They are raised inside the app's
|
|
16
|
+
* own injected seams, which may resolve to a second copy of
|
|
17
|
+
* `@interop/was-client`, so they are matched on `err.name`; the engine core
|
|
18
|
+
* and both apps share these predicates rather than each writing an
|
|
19
|
+
* `instanceof` that a duplicated dependency would silently defeat.
|
|
14
20
|
* - `SyncStore` / `SyncedRow` / `ProjectionAction` / `ResolveConflict` are the
|
|
15
21
|
* replica-side persistence seam.
|
|
16
22
|
* - `runPull` / `projectionForDoc`, `runPush`, and `SyncEngine` are the pull,
|
|
@@ -31,6 +37,7 @@
|
|
|
31
37
|
*/
|
|
32
38
|
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
|
|
33
39
|
export type { Json, SyncCheckpoint, WireDoc, MasterState, WasSyncPort, DocCipher } from '@interop/was-client/sync';
|
|
40
|
+
export { isSyncConflictError, isSyncNotFoundError, isUnknownEpochError } from './types.js';
|
|
34
41
|
export type { SyncStore, SyncedRow, ProjectionAction, ResolveConflict } from './types.js';
|
|
35
42
|
export { runPull, projectionForDoc } from './pull.js';
|
|
36
43
|
export { runPush, formatEtag } from './push.js';
|
package/dist/sync/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,WAAW,EACX,WAAW,EACX,SAAS,EACV,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/sync/index.js
CHANGED
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
* `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
|
|
12
12
|
* `@interop/was-client/sync` and are re-exported here so an engine consumer
|
|
13
13
|
* imports one package.
|
|
14
|
+
* - `isSyncConflictError` / `isSyncNotFoundError` / `isUnknownEpochError` are
|
|
15
|
+
* how those three signals are classified. They are raised inside the app's
|
|
16
|
+
* own injected seams, which may resolve to a second copy of
|
|
17
|
+
* `@interop/was-client`, so they are matched on `err.name`; the engine core
|
|
18
|
+
* and both apps share these predicates rather than each writing an
|
|
19
|
+
* `instanceof` that a duplicated dependency would silently defeat.
|
|
14
20
|
* - `SyncStore` / `SyncedRow` / `ProjectionAction` / `ResolveConflict` are the
|
|
15
21
|
* replica-side persistence seam.
|
|
16
22
|
* - `runPull` / `projectionForDoc`, `runPush`, and `SyncEngine` are the pull,
|
|
@@ -30,6 +36,7 @@
|
|
|
30
36
|
* `push.ts` for why the metadata half is left out of the shared core.
|
|
31
37
|
*/
|
|
32
38
|
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
|
|
39
|
+
export { isSyncConflictError, isSyncNotFoundError, isUnknownEpochError } from './types.js';
|
|
33
40
|
export { runPull, projectionForDoc } from './pull.js';
|
|
34
41
|
export { runPush, formatEtag } from './push.js';
|
|
35
42
|
export { remintPendingEnvelopes } from './remint.js';
|
package/dist/sync/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAUjC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,YAAY,CAAA;AAQnB,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAIxC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA"}
|
package/dist/sync/push.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* optional on the port for the driver that needs it.
|
|
27
27
|
*/
|
|
28
28
|
import { formatEtag } from '@interop/was-client/sync';
|
|
29
|
-
import {
|
|
29
|
+
import { isSyncConflictError, isSyncNotFoundError } from './types.js';
|
|
30
30
|
// Formats a master revision as the quoted strong ETag the server compares
|
|
31
31
|
// `If-Match` against (revision `3` becomes `"3"`). Re-exported so callers keep
|
|
32
32
|
// importing it from here.
|
|
@@ -67,7 +67,7 @@ async function pushUpsert({ port, store, row, resolveConflict }) {
|
|
|
67
67
|
return { conflictResolved: false };
|
|
68
68
|
}
|
|
69
69
|
catch (err) {
|
|
70
|
-
if (!(err
|
|
70
|
+
if (!isSyncConflictError(err)) {
|
|
71
71
|
throw err;
|
|
72
72
|
}
|
|
73
73
|
if (resolveConflict) {
|
|
@@ -116,11 +116,11 @@ async function tryDelete({ port, store, id, ifMatch, revision }) {
|
|
|
116
116
|
return true;
|
|
117
117
|
}
|
|
118
118
|
catch (err) {
|
|
119
|
-
if (err
|
|
119
|
+
if (isSyncNotFoundError(err)) {
|
|
120
120
|
await store.markDeletedPushed({ id, ...revisionAck });
|
|
121
121
|
return true;
|
|
122
122
|
}
|
|
123
|
-
if (err
|
|
123
|
+
if (isSyncConflictError(err)) {
|
|
124
124
|
return false;
|
|
125
125
|
}
|
|
126
126
|
throw err;
|
package/dist/sync/push.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/sync/push.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/sync/push.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErE,0EAA0E;AAC1E,+EAA+E;AAC/E,0BAA0B;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAA;AAErB;;;;;;;;;;;;;;;;;;GAkBG;AACH,KAAK,UAAU,UAAU,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,GAAG,EACH,eAAe,EAWhB;IACC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC;YACpC,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,IAAI;YACtB,GAAG,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC;gBACjB,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;gBACtC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;SAC3B,CAAC,CAAA;QACF,MAAM,KAAK,CAAC,UAAU,CAAC;YACrB,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,OAAO;YACP,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;SAC9D,CAAC,CAAA;QACF,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAA;IACpC,CAAC;IAAC,O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B,EAAE,CAAA;AACtC,CAAC"}
|
package/dist/sync/remint.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isUnknownEpochError } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* How many full re-mint passes are attempted before giving up. A pass that
|
|
4
4
|
* ends with skipped rows (a local write bumped a row's revision between the
|
|
@@ -75,7 +75,7 @@ export async function remintPendingEnvelopes({ store, cipher, decryptStale, sign
|
|
|
75
75
|
continue;
|
|
76
76
|
}
|
|
77
77
|
catch (err) {
|
|
78
|
-
if (!(err
|
|
78
|
+
if (!isUnknownEpochError(err)) {
|
|
79
79
|
throw err;
|
|
80
80
|
}
|
|
81
81
|
}
|
package/dist/sync/remint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remint.js","sourceRoot":"","sources":["../../src/sync/remint.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"remint.js","sourceRoot":"","sources":["../../src/sync/remint.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,KAAK,EACL,MAAM,EACN,YAAY,EACZ,MAAM,EAQP;IACC,IAAI,OAA2B,CAAA;IAC/B,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,OAAO,GAAa,EAAE,CAAA;IAE1B,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,mBAAmB,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;QAClE,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,MAAK;QACP,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,KAAK,C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O,EAAE,CAAC;gBACZ,QAAQ,IAAI,CAAC,CAAA;YACf,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;YACtB,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YAC5C,MAAK;QACP,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,yBAAyB,mBAAmB,qBAAqB;YAC/D,UAAU,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wCAAwC;YACpE,qEAAqE;YACrE,uEAAuE,CAC1E,CAAA;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAA;AAC5C,CAAC"}
|
package/dist/sync/types.d.ts
CHANGED
|
@@ -8,7 +8,18 @@
|
|
|
8
8
|
* `MasterState`, `WasSyncPort`, `DocCipher`, and the `WasSyncConflictError` /
|
|
9
9
|
* `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
|
|
10
10
|
* `@interop/was-client/sync` and are re-exported here so a single import gives
|
|
11
|
-
* a consumer both the wire types and the replica-side seams.
|
|
11
|
+
* a consumer both the wire types and the replica-side seams. Beside the three
|
|
12
|
+
* signal classes sit the three predicates that CLASSIFY them
|
|
13
|
+
* ({@link isSyncConflictError}, {@link isSyncNotFoundError},
|
|
14
|
+
* {@link isUnknownEpochError}): each is raised inside an app-injected seam --
|
|
15
|
+
* the port for the two wire signals, the caller's `DocCipher` for the third --
|
|
16
|
+
* which can resolve to a second copy of `@interop/was-client` (a `link:` dev
|
|
17
|
+
* setup, a dedupe miss through a dependency tree), so they are matched on
|
|
18
|
+
* `err.name` and never with `instanceof`. The same rule the resource-log
|
|
19
|
+
* refusal classes follow, and for the same reason: an `instanceof` miss here
|
|
20
|
+
* turns every push 412 into a fatal cycle error and makes the create-loss
|
|
21
|
+
* re-mint rethrow instead of re-minting. Every one of the three classes
|
|
22
|
+
* assigns its `name` explicitly, which is what makes the string a contract.
|
|
12
23
|
*
|
|
13
24
|
* The local-persistence seam (`SyncStore`, `SyncedRow`, `ProjectionAction`,
|
|
14
25
|
* `ResolveConflict`) is the replica's side of the contract: it stands in for a
|
|
@@ -24,6 +35,35 @@
|
|
|
24
35
|
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
|
|
25
36
|
export type { Json, SyncCheckpoint, WireDoc, MasterState, WasSyncPort, DocCipher } from '@interop/was-client/sync';
|
|
26
37
|
import type { Json, MasterState, SyncCheckpoint, WireDoc } from '@interop/was-client/sync';
|
|
38
|
+
/**
|
|
39
|
+
* Whether an error is the replication port's rejected-conditional-write signal
|
|
40
|
+
* (`WasSyncConflictError`, HTTP 412): a lost-update `If-Match` mismatch, or a
|
|
41
|
+
* create-if-absent whose target already exists. The push loop's one settle-and-
|
|
42
|
+
* reconcile branch; everything else propagates to the engine's backoff.
|
|
43
|
+
*
|
|
44
|
+
* @param err {unknown}
|
|
45
|
+
* @returns {boolean}
|
|
46
|
+
*/
|
|
47
|
+
export declare function isSyncConflictError(err: unknown): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether an error is the replication port's absent-target signal
|
|
50
|
+
* (`WasSyncNotFoundError`, HTTP 404). On a delete that is a settled outcome
|
|
51
|
+
* -- already gone, or the write never reached the server -- not a conflict.
|
|
52
|
+
*
|
|
53
|
+
* @param err {unknown}
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
export declare function isSyncNotFoundError(err: unknown): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether an error is the cipher's unknown-epoch signal (`UnknownEpochError`):
|
|
59
|
+
* an envelope naming recipient key ids whose epoch the descriptor this reader
|
|
60
|
+
* holds does not list at all. Distinct from a key the reader simply does not
|
|
61
|
+
* have (`KeyUnwrapError`), which re-reading the descriptor cannot fix.
|
|
62
|
+
*
|
|
63
|
+
* @param err {unknown}
|
|
64
|
+
* @returns {boolean}
|
|
65
|
+
*/
|
|
66
|
+
export declare function isUnknownEpochError(err: unknown): boolean;
|
|
27
67
|
/**
|
|
28
68
|
* A dirty local synced-docs row awaiting push. `data` is the stored body (the
|
|
29
69
|
* EDV envelope on an encrypted collection, or the plaintext JSON on a plaintext
|
package/dist/sync/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,WAAW,EACX,WAAW,EACX,SAAS,EACV,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EACV,IAAI,EACJ,WAAW,EACX,cAAc,EACd,OAAO,EACR,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAA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AAM,CAAA;QACV,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjB;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE;QACnB,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;QAC1B,UAAU,EAAE,gBAAgB,CAAA;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,cAAc,CAAC,CAAC,OAAO,EAAE;QACvB,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,IAAI,CAAA;QACd,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAC3B,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAClC"}
|
package/dist/sync/types.js
CHANGED
|
@@ -8,7 +8,18 @@
|
|
|
8
8
|
* `MasterState`, `WasSyncPort`, `DocCipher`, and the `WasSyncConflictError` /
|
|
9
9
|
* `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
|
|
10
10
|
* `@interop/was-client/sync` and are re-exported here so a single import gives
|
|
11
|
-
* a consumer both the wire types and the replica-side seams.
|
|
11
|
+
* a consumer both the wire types and the replica-side seams. Beside the three
|
|
12
|
+
* signal classes sit the three predicates that CLASSIFY them
|
|
13
|
+
* ({@link isSyncConflictError}, {@link isSyncNotFoundError},
|
|
14
|
+
* {@link isUnknownEpochError}): each is raised inside an app-injected seam --
|
|
15
|
+
* the port for the two wire signals, the caller's `DocCipher` for the third --
|
|
16
|
+
* which can resolve to a second copy of `@interop/was-client` (a `link:` dev
|
|
17
|
+
* setup, a dedupe miss through a dependency tree), so they are matched on
|
|
18
|
+
* `err.name` and never with `instanceof`. The same rule the resource-log
|
|
19
|
+
* refusal classes follow, and for the same reason: an `instanceof` miss here
|
|
20
|
+
* turns every push 412 into a fatal cycle error and makes the create-loss
|
|
21
|
+
* re-mint rethrow instead of re-minting. Every one of the three classes
|
|
22
|
+
* assigns its `name` explicitly, which is what makes the string a contract.
|
|
12
23
|
*
|
|
13
24
|
* The local-persistence seam (`SyncStore`, `SyncedRow`, `ProjectionAction`,
|
|
14
25
|
* `ResolveConflict`) is the replica's side of the contract: it stands in for a
|
|
@@ -22,4 +33,39 @@
|
|
|
22
33
|
* Native, against a fake port and an in-memory store.
|
|
23
34
|
*/
|
|
24
35
|
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
|
|
36
|
+
/**
|
|
37
|
+
* Whether an error is the replication port's rejected-conditional-write signal
|
|
38
|
+
* (`WasSyncConflictError`, HTTP 412): a lost-update `If-Match` mismatch, or a
|
|
39
|
+
* create-if-absent whose target already exists. The push loop's one settle-and-
|
|
40
|
+
* reconcile branch; everything else propagates to the engine's backoff.
|
|
41
|
+
*
|
|
42
|
+
* @param err {unknown}
|
|
43
|
+
* @returns {boolean}
|
|
44
|
+
*/
|
|
45
|
+
export function isSyncConflictError(err) {
|
|
46
|
+
return err?.name === 'WasSyncConflictError';
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether an error is the replication port's absent-target signal
|
|
50
|
+
* (`WasSyncNotFoundError`, HTTP 404). On a delete that is a settled outcome
|
|
51
|
+
* -- already gone, or the write never reached the server -- not a conflict.
|
|
52
|
+
*
|
|
53
|
+
* @param err {unknown}
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
export function isSyncNotFoundError(err) {
|
|
57
|
+
return err?.name === 'WasSyncNotFoundError';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Whether an error is the cipher's unknown-epoch signal (`UnknownEpochError`):
|
|
61
|
+
* an envelope naming recipient key ids whose epoch the descriptor this reader
|
|
62
|
+
* holds does not list at all. Distinct from a key the reader simply does not
|
|
63
|
+
* have (`KeyUnwrapError`), which re-reading the descriptor cannot fix.
|
|
64
|
+
*
|
|
65
|
+
* @param err {unknown}
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
export function isUnknownEpochError(err) {
|
|
69
|
+
return err?.name === 'UnknownEpochError';
|
|
70
|
+
}
|
|
25
71
|
//# sourceMappingURL=types.js.map
|
package/dist/sync/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAiBjC;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,OAAQ,GAAiC,EAAE,IAAI,KAAK,sBAAsB,CAAA;AAC5E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,OAAQ,GAAiC,EAAE,IAAI,KAAK,sBAAsB,CAAA;AAC5E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,OAAQ,GAAiC,EAAE,IAAI,KAAK,mBAAmB,CAAA;AACzE,CAAC"}
|
package/dist/unlock/index.d.ts
CHANGED
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
* - `retireUnlockCredential` -- the retirement ceremony behind "change my
|
|
23
23
|
* passphrase" and "remove this passkey": the inventory edit, then the shared
|
|
24
24
|
* roster rotation and collection fan-out off the retired credential's wrap.
|
|
25
|
+
* It refuses (`UnclaimedLadderVmRetirementError`) when the ladder
|
|
26
|
+
* attribution cannot claim the retired credential's ladder VM;
|
|
27
|
+
* `preflightUnlockCredentialRetirement` runs that gate read-only, before a
|
|
28
|
+
* caller establishes anything.
|
|
25
29
|
*
|
|
26
30
|
* The ladder itself, and every ceremony that exercises it (the ladder-anchored
|
|
27
31
|
* genesis, self-enrollment, the forget ceremony), live in
|
|
@@ -35,8 +39,8 @@ export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentit
|
|
|
35
39
|
export type { StandingUnlockClient, UnlockClientIdentity } from './standingClient.js';
|
|
36
40
|
export { computeUnlockBinding, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
|
|
37
41
|
export type { SealedRecordMember, SignedUnlockRecord, UnlockRecordContents, UnlockRecordProofState } from './unlockRecord.js';
|
|
38
|
-
export { publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
39
|
-
export type { StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
|
|
42
|
+
export { assertLadderVmClaimed, LadderInventoryDriftError, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
43
|
+
export type { LadderVmRemovalReport, StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
|
|
40
44
|
export { retireUnlockCredential } from './retire.js';
|
|
41
45
|
export type { ClientAnnexInventoryRetirement, UnlockCredentialRetirementResult } from './retire.js';
|
|
42
46
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,aAAa,CAAA"}
|
package/dist/unlock/index.js
CHANGED
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
* - `retireUnlockCredential` -- the retirement ceremony behind "change my
|
|
23
23
|
* passphrase" and "remove this passkey": the inventory edit, then the shared
|
|
24
24
|
* roster rotation and collection fan-out off the retired credential's wrap.
|
|
25
|
+
* It refuses (`UnclaimedLadderVmRetirementError`) when the ladder
|
|
26
|
+
* attribution cannot claim the retired credential's ladder VM;
|
|
27
|
+
* `preflightUnlockCredentialRetirement` runs that gate read-only, before a
|
|
28
|
+
* caller establishes anything.
|
|
25
29
|
*
|
|
26
30
|
* The ladder itself, and every ceremony that exercises it (the ladder-anchored
|
|
27
31
|
* genesis, self-enrollment, the forget ceremony), live in
|
|
@@ -33,6 +37,6 @@
|
|
|
33
37
|
*/
|
|
34
38
|
export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentityFromSeed } from './standingClient.js';
|
|
35
39
|
export { computeUnlockBinding, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
|
|
36
|
-
export { publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
40
|
+
export { assertLadderVmClaimed, LadderInventoryDriftError, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
37
41
|
export { retireUnlockCredential } from './retire.js';
|
|
38
42
|
//# sourceMappingURL=index.js.map
|
package/dist/unlock/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAQ3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/unlock/retire.d.ts
CHANGED
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
* inventory in the account's did:webvh document -- so retiring one is a real
|
|
10
10
|
* rotation, on the same stages the client-revocation cascade runs.
|
|
11
11
|
*
|
|
12
|
+
* 0. **The dependent-record re-mint** (the injected `remintDependentRecords`
|
|
13
|
+
* closure), against the PRE-edit document: the credential's ladder VM is
|
|
14
|
+
* about to be struck, and a struck VM rots every record and bridge
|
|
15
|
+
* delegation it signed for OTHER credentials -- the last-client transition
|
|
16
|
+
* signs siblings' records with one, and `currentAccountRecordSigners`
|
|
17
|
+
* accepts it. The stage names the doomed VM ids to the pass, which
|
|
18
|
+
* re-signs those records under a key that outlives the edit.
|
|
12
19
|
* 1. **The document inventory edit** (`removeUnlockKey`): the credential's
|
|
13
20
|
* `keyAgreement` entry (verbatim key or commitment) and its committed
|
|
14
21
|
* update-key hash leave the document in one log entry. That kills the
|
|
@@ -29,11 +36,21 @@
|
|
|
29
36
|
* inventory still standing would simply re-escrow the credential and look
|
|
30
37
|
* healthy.
|
|
31
38
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* the
|
|
36
|
-
* credential's
|
|
39
|
+
* Stage 0 is the one stage that runs BEFORE the edit, and its placement is
|
|
40
|
+
* the point. Run after the edit it would leave a window in which every
|
|
41
|
+
* sibling credential's record is unverifiable, and a run torn there bricks
|
|
42
|
+
* exactly what the stage exists to protect: a record whose frame proof names
|
|
43
|
+
* a struck key refuses before decryption, and the credential's own login dies
|
|
44
|
+
* at that check with no repair arm. Run before it, a tear leaves the sibling
|
|
45
|
+
* records signed by a key that still stands and the retiring credential still
|
|
46
|
+
* standing -- the correct resting state, converged by a re-run. So the stage
|
|
47
|
+
* is fail-closed rather than best-effort: a throw from the closure aborts the
|
|
48
|
+
* retirement before anything is published, unlike the annex closure at 1b.
|
|
49
|
+
*
|
|
50
|
+
* That corrects what this module used to reason. A retired credential's own
|
|
51
|
+
* bridge delegation does die with its unlock Space, which the app deletes as
|
|
52
|
+
* part of the change-method ceremony. Its ladder VM is the part that reaches
|
|
53
|
+
* further: other credentials' records and bridges chain through it.
|
|
37
54
|
*
|
|
38
55
|
* The client annex reach is its own stage (1b, the injected
|
|
39
56
|
* `retireClientAnnexInventory` closure), between the document edit and the
|
|
@@ -54,6 +71,30 @@
|
|
|
54
71
|
* skip, so the roster rotation -- the ceremony's essential remedy -- always
|
|
55
72
|
* runs.
|
|
56
73
|
*
|
|
74
|
+
* Both stages carry the retirement gate (`decisions/0015`): a credential
|
|
75
|
+
* retired here carries a ladder, so its ladder VM must be claimed -- by the
|
|
76
|
+
* seed, or by the log's attribution -- before the edit strikes anything. A
|
|
77
|
+
* claim that strikes nothing while ladder VMs stand unclaimed refuses with
|
|
78
|
+
* `UnclaimedLadderVmRetirementError`, at stage 0 before the re-mint pass
|
|
79
|
+
* writes a sibling record and again inside the edit before its entry
|
|
80
|
+
* publishes, so the credential still stands and the log is unchanged. The
|
|
81
|
+
* leftover the gate closes is a retired credential's VM standing under
|
|
82
|
+
* `capabilityDelegation`, which could still sign a DELETE-only capability on
|
|
83
|
+
* the account Space. Callers that establish a replacement before retiring
|
|
84
|
+
* run `preflightUnlockCredentialRetirement` first, so the refusal lands
|
|
85
|
+
* before establishment rather than in a torn state. The recovery-code
|
|
86
|
+
* removal shares the edit but not the gate: a code carries no ladder VM to
|
|
87
|
+
* claim.
|
|
88
|
+
*
|
|
89
|
+
* Stage 0 and stage 1 each read the log for themselves, and the two reads are
|
|
90
|
+
* tied by a cross-check rather than by luck: stage 0 hands its attributed
|
|
91
|
+
* ladder VM ids to the edit as `expectedLadderVmIds`, and the edit refuses
|
|
92
|
+
* before writing when its own attribution resolves a different set
|
|
93
|
+
* (`LadderInventoryDriftError`). So a concurrent ceremony, or a host serving
|
|
94
|
+
* different log versions to the two reads, cannot leave the strike diverging
|
|
95
|
+
* from what the re-mint pass acted on. Both reads take the caller's
|
|
96
|
+
* `pinStore` and `logId`, so both are checked against the same chain head.
|
|
97
|
+
*
|
|
57
98
|
* Convergence is the design: every stage detects its own completion from
|
|
58
99
|
* durable state alone -- the inventory edit no-ops when the document is already
|
|
59
100
|
* settled, the rotation no-ops once every current-epoch recipient is
|
|
@@ -70,24 +111,32 @@ import type { IKeyAgreementKey } from '@interop/data-integrity-core';
|
|
|
70
111
|
import type { CollectionEncryption } from '@interop/was-client';
|
|
71
112
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
|
|
72
113
|
import { type CascadeCollections, type RosterSealReport, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
73
|
-
import type {
|
|
74
|
-
import {
|
|
114
|
+
import type { WebvhIdStore } from '../webvh/index.js';
|
|
115
|
+
import type { AccountLogSigner } from '../webvh/accountEntry.js';
|
|
116
|
+
import type { ResourceLogPinStore } from '@interop/vh-resource-log';
|
|
117
|
+
import { type LadderVmRemovalReport, type StandingUnlockKeys } from './standingWebvh.js';
|
|
75
118
|
/**
|
|
76
119
|
* What a completed retirement reports: whether the roster actually rotated on
|
|
77
120
|
* this run (a re-run of an already-complete retirement reports `false`), the
|
|
78
121
|
* roster's seal-backstop report (present when the roster store is sealable and
|
|
79
122
|
* the roster stage ran), the per-collection fan-out result, the document as
|
|
80
|
-
* the inventory edit left it,
|
|
81
|
-
* was read from
|
|
123
|
+
* the inventory edit left it, the rotated key with the roster descriptor it
|
|
124
|
+
* was read from, whatever the dependent-record re-mint pass returned
|
|
125
|
+
* (`dependentRecords`, absent when no closure was supplied), and the
|
|
126
|
+
* inventory edit's ladder VM report (`ladderVm`: what the edit struck, and
|
|
127
|
+
* what stands unclaimed after it -- a seedless strike that claimed nothing
|
|
128
|
+
* reports its credential's VM there rather than reading as clean).
|
|
82
129
|
*/
|
|
83
130
|
export interface UnlockCredentialRetirementResult {
|
|
84
131
|
rotated: boolean;
|
|
132
|
+
ladderVm: LadderVmRemovalReport;
|
|
85
133
|
rosterSeal?: RosterSealReport;
|
|
86
134
|
collections: UserKeyCascadeResult;
|
|
87
135
|
document: object;
|
|
88
136
|
userKey?: UserKey;
|
|
89
137
|
rosterDescriptor?: CollectionEncryption;
|
|
90
138
|
clientAnnex?: ClientAnnexInventoryRetirement;
|
|
139
|
+
dependentRecords?: unknown;
|
|
91
140
|
}
|
|
92
141
|
/**
|
|
93
142
|
* What the annex-inventory stage reports: `struck` (a strike entry dropped
|
|
@@ -110,18 +159,34 @@ export interface ClientAnnexInventoryRetirement {
|
|
|
110
159
|
*
|
|
111
160
|
* @param options {object}
|
|
112
161
|
* @param options.idStore {WebvhIdStore} the account's `id` collection store
|
|
113
|
-
* @param options.
|
|
114
|
-
* client's own did:webvh update-key seeds,
|
|
162
|
+
* @param options.signer {AccountLogSigner} who signs the inventory edit:
|
|
163
|
+
* the retiring enrolled client's own did:webvh update-key seeds, or the
|
|
164
|
+
* ACTING (surviving or successor) credential's ladder seed
|
|
115
165
|
* @param options.unlockKeys {StandingUnlockKeys} the retired credential's
|
|
116
166
|
* public inventory (its key-agreement publication and its recorded update
|
|
117
167
|
* key, which the inventory edit treats as a ladder anchor rather than truth
|
|
118
168
|
* -- see `removeUnlockKey`)
|
|
119
169
|
* @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
|
|
120
170
|
* seed, when the ceremony holds the credential's secret; it strengthens the
|
|
121
|
-
* ladder attribution
|
|
171
|
+
* ladder attribution, and it is what a retry supplies after a seedless run
|
|
172
|
+
* refused with `UnclaimedLadderVmRetirementError`
|
|
173
|
+
* @param [options.projectionStore] {object} an `id`-collection store the
|
|
174
|
+
* caller may write through, passed straight to the inventory edit: the
|
|
175
|
+
* post-strike `did:web` projection is PUT through it immediately before
|
|
176
|
+
* that entry publishes, so a ladder-signed retirement does not leave
|
|
177
|
+
* `did.json` naming the retired credential. Best-effort, and omitted the
|
|
178
|
+
* behavior is unchanged (see `removeUnlockKey`)
|
|
122
179
|
* @param [options.expectedDid] {string} the account DID from the caller's
|
|
123
180
|
* stored account pointer; supplied, the inventory edit refuses a `did.jsonl`
|
|
124
181
|
* resolving to any other account
|
|
182
|
+
* @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
|
|
183
|
+
* pins, threaded to BOTH account-log reads the ceremony makes -- stage 0's
|
|
184
|
+
* attribution read and the inventory edit's own read inside its
|
|
185
|
+
* conflict-retry loop -- so a served rollback or fork is refused before
|
|
186
|
+
* anything is published
|
|
187
|
+
* @param [options.logId] {string} the account log's pin slot
|
|
188
|
+
* (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
|
|
189
|
+
* supplied
|
|
125
190
|
* @param [options.verb] {string} what the caller is doing, for the
|
|
126
191
|
* pending-rotation refusal message (e.g. `'changing your passphrase'`)
|
|
127
192
|
* @param options.rosterStore {EncryptionDescriptorStore} the
|
|
@@ -135,6 +200,15 @@ export interface ClientAnnexInventoryRetirement {
|
|
|
135
200
|
* called with `{ userKey, latestEpochId, descriptor }` after the roster read
|
|
136
201
|
* and BEFORE the fan-out. The key and the epoch pin must persist atomically
|
|
137
202
|
* @param options.collections {CascadeCollections} the fan-out's work
|
|
203
|
+
* @param [options.remintDependentRecords] {Function} `({ document,
|
|
204
|
+
* retiringKeyMultibases }) => Promise<unknown>` -- the dependent-record
|
|
205
|
+
* re-mint (stage 0), run against the PRE-edit document with the ladder VM
|
|
206
|
+
* ids this retirement is about to strike. Fail-closed: a throw aborts the
|
|
207
|
+
* retirement before the document edit. Absent, the stage is skipped and no
|
|
208
|
+
* log read happens for it (the no-WAS path). It is also skipped on the
|
|
209
|
+
* ladder arm: every unlock record is signed by its own credential's ladder
|
|
210
|
+
* VM, so this strike rots no sibling record, and there is nothing to
|
|
211
|
+
* re-mint (`decisions/0019`)
|
|
138
212
|
* @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
|
|
139
213
|
* Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
|
|
140
214
|
* the module doc), run against the post-edit document; a throw is caught
|
|
@@ -144,12 +218,15 @@ export interface ClientAnnexInventoryRetirement {
|
|
|
144
218
|
* the session keeps operating without a re-login
|
|
145
219
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
146
220
|
*/
|
|
147
|
-
export declare function retireUnlockCredential({ idStore,
|
|
221
|
+
export declare function retireUnlockCredential({ idStore, signer, unlockKeys, ladderSeed, projectionStore, expectedDid, pinStore, logId, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintDependentRecords, retireClientAnnexInventory, onRotationAdopted }: {
|
|
148
222
|
idStore: WebvhIdStore;
|
|
149
|
-
|
|
223
|
+
signer: AccountLogSigner;
|
|
150
224
|
unlockKeys: StandingUnlockKeys;
|
|
151
225
|
ladderSeed?: Uint8Array;
|
|
226
|
+
projectionStore?: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
|
|
152
227
|
expectedDid?: string;
|
|
228
|
+
pinStore?: ResourceLogPinStore;
|
|
229
|
+
logId?: string;
|
|
153
230
|
verb?: string;
|
|
154
231
|
rosterStore: EncryptionDescriptorStore;
|
|
155
232
|
userKey?: UserKey;
|
|
@@ -161,6 +238,10 @@ export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys
|
|
|
161
238
|
descriptor: CollectionEncryption;
|
|
162
239
|
}) => Promise<void>;
|
|
163
240
|
collections: CascadeCollections;
|
|
241
|
+
remintDependentRecords?: (options: {
|
|
242
|
+
document: object;
|
|
243
|
+
retiringKeyMultibases: string[];
|
|
244
|
+
}) => Promise<unknown>;
|
|
164
245
|
retireClientAnnexInventory?: (options: {
|
|
165
246
|
document: object;
|
|
166
247
|
}) => Promise<ClientAnnexInventoryRetirement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;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,yBAAyB,CAAA;AACxE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,OAAO,EAML,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,8BAA8B,CAAA;IA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