@interop/was-client 0.49.0 → 0.50.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/dist/sync/index.d.ts +2 -2
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +1 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/port.d.ts +20 -15
- package/dist/sync/port.d.ts.map +1 -1
- package/dist/sync/port.js +62 -31
- package/dist/sync/port.js.map +1 -1
- package/dist/sync/types.d.ts +51 -24
- package/dist/sync/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/sync/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* boundary the predicates are the contract
|
|
40
40
|
* (`decisions/0001-cross-package-errors-match-by-name.md`).
|
|
41
41
|
*/
|
|
42
|
-
export { createWasSyncPort, KEY_EPOCH_HEADER,
|
|
42
|
+
export { createWasSyncPort, KEY_EPOCH_HEADER, parseEtag } from './port.js';
|
|
43
43
|
export { httpStatus as errorStatus, errorMessage } from '../errors.js';
|
|
44
44
|
export { contentCid, cidFrom, deriveSpaceId } from './cid.js';
|
|
45
45
|
export { isEncryptedEnvelope } from './envelope.js';
|
|
@@ -47,5 +47,5 @@ export { createPlaintextDocCipher } from './plaintextCipher.js';
|
|
|
47
47
|
export { ensureSpace, ensureSpaceAndCollection } from './provisioning.js';
|
|
48
48
|
export { isSyncAuthError, isSyncConflictError, isSyncNotFoundError, isUnknownEpochError } from './predicates.js';
|
|
49
49
|
export { EncryptionError, KeyUnwrapError, UnknownEpochError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError } from '../errors.js';
|
|
50
|
-
export type { Json, SyncCheckpoint, WireDoc, SyncPage, MasterState, SyncStatus, WasSyncPort, DocCipher } from './types.js';
|
|
50
|
+
export type { Json, SyncCheckpoint, WireDoc, SyncPage, MasterState, WriteAck, SyncStatus, WasSyncPort, DocCipher } from './types.js';
|
|
51
51
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/sync/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAI1E,OAAO,EAAE,UAAU,IAAI,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,cAAc,CAAA;AAErB,YAAY,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACV,MAAM,YAAY,CAAA"}
|
package/dist/sync/index.js
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* boundary the predicates are the contract
|
|
40
40
|
* (`decisions/0001-cross-package-errors-match-by-name.md`).
|
|
41
41
|
*/
|
|
42
|
-
export { createWasSyncPort, KEY_EPOCH_HEADER,
|
|
42
|
+
export { createWasSyncPort, KEY_EPOCH_HEADER, parseEtag } from './port.js';
|
|
43
43
|
// The sync subpath's names for the client's own error accessors, so a
|
|
44
44
|
// sync-only consumer reads a raw ky/ezcap failure without importing the core
|
|
45
45
|
// entry.
|
package/dist/sync/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1E,sEAAsE;AACtE,6EAA6E;AAC7E,SAAS;AACT,OAAO,EAAE,UAAU,IAAI,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,cAAc,CAAA"}
|
package/dist/sync/port.d.ts
CHANGED
|
@@ -19,11 +19,16 @@
|
|
|
19
19
|
* `POST /space/:s/:c/query` (profile `changes`) as a root invocation and, like
|
|
20
20
|
* the raw writes, ships the stored bodies verbatim without decrypting.
|
|
21
21
|
*
|
|
22
|
-
* Conditional writes ride the server's
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
22
|
+
* Conditional writes ride the server's `ETag`: an opaque quoted string
|
|
23
|
+
* (`"<generation>.<version>"`, a per-record generation marker ahead of the
|
|
24
|
+
* monotonic content `version` so a hard-deleted-and-recreated id can never
|
|
25
|
+
* collide with its predecessor's validators), enforced uniformly for
|
|
26
|
+
* plaintext and encrypted resources, so there is no plaintext-vs-encrypted
|
|
27
|
+
* fork. `putContent`/`deleteContent` return the server-acked {@link
|
|
28
|
+
* WriteAck} -- the write's raw `etag` (re-read only if the backend sent
|
|
29
|
+
* none) plus its `version` parsed out of it -- so a caller can record acked
|
|
30
|
+
* revisions immediately and echo `etag` back verbatim as a later write's
|
|
31
|
+
* `ifMatch`.
|
|
27
32
|
*
|
|
28
33
|
* Bypassing the codec is not bypassing the error mapper. Every failure caught
|
|
29
34
|
* here goes through the client's own `mapError` first, so the port's signals
|
|
@@ -42,17 +47,17 @@ import type { WasSyncPort } from './types.js';
|
|
|
42
47
|
*/
|
|
43
48
|
export { KEY_EPOCH_HEADER };
|
|
44
49
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* `
|
|
50
|
+
* Parses a quoted strong `ETag` into its numeric revision: the decimal
|
|
51
|
+
* integer after the LAST `.` inside the quotes (`"3mJr7AoUXx2.3"` to `3`).
|
|
52
|
+
* Returns `undefined` when the header is absent, has no `.`, or the trailing
|
|
53
|
+
* segment is anything other than a run of digits.
|
|
48
54
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
* `undefined` when the header is absent or non-numeric (no such revision yet).
|
|
55
|
+
* The quoted string as a whole is opaque -- it also carries a per-record
|
|
56
|
+
* generation marker ahead of the version, minted once and kept for the
|
|
57
|
+
* record's life, so this is one-way: there is no `formatEtag` to build a
|
|
58
|
+
* validator back out of a bare revision number. Always echo the `etag` a read
|
|
59
|
+
* or write returned back verbatim for `ifMatch`/`ifNoneMatch`; this helper
|
|
60
|
+
* only reads the revision out of it for comparison or display.
|
|
56
61
|
*
|
|
57
62
|
* @param etag {string | null | undefined}
|
|
58
63
|
* @returns {number | undefined}
|
package/dist/sync/port.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port.d.ts","sourceRoot":"","sources":["../../src/sync/port.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"port.d.ts","sourceRoot":"","sources":["../../src/sync/port.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EACL,gBAAgB,EAGjB,MAAM,4BAA4B,CAAA;AAWnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAqB,WAAW,EAAY,MAAM,YAAY,CAAA;AAE1E;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAwG3B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAW7E;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,GAAG,EACH,OAAO,EACP,YAAY,EACZ,UAAU,EACV,aAAqB,EACtB,EAAE;IACD,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GAAG,WAAW,CAiNd"}
|
package/dist/sync/port.js
CHANGED
|
@@ -49,9 +49,8 @@ function signalOptions(mapped) {
|
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Whether a mapped error is already one of the port's own signals, which a
|
|
52
|
-
* nested port call (the
|
|
53
|
-
*
|
|
54
|
-
* gain.
|
|
52
|
+
* nested port call (the write-ack re-read inside a write) can raise through a
|
|
53
|
+
* write's catch block. Re-wrapping one would drop its cause for no gain.
|
|
55
54
|
*
|
|
56
55
|
* @param mapped {WasError}
|
|
57
56
|
* @returns {boolean}
|
|
@@ -99,19 +98,17 @@ function mapWriteError(err, { notFound = false, authErrors = false } = {}) {
|
|
|
99
98
|
throw mapped;
|
|
100
99
|
}
|
|
101
100
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* `
|
|
101
|
+
* Parses a quoted strong `ETag` into its numeric revision: the decimal
|
|
102
|
+
* integer after the LAST `.` inside the quotes (`"3mJr7AoUXx2.3"` to `3`).
|
|
103
|
+
* Returns `undefined` when the header is absent, has no `.`, or the trailing
|
|
104
|
+
* segment is anything other than a run of digits.
|
|
105
105
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Parses a quoted strong `ETag` (`"3"`) into its numeric revision, or
|
|
114
|
-
* `undefined` when the header is absent or non-numeric (no such revision yet).
|
|
106
|
+
* The quoted string as a whole is opaque -- it also carries a per-record
|
|
107
|
+
* generation marker ahead of the version, minted once and kept for the
|
|
108
|
+
* record's life, so this is one-way: there is no `formatEtag` to build a
|
|
109
|
+
* validator back out of a bare revision number. Always echo the `etag` a read
|
|
110
|
+
* or write returned back verbatim for `ifMatch`/`ifNoneMatch`; this helper
|
|
111
|
+
* only reads the revision out of it for comparison or display.
|
|
115
112
|
*
|
|
116
113
|
* @param etag {string | null | undefined}
|
|
117
114
|
* @returns {number | undefined}
|
|
@@ -120,8 +117,31 @@ export function parseEtag(etag) {
|
|
|
120
117
|
if (!etag) {
|
|
121
118
|
return undefined;
|
|
122
119
|
}
|
|
123
|
-
const
|
|
124
|
-
|
|
120
|
+
const unquoted = etag.replace(/"/g, '');
|
|
121
|
+
const lastDot = unquoted.lastIndexOf('.');
|
|
122
|
+
if (lastDot === -1) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
const versionPart = unquoted.slice(lastDot + 1);
|
|
126
|
+
return /^\d+$/.test(versionPart) ? Number(versionPart) : undefined;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Reads a response's `ETag` together with the revision parsed out of it, the
|
|
130
|
+
* one place the two are paired. `etag` is absent when the response carried no
|
|
131
|
+
* validator (a backend that does not version the resource); `version` is
|
|
132
|
+
* absent whenever `etag` is, and also when the validator does not end in a
|
|
133
|
+
* revision number. Callers decide what an absent value means for them.
|
|
134
|
+
*
|
|
135
|
+
* @param response {HttpResponse}
|
|
136
|
+
* @returns {{ etag?: string, version?: number }}
|
|
137
|
+
*/
|
|
138
|
+
function versionedEtag(response) {
|
|
139
|
+
const etag = readEtag(response);
|
|
140
|
+
const version = parseEtag(etag);
|
|
141
|
+
return {
|
|
142
|
+
...(etag !== undefined && { etag }),
|
|
143
|
+
...(version !== undefined && { version })
|
|
144
|
+
};
|
|
125
145
|
}
|
|
126
146
|
/**
|
|
127
147
|
* Builds a {@link WasSyncPort} bound to one Space + Collection, backed by the
|
|
@@ -189,19 +209,24 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability, mapA
|
|
|
189
209
|
}
|
|
190
210
|
throw mapped;
|
|
191
211
|
}
|
|
212
|
+
const { etag, version } = versionedEtag(response);
|
|
192
213
|
return {
|
|
193
|
-
version:
|
|
214
|
+
version: version ?? 0,
|
|
215
|
+
etag,
|
|
194
216
|
updatedAt: UNKNOWN_UPDATED_AT,
|
|
195
217
|
data: response.data
|
|
196
218
|
};
|
|
197
219
|
};
|
|
198
|
-
/**
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
220
|
+
/**
|
|
221
|
+
* The acked {@link WriteAck} of a write response. Taken from the response's
|
|
222
|
+
* own `ETag` only: a re-read after the fact could return a concurrent
|
|
223
|
+
* writer's validator as this write's ack. A response with no `ETag` acks
|
|
224
|
+
* `version: 0` and no `etag`, the shape of a backend that does not version
|
|
225
|
+
* resources.
|
|
226
|
+
*/
|
|
227
|
+
const writeAck = (response) => {
|
|
228
|
+
const { etag, version } = versionedEtag(response);
|
|
229
|
+
return { version: version ?? 0, etag };
|
|
205
230
|
};
|
|
206
231
|
return {
|
|
207
232
|
async query({ checkpoint, limit }) {
|
|
@@ -231,7 +256,7 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability, mapA
|
|
|
231
256
|
epoch
|
|
232
257
|
})
|
|
233
258
|
});
|
|
234
|
-
return
|
|
259
|
+
return writeAck(response);
|
|
235
260
|
}
|
|
236
261
|
catch (err) {
|
|
237
262
|
mapWriteError(err, { authErrors: mapAuthErrors });
|
|
@@ -245,7 +270,7 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability, mapA
|
|
|
245
270
|
method: 'DELETE',
|
|
246
271
|
headers: writeHeaders({ precondition: { ifMatch } })
|
|
247
272
|
});
|
|
248
|
-
return
|
|
273
|
+
return writeAck(response);
|
|
249
274
|
}
|
|
250
275
|
catch (err) {
|
|
251
276
|
// Under `mapAuthErrors` a delete's `404` is an idempotent success: the
|
|
@@ -278,7 +303,8 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability, mapA
|
|
|
278
303
|
json: custom === undefined ? {} : { custom },
|
|
279
304
|
headers: writeHeaders({ precondition: { ifMatch, ifNoneMatch } })
|
|
280
305
|
});
|
|
281
|
-
|
|
306
|
+
const { etag, version } = versionedEtag(response);
|
|
307
|
+
return etag !== undefined ? { version: version ?? 0, etag } : undefined;
|
|
282
308
|
}
|
|
283
309
|
catch (err) {
|
|
284
310
|
mapWriteError(err, { authErrors: mapAuthErrors });
|
|
@@ -298,8 +324,8 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability, mapA
|
|
|
298
324
|
}
|
|
299
325
|
// Metadata (best-effort): the `/meta` body carries the server-managed
|
|
300
326
|
// `updatedAt`, the creator DID, the key-epoch id, and the user-writable
|
|
301
|
-
// `custom`, plus its own `metaVersion` ETag. A resource with
|
|
302
|
-
// yet 404s here; only a hard error propagates.
|
|
327
|
+
// `custom`, plus its own `metaVersion`/`metaEtag` ETag. A resource with
|
|
328
|
+
// no metadata yet 404s here; only a hard error propagates.
|
|
303
329
|
const meta = await metaRead;
|
|
304
330
|
if (!meta.ok) {
|
|
305
331
|
const mapped = mapError(meta.err);
|
|
@@ -327,7 +353,12 @@ export function createWasSyncPort({ was, spaceId, collectionId, capability, mapA
|
|
|
327
353
|
if (metaBody?.custom !== undefined) {
|
|
328
354
|
master.custom = metaBody.custom;
|
|
329
355
|
}
|
|
330
|
-
|
|
356
|
+
// The validator is kept whenever the server sent one, so a later
|
|
357
|
+
// `putMeta` can pin on it even when no revision number parses out of it.
|
|
358
|
+
const { etag: metaEtag, version: metaVersion } = versionedEtag(meta.response);
|
|
359
|
+
if (metaEtag !== undefined) {
|
|
360
|
+
master.metaEtag = metaEtag;
|
|
361
|
+
}
|
|
331
362
|
if (metaVersion !== undefined) {
|
|
332
363
|
master.metaVersion = metaVersion;
|
|
333
364
|
}
|
package/dist/sync/port.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port.js","sourceRoot":"","sources":["../../src/sync/port.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"port.js","sourceRoot":"","sources":["../../src/sync/port.ts"],"names":[],"mappings":"AAuCA,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACb,MAAM,4BAA4B,CAAA;AAC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YACD,IAAI,QAAQ,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;gBAClC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAA;YAC/B,CAAC;YACD,IAAI,QAAQ,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;gBACnC,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAA;YACjC,CAAC;YACD,iEAAiE;YACjE,yEAAyE;YACzE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,aAAa,CAC5D,IAAI,CAAC,QAAQ,CACd,CAAA;YACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAA;YAC5B,CAAC;YACD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;YAClC,CAAC;YAED,OAAO,MAAM,CAAA;QACf,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/sync/types.d.ts
CHANGED
|
@@ -25,12 +25,17 @@ export type { Json };
|
|
|
25
25
|
export type SyncCheckpoint = ChangesCheckpoint;
|
|
26
26
|
/**
|
|
27
27
|
* One document as it travels on the `changes` feed wire: `id` is the WAS
|
|
28
|
-
* resource id, `version`
|
|
29
|
-
*
|
|
30
|
-
* `
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
28
|
+
* resource id, `version` its monotonic content revision number, and the
|
|
29
|
+
* stored body is under `data`. `version` is for comparison/ordering only and
|
|
30
|
+
* is not an `ifMatch` value on its own; the server's `ETag` is an opaque
|
|
31
|
+
* string that embeds more than the version. The feed carries the validators
|
|
32
|
+
* themselves: `etag` (content) and `metaEtag` (the `/meta` object), quoted
|
|
33
|
+
* exactly as the server emits them, so a puller passes one back verbatim as a
|
|
34
|
+
* conditional write's `ifMatch` without a {@link WasSyncPort.get} first. A
|
|
35
|
+
* tombstone carries `_deleted: true` with no `data`. This is the shared
|
|
36
|
+
* `ChangeDocument` from `@interop/storage-core`; on an encrypted collection
|
|
37
|
+
* `data`/`custom` are the opaque stored envelope, moved verbatim (decrypt is a
|
|
38
|
+
* projection-time concern the engine's `DocCipher` handles, never the port).
|
|
34
39
|
*/
|
|
35
40
|
export type WireDoc = ChangeDocument;
|
|
36
41
|
/**
|
|
@@ -43,20 +48,41 @@ export type SyncPage = ChangesPage;
|
|
|
43
48
|
* The current master state of a single resource, read back for the 412-conflict
|
|
44
49
|
* path ({@link WasSyncPort.get}). An absent or tombstoned resource surfaces as
|
|
45
50
|
* `get` resolving `null`, never as a `MasterState`. `updatedAt`, `metaVersion`,
|
|
46
|
-
* `custom`, `createdBy`, and `epoch` are populated from the
|
|
47
|
-
* document when it exists; a resource with no metadata yet
|
|
48
|
-
* epoch-zero `updatedAt` placeholder (a valid, sortable timestamp --
|
|
49
|
-
* change feed remains the authority on ordering).
|
|
51
|
+
* `metaEtag`, `custom`, `createdBy`, and `epoch` are populated from the
|
|
52
|
+
* resource's `/meta` document when it exists; a resource with no metadata yet
|
|
53
|
+
* reports an epoch-zero `updatedAt` placeholder (a valid, sortable timestamp --
|
|
54
|
+
* the change feed remains the authority on ordering).
|
|
55
|
+
*
|
|
56
|
+
* `etag` and `metaEtag` are the raw, opaque `ETag` validators the content and
|
|
57
|
+
* `/meta` reads returned (absent against a backend that does not version
|
|
58
|
+
* resources) -- pass one back verbatim as a later write's `ifMatch`. `version`
|
|
59
|
+
* and `metaVersion` are the revision numbers parsed out of them, for
|
|
60
|
+
* comparison or display only.
|
|
50
61
|
*/
|
|
51
62
|
export interface MasterState {
|
|
52
63
|
version: number;
|
|
64
|
+
etag?: string;
|
|
53
65
|
updatedAt: string;
|
|
54
66
|
metaVersion?: number;
|
|
67
|
+
metaEtag?: string;
|
|
55
68
|
data?: Json;
|
|
56
69
|
custom?: Json;
|
|
57
70
|
createdBy?: string;
|
|
58
71
|
epoch?: string;
|
|
59
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* The acknowledgment a conditional write returns: the new `version` plus the
|
|
75
|
+
* opaque `etag` validator it lives behind, exactly as the server sent it.
|
|
76
|
+
* Pass `etag` back verbatim as a later write's `ifMatch` -- it can no longer
|
|
77
|
+
* be synthesized from `version` alone, since the server's `ETag` also embeds a
|
|
78
|
+
* per-record generation marker ahead of the version. `etag` is absent against
|
|
79
|
+
* a backend that does not version resources; read `version` only to compare
|
|
80
|
+
* or display a revision number.
|
|
81
|
+
*/
|
|
82
|
+
export interface WriteAck {
|
|
83
|
+
version: number;
|
|
84
|
+
etag?: string;
|
|
85
|
+
}
|
|
60
86
|
/**
|
|
61
87
|
* The injected WAS-access seam. `createWasSyncPort` implements this over
|
|
62
88
|
* `@interop/was-client`'s `was.request()` and the `Collection.changes()` feed;
|
|
@@ -78,10 +104,10 @@ export interface WasSyncPort {
|
|
|
78
104
|
}): Promise<SyncPage>;
|
|
79
105
|
/**
|
|
80
106
|
* Conditionally writes the content body verbatim (`PUT /:id`). Pass
|
|
81
|
-
* `ifNoneMatch: true` for create-if-absent, or `ifMatch` (
|
|
82
|
-
*
|
|
83
|
-
* key-epoch id the body was encrypted under
|
|
84
|
-
*
|
|
107
|
+
* `ifNoneMatch: true` for create-if-absent, or `ifMatch` (the opaque `ETag`
|
|
108
|
+
* from a prior read/write, echoed back verbatim) for update-if-unchanged.
|
|
109
|
+
* `epoch` stamps the opaque key-epoch id the body was encrypted under
|
|
110
|
+
* (absent clears any prior stamp). Returns the new {@link WriteAck}. Throws
|
|
85
111
|
* {@link WasSyncConflictError} on `412`.
|
|
86
112
|
*/
|
|
87
113
|
putContent(options: {
|
|
@@ -90,13 +116,14 @@ export interface WasSyncPort {
|
|
|
90
116
|
ifMatch?: string;
|
|
91
117
|
ifNoneMatch?: boolean;
|
|
92
118
|
epoch?: string;
|
|
93
|
-
}): Promise<
|
|
119
|
+
}): Promise<WriteAck>;
|
|
94
120
|
/**
|
|
95
121
|
* Conditionally deletes a resource (writes a tombstone; `DELETE /:id`). Pass
|
|
96
|
-
* `ifMatch` (
|
|
97
|
-
* unchanged. Returns the tombstone's new
|
|
98
|
-
* {@link
|
|
99
|
-
* (already gone -- a settled outcome
|
|
122
|
+
* `ifMatch` (the opaque `ETag` from a prior read/write, echoed back
|
|
123
|
+
* verbatim) to delete only if unchanged. Returns the tombstone's new
|
|
124
|
+
* {@link WriteAck}. Throws {@link WasSyncConflictError} on `412`,
|
|
125
|
+
* {@link WasSyncNotFoundError} on `404` (already gone -- a settled outcome
|
|
126
|
+
* for a delete).
|
|
100
127
|
*
|
|
101
128
|
* Resolves `undefined` instead when the port was built with
|
|
102
129
|
* `mapAuthErrors: true` and the target was already absent: there the delete
|
|
@@ -105,22 +132,22 @@ export interface WasSyncPort {
|
|
|
105
132
|
deleteContent(options: {
|
|
106
133
|
id: string;
|
|
107
134
|
ifMatch?: string;
|
|
108
|
-
}): Promise<
|
|
135
|
+
}): Promise<WriteAck | undefined>;
|
|
109
136
|
/**
|
|
110
137
|
* Conditionally writes the user-writable metadata `custom` (`PUT /:id/meta`).
|
|
111
138
|
* Optional -- present only on a port that syncs metadata. The write fully
|
|
112
139
|
* replaces `custom`, so omitting it writes the CLEARED state (the server
|
|
113
140
|
* clears every property the body leaves out) -- that is how a metadata clear
|
|
114
|
-
* replicates. Returns the new
|
|
115
|
-
*
|
|
116
|
-
*
|
|
141
|
+
* replicates. Returns the new metadata {@link WriteAck}, or `undefined` when
|
|
142
|
+
* the response carried no `ETag`. Throws {@link WasSyncConflictError} on
|
|
143
|
+
* `412`.
|
|
117
144
|
*/
|
|
118
145
|
putMeta?(options: {
|
|
119
146
|
id: string;
|
|
120
147
|
custom?: Json;
|
|
121
148
|
ifMatch?: string;
|
|
122
149
|
ifNoneMatch?: boolean;
|
|
123
|
-
}): Promise<
|
|
150
|
+
}): Promise<WriteAck | undefined>;
|
|
124
151
|
/**
|
|
125
152
|
* Re-reads a single resource's current master state for the 412-conflict
|
|
126
153
|
* assembler. Returns `null` when the resource is genuinely absent OR a
|
package/dist/sync/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,YAAY,EAAE,IAAI,EAAE,CAAA;AAEpB;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sync/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,YAAY,EAAE,IAAI,EAAE,CAAA;AAEpB;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAA;AAE9C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,GAAG,cAAc,CAAA;AAEpC;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAA;AAElC;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE,IAAI,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB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,OAAO,EAAE;QACf,IAAI,EAAE,IAAI,CAAA;KACX,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC3D,aAAa,CAAC,CAAC,OAAO,EAAE;QACtB,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,IAAI,CAAA;QACV,OAAO,EAAE,IAAI,CAAA;KACd,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC3D,OAAO,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpD;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interop/was-client",
|
|
3
3
|
"description": "A developer-friendly client for Wallet Attached Storage (WAS) servers.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.50.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@interop/ezcap": "^7.4.6",
|
|
68
68
|
"@interop/http-client": "^1.0.5",
|
|
69
69
|
"@interop/minimal-cipher": "^7.10.0",
|
|
70
|
-
"@interop/storage-core": "^0.
|
|
70
|
+
"@interop/storage-core": "^0.11.0",
|
|
71
71
|
"@interop/vh-resource-log": "^0.4.1",
|
|
72
72
|
"@interop/x25519-key-agreement-key": "^5.3.0",
|
|
73
73
|
"@noble/hashes": "^2.3.0",
|