@interop/was-client 0.33.0 → 0.34.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/errors.d.ts +28 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +36 -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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/revoke.d.ts +21 -1
- package/dist/internal/revoke.d.ts.map +1 -1
- package/dist/internal/revoke.js +1 -1
- package/dist/internal/revoke.js.map +1 -1
- package/dist/paths.d.ts +30 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +29 -0
- package/dist/paths.js.map +1 -0
- package/dist/sync/index.d.ts +6 -4
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +6 -4
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/port.d.ts +34 -4
- package/dist/sync/port.d.ts.map +1 -1
- package/dist/sync/port.js +123 -20
- package/dist/sync/port.js.map +1 -1
- package/dist/sync/types.d.ts +12 -4
- package/dist/sync/types.d.ts.map +1 -1
- package/package.json +7 -1
package/dist/errors.d.ts
CHANGED
|
@@ -165,6 +165,24 @@ export declare class WasSyncConflictError extends PreconditionFailedError {
|
|
|
165
165
|
export declare class WasSyncNotFoundError extends NotFoundError {
|
|
166
166
|
constructor(message?: string, options?: WasErrorOptions);
|
|
167
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* The replication-port signal for a request a WAS server refused on
|
|
170
|
+
* authorization grounds: `401` (no verifiable invocation), `403` (authenticated
|
|
171
|
+
* but not permitted), or the `404` a server returns when it MASKS an
|
|
172
|
+
* authorization failure as "not found" so an unauthorized caller cannot probe
|
|
173
|
+
* which resources exist. Carries the originating HTTP `status` so a caller can
|
|
174
|
+
* tell the three apart.
|
|
175
|
+
*
|
|
176
|
+
* Opt-in: a `WasSyncPort` raises it only when built with `mapAuthErrors: true`
|
|
177
|
+
* (`@interop/was-client/sync`), because the `404` reading is safe exactly when
|
|
178
|
+
* the invoked Space and Collection are known to exist -- then a `404` can only
|
|
179
|
+
* mean the invocation itself was rejected, i.e. the grant expired or was
|
|
180
|
+
* revoked. A subtype of {@link AuthRequiredError}, so a caller that already
|
|
181
|
+
* handles 401/403 via `instanceof AuthRequiredError` still catches it.
|
|
182
|
+
*/
|
|
183
|
+
export declare class WasSyncAuthError extends AuthRequiredError {
|
|
184
|
+
constructor(status: number, options?: WasErrorOptions);
|
|
185
|
+
}
|
|
168
186
|
/**
|
|
169
187
|
* The server encountered an internal fault (HTTP 5xx).
|
|
170
188
|
*/
|
|
@@ -193,6 +211,16 @@ export declare class UnknownEpochError extends Error {
|
|
|
193
211
|
* @returns {number | undefined}
|
|
194
212
|
*/
|
|
195
213
|
export declare function httpStatus(err: unknown): number | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Normalizes an unknown caught value into a display string: the `Error`'s
|
|
216
|
+
* `message` when it is one, else its `String(...)` coercion. The companion to
|
|
217
|
+
* {@link httpStatus} for the "log or surface what went wrong" half of a catch
|
|
218
|
+
* block.
|
|
219
|
+
*
|
|
220
|
+
* @param err {unknown} the caught error
|
|
221
|
+
* @returns {string}
|
|
222
|
+
*/
|
|
223
|
+
export declare function errorMessage(err: unknown): string;
|
|
196
224
|
/**
|
|
197
225
|
* Translates a thrown ky/ezcap error into the appropriate `WasError` subclass,
|
|
198
226
|
* carrying through the server's `problem+json` fields. Dispatches on the
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,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;;;;;;;;;;;;GAcG;AACH,qBAAa,gBAAiB,SAAQ,iBAAiB;gBACzC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB;CAO1D;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IACjC,IAAI,SAAmB;CACjC;AAED;;;;;;;GAOG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,EACV,YAAY,EACZ,IAAI,EACL,EAAE;QACD,YAAY,EAAE,MAAM,CAAA;QACpB,IAAI,EAAE,MAAM,EAAE,CAAA;KACf;CAUF;AA4DD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CA2D/C"}
|
package/dist/errors.js
CHANGED
|
@@ -174,6 +174,30 @@ export class WasSyncNotFoundError extends NotFoundError {
|
|
|
174
174
|
this.name = 'WasSyncNotFoundError';
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* The replication-port signal for a request a WAS server refused on
|
|
179
|
+
* authorization grounds: `401` (no verifiable invocation), `403` (authenticated
|
|
180
|
+
* but not permitted), or the `404` a server returns when it MASKS an
|
|
181
|
+
* authorization failure as "not found" so an unauthorized caller cannot probe
|
|
182
|
+
* which resources exist. Carries the originating HTTP `status` so a caller can
|
|
183
|
+
* tell the three apart.
|
|
184
|
+
*
|
|
185
|
+
* Opt-in: a `WasSyncPort` raises it only when built with `mapAuthErrors: true`
|
|
186
|
+
* (`@interop/was-client/sync`), because the `404` reading is safe exactly when
|
|
187
|
+
* the invoked Space and Collection are known to exist -- then a `404` can only
|
|
188
|
+
* mean the invocation itself was rejected, i.e. the grant expired or was
|
|
189
|
+
* revoked. A subtype of {@link AuthRequiredError}, so a caller that already
|
|
190
|
+
* handles 401/403 via `instanceof AuthRequiredError` still catches it.
|
|
191
|
+
*/
|
|
192
|
+
export class WasSyncAuthError extends AuthRequiredError {
|
|
193
|
+
constructor(status, options = {}) {
|
|
194
|
+
super(`WAS storage access denied (HTTP ${status}).`, {
|
|
195
|
+
...options,
|
|
196
|
+
status
|
|
197
|
+
});
|
|
198
|
+
this.name = 'WasSyncAuthError';
|
|
199
|
+
}
|
|
200
|
+
}
|
|
177
201
|
/**
|
|
178
202
|
* The server encountered an internal fault (HTTP 5xx).
|
|
179
203
|
*/
|
|
@@ -244,6 +268,18 @@ export function httpStatus(err) {
|
|
|
244
268
|
const raw = err;
|
|
245
269
|
return raw?.status ?? raw?.response?.status;
|
|
246
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Normalizes an unknown caught value into a display string: the `Error`'s
|
|
273
|
+
* `message` when it is one, else its `String(...)` coercion. The companion to
|
|
274
|
+
* {@link httpStatus} for the "log or surface what went wrong" half of a catch
|
|
275
|
+
* block.
|
|
276
|
+
*
|
|
277
|
+
* @param err {unknown} the caught error
|
|
278
|
+
* @returns {string}
|
|
279
|
+
*/
|
|
280
|
+
export function errorMessage(err) {
|
|
281
|
+
return err instanceof Error ? err.message : String(err);
|
|
282
|
+
}
|
|
247
283
|
/**
|
|
248
284
|
* Translates a thrown ky/ezcap error into the appropriate `WasError` subclass,
|
|
249
285
|
* carrying through the server's `problem+json` fields. Dispatches on the
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAmBpD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,MAAM,CAAS;IACf,IAAI,CAAS;IACb,KAAK,CAAS;IACd,OAAO,CAAW;IA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AClD,KAAK,GAAG;YACN,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QAChD,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC;IAED,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACvC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { parseSpaceTarget } from './internal/paths.js';
|
|
|
13
13
|
export type { ParsedSpacePath } from './internal/paths.js';
|
|
14
14
|
export { readEtag, writeHeaders } from './internal/conditional.js';
|
|
15
15
|
export type { WritePrecondition } from './internal/conditional.js';
|
|
16
|
-
export { WasError, NotFoundError, ValidationError, AuthRequiredError, NotImplementedError, ConflictError, PreconditionFailedError, LogNotConfirmedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, KeyUnwrapError, IntegrityError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, mapError } from './errors.js';
|
|
16
|
+
export { WasError, NotFoundError, ValidationError, AuthRequiredError, NotImplementedError, ConflictError, PreconditionFailedError, LogNotConfirmedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, KeyUnwrapError, IntegrityError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, mapError } from './errors.js';
|
|
17
17
|
export type { ResourceCodec, EncryptionProvider, EncodedWrite, ResponseLike } from './codec.js';
|
|
18
18
|
export type { Json, JsonPrimitive, JsonObject, JsonArray, ResourceData, Action, ActionInput, SpaceDescription, CollectionDescription, CollectionWritableFields, CollectionEncryption, CollectionEncryptionEpoch, CollectionEncryptionRecipient, CollectionSummary, CollectionsList, SpaceSummary, SpaceListing, ResourceSummary, CollectionResourcesList, ResourceMetadata, ResourceMetadataCustom, AddResult, ImportStats, PolicyDocument, LinkSet, LinkSetEntry, HandleOptions, EncryptionOverride, BackendReference, BackendDescriptor, BackendRegistration, BackendConnectionInput, BackendConnectionPublic, StorageLimit, CollectionUsage, BackendUsage, SpaceQuotaReport, GrantOptions, RequestInput, IZcap, IDelegatedZcap, ISigner } from './types.js';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAClE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAElE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACT,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACb,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,IAAI,EACJ,aAAa,EACb,UAAU,EACV,SAAS,EACT,YAAY,EACZ,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,oB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,EACb,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACb,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,IAAI,EACJ,aAAa,EACb,UAAU,EACV,SAAS,EACT,YAAY,EACZ,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAC7B,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,SAAS,EACT,WAAW,EACX,cAAc,EACd,OAAO,EACP,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,cAAc,EACd,OAAO,EACR,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -11,5 +11,5 @@ export { Collection } from './Collection.js';
|
|
|
11
11
|
export { Resource } from './Resource.js';
|
|
12
12
|
export { parseSpaceTarget } from './internal/paths.js';
|
|
13
13
|
export { readEtag, writeHeaders } from './internal/conditional.js';
|
|
14
|
-
export { WasError, NotFoundError, ValidationError, AuthRequiredError, NotImplementedError, ConflictError, PreconditionFailedError, LogNotConfirmedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, KeyUnwrapError, IntegrityError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, mapError } from './errors.js';
|
|
14
|
+
export { WasError, NotFoundError, ValidationError, AuthRequiredError, NotImplementedError, ConflictError, PreconditionFailedError, LogNotConfirmedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, KeyUnwrapError, IntegrityError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, mapError } from './errors.js';
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGlE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACT,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGlE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACT,MAAM,aAAa,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClientContext } from './request.js';
|
|
2
|
-
import type { IDelegatedZcap, IZcap } from '../types.js';
|
|
2
|
+
import type { IDelegatedZcap, IRootZcap, IZcap } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* The root capability id for an invocation target URL
|
|
5
5
|
* (`urn:zcap:root:<encoded target>`) -- the id grammar shared by revocation
|
|
@@ -11,6 +11,26 @@ import type { IDelegatedZcap, IZcap } from '../types.js';
|
|
|
11
11
|
* @returns {string}
|
|
12
12
|
*/
|
|
13
13
|
export declare function rootCapabilityId(target: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Builds the root capability for `target` in **object** form.
|
|
16
|
+
*
|
|
17
|
+
* The object form is load-bearing: `@interop/ezcap` accepts a *string* root
|
|
18
|
+
* capability id only when its invocation target is `https:`, which would break
|
|
19
|
+
* against an `http://localhost` server. Both forms reduce to the same
|
|
20
|
+
* `zcap id="..."` invocation header.
|
|
21
|
+
*
|
|
22
|
+
* `controller` is client-side only -- the server re-derives the real controller
|
|
23
|
+
* when it synthesizes the root capability -- so the caller's own DID is fine.
|
|
24
|
+
*
|
|
25
|
+
* @param options {object}
|
|
26
|
+
* @param options.target {string} the absolute invocation target URL
|
|
27
|
+
* @param options.controller {string} the invoking client's DID
|
|
28
|
+
* @returns {IRootZcap}
|
|
29
|
+
*/
|
|
30
|
+
export declare function rootCapability({ target, controller }: {
|
|
31
|
+
target: string;
|
|
32
|
+
controller: string;
|
|
33
|
+
}): IRootZcap;
|
|
14
34
|
/**
|
|
15
35
|
* Derives the id of the Space a capability is rooted in, from its
|
|
16
36
|
* `invocationTarget`. A Space-rooted capability's target is the Space URL or a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../src/internal/revoke.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGjD,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../src/internal/revoke.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAOnE;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,UAAU,EACX,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,SAAS,CAOZ;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAarE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,aAAa,EACtB,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GAC3D,OAAO,CAAC,IAAI,CAAC,CAmBf"}
|
package/dist/internal/revoke.js
CHANGED
|
@@ -52,7 +52,7 @@ export function rootCapabilityId(target) {
|
|
|
52
52
|
* @param options.controller {string} the invoking client's DID
|
|
53
53
|
* @returns {IRootZcap}
|
|
54
54
|
*/
|
|
55
|
-
function rootCapability({ target, controller }) {
|
|
55
|
+
export function rootCapability({ target, controller }) {
|
|
56
56
|
return {
|
|
57
57
|
'@context': ZCAP_CONTEXT_URL,
|
|
58
58
|
id: rootCapabilityId(target),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revoke.js","sourceRoot":"","sources":["../../src/internal/revoke.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAErE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAG9C;;GAEG;AACH,MAAM,gBAAgB,GAAG,0BAA0B,CAAA;AAEnD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,iBAAiB,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAA;AACtD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,
|
|
1
|
+
{"version":3,"file":"revoke.js","sourceRoot":"","sources":["../../src/internal/revoke.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAErE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAG9C;;GAEG;AACH,MAAM,gBAAgB,GAAG,0BAA0B,CAAA;AAEnD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,iBAAiB,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAA;AACtD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,MAAM,EACN,UAAU,EAIX;IACC,OAAO;QACL,UAAU,EAAE,gBAAgB;QAC5B,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC;QAC5B,gBAAgB,EAAE,MAAM;QACxB,UAA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
+
* The `@interop/was-client/paths` subpath entry: the WAS URL grammar as
|
|
6
|
+
* standalone functions, for a consumer that has to form a WAS path or a zcap
|
|
7
|
+
* `invocationTarget` without going through a navigational handle.
|
|
8
|
+
*
|
|
9
|
+
* The path builders own the trailing-slash canonicalization (item-create and
|
|
10
|
+
* listing endpoints carry a trailing slash; get/put/delete-by-id endpoints do
|
|
11
|
+
* not) and the per-segment percent-encoding, and the zcap `invocationTarget` is
|
|
12
|
+
* derived from the request URL -- so a caller that hand-assembles a path is
|
|
13
|
+
* re-deriving rules that must match the server's `allowedTarget` byte for byte.
|
|
14
|
+
* Exporting the builders instead is what keeps that from happening.
|
|
15
|
+
*
|
|
16
|
+
* `parseSpacePath` / `parseSpaceTarget` are the inverse grammar (a pathname or
|
|
17
|
+
* an absolute URL back to the containment depth it addresses), and
|
|
18
|
+
* `rootCapabilityId` / `rootCapability` mint the `urn:zcap:root:` capability a
|
|
19
|
+
* target's own root invocation names -- the id form for parenting an unparented
|
|
20
|
+
* grant, the object form for invoking it (`@interop/ezcap` accepts a bare root
|
|
21
|
+
* capability id only for an `https:` target, which would break against an
|
|
22
|
+
* `http://localhost` server).
|
|
23
|
+
*
|
|
24
|
+
* Kept off the core entry so a consumer opts in; every export here is a pure
|
|
25
|
+
* function with no I/O and no client state.
|
|
26
|
+
*/
|
|
27
|
+
export { spacePath, collectionPath, collectionItems, collectionQuery, resourcePath, resourceMeta, toUrl, parseSpacePath, parseSpaceTarget } from './internal/paths.js';
|
|
28
|
+
export type { ParsedSpacePath } from './internal/paths.js';
|
|
29
|
+
export { rootCapabilityId, rootCapability } from './internal/revoke.js';
|
|
30
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,SAAS,EACT,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,cAAc,EACd,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
|
package/dist/paths.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The `@interop/was-client/paths` subpath entry: the WAS URL grammar as
|
|
6
|
+
* standalone functions, for a consumer that has to form a WAS path or a zcap
|
|
7
|
+
* `invocationTarget` without going through a navigational handle.
|
|
8
|
+
*
|
|
9
|
+
* The path builders own the trailing-slash canonicalization (item-create and
|
|
10
|
+
* listing endpoints carry a trailing slash; get/put/delete-by-id endpoints do
|
|
11
|
+
* not) and the per-segment percent-encoding, and the zcap `invocationTarget` is
|
|
12
|
+
* derived from the request URL -- so a caller that hand-assembles a path is
|
|
13
|
+
* re-deriving rules that must match the server's `allowedTarget` byte for byte.
|
|
14
|
+
* Exporting the builders instead is what keeps that from happening.
|
|
15
|
+
*
|
|
16
|
+
* `parseSpacePath` / `parseSpaceTarget` are the inverse grammar (a pathname or
|
|
17
|
+
* an absolute URL back to the containment depth it addresses), and
|
|
18
|
+
* `rootCapabilityId` / `rootCapability` mint the `urn:zcap:root:` capability a
|
|
19
|
+
* target's own root invocation names -- the id form for parenting an unparented
|
|
20
|
+
* grant, the object form for invoking it (`@interop/ezcap` accepts a bare root
|
|
21
|
+
* capability id only for an `https:` target, which would break against an
|
|
22
|
+
* `http://localhost` server).
|
|
23
|
+
*
|
|
24
|
+
* Kept off the core entry so a consumer opts in; every export here is a pure
|
|
25
|
+
* function with no I/O and no client state.
|
|
26
|
+
*/
|
|
27
|
+
export { spacePath, collectionPath, collectionItems, collectionQuery, resourcePath, resourceMeta, toUrl, parseSpacePath, parseSpaceTarget } from './internal/paths.js';
|
|
28
|
+
export { rootCapabilityId, rootCapability } from './internal/revoke.js';
|
|
29
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,SAAS,EACT,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,cAAc,EACd,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
|
package/dist/sync/index.d.ts
CHANGED
|
@@ -16,16 +16,18 @@
|
|
|
16
16
|
* - `ensureSpaceAndCollection` -- idempotent Space + Collection provisioning.
|
|
17
17
|
*
|
|
18
18
|
* The 412 conflict / 404 not-found port signals (`WasSyncConflictError` /
|
|
19
|
-
* `WasSyncNotFoundError`)
|
|
20
|
-
*
|
|
19
|
+
* `WasSyncNotFoundError`), and the opt-in revoked-access signal
|
|
20
|
+
* (`WasSyncAuthError`, raised only under `mapAuthErrors`), live in the client's
|
|
21
|
+
* typed error hierarchy and are re-exported here for convenience -- as is the
|
|
22
|
+
* stale-descriptor decrypt
|
|
21
23
|
* signal (`UnknownEpochError`), so a crypto-free sync consumer can
|
|
22
24
|
* `instanceof`-match it without importing the `/edv` entry that throws it.
|
|
23
25
|
*/
|
|
24
|
-
export { createWasSyncPort, KEY_EPOCH_HEADER, formatEtag, parseEtag, errorStatus } from './port.js';
|
|
26
|
+
export { createWasSyncPort, KEY_EPOCH_HEADER, formatEtag, parseEtag, errorStatus, errorMessage } from './port.js';
|
|
25
27
|
export { contentCid, cidFrom, deriveSpaceId } from './cid.js';
|
|
26
28
|
export { isEncryptedEnvelope } from './envelope.js';
|
|
27
29
|
export { createPlaintextDocCipher } from './plaintextCipher.js';
|
|
28
30
|
export { ensureSpaceAndCollection } from './provisioning.js';
|
|
29
|
-
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '../errors.js';
|
|
31
|
+
export { UnknownEpochError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError } from '../errors.js';
|
|
30
32
|
export type { Json, SyncCheckpoint, WireDoc, SyncPage, MasterState, WasSyncPort, DocCipher } from './types.js';
|
|
31
33
|
//# 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
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACb,MAAM,WAAW,CAAA;AAClB,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,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,cAAc,CAAA;AAErB,YAAY,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,QAAQ,EACR,WAAW,EACX,WAAW,EACX,SAAS,EACV,MAAM,YAAY,CAAA"}
|
package/dist/sync/index.js
CHANGED
|
@@ -16,15 +16,17 @@
|
|
|
16
16
|
* - `ensureSpaceAndCollection` -- idempotent Space + Collection provisioning.
|
|
17
17
|
*
|
|
18
18
|
* The 412 conflict / 404 not-found port signals (`WasSyncConflictError` /
|
|
19
|
-
* `WasSyncNotFoundError`)
|
|
20
|
-
*
|
|
19
|
+
* `WasSyncNotFoundError`), and the opt-in revoked-access signal
|
|
20
|
+
* (`WasSyncAuthError`, raised only under `mapAuthErrors`), live in the client's
|
|
21
|
+
* typed error hierarchy and are re-exported here for convenience -- as is the
|
|
22
|
+
* stale-descriptor decrypt
|
|
21
23
|
* signal (`UnknownEpochError`), so a crypto-free sync consumer can
|
|
22
24
|
* `instanceof`-match it without importing the `/edv` entry that throws it.
|
|
23
25
|
*/
|
|
24
|
-
export { createWasSyncPort, KEY_EPOCH_HEADER, formatEtag, parseEtag, errorStatus } from './port.js';
|
|
26
|
+
export { createWasSyncPort, KEY_EPOCH_HEADER, formatEtag, parseEtag, errorStatus, errorMessage } from './port.js';
|
|
25
27
|
export { contentCid, cidFrom, deriveSpaceId } from './cid.js';
|
|
26
28
|
export { isEncryptedEnvelope } from './envelope.js';
|
|
27
29
|
export { createPlaintextDocCipher } from './plaintextCipher.js';
|
|
28
30
|
export { ensureSpaceAndCollection } from './provisioning.js';
|
|
29
|
-
export { UnknownEpochError, WasSyncConflictError, WasSyncNotFoundError } from '../errors.js';
|
|
31
|
+
export { UnknownEpochError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError } from '../errors.js';
|
|
30
32
|
//# sourceMappingURL=index.js.map
|
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
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACb,MAAM,WAAW,CAAA;AAClB,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,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,cAAc,CAAA"}
|
package/dist/sync/port.d.ts
CHANGED
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import type { WasClient } from '../WasClient.js';
|
|
29
29
|
import { KEY_EPOCH_HEADER } from '../internal/conditional.js';
|
|
30
|
-
import { httpStatus } from '../errors.js';
|
|
30
|
+
import { errorMessage, httpStatus } from '../errors.js';
|
|
31
|
+
import type { IZcap } from '../types.js';
|
|
31
32
|
import type { WasSyncPort } from './types.js';
|
|
32
33
|
/**
|
|
33
34
|
* The request header the server reads a content write's key-epoch id from,
|
|
@@ -43,6 +44,12 @@ export { KEY_EPOCH_HEADER };
|
|
|
43
44
|
* for the client's own {@link httpStatus}.
|
|
44
45
|
*/
|
|
45
46
|
export declare const errorStatus: typeof httpStatus;
|
|
47
|
+
/**
|
|
48
|
+
* Normalizes an unknown caught error into a display string. The sync subpath's
|
|
49
|
+
* name for the client's own {@link errorMessage}, the companion to
|
|
50
|
+
* {@link errorStatus}.
|
|
51
|
+
*/
|
|
52
|
+
export { errorMessage };
|
|
46
53
|
/**
|
|
47
54
|
* Formats a numeric content `version` as the quoted strong `ETag` an
|
|
48
55
|
* update-if-unchanged write passes as its `ifMatch` precondition (e.g. `3` to
|
|
@@ -62,18 +69,41 @@ export declare function formatEtag(version: number): string;
|
|
|
62
69
|
export declare function parseEtag(etag: string | null): number | undefined;
|
|
63
70
|
/**
|
|
64
71
|
* Builds a {@link WasSyncPort} bound to one Space + Collection, backed by the
|
|
65
|
-
* caller's signed {@link WasClient}.
|
|
66
|
-
*
|
|
72
|
+
* caller's signed {@link WasClient}. With no `capability`, requests invoke the
|
|
73
|
+
* client's own root capability.
|
|
74
|
+
*
|
|
75
|
+
* `mapAuthErrors` exists because a WAS server MASKS an authorization failure as
|
|
76
|
+
* `404` ("not found or invalid authorization") rather than `403`, so an
|
|
77
|
+
* unauthorized caller cannot probe which resources exist. A replica that
|
|
78
|
+
* already synced its Space and Collection knows they exist, so on its sync
|
|
79
|
+
* paths a `404` can only mean the invocation itself was rejected -- the
|
|
80
|
+
* expired- or revoked-grant signal it needs in order to stop retrying and
|
|
81
|
+
* prompt for a reconnect. The reading is only safe with that knowledge, so it
|
|
82
|
+
* is opt-in: off (the default), every status behaves exactly as before.
|
|
83
|
+
*
|
|
84
|
+
* Two paths keep their own `404` semantics even when it is on, because there a
|
|
85
|
+
* `404` is a modeled outcome rather than an anomaly: `deleteContent` resolves
|
|
86
|
+
* (the tombstone's goal state already holds -- an idempotent delete), and `get`
|
|
87
|
+
* resolves `null` (absent or tombstoned -- the deletion-wins input its callers
|
|
88
|
+
* depend on). Revoked access still surfaces within one poll on `query` and on
|
|
89
|
+
* the content/metadata writes.
|
|
67
90
|
*
|
|
68
91
|
* @param options {object}
|
|
69
92
|
* @param options.was {WasClient} the session client (holds the signer)
|
|
70
93
|
* @param options.spaceId {string} the WAS Space id
|
|
71
94
|
* @param options.collectionId {string} the WAS collection id
|
|
95
|
+
* @param [options.capability] {IZcap} a delegated capability to invoke on
|
|
96
|
+
* every request this port makes (pull, writes, and reads alike); omit to
|
|
97
|
+
* invoke the client's own root capability
|
|
98
|
+
* @param [options.mapAuthErrors] {boolean} map `401` / `403` / the masked
|
|
99
|
+
* `404` to {@link WasSyncAuthError} (default `false`)
|
|
72
100
|
* @returns {WasSyncPort}
|
|
73
101
|
*/
|
|
74
|
-
export declare function createWasSyncPort({ was, spaceId, collectionId }: {
|
|
102
|
+
export declare function createWasSyncPort({ was, spaceId, collectionId, capability, mapAuthErrors }: {
|
|
75
103
|
was: WasClient;
|
|
76
104
|
spaceId: string;
|
|
77
105
|
collectionId: string;
|
|
106
|
+
capability?: IZcap;
|
|
107
|
+
mapAuthErrors?: boolean;
|
|
78
108
|
}): WasSyncPort;
|
|
79
109
|
//# sourceMappingURL=port.d.ts.map
|
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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EACL,gBAAgB,EAGjB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"port.d.ts","sourceRoot":"","sources":["../../src/sync/port.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EACL,gBAAgB,EAGjB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,YAAY,EACZ,UAAU,EAIX,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,YAAY,CAAA;AAEhE;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAW3B;;;;;GAKG;AACH,eAAO,MAAM,WAAW,mBAAa,CAAA;AAErC;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,CAAA;AAmDvB;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAMjE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAwMd"}
|
package/dist/sync/port.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KEY_EPOCH_HEADER, readEtag, writeHeaders } from '../internal/conditional.js';
|
|
2
2
|
import { resourceMeta, resourcePath } from '../internal/paths.js';
|
|
3
|
-
import { httpStatus, WasSyncConflictError, WasSyncNotFoundError } from '../errors.js';
|
|
3
|
+
import { errorMessage, httpStatus, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError } from '../errors.js';
|
|
4
4
|
/**
|
|
5
5
|
* The request header the server reads a content write's key-epoch id from,
|
|
6
6
|
* stamping it onto the Resource's metadata. Defined next to the header
|
|
@@ -23,19 +23,41 @@ const UNKNOWN_UPDATED_AT = new Date(0).toISOString();
|
|
|
23
23
|
* for the client's own {@link httpStatus}.
|
|
24
24
|
*/
|
|
25
25
|
export const errorStatus = httpStatus;
|
|
26
|
+
/**
|
|
27
|
+
* Normalizes an unknown caught error into a display string. The sync subpath's
|
|
28
|
+
* name for the client's own {@link errorMessage}, the companion to
|
|
29
|
+
* {@link errorStatus}.
|
|
30
|
+
*/
|
|
31
|
+
export { errorMessage };
|
|
32
|
+
/**
|
|
33
|
+
* The statuses a WAS server can return for an authorization failure: `401` (no
|
|
34
|
+
* verifiable invocation), `403` (not permitted), and the `404` it returns when
|
|
35
|
+
* it masks an authorization failure as "not found".
|
|
36
|
+
*
|
|
37
|
+
* @param status {number | undefined}
|
|
38
|
+
* @returns {boolean}
|
|
39
|
+
*/
|
|
40
|
+
function isAuthStatus(status) {
|
|
41
|
+
return status === 401 || status === 403 || status === 404;
|
|
42
|
+
}
|
|
26
43
|
/**
|
|
27
44
|
* Maps a raw write error onto the port's typed signals, rethrowing anything
|
|
28
45
|
* else unchanged: `412` becomes a {@link WasSyncConflictError} for every write.
|
|
29
46
|
* `notFound` opts in to the `404` mapping, which only `deleteContent` performs
|
|
30
47
|
* (an already-gone target is a settled outcome for a delete, but a hard error
|
|
31
|
-
* for a content or metadata write).
|
|
48
|
+
* for a content or metadata write). `authErrors` is the port's `mapAuthErrors`
|
|
49
|
+
* option: it maps `401` / `403` / the masked `404` to a
|
|
50
|
+
* {@link WasSyncAuthError}. `notFound` is checked first, so a port that asked
|
|
51
|
+
* for both still gets the delete-specific signal.
|
|
32
52
|
*
|
|
33
53
|
* @param err {unknown} the caught error
|
|
34
54
|
* @param [options] {object}
|
|
35
55
|
* @param [options.notFound] {boolean} map `404` to {@link WasSyncNotFoundError}
|
|
56
|
+
* @param [options.authErrors] {boolean} map `401`/`403`/`404` to
|
|
57
|
+
* {@link WasSyncAuthError}
|
|
36
58
|
* @returns {never} always throws
|
|
37
59
|
*/
|
|
38
|
-
function mapWriteError(err, { notFound = false } = {}) {
|
|
60
|
+
function mapWriteError(err, { notFound = false, authErrors = false } = {}) {
|
|
39
61
|
const status = errorStatus(err);
|
|
40
62
|
if (notFound && status === 404) {
|
|
41
63
|
throw new WasSyncNotFoundError();
|
|
@@ -43,6 +65,9 @@ function mapWriteError(err, { notFound = false } = {}) {
|
|
|
43
65
|
if (status === 412) {
|
|
44
66
|
throw new WasSyncConflictError();
|
|
45
67
|
}
|
|
68
|
+
if (authErrors && isAuthStatus(status)) {
|
|
69
|
+
throw new WasSyncAuthError(status);
|
|
70
|
+
}
|
|
46
71
|
throw err;
|
|
47
72
|
}
|
|
48
73
|
/**
|
|
@@ -72,16 +97,37 @@ export function parseEtag(etag) {
|
|
|
72
97
|
}
|
|
73
98
|
/**
|
|
74
99
|
* Builds a {@link WasSyncPort} bound to one Space + Collection, backed by the
|
|
75
|
-
* caller's signed {@link WasClient}.
|
|
76
|
-
*
|
|
100
|
+
* caller's signed {@link WasClient}. With no `capability`, requests invoke the
|
|
101
|
+
* client's own root capability.
|
|
102
|
+
*
|
|
103
|
+
* `mapAuthErrors` exists because a WAS server MASKS an authorization failure as
|
|
104
|
+
* `404` ("not found or invalid authorization") rather than `403`, so an
|
|
105
|
+
* unauthorized caller cannot probe which resources exist. A replica that
|
|
106
|
+
* already synced its Space and Collection knows they exist, so on its sync
|
|
107
|
+
* paths a `404` can only mean the invocation itself was rejected -- the
|
|
108
|
+
* expired- or revoked-grant signal it needs in order to stop retrying and
|
|
109
|
+
* prompt for a reconnect. The reading is only safe with that knowledge, so it
|
|
110
|
+
* is opt-in: off (the default), every status behaves exactly as before.
|
|
111
|
+
*
|
|
112
|
+
* Two paths keep their own `404` semantics even when it is on, because there a
|
|
113
|
+
* `404` is a modeled outcome rather than an anomaly: `deleteContent` resolves
|
|
114
|
+
* (the tombstone's goal state already holds -- an idempotent delete), and `get`
|
|
115
|
+
* resolves `null` (absent or tombstoned -- the deletion-wins input its callers
|
|
116
|
+
* depend on). Revoked access still surfaces within one poll on `query` and on
|
|
117
|
+
* the content/metadata writes.
|
|
77
118
|
*
|
|
78
119
|
* @param options {object}
|
|
79
120
|
* @param options.was {WasClient} the session client (holds the signer)
|
|
80
121
|
* @param options.spaceId {string} the WAS Space id
|
|
81
122
|
* @param options.collectionId {string} the WAS collection id
|
|
123
|
+
* @param [options.capability] {IZcap} a delegated capability to invoke on
|
|
124
|
+
* every request this port makes (pull, writes, and reads alike); omit to
|
|
125
|
+
* invoke the client's own root capability
|
|
126
|
+
* @param [options.mapAuthErrors] {boolean} map `401` / `403` / the masked
|
|
127
|
+
* `404` to {@link WasSyncAuthError} (default `false`)
|
|
82
128
|
* @returns {WasSyncPort}
|
|
83
129
|
*/
|
|
84
|
-
export function createWasSyncPort({ was, spaceId, collectionId }) {
|
|
130
|
+
export function createWasSyncPort({ was, spaceId, collectionId, capability, mapAuthErrors = false }) {
|
|
85
131
|
// Paths come from the internal builders, so this port inherits the same
|
|
86
132
|
// percent-encoding and reserved/dot-segment guards as the handle API.
|
|
87
133
|
const contentPath = (id) => resourcePath(spaceId, collectionId, id);
|
|
@@ -89,16 +135,29 @@ export function createWasSyncPort({ was, spaceId, collectionId }) {
|
|
|
89
135
|
// Construction is I/O-free (the codec/feature probes are lazy thunks) and
|
|
90
136
|
// `changes()` never resolves the codec, so it ships the stored bodies
|
|
91
137
|
// verbatim -- what this codec-bypassing port requires.
|
|
92
|
-
const changesCollection = was
|
|
138
|
+
const changesCollection = was
|
|
139
|
+
.space(spaceId)
|
|
140
|
+
.collection(collectionId, { capability });
|
|
93
141
|
/** Re-reads a resource's raw content body + version (no decrypt, no `/meta`). */
|
|
94
142
|
const readContent = async (id) => {
|
|
95
143
|
let response;
|
|
96
144
|
try {
|
|
97
|
-
response = await was.request({
|
|
145
|
+
response = await was.request({
|
|
146
|
+
capability,
|
|
147
|
+
path: contentPath(id),
|
|
148
|
+
method: 'GET'
|
|
149
|
+
});
|
|
98
150
|
}
|
|
99
151
|
catch (err) {
|
|
100
|
-
|
|
101
|
-
|
|
152
|
+
const status = errorStatus(err);
|
|
153
|
+
// A read's `404` stays "absent or tombstoned" even under
|
|
154
|
+
// `mapAuthErrors`: it is a modeled outcome here, and the callers read it
|
|
155
|
+
// as deletion-wins.
|
|
156
|
+
if (status === 404) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
if (mapAuthErrors && isAuthStatus(status)) {
|
|
160
|
+
throw new WasSyncAuthError(status);
|
|
102
161
|
}
|
|
103
162
|
throw err;
|
|
104
163
|
}
|
|
@@ -118,11 +177,24 @@ export function createWasSyncPort({ was, spaceId, collectionId }) {
|
|
|
118
177
|
};
|
|
119
178
|
return {
|
|
120
179
|
async query({ checkpoint, limit }) {
|
|
121
|
-
|
|
180
|
+
try {
|
|
181
|
+
return await changesCollection.changes({ checkpoint, limit });
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
// The pull path is where revoked access surfaces reliably: unlike a
|
|
185
|
+
// read or a delete, a `404` on the collection's own query endpoint has
|
|
186
|
+
// no benign reading once the collection is known to exist.
|
|
187
|
+
const status = errorStatus(err);
|
|
188
|
+
if (mapAuthErrors && isAuthStatus(status)) {
|
|
189
|
+
throw new WasSyncAuthError(status);
|
|
190
|
+
}
|
|
191
|
+
throw err;
|
|
192
|
+
}
|
|
122
193
|
},
|
|
123
194
|
async putContent({ id, data, ifMatch, ifNoneMatch, epoch }) {
|
|
124
195
|
try {
|
|
125
196
|
const response = await was.request({
|
|
197
|
+
capability,
|
|
126
198
|
path: contentPath(id),
|
|
127
199
|
method: 'PUT',
|
|
128
200
|
json: data,
|
|
@@ -134,12 +206,13 @@ export function createWasSyncPort({ was, spaceId, collectionId }) {
|
|
|
134
206
|
return await ackedVersion(response, id);
|
|
135
207
|
}
|
|
136
208
|
catch (err) {
|
|
137
|
-
mapWriteError(err);
|
|
209
|
+
mapWriteError(err, { authErrors: mapAuthErrors });
|
|
138
210
|
}
|
|
139
211
|
},
|
|
140
212
|
async deleteContent({ id, ifMatch }) {
|
|
141
213
|
try {
|
|
142
214
|
const response = await was.request({
|
|
215
|
+
capability,
|
|
143
216
|
path: contentPath(id),
|
|
144
217
|
method: 'DELETE',
|
|
145
218
|
headers: writeHeaders({ precondition: { ifMatch } })
|
|
@@ -147,20 +220,41 @@ export function createWasSyncPort({ was, spaceId, collectionId }) {
|
|
|
147
220
|
return await ackedVersion(response, id);
|
|
148
221
|
}
|
|
149
222
|
catch (err) {
|
|
150
|
-
|
|
223
|
+
// Under `mapAuthErrors` a delete's `404` is an idempotent success: the
|
|
224
|
+
// resource is already gone (deleted locally before it was ever pushed,
|
|
225
|
+
// or deleted first by another replica), so the tombstone's goal state
|
|
226
|
+
// holds and the batch must not be retried forever. A masked
|
|
227
|
+
// authorization `404` is swallowed with it -- indistinguishable by
|
|
228
|
+
// design -- but revoked access still surfaces on the next `query`.
|
|
229
|
+
if (mapAuthErrors && errorStatus(err) === 404) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
mapWriteError(err, {
|
|
233
|
+
notFound: !mapAuthErrors,
|
|
234
|
+
authErrors: mapAuthErrors
|
|
235
|
+
});
|
|
151
236
|
}
|
|
152
237
|
},
|
|
153
238
|
async putMeta({ id, custom, ifMatch, ifNoneMatch }) {
|
|
154
239
|
try {
|
|
155
|
-
await was.request({
|
|
240
|
+
const response = await was.request({
|
|
241
|
+
capability,
|
|
156
242
|
path: metaPath(id),
|
|
157
243
|
method: 'PUT',
|
|
158
|
-
|
|
244
|
+
// The `/meta` PUT fully replaces `custom`: a body omitting it writes
|
|
245
|
+
// the CLEARED state (the server clears every property the body
|
|
246
|
+
// leaves out), which is how a metadata clear replicates. Byte-
|
|
247
|
+
// identical on the wire to the `{ custom: undefined }` this used to
|
|
248
|
+
// send, since `JSON.stringify` drops an `undefined` member.
|
|
249
|
+
json: custom === undefined ? {} : { custom },
|
|
159
250
|
headers: writeHeaders({ precondition: { ifMatch, ifNoneMatch } })
|
|
160
251
|
});
|
|
252
|
+
// `readEtag` reports an absent header as `undefined`; `parseEtag` reads
|
|
253
|
+
// the `null` spelling of the same thing.
|
|
254
|
+
return parseEtag(readEtag(response) ?? null);
|
|
161
255
|
}
|
|
162
256
|
catch (err) {
|
|
163
|
-
mapWriteError(err);
|
|
257
|
+
mapWriteError(err, { authErrors: mapAuthErrors });
|
|
164
258
|
}
|
|
165
259
|
},
|
|
166
260
|
async get({ id }) {
|
|
@@ -168,7 +262,9 @@ export function createWasSyncPort({ was, spaceId, collectionId }) {
|
|
|
168
262
|
// together. The metadata read settles into a value (its rejection handler
|
|
169
263
|
// is attached before any `await` that can throw, so an abandoned read can
|
|
170
264
|
// never surface as an unhandled rejection).
|
|
171
|
-
const metaRead = was
|
|
265
|
+
const metaRead = was
|
|
266
|
+
.request({ capability, path: metaPath(id), method: 'GET' })
|
|
267
|
+
.then(response => ({ ok: true, response }), (err) => ({ ok: false, err }));
|
|
172
268
|
const master = await readContent(id);
|
|
173
269
|
if (master === null) {
|
|
174
270
|
return null; // absent or tombstoned; the metadata read is discarded
|
|
@@ -179,10 +275,17 @@ export function createWasSyncPort({ was, spaceId, collectionId }) {
|
|
|
179
275
|
// yet 404s here; only a hard error propagates.
|
|
180
276
|
const meta = await metaRead;
|
|
181
277
|
if (!meta.ok) {
|
|
182
|
-
|
|
183
|
-
|
|
278
|
+
const status = errorStatus(meta.err);
|
|
279
|
+
// A `/meta` `404` is routine (the resource has no metadata document
|
|
280
|
+
// yet), so it stays benign under `mapAuthErrors` -- only `401`/`403`
|
|
281
|
+
// map there.
|
|
282
|
+
if (status === 404) {
|
|
283
|
+
return master;
|
|
284
|
+
}
|
|
285
|
+
if (mapAuthErrors && isAuthStatus(status)) {
|
|
286
|
+
throw new WasSyncAuthError(status);
|
|
184
287
|
}
|
|
185
|
-
|
|
288
|
+
throw meta.err;
|
|
186
289
|
}
|
|
187
290
|
const metaBody = meta.response.data;
|
|
188
291
|
if (metaBody?.updatedAt) {
|
package/dist/sync/port.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port.js","sourceRoot":"","sources":["../../src/sync/port.ts"],"names":[],"mappings":"AA6BA,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACb,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"port.js","sourceRoot":"","sources":["../../src/sync/port.ts"],"names":[],"mappings":"AA6BA,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,YAA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,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,MAAM,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAA;YAC9D,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
|
@@ -96,22 +96,30 @@ export interface WasSyncPort {
|
|
|
96
96
|
* unchanged. Returns the tombstone's new server `version`. Throws
|
|
97
97
|
* {@link WasSyncConflictError} on `412`, {@link WasSyncNotFoundError} on `404`
|
|
98
98
|
* (already gone -- a settled outcome for a delete).
|
|
99
|
+
*
|
|
100
|
+
* Resolves `undefined` instead when the port was built with
|
|
101
|
+
* `mapAuthErrors: true` and the target was already absent: there the delete
|
|
102
|
+
* is idempotent, so there is no acked revision to report.
|
|
99
103
|
*/
|
|
100
104
|
deleteContent(options: {
|
|
101
105
|
id: string;
|
|
102
106
|
ifMatch?: string;
|
|
103
|
-
}): Promise<number>;
|
|
107
|
+
}): Promise<number | undefined>;
|
|
104
108
|
/**
|
|
105
109
|
* Conditionally writes the user-writable metadata `custom` (`PUT /:id/meta`).
|
|
106
|
-
* Optional -- present only on a port that syncs metadata.
|
|
110
|
+
* Optional -- present only on a port that syncs metadata. The write fully
|
|
111
|
+
* replaces `custom`, so omitting it writes the CLEARED state (the server
|
|
112
|
+
* clears every property the body leaves out) -- that is how a metadata clear
|
|
113
|
+
* replicates. Returns the new `metaVersion` (parsed from the write's `ETag`),
|
|
114
|
+
* or `undefined` when the response carried none. Throws
|
|
107
115
|
* {@link WasSyncConflictError} on `412`.
|
|
108
116
|
*/
|
|
109
117
|
putMeta?(options: {
|
|
110
118
|
id: string;
|
|
111
|
-
custom
|
|
119
|
+
custom?: Json;
|
|
112
120
|
ifMatch?: string;
|
|
113
121
|
ifNoneMatch?: boolean;
|
|
114
|
-
}): Promise<
|
|
122
|
+
}): Promise<number | undefined>;
|
|
115
123
|
/**
|
|
116
124
|
* Re-reads a single resource's current master state for the 412-conflict
|
|
117
125
|
* 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;;;;;;;;;GASG;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;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG,cAAc,CAAA;AAEpC;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAA;AAElC;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE,IAAI,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,KAAK,C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A;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"}
|
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.34.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
"import": "./dist/edv/index.js",
|
|
37
37
|
"default": "./dist/edv/index.js"
|
|
38
38
|
},
|
|
39
|
+
"./paths": {
|
|
40
|
+
"types": "./dist/paths.d.ts",
|
|
41
|
+
"react-native": "./dist/paths.js",
|
|
42
|
+
"import": "./dist/paths.js",
|
|
43
|
+
"default": "./dist/paths.js"
|
|
44
|
+
},
|
|
39
45
|
"./log": {
|
|
40
46
|
"types": "./dist/log/index.d.ts",
|
|
41
47
|
"react-native": "./dist/log/index.js",
|