@interop/was-client 0.2.0 → 0.4.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 +245 -40
- package/dist/Collection.d.ts +9 -3
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +12 -1
- package/dist/Collection.js.map +1 -1
- package/dist/Resource.d.ts +47 -1
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +71 -1
- package/dist/Resource.js.map +1 -1
- package/dist/Space.d.ts +25 -3
- package/dist/Space.d.ts.map +1 -1
- package/dist/Space.js +46 -3
- package/dist/Space.js.map +1 -1
- package/dist/WasClient.d.ts +30 -4
- package/dist/WasClient.d.ts.map +1 -1
- package/dist/WasClient.js +44 -4
- package/dist/WasClient.js.map +1 -1
- package/dist/errors.d.ts +34 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +101 -3
- 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 +13 -0
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +19 -0
- package/dist/internal/paths.js.map +1 -1
- package/dist/internal/request.d.ts +20 -0
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/request.js +41 -0
- package/dist/internal/request.js.map +1 -1
- package/dist/types.d.ts +11 -131
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -6
package/dist/Resource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resource.js","sourceRoot":"","sources":["../src/Resource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"Resource.js","sourceRoot":"","sources":["../src/Resource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;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,IAAI,CAAC,SAAS,EAAE,CAAA;QACrC,OAAO,MAAM,EAAE,IAAI,KAAK,eAAe,CAAA;IACzC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACxB,IAAI,EAAE,IAAI,CAAC,WAAW;YACtB,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,UAAU,EAAE,IAAI;SACjB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/dist/Space.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClientContext } from './internal/request.js';
|
|
2
2
|
import { Collection } from './Collection.js';
|
|
3
|
-
import type { BackendReference,
|
|
3
|
+
import type { BackendDescriptor, BackendReference, CollectionsList, GrantOptions, HandleOptions, IDelegatedZcap, IZcap, ImportStats, LinkSet, PolicyDocument, SpaceDescription, SpaceQuotaReport } from './types.js';
|
|
4
4
|
export declare class Space {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
private readonly _context;
|
|
@@ -71,9 +71,25 @@ export declare class Space {
|
|
|
71
71
|
* Lists the collections in the space. Returns `null` if the space is missing
|
|
72
72
|
* or not visible to you (404 conflation caveat).
|
|
73
73
|
*
|
|
74
|
-
* @returns {Promise<
|
|
74
|
+
* @returns {Promise<CollectionsList | null>}
|
|
75
75
|
*/
|
|
76
|
-
collections(): Promise<
|
|
76
|
+
collections(): Promise<CollectionsList | null>;
|
|
77
|
+
/**
|
|
78
|
+
* Lists the storage backends available within this space. Returns `null` if
|
|
79
|
+
* the space is missing or not visible to you (404 conflation caveat). A
|
|
80
|
+
* server without backend support surfaces its 501 as `NotImplementedError`.
|
|
81
|
+
*
|
|
82
|
+
* @returns {Promise<BackendDescriptor[] | null>}
|
|
83
|
+
*/
|
|
84
|
+
backends(): Promise<BackendDescriptor[] | null>;
|
|
85
|
+
/**
|
|
86
|
+
* Reads the space's storage quota report, grouped by backend. Returns `null`
|
|
87
|
+
* if the space is missing or not visible to you (404 conflation caveat). A
|
|
88
|
+
* server without quota support surfaces its 501 as `NotImplementedError`.
|
|
89
|
+
*
|
|
90
|
+
* @returns {Promise<SpaceQuotaReport | null>}
|
|
91
|
+
*/
|
|
92
|
+
quotas(): Promise<SpaceQuotaReport | null>;
|
|
77
93
|
/**
|
|
78
94
|
* Delegates access to this space. Prefills the grant `target` with this
|
|
79
95
|
* space's URL (and the bound `capability`, if any, for re-delegation).
|
|
@@ -111,6 +127,12 @@ export declare class Space {
|
|
|
111
127
|
* @returns {Promise<void>}
|
|
112
128
|
*/
|
|
113
129
|
setPolicy(policy: PolicyDocument): Promise<void>;
|
|
130
|
+
/**
|
|
131
|
+
* Returns `true` when this space's policy is `PublicCanRead`.
|
|
132
|
+
*
|
|
133
|
+
* @returns {Promise<boolean>}
|
|
134
|
+
*/
|
|
135
|
+
isPublic(): Promise<boolean>;
|
|
114
136
|
/**
|
|
115
137
|
* Makes the whole space world-readable: every collection and resource under
|
|
116
138
|
* it becomes readable without authorization (unless overridden by a more
|
package/dist/Space.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Space.d.ts","sourceRoot":"","sources":["../src/Space.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Space.d.ts","sourceRoot":"","sources":["../src/Space.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAEhB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,cAAc,EACd,KAAK,EACL,WAAW,EACX,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,YAAY,CAAA;AAEnB,qBAAa,KAAK;IAChB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IAEnB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U,CAAC;IAanC;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAe1D;;;;;;;OAOG;IACG,SAAS,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAUjD;;;;;OAKG;IACG,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAStD;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAKlC;;;;;;OAMG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC;;;;;OAKG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IASlC;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CASzC"}
|
package/dist/Space.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* (`collection`/`createCollection`/`collections`), delegation (`grant`), and
|
|
8
8
|
* whole-space `export`/`import`.
|
|
9
9
|
*/
|
|
10
|
-
import { spacePath, spaceItems, spaceCollections, spaceExport, spaceImport, spacePolicy, spaceLinkset, toUrl } from './internal/paths.js';
|
|
10
|
+
import { spacePath, spaceItems, spaceCollections, spaceExport, spaceImport, spaceBackends, spaceQuotas, spacePolicy, spaceLinkset, toUrl } from './internal/paths.js';
|
|
11
11
|
import { assertNotReserved } from './internal/reserved.js';
|
|
12
12
|
import { delegateGrant } from './internal/grant.js';
|
|
13
13
|
import { send } from './internal/request.js';
|
|
@@ -68,7 +68,9 @@ export class Space {
|
|
|
68
68
|
id: this.id,
|
|
69
69
|
type: current?.type ?? ['Space'],
|
|
70
70
|
...(name !== undefined ? { name } : {}),
|
|
71
|
-
controller
|
|
71
|
+
// `controller` is a user-supplied DID string; assert it as the branded
|
|
72
|
+
// `IDID` the wire type now uses (the server validates the DID form).
|
|
73
|
+
controller: controller
|
|
72
74
|
};
|
|
73
75
|
}
|
|
74
76
|
/**
|
|
@@ -138,7 +140,7 @@ export class Space {
|
|
|
138
140
|
* Lists the collections in the space. Returns `null` if the space is missing
|
|
139
141
|
* or not visible to you (404 conflation caveat).
|
|
140
142
|
*
|
|
141
|
-
* @returns {Promise<
|
|
143
|
+
* @returns {Promise<CollectionsList | null>}
|
|
142
144
|
*/
|
|
143
145
|
async collections() {
|
|
144
146
|
const response = await send(this._context, {
|
|
@@ -149,6 +151,38 @@ export class Space {
|
|
|
149
151
|
});
|
|
150
152
|
return response === null ? null : response.data;
|
|
151
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Lists the storage backends available within this space. Returns `null` if
|
|
156
|
+
* the space is missing or not visible to you (404 conflation caveat). A
|
|
157
|
+
* server without backend support surfaces its 501 as `NotImplementedError`.
|
|
158
|
+
*
|
|
159
|
+
* @returns {Promise<BackendDescriptor[] | null>}
|
|
160
|
+
*/
|
|
161
|
+
async backends() {
|
|
162
|
+
const response = await send(this._context, {
|
|
163
|
+
path: spaceBackends(this.id),
|
|
164
|
+
method: 'GET',
|
|
165
|
+
capability: this._capability,
|
|
166
|
+
read: true
|
|
167
|
+
});
|
|
168
|
+
return response === null ? null : response.data;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Reads the space's storage quota report, grouped by backend. Returns `null`
|
|
172
|
+
* if the space is missing or not visible to you (404 conflation caveat). A
|
|
173
|
+
* server without quota support surfaces its 501 as `NotImplementedError`.
|
|
174
|
+
*
|
|
175
|
+
* @returns {Promise<SpaceQuotaReport | null>}
|
|
176
|
+
*/
|
|
177
|
+
async quotas() {
|
|
178
|
+
const response = await send(this._context, {
|
|
179
|
+
path: spaceQuotas(this.id),
|
|
180
|
+
method: 'GET',
|
|
181
|
+
capability: this._capability,
|
|
182
|
+
read: true
|
|
183
|
+
});
|
|
184
|
+
return response === null ? null : response.data;
|
|
185
|
+
}
|
|
152
186
|
/**
|
|
153
187
|
* Delegates access to this space. Prefills the grant `target` with this
|
|
154
188
|
* space's URL (and the bound `capability`, if any, for re-delegation).
|
|
@@ -229,6 +263,15 @@ export class Space {
|
|
|
229
263
|
json: policy
|
|
230
264
|
});
|
|
231
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* Returns `true` when this space's policy is `PublicCanRead`.
|
|
268
|
+
*
|
|
269
|
+
* @returns {Promise<boolean>}
|
|
270
|
+
*/
|
|
271
|
+
async isPublic() {
|
|
272
|
+
const policy = await this.getPolicy();
|
|
273
|
+
return policy?.type === 'PublicCanRead';
|
|
274
|
+
}
|
|
232
275
|
/**
|
|
233
276
|
* Makes the whole space world-readable: every collection and resource under
|
|
234
277
|
* it becomes readable without authorization (unless overridden by a more
|
package/dist/Space.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Space.js","sourceRoot":"","sources":["../src/Space.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AACH,OAAO,EACL,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,KAAK,EACN,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"Space.js","sourceRoot":"","sources":["../src/Space.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AACH,OAAO,EACL,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,KAAK,EACN,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CA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;SACb,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ;QACZ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAA;QACrC,OAAO,MAAM,EAAE,IAAI,KAAK,eAAe,CAAA;IACzC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAA;IACjD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACxB,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,UAAU,EAAE,IAAI;SACjB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACzC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;QACF,OAAO,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE,QAAQ,CAAC,IAAgB,CAAA;IAC9D,CAAC;CACF"}
|
package/dist/WasClient.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type { HttpResponse } from '@interop/http-client';
|
|
|
14
14
|
import { Space } from './Space.js';
|
|
15
15
|
import { Collection } from './Collection.js';
|
|
16
16
|
import { Resource } from './Resource.js';
|
|
17
|
-
import type { GrantOptions, HandleOptions, IDelegatedZcap, ISigner, IZcap, RequestInput, SpaceListing } from './types.js';
|
|
17
|
+
import type { GrantOptions, HandleOptions, IDelegatedZcap, ISigner, IZcap, Json, RequestInput, CollectionResourcesList, SpaceListing } from './types.js';
|
|
18
18
|
export declare class WasClient {
|
|
19
19
|
readonly serverUrl: string;
|
|
20
20
|
readonly zcapClient: ZcapClient;
|
|
@@ -59,9 +59,9 @@ export declare class WasClient {
|
|
|
59
59
|
*/
|
|
60
60
|
space(spaceId: string, options?: HandleOptions): Space;
|
|
61
61
|
/**
|
|
62
|
-
* Creates a space (server-generated id unless `id` is given).
|
|
63
|
-
*
|
|
64
|
-
* (which is the default).
|
|
62
|
+
* Creates a space (server-generated id unless `id` is given). `name` is
|
|
63
|
+
* optional (both in the spec and on the reference server); `controller` must
|
|
64
|
+
* match the wrapped signer's DID (which is the default).
|
|
65
65
|
*
|
|
66
66
|
* @param desc {object}
|
|
67
67
|
* @param [desc.id] {string}
|
|
@@ -82,6 +82,32 @@ export declare class WasClient {
|
|
|
82
82
|
* @returns {Promise<SpaceListing>}
|
|
83
83
|
*/
|
|
84
84
|
listSpaces(): Promise<SpaceListing>;
|
|
85
|
+
/**
|
|
86
|
+
* Reads a public (`PublicCanRead`) resource by its URL with no authorization
|
|
87
|
+
* -- an unsigned `GET`, for consuming a shared public link. Auto-parses JSON
|
|
88
|
+
* to an object and returns binary as a `Blob`. Returns `null` if the resource
|
|
89
|
+
* is missing or not publicly readable (404 conflation caveat).
|
|
90
|
+
*
|
|
91
|
+
* @param options {object}
|
|
92
|
+
* @param options.resourceUrl {string} the absolute resource URL
|
|
93
|
+
* @returns {Promise<Json | Blob | null>}
|
|
94
|
+
*/
|
|
95
|
+
publicRead({ resourceUrl }: {
|
|
96
|
+
resourceUrl: string;
|
|
97
|
+
}): Promise<Json | Blob | null>;
|
|
98
|
+
/**
|
|
99
|
+
* Lists a public (`PublicCanRead`) collection by its URL with no authorization
|
|
100
|
+
* -- an unsigned `GET` -- e.g. to browse a blog published as a public-read
|
|
101
|
+
* collection. Returns `null` if the collection is missing or not publicly
|
|
102
|
+
* readable (404 conflation caveat).
|
|
103
|
+
*
|
|
104
|
+
* @param options {object}
|
|
105
|
+
* @param options.collectionUrl {string} the absolute collection URL
|
|
106
|
+
* @returns {Promise<CollectionResourcesList | null>}
|
|
107
|
+
*/
|
|
108
|
+
publicListCollection({ collectionUrl }: {
|
|
109
|
+
collectionUrl: string;
|
|
110
|
+
}): Promise<CollectionResourcesList | null>;
|
|
85
111
|
/**
|
|
86
112
|
* Rebuilds an access handle from a received capability, returning a handle at
|
|
87
113
|
* the depth implied by the capability's `invocationTarget` (space /
|
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;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"WasClient.d.ts","sourceRoot":"","sources":["../src/WasClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAOxD,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,KAAK,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,OAAO,EACP,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,uBAAuB,EACvB,YAAY,EACb,MAAM,YAAY,CAAA;AAEnB,qBAAa,SAAS;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAE/B;;;;;OAKG;gB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OAAO,CAAC,YAAY,CAAC;CAG5D"}
|
package/dist/WasClient.js
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
import { ZcapClient } from '@interop/ezcap';
|
|
13
13
|
import { Ed25519Signature2020 } from '@interop/ed25519-signature';
|
|
14
14
|
import { spacesRoot } from './internal/paths.js';
|
|
15
|
-
import { send, rawRequest } from './internal/request.js';
|
|
15
|
+
import { send, rawRequest, unsignedRequest } from './internal/request.js';
|
|
16
|
+
import { parseResource } from './internal/content.js';
|
|
16
17
|
import { delegateGrant } from './internal/grant.js';
|
|
17
18
|
import { ValidationError } from './errors.js';
|
|
18
19
|
import { Space } from './Space.js';
|
|
@@ -84,9 +85,9 @@ export class WasClient {
|
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
87
|
-
* Creates a space (server-generated id unless `id` is given).
|
|
88
|
-
*
|
|
89
|
-
* (which is the default).
|
|
88
|
+
* Creates a space (server-generated id unless `id` is given). `name` is
|
|
89
|
+
* optional (both in the spec and on the reference server); `controller` must
|
|
90
|
+
* match the wrapped signer's DID (which is the default).
|
|
90
91
|
*
|
|
91
92
|
* @param desc {object}
|
|
92
93
|
* @param [desc.id] {string}
|
|
@@ -125,6 +126,45 @@ export class WasClient {
|
|
|
125
126
|
});
|
|
126
127
|
return response.data;
|
|
127
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Reads a public (`PublicCanRead`) resource by its URL with no authorization
|
|
131
|
+
* -- an unsigned `GET`, for consuming a shared public link. Auto-parses JSON
|
|
132
|
+
* to an object and returns binary as a `Blob`. Returns `null` if the resource
|
|
133
|
+
* is missing or not publicly readable (404 conflation caveat).
|
|
134
|
+
*
|
|
135
|
+
* @param options {object}
|
|
136
|
+
* @param options.resourceUrl {string} the absolute resource URL
|
|
137
|
+
* @returns {Promise<Json | Blob | null>}
|
|
138
|
+
*/
|
|
139
|
+
async publicRead({ resourceUrl }) {
|
|
140
|
+
const response = await unsignedRequest({
|
|
141
|
+
url: resourceUrl,
|
|
142
|
+
method: 'GET',
|
|
143
|
+
read: true
|
|
144
|
+
});
|
|
145
|
+
return parseResource(response);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Lists a public (`PublicCanRead`) collection by its URL with no authorization
|
|
149
|
+
* -- an unsigned `GET` -- e.g. to browse a blog published as a public-read
|
|
150
|
+
* collection. Returns `null` if the collection is missing or not publicly
|
|
151
|
+
* readable (404 conflation caveat).
|
|
152
|
+
*
|
|
153
|
+
* @param options {object}
|
|
154
|
+
* @param options.collectionUrl {string} the absolute collection URL
|
|
155
|
+
* @returns {Promise<CollectionResourcesList | null>}
|
|
156
|
+
*/
|
|
157
|
+
async publicListCollection({ collectionUrl }) {
|
|
158
|
+
// The collection listing endpoint is the trailing-slash items URL.
|
|
159
|
+
const url = collectionUrl.endsWith('/')
|
|
160
|
+
? collectionUrl
|
|
161
|
+
: `${collectionUrl}/`;
|
|
162
|
+
const response = await unsignedRequest({ url, method: 'GET', read: true });
|
|
163
|
+
if (response === null) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
return (response.data ?? (await response.json()));
|
|
167
|
+
}
|
|
128
168
|
/**
|
|
129
169
|
* Rebuilds an access handle from a received capability, returning a handle at
|
|
130
170
|
* the depth implied by the capability's `invocationTarget` (space /
|
package/dist/WasClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WasClient.js","sourceRoot":"","sources":["../src/WasClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"WasClient.js","sourceRoot":"","sources":["../src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 Interop Alliance. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Typed error hierarchy for the WAS client. A `WasError` base carries the
|
|
6
|
-
* server's `application/problem+json` fields (`status` / `title` / `details` /
|
|
7
|
-
* `requestUrl`); `mapError()` translates a thrown ky/ezcap error into the
|
|
8
|
-
* appropriate subclass.
|
|
9
|
-
*/
|
|
10
1
|
/**
|
|
11
2
|
* Structured fields attached to a `WasError`, sourced from the server's
|
|
12
3
|
* `application/problem+json` response body.
|
|
13
4
|
*/
|
|
14
5
|
export interface WasErrorOptions {
|
|
15
6
|
status?: number;
|
|
7
|
+
/**
|
|
8
|
+
* The problem-kind URI from the response body's `type` (e.g.
|
|
9
|
+
* `https://wallet.storage/spec#quota-exceeded`), when the server sent one.
|
|
10
|
+
*/
|
|
11
|
+
type?: string;
|
|
16
12
|
title?: string;
|
|
17
13
|
details?: string[];
|
|
18
14
|
requestUrl?: string;
|
|
@@ -23,6 +19,7 @@ export interface WasErrorOptions {
|
|
|
23
19
|
*/
|
|
24
20
|
export declare class WasError extends Error {
|
|
25
21
|
status?: number;
|
|
22
|
+
type?: string;
|
|
26
23
|
title?: string;
|
|
27
24
|
details?: string[];
|
|
28
25
|
requestUrl?: string;
|
|
@@ -55,6 +52,31 @@ export declare class AuthRequiredError extends WasError {
|
|
|
55
52
|
export declare class NotImplementedError extends WasError {
|
|
56
53
|
constructor(message: string, options?: WasErrorOptions);
|
|
57
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* A client-supplied id or backend conflicts with existing state (HTTP 409):
|
|
57
|
+
* `id-conflict` (the id already exists), `reserved-id` (the id collides with a
|
|
58
|
+
* reserved path segment), or `unsupported-backend` (the backend id is not in
|
|
59
|
+
* the space's available list). The specific kind is on the `type` URI.
|
|
60
|
+
*/
|
|
61
|
+
export declare class ConflictError extends WasError {
|
|
62
|
+
constructor(message: string, options?: WasErrorOptions);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A single upload exceeded the target backend's `maxUploadBytes` constraint
|
|
66
|
+
* (HTTP 413). Unlike `QuotaExceededError`, this is per-request -- a smaller
|
|
67
|
+
* upload may still succeed.
|
|
68
|
+
*/
|
|
69
|
+
export declare class PayloadTooLargeError extends WasError {
|
|
70
|
+
constructor(message: string, options?: WasErrorOptions);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A write was rejected because the target backend's storage quota is exhausted
|
|
74
|
+
* (HTTP 507). This is a client-actionable storage-full condition, not a server
|
|
75
|
+
* fault.
|
|
76
|
+
*/
|
|
77
|
+
export declare class QuotaExceededError extends WasError {
|
|
78
|
+
constructor(message: string, options?: WasErrorOptions);
|
|
79
|
+
}
|
|
58
80
|
/**
|
|
59
81
|
* The server encountered an internal fault (HTTP 5xx).
|
|
60
82
|
*/
|
|
@@ -63,7 +85,9 @@ export declare class WasServerError extends WasError {
|
|
|
63
85
|
}
|
|
64
86
|
/**
|
|
65
87
|
* Translates a thrown ky/ezcap error into the appropriate `WasError` subclass,
|
|
66
|
-
* carrying through the server's `problem+json` fields.
|
|
88
|
+
* carrying through the server's `problem+json` fields. Dispatches on the
|
|
89
|
+
* problem-kind `type` URI when the server sent one, falling back to the HTTP
|
|
90
|
+
* status otherwise.
|
|
67
91
|
*
|
|
68
92
|
* @param err {unknown} the caught error
|
|
69
93
|
* @returns {WasError}
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
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,EAAE,MAAM,EAAE,CAAA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ACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CA6C/C"}
|
package/dist/errors.js
CHANGED
|
@@ -7,19 +7,22 @@
|
|
|
7
7
|
* `requestUrl`); `mapError()` translates a thrown ky/ezcap error into the
|
|
8
8
|
* appropriate subclass.
|
|
9
9
|
*/
|
|
10
|
+
import { ProblemTypes } from '@interop/storage-core';
|
|
10
11
|
/**
|
|
11
12
|
* Base class for all errors thrown by the high-level client methods.
|
|
12
13
|
*/
|
|
13
14
|
export class WasError extends Error {
|
|
14
15
|
status;
|
|
16
|
+
type;
|
|
15
17
|
title;
|
|
16
18
|
details;
|
|
17
19
|
requestUrl;
|
|
18
20
|
constructor(message, options = {}) {
|
|
19
|
-
const { status, title, details, requestUrl, cause } = options;
|
|
21
|
+
const { status, type, title, details, requestUrl, cause } = options;
|
|
20
22
|
super(message, cause !== undefined ? { cause } : undefined);
|
|
21
23
|
this.name = 'WasError';
|
|
22
24
|
this.status = status;
|
|
25
|
+
this.type = type;
|
|
23
26
|
this.title = title;
|
|
24
27
|
this.details = details;
|
|
25
28
|
this.requestUrl = requestUrl;
|
|
@@ -64,6 +67,40 @@ export class NotImplementedError extends WasError {
|
|
|
64
67
|
this.name = 'NotImplementedError';
|
|
65
68
|
}
|
|
66
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* A client-supplied id or backend conflicts with existing state (HTTP 409):
|
|
72
|
+
* `id-conflict` (the id already exists), `reserved-id` (the id collides with a
|
|
73
|
+
* reserved path segment), or `unsupported-backend` (the backend id is not in
|
|
74
|
+
* the space's available list). The specific kind is on the `type` URI.
|
|
75
|
+
*/
|
|
76
|
+
export class ConflictError extends WasError {
|
|
77
|
+
constructor(message, options = {}) {
|
|
78
|
+
super(message, options);
|
|
79
|
+
this.name = 'ConflictError';
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A single upload exceeded the target backend's `maxUploadBytes` constraint
|
|
84
|
+
* (HTTP 413). Unlike `QuotaExceededError`, this is per-request -- a smaller
|
|
85
|
+
* upload may still succeed.
|
|
86
|
+
*/
|
|
87
|
+
export class PayloadTooLargeError extends WasError {
|
|
88
|
+
constructor(message, options = {}) {
|
|
89
|
+
super(message, options);
|
|
90
|
+
this.name = 'PayloadTooLargeError';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A write was rejected because the target backend's storage quota is exhausted
|
|
95
|
+
* (HTTP 507). This is a client-actionable storage-full condition, not a server
|
|
96
|
+
* fault.
|
|
97
|
+
*/
|
|
98
|
+
export class QuotaExceededError extends WasError {
|
|
99
|
+
constructor(message, options = {}) {
|
|
100
|
+
super(message, options);
|
|
101
|
+
this.name = 'QuotaExceededError';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
67
104
|
/**
|
|
68
105
|
* The server encountered an internal fault (HTTP 5xx).
|
|
69
106
|
*/
|
|
@@ -73,9 +110,58 @@ export class WasServerError extends WasError {
|
|
|
73
110
|
this.name = 'WasServerError';
|
|
74
111
|
}
|
|
75
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Extracts the fragment of a problem-type URI (the part after `#`, e.g.
|
|
115
|
+
* `quota-exceeded` from `https://wallet.storage/spec#quota-exceeded`).
|
|
116
|
+
* @param problemType {string} a `ProblemTypes` URI
|
|
117
|
+
* @returns {string}
|
|
118
|
+
*/
|
|
119
|
+
function problemFragment(problemType) {
|
|
120
|
+
return problemType.split('#')[1] ?? '';
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Maps each problem-kind fragment to the `WasError` subclass that represents
|
|
124
|
+
* it. Keyed off the shared `ProblemTypes` registry from `@interop/storage-core`
|
|
125
|
+
* (via `problemFragment`) so the kinds stay in lockstep with the server instead
|
|
126
|
+
* of being duplicated as literal strings here.
|
|
127
|
+
*/
|
|
128
|
+
const ERROR_CLASS_BY_KIND = {
|
|
129
|
+
[problemFragment(ProblemTypes.NOT_FOUND)]: NotFoundError,
|
|
130
|
+
[problemFragment(ProblemTypes.INVALID_ID)]: ValidationError,
|
|
131
|
+
[problemFragment(ProblemTypes.INVALID_REQUEST_BODY)]: ValidationError,
|
|
132
|
+
[problemFragment(ProblemTypes.MISSING_CONTENT_TYPE)]: ValidationError,
|
|
133
|
+
[problemFragment(ProblemTypes.INVALID_AUTHORIZATION_HEADER)]: ValidationError,
|
|
134
|
+
[problemFragment(ProblemTypes.CONTROLLER_MISMATCH)]: ValidationError,
|
|
135
|
+
[problemFragment(ProblemTypes.INVALID_IMPORT)]: ValidationError,
|
|
136
|
+
[problemFragment(ProblemTypes.MISSING_AUTHORIZATION)]: AuthRequiredError,
|
|
137
|
+
[problemFragment(ProblemTypes.RESERVED_ID)]: ConflictError,
|
|
138
|
+
[problemFragment(ProblemTypes.ID_CONFLICT)]: ConflictError,
|
|
139
|
+
[problemFragment(ProblemTypes.UNSUPPORTED_BACKEND)]: ConflictError,
|
|
140
|
+
[problemFragment(ProblemTypes.PAYLOAD_TOO_LARGE)]: PayloadTooLargeError,
|
|
141
|
+
[problemFragment(ProblemTypes.QUOTA_EXCEEDED)]: QuotaExceededError,
|
|
142
|
+
[problemFragment(ProblemTypes.UNSUPPORTED_OPERATION)]: NotImplementedError,
|
|
143
|
+
[problemFragment(ProblemTypes.STORAGE_ERROR)]: WasServerError,
|
|
144
|
+
[problemFragment(ProblemTypes.INTERNAL_ERROR)]: WasServerError
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Constructs a `WasError` subclass from a problem-kind anchor (the fragment of
|
|
148
|
+
* the `type` URI, e.g. `quota-exceeded`). Returns `null` for an unrecognized or
|
|
149
|
+
* absent kind so the caller can fall back to status-based dispatch.
|
|
150
|
+
*
|
|
151
|
+
* @param kind {string | undefined} the `type` URI fragment
|
|
152
|
+
* @param message {string}
|
|
153
|
+
* @param options {WasErrorOptions}
|
|
154
|
+
* @returns {WasError | null}
|
|
155
|
+
*/
|
|
156
|
+
function errorForKind(kind, message, options) {
|
|
157
|
+
const ErrorClass = kind === undefined ? undefined : ERROR_CLASS_BY_KIND[kind];
|
|
158
|
+
return ErrorClass ? new ErrorClass(message, options) : null;
|
|
159
|
+
}
|
|
76
160
|
/**
|
|
77
161
|
* Translates a thrown ky/ezcap error into the appropriate `WasError` subclass,
|
|
78
|
-
* carrying through the server's `problem+json` fields.
|
|
162
|
+
* carrying through the server's `problem+json` fields. Dispatches on the
|
|
163
|
+
* problem-kind `type` URI when the server sent one, falling back to the HTTP
|
|
164
|
+
* status otherwise.
|
|
79
165
|
*
|
|
80
166
|
* @param err {unknown} the caught error
|
|
81
167
|
* @returns {WasError}
|
|
@@ -87,13 +173,19 @@ export function mapError(err) {
|
|
|
87
173
|
const httpError = (err ?? {});
|
|
88
174
|
const status = httpError.status ?? httpError.response?.status;
|
|
89
175
|
const data = httpError.data;
|
|
176
|
+
const type = data?.type;
|
|
90
177
|
const title = data?.title;
|
|
91
178
|
const details = data?.errors
|
|
92
179
|
?.map(entry => entry.detail)
|
|
93
180
|
.filter((detail) => typeof detail === 'string');
|
|
94
181
|
const requestUrl = httpError.requestUrl;
|
|
95
182
|
const message = title ?? httpError.message ?? 'WAS request failed';
|
|
96
|
-
const options = { status, title, details, requestUrl, cause: err };
|
|
183
|
+
const options = { status, type, title, details, requestUrl, cause: err };
|
|
184
|
+
const kind = typeof type === 'string' ? type.split('#')[1] : undefined;
|
|
185
|
+
const byKind = errorForKind(kind, message, options);
|
|
186
|
+
if (byKind !== null) {
|
|
187
|
+
return byKind;
|
|
188
|
+
}
|
|
97
189
|
switch (status) {
|
|
98
190
|
case 400:
|
|
99
191
|
return new ValidationError(message, options);
|
|
@@ -101,8 +193,14 @@ export function mapError(err) {
|
|
|
101
193
|
return new AuthRequiredError(message, options);
|
|
102
194
|
case 404:
|
|
103
195
|
return new NotFoundError(message, options);
|
|
196
|
+
case 409:
|
|
197
|
+
return new ConflictError(message, options);
|
|
198
|
+
case 413:
|
|
199
|
+
return new PayloadTooLargeError(message, options);
|
|
104
200
|
case 501:
|
|
105
201
|
return new NotImplementedError(message, options);
|
|
202
|
+
case 507:
|
|
203
|
+
return new QuotaExceededError(message, options);
|
|
106
204
|
}
|
|
107
205
|
if (typeof status === 'number' && status >= 500) {
|
|
108
206
|
return new WasServerError(message, options);
|
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;
|
|
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;IAClB,UAAU,CAAS;IAEnB,YAAY,OAAe,EAAE,UAA2B,EAAE;QACxD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;QACnE,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QAC3D,IAAI,CAAC,IAAI,GAAG,UAAU,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,QAAQ;IACzC,YAAY,OAAe,EAAE,UAA2B,EAAE;QACxD,K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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
|
@@ -9,6 +9,6 @@ export { WasClient } from './WasClient.js';
|
|
|
9
9
|
export { Space } from './Space.js';
|
|
10
10
|
export { Collection } from './Collection.js';
|
|
11
11
|
export { Resource } from './Resource.js';
|
|
12
|
-
export { WasError, NotFoundError, ValidationError, AuthRequiredError, NotImplementedError, WasServerError, mapError } from './errors.js';
|
|
13
|
-
export type { Json, JsonPrimitive, JsonObject, JsonArray, Action, ActionInput, SpaceDescription, CollectionDescription, CollectionSummary,
|
|
12
|
+
export { WasError, NotFoundError, ValidationError, AuthRequiredError, NotImplementedError, ConflictError, PayloadTooLargeError, QuotaExceededError, WasServerError, mapError } from './errors.js';
|
|
13
|
+
export type { Json, JsonPrimitive, JsonObject, JsonArray, Action, ActionInput, SpaceDescription, CollectionDescription, CollectionSummary, CollectionsList, SpaceSummary, SpaceListing, ResourceSummary, CollectionResourcesList, ResourceMetadata, ResourceMetadataCustom, AddResult, ImportStats, PolicyDocument, LinkSet, LinkSetEntry, HandleOptions, BackendReference, BackendDescriptor, StorageLimit, CollectionUsage, BackendUsage, SpaceQuotaReport, GrantOptions, RequestInput, IZcap, IDelegatedZcap, ISigner } from './types.js';
|
|
14
14
|
//# 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,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACT,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,IAAI,EACJ,aAAa,EACb,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,
|
|
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,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACT,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,IAAI,EACJ,aAAa,EACb,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,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,gBAAgB,EAChB,iBAAiB,EACjB,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
|
@@ -9,5 +9,5 @@ export { WasClient } from './WasClient.js';
|
|
|
9
9
|
export { Space } from './Space.js';
|
|
10
10
|
export { Collection } from './Collection.js';
|
|
11
11
|
export { Resource } from './Resource.js';
|
|
12
|
-
export { WasError, NotFoundError, ValidationError, AuthRequiredError, NotImplementedError, WasServerError, mapError } from './errors.js';
|
|
12
|
+
export { WasError, NotFoundError, ValidationError, AuthRequiredError, NotImplementedError, ConflictError, PayloadTooLargeError, QuotaExceededError, WasServerError, mapError } from './errors.js';
|
|
13
13
|
//# sourceMappingURL=index.js.map
|