@interop/was-client 0.99.1 → 0.100.1
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 +127 -69
- package/dist/Collection.d.ts +17 -9
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +85 -70
- package/dist/Collection.js.map +1 -1
- package/dist/Resource.d.ts +11 -4
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +34 -28
- package/dist/Resource.js.map +1 -1
- package/dist/Space.d.ts +20 -5
- package/dist/Space.d.ts.map +1 -1
- package/dist/Space.js +69 -65
- package/dist/Space.js.map +1 -1
- package/dist/WasClient.d.ts +185 -57
- package/dist/WasClient.d.ts.map +1 -1
- package/dist/WasClient.js +340 -140
- package/dist/WasClient.js.map +1 -1
- package/dist/codec.d.ts +3 -2
- package/dist/codec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.js +1 -1
- package/dist/edv/EdvCodec.js.map +1 -1
- package/dist/edv/WasTransport.d.ts +7 -4
- package/dist/edv/WasTransport.d.ts.map +1 -1
- package/dist/edv/WasTransport.js +39 -20
- package/dist/edv/WasTransport.js.map +1 -1
- package/dist/edv/acquire.d.ts +3 -3
- package/dist/edv/acquire.d.ts.map +1 -1
- package/dist/edv/acquire.js +3 -3
- package/dist/edv/acquire.js.map +1 -1
- package/dist/edv/cipher.d.ts +1 -1
- package/dist/edv/cipher.js +1 -1
- package/dist/edv/docCipher.d.ts +6 -5
- package/dist/edv/docCipher.d.ts.map +1 -1
- package/dist/edv/docCipher.js +6 -5
- package/dist/edv/docCipher.js.map +1 -1
- package/dist/edv/encryption.d.ts +2 -2
- package/dist/edv/encryption.d.ts.map +1 -1
- package/dist/edv/encryption.js +8 -6
- package/dist/edv/encryption.js.map +1 -1
- package/dist/edv/refreshingDocCipher.d.ts +3 -3
- package/dist/edv/refreshingDocCipher.d.ts.map +1 -1
- package/dist/edv/refreshingDocCipher.js +3 -3
- package/dist/edv/refreshingDocCipher.js.map +1 -1
- package/dist/edv/transportFactory.d.ts +3 -3
- package/dist/edv/transportFactory.d.ts.map +1 -1
- package/dist/edv/transportFactory.js +3 -3
- package/dist/edv/transportFactory.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/codec.d.ts +7 -7
- package/dist/internal/codec.d.ts.map +1 -1
- package/dist/internal/codec.js +19 -18
- package/dist/internal/codec.js.map +1 -1
- package/dist/internal/conditional.d.ts +3 -3
- package/dist/internal/conditional.d.ts.map +1 -1
- package/dist/internal/conditional.js +5 -5
- package/dist/internal/conditional.js.map +1 -1
- package/dist/internal/grant.d.ts +15 -26
- package/dist/internal/grant.d.ts.map +1 -1
- package/dist/internal/grant.js +95 -29
- package/dist/internal/grant.js.map +1 -1
- package/dist/internal/meta.d.ts +8 -8
- package/dist/internal/meta.d.ts.map +1 -1
- package/dist/internal/meta.js +13 -10
- package/dist/internal/meta.js.map +1 -1
- package/dist/internal/paths.d.ts +423 -195
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +582 -369
- package/dist/internal/paths.js.map +1 -1
- package/dist/internal/policy.d.ts +23 -23
- package/dist/internal/policy.d.ts.map +1 -1
- package/dist/internal/policy.js +20 -20
- package/dist/internal/policy.js.map +1 -1
- package/dist/internal/request.d.ts +17 -21
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/request.js +10 -21
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/reserved.d.ts +15 -3
- package/dist/internal/reserved.d.ts.map +1 -1
- package/dist/internal/reserved.js +37 -8
- package/dist/internal/reserved.js.map +1 -1
- package/dist/internal/revoke.d.ts +34 -13
- package/dist/internal/revoke.d.ts.map +1 -1
- package/dist/internal/revoke.js +97 -28
- package/dist/internal/revoke.js.map +1 -1
- package/dist/internal/service.d.ts +27 -7
- package/dist/internal/service.d.ts.map +1 -1
- package/dist/internal/service.js +51 -45
- package/dist/internal/service.js.map +1 -1
- package/dist/internal/write.d.ts +18 -18
- package/dist/internal/write.d.ts.map +1 -1
- package/dist/internal/write.js +27 -27
- package/dist/internal/write.js.map +1 -1
- package/dist/paths.d.ts +32 -25
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +32 -25
- package/dist/paths.js.map +1 -1
- package/dist/sync/port.d.ts +3 -3
- package/dist/sync/port.d.ts.map +1 -1
- package/dist/sync/port.js +12 -12
- package/dist/sync/port.js.map +1 -1
- package/dist/sync/provisioning.d.ts +10 -9
- package/dist/sync/provisioning.d.ts.map +1 -1
- package/dist/sync/provisioning.js +19 -18
- package/dist/sync/provisioning.js.map +1 -1
- package/dist/sync/types.d.ts +2 -2
- package/dist/types.d.ts +13 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/internal/paths.d.ts
CHANGED
|
@@ -1,307 +1,535 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* The Space is an ordinary container, so its members are listed and created at
|
|
6
|
-
* the container itself -- there is no second builder for that.
|
|
2
|
+
* Parses an absolute `http(s)` URL, or returns `null`. The one rule for which
|
|
3
|
+
* URLs may name a server, a Spaces Repository, or a container here; the
|
|
4
|
+
* callers that need more (no query, a path) narrow it.
|
|
7
5
|
*
|
|
8
|
-
* @param
|
|
6
|
+
* @param url {string}
|
|
7
|
+
* @returns {URL | null}
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseAbsoluteHttpUrl(url: string): URL | null;
|
|
10
|
+
/**
|
|
11
|
+
* Whether a canonical container URL is an origin root (`https://h/`).
|
|
12
|
+
*
|
|
13
|
+
* @param canonical {string}
|
|
14
|
+
* @returns {boolean}
|
|
15
|
+
*/
|
|
16
|
+
export declare function isOriginRoot(canonical: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The base server URL in canonical form: the URL under which a server lays
|
|
19
|
+
* out `service`, `spaces/` and `space/{space_id}/`. An absolute `http(s)` URL
|
|
20
|
+
* with no query or fragment; a missing trailing slash is supplied rather than
|
|
21
|
+
* refused, since `https://h/pws` and `https://h/pws/` can only mean the same
|
|
22
|
+
* mount.
|
|
23
|
+
*
|
|
24
|
+
* @param baseServerUrl {string}
|
|
25
|
+
* @returns {string}
|
|
26
|
+
* @throws {ValidationError} when the value is not an absolute `http(s)` URL,
|
|
27
|
+
* or carries a query or fragment
|
|
28
|
+
*/
|
|
29
|
+
export declare function canonicalBaseServerUrl(baseServerUrl: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* `{base}service` -- the service description of the server at
|
|
32
|
+
* `baseServerUrl`.
|
|
33
|
+
*
|
|
34
|
+
* @param options {object}
|
|
35
|
+
* @param options.baseServerUrl {string}
|
|
36
|
+
* @returns {string}
|
|
37
|
+
*/
|
|
38
|
+
export declare function serviceDescriptionUrl({ baseServerUrl }: {
|
|
39
|
+
baseServerUrl: string;
|
|
40
|
+
}): string;
|
|
41
|
+
/**
|
|
42
|
+
* `{base}spaces/` -- the Spaces Repository of the server at `baseServerUrl`,
|
|
43
|
+
* in canonical container form. The server may not implement one; its service
|
|
44
|
+
* description says.
|
|
45
|
+
*
|
|
46
|
+
* @param options {object}
|
|
47
|
+
* @param options.baseServerUrl {string}
|
|
48
|
+
* @returns {string}
|
|
49
|
+
*/
|
|
50
|
+
export declare function spacesRepositoryUrl({ baseServerUrl }: {
|
|
51
|
+
baseServerUrl: string;
|
|
52
|
+
}): string;
|
|
53
|
+
/**
|
|
54
|
+
* `{base}space/{space_id}/` -- the Space with id `spaceId` on the server at
|
|
55
|
+
* `baseServerUrl`, in canonical form. The one place a Space URL is built
|
|
56
|
+
* rather than received; the spec's Server Layout fixes this shape.
|
|
57
|
+
*
|
|
58
|
+
* @param options {object}
|
|
59
|
+
* @param options.baseServerUrl {string}
|
|
60
|
+
* @param options.spaceId {string}
|
|
9
61
|
* @returns {string}
|
|
62
|
+
* @throws {ValidationError} when `spaceId` is empty or a dot segment
|
|
10
63
|
*/
|
|
11
|
-
export declare function
|
|
64
|
+
export declare function spaceUrlById({ baseServerUrl, spaceId }: {
|
|
65
|
+
baseServerUrl: string;
|
|
66
|
+
spaceId: string;
|
|
67
|
+
}): string;
|
|
12
68
|
/**
|
|
13
|
-
*
|
|
69
|
+
* The base server URL a server-level URL sits under: the inverse of
|
|
70
|
+
* {@link serviceDescriptionUrl}, {@link spacesRepositoryUrl} and
|
|
71
|
+
* {@link spaceUrlById}. Accepts the service description URL (`{base}service`),
|
|
72
|
+
* the Spaces Repository URL (`{base}spaces/`, slash optional) or a Space URL
|
|
73
|
+
* (`{base}space/{space_id}/`, slash optional) and strips exactly the segments
|
|
74
|
+
* the layout adds. Anything else is refused, including a Collection or
|
|
75
|
+
* Resource URL, whose depth cannot be told from the string alone, and the
|
|
76
|
+
* URL of a single fixed Space, which has no base server URL.
|
|
77
|
+
*
|
|
78
|
+
* @param url {string}
|
|
79
|
+
* @returns {string}
|
|
80
|
+
* @throws {ValidationError} when `url` is not an absolute `http(s)` URL
|
|
81
|
+
* without query or fragment in one of the three forms
|
|
82
|
+
*/
|
|
83
|
+
export declare function baseServerUrlOf(url: string): string;
|
|
84
|
+
/**
|
|
85
|
+
* Splits an absolute Collection URL into the Space URL it sits under and the
|
|
86
|
+
* Collection id: the parent container and the last segment, percent-decoded.
|
|
87
|
+
* A Collection URL is always the Space URL plus one segment, so no layout
|
|
88
|
+
* knowledge is needed. The bare form (no trailing slash) is accepted, as for
|
|
89
|
+
* any container URL received from outside.
|
|
90
|
+
*
|
|
91
|
+
* @param collectionUrl {string}
|
|
92
|
+
* @returns {{ spaceUrl: string; collectionId: string }}
|
|
93
|
+
* @throws {ValidationError} when `collectionUrl` is not an absolute `http(s)`
|
|
94
|
+
* URL without query or fragment, has no path segment, or its last segment
|
|
95
|
+
* is a malformed percent escape
|
|
96
|
+
*/
|
|
97
|
+
export declare function splitCollectionUrl(collectionUrl: string): {
|
|
98
|
+
spaceUrl: string;
|
|
99
|
+
collectionId: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* The Space URL in canonical form (see `canonicalContainer`). A server names
|
|
103
|
+
* a Space in this form (the `Location` of the create response, a listing
|
|
104
|
+
* item's `url`), and every URL beneath the Space, and every zcap
|
|
105
|
+
* `invocationTarget`, is derived from it, so a caller's own serialization of
|
|
106
|
+
* the same Space must reduce to the same string. An origin root is a valid
|
|
107
|
+
* Space URL: a single fixed Space (one with no Space id and no base server
|
|
108
|
+
* URL) may be served there.
|
|
109
|
+
*
|
|
110
|
+
* @param spaceUrl {string} a Space URL, as the server named it or as the
|
|
111
|
+
* caller stored it
|
|
112
|
+
* @returns {string}
|
|
113
|
+
* @throws {ValidationError} when `spaceUrl` is not an absolute `http(s)`
|
|
114
|
+
* URL, carries a query or fragment, or has an empty path segment
|
|
115
|
+
*/
|
|
116
|
+
export declare function canonicalSpaceUrl(spaceUrl: string): string;
|
|
117
|
+
/**
|
|
118
|
+
* The Space's id as its URL names it: the last path segment of the Space
|
|
119
|
+
* URL, percent-decoded. The spec's hierarchy and its did:webvh profile both
|
|
120
|
+
* place the id there (`.../space/{space_id}/`), and it is the value the Space
|
|
121
|
+
* Metadata object's `id` carries. A single fixed Space at an origin root has
|
|
122
|
+
* no id, so that URL is refused here.
|
|
123
|
+
*
|
|
124
|
+
* @param spaceUrl {string} a Space URL
|
|
125
|
+
* @returns {string}
|
|
126
|
+
* @throws {ValidationError} when `spaceUrl` is not a Space URL (see
|
|
127
|
+
* {@link canonicalSpaceUrl}), is an origin root, or its last segment is a
|
|
128
|
+
* malformed percent escape
|
|
129
|
+
*/
|
|
130
|
+
export declare function spaceIdOfUrl(spaceUrl: string): string;
|
|
131
|
+
/**
|
|
132
|
+
* {@link spaceIdOfUrl} for a Space URL already in canonical form (a handle's
|
|
133
|
+
* `url`, the result of {@link canonicalSpaceUrl}), sparing the second parse.
|
|
134
|
+
* Returns `undefined` for an origin root, which has no id segment.
|
|
135
|
+
*
|
|
136
|
+
* @param canonical {string} a canonical Space URL
|
|
137
|
+
* @returns {string | undefined}
|
|
138
|
+
* @throws {ValidationError} when the last segment is a malformed percent
|
|
139
|
+
* escape
|
|
140
|
+
*/
|
|
141
|
+
export declare function spaceIdOfCanonicalUrl(canonical: string): string | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* `{spaceUrl}meta` -- the Space Metadata object: the Space's description
|
|
14
144
|
* (`name`, `controller`, `type`), read with `GET` and replaced with `PUT`.
|
|
145
|
+
* The Space container itself (the canonical Space URL) is the target a Space
|
|
146
|
+
* root capability names, the URL whose `GET` lists the Space's Collections,
|
|
147
|
+
* whose `POST` creates one, and whose `DELETE` removes the Space; it has no
|
|
148
|
+
* builder, since the caller holds it.
|
|
15
149
|
*
|
|
16
|
-
* @param
|
|
150
|
+
* @param options {object}
|
|
151
|
+
* @param options.spaceUrl {string}
|
|
17
152
|
* @returns {string}
|
|
18
153
|
*/
|
|
19
|
-
export declare function
|
|
154
|
+
export declare function spaceMetaUrl({ spaceUrl }: {
|
|
155
|
+
spaceUrl: string;
|
|
156
|
+
}): string;
|
|
20
157
|
/**
|
|
21
|
-
*
|
|
158
|
+
* `{spaceUrl}export` -- export a space as a tar archive.
|
|
159
|
+
*
|
|
160
|
+
* @param options {object}
|
|
161
|
+
* @param options.spaceUrl {string}
|
|
162
|
+
* @returns {string}
|
|
22
163
|
*/
|
|
23
|
-
export declare function
|
|
164
|
+
export declare function spaceExportUrl({ spaceUrl }: {
|
|
165
|
+
spaceUrl: string;
|
|
166
|
+
}): string;
|
|
24
167
|
/**
|
|
25
|
-
*
|
|
168
|
+
* `{spaceUrl}import` -- import a tar archive into a space.
|
|
169
|
+
*
|
|
170
|
+
* @param options {object}
|
|
171
|
+
* @param options.spaceUrl {string}
|
|
172
|
+
* @returns {string}
|
|
26
173
|
*/
|
|
27
|
-
export declare function
|
|
174
|
+
export declare function spaceImportUrl({ spaceUrl }: {
|
|
175
|
+
spaceUrl: string;
|
|
176
|
+
}): string;
|
|
28
177
|
/**
|
|
29
|
-
*
|
|
178
|
+
* `{spaceUrl}backends` -- the backends available within a space (list, and
|
|
30
179
|
* register a new `external` backend).
|
|
180
|
+
*
|
|
181
|
+
* @param options {object}
|
|
182
|
+
* @param options.spaceUrl {string}
|
|
183
|
+
* @returns {string}
|
|
31
184
|
*/
|
|
32
|
-
export declare function
|
|
185
|
+
export declare function spaceBackendsUrl({ spaceUrl }: {
|
|
186
|
+
spaceUrl: string;
|
|
187
|
+
}): string;
|
|
33
188
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
189
|
+
* `{spaceUrl}backends/{backendId}` -- a single registered `external` backend
|
|
190
|
+
* (replace / deregister by id).
|
|
191
|
+
*
|
|
192
|
+
* @param options {object}
|
|
193
|
+
* @param options.spaceUrl {string}
|
|
194
|
+
* @param options.backendId {string}
|
|
195
|
+
* @returns {string}
|
|
36
196
|
*/
|
|
37
|
-
export declare function
|
|
197
|
+
export declare function registeredBackendUrl({ spaceUrl, backendId }: {
|
|
198
|
+
spaceUrl: string;
|
|
199
|
+
backendId: string;
|
|
200
|
+
}): string;
|
|
38
201
|
/**
|
|
39
|
-
*
|
|
202
|
+
* `{spaceUrl}quotas` -- the space-level storage quota report.
|
|
203
|
+
*
|
|
204
|
+
* @param options {object}
|
|
205
|
+
* @param options.spaceUrl {string}
|
|
206
|
+
* @returns {string}
|
|
40
207
|
*/
|
|
41
|
-
export declare function
|
|
208
|
+
export declare function spaceQuotasUrl({ spaceUrl }: {
|
|
209
|
+
spaceUrl: string;
|
|
210
|
+
}): string;
|
|
42
211
|
/**
|
|
43
|
-
*
|
|
212
|
+
* `{spaceUrl}policy` -- the space-level access-control policy resource.
|
|
213
|
+
*
|
|
214
|
+
* @param options {object}
|
|
215
|
+
* @param options.spaceUrl {string}
|
|
216
|
+
* @returns {string}
|
|
44
217
|
*/
|
|
45
|
-
export declare function
|
|
218
|
+
export declare function spacePolicyUrl({ spaceUrl }: {
|
|
219
|
+
spaceUrl: string;
|
|
220
|
+
}): string;
|
|
46
221
|
/**
|
|
47
|
-
*
|
|
222
|
+
* `{spaceUrl}linkset` -- the space-level linkset (policy discovery).
|
|
223
|
+
*
|
|
224
|
+
* @param options {object}
|
|
225
|
+
* @param options.spaceUrl {string}
|
|
226
|
+
* @returns {string}
|
|
48
227
|
*/
|
|
49
|
-
export declare function
|
|
228
|
+
export declare function spaceLinksetUrl({ spaceUrl }: {
|
|
229
|
+
spaceUrl: string;
|
|
230
|
+
}): string;
|
|
50
231
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
232
|
+
* `{spaceUrl}replicas` -- the Space's replica registrations: `GET` lists them
|
|
233
|
+
* and `POST` registers one. Controller-only, both forms.
|
|
234
|
+
*
|
|
235
|
+
* @param options {object}
|
|
236
|
+
* @param options.spaceUrl {string}
|
|
237
|
+
* @returns {string}
|
|
53
238
|
*/
|
|
54
|
-
export declare function
|
|
239
|
+
export declare function spaceReplicasUrl({ spaceUrl }: {
|
|
240
|
+
spaceUrl: string;
|
|
241
|
+
}): string;
|
|
55
242
|
/**
|
|
56
|
-
*
|
|
243
|
+
* `{spaceUrl}replicas/{replicaId}` -- one replica registration (read and
|
|
57
244
|
* delete by id).
|
|
245
|
+
*
|
|
246
|
+
* @param options {object}
|
|
247
|
+
* @param options.spaceUrl {string}
|
|
248
|
+
* @param options.replicaId {string}
|
|
249
|
+
* @returns {string}
|
|
58
250
|
*/
|
|
59
|
-
export declare function
|
|
251
|
+
export declare function replicaRegistrationUrl({ spaceUrl, replicaId }: {
|
|
252
|
+
spaceUrl: string;
|
|
253
|
+
replicaId: string;
|
|
254
|
+
}): string;
|
|
60
255
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
256
|
+
* `{spaceUrl}replicas/{replicaId}/status` -- the pull loop's runtime state
|
|
257
|
+
* for one registration.
|
|
258
|
+
*
|
|
259
|
+
* @param options {object}
|
|
260
|
+
* @param options.spaceUrl {string}
|
|
261
|
+
* @param options.replicaId {string}
|
|
262
|
+
* @returns {string}
|
|
63
263
|
*/
|
|
64
|
-
export declare function
|
|
264
|
+
export declare function replicaStatusUrl({ spaceUrl, replicaId }: {
|
|
265
|
+
spaceUrl: string;
|
|
266
|
+
replicaId: string;
|
|
267
|
+
}): string;
|
|
65
268
|
/**
|
|
66
|
-
*
|
|
269
|
+
* `{spaceUrl}zcaps/revocations/{capabilityId}` -- submit a revocation of a
|
|
67
270
|
* Space-rooted capability. The capability's `id` (typically a `urn:uuid:`) is
|
|
68
271
|
* percent-encoded into the single final segment. `zcaps` is in the Reserved
|
|
69
272
|
* Path Segment Registry, so no Collection can take that slot.
|
|
273
|
+
*
|
|
274
|
+
* @param options {object}
|
|
275
|
+
* @param options.spaceUrl {string}
|
|
276
|
+
* @param options.capabilityId {string}
|
|
277
|
+
* @returns {string}
|
|
70
278
|
*/
|
|
71
|
-
export declare function
|
|
279
|
+
export declare function spaceRevocationUrl({ spaceUrl, capabilityId }: {
|
|
280
|
+
spaceUrl: string;
|
|
281
|
+
capabilityId: string;
|
|
282
|
+
}): string;
|
|
72
283
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
284
|
+
* `{spaceUrl}{collectionId}/` -- the Collection container in canonical form:
|
|
285
|
+
* the target a "share this collection" capability names, the URL whose `GET`
|
|
286
|
+
* lists its Resources, whose `POST` adds one, and whose `DELETE` removes the
|
|
287
|
+
* Collection.
|
|
77
288
|
*
|
|
78
|
-
* @param
|
|
79
|
-
* @param
|
|
289
|
+
* @param options {object}
|
|
290
|
+
* @param options.spaceUrl {string}
|
|
291
|
+
* @param options.collectionId {string}
|
|
80
292
|
* @returns {string}
|
|
81
293
|
*/
|
|
82
|
-
export declare function
|
|
294
|
+
export declare function collectionUrl({ spaceUrl, collectionId }: {
|
|
295
|
+
spaceUrl: string;
|
|
296
|
+
collectionId: string;
|
|
297
|
+
}): string;
|
|
83
298
|
/**
|
|
84
|
-
*
|
|
299
|
+
* `{spaceUrl}{collectionId}/policy` -- the collection-level access-control
|
|
85
300
|
* policy resource.
|
|
301
|
+
*
|
|
302
|
+
* @param options {object}
|
|
303
|
+
* @param options.spaceUrl {string}
|
|
304
|
+
* @param options.collectionId {string}
|
|
305
|
+
* @returns {string}
|
|
86
306
|
*/
|
|
87
|
-
export declare function
|
|
307
|
+
export declare function collectionPolicyUrl({ spaceUrl, collectionId }: {
|
|
308
|
+
spaceUrl: string;
|
|
309
|
+
collectionId: string;
|
|
310
|
+
}): string;
|
|
88
311
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
312
|
+
* `{spaceUrl}{collectionId}/linkset` -- the collection-level linkset (policy
|
|
313
|
+
* discovery).
|
|
314
|
+
*
|
|
315
|
+
* @param options {object}
|
|
316
|
+
* @param options.spaceUrl {string}
|
|
317
|
+
* @param options.collectionId {string}
|
|
318
|
+
* @returns {string}
|
|
91
319
|
*/
|
|
92
|
-
export declare function
|
|
320
|
+
export declare function collectionLinksetUrl({ spaceUrl, collectionId }: {
|
|
321
|
+
spaceUrl: string;
|
|
322
|
+
collectionId: string;
|
|
323
|
+
}): string;
|
|
93
324
|
/**
|
|
94
|
-
*
|
|
325
|
+
* `{spaceUrl}{collectionId}/backend` -- the "Collection Backend Selected"
|
|
95
326
|
* descriptor (the backend this collection is stored on).
|
|
327
|
+
*
|
|
328
|
+
* @param options {object}
|
|
329
|
+
* @param options.spaceUrl {string}
|
|
330
|
+
* @param options.collectionId {string}
|
|
331
|
+
* @returns {string}
|
|
96
332
|
*/
|
|
97
|
-
export declare function
|
|
333
|
+
export declare function collectionBackendUrl({ spaceUrl, collectionId }: {
|
|
334
|
+
spaceUrl: string;
|
|
335
|
+
collectionId: string;
|
|
336
|
+
}): string;
|
|
98
337
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
338
|
+
* `{spaceUrl}{collectionId}/quota` -- the per-collection storage quota report
|
|
339
|
+
* (spec "Quotas").
|
|
340
|
+
*
|
|
341
|
+
* @param options {object}
|
|
342
|
+
* @param options.spaceUrl {string}
|
|
343
|
+
* @param options.collectionId {string}
|
|
344
|
+
* @returns {string}
|
|
101
345
|
*/
|
|
102
|
-
export declare function
|
|
346
|
+
export declare function collectionQuotaUrl({ spaceUrl, collectionId }: {
|
|
347
|
+
spaceUrl: string;
|
|
348
|
+
collectionId: string;
|
|
349
|
+
}): string;
|
|
103
350
|
/**
|
|
104
|
-
*
|
|
351
|
+
* `{spaceUrl}{collectionId}/meta` -- the Collection Metadata object: the
|
|
105
352
|
* Collection's configuration (`name`, `backend`, `encryption`, `generator`)
|
|
106
353
|
* together with the server-managed timestamps / `createdBy` and the
|
|
107
354
|
* user-writable `custom` and `epoch`, as one object under one validator.
|
|
355
|
+
*
|
|
356
|
+
* @param options {object}
|
|
357
|
+
* @param options.spaceUrl {string}
|
|
358
|
+
* @param options.collectionId {string}
|
|
359
|
+
* @returns {string}
|
|
108
360
|
*/
|
|
109
|
-
export declare function
|
|
361
|
+
export declare function collectionMetaUrl({ spaceUrl, collectionId }: {
|
|
362
|
+
spaceUrl: string;
|
|
363
|
+
collectionId: string;
|
|
364
|
+
}): string;
|
|
110
365
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
366
|
+
* `{spaceUrl}{collectionId}/meta/log` -- the Collection's governing history
|
|
367
|
+
* log sub-resource (JSON Lines). Not a Resource of the Collection: absent from
|
|
368
|
+
* listings and the `changes` feed, and versioned by its own ETag.
|
|
369
|
+
*
|
|
370
|
+
* @param options {object}
|
|
371
|
+
* @param options.spaceUrl {string}
|
|
372
|
+
* @param options.collectionId {string}
|
|
373
|
+
* @returns {string}
|
|
114
374
|
*/
|
|
115
|
-
export declare function
|
|
375
|
+
export declare function collectionLogUrl({ spaceUrl, collectionId }: {
|
|
376
|
+
spaceUrl: string;
|
|
377
|
+
collectionId: string;
|
|
378
|
+
}): string;
|
|
116
379
|
/**
|
|
117
|
-
*
|
|
380
|
+
* `{spaceUrl}{collectionId}/query` -- the collection-level query endpoint,
|
|
118
381
|
* whose body's `profile` selects the query (e.g. `changes`, `blinded-index`).
|
|
382
|
+
*
|
|
383
|
+
* @param options {object}
|
|
384
|
+
* @param options.spaceUrl {string}
|
|
385
|
+
* @param options.collectionId {string}
|
|
386
|
+
* @returns {string}
|
|
119
387
|
*/
|
|
120
|
-
export declare function
|
|
388
|
+
export declare function collectionQueryUrl({ spaceUrl, collectionId }: {
|
|
389
|
+
spaceUrl: string;
|
|
390
|
+
collectionId: string;
|
|
391
|
+
}): string;
|
|
121
392
|
/**
|
|
122
|
-
*
|
|
393
|
+
* `{spaceUrl}{collectionId}/{resourceId}` -- get / put / delete a resource
|
|
123
394
|
* (no trailing slash).
|
|
124
|
-
*/
|
|
125
|
-
export declare function resourcePath(spaceId: string, collectionId: string, resourceId: string): string;
|
|
126
|
-
/**
|
|
127
|
-
* `/space/:spaceId/:collectionId/:resourceId/meta` -- the resource metadata
|
|
128
|
-
* object (server-managed properties plus the user-writable `custom` object).
|
|
129
|
-
*/
|
|
130
|
-
export declare function resourceMeta(spaceId: string, collectionId: string, resourceId: string): string;
|
|
131
|
-
/**
|
|
132
|
-
* `/space/:spaceId/:collectionId/:resourceId/policy` -- the resource-level
|
|
133
|
-
* access-control policy resource.
|
|
134
|
-
*/
|
|
135
|
-
export declare function resourcePolicy(spaceId: string, collectionId: string, resourceId: string): string;
|
|
136
|
-
/**
|
|
137
|
-
* `/space/:spaceId/:collectionId/:resourceId/chunks/:chunkIndex` -- a single
|
|
138
|
-
* stored chunk of a chunked Resource. Member
|
|
139
|
-
* form, no trailing slash: get / put / delete one chunk by its ordinal index.
|
|
140
|
-
* The `chunkIndex` is a non-negative integer, emitted verbatim (it is never a
|
|
141
|
-
* reserved or dot segment, so it needs no percent-encoding).
|
|
142
395
|
*
|
|
143
|
-
* @param
|
|
144
|
-
* @param
|
|
145
|
-
* @param
|
|
146
|
-
* @param
|
|
396
|
+
* @param options {object}
|
|
397
|
+
* @param options.spaceUrl {string}
|
|
398
|
+
* @param options.collectionId {string}
|
|
399
|
+
* @param options.resourceId {string}
|
|
147
400
|
* @returns {string}
|
|
148
401
|
*/
|
|
149
|
-
export declare function
|
|
402
|
+
export declare function resourceUrl({ spaceUrl, collectionId, resourceId }: {
|
|
403
|
+
spaceUrl: string;
|
|
404
|
+
collectionId: string;
|
|
405
|
+
resourceId: string;
|
|
406
|
+
}): string;
|
|
150
407
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* slash (the member form, {@link resourceChunkPath}, has none).
|
|
408
|
+
* `{spaceUrl}{collectionId}/{resourceId}/meta` -- the resource metadata
|
|
409
|
+
* object (server-managed properties plus the user-writable `custom` object).
|
|
154
410
|
*
|
|
155
|
-
* @param
|
|
156
|
-
* @param
|
|
157
|
-
* @param
|
|
411
|
+
* @param options {object}
|
|
412
|
+
* @param options.spaceUrl {string}
|
|
413
|
+
* @param options.collectionId {string}
|
|
414
|
+
* @param options.resourceId {string}
|
|
158
415
|
* @returns {string}
|
|
159
416
|
*/
|
|
160
|
-
export declare function
|
|
417
|
+
export declare function resourceMetaUrl({ spaceUrl, collectionId, resourceId }: {
|
|
418
|
+
spaceUrl: string;
|
|
419
|
+
collectionId: string;
|
|
420
|
+
resourceId: string;
|
|
421
|
+
}): string;
|
|
161
422
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* URL a `WasClient` is constructed with (its `serverUrl`), so a consumer that
|
|
165
|
-
* holds only a Space or Collection URL forms the client's `serverUrl` from the
|
|
166
|
-
* base `parseAbsoluteSpaceTarget` reads off it.
|
|
423
|
+
* `{spaceUrl}{collectionId}/{resourceId}/policy` -- the resource-level
|
|
424
|
+
* access-control policy resource.
|
|
167
425
|
*
|
|
168
426
|
* @param options {object}
|
|
169
|
-
* @param options.
|
|
427
|
+
* @param options.spaceUrl {string}
|
|
428
|
+
* @param options.collectionId {string}
|
|
429
|
+
* @param options.resourceId {string}
|
|
170
430
|
* @returns {string}
|
|
171
431
|
*/
|
|
172
|
-
export declare function
|
|
173
|
-
|
|
432
|
+
export declare function resourcePolicyUrl({ spaceUrl, collectionId, resourceId }: {
|
|
433
|
+
spaceUrl: string;
|
|
434
|
+
collectionId: string;
|
|
435
|
+
resourceId: string;
|
|
174
436
|
}): string;
|
|
175
437
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* the same. The result is in `URL` canonical form (lower-case host, default
|
|
182
|
-
* port dropped), so two serializations of one URL compare equal.
|
|
438
|
+
* `{spaceUrl}{collectionId}/{resourceId}/chunks/{chunkIndex}` -- a single
|
|
439
|
+
* stored chunk of a chunked Resource. Member form, no trailing slash: get /
|
|
440
|
+
* put / delete one chunk by its ordinal index. The `chunkIndex` is a
|
|
441
|
+
* non-negative integer, emitted verbatim (it is never a reserved or dot
|
|
442
|
+
* segment, so it needs no percent-encoding).
|
|
183
443
|
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* @param
|
|
189
|
-
* @returns {string
|
|
444
|
+
* @param options {object}
|
|
445
|
+
* @param options.spaceUrl {string}
|
|
446
|
+
* @param options.collectionId {string}
|
|
447
|
+
* @param options.resourceId {string}
|
|
448
|
+
* @param options.chunkIndex {number}
|
|
449
|
+
* @returns {string}
|
|
190
450
|
*/
|
|
191
|
-
export declare function
|
|
451
|
+
export declare function resourceChunkUrl({ spaceUrl, collectionId, resourceId, chunkIndex }: {
|
|
452
|
+
spaceUrl: string;
|
|
453
|
+
collectionId: string;
|
|
454
|
+
resourceId: string;
|
|
455
|
+
chunkIndex: number;
|
|
456
|
+
}): string;
|
|
192
457
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* The path is joined onto `baseUrl`'s path rather than its origin, so a WAS
|
|
197
|
-
* deployment mounted under a sub-path (e.g. `https://host/was`) keeps that
|
|
198
|
-
* prefix. A bare-origin `baseUrl` behaves as before.
|
|
458
|
+
* `{spaceUrl}{collectionId}/{resourceId}/chunks/` -- the chunk container of a
|
|
459
|
+
* chunked Resource: its stored chunks, listed. Container form, trailing slash
|
|
460
|
+
* (the member form, {@link resourceChunkUrl}, has none).
|
|
199
461
|
*
|
|
200
462
|
* @param options {object}
|
|
201
|
-
* @param options.
|
|
202
|
-
* @param options.
|
|
463
|
+
* @param options.spaceUrl {string}
|
|
464
|
+
* @param options.collectionId {string}
|
|
465
|
+
* @param options.resourceId {string}
|
|
203
466
|
* @returns {string}
|
|
204
467
|
*/
|
|
205
|
-
export declare function
|
|
206
|
-
|
|
207
|
-
|
|
468
|
+
export declare function resourceChunksUrl({ spaceUrl, collectionId, resourceId }: {
|
|
469
|
+
spaceUrl: string;
|
|
470
|
+
collectionId: string;
|
|
471
|
+
resourceId: string;
|
|
208
472
|
}): string;
|
|
209
473
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
474
|
+
* The canonical (trailing-slash) form of a container URL received from
|
|
475
|
+
* outside and requested as given: the Spaces Repository URL a service
|
|
476
|
+
* description advertises, a public Collection link. The bare form only
|
|
477
|
+
* 308-redirects, and a signed invocation does not survive the redirect, so
|
|
478
|
+
* the slash is added here before the URL is ever requested. This module owns
|
|
479
|
+
* the trailing-slash rules; callers normalize here rather than re-encoding
|
|
480
|
+
* the rule.
|
|
214
481
|
*
|
|
215
|
-
* @param
|
|
482
|
+
* @param url {string} an absolute container URL, in either form
|
|
216
483
|
* @returns {string}
|
|
217
484
|
*/
|
|
218
|
-
export declare function
|
|
485
|
+
export declare function canonicalContainerUrl(url: string): string;
|
|
219
486
|
/**
|
|
220
|
-
* The classification of a
|
|
221
|
-
* containment kinds map onto navigational handles; `sub-resource`
|
|
222
|
-
* reserved sub-endpoint the builders above produce (
|
|
223
|
-
*
|
|
224
|
-
* its own.
|
|
487
|
+
* The classification of a URL beneath a Space by the depth it addresses. The
|
|
488
|
+
* three containment kinds map onto navigational handles; `sub-resource`
|
|
489
|
+
* covers every reserved sub-endpoint the builders above produce (`policy`,
|
|
490
|
+
* `{c}/backend`, `{c}/{r}/meta`, ...), which has no handle of its own.
|
|
225
491
|
*/
|
|
226
492
|
export type ParsedSpacePath = {
|
|
227
493
|
kind: 'space';
|
|
228
|
-
spaceId: string;
|
|
229
494
|
} | {
|
|
230
495
|
kind: 'collection';
|
|
231
|
-
spaceId: string;
|
|
232
496
|
collectionId: string;
|
|
233
497
|
} | {
|
|
234
498
|
kind: 'resource';
|
|
235
|
-
spaceId: string;
|
|
236
499
|
collectionId: string;
|
|
237
500
|
resourceId: string;
|
|
238
501
|
} | {
|
|
239
502
|
kind: 'sub-resource';
|
|
240
|
-
spaceId: string;
|
|
241
503
|
segments: string[];
|
|
242
504
|
};
|
|
243
505
|
/**
|
|
244
|
-
* Classifies an absolute `target` URL
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
506
|
+
* Classifies an absolute `target` URL by where it sits beneath `spaceUrl`:
|
|
507
|
+
* the Space itself, one of its Collections, a Resource, or a reserved
|
|
508
|
+
* sub-endpoint. The inverse of the builders above, kept next to them so the
|
|
509
|
+
* grammar is owned in one place: `WasClient.fromCapability` reads a
|
|
510
|
+
* capability's `invocationTarget` through it, and the builders stay in
|
|
511
|
+
* lockstep.
|
|
512
|
+
*
|
|
513
|
+
* Both URLs are compared in parsed form, so a target serialized by another
|
|
514
|
+
* party (an upper-case host, a default port) still matches. Segments are
|
|
515
|
+
* percent-decoded (the builders re-encode them). Empty segments are dropped,
|
|
516
|
+
* so a container addressed in either form classifies the same: the bare and
|
|
517
|
+
* the trailing-slash form of a Collection are both the Collection. That is
|
|
518
|
+
* deliberate: the builders emit only the canonical form, but the targets
|
|
519
|
+
* parsed here come from capabilities minted elsewhere, and a client that
|
|
520
|
+
* reads only one form would refuse valid ones.
|
|
248
521
|
*
|
|
249
|
-
* Returns `null` when `target` is not beneath `
|
|
250
|
-
* another
|
|
251
|
-
*
|
|
252
|
-
* an error.
|
|
522
|
+
* Returns `null` when `target` is not beneath `spaceUrl` (another origin, or
|
|
523
|
+
* another path), carries a query or fragment, or either URL is malformed.
|
|
524
|
+
* The caller chooses whether that is an error.
|
|
253
525
|
*
|
|
254
526
|
* @param options {object}
|
|
255
|
-
* @param options.
|
|
256
|
-
* @param options.target {string}
|
|
527
|
+
* @param options.spaceUrl {string} the Space URL
|
|
528
|
+
* @param options.target {string} an absolute URL expected beneath it
|
|
257
529
|
* @returns {ParsedSpacePath | null}
|
|
258
530
|
*/
|
|
259
|
-
export declare function parseSpaceTarget({
|
|
260
|
-
|
|
531
|
+
export declare function parseSpaceTarget({ spaceUrl, target }: {
|
|
532
|
+
spaceUrl: string;
|
|
261
533
|
target: string;
|
|
262
534
|
}): ParsedSpacePath | null;
|
|
263
|
-
/**
|
|
264
|
-
* Classifies an absolute `target` URL whose server is not known in advance:
|
|
265
|
-
* the base URL is read off the target itself, as everything before its first
|
|
266
|
-
* `space` path segment, so a WAS mounted under a sub-path
|
|
267
|
-
* (`https://host/was/space/...`) yields `https://host/was`. For a target on a
|
|
268
|
-
* known server, `parseSpaceTarget` is the stricter check (it refuses a target
|
|
269
|
-
* beneath any other base). This is the one for a capability received from
|
|
270
|
-
* another party, whose `invocationTarget` may name any host.
|
|
271
|
-
*
|
|
272
|
-
* Returns `null` when `target` is not an absolute `http(s)` URL, has no
|
|
273
|
-
* `space` segment, carries a query or fragment, or has an empty segment in
|
|
274
|
-
* the base before it (`https://host//was/space/x`); these are the rules
|
|
275
|
-
* `baseUrlOfSpacesUrl` applies too. Also `null` from the path grammar for a
|
|
276
|
-
* path it cannot classify. The caller chooses whether that is an error.
|
|
277
|
-
*
|
|
278
|
-
* @param target {string} an absolute WAS URL
|
|
279
|
-
* @returns {{ baseUrl: string; path: ParsedSpacePath } | null} the server
|
|
280
|
-
* base URL (no trailing slash) and the parsed target beneath it
|
|
281
|
-
*/
|
|
282
|
-
export declare function parseAbsoluteSpaceTarget(target: string): {
|
|
283
|
-
baseUrl: string;
|
|
284
|
-
path: ParsedSpacePath;
|
|
285
|
-
} | null;
|
|
286
|
-
/**
|
|
287
|
-
* Parses a server pathname back into the containment depth it addresses -- the
|
|
288
|
-
* inverse of the builders above, kept next to them so the grammar is owned in
|
|
289
|
-
* one place. Segments are percent-decoded (the builders re-encode them).
|
|
290
|
-
* Returns `null` for a pathname outside the `/space/...` tree; the caller
|
|
291
|
-
* chooses the error. A path that addresses a reserved sub-endpoint rather than
|
|
292
|
-
* a space/collection/resource -- e.g. `/space/s/policy`, `/space/s/c/backend`,
|
|
293
|
-
* or any 5-segment target like `/space/s/c/r/meta` -- is classified
|
|
294
|
-
* `sub-resource`, never silently truncated to the nearest handle.
|
|
295
|
-
*
|
|
296
|
-
* Empty segments are dropped, so a container addressed in either form
|
|
297
|
-
* classifies the same: `/space/s` and `/space/s/` are both the Space, and
|
|
298
|
-
* `/space/s/c` and `/space/s/c/` both the Collection. That is deliberate. The
|
|
299
|
-
* builders emit only the canonical trailing-slash form, but the targets parsed
|
|
300
|
-
* here come from capabilities minted elsewhere, and a client that reads only
|
|
301
|
-
* one spelling would refuse valid ones.
|
|
302
|
-
*
|
|
303
|
-
* @param pathname {string} a URL pathname (e.g. from `new URL(...).pathname`)
|
|
304
|
-
* @returns {ParsedSpacePath | null}
|
|
305
|
-
*/
|
|
306
|
-
export declare function parseSpacePath(pathname: string): ParsedSpacePath | null;
|
|
307
535
|
//# sourceMappingURL=paths.d.ts.map
|