@be-link/flow-cli-nodejs 0.0.24 → 0.0.25

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.
Files changed (2) hide show
  1. package/flow/http.js +4 -3
  2. package/package.json +1 -1
package/flow/http.js CHANGED
@@ -32,10 +32,11 @@ const uuid_1 = require("uuid");
32
32
  const BizError_1 = __importDefault(require("../errors/BizError"));
33
33
  const SystemError_1 = __importDefault(require("../errors/SystemError"));
34
34
  const axios_retry_1 = __importDefault(require("axios-retry"));
35
- (0, axios_retry_1.default)(axios_1.default, {
35
+ const flowAxios = axios_1.default.create();
36
+ (0, axios_retry_1.default)(flowAxios, {
36
37
  retries: 1,
37
38
  retryCondition(error) {
38
- return error.response.status === 502;
39
+ return error.response?.status === 502;
39
40
  },
40
41
  retryDelay: (retryCount, error) => {
41
42
  console.info(`retryCount: ${retryCount}, retryDelay: ${retryCount * 500}`);
@@ -49,7 +50,7 @@ async function callApi(url, ...request) {
49
50
  const requestId = (0, uuid_1.v4)();
50
51
  try {
51
52
  console.info(`准备发起FLOW请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
52
- const response = await axios_1.default.post(url, request[0], {
53
+ const response = await flowAxios.post(url, request[0], {
53
54
  headers: {
54
55
  'X-Request-Id': requestId,
55
56
  'x-belink-accessType': 'authorizationTokenInside',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/flow-cli-nodejs",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "流服务Nodejs客户端",
5
5
  "main": "index.js",
6
6
  "repository": {