@eggjs/jsonp 4.0.0-beta.15 → 4.0.0-beta.18
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,6 +1,24 @@
|
|
|
1
1
|
import { PartialEggConfig } from "egg";
|
|
2
2
|
|
|
3
3
|
//#region src/config/config.default.d.ts
|
|
4
|
+
interface JSONPConfig {
|
|
5
|
+
/**
|
|
6
|
+
* jsonp callback methods key, default to `['_callback', 'callback' ]`
|
|
7
|
+
*/
|
|
8
|
+
callback: string[] | string;
|
|
9
|
+
/**
|
|
10
|
+
* callback method name's max length, default to `50`
|
|
11
|
+
*/
|
|
12
|
+
limit: number;
|
|
13
|
+
/**
|
|
14
|
+
* enable csrf check or not, default to `false`
|
|
15
|
+
*/
|
|
16
|
+
csrf: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* referrer white list, default to `undefined`
|
|
19
|
+
*/
|
|
20
|
+
whiteList?: string | RegExp | (string | RegExp)[];
|
|
21
|
+
}
|
|
4
22
|
declare const _default: PartialEggConfig;
|
|
5
23
|
//#endregion
|
|
6
|
-
export { _default as default };
|
|
24
|
+
export { JSONPConfig, _default as default };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,31 +1,13 @@
|
|
|
1
|
+
import { JSONPConfig } from "./config/config.default.js";
|
|
1
2
|
import { MiddlewareFunc } from "egg";
|
|
2
3
|
|
|
3
4
|
//#region src/types.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* jsonp options
|
|
7
|
-
* @member Config#jsonp
|
|
8
|
-
*/
|
|
9
|
-
interface JSONPConfig {
|
|
10
|
-
/**
|
|
11
|
-
* jsonp callback methods key, default to `['_callback', 'callback' ]`
|
|
12
|
-
*/
|
|
13
|
-
callback: string[] | string;
|
|
14
|
-
/**
|
|
15
|
-
* callback method name's max length, default to `50`
|
|
16
|
-
*/
|
|
17
|
-
limit: number;
|
|
18
|
-
/**
|
|
19
|
-
* enable csrf check or not, default to `false`
|
|
20
|
-
*/
|
|
21
|
-
csrf: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* referrer white list, default to `undefined`
|
|
24
|
-
*/
|
|
25
|
-
whiteList?: string | RegExp | (string | RegExp)[];
|
|
26
|
-
}
|
|
27
5
|
declare module 'egg' {
|
|
28
6
|
interface EggAppConfig {
|
|
7
|
+
/**
|
|
8
|
+
* jsonp options
|
|
9
|
+
* @member Config#jsonp
|
|
10
|
+
*/
|
|
29
11
|
jsonp?: JSONPConfig;
|
|
30
12
|
}
|
|
31
13
|
interface Context {
|
|
@@ -50,6 +32,4 @@ declare module 'egg' {
|
|
|
50
32
|
*/
|
|
51
33
|
jsonp(initOptions?: Partial<JSONPConfig>): MiddlewareFunc;
|
|
52
34
|
}
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { JSONPConfig };
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/jsonp",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.18",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"jsonp-body": "^2.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"egg": "4.1.0-beta.
|
|
52
|
+
"egg": "4.1.0-beta.18"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "24.5.2",
|
|
56
56
|
"tsdown": "^0.15.4",
|
|
57
57
|
"typescript": "5.9.2",
|
|
58
58
|
"vitest": "4.0.0-beta.13",
|
|
59
|
-
"@eggjs/
|
|
60
|
-
"@eggjs/
|
|
59
|
+
"@eggjs/mock": "7.0.0-beta.18",
|
|
60
|
+
"@eggjs/tsconfig": "3.1.0-beta.18"
|
|
61
61
|
},
|
|
62
62
|
"main": "./dist/index.js",
|
|
63
63
|
"module": "./dist/index.js",
|