@interop/was-client 0.99.1 → 0.100.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 +90 -70
- package/dist/Collection.d.ts +20 -8
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +89 -69
- package/dist/Collection.js.map +1 -1
- package/dist/Resource.d.ts +14 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +38 -27
- package/dist/Resource.js.map +1 -1
- package/dist/Space.d.ts +18 -4
- package/dist/Space.d.ts.map +1 -1
- package/dist/Space.js +64 -61
- package/dist/Space.js.map +1 -1
- package/dist/WasClient.d.ts +102 -54
- package/dist/WasClient.d.ts.map +1 -1
- package/dist/WasClient.js +212 -133
- 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 +2 -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 +332 -195
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +400 -367
- 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/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 +25 -7
- package/dist/internal/service.d.ts.map +1 -1
- package/dist/internal/service.js +49 -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 +1 -1
package/dist/internal/paths.d.ts
CHANGED
|
@@ -1,307 +1,444 @@
|
|
|
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
|
+
* The Space URL in canonical form: an absolute `http(s)` URL, serialized by
|
|
12
|
+
* `URL` (lower-case host, default port dropped), ending in exactly one
|
|
13
|
+
* slash. A server names a Space in this form (the `Location` of the create
|
|
14
|
+
* response, a listing item's `url`), and every URL beneath the Space, and
|
|
15
|
+
* every zcap `invocationTarget`, is derived from it, so a caller's own
|
|
16
|
+
* serialization of the same Space must reduce to the same string. A missing
|
|
17
|
+
* trailing slash is added, since the bare form names the same container; a
|
|
18
|
+
* run of trailing slashes is collapsed to one.
|
|
19
|
+
*
|
|
20
|
+
* @param spaceUrl {string} a Space URL, as the server named it or as the
|
|
21
|
+
* caller stored it
|
|
22
|
+
* @returns {string}
|
|
23
|
+
* @throws {ValidationError} when `spaceUrl` is not an absolute `http(s)`
|
|
24
|
+
* URL, carries a query or fragment, or has no path segment (an origin is
|
|
25
|
+
* not a Space)
|
|
26
|
+
*/
|
|
27
|
+
export declare function canonicalSpaceUrl(spaceUrl: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* The Space's id as its URL names it: the last path segment of the Space
|
|
30
|
+
* URL, percent-decoded. The spec's hierarchy and its did:webvh profile both
|
|
31
|
+
* place the id there (`.../space/{space_id}/`), and it is the value the Space
|
|
32
|
+
* Metadata object's `id` carries.
|
|
33
|
+
*
|
|
34
|
+
* @param spaceUrl {string} a Space URL
|
|
35
|
+
* @returns {string}
|
|
36
|
+
* @throws {ValidationError} when `spaceUrl` is not a Space URL (see
|
|
37
|
+
* {@link canonicalSpaceUrl}) or its last segment is a malformed percent
|
|
38
|
+
* escape
|
|
39
|
+
*/
|
|
40
|
+
export declare function spaceIdOfUrl(spaceUrl: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* {@link spaceIdOfUrl} for a Space URL already in canonical form (a handle's
|
|
43
|
+
* `url`, the result of {@link canonicalSpaceUrl}), sparing the second parse.
|
|
44
|
+
*
|
|
45
|
+
* @param canonical {string} a canonical Space URL
|
|
9
46
|
* @returns {string}
|
|
47
|
+
* @throws {ValidationError} when the last segment is a malformed percent
|
|
48
|
+
* escape
|
|
10
49
|
*/
|
|
11
|
-
export declare function
|
|
50
|
+
export declare function spaceIdOfCanonicalUrl(canonical: string): string;
|
|
12
51
|
/**
|
|
13
|
-
*
|
|
52
|
+
* `{spaceUrl}meta` -- the Space Metadata object: the Space's description
|
|
14
53
|
* (`name`, `controller`, `type`), read with `GET` and replaced with `PUT`.
|
|
54
|
+
* The Space container itself (the canonical Space URL) is the target a Space
|
|
55
|
+
* root capability names, the URL whose `GET` lists the Space's Collections,
|
|
56
|
+
* whose `POST` creates one, and whose `DELETE` removes the Space; it has no
|
|
57
|
+
* builder, since the caller holds it.
|
|
15
58
|
*
|
|
16
|
-
* @param
|
|
59
|
+
* @param options {object}
|
|
60
|
+
* @param options.spaceUrl {string}
|
|
17
61
|
* @returns {string}
|
|
18
62
|
*/
|
|
19
|
-
export declare function
|
|
63
|
+
export declare function spaceMetaUrl({ spaceUrl }: {
|
|
64
|
+
spaceUrl: string;
|
|
65
|
+
}): string;
|
|
20
66
|
/**
|
|
21
|
-
*
|
|
67
|
+
* `{spaceUrl}export` -- export a space as a tar archive.
|
|
68
|
+
*
|
|
69
|
+
* @param options {object}
|
|
70
|
+
* @param options.spaceUrl {string}
|
|
71
|
+
* @returns {string}
|
|
22
72
|
*/
|
|
23
|
-
export declare function
|
|
73
|
+
export declare function spaceExportUrl({ spaceUrl }: {
|
|
74
|
+
spaceUrl: string;
|
|
75
|
+
}): string;
|
|
24
76
|
/**
|
|
25
|
-
*
|
|
77
|
+
* `{spaceUrl}import` -- import a tar archive into a space.
|
|
78
|
+
*
|
|
79
|
+
* @param options {object}
|
|
80
|
+
* @param options.spaceUrl {string}
|
|
81
|
+
* @returns {string}
|
|
26
82
|
*/
|
|
27
|
-
export declare function
|
|
83
|
+
export declare function spaceImportUrl({ spaceUrl }: {
|
|
84
|
+
spaceUrl: string;
|
|
85
|
+
}): string;
|
|
28
86
|
/**
|
|
29
|
-
*
|
|
87
|
+
* `{spaceUrl}backends` -- the backends available within a space (list, and
|
|
30
88
|
* register a new `external` backend).
|
|
89
|
+
*
|
|
90
|
+
* @param options {object}
|
|
91
|
+
* @param options.spaceUrl {string}
|
|
92
|
+
* @returns {string}
|
|
31
93
|
*/
|
|
32
|
-
export declare function
|
|
94
|
+
export declare function spaceBackendsUrl({ spaceUrl }: {
|
|
95
|
+
spaceUrl: string;
|
|
96
|
+
}): string;
|
|
33
97
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
98
|
+
* `{spaceUrl}backends/{backendId}` -- a single registered `external` backend
|
|
99
|
+
* (replace / deregister by id).
|
|
100
|
+
*
|
|
101
|
+
* @param options {object}
|
|
102
|
+
* @param options.spaceUrl {string}
|
|
103
|
+
* @param options.backendId {string}
|
|
104
|
+
* @returns {string}
|
|
36
105
|
*/
|
|
37
|
-
export declare function
|
|
106
|
+
export declare function registeredBackendUrl({ spaceUrl, backendId }: {
|
|
107
|
+
spaceUrl: string;
|
|
108
|
+
backendId: string;
|
|
109
|
+
}): string;
|
|
38
110
|
/**
|
|
39
|
-
*
|
|
111
|
+
* `{spaceUrl}quotas` -- the space-level storage quota report.
|
|
112
|
+
*
|
|
113
|
+
* @param options {object}
|
|
114
|
+
* @param options.spaceUrl {string}
|
|
115
|
+
* @returns {string}
|
|
40
116
|
*/
|
|
41
|
-
export declare function
|
|
117
|
+
export declare function spaceQuotasUrl({ spaceUrl }: {
|
|
118
|
+
spaceUrl: string;
|
|
119
|
+
}): string;
|
|
42
120
|
/**
|
|
43
|
-
*
|
|
121
|
+
* `{spaceUrl}policy` -- the space-level access-control policy resource.
|
|
122
|
+
*
|
|
123
|
+
* @param options {object}
|
|
124
|
+
* @param options.spaceUrl {string}
|
|
125
|
+
* @returns {string}
|
|
44
126
|
*/
|
|
45
|
-
export declare function
|
|
127
|
+
export declare function spacePolicyUrl({ spaceUrl }: {
|
|
128
|
+
spaceUrl: string;
|
|
129
|
+
}): string;
|
|
46
130
|
/**
|
|
47
|
-
*
|
|
131
|
+
* `{spaceUrl}linkset` -- the space-level linkset (policy discovery).
|
|
132
|
+
*
|
|
133
|
+
* @param options {object}
|
|
134
|
+
* @param options.spaceUrl {string}
|
|
135
|
+
* @returns {string}
|
|
48
136
|
*/
|
|
49
|
-
export declare function
|
|
137
|
+
export declare function spaceLinksetUrl({ spaceUrl }: {
|
|
138
|
+
spaceUrl: string;
|
|
139
|
+
}): string;
|
|
50
140
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
141
|
+
* `{spaceUrl}replicas` -- the Space's replica registrations: `GET` lists them
|
|
142
|
+
* and `POST` registers one. Controller-only, both forms.
|
|
143
|
+
*
|
|
144
|
+
* @param options {object}
|
|
145
|
+
* @param options.spaceUrl {string}
|
|
146
|
+
* @returns {string}
|
|
53
147
|
*/
|
|
54
|
-
export declare function
|
|
148
|
+
export declare function spaceReplicasUrl({ spaceUrl }: {
|
|
149
|
+
spaceUrl: string;
|
|
150
|
+
}): string;
|
|
55
151
|
/**
|
|
56
|
-
*
|
|
152
|
+
* `{spaceUrl}replicas/{replicaId}` -- one replica registration (read and
|
|
57
153
|
* delete by id).
|
|
154
|
+
*
|
|
155
|
+
* @param options {object}
|
|
156
|
+
* @param options.spaceUrl {string}
|
|
157
|
+
* @param options.replicaId {string}
|
|
158
|
+
* @returns {string}
|
|
58
159
|
*/
|
|
59
|
-
export declare function
|
|
160
|
+
export declare function replicaRegistrationUrl({ spaceUrl, replicaId }: {
|
|
161
|
+
spaceUrl: string;
|
|
162
|
+
replicaId: string;
|
|
163
|
+
}): string;
|
|
60
164
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
165
|
+
* `{spaceUrl}replicas/{replicaId}/status` -- the pull loop's runtime state
|
|
166
|
+
* for one registration.
|
|
167
|
+
*
|
|
168
|
+
* @param options {object}
|
|
169
|
+
* @param options.spaceUrl {string}
|
|
170
|
+
* @param options.replicaId {string}
|
|
171
|
+
* @returns {string}
|
|
63
172
|
*/
|
|
64
|
-
export declare function
|
|
173
|
+
export declare function replicaStatusUrl({ spaceUrl, replicaId }: {
|
|
174
|
+
spaceUrl: string;
|
|
175
|
+
replicaId: string;
|
|
176
|
+
}): string;
|
|
65
177
|
/**
|
|
66
|
-
*
|
|
178
|
+
* `{spaceUrl}zcaps/revocations/{capabilityId}` -- submit a revocation of a
|
|
67
179
|
* Space-rooted capability. The capability's `id` (typically a `urn:uuid:`) is
|
|
68
180
|
* percent-encoded into the single final segment. `zcaps` is in the Reserved
|
|
69
181
|
* Path Segment Registry, so no Collection can take that slot.
|
|
182
|
+
*
|
|
183
|
+
* @param options {object}
|
|
184
|
+
* @param options.spaceUrl {string}
|
|
185
|
+
* @param options.capabilityId {string}
|
|
186
|
+
* @returns {string}
|
|
70
187
|
*/
|
|
71
|
-
export declare function
|
|
188
|
+
export declare function spaceRevocationUrl({ spaceUrl, capabilityId }: {
|
|
189
|
+
spaceUrl: string;
|
|
190
|
+
capabilityId: string;
|
|
191
|
+
}): string;
|
|
72
192
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
193
|
+
* `{spaceUrl}{collectionId}/` -- the Collection container in canonical form:
|
|
194
|
+
* the target a "share this collection" capability names, the URL whose `GET`
|
|
195
|
+
* lists its Resources, whose `POST` adds one, and whose `DELETE` removes the
|
|
196
|
+
* Collection.
|
|
77
197
|
*
|
|
78
|
-
* @param
|
|
79
|
-
* @param
|
|
198
|
+
* @param options {object}
|
|
199
|
+
* @param options.spaceUrl {string}
|
|
200
|
+
* @param options.collectionId {string}
|
|
80
201
|
* @returns {string}
|
|
81
202
|
*/
|
|
82
|
-
export declare function
|
|
203
|
+
export declare function collectionUrl({ spaceUrl, collectionId }: {
|
|
204
|
+
spaceUrl: string;
|
|
205
|
+
collectionId: string;
|
|
206
|
+
}): string;
|
|
83
207
|
/**
|
|
84
|
-
*
|
|
208
|
+
* `{spaceUrl}{collectionId}/policy` -- the collection-level access-control
|
|
85
209
|
* policy resource.
|
|
210
|
+
*
|
|
211
|
+
* @param options {object}
|
|
212
|
+
* @param options.spaceUrl {string}
|
|
213
|
+
* @param options.collectionId {string}
|
|
214
|
+
* @returns {string}
|
|
86
215
|
*/
|
|
87
|
-
export declare function
|
|
216
|
+
export declare function collectionPolicyUrl({ spaceUrl, collectionId }: {
|
|
217
|
+
spaceUrl: string;
|
|
218
|
+
collectionId: string;
|
|
219
|
+
}): string;
|
|
88
220
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
221
|
+
* `{spaceUrl}{collectionId}/linkset` -- the collection-level linkset (policy
|
|
222
|
+
* discovery).
|
|
223
|
+
*
|
|
224
|
+
* @param options {object}
|
|
225
|
+
* @param options.spaceUrl {string}
|
|
226
|
+
* @param options.collectionId {string}
|
|
227
|
+
* @returns {string}
|
|
91
228
|
*/
|
|
92
|
-
export declare function
|
|
229
|
+
export declare function collectionLinksetUrl({ spaceUrl, collectionId }: {
|
|
230
|
+
spaceUrl: string;
|
|
231
|
+
collectionId: string;
|
|
232
|
+
}): string;
|
|
93
233
|
/**
|
|
94
|
-
*
|
|
234
|
+
* `{spaceUrl}{collectionId}/backend` -- the "Collection Backend Selected"
|
|
95
235
|
* descriptor (the backend this collection is stored on).
|
|
236
|
+
*
|
|
237
|
+
* @param options {object}
|
|
238
|
+
* @param options.spaceUrl {string}
|
|
239
|
+
* @param options.collectionId {string}
|
|
240
|
+
* @returns {string}
|
|
96
241
|
*/
|
|
97
|
-
export declare function
|
|
242
|
+
export declare function collectionBackendUrl({ spaceUrl, collectionId }: {
|
|
243
|
+
spaceUrl: string;
|
|
244
|
+
collectionId: string;
|
|
245
|
+
}): string;
|
|
98
246
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
247
|
+
* `{spaceUrl}{collectionId}/quota` -- the per-collection storage quota report
|
|
248
|
+
* (spec "Quotas").
|
|
249
|
+
*
|
|
250
|
+
* @param options {object}
|
|
251
|
+
* @param options.spaceUrl {string}
|
|
252
|
+
* @param options.collectionId {string}
|
|
253
|
+
* @returns {string}
|
|
101
254
|
*/
|
|
102
|
-
export declare function
|
|
255
|
+
export declare function collectionQuotaUrl({ spaceUrl, collectionId }: {
|
|
256
|
+
spaceUrl: string;
|
|
257
|
+
collectionId: string;
|
|
258
|
+
}): string;
|
|
103
259
|
/**
|
|
104
|
-
*
|
|
260
|
+
* `{spaceUrl}{collectionId}/meta` -- the Collection Metadata object: the
|
|
105
261
|
* Collection's configuration (`name`, `backend`, `encryption`, `generator`)
|
|
106
262
|
* together with the server-managed timestamps / `createdBy` and the
|
|
107
263
|
* user-writable `custom` and `epoch`, as one object under one validator.
|
|
264
|
+
*
|
|
265
|
+
* @param options {object}
|
|
266
|
+
* @param options.spaceUrl {string}
|
|
267
|
+
* @param options.collectionId {string}
|
|
268
|
+
* @returns {string}
|
|
108
269
|
*/
|
|
109
|
-
export declare function
|
|
270
|
+
export declare function collectionMetaUrl({ spaceUrl, collectionId }: {
|
|
271
|
+
spaceUrl: string;
|
|
272
|
+
collectionId: string;
|
|
273
|
+
}): string;
|
|
110
274
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
275
|
+
* `{spaceUrl}{collectionId}/meta/log` -- the Collection's governing history
|
|
276
|
+
* log sub-resource (JSON Lines). Not a Resource of the Collection: absent from
|
|
277
|
+
* listings and the `changes` feed, and versioned by its own ETag.
|
|
278
|
+
*
|
|
279
|
+
* @param options {object}
|
|
280
|
+
* @param options.spaceUrl {string}
|
|
281
|
+
* @param options.collectionId {string}
|
|
282
|
+
* @returns {string}
|
|
114
283
|
*/
|
|
115
|
-
export declare function
|
|
284
|
+
export declare function collectionLogUrl({ spaceUrl, collectionId }: {
|
|
285
|
+
spaceUrl: string;
|
|
286
|
+
collectionId: string;
|
|
287
|
+
}): string;
|
|
116
288
|
/**
|
|
117
|
-
*
|
|
289
|
+
* `{spaceUrl}{collectionId}/query` -- the collection-level query endpoint,
|
|
118
290
|
* whose body's `profile` selects the query (e.g. `changes`, `blinded-index`).
|
|
291
|
+
*
|
|
292
|
+
* @param options {object}
|
|
293
|
+
* @param options.spaceUrl {string}
|
|
294
|
+
* @param options.collectionId {string}
|
|
295
|
+
* @returns {string}
|
|
119
296
|
*/
|
|
120
|
-
export declare function
|
|
297
|
+
export declare function collectionQueryUrl({ spaceUrl, collectionId }: {
|
|
298
|
+
spaceUrl: string;
|
|
299
|
+
collectionId: string;
|
|
300
|
+
}): string;
|
|
121
301
|
/**
|
|
122
|
-
*
|
|
302
|
+
* `{spaceUrl}{collectionId}/{resourceId}` -- get / put / delete a resource
|
|
123
303
|
* (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
304
|
*
|
|
143
|
-
* @param
|
|
144
|
-
* @param
|
|
145
|
-
* @param
|
|
146
|
-
* @param
|
|
305
|
+
* @param options {object}
|
|
306
|
+
* @param options.spaceUrl {string}
|
|
307
|
+
* @param options.collectionId {string}
|
|
308
|
+
* @param options.resourceId {string}
|
|
147
309
|
* @returns {string}
|
|
148
310
|
*/
|
|
149
|
-
export declare function
|
|
311
|
+
export declare function resourceUrl({ spaceUrl, collectionId, resourceId }: {
|
|
312
|
+
spaceUrl: string;
|
|
313
|
+
collectionId: string;
|
|
314
|
+
resourceId: string;
|
|
315
|
+
}): string;
|
|
150
316
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* slash (the member form, {@link resourceChunkPath}, has none).
|
|
317
|
+
* `{spaceUrl}{collectionId}/{resourceId}/meta` -- the resource metadata
|
|
318
|
+
* object (server-managed properties plus the user-writable `custom` object).
|
|
154
319
|
*
|
|
155
|
-
* @param
|
|
156
|
-
* @param
|
|
157
|
-
* @param
|
|
320
|
+
* @param options {object}
|
|
321
|
+
* @param options.spaceUrl {string}
|
|
322
|
+
* @param options.collectionId {string}
|
|
323
|
+
* @param options.resourceId {string}
|
|
158
324
|
* @returns {string}
|
|
159
325
|
*/
|
|
160
|
-
export declare function
|
|
326
|
+
export declare function resourceMetaUrl({ spaceUrl, collectionId, resourceId }: {
|
|
327
|
+
spaceUrl: string;
|
|
328
|
+
collectionId: string;
|
|
329
|
+
resourceId: string;
|
|
330
|
+
}): string;
|
|
161
331
|
/**
|
|
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.
|
|
332
|
+
* `{spaceUrl}{collectionId}/{resourceId}/policy` -- the resource-level
|
|
333
|
+
* access-control policy resource.
|
|
167
334
|
*
|
|
168
335
|
* @param options {object}
|
|
169
|
-
* @param options.
|
|
336
|
+
* @param options.spaceUrl {string}
|
|
337
|
+
* @param options.collectionId {string}
|
|
338
|
+
* @param options.resourceId {string}
|
|
170
339
|
* @returns {string}
|
|
171
340
|
*/
|
|
172
|
-
export declare function
|
|
173
|
-
|
|
341
|
+
export declare function resourcePolicyUrl({ spaceUrl, collectionId, resourceId }: {
|
|
342
|
+
spaceUrl: string;
|
|
343
|
+
collectionId: string;
|
|
344
|
+
resourceId: string;
|
|
174
345
|
}): string;
|
|
175
346
|
/**
|
|
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.
|
|
347
|
+
* `{spaceUrl}{collectionId}/{resourceId}/chunks/{chunkIndex}` -- a single
|
|
348
|
+
* stored chunk of a chunked Resource. Member form, no trailing slash: get /
|
|
349
|
+
* put / delete one chunk by its ordinal index. The `chunkIndex` is a
|
|
350
|
+
* non-negative integer, emitted verbatim (it is never a reserved or dot
|
|
351
|
+
* segment, so it needs no percent-encoding).
|
|
183
352
|
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* @param
|
|
189
|
-
* @returns {string
|
|
353
|
+
* @param options {object}
|
|
354
|
+
* @param options.spaceUrl {string}
|
|
355
|
+
* @param options.collectionId {string}
|
|
356
|
+
* @param options.resourceId {string}
|
|
357
|
+
* @param options.chunkIndex {number}
|
|
358
|
+
* @returns {string}
|
|
190
359
|
*/
|
|
191
|
-
export declare function
|
|
360
|
+
export declare function resourceChunkUrl({ spaceUrl, collectionId, resourceId, chunkIndex }: {
|
|
361
|
+
spaceUrl: string;
|
|
362
|
+
collectionId: string;
|
|
363
|
+
resourceId: string;
|
|
364
|
+
chunkIndex: number;
|
|
365
|
+
}): string;
|
|
192
366
|
/**
|
|
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.
|
|
367
|
+
* `{spaceUrl}{collectionId}/{resourceId}/chunks/` -- the chunk container of a
|
|
368
|
+
* chunked Resource: its stored chunks, listed. Container form, trailing slash
|
|
369
|
+
* (the member form, {@link resourceChunkUrl}, has none).
|
|
199
370
|
*
|
|
200
371
|
* @param options {object}
|
|
201
|
-
* @param options.
|
|
202
|
-
* @param options.
|
|
372
|
+
* @param options.spaceUrl {string}
|
|
373
|
+
* @param options.collectionId {string}
|
|
374
|
+
* @param options.resourceId {string}
|
|
203
375
|
* @returns {string}
|
|
204
376
|
*/
|
|
205
|
-
export declare function
|
|
206
|
-
|
|
207
|
-
|
|
377
|
+
export declare function resourceChunksUrl({ spaceUrl, collectionId, resourceId }: {
|
|
378
|
+
spaceUrl: string;
|
|
379
|
+
collectionId: string;
|
|
380
|
+
resourceId: string;
|
|
208
381
|
}): string;
|
|
209
382
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
383
|
+
* The canonical (trailing-slash) form of a container URL received from
|
|
384
|
+
* outside and requested as given: the Spaces Repository URL a service
|
|
385
|
+
* description advertises, a public Collection link. The bare form only
|
|
386
|
+
* 308-redirects, and a signed invocation does not survive the redirect, so
|
|
387
|
+
* the slash is added here before the URL is ever requested. This module owns
|
|
388
|
+
* the trailing-slash rules; callers normalize here rather than re-encoding
|
|
389
|
+
* the rule.
|
|
214
390
|
*
|
|
215
|
-
* @param
|
|
391
|
+
* @param url {string} an absolute container URL, in either form
|
|
216
392
|
* @returns {string}
|
|
217
393
|
*/
|
|
218
|
-
export declare function
|
|
394
|
+
export declare function canonicalContainerUrl(url: string): string;
|
|
219
395
|
/**
|
|
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.
|
|
396
|
+
* The classification of a URL beneath a Space by the depth it addresses. The
|
|
397
|
+
* three containment kinds map onto navigational handles; `sub-resource`
|
|
398
|
+
* covers every reserved sub-endpoint the builders above produce (`policy`,
|
|
399
|
+
* `{c}/backend`, `{c}/{r}/meta`, ...), which has no handle of its own.
|
|
225
400
|
*/
|
|
226
401
|
export type ParsedSpacePath = {
|
|
227
402
|
kind: 'space';
|
|
228
|
-
spaceId: string;
|
|
229
403
|
} | {
|
|
230
404
|
kind: 'collection';
|
|
231
|
-
spaceId: string;
|
|
232
405
|
collectionId: string;
|
|
233
406
|
} | {
|
|
234
407
|
kind: 'resource';
|
|
235
|
-
spaceId: string;
|
|
236
408
|
collectionId: string;
|
|
237
409
|
resourceId: string;
|
|
238
410
|
} | {
|
|
239
411
|
kind: 'sub-resource';
|
|
240
|
-
spaceId: string;
|
|
241
412
|
segments: string[];
|
|
242
413
|
};
|
|
243
414
|
/**
|
|
244
|
-
* Classifies an absolute `target` URL
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
415
|
+
* Classifies an absolute `target` URL by where it sits beneath `spaceUrl`:
|
|
416
|
+
* the Space itself, one of its Collections, a Resource, or a reserved
|
|
417
|
+
* sub-endpoint. The inverse of the builders above, kept next to them so the
|
|
418
|
+
* grammar is owned in one place: `WasClient.fromCapability` reads a
|
|
419
|
+
* capability's `invocationTarget` through it, and the builders stay in
|
|
420
|
+
* lockstep.
|
|
421
|
+
*
|
|
422
|
+
* Both URLs are compared in parsed form, so a target serialized by another
|
|
423
|
+
* party (an upper-case host, a default port) still matches. Segments are
|
|
424
|
+
* percent-decoded (the builders re-encode them). Empty segments are dropped,
|
|
425
|
+
* so a container addressed in either form classifies the same: the bare and
|
|
426
|
+
* the trailing-slash form of a Collection are both the Collection. That is
|
|
427
|
+
* deliberate: the builders emit only the canonical form, but the targets
|
|
428
|
+
* parsed here come from capabilities minted elsewhere, and a client that
|
|
429
|
+
* reads only one form would refuse valid ones.
|
|
248
430
|
*
|
|
249
|
-
* Returns `null` when `target` is not beneath `
|
|
250
|
-
* another
|
|
251
|
-
*
|
|
252
|
-
* an error.
|
|
431
|
+
* Returns `null` when `target` is not beneath `spaceUrl` (another origin, or
|
|
432
|
+
* another path), carries a query or fragment, or either URL is malformed.
|
|
433
|
+
* The caller chooses whether that is an error.
|
|
253
434
|
*
|
|
254
435
|
* @param options {object}
|
|
255
|
-
* @param options.
|
|
256
|
-
* @param options.target {string}
|
|
436
|
+
* @param options.spaceUrl {string} the Space URL
|
|
437
|
+
* @param options.target {string} an absolute URL expected beneath it
|
|
257
438
|
* @returns {ParsedSpacePath | null}
|
|
258
439
|
*/
|
|
259
|
-
export declare function parseSpaceTarget({
|
|
260
|
-
|
|
440
|
+
export declare function parseSpaceTarget({ spaceUrl, target }: {
|
|
441
|
+
spaceUrl: string;
|
|
261
442
|
target: string;
|
|
262
443
|
}): 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
444
|
//# sourceMappingURL=paths.d.ts.map
|