@be-link/pos-cli-nodejs 1.0.214 → 1.0.217
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@be-link/pos-cli-nodejs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.217",
|
|
4
4
|
"description": "正向订单服务Nodejs客户端",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"axios-retry": "^4.0.0",
|
|
43
43
|
"lodash": "4.17.21",
|
|
44
44
|
"uuid": "^9.0.1",
|
|
45
|
-
"vitality-meta": "1.0.
|
|
45
|
+
"vitality-meta": "1.0.238"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "rm -rf ./dist && tsc && cp package.json README.md ./dist/",
|
package/pos/http.js
CHANGED
|
@@ -26,24 +26,20 @@ const axiosInstance = axios_1.default.create({
|
|
|
26
26
|
(0, axios_retry_1.default)(axiosInstance, {
|
|
27
27
|
retries: 1,
|
|
28
28
|
retryCondition(error) {
|
|
29
|
-
console.info('errorMessage', error.message);
|
|
30
|
-
console.info('errorResponse', error.response ? error.response.data : null);
|
|
31
29
|
const isSocketHangUp = error.message.includes('socket hang up');
|
|
32
30
|
return isSocketHangUp || error.message.includes('getaddrinfo ENOTFOUND') || (Boolean(error.response) && [502, 503].includes(error.response.status));
|
|
33
31
|
},
|
|
34
|
-
retryDelay: (retryCount,
|
|
35
|
-
console.info(`retryCount: ${retryCount}, retryDelay: ${retryCount * 500}`);
|
|
32
|
+
retryDelay: (retryCount, _error) => {
|
|
36
33
|
return retryCount * 500;
|
|
37
34
|
},
|
|
38
|
-
onRetry(
|
|
39
|
-
|
|
35
|
+
onRetry(_retryCount, _error, _requestConfig) {
|
|
36
|
+
// onRetry handler
|
|
40
37
|
},
|
|
41
38
|
});
|
|
42
39
|
function callApi(url, ...request) {
|
|
43
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
41
|
const requestId = (0, uuid_1.v4)();
|
|
45
42
|
try {
|
|
46
|
-
console.info(`准备发起POS请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
|
|
47
43
|
const response = yield axiosInstance.post(url, request[0], {
|
|
48
44
|
headers: {
|
|
49
45
|
'X-Request-Id': requestId,
|
|
@@ -65,7 +61,6 @@ function callApi(url, ...request) {
|
|
|
65
61
|
const response = axiosError.response;
|
|
66
62
|
const data = response.data;
|
|
67
63
|
console.error(`POS 异常[${requestId}]: ${axiosError.message}`);
|
|
68
|
-
console.info('响应信息', data.message);
|
|
69
64
|
console.error('异常堆栈', JSON.stringify(error.stack));
|
|
70
65
|
throw new ErrorClass(data.message || 'Pos Error', response.status);
|
|
71
66
|
}
|
|
@@ -5,6 +5,7 @@ declare class OrderAbnormalFollowService extends BaseService implements Service.
|
|
|
5
5
|
upsertFollow(request: Service.Request.upsertFollow): Promise<void>;
|
|
6
6
|
listByOrderIds(request: Service.Request.listByOrderIds): Promise<Service.Response.listByOrderIds>;
|
|
7
7
|
markUserReminded(request: Service.Request.markUserReminded): Promise<boolean>;
|
|
8
|
+
createHotelChangeFollow(request: Service.Request.createHotelChangeFollow): Promise<void>;
|
|
8
9
|
softDelete(request: Service.Request.softDelete): Promise<void>;
|
|
9
10
|
countByTypeInScope(request: Service.Request.countByTypeInScope): Promise<number>;
|
|
10
11
|
}
|
|
@@ -19,6 +19,9 @@ class OrderAbnormalFollowService extends service_1.default {
|
|
|
19
19
|
markUserReminded(request) {
|
|
20
20
|
return (0, http_1.callApi)(this.getApiUrl(this.markUserReminded), request);
|
|
21
21
|
}
|
|
22
|
+
createHotelChangeFollow(request) {
|
|
23
|
+
return (0, http_1.callApi)(this.getApiUrl(this.createHotelChangeFollow), request);
|
|
24
|
+
}
|
|
22
25
|
softDelete(request) {
|
|
23
26
|
return (0, http_1.callApi)(this.getApiUrl(this.softDelete), request);
|
|
24
27
|
}
|
|
@@ -15,9 +15,19 @@ export declare namespace Service {
|
|
|
15
15
|
}
|
|
16
16
|
interface markUserReminded {
|
|
17
17
|
orderId: string;
|
|
18
|
-
abnormalType: AbnormalType.APPEND_FAILED | AbnormalType.UPCOMING;
|
|
18
|
+
abnormalType: AbnormalType.APPEND_FAILED | AbnormalType.UPCOMING | AbnormalType.HOTEL_ORDER_CHANGE;
|
|
19
19
|
followUnionId: string;
|
|
20
20
|
}
|
|
21
|
+
interface createHotelChangeFollow {
|
|
22
|
+
orderId: string;
|
|
23
|
+
followUnionId?: string;
|
|
24
|
+
changeFlowId: string;
|
|
25
|
+
changeType: string;
|
|
26
|
+
changeStatus: string;
|
|
27
|
+
changeContent: string;
|
|
28
|
+
rejectReason?: string;
|
|
29
|
+
processedAt: number;
|
|
30
|
+
}
|
|
21
31
|
interface softDelete {
|
|
22
32
|
orderId: string;
|
|
23
33
|
abnormalType: AbnormalType;
|
|
@@ -47,6 +57,11 @@ export declare namespace Service {
|
|
|
47
57
|
* @path /abnormal-follow/mark-user-reminded
|
|
48
58
|
*/
|
|
49
59
|
markUserReminded(request: Request.markUserReminded): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* 写入酒店订单变更异常跟进记录
|
|
62
|
+
* @path /abnormal-follow/create-hotel-change-follow
|
|
63
|
+
*/
|
|
64
|
+
createHotelChangeFollow(request: Request.createHotelChangeFollow): Promise<void>;
|
|
50
65
|
/**
|
|
51
66
|
* 软删除跟进记录
|
|
52
67
|
* @path /abnormal-follow/soft-delete
|
|
@@ -603,6 +603,8 @@ export declare namespace Service {
|
|
|
603
603
|
pageIndex?: number;
|
|
604
604
|
/** 商品id */
|
|
605
605
|
itemIdList?: string[];
|
|
606
|
+
/** 商品名称 */
|
|
607
|
+
itemName?: string;
|
|
606
608
|
};
|
|
607
609
|
/** 排序 */
|
|
608
610
|
sort: {
|
|
@@ -719,6 +721,8 @@ export declare namespace Service {
|
|
|
719
721
|
supplierIdList?: string[];
|
|
720
722
|
/** 商品id */
|
|
721
723
|
itemIdList?: string[];
|
|
724
|
+
/** 商品名称 */
|
|
725
|
+
itemName?: string;
|
|
722
726
|
}
|
|
723
727
|
interface getOrderCount {
|
|
724
728
|
/** 状态 */
|
package/types.d.ts
CHANGED
|
@@ -1360,4 +1360,10 @@ export interface IOrderAbnormalFollowRow {
|
|
|
1360
1360
|
createdAt: number;
|
|
1361
1361
|
updatedAt: number;
|
|
1362
1362
|
deletedAt: number;
|
|
1363
|
+
changeFlowId?: string;
|
|
1364
|
+
changeType?: string;
|
|
1365
|
+
changeStatus?: string;
|
|
1366
|
+
changeContent?: string;
|
|
1367
|
+
rejectReason?: string;
|
|
1368
|
+
processedAt?: number;
|
|
1363
1369
|
}
|