@interop/was-client 0.61.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -3
- package/dist/WasClient.d.ts +51 -6
- package/dist/WasClient.d.ts.map +1 -1
- package/dist/WasClient.js +84 -14
- package/dist/WasClient.js.map +1 -1
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +13 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/paths.d.ts +0 -4
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +4 -9
- package/dist/internal/paths.js.map +1 -1
- package/dist/internal/request.d.ts +22 -6
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/request.js +31 -13
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/service.d.ts +61 -0
- package/dist/internal/service.d.ts.map +1 -0
- package/dist/internal/service.js +259 -0
- package/dist/internal/service.js.map +1 -0
- package/dist/types.d.ts +28 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
- [Usage](#usage)
|
|
14
14
|
- [Creating a client (signer + zcapClient)](#creating-a-client-signer--zcapclient)
|
|
15
15
|
- [Deriving a client from a secret or seed (`./identity`)](#deriving-a-client-from-a-secret-or-seed-identity)
|
|
16
|
+
- [Service discovery](#service-discovery)
|
|
16
17
|
- [The handle model](#the-handle-model)
|
|
17
18
|
- [Spaces](#spaces)
|
|
18
19
|
- [Collections](#collections)
|
|
@@ -187,6 +188,50 @@ accepted. A server that verifies both it and the older `Ed25519Signature2020`
|
|
|
187
188
|
accepts chains whose links mix the two, which is what a fleet upgrading at its
|
|
188
189
|
own pace produces.
|
|
189
190
|
|
|
191
|
+
### Service discovery
|
|
192
|
+
|
|
193
|
+
Before its first signed request, the client reads the server's service
|
|
194
|
+
description. It sends an unsigned `HEAD` to `serverUrl` and follows the
|
|
195
|
+
`Link: <...>; rel="service"` header on the response, whatever its status. Then
|
|
196
|
+
it reads the linked document with an unsigned `GET`. The spec fixes no path for
|
|
197
|
+
the document, so the client assumes none.
|
|
198
|
+
|
|
199
|
+
From the document the client selects the WAS specification version it speaks.
|
|
200
|
+
This client speaks only v0.5. It ignores `specs` keys other than
|
|
201
|
+
`https://w3id.org/pws` and entries without a `version`. If no entry names v0.5,
|
|
202
|
+
or the document is malformed, every signed request rejects with
|
|
203
|
+
`IncompatibleServerError` before anything is signed. A server whose responses
|
|
204
|
+
carry no `service` link predates v0.5 and is refused the same way. The client
|
|
205
|
+
does not fall back to the v0.4 layout.
|
|
206
|
+
|
|
207
|
+
Discovery runs once per client and is shared by every handle. A failure is not
|
|
208
|
+
memoized, so the next request retries. Unsigned public reads (`publicRead`,
|
|
209
|
+
`publicListCollection`, ...) take absolute URLs that may point at another
|
|
210
|
+
server, and do not wait on discovery.
|
|
211
|
+
|
|
212
|
+
`was.service()` returns what discovery found:
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
const info = await was.service()
|
|
216
|
+
info.version // '0.5'
|
|
217
|
+
info.entry // the chosen `PwsVersionEntry`
|
|
218
|
+
info.description // the whole `ServiceDescription`
|
|
219
|
+
info.spacesUrl // the Spaces Repository URL, or undefined
|
|
220
|
+
info.features // e.g. ['listing', 'collection-management', ...]
|
|
221
|
+
info.hasFeature('quotas') // false when the token is absent
|
|
222
|
+
|
|
223
|
+
// Discover again, e.g. before relying on an affordance a host may have dropped.
|
|
224
|
+
await was.service({ refresh: true })
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
`features` is an open token list. A token this client does not know is carried
|
|
228
|
+
along and otherwise ignored, and an absent token means unsupported. The client
|
|
229
|
+
gates no behavior on the document's `instance` member.
|
|
230
|
+
|
|
231
|
+
A caller that already holds the document (from a cache, say) can pass it as the
|
|
232
|
+
`serviceDescription` constructor option. The client then selects a version from
|
|
233
|
+
that copy without fetching, and `service({ refresh: true })` discovers afresh.
|
|
234
|
+
|
|
190
235
|
### The handle model
|
|
191
236
|
|
|
192
237
|
The client exposes the WAS containment model
|
|
@@ -220,10 +265,13 @@ one item" footgun. The next sections cover each level in turn.
|
|
|
220
265
|
|
|
221
266
|
A Space is the top-level container, created from the spaces repository. The
|
|
222
267
|
server requires a `name`; `controller` defaults to the client's own DID, and the
|
|
223
|
-
server generates the id unless you pass one.
|
|
268
|
+
server generates the id unless you pass one. `createSpace()` and `listSpaces()`
|
|
269
|
+
address the Spaces Repository URL the service description names (see
|
|
270
|
+
[Service discovery](#service-discovery)). Against a server whose description has
|
|
271
|
+
no `spaces` URL, they throw `NotSupportedError` without sending anything.
|
|
224
272
|
|
|
225
273
|
```ts
|
|
226
|
-
const space = await was.createSpace({ name: 'Home' }) // POST
|
|
274
|
+
const space = await was.createSpace({ name: 'Home' }) // POST {spacesUrl}
|
|
227
275
|
|
|
228
276
|
// Lazy handle to an existing space by id -- no I/O until a verb runs.
|
|
229
277
|
const same = was.space(space.id)
|
|
@@ -1134,7 +1182,8 @@ large Blobs to disk.)
|
|
|
1134
1182
|
`was.request(...)` mirrors ezcap's generic `request()` for hand-built calls. As
|
|
1135
1183
|
a deliberate escape hatch it returns the raw `HttpResponse` and throws raw
|
|
1136
1184
|
ezcap/ky errors -- it does not apply the null-on-404 or typed-error
|
|
1137
|
-
conveniences.
|
|
1185
|
+
conveniences. It still waits on service discovery, so against an incompatible
|
|
1186
|
+
server it rejects with `IncompatibleServerError`.
|
|
1138
1187
|
|
|
1139
1188
|
```ts
|
|
1140
1189
|
const response = await was.request({ path: `/space/${spaceId}`, method: 'GET' })
|
|
@@ -1171,6 +1220,12 @@ instead, as `{ outcome: 'not-found' }`, rather than swallowing it.
|
|
|
1171
1220
|
Spec endpoints a given server has not yet implemented surface as
|
|
1172
1221
|
`NotImplementedError` (the server's 501).
|
|
1173
1222
|
|
|
1223
|
+
`IncompatibleServerError` comes from service discovery, not from a response
|
|
1224
|
+
status. Any signed method, read methods included, throws it when the server
|
|
1225
|
+
speaks no WAS version this client understands (see
|
|
1226
|
+
[Service discovery](#service-discovery)). It carries no `status`, so a read
|
|
1227
|
+
method does not mistake it for a 404.
|
|
1228
|
+
|
|
1174
1229
|
## Contribute
|
|
1175
1230
|
|
|
1176
1231
|
PRs accepted. See [CONTRIBUTING.md](CONTRIBUTING.md) for editor setup (Prettier,
|
package/dist/WasClient.d.ts
CHANGED
|
@@ -6,16 +6,18 @@
|
|
|
6
6
|
* signer) and exposes the WAS containment model
|
|
7
7
|
* (`SpacesRepository > Space > Collection > Resource`) through lazy
|
|
8
8
|
* navigational handles. Also hosts the general delegation primitive
|
|
9
|
-
* (`grant`), capability-rebuilding (`fromCapability`),
|
|
10
|
-
* escape-hatch (`request`)
|
|
9
|
+
* (`grant`), capability-rebuilding (`fromCapability`), the signed
|
|
10
|
+
* escape-hatch (`request`), and service discovery (`service`), which every
|
|
11
|
+
* signed request waits on.
|
|
11
12
|
*/
|
|
12
13
|
import type { ZcapClient } from '@interop/ezcap';
|
|
13
14
|
import type { HttpResponse } from '@interop/http-client';
|
|
15
|
+
import type { ServiceDescription } from '@interop/storage-core';
|
|
14
16
|
import type { EncryptionProvider } from './codec.js';
|
|
15
17
|
import { Space } from './Space.js';
|
|
16
18
|
import { Collection } from './Collection.js';
|
|
17
19
|
import { Resource } from './Resource.js';
|
|
18
|
-
import type { GrantOptions, HandleOptions, IDelegatedZcap, ISigner, IZcap, Json, RequestInput, CollectionResourcesList, ResourceSummary, SpaceListing } from './types.js';
|
|
20
|
+
import type { GrantOptions, HandleOptions, IDelegatedZcap, ISigner, IZcap, Json, RequestInput, CollectionResourcesList, ResourceSummary, ServiceInfo, SpaceListing } from './types.js';
|
|
19
21
|
export declare class WasClient {
|
|
20
22
|
#private;
|
|
21
23
|
readonly serverUrl: string;
|
|
@@ -33,11 +35,18 @@ export declare class WasClient {
|
|
|
33
35
|
* does not decide *which* collections are encrypted -- that is the
|
|
34
36
|
* descriptor/override -- so a missing key for an encrypted collection fails
|
|
35
37
|
* closed rather than silently downgrading to plaintext.
|
|
38
|
+
* @param [options.serviceDescription] {ServiceDescription} a service
|
|
39
|
+
* description the caller already holds (from a cache, say). The client
|
|
40
|
+
* selects its version from this copy instead of discovering the document
|
|
41
|
+
* from `serverUrl`, and still refuses it with `IncompatibleServerError` if
|
|
42
|
+
* it names no version this client speaks. `service({ refresh: true })`
|
|
43
|
+
* discards it and discovers afresh.
|
|
36
44
|
*/
|
|
37
|
-
constructor({ serverUrl, zcapClient, encryption }: {
|
|
45
|
+
constructor({ serverUrl, zcapClient, encryption, serviceDescription }: {
|
|
38
46
|
serverUrl: string;
|
|
39
47
|
zcapClient: ZcapClient;
|
|
40
48
|
encryption?: EncryptionProvider;
|
|
49
|
+
serviceDescription?: ServiceDescription;
|
|
41
50
|
});
|
|
42
51
|
/**
|
|
43
52
|
* Convenience constructor that builds the ezcap `ZcapClient` internally from
|
|
@@ -52,12 +61,15 @@ export declare class WasClient {
|
|
|
52
61
|
* @param options.serverUrl {string}
|
|
53
62
|
* @param options.signer {ISigner}
|
|
54
63
|
* @param [options.encryption] {EncryptionProvider} see the constructor
|
|
64
|
+
* @param [options.serviceDescription] {ServiceDescription} see the
|
|
65
|
+
* constructor
|
|
55
66
|
* @returns {WasClient}
|
|
56
67
|
*/
|
|
57
|
-
static fromSigner({ serverUrl, signer, encryption }: {
|
|
68
|
+
static fromSigner({ serverUrl, signer, encryption, serviceDescription }: {
|
|
58
69
|
serverUrl: string;
|
|
59
70
|
signer: ISigner;
|
|
60
71
|
encryption?: EncryptionProvider;
|
|
72
|
+
serviceDescription?: ServiceDescription;
|
|
61
73
|
}): WasClient;
|
|
62
74
|
/**
|
|
63
75
|
* The DID controlling the wrapped signer (`signer.id` without the key
|
|
@@ -66,6 +78,34 @@ export declare class WasClient {
|
|
|
66
78
|
* @returns {string}
|
|
67
79
|
*/
|
|
68
80
|
get controllerDid(): string;
|
|
81
|
+
/**
|
|
82
|
+
* Discovers the server's service description and the WAS version this
|
|
83
|
+
* client speaks with it. Follows the `rel="service"` link on the response to
|
|
84
|
+
* an unsigned `HEAD` of `serverUrl`, then reads the linked document with an
|
|
85
|
+
* unsigned `GET`. No capability is invoked. The result is memoized for the
|
|
86
|
+
* life of the client and shared by every handle; concurrent callers share
|
|
87
|
+
* one discovery, and a failure is not memoized, so the next call retries.
|
|
88
|
+
*
|
|
89
|
+
* Every signed request waits on this discovery, so a caller rarely needs to
|
|
90
|
+
* call it first. It is the way to read the server-wide affordances:
|
|
91
|
+
* `features` (an open token list, where an absent token means unsupported)
|
|
92
|
+
* and `spacesUrl` (absent when the server has no Spaces Repository).
|
|
93
|
+
* Unsigned public reads (`publicRead`, `publicListCollection`, ...) address
|
|
94
|
+
* an absolute URL that may be on another server, and do not wait on it.
|
|
95
|
+
*
|
|
96
|
+
* @param [options] {object}
|
|
97
|
+
* @param [options.refresh] {boolean} discard the memoized result (and any
|
|
98
|
+
* constructor-supplied `serviceDescription`) and discover again, for a
|
|
99
|
+
* caller about to rely on an affordance the server may have stopped
|
|
100
|
+
* advertising
|
|
101
|
+
* @returns {Promise<ServiceInfo>}
|
|
102
|
+
* @throws {IncompatibleServerError} when the server's responses carry no
|
|
103
|
+
* `service` link (it predates v0.5), the document is malformed, or it
|
|
104
|
+
* lists no version this client speaks
|
|
105
|
+
*/
|
|
106
|
+
service(options?: {
|
|
107
|
+
refresh?: boolean;
|
|
108
|
+
}): Promise<ServiceInfo>;
|
|
69
109
|
/**
|
|
70
110
|
* Returns a lazy handle to a space by id. No I/O.
|
|
71
111
|
*
|
|
@@ -78,13 +118,15 @@ export declare class WasClient {
|
|
|
78
118
|
/**
|
|
79
119
|
* Creates a space (server-generated id unless `id` is given). `name` is
|
|
80
120
|
* optional (both in the spec and on the reference server); `controller` must
|
|
81
|
-
* match the wrapped signer's DID (which is the default).
|
|
121
|
+
* match the wrapped signer's DID (which is the default). The request goes
|
|
122
|
+
* to the Spaces Repository URL the service description names.
|
|
82
123
|
*
|
|
83
124
|
* @param desc {object}
|
|
84
125
|
* @param [desc.id] {string}
|
|
85
126
|
* @param [desc.name] {string}
|
|
86
127
|
* @param [desc.controller] {string}
|
|
87
128
|
* @returns {Promise<Space>}
|
|
129
|
+
* @throws {NotSupportedError} when the server has no Spaces Repository
|
|
88
130
|
*/
|
|
89
131
|
createSpace(desc?: {
|
|
90
132
|
id?: string;
|
|
@@ -106,6 +148,7 @@ export declare class WasClient {
|
|
|
106
148
|
* the walk has gathered the complete listing.
|
|
107
149
|
*
|
|
108
150
|
* @returns {Promise<SpaceListing>}
|
|
151
|
+
* @throws {NotSupportedError} when the server has no Spaces Repository
|
|
109
152
|
*/
|
|
110
153
|
listSpaces(): Promise<SpaceListing>;
|
|
111
154
|
/**
|
|
@@ -205,6 +248,8 @@ export declare class WasClient {
|
|
|
205
248
|
* `path` against `serverUrl`, defaults `action` to `method`, and signs via the
|
|
206
249
|
* wrapped client. Returns the raw `HttpResponse` and throws raw ky/ezcap
|
|
207
250
|
* errors -- it does not apply the null-on-404 or typed-error conveniences.
|
|
251
|
+
* Like every signed request it waits on {@link service} first, and rejects
|
|
252
|
+
* with its `IncompatibleServerError` before signing anything.
|
|
208
253
|
*
|
|
209
254
|
* @param options {RequestInput}
|
|
210
255
|
* @returns {Promise<HttpResponse>}
|
package/dist/WasClient.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WasClient.d.ts","sourceRoot":"","sources":["../src/WasClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"WasClient.d.ts","sourceRoot":"","sources":["../src/WasClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,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MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjD;;;;;;;;;;OAUG;IACG,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;CAG5D"}
|
package/dist/WasClient.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { collectionItemsUrl, parseSpaceTarget
|
|
1
|
+
import { collectionItemsUrl, parseSpaceTarget } from './internal/paths.js';
|
|
2
2
|
import { send, rawRequest, unsignedRequest } from './internal/request.js';
|
|
3
3
|
import { createdId, parseResource, readJsonData } from './internal/content.js';
|
|
4
4
|
import { buildPageWalk, collectPages, collectWalk, signedPageWalk, walkItems, walkPagesOrEmpty } from './internal/pagination.js';
|
|
5
5
|
import { delegateGrant } from './internal/grant.js';
|
|
6
6
|
import { spaceIdOf, submitRevocation } from './internal/revoke.js';
|
|
7
|
-
import {
|
|
7
|
+
import { Memo } from './internal/memo.js';
|
|
8
|
+
import { discoverService, selectServiceVersion } from './internal/service.js';
|
|
9
|
+
import { NotSupportedError, ValidationError, WasServerError } from './errors.js';
|
|
8
10
|
import { zcapClientForSigner } from './zcapClient.js';
|
|
9
11
|
import { Space } from './Space.js';
|
|
10
12
|
import { Collection } from './Collection.js';
|
|
@@ -25,11 +27,18 @@ export class WasClient {
|
|
|
25
27
|
* does not decide *which* collections are encrypted -- that is the
|
|
26
28
|
* descriptor/override -- so a missing key for an encrypted collection fails
|
|
27
29
|
* closed rather than silently downgrading to plaintext.
|
|
30
|
+
* @param [options.serviceDescription] {ServiceDescription} a service
|
|
31
|
+
* description the caller already holds (from a cache, say). The client
|
|
32
|
+
* selects its version from this copy instead of discovering the document
|
|
33
|
+
* from `serverUrl`, and still refuses it with `IncompatibleServerError` if
|
|
34
|
+
* it names no version this client speaks. `service({ refresh: true })`
|
|
35
|
+
* discards it and discovers afresh.
|
|
28
36
|
*/
|
|
29
|
-
constructor({ serverUrl, zcapClient, encryption }) {
|
|
37
|
+
constructor({ serverUrl, zcapClient, encryption, serviceDescription }) {
|
|
30
38
|
this.serverUrl = serverUrl;
|
|
31
39
|
this.zcapClient = zcapClient;
|
|
32
40
|
this.encryption = encryption;
|
|
41
|
+
this.#serviceDescription = serviceDescription;
|
|
33
42
|
}
|
|
34
43
|
/**
|
|
35
44
|
* Convenience constructor that builds the ezcap `ZcapClient` internally from
|
|
@@ -44,13 +53,16 @@ export class WasClient {
|
|
|
44
53
|
* @param options.serverUrl {string}
|
|
45
54
|
* @param options.signer {ISigner}
|
|
46
55
|
* @param [options.encryption] {EncryptionProvider} see the constructor
|
|
56
|
+
* @param [options.serviceDescription] {ServiceDescription} see the
|
|
57
|
+
* constructor
|
|
47
58
|
* @returns {WasClient}
|
|
48
59
|
*/
|
|
49
|
-
static fromSigner({ serverUrl, signer, encryption }) {
|
|
60
|
+
static fromSigner({ serverUrl, signer, encryption, serviceDescription }) {
|
|
50
61
|
return new WasClient({
|
|
51
62
|
serverUrl,
|
|
52
63
|
zcapClient: zcapClientForSigner({ signer }),
|
|
53
|
-
encryption
|
|
64
|
+
encryption,
|
|
65
|
+
serviceDescription
|
|
54
66
|
});
|
|
55
67
|
}
|
|
56
68
|
/**
|
|
@@ -66,6 +78,58 @@ export class WasClient {
|
|
|
66
78
|
}
|
|
67
79
|
return signer.id.split('#')[0];
|
|
68
80
|
}
|
|
81
|
+
#serviceDescription;
|
|
82
|
+
#service = new Memo(async () => this.#serviceDescription === undefined
|
|
83
|
+
? discoverService({ url: this.serverUrl })
|
|
84
|
+
: selectServiceVersion(this.#serviceDescription));
|
|
85
|
+
/**
|
|
86
|
+
* Discovers the server's service description and the WAS version this
|
|
87
|
+
* client speaks with it. Follows the `rel="service"` link on the response to
|
|
88
|
+
* an unsigned `HEAD` of `serverUrl`, then reads the linked document with an
|
|
89
|
+
* unsigned `GET`. No capability is invoked. The result is memoized for the
|
|
90
|
+
* life of the client and shared by every handle; concurrent callers share
|
|
91
|
+
* one discovery, and a failure is not memoized, so the next call retries.
|
|
92
|
+
*
|
|
93
|
+
* Every signed request waits on this discovery, so a caller rarely needs to
|
|
94
|
+
* call it first. It is the way to read the server-wide affordances:
|
|
95
|
+
* `features` (an open token list, where an absent token means unsupported)
|
|
96
|
+
* and `spacesUrl` (absent when the server has no Spaces Repository).
|
|
97
|
+
* Unsigned public reads (`publicRead`, `publicListCollection`, ...) address
|
|
98
|
+
* an absolute URL that may be on another server, and do not wait on it.
|
|
99
|
+
*
|
|
100
|
+
* @param [options] {object}
|
|
101
|
+
* @param [options.refresh] {boolean} discard the memoized result (and any
|
|
102
|
+
* constructor-supplied `serviceDescription`) and discover again, for a
|
|
103
|
+
* caller about to rely on an affordance the server may have stopped
|
|
104
|
+
* advertising
|
|
105
|
+
* @returns {Promise<ServiceInfo>}
|
|
106
|
+
* @throws {IncompatibleServerError} when the server's responses carry no
|
|
107
|
+
* `service` link (it predates v0.5), the document is malformed, or it
|
|
108
|
+
* lists no version this client speaks
|
|
109
|
+
*/
|
|
110
|
+
async service(options = {}) {
|
|
111
|
+
if (options.refresh) {
|
|
112
|
+
this.#serviceDescription = undefined;
|
|
113
|
+
this.#service.reset();
|
|
114
|
+
}
|
|
115
|
+
return this.#service.get();
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The Spaces Repository URL from the service description.
|
|
119
|
+
*
|
|
120
|
+
* @returns {Promise<string>}
|
|
121
|
+
* @throws {NotSupportedError} when the server does not implement the
|
|
122
|
+
* Spaces Repository
|
|
123
|
+
*/
|
|
124
|
+
async #spacesUrl() {
|
|
125
|
+
const { spacesUrl, version } = await this.service();
|
|
126
|
+
if (spacesUrl === undefined) {
|
|
127
|
+
throw new NotSupportedError(`The server at "${this.serverUrl}" does not implement the Spaces ` +
|
|
128
|
+
`Repository: its WAS ${version} service description entry has no ` +
|
|
129
|
+
'`spaces` URL.');
|
|
130
|
+
}
|
|
131
|
+
return spacesUrl;
|
|
132
|
+
}
|
|
69
133
|
#cachedContext;
|
|
70
134
|
get #context() {
|
|
71
135
|
// `serverUrl`, `zcapClient` (and thus `controllerDid`), and `encryption`
|
|
@@ -77,7 +141,8 @@ export class WasClient {
|
|
|
77
141
|
serverUrl: this.serverUrl,
|
|
78
142
|
zcapClient: this.zcapClient,
|
|
79
143
|
controllerDid: this.controllerDid,
|
|
80
|
-
encryption: this.encryption
|
|
144
|
+
encryption: this.encryption,
|
|
145
|
+
service: () => this.service()
|
|
81
146
|
};
|
|
82
147
|
}
|
|
83
148
|
return this.#cachedContext;
|
|
@@ -100,13 +165,15 @@ export class WasClient {
|
|
|
100
165
|
/**
|
|
101
166
|
* Creates a space (server-generated id unless `id` is given). `name` is
|
|
102
167
|
* optional (both in the spec and on the reference server); `controller` must
|
|
103
|
-
* match the wrapped signer's DID (which is the default).
|
|
168
|
+
* match the wrapped signer's DID (which is the default). The request goes
|
|
169
|
+
* to the Spaces Repository URL the service description names.
|
|
104
170
|
*
|
|
105
171
|
* @param desc {object}
|
|
106
172
|
* @param [desc.id] {string}
|
|
107
173
|
* @param [desc.name] {string}
|
|
108
174
|
* @param [desc.controller] {string}
|
|
109
175
|
* @returns {Promise<Space>}
|
|
176
|
+
* @throws {NotSupportedError} when the server has no Spaces Repository
|
|
110
177
|
*/
|
|
111
178
|
async createSpace(desc = {}) {
|
|
112
179
|
const controller = desc.controller ?? this.controllerDid;
|
|
@@ -116,7 +183,7 @@ export class WasClient {
|
|
|
116
183
|
...(desc.name !== undefined && { name: desc.name })
|
|
117
184
|
};
|
|
118
185
|
const response = await send(this.#context, {
|
|
119
|
-
|
|
186
|
+
url: await this.#spacesUrl(),
|
|
120
187
|
method: 'POST',
|
|
121
188
|
json: body
|
|
122
189
|
});
|
|
@@ -137,19 +204,20 @@ export class WasClient {
|
|
|
137
204
|
* the walk has gathered the complete listing.
|
|
138
205
|
*
|
|
139
206
|
* @returns {Promise<SpaceListing>}
|
|
207
|
+
* @throws {NotSupportedError} when the server has no Spaces Repository
|
|
140
208
|
*/
|
|
141
209
|
async listSpaces() {
|
|
210
|
+
const spacesUrl = await this.#spacesUrl();
|
|
142
211
|
const walk = await signedPageWalk(this.#context, {
|
|
143
|
-
firstUrl:
|
|
212
|
+
firstUrl: spacesUrl
|
|
144
213
|
});
|
|
145
214
|
// The first page always carries the listing body (an unauthorized caller
|
|
146
215
|
// still gets an empty `items` list, not an error), so a `null` walk is a
|
|
147
|
-
// server fault -- a 404
|
|
148
|
-
//
|
|
149
|
-
//
|
|
216
|
+
// server fault -- a 404 at the advertised repository URL, or a 2xx whose
|
|
217
|
+
// body did not parse as JSON. Report it as one, rather than as a
|
|
218
|
+
// `TypeError` from destructuring `null`.
|
|
150
219
|
if (walk === null) {
|
|
151
|
-
throw new WasServerError(`The space listing at "${
|
|
152
|
-
'body. Check that `serverUrl` names the WAS repository root.');
|
|
220
|
+
throw new WasServerError(`The space listing at "${spacesUrl}" answered with no JSON body.`);
|
|
153
221
|
}
|
|
154
222
|
const listing = await collectPages(walk);
|
|
155
223
|
// A paginating server omits `totalItems` on truncated pages; the walk has
|
|
@@ -341,6 +409,8 @@ export class WasClient {
|
|
|
341
409
|
* `path` against `serverUrl`, defaults `action` to `method`, and signs via the
|
|
342
410
|
* wrapped client. Returns the raw `HttpResponse` and throws raw ky/ezcap
|
|
343
411
|
* errors -- it does not apply the null-on-404 or typed-error conveniences.
|
|
412
|
+
* Like every signed request it waits on {@link service} first, and rejects
|
|
413
|
+
* with its `IncompatibleServerError` before signing anything.
|
|
344
414
|
*
|
|
345
415
|
* @param options {RequestInput}
|
|
346
416
|
* @returns {Promise<HttpResponse>}
|
package/dist/WasClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WasClient.js","sourceRoot":"","sources":["../src/WasClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WasClient.js","sourceRoot":"","sources":["../src/WasClient.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE1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;IACH,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,OAAO,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,MAAM,CAAC,IAAoB;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7B,OAAO,gBAAgB,CAAC,OAAO,EAAE;YAC/B,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC;YACjC,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,OAAO,CAAC,OAAqB;QACjC,OAAO,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;CACF"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -96,6 +96,19 @@ export declare class NotImplementedError extends WasError {
|
|
|
96
96
|
export declare class NotSupportedError extends WasError {
|
|
97
97
|
name: string;
|
|
98
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* The server speaks no version of the WAS specification this client
|
|
101
|
+
* understands, so the client stops rather than guess a URL layout. Raised by
|
|
102
|
+
* service discovery before the first signed request when the server's
|
|
103
|
+
* responses carry no `rel="service"` link (a server that predates v0.5), when
|
|
104
|
+
* the service description is not valid JSON or lacks `url` or `specs`, or
|
|
105
|
+
* when no version entry under the WAS specification identifier names a
|
|
106
|
+
* version this client understands. Not a transient failure: retrying against
|
|
107
|
+
* the same server gives the same answer.
|
|
108
|
+
*/
|
|
109
|
+
export declare class IncompatibleServerError extends WasError {
|
|
110
|
+
name: string;
|
|
111
|
+
}
|
|
99
112
|
/**
|
|
100
113
|
* A client-supplied id or backend conflicts with existing state (HTTP 409):
|
|
101
114
|
* `id-conflict` (the id already exists), `reserved-id` (the id collides with a
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","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AAO,GAAE,eAAoB;CAO1D;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IACjC,IAAI,SAAmB;CACjC;AAED;;;;;;;;;;;;;GAaG;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;AAkED;;;;;;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
|
@@ -99,6 +99,19 @@ export class NotImplementedError extends WasError {
|
|
|
99
99
|
export class NotSupportedError extends WasError {
|
|
100
100
|
name = 'NotSupportedError';
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* The server speaks no version of the WAS specification this client
|
|
104
|
+
* understands, so the client stops rather than guess a URL layout. Raised by
|
|
105
|
+
* service discovery before the first signed request when the server's
|
|
106
|
+
* responses carry no `rel="service"` link (a server that predates v0.5), when
|
|
107
|
+
* the service description is not valid JSON or lacks `url` or `specs`, or
|
|
108
|
+
* when no version entry under the WAS specification identifier names a
|
|
109
|
+
* version this client understands. Not a transient failure: retrying against
|
|
110
|
+
* the same server gives the same answer.
|
|
111
|
+
*/
|
|
112
|
+
export class IncompatibleServerError extends WasError {
|
|
113
|
+
name = 'IncompatibleServerError';
|
|
114
|
+
}
|
|
102
115
|
/**
|
|
103
116
|
* A client-supplied id or backend conflicts with existing state (HTTP 409):
|
|
104
117
|
* `id-conflict` (the id already exists), `reserved-id` (the id collides with a
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export { parseSpaceTarget } from './internal/paths.js';
|
|
|
14
14
|
export type { ParsedSpacePath } from './internal/paths.js';
|
|
15
15
|
export { readEtag, writeHeaders } from './internal/conditional.js';
|
|
16
16
|
export type { WritePrecondition } from './internal/conditional.js';
|
|
17
|
-
export { WasError, NotFoundError, CapabilityRevokedError, CapabilityExpiredError, ValidationError, AlreadyRevokedError, AuthRequiredError, NotImplementedError, NotSupportedError, ConflictError, PreconditionFailedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, EncryptOnlyCipherError, KeyUnwrapError, IntegrityError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, mapError } from './errors.js';
|
|
17
|
+
export { WasError, NotFoundError, CapabilityRevokedError, CapabilityExpiredError, ValidationError, AlreadyRevokedError, AuthRequiredError, NotImplementedError, NotSupportedError, IncompatibleServerError, ConflictError, PreconditionFailedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, EncryptOnlyCipherError, KeyUnwrapError, IntegrityError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, mapError } from './errors.js';
|
|
18
18
|
export type { FeatureProbe } from './internal/features.js';
|
|
19
19
|
export { isChunkedWrite } from './codec.js';
|
|
20
20
|
export type { ResourceCodec, EncryptionProvider, ChunkedWrite, CodecRequestContext, CodecWrite, MetaReadSlot, MetaWriteSlot, EncodedWrite, ResponseLike, BlindedQuery, CodecIndexing, IndexDeclaration, IndexSchema } from './codec.js';
|
|
21
|
-
export type { Json, JsonPrimitive, JsonObject, JsonArray, ResourceData, Action, ActionInput, ChangeDocument, ChangesCheckpoint, ChangesPage, SpaceMetadata, CollectionWritableFields, CollectionEncryption, CollectionEncryptionEpoch, CollectionEncryptionRecipient, CollectionEncryptionHmac, EncryptionWithHmac, CollectionSummary, CollectionsList, SpaceSummary, SpaceListing, ResourceSummary, CollectionResourcesList, ResourceMetadata, ResourceMetadataCustom, ResourceMetadataCustomInput, CollectionMetadata, AddResult, FindPage, ImportStats, PolicyDocument, LinkSet, LinkSetEntry, HandleOptions, EncryptionOverride, BackendReference, BackendDescriptor, BackendRegistration, BackendConnectionInput, BackendConnectionPublic, StorageLimit, CollectionUsage, BackendUsage, SpaceQuotaReport, GrantOptions, RequestInput, IZcap, IDelegatedZcap, ISigner } from './types.js';
|
|
21
|
+
export type { Json, JsonPrimitive, JsonObject, JsonArray, ResourceData, Action, ActionInput, ChangeDocument, ChangesCheckpoint, ChangesPage, SpaceMetadata, CollectionWritableFields, CollectionEncryption, CollectionEncryptionEpoch, CollectionEncryptionRecipient, CollectionEncryptionHmac, EncryptionWithHmac, CollectionSummary, CollectionsList, SpaceSummary, SpaceListing, ResourceSummary, CollectionResourcesList, ResourceMetadata, ResourceMetadataCustom, ResourceMetadataCustomInput, CollectionMetadata, AddResult, FindPage, ImportStats, PolicyDocument, LinkSet, LinkSetEntry, HandleOptions, EncryptionOverride, BackendReference, BackendDescriptor, BackendRegistration, BackendConnectionInput, BackendConnectionPublic, StorageLimit, CollectionUsage, BackendUsage, SpaceQuotaReport, ServiceDescription, ServiceDescriptionVersionEntry, PwsVersionEntry, ServiceInfo, GrantOptions, RequestInput, IZcap, IDelegatedZcap, ISigner } from './types.js';
|
|
22
22
|
//# 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;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAA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E,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,WAAW,EACZ,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,IAAI,EACJ,aAAa,EACb,UAAU,EACV,SAAS,EACT,YAAY,EACZ,MAAM,EACN,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,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,kBAAkB,EAClB,8BAA8B,EAC9B,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,cAAc,EACd,OAAO,EACR,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,6 @@ export { Resource } from './Resource.js';
|
|
|
12
12
|
export { zcapClientForSigner } from './zcapClient.js';
|
|
13
13
|
export { parseSpaceTarget } from './internal/paths.js';
|
|
14
14
|
export { readEtag, writeHeaders } from './internal/conditional.js';
|
|
15
|
-
export { WasError, NotFoundError, CapabilityRevokedError, CapabilityExpiredError, ValidationError, AlreadyRevokedError, AuthRequiredError, NotImplementedError, NotSupportedError, ConflictError, PreconditionFailedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, EncryptOnlyCipherError, KeyUnwrapError, IntegrityError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, mapError } from './errors.js';
|
|
15
|
+
export { WasError, NotFoundError, CapabilityRevokedError, CapabilityExpiredError, ValidationError, AlreadyRevokedError, AuthRequiredError, NotImplementedError, NotSupportedError, IncompatibleServerError, ConflictError, PreconditionFailedError, PayloadTooLargeError, QuotaExceededError, EncryptionError, EncryptOnlyCipherError, KeyUnwrapError, IntegrityError, WasSyncAuthError, WasSyncConflictError, WasSyncNotFoundError, WasServerError, mapError } from './errors.js';
|
|
16
16
|
export { isChunkedWrite } from './codec.js';
|
|
17
17
|
//# 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;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGlE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACT,MAAM,aAAa,CAAA;AAIpB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,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;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGlE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACT,MAAM,aAAa,CAAA;AAIpB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/internal/paths.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `/spaces/` -- the SpacesRepository (create / list spaces).
|
|
3
|
-
*/
|
|
4
|
-
export declare function spacesRoot(): string;
|
|
5
1
|
/**
|
|
6
2
|
* `/space/:spaceId/` -- the Space container in canonical form: the target a
|
|
7
3
|
* Space root capability names, the URL whose `GET` lists the Space's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/internal/paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/internal/paths.ts"],"names":[],"mappings":"AA8GA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAE7E;AAeD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;GAGG;AACH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