@interop/was-client 0.15.0 → 0.17.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.
Files changed (85) hide show
  1. package/dist/Collection.d.ts +17 -26
  2. package/dist/Collection.d.ts.map +1 -1
  3. package/dist/Collection.js +60 -59
  4. package/dist/Collection.js.map +1 -1
  5. package/dist/Resource.d.ts +27 -3
  6. package/dist/Resource.d.ts.map +1 -1
  7. package/dist/Resource.js +60 -22
  8. package/dist/Resource.js.map +1 -1
  9. package/dist/Space.d.ts +26 -2
  10. package/dist/Space.d.ts.map +1 -1
  11. package/dist/Space.js +66 -18
  12. package/dist/Space.js.map +1 -1
  13. package/dist/WasClient.d.ts +6 -0
  14. package/dist/WasClient.d.ts.map +1 -1
  15. package/dist/WasClient.js +29 -20
  16. package/dist/WasClient.js.map +1 -1
  17. package/dist/edv/EdvCodec.d.ts +11 -2
  18. package/dist/edv/EdvCodec.d.ts.map +1 -1
  19. package/dist/edv/EdvCodec.js +79 -67
  20. package/dist/edv/EdvCodec.js.map +1 -1
  21. package/dist/edv/WasTransport.d.ts +23 -44
  22. package/dist/edv/WasTransport.d.ts.map +1 -1
  23. package/dist/edv/WasTransport.js +109 -155
  24. package/dist/edv/WasTransport.js.map +1 -1
  25. package/dist/edv/constants.d.ts +0 -14
  26. package/dist/edv/constants.d.ts.map +1 -1
  27. package/dist/edv/constants.js +4 -8
  28. package/dist/edv/constants.js.map +1 -1
  29. package/dist/edv/epochCrypto.d.ts +1 -1
  30. package/dist/edv/epochCrypto.d.ts.map +1 -1
  31. package/dist/edv/epochCrypto.js +33 -4
  32. package/dist/edv/epochCrypto.js.map +1 -1
  33. package/dist/edv/epochKeys.js +11 -1
  34. package/dist/edv/epochKeys.js.map +1 -1
  35. package/dist/edv/recipients.d.ts +5 -1
  36. package/dist/edv/recipients.d.ts.map +1 -1
  37. package/dist/edv/recipients.js +38 -16
  38. package/dist/edv/recipients.js.map +1 -1
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/internal/codec.d.ts +19 -0
  42. package/dist/internal/codec.d.ts.map +1 -1
  43. package/dist/internal/codec.js +26 -8
  44. package/dist/internal/codec.js.map +1 -1
  45. package/dist/internal/conditional.d.ts +11 -0
  46. package/dist/internal/conditional.d.ts.map +1 -1
  47. package/dist/internal/conditional.js +12 -0
  48. package/dist/internal/conditional.js.map +1 -1
  49. package/dist/internal/content.d.ts +7 -0
  50. package/dist/internal/content.d.ts.map +1 -1
  51. package/dist/internal/content.js +5 -3
  52. package/dist/internal/content.js.map +1 -1
  53. package/dist/internal/describe.d.ts +49 -1
  54. package/dist/internal/describe.d.ts.map +1 -1
  55. package/dist/internal/describe.js +47 -6
  56. package/dist/internal/describe.js.map +1 -1
  57. package/dist/internal/features.d.ts +73 -0
  58. package/dist/internal/features.d.ts.map +1 -0
  59. package/dist/internal/features.js +129 -0
  60. package/dist/internal/features.js.map +1 -0
  61. package/dist/internal/grant.d.ts.map +1 -1
  62. package/dist/internal/grant.js +2 -1
  63. package/dist/internal/grant.js.map +1 -1
  64. package/dist/internal/pagination.d.ts +58 -14
  65. package/dist/internal/pagination.d.ts.map +1 -1
  66. package/dist/internal/pagination.js +49 -6
  67. package/dist/internal/pagination.js.map +1 -1
  68. package/dist/internal/paths.d.ts.map +1 -1
  69. package/dist/internal/paths.js +38 -10
  70. package/dist/internal/paths.js.map +1 -1
  71. package/dist/internal/policy.d.ts +28 -0
  72. package/dist/internal/policy.d.ts.map +1 -1
  73. package/dist/internal/policy.js +31 -0
  74. package/dist/internal/policy.js.map +1 -1
  75. package/dist/internal/revoke.d.ts +11 -0
  76. package/dist/internal/revoke.d.ts.map +1 -1
  77. package/dist/internal/revoke.js +14 -1
  78. package/dist/internal/revoke.js.map +1 -1
  79. package/dist/internal/write.d.ts +10 -1
  80. package/dist/internal/write.d.ts.map +1 -1
  81. package/dist/internal/write.js +29 -4
  82. package/dist/internal/write.js.map +1 -1
  83. package/dist/types.d.ts +12 -0
  84. package/dist/types.d.ts.map +1 -1
  85. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAG3C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAsB,EACtB,EACE,OAAO,EACP,YAAY,EACZ,UAAU,EACoD;IAEhE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE;QACnC,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC;QAC3C,MAAM,EAAE,KAAK;QACb,UAAU;QACV,IAAI,EAAE,IAAI;KACX,CAAC,CAAA;IACF,OAAO,UAAU,CAAwB,QAAQ,CAAC,CAAA;AACpD,CAAC"}
1
+ {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/internal/describe.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAI9C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAAsB,EACtB,EACE,OAAO,EACP,YAAY,EACZ,UAAU,EACoD;IAEhE,OAAO,IAAI,CAAC,OAAO,EAAE;QACnB,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC;QAC3C,MAAM,EAAE,KAAK;QACb,UAAU;QACV,IAAI,EAAE,IAAI;KACX,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAsB,EACtB,OAAsE;IAEtE,OAAO,UAAU,CACf,MAAM,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,CACnD,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,0BAA0B,CAAC,EACzC,SAAS,EACT,WAAW,EACX,MAAM,EACN,UAAU,GAAG,eAAe,EAM7B;IACC,OAAO,IAAI,UAAU,CACnB,UAAU,SAAS,sDAAsD;QACvE,kEAAkE;QAClE,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,GAAG;QACH,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC7C,CAAA;AACH,CAAC"}
@@ -0,0 +1,73 @@
1
+ import type { ClientContext } from './request.js';
2
+ import type { IZcap } from '../types.js';
3
+ /**
4
+ * A memoizing probe of one collection backend's advertised feature tokens.
5
+ * Memoized once it produces a definitive answer: a successful read (including
6
+ * one that lists no features) and a definitive "endpoint absent"
7
+ * (`404` / `405` / `501`) both resolve to a cached feature list, so every
8
+ * affordance gate falls closed against a server that has no backend
9
+ * descriptors.
10
+ *
11
+ * A transient/ambiguous failure (network error, timeout, `401`, `429`, other
12
+ * `5xx`) is NOT cached: the memo is cleared so the next call re-probes, and
13
+ * the error is rethrown so the caller fails loud rather than silently
14
+ * degrading against a server that may well be capable. (A single transient
15
+ * failure must not poison the probe for its lifetime.)
16
+ */
17
+ export declare class BackendFeatures {
18
+ private _promise?;
19
+ private readonly _readDescriptor;
20
+ /**
21
+ * @param readDescriptor {function} reads and parses the backend descriptor
22
+ * JSON (`GET .../backend`); expected to throw an error carrying an HTTP
23
+ * status (readable via `httpStatus`) on failure
24
+ */
25
+ constructor(readDescriptor: () => Promise<unknown>);
26
+ /**
27
+ * The feature tokens the backend advertises, probed once and cached on a
28
+ * definitive answer.
29
+ *
30
+ * @returns {Promise<string[]>}
31
+ */
32
+ get(): Promise<string[]>;
33
+ /**
34
+ * Whether the backend advertises the given feature token.
35
+ *
36
+ * @param feature {string} the affordance token (e.g. `conditional-writes`)
37
+ * @returns {Promise<boolean>}
38
+ */
39
+ has(feature: string): Promise<boolean>;
40
+ /**
41
+ * Reads and parses the backend descriptor once. On a definitive answer
42
+ * (success, or a `404` / `405` / `501` that means the endpoint is
43
+ * legitimately absent) resolves the feature list, which `get` then caches.
44
+ * On a transient failure, clears the memo (so the next call re-probes) and
45
+ * rethrows.
46
+ *
47
+ * @returns {Promise<string[]>}
48
+ */
49
+ private _probe;
50
+ }
51
+ /**
52
+ * Builds the {@link BackendFeatures} probe for a collection, reading its
53
+ * backend descriptor with a signed `GET` through the shared request layer --
54
+ * the probe the core handles (Collection/Resource) hold, mirroring the one
55
+ * `WasTransport` builds over its own requester. A descriptor that is not
56
+ * readable with the bound capability surfaces as a 404 (WAS masks unauthorized
57
+ * reads), which the probe treats as "no features advertised" -- so every
58
+ * affordance gate falls closed for a capability that cannot read the
59
+ * descriptor.
60
+ *
61
+ * @param context {ClientContext}
62
+ * @param options {object}
63
+ * @param options.spaceId {string}
64
+ * @param options.collectionId {string}
65
+ * @param [options.capability] {IZcap} capability attached to the probe
66
+ * @returns {BackendFeatures}
67
+ */
68
+ export declare function collectionBackendFeatures(context: ClientContext, { spaceId, collectionId, capability }: {
69
+ spaceId: string;
70
+ collectionId: string;
71
+ capability?: IZcap;
72
+ }): BackendFeatures;
73
+ //# sourceMappingURL=features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/internal/features.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAcxC;;;;;;;;;;;;;GAaG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAwB;IAExD;;;;OAIG;gBACS,cAAc,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC;IAIlD;;;;;OAKG;IACH,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKxB;;;;;OAKG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5C;;;;;;;;OAQG;YACW,MAAM;CAqBrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,aAAa,EACtB,EACE,OAAO,EACP,YAAY,EACZ,UAAU,EACX,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC/D,eAAe,CAWjB"}
@@ -0,0 +1,129 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The shared backend-feature probe: reads a collection backend's "Collection
6
+ * Backend Selected" descriptor once and answers which optional affordance
7
+ * tokens it advertises (e.g. `conditional-writes`, `blinded-index-query`,
8
+ * `chunked-streams`). Both EDV write paths -- the standalone `WasTransport`
9
+ * and the codec-seam write orchestration -- consult this one helper, so the
10
+ * backend-capability decision is made in a single place instead of being
11
+ * probed in one path and assumed away in the other.
12
+ */
13
+ import { httpStatus } from '../errors.js';
14
+ import { send } from './request.js';
15
+ import { readJsonData } from './content.js';
16
+ import { collectionBackend } from './paths.js';
17
+ /**
18
+ * HTTP statuses that mean the backend-descriptor endpoint is legitimately
19
+ * absent (or explicitly unimplemented), as opposed to transiently failing:
20
+ * `404` (no such endpoint), `405` (endpoint does not answer `GET`), `501`
21
+ * (not implemented). These are a definitive "this server advertises no
22
+ * backend features" answer and are safe to cache -- every affordance gate
23
+ * then falls closed against a server that has no backend descriptors. Any
24
+ * other failure (network error, timeout, `401`, `429`, other `5xx`) is
25
+ * transient/ambiguous and is re-probed instead of cached.
26
+ */
27
+ const DESCRIPTOR_ABSENT_STATUSES = new Set([404, 405, 501]);
28
+ /**
29
+ * A memoizing probe of one collection backend's advertised feature tokens.
30
+ * Memoized once it produces a definitive answer: a successful read (including
31
+ * one that lists no features) and a definitive "endpoint absent"
32
+ * (`404` / `405` / `501`) both resolve to a cached feature list, so every
33
+ * affordance gate falls closed against a server that has no backend
34
+ * descriptors.
35
+ *
36
+ * A transient/ambiguous failure (network error, timeout, `401`, `429`, other
37
+ * `5xx`) is NOT cached: the memo is cleared so the next call re-probes, and
38
+ * the error is rethrown so the caller fails loud rather than silently
39
+ * degrading against a server that may well be capable. (A single transient
40
+ * failure must not poison the probe for its lifetime.)
41
+ */
42
+ export class BackendFeatures {
43
+ _promise;
44
+ _readDescriptor;
45
+ /**
46
+ * @param readDescriptor {function} reads and parses the backend descriptor
47
+ * JSON (`GET .../backend`); expected to throw an error carrying an HTTP
48
+ * status (readable via `httpStatus`) on failure
49
+ */
50
+ constructor(readDescriptor) {
51
+ this._readDescriptor = readDescriptor;
52
+ }
53
+ /**
54
+ * The feature tokens the backend advertises, probed once and cached on a
55
+ * definitive answer.
56
+ *
57
+ * @returns {Promise<string[]>}
58
+ */
59
+ get() {
60
+ this._promise ??= this._probe();
61
+ return this._promise;
62
+ }
63
+ /**
64
+ * Whether the backend advertises the given feature token.
65
+ *
66
+ * @param feature {string} the affordance token (e.g. `conditional-writes`)
67
+ * @returns {Promise<boolean>}
68
+ */
69
+ async has(feature) {
70
+ return (await this.get()).includes(feature);
71
+ }
72
+ /**
73
+ * Reads and parses the backend descriptor once. On a definitive answer
74
+ * (success, or a `404` / `405` / `501` that means the endpoint is
75
+ * legitimately absent) resolves the feature list, which `get` then caches.
76
+ * On a transient failure, clears the memo (so the next call re-probes) and
77
+ * rethrows.
78
+ *
79
+ * @returns {Promise<string[]>}
80
+ */
81
+ async _probe() {
82
+ try {
83
+ const descriptor = (await this._readDescriptor());
84
+ return Array.isArray(descriptor?.features)
85
+ ? descriptor.features.filter((feature) => typeof feature === 'string')
86
+ : [];
87
+ }
88
+ catch (err) {
89
+ const status = httpStatus(err);
90
+ if (status !== undefined && DESCRIPTOR_ABSENT_STATUSES.has(status)) {
91
+ return [];
92
+ }
93
+ // Transient/ambiguous: do not cache this failure -- drop the memo so the
94
+ // next call re-probes -- and rethrow.
95
+ this._promise = undefined;
96
+ throw err;
97
+ }
98
+ }
99
+ }
100
+ /**
101
+ * Builds the {@link BackendFeatures} probe for a collection, reading its
102
+ * backend descriptor with a signed `GET` through the shared request layer --
103
+ * the probe the core handles (Collection/Resource) hold, mirroring the one
104
+ * `WasTransport` builds over its own requester. A descriptor that is not
105
+ * readable with the bound capability surfaces as a 404 (WAS masks unauthorized
106
+ * reads), which the probe treats as "no features advertised" -- so every
107
+ * affordance gate falls closed for a capability that cannot read the
108
+ * descriptor.
109
+ *
110
+ * @param context {ClientContext}
111
+ * @param options {object}
112
+ * @param options.spaceId {string}
113
+ * @param options.collectionId {string}
114
+ * @param [options.capability] {IZcap} capability attached to the probe
115
+ * @returns {BackendFeatures}
116
+ */
117
+ export function collectionBackendFeatures(context, { spaceId, collectionId, capability }) {
118
+ return new BackendFeatures(async () => {
119
+ const response = await send(context, {
120
+ path: collectionBackend(spaceId, collectionId),
121
+ method: 'GET',
122
+ capability
123
+ });
124
+ // Without the `read` flag `send` never resolves `null` (a 404 throws and
125
+ // the probe maps it to "absent"), so this null-guard is for the type only.
126
+ return response === null ? null : readJsonData(response);
127
+ });
128
+ }
129
+ //# sourceMappingURL=features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/internal/features.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,IAA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,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC7D,OAAO,CAAC,cAAc,CAAC,CAMzB"}
1
+ {"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/internal/grant.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAgCtE;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,EACtB,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,YAAY,GACzD,OAAO,CAAC,cAAc,CAAC,CAazB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,EACE,IAAI,EACJ,OAAO,EACP,UAAU,EACX,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAC;IAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GAC7D,OAAO,CAAC,cAAc,CAAC,CAMzB"}
@@ -1,4 +1,5 @@
1
1
  import { parseSpaceTarget, spacePath, toUrl } from './paths.js';
2
+ import { rootCapabilityId } from './revoke.js';
2
3
  /**
3
4
  * The root capability id (`urn:zcap:root:<encoded target>`) of the Space
4
5
  * containing `target`, or `undefined` when `target` is not a URL beneath this
@@ -20,7 +21,7 @@ function spaceRootCapabilityId({ serverUrl, target }) {
20
21
  return undefined;
21
22
  }
22
23
  const spaceUrl = toUrl({ serverUrl, path: spacePath(parsed.spaceId) });
23
- return `urn:zcap:root:${encodeURIComponent(spaceUrl)}`;
24
+ return rootCapabilityId(spaceUrl);
24
25
  }
25
26
  /**
26
27
  * Delegates a capability per `GrantOptions`, returning the signed zcap to hand
@@ -1 +1 @@
1
- {"version":3,"file":"grant.js","sourceRoot":"","sources":["../../src/internal/grant.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAG/D;;;;;;;;;;;;;;GAcG;AACH,SAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,MAAM,EAIP;IACC,MAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAA;IACtD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACtE,OAAO,iBAAiB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAA;AACxD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAsB,EACtB,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAgB;IAE1D,MAAM,MAAM,GACV,UAAU;QACV,CAAC,MAAM,KAAK,SAAS;YACnB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IACtE,OAAO,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;QACjC,UAAU,EAAE,EAAE;QACd,gBAAgB,EAAE,MAAM;QACxB,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC3D,OAAO;QACP,UAAU,EAAE,MAAM;KACnB,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG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AE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IACtE,OAAO,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;QACjC,UAAU,EAAE,EAAE;QACd,gBAAgB,EAAE,MAAM;QACxB,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC3D,OAAO;QACP,UAAU,EAAE,MAAM;KACnB,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAAsB,EACtB,EACE,IAAI,EACJ,OAAO,EACP,UAAU,EACkD;IAE9D,OAAO,aAAa,CAAC,OAAO,EAAE;QAC5B,GAAG,OAAO;QACV,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;QACvE,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,UAAU;KAC7C,CAAC,CAAA;AACJ,CAAC"}
@@ -9,17 +9,31 @@
9
9
  * from page to page, dereferencing each with the same authorization as the first
10
10
  * request, and yields one page at a time (constant memory, early-exit-friendly).
11
11
  * `collectPages` builds on it to eagerly aggregate every page into one envelope.
12
+ *
13
+ * The helpers are generic over the listing envelope, so they serve all three
14
+ * paginated WAS listings: List Collection items (`CollectionResourcesList`),
15
+ * List Collections (`CollectionsList`), and List Spaces (`SpaceListing`). Each
16
+ * envelope shares the `{ items, next? }` shape the traversal relies on.
17
+ */
18
+ import type { CollectionResourcesList, ResourceSummary } from '../types.js';
19
+ /**
20
+ * The shared shape of every paginated listing envelope: an `items` array and an
21
+ * optional `next` continuation URL. The traversal core only ever touches these
22
+ * two fields, so it works uniformly across the concrete listing types.
12
23
  */
13
- import type { CollectionResourcesList } from '../types.js';
24
+ type PageEnvelope = {
25
+ items: unknown[];
26
+ next?: string;
27
+ };
14
28
  /**
15
29
  * The first page (already read) plus the means to fetch each following page.
16
30
  * The `fetchPage` callback fetches a single page by absolute URL, returning
17
31
  * `null` if it is missing/unauthorized (which ends the traversal).
18
32
  */
19
- export interface PageWalk {
20
- first: CollectionResourcesList;
33
+ export interface PageWalk<T extends PageEnvelope = CollectionResourcesList> {
34
+ first: T;
21
35
  firstUrl: string;
22
- fetchPage: (url: string) => Promise<CollectionResourcesList | null>;
36
+ fetchPage: (url: string) => Promise<T | null>;
23
37
  }
24
38
  /**
25
39
  * Builds a {@link PageWalk} by fetching the first page with the same
@@ -31,12 +45,12 @@ export interface PageWalk {
31
45
  * @param options {object}
32
46
  * @param options.firstUrl {string} the absolute listing URL
33
47
  * @param options.fetchPage {function} fetches one page by absolute URL
34
- * @returns {Promise<PageWalk | null>}
48
+ * @returns {Promise<PageWalk<T> | null>}
35
49
  */
36
- export declare function buildPageWalk({ firstUrl, fetchPage }: {
50
+ export declare function buildPageWalk<T extends PageEnvelope = CollectionResourcesList>({ firstUrl, fetchPage }: {
37
51
  firstUrl: string;
38
- fetchPage: PageWalk['fetchPage'];
39
- }): Promise<PageWalk | null>;
52
+ fetchPage: PageWalk<T>['fetchPage'];
53
+ }): Promise<PageWalk<T> | null>;
40
54
  /**
41
55
  * Lazily walks a list response page by page, yielding the first page and then
42
56
  * each page reached by following `next`. Each `next` is resolved relative to the
@@ -44,18 +58,48 @@ export declare function buildPageWalk({ firstUrl, fetchPage }: {
44
58
  * `next` ends the traversal defensively rather than looping forever. Yields one
45
59
  * page at a time, so a consumer can stop early without fetching the rest.
46
60
  *
47
- * @param walk {PageWalk}
48
- * @returns {AsyncGenerator<CollectionResourcesList>}
61
+ * @param walk {PageWalk<T>}
62
+ * @returns {AsyncGenerator<T>}
49
63
  */
50
- export declare function walkPages(walk: PageWalk): AsyncGenerator<CollectionResourcesList>;
64
+ export declare function walkPages<T extends PageEnvelope = CollectionResourcesList>(walk: PageWalk<T>): AsyncGenerator<T>;
51
65
  /**
52
66
  * Eagerly follows every `next` link, aggregating all pages' items into a single
53
67
  * envelope shaped like the first page (with `next` dropped, since the whole list
54
68
  * has been collected). Buffers the entire collection in memory; for a large
55
69
  * collection prefer `walkPages` (one page at a time) or an item iterator.
56
70
  *
57
- * @param walk {PageWalk}
58
- * @returns {Promise<CollectionResourcesList>}
71
+ * @param walk {PageWalk<T>}
72
+ * @returns {Promise<T>}
73
+ */
74
+ export declare function collectPages<T extends PageEnvelope = CollectionResourcesList>(walk: PageWalk<T>): Promise<T>;
75
+ /**
76
+ * The buffering list surface over a possibly-absent walk: collects every page
77
+ * into one envelope, mapping a `null` walk (missing/unauthorized listing) to
78
+ * `null`. The shared dispatch behind `Collection.list()` and
79
+ * `WasClient.publicListCollection()`.
80
+ *
81
+ * @param walk {PageWalk<T> | null}
82
+ * @returns {Promise<T | null>}
83
+ */
84
+ export declare function collectWalk<T extends PageEnvelope = CollectionResourcesList>(walk: PageWalk<T> | null): Promise<T | null>;
85
+ /**
86
+ * The lazy page surface over a possibly-absent walk: yields each page, or
87
+ * nothing for a `null` walk (which an iterator cannot distinguish from an
88
+ * empty listing). The shared dispatch behind `Collection.listPages()` and
89
+ * `WasClient.publicListCollectionPages()`.
90
+ *
91
+ * @param walk {PageWalk<T> | null}
92
+ * @returns {AsyncGenerator<T>}
93
+ */
94
+ export declare function walkPagesOrEmpty<T extends PageEnvelope = CollectionResourcesList>(walk: PageWalk<T> | null): AsyncGenerator<T>;
95
+ /**
96
+ * The lazy item surface: flattens a page iterator into its `ResourceSummary`
97
+ * entries. The shared dispatch behind `Collection.listItems()` and
98
+ * `WasClient.publicListCollectionItems()`.
99
+ *
100
+ * @param pages {AsyncIterable<CollectionResourcesList>}
101
+ * @returns {AsyncGenerator<ResourceSummary>}
59
102
  */
60
- export declare function collectPages(walk: PageWalk): Promise<CollectionResourcesList>;
103
+ export declare function walkItems(pages: AsyncIterable<CollectionResourcesList>): AsyncGenerator<ResourceSummary>;
104
+ export {};
61
105
  //# sourceMappingURL=pagination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,uBAAuB,CAAA;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAA;CACpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,SAAS,EACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;CACjC,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAG3B;AAED;;;;;;;;;GASG;AACH,wBAAuB,SAAS,CAC9B,IAAI,EAAE,QAAQ,GACb,cAAc,CAAC,uBAAuB,CAAC,CAwBzC;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,uBAAuB,CAAC,CAWlC"}
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE3E;;;;GAIG;AACH,KAAK,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvD;;;;GAIG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,YAAY,GAAG,uBAAuB;IACxE,KAAK,EAAE,CAAC,CAAA;IACR,QA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
  * @param options {object}
9
9
  * @param options.firstUrl {string} the absolute listing URL
10
10
  * @param options.fetchPage {function} fetches one page by absolute URL
11
- * @returns {Promise<PageWalk | null>}
11
+ * @returns {Promise<PageWalk<T> | null>}
12
12
  */
13
13
  export async function buildPageWalk({ firstUrl, fetchPage }) {
14
14
  const first = await fetchPage(firstUrl);
@@ -21,8 +21,8 @@ export async function buildPageWalk({ firstUrl, fetchPage }) {
21
21
  * `next` ends the traversal defensively rather than looping forever. Yields one
22
22
  * page at a time, so a consumer can stop early without fetching the rest.
23
23
  *
24
- * @param walk {PageWalk}
25
- * @returns {AsyncGenerator<CollectionResourcesList>}
24
+ * @param walk {PageWalk<T>}
25
+ * @returns {AsyncGenerator<T>}
26
26
  */
27
27
  export async function* walkPages(walk) {
28
28
  const { first, firstUrl, fetchPage } = walk;
@@ -55,19 +55,62 @@ export async function* walkPages(walk) {
55
55
  * has been collected). Buffers the entire collection in memory; for a large
56
56
  * collection prefer `walkPages` (one page at a time) or an item iterator.
57
57
  *
58
- * @param walk {PageWalk}
59
- * @returns {Promise<CollectionResourcesList>}
58
+ * @param walk {PageWalk<T>}
59
+ * @returns {Promise<T>}
60
60
  */
61
61
  export async function collectPages(walk) {
62
62
  let aggregate;
63
63
  const items = [];
64
64
  for await (const page of walkPages(walk)) {
65
65
  aggregate ??= page;
66
- items.push(...page.items);
66
+ // Append one by one: spreading a page's items as call arguments would hit
67
+ // the engine's max-arguments ceiling on a very large page.
68
+ for (const item of page.items) {
69
+ items.push(item);
70
+ }
67
71
  }
68
72
  // `walkPages` always yields `first`, so `aggregate` is set here.
69
73
  const result = { ...aggregate, items };
70
74
  delete result.next;
71
75
  return result;
72
76
  }
77
+ /**
78
+ * The buffering list surface over a possibly-absent walk: collects every page
79
+ * into one envelope, mapping a `null` walk (missing/unauthorized listing) to
80
+ * `null`. The shared dispatch behind `Collection.list()` and
81
+ * `WasClient.publicListCollection()`.
82
+ *
83
+ * @param walk {PageWalk<T> | null}
84
+ * @returns {Promise<T | null>}
85
+ */
86
+ export async function collectWalk(walk) {
87
+ return walk === null ? null : collectPages(walk);
88
+ }
89
+ /**
90
+ * The lazy page surface over a possibly-absent walk: yields each page, or
91
+ * nothing for a `null` walk (which an iterator cannot distinguish from an
92
+ * empty listing). The shared dispatch behind `Collection.listPages()` and
93
+ * `WasClient.publicListCollectionPages()`.
94
+ *
95
+ * @param walk {PageWalk<T> | null}
96
+ * @returns {AsyncGenerator<T>}
97
+ */
98
+ export async function* walkPagesOrEmpty(walk) {
99
+ if (walk !== null) {
100
+ yield* walkPages(walk);
101
+ }
102
+ }
103
+ /**
104
+ * The lazy item surface: flattens a page iterator into its `ResourceSummary`
105
+ * entries. The shared dispatch behind `Collection.listItems()` and
106
+ * `WasClient.publicListCollectionItems()`.
107
+ *
108
+ * @param pages {AsyncIterable<CollectionResourcesList>}
109
+ * @returns {AsyncGenerator<ResourceSummary>}
110
+ */
111
+ export async function* walkItems(pages) {
112
+ for await (const page of pages) {
113
+ yield* page.items;
114
+ }
115
+ }
73
116
  //# sourceMappingURL=pagination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/internal/pagination.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,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,CAAA;AAC/D,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,SAAS,CAC9B,IAAc;IAEd,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;IAC3C,MAAM,KAAK,CAAA;IACX,0EAA0E;IAC1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ACE,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB,GACD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAEjE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,MAAM,EACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,eAAe,GAAG,IAAI,CAazB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CA0CvE"}
@@ -18,6 +18,7 @@
18
18
  */
19
19
  import { RESERVED_COLLECTION_IDS, RESERVED_RESOURCE_IDS } from '@interop/storage-core';
20
20
  import { ValidationError } from '../errors.js';
21
+ import { assertNotReserved } from './reserved.js';
21
22
  /**
22
23
  * Rejects an id that would escape its path slot even after percent-encoding:
23
24
  * `encodeURIComponent` leaves `.` and `..` intact, and WHATWG URL resolution
@@ -39,6 +40,33 @@ function encode(segment) {
39
40
  assertValidId(segment);
40
41
  return encodeURIComponent(segment);
41
42
  }
43
+ /**
44
+ * Encodes a collection-id slot, additionally rejecting an id from the Reserved
45
+ * Path Segment Registry: `collectionPath(s, 'policy')` is byte-identical to
46
+ * the space policy path, so a reserved id would silently mis-target a
47
+ * space-level endpoint. Guarding in the builders covers every URL-forming
48
+ * entry point (handle constructors guard too, for the earlier failure).
49
+ *
50
+ * @param collectionId {string}
51
+ * @returns {string}
52
+ */
53
+ function encodeCollectionId(collectionId) {
54
+ assertNotReserved({ id: collectionId, kind: 'collection' });
55
+ return encode(collectionId);
56
+ }
57
+ /**
58
+ * Encodes a resource-id slot, additionally rejecting an id from the Reserved
59
+ * Path Segment Registry: `resourcePath(s, c, 'policy')` is byte-identical to
60
+ * the collection policy path, so a reserved id would silently mis-target a
61
+ * collection-level endpoint.
62
+ *
63
+ * @param resourceId {string}
64
+ * @returns {string}
65
+ */
66
+ function encodeResourceId(resourceId) {
67
+ assertNotReserved({ id: resourceId, kind: 'resource' });
68
+ return encode(resourceId);
69
+ }
42
70
  /**
43
71
  * `/spaces/` -- the SpacesRepository (create / list spaces).
44
72
  */
@@ -123,70 +151,70 @@ export function spaceRevocation(spaceId, capabilityId) {
123
151
  * (no trailing slash).
124
152
  */
125
153
  export function collectionPath(spaceId, collectionId) {
126
- return `/space/${encode(spaceId)}/${encode(collectionId)}`;
154
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}`;
127
155
  }
128
156
  /**
129
157
  * `/space/:spaceId/:collectionId/` -- list items / add a resource
130
158
  * (trailing slash).
131
159
  */
132
160
  export function collectionItems(spaceId, collectionId) {
133
- return `/space/${encode(spaceId)}/${encode(collectionId)}/`;
161
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/`;
134
162
  }
135
163
  /**
136
164
  * `/space/:spaceId/:collectionId/policy` -- the collection-level access-control
137
165
  * policy resource.
138
166
  */
139
167
  export function collectionPolicy(spaceId, collectionId) {
140
- return `/space/${encode(spaceId)}/${encode(collectionId)}/policy`;
168
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/policy`;
141
169
  }
142
170
  /**
143
171
  * `/space/:spaceId/:collectionId/linkset` -- the collection-level linkset
144
172
  * (policy discovery).
145
173
  */
146
174
  export function collectionLinkset(spaceId, collectionId) {
147
- return `/space/${encode(spaceId)}/${encode(collectionId)}/linkset`;
175
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/linkset`;
148
176
  }
149
177
  /**
150
178
  * `/space/:spaceId/:collectionId/backend` -- the "Collection Backend Selected"
151
179
  * descriptor (the backend this collection is stored on).
152
180
  */
153
181
  export function collectionBackend(spaceId, collectionId) {
154
- return `/space/${encode(spaceId)}/${encode(collectionId)}/backend`;
182
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/backend`;
155
183
  }
156
184
  /**
157
185
  * `/space/:spaceId/:collectionId/quota` -- the per-collection storage quota
158
186
  * report (spec "Quotas").
159
187
  */
160
188
  export function collectionQuota(spaceId, collectionId) {
161
- return `/space/${encode(spaceId)}/${encode(collectionId)}/quota`;
189
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/quota`;
162
190
  }
163
191
  /**
164
192
  * `/space/:spaceId/:collectionId/query` -- the collection-level query endpoint,
165
193
  * whose body's `profile` selects the query (e.g. `changes`, `blinded-index`).
166
194
  */
167
195
  export function collectionQuery(spaceId, collectionId) {
168
- return `/space/${encode(spaceId)}/${encode(collectionId)}/query`;
196
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/query`;
169
197
  }
170
198
  /**
171
199
  * `/space/:spaceId/:collectionId/:resourceId` -- get / put / delete a resource
172
200
  * (no trailing slash).
173
201
  */
174
202
  export function resourcePath(spaceId, collectionId, resourceId) {
175
- return `/space/${encode(spaceId)}/${encode(collectionId)}/${encode(resourceId)}`;
203
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/${encodeResourceId(resourceId)}`;
176
204
  }
177
205
  /**
178
206
  * `/space/:spaceId/:collectionId/:resourceId/meta` -- the resource metadata
179
207
  * object (server-managed properties plus the user-writable `custom` object).
180
208
  */
181
209
  export function resourceMeta(spaceId, collectionId, resourceId) {
182
- return `/space/${encode(spaceId)}/${encode(collectionId)}/${encode(resourceId)}/meta`;
210
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/${encodeResourceId(resourceId)}/meta`;
183
211
  }
184
212
  /**
185
213
  * `/space/:spaceId/:collectionId/:resourceId/policy` -- the resource-level
186
214
  * access-control policy resource.
187
215
  */
188
216
  export function resourcePolicy(spaceId, collectionId, resourceId) {
189
- return `/space/${encode(spaceId)}/${encode(collectionId)}/${encode(resourceId)}/policy`;
217
+ return `/space/${encode(spaceId)}/${encodeCollectionId(collectionId)}/${encodeResourceId(resourceId)}/policy`;
190
218
  }
191
219
  /**
192
220
  * `/space/:spaceId/:collectionId/:resourceId/chunks/:chunkIndex` -- a single
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/internal/paths.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C;;;;;;;;;;GAUG;AACH,SAAS,aAAa,CAAC,OAAe;IACpC,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC1D,MAAM,IAAI,eAAe,CACvB,cAAc,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,+BAA+B;YAClE,qDAAqD,CACxD,CAAA;IACH,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,OAAe;IAC7B,aAAa,CAAC,OAAO,CAAC,CAAA;IACtB,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,UAAU,CAAA;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,UAAU,MAAM,CAAC,OAAO,CAAC,EAAE,CAAA;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,UAAU,MAAM,CAAC,OAAO,CAAC,GAAG,CAAA;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,UAAU,MAAM,CAAC,OAAO,CAAC,eAAe,CAAA;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC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