@interop/wallet-core 0.101.1 → 0.104.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 (135) hide show
  1. package/README.md +36 -17
  2. package/dist/audiences/audienceGrant.d.ts +49 -0
  3. package/dist/audiences/audienceGrant.d.ts.map +1 -0
  4. package/dist/audiences/audienceGrant.js +46 -0
  5. package/dist/audiences/audienceGrant.js.map +1 -0
  6. package/dist/audiences/index.d.ts +10 -0
  7. package/dist/audiences/index.d.ts.map +1 -0
  8. package/dist/audiences/index.js +10 -0
  9. package/dist/audiences/index.js.map +1 -0
  10. package/dist/clientAnnex/grantRevocation.d.ts +0 -18
  11. package/dist/clientAnnex/grantRevocation.d.ts.map +1 -1
  12. package/dist/clientAnnex/grantRevocation.js +2 -40
  13. package/dist/clientAnnex/grantRevocation.js.map +1 -1
  14. package/dist/clientAnnex/index.d.ts +2 -1
  15. package/dist/clientAnnex/index.d.ts.map +1 -1
  16. package/dist/clientAnnex/index.js +2 -1
  17. package/dist/clientAnnex/index.js.map +1 -1
  18. package/dist/clientAnnex/log.d.ts +4 -42
  19. package/dist/clientAnnex/log.d.ts.map +1 -1
  20. package/dist/clientAnnex/log.js +10 -65
  21. package/dist/clientAnnex/log.js.map +1 -1
  22. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  23. package/dist/clients/rosterPolicy.js +3 -1
  24. package/dist/clients/rosterPolicy.js.map +1 -1
  25. package/dist/connections/didKey.d.ts +27 -0
  26. package/dist/connections/didKey.d.ts.map +1 -1
  27. package/dist/connections/didKey.js +42 -6
  28. package/dist/connections/didKey.js.map +1 -1
  29. package/dist/connections/entry.d.ts +95 -13
  30. package/dist/connections/entry.d.ts.map +1 -1
  31. package/dist/connections/entry.js +102 -16
  32. package/dist/connections/entry.js.map +1 -1
  33. package/dist/connections/grantProof.d.ts +64 -0
  34. package/dist/connections/grantProof.d.ts.map +1 -0
  35. package/dist/connections/grantProof.js +195 -0
  36. package/dist/connections/grantProof.js.map +1 -0
  37. package/dist/connections/grants.d.ts +225 -3
  38. package/dist/connections/grants.d.ts.map +1 -1
  39. package/dist/connections/grants.js +293 -8
  40. package/dist/connections/grants.js.map +1 -1
  41. package/dist/connections/index.d.ts +22 -8
  42. package/dist/connections/index.d.ts.map +1 -1
  43. package/dist/connections/index.js +19 -6
  44. package/dist/connections/index.js.map +1 -1
  45. package/dist/connections/read.d.ts.map +1 -1
  46. package/dist/connections/read.js +2 -1
  47. package/dist/connections/read.js.map +1 -1
  48. package/dist/connections/resourceId.d.ts +33 -0
  49. package/dist/connections/resourceId.d.ts.map +1 -1
  50. package/dist/connections/resourceId.js +88 -8
  51. package/dist/connections/resourceId.js.map +1 -1
  52. package/dist/connections/upsert.d.ts +252 -7
  53. package/dist/connections/upsert.d.ts.map +1 -1
  54. package/dist/connections/upsert.js +674 -41
  55. package/dist/connections/upsert.js.map +1 -1
  56. package/dist/connections/writers.js +2 -1
  57. package/dist/connections/writers.js.map +1 -1
  58. package/dist/descriptors/index.d.ts +5 -0
  59. package/dist/descriptors/index.d.ts.map +1 -1
  60. package/dist/descriptors/index.js +5 -0
  61. package/dist/descriptors/index.js.map +1 -1
  62. package/dist/descriptors/logSource.d.ts +9 -4
  63. package/dist/descriptors/logSource.d.ts.map +1 -1
  64. package/dist/descriptors/logSource.js +13 -6
  65. package/dist/descriptors/logSource.js.map +1 -1
  66. package/dist/jsonObject.d.ts +16 -0
  67. package/dist/jsonObject.d.ts.map +1 -0
  68. package/dist/jsonObject.js +18 -0
  69. package/dist/jsonObject.js.map +1 -0
  70. package/dist/keys/index.d.ts +13 -9
  71. package/dist/keys/index.d.ts.map +1 -1
  72. package/dist/keys/index.js +11 -7
  73. package/dist/keys/index.js.map +1 -1
  74. package/dist/keys/userKeyCascade.d.ts +46 -0
  75. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  76. package/dist/keys/userKeyCascade.js +153 -65
  77. package/dist/keys/userKeyCascade.js.map +1 -1
  78. package/dist/keys/userKeyRoster.d.ts +60 -7
  79. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  80. package/dist/keys/userKeyRoster.js +165 -47
  81. package/dist/keys/userKeyRoster.js.map +1 -1
  82. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  83. package/dist/keys/userKeyRosterCascade.js +1 -0
  84. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  85. package/dist/menders/ids.d.ts +1 -1
  86. package/dist/menders/ids.d.ts.map +1 -1
  87. package/dist/menders/ids.js +20 -4
  88. package/dist/menders/ids.js.map +1 -1
  89. package/dist/resourceLog/controller.d.ts +11 -7
  90. package/dist/resourceLog/controller.d.ts.map +1 -1
  91. package/dist/resourceLog/controller.js +15 -31
  92. package/dist/resourceLog/controller.js.map +1 -1
  93. package/dist/resourceLog/document.d.ts +9 -11
  94. package/dist/resourceLog/document.d.ts.map +1 -1
  95. package/dist/resourceLog/document.js +9 -11
  96. package/dist/resourceLog/document.js.map +1 -1
  97. package/dist/space/collections.d.ts +23 -3
  98. package/dist/space/collections.d.ts.map +1 -1
  99. package/dist/space/collections.js +26 -2
  100. package/dist/space/collections.js.map +1 -1
  101. package/dist/space/inboxMessage.d.ts +47 -0
  102. package/dist/space/inboxMessage.d.ts.map +1 -0
  103. package/dist/space/inboxMessage.js +86 -0
  104. package/dist/space/inboxMessage.js.map +1 -0
  105. package/dist/space/index.d.ts +6 -1
  106. package/dist/space/index.d.ts.map +1 -1
  107. package/dist/space/index.js +5 -1
  108. package/dist/space/index.js.map +1 -1
  109. package/dist/sync/contactsConflict.d.ts +23 -10
  110. package/dist/sync/contactsConflict.d.ts.map +1 -1
  111. package/dist/sync/contactsConflict.js +40 -21
  112. package/dist/sync/contactsConflict.js.map +1 -1
  113. package/dist/unlock/index.d.ts +1 -1
  114. package/dist/unlock/index.d.ts.map +1 -1
  115. package/dist/unlock/index.js +1 -1
  116. package/dist/unlock/index.js.map +1 -1
  117. package/dist/webvh/clientAnnexDid.d.ts +76 -0
  118. package/dist/webvh/clientAnnexDid.d.ts.map +1 -0
  119. package/dist/webvh/clientAnnexDid.js +117 -0
  120. package/dist/webvh/clientAnnexDid.js.map +1 -0
  121. package/dist/webvh/didWebProjection.d.ts +38 -5
  122. package/dist/webvh/didWebProjection.d.ts.map +1 -1
  123. package/dist/webvh/didWebProjection.js +35 -22
  124. package/dist/webvh/didWebProjection.js.map +1 -1
  125. package/dist/webvh/documentDids.d.ts +3 -3
  126. package/dist/webvh/documentDids.js +3 -3
  127. package/dist/webvh/index.d.ts +4 -3
  128. package/dist/webvh/index.d.ts.map +1 -1
  129. package/dist/webvh/index.js +4 -3
  130. package/dist/webvh/index.js.map +1 -1
  131. package/dist/webvh/standingZcap.d.ts +27 -2
  132. package/dist/webvh/standingZcap.d.ts.map +1 -1
  133. package/dist/webvh/standingZcap.js +42 -4
  134. package/dist/webvh/standingZcap.js.map +1 -1
  135. package/package.json +14 -7
@@ -18,13 +18,23 @@
18
18
  *
19
19
  * **Fail-safe to remote.** Whenever the fields the rule needs are unreachable
20
20
  * -- a tombstone on either side, a missing cipher, an envelope this replica
21
- * holds no key for, a body that is not a valid head payload -- the remote
22
- * master wins. That is the always-converging default, so a malformed side
23
- * simply loses: a valid local over a malformed remote re-pushes and repairs the
24
- * server copy, a valid remote over a malformed local is adopted, and two
25
- * malformed sides adopt the server version rather than re-fighting the conflict
26
- * forever. A delete is in the same class deliberately: a tombstone carries no
27
- * fresher stamp (a delete does not rewrite the head payload), so deletion wins.
21
+ * holds no key for, a plaintext body where a cipher is configured, a body that
22
+ * is not a valid head payload -- the remote master wins. That is the
23
+ * always-converging default, so a malformed side simply loses: a valid local
24
+ * over a malformed remote re-pushes and repairs the server copy, a valid remote
25
+ * over a malformed local is adopted, and two malformed sides adopt the server
26
+ * version rather than re-fighting the conflict forever. A delete is in the same
27
+ * class deliberately: a tombstone carries no fresher stamp (a delete does not
28
+ * rewrite the head payload), so deletion wins.
29
+ *
30
+ * **A plaintext body under a cipher is unreachable.** When the collection is
31
+ * encrypted, a non-envelope body is not one of this wallet's heads: an older
32
+ * writer or a hostile host put it there, and the app's own reads refuse it.
33
+ * Comparing its stamp would let a plaintext head with a later `updatedAt` beat
34
+ * a valid local envelope, which then disappears for good, since no read can
35
+ * open the winner and no write replaces it. So it scores as unreachable, and a
36
+ * valid encrypted side wins over it and re-pushes. Plaintext passes through
37
+ * only when no cipher is passed.
28
38
  *
29
39
  * **An integrity refusal is not an unreachable side.** A decrypt refused by the
30
40
  * cipher's envelope-to-resource binding check (was-client's `IntegrityError`)
@@ -56,8 +66,10 @@ import { isEncryptedEnvelope, isIntegrityError } from '@interop/was-client/sync'
56
66
  import { isContactHeadPayload, remotePayloadWins } from '@interop/social-core';
57
67
  /**
58
68
  * Recovers a validated head payload from a stored body: decrypts an
59
- * envelope, passes plaintext through, and resolves `undefined` when the
60
- * payload (and so the fields the rule compares) cannot be reached.
69
+ * envelope, and resolves `undefined` when the payload (and so the fields the
70
+ * rule compares) cannot be reached. A plaintext body passes through only when
71
+ * no cipher is passed. With a cipher, a plaintext body is unreachable and is
72
+ * never handed to the cipher (see the module doc).
61
73
  *
62
74
  * A side this replica holds no key for is unreachable. What the fail-safe rule
63
75
  * below then does with it depends on which side it was: an unreachable local
@@ -76,7 +88,8 @@ import { isContactHeadPayload, remotePayloadWins } from '@interop/social-core';
76
88
  * @param options.data {Json} the stored body: an encrypted envelope or a
77
89
  * plaintext payload
78
90
  * @param [options.cipher] {DocCipher} the collection's document cipher;
79
- * absent for a plaintext store, in which case an envelope is unreachable
91
+ * absent for a plaintext store, in which case an envelope is unreachable.
92
+ * When present, a plaintext body is unreachable.
80
93
  * @returns {Promise<ContactHeadPayload | undefined>}
81
94
  * @throws {Error} the cipher's `IntegrityError`: the stored envelope was
82
95
  * sealed for a different resource than `id`
@@ -85,20 +98,26 @@ export async function contactHeadPayloadOf({ id, data, cipher }) {
85
98
  if (data === null || data === undefined) {
86
99
  return undefined;
87
100
  }
88
- let body = data;
89
- if (isEncryptedEnvelope(data)) {
90
- if (!cipher) {
101
+ if (!isEncryptedEnvelope(data)) {
102
+ // A plaintext body counts only on a plaintext store. Under a cipher it is
103
+ // not one of this wallet's heads, so it must not win on its stamp.
104
+ if (cipher) {
91
105
  return undefined;
92
106
  }
93
- try {
94
- body = await cipher.decrypt({ id, envelope: data });
95
- }
96
- catch (err) {
97
- if (isIntegrityError(err)) {
98
- throw err;
99
- }
100
- return undefined;
107
+ return isContactHeadPayload(data) ? data : undefined;
108
+ }
109
+ if (!cipher) {
110
+ return undefined;
111
+ }
112
+ let body;
113
+ try {
114
+ body = await cipher.decrypt({ id, envelope: data });
115
+ }
116
+ catch (err) {
117
+ if (isIntegrityError(err)) {
118
+ throw err;
101
119
  }
120
+ return undefined;
102
121
  }
103
122
  return isContactHeadPayload(body) ? body : undefined;
104
123
  }
@@ -1 +1 @@
1
- {"version":3,"file":"contactsConflict.js","sourceRoot":"","sources":["../../src/sync/contactsConflict.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAGjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EAElB,MAAM,sBAAsB,CAAA;AAO7B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,EAAE,EACF,IAAI,EACJ,MAAM,EAKP;IACC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,IAAI,GAAY,IAAI,CAAA;IACxB,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,IAAI,CAAC;YACH,IAAI,GA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AAI,SAAS,IAAI,CAAC,UAAU,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -39,7 +39,7 @@ export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentit
39
39
  export type { StandingUnlockClient, UnlockClientIdentity } from './standingClient.js';
40
40
  export { computeUnlockBinding, generateLadderSeed, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
41
41
  export type { SealedRecordMember, SignedUnlockRecord, UnlockRecordContents, UnlockRecordProofState } from './unlockRecord.js';
42
- export { assertLadderVmClaimed, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
42
+ export { assertLadderVmClaimed, attributeUnlockLadderInventory, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
43
43
  export type { CredentialKeyAgreementMethod, LadderVmRemovalReport, StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
44
44
  export { UNLOCK_MANAGEMENT_ACTIONS } from './managementZcap.js';
45
45
  export { retireUnlockCredential, UNLOCK_CREDENTIAL_RETIREMENT_STAGES } from './retire.js';
@@ -1 +1 @@
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,kBAAkB,EAClB,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,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACpC,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,+BAA+B,EAC/B,8BAA8B,EAC9B,4BAA4B,EAC5B,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,kBAAkB,EAClB,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,8BAA8B,EAC9B,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACpC,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,+BAA+B,EAC/B,8BAA8B,EAC9B,4BAA4B,EAC5B,gCAAgC,EACjC,MAAM,aAAa,CAAA"}
@@ -37,7 +37,7 @@
37
37
  */
38
38
  export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentityFromSeed } from './standingClient.js';
39
39
  export { computeUnlockBinding, generateLadderSeed, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
40
- export { assertLadderVmClaimed, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
40
+ export { assertLadderVmClaimed, attributeUnlockLadderInventory, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
41
41
  export { UNLOCK_MANAGEMENT_ACTIONS } from './managementZcap.js';
42
42
  export { retireUnlockCredential, UNLOCK_CREDENTIAL_RETIREMENT_STAGES } from './retire.js';
43
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAS3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACpC,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,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAS3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACpC,MAAM,aAAa,CAAA"}
@@ -0,0 +1,76 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The client annex DID string's shape, on its own import-free leaf so a base
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.
9
+ * The annex module (`clientAnnex/log.ts`, `clientAnnex/grantRevocation.ts`)
10
+ * re-exports these, so its public surface is unchanged.
11
+ */
12
+ /**
13
+ * The literal prefix of every generation collection's name. Wire-level and
14
+ * permanent: orphan discovery is a plain prefix match over the auxiliary
15
+ * Space's collection listing, and the generation id embeds in every annex
16
+ * DID string ever published.
17
+ */
18
+ export declare const GENERATION_ID_PREFIX = "gen-";
19
+ /**
20
+ * Refuses anything that is not a well-formed generation id. Run by every
21
+ * annex builder that takes a generation id, so a malformed one is refused
22
+ * before it can reach a DID string, an HKDF label, or a collection id.
23
+ *
24
+ * @param generationId {string}
25
+ */
26
+ export declare function assertGenerationId(generationId: string): void;
27
+ /**
28
+ * The three permanent substrings of an annex DID string, as
29
+ * {@link parseClientAnnexDid} reads them.
30
+ */
31
+ export interface ClientAnnexDidParts {
32
+ host: string;
33
+ spaceId: string;
34
+ generationId: string;
35
+ }
36
+ /**
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>`), and it
42
+ * is the generation-identifying half of the annex rung HKDF
43
+ * labels, so this parse is what lets an enrollee derive its writing key from
44
+ * the pointer alone -- no log read, no registry.
45
+ *
46
+ * The host is the method-specific id's second segment, percent-decoded (a
47
+ * port rides as `%3A` inside the one segment). A caller enumerating Spaces
48
+ * out of a log compares it against the deployment it is talking to: an
49
+ * account that has migrated hosts carries entries naming the old one, which
50
+ * this deployment cannot address.
51
+ *
52
+ * @param did {string}
53
+ * @returns {ClientAnnexDidParts | undefined}
54
+ */
55
+ export declare function parseClientAnnexDid(did: string): ClientAnnexDidParts | undefined;
56
+ /**
57
+ * {@link parseClientAnnexDid}, refusing with a throw: one naming the DID
58
+ * when its segments are not an annex did:webvh's, and the generation-id
59
+ * refusal when the segments are but the generation id is malformed.
60
+ *
61
+ * @param options {object}
62
+ * @param options.did {string} an annex did:webvh string
63
+ * @returns {ClientAnnexDidParts}
64
+ */
65
+ export declare function clientAnnexDidParts({ did }: {
66
+ did: string;
67
+ }): ClientAnnexDidParts;
68
+ /**
69
+ * Whether a DID string is a client annex did:webvh, by the same parse
70
+ * {@link parseClientAnnexDid} applies.
71
+ *
72
+ * @param did {string}
73
+ * @returns {boolean}
74
+ */
75
+ export declare function isClientAnnexDid(did: string): boolean;
76
+ //# sourceMappingURL=clientAnnexDid.d.ts.map
@@ -0,0 +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;;;;;;;;;;;;;;;;;;GAkBG;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"}
@@ -0,0 +1,117 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The client annex DID string's shape, on its own import-free leaf so a base
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.
9
+ * The annex module (`clientAnnex/log.ts`, `clientAnnex/grantRevocation.ts`)
10
+ * re-exports these, so its public surface is unchanged.
11
+ */
12
+ /**
13
+ * The literal prefix of every generation collection's name. Wire-level and
14
+ * permanent: orphan discovery is a plain prefix match over the auxiliary
15
+ * Space's collection listing, and the generation id embeds in every annex
16
+ * DID string ever published.
17
+ */
18
+ export const GENERATION_ID_PREFIX = 'gen-';
19
+ /**
20
+ * The full generation id shape: the literal prefix plus 16 base64url
21
+ * characters.
22
+ */
23
+ const GENERATION_ID_PATTERN = /^gen-[A-Za-z0-9_-]{16}$/;
24
+ /**
25
+ * Refuses anything that is not a well-formed generation id. Run by every
26
+ * annex builder that takes a generation id, so a malformed one is refused
27
+ * before it can reach a DID string, an HKDF label, or a collection id.
28
+ *
29
+ * @param generationId {string}
30
+ */
31
+ export function assertGenerationId(generationId) {
32
+ if (!GENERATION_ID_PATTERN.test(generationId)) {
33
+ throw new Error(`Not a generation id: "${generationId}" (expected "gen-" plus 16 ` +
34
+ 'base64url characters).');
35
+ }
36
+ }
37
+ /**
38
+ * The structural parse behind {@link parseClientAnnexDid} and
39
+ * {@link clientAnnexDidParts}: the segments alone, with the generation id
40
+ * not yet checked against its shape, so the throwing parse can name which
41
+ * of the two refused.
42
+ *
43
+ * @param did {string}
44
+ * @returns {ClientAnnexDidParts | undefined}
45
+ */
46
+ function splitClientAnnexDid(did) {
47
+ const parts = did.split(':');
48
+ const generationId = parts[parts.length - 1];
49
+ const spaceId = parts[parts.length - 2];
50
+ const host = parts[3];
51
+ if (parts.length < 7 ||
52
+ parts[0] !== 'did' ||
53
+ parts[1] !== 'webvh' ||
54
+ parts[parts.length - 3] !== 'space' ||
55
+ generationId === undefined ||
56
+ spaceId === undefined ||
57
+ spaceId.length === 0 ||
58
+ host === undefined ||
59
+ host.length === 0) {
60
+ return undefined;
61
+ }
62
+ return { host: decodeURIComponent(host), spaceId, generationId };
63
+ }
64
+ /**
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>`), and it
70
+ * is the generation-identifying half of the annex rung HKDF
71
+ * labels, so this parse is what lets an enrollee derive its writing key from
72
+ * the pointer alone -- no log read, no registry.
73
+ *
74
+ * The host is the method-specific id's second segment, percent-decoded (a
75
+ * port rides as `%3A` inside the one segment). A caller enumerating Spaces
76
+ * out of a log compares it against the deployment it is talking to: an
77
+ * account that has migrated hosts carries entries naming the old one, which
78
+ * this deployment cannot address.
79
+ *
80
+ * @param did {string}
81
+ * @returns {ClientAnnexDidParts | undefined}
82
+ */
83
+ export function parseClientAnnexDid(did) {
84
+ const parts = splitClientAnnexDid(did);
85
+ if (parts === undefined || !GENERATION_ID_PATTERN.test(parts.generationId)) {
86
+ return undefined;
87
+ }
88
+ return parts;
89
+ }
90
+ /**
91
+ * {@link parseClientAnnexDid}, refusing with a throw: one naming the DID
92
+ * when its segments are not an annex did:webvh's, and the generation-id
93
+ * refusal when the segments are but the generation id is malformed.
94
+ *
95
+ * @param options {object}
96
+ * @param options.did {string} an annex did:webvh string
97
+ * @returns {ClientAnnexDidParts}
98
+ */
99
+ export function clientAnnexDidParts({ did }) {
100
+ const parts = splitClientAnnexDid(did);
101
+ if (parts === undefined) {
102
+ throw new Error(`Not a client annex did:webvh: "${did}".`);
103
+ }
104
+ assertGenerationId(parts.generationId);
105
+ return parts;
106
+ }
107
+ /**
108
+ * Whether a DID string is a client annex did:webvh, by the same parse
109
+ * {@link parseClientAnnexDid} applies.
110
+ *
111
+ * @param did {string}
112
+ * @returns {boolean}
113
+ */
114
+ export function isClientAnnexDid(did) {
115
+ return parseClientAnnexDid(did) !== undefined;
116
+ }
117
+ //# sourceMappingURL=clientAnnexDid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientAnnexDid.js","sourceRoot":"","sources":["../../src/webvh/clientAnnexDid.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAE1C;;;GAGG;AACH,MAAM,qBAAqB,GAAG,yBAAyB,CAAA;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,YAAoB;IACrD,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,yBAAyB,YAAY,6BAA6B;YAChE,wBAAwB,CAC3B,CAAA;IACH,CAAC;AACH,CAAC;AAYD;;;;;;;;GAQG;AACH,SAAS,mBAAmB,CAAC,GAAW;IACtC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACvC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IACrB,IACE,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
@@ -8,7 +8,9 @@
8
8
  * the two ways that cache is written -- the unconditional PUT every publish
9
9
  * tail makes ({@link putDidWebProjection}) and the read-then-write freshness
10
10
  * ensure a caller with no controller authority makes
11
- * ({@link ensureDidWebProjection}).
11
+ * ({@link ensureDidWebProjection}). The ensure's compare is exported on its
12
+ * own as {@link didWebProjectionCurrent}, for a reader that wants it without
13
+ * the write.
12
14
  *
13
15
  * The ensure exists because the projection is NOT republished by every entry.
14
16
  * A ladder-signed entry publishes through `publishEntryPinned`, which writes
@@ -110,10 +112,11 @@ export declare function preEntryProjectionPublisher({ store }: {
110
112
  * account Space's container URL and so may write `id/did.json` with no
111
113
  * widened bridge and no server change.
112
114
  *
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.
115
+ * The served document is compared through {@link didWebProjectionCurrent}, as
116
+ * parsed JSON and key-order-insensitively, so a host (or an earlier writer)
117
+ * that reserialized the same document does not provoke a write. Absent,
118
+ * unparsable, and different all reach the write; only an equal document is
119
+ * left alone.
117
120
  *
118
121
  * A difference is not by itself evidence that the served projection is the
119
122
  * stale side. The caller's `doc` was resolved at some earlier point, and a
@@ -161,4 +164,34 @@ export declare function ensureDidWebProjection({ store, did, doc, refresh }: {
161
164
  }): Promise<{
162
165
  outcome: 'current' | 'republished' | 'conflict';
163
166
  }>;
167
+ /**
168
+ * Whether the served projection text is the current `did:web` projection of a
169
+ * resolved did:webvh document. It derives the projection with
170
+ * `generateParallelDidWeb` and compares it against the served body as parsed
171
+ * JSON, key-order-insensitively. This is the compare
172
+ * {@link ensureDidWebProjection} runs, exported for a reader (a wallet's
173
+ * invariant audit) that wants the compare without the write.
174
+ *
175
+ * An absent or unparsable body reads as not current rather than as an error.
176
+ * Whatever it is, it is not the projection, and republishing is the answer
177
+ * either way.
178
+ *
179
+ * The derived document is round-tripped through JSON before the comparison,
180
+ * so it is compared in the form a PUT would serialize it into. A member whose
181
+ * value is `undefined` disappears on both sides rather than reading as a
182
+ * difference the write could never fix.
183
+ *
184
+ * @param options {object}
185
+ * @param options.text {string | undefined} the served `did.json` body, or
186
+ * `undefined` when the resource is absent
187
+ * @param options.did {string} the account's did:webvh, from the resolved log
188
+ * @param options.doc {DIDDoc} the resolved did:webvh document
189
+ * @returns {boolean} true only when the served body parses and structurally
190
+ * equals the derived projection
191
+ */
192
+ export declare function didWebProjectionCurrent({ text, did, doc }: {
193
+ text: string | undefined;
194
+ did: string;
195
+ doc: DIDDoc;
196
+ }): boolean;
164
197
  //# sourceMappingURL=didWebProjection.d.ts.map
@@ -1 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IAAI,CAAC,CAgBzD;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;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,CAqC/D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,GAAG,EACH,GAAG,EACJ,EAAE;IACD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,OAAO,CAcV"}
@@ -87,10 +87,11 @@ const PRECONDITION_FAILED_ERROR_NAME = 'PreconditionFailedError';
87
87
  * account Space's container URL and so may write `id/did.json` with no
88
88
  * widened bridge and no server change.
89
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.
90
+ * The served document is compared through {@link didWebProjectionCurrent}, as
91
+ * parsed JSON and key-order-insensitively, so a host (or an earlier writer)
92
+ * that reserialized the same document does not provoke a write. Absent,
93
+ * unparsable, and different all reach the write; only an equal document is
94
+ * left alone.
94
95
  *
95
96
  * A difference is not by itself evidence that the served projection is the
96
97
  * stale side. The caller's `doc` was resolved at some earlier point, and a
@@ -131,22 +132,20 @@ export async function ensureDidWebProjection({ store, did, doc, refresh }) {
131
132
  const served = await store.getIdResourceRaw({
132
133
  resourceId: DID_DOCUMENT_RESOURCE
133
134
  });
134
- let expected = generateParallelDidWeb(did, doc);
135
- if (served !== undefined && servedMatches({ text: served.text, expected })) {
135
+ let resolved = { did, doc };
136
+ if (didWebProjectionCurrent({ text: served?.text, ...resolved })) {
136
137
  return { outcome: 'current' };
137
138
  }
138
139
  if (refresh) {
139
- const fresh = await refresh();
140
- expected = generateParallelDidWeb(fresh.did, fresh.doc);
141
- if (served !== undefined &&
142
- servedMatches({ text: served.text, expected })) {
140
+ resolved = await refresh();
141
+ if (didWebProjectionCurrent({ text: served?.text, ...resolved })) {
143
142
  return { outcome: 'current' };
144
143
  }
145
144
  }
146
145
  try {
147
146
  await store.putIdResource({
148
147
  resourceId: DID_DOCUMENT_RESOURCE,
149
- content: expected,
148
+ content: generateParallelDidWeb(resolved.did, resolved.doc),
150
149
  contentType: 'application/did+json',
151
150
  // Absent, the write is a create; present, an update-if-unchanged. A
152
151
  // backend serving no ETag versions nothing, so that write degrades to
@@ -169,21 +168,34 @@ export async function ensureDidWebProjection({ store, did, doc, refresh }) {
169
168
  return { outcome: 'republished' };
170
169
  }
171
170
  /**
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.
171
+ * Whether the served projection text is the current `did:web` projection of a
172
+ * resolved did:webvh document. It derives the projection with
173
+ * `generateParallelDidWeb` and compares it against the served body as parsed
174
+ * JSON, key-order-insensitively. This is the compare
175
+ * {@link ensureDidWebProjection} runs, exported for a reader (a wallet's
176
+ * invariant audit) that wants the compare without the write.
175
177
  *
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
178
+ * An absent or unparsable body reads as not current rather than as an error.
179
+ * Whatever it is, it is not the projection, and republishing is the answer
180
+ * either way.
181
+ *
182
+ * The derived document is round-tripped through JSON before the comparison,
183
+ * so it is compared in the form a PUT would serialize it into. A member whose
184
+ * value is `undefined` disappears on both sides rather than reading as a
179
185
  * difference the write could never fix.
180
186
  *
181
187
  * @param options {object}
182
- * @param options.text {string} the served body
183
- * @param options.expected {object} the freshly derived projection
184
- * @returns {boolean}
188
+ * @param options.text {string | undefined} the served `did.json` body, or
189
+ * `undefined` when the resource is absent
190
+ * @param options.did {string} the account's did:webvh, from the resolved log
191
+ * @param options.doc {DIDDoc} the resolved did:webvh document
192
+ * @returns {boolean} true only when the served body parses and structurally
193
+ * equals the derived projection
185
194
  */
186
- function servedMatches({ text, expected }) {
195
+ export function didWebProjectionCurrent({ text, did, doc }) {
196
+ if (text === undefined) {
197
+ return false;
198
+ }
187
199
  let parsed;
188
200
  try {
189
201
  parsed = JSON.parse(text);
@@ -191,7 +203,8 @@ function servedMatches({ text, expected }) {
191
203
  catch {
192
204
  return false;
193
205
  }
194
- return sameJsonValue(JSON.parse(JSON.stringify(expected)), parsed);
206
+ const expected = JSON.parse(JSON.stringify(generateParallelDidWeb(did, doc)));
207
+ return sameJsonValue(expected, parsed);
195
208
  }
196
209
  /**
197
210
  * Structural JSON equality: object key order is immaterial, array order is
@@ -1 +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,WA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AI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAC5B,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACnE,CAAA;IACH,CAAC;IACD,IACE,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,KAAK,KAAK,QAAQ;QACzB,IAAI,KAAK,IAAI;QACb,KAAK,KAAK,IAAI,EACd,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAA+B,CAAC,CAAA;IACnE,MAAM,WAAW,GAAG,KAAgC,CAAA;IACpD,OAAO,CACL,WAAW,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM;QACtD,WAAW,CAAC,KAAK,CACf,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CACf,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC;YACtD,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CACzC,CACF,CAAA;AACH,CAAC"}
@@ -29,9 +29,9 @@ export declare function walletClientDid({ signingKeyMultibase }: {
29
29
  * enrolled client's ({@link enrolledClientKeyMultibases}) and each ladder
30
30
  * VM's ({@link ladderVmKeyMultibases}) bare did:key, from the key multibase
31
31
  * the shared readers name for the method. A member the readers name no key
32
- * for (no fragment and no `publicKeyMultibase`, or the two disagreeing) is
33
- * skipped, the same answer the ladder-rung attribution gives it. An entry
34
- * carrying no document state is skipped too.
32
+ * for (one resolving to no method, or to a method publishing no
33
+ * `publicKeyMultibase`) is skipped, the same answer the ladder-rung
34
+ * attribution gives it. An entry carrying no document state is skipped too.
35
35
  *
36
36
  * @param options {object}
37
37
  * @param options.log {DIDLog} the VERIFIED account log
@@ -21,9 +21,9 @@ export function walletClientDid({ signingKeyMultibase }) {
21
21
  * enrolled client's ({@link enrolledClientKeyMultibases}) and each ladder
22
22
  * VM's ({@link ladderVmKeyMultibases}) bare did:key, from the key multibase
23
23
  * the shared readers name for the method. A member the readers name no key
24
- * for (no fragment and no `publicKeyMultibase`, or the two disagreeing) is
25
- * skipped, the same answer the ladder-rung attribution gives it. An entry
26
- * carrying no document state is skipped too.
24
+ * for (one resolving to no method, or to a method publishing no
25
+ * `publicKeyMultibase`) is skipped, the same answer the ladder-rung
26
+ * attribution gives it. An entry carrying no document state is skipped too.
27
27
  *
28
28
  * @param options {object}
29
29
  * @param options.log {DIDLog} the VERIFIED account log
@@ -63,7 +63,8 @@
63
63
  * through, over the parameterized `wasWebvhLogStore` (any collection's
64
64
  * `did.jsonl`), which also serves a client-annex generation's log.
65
65
  * - `ensureDidWebProjection` / `putDidWebProjection` -- the `did:web`
66
- * projection (`id/did.json`) writers. The publish tails PUT it
66
+ * projection (`id/did.json`) writers, with the ensure's compare exported on
67
+ * its own as `didWebProjectionCurrent`. The publish tails PUT it
67
68
  * unconditionally behind a won log compare-and-swap; the ensure compares
68
69
  * the served document against the one the resolved log derives and writes
69
70
  * only on a difference -- re-resolving through the caller's optional
@@ -96,10 +97,10 @@ export { accountControllerResolver, accountLogPinId, logResourcePinId, AccountLo
96
97
  export type { VerifiedAccountLog } from './verifyLog.js';
97
98
  export { wasWebvhIdStore, wasWebvhLogStore } from './wasIdStore.js';
98
99
  export type { WebvhLogResourceStore } from './wasIdStore.js';
99
- export { ensureDidWebProjection, putDidWebProjection } from './didWebProjection.js';
100
+ export { didWebProjectionCurrent, ensureDidWebProjection, putDidWebProjection } from './didWebProjection.js';
100
101
  export { delegatedWebvhLogStore } from './delegatedLogStore.js';
101
102
  export type { DelegatedWebvhLogStore } from './delegatedLogStore.js';
102
- export { delegationAtExpiry, delegationExpired, delegationProofKeyId, delegationSignerGone, recordedZcapStale, REVOCATION_CLOCK_SKEW_MS, STANDING_ZCAP_TTL_MS, standingZcapStale, ZCAP_RENEWAL_WINDOW_MS, zcapExpiring } from './standingZcap.js';
103
+ export { delegationAtExpiry, delegationExpired, delegationProofKeyId, delegationSignerGone, recordedZcapStale, REVOCATION_CLOCK_SKEW_MS, STANDING_ZCAP_TTL_MS, standingZcapStale, embeddedParentCapability, firstDelegationProof, ZCAP_RENEWAL_WINDOW_MS, zcapExpiring } from './standingZcap.js';
103
104
  export { attributeClientUpdateKey, delegationKeyInDocument, documentKeyMultibases, enrolledClientVmIds, isLastEnrolledClient, listEnrolledWebvhClients, markedKeyAgreementMethods, markedKeyAgreementMultibases } from './listClients.js';
104
105
  export type { EnrolledWebvhClient, PublishedKeyDocument } from './listClients.js';
105
106
  export { mergeVerificationMethods } from './mergeMethods.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,Y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