@be-link/pos-cli-nodejs 0.0.19 → 0.0.21
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/package.json +4 -4
- package/pos/http.js +1 -1
- package/pos/modules/service.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@be-link/pos-cli-nodejs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "正向订单服务Nodejs客户端",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/jest": "29.5.6",
|
|
27
|
-
"@types/node": "
|
|
27
|
+
"@types/node": "20.8.9",
|
|
28
28
|
"jest": "29.7.0",
|
|
29
29
|
"ts-jest": "29.1.1",
|
|
30
|
-
"typedoc": "
|
|
31
|
-
"typedoc-plugin-missing-exports": "
|
|
30
|
+
"typedoc": "0.25.2",
|
|
31
|
+
"typedoc-plugin-missing-exports": "2.1.0",
|
|
32
32
|
"typescript": "5.2.2"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
package/pos/http.js
CHANGED
|
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
8
8
|
const PosError_1 = __importDefault(require("../errors/PosError"));
|
|
9
9
|
async function callApi(url, ...request) {
|
|
10
10
|
try {
|
|
11
|
-
const response = await axios_1.default.post(url, request);
|
|
11
|
+
const response = await axios_1.default.post(url, request[0]);
|
|
12
12
|
const responseData = response.data;
|
|
13
13
|
return responseData.data;
|
|
14
14
|
}
|
package/pos/modules/service.js
CHANGED
|
@@ -14,17 +14,17 @@ class BaseService {
|
|
|
14
14
|
this.publicDevHost = 'https://pos-app-74680-5-1304510571.sh.run.tcloudbase.com';
|
|
15
15
|
this.publicProdHost = '';
|
|
16
16
|
/** 如果是云函数环境, 默认走公网访问 */
|
|
17
|
-
this.isPublicEnv = process.env.CONTAINER_ENV === 'SFC';
|
|
17
|
+
this.isPublicEnv = (process.env.CONTAINER_ENV || 'SCF') === 'SFC';
|
|
18
18
|
}
|
|
19
19
|
/** 获取API URL */
|
|
20
20
|
getApiUrl(func) {
|
|
21
21
|
const host = this.isPublicEnv
|
|
22
22
|
? env_1.default.isProduction()
|
|
23
|
-
? this.
|
|
24
|
-
: this.
|
|
23
|
+
? this.publicProdHost
|
|
24
|
+
: this.publicDevHost
|
|
25
25
|
: env_1.default.isProduction()
|
|
26
|
-
? this.
|
|
27
|
-
: this.
|
|
26
|
+
? this.natProdHost
|
|
27
|
+
: this.natDevHost;
|
|
28
28
|
return `${host}${this.prefixUrl}/${(0, string_1.camelToKebabCase)(func.name)}`;
|
|
29
29
|
}
|
|
30
30
|
}
|