@tuya-sat/micro-dev-proxy 2.0.0-rc.7 → 2.0.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/index.d.ts CHANGED
@@ -4,4 +4,4 @@ export interface Config extends AppProxyConfig {
4
4
  [key: string]: any;
5
5
  };
6
6
  }
7
- export default function createProxy(prevConfig: Config): (app: any) => void;
7
+ export default function createProxy({ additionHeaders, ...restPrevConfig }: Config): (app: any) => void;
package/dist/index.js CHANGED
@@ -14,10 +14,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ const node_os_1 = __importDefault(require("node:os"));
17
18
  const http_proxy_middleware_1 = require("http-proxy-middleware");
18
19
  const appProxy_1 = __importDefault(require("./appProxy"));
19
- function createProxy(prevConfig) {
20
- const config = Object.assign({ additionHeaders: {}, isMainApp: false, loginApi: "/api/login", needProxyApi: ["/api", "/open-api"], logSign: false, csrf: true }, prevConfig);
20
+ function createProxy(_a) {
21
+ var { additionHeaders = {} } = _a, restPrevConfig = __rest(_a, ["additionHeaders"]);
22
+ const config = Object.assign({ additionHeaders: Object.assign({ terminalId: node_os_1.default.hostname() }, additionHeaders), isMainApp: false, loginApi: "/api/login", needProxyApi: ["/api", "/open-api"], logSign: false, csrf: true }, restPrevConfig);
21
23
  const { needProxyApi } = config, appProxyConfig = __rest(config, ["needProxyApi"]);
22
24
  const appProxy = new appProxy_1.default(appProxyConfig);
23
25
  return function middleware(app) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-dev-proxy",
3
- "version": "2.0.0-rc.7",
3
+ "version": "2.0.0",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -10,18 +10,18 @@
10
10
  "test": "jest --verbose ./__tests__"
11
11
  },
12
12
  "dependencies": {
13
- "axios": "^0.23.0",
14
- "chalk": "^4.1.2",
15
- "fs-extra": "^10.0.0",
16
- "http-proxy-middleware": "^2.0.1",
17
- "js-sha256": "^0.9.0"
13
+ "axios": "0.26.1",
14
+ "chalk": "5.0.1",
15
+ "fs-extra": "10.0.1",
16
+ "http-proxy-middleware": "2.0.4",
17
+ "js-sha256": "0.9.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/fs-extra": "^9.0.13",
21
- "@types/jest": "^26.0.24",
22
- "jest": "^27.0.6",
23
- "ts-jest": "^27.0.4",
24
- "typescript": "^4.4.4"
20
+ "@types/fs-extra": "9.0.13",
21
+ "@types/jest": "27.4.1",
22
+ "jest": "27.5.1",
23
+ "ts-jest": "27.1.3",
24
+ "typescript": "4.6.2"
25
25
  },
26
26
  "keywords": [
27
27
  "saturn-project",
@@ -31,6 +31,5 @@
31
31
  "saas",
32
32
  "cloud",
33
33
  "tuya"
34
- ],
35
- "stableVersion": "1.1.4"
34
+ ]
36
35
  }