@interop/was-client 0.50.0 → 0.52.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.
- package/README.md +59 -7
- package/dist/Collection.d.ts +66 -0
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +161 -53
- package/dist/Collection.js.map +1 -1
- package/dist/Resource.js +2 -2
- package/dist/Resource.js.map +1 -1
- package/dist/Space.d.ts.map +1 -1
- package/dist/Space.js +15 -11
- package/dist/Space.js.map +1 -1
- package/dist/codec.d.ts +54 -12
- package/dist/codec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.d.ts +9 -8
- package/dist/edv/EdvCodec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.js +65 -33
- package/dist/edv/EdvCodec.js.map +1 -1
- package/dist/edv/descriptorStore.d.ts.map +1 -1
- package/dist/edv/descriptorStore.js +2 -0
- package/dist/edv/descriptorStore.js.map +1 -1
- package/dist/edv/docCipher.d.ts.map +1 -1
- package/dist/edv/docCipher.js +1 -1
- package/dist/edv/docCipher.js.map +1 -1
- package/dist/edv/index.d.ts +2 -0
- package/dist/edv/index.d.ts.map +1 -1
- package/dist/edv/index.js +1 -0
- package/dist/edv/index.js.map +1 -1
- package/dist/edv/logGovernedDescriptorStore.d.ts +164 -0
- package/dist/edv/logGovernedDescriptorStore.d.ts.map +1 -0
- package/dist/edv/logGovernedDescriptorStore.js +476 -0
- package/dist/edv/logGovernedDescriptorStore.js.map +1 -0
- package/dist/edv/recipients.d.ts.map +1 -1
- package/dist/edv/recipients.js +25 -82
- package/dist/edv/recipients.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/cas.d.ts +95 -0
- package/dist/internal/cas.d.ts.map +1 -0
- package/dist/internal/cas.js +116 -0
- package/dist/internal/cas.js.map +1 -0
- package/dist/internal/codec.d.ts.map +1 -1
- package/dist/internal/codec.js +6 -6
- package/dist/internal/codec.js.map +1 -1
- package/dist/internal/conditional.d.ts +12 -0
- package/dist/internal/conditional.d.ts.map +1 -1
- package/dist/internal/conditional.js +17 -0
- package/dist/internal/conditional.js.map +1 -1
- package/dist/internal/content.d.ts +8 -0
- package/dist/internal/content.d.ts.map +1 -1
- package/dist/internal/content.js +8 -0
- package/dist/internal/content.js.map +1 -1
- package/dist/internal/meta.d.ts +9 -9
- package/dist/internal/meta.d.ts.map +1 -1
- package/dist/internal/meta.js +13 -14
- package/dist/internal/meta.js.map +1 -1
- package/dist/internal/paths.d.ts +6 -0
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +8 -0
- package/dist/internal/paths.js.map +1 -1
- package/dist/internal/write.d.ts +1 -1
- package/dist/internal/write.d.ts.map +1 -1
- package/dist/internal/write.js +4 -2
- package/dist/internal/write.js.map +1 -1
- package/dist/log/index.d.ts +2 -1
- package/dist/log/index.d.ts.map +1 -1
- package/dist/log/index.js +2 -1
- package/dist/log/index.js.map +1 -1
- package/dist/log/logStore.d.ts +38 -25
- package/dist/log/logStore.d.ts.map +1 -1
- package/dist/log/logStore.js +99 -42
- package/dist/log/logStore.js.map +1 -1
- package/dist/paths.d.ts +1 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +1 -1
- package/dist/paths.js.map +1 -1
- package/dist/sync/provisioning.d.ts.map +1 -1
- package/dist/sync/provisioning.js +49 -14
- package/dist/sync/provisioning.js.map +1 -1
- package/dist/types.d.ts +11 -12
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/internal/meta.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResourceCodec } from '../codec.js';
|
|
1
|
+
import type { MetaReadSlot, MetaWriteSlot, ResourceCodec } from '../codec.js';
|
|
2
2
|
import type { ClientContext } from './request.js';
|
|
3
3
|
import type { IZcap, ResourceMetadataCustom, ResourceMetadataCustomInput } from '../types.js';
|
|
4
4
|
/**
|
|
@@ -13,18 +13,18 @@ import type { IZcap, ResourceMetadataCustom, ResourceMetadataCustomInput } from
|
|
|
13
13
|
* concurrently with the read
|
|
14
14
|
* @param options.subject {string} the metadata's owner as it reads in the
|
|
15
15
|
* malformed-response error message
|
|
16
|
-
* @param
|
|
17
|
-
*
|
|
16
|
+
* @param options.slot {MetaReadSlot} the `/meta` slot being read, for an
|
|
17
|
+
* encrypting codec's envelope-binding check
|
|
18
18
|
* @param [options.capability] {IZcap}
|
|
19
19
|
* @returns {Promise<(Metadata & { etag?: string }) | null>}
|
|
20
20
|
*/
|
|
21
21
|
export declare function readMeta<Metadata extends {
|
|
22
22
|
custom?: ResourceMetadataCustom;
|
|
23
|
-
}>(context: ClientContext, { metaPath, codec: codecPromise, subject,
|
|
23
|
+
}>(context: ClientContext, { metaPath, codec: codecPromise, subject, slot, capability }: {
|
|
24
24
|
metaPath: string;
|
|
25
25
|
codec: Promise<ResourceCodec>;
|
|
26
26
|
subject: string;
|
|
27
|
-
|
|
27
|
+
slot: MetaReadSlot;
|
|
28
28
|
capability?: IZcap;
|
|
29
29
|
}): Promise<(Metadata & {
|
|
30
30
|
etag?: string;
|
|
@@ -45,19 +45,19 @@ export declare function readMeta<Metadata extends {
|
|
|
45
45
|
* stamp describes the `custom` envelope itself; false at Resource level,
|
|
46
46
|
* where a Resource's epoch instead stamps its content write via the
|
|
47
47
|
* `Key-Epoch` header, so an epoch surfaced here is deliberately dropped.
|
|
48
|
-
* @param
|
|
49
|
-
*
|
|
48
|
+
* @param options.slot {MetaWriteSlot} the `/meta` slot being written, which
|
|
49
|
+
* an encrypting codec binds into the envelope
|
|
50
50
|
* @param [options.ifMatch] {string} update only if the `/meta` ETag matches
|
|
51
51
|
* @param [options.ifNoneMatch] {boolean} write only if no metadata is set
|
|
52
52
|
* @param [options.capability] {IZcap}
|
|
53
53
|
* @returns {Promise<{ etag?: string }>} the metadata's new ETag
|
|
54
54
|
*/
|
|
55
|
-
export declare function writeMeta(context: ClientContext, { metaPath, codec: codecPromise, custom, sendEpoch,
|
|
55
|
+
export declare function writeMeta(context: ClientContext, { metaPath, codec: codecPromise, custom, sendEpoch, slot, ifMatch, ifNoneMatch, capability }: {
|
|
56
56
|
metaPath: string;
|
|
57
57
|
codec: Promise<ResourceCodec>;
|
|
58
58
|
custom: ResourceMetadataCustomInput;
|
|
59
59
|
sendEpoch: boolean;
|
|
60
|
-
|
|
60
|
+
slot: MetaWriteSlot;
|
|
61
61
|
ifMatch?: string;
|
|
62
62
|
ifNoneMatch?: boolean;
|
|
63
63
|
capability?: IZcap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,OAAO,KAAK,EACV,KAAK,EACL,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,aAAa,CAAA;AAEpB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,QAAQ,CAC5B,QAAQ,SAAS;IAAE,MAAM,CAAC,EAAE,sBAAsB,CAAA;CAAE,EAEpD,OAAO,EAAE,aAAa,EACtB,EACE,QAAQ,EACR,KAAK,EAAE,YAAY,EACnB,OAAO,EACP,IAAI,EACJ,UAAU,EACX,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,YAAY,CAAA;IAClB,UAAU,CAAC,EAAE,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
5
5
|
* Shared `/meta` I/O for the Collection and Resource handles. The two read and
|
|
6
6
|
* write the same metadata document shape and differ only in the metadata type,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* the `/meta` slot the `custom` envelope is bound to, and whether the codec's
|
|
8
|
+
* key epoch travels in the PUT body. Each handle wraps these with its
|
|
9
9
|
* own JSDoc.
|
|
10
10
|
*/
|
|
11
11
|
import { WasServerError } from '../errors.js';
|
|
@@ -24,12 +24,12 @@ import { withCodec } from './withCodec.js';
|
|
|
24
24
|
* concurrently with the read
|
|
25
25
|
* @param options.subject {string} the metadata's owner as it reads in the
|
|
26
26
|
* malformed-response error message
|
|
27
|
-
* @param
|
|
28
|
-
*
|
|
27
|
+
* @param options.slot {MetaReadSlot} the `/meta` slot being read, for an
|
|
28
|
+
* encrypting codec's envelope-binding check
|
|
29
29
|
* @param [options.capability] {IZcap}
|
|
30
30
|
* @returns {Promise<(Metadata & { etag?: string }) | null>}
|
|
31
31
|
*/
|
|
32
|
-
export async function readMeta(context, { metaPath, codec: codecPromise, subject,
|
|
32
|
+
export async function readMeta(context, { metaPath, codec: codecPromise, subject, slot, capability }) {
|
|
33
33
|
// The metadata GET does not depend on the codec (only its `custom` decode
|
|
34
34
|
// below does), so the two overlap.
|
|
35
35
|
const [codec, response] = await withCodec(codecPromise, send(context, {
|
|
@@ -55,11 +55,10 @@ export async function readMeta(context, { metaPath, codec: codecPromise, subject
|
|
|
55
55
|
}
|
|
56
56
|
const metadata = response.data;
|
|
57
57
|
// Decode the user-writable `custom` (decrypting it on an encrypted
|
|
58
|
-
// collection) so callers uniformly see plaintext `{ name, tags }`.
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
const custom = await codec.decodeMeta({ custom: metadata.custom }, id);
|
|
58
|
+
// collection) so callers uniformly see plaintext `{ name, tags }`. The
|
|
59
|
+
// stated slot drives the encrypting codec's binding check: in the
|
|
60
|
+
// Collection slot it refuses a resource-bound envelope served there.
|
|
61
|
+
const custom = await codec.decodeMeta({ custom: metadata.custom }, slot);
|
|
63
62
|
const decoded = { ...metadata, custom };
|
|
64
63
|
const etag = readEtag(response);
|
|
65
64
|
return etag !== undefined ? { ...decoded, etag } : decoded;
|
|
@@ -80,16 +79,16 @@ export async function readMeta(context, { metaPath, codec: codecPromise, subject
|
|
|
80
79
|
* stamp describes the `custom` envelope itself; false at Resource level,
|
|
81
80
|
* where a Resource's epoch instead stamps its content write via the
|
|
82
81
|
* `Key-Epoch` header, so an epoch surfaced here is deliberately dropped.
|
|
83
|
-
* @param
|
|
84
|
-
*
|
|
82
|
+
* @param options.slot {MetaWriteSlot} the `/meta` slot being written, which
|
|
83
|
+
* an encrypting codec binds into the envelope
|
|
85
84
|
* @param [options.ifMatch] {string} update only if the `/meta` ETag matches
|
|
86
85
|
* @param [options.ifNoneMatch] {boolean} write only if no metadata is set
|
|
87
86
|
* @param [options.capability] {IZcap}
|
|
88
87
|
* @returns {Promise<{ etag?: string }>} the metadata's new ETag
|
|
89
88
|
*/
|
|
90
|
-
export async function writeMeta(context, { metaPath, codec: codecPromise, custom, sendEpoch,
|
|
89
|
+
export async function writeMeta(context, { metaPath, codec: codecPromise, custom, sendEpoch, slot, ifMatch, ifNoneMatch, capability }) {
|
|
91
90
|
const codec = await codecPromise;
|
|
92
|
-
const { custom: encoded, epoch } = await codec.encodeMeta(
|
|
91
|
+
const { custom: encoded, epoch } = await codec.encodeMeta({ custom, slot });
|
|
93
92
|
const response = await send(context, {
|
|
94
93
|
path: metaPath,
|
|
95
94
|
method: 'PUT',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAG7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE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C,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE;YAC5B,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE;QACzB,OAAO,EAAE,YAAY,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,CAAC;KAClE,CAAC,CAAA;IACF,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;AACrC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAMC,EACD,KAA6B;IAE7B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;IACnC,MAAM,MAAM,CAAC,OAAO,CAClB,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAC5C,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAC3B,CAAA;AACH,CAAC"}
|
package/dist/internal/paths.d.ts
CHANGED
|
@@ -89,6 +89,12 @@ export declare function collectionQuota(spaceId: string, collectionId: string):
|
|
|
89
89
|
* `custom` object). Versioned independently of the Collection Description.
|
|
90
90
|
*/
|
|
91
91
|
export declare function collectionMeta(spaceId: string, collectionId: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* `/space/:spaceId/:collectionId/meta/log` -- the Collection's governing
|
|
94
|
+
* history log sub-resource (JSON Lines). Not a Resource of the Collection:
|
|
95
|
+
* absent from listings and the `changes` feed, and versioned by its own ETag.
|
|
96
|
+
*/
|
|
97
|
+
export declare function collectionLog(spaceId: string, collectionId: string): string;
|
|
92
98
|
/**
|
|
93
99
|
* `/space/:spaceId/:collectionId/query` -- the collection-level query endpoint,
|
|
94
100
|
* whose body's `profile` selects the query (e.g. `changes`, `blinded-index`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/internal/paths.ts"],"names":[],"m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D;IACE,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB,GACD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAEjE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,MAAM,EACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,eAAe,GAAG,IAAI,CAazB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CA0CvE"}
|
package/dist/internal/paths.js
CHANGED
|
@@ -196,6 +196,14 @@ export function collectionQuota(spaceId, collectionId) {
|
|
|
196
196
|
export function collectionMeta(spaceId, collectionId) {
|
|
197
197
|
return `${collectionPath(spaceId, collectionId)}/meta`;
|
|
198
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* `/space/:spaceId/:collectionId/meta/log` -- the Collection's governing
|
|
201
|
+
* history log sub-resource (JSON Lines). Not a Resource of the Collection:
|
|
202
|
+
* absent from listings and the `changes` feed, and versioned by its own ETag.
|
|
203
|
+
*/
|
|
204
|
+
export function collectionLog(spaceId, collectionId) {
|
|
205
|
+
return `${collectionMeta(spaceId, collectionId)}/log`;
|
|
206
|
+
}
|
|
199
207
|
/**
|
|
200
208
|
* `/space/:spaceId/:collectionId/query` -- the collection-level query endpoint,
|
|
201
209
|
* whose body's `profile` selects the query (e.g. `changes`, `blinded-index`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/internal/paths.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AACH,OAAO,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ext, { itemsPath, path
|
|
|
170
170
|
* precondition (used only for a non-conditional codec)
|
|
171
171
|
* @returns {Promise<HttpResponse>}
|
|
172
172
|
*/
|
|
173
|
-
export declare function upsertResource(context: ClientContext, { path, codec, id, data, features, contentType, capability, precondition }: {
|
|
173
|
+
export declare function upsertResource(context: ClientContext, { path, codec, id, data, features, contentType, capability, precondition: callerPrecondition }: {
|
|
174
174
|
path: string;
|
|
175
175
|
codec: ResourceCodec;
|
|
176
176
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/internal/write.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACd,MAAM,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/internal/write.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACd,MAAM,aAAa,CAAA;AAGpB,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAOjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,k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aAAa,CAAA;IACpB,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,YAAY,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB,GACA,OAAO,CAAC,aAAa,CAAC,CA2BxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,aAAa,EACtB,EACE,IAAI,EACJ,KAAK,EACL,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,UAAU,EACV,YAAY,EAAE,kBAAkB,EACjC,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,aAAa,CAAA;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,YAAY,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,YAAY,CAAC,EAAE,iBAAiB,CAAA;CACjC,GACA,OAAO,CAAC,YAAY,CAAC,CA6FvB"}
|
package/dist/internal/write.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isChunkedWrite } from '../codec.js';
|
|
2
2
|
import { PreconditionFailedError, ValidationError } from '../errors.js';
|
|
3
3
|
import { send } from './request.js';
|
|
4
|
-
import { assertPreconditionAgainstPreRead, encodedPrecondition, writeHeaders } from './conditional.js';
|
|
4
|
+
import { assertPreconditionAgainstPreRead, encodedPrecondition, writeHeaders, namedPrecondition } from './conditional.js';
|
|
5
5
|
/**
|
|
6
6
|
* Sends an encoded write (`PUT`/`POST`) to a resource path, applying the
|
|
7
7
|
* encoded body (`json` or `body`), its content-type, and the conditional-write
|
|
@@ -162,7 +162,9 @@ export async function insertResource(context, { itemsPath, pathForId, codec, dat
|
|
|
162
162
|
* precondition (used only for a non-conditional codec)
|
|
163
163
|
* @returns {Promise<HttpResponse>}
|
|
164
164
|
*/
|
|
165
|
-
export async function upsertResource(context, { path, codec, id, data, features, contentType, capability, precondition }) {
|
|
165
|
+
export async function upsertResource(context, { path, codec, id, data, features, contentType, capability, precondition: callerPrecondition }) {
|
|
166
|
+
// An empty precondition object (the handle's default) names no baseline.
|
|
167
|
+
const precondition = namedPrecondition(callerPrecondition);
|
|
166
168
|
let current;
|
|
167
169
|
if (codec.conditionalWrites) {
|
|
168
170
|
current = await send(context, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/internal/write.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EACL,gCAAgC,EAChC,mBAAmB,EACnB,YAAY,
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/internal/write.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EACL,gCAAgC,EAChC,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EAClB,MAAM,kBAAkB,CAAA;AAGzB;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAsB,EACtB,EACE,IAAI,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,YAAY,EAOb;IAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE;QACnC,IAAI;QACJ,MAAM;QACN,UAAU;QACV,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,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gBAAgB,CAAC,OAAO,EAAE;YACrC,IAAI;YACJ,MAAM,EAAE,KAAK;YACb,UAAU;YACV,OAAO;YACP,YAAY,EAAE,MAAM;SACrB,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IACE,GAAG,YAAY,uBAAuB;YACtC,KAAK,CAAC,iBAAiB;YACvB,OAAO,KAAK,IAAI,EAChB,CAAC;YACD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,GAAG,CAAA;YACxD,MAAM,IAAI,uBAAuB,CAC/B,kCAAkC,IAAI,gCAAgC;gBACpE,0DAA0D;gBAC1D,kEAAkE;gBAClE,gEAAgE;gBAChE,+DAA+D;gBAC/D,WAAW,EACb,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,CACzD,CAAA;QACH,CAAC;QACD,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC"}
|
package/dist/log/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* The `@interop/was-client/log` subpath entry: the WAS binding of
|
|
6
6
|
* `@interop/vh-resource-log`'s store port -- `resourceLogStore` maps the
|
|
7
7
|
* port's read-with-etag, compare-and-swap append, and guarded genesis create
|
|
8
|
-
* onto one WAS Resource
|
|
8
|
+
* onto the conditional writes of one WAS Resource, or of a Collection's
|
|
9
|
+
* governing history log at `/meta/log`, rethrowing a lost race as the
|
|
9
10
|
* library's `ResourceLogConflictError`. Everything else about resource logs
|
|
10
11
|
* (the Resource Log Profile, encrypted-collections-spec
|
|
11
12
|
* `#resource-log-profile`) lives in that library: the JSON Lines codec, the
|
package/dist/log/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/log/index.js
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* The `@interop/was-client/log` subpath entry: the WAS binding of
|
|
6
6
|
* `@interop/vh-resource-log`'s store port -- `resourceLogStore` maps the
|
|
7
7
|
* port's read-with-etag, compare-and-swap append, and guarded genesis create
|
|
8
|
-
* onto one WAS Resource
|
|
8
|
+
* onto the conditional writes of one WAS Resource, or of a Collection's
|
|
9
|
+
* governing history log at `/meta/log`, rethrowing a lost race as the
|
|
9
10
|
* library's `ResourceLogConflictError`. Everything else about resource logs
|
|
10
11
|
* (the Resource Log Profile, encrypted-collections-spec
|
|
11
12
|
* `#resource-log-profile`) lives in that library: the JSON Lines codec, the
|
package/dist/log/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/log/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/log/logStore.d.ts
CHANGED
|
@@ -2,15 +2,22 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The WAS binding of `@interop/vh-resource-log`'s store port
|
|
6
|
-
* WAS
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
5
|
+
* The WAS binding of `@interop/vh-resource-log`'s store port, over either of
|
|
6
|
+
* the two places a WAS server keeps a resource log. A log may be a WAS
|
|
7
|
+
* Resource's entire body (the user key roster's `key-map/user-key.jsonl`), or
|
|
8
|
+
* a Collection's governing history log at the `/meta/log` sub-resource (the
|
|
9
|
+
* backend's `governed-history-logs` feature, from which the server derives
|
|
10
|
+
* the Collection's served `encryption` member). Either way the log is stored
|
|
11
|
+
* as `text/jsonl`, with the port's read-with-etag, compare-and-swap append,
|
|
12
|
+
* and guarded genesis create mapped onto the target's conditional writes.
|
|
13
|
+
*
|
|
14
|
+
* A Resource-hosted log's collection may be plaintext or encrypted: a
|
|
15
|
+
* conditional codec pins the write to the `ifMatch` this store passes rather
|
|
16
|
+
* than to the ETag its own pre-read observed, so the append profile's
|
|
17
|
+
* compare-and-swap holds either way. On an encrypted host the resource id
|
|
18
|
+
* must be one the codec mints, since the EDV codec refuses to create a
|
|
19
|
+
* document under a human-readable id. A Collection's history log is never
|
|
20
|
+
* encrypted and runs no codec: the server reads its head itself.
|
|
14
21
|
*
|
|
15
22
|
* Both the append and the create ride the backend's `conditional-writes`
|
|
16
23
|
* feature -- the profile requires it (without the precondition, concurrent
|
|
@@ -19,30 +26,36 @@
|
|
|
19
26
|
* create against a log that already exists -- is rethrown as the library's
|
|
20
27
|
* `ResourceLogConflictError` with the transport's `PreconditionFailedError`
|
|
21
28
|
* as `cause`, which is the port's one conflict signal and what the library's
|
|
22
|
-
* rebase loop catches (by `name
|
|
23
|
-
* adapter-to-library package boundary).
|
|
29
|
+
* rebase loop catches (by `name` rather than `instanceof`, since the error
|
|
30
|
+
* crosses the adapter-to-library package boundary).
|
|
24
31
|
*/
|
|
25
32
|
import { type ResourceLogStore } from '@interop/vh-resource-log';
|
|
33
|
+
import type { Collection } from '../Collection.js';
|
|
26
34
|
import type { Resource } from '../Resource.js';
|
|
35
|
+
import { LOG_CONTENT_TYPE } from '../internal/content.js';
|
|
36
|
+
export { LOG_CONTENT_TYPE };
|
|
27
37
|
/**
|
|
28
|
-
* The
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* prior entries' bytes forward verbatim from the most recent read (an append
|
|
38
|
-
* never re-serializes history), and both `append` and `create` translate the
|
|
39
|
-
* transport's 412 into the library's conflict error.
|
|
38
|
+
* The WAS adapter implementing the library's `ResourceLogStore` port, over
|
|
39
|
+
* one of two hosts: `resource`, a WAS Resource whose whole body is the log,
|
|
40
|
+
* or `collection`, whose governing history log at `/meta/log` is the log.
|
|
41
|
+
* `append` carries the prior entries' bytes forward verbatim from the most
|
|
42
|
+
* recent read (an append does not re-serialize history), and both `append`
|
|
43
|
+
* and `create` translate the transport's 412 into the library's conflict
|
|
44
|
+
* error. A served log with an empty body reads as absent (the pre-genesis
|
|
45
|
+
* `null`), the state a host that has no log for the slot should report as
|
|
46
|
+
* 404; under a held pin the library still refuses it as a rollback.
|
|
40
47
|
*
|
|
41
48
|
* @param options {object}
|
|
42
|
-
* @param options.resource {Resource}
|
|
49
|
+
* @param [options.resource] {Resource} the Resource holding the log
|
|
50
|
+
* @param [options.collection] {Collection} the Collection whose history log
|
|
51
|
+
* is the log; exactly one of the two is given, or `ValidationError`
|
|
43
52
|
* @returns {ResourceLogStore}
|
|
44
53
|
*/
|
|
45
|
-
export declare function resourceLogStore(
|
|
54
|
+
export declare function resourceLogStore(options: {
|
|
46
55
|
resource: Resource;
|
|
56
|
+
collection?: undefined;
|
|
57
|
+
} | {
|
|
58
|
+
collection: Collection;
|
|
59
|
+
resource?: undefined;
|
|
47
60
|
}): ResourceLogStore;
|
|
48
61
|
//# sourceMappingURL=logStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logStore.d.ts","sourceRoot":"","sources":["../../src/log/logStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"logStore.d.ts","sourceRoot":"","sources":["../../src/log/logStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAG9C,OAAO,EAAW,gBAAgB,EAAU,MAAM,wBAAwB,CAAA;AAE1E,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAqE3B;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EACH;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,UAAU,CAAC,EAAE,SAAS,CAAA;CAAE,GAC9C;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GACnD,gBAAgB,CA0FlB"}
|
package/dist/log/logStore.js
CHANGED
|
@@ -2,15 +2,22 @@
|
|
|
2
2
|
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The WAS binding of `@interop/vh-resource-log`'s store port
|
|
6
|
-
* WAS
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
5
|
+
* The WAS binding of `@interop/vh-resource-log`'s store port, over either of
|
|
6
|
+
* the two places a WAS server keeps a resource log. A log may be a WAS
|
|
7
|
+
* Resource's entire body (the user key roster's `key-map/user-key.jsonl`), or
|
|
8
|
+
* a Collection's governing history log at the `/meta/log` sub-resource (the
|
|
9
|
+
* backend's `governed-history-logs` feature, from which the server derives
|
|
10
|
+
* the Collection's served `encryption` member). Either way the log is stored
|
|
11
|
+
* as `text/jsonl`, with the port's read-with-etag, compare-and-swap append,
|
|
12
|
+
* and guarded genesis create mapped onto the target's conditional writes.
|
|
13
|
+
*
|
|
14
|
+
* A Resource-hosted log's collection may be plaintext or encrypted: a
|
|
15
|
+
* conditional codec pins the write to the `ifMatch` this store passes rather
|
|
16
|
+
* than to the ETag its own pre-read observed, so the append profile's
|
|
17
|
+
* compare-and-swap holds either way. On an encrypted host the resource id
|
|
18
|
+
* must be one the codec mints, since the EDV codec refuses to create a
|
|
19
|
+
* document under a human-readable id. A Collection's history log is never
|
|
20
|
+
* encrypted and runs no codec: the server reads its head itself.
|
|
14
21
|
*
|
|
15
22
|
* Both the append and the create ride the backend's `conditional-writes`
|
|
16
23
|
* feature -- the profile requires it (without the precondition, concurrent
|
|
@@ -19,37 +26,24 @@
|
|
|
19
26
|
* create against a log that already exists -- is rethrown as the library's
|
|
20
27
|
* `ResourceLogConflictError` with the transport's `PreconditionFailedError`
|
|
21
28
|
* as `cause`, which is the port's one conflict signal and what the library's
|
|
22
|
-
* rebase loop catches (by `name
|
|
23
|
-
* adapter-to-library package boundary).
|
|
29
|
+
* rebase loop catches (by `name` rather than `instanceof`, since the error
|
|
30
|
+
* crosses the adapter-to-library package boundary).
|
|
24
31
|
*/
|
|
25
32
|
import { ResourceLogConflictError, parseResourceLog, serializeResourceLog, serializeResourceLogEntry } from '@interop/vh-resource-log';
|
|
26
33
|
import { PreconditionFailedError, ValidationError } from '../errors.js';
|
|
27
34
|
import { blobText } from '../internal/blob.js';
|
|
28
|
-
import { ENCODER, isBlob } from '../internal/content.js';
|
|
29
|
-
|
|
30
|
-
* The content type a resource log is stored under (JSON Lines, not JSON --
|
|
31
|
-
* load-bearing: a JSON content type would have the request layer parse and
|
|
32
|
-
* re-serialize the body, losing the line framing).
|
|
33
|
-
*/
|
|
34
|
-
export const LOG_CONTENT_TYPE = 'text/jsonl';
|
|
35
|
+
import { ENCODER, LOG_CONTENT_TYPE, isBlob } from '../internal/content.js';
|
|
36
|
+
export { LOG_CONTENT_TYPE };
|
|
35
37
|
/**
|
|
36
|
-
* The
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* never re-serializes history), and both `append` and `create` translate the
|
|
41
|
-
* transport's 412 into the library's conflict error.
|
|
38
|
+
* The Resource host: `getWithEtag` (so the codec runs and a text body is
|
|
39
|
+
* decoded as a Blob or a string) and `put` with the log content type.
|
|
40
|
+
* `read` keeps the Blob / text body handling (a React Native Blob has no
|
|
41
|
+
* `text()`; `blobText` falls back to `FileReader`).
|
|
42
42
|
*
|
|
43
|
-
* @param
|
|
44
|
-
* @
|
|
45
|
-
* @returns {ResourceLogStore}
|
|
43
|
+
* @param resource {Resource}
|
|
44
|
+
* @returns {LogTarget}
|
|
46
45
|
*/
|
|
47
|
-
|
|
48
|
-
// The raw body observed by the most recent read; an append extends these
|
|
49
|
-
// bytes verbatim instead of re-serializing the parsed entries. Safe to carry
|
|
50
|
-
// even if stale: the append is pinned to the same read's ETag, so a
|
|
51
|
-
// concurrent append fails the CAS instead.
|
|
52
|
-
let lastReadBody;
|
|
46
|
+
function resourceTarget(resource) {
|
|
53
47
|
return {
|
|
54
48
|
async read() {
|
|
55
49
|
const current = await resource.getWithEtag();
|
|
@@ -65,8 +59,74 @@ export function resourceLogStore({ resource }) {
|
|
|
65
59
|
throw new ValidationError(`Cannot read resource log: the resource "${resource.id}" does not ` +
|
|
66
60
|
'hold a text body (is it stored as JSON instead of JSON Lines?).');
|
|
67
61
|
}
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
return { body, etag: current.etag };
|
|
63
|
+
},
|
|
64
|
+
async put(body, precondition) {
|
|
65
|
+
await resource.put(ENCODER.encode(body), {
|
|
66
|
+
contentType: LOG_CONTENT_TYPE,
|
|
67
|
+
...precondition
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The Collection host: the governing history log at `/meta/log`, read and
|
|
74
|
+
* written verbatim through the handle's own transport methods.
|
|
75
|
+
*
|
|
76
|
+
* @param collection {Collection}
|
|
77
|
+
* @returns {LogTarget}
|
|
78
|
+
*/
|
|
79
|
+
function collectionTarget(collection) {
|
|
80
|
+
return {
|
|
81
|
+
read: () => collection.getHistoryLog(),
|
|
82
|
+
async put(body, precondition) {
|
|
83
|
+
await collection.putHistoryLog(body, precondition);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The WAS adapter implementing the library's `ResourceLogStore` port, over
|
|
89
|
+
* one of two hosts: `resource`, a WAS Resource whose whole body is the log,
|
|
90
|
+
* or `collection`, whose governing history log at `/meta/log` is the log.
|
|
91
|
+
* `append` carries the prior entries' bytes forward verbatim from the most
|
|
92
|
+
* recent read (an append does not re-serialize history), and both `append`
|
|
93
|
+
* and `create` translate the transport's 412 into the library's conflict
|
|
94
|
+
* error. A served log with an empty body reads as absent (the pre-genesis
|
|
95
|
+
* `null`), the state a host that has no log for the slot should report as
|
|
96
|
+
* 404; under a held pin the library still refuses it as a rollback.
|
|
97
|
+
*
|
|
98
|
+
* @param options {object}
|
|
99
|
+
* @param [options.resource] {Resource} the Resource holding the log
|
|
100
|
+
* @param [options.collection] {Collection} the Collection whose history log
|
|
101
|
+
* is the log; exactly one of the two is given, or `ValidationError`
|
|
102
|
+
* @returns {ResourceLogStore}
|
|
103
|
+
*/
|
|
104
|
+
export function resourceLogStore(options) {
|
|
105
|
+
if (options.resource !== undefined && options.collection !== undefined) {
|
|
106
|
+
throw new ValidationError('Pass either `resource` (the Resource holding the log) or ' +
|
|
107
|
+
'`collection` (the Collection whose history log is the log), not both.');
|
|
108
|
+
}
|
|
109
|
+
if (options.resource === undefined && options.collection === undefined) {
|
|
110
|
+
throw new ValidationError('A resource log store needs its host: pass `resource` or `collection`.');
|
|
111
|
+
}
|
|
112
|
+
const target = options.resource !== undefined
|
|
113
|
+
? resourceTarget(options.resource)
|
|
114
|
+
: collectionTarget(options.collection);
|
|
115
|
+
/**
|
|
116
|
+
* The raw body observed by the most recent read; an append extends these
|
|
117
|
+
* bytes verbatim instead of re-serializing the parsed entries. Safe to carry
|
|
118
|
+
* even if stale: the append is pinned to the same read's ETag, so a
|
|
119
|
+
* concurrent append fails the CAS instead.
|
|
120
|
+
*/
|
|
121
|
+
let lastReadBody;
|
|
122
|
+
return {
|
|
123
|
+
async read() {
|
|
124
|
+
const current = await target.read();
|
|
125
|
+
if (current === null || current.body === '') {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const entries = parseResourceLog(current.body);
|
|
129
|
+
lastReadBody = current.body;
|
|
70
130
|
return { entries, etag: current.etag };
|
|
71
131
|
},
|
|
72
132
|
async append(entry, { ifMatch }) {
|
|
@@ -78,7 +138,7 @@ export function resourceLogStore({ resource }) {
|
|
|
78
138
|
const extended = lastReadBody + separator + serializeResourceLogEntry(entry) + '\n';
|
|
79
139
|
await putOrConflict({
|
|
80
140
|
body: extended,
|
|
81
|
-
|
|
141
|
+
precondition: { ifMatch },
|
|
82
142
|
conflict: 'Resource-log append lost its compare-and-swap: the validator ' +
|
|
83
143
|
'is stale.'
|
|
84
144
|
});
|
|
@@ -88,7 +148,7 @@ export function resourceLogStore({ resource }) {
|
|
|
88
148
|
const serialized = serializeResourceLog([entry]);
|
|
89
149
|
await putOrConflict({
|
|
90
150
|
body: serialized,
|
|
91
|
-
|
|
151
|
+
precondition: { ifNoneMatch: true },
|
|
92
152
|
conflict: 'Resource-log create lost its guarded-create race: the log ' +
|
|
93
153
|
'already exists.'
|
|
94
154
|
});
|
|
@@ -102,12 +162,9 @@ export function resourceLogStore({ resource }) {
|
|
|
102
162
|
* it is the port's CAS conflict, not an error: the library's rebase loop
|
|
103
163
|
* re-reads, re-verifies, and retries on it.
|
|
104
164
|
*/
|
|
105
|
-
async function putOrConflict({ body,
|
|
165
|
+
async function putOrConflict({ body, precondition, conflict }) {
|
|
106
166
|
try {
|
|
107
|
-
await
|
|
108
|
-
contentType: LOG_CONTENT_TYPE,
|
|
109
|
-
...options
|
|
110
|
-
});
|
|
167
|
+
await target.put(body, precondition);
|
|
111
168
|
}
|
|
112
169
|
catch (err) {
|
|
113
170
|
if (err instanceof PreconditionFailedError) {
|