@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.
Files changed (313) hide show
  1. package/README.md +41 -16
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +55 -34
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +102 -56
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +16 -2
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +11 -9
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +126 -35
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +208 -60
  17. package/dist/clientAnnex/forgetLast.js.map +1 -1
  18. package/dist/clientAnnex/gc.d.ts +3 -2
  19. package/dist/clientAnnex/gc.d.ts.map +1 -1
  20. package/dist/clientAnnex/gc.js +7 -7
  21. package/dist/clientAnnex/gc.js.map +1 -1
  22. package/dist/clientAnnex/heal.d.ts +101 -33
  23. package/dist/clientAnnex/heal.d.ts.map +1 -1
  24. package/dist/clientAnnex/heal.js +559 -212
  25. package/dist/clientAnnex/heal.js.map +1 -1
  26. package/dist/clientAnnex/index.d.ts +21 -5
  27. package/dist/clientAnnex/index.d.ts.map +1 -1
  28. package/dist/clientAnnex/index.js +24 -5
  29. package/dist/clientAnnex/index.js.map +1 -1
  30. package/dist/clientAnnex/ladder.d.ts +304 -18
  31. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  32. package/dist/clientAnnex/ladder.js +942 -64
  33. package/dist/clientAnnex/ladder.js.map +1 -1
  34. package/dist/clientAnnex/ladderAnchored.d.ts +261 -28
  35. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  36. package/dist/clientAnnex/ladderAnchored.js +521 -295
  37. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  38. package/dist/clientAnnex/log.d.ts +193 -38
  39. package/dist/clientAnnex/log.d.ts.map +1 -1
  40. package/dist/clientAnnex/log.js +445 -190
  41. package/dist/clientAnnex/log.js.map +1 -1
  42. package/dist/clientAnnex/mend.d.ts +12 -6
  43. package/dist/clientAnnex/mend.d.ts.map +1 -1
  44. package/dist/clientAnnex/mend.js +26 -12
  45. package/dist/clientAnnex/mend.js.map +1 -1
  46. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +38 -11
  47. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  48. package/dist/clientAnnex/recoveryLadderAnchored.js +177 -55
  49. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  50. package/dist/clientAnnex/spaceCapability.d.ts +123 -0
  51. package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
  52. package/dist/clientAnnex/spaceCapability.js +152 -0
  53. package/dist/clientAnnex/spaceCapability.js.map +1 -0
  54. package/dist/clientAnnex/stages.d.ts +63 -0
  55. package/dist/clientAnnex/stages.d.ts.map +1 -0
  56. package/dist/clientAnnex/stages.js +64 -0
  57. package/dist/clientAnnex/stages.js.map +1 -0
  58. package/dist/clientAnnex/zcap.d.ts +1 -1
  59. package/dist/clientAnnex/zcap.d.ts.map +1 -1
  60. package/dist/clientAnnex/zcap.js +42 -35
  61. package/dist/clientAnnex/zcap.js.map +1 -1
  62. package/dist/clients/policy.d.ts +15 -1
  63. package/dist/clients/policy.d.ts.map +1 -1
  64. package/dist/clients/policy.js +12 -6
  65. package/dist/clients/policy.js.map +1 -1
  66. package/dist/clients/revocation.d.ts +18 -10
  67. package/dist/clients/revocation.d.ts.map +1 -1
  68. package/dist/clients/revocation.js +13 -5
  69. package/dist/clients/revocation.js.map +1 -1
  70. package/dist/clients/rosterPolicy.d.ts +10 -2
  71. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  72. package/dist/clients/rosterPolicy.js +41 -24
  73. package/dist/clients/rosterPolicy.js.map +1 -1
  74. package/dist/descriptors/acquire.d.ts.map +1 -1
  75. package/dist/descriptors/acquire.js +6 -23
  76. package/dist/descriptors/acquire.js.map +1 -1
  77. package/dist/descriptors/cipher.d.ts.map +1 -1
  78. package/dist/descriptors/cipher.js +5 -0
  79. package/dist/descriptors/cipher.js.map +1 -1
  80. package/dist/descriptors/errors.d.ts +43 -0
  81. package/dist/descriptors/errors.d.ts.map +1 -0
  82. package/dist/descriptors/errors.js +45 -0
  83. package/dist/descriptors/errors.js.map +1 -0
  84. package/dist/descriptors/index.d.ts +5 -0
  85. package/dist/descriptors/index.d.ts.map +1 -1
  86. package/dist/descriptors/index.js +5 -0
  87. package/dist/descriptors/index.js.map +1 -1
  88. package/dist/enrollment/enrollment.d.ts +37 -10
  89. package/dist/enrollment/enrollment.d.ts.map +1 -1
  90. package/dist/enrollment/enrollment.js +52 -15
  91. package/dist/enrollment/enrollment.js.map +1 -1
  92. package/dist/genesis/accountGenesis.d.ts +42 -11
  93. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  94. package/dist/genesis/accountGenesis.js +80 -22
  95. package/dist/genesis/accountGenesis.js.map +1 -1
  96. package/dist/genesis/index.d.ts +3 -1
  97. package/dist/genesis/index.d.ts.map +1 -1
  98. package/dist/genesis/index.js +3 -1
  99. package/dist/genesis/index.js.map +1 -1
  100. package/dist/identity/agents.d.ts +17 -1
  101. package/dist/identity/agents.d.ts.map +1 -1
  102. package/dist/identity/agents.js +24 -8
  103. package/dist/identity/agents.js.map +1 -1
  104. package/dist/identity/index.d.ts +3 -1
  105. package/dist/identity/index.d.ts.map +1 -1
  106. package/dist/identity/index.js +3 -1
  107. package/dist/identity/index.js.map +1 -1
  108. package/dist/index.d.ts +6 -3
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +6 -3
  111. package/dist/index.js.map +1 -1
  112. package/dist/keyring/index.d.ts +2 -1
  113. package/dist/keyring/index.d.ts.map +1 -1
  114. package/dist/keyring/index.js +2 -1
  115. package/dist/keyring/index.js.map +1 -1
  116. package/dist/keyring/record.d.ts.map +1 -1
  117. package/dist/keyring/record.js +3 -6
  118. package/dist/keyring/record.js.map +1 -1
  119. package/dist/keyring/unlockSpace.d.ts +14 -5
  120. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  121. package/dist/keyring/unlockSpace.js +31 -36
  122. package/dist/keyring/unlockSpace.js.map +1 -1
  123. package/dist/keys/index.d.ts +10 -6
  124. package/dist/keys/index.d.ts.map +1 -1
  125. package/dist/keys/index.js +9 -5
  126. package/dist/keys/index.js.map +1 -1
  127. package/dist/keys/rosterLogStore.d.ts +12 -11
  128. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  129. package/dist/keys/rosterLogStore.js +15 -13
  130. package/dist/keys/rosterLogStore.js.map +1 -1
  131. package/dist/keys/rosterStore.d.ts +3 -6
  132. package/dist/keys/rosterStore.d.ts.map +1 -1
  133. package/dist/keys/rosterStore.js +10 -9
  134. package/dist/keys/rosterStore.js.map +1 -1
  135. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  136. package/dist/keys/spaceEpochs.js +2 -3
  137. package/dist/keys/spaceEpochs.js.map +1 -1
  138. package/dist/keys/userKeyRoster.d.ts +89 -9
  139. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  140. package/dist/keys/userKeyRoster.js +262 -19
  141. package/dist/keys/userKeyRoster.js.map +1 -1
  142. package/dist/keys/userKeyRosterCascade.d.ts +7 -6
  143. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  144. package/dist/keys/userKeyRosterCascade.js +7 -6
  145. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  146. package/dist/keys/wasLabelsStore.d.ts +9 -2
  147. package/dist/keys/wasLabelsStore.d.ts.map +1 -1
  148. package/dist/keys/wasLabelsStore.js +14 -6
  149. package/dist/keys/wasLabelsStore.js.map +1 -1
  150. package/dist/log.d.ts +7 -2
  151. package/dist/log.d.ts.map +1 -1
  152. package/dist/log.js +6 -1
  153. package/dist/log.js.map +1 -1
  154. package/dist/recovery/index.d.ts +12 -8
  155. package/dist/recovery/index.d.ts.map +1 -1
  156. package/dist/recovery/index.js +11 -7
  157. package/dist/recovery/index.js.map +1 -1
  158. package/dist/recovery/recoveryCode.d.ts +27 -7
  159. package/dist/recovery/recoveryCode.d.ts.map +1 -1
  160. package/dist/recovery/recoveryCode.js +18 -6
  161. package/dist/recovery/recoveryCode.js.map +1 -1
  162. package/dist/recovery/recoveryDelegation.d.ts +4 -1
  163. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  164. package/dist/recovery/recoveryDelegation.js +25 -36
  165. package/dist/recovery/recoveryDelegation.js.map +1 -1
  166. package/dist/recovery/recoveryWebvh.d.ts +117 -65
  167. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  168. package/dist/recovery/recoveryWebvh.js +279 -126
  169. package/dist/recovery/recoveryWebvh.js.map +1 -1
  170. package/dist/request/classify.d.ts +32 -8
  171. package/dist/request/classify.d.ts.map +1 -1
  172. package/dist/request/classify.js +39 -14
  173. package/dist/request/classify.js.map +1 -1
  174. package/dist/request/ephemeralExchange.d.ts +1 -6
  175. package/dist/request/ephemeralExchange.d.ts.map +1 -1
  176. package/dist/request/ephemeralExchange.js.map +1 -1
  177. package/dist/request/onboarding.d.ts.map +1 -1
  178. package/dist/request/onboarding.js +2 -2
  179. package/dist/request/onboarding.js.map +1 -1
  180. package/dist/request/parse.d.ts.map +1 -1
  181. package/dist/request/parse.js +2 -3
  182. package/dist/request/parse.js.map +1 -1
  183. package/dist/resourceLog/controller.d.ts +34 -12
  184. package/dist/resourceLog/controller.d.ts.map +1 -1
  185. package/dist/resourceLog/controller.js +79 -86
  186. package/dist/resourceLog/controller.js.map +1 -1
  187. package/dist/resourceLog/document.d.ts +182 -0
  188. package/dist/resourceLog/document.d.ts.map +1 -0
  189. package/dist/resourceLog/document.js +159 -0
  190. package/dist/resourceLog/document.js.map +1 -0
  191. package/dist/resourceLog/errors.d.ts +47 -8
  192. package/dist/resourceLog/errors.d.ts.map +1 -1
  193. package/dist/resourceLog/errors.js +54 -8
  194. package/dist/resourceLog/errors.js.map +1 -1
  195. package/dist/resourceLog/index.d.ts +7 -3
  196. package/dist/resourceLog/index.d.ts.map +1 -1
  197. package/dist/resourceLog/index.js +7 -3
  198. package/dist/resourceLog/index.js.map +1 -1
  199. package/dist/resourceLog/ladderRungs.d.ts +35 -0
  200. package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
  201. package/dist/resourceLog/ladderRungs.js +352 -0
  202. package/dist/resourceLog/ladderRungs.js.map +1 -0
  203. package/dist/resourceLog/license.d.ts +42 -17
  204. package/dist/resourceLog/license.d.ts.map +1 -1
  205. package/dist/resourceLog/license.js +38 -24
  206. package/dist/resourceLog/license.js.map +1 -1
  207. package/dist/space/activity.d.ts +15 -15
  208. package/dist/space/activity.d.ts.map +1 -1
  209. package/dist/space/activity.js +15 -15
  210. package/dist/space/activity.js.map +1 -1
  211. package/dist/space/collections.d.ts +11 -0
  212. package/dist/space/collections.d.ts.map +1 -1
  213. package/dist/space/collections.js +13 -0
  214. package/dist/space/collections.js.map +1 -1
  215. package/dist/space/deleteSpace.d.ts +28 -0
  216. package/dist/space/deleteSpace.d.ts.map +1 -0
  217. package/dist/space/deleteSpace.js +44 -0
  218. package/dist/space/deleteSpace.js.map +1 -0
  219. package/dist/space/errors.d.ts.map +1 -1
  220. package/dist/space/errors.js +0 -1
  221. package/dist/space/errors.js.map +1 -1
  222. package/dist/space/index.d.ts +6 -0
  223. package/dist/space/index.d.ts.map +1 -1
  224. package/dist/space/index.js +6 -0
  225. package/dist/space/index.js.map +1 -1
  226. package/dist/space/plaintextCollection.d.ts +43 -0
  227. package/dist/space/plaintextCollection.d.ts.map +1 -0
  228. package/dist/space/plaintextCollection.js +17 -0
  229. package/dist/space/plaintextCollection.js.map +1 -0
  230. package/dist/stages.d.ts +23 -0
  231. package/dist/stages.d.ts.map +1 -0
  232. package/dist/stages.js +23 -0
  233. package/dist/stages.js.map +1 -0
  234. package/dist/sync/index.d.ts +7 -0
  235. package/dist/sync/index.d.ts.map +1 -1
  236. package/dist/sync/index.js +7 -0
  237. package/dist/sync/index.js.map +1 -1
  238. package/dist/sync/push.js +4 -4
  239. package/dist/sync/push.js.map +1 -1
  240. package/dist/sync/remint.js +2 -2
  241. package/dist/sync/remint.js.map +1 -1
  242. package/dist/sync/types.d.ts +41 -1
  243. package/dist/sync/types.d.ts.map +1 -1
  244. package/dist/sync/types.js +47 -1
  245. package/dist/sync/types.js.map +1 -1
  246. package/dist/unlock/index.d.ts +6 -2
  247. package/dist/unlock/index.d.ts.map +1 -1
  248. package/dist/unlock/index.js +5 -1
  249. package/dist/unlock/index.js.map +1 -1
  250. package/dist/unlock/retire.d.ts +95 -14
  251. package/dist/unlock/retire.d.ts.map +1 -1
  252. package/dist/unlock/retire.js +102 -10
  253. package/dist/unlock/retire.js.map +1 -1
  254. package/dist/unlock/standingClient.d.ts.map +1 -1
  255. package/dist/unlock/standingClient.js +5 -1
  256. package/dist/unlock/standingClient.js.map +1 -1
  257. package/dist/unlock/standingWebvh.d.ts +341 -49
  258. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  259. package/dist/unlock/standingWebvh.js +608 -164
  260. package/dist/unlock/standingWebvh.js.map +1 -1
  261. package/dist/webvh/accountEntry.d.ts +146 -0
  262. package/dist/webvh/accountEntry.d.ts.map +1 -0
  263. package/dist/webvh/accountEntry.js +239 -0
  264. package/dist/webvh/accountEntry.js.map +1 -0
  265. package/dist/webvh/didWeb.d.ts +12 -7
  266. package/dist/webvh/didWeb.d.ts.map +1 -1
  267. package/dist/webvh/didWeb.js +2 -2
  268. package/dist/webvh/didWeb.js.map +1 -1
  269. package/dist/webvh/didWebProjection.d.ts +164 -0
  270. package/dist/webvh/didWebProjection.d.ts.map +1 -0
  271. package/dist/webvh/didWebProjection.js +230 -0
  272. package/dist/webvh/didWebProjection.js.map +1 -0
  273. package/dist/webvh/didWebvh.d.ts +278 -138
  274. package/dist/webvh/didWebvh.d.ts.map +1 -1
  275. package/dist/webvh/didWebvh.js +314 -345
  276. package/dist/webvh/didWebvh.js.map +1 -1
  277. package/dist/webvh/enrollClient.d.ts +65 -0
  278. package/dist/webvh/enrollClient.d.ts.map +1 -0
  279. package/dist/webvh/enrollClient.js +172 -0
  280. package/dist/webvh/enrollClient.js.map +1 -0
  281. package/dist/webvh/index.d.ts +37 -12
  282. package/dist/webvh/index.d.ts.map +1 -1
  283. package/dist/webvh/index.js +33 -10
  284. package/dist/webvh/index.js.map +1 -1
  285. package/dist/webvh/listClients.d.ts +1 -33
  286. package/dist/webvh/listClients.d.ts.map +1 -1
  287. package/dist/webvh/listClients.js +2 -28
  288. package/dist/webvh/listClients.js.map +1 -1
  289. package/dist/webvh/revokeClient.d.ts +89 -11
  290. package/dist/webvh/revokeClient.d.ts.map +1 -1
  291. package/dist/webvh/revokeClient.js +182 -47
  292. package/dist/webvh/revokeClient.js.map +1 -1
  293. package/dist/webvh/standingZcap.d.ts +61 -14
  294. package/dist/webvh/standingZcap.d.ts.map +1 -1
  295. package/dist/webvh/standingZcap.js +91 -0
  296. package/dist/webvh/standingZcap.js.map +1 -1
  297. package/dist/webvh/verifyLog.d.ts +59 -5
  298. package/dist/webvh/verifyLog.d.ts.map +1 -1
  299. package/dist/webvh/verifyLog.js +76 -11
  300. package/dist/webvh/verifyLog.js.map +1 -1
  301. package/dist/webvh/wasIdStore.d.ts +8 -8
  302. package/dist/webvh/wasIdStore.d.ts.map +1 -1
  303. package/dist/webvh/wasIdStore.js +39 -14
  304. package/dist/webvh/wasIdStore.js.map +1 -1
  305. package/dist/webvh/zcap.d.ts +14 -1
  306. package/dist/webvh/zcap.d.ts.map +1 -1
  307. package/dist/webvh/zcap.js +3 -27
  308. package/dist/webvh/zcap.js.map +1 -1
  309. package/package.json +5 -5
  310. package/dist/webvh/keyAgreement.d.ts +0 -72
  311. package/dist/webvh/keyAgreement.d.ts.map +0 -1
  312. package/dist/webvh/keyAgreement.js +0 -47
  313. 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"}
@@ -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"}
@@ -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';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;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,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"}
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"}
@@ -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';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAiBjC,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"}
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 { WasSyncConflictError, WasSyncNotFoundError } from './types.js';
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 instanceof WasSyncConflictError)) {
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 instanceof WasSyncNotFoundError) {
119
+ if (isSyncNotFoundError(err)) {
120
120
  await store.markDeletedPushed({ id, ...revisionAck });
121
121
  return true;
122
122
  }
123
- if (err instanceof WasSyncConflictError) {
123
+ if (isSyncConflictError(err)) {
124
124
  return false;
125
125
  }
126
126
  throw err;
@@ -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,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEvE,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;Q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CAAC;YACpB,MAAK;QACP,CAAC;QACD,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YAChB,MAAM,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;QACxC,CAAC;aAAM,CAAC;YACN,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,UAAU,CAAC;gBAC5C,IAAI;gBACJ,KAAK;gBACL,GAAG;gBACH,eAAe;aAChB,CAAC,CAAA;YACF,IAAI,gBAAgB,EAAE,CAAC;gBACrB,iBAAiB,IAAI,CAAC,CAAA;YACxB,CAAC;QACH,CAAC;QACD,MAAM,IAAI,CAAC,CAAA;IACb,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAA;AACtC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { UnknownEpochError } from './types.js';
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 instanceof UnknownEpochError)) {
78
+ if (!isUnknownEpochError(err)) {
79
79
  throw err;
80
80
  }
81
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"remint.js","sourceRoot":"","sources":["../../src/sync/remint.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;;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;I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,MAAM,KAAK,CAAC,cAAc,CAAC;gBAC7C,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,KAAK;gBACL,QAAQ,EAAE,gBAAgB;gBAC1B,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;aAC9D,CAAC,CAAA;YACF,IAAI,OAAO,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"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;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;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAC1B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3E;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;CAClB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAEnB;;;;;;GAMG;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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"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA"}
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"}
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,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"}
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"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAO3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
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"}
@@ -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
- * There is deliberately no recovery-delegation re-mint stage here (the
33
- * client-revocation cascade's fourth stage). A retired credential signs no
34
- * delegations: its own bridge delegation dies with its unlock Space, which
35
- * the app deletes as part of the change-method ceremony, and no other
36
- * credential's bridge chains through it.
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 { ClientWebvhUpdateKeys, WebvhIdStore } from '../webvh/index.js';
74
- import { type StandingUnlockKeys } from './standingWebvh.js';
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, and the rotated key with the roster descriptor 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.updateKeys {ClientWebvhUpdateKeys} the RETIRING (enrolled)
114
- * client's own did:webvh update-key seeds, which sign the inventory edit
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 but is not required
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, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexInventory, onRotationAdopted }: {
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
- updateKeys: ClientWebvhUpdateKeys;
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;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,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE7E;;;;;;;GAOG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAA;IAChB,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;CAC7C;AAED;;;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