@midwayjs/cross-domain 3.19.2 → 4.0.0-alpha.1

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.
@@ -22,11 +22,12 @@ let CrossDomainConfiguration = class CrossDomainConfiguration {
22
22
  });
23
23
  }
24
24
  };
25
+ exports.CrossDomainConfiguration = CrossDomainConfiguration;
25
26
  __decorate([
26
27
  (0, core_1.Inject)(),
27
28
  __metadata("design:type", core_1.MidwayApplicationManager)
28
29
  ], CrossDomainConfiguration.prototype, "applicationManager", void 0);
29
- CrossDomainConfiguration = __decorate([
30
+ exports.CrossDomainConfiguration = CrossDomainConfiguration = __decorate([
30
31
  (0, core_1.Configuration)({
31
32
  namespace: 'cross-domain',
32
33
  importConfigs: [
@@ -36,5 +37,4 @@ CrossDomainConfiguration = __decorate([
36
37
  ],
37
38
  })
38
39
  ], CrossDomainConfiguration);
39
- exports.CrossDomainConfiguration = CrossDomainConfiguration;
40
40
  //# sourceMappingURL=configuration.js.map
package/dist/jsonp.js CHANGED
@@ -32,6 +32,7 @@ let JSONPService = class JSONPService {
32
32
  return `/**/ typeof ${cb} === 'function' && ${cb}(${str});`;
33
33
  }
34
34
  };
35
+ exports.JSONPService = JSONPService;
35
36
  __decorate([
36
37
  (0, core_1.Inject)(),
37
38
  __metadata("design:type", Object)
@@ -44,8 +45,7 @@ __decorate([
44
45
  (0, core_1.Inject)(),
45
46
  __metadata("design:type", Object)
46
47
  ], JSONPService.prototype, "res", void 0);
47
- JSONPService = __decorate([
48
+ exports.JSONPService = JSONPService = __decorate([
48
49
  (0, core_1.Provide)()
49
50
  ], JSONPService);
50
- exports.JSONPService = JSONPService;
51
51
  //# sourceMappingURL=jsonp.js.map
@@ -14,7 +14,7 @@ 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() === core_1.MidwayFrameworkType.WEB_EXPRESS) {
17
+ if ('express' === app.getNamespace()) {
18
18
  return async (req, res, next) => {
19
19
  return this.compatibleMiddleware(req, res, next);
20
20
  };
@@ -112,12 +112,12 @@ let CorsMiddleware = class CorsMiddleware {
112
112
  return 'cors';
113
113
  }
114
114
  };
115
+ exports.CorsMiddleware = CorsMiddleware;
115
116
  __decorate([
116
117
  (0, core_1.Config)('cors'),
117
118
  __metadata("design:type", Object)
118
119
  ], CorsMiddleware.prototype, "cors", void 0);
119
- CorsMiddleware = __decorate([
120
+ exports.CorsMiddleware = CorsMiddleware = __decorate([
120
121
  (0, core_1.Middleware)()
121
122
  ], CorsMiddleware);
122
- exports.CorsMiddleware = CorsMiddleware;
123
123
  //# sourceMappingURL=cors.js.map
@@ -19,13 +19,13 @@ let JSONPFilter = class JSONPFilter {
19
19
  return jsonpService.jsonp(value);
20
20
  }
21
21
  };
22
- JSONPFilter = __decorate([
22
+ exports.JSONPFilter = JSONPFilter;
23
+ exports.JSONPFilter = JSONPFilter = __decorate([
23
24
  (0, core_1.Match)()
24
25
  ], JSONPFilter);
25
- exports.JSONPFilter = JSONPFilter;
26
26
  let JSONPMiddleware = class JSONPMiddleware {
27
27
  resolve(app) {
28
- if (app.getFrameworkType() === core_1.MidwayFrameworkType.WEB_EXPRESS) {
28
+ if ('express' === app.getNamespace()) {
29
29
  app.useFilter(JSONPFilter);
30
30
  return async (req, res, next) => {
31
31
  return this.compatibleMiddleware(req, next);
@@ -56,12 +56,12 @@ let JSONPMiddleware = class JSONPMiddleware {
56
56
  return 'jsonp';
57
57
  }
58
58
  };
59
+ exports.JSONPMiddleware = JSONPMiddleware;
59
60
  __decorate([
60
61
  (0, core_1.Config)('jsonp'),
61
62
  __metadata("design:type", Object)
62
63
  ], JSONPMiddleware.prototype, "jsonp", void 0);
63
- JSONPMiddleware = __decorate([
64
+ exports.JSONPMiddleware = JSONPMiddleware = __decorate([
64
65
  (0, core_1.Middleware)()
65
66
  ], JSONPMiddleware);
66
- exports.JSONPMiddleware = JSONPMiddleware;
67
67
  //# sourceMappingURL=jsonp.js.map
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@midwayjs/cross-domain",
3
- "version": "3.19.2",
3
+ "version": "4.0.0-alpha.1",
4
4
  "description": "Midway Component for Cross Domain",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
- "test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand",
10
- "cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit",
9
+ "test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand",
10
+ "cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit",
11
11
  "ci": "npm run test"
12
12
  },
13
13
  "keywords": [],
@@ -25,13 +25,12 @@
25
25
  "vary": "1.1.2"
26
26
  },
27
27
  "devDependencies": {
28
- "@midwayjs/core": "^3.19.0",
29
- "@midwayjs/express": "^3.19.2",
30
- "@midwayjs/faas": "^3.19.2",
31
- "@midwayjs/koa": "^3.19.2",
32
- "@midwayjs/mock": "^3.19.2",
33
- "@midwayjs/serverless-app": "^3.19.2",
34
- "@midwayjs/web": "^3.19.2"
28
+ "@midwayjs/core": "^4.0.0-alpha.1",
29
+ "@midwayjs/express": "^4.0.0-alpha.1",
30
+ "@midwayjs/faas": "^4.0.0-alpha.1",
31
+ "@midwayjs/koa": "^4.0.0-alpha.1",
32
+ "@midwayjs/mock": "^4.0.0-alpha.1",
33
+ "@midwayjs/web": "^4.0.0-alpha.1"
35
34
  },
36
- "gitHead": "57fd034be94897fb819b0d9ef776de0b9923ab0f"
35
+ "gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372"
37
36
  }