hyperttp 0.1.5

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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -0
  3. package/dist/Hyperttp/Core/CacheManager.d.ts +65 -0
  4. package/dist/Hyperttp/Core/CacheManager.d.ts.map +1 -0
  5. package/dist/Hyperttp/Core/CacheManager.js +80 -0
  6. package/dist/Hyperttp/Core/CacheManager.js.map +1 -0
  7. package/dist/Hyperttp/Core/HttpClientImproved.d.ts +280 -0
  8. package/dist/Hyperttp/Core/HttpClientImproved.d.ts.map +1 -0
  9. package/dist/Hyperttp/Core/HttpClientImproved.js +611 -0
  10. package/dist/Hyperttp/Core/HttpClientImproved.js.map +1 -0
  11. package/dist/Hyperttp/Core/QueueManager.d.ts +49 -0
  12. package/dist/Hyperttp/Core/QueueManager.d.ts.map +1 -0
  13. package/dist/Hyperttp/Core/QueueManager.js +75 -0
  14. package/dist/Hyperttp/Core/QueueManager.js.map +1 -0
  15. package/dist/Hyperttp/Core/RateLimiter.d.ts +53 -0
  16. package/dist/Hyperttp/Core/RateLimiter.d.ts.map +1 -0
  17. package/dist/Hyperttp/Core/RateLimiter.js +70 -0
  18. package/dist/Hyperttp/Core/RateLimiter.js.map +1 -0
  19. package/dist/Hyperttp/Core/index.d.ts +22 -0
  20. package/dist/Hyperttp/Core/index.d.ts.map +1 -0
  21. package/dist/Hyperttp/Core/index.js +29 -0
  22. package/dist/Hyperttp/Core/index.js.map +1 -0
  23. package/dist/Hyperttp/Request.d.ts +78 -0
  24. package/dist/Hyperttp/Request.d.ts.map +1 -0
  25. package/dist/Hyperttp/Request.js +234 -0
  26. package/dist/Hyperttp/Request.js.map +1 -0
  27. package/dist/Hyperttp/UrlExtractor.d.ts +87 -0
  28. package/dist/Hyperttp/UrlExtractor.d.ts.map +1 -0
  29. package/dist/Hyperttp/UrlExtractor.js +127 -0
  30. package/dist/Hyperttp/UrlExtractor.js.map +1 -0
  31. package/dist/Hyperttp/index.d.ts +5 -0
  32. package/dist/Hyperttp/index.d.ts.map +1 -0
  33. package/dist/Hyperttp/index.js +18 -0
  34. package/dist/Hyperttp/index.js.map +1 -0
  35. package/dist/Types/index.d.ts +32 -0
  36. package/dist/Types/index.d.ts.map +1 -0
  37. package/dist/Types/index.js +18 -0
  38. package/dist/Types/index.js.map +1 -0
  39. package/dist/Types/request.d.ts +136 -0
  40. package/dist/Types/request.d.ts.map +1 -0
  41. package/dist/Types/request.js +3 -0
  42. package/dist/Types/request.js.map +1 -0
  43. package/dist/index.d.ts +3 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +12 -0
  46. package/dist/index.js.map +1 -0
  47. package/package.json +32 -0
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Manages concurrent execution of asynchronous tasks with a configurable limit.
3
+ * Uses a queue-based approach to prevent overwhelming the system with too many
4
+ * simultaneous operations.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * const queue = new QueueManager(5); // Max 5 concurrent tasks
9
+ * const result = await queue.enqueue(() => fetch('https://api.example.com'));
10
+ * ```
11
+ */
12
+ export declare class QueueManager {
13
+ private maxConcurrent;
14
+ private queue;
15
+ private running;
16
+ /**
17
+ * Creates a new QueueManager instance
18
+ * @param maxConcurrent - Maximum number of tasks that can run simultaneously (default: 50)
19
+ */
20
+ constructor(maxConcurrent?: number);
21
+ /**
22
+ * Enqueues a task for execution, respecting the concurrency limit.
23
+ * If the limit is reached, the task will wait in queue until a slot becomes available.
24
+ *
25
+ * @template T - The return type of the executor function
26
+ * @param executor - An async function to execute
27
+ * @returns A promise that resolves with the executor's result
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const data = await queue.enqueue(async () => {
32
+ * const response = await fetch('https://api.example.com/data');
33
+ * return response.json();
34
+ * });
35
+ * ```
36
+ */
37
+ enqueue<T>(executor: () => Promise<T>): Promise<T>;
38
+ /**
39
+ * Gets the current number of running tasks
40
+ * @returns The number of currently executing tasks
41
+ */
42
+ get activeCount(): number;
43
+ /**
44
+ * Gets the number of tasks waiting in queue
45
+ * @returns The number of queued tasks
46
+ */
47
+ get queuedCount(): number;
48
+ }
49
+ //# sourceMappingURL=QueueManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueManager.d.ts","sourceRoot":"","sources":["../../../src/Hyperttp/Core/QueueManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,qBAAa,YAAY;IAQX,OAAO,CAAC,aAAa;IAPjC,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,OAAO,CAAK;IAEpB;;;OAGG;gBACiB,aAAa,SAAK;IAEtC;;;;;;;;;;;;;;;OAeG;IACG,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAiBxD;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;CACF"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueueManager = void 0;
4
+ /**
5
+ * Manages concurrent execution of asynchronous tasks with a configurable limit.
6
+ * Uses a queue-based approach to prevent overwhelming the system with too many
7
+ * simultaneous operations.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const queue = new QueueManager(5); // Max 5 concurrent tasks
12
+ * const result = await queue.enqueue(() => fetch('https://api.example.com'));
13
+ * ```
14
+ */
15
+ class QueueManager {
16
+ maxConcurrent;
17
+ queue = [];
18
+ running = 0;
19
+ /**
20
+ * Creates a new QueueManager instance
21
+ * @param maxConcurrent - Maximum number of tasks that can run simultaneously (default: 50)
22
+ */
23
+ constructor(maxConcurrent = 50) {
24
+ this.maxConcurrent = maxConcurrent;
25
+ }
26
+ /**
27
+ * Enqueues a task for execution, respecting the concurrency limit.
28
+ * If the limit is reached, the task will wait in queue until a slot becomes available.
29
+ *
30
+ * @template T - The return type of the executor function
31
+ * @param executor - An async function to execute
32
+ * @returns A promise that resolves with the executor's result
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const data = await queue.enqueue(async () => {
37
+ * const response = await fetch('https://api.example.com/data');
38
+ * return response.json();
39
+ * });
40
+ * ```
41
+ */
42
+ async enqueue(executor) {
43
+ // Wait if we've reached the concurrency limit
44
+ if (this.running >= this.maxConcurrent) {
45
+ await new Promise((resolve) => this.queue.push(resolve));
46
+ }
47
+ this.running++;
48
+ try {
49
+ return await executor();
50
+ }
51
+ finally {
52
+ this.running--;
53
+ // Process next task in queue
54
+ const next = this.queue.shift();
55
+ if (next)
56
+ next();
57
+ }
58
+ }
59
+ /**
60
+ * Gets the current number of running tasks
61
+ * @returns The number of currently executing tasks
62
+ */
63
+ get activeCount() {
64
+ return this.running;
65
+ }
66
+ /**
67
+ * Gets the number of tasks waiting in queue
68
+ * @returns The number of queued tasks
69
+ */
70
+ get queuedCount() {
71
+ return this.queue.length;
72
+ }
73
+ }
74
+ exports.QueueManager = QueueManager;
75
+ //# sourceMappingURL=QueueManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueManager.js","sourceRoot":"","sources":["../../../src/Hyperttp/Core/QueueManager.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,MAAa,YAAY;IAQH;IAPZ,KAAK,GAAmB,EAAE,CAAC;IAC3B,OAAO,GAAG,CAAC,CAAC;IAEpB;;;OAGG;IACH,YAAoB,gBAAgB,EAAE;QAAlB,kBAAa,GAAb,aAAa,CAAK;IAAG,CAAC;IAE1C;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,OAAO,CAAI,QAA0B;QACzC,8CAA8C;QAC9C,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,EAAE,CAAC;QAC1B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,6BAA6B;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI;gBAAE,IAAI,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;CACF;AA1DD,oCA0DC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Configuration options for the RateLimiter
3
+ */
4
+ export interface RateLimiterConfig {
5
+ /** Maximum number of requests allowed within the time window (default: 100) */
6
+ maxRequests?: number;
7
+ /** Time window in milliseconds (default: 60000ms / 1 minute) */
8
+ windowMs?: number;
9
+ }
10
+ /**
11
+ * Implements a sliding window rate limiter to control request frequency.
12
+ * Prevents exceeding a specified number of requests within a time window.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const limiter = new RateLimiter({ maxRequests: 10, windowMs: 1000 });
17
+ * await limiter.wait(); // Will delay if rate limit is exceeded
18
+ * // Make your request here
19
+ * ```
20
+ */
21
+ export declare class RateLimiter {
22
+ private timestamps;
23
+ private max;
24
+ private window;
25
+ /**
26
+ * Creates a new RateLimiter instance
27
+ * @param config - Configuration for rate limiting behavior
28
+ */
29
+ constructor(config?: RateLimiterConfig);
30
+ /**
31
+ * Waits if necessary to respect the rate limit, then records the current request.
32
+ * This method should be called before making each request.
33
+ *
34
+ * @returns A promise that resolves when it's safe to proceed with the request
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * await limiter.wait();
39
+ * const response = await fetch('https://api.example.com');
40
+ * ```
41
+ */
42
+ wait(): Promise<void>;
43
+ /**
44
+ * Gets the current number of requests in the sliding window
45
+ * @returns The number of requests made within the current time window
46
+ */
47
+ get currentCount(): number;
48
+ /**
49
+ * Resets the rate limiter, clearing all recorded timestamps
50
+ */
51
+ reset(): void;
52
+ }
53
+ //# sourceMappingURL=RateLimiter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RateLimiter.d.ts","sourceRoot":"","sources":["../../../src/Hyperttp/Core/RateLimiter.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IAEvB;;;OAGG;gBACS,MAAM,CAAC,EAAE,iBAAiB;IAKtC;;;;;;;;;;;OAWG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB3B;;;OAGG;IACH,IAAI,YAAY,IAAI,MAAM,CAIzB;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RateLimiter = void 0;
4
+ /**
5
+ * Implements a sliding window rate limiter to control request frequency.
6
+ * Prevents exceeding a specified number of requests within a time window.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const limiter = new RateLimiter({ maxRequests: 10, windowMs: 1000 });
11
+ * await limiter.wait(); // Will delay if rate limit is exceeded
12
+ * // Make your request here
13
+ * ```
14
+ */
15
+ class RateLimiter {
16
+ timestamps = [];
17
+ max;
18
+ window;
19
+ /**
20
+ * Creates a new RateLimiter instance
21
+ * @param config - Configuration for rate limiting behavior
22
+ */
23
+ constructor(config) {
24
+ this.max = config?.maxRequests ?? 100;
25
+ this.window = config?.windowMs ?? 60_000;
26
+ }
27
+ /**
28
+ * Waits if necessary to respect the rate limit, then records the current request.
29
+ * This method should be called before making each request.
30
+ *
31
+ * @returns A promise that resolves when it's safe to proceed with the request
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * await limiter.wait();
36
+ * const response = await fetch('https://api.example.com');
37
+ * ```
38
+ */
39
+ async wait() {
40
+ const now = Date.now();
41
+ // Remove timestamps outside the current window
42
+ this.timestamps = this.timestamps.filter((t) => now - t < this.window);
43
+ // If we've hit the limit, wait until the oldest request expires
44
+ if (this.timestamps.length >= this.max) {
45
+ const delay = this.timestamps[0] + this.window - now;
46
+ if (delay > 0) {
47
+ await new Promise((resolve) => setTimeout(resolve, delay));
48
+ }
49
+ }
50
+ // Record this request
51
+ this.timestamps.push(Date.now());
52
+ }
53
+ /**
54
+ * Gets the current number of requests in the sliding window
55
+ * @returns The number of requests made within the current time window
56
+ */
57
+ get currentCount() {
58
+ const now = Date.now();
59
+ this.timestamps = this.timestamps.filter((t) => now - t < this.window);
60
+ return this.timestamps.length;
61
+ }
62
+ /**
63
+ * Resets the rate limiter, clearing all recorded timestamps
64
+ */
65
+ reset() {
66
+ this.timestamps = [];
67
+ }
68
+ }
69
+ exports.RateLimiter = RateLimiter;
70
+ //# sourceMappingURL=RateLimiter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RateLimiter.js","sourceRoot":"","sources":["../../../src/Hyperttp/Core/RateLimiter.ts"],"names":[],"mappings":";;;AAUA;;;;;;;;;;GAUG;AACH,MAAa,WAAW;IACd,UAAU,GAAa,EAAE,CAAC;IAC1B,GAAG,CAAS;IACZ,MAAM,CAAS;IAEvB;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,GAAG,GAAG,MAAM,EAAE,WAAW,IAAI,GAAG,CAAC;QACtC,IAAI,CAAC,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P Client Library
3
+ *
4
+ * A comprehensive HTTP client with advanced features including:
5
+ * - Automatic caching with LRU eviction
6
+ * - Rate limiting with sliding window
7
+ * - Request queuing and concurrency control
8
+ * - Automatic retries with exponential backoff
9
+ * - Cookie management
10
+ * - Request deduplication
11
+ * - Response compression support
12
+ *
13
+ * @module http-client
14
+ */
15
+ export { default as HttpClientImproved } from "./HttpClientImproved";
16
+ export { QueueManager } from "./QueueManager";
17
+ export { CacheManager } from "./CacheManager";
18
+ export { RateLimiter } from "./RateLimiter";
19
+ export type { HttpClientOptions, HttpClientInterface, RequestInterface, RetryOptions, LogLevel, LoggerFunction, } from "./HttpClientImproved";
20
+ export type { CacheManagerOptions } from "./CacheManager";
21
+ export type { RateLimiterConfig } from "./RateLimiter";
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Hyperttp/Core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,cAAc,GACf,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * HTTP Client Library
4
+ *
5
+ * A comprehensive HTTP client with advanced features including:
6
+ * - Automatic caching with LRU eviction
7
+ * - Rate limiting with sliding window
8
+ * - Request queuing and concurrency control
9
+ * - Automatic retries with exponential backoff
10
+ * - Cookie management
11
+ * - Request deduplication
12
+ * - Response compression support
13
+ *
14
+ * @module http-client
15
+ */
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.RateLimiter = exports.CacheManager = exports.QueueManager = exports.HttpClientImproved = void 0;
21
+ var HttpClientImproved_1 = require("./HttpClientImproved");
22
+ Object.defineProperty(exports, "HttpClientImproved", { enumerable: true, get: function () { return __importDefault(HttpClientImproved_1).default; } });
23
+ var QueueManager_1 = require("./QueueManager");
24
+ Object.defineProperty(exports, "QueueManager", { enumerable: true, get: function () { return QueueManager_1.QueueManager; } });
25
+ var CacheManager_1 = require("./CacheManager");
26
+ Object.defineProperty(exports, "CacheManager", { enumerable: true, get: function () { return CacheManager_1.CacheManager; } });
27
+ var RateLimiter_1 = require("./RateLimiter");
28
+ Object.defineProperty(exports, "RateLimiter", { enumerable: true, get: function () { return RateLimiter_1.RateLimiter; } });
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Hyperttp/Core/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;AAEH,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA"}
@@ -0,0 +1,78 @@
1
+ import type { RequestHeaders, RequestQuery, RequestBodyData, RequestConfig, RequestInterface } from "../Types/request";
2
+ /**
3
+ * Represents an HTTP request with configurable scheme, host, port, path, headers, query, and body data.
4
+ * Provides methods to build and manipulate the request.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * const req = new Request({
9
+ * scheme: "https",
10
+ * host: "api.example.com",
11
+ * port: 443,
12
+ * });
13
+ *
14
+ * req.setPath("/v1/users")
15
+ * .addQuery({ page: "1" })
16
+ * .addHeaders({ Authorization: "Bearer token" });
17
+ *
18
+ * console.log(req.getURL()); // "https://api.example.com:443/v1/users?page=1"
19
+ * ```
20
+ */
21
+ export default class Request implements RequestInterface {
22
+ private scheme;
23
+ private host;
24
+ private port;
25
+ private path;
26
+ private headers;
27
+ private query;
28
+ private bodyData;
29
+ constructor(config: RequestConfig);
30
+ private normalizePath;
31
+ setPath(path: string): this;
32
+ setHost(host: string): this;
33
+ getHeaders(): RequestHeaders;
34
+ setHeaders(headers: RequestHeaders): this;
35
+ addHeaders(headers: RequestHeaders): this;
36
+ getQuery(): RequestQuery;
37
+ setQuery(query: RequestQuery): this;
38
+ addQuery(query: RequestQuery): this;
39
+ getQueryAsString(): string;
40
+ getBodyData(): RequestBodyData;
41
+ getBodyDataString(): string;
42
+ setBodyData(bodyData: RequestBodyData): this;
43
+ addBodyData(bodyData: RequestBodyData): this;
44
+ getURI(): string;
45
+ getURL(): string;
46
+ }
47
+ /**
48
+ * PreparedRequest is a wrapper around Request that parses a base URL and provides the same RequestInterface methods.
49
+ * Useful for quickly creating requests from a full URL.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const prepReq = new PreparedRequest("https://api.example.com:443");
54
+ * prepReq.setPath("/v1/users")
55
+ * .addQuery({ page: "2" });
56
+ * console.log(prepReq.getURL()); // "https://api.example.com:443/v1/users?page=2"
57
+ * ```
58
+ */
59
+ export declare class PreparedRequest implements RequestInterface {
60
+ private request;
61
+ constructor(baseUrl: string);
62
+ setPath(path: string): this;
63
+ setHost(host: string): this;
64
+ getHeaders(): RequestHeaders;
65
+ setHeaders(headers: RequestHeaders): this;
66
+ addHeaders(headers: RequestHeaders): this;
67
+ getQuery(): RequestQuery;
68
+ setQuery(query: RequestQuery): this;
69
+ addQuery(query: RequestQuery): this;
70
+ getQueryAsString(): string;
71
+ getBodyData(): RequestBodyData;
72
+ getBodyDataString(): string;
73
+ setBodyData(bodyData: RequestBodyData): this;
74
+ addBodyData(bodyData: RequestBodyData): this;
75
+ getURI(): string;
76
+ getURL(): string;
77
+ }
78
+ //# sourceMappingURL=Request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../src/Hyperttp/Request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,eAAe,EACf,aAAa,EACb,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,YAAW,gBAAgB;IACtD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,QAAQ,CAAkB;gBAEtB,MAAM,EAAE,aAAa;IAUjC,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3B,UAAU,IAAI,cAAc;IAI5B,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAKzC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAKzC,QAAQ,IAAI,YAAY;IAIxB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAKnC,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAKnC,gBAAgB,IAAI,MAAM;IAU1B,WAAW,IAAI,eAAe;IAI9B,iBAAiB,IAAI,MAAM;IAI3B,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAK5C,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAK5C,MAAM,IAAI,MAAM;IAMhB,MAAM,IAAI,MAAM;CASjB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,OAAO,CAAC,OAAO,CAAU;gBAEb,OAAO,EAAE,MAAM;IAgB3B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI3B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI3B,UAAU,IAAI,cAAc;IAG5B,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAIzC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAIzC,QAAQ,IAAI,YAAY;IAGxB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAInC,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAInC,gBAAgB,IAAI,MAAM;IAG1B,WAAW,IAAI,eAAe;IAG9B,iBAAiB,IAAI,MAAM;IAG3B,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAI5C,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAI5C,MAAM,IAAI,MAAM;IAGhB,MAAM,IAAI,MAAM;CAGjB"}
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.PreparedRequest = void 0;
37
+ const querystring = __importStar(require("querystring"));
38
+ /**
39
+ * Represents an HTTP request with configurable scheme, host, port, path, headers, query, and body data.
40
+ * Provides methods to build and manipulate the request.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const req = new Request({
45
+ * scheme: "https",
46
+ * host: "api.example.com",
47
+ * port: 443,
48
+ * });
49
+ *
50
+ * req.setPath("/v1/users")
51
+ * .addQuery({ page: "1" })
52
+ * .addHeaders({ Authorization: "Bearer token" });
53
+ *
54
+ * console.log(req.getURL()); // "https://api.example.com:443/v1/users?page=1"
55
+ * ```
56
+ */
57
+ class Request {
58
+ scheme;
59
+ host;
60
+ port;
61
+ path;
62
+ headers;
63
+ query;
64
+ bodyData;
65
+ constructor(config) {
66
+ this.scheme = config.scheme;
67
+ this.host = config.host;
68
+ this.port = config.port;
69
+ this.path = config.path ?? "";
70
+ this.headers = config.headers ?? {};
71
+ this.query = config.query ?? {};
72
+ this.bodyData = config.bodyData ?? {};
73
+ }
74
+ normalizePath(path) {
75
+ if (!path)
76
+ return "";
77
+ return path.startsWith("/") ? path : `/${path}`;
78
+ }
79
+ setPath(path) {
80
+ this.path = path;
81
+ return this;
82
+ }
83
+ setHost(host) {
84
+ this.host = host;
85
+ return this;
86
+ }
87
+ getHeaders() {
88
+ return this.headers;
89
+ }
90
+ setHeaders(headers) {
91
+ this.headers = { ...headers };
92
+ return this;
93
+ }
94
+ addHeaders(headers) {
95
+ this.headers = { ...this.headers, ...headers };
96
+ return this;
97
+ }
98
+ getQuery() {
99
+ return this.query;
100
+ }
101
+ setQuery(query) {
102
+ this.query = { ...query };
103
+ return this;
104
+ }
105
+ addQuery(query) {
106
+ this.query = { ...this.query, ...query };
107
+ return this;
108
+ }
109
+ getQueryAsString() {
110
+ const params = new URLSearchParams();
111
+ for (const [key, value] of Object.entries(this.query)) {
112
+ if (value === undefined || value === null)
113
+ continue;
114
+ params.append(key, String(value));
115
+ }
116
+ const qs = params.toString();
117
+ return qs ? `?${qs}` : "";
118
+ }
119
+ getBodyData() {
120
+ return this.bodyData;
121
+ }
122
+ getBodyDataString() {
123
+ return querystring.stringify(this.bodyData);
124
+ }
125
+ setBodyData(bodyData) {
126
+ this.bodyData = { ...bodyData };
127
+ return this;
128
+ }
129
+ addBodyData(bodyData) {
130
+ this.bodyData = { ...this.bodyData, ...bodyData };
131
+ return this;
132
+ }
133
+ getURI() {
134
+ const path = this.normalizePath(this.path);
135
+ const portPart = this.port ? `:${this.port}` : "";
136
+ return `${this.scheme}://${this.host}${portPart}${path}`;
137
+ }
138
+ getURL() {
139
+ // Используем URL + searchParams для надёжной сборки
140
+ const base = new URL(this.getURI());
141
+ for (const [key, value] of Object.entries(this.query)) {
142
+ if (value === undefined || value === null)
143
+ continue;
144
+ base.searchParams.append(key, String(value));
145
+ }
146
+ return base.toString();
147
+ }
148
+ }
149
+ exports.default = Request;
150
+ /**
151
+ * PreparedRequest is a wrapper around Request that parses a base URL and provides the same RequestInterface methods.
152
+ * Useful for quickly creating requests from a full URL.
153
+ *
154
+ * @example
155
+ * ```ts
156
+ * const prepReq = new PreparedRequest("https://api.example.com:443");
157
+ * prepReq.setPath("/v1/users")
158
+ * .addQuery({ page: "2" });
159
+ * console.log(prepReq.getURL()); // "https://api.example.com:443/v1/users?page=2"
160
+ * ```
161
+ */
162
+ class PreparedRequest {
163
+ request;
164
+ constructor(baseUrl) {
165
+ const url = new URL(baseUrl);
166
+ const config = {
167
+ scheme: url.protocol.replace(":", ""),
168
+ host: url.hostname,
169
+ port: url.port
170
+ ? parseInt(url.port, 10)
171
+ : url.protocol === "https:"
172
+ ? 443
173
+ : 80,
174
+ path: url.pathname === "/" ? "" : url.pathname,
175
+ query: Object.fromEntries(url.searchParams.entries()),
176
+ };
177
+ this.request = new Request(config);
178
+ }
179
+ setPath(path) {
180
+ this.request.setPath(path);
181
+ return this;
182
+ }
183
+ setHost(host) {
184
+ this.request.setHost(host);
185
+ return this;
186
+ }
187
+ getHeaders() {
188
+ return this.request.getHeaders();
189
+ }
190
+ setHeaders(headers) {
191
+ this.request.setHeaders(headers);
192
+ return this;
193
+ }
194
+ addHeaders(headers) {
195
+ this.request.addHeaders(headers);
196
+ return this;
197
+ }
198
+ getQuery() {
199
+ return this.request.getQuery();
200
+ }
201
+ setQuery(query) {
202
+ this.request.setQuery(query);
203
+ return this;
204
+ }
205
+ addQuery(query) {
206
+ this.request.addQuery(query);
207
+ return this;
208
+ }
209
+ getQueryAsString() {
210
+ return this.request.getQueryAsString();
211
+ }
212
+ getBodyData() {
213
+ return this.request.getBodyData();
214
+ }
215
+ getBodyDataString() {
216
+ return this.request.getBodyDataString();
217
+ }
218
+ setBodyData(bodyData) {
219
+ this.request.setBodyData(bodyData);
220
+ return this;
221
+ }
222
+ addBodyData(bodyData) {
223
+ this.request.addBodyData(bodyData);
224
+ return this;
225
+ }
226
+ getURI() {
227
+ return this.request.getURI();
228
+ }
229
+ getURL() {
230
+ return this.request.getURL();
231
+ }
232
+ }
233
+ exports.PreparedRequest = PreparedRequest;
234
+ //# sourceMappingURL=Request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Request.js","sourceRoot":"","sources":["../../src/Hyperttp/Request.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAS3C;;;;;;;;;;;;;;;;;;GAkB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