@interop/wallet-core 0.101.0 → 0.103.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 (123) hide show
  1. package/README.md +35 -19
  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/gc.d.ts +107 -25
  11. package/dist/clientAnnex/gc.d.ts.map +1 -1
  12. package/dist/clientAnnex/gc.js +258 -89
  13. package/dist/clientAnnex/gc.js.map +1 -1
  14. package/dist/clientAnnex/grantRevocation.d.ts +0 -10
  15. package/dist/clientAnnex/grantRevocation.d.ts.map +1 -1
  16. package/dist/clientAnnex/grantRevocation.js +1 -23
  17. package/dist/clientAnnex/grantRevocation.js.map +1 -1
  18. package/dist/clientAnnex/heal.d.ts +32 -0
  19. package/dist/clientAnnex/heal.d.ts.map +1 -1
  20. package/dist/clientAnnex/heal.js +52 -50
  21. package/dist/clientAnnex/heal.js.map +1 -1
  22. package/dist/clientAnnex/index.d.ts +2 -2
  23. package/dist/clientAnnex/index.d.ts.map +1 -1
  24. package/dist/clientAnnex/index.js +2 -2
  25. package/dist/clientAnnex/index.js.map +1 -1
  26. package/dist/clientAnnex/log.d.ts +20 -2
  27. package/dist/clientAnnex/log.d.ts.map +1 -1
  28. package/dist/clientAnnex/log.js +30 -4
  29. package/dist/clientAnnex/log.js.map +1 -1
  30. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  31. package/dist/clients/rosterPolicy.js +3 -1
  32. package/dist/clients/rosterPolicy.js.map +1 -1
  33. package/dist/connections/didKey.d.ts +27 -0
  34. package/dist/connections/didKey.d.ts.map +1 -1
  35. package/dist/connections/didKey.js +42 -6
  36. package/dist/connections/didKey.js.map +1 -1
  37. package/dist/connections/entry.d.ts +95 -13
  38. package/dist/connections/entry.d.ts.map +1 -1
  39. package/dist/connections/entry.js +102 -16
  40. package/dist/connections/entry.js.map +1 -1
  41. package/dist/connections/grants.d.ts +225 -3
  42. package/dist/connections/grants.d.ts.map +1 -1
  43. package/dist/connections/grants.js +293 -8
  44. package/dist/connections/grants.js.map +1 -1
  45. package/dist/connections/index.d.ts +15 -8
  46. package/dist/connections/index.d.ts.map +1 -1
  47. package/dist/connections/index.js +13 -6
  48. package/dist/connections/index.js.map +1 -1
  49. package/dist/connections/read.d.ts.map +1 -1
  50. package/dist/connections/read.js +2 -1
  51. package/dist/connections/read.js.map +1 -1
  52. package/dist/connections/resourceId.d.ts +33 -0
  53. package/dist/connections/resourceId.d.ts.map +1 -1
  54. package/dist/connections/resourceId.js +88 -8
  55. package/dist/connections/resourceId.js.map +1 -1
  56. package/dist/connections/upsert.d.ts +219 -7
  57. package/dist/connections/upsert.d.ts.map +1 -1
  58. package/dist/connections/upsert.js +628 -41
  59. package/dist/connections/upsert.js.map +1 -1
  60. package/dist/connections/writers.js +2 -1
  61. package/dist/connections/writers.js.map +1 -1
  62. package/dist/descriptors/index.d.ts +5 -0
  63. package/dist/descriptors/index.d.ts.map +1 -1
  64. package/dist/descriptors/index.js +5 -0
  65. package/dist/descriptors/index.js.map +1 -1
  66. package/dist/descriptors/logSource.d.ts +9 -4
  67. package/dist/descriptors/logSource.d.ts.map +1 -1
  68. package/dist/descriptors/logSource.js +13 -6
  69. package/dist/descriptors/logSource.js.map +1 -1
  70. package/dist/jsonObject.d.ts +16 -0
  71. package/dist/jsonObject.d.ts.map +1 -0
  72. package/dist/jsonObject.js +18 -0
  73. package/dist/jsonObject.js.map +1 -0
  74. package/dist/keys/index.d.ts +13 -9
  75. package/dist/keys/index.d.ts.map +1 -1
  76. package/dist/keys/index.js +11 -7
  77. package/dist/keys/index.js.map +1 -1
  78. package/dist/keys/userKeyCascade.d.ts +46 -0
  79. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  80. package/dist/keys/userKeyCascade.js +153 -65
  81. package/dist/keys/userKeyCascade.js.map +1 -1
  82. package/dist/keys/userKeyRoster.d.ts +60 -7
  83. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  84. package/dist/keys/userKeyRoster.js +165 -47
  85. package/dist/keys/userKeyRoster.js.map +1 -1
  86. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  87. package/dist/keys/userKeyRosterCascade.js +1 -0
  88. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  89. package/dist/menders/ids.d.ts +1 -1
  90. package/dist/menders/ids.d.ts.map +1 -1
  91. package/dist/menders/ids.js +20 -4
  92. package/dist/menders/ids.js.map +1 -1
  93. package/dist/space/collections.d.ts +26 -6
  94. package/dist/space/collections.d.ts.map +1 -1
  95. package/dist/space/collections.js +31 -7
  96. package/dist/space/collections.js.map +1 -1
  97. package/dist/space/inboxMessage.d.ts +47 -0
  98. package/dist/space/inboxMessage.d.ts.map +1 -0
  99. package/dist/space/inboxMessage.js +86 -0
  100. package/dist/space/inboxMessage.js.map +1 -0
  101. package/dist/space/index.d.ts +7 -2
  102. package/dist/space/index.d.ts.map +1 -1
  103. package/dist/space/index.js +6 -2
  104. package/dist/space/index.js.map +1 -1
  105. package/dist/sync/contactsConflict.d.ts +23 -10
  106. package/dist/sync/contactsConflict.d.ts.map +1 -1
  107. package/dist/sync/contactsConflict.js +40 -21
  108. package/dist/sync/contactsConflict.js.map +1 -1
  109. package/dist/sync/index.d.ts +2 -2
  110. package/dist/sync/index.js +2 -2
  111. package/dist/webvh/didWebProjection.d.ts +38 -5
  112. package/dist/webvh/didWebProjection.d.ts.map +1 -1
  113. package/dist/webvh/didWebProjection.js +35 -22
  114. package/dist/webvh/didWebProjection.js.map +1 -1
  115. package/dist/webvh/index.d.ts +4 -3
  116. package/dist/webvh/index.d.ts.map +1 -1
  117. package/dist/webvh/index.js +4 -3
  118. package/dist/webvh/index.js.map +1 -1
  119. package/dist/webvh/standingZcap.d.ts +19 -2
  120. package/dist/webvh/standingZcap.d.ts.map +1 -1
  121. package/dist/webvh/standingZcap.js +31 -3
  122. package/dist/webvh/standingZcap.js.map +1 -1
  123. package/package.json +12 -6
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/space/collections.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EACjC,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAA;AAE/B;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAA;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAA;AACnE;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAA;AACjE;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAA;AAC3D;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAA;AAC3D;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAA;AAuDnD;;;GAGG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAwB;IACtE,YAAY,EAAE,8BAA8B;IAC5C,IAAI,EAAE,wBAAwB;IAC9B,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;CAChB,CAAA;AAED;;;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AW,CAAA;AAC5C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,gBAAgB,CAAA;AAC5D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,UAAU,CAAA;AAC5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAA"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * A delegated zcap carried in an inbox message, verbatim. The parser checks
3
+ * the members named here and keeps every other member as it arrived.
4
+ */
5
+ export interface InboxMessageZcap {
6
+ id: string;
7
+ controller: string;
8
+ invocationTarget: string;
9
+ proof: Record<string, unknown> | Record<string, unknown>[];
10
+ [member: string]: unknown;
11
+ }
12
+ /**
13
+ * The inbox message envelope. `type` is the bare string `'Grant'` (the
14
+ * history Grant activity row carries a one-member array instead).
15
+ */
16
+ export interface InboxGrantMessage {
17
+ type: 'Grant';
18
+ actor: string;
19
+ object: {
20
+ zcaps: InboxMessageZcap[];
21
+ };
22
+ }
23
+ /**
24
+ * Builds an inbox Grant message carrying the given zcaps verbatim.
25
+ *
26
+ * @param options {object}
27
+ * @param options.actor {string} the sender's did:key
28
+ * @param options.zcaps {InboxMessageZcap[]} the delegated zcaps, at least
29
+ * one
30
+ * @returns {InboxGrantMessage}
31
+ */
32
+ export declare function inboxGrantMessage({ actor, zcaps }: {
33
+ actor: string;
34
+ zcaps: InboxMessageZcap[];
35
+ }): InboxGrantMessage;
36
+ /**
37
+ * Reads an inbox Grant message. Returns `undefined` for a body that is not
38
+ * one: a non-object body, a `type` other than the bare string `'Grant'`, an
39
+ * `actor` that is not a did:key, or an `object.zcaps` that is not a non-empty
40
+ * array of zcaps each carrying `id`, `controller`, `invocationTarget`, and a
41
+ * `proof`. Unknown members at any level are ignored and kept verbatim.
42
+ *
43
+ * @param body {unknown} the parsed JSON body
44
+ * @returns {InboxGrantMessage | undefined}
45
+ */
46
+ export declare function parseInboxGrantMessage(body: unknown): InboxGrantMessage | undefined;
47
+ //# sourceMappingURL=inboxMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inboxMessage.d.ts","sourceRoot":"","sources":["../../src/space/inboxMessage.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC1D,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE;QAAE,KAAK,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAA;CACtC;AAyBD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,KAAK,EACN,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAC1B,GAAG,iBAAiB,CAQpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,GACZ,iBAAiB,GAAG,SAAS,CAuB/B"}
@@ -0,0 +1,86 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The inbox message envelope: the one message kind a party POSTs to a
6
+ * wallet's `inbox` collection, or a wallet POSTs to a party's inbox. Shape:
7
+ * `{ type: 'Grant', actor: <did:key>, object: { zcaps: [ <zcap>, ... ] } }`,
8
+ * content type `application/json`, with no `@context`.
9
+ *
10
+ * There is one message kind. An invitation and a renewal are told apart by
11
+ * the zcap target. A zcap targeting the sender's own inbox is a channel
12
+ * capability, and one targeting the recipient's Space is a renewed grant.
13
+ * Every wallet and any agent built on this package share the shape.
14
+ */
15
+ import { isJsonObject } from '../jsonObject.js';
16
+ import { ACTIVITY_TYPE } from './activity.js';
17
+ function isDidKey(value) {
18
+ return typeof value === 'string' && value.startsWith('did:key:');
19
+ }
20
+ function isInboxMessageZcap(value) {
21
+ if (!isJsonObject(value)) {
22
+ return false;
23
+ }
24
+ const { id, controller, invocationTarget, proof } = value;
25
+ if (typeof id !== 'string' ||
26
+ id.length === 0 ||
27
+ typeof controller !== 'string' ||
28
+ typeof invocationTarget !== 'string') {
29
+ return false;
30
+ }
31
+ if (Array.isArray(proof)) {
32
+ return proof.length > 0 && proof.every(isJsonObject);
33
+ }
34
+ return isJsonObject(proof);
35
+ }
36
+ /**
37
+ * Builds an inbox Grant message carrying the given zcaps verbatim.
38
+ *
39
+ * @param options {object}
40
+ * @param options.actor {string} the sender's did:key
41
+ * @param options.zcaps {InboxMessageZcap[]} the delegated zcaps, at least
42
+ * one
43
+ * @returns {InboxGrantMessage}
44
+ */
45
+ export function inboxGrantMessage({ actor, zcaps }) {
46
+ if (!isDidKey(actor)) {
47
+ throw new TypeError('inbox message: `actor` must be a did:key DID.');
48
+ }
49
+ if (zcaps.length === 0) {
50
+ throw new TypeError('inbox message: `zcaps` must not be empty.');
51
+ }
52
+ return { type: ACTIVITY_TYPE.Grant, actor, object: { zcaps } };
53
+ }
54
+ /**
55
+ * Reads an inbox Grant message. Returns `undefined` for a body that is not
56
+ * one: a non-object body, a `type` other than the bare string `'Grant'`, an
57
+ * `actor` that is not a did:key, or an `object.zcaps` that is not a non-empty
58
+ * array of zcaps each carrying `id`, `controller`, `invocationTarget`, and a
59
+ * `proof`. Unknown members at any level are ignored and kept verbatim.
60
+ *
61
+ * @param body {unknown} the parsed JSON body
62
+ * @returns {InboxGrantMessage | undefined}
63
+ */
64
+ export function parseInboxGrantMessage(body) {
65
+ if (!isJsonObject(body)) {
66
+ return undefined;
67
+ }
68
+ const { type, actor, object } = body;
69
+ if (type !== ACTIVITY_TYPE.Grant) {
70
+ return undefined;
71
+ }
72
+ if (!isDidKey(actor)) {
73
+ return undefined;
74
+ }
75
+ if (!isJsonObject(object)) {
76
+ return undefined;
77
+ }
78
+ const { zcaps } = object;
79
+ if (!Array.isArray(zcaps) ||
80
+ zcaps.length === 0 ||
81
+ !zcaps.every(isInboxMessageZcap)) {
82
+ return undefined;
83
+ }
84
+ return body;
85
+ }
86
+ //# sourceMappingURL=inboxMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inboxMessage.js","sourceRoot":"","sources":["../../src/space/inboxMessage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAwB7C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;AAClE,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACzD,IACE,OAAO,EAAE,KAAK,QAAQ;QACtB,EAAE,CAAC,MAAM,KAAK,CAAC;QACf,OAAO,UAAU,KAAK,QAAQ;QAC9B,OAAO,gBAAgB,KAAK,QAAQ,EACpC,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IACtD,CAAC;IACD,OAAO,YAAY,CA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6,7 +6,7 @@
6
6
  * WAS-enabled wallet apps share.
7
7
  *
8
8
  * - The shared collection ids and descriptive specs (`private-credentials`,
9
- * `public-credentials`, `wallet-activity`, `app-connections`, and the
9
+ * `public-credentials`, `wallet-activity`, `app-keys`, and the
10
10
  * directly read `connections` directory; the contacts
11
11
  * identity contract
12
12
  * stays in `@interop/social-core`, spread into the wallet-Space specs here),
@@ -35,11 +35,14 @@
35
35
  * `parseWasLinkPayload` / `encodeWasLinkSecret`) and `isWasLinkPayload`,
36
36
  * the recognizer a wallet hands `@interop/wallet-request`'s input
37
37
  * classifier.
38
+ * - The inbox message envelope (`InboxGrantMessage`, built by
39
+ * `inboxGrantMessage` and read by `parseInboxGrantMessage`), the one
40
+ * message kind a party POSTs to an inbox, carrying delegated zcaps.
38
41
  * - `CEREMONY_IDS` / `CeremonyId`, the typed vocabulary of account ceremony
39
42
  * ids, including the ceremonies still implemented app-side.
40
43
  */
41
44
  export { deleteSpaceWithCapability } from './deleteSpace.js';
42
- export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_CONNECTIONS_COLLECTION, CONNECTIONS_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_CONNECTIONS_COLLECTION_SPEC, CONNECTIONS_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
45
+ export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_KEYS_COLLECTION, CONNECTIONS_COLLECTION, INBOX_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_KEYS_COLLECTION_SPEC, CONNECTIONS_COLLECTION_SPEC, INBOX_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
43
46
  export { ID_COLLECTION, KEY_MAP_COLLECTION, UNLOCK_METHODS_COLLECTION, KEYRING_COLLECTION, ID_COLLECTION_SPEC, KEY_MAP_COLLECTION_SPEC, UNLOCK_METHODS_COLLECTION_SPEC, DID_DOCUMENT_RESOURCE, DID_LOG_RESOURCE, DID_KEYS_RESOURCE, USER_KEY_ROSTER_LOG_RESOURCE, COLLECTION_HISTORY_LOG_SUBRESOURCE, UNLOCK_METHODS_RESOURCE, KEYRING_RESOURCE } from './collections.js';
44
47
  export type { SpaceProvisionSpec, SpaceCollectionSpec } from './collections.js';
45
48
  export { provisionWalletSpace } from './provisioning.js';
@@ -49,6 +52,8 @@ export type { WalletActivity, ActivityGrant, ImportCollectionOutcome } from './a
49
52
  export { publicCredentialUrl } from './publicLink.js';
50
53
  export { encodeWasLinkSecret, isWasLinkPayload, buildWasLinkPayload, parseWasLinkPayload } from './wasLink.js';
51
54
  export type { WasLinkPayload } from './wasLink.js';
55
+ export { inboxGrantMessage, parseInboxGrantMessage } from './inboxMessage.js';
56
+ export type { InboxGrantMessage, InboxMessageZcap } from './inboxMessage.js';
52
57
  export { HumanReadableError } from './errors.js';
53
58
  export { CEREMONY_IDS } from './ceremony.js';
54
59
  export type { CeremonyId } from './ceremony.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA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2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,eAAe,CAAA;AACtB,YAAY,EACV,cAAc,EACd,aAAa,EACb,uBAAuB,EACxB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC7E,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA"}
@@ -6,7 +6,7 @@
6
6
  * WAS-enabled wallet apps share.
7
7
  *
8
8
  * - The shared collection ids and descriptive specs (`private-credentials`,
9
- * `public-credentials`, `wallet-activity`, `app-connections`, and the
9
+ * `public-credentials`, `wallet-activity`, `app-keys`, and the
10
10
  * directly read `connections` directory; the contacts
11
11
  * identity contract
12
12
  * stays in `@interop/social-core`, spread into the wallet-Space specs here),
@@ -35,17 +35,21 @@
35
35
  * `parseWasLinkPayload` / `encodeWasLinkSecret`) and `isWasLinkPayload`,
36
36
  * the recognizer a wallet hands `@interop/wallet-request`'s input
37
37
  * classifier.
38
+ * - The inbox message envelope (`InboxGrantMessage`, built by
39
+ * `inboxGrantMessage` and read by `parseInboxGrantMessage`), the one
40
+ * message kind a party POSTs to an inbox, carrying delegated zcaps.
38
41
  * - `CEREMONY_IDS` / `CeremonyId`, the typed vocabulary of account ceremony
39
42
  * ids, including the ceremonies still implemented app-side.
40
43
  */
41
44
  export { deleteSpaceWithCapability } from './deleteSpace.js';
42
- export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_CONNECTIONS_COLLECTION, CONNECTIONS_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_CONNECTIONS_COLLECTION_SPEC, CONNECTIONS_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
45
+ export { WALLET_SPACE_NAME, PRIVATE_CREDENTIALS_COLLECTION, PUBLIC_CREDENTIALS_COLLECTION, WALLET_ACTIVITY_COLLECTION, APP_KEYS_COLLECTION, CONNECTIONS_COLLECTION, INBOX_COLLECTION, PRIVATE_CREDENTIALS_COLLECTION_SPEC, PUBLIC_CREDENTIALS_COLLECTION_SPEC, WALLET_ACTIVITY_COLLECTION_SPEC, CONTACTS_SPACE_COLLECTION_SPEC, CONTACTS_HISTORY_SPACE_COLLECTION_SPEC, APP_KEYS_COLLECTION_SPEC, CONNECTIONS_COLLECTION_SPEC, INBOX_COLLECTION_SPEC, WALLET_SPACE_SYNCED_SPECS, WALLET_SPACE_SYSTEM_SPECS, WALLET_SPACE_PROVISION_ROSTER } from './collections.js';
43
46
  export { ID_COLLECTION, KEY_MAP_COLLECTION, UNLOCK_METHODS_COLLECTION, KEYRING_COLLECTION, ID_COLLECTION_SPEC, KEY_MAP_COLLECTION_SPEC, UNLOCK_METHODS_COLLECTION_SPEC, DID_DOCUMENT_RESOURCE, DID_LOG_RESOURCE, DID_KEYS_RESOURCE, USER_KEY_ROSTER_LOG_RESOURCE, COLLECTION_HISTORY_LOG_SUBRESOURCE, UNLOCK_METHODS_RESOURCE, KEYRING_RESOURCE } from './collections.js';
44
47
  export { provisionWalletSpace } from './provisioning.js';
45
48
  export { plaintextCollection } from './plaintextCollection.js';
46
49
  export { ACTIVITY_TYPE, addHistoryNewAccount, addHistorySpaceCreated, addHistoryCredentialCreated, addHistoryCredentialDeleted, addHistoryCredentialShared, addHistoryCredentialUnshared, addHistoryLogin, addHistoryGrant, addHistoryWalletLogin, addHistoryAppRevoke, addHistoryAgentRevoke, addHistoryClientConnected, addHistoryClientRevoked, addHistoryGenerationCollected, addHistoryContentImported, addHistoryProfileCreated, addHistoryCollectionShared, addHistoryCollectionUnshared } from './activity.js';
47
50
  export { publicCredentialUrl } from './publicLink.js';
48
51
  export { encodeWasLinkSecret, isWasLinkPayload, buildWasLinkPayload, parseWasLinkPayload } from './wasLink.js';
52
+ export { inboxGrantMessage, parseInboxGrantMessage } from './inboxMessage.js';
49
53
  export { HumanReadableError } from './errors.js';
50
54
  export { CEREMONY_IDS } from './ceremony.js';
51
55
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/space/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,EAC/B,8BAA8B,EAC9B,sCAAsC,EACtC,+BAA+B,EAC/B,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EA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able
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`)
@@ -60,8 +70,10 @@ import { type ContactHeadPayload } from '@interop/social-core';
60
70
  export type ContactConflictWinner = 'remote' | 'local';
61
71
  /**
62
72
  * Recovers a validated head payload from a stored body: decrypts an
63
- * envelope, passes plaintext through, and resolves `undefined` when the
64
- * payload (and so the fields the rule compares) cannot be reached.
73
+ * envelope, and resolves `undefined` when the payload (and so the fields the
74
+ * rule compares) cannot be reached. A plaintext body passes through only when
75
+ * no cipher is passed. With a cipher, a plaintext body is unreachable and is
76
+ * never handed to the cipher (see the module doc).
65
77
  *
66
78
  * A side this replica holds no key for is unreachable. What the fail-safe rule
67
79
  * below then does with it depends on which side it was: an unreachable local
@@ -80,7 +92,8 @@ export type ContactConflictWinner = 'remote' | 'local';
80
92
  * @param options.data {Json} the stored body: an encrypted envelope or a
81
93
  * plaintext payload
82
94
  * @param [options.cipher] {DocCipher} the collection's document cipher;
83
- * absent for a plaintext store, in which case an envelope is unreachable
95
+ * absent for a plaintext store, in which case an envelope is unreachable.
96
+ * When present, a plaintext body is unreachable.
84
97
  * @returns {Promise<ContactHeadPayload | undefined>}
85
98
  * @throws {Error} the cipher's `IntegrityError`: the stored envelope was
86
99
  * sealed for a different resource than `id`
@@ -1 +1 @@
1
- {"version":3,"file":"contactsConflict.d.ts","sourceRoot":"","sources":["../../src/sync/contactsConflict.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAA;AAE7B;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,EAAE,EACF,IAAI,EACJ,MAAM,EACP,EAAE;IACD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;IACtB,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAmB1C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,EAAE,EACF,MAAM,EACN,KAAK,EACL,MAAM,EACN,aAAqB,EACrB,YAAoB,EACpB,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BAAkB,EACnB,EAAE;IACD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,IAAI,GAAG,SAAS,CAAA;IACxB,KAAK,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC7B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;QACxB,GAAG,EAAE,OAAO,CAAA;KACb,KAAK,IAAI,CAAA;CACX,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0CjC"}
@@ -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,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;QACrD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb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
12
12
  * signals) come from `@interop/was-client/sync` and are re-exported here so
13
13
  * an engine consumer imports one package. The server's `ETag` is opaque and
14
14
  * carried verbatim on `MasterState.etag` / `WireDoc.etag` / `WriteAck.etag`
15
- * -- a caller echoes it back as a later write's `ifMatch` rather than
16
- * rebuilding it from `version`.
15
+ * -- a caller echoes it back as a later write's `ifMatch`. The wire carries
16
+ * no revision number, so the validator is never rebuilt from a record.
17
17
  * - The predicates that classify those signals (`isSyncConflictError` /
18
18
  * `isSyncNotFoundError` / `isUnknownEpochError`) and the `SyncStatus`
19
19
  * vocabulary ship from `@interop/was-client/sync` too. They are imported
@@ -12,8 +12,8 @@
12
12
  * signals) come from `@interop/was-client/sync` and are re-exported here so
13
13
  * an engine consumer imports one package. The server's `ETag` is opaque and
14
14
  * carried verbatim on `MasterState.etag` / `WireDoc.etag` / `WriteAck.etag`
15
- * -- a caller echoes it back as a later write's `ifMatch` rather than
16
- * rebuilding it from `version`.
15
+ * -- a caller echoes it back as a later write's `ifMatch`. The wire carries
16
+ * no revision number, so the validator is never rebuilt from a record.
17
17
  * - The predicates that classify those signals (`isSyncConflictError` /
18
18
  * `isSyncNotFoundError` / `isUnknownEpochError`) and the `SyncStatus`
19
19
  * vocabulary ship from `@interop/was-client/sync` too. They are imported
@@ -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","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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