@interop/was-client 0.14.5 → 0.16.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/Collection.d.ts +17 -26
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +60 -59
- package/dist/Collection.js.map +1 -1
- package/dist/Resource.d.ts +27 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +60 -22
- package/dist/Resource.js.map +1 -1
- package/dist/Space.d.ts.map +1 -1
- package/dist/Space.js +19 -11
- package/dist/Space.js.map +1 -1
- package/dist/WasClient.d.ts.map +1 -1
- package/dist/WasClient.js +4 -13
- package/dist/WasClient.js.map +1 -1
- package/dist/edv/EdvCodec.d.ts +11 -2
- package/dist/edv/EdvCodec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.js +85 -70
- package/dist/edv/EdvCodec.js.map +1 -1
- package/dist/edv/WasTransport.d.ts +61 -53
- package/dist/edv/WasTransport.d.ts.map +1 -1
- package/dist/edv/WasTransport.js +189 -157
- package/dist/edv/WasTransport.js.map +1 -1
- package/dist/edv/constants.d.ts +0 -14
- package/dist/edv/constants.d.ts.map +1 -1
- package/dist/edv/constants.js +4 -8
- package/dist/edv/constants.js.map +1 -1
- package/dist/edv/epochCrypto.d.ts +1 -1
- package/dist/edv/epochCrypto.d.ts.map +1 -1
- package/dist/edv/epochCrypto.js +33 -4
- package/dist/edv/epochCrypto.js.map +1 -1
- package/dist/edv/epochKeys.js +11 -1
- package/dist/edv/epochKeys.js.map +1 -1
- package/dist/edv/recipients.d.ts +5 -1
- package/dist/edv/recipients.d.ts.map +1 -1
- package/dist/edv/recipients.js +38 -16
- package/dist/edv/recipients.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/codec.d.ts +19 -0
- package/dist/internal/codec.d.ts.map +1 -1
- package/dist/internal/codec.js +26 -8
- package/dist/internal/codec.js.map +1 -1
- package/dist/internal/conditional.d.ts +11 -0
- package/dist/internal/conditional.d.ts.map +1 -1
- package/dist/internal/conditional.js +12 -0
- package/dist/internal/conditional.js.map +1 -1
- package/dist/internal/content.d.ts +7 -0
- package/dist/internal/content.d.ts.map +1 -1
- package/dist/internal/content.js +5 -3
- package/dist/internal/content.js.map +1 -1
- package/dist/internal/describe.d.ts +49 -1
- package/dist/internal/describe.d.ts.map +1 -1
- package/dist/internal/describe.js +47 -6
- package/dist/internal/describe.js.map +1 -1
- package/dist/internal/features.d.ts +73 -0
- package/dist/internal/features.d.ts.map +1 -0
- package/dist/internal/features.js +129 -0
- package/dist/internal/features.js.map +1 -0
- package/dist/internal/grant.d.ts.map +1 -1
- package/dist/internal/grant.js +2 -1
- package/dist/internal/grant.js.map +1 -1
- package/dist/internal/pagination.d.ts +30 -1
- package/dist/internal/pagination.d.ts.map +1 -1
- package/dist/internal/pagination.js +44 -1
- package/dist/internal/pagination.js.map +1 -1
- package/dist/internal/paths.d.ts +25 -0
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +67 -10
- package/dist/internal/paths.js.map +1 -1
- package/dist/internal/policy.d.ts +28 -0
- package/dist/internal/policy.d.ts.map +1 -1
- package/dist/internal/policy.js +31 -0
- package/dist/internal/policy.js.map +1 -1
- package/dist/internal/revoke.d.ts +11 -0
- package/dist/internal/revoke.d.ts.map +1 -1
- package/dist/internal/revoke.js +14 -1
- package/dist/internal/revoke.js.map +1 -1
- package/dist/internal/write.d.ts +10 -1
- package/dist/internal/write.d.ts.map +1 -1
- package/dist/internal/write.js +29 -4
- package/dist/internal/write.js.map +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the conditional-write precondition a codec attached to its encoded
|
|
3
|
+
* write (`EncodedWrite.ifMatch` / `ifNoneMatch`). The one mapping shared by
|
|
4
|
+
* the two write entry points (`Collection.add` and `upsertResource`), so they
|
|
5
|
+
* cannot diverge.
|
|
6
|
+
*
|
|
7
|
+
* @param encoded {EncodedWrite}
|
|
8
|
+
* @returns {WritePrecondition}
|
|
9
|
+
*/
|
|
10
|
+
export function encodedPrecondition(encoded) {
|
|
11
|
+
return { ifMatch: encoded.ifMatch, ifNoneMatch: encoded.ifNoneMatch };
|
|
12
|
+
}
|
|
1
13
|
/**
|
|
2
14
|
* Builds the headers for a write request: the content-type (when present) and
|
|
3
15
|
* the conditional-write precondition headers (`If-Match` / `If-None-Match: *`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../src/internal/conditional.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../src/internal/conditional.ts"],"names":[],"mappings":"AAsBA;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAqB;IACvD,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAA;AACvE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,WAAW,EACX,YAAY,GAAG,EAAE,EACjB,KAAK,EAKN;IACC,MAAM,OAAO,GAA2B,EAAE,CAAA;IAC1C,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CAAC,cAAc,CAAC,GAAG,WAAW,CAAA;IACvC,CAAC;IACD,IAAI,YAAY,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC,OAAO,CAAA;IAC5C,CAAC;IACD,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,OAAO,CAAC,eAAe,CAAC,GAAG,GAAG,CAAA;IAChC,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,CAAC,eAAe,CAAC,GAAG,KAAK,CAAA;IAClC,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;AAC9D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,QAA6B;IACpD,OAAO,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,SAAS,CAAA;AACnD,CAAC"}
|
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { HttpResponse } from '@interop/http-client';
|
|
13
13
|
import type { Json, ResourceData } from '../types.js';
|
|
14
|
+
/**
|
|
15
|
+
* The shared `TextEncoder` (stateless, so one instance serves the whole
|
|
16
|
+
* library): serializing an explicitly-typed JSON write to bytes here,
|
|
17
|
+
* re-serializing a pre-parsed JSON body in `Resource.getBytes()`, and encoding
|
|
18
|
+
* EDV envelope bytes (re-exported by `edv/constants.ts`).
|
|
19
|
+
*/
|
|
20
|
+
export declare const ENCODER: TextEncoder;
|
|
14
21
|
/**
|
|
15
22
|
* Whether a content-type denotes JSON -- `application/json` or any
|
|
16
23
|
* `application/<prefix>+json` structured-suffix variant (e.g.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/internal/content.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/internal/content.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAA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ClB,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GACxD,YAAY,CAiCd;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,GAAG,MAAM,CA4B/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAIrE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3E;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,YAAY,GAAG,IAAI,GAC5B,OAAO,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAS7B"}
|
package/dist/internal/content.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ValidationError, WasServerError } from '../errors.js';
|
|
2
2
|
const OCTET_STREAM = 'application/octet-stream';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The shared `TextEncoder` (stateless, so one instance serves the whole
|
|
5
|
+
* library): serializing an explicitly-typed JSON write to bytes here,
|
|
6
|
+
* re-serializing a pre-parsed JSON body in `Resource.getBytes()`, and encoding
|
|
7
|
+
* EDV envelope bytes (re-exported by `edv/constants.ts`).
|
|
6
8
|
*/
|
|
7
|
-
const ENCODER = new TextEncoder();
|
|
9
|
+
export const ENCODER = new TextEncoder();
|
|
8
10
|
/**
|
|
9
11
|
* Whether a content-type denotes JSON -- `application/json` or any
|
|
10
12
|
* `application/<prefix>+json` structured-suffix variant (e.g.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/internal/content.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,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C,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAA;AAC5E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAA6B;IAE7B,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAA;IAC9D,IAAI,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,OAAO,CAAC,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAS,CAAA;IAC/C,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;AACxB,CAAC"}
|
|
@@ -5,9 +5,34 @@
|
|
|
5
5
|
* Reads a Collection Description with a single GET. Shared by
|
|
6
6
|
* `Collection.describe()` and the standalone-resource codec's marker discovery
|
|
7
7
|
* so the request shape (path, capability, null-unwrap) lives in one place.
|
|
8
|
+
* Also owns the masked-404 fail-closed policy: WAS returns 404 for both
|
|
9
|
+
* not-found and unauthorized, so a `null` description is ambiguous and an
|
|
10
|
+
* operation that must know the current state fails closed via
|
|
11
|
+
* `unreadableDescriptionError` rather than guessing.
|
|
8
12
|
*/
|
|
13
|
+
import type { HttpResponse } from '@interop/http-client';
|
|
9
14
|
import type { ClientContext } from './request.js';
|
|
15
|
+
import type { WasError } from '../errors.js';
|
|
10
16
|
import type { CollectionDescription, IZcap } from '../types.js';
|
|
17
|
+
/**
|
|
18
|
+
* Sends the Collection Description GET, returning the raw response -- or
|
|
19
|
+
* `null` if the collection is missing or not visible to you (WAS returns 404
|
|
20
|
+
* for both not-found and unauthorized). The one request shape shared by
|
|
21
|
+
* {@link describeCollection} and `Collection.describeWithEtag` (which also
|
|
22
|
+
* needs the response's `ETag` header).
|
|
23
|
+
*
|
|
24
|
+
* @param context {ClientContext}
|
|
25
|
+
* @param options {object}
|
|
26
|
+
* @param options.spaceId {string}
|
|
27
|
+
* @param options.collectionId {string}
|
|
28
|
+
* @param [options.capability] {IZcap} capability attached to the request
|
|
29
|
+
* @returns {Promise<HttpResponse | null>}
|
|
30
|
+
*/
|
|
31
|
+
export declare function describeCollectionResponse(context: ClientContext, { spaceId, collectionId, capability }: {
|
|
32
|
+
spaceId: string;
|
|
33
|
+
collectionId: string;
|
|
34
|
+
capability?: IZcap;
|
|
35
|
+
}): Promise<HttpResponse | null>;
|
|
11
36
|
/**
|
|
12
37
|
* Reads the Collection Description. Returns `null` if the collection is missing
|
|
13
38
|
* or not visible to you (WAS returns 404 for both not-found and unauthorized).
|
|
@@ -19,9 +44,32 @@ import type { CollectionDescription, IZcap } from '../types.js';
|
|
|
19
44
|
* @param [options.capability] {IZcap} capability attached to the request
|
|
20
45
|
* @returns {Promise<CollectionDescription | null>}
|
|
21
46
|
*/
|
|
22
|
-
export declare function describeCollection(context: ClientContext,
|
|
47
|
+
export declare function describeCollection(context: ClientContext, options: {
|
|
23
48
|
spaceId: string;
|
|
24
49
|
collectionId: string;
|
|
25
50
|
capability?: IZcap;
|
|
26
51
|
}): Promise<CollectionDescription | null>;
|
|
52
|
+
/**
|
|
53
|
+
* Builds the fail-closed error for an operation that needs a description it
|
|
54
|
+
* could not read. The one owner of the masked-404 policy statement ("WAS
|
|
55
|
+
* returns 404 for both not-found and unauthorized, so a null description is
|
|
56
|
+
* ambiguous -- fail closed"); callers supply the operation, its consequence,
|
|
57
|
+
* and the recovery advice.
|
|
58
|
+
*
|
|
59
|
+
* @param options {object}
|
|
60
|
+
* @param options.operation {string} what was refused, continuing "Cannot ..."
|
|
61
|
+
* @param [options.consequence] {string} what proceeding could silently do,
|
|
62
|
+
* continuing "..., so "
|
|
63
|
+
* @param [options.advice] {string} recovery guidance, appended verbatim
|
|
64
|
+
* @param [options.ErrorClass] {Function} the `WasError` subclass to build
|
|
65
|
+
* (defaults to `ValidationError`; the codec resolver passes
|
|
66
|
+
* `EncryptionError` so fail-closed encryption handling still catches it)
|
|
67
|
+
* @returns {WasError}
|
|
68
|
+
*/
|
|
69
|
+
export declare function unreadableDescriptionError({ operation, consequence, advice, ErrorClass }: {
|
|
70
|
+
operation: string;
|
|
71
|
+
consequence?: string;
|
|
72
|
+
advice?: string;
|
|
73
|
+
ErrorClass?: new (message: string) => WasError;
|
|
74
|
+
}): WasError;
|
|
27
75
|
//# sourceMappingURL=describe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAKjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAE/D;;;;;;;;;;;;;GAaG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,aAAa,EACtB,EACE,OAAO,EACP,YAAY,EACZ,UAAU,EACX,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC/D,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAO9B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GACrE,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAIvC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,SAAS,EACT,WAAW,EACX,MAAM,EACN,UAA4B,EAC7B,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAA;CAC/C,GAAG,QAAQ,CAQX"}
|
|
@@ -1,24 +1,65 @@
|
|
|
1
1
|
import { send } from './request.js';
|
|
2
2
|
import { dataOrNull } from './content.js';
|
|
3
3
|
import { collectionPath } from './paths.js';
|
|
4
|
+
import { ValidationError } from '../errors.js';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
* or not visible to you (WAS returns 404
|
|
6
|
+
* Sends the Collection Description GET, returning the raw response -- or
|
|
7
|
+
* `null` if the collection is missing or not visible to you (WAS returns 404
|
|
8
|
+
* for both not-found and unauthorized). The one request shape shared by
|
|
9
|
+
* {@link describeCollection} and `Collection.describeWithEtag` (which also
|
|
10
|
+
* needs the response's `ETag` header).
|
|
7
11
|
*
|
|
8
12
|
* @param context {ClientContext}
|
|
9
13
|
* @param options {object}
|
|
10
14
|
* @param options.spaceId {string}
|
|
11
15
|
* @param options.collectionId {string}
|
|
12
16
|
* @param [options.capability] {IZcap} capability attached to the request
|
|
13
|
-
* @returns {Promise<
|
|
17
|
+
* @returns {Promise<HttpResponse | null>}
|
|
14
18
|
*/
|
|
15
|
-
export async function
|
|
16
|
-
|
|
19
|
+
export async function describeCollectionResponse(context, { spaceId, collectionId, capability }) {
|
|
20
|
+
return send(context, {
|
|
17
21
|
path: collectionPath(spaceId, collectionId),
|
|
18
22
|
method: 'GET',
|
|
19
23
|
capability,
|
|
20
24
|
read: true
|
|
21
25
|
});
|
|
22
|
-
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Reads the Collection Description. Returns `null` if the collection is missing
|
|
29
|
+
* or not visible to you (WAS returns 404 for both not-found and unauthorized).
|
|
30
|
+
*
|
|
31
|
+
* @param context {ClientContext}
|
|
32
|
+
* @param options {object}
|
|
33
|
+
* @param options.spaceId {string}
|
|
34
|
+
* @param options.collectionId {string}
|
|
35
|
+
* @param [options.capability] {IZcap} capability attached to the request
|
|
36
|
+
* @returns {Promise<CollectionDescription | null>}
|
|
37
|
+
*/
|
|
38
|
+
export async function describeCollection(context, options) {
|
|
39
|
+
return dataOrNull(await describeCollectionResponse(context, options));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Builds the fail-closed error for an operation that needs a description it
|
|
43
|
+
* could not read. The one owner of the masked-404 policy statement ("WAS
|
|
44
|
+
* returns 404 for both not-found and unauthorized, so a null description is
|
|
45
|
+
* ambiguous -- fail closed"); callers supply the operation, its consequence,
|
|
46
|
+
* and the recovery advice.
|
|
47
|
+
*
|
|
48
|
+
* @param options {object}
|
|
49
|
+
* @param options.operation {string} what was refused, continuing "Cannot ..."
|
|
50
|
+
* @param [options.consequence] {string} what proceeding could silently do,
|
|
51
|
+
* continuing "..., so "
|
|
52
|
+
* @param [options.advice] {string} recovery guidance, appended verbatim
|
|
53
|
+
* @param [options.ErrorClass] {Function} the `WasError` subclass to build
|
|
54
|
+
* (defaults to `ValidationError`; the codec resolver passes
|
|
55
|
+
* `EncryptionError` so fail-closed encryption handling still catches it)
|
|
56
|
+
* @returns {WasError}
|
|
57
|
+
*/
|
|
58
|
+
export function unreadableDescriptionError({ operation, consequence, advice, ErrorClass = ValidationError }) {
|
|
59
|
+
return new ErrorClass(`Cannot ${operation}: the current description is not readable with this ` +
|
|
60
|
+
'capability (WAS returns 404 for both not-found and unauthorized)' +
|
|
61
|
+
(consequence !== undefined ? `, so ${consequence}` : '') +
|
|
62
|
+
'.' +
|
|
63
|
+
(advice !== undefined ? ` ${advice}` : ''));
|
|
23
64
|
}
|
|
24
65
|
//# sourceMappingURL=describe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAI9C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAAsB,EACtB,EACE,OAAO,EACP,YAAY,EACZ,UAAU,EACoD;IAEhE,OAAO,IAAI,CAAC,OAAO,EAAE;QACnB,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC;QAC3C,MAAM,EAAE,KAAK;QACb,UAAU;QACV,IAAI,EAAE,IAAI;KACX,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAsB,EACtB,OAAsE;IAEtE,OAAO,UAAU,CACf,MAAM,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,CACnD,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACzC,SAAS,EACT,WAAW,EACX,MAAM,EACN,UAAU,GAAG,eAAe,EAM7B;IACC,OAAO,IAAI,UAAU,CACnB,UAAU,SAAS,sDAAsD;QACvE,kEAAkE;QAClE,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,GAAG;QACH,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC7C,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ClientContext } from './request.js';
|
|
2
|
+
import type { IZcap } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A memoizing probe of one collection backend's advertised feature tokens.
|
|
5
|
+
* Memoized once it produces a definitive answer: a successful read (including
|
|
6
|
+
* one that lists no features) and a definitive "endpoint absent"
|
|
7
|
+
* (`404` / `405` / `501`) both resolve to a cached feature list, so every
|
|
8
|
+
* affordance gate falls closed against a server that has no backend
|
|
9
|
+
* descriptors.
|
|
10
|
+
*
|
|
11
|
+
* A transient/ambiguous failure (network error, timeout, `401`, `429`, other
|
|
12
|
+
* `5xx`) is NOT cached: the memo is cleared so the next call re-probes, and
|
|
13
|
+
* the error is rethrown so the caller fails loud rather than silently
|
|
14
|
+
* degrading against a server that may well be capable. (A single transient
|
|
15
|
+
* failure must not poison the probe for its lifetime.)
|
|
16
|
+
*/
|
|
17
|
+
export declare class BackendFeatures {
|
|
18
|
+
private _promise?;
|
|
19
|
+
private readonly _readDescriptor;
|
|
20
|
+
/**
|
|
21
|
+
* @param readDescriptor {function} reads and parses the backend descriptor
|
|
22
|
+
* JSON (`GET .../backend`); expected to throw an error carrying an HTTP
|
|
23
|
+
* status (readable via `httpStatus`) on failure
|
|
24
|
+
*/
|
|
25
|
+
constructor(readDescriptor: () => Promise<unknown>);
|
|
26
|
+
/**
|
|
27
|
+
* The feature tokens the backend advertises, probed once and cached on a
|
|
28
|
+
* definitive answer.
|
|
29
|
+
*
|
|
30
|
+
* @returns {Promise<string[]>}
|
|
31
|
+
*/
|
|
32
|
+
get(): Promise<string[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the backend advertises the given feature token.
|
|
35
|
+
*
|
|
36
|
+
* @param feature {string} the affordance token (e.g. `conditional-writes`)
|
|
37
|
+
* @returns {Promise<boolean>}
|
|
38
|
+
*/
|
|
39
|
+
has(feature: string): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Reads and parses the backend descriptor once. On a definitive answer
|
|
42
|
+
* (success, or a `404` / `405` / `501` that means the endpoint is
|
|
43
|
+
* legitimately absent) resolves the feature list, which `get` then caches.
|
|
44
|
+
* On a transient failure, clears the memo (so the next call re-probes) and
|
|
45
|
+
* rethrows.
|
|
46
|
+
*
|
|
47
|
+
* @returns {Promise<string[]>}
|
|
48
|
+
*/
|
|
49
|
+
private _probe;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Builds the {@link BackendFeatures} probe for a collection, reading its
|
|
53
|
+
* backend descriptor with a signed `GET` through the shared request layer --
|
|
54
|
+
* the probe the core handles (Collection/Resource) hold, mirroring the one
|
|
55
|
+
* `WasTransport` builds over its own requester. A descriptor that is not
|
|
56
|
+
* readable with the bound capability surfaces as a 404 (WAS masks unauthorized
|
|
57
|
+
* reads), which the probe treats as "no features advertised" -- so every
|
|
58
|
+
* affordance gate falls closed for a capability that cannot read the
|
|
59
|
+
* descriptor.
|
|
60
|
+
*
|
|
61
|
+
* @param context {ClientContext}
|
|
62
|
+
* @param options {object}
|
|
63
|
+
* @param options.spaceId {string}
|
|
64
|
+
* @param options.collectionId {string}
|
|
65
|
+
* @param [options.capability] {IZcap} capability attached to the probe
|
|
66
|
+
* @returns {BackendFeatures}
|
|
67
|
+
*/
|
|
68
|
+
export declare function collectionBackendFeatures(context: ClientContext, { spaceId, collectionId, capability }: {
|
|
69
|
+
spaceId: string;
|
|
70
|
+
collectionId: string;
|
|
71
|
+
capability?: IZcap;
|
|
72
|
+
}): BackendFeatures;
|
|
73
|
+
//# sourceMappingURL=features.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/internal/features.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAcxC;;;;;;;;;;;;;GAaG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAwB;IAExD;;;;OAIG;gBACS,cAAc,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC;IAIlD;;;;;OAKG;IACH,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKxB;;;;;OAKG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5C;;;;;;;;OAQG;YACW,MAAM;CAqBrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,aAAa,EACtB,EACE,OAAO,EACP,YAAY,EACZ,UAAU,EACX,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC/D,eAAe,CAWjB"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026 Interop Alliance. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The shared backend-feature probe: reads a collection backend's "Collection
|
|
6
|
+
* Backend Selected" descriptor once and answers which optional affordance
|
|
7
|
+
* tokens it advertises (e.g. `conditional-writes`, `blinded-index-query`,
|
|
8
|
+
* `chunked-streams`). Both EDV write paths -- the standalone `WasTransport`
|
|
9
|
+
* and the codec-seam write orchestration -- consult this one helper, so the
|
|
10
|
+
* backend-capability decision is made in a single place instead of being
|
|
11
|
+
* probed in one path and assumed away in the other.
|
|
12
|
+
*/
|
|
13
|
+
import { httpStatus } from '../errors.js';
|
|
14
|
+
import { send } from './request.js';
|
|
15
|
+
import { readJsonData } from './content.js';
|
|
16
|
+
import { collectionBackend } from './paths.js';
|
|
17
|
+
/**
|
|
18
|
+
* HTTP statuses that mean the backend-descriptor endpoint is legitimately
|
|
19
|
+
* absent (or explicitly unimplemented), as opposed to transiently failing:
|
|
20
|
+
* `404` (no such endpoint), `405` (endpoint does not answer `GET`), `501`
|
|
21
|
+
* (not implemented). These are a definitive "this server advertises no
|
|
22
|
+
* backend features" answer and are safe to cache -- every affordance gate
|
|
23
|
+
* then falls closed against a server that has no backend descriptors. Any
|
|
24
|
+
* other failure (network error, timeout, `401`, `429`, other `5xx`) is
|
|
25
|
+
* transient/ambiguous and is re-probed instead of cached.
|
|
26
|
+
*/
|
|
27
|
+
const DESCRIPTOR_ABSENT_STATUSES = new Set([404, 405, 501]);
|
|
28
|
+
/**
|
|
29
|
+
* A memoizing probe of one collection backend's advertised feature tokens.
|
|
30
|
+
* Memoized once it produces a definitive answer: a successful read (including
|
|
31
|
+
* one that lists no features) and a definitive "endpoint absent"
|
|
32
|
+
* (`404` / `405` / `501`) both resolve to a cached feature list, so every
|
|
33
|
+
* affordance gate falls closed against a server that has no backend
|
|
34
|
+
* descriptors.
|
|
35
|
+
*
|
|
36
|
+
* A transient/ambiguous failure (network error, timeout, `401`, `429`, other
|
|
37
|
+
* `5xx`) is NOT cached: the memo is cleared so the next call re-probes, and
|
|
38
|
+
* the error is rethrown so the caller fails loud rather than silently
|
|
39
|
+
* degrading against a server that may well be capable. (A single transient
|
|
40
|
+
* failure must not poison the probe for its lifetime.)
|
|
41
|
+
*/
|
|
42
|
+
export class BackendFeatures {
|
|
43
|
+
_promise;
|
|
44
|
+
_readDescriptor;
|
|
45
|
+
/**
|
|
46
|
+
* @param readDescriptor {function} reads and parses the backend descriptor
|
|
47
|
+
* JSON (`GET .../backend`); expected to throw an error carrying an HTTP
|
|
48
|
+
* status (readable via `httpStatus`) on failure
|
|
49
|
+
*/
|
|
50
|
+
constructor(readDescriptor) {
|
|
51
|
+
this._readDescriptor = readDescriptor;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The feature tokens the backend advertises, probed once and cached on a
|
|
55
|
+
* definitive answer.
|
|
56
|
+
*
|
|
57
|
+
* @returns {Promise<string[]>}
|
|
58
|
+
*/
|
|
59
|
+
get() {
|
|
60
|
+
this._promise ??= this._probe();
|
|
61
|
+
return this._promise;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Whether the backend advertises the given feature token.
|
|
65
|
+
*
|
|
66
|
+
* @param feature {string} the affordance token (e.g. `conditional-writes`)
|
|
67
|
+
* @returns {Promise<boolean>}
|
|
68
|
+
*/
|
|
69
|
+
async has(feature) {
|
|
70
|
+
return (await this.get()).includes(feature);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Reads and parses the backend descriptor once. On a definitive answer
|
|
74
|
+
* (success, or a `404` / `405` / `501` that means the endpoint is
|
|
75
|
+
* legitimately absent) resolves the feature list, which `get` then caches.
|
|
76
|
+
* On a transient failure, clears the memo (so the next call re-probes) and
|
|
77
|
+
* rethrows.
|
|
78
|
+
*
|
|
79
|
+
* @returns {Promise<string[]>}
|
|
80
|
+
*/
|
|
81
|
+
async _probe() {
|
|
82
|
+
try {
|
|
83
|
+
const descriptor = (await this._readDescriptor());
|
|
84
|
+
return Array.isArray(descriptor?.features)
|
|
85
|
+
? descriptor.features.filter((feature) => typeof feature === 'string')
|
|
86
|
+
: [];
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
const status = httpStatus(err);
|
|
90
|
+
if (status !== undefined && DESCRIPTOR_ABSENT_STATUSES.has(status)) {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
// Transient/ambiguous: do not cache this failure -- drop the memo so the
|
|
94
|
+
// next call re-probes -- and rethrow.
|
|
95
|
+
this._promise = undefined;
|
|
96
|
+
throw err;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Builds the {@link BackendFeatures} probe for a collection, reading its
|
|
102
|
+
* backend descriptor with a signed `GET` through the shared request layer --
|
|
103
|
+
* the probe the core handles (Collection/Resource) hold, mirroring the one
|
|
104
|
+
* `WasTransport` builds over its own requester. A descriptor that is not
|
|
105
|
+
* readable with the bound capability surfaces as a 404 (WAS masks unauthorized
|
|
106
|
+
* reads), which the probe treats as "no features advertised" -- so every
|
|
107
|
+
* affordance gate falls closed for a capability that cannot read the
|
|
108
|
+
* descriptor.
|
|
109
|
+
*
|
|
110
|
+
* @param context {ClientContext}
|
|
111
|
+
* @param options {object}
|
|
112
|
+
* @param options.spaceId {string}
|
|
113
|
+
* @param options.collectionId {string}
|
|
114
|
+
* @param [options.capability] {IZcap} capability attached to the probe
|
|
115
|
+
* @returns {BackendFeatures}
|
|
116
|
+
*/
|
|
117
|
+
export function collectionBackendFeatures(context, { spaceId, collectionId, capability }) {
|
|
118
|
+
return new BackendFeatures(async () => {
|
|
119
|
+
const response = await send(context, {
|
|
120
|
+
path: collectionBackend(spaceId, collectionId),
|
|
121
|
+
method: 'GET',
|
|
122
|
+
capability
|
|
123
|
+
});
|
|
124
|
+
// Without the `read` flag `send` never resolves `null` (a 404 throws and
|
|
125
|
+
// the probe maps it to "absent"), so this null-guard is for the type only.
|
|
126
|
+
return response === null ? null : readJsonData(response);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=features.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/internal/features.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAG9C;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAA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BAAyB,CACvC,OAAsB,EACtB,EACE,OAAO,EACP,YAAY,EACZ,UAAU,EACoD;IAEhE,OAAO,IAAI,eAAe,CAAC,KAAK,IAAI,EAAE;QACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE;YACnC,IAAI,EAAE,iBAAiB,CAAC,OAAO,EAAE,YAAY,CAAC;YAC9C,MAAM,EAAE,KAAK;YACb,UAAU;SACX,CAAC,CAAA;QACF,yEAAyE;QACzE,2EAA2E;QAC3E,OAAO,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC1D,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/internal/grant.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/internal/grant.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAgCtE;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,EACtB,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,YAAY,GACzD,OAAO,CAAC,cAAc,CAAC,CAazB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,EACE,IAAI,EACJ,OAAO,EACP,UAAU,EACX,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC7D,OAAO,CAAC,cAAc,CAAC,CAMzB"}
|
package/dist/internal/grant.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseSpaceTarget, spacePath, toUrl } from './paths.js';
|
|
2
|
+
import { rootCapabilityId } from './revoke.js';
|
|
2
3
|
/**
|
|
3
4
|
* The root capability id (`urn:zcap:root:<encoded target>`) of the Space
|
|
4
5
|
* containing `target`, or `undefined` when `target` is not a URL beneath this
|
|
@@ -20,7 +21,7 @@ function spaceRootCapabilityId({ serverUrl, target }) {
|
|
|
20
21
|
return undefined;
|
|
21
22
|
}
|
|
22
23
|
const spaceUrl = toUrl({ serverUrl, path: spacePath(parsed.spaceId) });
|
|
23
|
-
return
|
|
24
|
+
return rootCapabilityId(spaceUrl);
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* Delegates a capability per `GrantOptions`, returning the signed zcap to hand
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant.js","sourceRoot":"","sources":["../../src/internal/grant.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"grant.js","sourceRoot":"","sources":["../../src/internal/grant.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAG9C;;;;;;;;;;;;;;GAcG;AACH,SAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,MAAM,EAIP;IACC,MAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAA;IACtD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,SAAS,C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
|
* `collectPages` builds on it to eagerly aggregate every page into one envelope.
|
|
12
12
|
*/
|
|
13
|
-
import type { CollectionResourcesList } from '../types.js';
|
|
13
|
+
import type { CollectionResourcesList, ResourceSummary } from '../types.js';
|
|
14
14
|
/**
|
|
15
15
|
* The first page (already read) plus the means to fetch each following page.
|
|
16
16
|
* The `fetchPage` callback fetches a single page by absolute URL, returning
|
|
@@ -58,4 +58,33 @@ export declare function walkPages(walk: PageWalk): AsyncGenerator<CollectionReso
|
|
|
58
58
|
* @returns {Promise<CollectionResourcesList>}
|
|
59
59
|
*/
|
|
60
60
|
export declare function collectPages(walk: PageWalk): Promise<CollectionResourcesList>;
|
|
61
|
+
/**
|
|
62
|
+
* The buffering list surface over a possibly-absent walk: collects every page
|
|
63
|
+
* into one envelope, mapping a `null` walk (missing/unauthorized listing) to
|
|
64
|
+
* `null`. The shared dispatch behind `Collection.list()` and
|
|
65
|
+
* `WasClient.publicListCollection()`.
|
|
66
|
+
*
|
|
67
|
+
* @param walk {PageWalk | null}
|
|
68
|
+
* @returns {Promise<CollectionResourcesList | null>}
|
|
69
|
+
*/
|
|
70
|
+
export declare function collectWalk(walk: PageWalk | null): Promise<CollectionResourcesList | null>;
|
|
71
|
+
/**
|
|
72
|
+
* The lazy page surface over a possibly-absent walk: yields each page, or
|
|
73
|
+
* nothing for a `null` walk (which an iterator cannot distinguish from an
|
|
74
|
+
* empty listing). The shared dispatch behind `Collection.listPages()` and
|
|
75
|
+
* `WasClient.publicListCollectionPages()`.
|
|
76
|
+
*
|
|
77
|
+
* @param walk {PageWalk | null}
|
|
78
|
+
* @returns {AsyncGenerator<CollectionResourcesList>}
|
|
79
|
+
*/
|
|
80
|
+
export declare function walkPagesOrEmpty(walk: PageWalk | null): AsyncGenerator<CollectionResourcesList>;
|
|
81
|
+
/**
|
|
82
|
+
* The lazy item surface: flattens a page iterator into its `ResourceSummary`
|
|
83
|
+
* entries. The shared dispatch behind `Collection.listItems()` and
|
|
84
|
+
* `WasClient.publicListCollectionItems()`.
|
|
85
|
+
*
|
|
86
|
+
* @param pages {AsyncIterable<CollectionResourcesList>}
|
|
87
|
+
* @returns {AsyncGenerator<ResourceSummary>}
|
|
88
|
+
*/
|
|
89
|
+
export declare function walkItems(pages: AsyncIterable<CollectionResourcesList>): AsyncGenerator<ResourceSummary>;
|
|
61
90
|
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE3E;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,uBAAuB,CAAA;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAA;CACpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,SAAS,EACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;CACjC,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAG3B;AAED;;;;;;;;;GASG;AACH,wBAAuB,SAAS,CAC9B,IAAI,EAAE,QAAQ,GACb,cAAc,CAAC,uBAAuB,CAAC,CAwBzC;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,uBAAuB,CAAC,CAelC;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,QAAQ,GAAG,IAAI,GACpB,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAEzC;AAED;;;;;;;;GAQG;AACH,wBAAuB,gBAAgB,CACrC,IAAI,EAAE,QAAQ,GAAG,IAAI,GACpB,cAAc,CAAC,uBAAuB,CAAC,CAIzC;AAED;;;;;;;GAOG;AACH,wBAAuB,SAAS,CAC9B,KAAK,EAAE,aAAa,CAAC,uBAAuB,CAAC,GAC5C,cAAc,CAAC,eAAe,CAAC,CAIjC"}
|
|
@@ -63,11 +63,54 @@ export async function collectPages(walk) {
|
|
|
63
63
|
const items = [];
|
|
64
64
|
for await (const page of walkPages(walk)) {
|
|
65
65
|
aggregate ??= page;
|
|
66
|
-
|
|
66
|
+
// Append one by one: spreading a page's items as call arguments would hit
|
|
67
|
+
// the engine's max-arguments ceiling on a very large page.
|
|
68
|
+
for (const item of page.items) {
|
|
69
|
+
items.push(item);
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
// `walkPages` always yields `first`, so `aggregate` is set here.
|
|
69
73
|
const result = { ...aggregate, items };
|
|
70
74
|
delete result.next;
|
|
71
75
|
return result;
|
|
72
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* The buffering list surface over a possibly-absent walk: collects every page
|
|
79
|
+
* into one envelope, mapping a `null` walk (missing/unauthorized listing) to
|
|
80
|
+
* `null`. The shared dispatch behind `Collection.list()` and
|
|
81
|
+
* `WasClient.publicListCollection()`.
|
|
82
|
+
*
|
|
83
|
+
* @param walk {PageWalk | null}
|
|
84
|
+
* @returns {Promise<CollectionResourcesList | null>}
|
|
85
|
+
*/
|
|
86
|
+
export async function collectWalk(walk) {
|
|
87
|
+
return walk === null ? null : collectPages(walk);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The lazy page surface over a possibly-absent walk: yields each page, or
|
|
91
|
+
* nothing for a `null` walk (which an iterator cannot distinguish from an
|
|
92
|
+
* empty listing). The shared dispatch behind `Collection.listPages()` and
|
|
93
|
+
* `WasClient.publicListCollectionPages()`.
|
|
94
|
+
*
|
|
95
|
+
* @param walk {PageWalk | null}
|
|
96
|
+
* @returns {AsyncGenerator<CollectionResourcesList>}
|
|
97
|
+
*/
|
|
98
|
+
export async function* walkPagesOrEmpty(walk) {
|
|
99
|
+
if (walk !== null) {
|
|
100
|
+
yield* walkPages(walk);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The lazy item surface: flattens a page iterator into its `ResourceSummary`
|
|
105
|
+
* entries. The shared dispatch behind `Collection.listItems()` and
|
|
106
|
+
* `WasClient.publicListCollectionItems()`.
|
|
107
|
+
*
|
|
108
|
+
* @param pages {AsyncIterable<CollectionResourcesList>}
|
|
109
|
+
* @returns {AsyncGenerator<ResourceSummary>}
|
|
110
|
+
*/
|
|
111
|
+
export async function* walkItems(pages) {
|
|
112
|
+
for await (const page of pages) {
|
|
113
|
+
yield* page.items;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
73
116
|
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,QAAQ,EACR,SAAS,EAIV;IACC,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAA;IACvC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;AAC/D,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,SAAS,CAC9B,IAAc;IAEd,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,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