@be-link/flow-cli-nodejs 0.0.2 → 0.0.3
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/flow/http.js +4 -4
- package/index.d.ts +2 -2
- package/index.js +3 -3
- package/package.json +1 -1
package/flow/http.js
CHANGED
|
@@ -48,7 +48,7 @@ const axios_retry_1 = __importDefault(require("axios-retry"));
|
|
|
48
48
|
async function callApi(url, ...request) {
|
|
49
49
|
const requestId = (0, uuid_1.v4)();
|
|
50
50
|
try {
|
|
51
|
-
console.info(`准备发起
|
|
51
|
+
console.info(`准备发起FLOW请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
|
|
52
52
|
const response = await axios_1.default.post(url, request[0], {
|
|
53
53
|
headers: {
|
|
54
54
|
'X-Request-Id': requestId
|
|
@@ -67,10 +67,10 @@ async function callApi(url, ...request) {
|
|
|
67
67
|
if (axiosError.response) {
|
|
68
68
|
const response = axiosError.response;
|
|
69
69
|
const data = response.data;
|
|
70
|
-
console.error(`
|
|
70
|
+
console.error(`FLOW 异常: ${axiosError.message},requestId: ${requestId}`);
|
|
71
71
|
console.info('响应信息', data.message);
|
|
72
72
|
console.error('异常堆栈', JSON.stringify(error.stack));
|
|
73
|
-
throw new ErrorClass(data.message || '
|
|
73
|
+
throw new ErrorClass(data.message || 'FLOW Error', response.status);
|
|
74
74
|
}
|
|
75
75
|
// 调用dns模块解析url
|
|
76
76
|
const dns = await Promise.resolve().then(() => __importStar(require('dns')));
|
|
@@ -91,7 +91,7 @@ async function callApi(url, ...request) {
|
|
|
91
91
|
catch (error) {
|
|
92
92
|
console.info(`error: ${JSON.stringify(error)}`);
|
|
93
93
|
}
|
|
94
|
-
console.error(`
|
|
94
|
+
console.error(`FLOW 未知异常: ${axiosError.message}`, error.stack);
|
|
95
95
|
throw error;
|
|
96
96
|
}
|
|
97
97
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as FlowConstants from 'vitality-meta/enums/flow';
|
|
2
2
|
import * as FlowDto from './types';
|
|
3
3
|
import BizError from './errors/BizError';
|
|
4
4
|
import flowCoreService from './flow/modules/bizFlowCore/service';
|
|
5
5
|
export { flowCoreService,
|
|
6
6
|
/** 业务模块 */
|
|
7
7
|
/** 枚举类 */
|
|
8
|
-
|
|
8
|
+
FlowConstants, FlowDto,
|
|
9
9
|
/** 错误类 */
|
|
10
10
|
BizError };
|
package/index.js
CHANGED
|
@@ -26,9 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.BizError = exports.FlowDto = exports.
|
|
30
|
-
const
|
|
31
|
-
exports.
|
|
29
|
+
exports.BizError = exports.FlowDto = exports.FlowConstants = exports.flowCoreService = void 0;
|
|
30
|
+
const FlowConstants = __importStar(require("vitality-meta/enums/flow"));
|
|
31
|
+
exports.FlowConstants = FlowConstants;
|
|
32
32
|
const FlowDto = __importStar(require("./types"));
|
|
33
33
|
exports.FlowDto = FlowDto;
|
|
34
34
|
const BizError_1 = __importDefault(require("./errors/BizError"));
|