@midwayjs/cross-domain 3.5.3 → 3.6.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.
- package/dist/configuration.js +3 -4
- package/dist/jsonp.js +5 -5
- package/dist/middleware/cors.js +4 -4
- package/dist/middleware/jsonp.js +5 -5
- package/package.json +9 -10
package/dist/configuration.js
CHANGED
|
@@ -10,9 +10,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CrossDomainConfiguration = void 0;
|
|
13
|
-
const decorator_1 = require("@midwayjs/decorator");
|
|
14
|
-
const DefaultConfig = require("./config/config.default");
|
|
15
13
|
const core_1 = require("@midwayjs/core");
|
|
14
|
+
const DefaultConfig = require("./config/config.default");
|
|
16
15
|
const cors_1 = require("./middleware/cors");
|
|
17
16
|
let CrossDomainConfiguration = class CrossDomainConfiguration {
|
|
18
17
|
async onReady() {
|
|
@@ -24,11 +23,11 @@ let CrossDomainConfiguration = class CrossDomainConfiguration {
|
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
25
|
__decorate([
|
|
27
|
-
(0,
|
|
26
|
+
(0, core_1.Inject)(),
|
|
28
27
|
__metadata("design:type", core_1.MidwayApplicationManager)
|
|
29
28
|
], CrossDomainConfiguration.prototype, "applicationManager", void 0);
|
|
30
29
|
CrossDomainConfiguration = __decorate([
|
|
31
|
-
(0,
|
|
30
|
+
(0, core_1.Configuration)({
|
|
32
31
|
namespace: 'cross-domain',
|
|
33
32
|
importConfigs: [
|
|
34
33
|
{
|
package/dist/jsonp.js
CHANGED
|
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.JSONPService = void 0;
|
|
13
|
-
const
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
14
|
let JSONPService = class JSONPService {
|
|
15
15
|
jsonp(body, config) {
|
|
16
16
|
this.ctx.type = 'js';
|
|
@@ -33,19 +33,19 @@ let JSONPService = class JSONPService {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
__decorate([
|
|
36
|
-
(0,
|
|
36
|
+
(0, core_1.Inject)(),
|
|
37
37
|
__metadata("design:type", Object)
|
|
38
38
|
], JSONPService.prototype, "ctx", void 0);
|
|
39
39
|
__decorate([
|
|
40
|
-
(0,
|
|
40
|
+
(0, core_1.Config)('jsonp'),
|
|
41
41
|
__metadata("design:type", Object)
|
|
42
42
|
], JSONPService.prototype, "jsonpConfig", void 0);
|
|
43
43
|
__decorate([
|
|
44
|
-
(0,
|
|
44
|
+
(0, core_1.Inject)(),
|
|
45
45
|
__metadata("design:type", Object)
|
|
46
46
|
], JSONPService.prototype, "res", void 0);
|
|
47
47
|
JSONPService = __decorate([
|
|
48
|
-
(0,
|
|
48
|
+
(0, core_1.Provide)()
|
|
49
49
|
], JSONPService);
|
|
50
50
|
exports.JSONPService = JSONPService;
|
|
51
51
|
//# sourceMappingURL=jsonp.js.map
|
package/dist/middleware/cors.js
CHANGED
|
@@ -10,11 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CorsMiddleware = void 0;
|
|
13
|
-
const
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
14
|
const vary = require("vary");
|
|
15
15
|
let CorsMiddleware = class CorsMiddleware {
|
|
16
16
|
resolve(app) {
|
|
17
|
-
if (app.getFrameworkType() ===
|
|
17
|
+
if (app.getFrameworkType() === core_1.MidwayFrameworkType.WEB_EXPRESS) {
|
|
18
18
|
return async (req, res, next) => {
|
|
19
19
|
return this.compatibleMiddleware(req, res, next);
|
|
20
20
|
};
|
|
@@ -110,11 +110,11 @@ let CorsMiddleware = class CorsMiddleware {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
__decorate([
|
|
113
|
-
(0,
|
|
113
|
+
(0, core_1.Config)('cors'),
|
|
114
114
|
__metadata("design:type", Object)
|
|
115
115
|
], CorsMiddleware.prototype, "cors", void 0);
|
|
116
116
|
CorsMiddleware = __decorate([
|
|
117
|
-
(0,
|
|
117
|
+
(0, core_1.Middleware)()
|
|
118
118
|
], CorsMiddleware);
|
|
119
119
|
exports.CorsMiddleware = CorsMiddleware;
|
|
120
120
|
//# sourceMappingURL=cors.js.map
|
package/dist/middleware/jsonp.js
CHANGED
|
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.JSONPMiddleware = exports.JSONPFilter = void 0;
|
|
13
|
-
const
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
14
|
const jsonp_1 = require("../jsonp");
|
|
15
15
|
const error_1 = require("../error");
|
|
16
16
|
let JSONPFilter = class JSONPFilter {
|
|
@@ -20,12 +20,12 @@ let JSONPFilter = class JSONPFilter {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
JSONPFilter = __decorate([
|
|
23
|
-
(0,
|
|
23
|
+
(0, core_1.Match)()
|
|
24
24
|
], JSONPFilter);
|
|
25
25
|
exports.JSONPFilter = JSONPFilter;
|
|
26
26
|
let JSONPMiddleware = class JSONPMiddleware {
|
|
27
27
|
resolve(app) {
|
|
28
|
-
if (app.getFrameworkType() ===
|
|
28
|
+
if (app.getFrameworkType() === core_1.MidwayFrameworkType.WEB_EXPRESS) {
|
|
29
29
|
app.useFilter(JSONPFilter);
|
|
30
30
|
return async (req, res, next) => {
|
|
31
31
|
return this.compatibleMiddleware(req, next);
|
|
@@ -54,11 +54,11 @@ let JSONPMiddleware = class JSONPMiddleware {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
__decorate([
|
|
57
|
-
(0,
|
|
57
|
+
(0, core_1.Config)('jsonp'),
|
|
58
58
|
__metadata("design:type", Object)
|
|
59
59
|
], JSONPMiddleware.prototype, "jsonp", void 0);
|
|
60
60
|
JSONPMiddleware = __decorate([
|
|
61
|
-
(0,
|
|
61
|
+
(0, core_1.Middleware)()
|
|
62
62
|
], JSONPMiddleware);
|
|
63
63
|
exports.JSONPMiddleware = JSONPMiddleware;
|
|
64
64
|
//# sourceMappingURL=jsonp.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/cross-domain",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Midway Component for Cross Domain",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -25,14 +25,13 @@
|
|
|
25
25
|
"vary": "^1.1.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@midwayjs/core": "^3.
|
|
29
|
-
"@midwayjs/
|
|
30
|
-
"@midwayjs/
|
|
31
|
-
"@midwayjs/
|
|
32
|
-
"@midwayjs/
|
|
33
|
-
"@midwayjs/
|
|
34
|
-
"@midwayjs/
|
|
35
|
-
"@midwayjs/web": "^3.5.3"
|
|
28
|
+
"@midwayjs/core": "^3.6.0",
|
|
29
|
+
"@midwayjs/express": "^3.6.0",
|
|
30
|
+
"@midwayjs/faas": "^3.6.0",
|
|
31
|
+
"@midwayjs/koa": "^3.6.0",
|
|
32
|
+
"@midwayjs/mock": "^3.6.0",
|
|
33
|
+
"@midwayjs/serverless-app": "^3.6.0",
|
|
34
|
+
"@midwayjs/web": "^3.6.0"
|
|
36
35
|
},
|
|
37
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
|
|
38
37
|
}
|