@interop/wallet-core 0.107.1 → 0.109.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 (208) hide show
  1. package/README.md +26 -24
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +3 -3
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +3 -3
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +10 -9
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +23 -19
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +5 -5
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +1 -1
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +10 -10
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +4 -4
  17. package/dist/clientAnnex/forgetLast.js.map +1 -1
  18. package/dist/clientAnnex/gc.d.ts +6 -6
  19. package/dist/clientAnnex/gc.d.ts.map +1 -1
  20. package/dist/clientAnnex/gc.js +13 -10
  21. package/dist/clientAnnex/gc.js.map +1 -1
  22. package/dist/clientAnnex/heal.d.ts +21 -19
  23. package/dist/clientAnnex/heal.d.ts.map +1 -1
  24. package/dist/clientAnnex/heal.js +25 -22
  25. package/dist/clientAnnex/heal.js.map +1 -1
  26. package/dist/clientAnnex/ladderAnchored.d.ts +40 -32
  27. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  28. package/dist/clientAnnex/ladderAnchored.js +33 -44
  29. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  30. package/dist/clientAnnex/log.d.ts +62 -61
  31. package/dist/clientAnnex/log.d.ts.map +1 -1
  32. package/dist/clientAnnex/log.js +68 -67
  33. package/dist/clientAnnex/log.js.map +1 -1
  34. package/dist/clientAnnex/mend.d.ts.map +1 -1
  35. package/dist/clientAnnex/mend.js +22 -16
  36. package/dist/clientAnnex/mend.js.map +1 -1
  37. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +4 -3
  38. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  39. package/dist/clientAnnex/recoveryLadderAnchored.js +1 -1
  40. package/dist/clientAnnex/selfEnroll.d.ts +3 -3
  41. package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
  42. package/dist/clientAnnex/selfEnroll.js +6 -7
  43. package/dist/clientAnnex/selfEnroll.js.map +1 -1
  44. package/dist/clientAnnex/spaceCapability.d.ts +6 -6
  45. package/dist/clientAnnex/spaceCapability.d.ts.map +1 -1
  46. package/dist/clientAnnex/spaceCapability.js +9 -12
  47. package/dist/clientAnnex/spaceCapability.js.map +1 -1
  48. package/dist/clients/index.d.ts +1 -1
  49. package/dist/clients/index.d.ts.map +1 -1
  50. package/dist/clients/index.js.map +1 -1
  51. package/dist/clients/listing.d.ts +12 -18
  52. package/dist/clients/listing.d.ts.map +1 -1
  53. package/dist/clients/listing.js +17 -13
  54. package/dist/clients/listing.js.map +1 -1
  55. package/dist/clients/revocation.d.ts +2 -2
  56. package/dist/clients/revocation.d.ts.map +1 -1
  57. package/dist/clients/revocation.js.map +1 -1
  58. package/dist/clients/rosterPolicy.d.ts +4 -4
  59. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  60. package/dist/clients/rosterPolicy.js +5 -4
  61. package/dist/clients/rosterPolicy.js.map +1 -1
  62. package/dist/connections/entry.d.ts +100 -9
  63. package/dist/connections/entry.d.ts.map +1 -1
  64. package/dist/connections/entry.js +104 -12
  65. package/dist/connections/entry.js.map +1 -1
  66. package/dist/connections/grantProof.d.ts.map +1 -1
  67. package/dist/connections/grantProof.js +4 -5
  68. package/dist/connections/grantProof.js.map +1 -1
  69. package/dist/connections/grants.d.ts.map +1 -1
  70. package/dist/connections/grants.js +3 -5
  71. package/dist/connections/grants.js.map +1 -1
  72. package/dist/connections/index.d.ts +9 -5
  73. package/dist/connections/index.d.ts.map +1 -1
  74. package/dist/connections/index.js +7 -4
  75. package/dist/connections/index.js.map +1 -1
  76. package/dist/connections/replicas.d.ts +227 -0
  77. package/dist/connections/replicas.d.ts.map +1 -0
  78. package/dist/connections/replicas.js +539 -0
  79. package/dist/connections/replicas.js.map +1 -0
  80. package/dist/connections/upsert.d.ts +75 -1
  81. package/dist/connections/upsert.d.ts.map +1 -1
  82. package/dist/connections/upsert.js +62 -34
  83. package/dist/connections/upsert.js.map +1 -1
  84. package/dist/enrollment/enrollment.d.ts.map +1 -1
  85. package/dist/enrollment/enrollment.js +4 -5
  86. package/dist/enrollment/enrollment.js.map +1 -1
  87. package/dist/genesis/accountGenesis.d.ts +4 -4
  88. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  89. package/dist/genesis/accountGenesis.js +4 -4
  90. package/dist/genesis/accountGenesis.js.map +1 -1
  91. package/dist/keyring/fetch.d.ts +3 -3
  92. package/dist/keyring/fetch.d.ts.map +1 -1
  93. package/dist/keyring/fetch.js +3 -3
  94. package/dist/keyring/fetch.js.map +1 -1
  95. package/dist/keyring/record.d.ts.map +1 -1
  96. package/dist/keyring/record.js +1 -2
  97. package/dist/keyring/record.js.map +1 -1
  98. package/dist/keyring/recordEnvelope.d.ts +8 -6
  99. package/dist/keyring/recordEnvelope.d.ts.map +1 -1
  100. package/dist/keyring/recordEnvelope.js +12 -6
  101. package/dist/keyring/recordEnvelope.js.map +1 -1
  102. package/dist/keyring/unlockSpace.d.ts +15 -15
  103. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  104. package/dist/keyring/unlockSpace.js +18 -19
  105. package/dist/keyring/unlockSpace.js.map +1 -1
  106. package/dist/keys/collectionLogStore.d.ts +3 -3
  107. package/dist/keys/collectionLogStore.d.ts.map +1 -1
  108. package/dist/keys/collectionLogStore.js +5 -7
  109. package/dist/keys/collectionLogStore.js.map +1 -1
  110. package/dist/keys/rosterStore.d.ts +3 -3
  111. package/dist/keys/rosterStore.d.ts.map +1 -1
  112. package/dist/keys/rosterStore.js +3 -4
  113. package/dist/keys/rosterStore.js.map +1 -1
  114. package/dist/recovery/continuation.d.ts +3 -9
  115. package/dist/recovery/continuation.d.ts.map +1 -1
  116. package/dist/recovery/continuation.js +1 -3
  117. package/dist/recovery/continuation.js.map +1 -1
  118. package/dist/recovery/index.d.ts +2 -1
  119. package/dist/recovery/index.d.ts.map +1 -1
  120. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  121. package/dist/recovery/recoveryDelegation.js +2 -21
  122. package/dist/recovery/recoveryDelegation.js.map +1 -1
  123. package/dist/recovery/recoveryWebvh.d.ts +21 -15
  124. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  125. package/dist/recovery/recoveryWebvh.js +12 -7
  126. package/dist/recovery/recoveryWebvh.js.map +1 -1
  127. package/dist/space/collections.d.ts +2 -2
  128. package/dist/space/collections.js +2 -2
  129. package/dist/space/deleteSpace.d.ts +3 -3
  130. package/dist/space/deleteSpace.d.ts.map +1 -1
  131. package/dist/space/deleteSpace.js +3 -4
  132. package/dist/space/deleteSpace.js.map +1 -1
  133. package/dist/space/errors.d.ts +1 -1
  134. package/dist/space/errors.js +1 -1
  135. package/dist/space/index.d.ts +4 -4
  136. package/dist/space/index.js +3 -3
  137. package/dist/space/provisioning.d.ts.map +1 -1
  138. package/dist/space/provisioning.js +6 -5
  139. package/dist/space/provisioning.js.map +1 -1
  140. package/dist/space/publicLink.d.ts +4 -4
  141. package/dist/space/publicLink.d.ts.map +1 -1
  142. package/dist/space/publicLink.js +9 -8
  143. package/dist/space/publicLink.js.map +1 -1
  144. package/dist/space/pwsLink.d.ts +58 -0
  145. package/dist/space/pwsLink.d.ts.map +1 -0
  146. package/dist/space/{wasLink.js → pwsLink.js} +42 -37
  147. package/dist/space/pwsLink.js.map +1 -0
  148. package/dist/testing/accountBuilder.d.ts +19 -19
  149. package/dist/testing/accountBuilder.d.ts.map +1 -1
  150. package/dist/testing/accountBuilder.js +45 -43
  151. package/dist/testing/accountBuilder.js.map +1 -1
  152. package/dist/unlock/index.d.ts +2 -1
  153. package/dist/unlock/index.d.ts.map +1 -1
  154. package/dist/unlock/retire.d.ts +7 -5
  155. package/dist/unlock/retire.d.ts.map +1 -1
  156. package/dist/unlock/retire.js +5 -4
  157. package/dist/unlock/retire.js.map +1 -1
  158. package/dist/unlock/standingWebvh.d.ts +24 -15
  159. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  160. package/dist/unlock/standingWebvh.js +32 -19
  161. package/dist/unlock/standingWebvh.js.map +1 -1
  162. package/dist/unlock/unlockRecord.d.ts.map +1 -1
  163. package/dist/unlock/unlockRecord.js +7 -7
  164. package/dist/unlock/unlockRecord.js.map +1 -1
  165. package/dist/webvh/accountEntry.d.ts +39 -50
  166. package/dist/webvh/accountEntry.d.ts.map +1 -1
  167. package/dist/webvh/accountEntry.js +133 -55
  168. package/dist/webvh/accountEntry.js.map +1 -1
  169. package/dist/webvh/clientAnnexDid.d.ts +21 -14
  170. package/dist/webvh/clientAnnexDid.d.ts.map +1 -1
  171. package/dist/webvh/clientAnnexDid.js +19 -14
  172. package/dist/webvh/clientAnnexDid.js.map +1 -1
  173. package/dist/webvh/delegatedLogStore.d.ts +7 -14
  174. package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
  175. package/dist/webvh/delegatedLogStore.js +10 -9
  176. package/dist/webvh/delegatedLogStore.js.map +1 -1
  177. package/dist/webvh/didWebProjection.d.ts +30 -49
  178. package/dist/webvh/didWebProjection.d.ts.map +1 -1
  179. package/dist/webvh/didWebProjection.js +9 -56
  180. package/dist/webvh/didWebProjection.js.map +1 -1
  181. package/dist/webvh/didWebvh.d.ts +19 -33
  182. package/dist/webvh/didWebvh.d.ts.map +1 -1
  183. package/dist/webvh/didWebvh.js +30 -41
  184. package/dist/webvh/didWebvh.js.map +1 -1
  185. package/dist/webvh/enrollClient.d.ts +5 -3
  186. package/dist/webvh/enrollClient.d.ts.map +1 -1
  187. package/dist/webvh/enrollClient.js +12 -10
  188. package/dist/webvh/enrollClient.js.map +1 -1
  189. package/dist/webvh/index.d.ts +2 -2
  190. package/dist/webvh/index.d.ts.map +1 -1
  191. package/dist/webvh/index.js +1 -1
  192. package/dist/webvh/index.js.map +1 -1
  193. package/dist/webvh/logLocation.d.ts +75 -0
  194. package/dist/webvh/logLocation.d.ts.map +1 -0
  195. package/dist/webvh/logLocation.js +102 -0
  196. package/dist/webvh/logLocation.js.map +1 -0
  197. package/dist/webvh/revokeClient.d.ts +10 -4
  198. package/dist/webvh/revokeClient.d.ts.map +1 -1
  199. package/dist/webvh/revokeClient.js +22 -22
  200. package/dist/webvh/revokeClient.js.map +1 -1
  201. package/dist/webvh/verifyLog.d.ts +9 -18
  202. package/dist/webvh/verifyLog.d.ts.map +1 -1
  203. package/dist/webvh/verifyLog.js +43 -50
  204. package/dist/webvh/verifyLog.js.map +1 -1
  205. package/package.json +7 -7
  206. package/dist/space/wasLink.d.ts +0 -57
  207. package/dist/space/wasLink.d.ts.map +0 -1
  208. package/dist/space/wasLink.js.map +0 -1
@@ -10,17 +10,31 @@
10
10
  * body accepts:
11
11
  *
12
12
  * - **client** -- an enrolled client's did:webvh update keys. The active key
13
- * is derived from the seed, the published log must authorize it, the
14
- * carry-over commitments must hold, and the entry publishes `did.jsonl`
15
- * beside its `did:web` projection (the client invokes as the controller, so
16
- * it may write both).
13
+ * is derived from the seed, the published log must authorize it, and the
14
+ * carry-over commitments must hold.
17
15
  * - **ladder** -- a standing credential's ladder seed, signing through the
18
16
  * record's bridge delegation. The rung is attributed from the published log
19
17
  * ({@link attributeLadderRung}, fail-closed), the acting rung reveals itself
20
- * in the entry it signs, the rung's own hash is kept committed beside the
21
- * build's own commit hashes in `decisions/0007` order, and the entry
22
- * publishes `did.jsonl` alone -- the bridge's whole reach. The projection is
23
- * the ceremony's own pre-entry PUT, or the next visit's ensure.
18
+ * in the entry it signs, and the rung's own hash is kept committed beside
19
+ * the build's own commit hashes in `decisions/0007` order.
20
+ *
21
+ * Neither arm writes the `did:web` projection through the log store. The
22
+ * entry publishes `did.jsonl` through `idStore` on every arm, and `did.json`
23
+ * is written only through a `projectionStore` the caller hands in, which is
24
+ * how a bridge-delegated store (a PUT on `did.jsonl` alone) and a
25
+ * controller-invoking one satisfy the same seam. The projection has two
26
+ * timings and one failure rule each (`projectionTiming`): AFTER the entry,
27
+ * the default, it is a derived cache of the entry that just landed, and a
28
+ * failed PUT throws past the pivot so a re-run republishes it from the
29
+ * idempotent path ({@link concludeUnchangedAccountEntry}); BEFORE the entry,
30
+ * for a ceremony whose entry ends the authority that writes it, a failed PUT
31
+ * warns and the entry publishes anyway, since a projection the next visit's
32
+ * ensure mends is a smaller residue than a struck key the log still lists.
33
+ * Which timing an entry takes is the seam's own decision, from the signer arm
34
+ * and the caller's `removesInventory`: a ladder-signed removal writes before,
35
+ * every other entry after. The idempotent path (`build`'s `concludeUnchanged`)
36
+ * republishes only under the AFTER timing, since under BEFORE the store's
37
+ * authority may already have ended at the entry an earlier run landed.
24
38
  *
25
39
  * A third arm is the seam's alone ({@link AccountEntrySigner}):
26
40
  *
@@ -57,10 +71,27 @@
57
71
  */
58
72
  import { updateDID } from '@interop/did-method-webvh';
59
73
  import { deriveNextKeyHash } from '@interop/did-method-webvh';
74
+ import { log } from '../log.js';
60
75
  import { assertCarryOverCommitments, assertPublishedLogDid, concludeWithPublishedLog, putLogResource, readPublishedLogOrThrow, updateKeyMultibase, updateKeySigner } from './didWebvh.js';
61
76
  import { putDidWebProjection } from './didWebProjection.js';
62
77
  import { assertBuiltOnHeadReached, assertBuiltOnHeadShape } from './builtOnHead.js';
63
78
  import { attributeLadderRung } from './ladder.js';
79
+ /**
80
+ * The timing rule, applied in this one place. `'before'` only for a
81
+ * ladder-signed entry that removes inventory, since that entry may strike the
82
+ * ladder VM or the client the projection store invokes as. Every other entry
83
+ * takes `'after'`, the enrolled arm's included: a client cannot remove
84
+ * itself, so its authority survives what it signs.
85
+ *
86
+ * @param options {object}
87
+ * @param options.signer {AccountEntrySigner} the arm the ceremony acts as
88
+ * @param options.removesInventory {boolean} whether the entry strikes a
89
+ * member of the document's inventory
90
+ * @returns {ProjectionTiming}
91
+ */
92
+ function projectionTimingOf({ signer, removesInventory }) {
93
+ return removesInventory && signer.kind === 'ladder' ? 'before' : 'after';
94
+ }
64
95
  /**
65
96
  * The head an entry leaves standing, assembled from what the entry's own
66
97
  * `updateDID` already resolved plus the publish's validator when an entry was
@@ -111,8 +142,15 @@ export function accountEntryHead({ outcome }) {
111
142
  * `did.jsonl` PUT
112
143
  * @param options.signer {AccountEntrySigner} who signs this entry
113
144
  * @param options.build {function}
114
- * `({ published, rung, state }) => AccountEntryFields | undefined` -- the
115
- * entry's own members, or `undefined` to decline
145
+ * `({ published, rung, state, concludeUnchanged }) => AccountEntryFields |
146
+ * undefined` -- the entry's own members, or `undefined` to decline.
147
+ * `concludeUnchanged()` is the idempotent path's conclusion, bound to this
148
+ * call's projection store and timing: it republishes the projection from
149
+ * the read under the `'after'` timing alone (healing a lag a torn earlier
150
+ * run's thrown post-entry PUT left behind) and writes nothing under
151
+ * `'before'`, since the entry an earlier run landed may have ended the
152
+ * store's authority. A ceremony whose build finds its entry already landed
153
+ * awaits it and declines
116
154
  * @param [options.skip] {function} `(published) => boolean` -- run on the
117
155
  * read, before any attribution; `true` returns `skipped` with nothing
118
156
  * published
@@ -135,24 +173,25 @@ export function accountEntryHead({ outcome }) {
135
173
  * when `did.jsonl` is absent
136
174
  * @param [options.verb] {string} what the caller is doing, for the client
137
175
  * arm's pending-rotation refusal message (e.g. `'revoking a client'`)
138
- * @param [options.logOnly] {boolean} publish `did.jsonl` without its
139
- * `did:web` projection. Defaults per arm: `true` on the ladder arm, whose
140
- * bridge reaches `did.jsonl` alone, and `false` on the enrolled arm, which
141
- * invokes as the controller. A ladder-signed entry written through a
142
- * root-invoking store (the establishment's stage 3) passes `false` to
143
- * republish the projection beside the entry; the committed arm states it,
144
- * since which store it signs through is the caller's
145
- * @param [options.beforePublish] {function} `({ updated }) => Promise<void>`
146
- * -- run on the built entry, AFTER `updateDID` and BEFORE the conditional
147
- * publish. The seam exists for the `did:web` projection: a ladder-signed
148
- * entry writes `did.jsonl` alone, so a ceremony whose entry removes
149
- * inventory has to publish the post-entry projection while the authority it
150
- * is about to end can still write it. A throw propagates and nothing is
151
- * published. It runs once per attempt, so a conflict retry invokes it again
152
- * and it must be idempotent
176
+ * @param [options.projectionStore] {DidWebProjectionStore} a store whose
177
+ * authority reaches `did.json`. Given, the post-entry `did:web` projection
178
+ * (`updateDID`'s own `webDoc`) is PUT through it and through nothing else;
179
+ * omitted, no projection is written on any arm and the next
180
+ * `ensureDidWebProjection` is the mender. An enrolled client passes its
181
+ * controller-invoking store, a transient visit its generation-delegated
182
+ * store, and a caller holding the bridge delegation alone omits it
183
+ * @param [options.removesInventory] {boolean} whether this entry strikes
184
+ * a member of the document's inventory (default `false`). It decides the
185
+ * projection's timing. A ladder-signed removal PUTs the projection after
186
+ * `updateDID` and before the conditional publish, since the entry may end
187
+ * the authority the store invokes under, and a failed PUT is warned and
188
+ * the entry publishes anyway; that write runs once per attempt, so a
189
+ * conflict retry PUTs it again. Every other entry PUTs it after `did.jsonl`
190
+ * lands, and a failed PUT throws
153
191
  * @returns {Promise<AccountEntryOutcome>}
154
192
  */
155
- export async function signAccountEntry({ idStore, signer, build, skip, published: alreadyRead, expectedDid, builtOnHead, missingMessage, verb = 'extending the account log', logOnly = signer.kind === 'ladder', beforePublish }) {
193
+ export async function signAccountEntry({ idStore, signer, build, skip, published: alreadyRead, expectedDid, builtOnHead, missingMessage, verb = 'extending the account log', projectionStore, removesInventory = false }) {
194
+ const projectionTiming = projectionTimingOf({ signer, removesInventory });
156
195
  // A resume skips nothing on the strength of a marker it cannot compare:
157
196
  // refused before any read, rather than resuming unguarded.
158
197
  if (builtOnHead !== undefined) {
@@ -194,7 +233,15 @@ export async function signAccountEntry({ idStore, signer, build, skip, published
194
233
  const ladderParts = attributed === undefined
195
234
  ? {}
196
235
  : { rung: attributed.rung, rungHash: rungHash, state: attributed.state };
197
- const entry = await build({ published, ...ladderParts });
236
+ const entry = await build({
237
+ published,
238
+ ...ladderParts,
239
+ concludeUnchanged: () => concludeUnchangedAccountEntry({
240
+ projectionStore,
241
+ projectionTiming,
242
+ published
243
+ })
244
+ });
198
245
  if (!entry) {
199
246
  return { skipped: false, published, ...ladderParts };
200
247
  }
@@ -262,12 +309,12 @@ export async function signAccountEntry({ idStore, signer, build, skip, published
262
309
  updateKeys: signedUpdateKeys,
263
310
  nextKeyHashes: signedHashes
264
311
  });
265
- await beforePublish?.({ updated });
266
312
  const written = await publishAccountEntry({
267
313
  idStore,
268
314
  updated,
269
315
  ifMatch: published.etag,
270
- logOnly
316
+ projectionStore,
317
+ projectionTiming
271
318
  });
272
319
  return {
273
320
  skipped: false,
@@ -280,56 +327,87 @@ export async function signAccountEntry({ idStore, signer, build, skip, published
280
327
  /**
281
328
  * The publish tail: `did.jsonl` under the caller's compare-and-swap token
282
329
  * (which advances the store's pin, for both arms, so a host rolling the log
283
- * back straight afterwards is refused on the next read), then its `did:web`
284
- * projection where the signer may write one.
330
+ * back straight afterwards is refused on the next read), with the `did:web`
331
+ * projection PUT through the projection store alone, before or after the
332
+ * log per the timing. The log store is never asked for the projection.
333
+ *
334
+ * The two failure rules live here and nowhere else. After the pivot the PUT
335
+ * throws: the entry stands, and the ceremony's re-run republishes the
336
+ * projection through its idempotent path. Before the pivot the PUT is
337
+ * best-effort, and the direction is deliberate: a projection published before
338
+ * an entry that then fails under-lists a key the log still carries, which a
339
+ * `did:web` verifier reads as less authority rather than more, while
340
+ * withholding the entry over a failed projection would leave the struck key
341
+ * standing in the log itself. The residue either way is a projection the next
342
+ * `ensureDidWebProjection` mends.
285
343
  *
286
344
  * @param options {object}
287
345
  * @param options.idStore {AccountLogStore}
288
346
  * @param options.updated {object} the `updateDID` result
289
347
  * @param [options.ifMatch] {string} the ETag of the read this entry was
290
348
  * built on
291
- * @param options.logOnly {boolean} skip the projection PUT
349
+ * @param [options.projectionStore] {DidWebProjectionStore} the one store the
350
+ * projection is written through; omitted, no projection is written
351
+ * @param options.projectionTiming {ProjectionTiming}
292
352
  * @returns {Promise<{ etag?: string }>} the LOG's new validator
293
353
  */
294
- async function publishAccountEntry({ idStore, updated, ifMatch, logOnly }) {
295
- if (!logOnly && !updated.webDoc) {
296
- throw new Error('did:webvh: updateDID returned no webDoc despite the did:web alsoKnownAs.');
354
+ async function publishAccountEntry({ idStore, updated, ifMatch, projectionStore, projectionTiming }) {
355
+ // One projection write, shared by both timings; only the failure rule
356
+ // around it differs.
357
+ const putProjection = async (store) => {
358
+ if (!updated.webDoc) {
359
+ // Every entry is built with `alsoKnownAsWeb`, so this is a defect
360
+ // rather than a state.
361
+ throw new Error('did:webvh: updateDID returned no webDoc despite the did:web ' +
362
+ 'alsoKnownAs.');
363
+ }
364
+ await putDidWebProjection({ store, webDoc: updated.webDoc });
365
+ };
366
+ if (projectionStore !== undefined && projectionTiming === 'before') {
367
+ try {
368
+ await putProjection(projectionStore);
369
+ }
370
+ catch (err) {
371
+ log.warn('did:webvh: the pre-entry did:web projection PUT failed.', {
372
+ err
373
+ });
374
+ }
297
375
  }
298
376
  const written = await putLogResource({
299
377
  store: idStore,
300
378
  log: updated.log,
301
379
  ...(ifMatch !== undefined ? { ifMatch } : {})
302
380
  });
303
- if (!logOnly) {
304
- await putDidWebProjection({
305
- store: idStore,
306
- webDoc: updated.webDoc
307
- });
381
+ if (projectionStore !== undefined && projectionTiming === 'after') {
382
+ await putProjection(projectionStore);
308
383
  }
309
384
  return written;
310
385
  }
311
386
  /**
312
387
  * The head a ceremony concludes on when its entry turns out to be
313
- * unnecessary -- the client is already enrolled, the removal already landed.
314
- * There is nothing to publish either way; what differs is the `did:web`
315
- * projection. The enrolled arm invokes as the account's controller, so it
316
- * republishes the projection and heals a lag a torn earlier run of the same
317
- * ceremony left behind. The ladder arm's bridge reaches `did.jsonl` alone, so
318
- * it takes the read verbatim and leaves the projection to
319
- * `ensureDidWebProjection`.
388
+ * unnecessary -- the client is already enrolled, the removal already landed,
389
+ * the pointer already set. `build` reaches it as `concludeUnchanged`, bound
390
+ * to the seam call's own store and timing. There is nothing to publish either
391
+ * way; what differs is the `did:web` projection. The projection is republished
392
+ * from the resolved log through the store under the `'after'` timing, which
393
+ * heals a lag a torn earlier run of the same ceremony left behind (a
394
+ * post-entry PUT that threw after the log landed). Under the `'before'`
395
+ * timing nothing is written: the entry an earlier run landed may have ended
396
+ * the authority the store invokes under, so the PUT could only be refused.
397
+ * Without a store the read is taken verbatim. Either way the projection is
398
+ * otherwise left to `ensureDidWebProjection`.
320
399
  *
321
400
  * @param options {object}
322
- * @param options.idStore {WebvhIdStore}
323
- * @param options.signer {AccountLogSigner} the arm the ceremony acts as
401
+ * @param [options.projectionStore] {DidWebProjectionStore} the store the
402
+ * projection is republished through; omitted, nothing is written
403
+ * @param options.projectionTiming {ProjectionTiming} the timing the entry
404
+ * would have taken; `'before'` writes nothing here
324
405
  * @param options.published {PublishedWebvhLog} the read the build stood on
325
406
  * @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>}
326
407
  */
327
- export async function concludeUnchangedAccountEntry({ idStore, signer, published }) {
328
- if (signer.kind === 'enrolled') {
329
- return {
330
- ...(await concludeWithPublishedLog({ idStore, published })),
331
- log: published.log
332
- };
408
+ async function concludeUnchangedAccountEntry({ projectionStore, projectionTiming, published }) {
409
+ if (projectionStore !== undefined && projectionTiming === 'after') {
410
+ await concludeWithPublishedLog({ idStore: projectionStore, published });
333
411
  }
334
412
  return { did: published.did, doc: published.doc, log: published.log };
335
413
  }
@@ -1 +1 @@
1
- {"version":3,"file":"accountEntry.js","sourceRoot":"","sources":["../../src/webvh/accountEntry.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;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AAE,CAAC;KAC9C,CAAC,CAAA;IACF,IAAI,eAAe,KAAK,SAAS,IAAI,gBAAgB,KAAK,OAAO,EAAE,CAAC;QAClE,MAAM,aAAa,CAAC,eAAe,CAAC,CAAA;IACtC,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,KAAK,UAAU,6BAA6B,CAAC,EAC3C,eAAe,EACf,gBAAgB,EAChB,SAAS,EAKV;IACC,IAAI,eAAe,KAAK,SAAS,IAAI,gBAAgB,KAAK,OAAO,EAAE,CAAC;QAClE,MAAM,wBAAwB,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC,CAAA;IACzE,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAA;AACvE,CAAC"}
@@ -4,8 +4,9 @@
4
4
  /**
5
5
  * The client annex DID string's shape, on its own import-free leaf so a base
6
6
  * module can recognize and parse an annex DID without the annex module: the
7
- * generation id convention, the parse of an annex did:webvh into its host,
8
- * auxiliary Space id, and generation id, and the predicate over that parse.
7
+ * generation id convention, the parse of an annex did:webvh into its Space
8
+ * location, auxiliary Space id, and generation id, and the predicate over
9
+ * that parse.
9
10
  * The annex module (`clientAnnex/log.ts`, `clientAnnex/grantRevocation.ts`)
10
11
  * re-exports these, so its public surface is unchanged.
11
12
  */
@@ -29,24 +30,30 @@ export declare function assertGenerationId(generationId: string): void;
29
30
  * {@link parseClientAnnexDid} reads them.
30
31
  */
31
32
  export interface ClientAnnexDidParts {
32
- host: string;
33
+ /**
34
+ * The identifier segments naming the annex Space: the host, any base
35
+ * server URL path prefix, the `space` segment and the Space id, joined by
36
+ * colons as the DID carries them. Two annex DIDs with equal
37
+ * `spaceLocation` name the same Space on the same server.
38
+ */
39
+ spaceLocation: string;
33
40
  spaceId: string;
34
41
  generationId: string;
35
42
  }
36
43
  /**
37
- * Parses the host, the auxiliary Space id and the generation id out of an
38
- * annex DID string, or returns `undefined` when the string is not an annex
39
- * did:webvh. All three are permanent substrings of every annex DID by
40
- * construction: the generation id is the final path segment of the annex
41
- * DID (`did:webvh:<scid>:<host>:...:space:<spaceId>:<generationId>`), so
42
- * this parse is what lets an enrollee find the generation's log from the
44
+ * Parses the Space location, the auxiliary Space id and the generation id
45
+ * out of an annex DID string, or returns `undefined` when the string is not
46
+ * an annex did:webvh. All three are permanent substrings of every annex DID
47
+ * by construction: the generation id is the final path segment of the annex
48
+ * DID (`did:webvh:<scid>:<host>:<prefix...>:space:<spaceId>:<generationId>`),
49
+ * so this parse is what lets an enrollee find the generation's log from the
43
50
  * pointer alone -- no registry.
44
51
  *
45
- * The host is the method-specific id's second segment, percent-decoded (a
46
- * port rides as `%3A` inside the one segment). A caller enumerating Spaces
47
- * out of a log compares it against the deployment it is talking to: an
48
- * account that has migrated hosts carries entries naming the old one, which
49
- * this deployment cannot address.
52
+ * The Space location is everything between the SCID and the generation id,
53
+ * verbatim: the host segment (a port rides as `%3A` inside it), the base
54
+ * server URL's path prefix segments, `space`, and the Space id. A caller
55
+ * that needs the server as a URL resolves the DID through the webvh
56
+ * module's log-location inverse; the leaf stays string-only.
50
57
  *
51
58
  * @param did {string}
52
59
  * @returns {ClientAnnexDidParts | undefined}
@@ -1 +1 @@
1
- {"version":3,"file":"clientAnnexDid.d.ts","sourceRoot":"","sources":["../../src/webvh/clientAnnexDid.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,SAAS,CAAA;AAQ1C;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAO7D;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;CACrB;AAgCD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,GACV,mBAAmB,GAAG,SAAS,CAMjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,mBAAmB,CAOtB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD"}
1
+ {"version":3,"file":"clientAnnexDid.d.ts","sourceRoot":"","sources":["../../src/webvh/clientAnnexDid.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,SAAS,CAAA;AAQ1C;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAO7D;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;CACrB;AAoCD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,GACV,mBAAmB,GAAG,SAAS,CAMjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,mBAAmB,CAOtB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD"}
@@ -4,8 +4,9 @@
4
4
  /**
5
5
  * The client annex DID string's shape, on its own import-free leaf so a base
6
6
  * module can recognize and parse an annex DID without the annex module: the
7
- * generation id convention, the parse of an annex did:webvh into its host,
8
- * auxiliary Space id, and generation id, and the predicate over that parse.
7
+ * generation id convention, the parse of an annex did:webvh into its Space
8
+ * location, auxiliary Space id, and generation id, and the predicate over
9
+ * that parse.
9
10
  * The annex module (`clientAnnex/log.ts`, `clientAnnex/grantRevocation.ts`)
10
11
  * re-exports these, so its public surface is unchanged.
11
12
  */
@@ -59,22 +60,26 @@ function splitClientAnnexDid(did) {
59
60
  host.length === 0) {
60
61
  return undefined;
61
62
  }
62
- return { host: decodeURIComponent(host), spaceId, generationId };
63
+ return {
64
+ spaceLocation: parts.slice(3, parts.length - 1).join(':'),
65
+ spaceId,
66
+ generationId
67
+ };
63
68
  }
64
69
  /**
65
- * Parses the host, the auxiliary Space id and the generation id out of an
66
- * annex DID string, or returns `undefined` when the string is not an annex
67
- * did:webvh. All three are permanent substrings of every annex DID by
68
- * construction: the generation id is the final path segment of the annex
69
- * DID (`did:webvh:<scid>:<host>:...:space:<spaceId>:<generationId>`), so
70
- * this parse is what lets an enrollee find the generation's log from the
70
+ * Parses the Space location, the auxiliary Space id and the generation id
71
+ * out of an annex DID string, or returns `undefined` when the string is not
72
+ * an annex did:webvh. All three are permanent substrings of every annex DID
73
+ * by construction: the generation id is the final path segment of the annex
74
+ * DID (`did:webvh:<scid>:<host>:<prefix...>:space:<spaceId>:<generationId>`),
75
+ * so this parse is what lets an enrollee find the generation's log from the
71
76
  * pointer alone -- no registry.
72
77
  *
73
- * The host is the method-specific id's second segment, percent-decoded (a
74
- * port rides as `%3A` inside the one segment). A caller enumerating Spaces
75
- * out of a log compares it against the deployment it is talking to: an
76
- * account that has migrated hosts carries entries naming the old one, which
77
- * this deployment cannot address.
78
+ * The Space location is everything between the SCID and the generation id,
79
+ * verbatim: the host segment (a port rides as `%3A` inside it), the base
80
+ * server URL's path prefix segments, `space`, and the Space id. A caller
81
+ * that needs the server as a URL resolves the DID through the webvh
82
+ * module's log-location inverse; the leaf stays string-only.
78
83
  *
79
84
  * @param did {string}
80
85
  * @returns {ClientAnnexDidParts | undefined}
@@ -1 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,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,GAAG,EAGJ;IACC,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAA;IACtC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,IAAI,CAAC,CAAA;IAC5D,CAAC;IACD,kBAAkB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IACtC,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,OAAO,mBAAmB,CAAC,GAAG,CAAC,KAAK,SAAS,CAAA;AAC/C,CAAC"}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  /**
5
5
  * The delegated did:webvh log store: the narrow read-and-publish seam
6
- * ({@link DelegatedWebvhLogStore}) served through a pre-minted delegation
6
+ * ({@link AccountLogStore}) served through a pre-minted delegation
7
7
  * rather than controller authority. Two credential-held bridges write
8
8
  * through it: the unlock record's `did.jsonl` bridge into the account log
9
9
  * (world-readable, so its reads stay unauthenticated), and the client
@@ -35,14 +35,7 @@ import type { IZcap } from '@interop/data-integrity-core';
35
35
  import type { ZcapClient } from '@interop/ezcap';
36
36
  import type { ResourceLogPinStore } from '@interop/vh-resource-log';
37
37
  import { type ServiceDescription } from '@interop/was-client';
38
- import type { WebvhIdStore } from './didWebvh.js';
39
- /**
40
- * The narrow store shape a delegated bridge serves: the log read plus the
41
- * conditional `did.jsonl` publish. A subset of {@link WebvhIdStore}, so it
42
- * satisfies the ceremony seams (`UnlockLogStore`, `RecoveryLogStore`, and the
43
- * annex ceremonies) structurally.
44
- */
45
- export type DelegatedWebvhLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource' | 'pin'>;
38
+ import type { AccountLogStore } from './accountEntry.js';
46
39
  /**
47
40
  * Builds a delegated log store over one collection of one Space.
48
41
  *
@@ -56,7 +49,7 @@ export type DelegatedWebvhLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'pu
56
49
  * token.
57
50
  *
58
51
  * @param options {object}
59
- * @param options.host {string} the storage server's base URL
52
+ * @param options.baseServerUrl {string} the server's base server URL
60
53
  * @param options.spaceId {string} the Space holding the collection
61
54
  * @param options.collectionId {string} the collection holding the log
62
55
  * @param options.delegation {IZcap} the pre-minted delegation the writes
@@ -69,15 +62,15 @@ export type DelegatedWebvhLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'pu
69
62
  * @param [options.serviceDescription] {ServiceDescription} the server's
70
63
  * service description a client the caller already holds discovered
71
64
  * (`(await was.service()).description`), so this one skips discovery
72
- * @returns {DelegatedWebvhLogStore}
65
+ * @returns {AccountLogStore}
73
66
  */
74
- export declare function delegatedWebvhLogStore({ host, spaceId, collectionId, delegation, zcapClient, pinStore, serviceDescription }: {
75
- host: string;
67
+ export declare function delegatedWebvhLogStore({ baseServerUrl, spaceId, collectionId, delegation, zcapClient, pinStore, serviceDescription }: {
68
+ baseServerUrl: string;
76
69
  spaceId: string;
77
70
  collectionId: string;
78
71
  delegation: IZcap;
79
72
  zcapClient: ZcapClient;
80
73
  pinStore: ResourceLogPinStore;
81
74
  serviceDescription?: ServiceDescription;
82
- }): DelegatedWebvhLogStore;
75
+ }): AccountLogStore;
83
76
  //# sourceMappingURL=delegatedLogStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delegatedLogStore.d.ts","sourceRoot":"","sources":["../../src/webvh/delegatedLogStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAGL,KAAK,kBAAkB,EACxB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,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,KAAK,CAAA;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;CACxC,GAAG,eAAe,CAuGlB"}
@@ -1,5 +1,5 @@
1
1
  import { PreconditionFailedError, WasClient } from '@interop/was-client';
2
- import { resourcePath, toUrl, spacesUrl } from '@interop/was-client/paths';
2
+ import { resourceUrl, spaceUrlById } from '@interop/was-client/paths';
3
3
  import { WALLET_SPACE_PROVISION_ROSTER } from '../space/collections.js';
4
4
  import { logResourcePinId } from './verifyLog.js';
5
5
  /**
@@ -37,7 +37,7 @@ function collectionIsPublic({ collectionId }) {
37
37
  * token.
38
38
  *
39
39
  * @param options {object}
40
- * @param options.host {string} the storage server's base URL
40
+ * @param options.baseServerUrl {string} the server's base server URL
41
41
  * @param options.spaceId {string} the Space holding the collection
42
42
  * @param options.collectionId {string} the collection holding the log
43
43
  * @param options.delegation {IZcap} the pre-minted delegation the writes
@@ -50,16 +50,17 @@ function collectionIsPublic({ collectionId }) {
50
50
  * @param [options.serviceDescription] {ServiceDescription} the server's
51
51
  * service description a client the caller already holds discovered
52
52
  * (`(await was.service()).description`), so this one skips discovery
53
- * @returns {DelegatedWebvhLogStore}
53
+ * @returns {AccountLogStore}
54
54
  */
55
- export function delegatedWebvhLogStore({ host, spaceId, collectionId, delegation, zcapClient, pinStore, serviceDescription }) {
55
+ export function delegatedWebvhLogStore({ baseServerUrl, spaceId, collectionId, delegation, zcapClient, pinStore, serviceDescription }) {
56
56
  const publicRead = collectionIsPublic({ collectionId });
57
57
  const was = new WasClient({
58
- serverUrl: spacesUrl({ baseUrl: host }),
58
+ baseServerUrl,
59
59
  zcapClient,
60
60
  serviceDescription
61
61
  });
62
- const pathOf = (resourceId) => resourcePath(spaceId, collectionId, resourceId);
62
+ const spaceUrl = spaceUrlById({ baseServerUrl, spaceId });
63
+ const urlOf = (resourceId) => resourceUrl({ spaceUrl, collectionId, resourceId });
63
64
  return {
64
65
  pin: {
65
66
  store: pinStore,
@@ -67,7 +68,7 @@ export function delegatedWebvhLogStore({ host, spaceId, collectionId, delegation
67
68
  },
68
69
  async getIdResourceRaw({ resourceId }) {
69
70
  if (publicRead) {
70
- const response = await fetch(toUrl({ baseUrl: host, path: pathOf(resourceId) }));
71
+ const response = await fetch(urlOf(resourceId));
71
72
  if (response.status === 404) {
72
73
  return undefined;
73
74
  }
@@ -82,7 +83,7 @@ export function delegatedWebvhLogStore({ host, spaceId, collectionId, delegation
82
83
  let response;
83
84
  try {
84
85
  response = await was.request({
85
- path: pathOf(resourceId),
86
+ url: urlOf(resourceId),
86
87
  method: 'GET',
87
88
  capability: delegation
88
89
  });
@@ -112,7 +113,7 @@ export function delegatedWebvhLogStore({ host, spaceId, collectionId, delegation
112
113
  let response;
113
114
  try {
114
115
  response = await was.request({
115
- path: pathOf(resourceId),
116
+ url: urlOf(resourceId),
116
117
  method: 'PUT',
117
118
  headers,
118
119
  body: new TextEncoder().encode(serialized),
@@ -1 +1 @@
1
- {"version":3,"file":"delegatedLogStore.js","sourceRoot":"","sources":["../../src/webvh/delegatedLogStore.ts"],"names":[],"mappings":"AAoCA,OAAO,EACL,uBAAuB,EACvB,SAAS,EAEV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAajD;;;;;GAKG;AACH,SAAS,QAAQ,CAAC,GAAY;IAC5B,MAAM,MAAM,GAAI,GAA4B,EAAE,MAAM,CAAA;IACpD,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,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