rezo 1.0.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 (135) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +1507 -0
  3. package/assets/icon.svg +37 -0
  4. package/assets/logo-dark.svg +47 -0
  5. package/assets/logo.svg +58 -0
  6. package/dist/adapters/curl.cjs +1034 -0
  7. package/dist/adapters/curl.js +1031 -0
  8. package/dist/adapters/entries/curl.cjs +4 -0
  9. package/dist/adapters/entries/curl.d.ts +2136 -0
  10. package/dist/adapters/entries/curl.js +2 -0
  11. package/dist/adapters/entries/fetch.cjs +2 -0
  12. package/dist/adapters/entries/fetch.d.ts +2127 -0
  13. package/dist/adapters/entries/fetch.js +1 -0
  14. package/dist/adapters/entries/http.cjs +2 -0
  15. package/dist/adapters/entries/http.d.ts +2126 -0
  16. package/dist/adapters/entries/http.js +1 -0
  17. package/dist/adapters/entries/http2.cjs +4 -0
  18. package/dist/adapters/entries/http2.d.ts +2136 -0
  19. package/dist/adapters/entries/http2.js +2 -0
  20. package/dist/adapters/entries/react-native.cjs +2 -0
  21. package/dist/adapters/entries/react-native.d.ts +2126 -0
  22. package/dist/adapters/entries/react-native.js +1 -0
  23. package/dist/adapters/entries/xhr.cjs +2 -0
  24. package/dist/adapters/entries/xhr.d.ts +2127 -0
  25. package/dist/adapters/entries/xhr.js +1 -0
  26. package/dist/adapters/fetch.cjs +740 -0
  27. package/dist/adapters/fetch.js +739 -0
  28. package/dist/adapters/http.cjs +1153 -0
  29. package/dist/adapters/http.js +1151 -0
  30. package/dist/adapters/http2.cjs +957 -0
  31. package/dist/adapters/http2.js +956 -0
  32. package/dist/adapters/index.cjs +6 -0
  33. package/dist/adapters/index.js +7 -0
  34. package/dist/adapters/picker.cjs +342 -0
  35. package/dist/adapters/picker.js +331 -0
  36. package/dist/adapters/react-native.cjs +545 -0
  37. package/dist/adapters/react-native.js +544 -0
  38. package/dist/adapters/xhr.cjs +622 -0
  39. package/dist/adapters/xhr.js +621 -0
  40. package/dist/cache/dns-cache.cjs +118 -0
  41. package/dist/cache/dns-cache.js +113 -0
  42. package/dist/cache/file-cacher.cjs +264 -0
  43. package/dist/cache/file-cacher.js +261 -0
  44. package/dist/cache/index.cjs +13 -0
  45. package/dist/cache/index.js +5 -0
  46. package/dist/cache/lru-cache.cjs +96 -0
  47. package/dist/cache/lru-cache.js +93 -0
  48. package/dist/cache/response-cache.cjs +314 -0
  49. package/dist/cache/response-cache.js +310 -0
  50. package/dist/cache/url-store.cjs +288 -0
  51. package/dist/cache/url-store.js +285 -0
  52. package/dist/core/hooks.cjs +133 -0
  53. package/dist/core/hooks.js +120 -0
  54. package/dist/core/rezo.cjs +464 -0
  55. package/dist/core/rezo.js +458 -0
  56. package/dist/crawler.d.ts +6255 -0
  57. package/dist/dom/index.cjs +1 -0
  58. package/dist/dom/index.d.ts +23 -0
  59. package/dist/dom/index.js +1 -0
  60. package/dist/entries/crawler.cjs +5 -0
  61. package/dist/entries/crawler.js +2 -0
  62. package/dist/errors/rezo-error.cjs +722 -0
  63. package/dist/errors/rezo-error.js +716 -0
  64. package/dist/index.cjs +34 -0
  65. package/dist/index.d.ts +3335 -0
  66. package/dist/index.js +26 -0
  67. package/dist/platform/browser.cjs +9 -0
  68. package/dist/platform/browser.d.ts +3203 -0
  69. package/dist/platform/browser.js +7 -0
  70. package/dist/platform/bun.cjs +9 -0
  71. package/dist/platform/bun.d.ts +3203 -0
  72. package/dist/platform/bun.js +7 -0
  73. package/dist/platform/deno.cjs +9 -0
  74. package/dist/platform/deno.d.ts +3203 -0
  75. package/dist/platform/deno.js +7 -0
  76. package/dist/platform/node.cjs +9 -0
  77. package/dist/platform/node.d.ts +3203 -0
  78. package/dist/platform/node.js +7 -0
  79. package/dist/platform/react-native.cjs +9 -0
  80. package/dist/platform/react-native.d.ts +3203 -0
  81. package/dist/platform/react-native.js +7 -0
  82. package/dist/platform/worker.cjs +9 -0
  83. package/dist/platform/worker.d.ts +3203 -0
  84. package/dist/platform/worker.js +7 -0
  85. package/dist/plugin/addon/decodo/index.cjs +1 -0
  86. package/dist/plugin/addon/decodo/index.js +1 -0
  87. package/dist/plugin/addon/decodo/options.cjs +1 -0
  88. package/dist/plugin/addon/decodo/options.js +1 -0
  89. package/dist/plugin/addon/oxylabs/index.cjs +1 -0
  90. package/dist/plugin/addon/oxylabs/index.js +1 -0
  91. package/dist/plugin/addon/oxylabs/options.cjs +1 -0
  92. package/dist/plugin/addon/oxylabs/options.js +1 -0
  93. package/dist/plugin/crawler-options.cjs +1 -0
  94. package/dist/plugin/crawler-options.js +1 -0
  95. package/dist/plugin/crawler.cjs +519 -0
  96. package/dist/plugin/crawler.js +517 -0
  97. package/dist/plugin/index.cjs +36 -0
  98. package/dist/plugin/index.js +32 -0
  99. package/dist/proxy/index.cjs +142 -0
  100. package/dist/proxy/index.js +139 -0
  101. package/dist/responses/buildError.cjs +452 -0
  102. package/dist/responses/buildError.js +441 -0
  103. package/dist/responses/buildResponse.cjs +365 -0
  104. package/dist/responses/buildResponse.js +361 -0
  105. package/dist/responses/download.cjs +54 -0
  106. package/dist/responses/download.js +52 -0
  107. package/dist/responses/stream.cjs +60 -0
  108. package/dist/responses/stream.js +58 -0
  109. package/dist/responses/upload.cjs +54 -0
  110. package/dist/responses/upload.js +52 -0
  111. package/dist/types/cookies.cjs +394 -0
  112. package/dist/types/cookies.js +391 -0
  113. package/dist/types/download.cjs +10 -0
  114. package/dist/types/download.js +10 -0
  115. package/dist/types/rezo-request.cjs +131 -0
  116. package/dist/types/rezo-request.js +131 -0
  117. package/dist/utils/agent-merger.cjs +111 -0
  118. package/dist/utils/agent-merger.js +108 -0
  119. package/dist/utils/compression.cjs +84 -0
  120. package/dist/utils/compression.js +82 -0
  121. package/dist/utils/cookies.cjs +514 -0
  122. package/dist/utils/cookies.js +511 -0
  123. package/dist/utils/data-operations.cjs +75 -0
  124. package/dist/utils/data-operations.js +73 -0
  125. package/dist/utils/form-data.cjs +164 -0
  126. package/dist/utils/form-data.js +161 -0
  127. package/dist/utils/headers.cjs +162 -0
  128. package/dist/utils/headers.js +161 -0
  129. package/dist/utils/http-config.cjs +723 -0
  130. package/dist/utils/http-config.js +718 -0
  131. package/dist/utils/index.cjs +8 -0
  132. package/dist/utils/index.js +8 -0
  133. package/dist/utils/tools.cjs +18 -0
  134. package/dist/utils/tools.js +15 -0
  135. package/package.json +172 -0
@@ -0,0 +1,391 @@
1
+ import { CookieJar as TouchCookieJar, Cookie as TouchCookie } from "tough-cookie";
2
+
3
+ export class Cookie extends TouchCookie {
4
+ constructor(options) {
5
+ super(options);
6
+ }
7
+ getExpires() {
8
+ let expires = 0;
9
+ if (this.expires && typeof this.expires !== "string") {
10
+ expires = Math.round(this.expires.getTime() / 1000);
11
+ } else if (this.maxAge) {
12
+ if (this.maxAge === "Infinity") {
13
+ expires = 2147483647;
14
+ } else if (this.maxAge === "-Infinity") {
15
+ expires = 0;
16
+ } else if (typeof this.maxAge === "number") {
17
+ expires = Math.round(Date.now() / 1000 + this.maxAge);
18
+ }
19
+ }
20
+ return expires;
21
+ }
22
+ toNetscapeFormat() {
23
+ const domain = !this.hostOnly ? this.domain.startsWith(".") ? this.domain : "." + this.domain : this.domain;
24
+ const secure = this.secure ? "TRUE" : "FALSE";
25
+ const expires = this.getExpires();
26
+ return `${domain} TRUE ${this.path} ${secure} ${expires} ${this.key} ${this.value}`;
27
+ }
28
+ toSetCookieString() {
29
+ let str = this.cookieString();
30
+ if (this.expires instanceof Date) {
31
+ str += `; Expires=${this.expires.toUTCString()}`;
32
+ }
33
+ if (this.maxAge != null) {
34
+ str += `; Max-Age=${this.maxAge}`;
35
+ }
36
+ if (this.domain) {
37
+ str += `; Domain=${this.domain}`;
38
+ }
39
+ if (this.path) {
40
+ str += `; Path=${this.path}`;
41
+ }
42
+ if (this.secure) {
43
+ str += "; Secure";
44
+ }
45
+ if (this.httpOnly) {
46
+ str += "; HttpOnly";
47
+ }
48
+ if (this.sameSite) {
49
+ str += `; SameSite=${this.sameSite}`;
50
+ }
51
+ if (this.extensions) {
52
+ str += `; ${this.extensions.join("; ")}`;
53
+ }
54
+ return str;
55
+ }
56
+ getURL() {
57
+ if (!this.domain) {
58
+ return;
59
+ }
60
+ const protocol = this.secure ? "https://" : "http://";
61
+ const domain = this.domain.startsWith(".") ? this.domain.substring(1) : this.domain;
62
+ const path = this.path || "/";
63
+ return `${protocol}${domain}${path}`;
64
+ }
65
+ }
66
+
67
+ export class CookieJar extends TouchCookieJar {
68
+ constructor(store, options) {
69
+ super(store, options);
70
+ }
71
+ generateCookies(data) {
72
+ const cookies = !data ? (this.toJSON()?.cookies || []).map((cookie) => new Cookie(cookie)) : data[0] instanceof Cookie ? data : data.map((cookie) => new Cookie(cookie instanceof TouchCookie ? cookie : Cookie.fromJSON(cookie)));
73
+ const netscape = cookies.map((cookie) => cookie.toNetscapeFormat());
74
+ const cookieString = cookies.map((cookie) => cookie.cookieString());
75
+ const setCookiesString = cookies.map((cookie) => cookie.toSetCookieString());
76
+ let netscapeString = `# Netscape HTTP Cookie File
77
+ `;
78
+ netscapeString += `# This file was generated by Rezo HTTP client
79
+ `;
80
+ netscapeString += `# https://github.com/yuniq-solutions/rezo
81
+ `;
82
+ netscapeString += netscape.join(`
83
+ `) || "";
84
+ return {
85
+ array: cookies,
86
+ serialized: this.toJSON()?.cookies || [],
87
+ netscape: netscapeString,
88
+ string: cookieString.join("; "),
89
+ setCookiesString
90
+ };
91
+ }
92
+ cookies() {
93
+ return this.generateCookies();
94
+ }
95
+ parseResponseCookies(cookies) {
96
+ return this.generateCookies(cookies);
97
+ }
98
+ static toNetscapeCookie(cookies) {
99
+ cookies = cookies.map((cookie) => {
100
+ return cookie instanceof Cookie ? cookie : new Cookie(Cookie.fromJSON(cookie));
101
+ });
102
+ let netscapeString = `# Netscape HTTP Cookie File
103
+ `;
104
+ netscapeString += `# This file was generated by Rezo HTTP client
105
+ `;
106
+ netscapeString += `# https://github.com/yuniq-solutions/rezo
107
+ `;
108
+ netscapeString += cookies.map((cookie) => cookie.toNetscapeFormat()).join(`
109
+ `) || "";
110
+ return netscapeString;
111
+ }
112
+ static toCookieString(cookies) {
113
+ cookies = cookies.map((cookie) => {
114
+ return cookie instanceof Cookie ? cookie : new Cookie(Cookie.fromJSON(cookie));
115
+ });
116
+ return cookies.map((cookie) => cookie.cookieString()).join("; ") || "";
117
+ }
118
+ toCookieString() {
119
+ return this.cookies().string;
120
+ }
121
+ toNetscapeCookie() {
122
+ return this.cookies().netscape;
123
+ }
124
+ toArray() {
125
+ return this.cookies().array;
126
+ }
127
+ toSetCookies() {
128
+ return this.cookies().setCookiesString;
129
+ }
130
+ toSerializedCookies() {
131
+ return this.cookies().serialized;
132
+ }
133
+ setCookiesSync(cookiesData, url) {
134
+ const cookies = [];
135
+ if (Array.isArray(cookiesData)) {
136
+ cookiesData.forEach((c) => {
137
+ const cookie = c instanceof Cookie ? c : typeof c === "string" ? new Cookie(Cookie.parse(c)) : new Cookie(Cookie.fromJSON(c));
138
+ let isFailed = 0;
139
+ while (isFailed < 2) {
140
+ try {
141
+ if (cookie) {
142
+ const _url = isFailed > 0 ? cookie.getURL() || url || this.getUrlFromCookie(cookie) : url || this.getUrlFromCookie(cookie);
143
+ if (_url) {
144
+ const __cookie = this.setCookieSync(cookie, _url);
145
+ if (__cookie) {
146
+ cookies.push(__cookie);
147
+ }
148
+ }
149
+ isFailed = 4;
150
+ break;
151
+ } else {
152
+ isFailed++;
153
+ }
154
+ } catch (error) {
155
+ isFailed++;
156
+ if (isFailed > 1) {
157
+ break;
158
+ }
159
+ }
160
+ }
161
+ });
162
+ } else if (typeof cookiesData === "string") {
163
+ if (cookiesData.includes(",") && (cookiesData.includes("=") && (cookiesData.includes(";") || cookiesData.includes("expires=") || cookiesData.includes("path=")))) {
164
+ const setCookieStrings = this.splitSetCookiesString(cookiesData);
165
+ setCookieStrings.forEach((cookieStr) => {
166
+ const cookie = new Cookie(Cookie.parse(cookieStr));
167
+ let isFailed = 0;
168
+ while (isFailed < 2) {
169
+ try {
170
+ if (cookie) {
171
+ const _url = isFailed > 0 ? cookie.getURL() || url || this.getUrlFromCookie(cookie) : url || this.getUrlFromCookie(cookie);
172
+ if (_url) {
173
+ const __cookie = this.setCookieSync(cookie, _url);
174
+ if (__cookie) {
175
+ cookies.push(__cookie);
176
+ }
177
+ }
178
+ isFailed = 4;
179
+ break;
180
+ } else {
181
+ isFailed++;
182
+ }
183
+ } catch (error) {
184
+ isFailed++;
185
+ if (isFailed > 1) {
186
+ break;
187
+ }
188
+ }
189
+ }
190
+ });
191
+ } else if (cookiesData.includes("=") && cookiesData.includes(";")) {
192
+ const cookiePairs = cookiesData.split(";");
193
+ cookiePairs.forEach((pair) => {
194
+ const trimmedPair = pair.trim();
195
+ if (trimmedPair) {
196
+ const cookie = new Cookie({ key: trimmedPair.split("=")[0].trim(), value: trimmedPair.split("=")[1]?.trim() || "" });
197
+ let isFailed = 0;
198
+ while (isFailed < 2) {
199
+ try {
200
+ if (cookie) {
201
+ const _url = isFailed > 0 ? cookie.getURL() || url || this.getUrlFromCookie(cookie) : url || this.getUrlFromCookie(cookie);
202
+ if (_url) {
203
+ const __cookie = this.setCookieSync(cookie, _url);
204
+ if (__cookie) {
205
+ cookies.push(__cookie);
206
+ }
207
+ }
208
+ isFailed = 4;
209
+ break;
210
+ } else {
211
+ isFailed++;
212
+ }
213
+ } catch (error) {
214
+ isFailed++;
215
+ if (isFailed > 1) {
216
+ break;
217
+ }
218
+ }
219
+ }
220
+ }
221
+ });
222
+ } else if (cookiesData.includes("\t") && /^\S+\t/.test(cookiesData)) {
223
+ const netscapeCookies = this.parseNetscapeCookies(cookiesData);
224
+ netscapeCookies.forEach((c) => {
225
+ const cookie = new Cookie(c);
226
+ let isFailed = 0;
227
+ while (isFailed < 2) {
228
+ try {
229
+ if (cookie) {
230
+ const _url = isFailed > 0 ? cookie.getURL() || url || this.getUrlFromCookie(cookie) : url || this.getUrlFromCookie(cookie);
231
+ if (_url) {
232
+ const __cookie = this.setCookieSync(cookie, _url);
233
+ if (__cookie) {
234
+ cookies.push(__cookie);
235
+ }
236
+ }
237
+ isFailed = 4;
238
+ break;
239
+ } else {
240
+ isFailed++;
241
+ }
242
+ } catch (error) {
243
+ isFailed++;
244
+ if (isFailed > 1) {
245
+ break;
246
+ }
247
+ }
248
+ }
249
+ });
250
+ } else if (cookiesData.includes("=")) {
251
+ const cookie = new Cookie(Cookie.parse(cookiesData));
252
+ let isFailed = 0;
253
+ while (isFailed < 2) {
254
+ try {
255
+ if (cookie) {
256
+ const _url = isFailed > 0 ? cookie.getURL() || url || this.getUrlFromCookie(cookie) : url || this.getUrlFromCookie(cookie);
257
+ if (_url) {
258
+ const __cookie = this.setCookieSync(cookie, _url);
259
+ if (__cookie) {
260
+ cookies.push(__cookie);
261
+ }
262
+ }
263
+ isFailed = 4;
264
+ break;
265
+ } else {
266
+ isFailed++;
267
+ }
268
+ } catch (error) {
269
+ isFailed++;
270
+ if (isFailed > 1) {
271
+ break;
272
+ }
273
+ }
274
+ }
275
+ }
276
+ }
277
+ return this.generateCookies(cookies);
278
+ }
279
+ splitSetCookiesString(cookiesString) {
280
+ const result = [];
281
+ let currentCookie = "";
282
+ let withinValue = false;
283
+ for (let i = 0;i < cookiesString.length; i++) {
284
+ const char = cookiesString[i];
285
+ if (char === "," && !withinValue) {
286
+ result.push(currentCookie.trim());
287
+ currentCookie = "";
288
+ continue;
289
+ }
290
+ if (char === "=") {
291
+ withinValue = true;
292
+ } else if (char === ";") {
293
+ withinValue = false;
294
+ }
295
+ currentCookie += char;
296
+ }
297
+ if (currentCookie.trim()) {
298
+ result.push(currentCookie.trim());
299
+ }
300
+ return result;
301
+ }
302
+ getUrlFromCookie(cookie) {
303
+ if (!cookie.domain) {
304
+ return;
305
+ }
306
+ const proto = cookie.secure ? "https://" : "http://";
307
+ const domain = cookie.domain.startsWith(".") ? cookie.domain.substring(1) : cookie.domain;
308
+ const pathname = cookie.path || "/";
309
+ return `${proto}${domain}${pathname}`;
310
+ }
311
+ parseNetscapeCookies = (cookieText) => {
312
+ const lines = cookieText.split(`
313
+ `).filter((line) => line.trim() !== "" && !line.startsWith("#"));
314
+ return lines.map((line) => {
315
+ const parts = line.split("\t");
316
+ if (parts.length < 7) {
317
+ throw new Error(`Invalid Netscape cookie format: ${line}`);
318
+ }
319
+ const [domain, _, path, secureStr, expiresStr, name, value] = parts;
320
+ let expires = null;
321
+ if (expiresStr !== "0" && expiresStr !== "") {
322
+ expires = new Date(parseInt(expiresStr, 10) * 1000);
323
+ }
324
+ return {
325
+ domain,
326
+ path,
327
+ secure: secureStr.toUpperCase() === "TRUE",
328
+ expires,
329
+ key: name,
330
+ value,
331
+ httpOnly: false,
332
+ sameSite: undefined
333
+ };
334
+ });
335
+ };
336
+ static netscapeCookiesToSetCookieArray(netscapeCookieText) {
337
+ const parseNetscapeCookies = (cookieText) => {
338
+ const lines = cookieText.split(`
339
+ `).filter((line) => line.trim() !== "" && !line.startsWith("#"));
340
+ return lines.map((line) => {
341
+ const parts = line.split("\t");
342
+ if (parts.length < 7) {
343
+ throw new Error(`Invalid Netscape cookie format: ${line}`);
344
+ }
345
+ const [domain, _, path, secureStr, expiresStr, name, value] = parts;
346
+ let expires = null;
347
+ if (expiresStr !== "0" && expiresStr !== "") {
348
+ expires = new Date(parseInt(expiresStr, 10) * 1000);
349
+ }
350
+ return {
351
+ domain,
352
+ path,
353
+ secure: secureStr.toUpperCase() === "TRUE",
354
+ expires,
355
+ name,
356
+ value,
357
+ httpOnly: false,
358
+ sameSite: undefined
359
+ };
360
+ });
361
+ };
362
+ const cookieToSetCookieString = (cookie) => {
363
+ let setCookie = `${cookie.name}=${cookie.value}`;
364
+ if (cookie.domain) {
365
+ setCookie += `; Domain=${cookie.domain}`;
366
+ }
367
+ if (cookie.path) {
368
+ setCookie += `; Path=${cookie.path}`;
369
+ }
370
+ if (cookie.expires) {
371
+ setCookie += `; Expires=${cookie.expires.toUTCString()}`;
372
+ }
373
+ if (cookie.secure) {
374
+ setCookie += "; Secure";
375
+ }
376
+ if (cookie.httpOnly) {
377
+ setCookie += "; HttpOnly";
378
+ }
379
+ if (cookie.sameSite) {
380
+ setCookie += `; SameSite=${cookie.sameSite}`;
381
+ }
382
+ return setCookie;
383
+ };
384
+ try {
385
+ const cookies = parseNetscapeCookies(netscapeCookieText);
386
+ return cookies.map(cookieToSetCookieString);
387
+ } catch (error) {
388
+ return [];
389
+ }
390
+ }
391
+ }
@@ -0,0 +1,10 @@
1
+ var DownloadState; exports.DownloadState = DownloadState;
2
+ ((DownloadState) => {
3
+ DownloadState["PENDING"] = "pending";
4
+ DownloadState["CONNECTING"] = "connecting";
5
+ DownloadState["DOWNLOADING"] = "downloading";
6
+ DownloadState["PAUSED"] = "paused";
7
+ DownloadState["COMPLETED"] = "completed";
8
+ DownloadState["FAILED"] = "failed";
9
+ DownloadState["CANCELLED"] = "cancelled";
10
+ })(DownloadState ||= {});
@@ -0,0 +1,10 @@
1
+ export var DownloadState;
2
+ ((DownloadState) => {
3
+ DownloadState["PENDING"] = "pending";
4
+ DownloadState["CONNECTING"] = "connecting";
5
+ DownloadState["DOWNLOADING"] = "downloading";
6
+ DownloadState["PAUSED"] = "paused";
7
+ DownloadState["COMPLETED"] = "completed";
8
+ DownloadState["FAILED"] = "failed";
9
+ DownloadState["CANCELLED"] = "cancelled";
10
+ })(DownloadState ||= {});
@@ -0,0 +1,131 @@
1
+ var HttpStatusCode; exports.HttpStatusCode = HttpStatusCode;
2
+ ((HttpStatusCode) => {
3
+ HttpStatusCode[HttpStatusCode["Continue"] = 100] = "Continue";
4
+ HttpStatusCode[HttpStatusCode["SwitchingProtocols"] = 101] = "SwitchingProtocols";
5
+ HttpStatusCode[HttpStatusCode["Processing"] = 102] = "Processing";
6
+ HttpStatusCode[HttpStatusCode["EarlyHints"] = 103] = "EarlyHints";
7
+ HttpStatusCode[HttpStatusCode["Ok"] = 200] = "Ok";
8
+ HttpStatusCode[HttpStatusCode["Created"] = 201] = "Created";
9
+ HttpStatusCode[HttpStatusCode["Accepted"] = 202] = "Accepted";
10
+ HttpStatusCode[HttpStatusCode["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
11
+ HttpStatusCode[HttpStatusCode["NoContent"] = 204] = "NoContent";
12
+ HttpStatusCode[HttpStatusCode["ResetContent"] = 205] = "ResetContent";
13
+ HttpStatusCode[HttpStatusCode["PartialContent"] = 206] = "PartialContent";
14
+ HttpStatusCode[HttpStatusCode["MultiStatus"] = 207] = "MultiStatus";
15
+ HttpStatusCode[HttpStatusCode["AlreadyReported"] = 208] = "AlreadyReported";
16
+ HttpStatusCode[HttpStatusCode["ImUsed"] = 226] = "ImUsed";
17
+ HttpStatusCode[HttpStatusCode["MultipleChoices"] = 300] = "MultipleChoices";
18
+ HttpStatusCode[HttpStatusCode["MovedPermanently"] = 301] = "MovedPermanently";
19
+ HttpStatusCode[HttpStatusCode["Found"] = 302] = "Found";
20
+ HttpStatusCode[HttpStatusCode["SeeOther"] = 303] = "SeeOther";
21
+ HttpStatusCode[HttpStatusCode["NotModified"] = 304] = "NotModified";
22
+ HttpStatusCode[HttpStatusCode["UseProxy"] = 305] = "UseProxy";
23
+ HttpStatusCode[HttpStatusCode["Unused"] = 306] = "Unused";
24
+ HttpStatusCode[HttpStatusCode["TemporaryRedirect"] = 307] = "TemporaryRedirect";
25
+ HttpStatusCode[HttpStatusCode["PermanentRedirect"] = 308] = "PermanentRedirect";
26
+ HttpStatusCode[HttpStatusCode["BadRequest"] = 400] = "BadRequest";
27
+ HttpStatusCode[HttpStatusCode["Unauthorized"] = 401] = "Unauthorized";
28
+ HttpStatusCode[HttpStatusCode["PaymentRequired"] = 402] = "PaymentRequired";
29
+ HttpStatusCode[HttpStatusCode["Forbidden"] = 403] = "Forbidden";
30
+ HttpStatusCode[HttpStatusCode["NotFound"] = 404] = "NotFound";
31
+ HttpStatusCode[HttpStatusCode["MethodNotAllowed"] = 405] = "MethodNotAllowed";
32
+ HttpStatusCode[HttpStatusCode["NotAcceptable"] = 406] = "NotAcceptable";
33
+ HttpStatusCode[HttpStatusCode["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
34
+ HttpStatusCode[HttpStatusCode["RequestTimeout"] = 408] = "RequestTimeout";
35
+ HttpStatusCode[HttpStatusCode["Conflict"] = 409] = "Conflict";
36
+ HttpStatusCode[HttpStatusCode["Gone"] = 410] = "Gone";
37
+ HttpStatusCode[HttpStatusCode["LengthRequired"] = 411] = "LengthRequired";
38
+ HttpStatusCode[HttpStatusCode["PreconditionFailed"] = 412] = "PreconditionFailed";
39
+ HttpStatusCode[HttpStatusCode["PayloadTooLarge"] = 413] = "PayloadTooLarge";
40
+ HttpStatusCode[HttpStatusCode["UriTooLong"] = 414] = "UriTooLong";
41
+ HttpStatusCode[HttpStatusCode["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
42
+ HttpStatusCode[HttpStatusCode["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
43
+ HttpStatusCode[HttpStatusCode["ExpectationFailed"] = 417] = "ExpectationFailed";
44
+ HttpStatusCode[HttpStatusCode["ImATeapot"] = 418] = "ImATeapot";
45
+ HttpStatusCode[HttpStatusCode["MisdirectedRequest"] = 421] = "MisdirectedRequest";
46
+ HttpStatusCode[HttpStatusCode["UnprocessableEntity"] = 422] = "UnprocessableEntity";
47
+ HttpStatusCode[HttpStatusCode["Locked"] = 423] = "Locked";
48
+ HttpStatusCode[HttpStatusCode["FailedDependency"] = 424] = "FailedDependency";
49
+ HttpStatusCode[HttpStatusCode["TooEarly"] = 425] = "TooEarly";
50
+ HttpStatusCode[HttpStatusCode["UpgradeRequired"] = 426] = "UpgradeRequired";
51
+ HttpStatusCode[HttpStatusCode["PreconditionRequired"] = 428] = "PreconditionRequired";
52
+ HttpStatusCode[HttpStatusCode["TooManyRequests"] = 429] = "TooManyRequests";
53
+ HttpStatusCode[HttpStatusCode["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
54
+ HttpStatusCode[HttpStatusCode["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
55
+ HttpStatusCode[HttpStatusCode["InternalServerError"] = 500] = "InternalServerError";
56
+ HttpStatusCode[HttpStatusCode["NotImplemented"] = 501] = "NotImplemented";
57
+ HttpStatusCode[HttpStatusCode["BadGateway"] = 502] = "BadGateway";
58
+ HttpStatusCode[HttpStatusCode["ServiceUnavailable"] = 503] = "ServiceUnavailable";
59
+ HttpStatusCode[HttpStatusCode["GatewayTimeout"] = 504] = "GatewayTimeout";
60
+ HttpStatusCode[HttpStatusCode["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
61
+ HttpStatusCode[HttpStatusCode["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
62
+ HttpStatusCode[HttpStatusCode["InsufficientStorage"] = 507] = "InsufficientStorage";
63
+ HttpStatusCode[HttpStatusCode["LoopDetected"] = 508] = "LoopDetected";
64
+ HttpStatusCode[HttpStatusCode["NotExtended"] = 510] = "NotExtended";
65
+ HttpStatusCode[HttpStatusCode["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
66
+ })(HttpStatusCode ||= {});
67
+ const RezoStatusCodes = exports.RezoStatusCodes = {
68
+ 100: "Continue",
69
+ 101: "Switching Protocols",
70
+ 102: "Processing",
71
+ 103: "Early Hints",
72
+ 200: "OK",
73
+ 201: "Created",
74
+ 202: "Accepted",
75
+ 203: "Non-Authoritative Information",
76
+ 204: "No Content",
77
+ 205: "Reset Content",
78
+ 206: "Partial Content",
79
+ 207: "Multi-Status",
80
+ 208: "Already Reported",
81
+ 226: "IM Used",
82
+ 300: "Multiple Choices",
83
+ 301: "Moved Permanently",
84
+ 302: "Found",
85
+ 303: "See Other",
86
+ 304: "Not Modified",
87
+ 305: "Use Proxy",
88
+ 306: "Switch Proxy",
89
+ 307: "Temporary Redirect",
90
+ 308: "Permanent Redirect",
91
+ 400: "Bad Request",
92
+ 401: "Unauthorized",
93
+ 402: "Payment Required",
94
+ 403: "Forbidden",
95
+ 404: "Not Found",
96
+ 405: "Method Not Allowed",
97
+ 406: "Not Acceptable",
98
+ 407: "Proxy Authentication Required",
99
+ 408: "Request Timeout",
100
+ 409: "Conflict",
101
+ 410: "Gone",
102
+ 411: "Length Required",
103
+ 412: "Precondition Failed",
104
+ 413: "Payload Too Large",
105
+ 414: "URI Too Long",
106
+ 415: "Unsupported Media Type",
107
+ 416: "Range Not Satisfiable",
108
+ 417: "Expectation Failed",
109
+ 418: "I'm a Teapot",
110
+ 421: "Misdirected Request",
111
+ 422: "Unprocessable Entity",
112
+ 423: "Locked",
113
+ 424: "Failed Dependency",
114
+ 425: "Too Early",
115
+ 426: "Upgrade Required",
116
+ 428: "Precondition Required",
117
+ 429: "Too Many Requests",
118
+ 431: "Request Header Fields Too Large",
119
+ 451: "Unavailable For Legal Reasons",
120
+ 500: "Internal Server Error",
121
+ 501: "Not Implemented",
122
+ 502: "Bad Gateway",
123
+ 503: "Service Unavailable",
124
+ 504: "Gateway Timeout",
125
+ 505: "HTTP Version Not Supported",
126
+ 506: "Variant Also Negotiates",
127
+ 507: "Insufficient Storage",
128
+ 508: "Loop Detected",
129
+ 510: "Not Extended",
130
+ 511: "Network Authentication Required"
131
+ };
@@ -0,0 +1,131 @@
1
+ export var HttpStatusCode;
2
+ ((HttpStatusCode) => {
3
+ HttpStatusCode[HttpStatusCode["Continue"] = 100] = "Continue";
4
+ HttpStatusCode[HttpStatusCode["SwitchingProtocols"] = 101] = "SwitchingProtocols";
5
+ HttpStatusCode[HttpStatusCode["Processing"] = 102] = "Processing";
6
+ HttpStatusCode[HttpStatusCode["EarlyHints"] = 103] = "EarlyHints";
7
+ HttpStatusCode[HttpStatusCode["Ok"] = 200] = "Ok";
8
+ HttpStatusCode[HttpStatusCode["Created"] = 201] = "Created";
9
+ HttpStatusCode[HttpStatusCode["Accepted"] = 202] = "Accepted";
10
+ HttpStatusCode[HttpStatusCode["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
11
+ HttpStatusCode[HttpStatusCode["NoContent"] = 204] = "NoContent";
12
+ HttpStatusCode[HttpStatusCode["ResetContent"] = 205] = "ResetContent";
13
+ HttpStatusCode[HttpStatusCode["PartialContent"] = 206] = "PartialContent";
14
+ HttpStatusCode[HttpStatusCode["MultiStatus"] = 207] = "MultiStatus";
15
+ HttpStatusCode[HttpStatusCode["AlreadyReported"] = 208] = "AlreadyReported";
16
+ HttpStatusCode[HttpStatusCode["ImUsed"] = 226] = "ImUsed";
17
+ HttpStatusCode[HttpStatusCode["MultipleChoices"] = 300] = "MultipleChoices";
18
+ HttpStatusCode[HttpStatusCode["MovedPermanently"] = 301] = "MovedPermanently";
19
+ HttpStatusCode[HttpStatusCode["Found"] = 302] = "Found";
20
+ HttpStatusCode[HttpStatusCode["SeeOther"] = 303] = "SeeOther";
21
+ HttpStatusCode[HttpStatusCode["NotModified"] = 304] = "NotModified";
22
+ HttpStatusCode[HttpStatusCode["UseProxy"] = 305] = "UseProxy";
23
+ HttpStatusCode[HttpStatusCode["Unused"] = 306] = "Unused";
24
+ HttpStatusCode[HttpStatusCode["TemporaryRedirect"] = 307] = "TemporaryRedirect";
25
+ HttpStatusCode[HttpStatusCode["PermanentRedirect"] = 308] = "PermanentRedirect";
26
+ HttpStatusCode[HttpStatusCode["BadRequest"] = 400] = "BadRequest";
27
+ HttpStatusCode[HttpStatusCode["Unauthorized"] = 401] = "Unauthorized";
28
+ HttpStatusCode[HttpStatusCode["PaymentRequired"] = 402] = "PaymentRequired";
29
+ HttpStatusCode[HttpStatusCode["Forbidden"] = 403] = "Forbidden";
30
+ HttpStatusCode[HttpStatusCode["NotFound"] = 404] = "NotFound";
31
+ HttpStatusCode[HttpStatusCode["MethodNotAllowed"] = 405] = "MethodNotAllowed";
32
+ HttpStatusCode[HttpStatusCode["NotAcceptable"] = 406] = "NotAcceptable";
33
+ HttpStatusCode[HttpStatusCode["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
34
+ HttpStatusCode[HttpStatusCode["RequestTimeout"] = 408] = "RequestTimeout";
35
+ HttpStatusCode[HttpStatusCode["Conflict"] = 409] = "Conflict";
36
+ HttpStatusCode[HttpStatusCode["Gone"] = 410] = "Gone";
37
+ HttpStatusCode[HttpStatusCode["LengthRequired"] = 411] = "LengthRequired";
38
+ HttpStatusCode[HttpStatusCode["PreconditionFailed"] = 412] = "PreconditionFailed";
39
+ HttpStatusCode[HttpStatusCode["PayloadTooLarge"] = 413] = "PayloadTooLarge";
40
+ HttpStatusCode[HttpStatusCode["UriTooLong"] = 414] = "UriTooLong";
41
+ HttpStatusCode[HttpStatusCode["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
42
+ HttpStatusCode[HttpStatusCode["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
43
+ HttpStatusCode[HttpStatusCode["ExpectationFailed"] = 417] = "ExpectationFailed";
44
+ HttpStatusCode[HttpStatusCode["ImATeapot"] = 418] = "ImATeapot";
45
+ HttpStatusCode[HttpStatusCode["MisdirectedRequest"] = 421] = "MisdirectedRequest";
46
+ HttpStatusCode[HttpStatusCode["UnprocessableEntity"] = 422] = "UnprocessableEntity";
47
+ HttpStatusCode[HttpStatusCode["Locked"] = 423] = "Locked";
48
+ HttpStatusCode[HttpStatusCode["FailedDependency"] = 424] = "FailedDependency";
49
+ HttpStatusCode[HttpStatusCode["TooEarly"] = 425] = "TooEarly";
50
+ HttpStatusCode[HttpStatusCode["UpgradeRequired"] = 426] = "UpgradeRequired";
51
+ HttpStatusCode[HttpStatusCode["PreconditionRequired"] = 428] = "PreconditionRequired";
52
+ HttpStatusCode[HttpStatusCode["TooManyRequests"] = 429] = "TooManyRequests";
53
+ HttpStatusCode[HttpStatusCode["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
54
+ HttpStatusCode[HttpStatusCode["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
55
+ HttpStatusCode[HttpStatusCode["InternalServerError"] = 500] = "InternalServerError";
56
+ HttpStatusCode[HttpStatusCode["NotImplemented"] = 501] = "NotImplemented";
57
+ HttpStatusCode[HttpStatusCode["BadGateway"] = 502] = "BadGateway";
58
+ HttpStatusCode[HttpStatusCode["ServiceUnavailable"] = 503] = "ServiceUnavailable";
59
+ HttpStatusCode[HttpStatusCode["GatewayTimeout"] = 504] = "GatewayTimeout";
60
+ HttpStatusCode[HttpStatusCode["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
61
+ HttpStatusCode[HttpStatusCode["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
62
+ HttpStatusCode[HttpStatusCode["InsufficientStorage"] = 507] = "InsufficientStorage";
63
+ HttpStatusCode[HttpStatusCode["LoopDetected"] = 508] = "LoopDetected";
64
+ HttpStatusCode[HttpStatusCode["NotExtended"] = 510] = "NotExtended";
65
+ HttpStatusCode[HttpStatusCode["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
66
+ })(HttpStatusCode ||= {});
67
+ export const RezoStatusCodes = {
68
+ 100: "Continue",
69
+ 101: "Switching Protocols",
70
+ 102: "Processing",
71
+ 103: "Early Hints",
72
+ 200: "OK",
73
+ 201: "Created",
74
+ 202: "Accepted",
75
+ 203: "Non-Authoritative Information",
76
+ 204: "No Content",
77
+ 205: "Reset Content",
78
+ 206: "Partial Content",
79
+ 207: "Multi-Status",
80
+ 208: "Already Reported",
81
+ 226: "IM Used",
82
+ 300: "Multiple Choices",
83
+ 301: "Moved Permanently",
84
+ 302: "Found",
85
+ 303: "See Other",
86
+ 304: "Not Modified",
87
+ 305: "Use Proxy",
88
+ 306: "Switch Proxy",
89
+ 307: "Temporary Redirect",
90
+ 308: "Permanent Redirect",
91
+ 400: "Bad Request",
92
+ 401: "Unauthorized",
93
+ 402: "Payment Required",
94
+ 403: "Forbidden",
95
+ 404: "Not Found",
96
+ 405: "Method Not Allowed",
97
+ 406: "Not Acceptable",
98
+ 407: "Proxy Authentication Required",
99
+ 408: "Request Timeout",
100
+ 409: "Conflict",
101
+ 410: "Gone",
102
+ 411: "Length Required",
103
+ 412: "Precondition Failed",
104
+ 413: "Payload Too Large",
105
+ 414: "URI Too Long",
106
+ 415: "Unsupported Media Type",
107
+ 416: "Range Not Satisfiable",
108
+ 417: "Expectation Failed",
109
+ 418: "I'm a Teapot",
110
+ 421: "Misdirected Request",
111
+ 422: "Unprocessable Entity",
112
+ 423: "Locked",
113
+ 424: "Failed Dependency",
114
+ 425: "Too Early",
115
+ 426: "Upgrade Required",
116
+ 428: "Precondition Required",
117
+ 429: "Too Many Requests",
118
+ 431: "Request Header Fields Too Large",
119
+ 451: "Unavailable For Legal Reasons",
120
+ 500: "Internal Server Error",
121
+ 501: "Not Implemented",
122
+ 502: "Bad Gateway",
123
+ 503: "Service Unavailable",
124
+ 504: "Gateway Timeout",
125
+ 505: "HTTP Version Not Supported",
126
+ 506: "Variant Also Negotiates",
127
+ 507: "Insufficient Storage",
128
+ 508: "Loop Detected",
129
+ 510: "Not Extended",
130
+ 511: "Network Authentication Required"
131
+ };