@interop/wallet-core 0.66.0 → 0.67.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.
Files changed (241) hide show
  1. package/README.md +12 -8
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +5 -4
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +32 -50
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +46 -18
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +112 -65
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts.map +1 -1
  11. package/dist/clientAnnex/forget.js +5 -6
  12. package/dist/clientAnnex/forget.js.map +1 -1
  13. package/dist/clientAnnex/forgetLast.d.ts +26 -113
  14. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  15. package/dist/clientAnnex/forgetLast.js +26 -150
  16. package/dist/clientAnnex/forgetLast.js.map +1 -1
  17. package/dist/clientAnnex/heal.d.ts +79 -13
  18. package/dist/clientAnnex/heal.d.ts.map +1 -1
  19. package/dist/clientAnnex/heal.js +67 -122
  20. package/dist/clientAnnex/heal.js.map +1 -1
  21. package/dist/clientAnnex/index.d.ts +6 -6
  22. package/dist/clientAnnex/index.d.ts.map +1 -1
  23. package/dist/clientAnnex/index.js +4 -4
  24. package/dist/clientAnnex/index.js.map +1 -1
  25. package/dist/clientAnnex/ladder.d.ts +51 -4
  26. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  27. package/dist/clientAnnex/ladder.js +283 -47
  28. package/dist/clientAnnex/ladder.js.map +1 -1
  29. package/dist/clientAnnex/ladderAnchored.d.ts +37 -3
  30. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  31. package/dist/clientAnnex/ladderAnchored.js +69 -34
  32. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  33. package/dist/clientAnnex/log.d.ts +68 -57
  34. package/dist/clientAnnex/log.d.ts.map +1 -1
  35. package/dist/clientAnnex/log.js +96 -126
  36. package/dist/clientAnnex/log.js.map +1 -1
  37. package/dist/clientAnnex/mend.js +44 -20
  38. package/dist/clientAnnex/mend.js.map +1 -1
  39. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +20 -1
  40. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  41. package/dist/clientAnnex/recoveryLadderAnchored.js +77 -294
  42. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  43. package/dist/clientAnnex/rosterDeliveredEpochs.d.ts +13 -5
  44. package/dist/clientAnnex/rosterDeliveredEpochs.d.ts.map +1 -1
  45. package/dist/clientAnnex/rosterDeliveredEpochs.js +18 -9
  46. package/dist/clientAnnex/rosterDeliveredEpochs.js.map +1 -1
  47. package/dist/clientAnnex/selfEnroll.js +1 -1
  48. package/dist/clientAnnex/selfEnroll.js.map +1 -1
  49. package/dist/clientAnnex/zcap.d.ts +19 -0
  50. package/dist/clientAnnex/zcap.d.ts.map +1 -1
  51. package/dist/clientAnnex/zcap.js +80 -12
  52. package/dist/clientAnnex/zcap.js.map +1 -1
  53. package/dist/clients/index.d.ts +3 -2
  54. package/dist/clients/index.d.ts.map +1 -1
  55. package/dist/clients/index.js +3 -2
  56. package/dist/clients/index.js.map +1 -1
  57. package/dist/clients/listing.d.ts.map +1 -1
  58. package/dist/clients/listing.js +33 -15
  59. package/dist/clients/listing.js.map +1 -1
  60. package/dist/clients/policy.d.ts +18 -0
  61. package/dist/clients/policy.d.ts.map +1 -1
  62. package/dist/clients/policy.js +22 -8
  63. package/dist/clients/policy.js.map +1 -1
  64. package/dist/clients/revocation.d.ts +18 -30
  65. package/dist/clients/revocation.d.ts.map +1 -1
  66. package/dist/clients/revocation.js +12 -27
  67. package/dist/clients/revocation.js.map +1 -1
  68. package/dist/clients/rosterPolicy.d.ts +6 -1
  69. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  70. package/dist/clients/rosterPolicy.js +27 -30
  71. package/dist/clients/rosterPolicy.js.map +1 -1
  72. package/dist/descriptors/errors.d.ts +6 -5
  73. package/dist/descriptors/errors.d.ts.map +1 -1
  74. package/dist/descriptors/errors.js +6 -5
  75. package/dist/descriptors/errors.js.map +1 -1
  76. package/dist/descriptors/index.d.ts +7 -3
  77. package/dist/descriptors/index.d.ts.map +1 -1
  78. package/dist/descriptors/index.js +7 -3
  79. package/dist/descriptors/index.js.map +1 -1
  80. package/dist/descriptors/logSource.d.ts +28 -6
  81. package/dist/descriptors/logSource.d.ts.map +1 -1
  82. package/dist/descriptors/logSource.js +33 -7
  83. package/dist/descriptors/logSource.js.map +1 -1
  84. package/dist/enrollment/enrollment.d.ts.map +1 -1
  85. package/dist/enrollment/enrollment.js +3 -7
  86. package/dist/enrollment/enrollment.js.map +1 -1
  87. package/dist/genesis/accountGenesis.d.ts +8 -10
  88. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  89. package/dist/genesis/accountGenesis.js +39 -41
  90. package/dist/genesis/accountGenesis.js.map +1 -1
  91. package/dist/genesis/kmsAuthentication.d.ts +50 -0
  92. package/dist/genesis/kmsAuthentication.d.ts.map +1 -0
  93. package/dist/genesis/kmsAuthentication.js +49 -0
  94. package/dist/genesis/kmsAuthentication.js.map +1 -0
  95. package/dist/keyring/kdf.d.ts +16 -20
  96. package/dist/keyring/kdf.d.ts.map +1 -1
  97. package/dist/keyring/kdf.js +2 -2
  98. package/dist/keyring/kdf.js.map +1 -1
  99. package/dist/keyring/unlockSpace.d.ts +8 -30
  100. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  101. package/dist/keyring/unlockSpace.js +8 -31
  102. package/dist/keyring/unlockSpace.js.map +1 -1
  103. package/dist/keys/clientKeyRecord.d.ts +2 -1
  104. package/dist/keys/clientKeyRecord.d.ts.map +1 -1
  105. package/dist/keys/clientKeyRecord.js +28 -11
  106. package/dist/keys/clientKeyRecord.js.map +1 -1
  107. package/dist/keys/index.d.ts +6 -2
  108. package/dist/keys/index.d.ts.map +1 -1
  109. package/dist/keys/index.js +5 -1
  110. package/dist/keys/index.js.map +1 -1
  111. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  112. package/dist/keys/rosterLogStore.js +14 -5
  113. package/dist/keys/rosterLogStore.js.map +1 -1
  114. package/dist/keys/spaceEpochs.d.ts +92 -3
  115. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  116. package/dist/keys/spaceEpochs.js +110 -4
  117. package/dist/keys/spaceEpochs.js.map +1 -1
  118. package/dist/keys/userKeyRoster.d.ts +30 -3
  119. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  120. package/dist/keys/userKeyRoster.js +90 -15
  121. package/dist/keys/userKeyRoster.js.map +1 -1
  122. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  123. package/dist/keys/userKeyRosterCascade.js +5 -1
  124. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  125. package/dist/recovery/continuation.d.ts +255 -0
  126. package/dist/recovery/continuation.d.ts.map +1 -0
  127. package/dist/recovery/continuation.js +471 -0
  128. package/dist/recovery/continuation.js.map +1 -0
  129. package/dist/recovery/index.d.ts +12 -8
  130. package/dist/recovery/index.d.ts.map +1 -1
  131. package/dist/recovery/index.js +11 -7
  132. package/dist/recovery/index.js.map +1 -1
  133. package/dist/recovery/recoveryDelegation.d.ts +23 -126
  134. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  135. package/dist/recovery/recoveryDelegation.js +1 -266
  136. package/dist/recovery/recoveryDelegation.js.map +1 -1
  137. package/dist/recovery/recoveryWebvh.d.ts +42 -83
  138. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  139. package/dist/recovery/recoveryWebvh.js +44 -380
  140. package/dist/recovery/recoveryWebvh.js.map +1 -1
  141. package/dist/request/classify.d.ts +3 -14
  142. package/dist/request/classify.d.ts.map +1 -1
  143. package/dist/request/classify.js +19 -40
  144. package/dist/request/classify.js.map +1 -1
  145. package/dist/request/index.d.ts +1 -0
  146. package/dist/request/index.d.ts.map +1 -1
  147. package/dist/request/index.js +1 -0
  148. package/dist/request/index.js.map +1 -1
  149. package/dist/request/onboarding.d.ts.map +1 -1
  150. package/dist/request/onboarding.js +19 -27
  151. package/dist/request/onboarding.js.map +1 -1
  152. package/dist/request/parse.d.ts +5 -3
  153. package/dist/request/parse.d.ts.map +1 -1
  154. package/dist/request/parse.js +7 -6
  155. package/dist/request/parse.js.map +1 -1
  156. package/dist/request/processRequest.d.ts.map +1 -1
  157. package/dist/request/processRequest.js +2 -1
  158. package/dist/request/processRequest.js.map +1 -1
  159. package/dist/request/queryPredicates.d.ts +98 -0
  160. package/dist/request/queryPredicates.d.ts.map +1 -0
  161. package/dist/request/queryPredicates.js +107 -0
  162. package/dist/request/queryPredicates.js.map +1 -0
  163. package/dist/resourceLog/document.d.ts +39 -0
  164. package/dist/resourceLog/document.d.ts.map +1 -1
  165. package/dist/resourceLog/document.js +41 -0
  166. package/dist/resourceLog/document.js.map +1 -1
  167. package/dist/resourceLog/ladderRungs.d.ts.map +1 -1
  168. package/dist/resourceLog/ladderRungs.js +3 -2
  169. package/dist/resourceLog/ladderRungs.js.map +1 -1
  170. package/dist/sync/contactsConflict.d.ts.map +1 -1
  171. package/dist/sync/contactsConflict.js +8 -2
  172. package/dist/sync/contactsConflict.js.map +1 -1
  173. package/dist/sync/engine.d.ts +38 -23
  174. package/dist/sync/engine.d.ts.map +1 -1
  175. package/dist/sync/engine.js +36 -5
  176. package/dist/sync/engine.js.map +1 -1
  177. package/dist/sync/index.d.ts +9 -12
  178. package/dist/sync/index.d.ts.map +1 -1
  179. package/dist/sync/index.js +8 -11
  180. package/dist/sync/index.js.map +1 -1
  181. package/dist/sync/push.d.ts.map +1 -1
  182. package/dist/sync/push.js +1 -2
  183. package/dist/sync/push.js.map +1 -1
  184. package/dist/sync/remint.d.ts +0 -31
  185. package/dist/sync/remint.d.ts.map +1 -1
  186. package/dist/sync/remint.js +32 -1
  187. package/dist/sync/remint.js.map +1 -1
  188. package/dist/sync/types.d.ts +4 -41
  189. package/dist/sync/types.d.ts.map +1 -1
  190. package/dist/sync/types.js +4 -47
  191. package/dist/sync/types.js.map +1 -1
  192. package/dist/unlock/index.d.ts +1 -1
  193. package/dist/unlock/index.d.ts.map +1 -1
  194. package/dist/unlock/index.js +1 -1
  195. package/dist/unlock/index.js.map +1 -1
  196. package/dist/unlock/retire.d.ts +16 -56
  197. package/dist/unlock/retire.d.ts.map +1 -1
  198. package/dist/unlock/retire.js +7 -76
  199. package/dist/unlock/retire.js.map +1 -1
  200. package/dist/unlock/standingWebvh.d.ts +20 -40
  201. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  202. package/dist/unlock/standingWebvh.js +35 -76
  203. package/dist/unlock/standingWebvh.js.map +1 -1
  204. package/dist/unlock/unlockRecord.d.ts.map +1 -1
  205. package/dist/unlock/unlockRecord.js +69 -44
  206. package/dist/unlock/unlockRecord.js.map +1 -1
  207. package/dist/webvh/accountEntry.d.ts +63 -7
  208. package/dist/webvh/accountEntry.d.ts.map +1 -1
  209. package/dist/webvh/accountEntry.js +110 -19
  210. package/dist/webvh/accountEntry.js.map +1 -1
  211. package/dist/webvh/delegatedLogStore.d.ts +18 -12
  212. package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
  213. package/dist/webvh/delegatedLogStore.js +32 -11
  214. package/dist/webvh/delegatedLogStore.js.map +1 -1
  215. package/dist/webvh/didWebvh.d.ts +39 -23
  216. package/dist/webvh/didWebvh.d.ts.map +1 -1
  217. package/dist/webvh/didWebvh.js +63 -45
  218. package/dist/webvh/didWebvh.js.map +1 -1
  219. package/dist/webvh/enrollClient.d.ts.map +1 -1
  220. package/dist/webvh/enrollClient.js +19 -23
  221. package/dist/webvh/enrollClient.js.map +1 -1
  222. package/dist/webvh/index.d.ts +11 -7
  223. package/dist/webvh/index.d.ts.map +1 -1
  224. package/dist/webvh/index.js +9 -6
  225. package/dist/webvh/index.js.map +1 -1
  226. package/dist/webvh/listClients.d.ts.map +1 -1
  227. package/dist/webvh/listClients.js +102 -65
  228. package/dist/webvh/listClients.js.map +1 -1
  229. package/dist/webvh/mergeMethods.d.ts +84 -0
  230. package/dist/webvh/mergeMethods.d.ts.map +1 -0
  231. package/dist/webvh/mergeMethods.js +46 -0
  232. package/dist/webvh/mergeMethods.js.map +1 -0
  233. package/dist/webvh/revokeClient.d.ts +12 -2
  234. package/dist/webvh/revokeClient.d.ts.map +1 -1
  235. package/dist/webvh/revokeClient.js +126 -48
  236. package/dist/webvh/revokeClient.js.map +1 -1
  237. package/dist/webvh/verifyLog.d.ts +21 -0
  238. package/dist/webvh/verifyLog.d.ts.map +1 -1
  239. package/dist/webvh/verifyLog.js +36 -14
  240. package/dist/webvh/verifyLog.js.map +1 -1
  241. package/package.json +11 -11
@@ -0,0 +1,255 @@
1
+ import type { DIDDoc, DIDLog, ServiceEndpoint, VerificationMethod } from '@interop/did-method-webvh';
2
+ import type { ResourceLogPinStore } from '@interop/vh-resource-log';
3
+ import type { WebvhIdStore } from '../webvh/didWebvh.js';
4
+ import type { RelationMembership } from '../webvh/mergeMethods.js';
5
+ /**
6
+ * What the add-and-retire entry retired, read back OFF THE LOG -- the resumed
7
+ * spend's answer to the same question the live run answers from the document
8
+ * it is editing. A run torn after that entry but before the caller's registry
9
+ * and unlock-Space teardown resumes into the already-complete branch, and
10
+ * without this it would be told nothing was retired and leave every other
11
+ * credential's registry entry standing.
12
+ *
13
+ * The entry is located by its own signature on the log: it is the first entry
14
+ * whose effective `updateKeys` authorize the successor key (the fresh
15
+ * ladder's rung 0 on the transient continuation, the new client's update key
16
+ * on the remembered one), which only that entry writes. What it retired is
17
+ * then the credential-class `keyAgreement` ids its predecessor published and
18
+ * it does not, less the spent code's own id -- the same exclusion the live
19
+ * branch makes, since the caller retires that one by name.
20
+ *
21
+ * @param options {object}
22
+ * @param options.log {DIDLog} the verified account log
23
+ * @param options.did {string} the account DID the log resolves to
24
+ * @param options.successorKeyMultibase {string} the update key only the
25
+ * add-and-retire entry authorizes
26
+ * @param options.spentVmId {string} the spent code's key-agreement
27
+ * verification-method id, excluded from the result
28
+ * @returns {string[]} the retired credentials' key-agreement ids, empty
29
+ * when no entry authorizes the successor key or it is the genesis entry
30
+ */
31
+ export declare function retiredCredentialVmIdsFromLog({ log, did, successorKeyMultibase, spentVmId }: {
32
+ log: DIDLog;
33
+ did: string;
34
+ successorKeyMultibase: string;
35
+ spentVmId: string;
36
+ }): string[];
37
+ /**
38
+ * What a recovery spend retired, the three members both continuations
39
+ * report: the credential-class `keyAgreement` ids the add-and-retire entry
40
+ * struck for pre-recovery credentials OTHER than the spent code (what a
41
+ * caller drops registry entries and deletes unlock Spaces for), the rung
42
+ * hashes the entry struck, and the retired credentials whose rungs the log
43
+ * could not attribute -- each of which keeps a committed rung it could still
44
+ * reveal, and is left for the caller to report rather than struck.
45
+ */
46
+ export interface RecoverySpendRetirement {
47
+ retiredCredentialVmIds: string[];
48
+ struckRungHashes: string[];
49
+ unclaimedCredentialVmIds: string[];
50
+ }
51
+ /**
52
+ * The retirement report of a spend whose add-and-retire entry already
53
+ * stands, read back off the log: the same three members the continuation
54
+ * returns, derived the way its completed branch derives them, so a resume
55
+ * that holds only the successor's public halves (a remembered spend's pending
56
+ * client-key record, say) reports exactly what the first run reported rather
57
+ * than a second definition of the same question.
58
+ *
59
+ * The entry is located by the successor key it authorized
60
+ * ({@link retiredCredentialVmIdsFromLog}), and the strike is recomputed over
61
+ * the log as it stood just before that entry with the same protected sets the
62
+ * first run used: the successor key and its staged partner, and the
63
+ * replacement code's rung 0. A log that does not authorize the successor key
64
+ * (the entry never landed) reports nothing retired, since there is no entry to
65
+ * read back.
66
+ *
67
+ * @param options {object}
68
+ * @param options.log {DIDLog} the verified account log
69
+ * @param options.did {string} the account DID the log resolves to
70
+ * @param options.successor {object} the public halves of the key the entry
71
+ * authorized (`updateKeyMultibase`) and the staged partner whose hash the
72
+ * reveal entry committed after it (`stagedKeyMultibase`)
73
+ * @param options.replacementUpdateKeyMultibase {string} the replacement
74
+ * code's rung-0 update key
75
+ * @param options.spentKeyAgreementKeyMultibase {string} the spent code's
76
+ * key-agreement key, excluded from the retired set
77
+ * @returns {Promise<RecoverySpendRetirement>}
78
+ */
79
+ export declare function recoverySpendRetirementFromLog({ log, did, successor, replacementUpdateKeyMultibase, spentKeyAgreementKeyMultibase }: {
80
+ log: DIDLog;
81
+ did: string;
82
+ successor: {
83
+ updateKeyMultibase: string;
84
+ stagedKeyMultibase: string;
85
+ };
86
+ replacementUpdateKeyMultibase: string;
87
+ spentKeyAgreementKeyMultibase: string;
88
+ }): Promise<RecoverySpendRetirement>;
89
+ /**
90
+ * The verification-method id a code's key-agreement key publishes under --
91
+ * the ordinary `<did>#<multibase>` form, indistinguishable by id from any
92
+ * other keyAgreement entry. Consumers that must exclude recovery entries do
93
+ * it structurally (an enrolled client is a `capabilityInvocation` entry; a
94
+ * recovery key never has one) or by the registry's recorded multibase.
95
+ *
96
+ * @param options {object}
97
+ * @param options.did {string} the account's did:webvh
98
+ * @param options.keyAgreementKeyMultibase {string}
99
+ * @returns {string}
100
+ */
101
+ export declare function recoveryVmId({ did, keyAgreementKeyMultibase }: {
102
+ did: string;
103
+ keyAgreementKeyMultibase: string;
104
+ }): string;
105
+ /**
106
+ * The public halves of a recovery code as the document and log carry them:
107
+ * the X25519 key-agreement key published as the recovery VM, and the update
108
+ * key whose hash stands in `nextKeyHashes`.
109
+ */
110
+ export interface RecoveryPublicKeys {
111
+ keyAgreementKeyMultibase: string;
112
+ updateKeyMultibase: string;
113
+ }
114
+ /**
115
+ * The public halves a SPEND needs of the replacement code it publishes: the
116
+ * two above plus the code's ladder VM key, which the add-and-retire entry
117
+ * installs under `assertionMethod` and `capabilityDelegation`. A code is a
118
+ * standing unlock credential with a ladder (`decisions/0020`) and its bridge
119
+ * delegation is signed by that ladder's VM (`decisions/0019`), so a
120
+ * replacement published without the VM could neither sign its own bridge nor
121
+ * spend. `recoveryClientFromCode` produces all three.
122
+ */
123
+ export interface ReplacementRecoveryPublicKeys extends RecoveryPublicKeys {
124
+ ladderVmKeyMultibase: string;
125
+ }
126
+ /**
127
+ * Thrown by the recovery continuation when the log carries neither the code's
128
+ * update key nor its committed hash -- the code was revoked (or never
129
+ * issued), so no continuation can verify.
130
+ */
131
+ export declare class RecoveryKeyNotCommittedError extends Error {
132
+ constructor(message?: string);
133
+ }
134
+ /**
135
+ * Thrown by the recovery continuation, before its reveal entry, when a
136
+ * credential-class `keyAgreement` id the add-and-retire entry would introduce
137
+ * already stands in the document -- the user re-typed a passphrase the
138
+ * account already stands on. The recovery exists to retire that credential,
139
+ * and an entry that re-binds it would strike its old ladder VM while leaving
140
+ * its old rung commitments standing, one member backed by two ladders. The
141
+ * app maps the refusal to "choose a passphrase you have not used". Nothing
142
+ * is published.
143
+ */
144
+ export declare class RecoveryCredentialStandingError extends Error {
145
+ readonly credentialVmIds: string[];
146
+ constructor({ credentialVmIds }: {
147
+ credentialVmIds: string[];
148
+ });
149
+ }
150
+ /**
151
+ * The narrow store seam the recovery continuation writes through: a public
152
+ * read of the log and the delegated `did.jsonl` PUT. A subset of
153
+ * {@link WebvhIdStore}, so an app's remote-store class satisfies it too.
154
+ */
155
+ export type RecoveryLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
156
+ /**
157
+ * What a variant adds to the add-and-retire entry beyond the replacement
158
+ * code's own inventory, which the core appends after it: the verification
159
+ * methods, and the ids each relation gains. Order is load-bearing on the wire
160
+ * -- the methods land in `verificationMethod` and each relation in the order
161
+ * given, with the replacement code's after them.
162
+ */
163
+ export interface RecoveryAddedInventory extends RelationMembership {
164
+ methods: VerificationMethod[];
165
+ services?: ServiceEndpoint[];
166
+ }
167
+ /**
168
+ * What one attempt of a recovery continuation returns: the superset both
169
+ * variants pick their public outcome from.
170
+ */
171
+ export interface RecoveryContinuationOutcome extends RecoverySpendRetirement {
172
+ did: string;
173
+ doc: DIDDoc;
174
+ log: DIDLog;
175
+ webDoc?: object;
176
+ committed: boolean;
177
+ }
178
+ /**
179
+ * One attempt of a recovery continuation, the shared control flow of
180
+ * `recoverWebvhClient` and `recoverWebvhLadderAnchored`; each wraps it in the
181
+ * conflict retry under its own preconditions. Both entries go through the
182
+ * account-entry seam ({@link signAccountEntry}) on its committed-key arm: the
183
+ * spent code's rung 0 signs the reveal-and-commit entry, and the successor
184
+ * key that entry committed signs the add-and-retire entry, so the pinned
185
+ * read, the carry-over precondition, the self-reveal union, the conditional
186
+ * publish, and the pin advance are the seam's. The body detects a completed
187
+ * run by the successor key standing authorized (reporting what the entry
188
+ * retired off the log), publishes the reveal-and-commit entry unless a torn
189
+ * earlier run left it standing, enters the `onCommitted` seam, and builds the
190
+ * add-and-retire entry from what the variant's `added` callback hands in.
191
+ *
192
+ * The reveal-and-commit entry commits, in this order, the successor key's
193
+ * hash, its staged partner's hash, and the replacement code's rung-0 hash --
194
+ * the ratified append order of `decisions/0007` (the replacement's comes
195
+ * LAST) and the anchor rule of `decisions/0014` both read that order. The
196
+ * add-and-retire entry is built on the head the reveal entry's own publish
197
+ * leaves standing, with no read in between; against a store whose PUT serves
198
+ * no ETag it is re-read under the same pin instead, so its compare-and-swap
199
+ * never degrades to an unconditional write.
200
+ *
201
+ * @param options {object}
202
+ * @param options.store {RecoveryLogStore}
203
+ * @param options.recovery {object} the spent code's update seed and public
204
+ * halves
205
+ * @param options.successor {object} the key the add-and-retire entry
206
+ * authorizes and signs with (`updateKeyMultibase`, from `updateSeed`) and
207
+ * the staged partner whose hash the reveal entry commits right after it
208
+ * (`stagedKeyMultibase`: the new client's staged key, or the fresh ladder's
209
+ * rung 1)
210
+ * @param options.replacement {ReplacementRecoveryPublicKeys}
211
+ * @param options.onCommitted {function} the persist-before-publish seam,
212
+ * entered once per attempt after the reveal entry stands and before the
213
+ * pivot is built; what it resolves to is handed to `added`
214
+ * @param options.added {function} builds the variant's additions to the
215
+ * add-and-retire entry from the account DID, the document the entry edits,
216
+ * and what the seam persisted
217
+ * @param [options.credentialVmIds] {function} `(did) => string[]` -- the
218
+ * credential-class `keyAgreement` ids `added` will introduce, checked
219
+ * against the read document before the reveal entry: one already standing
220
+ * is refused with {@link RecoveryCredentialStandingError}. The transient
221
+ * variant supplies its fresh credential's; the remembered variant's new
222
+ * client publishes a marked pair, which is never credential-class
223
+ * @param [options.expectedDid] {string}
224
+ * @param [options.pinStore] {ResourceLogPinStore}
225
+ * @param [options.logId] {string}
226
+ * @returns {Promise<RecoveryContinuationOutcome>}
227
+ */
228
+ export declare function recoveryContinuationOnce<Persisted>({ store, recovery, successor, replacement, onCommitted, added, credentialVmIds, expectedDid, pinStore, logId }: {
229
+ store: RecoveryLogStore;
230
+ recovery: RecoveryPublicKeys & {
231
+ updateSeed: Uint8Array;
232
+ };
233
+ successor: {
234
+ updateKeyMultibase: string;
235
+ updateSeed: Uint8Array;
236
+ stagedKeyMultibase: string;
237
+ };
238
+ replacement: ReplacementRecoveryPublicKeys;
239
+ onCommitted: (committed: {
240
+ builtOnHead: {
241
+ scid: string;
242
+ versionId: string;
243
+ };
244
+ }) => Promise<Persisted>;
245
+ added: (context: {
246
+ did: string;
247
+ doc: DIDDoc;
248
+ persisted: Persisted;
249
+ }) => RecoveryAddedInventory;
250
+ credentialVmIds?: (did: string) => string[];
251
+ expectedDid?: string;
252
+ pinStore?: ResourceLogPinStore;
253
+ logId?: string;
254
+ }): Promise<RecoveryContinuationOutcome>;
255
+ //# sourceMappingURL=continuation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continuation.d.ts","sourceRoot":"","sources":["../../src/recovery/continuation.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACN,eAAe,EACf,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAQnE,OAAO,KAAK,EAAqB,YAAY,EAAE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