koonjs 0.4.4 → 0.4.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.
package/index.d.ts CHANGED
@@ -61,6 +61,11 @@ export interface KoonWsMessage {
61
61
  data: Buffer;
62
62
  }
63
63
 
64
+ export interface KoonRequestOptions {
65
+ /** Additional headers for this request. Override constructor-level headers. */
66
+ headers?: Record<string, string>;
67
+ }
68
+
64
69
  export interface KoonMultipartField {
65
70
  /** Field name. */
66
71
  name: string;
@@ -77,15 +82,15 @@ export interface KoonMultipartField {
77
82
  export class Koon {
78
83
  constructor(options?: KoonOptions);
79
84
 
80
- get(url: string): Promise<KoonResponse>;
81
- post(url: string, body?: Buffer): Promise<KoonResponse>;
82
- put(url: string, body?: Buffer): Promise<KoonResponse>;
83
- delete(url: string): Promise<KoonResponse>;
84
- patch(url: string, body?: Buffer): Promise<KoonResponse>;
85
- head(url: string): Promise<KoonResponse>;
86
- request(method: string, url: string, body?: Buffer): Promise<KoonResponse>;
87
- postMultipart(url: string, fields: KoonMultipartField[]): Promise<KoonResponse>;
88
- requestStreaming(method: string, url: string, body?: Buffer): Promise<KoonStreamingResponse>;
85
+ get(url: string, options?: KoonRequestOptions): Promise<KoonResponse>;
86
+ post(url: string, body?: Buffer, options?: KoonRequestOptions): Promise<KoonResponse>;
87
+ put(url: string, body?: Buffer, options?: KoonRequestOptions): Promise<KoonResponse>;
88
+ delete(url: string, options?: KoonRequestOptions): Promise<KoonResponse>;
89
+ patch(url: string, body?: Buffer, options?: KoonRequestOptions): Promise<KoonResponse>;
90
+ head(url: string, options?: KoonRequestOptions): Promise<KoonResponse>;
91
+ request(method: string, url: string, body?: Buffer, options?: KoonRequestOptions): Promise<KoonResponse>;
92
+ postMultipart(url: string, fields: KoonMultipartField[], options?: KoonRequestOptions): Promise<KoonResponse>;
93
+ requestStreaming(method: string, url: string, body?: Buffer, options?: KoonRequestOptions): Promise<KoonStreamingResponse>;
89
94
 
90
95
  websocket(url: string, headers?: Record<string, string>): Promise<KoonWebSocket>;
91
96
 
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koonjs",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Browser-impersonating HTTP client with TLS/HTTP2 fingerprint spoofing",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",