@interop/was-client 0.98.0 → 0.99.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 +63 -42
- package/dist/Collection.d.ts +43 -15
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +127 -54
- package/dist/Collection.js.map +1 -1
- package/dist/Resource.d.ts +26 -11
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +26 -11
- package/dist/Resource.js.map +1 -1
- package/dist/WasClient.d.ts +23 -8
- package/dist/WasClient.d.ts.map +1 -1
- package/dist/WasClient.js +31 -15
- package/dist/WasClient.js.map +1 -1
- package/dist/codec.d.ts +6 -14
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js.map +1 -1
- package/dist/edv/EdvCodec.d.ts +2 -1
- package/dist/edv/EdvCodec.d.ts.map +1 -1
- package/dist/edv/EdvCodec.js +348 -105
- package/dist/edv/EdvCodec.js.map +1 -1
- package/dist/edv/WasTransport.d.ts +76 -12
- package/dist/edv/WasTransport.d.ts.map +1 -1
- package/dist/edv/WasTransport.js +76 -11
- package/dist/edv/WasTransport.js.map +1 -1
- package/dist/edv/cipher.d.ts +6 -3
- package/dist/edv/cipher.d.ts.map +1 -1
- package/dist/edv/cipher.js +6 -3
- package/dist/edv/cipher.js.map +1 -1
- package/dist/edv/core.d.ts +1 -1
- package/dist/edv/core.d.ts.map +1 -1
- package/dist/edv/core.js +1 -1
- package/dist/edv/core.js.map +1 -1
- package/dist/edv/docCipher.d.ts +4 -2
- package/dist/edv/docCipher.d.ts.map +1 -1
- package/dist/edv/docCipher.js +17 -12
- package/dist/edv/docCipher.js.map +1 -1
- package/dist/edv/epochCrypto.d.ts +12 -4
- package/dist/edv/epochCrypto.d.ts.map +1 -1
- package/dist/edv/epochCrypto.js +37 -10
- package/dist/edv/epochCrypto.js.map +1 -1
- package/dist/edv/epochKeys.d.ts +6 -2
- package/dist/edv/epochKeys.d.ts.map +1 -1
- package/dist/edv/epochKeys.js +25 -14
- package/dist/edv/epochKeys.js.map +1 -1
- package/dist/edv/hmacKey.d.ts +7 -1
- package/dist/edv/hmacKey.d.ts.map +1 -1
- package/dist/edv/hmacKey.js +9 -3
- package/dist/edv/hmacKey.js.map +1 -1
- package/dist/edv/index.d.ts +2 -1
- package/dist/edv/index.d.ts.map +1 -1
- package/dist/edv/index.js +1 -1
- package/dist/edv/index.js.map +1 -1
- package/dist/edv/recipients.d.ts.map +1 -1
- package/dist/edv/recipients.js +2 -0
- package/dist/edv/recipients.js.map +1 -1
- package/dist/edv/transportFactory.d.ts.map +1 -1
- package/dist/edv/transportFactory.js +3 -2
- package/dist/edv/transportFactory.js.map +1 -1
- package/dist/errors.d.ts +19 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +22 -11
- package/dist/errors.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 +51 -2
- package/dist/internal/codec.d.ts.map +1 -1
- package/dist/internal/codec.js +53 -21
- package/dist/internal/codec.js.map +1 -1
- package/dist/internal/indexSchema.d.ts +30 -0
- package/dist/internal/indexSchema.d.ts.map +1 -1
- package/dist/internal/indexSchema.js +40 -0
- package/dist/internal/indexSchema.js.map +1 -1
- package/dist/internal/memo.d.ts +13 -4
- package/dist/internal/memo.d.ts.map +1 -1
- package/dist/internal/memo.js +18 -7
- package/dist/internal/memo.js.map +1 -1
- package/dist/internal/meta.d.ts +9 -3
- package/dist/internal/meta.d.ts.map +1 -1
- package/dist/internal/meta.js +13 -7
- package/dist/internal/meta.js.map +1 -1
- package/dist/internal/pagination.d.ts +30 -15
- package/dist/internal/pagination.d.ts.map +1 -1
- package/dist/internal/pagination.js +31 -17
- package/dist/internal/pagination.js.map +1 -1
- package/dist/internal/paths.d.ts +11 -0
- package/dist/internal/paths.d.ts.map +1 -1
- package/dist/internal/paths.js +13 -0
- package/dist/internal/paths.js.map +1 -1
- package/dist/internal/request.d.ts +9 -0
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/request.js +31 -3
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/write.d.ts +10 -10
- package/dist/internal/write.d.ts.map +1 -1
- package/dist/internal/write.js +23 -30
- package/dist/internal/write.js.map +1 -1
- package/dist/sync/index.d.ts +4 -2
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +4 -2
- package/dist/sync/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* memory would leave every other reader unable to learn them.
|
|
16
16
|
*/
|
|
17
17
|
import type { IndexSchema } from '../codec.js';
|
|
18
|
+
import type { ResourceMetadataCustomInput } from '../types.js';
|
|
18
19
|
/**
|
|
19
20
|
* The property the schema is stored under inside the collection's metadata
|
|
20
21
|
* `custom` object, alongside the user's own `name` / `tags`.
|
|
@@ -115,5 +116,34 @@ export declare function assertQueryAttributes({ schema, equals, has }: {
|
|
|
115
116
|
equals?: Record<string, unknown> | Array<Record<string, unknown>>;
|
|
116
117
|
has?: string | string[];
|
|
117
118
|
}): void;
|
|
119
|
+
/**
|
|
120
|
+
* The `custom` a full-replacement Collection annotation write sends: the
|
|
121
|
+
* caller's `custom`, plus the stored schema when the caller's names none of
|
|
122
|
+
* its own. The schema is collection state this module owns rather than an
|
|
123
|
+
* annotation the caller is replacing, so a write about `name` / `tags` must
|
|
124
|
+
* not clear it on the way through. A `custom` that names the `indexSchema`
|
|
125
|
+
* member (a `declareIndex` write, the read-merge-write sugar, or a caller
|
|
126
|
+
* clearing the schema with `indexSchema: undefined`) is returned as given.
|
|
127
|
+
*
|
|
128
|
+
* The stored `custom` is opened only when there is something to carry, which
|
|
129
|
+
* is what the `stored` thunk is for: on an encrypted collection the open is a
|
|
130
|
+
* decrypt, and the caller usually holds the opened value from the `meta()`
|
|
131
|
+
* read the write composes against. An opened value that is not an object (a
|
|
132
|
+
* stored `custom` this client cannot open, or a foreign writer's scalar)
|
|
133
|
+
* carries nothing: the write goes out as given, which keeps `setMeta` the way
|
|
134
|
+
* to replace such a value. The same policy the configuration write applies
|
|
135
|
+
* when it cannot re-seal the stored `custom`.
|
|
136
|
+
*
|
|
137
|
+
* @param options {object}
|
|
138
|
+
* @param options.custom {ResourceMetadataCustomInput} the write's `custom`
|
|
139
|
+
* @param options.stored {function} resolves the stored `custom` opened
|
|
140
|
+
* through the codec, or `undefined` when there is none or it cannot be
|
|
141
|
+
* opened here
|
|
142
|
+
* @returns {Promise<ResourceMetadataCustomInput>}
|
|
143
|
+
*/
|
|
144
|
+
export declare function withStoredIndexSchema({ custom, stored }: {
|
|
145
|
+
custom: ResourceMetadataCustomInput;
|
|
146
|
+
stored: () => Promise<unknown>;
|
|
147
|
+
}): Promise<ResourceMetadataCustomInput>;
|
|
118
148
|
export {};
|
|
119
149
|
//# sourceMappingURL=indexSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexSchema.d.ts","sourceRoot":"","sources":["../../src/internal/indexSchema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"indexSchema.d.ts","sourceRoot":"","sources":["../../src/internal/indexSchema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,aAAa,CAAA;AAEhE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,gBAAgB,CAAA;AAElD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAA0C,CAAA;AAE3E;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC5D,WAAW,CAAC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EACP,EAAE;IACD,MAAM,EAAE,2BAA2B,CAAA;IACnC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CAC/B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAkBvC"}
|
|
@@ -189,4 +189,44 @@ export function assertQueryAttributes({ schema, equals, has }) {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* The `custom` a full-replacement Collection annotation write sends: the
|
|
194
|
+
* caller's `custom`, plus the stored schema when the caller's names none of
|
|
195
|
+
* its own. The schema is collection state this module owns rather than an
|
|
196
|
+
* annotation the caller is replacing, so a write about `name` / `tags` must
|
|
197
|
+
* not clear it on the way through. A `custom` that names the `indexSchema`
|
|
198
|
+
* member (a `declareIndex` write, the read-merge-write sugar, or a caller
|
|
199
|
+
* clearing the schema with `indexSchema: undefined`) is returned as given.
|
|
200
|
+
*
|
|
201
|
+
* The stored `custom` is opened only when there is something to carry, which
|
|
202
|
+
* is what the `stored` thunk is for: on an encrypted collection the open is a
|
|
203
|
+
* decrypt, and the caller usually holds the opened value from the `meta()`
|
|
204
|
+
* read the write composes against. An opened value that is not an object (a
|
|
205
|
+
* stored `custom` this client cannot open, or a foreign writer's scalar)
|
|
206
|
+
* carries nothing: the write goes out as given, which keeps `setMeta` the way
|
|
207
|
+
* to replace such a value. The same policy the configuration write applies
|
|
208
|
+
* when it cannot re-seal the stored `custom`.
|
|
209
|
+
*
|
|
210
|
+
* @param options {object}
|
|
211
|
+
* @param options.custom {ResourceMetadataCustomInput} the write's `custom`
|
|
212
|
+
* @param options.stored {function} resolves the stored `custom` opened
|
|
213
|
+
* through the codec, or `undefined` when there is none or it cannot be
|
|
214
|
+
* opened here
|
|
215
|
+
* @returns {Promise<ResourceMetadataCustomInput>}
|
|
216
|
+
*/
|
|
217
|
+
export async function withStoredIndexSchema({ custom, stored }) {
|
|
218
|
+
if (INDEX_SCHEMA_PROPERTY in custom) {
|
|
219
|
+
return custom;
|
|
220
|
+
}
|
|
221
|
+
const opened = await stored();
|
|
222
|
+
if (opened === null ||
|
|
223
|
+
typeof opened !== 'object' ||
|
|
224
|
+
!(INDEX_SCHEMA_PROPERTY in opened)) {
|
|
225
|
+
return custom;
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
...custom,
|
|
229
|
+
[INDEX_SCHEMA_PROPERTY]: opened[INDEX_SCHEMA_PROPERTY]
|
|
230
|
+
};
|
|
231
|
+
}
|
|
192
232
|
//# sourceMappingURL=indexSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexSchema.js","sourceRoot":"","sources":["../../src/internal/indexSchema.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"indexSchema.js","sourceRoot":"","sources":["../../src/internal/indexSchema.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAG9C;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAA;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgB,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;AAU3E;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAA4B;IAE5B,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvD,OAAO,SAAS,CAAC,CAAC,CAAE,CAAA;IACtB,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,SAA4B;IACvD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IA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AI,MAAM,CAAC,EAClC,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IACD,OAAO;QACL,GAAG,MAAM;QACT,CAAC,qBAAqB,CAAC,EAAG,MAAgC,CACxD,qBAAqB,CACtB;KACF,CAAA;AACH,CAAC"}
|
package/dist/internal/memo.d.ts
CHANGED
|
@@ -8,21 +8,30 @@
|
|
|
8
8
|
* properties: concurrent callers share one round-trip, a rejection is not
|
|
9
9
|
* cached (so the next call retries rather than replaying a stale failure), and
|
|
10
10
|
* a reset drops whatever is held. Written once here so the three cannot drift
|
|
11
|
-
* apart, which they had.
|
|
11
|
+
* apart, which they had. A user whose input cannot change under it may name
|
|
12
|
+
* the rejections it wants kept, so a permanent failure is raised once and then
|
|
13
|
+
* replayed instead of re-attempted.
|
|
12
14
|
*/
|
|
13
15
|
/**
|
|
14
16
|
* A memo of one lazily-resolved value. Holds the in-flight promise so
|
|
15
17
|
* concurrent callers share a single resolution, drops it on rejection so a
|
|
16
|
-
* transient failure does not permanently poison the memo
|
|
17
|
-
* {@link Memo.reset} for when the
|
|
18
|
+
* transient failure does not permanently poison the memo (unless `retain`
|
|
19
|
+
* claims that rejection), and exposes {@link Memo.reset} for when the
|
|
20
|
+
* underlying answer is known to have changed.
|
|
18
21
|
*/
|
|
19
22
|
export declare class Memo<T> {
|
|
20
23
|
#private;
|
|
21
24
|
/**
|
|
22
25
|
* @param resolve {function} resolves a fresh value; re-invoked after a
|
|
23
26
|
* rejection or a `reset()`, else called at most once
|
|
27
|
+
* @param [options] {object}
|
|
28
|
+
* @param [options.retain] {function} given a rejection's reason, whether
|
|
29
|
+
* to keep that rejection memoized (a failure a retry cannot change);
|
|
30
|
+
* default: keep none
|
|
24
31
|
*/
|
|
25
|
-
constructor(resolve: () => Promise<T
|
|
32
|
+
constructor(resolve: () => Promise<T>, { retain }?: {
|
|
33
|
+
retain?: (err: unknown) => boolean;
|
|
34
|
+
});
|
|
26
35
|
/**
|
|
27
36
|
* Whether a resolution is already held -- in flight or settled. Lets a caller
|
|
28
37
|
* tell, synchronously and before calling {@link Memo.get}, whether its own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../../src/internal/memo.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../../src/internal/memo.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,qBAAa,IAAI,CAAC,CAAC;;IAKjB;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,EAAE,MAAoB,EAAE,GAAE;QAAE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAA;KAAO;IAMvE;;;;;;OAMG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;OAIG;IACH,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC;IAmBjB;;;;OAIG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
package/dist/internal/memo.js
CHANGED
|
@@ -8,23 +8,32 @@
|
|
|
8
8
|
* properties: concurrent callers share one round-trip, a rejection is not
|
|
9
9
|
* cached (so the next call retries rather than replaying a stale failure), and
|
|
10
10
|
* a reset drops whatever is held. Written once here so the three cannot drift
|
|
11
|
-
* apart, which they had.
|
|
11
|
+
* apart, which they had. A user whose input cannot change under it may name
|
|
12
|
+
* the rejections it wants kept, so a permanent failure is raised once and then
|
|
13
|
+
* replayed instead of re-attempted.
|
|
12
14
|
*/
|
|
13
15
|
/**
|
|
14
16
|
* A memo of one lazily-resolved value. Holds the in-flight promise so
|
|
15
17
|
* concurrent callers share a single resolution, drops it on rejection so a
|
|
16
|
-
* transient failure does not permanently poison the memo
|
|
17
|
-
* {@link Memo.reset} for when the
|
|
18
|
+
* transient failure does not permanently poison the memo (unless `retain`
|
|
19
|
+
* claims that rejection), and exposes {@link Memo.reset} for when the
|
|
20
|
+
* underlying answer is known to have changed.
|
|
18
21
|
*/
|
|
19
22
|
export class Memo {
|
|
20
23
|
#promise;
|
|
21
24
|
#resolve;
|
|
25
|
+
#retain;
|
|
22
26
|
/**
|
|
23
27
|
* @param resolve {function} resolves a fresh value; re-invoked after a
|
|
24
28
|
* rejection or a `reset()`, else called at most once
|
|
29
|
+
* @param [options] {object}
|
|
30
|
+
* @param [options.retain] {function} given a rejection's reason, whether
|
|
31
|
+
* to keep that rejection memoized (a failure a retry cannot change);
|
|
32
|
+
* default: keep none
|
|
25
33
|
*/
|
|
26
|
-
constructor(resolve) {
|
|
34
|
+
constructor(resolve, { retain = () => false } = {}) {
|
|
27
35
|
this.#resolve = resolve;
|
|
36
|
+
this.#retain = retain;
|
|
28
37
|
}
|
|
29
38
|
/**
|
|
30
39
|
* Whether a resolution is already held -- in flight or settled. Lets a caller
|
|
@@ -48,10 +57,12 @@ export class Memo {
|
|
|
48
57
|
const promise = this.#resolve();
|
|
49
58
|
// Memoize the in-flight promise so concurrent callers share one round-trip,
|
|
50
59
|
// but drop it on rejection so a transient failure does not permanently
|
|
51
|
-
// poison the memo.
|
|
60
|
+
// poison the memo. A rejection `retain` claims stays, so the next `get()`
|
|
61
|
+
// replays it rather than paying for an attempt that can only fail the same
|
|
62
|
+
// way. The identity guard avoids clobbering a newer promise.
|
|
52
63
|
this.#promise = promise;
|
|
53
|
-
promise.catch(() => {
|
|
54
|
-
if (this.#promise === promise) {
|
|
64
|
+
promise.catch((err) => {
|
|
65
|
+
if (this.#promise === promise && !this.#retain(err)) {
|
|
55
66
|
this.#promise = undefined;
|
|
56
67
|
}
|
|
57
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memo.js","sourceRoot":"","sources":["../../src/internal/memo.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"memo.js","sourceRoot":"","sources":["../../src/internal/memo.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,MAAM,OAAO,IAAI;IACf,QAAQ,CAAa;IACZ,QAAQ,CAAkB;IAC1B,OAAO,CAA2B;IAE3C;;;;;;;OAOG;IACH,YACE,OAAyB,EACzB,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC,KAAK,KAA6C,EAAE;QAErE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;IACvB,CAAC;IAED;;;;;;OAMG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAA;IACpC,CAAC;IAED;;;;OAIG;IACH,GAAG;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAA;QACtB,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC/B,4EAA4E;QAC5E,uEAAuE;QACvE,0EAA0E;QAC1E,2EAA2E;QAC3E,6DAA6D;QAC7D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,OAAO,CAAC,KAAK,CAAC,CAAC,GAAY,EAAQ,EAAE;YACnC,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAA;YAC3B,CAAC;QACH,CAAC,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAA;IAC3B,CAAC;CACF"}
|
package/dist/internal/meta.d.ts
CHANGED
|
@@ -18,9 +18,11 @@ import type { IZcap, ResourceMetadataCustom, ResourceMetadataCustomInput } from
|
|
|
18
18
|
* encrypting codec's envelope-binding check
|
|
19
19
|
* @param [options.capability] {IZcap}
|
|
20
20
|
* @param [options.onStored] {function} receives the document as served, with
|
|
21
|
-
* its validator and its `custom` still undecoded,
|
|
22
|
-
* caller whose next step is a full-replacement write of
|
|
23
|
-
* can compose that write against the read it just paid
|
|
21
|
+
* its validator and its `custom` still undecoded, plus the decoded `custom`
|
|
22
|
+
* beside it -- so a caller whose next step is a full-replacement write of
|
|
23
|
+
* the same document can compose that write against the read it just paid
|
|
24
|
+
* for, without opening the `custom` a second time. Not called when the
|
|
25
|
+
* decode fails: a read that throws is no baseline
|
|
24
26
|
* @returns {Promise<(Metadata & { etag?: string }) | null>}
|
|
25
27
|
*/
|
|
26
28
|
export declare function readMeta<Metadata extends {
|
|
@@ -34,6 +36,7 @@ export declare function readMeta<Metadata extends {
|
|
|
34
36
|
onStored?: (read: {
|
|
35
37
|
metadata: Record<string, unknown>;
|
|
36
38
|
etag?: string;
|
|
39
|
+
opened: ResourceMetadataCustom;
|
|
37
40
|
}) => void;
|
|
38
41
|
}): Promise<(Metadata & {
|
|
39
42
|
etag?: string;
|
|
@@ -128,6 +131,9 @@ export declare function patchCustom(handle: {
|
|
|
128
131
|
* to you (WAS returns 404 for both not-found and unauthorized); `etag` is
|
|
129
132
|
* absent against a backend that does not version the object.
|
|
130
133
|
*
|
|
134
|
+
* Also `null` when the capability's invocation target does not contain the
|
|
135
|
+
* object (a resource-scoped grant, typically); see `send()`.
|
|
136
|
+
*
|
|
131
137
|
* @param context {ClientContext}
|
|
132
138
|
* @param options {object}
|
|
133
139
|
* @param options.spaceId {string}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AA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,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GACrE,OAAO,CAAC;IAAE,QAAQ,EAAE,wBAAwB,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAYvE"}
|
package/dist/internal/meta.js
CHANGED
|
@@ -43,9 +43,11 @@ import { withCodec } from './withCodec.js';
|
|
|
43
43
|
* encrypting codec's envelope-binding check
|
|
44
44
|
* @param [options.capability] {IZcap}
|
|
45
45
|
* @param [options.onStored] {function} receives the document as served, with
|
|
46
|
-
* its validator and its `custom` still undecoded,
|
|
47
|
-
* caller whose next step is a full-replacement write of
|
|
48
|
-
* can compose that write against the read it just paid
|
|
46
|
+
* its validator and its `custom` still undecoded, plus the decoded `custom`
|
|
47
|
+
* beside it -- so a caller whose next step is a full-replacement write of
|
|
48
|
+
* the same document can compose that write against the read it just paid
|
|
49
|
+
* for, without opening the `custom` a second time. Not called when the
|
|
50
|
+
* decode fails: a read that throws is no baseline
|
|
49
51
|
* @returns {Promise<(Metadata & { etag?: string }) | null>}
|
|
50
52
|
*/
|
|
51
53
|
export async function readMeta(context, { metaPath, codec: codecPromise, subject, slot, capability, onStored }) {
|
|
@@ -74,15 +76,16 @@ export async function readMeta(context, { metaPath, codec: codecPromise, subject
|
|
|
74
76
|
}
|
|
75
77
|
const metadata = response.data;
|
|
76
78
|
const etagBeforeDecode = readEtag(response);
|
|
77
|
-
onStored?.({
|
|
78
|
-
metadata: metadata,
|
|
79
|
-
...(etagBeforeDecode !== undefined && { etag: etagBeforeDecode })
|
|
80
|
-
});
|
|
81
79
|
// Decode the user-writable `custom` (decrypting it on an encrypted
|
|
82
80
|
// collection) so callers uniformly see plaintext `{ name, tags }`. The
|
|
83
81
|
// stated slot drives the encrypting codec's binding check: in the
|
|
84
82
|
// Collection slot it refuses a resource-bound envelope served there.
|
|
85
83
|
const custom = await codec.decodeMeta({ custom: metadata.custom }, slot);
|
|
84
|
+
onStored?.({
|
|
85
|
+
metadata: metadata,
|
|
86
|
+
...(etagBeforeDecode !== undefined && { etag: etagBeforeDecode }),
|
|
87
|
+
opened: custom
|
|
88
|
+
});
|
|
86
89
|
const decoded = { ...metadata, custom };
|
|
87
90
|
return etagBeforeDecode !== undefined
|
|
88
91
|
? { ...decoded, etag: etagBeforeDecode }
|
|
@@ -197,6 +200,9 @@ export async function patchCustom(handle, patch, { operation = 'Metadata update'
|
|
|
197
200
|
* to you (WAS returns 404 for both not-found and unauthorized); `etag` is
|
|
198
201
|
* absent against a backend that does not version the object.
|
|
199
202
|
*
|
|
203
|
+
* Also `null` when the capability's invocation target does not contain the
|
|
204
|
+
* object (a resource-scoped grant, typically); see `send()`.
|
|
205
|
+
*
|
|
200
206
|
* @param context {ClientContext}
|
|
201
207
|
* @param options {object}
|
|
202
208
|
* @param options.spaceId {string}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAG3C,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAO1C
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/internal/meta.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,aAAa,EAAE,cAAc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C/C,CAAC;SACF;QACD,SAAS;QACT,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;KAC5C,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAsB,EACtB,OAAsE;IAEtE,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAA2B,OAAO,EAAE;QACrE,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC;QAC3D,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAA;IACF,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,IAAI;QACnB,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;KACpD,CAAA;AACH,CAAC"}
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
* The helpers are generic over the listing envelope, so they serve all three
|
|
20
20
|
* paginated WAS listings: List Collection items (`CollectionResourcesList`),
|
|
21
21
|
* List Collections (`CollectionsList`), and List Spaces (`SpaceListing`). Each
|
|
22
|
-
* envelope shares the `{ items, next? }` shape
|
|
22
|
+
* envelope shares the `{ items, next?, totalItems? }` shape (`PageEnvelope`)
|
|
23
|
+
* that the traversal and the aggregation rely on.
|
|
23
24
|
*/
|
|
24
25
|
import type { CollectionResourcesList, IZcap, ResourceSummary } from '../types.js';
|
|
25
26
|
import type { ClientContext } from './request.js';
|
|
@@ -30,18 +31,22 @@ import type { ClientContext } from './request.js';
|
|
|
30
31
|
*/
|
|
31
32
|
export declare const DEFAULT_MAX_PAGES = 10000;
|
|
32
33
|
/**
|
|
33
|
-
* The shared shape of every paginated listing envelope: an `items` array
|
|
34
|
-
* optional `next` continuation URL
|
|
35
|
-
*
|
|
34
|
+
* The shared shape of every paginated listing envelope: an `items` array, an
|
|
35
|
+
* optional `next` continuation URL, and the whole listing's `totalItems` count
|
|
36
|
+
* (required on some listing types upstream, optional on others). The traversal
|
|
37
|
+
* core only touches `items` and `next`; `collectPages` also sets `totalItems`.
|
|
36
38
|
*/
|
|
37
39
|
type PageEnvelope = {
|
|
38
40
|
items: unknown[];
|
|
39
41
|
next?: string;
|
|
42
|
+
totalItems?: number;
|
|
40
43
|
};
|
|
41
44
|
/**
|
|
42
45
|
* The first page (already read) plus the means to fetch each following page.
|
|
43
46
|
* The `fetchPage` callback fetches a single page by absolute URL, returning
|
|
44
|
-
* `null` if it is missing/unauthorized
|
|
47
|
+
* `null` if it is missing/unauthorized. A `null` first page makes the walk
|
|
48
|
+
* itself `null`; a `null` page mid-walk fails the walk, since a `next` the
|
|
49
|
+
* server handed out has to resolve.
|
|
45
50
|
*/
|
|
46
51
|
export interface PageWalk<T extends PageEnvelope = CollectionResourcesList> {
|
|
47
52
|
first: T;
|
|
@@ -85,33 +90,43 @@ export declare function signedPageWalk<T extends PageEnvelope = CollectionResour
|
|
|
85
90
|
/**
|
|
86
91
|
* Lazily walks a list response page by page, yielding the first page and then
|
|
87
92
|
* each page reached by following `next`. Each `next` is resolved relative to the
|
|
88
|
-
* URL of the page that produced it
|
|
89
|
-
*
|
|
90
|
-
* page at a time, so a consumer can stop early without fetching the rest.
|
|
93
|
+
* URL of the page that produced it. Yields one page at a time, so a consumer
|
|
94
|
+
* can stop early without fetching the rest.
|
|
91
95
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
+
* The walk either reaches the server's end-of-list signal (a page with no
|
|
97
|
+
* `next`) or fails. A `next` outside the first page's origin or base path, a
|
|
98
|
+
* `next` carrying a username or password, a `next` pointing at an already-seen
|
|
99
|
+
* page (a cycle), a page that walks past `maxPages`, or a followed page that
|
|
100
|
+
* comes back `null` (missing/unauthorized) each fail with a `WasServerError`
|
|
101
|
+
* naming the listing URL. Ending silently on any of these would hand the
|
|
102
|
+
* consumer a short listing it cannot tell from a complete one.
|
|
96
103
|
*
|
|
97
104
|
* @param walk {PageWalk<T>}
|
|
98
105
|
* @param [options] {object}
|
|
99
106
|
* @param [options.maxPages] {number} the most pages to yield, counting the
|
|
100
107
|
* first (defaults to {@link DEFAULT_MAX_PAGES})
|
|
101
108
|
* @returns {AsyncGenerator<T>}
|
|
102
|
-
* @throws {WasServerError} when `next` leaves the listing
|
|
109
|
+
* @throws {WasServerError} when `next` leaves the listing, repeats a page, or
|
|
110
|
+
* fails to resolve, or when the page bound is hit
|
|
103
111
|
*/
|
|
104
112
|
export declare function walkPages<T extends PageEnvelope = CollectionResourcesList>(walk: PageWalk<T>, { maxPages }?: {
|
|
105
113
|
maxPages?: number;
|
|
106
114
|
}): AsyncGenerator<T>;
|
|
107
115
|
/**
|
|
108
116
|
* Eagerly follows every `next` link, aggregating all pages' items into a single
|
|
109
|
-
* envelope shaped like the first page
|
|
110
|
-
* has been collected
|
|
117
|
+
* envelope shaped like the first page, with `next` dropped since the whole list
|
|
118
|
+
* has been collected. Buffers the entire collection in memory; for a large
|
|
111
119
|
* collection prefer `walkPages` (one page at a time) or an item iterator.
|
|
112
120
|
*
|
|
121
|
+
* `totalItems` on the aggregate is always the count of the collected items.
|
|
122
|
+
* The server's value is not used, since a paginating server may omit it on a
|
|
123
|
+
* truncated page and the first page's value may be stale by the time the last
|
|
124
|
+
* page is read. The count is sound because `walkPages` either completes the
|
|
125
|
+
* listing or throws.
|
|
126
|
+
*
|
|
113
127
|
* @param walk {PageWalk<T>}
|
|
114
128
|
* @returns {Promise<T>}
|
|
129
|
+
* @throws {WasServerError} when the walk cannot complete the listing
|
|
115
130
|
*/
|
|
116
131
|
export declare function collectPages<T extends PageEnvelope = CollectionResourcesList>(walk: PageWalk<T>): Promise<T>;
|
|
117
132
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EACV,uBAAuB,EACvB,KAAK,EACL,eAAe,EAChB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAKjD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAS,CAAA;AAEvC;;;;;GAKG;AACH,KAAK,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5E;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,YAAY,GAAG,uBAAuB;IACxE,KAAK,EAAE,CAAC,CAAA;IACR,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;CAC9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,CAAC,SAAS,YAAY,GAAG,uBAAuB,EAChD,EACA,QAAQ,EACR,SAAS,EACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;CACpC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAG9B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAClC,CAAC,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a list response page by page, yielding the first page and then
|
|
92
92
|
* each page reached by following `next`. Each `next` is resolved relative to the
|
|
93
|
-
* URL of the page that produced it
|
|
94
|
-
*
|
|
95
|
-
* page at a time, so a consumer can stop early without fetching the rest.
|
|
93
|
+
* URL of the page that produced it. Yields one page at a time, so a consumer
|
|
94
|
+
* can stop early without fetching the rest.
|
|
96
95
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
96
|
+
* The walk either reaches the server's end-of-list signal (a page with no
|
|
97
|
+
* `next`) or fails. A `next` outside the first page's origin or base path, a
|
|
98
|
+
* `next` carrying a username or password, a `next` pointing at an already-seen
|
|
99
|
+
* page (a cycle), a page that walks past `maxPages`, or a followed page that
|
|
100
|
+
* comes back `null` (missing/unauthorized) each fail with a `WasServerError`
|
|
101
|
+
* naming the listing URL. Ending silently on any of these would hand the
|
|
102
|
+
* consumer a short listing it cannot tell from a complete one.
|
|
101
103
|
*
|
|
102
104
|
* @param walk {PageWalk<T>}
|
|
103
105
|
* @param [options] {object}
|
|
104
106
|
* @param [options.maxPages] {number} the most pages to yield, counting the
|
|
105
107
|
* first (defaults to {@link DEFAULT_MAX_PAGES})
|
|
106
108
|
* @returns {AsyncGenerator<T>}
|
|
107
|
-
* @throws {WasServerError} when `next` leaves the listing
|
|
109
|
+
* @throws {WasServerError} when `next` leaves the listing, repeats a page, or
|
|
110
|
+
* fails to resolve, or when the page bound is hit
|
|
108
111
|
*/
|
|
109
112
|
export async function* walkPages(walk, { maxPages = DEFAULT_MAX_PAGES } = {}) {
|
|
110
113
|
const { first, fetchPage } = walk;
|
|
@@ -114,24 +117,28 @@ export async function* walkPages(walk, { maxPages = DEFAULT_MAX_PAGES } = {}) {
|
|
|
114
117
|
// an explicit default port) would let a next-link back to page 1 defeat the
|
|
115
118
|
// guard and yield its items twice.
|
|
116
119
|
const firstUrl = new URL(walk.firstUrl);
|
|
120
|
+
const listingUrl = firstUrl.toString();
|
|
117
121
|
yield first;
|
|
118
|
-
const seen = new Set([
|
|
122
|
+
const seen = new Set([listingUrl]);
|
|
119
123
|
let pageCount = 1;
|
|
120
|
-
let baseUrl =
|
|
124
|
+
let baseUrl = listingUrl;
|
|
121
125
|
let next = first.next;
|
|
122
126
|
while (next) {
|
|
123
127
|
const pageUrl = resolveNext({ next, baseUrl, firstUrl });
|
|
124
128
|
if (seen.has(pageUrl)) {
|
|
125
|
-
|
|
129
|
+
throw new WasServerError(`The listing at "${listingUrl}" served a \`next\` link ` +
|
|
130
|
+
`("${pageUrl}") back to a page already walked.`, { requestUrl: listingUrl });
|
|
126
131
|
}
|
|
127
132
|
if (pageCount >= maxPages) {
|
|
128
|
-
throw new WasServerError(`The listing at "${
|
|
129
|
-
`${maxPages} pages.`, { requestUrl:
|
|
133
|
+
throw new WasServerError(`The listing at "${listingUrl}" did not end within ` +
|
|
134
|
+
`${maxPages} pages.`, { requestUrl: listingUrl });
|
|
130
135
|
}
|
|
131
136
|
seen.add(pageUrl);
|
|
132
137
|
const page = await fetchPage(pageUrl);
|
|
133
138
|
if (page === null) {
|
|
134
|
-
|
|
139
|
+
throw new WasServerError(`The listing at "${listingUrl}" served a \`next\` link ` +
|
|
140
|
+
`("${pageUrl}") that answered with no listing (missing or ` +
|
|
141
|
+
'unauthorized).', { requestUrl: pageUrl });
|
|
135
142
|
}
|
|
136
143
|
pageCount += 1;
|
|
137
144
|
yield page;
|
|
@@ -141,12 +148,19 @@ export async function* walkPages(walk, { maxPages = DEFAULT_MAX_PAGES } = {}) {
|
|
|
141
148
|
}
|
|
142
149
|
/**
|
|
143
150
|
* Eagerly follows every `next` link, aggregating all pages' items into a single
|
|
144
|
-
* envelope shaped like the first page
|
|
145
|
-
* has been collected
|
|
151
|
+
* envelope shaped like the first page, with `next` dropped since the whole list
|
|
152
|
+
* has been collected. Buffers the entire collection in memory; for a large
|
|
146
153
|
* collection prefer `walkPages` (one page at a time) or an item iterator.
|
|
147
154
|
*
|
|
155
|
+
* `totalItems` on the aggregate is always the count of the collected items.
|
|
156
|
+
* The server's value is not used, since a paginating server may omit it on a
|
|
157
|
+
* truncated page and the first page's value may be stale by the time the last
|
|
158
|
+
* page is read. The count is sound because `walkPages` either completes the
|
|
159
|
+
* listing or throws.
|
|
160
|
+
*
|
|
148
161
|
* @param walk {PageWalk<T>}
|
|
149
162
|
* @returns {Promise<T>}
|
|
163
|
+
* @throws {WasServerError} when the walk cannot complete the listing
|
|
150
164
|
*/
|
|
151
165
|
export async function collectPages(walk) {
|
|
152
166
|
let aggregate;
|
|
@@ -160,7 +174,7 @@ export async function collectPages(walk) {
|
|
|
160
174
|
}
|
|
161
175
|
}
|
|
162
176
|
// `walkPages` always yields `first`, so `aggregate` is set here.
|
|
163
|
-
const result = { ...aggregate, items };
|
|
177
|
+
const result = { ...aggregate, items, totalItems: items.length };
|
|
164
178
|
delete result.next;
|
|
165
179
|
return result;
|
|
166
180
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAuBvC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAEjC,EACA,QAAQ,EACR,SAAS,EAIV;IACC,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAA;IACvC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CA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AAyD;QACzD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,CAAC;IACH,CAAC;IACD,iEAAiE;IACjE,MAAM,MAAM,GAAM,EAAE,GAAG,SAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,CAAA;IACpE,OAAO,MAAM,CAAC,IAAI,CAAA;IAClB,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAE/B,IAAwB;IACxB,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,gBAAgB,CAErC,IAAwB;IACxB,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IACxB,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,SAAS,CAC9B,KAA6C;IAE7C,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC/B,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;AACH,CAAC"}
|
package/dist/internal/paths.d.ts
CHANGED
|
@@ -147,6 +147,17 @@ export declare function resourcePolicy(spaceId: string, collectionId: string, re
|
|
|
147
147
|
* @returns {string}
|
|
148
148
|
*/
|
|
149
149
|
export declare function resourceChunkPath(spaceId: string, collectionId: string, resourceId: string, chunkIndex: number): string;
|
|
150
|
+
/**
|
|
151
|
+
* `/space/:spaceId/:collectionId/:resourceId/chunks/` -- the chunk container
|
|
152
|
+
* of a chunked Resource: its stored chunks, listed. Container form, trailing
|
|
153
|
+
* slash (the member form, {@link resourceChunkPath}, has none).
|
|
154
|
+
*
|
|
155
|
+
* @param spaceId {string}
|
|
156
|
+
* @param collectionId {string}
|
|
157
|
+
* @param resourceId {string}
|
|
158
|
+
* @returns {string}
|
|
159
|
+
*/
|
|
160
|
+
export declare function resourceChunksPath(spaceId: string, collectionId: string, resourceId: string): string;
|
|
150
161
|
/**
|
|
151
162
|
* The Spaces Repository URL beneath a server base URL: the reserved `spaces`
|
|
152
163
|
* segment at the server root, in canonical trailing-slash form. This is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/internal/paths.ts"],"names":[],"mappings":"AA8GA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;GAGG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