@relayfile/adapter-core 0.3.37 → 0.3.38
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/dist/src/alias-lifecycle.d.ts +73 -0
- package/dist/src/alias-lifecycle.d.ts.map +1 -0
- package/dist/src/alias-lifecycle.js +90 -0
- package/dist/src/alias-lifecycle.js.map +1 -0
- package/dist/src/http/index.d.ts +3 -0
- package/dist/src/http/index.d.ts.map +1 -0
- package/dist/src/http/index.js +2 -0
- package/dist/src/http/index.js.map +1 -0
- package/dist/src/http/retry.d.ts +165 -0
- package/dist/src/http/retry.d.ts.map +1 -0
- package/dist/src/http/retry.js +330 -0
- package/dist/src/http/retry.js.map +1 -0
- package/dist/src/http/retry.test.d.ts +2 -0
- package/dist/src/http/retry.test.d.ts.map +1 -0
- package/dist/src/http/retry.test.js +382 -0
- package/dist/src/http/retry.test.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/ingest/shared.d.ts.map +1 -1
- package/dist/src/ingest/shared.js +2 -1
- package/dist/src/ingest/shared.js.map +1 -1
- package/dist/src/runtime/file-native-router.test.js +15 -0
- package/dist/src/runtime/file-native-router.test.js.map +1 -1
- package/dist/src/runtime/schema-adapter.d.ts.map +1 -1
- package/dist/src/runtime/schema-adapter.js +3 -2
- package/dist/src/runtime/schema-adapter.js.map +1 -1
- package/dist/src/writeback-paths/catalog.generated.d.ts +4 -0
- package/dist/src/writeback-paths/catalog.generated.d.ts.map +1 -1
- package/dist/src/writeback-paths/catalog.generated.js +6 -0
- package/dist/src/writeback-paths/catalog.generated.js.map +1 -1
- package/dist/tests/alias-lifecycle/alias-lifecycle.test.d.ts +2 -0
- package/dist/tests/alias-lifecycle/alias-lifecycle.test.d.ts.map +1 -0
- package/dist/tests/alias-lifecycle/alias-lifecycle.test.js +104 -0
- package/dist/tests/alias-lifecycle/alias-lifecycle.test.js.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared HTTP rate-limit / retry helpers.
|
|
3
|
+
*
|
|
4
|
+
* Adapters in this repo talk to providers through one of two transports:
|
|
5
|
+
*
|
|
6
|
+
* 1. A `fetch`-shaped client (Notion's raw token path, the X search client).
|
|
7
|
+
* Wrap those call sites with {@link fetchWithRetry}.
|
|
8
|
+
* 2. A relayfile `ConnectionProvider.proxy()` call. Wrap the provider with
|
|
9
|
+
* {@link withProxyRetry} at the call site:
|
|
10
|
+
*
|
|
11
|
+
* const response = await withProxyRetry(provider).proxy({ ... });
|
|
12
|
+
*
|
|
13
|
+
* Both honor `Retry-After` (delta-seconds and HTTP-date forms), retry on 429,
|
|
14
|
+
* 5xx, and transient network errors with exponential backoff plus jitter, and
|
|
15
|
+
* never retry non-idempotent requests (POST/PATCH) unless the caller opts in
|
|
16
|
+
* via `retryNonIdempotent: true`.
|
|
17
|
+
*
|
|
18
|
+
* Exhaustion semantics:
|
|
19
|
+
* - If the final attempt produced an HTTP response, that response is returned
|
|
20
|
+
* so existing status handling in adapters keeps working unchanged. Callers
|
|
21
|
+
* that want a typed failure instead can pass
|
|
22
|
+
* `throwOnExhaustedRetryableStatus: true` to receive a
|
|
23
|
+
* {@link RetryExhaustedError}.
|
|
24
|
+
* - If the final attempt failed with a transient network error, a
|
|
25
|
+
* {@link RetryExhaustedError} is thrown with the underlying error as
|
|
26
|
+
* `cause`.
|
|
27
|
+
*/
|
|
28
|
+
const DEFAULT_MAX_ATTEMPTS = 3;
|
|
29
|
+
const DEFAULT_MAX_ELAPSED_MS = 30_000;
|
|
30
|
+
const DEFAULT_INITIAL_DELAY_MS = 250;
|
|
31
|
+
const DEFAULT_MAX_DELAY_MS = 10_000;
|
|
32
|
+
const DEFAULT_BACKOFF_FACTOR = 2;
|
|
33
|
+
const IDEMPOTENT_METHODS = new Set(['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE']);
|
|
34
|
+
const TRANSIENT_ERROR_CODES = new Set([
|
|
35
|
+
'ECONNRESET',
|
|
36
|
+
'ECONNREFUSED',
|
|
37
|
+
'ECONNABORTED',
|
|
38
|
+
'EPIPE',
|
|
39
|
+
'ETIMEDOUT',
|
|
40
|
+
'EAI_AGAIN',
|
|
41
|
+
'ENETUNREACH',
|
|
42
|
+
'EHOSTUNREACH',
|
|
43
|
+
'UND_ERR_CONNECT_TIMEOUT',
|
|
44
|
+
'UND_ERR_SOCKET',
|
|
45
|
+
'UND_ERR_HEADERS_TIMEOUT',
|
|
46
|
+
'UND_ERR_BODY_TIMEOUT',
|
|
47
|
+
]);
|
|
48
|
+
/** Typed error surfaced when retries are exhausted. */
|
|
49
|
+
export class RetryExhaustedError extends Error {
|
|
50
|
+
code = 'RETRY_EXHAUSTED';
|
|
51
|
+
/** Number of attempts that were made. */
|
|
52
|
+
attempts;
|
|
53
|
+
/** Wall-clock time spent across all attempts, in milliseconds. */
|
|
54
|
+
elapsedMs;
|
|
55
|
+
/** Status of the final response, when the final attempt got one. */
|
|
56
|
+
lastStatus;
|
|
57
|
+
constructor(message, details) {
|
|
58
|
+
super(message, details.cause === undefined ? undefined : { cause: details.cause });
|
|
59
|
+
this.name = 'RetryExhaustedError';
|
|
60
|
+
this.attempts = details.attempts;
|
|
61
|
+
this.elapsedMs = details.elapsedMs;
|
|
62
|
+
if (details.lastStatus !== undefined)
|
|
63
|
+
this.lastStatus = details.lastStatus;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** True for errors that look like transient network failures worth retrying. */
|
|
67
|
+
export function isTransientNetworkError(error) {
|
|
68
|
+
if (isAbortError(error))
|
|
69
|
+
return false;
|
|
70
|
+
let current = error;
|
|
71
|
+
for (let depth = 0; depth < 5 && current !== null && typeof current === 'object'; depth += 1) {
|
|
72
|
+
const record = current;
|
|
73
|
+
const code = record.code ?? record.errno;
|
|
74
|
+
if (typeof code === 'string' && TRANSIENT_ERROR_CODES.has(code))
|
|
75
|
+
return true;
|
|
76
|
+
if (current instanceof TypeError) {
|
|
77
|
+
// undici / WHATWG fetch reports network failures as `TypeError: fetch failed`.
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
current = record.cause;
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
function isAbortError(error) {
|
|
85
|
+
return (error !== null &&
|
|
86
|
+
typeof error === 'object' &&
|
|
87
|
+
error.name === 'AbortError');
|
|
88
|
+
}
|
|
89
|
+
function isIdempotentMethod(method) {
|
|
90
|
+
return IDEMPOTENT_METHODS.has((method ?? 'GET').toUpperCase());
|
|
91
|
+
}
|
|
92
|
+
function defaultIsRetryableStatus(status) {
|
|
93
|
+
return status === 429 || (status >= 500 && status <= 599);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parse a `Retry-After` header value: either delta-seconds or an HTTP-date.
|
|
97
|
+
* Returns the wait in milliseconds, or `undefined` when unparseable.
|
|
98
|
+
*/
|
|
99
|
+
export function parseRetryAfterMs(value, nowMs) {
|
|
100
|
+
if (typeof value !== 'string')
|
|
101
|
+
return undefined;
|
|
102
|
+
const trimmed = value.trim();
|
|
103
|
+
if (trimmed === '')
|
|
104
|
+
return undefined;
|
|
105
|
+
if (/^\d+$/.test(trimmed)) {
|
|
106
|
+
return Number.parseInt(trimmed, 10) * 1000;
|
|
107
|
+
}
|
|
108
|
+
const date = Date.parse(trimmed);
|
|
109
|
+
if (Number.isNaN(date))
|
|
110
|
+
return undefined;
|
|
111
|
+
return Math.max(0, date - nowMs);
|
|
112
|
+
}
|
|
113
|
+
function readHeader(headers, name) {
|
|
114
|
+
if (!headers)
|
|
115
|
+
return undefined;
|
|
116
|
+
if (typeof headers.get === 'function') {
|
|
117
|
+
const value = headers.get(name);
|
|
118
|
+
return value ?? undefined;
|
|
119
|
+
}
|
|
120
|
+
const record = headers;
|
|
121
|
+
const lower = name.toLowerCase();
|
|
122
|
+
for (const key of Object.keys(record)) {
|
|
123
|
+
if (key.toLowerCase() === lower) {
|
|
124
|
+
const value = record[key];
|
|
125
|
+
if (typeof value === 'string')
|
|
126
|
+
return value;
|
|
127
|
+
if (Array.isArray(value))
|
|
128
|
+
return value[0];
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
function defaultSleep(ms, signal) {
|
|
135
|
+
return new Promise((resolve, reject) => {
|
|
136
|
+
if (signal?.aborted) {
|
|
137
|
+
reject(createAbortError());
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const timer = setTimeout(() => {
|
|
141
|
+
signal?.removeEventListener('abort', onAbort);
|
|
142
|
+
resolve();
|
|
143
|
+
}, ms);
|
|
144
|
+
function onAbort() {
|
|
145
|
+
clearTimeout(timer);
|
|
146
|
+
reject(createAbortError());
|
|
147
|
+
}
|
|
148
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function createAbortError() {
|
|
152
|
+
const error = new Error('The operation was aborted');
|
|
153
|
+
error.name = 'AbortError';
|
|
154
|
+
return error;
|
|
155
|
+
}
|
|
156
|
+
function resolveOptions(options) {
|
|
157
|
+
const resolved = {
|
|
158
|
+
maxAttempts: Math.max(1, options.maxAttempts ?? DEFAULT_MAX_ATTEMPTS),
|
|
159
|
+
maxElapsedMs: options.maxElapsedMs ?? DEFAULT_MAX_ELAPSED_MS,
|
|
160
|
+
initialDelayMs: options.initialDelayMs ?? DEFAULT_INITIAL_DELAY_MS,
|
|
161
|
+
maxDelayMs: options.maxDelayMs ?? DEFAULT_MAX_DELAY_MS,
|
|
162
|
+
backoffFactor: options.backoffFactor ?? DEFAULT_BACKOFF_FACTOR,
|
|
163
|
+
retryNonIdempotent: options.retryNonIdempotent ?? false,
|
|
164
|
+
isRetryableStatus: options.isRetryableStatus ?? defaultIsRetryableStatus,
|
|
165
|
+
isRetryableError: options.isRetryableError ?? isTransientNetworkError,
|
|
166
|
+
throwOnExhaustedRetryableStatus: options.throwOnExhaustedRetryableStatus ?? false,
|
|
167
|
+
sleep: options.sleep ?? defaultSleep,
|
|
168
|
+
random: options.random ?? Math.random,
|
|
169
|
+
now: options.now ?? Date.now,
|
|
170
|
+
};
|
|
171
|
+
if (options.signal)
|
|
172
|
+
resolved.signal = options.signal;
|
|
173
|
+
return resolved;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Core retry loop shared by {@link fetchWithRetry} and {@link withProxyRetry}.
|
|
177
|
+
*
|
|
178
|
+
* `attempt` performs one request; `inspect` classifies its result. Thrown
|
|
179
|
+
* errors are retried only when `isRetryableError` says so and the request is
|
|
180
|
+
* idempotent (or `retryNonIdempotent` is set).
|
|
181
|
+
*/
|
|
182
|
+
export async function executeWithRetry(args) {
|
|
183
|
+
const opts = resolveOptions(args.options);
|
|
184
|
+
const canRetry = args.idempotent || opts.retryNonIdempotent;
|
|
185
|
+
const startedAt = opts.now();
|
|
186
|
+
for (let attemptNumber = 1;; attemptNumber += 1) {
|
|
187
|
+
if (opts.signal?.aborted)
|
|
188
|
+
throw createAbortError();
|
|
189
|
+
let result;
|
|
190
|
+
try {
|
|
191
|
+
result = await args.attempt();
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
if (isAbortError(error) || !canRetry || !opts.isRetryableError(error)) {
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
const delayMs = nextDelayMs(opts, attemptNumber, undefined);
|
|
198
|
+
if (attemptNumber >= opts.maxAttempts || exceedsBudget(opts, startedAt, delayMs)) {
|
|
199
|
+
throw new RetryExhaustedError(`${args.describe} failed after ${attemptNumber} attempt(s): ${describeError(error)}`, { attempts: attemptNumber, elapsedMs: opts.now() - startedAt, cause: error });
|
|
200
|
+
}
|
|
201
|
+
await opts.sleep(delayMs, opts.signal);
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
const inspection = args.inspect(result);
|
|
205
|
+
if (!inspection.retryable || !canRetry) {
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
const delayMs = nextDelayMs(opts, attemptNumber, inspection.retryAfterMs);
|
|
209
|
+
if (attemptNumber >= opts.maxAttempts || exceedsBudget(opts, startedAt, delayMs)) {
|
|
210
|
+
if (opts.throwOnExhaustedRetryableStatus) {
|
|
211
|
+
throw new RetryExhaustedError(`${args.describe} still returning ${inspection.status} after ${attemptNumber} attempt(s)`, {
|
|
212
|
+
attempts: attemptNumber,
|
|
213
|
+
elapsedMs: opts.now() - startedAt,
|
|
214
|
+
lastStatus: inspection.status,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
await opts.sleep(delayMs, opts.signal);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function nextDelayMs(opts, attemptNumber, retryAfterMs) {
|
|
223
|
+
if (retryAfterMs !== undefined) {
|
|
224
|
+
// Honor the server's request, but never beyond the elapsed-time budget
|
|
225
|
+
// (checked by the caller via exceedsBudget).
|
|
226
|
+
return retryAfterMs;
|
|
227
|
+
}
|
|
228
|
+
const exponential = Math.min(opts.maxDelayMs, opts.initialDelayMs * opts.backoffFactor ** (attemptNumber - 1));
|
|
229
|
+
// Equal jitter: half deterministic, half random.
|
|
230
|
+
return exponential / 2 + opts.random() * (exponential / 2);
|
|
231
|
+
}
|
|
232
|
+
function exceedsBudget(opts, startedAt, delayMs) {
|
|
233
|
+
return opts.now() - startedAt + delayMs > opts.maxElapsedMs;
|
|
234
|
+
}
|
|
235
|
+
function describeError(error) {
|
|
236
|
+
return error instanceof Error ? error.message : String(error);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* `fetch` with rate-limit aware retries.
|
|
240
|
+
*
|
|
241
|
+
* Retries 429/5xx responses (honoring `Retry-After`) and transient network
|
|
242
|
+
* errors with exponential backoff plus jitter. Non-idempotent methods
|
|
243
|
+
* (POST/PATCH) are never retried unless the caller opts in via
|
|
244
|
+
* `retryNonIdempotent` or `idempotent: true`.
|
|
245
|
+
*
|
|
246
|
+
* Returns the final response even when it is still an error status, unless
|
|
247
|
+
* `throwOnExhaustedRetryableStatus` is set; network-error exhaustion throws a
|
|
248
|
+
* {@link RetryExhaustedError}.
|
|
249
|
+
*/
|
|
250
|
+
export async function fetchWithRetry(input, init = {}, options = {}) {
|
|
251
|
+
const fetchImpl = options.fetch ??
|
|
252
|
+
globalThis.fetch;
|
|
253
|
+
if (typeof fetchImpl !== 'function') {
|
|
254
|
+
throw new TypeError('fetchWithRetry requires a fetch implementation');
|
|
255
|
+
}
|
|
256
|
+
const idempotent = options.idempotent ?? isIdempotentMethod(init.method);
|
|
257
|
+
const nowFn = options.now ?? Date.now;
|
|
258
|
+
const retryableStatus = options.isRetryableStatus ?? defaultIsRetryableStatus;
|
|
259
|
+
const retryOptions = { ...options };
|
|
260
|
+
if (!retryOptions.signal && init.signal)
|
|
261
|
+
retryOptions.signal = init.signal;
|
|
262
|
+
return executeWithRetry({
|
|
263
|
+
attempt: () => fetchImpl(input, init),
|
|
264
|
+
inspect: (response) => {
|
|
265
|
+
const retryable = retryableStatus(response.status);
|
|
266
|
+
const inspection = { retryable, status: response.status };
|
|
267
|
+
if (retryable) {
|
|
268
|
+
const retryAfterMs = parseRetryAfterMs(readHeader(response.headers, 'retry-after'), nowFn());
|
|
269
|
+
if (retryAfterMs !== undefined)
|
|
270
|
+
inspection.retryAfterMs = retryAfterMs;
|
|
271
|
+
}
|
|
272
|
+
return inspection;
|
|
273
|
+
},
|
|
274
|
+
idempotent,
|
|
275
|
+
describe: `${(init.method ?? 'GET').toUpperCase()} ${String(input)}`,
|
|
276
|
+
options: retryOptions,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
const defaultWrappedProviders = new WeakMap();
|
|
280
|
+
/**
|
|
281
|
+
* Wrap a `ConnectionProvider`-shaped object so `proxy()` retries 429/5xx
|
|
282
|
+
* responses (honoring `Retry-After`) and transient network errors. The
|
|
283
|
+
* wrapper preserves the provider's full type, so call sites change from
|
|
284
|
+
* `provider.proxy({...})` to `withProxyRetry(provider).proxy({...})`.
|
|
285
|
+
*
|
|
286
|
+
* POST/PATCH requests pass through without retries unless
|
|
287
|
+
* `retryNonIdempotent` is set.
|
|
288
|
+
*/
|
|
289
|
+
export function withProxyRetry(provider, options) {
|
|
290
|
+
if (options === undefined) {
|
|
291
|
+
const cached = defaultWrappedProviders.get(provider);
|
|
292
|
+
if (cached)
|
|
293
|
+
return cached;
|
|
294
|
+
}
|
|
295
|
+
const wrapped = Object.create(provider);
|
|
296
|
+
const retryOptions = options ?? {};
|
|
297
|
+
const nowFn = retryOptions.now ?? Date.now;
|
|
298
|
+
const retryableStatus = retryOptions.isRetryableStatus ?? defaultIsRetryableStatus;
|
|
299
|
+
Object.defineProperty(wrapped, 'proxy', {
|
|
300
|
+
configurable: true,
|
|
301
|
+
writable: true,
|
|
302
|
+
enumerable: false,
|
|
303
|
+
value: (request) => {
|
|
304
|
+
const perCall = { ...retryOptions };
|
|
305
|
+
if (!perCall.signal && request?.signal)
|
|
306
|
+
perCall.signal = request.signal;
|
|
307
|
+
return executeWithRetry({
|
|
308
|
+
attempt: () => provider.proxy(request),
|
|
309
|
+
inspect: (response) => {
|
|
310
|
+
const retryable = retryableStatus(response.status);
|
|
311
|
+
const inspection = { retryable, status: response.status };
|
|
312
|
+
if (retryable) {
|
|
313
|
+
const retryAfterMs = parseRetryAfterMs(readHeader(response.headers, 'retry-after'), nowFn());
|
|
314
|
+
if (retryAfterMs !== undefined)
|
|
315
|
+
inspection.retryAfterMs = retryAfterMs;
|
|
316
|
+
}
|
|
317
|
+
return inspection;
|
|
318
|
+
},
|
|
319
|
+
idempotent: isIdempotentMethod(request?.method),
|
|
320
|
+
describe: `${(request?.method ?? 'GET').toUpperCase()} proxy request`,
|
|
321
|
+
options: perCall,
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
});
|
|
325
|
+
if (options === undefined) {
|
|
326
|
+
defaultWrappedProviders.set(provider, wrapped);
|
|
327
|
+
}
|
|
328
|
+
return wrapped;
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../src/http/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAsCH,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,sBAAsB,GAAG,MAAM,CAAC;AACtC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AACpC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAEjC,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAEzF,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,YAAY;IACZ,cAAc;IACd,cAAc;IACd,OAAO;IACP,WAAW;IACX,WAAW;IACX,aAAa;IACb,cAAc;IACd,yBAAyB;IACzB,gBAAgB;IAChB,yBAAyB;IACzB,sBAAsB;CACvB,CAAC,CAAC;AAEH,uDAAuD;AACvD,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,IAAI,GAAG,iBAAiB,CAAC;IAClC,yCAAyC;IAChC,QAAQ,CAAS;IAC1B,kEAAkE;IACzD,SAAS,CAAS;IAC3B,oEAAoE;IAC3D,UAAU,CAAU;IAE7B,YACE,OAAe,EACf,OAAsF;QAEtF,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,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