@taybart/corvid 0.1.11 → 0.1.12

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/index.js CHANGED
@@ -518,16 +518,16 @@ class request {
518
518
  this.log.debug(`params: ${reqParams.toString()}`);
519
519
  url = `${url}?${reqParams.toString()}`;
520
520
  }
521
+ override.headers = override.headers || {};
521
522
  this.log.debug(`${this.opts.method} ${url}`);
522
523
  return {
523
524
  url,
524
525
  options: {
525
- method: this.opts.method,
526
+ method: override.method || this.opts.method,
526
527
  credentials: this.opts.credentials,
527
528
  headers: {
528
- accept: 'application/json',
529
- 'content-type': 'application/json',
530
- ...this.opts.headers
529
+ ...this.opts.headers,
530
+ ...override.headers
531
531
  },
532
532
  body: JSON.stringify(body)
533
533
  }
package/dist/network.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare class params {
11
11
  export type requestOpts = {
12
12
  url?: string;
13
13
  type?: 'json';
14
- method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
14
+ method?: 'HEAD' | 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS';
15
15
  params?: Object | params;
16
16
  headers?: Record<string, string>;
17
17
  auth?: string | {
@@ -21,6 +21,7 @@ export type requestOpts = {
21
21
  body?: Object;
22
22
  success?: number;
23
23
  credentials?: RequestCredentials;
24
+ insecureNoVerify?: boolean;
24
25
  };
25
26
  export declare class request {
26
27
  opts: requestOpts;
@@ -39,15 +40,22 @@ export declare class request {
39
40
  success?: number;
40
41
  params?: Object;
41
42
  body?: Object;
43
+ headers?: Object;
44
+ method?: string;
42
45
  };
43
46
  }): {
44
47
  url: string;
45
48
  options: {
46
- method: "GET" | "POST" | "PUT" | "DELETE" | undefined;
49
+ method: string | undefined;
47
50
  credentials: RequestCredentials | undefined;
48
51
  headers: {
49
- accept: string;
50
- 'content-type': string;
52
+ constructor: Function;
53
+ toString(): string;
54
+ toLocaleString(): string;
55
+ valueOf(): Object;
56
+ hasOwnProperty(v: PropertyKey): boolean;
57
+ isPrototypeOf(v: Object): boolean;
58
+ propertyIsEnumerable(v: PropertyKey): boolean;
51
59
  };
52
60
  body: string;
53
61
  };
@@ -58,6 +66,7 @@ export declare class request {
58
66
  override?: {
59
67
  success?: number;
60
68
  params?: Object;
69
+ headers?: Object;
61
70
  body?: Object;
62
71
  };
63
72
  }): Promise<any>;
package/dist/network.js CHANGED
@@ -115,16 +115,16 @@ class request {
115
115
  this.log.debug(`params: ${reqParams.toString()}`);
116
116
  url = `${url}?${reqParams.toString()}`;
117
117
  }
118
+ override.headers = override.headers || {};
118
119
  this.log.debug(`${this.opts.method} ${url}`);
119
120
  return {
120
121
  url,
121
122
  options: {
122
- method: this.opts.method,
123
+ method: override.method || this.opts.method,
123
124
  credentials: this.opts.credentials,
124
125
  headers: {
125
- accept: 'application/json',
126
- 'content-type': 'application/json',
127
- ...this.opts.headers
126
+ ...this.opts.headers,
127
+ ...override.headers
128
128
  },
129
129
  body: JSON.stringify(body)
130
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taybart/corvid",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {