@interop/wallet-core 0.62.0 → 0.66.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 (321) 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 +119 -35
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +227 -160
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +18 -8
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +37 -64
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +85 -38
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +155 -98
  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 +16 -7
  21. package/dist/clientAnnex/gc.js.map +1 -1
  22. package/dist/clientAnnex/heal.d.ts +65 -14
  23. package/dist/clientAnnex/heal.d.ts.map +1 -1
  24. package/dist/clientAnnex/heal.js +397 -298
  25. package/dist/clientAnnex/heal.js.map +1 -1
  26. package/dist/clientAnnex/index.d.ts +23 -7
  27. package/dist/clientAnnex/index.d.ts.map +1 -1
  28. package/dist/clientAnnex/index.js +26 -7
  29. package/dist/clientAnnex/index.js.map +1 -1
  30. package/dist/clientAnnex/ladder.d.ts +58 -0
  31. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  32. package/dist/clientAnnex/ladder.js +249 -41
  33. package/dist/clientAnnex/ladder.js.map +1 -1
  34. package/dist/clientAnnex/ladderAnchored.d.ts +148 -22
  35. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  36. package/dist/clientAnnex/ladderAnchored.js +391 -346
  37. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  38. package/dist/clientAnnex/log.d.ts +237 -53
  39. package/dist/clientAnnex/log.d.ts.map +1 -1
  40. package/dist/clientAnnex/log.js +533 -198
  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 +44 -72
  45. package/dist/clientAnnex/mend.js.map +1 -1
  46. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +6 -4
  47. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  48. package/dist/clientAnnex/recoveryLadderAnchored.js +56 -35
  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 +23 -7
  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 +22 -8
  124. package/dist/keys/index.d.ts.map +1 -1
  125. package/dist/keys/index.js +20 -6
  126. package/dist/keys/index.js.map +1 -1
  127. package/dist/keys/rosterLogStore.d.ts +15 -12
  128. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  129. package/dist/keys/rosterLogStore.js +21 -16
  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/userKeyCascade.d.ts +8 -5
  139. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  140. package/dist/keys/userKeyCascade.js +7 -6
  141. package/dist/keys/userKeyCascade.js.map +1 -1
  142. package/dist/keys/userKeyRoster.d.ts +95 -8
  143. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  144. package/dist/keys/userKeyRoster.js +278 -35
  145. package/dist/keys/userKeyRoster.js.map +1 -1
  146. package/dist/keys/userKeyRosterCascade.d.ts +117 -16
  147. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  148. package/dist/keys/userKeyRosterCascade.js +184 -43
  149. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  150. package/dist/keys/wasLabelsStore.d.ts +9 -2
  151. package/dist/keys/wasLabelsStore.d.ts.map +1 -1
  152. package/dist/keys/wasLabelsStore.js +14 -6
  153. package/dist/keys/wasLabelsStore.js.map +1 -1
  154. package/dist/log.d.ts +7 -2
  155. package/dist/log.d.ts.map +1 -1
  156. package/dist/log.js +6 -1
  157. package/dist/log.js.map +1 -1
  158. package/dist/recovery/index.d.ts +13 -9
  159. package/dist/recovery/index.d.ts.map +1 -1
  160. package/dist/recovery/index.js +12 -8
  161. package/dist/recovery/index.js.map +1 -1
  162. package/dist/recovery/recoveryCode.d.ts +27 -7
  163. package/dist/recovery/recoveryCode.d.ts.map +1 -1
  164. package/dist/recovery/recoveryCode.js +18 -6
  165. package/dist/recovery/recoveryCode.js.map +1 -1
  166. package/dist/recovery/recoveryDelegation.d.ts +23 -0
  167. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  168. package/dist/recovery/recoveryDelegation.js +66 -46
  169. package/dist/recovery/recoveryDelegation.js.map +1 -1
  170. package/dist/recovery/recoveryWebvh.d.ts +75 -63
  171. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  172. package/dist/recovery/recoveryWebvh.js +127 -116
  173. package/dist/recovery/recoveryWebvh.js.map +1 -1
  174. package/dist/request/appKey.d.ts +35 -1
  175. package/dist/request/appKey.d.ts.map +1 -1
  176. package/dist/request/appKey.js +29 -10
  177. package/dist/request/appKey.js.map +1 -1
  178. package/dist/request/classify.d.ts +32 -8
  179. package/dist/request/classify.d.ts.map +1 -1
  180. package/dist/request/classify.js +39 -14
  181. package/dist/request/classify.js.map +1 -1
  182. package/dist/request/ephemeralExchange.d.ts +1 -6
  183. package/dist/request/ephemeralExchange.d.ts.map +1 -1
  184. package/dist/request/ephemeralExchange.js.map +1 -1
  185. package/dist/request/onboarding.d.ts.map +1 -1
  186. package/dist/request/onboarding.js +2 -2
  187. package/dist/request/onboarding.js.map +1 -1
  188. package/dist/request/parse.d.ts.map +1 -1
  189. package/dist/request/parse.js +2 -3
  190. package/dist/request/parse.js.map +1 -1
  191. package/dist/resourceLog/controller.d.ts +34 -12
  192. package/dist/resourceLog/controller.d.ts.map +1 -1
  193. package/dist/resourceLog/controller.js +79 -86
  194. package/dist/resourceLog/controller.js.map +1 -1
  195. package/dist/resourceLog/document.d.ts +182 -0
  196. package/dist/resourceLog/document.d.ts.map +1 -0
  197. package/dist/resourceLog/document.js +159 -0
  198. package/dist/resourceLog/document.js.map +1 -0
  199. package/dist/resourceLog/errors.d.ts +47 -8
  200. package/dist/resourceLog/errors.d.ts.map +1 -1
  201. package/dist/resourceLog/errors.js +54 -8
  202. package/dist/resourceLog/errors.js.map +1 -1
  203. package/dist/resourceLog/index.d.ts +7 -3
  204. package/dist/resourceLog/index.d.ts.map +1 -1
  205. package/dist/resourceLog/index.js +7 -3
  206. package/dist/resourceLog/index.js.map +1 -1
  207. package/dist/resourceLog/ladderRungs.d.ts +35 -0
  208. package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
  209. package/dist/resourceLog/ladderRungs.js +352 -0
  210. package/dist/resourceLog/ladderRungs.js.map +1 -0
  211. package/dist/resourceLog/license.d.ts +42 -17
  212. package/dist/resourceLog/license.d.ts.map +1 -1
  213. package/dist/resourceLog/license.js +38 -24
  214. package/dist/resourceLog/license.js.map +1 -1
  215. package/dist/space/activity.d.ts +15 -15
  216. package/dist/space/activity.d.ts.map +1 -1
  217. package/dist/space/activity.js +15 -15
  218. package/dist/space/activity.js.map +1 -1
  219. package/dist/space/collections.d.ts +11 -0
  220. package/dist/space/collections.d.ts.map +1 -1
  221. package/dist/space/collections.js +13 -0
  222. package/dist/space/collections.js.map +1 -1
  223. package/dist/space/deleteSpace.d.ts +28 -0
  224. package/dist/space/deleteSpace.d.ts.map +1 -0
  225. package/dist/space/deleteSpace.js +44 -0
  226. package/dist/space/deleteSpace.js.map +1 -0
  227. package/dist/space/errors.d.ts.map +1 -1
  228. package/dist/space/errors.js +0 -1
  229. package/dist/space/errors.js.map +1 -1
  230. package/dist/space/index.d.ts +6 -0
  231. package/dist/space/index.d.ts.map +1 -1
  232. package/dist/space/index.js +6 -0
  233. package/dist/space/index.js.map +1 -1
  234. package/dist/space/plaintextCollection.d.ts +43 -0
  235. package/dist/space/plaintextCollection.d.ts.map +1 -0
  236. package/dist/space/plaintextCollection.js +17 -0
  237. package/dist/space/plaintextCollection.js.map +1 -0
  238. package/dist/stages.d.ts +23 -0
  239. package/dist/stages.d.ts.map +1 -0
  240. package/dist/stages.js +23 -0
  241. package/dist/stages.js.map +1 -0
  242. package/dist/sync/index.d.ts +7 -0
  243. package/dist/sync/index.d.ts.map +1 -1
  244. package/dist/sync/index.js +7 -0
  245. package/dist/sync/index.js.map +1 -1
  246. package/dist/sync/push.js +4 -4
  247. package/dist/sync/push.js.map +1 -1
  248. package/dist/sync/remint.js +2 -2
  249. package/dist/sync/remint.js.map +1 -1
  250. package/dist/sync/types.d.ts +41 -1
  251. package/dist/sync/types.d.ts.map +1 -1
  252. package/dist/sync/types.js +47 -1
  253. package/dist/sync/types.js.map +1 -1
  254. package/dist/unlock/index.d.ts +5 -1
  255. package/dist/unlock/index.d.ts.map +1 -1
  256. package/dist/unlock/index.js +5 -1
  257. package/dist/unlock/index.js.map +1 -1
  258. package/dist/unlock/retire.d.ts +35 -7
  259. package/dist/unlock/retire.d.ts.map +1 -1
  260. package/dist/unlock/retire.js +52 -14
  261. package/dist/unlock/retire.js.map +1 -1
  262. package/dist/unlock/standingClient.d.ts.map +1 -1
  263. package/dist/unlock/standingClient.js +5 -1
  264. package/dist/unlock/standingClient.js.map +1 -1
  265. package/dist/unlock/standingWebvh.d.ts +217 -35
  266. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  267. package/dist/unlock/standingWebvh.js +469 -210
  268. package/dist/unlock/standingWebvh.js.map +1 -1
  269. package/dist/webvh/accountEntry.d.ts +146 -0
  270. package/dist/webvh/accountEntry.d.ts.map +1 -0
  271. package/dist/webvh/accountEntry.js +239 -0
  272. package/dist/webvh/accountEntry.js.map +1 -0
  273. package/dist/webvh/didWeb.d.ts +12 -7
  274. package/dist/webvh/didWeb.d.ts.map +1 -1
  275. package/dist/webvh/didWeb.js +2 -2
  276. package/dist/webvh/didWeb.js.map +1 -1
  277. package/dist/webvh/didWebProjection.d.ts +164 -0
  278. package/dist/webvh/didWebProjection.d.ts.map +1 -0
  279. package/dist/webvh/didWebProjection.js +230 -0
  280. package/dist/webvh/didWebProjection.js.map +1 -0
  281. package/dist/webvh/didWebvh.d.ts +275 -136
  282. package/dist/webvh/didWebvh.d.ts.map +1 -1
  283. package/dist/webvh/didWebvh.js +307 -340
  284. package/dist/webvh/didWebvh.js.map +1 -1
  285. package/dist/webvh/enrollClient.d.ts +65 -0
  286. package/dist/webvh/enrollClient.d.ts.map +1 -0
  287. package/dist/webvh/enrollClient.js +172 -0
  288. package/dist/webvh/enrollClient.js.map +1 -0
  289. package/dist/webvh/index.d.ts +37 -12
  290. package/dist/webvh/index.d.ts.map +1 -1
  291. package/dist/webvh/index.js +33 -10
  292. package/dist/webvh/index.js.map +1 -1
  293. package/dist/webvh/listClients.d.ts +1 -35
  294. package/dist/webvh/listClients.d.ts.map +1 -1
  295. package/dist/webvh/listClients.js +2 -30
  296. package/dist/webvh/listClients.js.map +1 -1
  297. package/dist/webvh/revokeClient.d.ts +41 -11
  298. package/dist/webvh/revokeClient.d.ts.map +1 -1
  299. package/dist/webvh/revokeClient.js +99 -48
  300. package/dist/webvh/revokeClient.js.map +1 -1
  301. package/dist/webvh/standingZcap.d.ts +61 -14
  302. package/dist/webvh/standingZcap.d.ts.map +1 -1
  303. package/dist/webvh/standingZcap.js +91 -0
  304. package/dist/webvh/standingZcap.js.map +1 -1
  305. package/dist/webvh/verifyLog.d.ts +59 -5
  306. package/dist/webvh/verifyLog.d.ts.map +1 -1
  307. package/dist/webvh/verifyLog.js +76 -11
  308. package/dist/webvh/verifyLog.js.map +1 -1
  309. package/dist/webvh/wasIdStore.d.ts +8 -8
  310. package/dist/webvh/wasIdStore.d.ts.map +1 -1
  311. package/dist/webvh/wasIdStore.js +39 -14
  312. package/dist/webvh/wasIdStore.js.map +1 -1
  313. package/dist/webvh/zcap.d.ts +14 -1
  314. package/dist/webvh/zcap.d.ts.map +1 -1
  315. package/dist/webvh/zcap.js +3 -27
  316. package/dist/webvh/zcap.js.map +1 -1
  317. package/package.json +2 -2
  318. package/dist/webvh/keyAgreement.d.ts +0 -97
  319. package/dist/webvh/keyAgreement.d.ts.map +0 -1
  320. package/dist/webvh/keyAgreement.js +0 -71
  321. package/dist/webvh/keyAgreement.js.map +0 -1
@@ -0,0 +1,164 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The `did:web` projection of the account log: `id/did.json`, the document
6
+ * `generateParallelDidWeb` derives from the resolved `did.jsonl`. The log is
7
+ * the source of truth and the projection a derived cache, so this module owns
8
+ * the two ways that cache is written -- the unconditional PUT every publish
9
+ * tail makes ({@link putDidWebProjection}) and the read-then-write freshness
10
+ * ensure a caller with no controller authority makes
11
+ * ({@link ensureDidWebProjection}).
12
+ *
13
+ * The ensure exists because the projection is NOT republished by every entry.
14
+ * A ladder-signed entry publishes through `publishEntryPinned`, which writes
15
+ * `did.jsonl` alone: the bridge delegation a standing unlock credential
16
+ * carries is a PUT on exactly that resource. So after a ladder-signed removal
17
+ * or retirement (the last-client transition, a transient recovery) the served
18
+ * projection can still publish a verification method the log has struck, and
19
+ * a `did:web` resolver reading it accepts a key the account revoked. The
20
+ * account's own WAS authorization is unaffected -- the server resolves the
21
+ * controller out of `did.jsonl` and never reads `did.json` -- so this is a
22
+ * `did:web` verifier concern rather than a storage one, but it is a
23
+ * revocation bypass all the same.
24
+ *
25
+ * A transient visit closes it with no server change and no widened bridge:
26
+ * its generation delegation targets the account Space's items subtree, which
27
+ * covers `id/did.json`, so the visit invokes as its annex verification method
28
+ * and republishes the projection itself. The ensure is deliberately a
29
+ * compare-then-write rather than the publish tails' unconditional PUT,
30
+ * because it runs on every visit rather than behind a won log
31
+ * compare-and-swap: a healthy account must cost one GET and no write.
32
+ *
33
+ * The compare's input is a document the caller resolved earlier, so a
34
+ * difference alone does not say which side is stale. Another client may have
35
+ * published an inventory-removing entry and its correct projection in the
36
+ * meantime, and writing the caller's older derivation over it would restore a
37
+ * key the account just struck. Two guards keep that from happening. The
38
+ * caller may hand in a `refresh` that re-resolves the log, and the write runs
39
+ * only when the refreshed derivation still differs. And the PUT is a
40
+ * compare-and-swap on the ETag of the read it was based on, so a projection
41
+ * written between that read and the PUT stands and the ensure reports
42
+ * `conflict` instead. The next visit is the mender in both cases.
43
+ *
44
+ * No wire artifact of its own: the resource id, the content type, and the
45
+ * document shape are the ones `publishWebvhLog` already writes.
46
+ */
47
+ import type { DIDDoc, UpdateDIDResult } from '@interop/did-method-webvh';
48
+ import type { WebvhIdStore } from './didWebvh.js';
49
+ /**
50
+ * Writes the `did:web` projection into the `id` collection: `did.json`, under
51
+ * the `application/did+json` content type. The single PUT site, so the
52
+ * resource id and content type cannot drift between the publish tails and the
53
+ * freshness ensure.
54
+ *
55
+ * Unconditional by design at every publish-tail caller: the write is
56
+ * serialized behind a won `did.jsonl` compare-and-swap, and the projection is
57
+ * a derived cache of a log that is itself the source of truth.
58
+ *
59
+ * @param options {object}
60
+ * @param options.store {object} anything with the seam's `putIdResource`
61
+ * @param options.webDoc {object} the projection to publish, from
62
+ * `generateParallelDidWeb` (or `updateDID`'s `webDoc`, which is the same
63
+ * document)
64
+ * @returns {Promise<void>}
65
+ */
66
+ export declare function putDidWebProjection({ store, webDoc }: {
67
+ store: Pick<WebvhIdStore, 'putIdResource'>;
68
+ webDoc: object;
69
+ }): Promise<void>;
70
+ /**
71
+ * The pre-entry projection publisher: a `beforePublish` hook for
72
+ * `signAccountEntry`, which PUTs the post-entry `did:web` projection through
73
+ * the caller's store immediately before the entry itself publishes.
74
+ *
75
+ * A strike entry (a client revocation, a credential retirement, a recovery
76
+ * code's removal) signed by a standing credential's ladder writes `did.jsonl`
77
+ * alone, the bridge delegation's whole reach, so nothing in that ceremony
78
+ * republishes `did.json` and the served projection keeps naming the struck
79
+ * client or credential. A caller holding a store that may write the `id`
80
+ * collection -- a transient session under its generation delegation, an
81
+ * enrolled client under its own root authority -- hands one in and the
82
+ * projection lands with the entry.
83
+ *
84
+ * BEST-EFFORT, and the direction is deliberate. A failed PUT is warned and
85
+ * the entry publishes anyway: the residue is a projection this account's next
86
+ * visit mends through {@link ensureDidWebProjection}, where withholding the
87
+ * strike would leave the struck key standing in the log itself. Between the
88
+ * two write orders the same reasoning picks this one: a projection published
89
+ * before an entry that then fails under-lists a key the log still carries,
90
+ * which a `did:web` verifier reads as less authority rather than more.
91
+ *
92
+ * @param options {object}
93
+ * @param options.store {object} the narrow id-collection seam
94
+ * (`Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>`), the type
95
+ * the forget ceremony's `clientLogStore` already takes
96
+ * @returns {Function} `({ updated }) => Promise<void>`, the
97
+ * `signAccountEntry` hook
98
+ */
99
+ export declare function preEntryProjectionPublisher({ store }: {
100
+ store: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
101
+ }): (built: {
102
+ updated: UpdateDIDResult;
103
+ }) => Promise<void>;
104
+ /**
105
+ * THE PROJECTION FRESHNESS ENSURE: re-derives `did.json` from a resolved log's
106
+ * DID and document, compares it against what the host serves, and republishes
107
+ * only on a difference. The credential-only mender for a projection a
108
+ * ladder-signed entry left behind (see the module doc): a transient visit runs
109
+ * it through a store bound to its generation delegation, which covers the
110
+ * account Space's items subtree and so may write `id/did.json` with no
111
+ * widened bridge and no server change.
112
+ *
113
+ * The served document is compared as parsed JSON, key-order-insensitively, so
114
+ * a host (or an earlier writer) that reserialized the same document does not
115
+ * provoke a write. Absent, unparsable, and different all reach the write; only
116
+ * an equal document is left alone.
117
+ *
118
+ * A difference is not by itself evidence that the served projection is the
119
+ * stale side. The caller's `doc` was resolved at some earlier point, and a
120
+ * concurrent writer may have published a newer log entry with its matching
121
+ * projection since. Two guards keep this call from undoing that writer's work:
122
+ *
123
+ * 1. `refresh`, when supplied, re-resolves the log on the difference path.
124
+ * The write runs only when the derivation from the refreshed document
125
+ * still differs from what is served, so one extra read buys the ordering
126
+ * the plain compare cannot see.
127
+ * 2. The PUT is conditional on the served read: `If-Match` on its ETag, or
128
+ * `If-None-Match: *` when the projection was absent. A projection written
129
+ * between the read and the PUT wins, and the outcome is `conflict`.
130
+ *
131
+ * Read and write errors PROPAGATE, a failed precondition excepted. The call is
132
+ * one step of a login or a ceremony that has other work to do, and whether a
133
+ * stale projection is worth failing that work over is the caller's decision,
134
+ * not this function's -- every caller today treats it as best-effort.
135
+ *
136
+ * @param options {object}
137
+ * @param options.store {object} the narrow id-collection seam: the raw read
138
+ * plus the write (`Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>`,
139
+ * which `wasWebvhIdStore` and `delegatedWebvhLogStore` both satisfy). The
140
+ * read may be unauthenticated, the `id` collection being world-readable
141
+ * @param options.did {string} the account's did:webvh, from the resolved log
142
+ * @param options.doc {DIDDoc} the resolved did:webvh document
143
+ * @param [options.refresh] {Function} `() => Promise<{ did, doc }>`, a fresh
144
+ * resolution of the same log, called at most once and only on a detected
145
+ * difference. Its result replaces `did` / `doc` for the re-compare and for
146
+ * the write. Omitted, the caller's snapshot is written on any difference
147
+ * @returns {Promise<{ outcome: 'current' | 'republished' | 'conflict' }>}
148
+ * `current` when the served projection already matched (before or after the
149
+ * refresh) and nothing was written; `republished` when the PUT landed;
150
+ * `conflict` when it lost its precondition to a concurrent writer, whose
151
+ * projection stands and whose successor visit is the mender
152
+ */
153
+ export declare function ensureDidWebProjection({ store, did, doc, refresh }: {
154
+ store: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
155
+ did: string;
156
+ doc: DIDDoc;
157
+ refresh?: () => Promise<{
158
+ did: string;
159
+ doc: DIDDoc;
160
+ }>;
161
+ }): Promise<{
162
+ outcome: 'current' | 'republished' | 'conflict';
163
+ }>;
164
+ //# sourceMappingURL=didWebProjection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"didWebProjection.d.ts","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAIxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,KAAK,EACL,MAAM,EACP,EAAE;IACD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAA;IAC1C,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACN,EAAE;IACD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,kBAAkB,GAAG,eAAe,CAAC,CAAA;CAChE,GAAG,CAAC,KAAK,EAAE;IAAE,OAAO,EAAE,eAAe,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAgBzD;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,KAAK,EACL,GAAG,EACH,GAAG,EACH,OAAO,EACR,EAAE;IACD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,kBAAkB,GAAG,eAAe,CAAC,CAAA;IAC/D,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACtD,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAA;CAAE,CAAC,CAyC/D"}
@@ -0,0 +1,230 @@
1
+ import { generateParallelDidWeb } from '@interop/did-method-webvh';
2
+ import { log } from '../log.js';
3
+ import { DID_DOCUMENT_RESOURCE } from '../space/collections.js';
4
+ /**
5
+ * Writes the `did:web` projection into the `id` collection: `did.json`, under
6
+ * the `application/did+json` content type. The single PUT site, so the
7
+ * resource id and content type cannot drift between the publish tails and the
8
+ * freshness ensure.
9
+ *
10
+ * Unconditional by design at every publish-tail caller: the write is
11
+ * serialized behind a won `did.jsonl` compare-and-swap, and the projection is
12
+ * a derived cache of a log that is itself the source of truth.
13
+ *
14
+ * @param options {object}
15
+ * @param options.store {object} anything with the seam's `putIdResource`
16
+ * @param options.webDoc {object} the projection to publish, from
17
+ * `generateParallelDidWeb` (or `updateDID`'s `webDoc`, which is the same
18
+ * document)
19
+ * @returns {Promise<void>}
20
+ */
21
+ export async function putDidWebProjection({ store, webDoc }) {
22
+ await store.putIdResource({
23
+ resourceId: DID_DOCUMENT_RESOURCE,
24
+ content: webDoc,
25
+ contentType: 'application/did+json'
26
+ });
27
+ }
28
+ /**
29
+ * The pre-entry projection publisher: a `beforePublish` hook for
30
+ * `signAccountEntry`, which PUTs the post-entry `did:web` projection through
31
+ * the caller's store immediately before the entry itself publishes.
32
+ *
33
+ * A strike entry (a client revocation, a credential retirement, a recovery
34
+ * code's removal) signed by a standing credential's ladder writes `did.jsonl`
35
+ * alone, the bridge delegation's whole reach, so nothing in that ceremony
36
+ * republishes `did.json` and the served projection keeps naming the struck
37
+ * client or credential. A caller holding a store that may write the `id`
38
+ * collection -- a transient session under its generation delegation, an
39
+ * enrolled client under its own root authority -- hands one in and the
40
+ * projection lands with the entry.
41
+ *
42
+ * BEST-EFFORT, and the direction is deliberate. A failed PUT is warned and
43
+ * the entry publishes anyway: the residue is a projection this account's next
44
+ * visit mends through {@link ensureDidWebProjection}, where withholding the
45
+ * strike would leave the struck key standing in the log itself. Between the
46
+ * two write orders the same reasoning picks this one: a projection published
47
+ * before an entry that then fails under-lists a key the log still carries,
48
+ * which a `did:web` verifier reads as less authority rather than more.
49
+ *
50
+ * @param options {object}
51
+ * @param options.store {object} the narrow id-collection seam
52
+ * (`Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>`), the type
53
+ * the forget ceremony's `clientLogStore` already takes
54
+ * @returns {Function} `({ updated }) => Promise<void>`, the
55
+ * `signAccountEntry` hook
56
+ */
57
+ export function preEntryProjectionPublisher({ store }) {
58
+ return async ({ updated }) => {
59
+ try {
60
+ if (!updated.webDoc) {
61
+ // Every entry is built with `alsoKnownAsWeb`, so this is a defect
62
+ // rather than a state -- reported, and the entry still publishes.
63
+ log.warn('did:webvh: no did:web projection to publish before an entry.');
64
+ return;
65
+ }
66
+ await putDidWebProjection({ store, webDoc: updated.webDoc });
67
+ }
68
+ catch (err) {
69
+ log.warn('did:webvh: the pre-entry did:web projection PUT failed.', {
70
+ err
71
+ });
72
+ }
73
+ };
74
+ }
75
+ /**
76
+ * The error name a lost write precondition surfaces as -- was-client's
77
+ * `PreconditionFailedError`, and whatever an alternative store implementation
78
+ * throws under that name (the `WebvhIdStore` seam contract requires it).
79
+ */
80
+ const PRECONDITION_FAILED_ERROR_NAME = 'PreconditionFailedError';
81
+ /**
82
+ * THE PROJECTION FRESHNESS ENSURE: re-derives `did.json` from a resolved log's
83
+ * DID and document, compares it against what the host serves, and republishes
84
+ * only on a difference. The credential-only mender for a projection a
85
+ * ladder-signed entry left behind (see the module doc): a transient visit runs
86
+ * it through a store bound to its generation delegation, which covers the
87
+ * account Space's items subtree and so may write `id/did.json` with no
88
+ * widened bridge and no server change.
89
+ *
90
+ * The served document is compared as parsed JSON, key-order-insensitively, so
91
+ * a host (or an earlier writer) that reserialized the same document does not
92
+ * provoke a write. Absent, unparsable, and different all reach the write; only
93
+ * an equal document is left alone.
94
+ *
95
+ * A difference is not by itself evidence that the served projection is the
96
+ * stale side. The caller's `doc` was resolved at some earlier point, and a
97
+ * concurrent writer may have published a newer log entry with its matching
98
+ * projection since. Two guards keep this call from undoing that writer's work:
99
+ *
100
+ * 1. `refresh`, when supplied, re-resolves the log on the difference path.
101
+ * The write runs only when the derivation from the refreshed document
102
+ * still differs from what is served, so one extra read buys the ordering
103
+ * the plain compare cannot see.
104
+ * 2. The PUT is conditional on the served read: `If-Match` on its ETag, or
105
+ * `If-None-Match: *` when the projection was absent. A projection written
106
+ * between the read and the PUT wins, and the outcome is `conflict`.
107
+ *
108
+ * Read and write errors PROPAGATE, a failed precondition excepted. The call is
109
+ * one step of a login or a ceremony that has other work to do, and whether a
110
+ * stale projection is worth failing that work over is the caller's decision,
111
+ * not this function's -- every caller today treats it as best-effort.
112
+ *
113
+ * @param options {object}
114
+ * @param options.store {object} the narrow id-collection seam: the raw read
115
+ * plus the write (`Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>`,
116
+ * which `wasWebvhIdStore` and `delegatedWebvhLogStore` both satisfy). The
117
+ * read may be unauthenticated, the `id` collection being world-readable
118
+ * @param options.did {string} the account's did:webvh, from the resolved log
119
+ * @param options.doc {DIDDoc} the resolved did:webvh document
120
+ * @param [options.refresh] {Function} `() => Promise<{ did, doc }>`, a fresh
121
+ * resolution of the same log, called at most once and only on a detected
122
+ * difference. Its result replaces `did` / `doc` for the re-compare and for
123
+ * the write. Omitted, the caller's snapshot is written on any difference
124
+ * @returns {Promise<{ outcome: 'current' | 'republished' | 'conflict' }>}
125
+ * `current` when the served projection already matched (before or after the
126
+ * refresh) and nothing was written; `republished` when the PUT landed;
127
+ * `conflict` when it lost its precondition to a concurrent writer, whose
128
+ * projection stands and whose successor visit is the mender
129
+ */
130
+ export async function ensureDidWebProjection({ store, did, doc, refresh }) {
131
+ const served = await store.getIdResourceRaw({
132
+ resourceId: DID_DOCUMENT_RESOURCE
133
+ });
134
+ let expected = generateParallelDidWeb(did, doc);
135
+ if (served !== undefined && servedMatches({ text: served.text, expected })) {
136
+ return { outcome: 'current' };
137
+ }
138
+ if (refresh) {
139
+ const fresh = await refresh();
140
+ expected = generateParallelDidWeb(fresh.did, fresh.doc);
141
+ if (served !== undefined &&
142
+ servedMatches({ text: served.text, expected })) {
143
+ return { outcome: 'current' };
144
+ }
145
+ }
146
+ try {
147
+ await store.putIdResource({
148
+ resourceId: DID_DOCUMENT_RESOURCE,
149
+ content: expected,
150
+ contentType: 'application/did+json',
151
+ // Absent, the write is a create; present, an update-if-unchanged. A
152
+ // backend serving no ETag versions nothing, so that write degrades to
153
+ // an unconditional one, as every other publish here does.
154
+ ...(served === undefined
155
+ ? { ifNoneMatch: true }
156
+ : served.etag !== undefined
157
+ ? { ifMatch: served.etag }
158
+ : {})
159
+ });
160
+ }
161
+ catch (err) {
162
+ // Matched by name: error classes do not survive crossing package copies,
163
+ // and the seam contract names the `name` rather than the class.
164
+ if (err?.name !== PRECONDITION_FAILED_ERROR_NAME) {
165
+ throw err;
166
+ }
167
+ return { outcome: 'conflict' };
168
+ }
169
+ return { outcome: 'republished' };
170
+ }
171
+ /**
172
+ * Whether the served projection text is the expected document. An unparsable
173
+ * body reads as a mismatch rather than an error: whatever it is, it is not the
174
+ * projection, and republishing is the answer either way.
175
+ *
176
+ * The expected document is round-tripped through JSON before the comparison,
177
+ * so it is compared in the form the PUT would serialize it into -- a member
178
+ * whose value is `undefined` disappears on both sides rather than reading as a
179
+ * difference the write could never fix.
180
+ *
181
+ * @param options {object}
182
+ * @param options.text {string} the served body
183
+ * @param options.expected {object} the freshly derived projection
184
+ * @returns {boolean}
185
+ */
186
+ function servedMatches({ text, expected }) {
187
+ let parsed;
188
+ try {
189
+ parsed = JSON.parse(text);
190
+ }
191
+ catch {
192
+ return false;
193
+ }
194
+ return sameJsonValue(JSON.parse(JSON.stringify(expected)), parsed);
195
+ }
196
+ /**
197
+ * Structural JSON equality: object key order is immaterial, array order is
198
+ * not. Used to decide whether the projection needs republishing, so a false
199
+ * negative costs one idempotent PUT and a false positive would leave a stale
200
+ * document standing -- which is why it compares recursively rather than by
201
+ * serialized string.
202
+ *
203
+ * @param left {unknown}
204
+ * @param right {unknown}
205
+ * @returns {boolean}
206
+ */
207
+ function sameJsonValue(left, right) {
208
+ if (left === right) {
209
+ return true;
210
+ }
211
+ if (Array.isArray(left) || Array.isArray(right)) {
212
+ if (!Array.isArray(left) || !Array.isArray(right)) {
213
+ return false;
214
+ }
215
+ return (left.length === right.length &&
216
+ left.every((member, index) => sameJsonValue(member, right[index])));
217
+ }
218
+ if (typeof left !== 'object' ||
219
+ typeof right !== 'object' ||
220
+ left === null ||
221
+ right === null) {
222
+ return false;
223
+ }
224
+ const leftEntries = Object.entries(left);
225
+ const rightRecord = right;
226
+ return (leftEntries.length === Object.keys(rightRecord).length &&
227
+ leftEntries.every(([key, value]) => Object.prototype.hasOwnProperty.call(rightRecord, key) &&
228
+ sameJsonValue(value, rightRecord[key])));
229
+ }
230
+ //# sourceMappingURL=didWebProjection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"didWebProjection.js","sourceRoot":"","sources":["../../src/webvh/didWebProjection.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAG/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACxC,KAAK,EACL,MAAM,EAIP;IACC,MAAM,KAAK,CAAC,aAAa,CAAC;QACxB,UAAU,EAAE,qBAAqB;QACjC,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,sBAAsB;KACpC,CAAC,CAAA;AACJ,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