@modern-js/create-request 2.41.0 → 2.42.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.
@@ -1,3 +1,3 @@
1
1
  import type { RequestCreator, IOptions } from './types';
2
2
  export declare const configure: (options: IOptions) => void;
3
- export declare const createRequest: RequestCreator;
3
+ export declare const createRequest: RequestCreator;
@@ -1,3 +1,3 @@
1
1
  import { Response as NodeResponse } from 'node-fetch';
2
2
  declare const handleRes: (res: Response | NodeResponse) => Promise<any>;
3
- export { handleRes };
3
+ export { handleRes };
@@ -1,4 +1,4 @@
1
1
  import nodeFetch from 'node-fetch';
2
2
  import type { RequestCreator, IOptions } from './types';
3
3
  export declare const configure: (options: IOptions<typeof nodeFetch>) => void;
4
- export declare const createRequest: RequestCreator<typeof nodeFetch>;
4
+ export declare const createRequest: RequestCreator<typeof nodeFetch>;
@@ -1,20 +1,20 @@
1
1
  import type { HttpMethodDecider } from '@modern-js/types';
2
2
  export type BFFRequestPayload = {
3
- params?: Record<string, any>;
4
- query?: Record<string, any>;
5
- body?: string;
6
- formUrlencoded?: never;
7
- formData?: FormData;
8
- data?: Record<string, any>;
9
- headers?: Record<string, any>;
10
- cookies?: Record<string, any>;
3
+ params?: Record<string, any>;
4
+ query?: Record<string, any>;
5
+ body?: string;
6
+ formUrlencoded?: never;
7
+ formData?: FormData;
8
+ data?: Record<string, any>;
9
+ headers?: Record<string, any>;
10
+ cookies?: Record<string, any>;
11
11
  };
12
12
  export type Sender<F = typeof fetch> = ((...args: any[]) => Promise<any>) & {
13
- fetch?: F;
13
+ fetch?: F;
14
14
  };
15
15
  export type RequestCreator<F = typeof fetch> = (path: string, method: string, port: number, httpMethodDecider: HttpMethodDecider, fetch?: F) => Sender;
16
16
  export type IOptions<F = typeof fetch> = {
17
- request?: F;
18
- interceptor?: (request: F) => F;
19
- allowedHeaders?: string[];
20
- };
17
+ request?: F;
18
+ interceptor?: (request: F) => F;
19
+ allowedHeaders?: string[];
20
+ };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.41.0",
18
+ "version": "2.42.0",
19
19
  "jsnext:source": "./src/node.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/node.js",
@@ -64,8 +64,8 @@
64
64
  "path-to-regexp": "^6.2.0",
65
65
  "query-string": "^7.1.1",
66
66
  "@swc/helpers": "0.5.3",
67
- "@modern-js/utils": "2.41.0",
68
- "@modern-js/runtime-utils": "2.41.0"
67
+ "@modern-js/utils": "2.42.0",
68
+ "@modern-js/runtime-utils": "2.42.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/jest": "^29",
@@ -75,9 +75,9 @@
75
75
  "jest": "^29",
76
76
  "nock": "^13.2.1",
77
77
  "typescript": "^5",
78
- "@modern-js/types": "2.41.0",
79
- "@scripts/build": "2.41.0",
80
- "@scripts/jest-config": "2.41.0"
78
+ "@modern-js/types": "2.42.0",
79
+ "@scripts/build": "2.42.0",
80
+ "@scripts/jest-config": "2.42.0"
81
81
  },
82
82
  "sideEffects": false,
83
83
  "publishConfig": {