@eggjs/jsonp 4.0.0-beta.34 → 4.0.0-beta.36
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/app/extend/application.d.ts +13 -9
- package/dist/app/extend/application.js +73 -103
- package/dist/app/extend/context.d.ts +18 -14
- package/dist/app/extend/context.js +33 -31
- package/dist/config/config.default.d.ts +23 -20
- package/dist/config/config.default.js +11 -9
- package/dist/error/JSONPForbiddenReferrerError.d.ts +7 -4
- package/dist/error/JSONPForbiddenReferrerError.js +15 -12
- package/dist/index.d.ts +20 -16
- package/dist/index.js +24 -21
- package/dist/lib/private_key.d.ts +4 -1
- package/dist/lib/private_key.js +5 -2
- package/dist/types.d.ts +35 -33
- package/dist/types.js +1 -2
- package/package.json +36 -43
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { JSONPConfig } from "../../config/config.default.js";
|
|
2
|
+
import { Application, MiddlewareFunc } from "egg";
|
|
3
|
+
|
|
4
|
+
//#region src/app/extend/application.d.ts
|
|
5
|
+
declare class JSONPApplication extends Application {
|
|
6
|
+
/**
|
|
7
|
+
* return a middleware to enable jsonp response.
|
|
8
|
+
* will do some security check inside.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
jsonp(initOptions?: Partial<JSONPConfig>): MiddlewareFunc;
|
|
10
12
|
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { JSONPApplication as default };
|
|
@@ -1,110 +1,80 @@
|
|
|
1
|
-
import { debuglog } from 'node:util';
|
|
2
|
-
import { parse as urlParse } from 'node:url';
|
|
3
|
-
import { Application } from 'egg';
|
|
4
|
-
import { JSONP_CONFIG } from "../../lib/private_key.js";
|
|
5
1
|
import { JSONPForbiddenReferrerError } from "../../error/JSONPForbiddenReferrerError.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
options,
|
|
54
|
-
};
|
|
55
|
-
// before handle request, must do some security checks
|
|
56
|
-
securityAssert(ctx);
|
|
57
|
-
await next();
|
|
58
|
-
// generate jsonp body
|
|
59
|
-
ctx.createJsonpBody(ctx.body);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
}
|
|
2
|
+
import { JSONP_CONFIG } from "../../lib/private_key.js";
|
|
3
|
+
import { Application } from "egg";
|
|
4
|
+
import { parse } from "node:url";
|
|
5
|
+
import { debuglog } from "node:util";
|
|
6
|
+
|
|
7
|
+
//#region src/app/extend/application.ts
|
|
8
|
+
const debug = debuglog("egg/jsonp/app/extend/application");
|
|
9
|
+
var JSONPApplication = class extends Application {
|
|
10
|
+
/**
|
|
11
|
+
* return a middleware to enable jsonp response.
|
|
12
|
+
* will do some security check inside.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
jsonp(initOptions = {}) {
|
|
16
|
+
const options = {
|
|
17
|
+
...this.config.jsonp,
|
|
18
|
+
...initOptions
|
|
19
|
+
};
|
|
20
|
+
if (!Array.isArray(options.callback)) options.callback = [options.callback];
|
|
21
|
+
const csrfEnable = this.plugins.security && this.plugins.security.enable && this.config.security.csrf && this.config.security.csrf.enable !== false && options.csrf;
|
|
22
|
+
const validateReferrer = options.whiteList && createValidateReferer(options.whiteList);
|
|
23
|
+
if (!csrfEnable && !validateReferrer) this.coreLogger.warn("[@eggjs/jsonp] SECURITY WARNING!! csrf check and referrer check are both closed!");
|
|
24
|
+
/**
|
|
25
|
+
* jsonp request security check, pass if
|
|
26
|
+
*
|
|
27
|
+
* 1. hit referrer white list
|
|
28
|
+
* 2. or pass csrf check
|
|
29
|
+
* 3. both check are disabled
|
|
30
|
+
*/
|
|
31
|
+
function securityAssert(ctx) {
|
|
32
|
+
if (!csrfEnable && !validateReferrer) return;
|
|
33
|
+
const referrer = ctx.get("referrer");
|
|
34
|
+
if (validateReferrer && validateReferrer(referrer)) return;
|
|
35
|
+
if (csrfEnable && validateCsrf(ctx)) return;
|
|
36
|
+
throw new JSONPForbiddenReferrerError("jsonp request security validate failed", referrer, 403);
|
|
37
|
+
}
|
|
38
|
+
return async function jsonp(ctx, next) {
|
|
39
|
+
ctx[JSONP_CONFIG] = {
|
|
40
|
+
jsonpFunction: getJsonpFunction(ctx.query, options.callback),
|
|
41
|
+
options
|
|
42
|
+
};
|
|
43
|
+
securityAssert(ctx);
|
|
44
|
+
await next();
|
|
45
|
+
ctx.createJsonpBody(ctx.body);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
63
49
|
function createValidateReferer(whiteList) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// check if referrer's hostname match the string rule
|
|
80
|
-
if (rule[0] === '.' && (hostname.endsWith(rule) || hostname === rule.slice(1))) {
|
|
81
|
-
// string start with `.`(.github.com): referrer's hostname must ends with rule
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
else if (hostname === rule) {
|
|
85
|
-
// string not start with `.`(github.com): referrer's hostname must strict equal to rule
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// no rule matched
|
|
90
|
-
return false;
|
|
91
|
-
};
|
|
50
|
+
if (!Array.isArray(whiteList)) whiteList = [whiteList];
|
|
51
|
+
return (referrer) => {
|
|
52
|
+
let parsed;
|
|
53
|
+
for (const rule of whiteList) {
|
|
54
|
+
if (rule instanceof RegExp) {
|
|
55
|
+
if (rule.test(referrer)) return true;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
parsed = parsed ?? parse(referrer);
|
|
59
|
+
const hostname = parsed.hostname || "";
|
|
60
|
+
if (rule[0] === "." && (hostname.endsWith(rule) || hostname === rule.slice(1))) return true;
|
|
61
|
+
else if (hostname === rule) return true;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
};
|
|
92
65
|
}
|
|
93
66
|
function validateCsrf(ctx) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
67
|
+
try {
|
|
68
|
+
ctx.assertCsrf();
|
|
69
|
+
return true;
|
|
70
|
+
} catch (err) {
|
|
71
|
+
debug("validate csrf failed: %s", err);
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
102
74
|
}
|
|
103
75
|
function getJsonpFunction(query, callbacks) {
|
|
104
|
-
|
|
105
|
-
if (query[callback]) {
|
|
106
|
-
return query[callback];
|
|
107
|
-
}
|
|
108
|
-
}
|
|
76
|
+
for (const callback of callbacks) if (query[callback]) return query[callback];
|
|
109
77
|
}
|
|
110
|
-
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
export { JSONPApplication as default };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { Context } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { Context } from "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/app/extend/context.d.ts
|
|
4
|
+
declare class JSONPContext extends Context {
|
|
5
|
+
/**
|
|
6
|
+
* detect if response should be jsonp
|
|
7
|
+
*/
|
|
8
|
+
get acceptJSONP(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* JSONP wrap body function
|
|
11
|
+
* Set jsonp response wrap function, other plugin can use it.
|
|
12
|
+
* If not necessary, please don't use this method in your application code.
|
|
13
|
+
* @param {Object} body response body
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
createJsonpBody(body: any): void;
|
|
15
17
|
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { JSONPContext as default };
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { jsonp as jsonpBody } from 'jsonp-body';
|
|
2
|
-
import { Context } from 'egg';
|
|
3
1
|
import { JSONP_CONFIG } from "../../lib/private_key.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
import { Context } from "egg";
|
|
3
|
+
import { jsonp } from "jsonp-body";
|
|
4
|
+
|
|
5
|
+
//#region src/app/extend/context.ts
|
|
6
|
+
var JSONPContext = class extends Context {
|
|
7
|
+
/**
|
|
8
|
+
* detect if response should be jsonp
|
|
9
|
+
*/
|
|
10
|
+
get acceptJSONP() {
|
|
11
|
+
return !!this[JSONP_CONFIG]?.jsonpFunction;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* JSONP wrap body function
|
|
15
|
+
* Set jsonp response wrap function, other plugin can use it.
|
|
16
|
+
* If not necessary, please don't use this method in your application code.
|
|
17
|
+
* @param {Object} body response body
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
createJsonpBody(body) {
|
|
21
|
+
const jsonpConfig = this[JSONP_CONFIG];
|
|
22
|
+
if (!jsonpConfig?.jsonpFunction) {
|
|
23
|
+
this.body = body;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.set("x-content-type-options", "nosniff");
|
|
27
|
+
this.type = "js";
|
|
28
|
+
body = body === void 0 ? null : body;
|
|
29
|
+
this.body = jsonp(body, jsonpConfig.jsonpFunction, jsonpConfig.options);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { JSONPContext as default };
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { PartialEggConfig } from "egg";
|
|
2
|
+
|
|
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)[];
|
|
19
21
|
}
|
|
20
|
-
declare const
|
|
21
|
-
|
|
22
|
+
declare const config: PartialEggConfig;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { JSONPConfig, config as default };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
//#region src/config/config.default.ts
|
|
2
|
+
const config = { jsonp: {
|
|
3
|
+
limit: 50,
|
|
4
|
+
callback: ["_callback", "callback"],
|
|
5
|
+
csrf: false,
|
|
6
|
+
whiteList: void 0
|
|
7
|
+
} };
|
|
8
|
+
var config_default_default = config;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { config_default_default as default };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/error/JSONPForbiddenReferrerError.d.ts
|
|
2
|
+
declare class JSONPForbiddenReferrerError extends Error {
|
|
3
|
+
referrer: string;
|
|
4
|
+
status: number;
|
|
5
|
+
constructor(message: string, referrer: string, status: number);
|
|
5
6
|
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { JSONPForbiddenReferrerError };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
//#region src/error/JSONPForbiddenReferrerError.ts
|
|
2
|
+
var JSONPForbiddenReferrerError = class extends Error {
|
|
3
|
+
referrer;
|
|
4
|
+
status;
|
|
5
|
+
constructor(message, referrer, status) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = this.constructor.name;
|
|
8
|
+
this.referrer = referrer;
|
|
9
|
+
this.status = status;
|
|
10
|
+
Error.captureStackTrace(this, this.constructor);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { JSONPForbiddenReferrerError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "./types.js";
|
|
2
|
+
import { EggPluginFactory } from "egg";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
* JSONP plugin
|
|
8
|
+
*
|
|
9
|
+
* @since 4.1.0
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```ts
|
|
12
|
+
* // config/plugin.ts
|
|
13
|
+
* import jsonpPlugin from '@eggjs/jsonp';
|
|
14
|
+
*
|
|
15
|
+
* export default {
|
|
16
|
+
* ...jsonpPlugin(),
|
|
17
|
+
* };
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
17
20
|
declare const _default: EggPluginFactory;
|
|
18
|
-
|
|
21
|
+
//#endregion
|
|
22
|
+
export { _default as default };
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
1
|
+
import { definePluginFactory } from "egg";
|
|
2
|
+
|
|
3
|
+
//#region src/index.ts
|
|
3
4
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
* JSONP plugin
|
|
6
|
+
*
|
|
7
|
+
* @since 4.1.0
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```ts
|
|
10
|
+
* // config/plugin.ts
|
|
11
|
+
* import jsonpPlugin from '@eggjs/jsonp';
|
|
12
|
+
*
|
|
13
|
+
* export default {
|
|
14
|
+
* ...jsonpPlugin(),
|
|
15
|
+
* };
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
var src_default = definePluginFactory({
|
|
19
|
+
name: "jsonp",
|
|
20
|
+
enable: true,
|
|
21
|
+
path: import.meta.dirname,
|
|
22
|
+
optionalDependencies: ["security"]
|
|
22
23
|
});
|
|
23
|
-
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { src_default as default };
|
package/dist/lib/private_key.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/lib/private_key.ts
|
|
2
|
+
const JSONP_CONFIG = Symbol("jsonp#config");
|
|
3
|
+
|
|
4
|
+
//#endregion
|
|
5
|
+
export { JSONP_CONFIG };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { JSONPConfig } from "./config/config.default.js";
|
|
2
|
+
import { MiddlewareFunc } from "egg";
|
|
3
|
+
|
|
4
|
+
//#region src/types.d.ts
|
|
5
|
+
declare module "egg" {
|
|
6
|
+
interface EggAppConfig {
|
|
7
|
+
/**
|
|
8
|
+
* jsonp options
|
|
9
|
+
* @member Config#jsonp
|
|
10
|
+
*/
|
|
11
|
+
jsonp?: JSONPConfig;
|
|
12
|
+
}
|
|
13
|
+
interface Context {
|
|
14
|
+
/**
|
|
15
|
+
* detect if response should be jsonp
|
|
16
|
+
*/
|
|
17
|
+
acceptJSONP: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* JSONP wrap body function
|
|
20
|
+
* Set jsonp response wrap function, other plugin can use it.
|
|
21
|
+
* If not necessary, please don't use this method in your application code.
|
|
22
|
+
* @param {Object} body response body
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
createJsonpBody(body: any): void;
|
|
26
|
+
}
|
|
27
|
+
interface Application {
|
|
28
|
+
/**
|
|
29
|
+
* return a middleware to enable jsonp response.
|
|
30
|
+
* will do some security check inside.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
jsonp(initOptions?: Partial<JSONPConfig>): MiddlewareFunc;
|
|
34
|
+
}
|
|
35
|
+
}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/jsonp",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
4
|
-
"publishConfig": {
|
|
5
|
-
"access": "public"
|
|
6
|
-
},
|
|
7
|
-
"type": "module",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": "./dist/index.js",
|
|
10
|
-
"./app/extend/application": "./dist/app/extend/application.js",
|
|
11
|
-
"./app/extend/context": "./dist/app/extend/context.js",
|
|
12
|
-
"./config/config.default": "./dist/config/config.default.js",
|
|
13
|
-
"./error/JSONPForbiddenReferrerError": "./dist/error/JSONPForbiddenReferrerError.js",
|
|
14
|
-
"./lib/private_key": "./dist/lib/private_key.js",
|
|
15
|
-
"./types": "./dist/types.js",
|
|
16
|
-
"./package.json": "./package.json"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"dist"
|
|
20
|
-
],
|
|
3
|
+
"version": "4.0.0-beta.36",
|
|
21
4
|
"description": "jsonp support for egg",
|
|
22
5
|
"keywords": [
|
|
23
6
|
"egg",
|
|
@@ -25,43 +8,53 @@
|
|
|
25
8
|
"jsonp",
|
|
26
9
|
"security"
|
|
27
10
|
],
|
|
11
|
+
"homepage": "https://github.com/eggjs/egg/tree/next/plugins/jsonp",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/eggjs/egg/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "dead-horse",
|
|
28
17
|
"repository": {
|
|
29
18
|
"type": "git",
|
|
30
|
-
"url": "git://github.com/eggjs/egg.git",
|
|
19
|
+
"url": "git+https://github.com/eggjs/egg.git",
|
|
31
20
|
"directory": "plugins/jsonp"
|
|
32
21
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./app/extend/application": "./dist/app/extend/application.js",
|
|
32
|
+
"./app/extend/context": "./dist/app/extend/context.js",
|
|
33
|
+
"./config/config.default": "./dist/config/config.default.js",
|
|
34
|
+
"./error/JSONPForbiddenReferrerError": "./dist/error/JSONPForbiddenReferrerError.js",
|
|
35
|
+
"./lib/private_key": "./dist/lib/private_key.js",
|
|
36
|
+
"./types": "./dist/types.js",
|
|
37
|
+
"./package.json": "./package.json"
|
|
35
38
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"license": "MIT",
|
|
39
|
-
"engines": {
|
|
40
|
-
"node": ">=22.18.0"
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"jsonp-body": "^2.0.0"
|
|
44
44
|
},
|
|
45
|
-
"peerDependencies": {
|
|
46
|
-
"egg": "4.1.0-beta.34"
|
|
47
|
-
},
|
|
48
45
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^24.
|
|
50
|
-
"tsdown": "0.15.11",
|
|
46
|
+
"@types/node": "^24.10.2",
|
|
51
47
|
"typescript": "^5.9.3",
|
|
52
|
-
"
|
|
53
|
-
"@eggjs/mock": "7.0.0-beta.
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
"egg": "4.1.0-beta.36",
|
|
49
|
+
"@eggjs/mock": "7.0.0-beta.36"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"egg": "4.1.0-beta.36"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=22.18.0"
|
|
56
56
|
},
|
|
57
|
-
"main": "./dist/index.js",
|
|
58
|
-
"module": "./dist/index.js",
|
|
59
|
-
"types": "./dist/index.d.ts",
|
|
60
57
|
"scripts": {
|
|
61
|
-
"
|
|
62
|
-
"typecheck": "tsc --noEmit",
|
|
63
|
-
"lint": "oxlint --type-aware",
|
|
64
|
-
"lint:fix": "npm run lint -- --fix",
|
|
65
|
-
"test": "npm run lint:fix && vitest run"
|
|
58
|
+
"typecheck": "tsgo --noEmit"
|
|
66
59
|
}
|
|
67
60
|
}
|