@interop/was-client 0.13.3 → 0.14.1

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 (80) hide show
  1. package/README.md +33 -0
  2. package/dist/Collection.d.ts +58 -0
  3. package/dist/Collection.d.ts.map +1 -1
  4. package/dist/Collection.js +106 -13
  5. package/dist/Collection.js.map +1 -1
  6. package/dist/Resource.d.ts +8 -0
  7. package/dist/Resource.d.ts.map +1 -1
  8. package/dist/Resource.js +52 -34
  9. package/dist/Resource.js.map +1 -1
  10. package/dist/Space.d.ts +42 -1
  11. package/dist/Space.d.ts.map +1 -1
  12. package/dist/Space.js +55 -2
  13. package/dist/Space.js.map +1 -1
  14. package/dist/WasClient.d.ts +15 -0
  15. package/dist/WasClient.d.ts.map +1 -1
  16. package/dist/WasClient.js +52 -21
  17. package/dist/WasClient.js.map +1 -1
  18. package/dist/codec.d.ts +14 -11
  19. package/dist/codec.d.ts.map +1 -1
  20. package/dist/edv/EdvCodec.d.ts +34 -56
  21. package/dist/edv/EdvCodec.d.ts.map +1 -1
  22. package/dist/edv/EdvCodec.js +155 -52
  23. package/dist/edv/EdvCodec.js.map +1 -1
  24. package/dist/edv/WasTransport.d.ts +84 -19
  25. package/dist/edv/WasTransport.d.ts.map +1 -1
  26. package/dist/edv/WasTransport.js +198 -44
  27. package/dist/edv/WasTransport.js.map +1 -1
  28. package/dist/edv/epochCrypto.d.ts +101 -0
  29. package/dist/edv/epochCrypto.d.ts.map +1 -0
  30. package/dist/edv/epochCrypto.js +211 -0
  31. package/dist/edv/epochCrypto.js.map +1 -0
  32. package/dist/edv/epochKeys.d.ts +57 -0
  33. package/dist/edv/epochKeys.d.ts.map +1 -0
  34. package/dist/edv/epochKeys.js +132 -0
  35. package/dist/edv/epochKeys.js.map +1 -0
  36. package/dist/edv/index.d.ts +8 -0
  37. package/dist/edv/index.d.ts.map +1 -1
  38. package/dist/edv/index.js +7 -0
  39. package/dist/edv/index.js.map +1 -1
  40. package/dist/edv/recipients.d.ts +122 -0
  41. package/dist/edv/recipients.d.ts.map +1 -0
  42. package/dist/edv/recipients.js +265 -0
  43. package/dist/edv/recipients.js.map +1 -0
  44. package/dist/errors.d.ts +31 -0
  45. package/dist/errors.d.ts.map +1 -1
  46. package/dist/errors.js +37 -0
  47. package/dist/errors.js.map +1 -1
  48. package/dist/index.d.ts +2 -2
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/index.js.map +1 -1
  52. package/dist/internal/codec.d.ts.map +1 -1
  53. package/dist/internal/codec.js +12 -4
  54. package/dist/internal/codec.js.map +1 -1
  55. package/dist/internal/conditional.d.ts +6 -1
  56. package/dist/internal/conditional.d.ts.map +1 -1
  57. package/dist/internal/conditional.js +8 -1
  58. package/dist/internal/conditional.js.map +1 -1
  59. package/dist/internal/content.d.ts +2 -2
  60. package/dist/internal/content.d.ts.map +1 -1
  61. package/dist/internal/content.js +16 -6
  62. package/dist/internal/content.js.map +1 -1
  63. package/dist/internal/grant.d.ts +11 -1
  64. package/dist/internal/grant.d.ts.map +1 -1
  65. package/dist/internal/grant.js +32 -3
  66. package/dist/internal/grant.js.map +1 -1
  67. package/dist/internal/paths.d.ts +28 -0
  68. package/dist/internal/paths.d.ts.map +1 -1
  69. package/dist/internal/paths.js +52 -1
  70. package/dist/internal/paths.js.map +1 -1
  71. package/dist/internal/revoke.d.ts +34 -0
  72. package/dist/internal/revoke.d.ts.map +1 -0
  73. package/dist/internal/revoke.js +106 -0
  74. package/dist/internal/revoke.js.map +1 -0
  75. package/dist/internal/write.d.ts.map +1 -1
  76. package/dist/internal/write.js +5 -1
  77. package/dist/internal/write.js.map +1 -1
  78. package/dist/types.d.ts +77 -5
  79. package/dist/types.d.ts.map +1 -1
  80. package/package.json +7 -5
@@ -43,15 +43,19 @@
43
43
  * surfaces as a `PreconditionFailedError` (412) -- the lost-update guard --
44
44
  * rather than the old advisory last-writer-wins. Against a backend that does
45
45
  * not advertise `conditional-writes` (no ETag) it degrades to advisory.
46
- * - **Encrypted metadata.** `metadataMode` is `'encrypted'`, so a Resource's
47
- * user-writable `custom` (`name`/`tags`, via `setName`/`setTags`/`setMeta`) is
46
+ * - **Encrypted metadata.** A Resource's user-writable `custom`
47
+ * (`name`/`tags`, via `setName`/`setTags`/`setMeta`) is
48
48
  * encrypted into an EDV Document envelope with the same `documentCipher` used
49
49
  * for content and stored opaquely under `/meta`; the server never sees
50
50
  * plaintext `name`/`tags`. A reader with the keys decrypts it back
51
51
  * transparently via `meta()`.
52
52
  */
53
+ import { base64 } from '@scure/base';
53
54
  import { EdvClientCore } from '@interop/edv-client';
54
- import { EncryptionError, ValidationError } from '../errors.js';
55
+ import { EncryptionError, IntegrityError, KeyUnwrapError, ValidationError } from '../errors.js';
56
+ import { readEtag } from '../internal/conditional.js';
57
+ import { resolveEpochKeys } from './epochKeys.js';
58
+ import { didKeyResolver } from './epochCrypto.js';
55
59
  import { isBlob, isTextContentType, readJsonData, resolvePayload } from '../internal/content.js';
56
60
  import { DEFAULT_CONTENT_TYPE, ENCODER, envelopeBytes } from './constants.js';
57
61
  /**
@@ -80,37 +84,32 @@ const UTF8_DECODER = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
80
84
  */
81
85
  const EDV_DOC_ID = /^z[1-9A-HJ-NP-Za-km-z]{21,}$/;
82
86
  /**
83
- * Encodes bytes to standard base64 using the platform `btoa` (present in modern
84
- * Node and browsers), via a binary string built in 32 KiB
85
- * `String.fromCharCode` chunks -- large enough to amortize the call overhead,
86
- * small enough to stay under engines' argument-count limits. (Byte-by-byte
87
- * string concatenation is quadratic-ish on the multi-MiB blobs the write path
88
- * feeds this.)
89
- *
90
- * @param bytes {Uint8Array}
91
- * @returns {string}
87
+ * The exact messages `@interop/minimal-cipher` / `@interop/edv-client` throw
88
+ * when a candidate key simply does not open an envelope -- a wrong or rotated
89
+ * key, not a corrupted one. `'Decryption failed.'` is the null-CEK unwrap path
90
+ * (the key could not unwrap the content-encryption key); `'No matching
91
+ * recipient found ...'` is the earlier kid-mismatch. These are the only two
92
+ * decrypt failures the `_decrypt` loop treats as "try the next key". Any OTHER
93
+ * decrypt failure means the key DID select a recipient and unwrap, but the
94
+ * content's AEAD tag did not verify -- a data-integrity failure (WebCrypto's
95
+ * `OperationError` in browsers, Node's "unable to authenticate data") -- which
96
+ * must surface as an {@link IntegrityError}, not be masked as a key miss.
92
97
  */
93
- function bytesToBase64(bytes) {
94
- let binary = '';
95
- const chunkSize = 0x8000;
96
- for (let index = 0; index < bytes.length; index += chunkSize) {
97
- binary += String.fromCharCode(...bytes.subarray(index, index + chunkSize));
98
- }
99
- return btoa(binary);
100
- }
98
+ const KEY_MISS_MESSAGES = new Set([
99
+ 'Decryption failed.',
100
+ 'No matching recipient found for key agreement key.'
101
+ ]);
101
102
  /**
102
- * Decodes standard base64 to bytes using the platform `atob`.
103
+ * Whether a decrypt error means "this candidate key does not open the envelope"
104
+ * (so the loop should try the next key) rather than an integrity failure. True
105
+ * only for the closed set of {@link KEY_MISS_MESSAGES}; every other error is
106
+ * treated as an integrity failure and surfaces immediately.
103
107
  *
104
- * @param base64 {string}
105
- * @returns {Uint8Array}
108
+ * @param err {unknown}
109
+ * @returns {boolean}
106
110
  */
107
- function base64ToBytes(base64) {
108
- const binary = atob(base64);
109
- const bytes = new Uint8Array(binary.length);
110
- for (let index = 0; index < binary.length; index++) {
111
- bytes[index] = binary.charCodeAt(index);
112
- }
113
- return bytes;
111
+ function isKeyMiss(err) {
112
+ return err instanceof Error && KEY_MISS_MESSAGES.has(err.message);
114
113
  }
115
114
  /**
116
115
  * A {@link ResourceCodec} that encrypts on write and decrypts on read using an
@@ -118,26 +117,40 @@ function base64ToBytes(base64) {
118
117
  * collection handle.
119
118
  */
120
119
  export class EdvCodec {
121
- metadataMode = 'encrypted';
122
120
  conditionalWrites = true;
123
121
  _edv;
124
- _keyAgreementKey;
122
+ _writeKey;
123
+ _readKeys;
124
+ _writeEpoch;
125
125
  _contentType;
126
126
  _maxBlobBytes;
127
127
  _idDerivation;
128
128
  /**
129
129
  * @param options {object}
130
130
  * @param options.edv {EdvClientCore} holds the cipher + key resolver
131
- * @param options.keyAgreementKey {IKeyAgreementKey} the recipient/decrypt key
131
+ * @param options.keyAgreementKey {IKeyAgreementKey} the key writes encrypt
132
+ * under and the default read key. On a single-key collection this is the
133
+ * wallet's own key-agreement key; on a multi-recipient (key-epoch)
134
+ * collection it is the reconstructed `currentEpoch` key pair.
135
+ * @param [options.readKeys] {IKeyAgreementKey[]} the candidate keys a read
136
+ * may decrypt with, one per epoch this reader can unwrap (defaults to just
137
+ * `keyAgreementKey`). A read selects the one whose id matches the stored
138
+ * envelope's recipient, so a resource written under an older epoch still
139
+ * decrypts.
140
+ * @param [options.writeEpoch] {string} the key-epoch id to stamp on writes
141
+ * (the `currentEpoch`), surfaced as {@link EncodedWrite.epoch}; absent on a
142
+ * single-key collection.
132
143
  * @param options.contentType {string} stored envelope content type
133
144
  * @param options.maxBlobBytes {number} single-document binary cap
134
145
  * @param options.idDerivation {string} how `add()` mints a document
135
146
  * id: `'random'` (classic `generateId()`) or `'content'` (derived from the
136
147
  * JWE ciphertext, content-addressed)
137
148
  */
138
- constructor({ edv, keyAgreementKey, contentType, maxBlobBytes, idDerivation }) {
149
+ constructor({ edv, keyAgreementKey, readKeys, writeEpoch, contentType, maxBlobBytes, idDerivation }) {
139
150
  this._edv = edv;
140
- this._keyAgreementKey = keyAgreementKey;
151
+ this._writeKey = keyAgreementKey;
152
+ this._readKeys = readKeys ?? [keyAgreementKey];
153
+ this._writeEpoch = writeEpoch;
141
154
  this._contentType = contentType;
142
155
  this._maxBlobBytes = maxBlobBytes;
143
156
  this._idDerivation = idDerivation;
@@ -171,7 +184,7 @@ export class EdvCodec {
171
184
  priorDoc = read;
172
185
  }
173
186
  const { documentCipher } = this._edv;
174
- const recipients = documentCipher.createDefaultRecipients(this._keyAgreementKey);
187
+ const recipients = documentCipher.createDefaultRecipients(this._writeKey);
175
188
  const encrypted = await documentCipher.encrypt({
176
189
  doc: {
177
190
  ...(docId !== undefined && { id: docId }),
@@ -210,8 +223,12 @@ export class EdvCodec {
210
223
  // (create-only-if-absent); a backend that does not honor it simply ignores
211
224
  // it, leaving the write harmless rather than degraded.
212
225
  ...(priorDoc
213
- ? { ifMatch: current.headers.get('etag') ?? undefined }
214
- : { ifNoneMatch: true })
226
+ ? { ifMatch: readEtag(current ?? null) }
227
+ : { ifNoneMatch: true }),
228
+ // Stamp the key epoch this write encrypted under (the `currentEpoch`), so
229
+ // the server records it and a reader can pick the epoch key. Absent on a
230
+ // single-key collection.
231
+ ...(this._writeEpoch !== undefined && { epoch: this._writeEpoch })
215
232
  };
216
233
  }
217
234
  /**
@@ -220,12 +237,70 @@ export class EdvCodec {
220
237
  async decode(response) {
221
238
  const encryptedDoc = await readJsonData(response);
222
239
  this._assertEnvelope(encryptedDoc, 'read');
223
- const decrypted = await this._edv.documentCipher.decrypt({
224
- encryptedDoc,
225
- keyAgreementKey: this._keyAgreementKey
226
- });
240
+ const decrypted = await this._decrypt(encryptedDoc);
227
241
  return this._fromDocument(decrypted.content, decrypted.meta);
228
242
  }
243
+ /**
244
+ * Decrypts a stored EDV envelope, selecting which read key to use by matching
245
+ * the envelope's JWE recipient `kid` against this reader's candidate keys
246
+ * (one per epoch it can unwrap). On a single-key collection there is exactly
247
+ * one candidate; on a multi-recipient collection a resource written under an
248
+ * older epoch selects that epoch's key, so history stays readable.
249
+ *
250
+ * A stored envelope naming an epoch this reader holds no key for (it was never
251
+ * a recipient of that epoch, or was removed and the epoch rotated) fails with
252
+ * {@link KeyUnwrapError} -- the **read** axis only; it says nothing about
253
+ * whether the server will still serve (pull) the ciphertext.
254
+ *
255
+ * @param encryptedDoc {IEncryptedDocument}
256
+ * @returns {Promise<{ content?: unknown; meta?: Record<string, unknown> }>}
257
+ */
258
+ async _decrypt(encryptedDoc) {
259
+ const recipients = encryptedDoc.jwe.recipients ?? [];
260
+ const kids = new Set(recipients
261
+ .map(recipient => recipient.header?.kid)
262
+ .filter((kid) => typeof kid === 'string'));
263
+ // Prefer the read key whose id names a recipient of this envelope. The
264
+ // `rest` fallback then tries the remaining candidates: it serves an envelope
265
+ // whose recipient `kid` matches no local key id -- format drift, or a
266
+ // single-key envelope read with a differently-labeled key -- where the
267
+ // exact-match partition is empty even though a candidate can still unwrap it.
268
+ // For a well-formed epoch envelope the exact match always hits, so `rest` is
269
+ // normally unreached.
270
+ const preferred = this._readKeys.filter(key => kids.has(key.id));
271
+ const rest = this._readKeys.filter(key => !kids.has(key.id));
272
+ for (const keyAgreementKey of [...preferred, ...rest]) {
273
+ try {
274
+ return await this._edv.documentCipher.decrypt({
275
+ encryptedDoc,
276
+ keyAgreementKey
277
+ });
278
+ }
279
+ catch (err) {
280
+ if (isKeyMiss(err)) {
281
+ // This candidate is not a recipient of this envelope, or could not
282
+ // unwrap its content-encryption key; try the next candidate.
283
+ continue;
284
+ }
285
+ // The candidate DID select a recipient and unwrap the CEK, but the
286
+ // content's AEAD tag failed to authenticate: the stored ciphertext is
287
+ // corrupt or has been tampered with. Surface this immediately as an
288
+ // integrity failure rather than masking it as a membership/key miss by
289
+ // continuing into `rest` (a real key miss never reaches AEAD, so this
290
+ // can only be a genuine integrity failure on a key that matched).
291
+ throw new IntegrityError('Cannot decrypt this resource: its ciphertext failed to authenticate ' +
292
+ '(the AEAD integrity tag did not verify). This reader holds a key ' +
293
+ 'that unwrapped the envelope, so this is not a key-epoch/membership ' +
294
+ 'problem -- the stored envelope is corrupt or has been tampered ' +
295
+ 'with.', { cause: err });
296
+ }
297
+ }
298
+ throw new KeyUnwrapError("Cannot decrypt this resource: none of this reader's epoch keys unwrap " +
299
+ 'it. It was encrypted under a key epoch this reader holds no key for ' +
300
+ '(it was never a recipient of that epoch, or it was removed from the ' +
301
+ 'collection and the epoch was rotated). This is the read axis only -- ' +
302
+ 'the server may still serve the ciphertext (a separate zcap decision).');
303
+ }
229
304
  /**
230
305
  * @inheritdoc
231
306
  *
@@ -237,7 +312,7 @@ export class EdvCodec {
237
312
  */
238
313
  async encodeMeta({ custom }) {
239
314
  const { documentCipher } = this._edv;
240
- const recipients = documentCipher.createDefaultRecipients(this._keyAgreementKey);
315
+ const recipients = documentCipher.createDefaultRecipients(this._writeKey);
241
316
  // The document needs an EDV id (the cipher asserts one on decrypt). It is
242
317
  // opaque to the server -- carried inside the un-decryptable envelope -- and
243
318
  // minted fresh each write, since the metadata envelope is never updated in
@@ -264,10 +339,7 @@ export class EdvCodec {
264
339
  return {};
265
340
  }
266
341
  this._assertEnvelope(custom, 'read');
267
- const decrypted = await this._edv.documentCipher.decrypt({
268
- encryptedDoc: custom,
269
- keyAgreementKey: this._keyAgreementKey
270
- });
342
+ const decrypted = await this._decrypt(custom);
271
343
  return (decrypted.content ?? {});
272
344
  }
273
345
  /**
@@ -360,7 +432,7 @@ export class EdvCodec {
360
432
  }
361
433
  }
362
434
  return {
363
- content: { bytes: bytesToBase64(bytes) },
435
+ content: { bytes: base64.encode(bytes) },
364
436
  meta: { contentType: resolvedType, encoding: 'base64' }
365
437
  };
366
438
  }
@@ -404,12 +476,12 @@ export class EdvCodec {
404
476
  return new Blob([ENCODER.encode(text)], { type: contentType });
405
477
  }
406
478
  if (encoding === 'base64') {
407
- const base64 = content?.bytes;
408
- if (typeof base64 !== 'string') {
479
+ const base64Text = content?.bytes;
480
+ if (typeof base64Text !== 'string') {
409
481
  throw new EncryptionError('Malformed encrypted binary document: meta.encoding is "base64" but ' +
410
482
  'content.bytes is not a string.');
411
483
  }
412
- return new Blob([base64ToBytes(base64)], {
484
+ return new Blob([base64.decode(base64Text)], {
413
485
  type: contentType
414
486
  });
415
487
  }
@@ -472,7 +544,7 @@ const EDV_SCHEME = 'edv';
472
544
  */
473
545
  export function createEdvEncryption({ resolveKeys, contentType = DEFAULT_CONTENT_TYPE, maxBlobBytes = DEFAULT_MAX_BLOB_BYTES, idDerivation = 'random' }) {
474
546
  return {
475
- async codecFor({ spaceId, collectionId, scheme, keys }) {
547
+ async codecFor({ spaceId, collectionId, scheme, encryption, keys }) {
476
548
  if (scheme !== EDV_SCHEME) {
477
549
  return null;
478
550
  }
@@ -482,6 +554,37 @@ export function createEdvEncryption({ resolveKeys, contentType = DEFAULT_CONTENT
482
554
  if (!resolved) {
483
555
  return null;
484
556
  }
557
+ // Multi-recipient (key-epoch) collection: resolve the reader's per-epoch
558
+ // keys from the marker -- the `currentEpoch` key pair for writes, every
559
+ // epoch key it can unwrap for reads -- and drive the cipher with those.
560
+ // The reader's own key-agreement key is used only to unwrap the epoch
561
+ // keys, never to encrypt resources.
562
+ if (encryption?.epochs && encryption.epochs.length > 0) {
563
+ const epochKeys = await resolveEpochKeys({
564
+ encryption,
565
+ keyAgreementKey: resolved.keyAgreementKey
566
+ });
567
+ if (epochKeys) {
568
+ // Epoch keys are self-describing did:key key-agreement keys, so a
569
+ // resource's recipient (the epoch public key) resolves through the
570
+ // standard did:key resolver, independent of the reader's own keystore.
571
+ const edv = new EdvClientCore({
572
+ keyAgreementKey: epochKeys.writeKey,
573
+ keyResolver: didKeyResolver
574
+ });
575
+ return new EdvCodec({
576
+ edv,
577
+ keyAgreementKey: epochKeys.writeKey,
578
+ readKeys: epochKeys.readKeys,
579
+ writeEpoch: epochKeys.writeEpoch,
580
+ contentType,
581
+ maxBlobBytes,
582
+ idDerivation
583
+ });
584
+ }
585
+ }
586
+ // Single-key collection (no epochs on the marker): the wallet's own
587
+ // key-agreement key encrypts and decrypts directly, unchanged.
485
588
  const edv = new EdvClientCore({
486
589
  keyAgreementKey: resolved.keyAgreementKey,
487
590
  keyResolver: resolved.keyResolver
@@ -1 +1 @@
1
- {"version":3,"file":"EdvCodec.js","sourceRoot":"","sources":["../../src/edv/EdvCodec.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAYnD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,CAAC,CAAA;YACF,OAAO,IAAI,QAAQ,CAAC;gBAClB,GAAG;gBACH,eAAe,EAAE,QAAQ,CAAC,eAAe;gBACzC,WAAW;gBACX,YAAY;gBACZ,YAAY;aACb,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -26,17 +26,22 @@
26
26
  * server that does not will reject it with 415). Pass `contentType:
27
27
  * JOSE_CONTENT_TYPE` to opt into it where the server supports it.
28
28
  *
29
- * Scope: documents only (`insert` / `update` / `get`). Blinded `find` / `count`
30
- * / `updateIndex` and chunked streams (`storeChunk` / `getChunk`) require
31
- * server-side EDV affordances (blinded `/query`, the `/{id}/chunks/{n}`
32
- * sub-segment) that a plaintext WAS server does not yet provide, so they throw
33
- * here. `insert` uses an atomic `If-None-Match: *` create when the backend
29
+ * Scope: documents (`insert` / `update` / `get`) plus blinded-index content
30
+ * query (`find`, the `blinded-index` profile of the reserved Collection
31
+ * `POST .../query` endpoint -- the server's `blinded-index-query` backend
32
+ * feature). `updateIndex` throws: in this profile the `indexed` array rides
33
+ * inside the stored document envelope, so `update()` IS the re-index
34
+ * operation and no separate index endpoint exists. Chunked streams
35
+ * (`storeChunk` / `getChunk`) still require the server's `chunked-streams`
36
+ * affordance (the reserved `/{id}/chunks/{n}` sub-segment), which neither
37
+ * reference backend provides, so they throw.
38
+ * `insert` uses an atomic `If-None-Match: *` create when the backend
34
39
  * advertises the optional `conditional-writes` feature; otherwise (and for
35
40
  * `update`) writes are advisory -- the EDV `sequence` is not enforced
36
41
  * (last-writer-wins on `update`).
37
42
  */
38
43
  import { Transport } from '@interop/edv-client';
39
- import type { IEncryptedDocument } from '@interop/data-integrity-core';
44
+ import type { IEDVQuery, IEncryptedDocument } from '@interop/data-integrity-core';
40
45
  import type { WasClient } from '../WasClient.js';
41
46
  import { JOSE_CONTENT_TYPE } from './constants.js';
42
47
  export { JOSE_CONTENT_TYPE };
@@ -50,7 +55,7 @@ export declare class WasTransport extends Transport {
50
55
  readonly collectionId: string;
51
56
  readonly contentType: string;
52
57
  private readonly _was;
53
- private _conditionalWritesPromise?;
58
+ private _backendFeaturesPromise?;
54
59
  /**
55
60
  * @param options {object}
56
61
  * @param options.was {WasClient} a WAS client holding the signer
@@ -90,11 +95,37 @@ export declare class WasTransport extends Transport {
90
95
  */
91
96
  private _put;
92
97
  /**
93
- * Whether the collection's backend advertises the `conditional-writes`
94
- * feature. Read once from the "Collection Backend Selected" descriptor and
95
- * memoized for the transport's lifetime; any failure to read the descriptor
96
- * (404, 501 on a server without backend support, network error) resolves
97
- * `false`, so the caller falls back to the advisory path.
98
+ * The feature tokens the collection's backend advertises in its "Collection
99
+ * Backend Selected" descriptor (e.g. `conditional-writes`,
100
+ * `blinded-index-query`). Memoized once it produces a definitive answer: a
101
+ * successful read (including one that lists no features) and a definitive
102
+ * "endpoint absent" (`404` / `405` / `501`) both resolve to a cached feature
103
+ * list, so every affordance gate falls closed against a server that has no
104
+ * backend descriptors.
105
+ *
106
+ * A transient/ambiguous failure (network error, timeout, `401`, `429`, other
107
+ * `5xx`) is NOT cached: the memo is cleared so the next call re-probes, and
108
+ * the error is rethrown so the caller fails loud rather than silently
109
+ * degrading atomicity against a server that may well be capable. (A single
110
+ * transient failure must not poison the transport for its lifetime.)
111
+ *
112
+ * @returns {Promise<string[]>}
113
+ */
114
+ private _backendFeatures;
115
+ /**
116
+ * Reads and parses the backend descriptor once. On a definitive answer
117
+ * (success, or a `404` / `405` / `501` that means the endpoint is legitimately
118
+ * absent) resolves the feature list, which `_backendFeatures` then caches. On
119
+ * a transient failure, clears the memo (so the next call re-probes) and
120
+ * rethrows.
121
+ *
122
+ * @returns {Promise<string[]>}
123
+ */
124
+ private _probeBackendFeatures;
125
+ /**
126
+ * Whether the collection's backend advertises the optional
127
+ * `conditional-writes` feature, so `insert` can use an atomic
128
+ * `If-None-Match: *` create instead of the advisory existence-check path.
98
129
  *
99
130
  * @returns {Promise<boolean>}
100
131
  */
@@ -108,7 +139,9 @@ export declare class WasTransport extends Transport {
108
139
  * `PUT` with `If-None-Match: *`, and the server's 412 maps to
109
140
  * `DuplicateError`. Otherwise it degrades to a bodiless existence check
110
141
  * (`HEAD`) before the `PUT` -- advisory and non-atomic, but no longer
111
- * downloading the whole stored envelope just to discard it.
142
+ * downloading the whole stored envelope just to discard it. In either path a
143
+ * 409 (a `unique: true` blinded attribute already held by another document)
144
+ * likewise maps to `DuplicateError`.
112
145
  *
113
146
  * @param options {object}
114
147
  * @param options.encrypted {IEncryptedDocument} the document to insert
@@ -124,6 +157,14 @@ export declare class WasTransport extends Transport {
124
157
  * here -- without server-side conditional writes, a stale write is not
125
158
  * rejected (last-writer-wins).
126
159
  *
160
+ * Two write-time conflicts are mapped to the names `EdvClientCore` dispatches
161
+ * on. A server enforcing conditional writes rejects a stale/sequence
162
+ * conflict with 412 (precondition-failed), which surfaces as
163
+ * `InvalidStateError` -- the recoverable case, by re-fetching the current
164
+ * document and retrying. A 409 is the EDV unique-attribute collision (a
165
+ * `unique: true` blinded attribute already held by another document), which
166
+ * is NOT recoverable by re-fetch-and-retry; it surfaces as `DuplicateError`.
167
+ *
127
168
  * @param options {object}
128
169
  * @param options.encrypted {IEncryptedDocument} the document to update
129
170
  * @returns {Promise<void>}
@@ -156,14 +197,36 @@ export declare class WasTransport extends Transport {
156
197
  /**
157
198
  * @inheritdoc
158
199
  *
159
- * Blinded-index query is not part of the documents-only EDV-over-WAS profile;
160
- * it needs the server's `/query` affordance.
200
+ * Runs a blinded-index content query: a signed `POST` of
201
+ * `{ profile: 'blinded-index', ...query }` to the Collection's reserved
202
+ * `/query` endpoint. Requires the backend's `blinded-index-query` affordance
203
+ * (throws `NotSupportedError` when it is absent). The server evaluates the
204
+ * blinded `equals` / `has` filters against the `indexed` entries of stored
205
+ * documents (opaque string comparison -- it does no crypto) and returns
206
+ * `{ documents, hasMore, cursor? }` (the encrypted envelopes verbatim, in
207
+ * ascending resource-id order, with `cursor` present iff `hasMore`), or a
208
+ * bare `{ count }` when `query.count` is `true`. The body is returned
209
+ * untouched: `EdvClientCore.find` decrypts `documents` and passes
210
+ * `hasMore` / `cursor` through.
211
+ *
212
+ * @param options {object}
213
+ * @param options.query {IEDVQuery} the blinded query (`index` plus one of
214
+ * `equals` / `has`, and optional `count` / `limit` / `cursor`), as built
215
+ * by `EdvClientCore`'s `IndexHelper.buildQuery`
216
+ * @returns {Promise<object>} the server's response body verbatim
161
217
  */
162
- find(): Promise<never>;
218
+ find({ query }?: {
219
+ query?: IEDVQuery;
220
+ }): Promise<object>;
163
221
  /**
164
222
  * @inheritdoc
165
223
  *
166
- * Index updates need the server's `/{id}/index` affordance.
224
+ * Not supported, deliberately: in the EDV-over-WAS profile, index entries
225
+ * are not a separate server-side resource -- the `indexed` array rides
226
+ * inside the stored document envelope, and every `insert` / `update`
227
+ * already carries it. Re-indexing a document is therefore an ordinary
228
+ * `update()` of the full envelope; there is no `/{id}/index` endpoint to
229
+ * bind this to.
167
230
  */
168
231
  updateIndex(): Promise<never>;
169
232
  /**
@@ -179,8 +242,10 @@ export declare class WasTransport extends Transport {
179
242
  */
180
243
  getChunk(): Promise<never>;
181
244
  /**
182
- * Throws a uniform "not supported in this profile" error for EDV operations
183
- * that depend on server-side affordances absent from a plaintext WAS server.
245
+ * Throws a uniform "not supported in this profile" error for the chunked-
246
+ * stream operations, which depend on a server-side affordance (the reserved
247
+ * `/{id}/chunks/{n}` sub-segment, the `chunked-streams` backend feature)
248
+ * that neither reference backend provides yet.
184
249
  *
185
250
  * @param operation {string}
186
251
  * @returns {never}
@@ -1 +1 @@
1
- {"version":3,"file":"WasTransport.d.ts","sourceRoot":"","sources":["../../src/edv/WasTransport.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,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