rezo 1.0.43 → 1.0.45

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 (79) hide show
  1. package/dist/adapters/entries/curl.d.ts +115 -0
  2. package/dist/adapters/entries/fetch.d.ts +115 -0
  3. package/dist/adapters/entries/http.d.ts +115 -0
  4. package/dist/adapters/entries/http2.d.ts +115 -0
  5. package/dist/adapters/entries/react-native.d.ts +115 -0
  6. package/dist/adapters/entries/xhr.d.ts +115 -0
  7. package/dist/adapters/fetch.cjs +18 -0
  8. package/dist/adapters/fetch.js +18 -0
  9. package/dist/adapters/http.cjs +18 -0
  10. package/dist/adapters/http.js +18 -0
  11. package/dist/adapters/http2.cjs +18 -0
  12. package/dist/adapters/http2.js +18 -0
  13. package/dist/adapters/index.cjs +6 -6
  14. package/dist/adapters/xhr.cjs +19 -0
  15. package/dist/adapters/xhr.js +19 -0
  16. package/dist/cache/index.cjs +9 -15
  17. package/dist/cache/index.js +0 -3
  18. package/dist/core/hooks.cjs +4 -2
  19. package/dist/core/hooks.js +4 -2
  20. package/dist/crawler/addon/decodo/index.cjs +1 -0
  21. package/dist/crawler/addon/decodo/index.js +1 -0
  22. package/dist/crawler/crawler-options.cjs +1 -0
  23. package/dist/crawler/crawler-options.js +1 -0
  24. package/dist/{plugin → crawler}/crawler.cjs +392 -32
  25. package/dist/{plugin → crawler}/crawler.js +392 -32
  26. package/dist/crawler/index.cjs +40 -0
  27. package/dist/{plugin → crawler}/index.js +4 -2
  28. package/dist/crawler/plugin/file-cacher.cjs +19 -0
  29. package/dist/crawler/plugin/file-cacher.js +19 -0
  30. package/dist/crawler/plugin/index.cjs +1 -0
  31. package/dist/crawler/plugin/index.js +1 -0
  32. package/dist/crawler/plugin/navigation-history.cjs +43 -0
  33. package/dist/crawler/plugin/navigation-history.js +43 -0
  34. package/dist/crawler/plugin/robots-txt.cjs +2 -0
  35. package/dist/crawler/plugin/robots-txt.js +2 -0
  36. package/dist/crawler/plugin/url-store.cjs +18 -0
  37. package/dist/crawler/plugin/url-store.js +18 -0
  38. package/dist/crawler.d.ts +430 -172
  39. package/dist/entries/crawler.cjs +5 -5
  40. package/dist/entries/crawler.js +2 -2
  41. package/dist/index.cjs +27 -27
  42. package/dist/index.d.ts +115 -0
  43. package/dist/internal/agents/index.cjs +10 -10
  44. package/dist/platform/browser.d.ts +115 -0
  45. package/dist/platform/bun.d.ts +115 -0
  46. package/dist/platform/deno.d.ts +115 -0
  47. package/dist/platform/node.d.ts +115 -0
  48. package/dist/platform/react-native.d.ts +115 -0
  49. package/dist/platform/worker.d.ts +115 -0
  50. package/dist/proxy/index.cjs +5 -5
  51. package/dist/proxy/index.js +1 -1
  52. package/dist/queue/index.cjs +8 -8
  53. package/dist/responses/universal/index.cjs +11 -11
  54. package/dist/utils/rate-limit-wait.cjs +217 -0
  55. package/dist/utils/rate-limit-wait.js +208 -0
  56. package/package.json +2 -6
  57. package/dist/cache/file-cacher.cjs +0 -270
  58. package/dist/cache/file-cacher.js +0 -267
  59. package/dist/cache/navigation-history.cjs +0 -298
  60. package/dist/cache/navigation-history.js +0 -296
  61. package/dist/cache/url-store.cjs +0 -294
  62. package/dist/cache/url-store.js +0 -291
  63. package/dist/plugin/addon/decodo/index.cjs +0 -1
  64. package/dist/plugin/addon/decodo/index.js +0 -1
  65. package/dist/plugin/crawler-options.cjs +0 -1
  66. package/dist/plugin/crawler-options.js +0 -1
  67. package/dist/plugin/index.cjs +0 -36
  68. /package/dist/{plugin → crawler}/addon/decodo/options.cjs +0 -0
  69. /package/dist/{plugin → crawler}/addon/decodo/options.js +0 -0
  70. /package/dist/{plugin → crawler}/addon/decodo/types.cjs +0 -0
  71. /package/dist/{plugin → crawler}/addon/decodo/types.js +0 -0
  72. /package/dist/{plugin → crawler}/addon/oxylabs/index.cjs +0 -0
  73. /package/dist/{plugin → crawler}/addon/oxylabs/index.js +0 -0
  74. /package/dist/{plugin → crawler}/addon/oxylabs/options.cjs +0 -0
  75. /package/dist/{plugin → crawler}/addon/oxylabs/options.js +0 -0
  76. /package/dist/{plugin → crawler}/addon/oxylabs/types.cjs +0 -0
  77. /package/dist/{plugin → crawler}/addon/oxylabs/types.js +0 -0
  78. /package/dist/{plugin → crawler}/scraper.cjs +0 -0
  79. /package/dist/{plugin → crawler}/scraper.js +0 -0
@@ -0,0 +1,208 @@
1
+ import { RezoHeaders } from './headers.js';
2
+ export const DEFAULT_WAIT_STATUS_CODES = [429];
3
+ export const DEFAULT_MAX_WAIT_TIME = 60000;
4
+ export const DEFAULT_WAIT_TIME = 1000;
5
+ export const DEFAULT_MAX_WAIT_ATTEMPTS = 3;
6
+ export function shouldWaitOnStatus(status, waitOnStatus) {
7
+ if (!waitOnStatus)
8
+ return false;
9
+ if (waitOnStatus === true) {
10
+ return DEFAULT_WAIT_STATUS_CODES.includes(status);
11
+ }
12
+ if (Array.isArray(waitOnStatus)) {
13
+ return waitOnStatus.includes(status);
14
+ }
15
+ return false;
16
+ }
17
+ export function parseRetryAfterHeader(value) {
18
+ if (!value)
19
+ return null;
20
+ const trimmed = value.trim();
21
+ const seconds = parseInt(trimmed, 10);
22
+ if (!isNaN(seconds) && seconds >= 0) {
23
+ return seconds * 1000;
24
+ }
25
+ const date = new Date(trimmed);
26
+ if (!isNaN(date.getTime())) {
27
+ const delayMs = date.getTime() - Date.now();
28
+ return delayMs > 0 ? delayMs : 0;
29
+ }
30
+ return null;
31
+ }
32
+ export function getNestedValue(obj, path) {
33
+ if (!obj || typeof path !== "string")
34
+ return;
35
+ const parts = path.split(".");
36
+ let current = obj;
37
+ for (const part of parts) {
38
+ if (current === null || current === undefined)
39
+ return;
40
+ if (typeof current !== "object")
41
+ return;
42
+ current = current[part];
43
+ }
44
+ return current;
45
+ }
46
+ export function extractWaitTime(response, options) {
47
+ const source = options.waitTimeSource ?? "retry-after";
48
+ const defaultWaitTime = options.defaultWaitTime ?? DEFAULT_WAIT_TIME;
49
+ if (typeof source === "function") {
50
+ try {
51
+ const seconds = source(response);
52
+ if (seconds !== null && seconds !== undefined && seconds > 0) {
53
+ return {
54
+ waitTimeMs: seconds * 1000,
55
+ source: "function"
56
+ };
57
+ }
58
+ } catch {}
59
+ return {
60
+ waitTimeMs: defaultWaitTime,
61
+ source: "default"
62
+ };
63
+ }
64
+ if (source === "retry-after") {
65
+ const headerValue = response.headers?.get?.("retry-after") ?? response.headers?.get?.("Retry-After") ?? response.headers?.["retry-after"] ?? response.headers?.["Retry-After"];
66
+ const waitTimeMs = parseRetryAfterHeader(headerValue);
67
+ if (waitTimeMs !== null) {
68
+ return {
69
+ waitTimeMs,
70
+ source: "header",
71
+ sourcePath: "retry-after"
72
+ };
73
+ }
74
+ return {
75
+ waitTimeMs: defaultWaitTime,
76
+ source: "default"
77
+ };
78
+ }
79
+ if (typeof source === "object" && "header" in source) {
80
+ const headerName = source.header;
81
+ const headerValue = response.headers?.get?.(headerName) ?? response.headers?.get?.(headerName.toLowerCase()) ?? response.headers?.[headerName] ?? response.headers?.[headerName.toLowerCase()];
82
+ if (headerValue) {
83
+ const numValue = parseInt(headerValue, 10);
84
+ if (!isNaN(numValue)) {
85
+ const now = Math.floor(Date.now() / 1000);
86
+ if (numValue > now && numValue < now + 86400 * 365) {
87
+ const waitTimeMs = (numValue - now) * 1000;
88
+ return {
89
+ waitTimeMs: waitTimeMs > 0 ? waitTimeMs : defaultWaitTime,
90
+ source: "header",
91
+ sourcePath: headerName
92
+ };
93
+ }
94
+ return {
95
+ waitTimeMs: numValue * 1000,
96
+ source: "header",
97
+ sourcePath: headerName
98
+ };
99
+ }
100
+ const waitTimeMs = parseRetryAfterHeader(headerValue);
101
+ if (waitTimeMs !== null) {
102
+ return {
103
+ waitTimeMs,
104
+ source: "header",
105
+ sourcePath: headerName
106
+ };
107
+ }
108
+ }
109
+ return {
110
+ waitTimeMs: defaultWaitTime,
111
+ source: "default"
112
+ };
113
+ }
114
+ if (typeof source === "object" && "body" in source) {
115
+ const bodyPath = source.body;
116
+ const value = getNestedValue(response.data, bodyPath);
117
+ if (value !== null && value !== undefined) {
118
+ const numValue = typeof value === "number" ? value : parseInt(String(value), 10);
119
+ if (!isNaN(numValue) && numValue > 0) {
120
+ return {
121
+ waitTimeMs: numValue * 1000,
122
+ source: "body",
123
+ sourcePath: bodyPath
124
+ };
125
+ }
126
+ }
127
+ return {
128
+ waitTimeMs: defaultWaitTime,
129
+ source: "default"
130
+ };
131
+ }
132
+ return {
133
+ waitTimeMs: defaultWaitTime,
134
+ source: "default"
135
+ };
136
+ }
137
+ export function createRateLimitWaitEvent(status, waitTimeMs, attempt, maxAttempts, source, sourcePath, url, method) {
138
+ return {
139
+ status,
140
+ waitTime: waitTimeMs,
141
+ attempt,
142
+ maxAttempts,
143
+ source,
144
+ sourcePath,
145
+ url,
146
+ method,
147
+ timestamp: Date.now()
148
+ };
149
+ }
150
+ export async function executeRateLimitWaitHooks(event, config) {
151
+ const hooks = config.hooks?.onRateLimitWait;
152
+ if (!hooks || hooks.length === 0)
153
+ return;
154
+ for (const hook of hooks) {
155
+ try {
156
+ await hook(event, config);
157
+ } catch (err) {
158
+ if (config.debug) {
159
+ console.log("[Rezo Debug] onRateLimitWait hook error:", err);
160
+ }
161
+ }
162
+ }
163
+ }
164
+ export function sleep(ms) {
165
+ return new Promise((resolve) => setTimeout(resolve, ms));
166
+ }
167
+ function normalizeHeaders(headers) {
168
+ if (!headers)
169
+ return new RezoHeaders;
170
+ if (headers instanceof RezoHeaders)
171
+ return headers;
172
+ if (typeof headers.get === "function")
173
+ return headers;
174
+ try {
175
+ return new RezoHeaders(headers);
176
+ } catch {
177
+ return new RezoHeaders;
178
+ }
179
+ }
180
+ export async function handleRateLimitWait(ctx) {
181
+ const { status, headers, data, url, method, config, options, currentWaitAttempt } = ctx;
182
+ if (!shouldWaitOnStatus(status, options.waitOnStatus)) {
183
+ return { shouldRetry: false, waitAttempt: currentWaitAttempt, waitedMs: 0 };
184
+ }
185
+ const maxAttempts = options.maxWaitAttempts ?? DEFAULT_MAX_WAIT_ATTEMPTS;
186
+ const maxWaitTime = options.maxWaitTime ?? DEFAULT_MAX_WAIT_TIME;
187
+ const nextAttempt = currentWaitAttempt + 1;
188
+ if (nextAttempt > maxAttempts) {
189
+ return { shouldRetry: false, waitAttempt: currentWaitAttempt, waitedMs: 0 };
190
+ }
191
+ const normalizedHeaders = normalizeHeaders(headers);
192
+ const extracted = extractWaitTime({ status, headers: normalizedHeaders, data }, options);
193
+ let waitTimeMs = extracted.waitTimeMs;
194
+ if (maxWaitTime > 0 && waitTimeMs > maxWaitTime) {
195
+ return { shouldRetry: false, waitAttempt: currentWaitAttempt, waitedMs: 0 };
196
+ }
197
+ const event = createRateLimitWaitEvent(status, waitTimeMs, nextAttempt, maxAttempts, extracted.source, extracted.sourcePath, url, method);
198
+ await executeRateLimitWaitHooks(event, config);
199
+ if (config.debug) {
200
+ console.log(`[Rezo Debug] Rate limit (${status}) - waiting ${waitTimeMs}ms (attempt ${nextAttempt}/${maxAttempts}, source: ${extracted.source}${extracted.sourcePath ? `:${extracted.sourcePath}` : ""})`);
201
+ }
202
+ await sleep(waitTimeMs);
203
+ return {
204
+ shouldRetry: true,
205
+ waitAttempt: nextAttempt,
206
+ waitedMs: waitTimeMs
207
+ };
208
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rezo",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "Lightning-fast, enterprise-grade HTTP client for modern JavaScript. Full HTTP/2 support, intelligent cookie management, multiple adapters (HTTP, Fetch, cURL, XHR), streaming, proxy support (HTTP/HTTPS/SOCKS), and cross-environment compatibility.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -62,11 +62,7 @@
62
62
  },
63
63
  "dependencies": {
64
64
  "tough-cookie": "^5.1.2",
65
- "http-proxy-agent": "^7.0.2",
66
- "https-proxy-agent": "^7.0.6",
67
- "socks-proxy-agent": "^8.0.5",
68
- "linkedom": "^0.18.11",
69
- "agent-base": "^7.1.4"
65
+ "linkedom": "^0.18.11"
70
66
  },
71
67
  "typesVersions": {
72
68
  "*": {
@@ -1,270 +0,0 @@
1
- const fs = require("node:fs");
2
- const path = require("node:path");
3
- const { createHash } = require("node:crypto");
4
- function detectRuntime() {
5
- if (typeof globalThis.Bun !== "undefined") {
6
- return "bun";
7
- }
8
- if (typeof globalThis.Deno !== "undefined") {
9
- return "deno";
10
- }
11
- return "node";
12
- }
13
- async function createDatabase(dbPath) {
14
- const runtime = detectRuntime();
15
- if (runtime === "bun") {
16
- const { Database } = await import("bun:sqlite");
17
- const db = new Database(dbPath);
18
- return {
19
- run: (sql, ...params) => db.run(sql, ...params),
20
- get: (sql, ...params) => db.query(sql).get(...params),
21
- all: (sql, ...params) => db.query(sql).all(...params),
22
- close: () => db.close()
23
- };
24
- }
25
- if (runtime === "deno") {
26
- try {
27
- const { Database } = await import("node:sqlite");
28
- const db = new Database(dbPath);
29
- return {
30
- run: (sql, ...params) => db.exec(sql, params),
31
- get: (sql, ...params) => {
32
- const stmt = db.prepare(sql);
33
- return stmt.get(...params);
34
- },
35
- all: (sql, ...params) => {
36
- const stmt = db.prepare(sql);
37
- return stmt.all(...params);
38
- },
39
- close: () => db.close()
40
- };
41
- } catch {
42
- throw new Error("Deno SQLite support requires Node.js compatibility mode");
43
- }
44
- }
45
- const { DatabaseSync } = await import("node:sqlite");
46
- const db = new DatabaseSync(dbPath);
47
- return {
48
- run: (sql, ...params) => {
49
- if (params.length === 0) {
50
- db.exec(sql);
51
- } else {
52
- db.prepare(sql).run(...params);
53
- }
54
- },
55
- get: (sql, ...params) => {
56
- const stmt = db.prepare(sql);
57
- return stmt.get(...params);
58
- },
59
- all: (sql, ...params) => {
60
- const stmt = db.prepare(sql);
61
- return stmt.all(...params);
62
- },
63
- close: () => db.close()
64
- };
65
- }
66
- async function compressData(data) {
67
- try {
68
- const zlib = await import("node:zlib");
69
- if (typeof zlib.zstdCompressSync === "function") {
70
- return zlib.zstdCompressSync(data);
71
- }
72
- return data;
73
- } catch {
74
- return data;
75
- }
76
- }
77
- async function decompressData(data) {
78
- try {
79
- const zlib = await import("node:zlib");
80
- if (typeof zlib.zstdDecompressSync === "function") {
81
- return zlib.zstdDecompressSync(data);
82
- }
83
- return data;
84
- } catch {
85
- return data;
86
- }
87
- }
88
-
89
- class FileCacher {
90
- databases = new Map;
91
- options;
92
- cacheDir;
93
- closed = false;
94
- constructor(options = {}) {
95
- this.options = {
96
- cacheDir: options.cacheDir || "./cache",
97
- ttl: options.ttl || 604800000,
98
- compression: options.compression ?? false,
99
- softDelete: options.softDelete ?? false,
100
- encryptNamespace: options.encryptNamespace ?? false,
101
- maxEntries: options.maxEntries ?? 0
102
- };
103
- this.cacheDir = path.resolve(this.options.cacheDir);
104
- if (!fs.existsSync(this.cacheDir)) {
105
- fs.mkdirSync(this.cacheDir, { recursive: true });
106
- }
107
- }
108
- static async create(options = {}) {
109
- const cacher = new FileCacher(options);
110
- return cacher;
111
- }
112
- async getDatabase(namespace) {
113
- const nsKey = this.options.encryptNamespace ? createHash("md5").update(namespace).digest("hex") : namespace.replace(/[^a-zA-Z0-9_-]/g, "_");
114
- if (this.databases.has(nsKey)) {
115
- return this.databases.get(nsKey);
116
- }
117
- const dbPath = path.join(this.cacheDir, `${nsKey}.db`);
118
- const db = await createDatabase(dbPath);
119
- db.run(`
120
- CREATE TABLE IF NOT EXISTS cache (
121
- key TEXT PRIMARY KEY,
122
- value TEXT NOT NULL,
123
- expiresAt INTEGER NOT NULL,
124
- createdAt INTEGER NOT NULL,
125
- compressed INTEGER DEFAULT 0,
126
- deleted INTEGER DEFAULT 0
127
- )
128
- `);
129
- db.run("CREATE INDEX IF NOT EXISTS idx_expires ON cache(expiresAt)");
130
- db.run("CREATE INDEX IF NOT EXISTS idx_deleted ON cache(deleted)");
131
- this.databases.set(nsKey, db);
132
- return db;
133
- }
134
- async set(key, value, ttl, namespace = "default") {
135
- if (this.closed)
136
- throw new Error("FileCacher is closed");
137
- const db = await this.getDatabase(namespace);
138
- const now = Date.now();
139
- const expiresAt = now + (ttl ?? this.options.ttl);
140
- let serialized = JSON.stringify(value);
141
- let compressed = 0;
142
- if (this.options.compression) {
143
- try {
144
- const compressedData = await compressData(Buffer.from(serialized, "utf-8"));
145
- serialized = compressedData.toString("base64");
146
- compressed = 1;
147
- } catch {}
148
- }
149
- db.run(`
150
- INSERT OR REPLACE INTO cache (key, value, expiresAt, createdAt, compressed, deleted)
151
- VALUES (?, ?, ?, ?, ?, 0)
152
- `, key, serialized, expiresAt, now, compressed);
153
- if (this.options.maxEntries > 0) {
154
- const count = db.get("SELECT COUNT(*) as cnt FROM cache WHERE deleted = 0");
155
- if (count && count.cnt > this.options.maxEntries) {
156
- const excess = count.cnt - this.options.maxEntries;
157
- db.run(`
158
- DELETE FROM cache WHERE key IN (
159
- SELECT key FROM cache WHERE deleted = 0 ORDER BY createdAt ASC LIMIT ?
160
- )
161
- `, excess);
162
- }
163
- }
164
- }
165
- async get(key, namespace = "default") {
166
- if (this.closed)
167
- throw new Error("FileCacher is closed");
168
- const db = await this.getDatabase(namespace);
169
- const entry = db.get("SELECT * FROM cache WHERE key = ? AND deleted = 0", key);
170
- if (!entry)
171
- return null;
172
- if (entry.expiresAt < Date.now()) {
173
- if (this.options.softDelete) {
174
- db.run("UPDATE cache SET deleted = 1 WHERE key = ?", key);
175
- } else {
176
- db.run("DELETE FROM cache WHERE key = ?", key);
177
- }
178
- return null;
179
- }
180
- let value = entry.value;
181
- if (entry.compressed) {
182
- try {
183
- const decompressed = await decompressData(Buffer.from(value, "base64"));
184
- value = decompressed.toString("utf-8");
185
- } catch {
186
- return null;
187
- }
188
- }
189
- try {
190
- return JSON.parse(value);
191
- } catch {
192
- return null;
193
- }
194
- }
195
- async has(key, namespace = "default") {
196
- if (this.closed)
197
- return false;
198
- const db = await this.getDatabase(namespace);
199
- const entry = db.get("SELECT key, expiresAt FROM cache WHERE key = ? AND deleted = 0", key);
200
- if (!entry)
201
- return false;
202
- return entry.expiresAt >= Date.now();
203
- }
204
- async delete(key, namespace = "default") {
205
- if (this.closed)
206
- return false;
207
- const db = await this.getDatabase(namespace);
208
- if (this.options.softDelete) {
209
- db.run("UPDATE cache SET deleted = 1 WHERE key = ?", key);
210
- } else {
211
- db.run("DELETE FROM cache WHERE key = ?", key);
212
- }
213
- return true;
214
- }
215
- async clear(namespace = "default") {
216
- if (this.closed)
217
- return;
218
- const db = await this.getDatabase(namespace);
219
- if (this.options.softDelete) {
220
- db.run("UPDATE cache SET deleted = 1");
221
- } else {
222
- db.run("DELETE FROM cache");
223
- }
224
- }
225
- async cleanup(namespace = "default") {
226
- if (this.closed)
227
- return 0;
228
- const db = await this.getDatabase(namespace);
229
- const now = Date.now();
230
- const countBefore = db.get("SELECT COUNT(*) as cnt FROM cache");
231
- db.run("DELETE FROM cache WHERE expiresAt < ? OR deleted = 1", now);
232
- const countAfter = db.get("SELECT COUNT(*) as cnt FROM cache");
233
- return (countBefore?.cnt || 0) - (countAfter?.cnt || 0);
234
- }
235
- async stats(namespace = "default") {
236
- if (this.closed)
237
- return { count: 0, expired: 0, deleted: 0 };
238
- const db = await this.getDatabase(namespace);
239
- const now = Date.now();
240
- const total = db.get("SELECT COUNT(*) as cnt FROM cache WHERE deleted = 0");
241
- const expired = db.get("SELECT COUNT(*) as cnt FROM cache WHERE expiresAt < ? AND deleted = 0", now);
242
- const deleted = db.get("SELECT COUNT(*) as cnt FROM cache WHERE deleted = 1");
243
- return {
244
- count: total?.cnt || 0,
245
- expired: expired?.cnt || 0,
246
- deleted: deleted?.cnt || 0
247
- };
248
- }
249
- async close() {
250
- if (this.closed)
251
- return;
252
- this.closed = true;
253
- for (const db of this.databases.values()) {
254
- try {
255
- db.close();
256
- } catch {}
257
- }
258
- this.databases.clear();
259
- }
260
- get isClosed() {
261
- return this.closed;
262
- }
263
- get directory() {
264
- return this.cacheDir;
265
- }
266
- }
267
-
268
- exports.FileCacher = FileCacher;
269
- exports.default = FileCacher;
270
- module.exports = Object.assign(FileCacher, exports);