@interop/wallet-core 0.68.0 → 0.69.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 (124) hide show
  1. package/README.md +14 -13
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +12 -1
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +9 -2
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +10 -0
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +14 -2
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/mend.d.ts +19 -4
  11. package/dist/clientAnnex/mend.d.ts.map +1 -1
  12. package/dist/clientAnnex/mend.js +83 -35
  13. package/dist/clientAnnex/mend.js.map +1 -1
  14. package/dist/clientAnnex/rosterDeliveredEpochs.d.ts +13 -14
  15. package/dist/clientAnnex/rosterDeliveredEpochs.d.ts.map +1 -1
  16. package/dist/clientAnnex/rosterDeliveredEpochs.js +12 -12
  17. package/dist/clientAnnex/rosterDeliveredEpochs.js.map +1 -1
  18. package/dist/descriptors/index.d.ts +21 -46
  19. package/dist/descriptors/index.d.ts.map +1 -1
  20. package/dist/descriptors/index.js +21 -45
  21. package/dist/descriptors/index.js.map +1 -1
  22. package/dist/descriptors/logSource.d.ts +45 -56
  23. package/dist/descriptors/logSource.d.ts.map +1 -1
  24. package/dist/descriptors/logSource.js +64 -74
  25. package/dist/descriptors/logSource.js.map +1 -1
  26. package/dist/genesis/accountGenesis.d.ts +13 -1
  27. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  28. package/dist/genesis/accountGenesis.js +11 -2
  29. package/dist/genesis/accountGenesis.js.map +1 -1
  30. package/dist/keys/collectionLogStore.d.ts +73 -0
  31. package/dist/keys/collectionLogStore.d.ts.map +1 -0
  32. package/dist/keys/collectionLogStore.js +60 -0
  33. package/dist/keys/collectionLogStore.js.map +1 -0
  34. package/dist/keys/index.d.ts +18 -6
  35. package/dist/keys/index.d.ts.map +1 -1
  36. package/dist/keys/index.js +18 -6
  37. package/dist/keys/index.js.map +1 -1
  38. package/dist/keys/rosterLogStore.d.ts +44 -6
  39. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  40. package/dist/keys/rosterLogStore.js +51 -238
  41. package/dist/keys/rosterLogStore.js.map +1 -1
  42. package/dist/keys/rosterStore.d.ts.map +1 -1
  43. package/dist/keys/rosterStore.js +2 -1
  44. package/dist/keys/rosterStore.js.map +1 -1
  45. package/dist/keys/spaceEpochs.d.ts +67 -34
  46. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  47. package/dist/keys/spaceEpochs.js +80 -30
  48. package/dist/keys/spaceEpochs.js.map +1 -1
  49. package/dist/keys/userKeyCascade.d.ts +26 -1
  50. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  51. package/dist/keys/userKeyCascade.js +29 -2
  52. package/dist/keys/userKeyCascade.js.map +1 -1
  53. package/dist/keys/userKeyRoster.d.ts +5 -0
  54. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  55. package/dist/keys/userKeyRoster.js +5 -0
  56. package/dist/keys/userKeyRoster.js.map +1 -1
  57. package/dist/keys/userKeyRosterCascade.d.ts +54 -16
  58. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  59. package/dist/keys/userKeyRosterCascade.js +50 -22
  60. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  61. package/dist/resourceLog/controller.d.ts +18 -6
  62. package/dist/resourceLog/controller.d.ts.map +1 -1
  63. package/dist/resourceLog/controller.js +5 -3
  64. package/dist/resourceLog/controller.js.map +1 -1
  65. package/dist/resourceLog/errors.d.ts +17 -43
  66. package/dist/resourceLog/errors.d.ts.map +1 -1
  67. package/dist/resourceLog/errors.js +17 -50
  68. package/dist/resourceLog/errors.js.map +1 -1
  69. package/dist/resourceLog/index.d.ts +4 -1
  70. package/dist/resourceLog/index.d.ts.map +1 -1
  71. package/dist/resourceLog/index.js +4 -1
  72. package/dist/resourceLog/index.js.map +1 -1
  73. package/dist/resourceLog/logClass.d.ts +69 -0
  74. package/dist/resourceLog/logClass.d.ts.map +1 -0
  75. package/dist/resourceLog/logClass.js +43 -0
  76. package/dist/resourceLog/logClass.js.map +1 -0
  77. package/dist/space/collections.d.ts +22 -2
  78. package/dist/space/collections.d.ts.map +1 -1
  79. package/dist/space/collections.js +18 -0
  80. package/dist/space/collections.js.map +1 -1
  81. package/dist/space/index.d.ts +4 -3
  82. package/dist/space/index.d.ts.map +1 -1
  83. package/dist/space/index.js +4 -3
  84. package/dist/space/index.js.map +1 -1
  85. package/dist/space/provisioning.d.ts +16 -6
  86. package/dist/space/provisioning.d.ts.map +1 -1
  87. package/dist/space/provisioning.js +11 -7
  88. package/dist/space/provisioning.js.map +1 -1
  89. package/dist/sync/engine.d.ts +4 -2
  90. package/dist/sync/engine.d.ts.map +1 -1
  91. package/dist/sync/engine.js.map +1 -1
  92. package/dist/sync/index.d.ts +9 -6
  93. package/dist/sync/index.d.ts.map +1 -1
  94. package/dist/sync/index.js +8 -5
  95. package/dist/sync/index.js.map +1 -1
  96. package/dist/sync/push.d.ts +0 -29
  97. package/dist/sync/push.d.ts.map +1 -1
  98. package/dist/sync/push.js +30 -28
  99. package/dist/sync/push.js.map +1 -1
  100. package/dist/sync/types.d.ts +39 -21
  101. package/dist/sync/types.d.ts.map +1 -1
  102. package/dist/sync/types.js +13 -7
  103. package/dist/sync/types.js.map +1 -1
  104. package/dist/unlock/retire.d.ts +8 -1
  105. package/dist/unlock/retire.d.ts.map +1 -1
  106. package/dist/unlock/retire.js +8 -1
  107. package/dist/unlock/retire.js.map +1 -1
  108. package/package.json +4 -4
  109. package/dist/descriptors/acquire.d.ts +0 -122
  110. package/dist/descriptors/acquire.d.ts.map +0 -1
  111. package/dist/descriptors/acquire.js +0 -100
  112. package/dist/descriptors/acquire.js.map +0 -1
  113. package/dist/descriptors/cipher.d.ts +0 -71
  114. package/dist/descriptors/cipher.d.ts.map +0 -1
  115. package/dist/descriptors/cipher.js +0 -109
  116. package/dist/descriptors/cipher.js.map +0 -1
  117. package/dist/descriptors/errors.d.ts +0 -44
  118. package/dist/descriptors/errors.d.ts.map +0 -1
  119. package/dist/descriptors/errors.js +0 -46
  120. package/dist/descriptors/errors.js.map +0 -1
  121. package/dist/descriptors/refresh.d.ts +0 -62
  122. package/dist/descriptors/refresh.d.ts.map +0 -1
  123. package/dist/descriptors/refresh.js +0 -69
  124. package/dist/descriptors/refresh.js.map +0 -1
@@ -7,10 +7,13 @@
7
7
  * WAS-enabled wallet apps share.
8
8
  *
9
9
  * - The wire contract and port seam (`WasSyncPort`, `SyncCheckpoint`, `WireDoc`,
10
- * `Json`, `DocCipher`, `MasterState`, and the `WasSyncConflictError` /
11
- * `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
12
- * `@interop/was-client/sync` and are re-exported here so an engine consumer
13
- * imports one package.
10
+ * `Json`, `DocCipher`, `MasterState`, `WriteAck`, and the
11
+ * `WasSyncConflictError` / `WasSyncNotFoundError` / `UnknownEpochError`
12
+ * signals) come from `@interop/was-client/sync` and are re-exported here so
13
+ * an engine consumer imports one package. The server's `ETag` is opaque and
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`.
14
17
  * - The predicates that classify those signals (`isSyncConflictError` /
15
18
  * `isSyncNotFoundError` / `isUnknownEpochError`) and the `SyncStatus`
16
19
  * vocabulary ship from `@interop/was-client/sync` too. They are imported
@@ -35,7 +38,7 @@
35
38
  */
36
39
  export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
37
40
  export { runPull, projectionForDoc } from './pull.js';
38
- export { runPush, formatEtag } from './push.js';
41
+ export { runPush } from './push.js';
39
42
  export { remintPendingEnvelopes } from './remint.js';
40
43
  export { SyncEngine } from './engine.js';
41
44
  export { contactHeadPayloadOf, resolveContactHeadConflict } from './contactsConflict.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAiBjC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAIxC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAkBjC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAIxC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA"}
@@ -1,33 +1,4 @@
1
- /*!
2
- * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
- */
4
- /**
5
- * The push side of the WAS replication engine core: fan each dirty local row out
6
- * to a conditional WAS write, then reconcile per the content-addressed conflict
7
- * table.
8
- *
9
- * On a content-addressed collection an id's `data` never mutates, so a live row
10
- * only ever pushes as a create (`If-None-Match: *`) and a tombstone as a delete;
11
- * there is no update path. A mutable (last-write-wins) collection pushes a live
12
- * row as a create while never-acked (`version 0`) and as an in-place update
13
- * (`If-Match`) once acked, and settles a `412` through its injected
14
- * {@link ResolveConflict} policy.
15
- *
16
- * This loop covers the CONTENT sub-resource only (`data` / `version`, at
17
- * `PUT/DELETE /:id`). It does not drive the independently-versioned METADATA
18
- * sub-resource (`custom` / `metaVersion`, at `PUT /:id/meta`): a replica that
19
- * syncs user-writable metadata (the web wallet's RxDB driver, via
20
- * `WasSyncPort.putMeta`) keeps that half in its own push handler. It is left out
21
- * of this core deliberately -- none of the wallet Space collections
22
- * (`private-credentials`, `public-credentials`, `wallet-activity`, `contacts`,
23
- * `contacts-history`) versions its metadata independently of its content, so
24
- * folding a `putMeta` diff into this loop would add an untested code path with
25
- * no collection to exercise it. The `WasSyncPort.putMeta` capability stays
26
- * optional on the port for the driver that needs it.
27
- */
28
- import { formatEtag } from '@interop/was-client/sync';
29
1
  import type { ResolveConflict, SyncStore, WasSyncPort } from './types.js';
30
- export { formatEtag };
31
2
  /**
32
3
  * Pushes every dirty row for one feed, sequentially (bounds sockets/CPU, and
33
4
  * keeps conflict reconciliation deterministic). Honors `signal` between rows.
@@ -1 +1 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/sync/push.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EACL,UAAU,EAGX,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAQ,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAK/E,OAAO,EAAE,UAAU,EAAE,CAAA;AA+KrB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,OAAO,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,eAAe,EACf,MAAM,EACP,EAAE;IACD,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;IAChB,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAwBzD"}
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/sync/push.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAQ,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AA2L/E;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,OAAO,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,eAAe,EACf,MAAM,EACP,EAAE;IACD,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;IAChB,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAwBzD"}
package/dist/sync/push.js CHANGED
@@ -25,20 +25,17 @@
25
25
  * no collection to exercise it. The `WasSyncPort.putMeta` capability stays
26
26
  * optional on the port for the driver that needs it.
27
27
  */
28
- import { formatEtag, isSyncConflictError, isSyncNotFoundError } from '@interop/was-client/sync';
29
- // Formats a master revision as the quoted strong ETag the server compares
30
- // `If-Match` against (revision `3` becomes `"3"`). Re-exported so callers keep
31
- // importing it from here.
32
- export { formatEtag };
28
+ import { isSyncConflictError, isSyncNotFoundError } from '@interop/was-client/sync';
33
29
  /**
34
30
  * Pushes a dirty live row. A never-acked row (`version 0`) is a create
35
31
  * (`PUT /:id` with `If-None-Match: *`); an acked row (`version > 0`) is an
36
- * in-place update (`If-Match` over its version) -- reachable only on a mutable
37
- * collection, since a content-addressed row never mutates in place. On success
38
- * the acked version is recorded and the row goes clean -- unless a local write
39
- * landed while the write was in flight, which the row's `revision` token
40
- * detects (see {@link SyncStore.markPushed}) so the newer write stays dirty for
41
- * the rerun cycle.
32
+ * in-place update (`If-Match` over its stored `etag`, echoed back verbatim --
33
+ * absent only against a backend that never returned one) -- reachable only on
34
+ * a mutable collection, since a content-addressed row never mutates in place.
35
+ * On success the acked `version` / `etag` are recorded and the row goes clean
36
+ * -- unless a local write landed while the write was in flight, which the
37
+ * row's `revision` token detects (see {@link SyncStore.markPushed}) so the
38
+ * newer write stays dirty for the rerun cycle.
42
39
  *
43
40
  * A `412` is settled by the collection's policy:
44
41
  * - A mutable collection defers to its {@link ResolveConflict} (re-read master,
@@ -51,16 +48,15 @@ export { formatEtag };
51
48
  */
52
49
  async function pushUpsert({ port, store, row, resolveConflict }) {
53
50
  try {
54
- const version = await port.putContent({
51
+ const ack = await port.putContent({
55
52
  id: row.id,
56
53
  data: row.data ?? null,
57
- ...(row.version > 0
58
- ? { ifMatch: formatEtag(row.version) }
59
- : { ifNoneMatch: true })
54
+ ...(row.version > 0 ? { ifMatch: row.etag } : { ifNoneMatch: true })
60
55
  });
61
56
  await store.markPushed({
62
57
  id: row.id,
63
- version,
58
+ version: ack.version,
59
+ etag: ack.etag,
64
60
  ...(row.revision !== undefined && { revision: row.revision })
65
61
  });
66
62
  return { conflictResolved: false };
@@ -107,11 +103,16 @@ async function pushUpsert({ port, store, row, resolveConflict }) {
107
103
  async function tryDelete({ port, store, id, ifMatch, revision }) {
108
104
  const revisionAck = revision !== undefined ? { revision } : {};
109
105
  try {
110
- const version = await port.deleteContent({
106
+ const ack = await port.deleteContent({
111
107
  id,
112
108
  ...(ifMatch !== undefined && { ifMatch })
113
109
  });
114
- await store.markDeletedPushed({ id, version, ...revisionAck });
110
+ await store.markDeletedPushed({
111
+ id,
112
+ version: ack?.version,
113
+ etag: ack?.etag,
114
+ ...revisionAck
115
+ });
115
116
  return true;
116
117
  }
117
118
  catch (err) {
@@ -126,18 +127,18 @@ async function tryDelete({ port, store, id, ifMatch, revision }) {
126
127
  }
127
128
  }
128
129
  /**
129
- * Pushes a dirty tombstone. `DELETE /:id` with `If-Match` when the row was ever
130
- * acked (`version > 0`), unconditional otherwise:
130
+ * Pushes a dirty tombstone. `DELETE /:id` with `If-Match` over the row's stored
131
+ * `etag` when the row was ever acked (`version > 0`), unconditional otherwise:
131
132
  * - `204` / `404` -> settled (clean).
132
133
  * - `412` then master absent/tombstone -> delete/delete race, settled.
133
- * - `412` then master live -> retry once with a fresh `If-Match`; a second
134
- * `412` leaves the row dirty for the next cycle (the next pull refreshes its
135
- * `version` via the dirty-deleted-vs-live rule, so the retry's `If-Match`
136
- * becomes current).
134
+ * - `412` then master live -> retry once with the master's fresh `etag`; a
135
+ * second `412` leaves the row dirty for the next cycle (the next pull
136
+ * refreshes its `version` / `etag` via the dirty-deleted-vs-live rule, so the
137
+ * retry's `If-Match` becomes current).
137
138
  */
138
139
  async function pushDelete({ port, store, row }) {
139
140
  const revisionAck = row.revision !== undefined ? { revision: row.revision } : {};
140
- const firstIfMatch = row.version > 0 ? formatEtag(row.version) : undefined;
141
+ const firstIfMatch = row.version > 0 ? row.etag : undefined;
141
142
  if (await tryDelete({
142
143
  port,
143
144
  store,
@@ -153,13 +154,14 @@ async function pushDelete({ port, store, row }) {
153
154
  await store.markDeletedPushed({ id: row.id, ...revisionAck });
154
155
  return;
155
156
  }
156
- // Second attempt with the current master version. If it too hits 412 we simply
157
- // leave the row dirty (tryDelete returned false and made no store write).
157
+ // Second attempt with the master's current etag. If it too hits 412 we
158
+ // simply leave the row dirty (tryDelete returned false and made no store
159
+ // write).
158
160
  await tryDelete({
159
161
  port,
160
162
  store,
161
163
  id: row.id,
162
- ifMatch: formatEtag(master.version),
164
+ ifMatch: master.etag,
163
165
  ...revisionAck
164
166
  });
165
167
  }
@@ -1 +1 @@
1
- {"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/sync/push.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H,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,eAAe,EACf,MAAM,EAMP;IACC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,YAAY,EAAE,CAAA;IACvC,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,iBAAiB,GAAG,CAAC,CAAA;IACzB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,MAAK;QACP,CAAC;QACD,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YAChB,MAAM,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;QACxC,CAAC;aAAM,CAAC;YACN,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,UAAU,CAAC;gBAC5C,IAAI;gBACJ,KAAK;gBACL,GAAG;gBACH,eAAe;aAChB,CAAC,CAAA;YACF,IAAI,gBAAgB,EAAE,CAAC;gBACrB,iBAAiB,IAAI,CAAC,CAAA;YACxB,CAAC;QACH,CAAC;QACD,MAAM,IAAI,CAAC,CAAA;IACb,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAA;AACtC,CAAC"}
@@ -5,13 +5,19 @@
5
5
  * Types for the WAS replication engine core.
6
6
  *
7
7
  * The wire contract and port seam (`Json`, `SyncCheckpoint`, `WireDoc`,
8
- * `MasterState`, `WasSyncPort`, `DocCipher`, and the `WasSyncConflictError` /
9
- * `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
10
- * `@interop/was-client/sync` and are re-exported here so a single import gives
11
- * a consumer both the wire types and the replica-side seams. The predicates
12
- * that CLASSIFY those signals ship from `@interop/was-client/sync` too, beside
13
- * the classes that assign the names they match; `push.ts` and `remint.ts`
14
- * import them from there.
8
+ * `MasterState`, `WriteAck`, `WasSyncPort`, `DocCipher`, and the
9
+ * `WasSyncConflictError` / `WasSyncNotFoundError` / `UnknownEpochError`
10
+ * signals) come from `@interop/was-client/sync` and are re-exported here so a
11
+ * single import gives a consumer both the wire types and the replica-side
12
+ * seams. The predicates that CLASSIFY those signals ship from
13
+ * `@interop/was-client/sync` too, beside the classes that assign the names
14
+ * they match; `push.ts` and `remint.ts` import them from there.
15
+ *
16
+ * The server's `ETag` is opaque (it embeds a per-record generation marker
17
+ * ahead of the content `version`, so it can no longer be rebuilt from a bare
18
+ * revision number). `MasterState.etag` / `WireDoc.etag` / `WriteAck.etag`
19
+ * carry it verbatim; a store that persists synced rows MUST keep the string
20
+ * alongside `version` and echo it back as a later write's `ifMatch`.
15
21
  *
16
22
  * The local-persistence seam (`SyncStore`, `SyncedRow`, `ProjectionAction`,
17
23
  * `ResolveConflict`) is the replica's side of the contract: it stands in for a
@@ -25,13 +31,16 @@
25
31
  * Native, against a fake port and an in-memory store.
26
32
  */
27
33
  export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '@interop/was-client/sync';
28
- export type { Json, SyncCheckpoint, WireDoc, MasterState, WasSyncPort, DocCipher } from '@interop/was-client/sync';
34
+ export type { Json, SyncCheckpoint, WireDoc, MasterState, WriteAck, WasSyncPort, DocCipher } from '@interop/was-client/sync';
29
35
  import type { Json, MasterState, SyncCheckpoint, WireDoc } from '@interop/was-client/sync';
30
36
  /**
31
37
  * A dirty local synced-docs row awaiting push. `data` is the stored body (the
32
38
  * EDV envelope on an encrypted collection, or the plaintext JSON on a plaintext
33
39
  * one), `null` for a tombstone. `version` is the last server-acked content
34
- * revision (`0` = never acked, so a create).
40
+ * revision (`0` = never acked, so a create); `etag` is the opaque `ETag`
41
+ * validator that revision was acked (or pulled) under, echoed back verbatim as
42
+ * a later write's `ifMatch` -- absent when the row has never been acked, or
43
+ * against a backend that does not version resources.
35
44
  *
36
45
  * `revision` is the store's own local revision token for the row: any opaque
37
46
  * value the store bumps on EVERY local write (a counter, a hash of the stored
@@ -44,6 +53,7 @@ import type { Json, MasterState, SyncCheckpoint, WireDoc } from '@interop/was-cl
44
53
  export interface SyncedRow {
45
54
  id: string;
46
55
  version: number;
56
+ etag?: string;
47
57
  updatedAt: string;
48
58
  deleted: boolean;
49
59
  data: Json | null;
@@ -101,7 +111,10 @@ export interface SyncStore {
101
111
  * Applies one pulled page in a single exclusive transaction: reconcile each
102
112
  * document against the local row (per the pull-apply conflict table), write
103
113
  * the matching projection action, and advance the checkpoint. `projections`
104
- * is keyed by document id.
114
+ * is keyed by document id. Each document's `etag` (and `metaEtag`, on a
115
+ * collection that syncs metadata) MUST be recorded onto its row alongside
116
+ * `version` -- it is the validator a later local write echoes back as
117
+ * `ifMatch`.
105
118
  */
106
119
  applyPulledPage(options: {
107
120
  documents: WireDoc[];
@@ -109,30 +122,33 @@ export interface SyncStore {
109
122
  projections: Map<string, ProjectionAction>;
110
123
  }): Promise<void>;
111
124
  /**
112
- * Marks a pushed create/update as acked: record the server `version` when
113
- * provided (the `204` ETag), and clear dirty -- but ONLY if the row's current
125
+ * Marks a pushed create/update as acked: record the server `version` and the
126
+ * opaque `etag` validator it lives behind (the write's {@link WriteAck}) when
127
+ * provided, and clear dirty -- but ONLY if the row's current
114
128
  * {@link SyncedRow.revision} still equals the `revision` that was pushed. A
115
129
  * local write that landed while the write was in flight leaves a newer token,
116
- * and that row MUST stay dirty (with the acked `version` still recorded, so
117
- * the re-push's `If-Match` is current) so the rerun cycle pushes it. When
118
- * `revision` is `undefined` -- a store that does not track a revision token --
119
- * dirty is cleared unconditionally.
130
+ * and that row MUST stay dirty (with the acked `version` / `etag` still
131
+ * recorded, so the re-push's `ifMatch` is current) so the rerun cycle pushes
132
+ * it. When `revision` is `undefined` -- a store that does not track a
133
+ * revision token -- dirty is cleared unconditionally.
120
134
  */
121
135
  markPushed(options: {
122
136
  id: string;
123
137
  version?: number;
138
+ etag?: string;
124
139
  revision?: string | number;
125
140
  }): Promise<void>;
126
141
  /**
127
142
  * Marks a pushed delete as settled: keep the tombstone, record the server
128
- * `version` when provided, and clear dirty under the same revision condition
129
- * as {@link SyncStore.markPushed} -- a row rewritten locally mid-flight stays
130
- * dirty and keeps its local state rather than being forced to a clean
131
- * tombstone.
143
+ * `version` / `etag` when provided, and clear dirty under the same revision
144
+ * condition as {@link SyncStore.markPushed} -- a row rewritten locally
145
+ * mid-flight stays dirty and keeps its local state rather than being forced
146
+ * to a clean tombstone.
132
147
  */
133
148
  markDeletedPushed(options: {
134
149
  id: string;
135
150
  version?: number;
151
+ etag?: string;
136
152
  revision?: string | number;
137
153
  }): Promise<void>;
138
154
  /**
@@ -140,7 +156,9 @@ export interface SyncStore {
140
156
  * contract's RxDB-derived naming) for a row whose push hit a `412`, applying
141
157
  * `projection` in the same transaction. `latest === null` means the server
142
158
  * has a tombstone (or the resource is absent): record the tombstone and
143
- * delete the projection.
159
+ * delete the projection. A non-null `latest` carries its own `etag`, which
160
+ * the store MUST record onto the row alongside `version` -- it is the
161
+ * validator the row's next push echoes back as `ifMatch`.
144
162
  */
145
163
  adoptLatest(options: {
146
164
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,WAAW,EACX,WAAW,EACX,SAAS,EACV,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EACV,IAAI,EACJ,WAAW,EACX,cAAc,EACd,OAAO,EACR,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,IAAI,GA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E,MAAM,CAAA;QAChB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjB;;;;;;;;OAQG;IACH,WAAW,CAAC,OAAO,EAAE;QACnB,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;QAC1B,UAAU,EAAE,gBAAgB,CAAA;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,cAAc,CAAC,CAAC,OAAO,EAAE;QACvB,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,IAAI,CAAA;QACd,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAC3B,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAClC"}
@@ -5,13 +5,19 @@
5
5
  * Types for the WAS replication engine core.
6
6
  *
7
7
  * The wire contract and port seam (`Json`, `SyncCheckpoint`, `WireDoc`,
8
- * `MasterState`, `WasSyncPort`, `DocCipher`, and the `WasSyncConflictError` /
9
- * `WasSyncNotFoundError` / `UnknownEpochError` signals) come from
10
- * `@interop/was-client/sync` and are re-exported here so a single import gives
11
- * a consumer both the wire types and the replica-side seams. The predicates
12
- * that CLASSIFY those signals ship from `@interop/was-client/sync` too, beside
13
- * the classes that assign the names they match; `push.ts` and `remint.ts`
14
- * import them from there.
8
+ * `MasterState`, `WriteAck`, `WasSyncPort`, `DocCipher`, and the
9
+ * `WasSyncConflictError` / `WasSyncNotFoundError` / `UnknownEpochError`
10
+ * signals) come from `@interop/was-client/sync` and are re-exported here so a
11
+ * single import gives a consumer both the wire types and the replica-side
12
+ * seams. The predicates that CLASSIFY those signals ship from
13
+ * `@interop/was-client/sync` too, beside the classes that assign the names
14
+ * they match; `push.ts` and `remint.ts` import them from there.
15
+ *
16
+ * The server's `ETag` is opaque (it embeds a per-record generation marker
17
+ * ahead of the content `version`, so it can no longer be rebuilt from a bare
18
+ * revision number). `MasterState.etag` / `WireDoc.etag` / `WriteAck.etag`
19
+ * carry it verbatim; a store that persists synced rows MUST keep the string
20
+ * alongside `version` and echo it back as a later write's `ifMatch`.
15
21
  *
16
22
  * The local-persistence seam (`SyncStore`, `SyncedRow`, `ProjectionAction`,
17
23
  * `ResolveConflict`) is the replica's side of the contract: it stands in for a
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA"}
@@ -166,7 +166,14 @@ export interface ClientAnnexInventoryRetirement {
166
166
  * @param [options.onUserKeyAdopted] {Function} persists a rotated key:
167
167
  * called with `{ userKey, latestEpochId, descriptor }` after the roster read
168
168
  * and BEFORE the fan-out. The key and the epoch pin must persist atomically
169
- * @param options.collections {CascadeCollections} the fan-out's work
169
+ * @param options.collections {CascadeCollections} the fan-out's work. Every
170
+ * collection store it hands back appends to that collection's governing
171
+ * log, anchored at the POST-EDIT document, so its signer must be a key that
172
+ * document still lists under `assertionMethod`. On a passphrase change that
173
+ * is the NEW credential's ladder VM, never the retiring credential's, whose
174
+ * ladder VM this ceremony's own inventory edit strikes; sign with the
175
+ * retiring one and every collection append is refused, leaving the
176
+ * collections keyed to the retired user key generation
170
177
  * @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
171
178
  * Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
172
179
  * the module doc), run against the post-edit document; a throw is caught
@@ -1 +1 @@
1
- {"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;GASG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,8BAA8B,CAAA;CAC7C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,QAAQ,GAAG,SAAS,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,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAoE5C"}
@@ -42,7 +42,14 @@ import { removeUnlockKey } from './standingWebvh.js';
42
42
  * @param [options.onUserKeyAdopted] {Function} persists a rotated key:
43
43
  * called with `{ userKey, latestEpochId, descriptor }` after the roster read
44
44
  * and BEFORE the fan-out. The key and the epoch pin must persist atomically
45
- * @param options.collections {CascadeCollections} the fan-out's work
45
+ * @param options.collections {CascadeCollections} the fan-out's work. Every
46
+ * collection store it hands back appends to that collection's governing
47
+ * log, anchored at the POST-EDIT document, so its signer must be a key that
48
+ * document still lists under `assertionMethod`. On a passphrase change that
49
+ * is the NEW credential's ladder VM, never the retiring credential's, whose
50
+ * ladder VM this ceremony's own inventory edit strikes; sign with the
51
+ * retiring one and every collection append is refused, leaving the
52
+ * collections keyed to the retired user key generation
46
53
  * @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
47
54
  * Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
48
55
  * the module doc), run against the post-edit document; a throw is caught
@@ -1 +1 @@
1
- {"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAyFA,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EACL,eAAe,EAGhB,MAAM,oBAAoB,CAAA;AAqC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,OAAO,EACP,MAAM,EACN,UAAU,EACV,UAAU,EACV,eAAe,EACf,WAAW,EACX,IAAI,EACJ,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,0BAA0B,EAC1B,iBAAiB,EAuBlB;IACC,yEAAyE;IACzE,yEAAyE;IACzE,iCAAiC;IACjC,MAAM,EAAE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allet-core",
3
3
  "description": "Shared wallet-domain logic (WAS sync engine core and wallet Space layout contracts) for Interop wallet apps.",
4
- "version": "0.68.0",
4
+ "version": "0.69.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "pnpm run clear && tsc",
@@ -28,10 +28,10 @@
28
28
  "@interop/ezcap": "^7.4.6",
29
29
  "@interop/security-document-loader": "^10.1.1",
30
30
  "@interop/social-core": "^0.8.1",
31
- "@interop/storage-core": "^0.10.0",
31
+ "@interop/storage-core": "^0.11.0",
32
32
  "@interop/vc": "^11.0.8",
33
- "@interop/vh-resource-log": "^0.4.1",
34
- "@interop/was-client": "^0.49.0",
33
+ "@interop/vh-resource-log": "^0.5.0",
34
+ "@interop/was-client": "^0.54.0",
35
35
  "@interop/webkms-client": "^14.7.5",
36
36
  "@interop/x25519-key-agreement-key": "^5.3.0",
37
37
  "@noble/ciphers": "^2.3.0",
@@ -1,122 +0,0 @@
1
- /*!
2
- * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
- */
4
- /**
5
- * Collection encryption-descriptor acquisition: reading a collection's
6
- * `CollectionEncryption` descriptor (its key-epoch roster) from the Collection
7
- * Description, caching each success, and falling back to the cached copy
8
- * whenever the description yields no descriptor -- whether it could not be
9
- * fetched at all (offline, a collection must keep encrypting under its current
10
- * epoch) or came back empty (WAS masks an unauthorized read as an absent one,
11
- * so an empty description is ambiguous, never an authoritative "no
12
- * encryption"). `undefined` therefore means only this: nothing, fetched or
13
- * cached, describes this collection's encryption -- a plaintext collection, or
14
- * an encrypted one whose epoch[0] install has not landed. A caller that has
15
- * declared the collection encrypted must refuse fail-closed rather than
16
- * encrypt without a roster.
17
- *
18
- * The two seams are deliberately narrow, so a wallet app's own classes satisfy
19
- * them structurally -- no adapter needed. An {@link EncryptionDescriptorSource}
20
- * is one signed describe; an {@link EncryptionDescriptorCache} is a
21
- * client-local get/put the host has already scoped to one account's Space (a
22
- * web wallet: a localStorage pair keyed by Space id; a mobile wallet: a
23
- * per-(profile, collection) table column), so no scope key appears in the
24
- * interface.
25
- */
26
- import type { CollectionEncryption, WasClient } from '@interop/was-client';
27
- /**
28
- * Where descriptors come from: one signed read of the collection's
29
- * Description. Resolves `undefined` when the description carries no encryption
30
- * member -- which a WAS host also serves for a read this client is not
31
- * authorized to make, so the absence is ambiguous and callers fall back to a
32
- * cached copy just as they do for a thrown fetch. Network errors throw through
33
- * (callers treat the fetch as best-effort).
34
- */
35
- export interface EncryptionDescriptorSource {
36
- collectionEncryption(options: {
37
- collectionId: string;
38
- }): Promise<CollectionEncryption | undefined>;
39
- }
40
- /**
41
- * Where fetched descriptors survive offline: a client-local get/put
42
- * pre-scoped by the host to one account's Space. `readDescriptor` resolves
43
- * `undefined` when nothing is cached (never throws for absence).
44
- */
45
- export interface EncryptionDescriptorCache {
46
- readDescriptor(options: {
47
- collectionId: string;
48
- }): Promise<CollectionEncryption | undefined>;
49
- writeDescriptor(options: {
50
- collectionId: string;
51
- descriptor: CollectionEncryption;
52
- }): Promise<void>;
53
- }
54
- /**
55
- * The {@link EncryptionDescriptorSource} over a was-client handle: reads the
56
- * collection's Description in the given Space and returns its `encryption`
57
- * descriptor.
58
- *
59
- * @param options {object}
60
- * @param options.was {WasClient} a client whose signer can read the Space
61
- * @param options.spaceId {string}
62
- * @returns {EncryptionDescriptorSource}
63
- */
64
- export declare function wasDescriptorSource({ was, spaceId }: {
65
- was: WasClient;
66
- spaceId: string;
67
- }): EncryptionDescriptorSource;
68
- /**
69
- * Acquires one collection's descriptor: fetches it from the source, caching a
70
- * success; falls back to the cached copy whenever the fetch yields no
71
- * descriptor (it threw, or it came back empty -- a masked 404 for an
72
- * unauthorized read looks exactly like an unencrypted collection); and with no
73
- * source at all (a purely local code path) reads the cache alone. Any cached
74
- * copy is deliberately left in place, never cleared by an empty fetch.
75
- * `undefined` means no descriptor exists anywhere for this collection.
76
- *
77
- * @param options {object}
78
- * @param [options.source] {EncryptionDescriptorSource} omit for cache-only
79
- * acquisition
80
- * @param options.cache {EncryptionDescriptorCache}
81
- * @param options.collectionId {string}
82
- * @param [options.onFetchError] {function} observes a swallowed fetch
83
- * failure (the thrown-fetch branch only; an empty description is not an
84
- * error). Errors from the cache itself throw through, as do a log-governed
85
- * source's refusal classes (a fabricated or discontinuous log is a security
86
- * signal, not an outage the cache should paper over) -- except a continuity
87
- * `rollback`, which falls back to the cache like any transport hiccup
88
- * @returns {Promise<CollectionEncryption | undefined>}
89
- */
90
- export declare function acquireDescriptor({ source, cache, collectionId, onFetchError }: {
91
- source?: EncryptionDescriptorSource;
92
- cache: EncryptionDescriptorCache;
93
- collectionId: string;
94
- onFetchError?: (err: unknown, info: {
95
- collectionId: string;
96
- }) => void;
97
- }): Promise<CollectionEncryption | undefined>;
98
- /**
99
- * Acquires descriptors for a set of collections concurrently (each fetch is an
100
- * independent signed round trip, so a session start is not gated on a serial
101
- * chain of describes). Collections that resolve no descriptor are simply
102
- * absent from the result.
103
- *
104
- * @param options {object}
105
- * @param [options.source] {EncryptionDescriptorSource} omit for cache-only
106
- * acquisition
107
- * @param options.cache {EncryptionDescriptorCache}
108
- * @param options.collectionIds {string[]}
109
- * @param [options.onFetchError] {function} observes each swallowed fetch
110
- * failure
111
- * @returns {Promise<Record<string, CollectionEncryption>>} keyed by
112
- * collection id
113
- */
114
- export declare function acquireDescriptors({ source, cache, collectionIds, onFetchError }: {
115
- source?: EncryptionDescriptorSource;
116
- cache: EncryptionDescriptorCache;
117
- collectionIds: string[];
118
- onFetchError?: (err: unknown, info: {
119
- collectionId: string;
120
- }) => void;
121
- }): Promise<Record<string, CollectionEncryption>>;
122
- //# sourceMappingURL=acquire.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"acquire.d.ts","sourceRoot":"","sources":["../../src/descriptors/acquire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAG1E;;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