@interop/was-client 0.59.1 → 0.61.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 (101) hide show
  1. package/README.md +66 -45
  2. package/dist/Collection.d.ts +140 -96
  3. package/dist/Collection.d.ts.map +1 -1
  4. package/dist/Collection.js +648 -194
  5. package/dist/Collection.js.map +1 -1
  6. package/dist/Resource.d.ts +1 -1
  7. package/dist/Resource.d.ts.map +1 -1
  8. package/dist/Resource.js +0 -3
  9. package/dist/Resource.js.map +1 -1
  10. package/dist/Space.d.ts +17 -16
  11. package/dist/Space.d.ts.map +1 -1
  12. package/dist/Space.js +41 -24
  13. package/dist/Space.js.map +1 -1
  14. package/dist/WasClient.d.ts.map +1 -1
  15. package/dist/WasClient.js +9 -3
  16. package/dist/WasClient.js.map +1 -1
  17. package/dist/codec.d.ts +3 -3
  18. package/dist/edv/EdvCodec.d.ts.map +1 -1
  19. package/dist/edv/EdvCodec.js +22 -46
  20. package/dist/edv/EdvCodec.js.map +1 -1
  21. package/dist/edv/descriptorStore.d.ts +16 -14
  22. package/dist/edv/descriptorStore.d.ts.map +1 -1
  23. package/dist/edv/descriptorStore.js +17 -14
  24. package/dist/edv/descriptorStore.js.map +1 -1
  25. package/dist/edv/didKeyRecipient.d.ts +6 -1
  26. package/dist/edv/didKeyRecipient.d.ts.map +1 -1
  27. package/dist/edv/didKeyRecipient.js +4 -0
  28. package/dist/edv/didKeyRecipient.js.map +1 -1
  29. package/dist/edv/epochKeys.d.ts +43 -3
  30. package/dist/edv/epochKeys.d.ts.map +1 -1
  31. package/dist/edv/epochKeys.js +90 -9
  32. package/dist/edv/epochKeys.js.map +1 -1
  33. package/dist/edv/epochRoster.d.ts +36 -26
  34. package/dist/edv/epochRoster.d.ts.map +1 -1
  35. package/dist/edv/epochRoster.js +61 -10
  36. package/dist/edv/epochRoster.js.map +1 -1
  37. package/dist/edv/hmacKey.d.ts +17 -5
  38. package/dist/edv/hmacKey.d.ts.map +1 -1
  39. package/dist/edv/hmacKey.js +19 -5
  40. package/dist/edv/hmacKey.js.map +1 -1
  41. package/dist/edv/index.d.ts +1 -1
  42. package/dist/edv/index.js +1 -1
  43. package/dist/edv/logGovernedDescriptorStore.d.ts +2 -2
  44. package/dist/edv/logGovernedDescriptorStore.d.ts.map +1 -1
  45. package/dist/edv/logGovernedDescriptorStore.js +10 -9
  46. package/dist/edv/logGovernedDescriptorStore.js.map +1 -1
  47. package/dist/edv/recipients.d.ts +1 -1
  48. package/dist/edv/recipients.d.ts.map +1 -1
  49. package/dist/edv/recipients.js +12 -4
  50. package/dist/edv/recipients.js.map +1 -1
  51. package/dist/edv/refresh.d.ts +6 -1
  52. package/dist/edv/refresh.d.ts.map +1 -1
  53. package/dist/edv/refresh.js +19 -2
  54. package/dist/edv/refresh.js.map +1 -1
  55. package/dist/errors.d.ts +1 -1
  56. package/dist/errors.js +3 -3
  57. package/dist/errors.js.map +1 -1
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/internal/cas.d.ts.map +1 -1
  61. package/dist/internal/cas.js +7 -4
  62. package/dist/internal/cas.js.map +1 -1
  63. package/dist/internal/codec.d.ts +22 -1
  64. package/dist/internal/codec.d.ts.map +1 -1
  65. package/dist/internal/codec.js +117 -46
  66. package/dist/internal/codec.js.map +1 -1
  67. package/dist/internal/content.d.ts.map +1 -1
  68. package/dist/internal/content.js +12 -1
  69. package/dist/internal/content.js.map +1 -1
  70. package/dist/internal/describe.d.ts +98 -24
  71. package/dist/internal/describe.d.ts.map +1 -1
  72. package/dist/internal/describe.js +125 -18
  73. package/dist/internal/describe.js.map +1 -1
  74. package/dist/internal/meta.d.ts +32 -17
  75. package/dist/internal/meta.d.ts.map +1 -1
  76. package/dist/internal/meta.js +64 -35
  77. package/dist/internal/meta.js.map +1 -1
  78. package/dist/internal/paths.d.ts +33 -17
  79. package/dist/internal/paths.d.ts.map +1 -1
  80. package/dist/internal/paths.js +92 -40
  81. package/dist/internal/paths.js.map +1 -1
  82. package/dist/internal/reserved.d.ts +14 -0
  83. package/dist/internal/reserved.d.ts.map +1 -1
  84. package/dist/internal/reserved.js +23 -4
  85. package/dist/internal/reserved.js.map +1 -1
  86. package/dist/internal/write.js +30 -1
  87. package/dist/internal/write.js.map +1 -1
  88. package/dist/paths.d.ts +8 -5
  89. package/dist/paths.d.ts.map +1 -1
  90. package/dist/paths.js +8 -5
  91. package/dist/paths.js.map +1 -1
  92. package/dist/sync/port.d.ts.map +1 -1
  93. package/dist/sync/port.js +14 -1
  94. package/dist/sync/port.js.map +1 -1
  95. package/dist/sync/provisioning.d.ts +7 -7
  96. package/dist/sync/provisioning.d.ts.map +1 -1
  97. package/dist/sync/provisioning.js +27 -15
  98. package/dist/sync/provisioning.js.map +1 -1
  99. package/dist/types.d.ts +16 -9
  100. package/dist/types.d.ts.map +1 -1
  101. package/package.json +2 -2
package/README.md CHANGED
@@ -228,14 +228,14 @@ const space = await was.createSpace({ name: 'Home' }) // POST /spaces/
228
228
  // Lazy handle to an existing space by id -- no I/O until a verb runs.
229
229
  const same = was.space(space.id)
230
230
 
231
- // Read the Space Description (null if missing or not visible to you).
231
+ // Read the Space Metadata object (null if missing or not visible to you).
232
232
  const desc = await space.describe() // { id, type: ['Space'], name, controller } | null
233
233
 
234
- // Upsert: merges the given fields over the current description.
234
+ // Upsert: merges the given fields over the current Metadata object.
235
235
  await space.configure({ name: 'Home (renamed)' })
236
236
 
237
- // Lost-update-safe writes: read the description with its ETag, then write
238
- // it under `ifMatch` (412 `PreconditionFailedError` if it changed), or
237
+ // Lost-update-safe writes: read the Metadata object with its ETag, then
238
+ // write it under `ifMatch` (412 `PreconditionFailedError` if it changed), or
239
239
  // create-if-absent under `ifNoneMatch` (412 if the Space already exists).
240
240
  // Nothing is read or merged on the client, so `controller` is required.
241
241
  const read = await space.describeWithEtag() // { description, etag? } | null
@@ -248,7 +248,7 @@ await was
248
248
  .replaceDescription(
249
249
  { name: 'Fresh', controller: 'did:key:z6Mk...' },
250
250
  { ifNoneMatch: true }
251
- ) // { description, etag? }: a create echoes the description
251
+ ) // { description, etag? }: a create echoes the Metadata object
252
252
 
253
253
  await space.delete() // idempotent
254
254
 
@@ -286,10 +286,10 @@ const collection = await space.createCollection({
286
286
  // Lazy handle to an existing collection by id.
287
287
  const same = space.collection(collection.id)
288
288
 
289
- // Read the Collection Description (null if missing or not visible).
289
+ // Read the Collection Metadata object (null if missing or not visible).
290
290
  const desc = await collection.describe() // { id, type: ['Collection'], name } | null
291
291
 
292
- // Update (upsert; merges over the current description).
292
+ // Update (upsert; merges over the current Metadata object).
293
293
  await collection.configure({ name: 'Credentials' })
294
294
 
295
295
  // List the collections in a space.
@@ -314,17 +314,16 @@ await collection.delete() // deletes the whole collection; idempotent
314
314
  To delete a single resource instead of the whole collection, use
315
315
  `collection.resource(id).delete()`.
316
316
 
317
- The Description's `name` is server-visible plaintext. An encrypted collection
318
- leaves it unpopulated by convention and carries its name and tags on the
319
- [Collection metadata](#collection-metadata) surface instead, where they are
320
- encrypted.
317
+ The Collection Metadata object's top-level `name` is server-visible plaintext.
318
+ An encrypted collection leaves it unpopulated by convention and carries its name
319
+ and tags on the same object's [`custom`](#collection-metadata) member instead,
320
+ where they are encrypted.
321
321
 
322
322
  An application that provisions a collection can record who it was provisioned
323
323
  for, with the optional `generator` (the application's DID) and `generatorOrigin`
324
- (the Web origin that DID was bound to) description fields. Both are accepted at
325
- create time and stay writable afterwards, so an existing collection can be
326
- backfilled; they are controller assertions the server persists but does not
327
- verify.
324
+ (the Web origin that DID was bound to) fields. Both are accepted at create time
325
+ and stay writable afterwards, so an existing collection can be backfilled; they
326
+ are controller assertions the server persists but does not verify.
328
327
 
329
328
  ```ts
330
329
  await space.createCollection({
@@ -544,10 +543,14 @@ collection listings; updating one updates the other.
544
543
 
545
544
  ### Collection metadata
546
545
 
547
- A Collection has the same metadata surface at its own reserved `/meta` path:
548
- server-managed properties (`createdAt` / `updatedAt` / `createdBy`) plus a
549
- user-writable `custom` object (`name` and `tags`). A server without the endpoint
550
- surfaces its 501 as `NotImplementedError`.
546
+ A Collection's configuration (`name`, `backend`, `encryption`, `generator`, read
547
+ by [`describe()`](#collections)) and its annotations live in one object at the
548
+ Collection's reserved `/meta` path: server-managed properties (`createdAt` /
549
+ `updatedAt` / `createdBy`) plus a user-writable `custom` object (`name` and
550
+ `tags`), under one `metaVersion` validator. `meta()` is that same object with
551
+ `custom` decoded through the codec; `describe()` does not resolve the codec at
552
+ all, so on an encrypted collection it reports `custom` as the opaque envelope. A
553
+ server without the endpoint surfaces its 501 as `NotImplementedError`.
551
554
 
552
555
  ```ts
553
556
  const meta = await collection.meta() // CollectionMetadata | null (null on a miss)
@@ -561,19 +564,31 @@ await collection.setTags({ app: 'wallet' }) // keeps existing name
561
564
 
562
565
  // Conditional metadata write, against a `conditional-writes` backend.
563
566
  await collection.setMeta({ custom: { name: 'Vault' } }, { ifMatch: meta?.etag })
564
- // ...or write only if no metadata is set yet:
567
+ // ...or create the Collection only if it does not exist yet:
565
568
  await collection.setMeta({ custom: { name: 'Vault' } }, { ifNoneMatch: true })
566
569
  ```
567
570
 
568
571
  A failed precondition throws `PreconditionFailedError` (412). This `/meta` ETag
569
- (`metaVersion`) is versioned independently of the Collection Description's ETag
570
- and of every Resource's versions: writing one never bumps the other.
572
+ (`metaVersion`) is independent of every Resource's versions, but not of the
573
+ configuration members: one validator covers the whole Collection Metadata
574
+ object, so `configure()` and `setMeta()` advance the same counter.
575
+
576
+ The write is a full replacement of that one object, so an annotation write
577
+ re-sends the configuration members (and any member this client does not model)
578
+ as read, and `configure()` merges over the version it pins to. Two consequences
579
+ worth knowing. `ifNoneMatch: true` is the only annotation write that may create:
580
+ it means "create the Collection only if it does not exist", creates it with no
581
+ configuration, and encodes `custom` with the plaintext codec, since the body it
582
+ sends declares no encryption descriptor (pass a per-handle `encryption` override
583
+ to state one). Every other annotation write requires a readable current object
584
+ and throws `NotFoundError` when there is none -- a masked 404 cannot turn a
585
+ rename into a create.
571
586
 
572
587
  On an encrypted collection `custom` is encrypted into an envelope before it is
573
588
  sent, so `name` / `tags` are never stored as server-visible plaintext, and
574
589
  `meta()` decrypts them back for a keyed reader. This is the encrypted
575
- collection's name/tags surface: by convention the plaintext Description `name`
576
- is left unpopulated there.
590
+ collection's name/tags surface: by convention the plaintext top-level `name` is
591
+ left unpopulated there.
577
592
 
578
593
  #### The governing history log
579
594
 
@@ -594,11 +609,12 @@ await collection.putHistoryLog(log.body + nextLine, { ifMatch: log.etag })
594
609
 
595
610
  From the create on, `describe()` serves `encryption` as the log head's `state`
596
611
  with `history: { method, resource }` stamped on, and a direct `encryption` write
597
- on the Description throws `ConflictError`. The create is refused the same way on
598
- a Collection whose Description already carries a client-written descriptor. A
599
- lost race throws `PreconditionFailedError` (412). These are the raw transport
600
- methods; the `/log` subpath's `resourceLogStore({ collection })` (below) drives
601
- them as the resource-log store port.
612
+ on the Collection Metadata object throws `ConflictError`. The create is refused
613
+ the same way on a Collection whose Metadata object already carries a
614
+ client-written descriptor. A lost race throws `PreconditionFailedError` (412).
615
+ These are the raw transport methods; the `/log` subpath's
616
+ `resourceLogStore({ collection })` (below) drives them as the resource-log store
617
+ port.
602
618
 
603
619
  A reader that holds the descriptor but not the convention follows its `history`
604
620
  pointer through the `/edv` subpath's `logGovernedCollectionDescriptorStore`, the
@@ -759,10 +775,9 @@ stores faithfully). Two things drive it, kept separate:
759
775
 
760
776
  - **Policy** (is this collection encrypted?) is declared on the collection
761
777
  itself: `createCollection({ encryption: { scheme: 'edv' } })` writes a
762
- non-secret `encryption` descriptor to the Collection Description. Any
778
+ non-secret `encryption` descriptor to the Collection Metadata object. Any
763
779
  authorized reader -- including a delegated consumer that did **not** create
764
- the collection -- discovers it by reading the Description, so it knows to
765
- decrypt.
780
+ the collection -- discovers it by reading that object, so it knows to decrypt.
766
781
  - **Keys** come from an `encryption` provider you pass to `WasClient` (built
767
782
  from the opt-in `@interop/was-client/edv` subpath, so plaintext consumers
768
783
  never pull the crypto graph). It is a pure **keystore**: `resolveKeys` returns
@@ -794,21 +809,23 @@ const { id } = await vault.add({ secret: 'hello' }) // encrypted; id is an EDV i
794
809
  const back = await vault.get(id) // { secret: 'hello' } -- decrypted
795
810
 
796
811
  // A consumer that did not create it discovers the descriptor and decrypts with its
797
- // own keys -- no override needed; one cached read of the Description:
812
+ // own keys -- no override needed; one cached read of the Collection Metadata
813
+ // object:
798
814
  const same = was.space(spaceId).collection('vault')
799
815
  await same.get(id) // reads the descriptor, then decrypts
800
816
  ```
801
817
 
802
818
  The switch is the **descriptor**: a handle encrypts a collection when its
803
- Description declares `encryption` (resolution reads the Description once, then
804
- caches -- no round-trip for plaintext-only clients or when an override is set).
805
- Keys are then **required**: if the collection is declared encrypted but your
806
- keystore returns no keys, reads/writes throw `EncryptionError` (fail-closed) --
807
- they never silently fall back to plaintext.
819
+ Collection Metadata object declares `encryption` (resolution reads that object
820
+ once, then caches -- no round-trip for plaintext-only clients or when an
821
+ override is set). Keys are then **required**: if the collection is declared
822
+ encrypted but your keystore returns no keys, reads/writes throw
823
+ `EncryptionError` (fail-closed) instead of silently falling back to plaintext.
808
824
 
809
825
  **Per-handle override (escape hatch).** Pass `encryption` in the handle options
810
- to force the decision and skip the Description read -- `{ scheme: 'edv' }` (keys
811
- from the keystore), `{ scheme: 'edv', keys }` (keys inline), or `'plaintext'`:
826
+ to force the decision and skip the Collection Metadata read --
827
+ `{ scheme: 'edv' }` (keys from the keystore), `{ scheme: 'edv', keys }` (keys
828
+ inline), or `'plaintext'`:
812
829
 
813
830
  ```ts
814
831
  const vault = was.space(spaceId).collection('vault', {
@@ -820,8 +837,12 @@ const vault = was.space(spaceId).collection('vault', {
820
837
  keys-only): re-declare it once with
821
838
  `collection.configure({ encryption: { scheme: 'edv' } })` (the descriptor is
822
839
  set-once: declaring it on a collection that lacks one is allowed, changing or
823
- clearing an existing one is rejected). Until then, a per-handle override reads
824
- it correctly.
840
+ clearing an existing one is rejected). The same write re-seals the stored
841
+ `custom` under the newly declared descriptor, since the server validates the
842
+ envelope against the incoming one; a client that cannot build that codec (no
843
+ keystore, or no keys for the descriptor) sends no `custom` at all rather than
844
+ plaintext beside the descriptor, which loses the stored name and tags. Until the
845
+ collection is re-declared, a per-handle override reads it correctly.
825
846
 
826
847
  Encrypted collections are a **stricter contract**, not a drop-in (documents-only
827
848
  scope for now):
@@ -842,9 +863,9 @@ scope for now):
842
863
  endpoint has its own ETag (`metaVersion`), independent of the content ETag.
843
864
  The same pair at Collection level (`collection.setName()` / `setTags()` /
844
865
  `setMeta()` / `meta()`) is where an encrypted collection carries its own name
845
- and tags, since the Description's plaintext `name` is left unpopulated; the
846
- collection-level envelope binds no resource id, and a resource-bound envelope
847
- served into that slot is refused.
866
+ and tags, since the Collection Metadata object's plaintext `name` is left
867
+ unpopulated; the collection-level envelope binds no resource id, and a
868
+ resource-bound envelope served into that slot is refused.
848
869
  - **Binary.** A `Blob`/`Uint8Array` up to `maxBlobBytes` (512 KiB by default) is
849
870
  encrypted as a single document. A larger one is routed automatically by
850
871
  `add()` to the chunked-stream path: one document plus its chunk resources,
@@ -2,7 +2,7 @@ import type { ClientContext } from './internal/request.js';
2
2
  import type { IndexDeclaration, IndexSchema } from './codec.js';
3
3
  import { Resource } from './Resource.js';
4
4
  import type { ChangeDocument, ChangesCheckpoint, ChangesPage } from '@interop/storage-core';
5
- import type { AddResult, BackendDescriptor, BackendUsage, CollectionDescription, CollectionMetadata, CollectionWritableFields, EncryptionOverride, FindPage, GrantOptions, HandleOptions, IDelegatedZcap, IZcap, Json, ResourceData, LinkSet, PolicyDocument, CollectionResourcesList, ResourceMetadataCustomInput, ResourceSummary } from './types.js';
5
+ import type { AddResult, BackendDescriptor, BackendUsage, CollectionMetadata, CollectionWritableFields, EncryptionOverride, FindPage, GrantOptions, HandleOptions, IDelegatedZcap, IZcap, Json, ResourceData, LinkSet, PolicyDocument, CollectionResourcesList, ResourceMetadataCustomInput, ResourceSummary } from './types.js';
6
6
  export declare class Collection {
7
7
  #private;
8
8
  readonly spaceId: string;
@@ -26,91 +26,121 @@ export declare class Collection {
26
26
  encryption?: EncryptionOverride;
27
27
  });
28
28
  /**
29
- * Reads the Collection Description. Returns `null` if the collection is
30
- * missing or not visible to you (WAS returns 404 for both not-found and
31
- * unauthorized).
29
+ * Reads the Collection Metadata object -- the Collection's configuration
30
+ * (`name`, `backend`, `encryption`, `generator`) beside the server-managed
31
+ * timestamps and the user-writable `custom`, as one object under one
32
+ * validator. Returns `null` if the collection is missing or not visible to
33
+ * you (WAS returns 404 for both not-found and unauthorized).
32
34
  *
33
- * @returns {Promise<CollectionDescription | null>}
35
+ * This read never resolves the codec, so it is the configuration read: on an
36
+ * encrypted Collection the served `custom` is the opaque envelope, exactly as
37
+ * stored. {@link meta} is the same object with `custom` decoded.
38
+ *
39
+ * @returns {Promise<(CollectionMetadata & { etag?: string }) | null>}
34
40
  */
35
- describe(): Promise<CollectionDescription | null>;
41
+ describe(): Promise<(CollectionMetadata & {
42
+ etag?: string;
43
+ }) | null>;
36
44
  /**
37
- * Creates or updates the collection by id (upsert). Merges the given fields
38
- * over the current description.
45
+ * {@link describe}, with the object and its `ETag` in separate members. The
46
+ * `ETag` is the `metaVersion` validator to pass to
47
+ * {@link replaceDescription}'s `ifMatch` for a lost-update-safe
48
+ * (compare-and-swap) write. One validator covers the whole object, so it is
49
+ * also what {@link setMeta} pins against. Returns `null` if the collection is
50
+ * missing or not visible to you (404 conflation caveat); `etag` is absent
51
+ * against a backend that does not version the object.
39
52
  *
40
- * The merge needs a readable current description to be lost-update-safe, and
41
- * `describe()` cannot distinguish "absent" from "unreadable" (WAS masks
42
- * unauthorized reads as 404). When it returns `null` and neither `backend`
43
- * nor `encryption` is supplied, this fails closed rather than sending a PUT
44
- * body that would silently drop an existing collection's `backend` (a
45
- * data-placement change) or trip `encryption-immutable` by clearing its
46
- * descriptor on a replace-semantics server. Pass `force: true` to proceed
47
- * anyway
48
- * -- e.g. when creating a new collection through a handle (or use
49
- * `space.createCollection()`, which does not merge).
53
+ * @returns {Promise<{ description: CollectionMetadata; etag?: string } | null>}
54
+ */
55
+ describeWithEtag(): Promise<{
56
+ description: CollectionMetadata;
57
+ etag?: string;
58
+ } | null>;
59
+ /**
60
+ * Creates or updates the collection by id (upsert). Merges the given
61
+ * configuration members over the current ones; the annotations (`custom` and
62
+ * its `epoch` stamp) are carried forward untouched, unless this write
63
+ * changes the encryption scheme, in which case `custom` is re-sealed under
64
+ * the incoming descriptor (see {@link replaceDescription}).
65
+ *
66
+ * The merge runs against the same read the write is pinned to, and rebases
67
+ * with it: a rival configuration change landing in between is re-read and
68
+ * merged over rather than re-applied stale.
69
+ *
70
+ * The merge needs a readable current object to be lost-update-safe, and the
71
+ * read cannot distinguish "absent" from "unreadable" (WAS masks unauthorized
72
+ * reads as 404). When it finds nothing and either `backend` or `encryption`
73
+ * is left out, this fails closed rather than sending a PUT body that would
74
+ * silently drop an existing collection's `backend` (a data-placement change)
75
+ * or trip `encryption-immutable` by clearing its descriptor. Supplying only
76
+ * one of the two does not cover the other: with nothing readable to merge
77
+ * from, the omitted field is dropped either way. Pass `force: true` to
78
+ * proceed anyway -- e.g. when creating a new collection through a handle (or
79
+ * use `space.createCollection()`, which does not merge).
50
80
  *
51
81
  * @param desc {CollectionWritableFields} the fields to merge; `encryption`
52
82
  * declares the client-side encryption descriptor, which is set-once on the
53
83
  * server (it may be added to a Collection that lacks one, but
54
84
  * changing/clearing an existing descriptor is rejected -- `ConflictError`,
55
85
  * `encryption-immutable`)
56
- * @param [desc.force] {boolean} proceed even when the current description
86
+ * @param [desc.force] {boolean} proceed even when the current object
57
87
  * is unreadable and `backend`/`encryption` are omitted (see above)
58
- * @param [desc.current] {CollectionDescription | null} the current
59
- * description, when the caller has already read it -- the merge and the
60
- * fail-closed check then run against this instead of a second `describe()`
61
- * round trip. `null` means the caller read it and found the collection
62
- * absent or unreadable, which is a supplied answer; omitting the member
63
- * entirely is what asks for the read. Supplying a description this
64
- * handle's own writes have since superseded would merge stale fields
65
- * forward -- dropping a `backend` or tripping `encryption-immutable` --
66
- * so pass only a read the caller itself made and has not written over
67
- * @returns {Promise<CollectionDescription>}
88
+ * @param [desc.current] {CollectionMetadata | null} the current Collection
89
+ * Metadata object, when the caller has already read it -- the merge's first
90
+ * attempt then runs against this instead of a second read. It is used only
91
+ * while it carries the `etag` the write pins against, so a copy another
92
+ * client has since overwritten loses the compare-and-swap and is re-read
93
+ * rather than merged forward. `null` means the caller read it and found
94
+ * the collection absent or unreadable; omitting the member entirely is
95
+ * what asks for the read
96
+ * @returns {Promise<CollectionMetadata>}
68
97
  */
69
98
  configure(desc: CollectionWritableFields & {
70
99
  force?: boolean;
71
- current?: CollectionDescription | null;
72
- }): Promise<CollectionDescription>;
100
+ current?: (CollectionMetadata & {
101
+ etag?: string;
102
+ }) | null;
103
+ }): Promise<CollectionMetadata>;
73
104
  /**
74
- * Reads the Collection Description together with its `ETag` validator (the
75
- * server's `conditional-writes` / description-version support). The `ETag` is
76
- * the opaque validator to pass to {@link replaceDescription}'s `ifMatch` for a
77
- * lost-update-safe (compare-and-swap) description write. Returns `null` if the
78
- * collection is missing or not visible to you (404 conflation caveat); `etag`
79
- * is absent against a server that does not version the description.
80
- *
81
- * @returns {Promise<{ description: CollectionDescription; etag?: string } | null>}
82
- */
83
- describeWithEtag(): Promise<{
84
- description: CollectionDescription;
85
- etag?: string;
86
- } | null>;
87
- /**
88
- * Writes (replaces) the Collection Description, optionally under a
89
- * precondition: `ifMatch` (the `ETag` from {@link describeWithEtag}) makes
105
+ * Writes (replaces) the Collection's configuration members, optionally under
106
+ * a precondition: `ifMatch` (the `ETag` from {@link describeWithEtag}) makes
90
107
  * it a compare-and-swap so a concurrent writer cannot be silently clobbered,
91
108
  * and `ifNoneMatch: true` makes it a guarded create that proceeds only while
92
109
  * no Collection exists under this id. A failed precondition surfaces as
93
- * `PreconditionFailedError` (412). Sends the writable fields as the full
94
- * body; omit a field to drop it (replace semantics), so callers doing CAS
95
- * pass every field forward. Returns the new `ETag` and the fields written.
96
- *
97
- * This is the generic description-CAS primitive the key-epoch recipient
110
+ * `PreconditionFailedError` (412). Sends the writable configuration as the
111
+ * full body; omit a member to drop it (replace semantics), so callers doing
112
+ * CAS pass every member forward. Members this client does not model are
113
+ * carried forward from the stored object rather than cleared.
114
+ *
115
+ * The annotations (`custom` and its `epoch` stamp) are carried forward
116
+ * verbatim -- `custom` exactly as served, so an encrypted Collection's
117
+ * envelope is never re-sealed by an ordinary configuration write. The one
118
+ * exception is a write that changes the encryption scheme: the server
119
+ * validates `custom` against the INCOMING descriptor, so a stored plaintext
120
+ * `custom` cannot travel beside a newly declared `encryption` descriptor.
121
+ * Such a write re-seals `custom` under the incoming descriptor's codec, and
122
+ * drops `custom` (and its stamp) when this client cannot build that codec.
123
+ * A Collection with no stored `custom` sends none, which clears an
124
+ * already-empty value on an encrypted Collection just as on a plaintext one.
125
+ * Returns the new `ETag`, and the object the server answers a create with.
126
+ *
127
+ * This is the generic compare-and-swap primitive the key-epoch recipient
98
128
  * operations build on (add/remove a reader is a CAS of the `encryption`
99
129
  * descriptor); it is not epoch-specific.
100
130
  *
101
131
  * @param description {CollectionWritableFields}
102
132
  * @param options {object}
103
133
  * @param [options.ifMatch] {string} the prior `ETag`; the write applies only
104
- * if the description is unchanged
134
+ * if the object is unchanged
105
135
  * @param [options.ifNoneMatch] {boolean} write only if the Collection does
106
136
  * not exist yet
107
- * @returns {Promise<{ description: CollectionDescription; etag?: string }>}
137
+ * @returns {Promise<{ description: CollectionMetadata; etag?: string }>}
108
138
  */
109
139
  replaceDescription(description: CollectionWritableFields, options?: {
110
140
  ifMatch?: string;
111
141
  ifNoneMatch?: boolean;
112
142
  }): Promise<{
113
- description: CollectionDescription;
143
+ description: CollectionMetadata;
114
144
  etag?: string;
115
145
  }>;
116
146
  /**
@@ -121,23 +151,25 @@ export declare class Collection {
121
151
  */
122
152
  delete(): Promise<void>;
123
153
  /**
124
- * Reads the Collection's metadata object (server-managed timestamps,
125
- * `createdBy` and the encrypted-`custom` key `epoch`, plus the user-writable
126
- * `custom` object). Returns `null` if the collection is missing or not
127
- * visible to you (404 conflation caveat). A server without Collection
128
- * metadata support surfaces its 501 as `NotImplementedError`.
154
+ * Reads the Collection Metadata object with its user-writable `custom`
155
+ * decoded -- {@link describe} plus the codec. Returns `null` if the
156
+ * collection is missing or not visible to you (404 conflation caveat). A
157
+ * server without Collection metadata support surfaces its 501 as
158
+ * `NotImplementedError`.
129
159
  *
130
160
  * On an encrypted collection the stored `custom` is an opaque envelope; this
131
161
  * decodes it (decrypts, via the codec) so a caller always sees plaintext
132
162
  * `{ name, tags }`. A collection with no user metadata reports `custom` as
133
- * `{}`.
163
+ * `{}`. Resolving the codec can fail closed on a collection this client holds
164
+ * no keys for, which is why {@link describe} -- the configuration read -- goes
165
+ * without it.
134
166
  *
135
167
  * Against a backend with the `conditional-writes` feature the result also
136
- * carries the metadata's current `etag` (the `/meta` `metaVersion`
137
- * validator) -- pass it as `setMeta(meta, { ifMatch })` for a
138
- * lost-update-safe metadata update. That validator is independent of the
139
- * Collection Description's ETag ({@link describeWithEtag}) and of every
140
- * Resource's versions: writing one never bumps the other.
168
+ * carries the object's current `etag` (its `metaVersion` validator) -- pass it
169
+ * as `setMeta(meta, { ifMatch })` for a lost-update-safe update. One
170
+ * validator covers the whole object: a configuration write and an annotation
171
+ * write advance the same counter, so a client holds one ETag for the
172
+ * Collection rather than one per surface.
141
173
  *
142
174
  * @returns {Promise<(CollectionMetadata & { etag?: string }) | null>}
143
175
  */
@@ -145,24 +177,33 @@ export declare class Collection {
145
177
  etag?: string;
146
178
  }) | null>;
147
179
  /**
148
- * Replaces the Collection's user-writable metadata (`custom`). This is a full
149
- * replacement: any property omitted from `custom` is cleared, and an omitted
150
- * `custom` clears them all. Does not create the collection -- a `PUT` to the
151
- * metadata of a nonexistent collection throws `NotFoundError`. Servers
152
- * without Collection metadata support surface their 501 as
153
- * `NotImplementedError`.
180
+ * Replaces the Collection's user-writable annotations (`custom`). This is a
181
+ * full replacement of `custom`: any property omitted from it is cleared, and
182
+ * an omitted `custom` clears them all. The Collection's configuration
183
+ * members are carried forward -- the same `PUT` replaces the whole
184
+ * Collection Metadata object, so they are read and re-sent rather than
185
+ * dropped.
154
186
  *
155
187
  * On an encrypted collection `custom` is encrypted into an opaque envelope by
156
188
  * the codec before it is sent, so `name` / `tags` are never stored as
157
189
  * server-visible plaintext -- transparently, the same call works on plaintext
158
- * and encrypted collections alike.
159
- *
160
- * Conditional metadata writes (the backend's `conditional-writes` feature):
161
- * pass `ifMatch` (the `etag` from a prior `meta()`) for an
162
- * update-if-unchanged, or `ifNoneMatch: true` for a
163
- * write-only-if-no-metadata. A failed precondition throws
164
- * `PreconditionFailedError` (412). The `/meta` ETag (`metaVersion`) is
165
- * independent of the Collection Description's ETag. Returns the new `etag`.
190
+ * and encrypted collections alike. The key epoch the codec stamps the
191
+ * envelope with travels as a top-level `epoch` member of the same body.
192
+ *
193
+ * Conditional writes (the backend's `conditional-writes` feature): pass
194
+ * `ifMatch` (the `etag` from a prior {@link meta} or {@link describe}) for an
195
+ * update-if-unchanged, and a failed precondition throws
196
+ * `PreconditionFailedError` (412). Without one the write is pinned to the
197
+ * version it composed the configuration from and rebases on a lost race.
198
+ * `ifNoneMatch: true` is the guarded create: one validator covers the whole
199
+ * object, which exists exactly as long as its Collection does, so it means
200
+ * "create the Collection only if it does not exist" -- and creates it with no
201
+ * configuration, the plaintext codec encoding its `custom` (nothing is
202
+ * stored yet to declare encryption, and a per-handle override is the only
203
+ * way to state it). Every other annotation write requires the Collection to
204
+ * be there: one that cannot read the current object throws `NotFoundError`
205
+ * rather than upserting a configuration-less Collection over one this
206
+ * capability cannot see. Returns the new `etag`.
166
207
  *
167
208
  * @param meta {object}
168
209
  * @param [meta.custom] {ResourceMetadataCustomInput} the user-writable
@@ -170,9 +211,10 @@ export declare class Collection {
170
211
  * Collection-level `custom` also carries the persisted `indexSchema`)
171
212
  * while `name` / `tags` themselves stay checked at their stored types
172
213
  * @param options {object}
173
- * @param [options.ifMatch] {string} update only if the `/meta` ETag matches
174
- * @param [options.ifNoneMatch] {boolean} write only if no metadata is set
175
- * @returns {Promise<{ etag?: string }>} the metadata's new ETag
214
+ * @param [options.ifMatch] {string} update only if the `ETag` matches
215
+ * @param [options.ifNoneMatch] {boolean} create only if the Collection does
216
+ * not exist
217
+ * @returns {Promise<{ etag?: string }>} the object's new ETag
176
218
  */
177
219
  setMeta(meta?: {
178
220
  custom?: ResourceMetadataCustomInput;
@@ -183,19 +225,20 @@ export declare class Collection {
183
225
  etag?: string;
184
226
  }>;
185
227
  /**
186
- * Sets the Collection's metadata-level human-readable `name`, preserving any
187
- * existing `tags`. Convenience over `setMeta()`. The write is pinned to the
188
- * `etag` the `meta()` read returned (when the backend supports
189
- * `conditional-writes`), so a concurrent metadata write surfaces as
190
- * `PreconditionFailedError` instead of being silently erased by this
228
+ * Sets the Collection's annotation-level human-readable `name`, preserving
229
+ * any existing `tags`. Convenience over `setMeta()`. The write is pinned to
230
+ * the `etag` the `meta()` read returned (when the backend supports
231
+ * `conditional-writes`) and rebases on a lost race, so a concurrent write --
232
+ * an annotation write or a configuration change, which share the one
233
+ * validator -- is re-read and re-applied rather than silently erased by this
191
234
  * full-replacement write.
192
235
  *
193
236
  * On an encrypted collection this is the collection's client-encrypted name
194
237
  * surface: the codec seals it into the `custom` envelope, and by convention
195
- * the plaintext Description `name` is left unpopulated. On a plaintext
238
+ * the plaintext top-level `name` is left unpopulated. On a plaintext
196
239
  * collection the two are separate labels -- space-level listings surface the
197
- * Description's `name` (set via `configure({ name })`), while this one is
198
- * metadata-level.
240
+ * top-level `name` (set via `configure({ name })`), while this one is inside
241
+ * `custom`.
199
242
  *
200
243
  * @param name {string}
201
244
  * @returns {Promise<void>}
@@ -211,7 +254,7 @@ export declare class Collection {
211
254
  */
212
255
  setTags(tags: Record<string, string>): Promise<void>;
213
256
  /**
214
- * The absolute URL of the Collection's governing history log, the `/meta/log`
257
+ * The absolute URL of the Collection's governing history log, the `meta/log`
215
258
  * sub-resource {@link getHistoryLog} reads. A log-governed descriptor's
216
259
  * `history.resource` names this URL; a verifying reader compares the two
217
260
  * before opening the log.
@@ -470,10 +513,11 @@ export declare class Collection {
470
513
  * envelopes (an EDV encrypted document under the v1 `edv` scheme) -- this
471
514
  * method does not decrypt them, unlike `get()`.
472
515
  *
473
- * Two server faults fail the call with a `WasServerError` instead of passing
474
- * through as a page: a 2xx response with no JSON body (indistinguishable
475
- * from an end-of-feed page otherwise), and a live entry with no `data` (the
476
- * server could not read or parse that resource's body).
516
+ * Malformed responses fail the call with a `WasServerError` instead of
517
+ * passing through as a page: a 2xx response with no JSON body
518
+ * (indistinguishable from an end-of-feed page otherwise), a body with no
519
+ * `documents` array or with a non-object entry in it, and a live entry with
520
+ * no `data` (the server could not read or parse that resource's body).
477
521
  *
478
522
  * @param [options] {object}
479
523
  * @param [options.checkpoint] {ChangesCheckpoint} resume strictly after this
@@ -1 +1 @@
1
- {"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../src/Collection.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AA2C1D,OAAO,KAAK,EAGV,gBAAgB,EAChB,WAAW,EAEZ,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,cAAc,EACd,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,cAAc,EACd,uBAAuB,EACvB,2BAA2B,EAC3B,eAAe,EAChB,MAAM,YAAY,CAA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