@foundatiofx/fetchclient 1.1.0 → 1.2.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/esm/mod.js +83 -0
- package/esm/src/DefaultHelpers.js +12 -5
- package/esm/src/FetchClient.js +66 -41
- package/esm/src/FetchClientError.js +73 -0
- package/esm/src/FetchClientProvider.js +24 -0
- package/esm/src/RateLimitMiddleware.js +35 -1
- package/esm/src/ResponsePromise.js +163 -0
- package/esm/src/RetryMiddleware.js +179 -0
- package/esm/src/mocks/MockHistory.js +8 -0
- package/esm/src/mocks/MockRegistry.js +7 -0
- package/package.json +1 -1
- package/readme.md +8 -15
- package/script/mod.js +94 -1
- package/script/src/DefaultHelpers.js +13 -5
- package/script/src/FetchClient.js +66 -41
- package/script/src/FetchClientError.js +77 -0
- package/script/src/FetchClientProvider.js +24 -0
- package/script/src/RateLimitMiddleware.js +36 -0
- package/script/src/ResponsePromise.js +167 -0
- package/script/src/RetryMiddleware.js +184 -0
- package/script/src/mocks/MockHistory.js +8 -0
- package/script/src/mocks/MockRegistry.js +7 -0
- package/types/mod.d.ts +96 -0
- package/types/mod.d.ts.map +1 -1
- package/types/src/DefaultHelpers.d.ts +11 -5
- package/types/src/DefaultHelpers.d.ts.map +1 -1
- package/types/src/FetchClient.d.ts +31 -15
- package/types/src/FetchClient.d.ts.map +1 -1
- package/types/src/FetchClientError.d.ts +29 -0
- package/types/src/FetchClientError.d.ts.map +1 -0
- package/types/src/FetchClientProvider.d.ts +11 -0
- package/types/src/FetchClientProvider.d.ts.map +1 -1
- package/types/src/RateLimitMiddleware.d.ts +27 -0
- package/types/src/RateLimitMiddleware.d.ts.map +1 -1
- package/types/src/ResponsePromise.d.ts +93 -0
- package/types/src/ResponsePromise.d.ts.map +1 -0
- package/types/src/RetryMiddleware.d.ts +88 -0
- package/types/src/RetryMiddleware.d.ts.map +1 -0
- package/types/src/mocks/MockHistory.d.ts +1 -0
- package/types/src/mocks/MockHistory.d.ts.map +1 -1
- package/types/src/mocks/MockRegistry.d.ts +5 -0
- package/types/src/mocks/MockRegistry.d.ts.map +1 -1
- package/types/src/mocks/types.d.ts +2 -0
- package/types/src/mocks/types.d.ts.map +1 -1
- package/types/src/tests/RetryMiddleware.test.d.ts.map +1 -0
|
@@ -47,4 +47,31 @@ export declare class RateLimitMiddleware {
|
|
|
47
47
|
*/
|
|
48
48
|
middleware(): FetchClientMiddleware;
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a rate limit middleware with the given options.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const client = new FetchClient();
|
|
56
|
+
* client.use(createRateLimitMiddleware({
|
|
57
|
+
* maxRequests: 100,
|
|
58
|
+
* windowSeconds: 60,
|
|
59
|
+
* }));
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function createRateLimitMiddleware(options: RateLimitMiddlewareOptions): FetchClientMiddleware;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a per-domain rate limit middleware where each domain is tracked separately.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const client = new FetchClient();
|
|
69
|
+
* client.use(createPerDomainRateLimitMiddleware({
|
|
70
|
+
* maxRequests: 100,
|
|
71
|
+
* windowSeconds: 60,
|
|
72
|
+
* }));
|
|
73
|
+
* // api.example.com and api.other.com will have separate rate limits
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function createPerDomainRateLimitMiddleware(options: RateLimitMiddlewareOptions): FetchClientMiddleware;
|
|
50
77
|
//# sourceMappingURL=RateLimitMiddleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RateLimitMiddleware.d.ts","sourceRoot":"","sources":["../../src/src/RateLimitMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,OAAO,
|
|
1
|
+
{"version":3,"file":"RateLimitMiddleware.d.ts","sourceRoot":"","sources":["../../src/src/RateLimitMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,OAAO,EAIL,WAAW,EACX,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,iBAAiB,EAAE,MAAM,CAAC;gBAE9B,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAW3E;AAED;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;GAEG;AACH,qBAAa,mBAAmB;;IAG9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;IAC3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAU;gBAEpC,OAAO,EAAE,0BAA0B;IAO/C;;OAEG;IACH,IAAW,WAAW,IAAI,WAAW,CAEpC;IAED;;;OAGG;IACI,UAAU,IAAI,qBAAqB;CA8F3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,0BAA0B,GAClC,qBAAqB,CAEvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,0BAA0B,GAClC,qBAAqB,CAKvB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { FetchClientResponse } from "./FetchClientResponse.js";
|
|
2
|
+
import type { RequestOptions } from "./RequestOptions.js";
|
|
3
|
+
/**
|
|
4
|
+
* A promise that resolves to a FetchClientResponse with additional helper methods
|
|
5
|
+
* for parsing the response body. This allows for a fluent API similar to ky:
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Await to get the full response
|
|
10
|
+
* const response = await client.get("/api/users");
|
|
11
|
+
*
|
|
12
|
+
* // Or use helper methods for direct access to parsed body
|
|
13
|
+
* const users = await client.get("/api/users").json<User[]>();
|
|
14
|
+
* const html = await client.get("/page").text();
|
|
15
|
+
* const file = await client.get("/file").blob();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class ResponsePromise<T = unknown> implements PromiseLike<FetchClientResponse<T>> {
|
|
19
|
+
#private;
|
|
20
|
+
constructor(responsePromise: Promise<FetchClientResponse<T>>, options?: RequestOptions);
|
|
21
|
+
/**
|
|
22
|
+
* Implements PromiseLike interface so the ResponsePromise can be awaited.
|
|
23
|
+
*/
|
|
24
|
+
then<TResult1 = FetchClientResponse<T>, TResult2 = never>(onfulfilled?: ((value: FetchClientResponse<T>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
25
|
+
/**
|
|
26
|
+
* Catches any errors from the response promise.
|
|
27
|
+
*/
|
|
28
|
+
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): Promise<FetchClientResponse<T> | TResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Executes a callback when the promise settles (fulfilled or rejected).
|
|
31
|
+
*/
|
|
32
|
+
finally(onfinally?: (() => void) | null): Promise<FetchClientResponse<T>>;
|
|
33
|
+
/**
|
|
34
|
+
* Parses the response body as JSON.
|
|
35
|
+
*
|
|
36
|
+
* If the response was already parsed as JSON (via getJSON, postJSON, etc.),
|
|
37
|
+
* returns the parsed data directly. Otherwise, parses the response body.
|
|
38
|
+
*
|
|
39
|
+
* @template TJson - The expected type of the JSON response
|
|
40
|
+
* @returns A promise that resolves to the parsed JSON
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const user = await client.get("/api/user/1").json<User>();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
json<TJson = T>(): Promise<TJson>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the response body as text.
|
|
50
|
+
*
|
|
51
|
+
* @returns A promise that resolves to the response text
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const html = await client.get("/page").text();
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
text(): Promise<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the response body as a Blob.
|
|
61
|
+
*
|
|
62
|
+
* @returns A promise that resolves to the response as a Blob
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const imageBlob = await client.get("/image.png").blob();
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
blob(): Promise<Blob>;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the response body as an ArrayBuffer.
|
|
72
|
+
*
|
|
73
|
+
* @returns A promise that resolves to the response as an ArrayBuffer
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const buffer = await client.get("/file").arrayBuffer();
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the response body as FormData.
|
|
83
|
+
*
|
|
84
|
+
* @returns A promise that resolves to the response as FormData
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const formData = await client.get("/form").formData();
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
formData(): Promise<FormData>;
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C,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAIzE;;;;;;;;;;;;;OAaG;IACG,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC;IAmBvC;;;;;;;;;OASG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAK7B;;;;;;;;;OASG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B;;;;;;;;;OASG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IAKzC;;;;;;;;;OASG;IACG,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;CAqDpC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { FetchClientMiddleware } from "./FetchClientMiddleware.js";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for the retry middleware.
|
|
4
|
+
*/
|
|
5
|
+
export interface RetryMiddlewareOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Maximum number of retry attempts.
|
|
8
|
+
* @default 2
|
|
9
|
+
*/
|
|
10
|
+
limit?: number;
|
|
11
|
+
/**
|
|
12
|
+
* HTTP methods eligible for retry.
|
|
13
|
+
* @default ['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS', 'TRACE']
|
|
14
|
+
*/
|
|
15
|
+
methods?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* HTTP status codes that trigger a retry.
|
|
18
|
+
* @default [408, 413, 429, 500, 502, 503, 504]
|
|
19
|
+
*/
|
|
20
|
+
statusCodes?: number[];
|
|
21
|
+
/**
|
|
22
|
+
* Maximum value of Retry-After header to respect, in milliseconds.
|
|
23
|
+
* If Retry-After exceeds this value, the request will not be retried.
|
|
24
|
+
* @default Infinity
|
|
25
|
+
*/
|
|
26
|
+
maxRetryAfter?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Maximum backoff delay in milliseconds.
|
|
29
|
+
* @default 30000
|
|
30
|
+
*/
|
|
31
|
+
backoffLimit?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Custom delay function that receives the attempt number (0-indexed) and returns delay in ms.
|
|
34
|
+
* If not provided, exponential backoff is used: min(1000 * 2^attempt, backoffLimit)
|
|
35
|
+
*/
|
|
36
|
+
delay?: (attemptNumber: number, response?: Response) => number;
|
|
37
|
+
/**
|
|
38
|
+
* Jitter fraction for randomizing delay.
|
|
39
|
+
* For example, 0.1 means +/- 10% randomization.
|
|
40
|
+
* @default 0.1
|
|
41
|
+
*/
|
|
42
|
+
jitter?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Custom predicate to determine if a request should be retried.
|
|
45
|
+
* Called after default checks pass. Return true to retry, false to stop.
|
|
46
|
+
*/
|
|
47
|
+
shouldRetry?: (response: Response, attemptNumber: number) => boolean | Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Callback invoked before each retry attempt.
|
|
50
|
+
*/
|
|
51
|
+
onRetry?: (attemptNumber: number, response: Response, delayMs: number) => void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Retry middleware that automatically retries failed requests with exponential backoff.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const provider = new FetchClientProvider();
|
|
59
|
+
* provider.useRetry({
|
|
60
|
+
* limit: 3,
|
|
61
|
+
* statusCodes: [500, 502, 503, 504],
|
|
62
|
+
* jitter: 0.1,
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* const client = provider.getFetchClient();
|
|
66
|
+
* const response = await client.getJSON('/api/data');
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare class RetryMiddleware {
|
|
70
|
+
#private;
|
|
71
|
+
constructor(options?: RetryMiddlewareOptions);
|
|
72
|
+
/**
|
|
73
|
+
* Creates the middleware function.
|
|
74
|
+
* @returns The middleware function
|
|
75
|
+
*/
|
|
76
|
+
middleware(): FetchClientMiddleware;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Creates a retry middleware with the given options.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* const client = new FetchClient();
|
|
84
|
+
* client.use(createRetryMiddleware({ limit: 3 }));
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function createRetryMiddleware(options?: RetryMiddlewareOptions): FetchClientMiddleware;
|
|
88
|
+
//# sourceMappingURL=RetryMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RetryMiddleware.d.ts","sourceRoot":"","sources":["../../src/src/RetryMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AA4BxE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,KAAK,MAAM,CAAC;IAE/D;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,WAAW,CAAC,EAAE,CACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,MAAM,KAClB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,OAAO,CAAC,EAAE,CACR,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;CACX;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,eAAe;;gBAoBd,OAAO,CAAC,EAAE,sBAAsB;IAgB5C;;;OAGG;IACI,UAAU,IAAI,qBAAqB;CAuI3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,qBAAqB,CAEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MockHistory.d.ts","sourceRoot":"","sources":["../../../src/src/mocks/MockHistory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;;
|
|
1
|
+
{"version":3,"file":"MockHistory.d.ts","sourceRoot":"","sources":["../../../src/src/mocks/MockHistory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;;IASjD,IAAI,GAAG,IAAI,OAAO,EAAE,CAEnB;IAED,IAAI,IAAI,IAAI,OAAO,EAAE,CAEpB;IAED,IAAI,IAAI,IAAI,OAAO,EAAE,CAEpB;IAED,IAAI,GAAG,IAAI,OAAO,EAAE,CAEnB;IAED,IAAI,KAAK,IAAI,OAAO,EAAE,CAErB;IAED,IAAI,MAAM,IAAI,OAAO,EAAE,CAEtB;IAED,IAAI,GAAG,IAAI,OAAO,EAAE,CAEnB;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAyB9B;;OAEG;IACH,KAAK,IAAI,IAAI;CASd"}
|
|
@@ -38,6 +38,11 @@ export declare class MockRegistry {
|
|
|
38
38
|
* @param url - URL string or RegExp to match
|
|
39
39
|
*/
|
|
40
40
|
onGet(url: string | RegExp): MockResponseBuilder<MockRegistry>;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a mock for HEAD requests matching the given URL.
|
|
43
|
+
* @param url - URL string or RegExp to match
|
|
44
|
+
*/
|
|
45
|
+
onHead(url: string | RegExp): MockResponseBuilder<MockRegistry>;
|
|
41
46
|
/**
|
|
42
47
|
* Creates a mock for POST requests matching the given URL.
|
|
43
48
|
* @param url - URL string or RegExp to match
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MockRegistry.d.ts","sourceRoot":"","sources":["../../../src/src/mocks/MockRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,KAAK,KAAK,GAAG,OAAO,UAAU,CAAC,KAAK,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,YAAY;;IAMvB;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,mBAAmB,CAAC,YAAY,CAAC;IAI9D;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,mBAAmB,CAAC,YAAY,CAAC;IAI/D;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,mBAAmB,CAAC,YAAY,CAAC;IAI9D;;;OAGG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,mBAAmB,CAAC,YAAY,CAAC;IAIhE;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,mBAAmB,CAAC,YAAY,CAAC;IAIjE;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,mBAAmB,CAAC,YAAY,CAAC;IAoB9D;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,WAAW,GAAG,IAAI;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