@be-link/ecommerce-trade-service-node-sdk 0.1.51 → 0.1.53

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.
@@ -6,35 +6,16 @@ export declare namespace RosOrderQueryService {
6
6
  interface IOrderList {
7
7
  /** 查询条件 */
8
8
  conditions?: {
9
- /** 下单时间范围 */
10
- createdAt?: {
11
- start?: number;
12
- end?: number;
13
- };
14
- /** 退款操作时间范围 */
15
- operateTime?: {
16
- start?: number;
17
- end?: number;
18
- };
19
- /** 退款申请时间范围 */
20
- orderTime?: {
21
- start?: number;
22
- end?: number;
23
- };
24
- /** 退款订单状态列表 */
25
- statusList?: ENUM.ReverseOrderStatus[];
26
- /** 退款到账状态列表 */
27
- arrivalStatusList?: ENUM.ReverseArrivalStatus[];
28
- /** 退款方式列表 */
29
- wayList?: ENUM.ReverseRefundWay[];
30
- /** 退款类型列表 */
31
- typeList?: ENUM.ReverseRefundType[];
32
- /** 用户ID列表 */
33
- userIds?: string[];
34
- /** 正向订单ID列表 */
35
- orderIds?: string[];
36
- /** 门店ID列表 */
37
- storeIds?: string[];
9
+ createdAt: string;
10
+ operateTime: string;
11
+ orderTime: string;
12
+ status: ENUM.ReverseOrderStatus;
13
+ arrivalStatusList: ENUM.ReverseArrivalStatus[];
14
+ wayList: ENUM.ReverseRefundWay[];
15
+ typeList: ENUM.ReverseRefundType[];
16
+ userIds: string[];
17
+ orderIds: string[];
18
+ storeIds: string[];
38
19
  };
39
20
  /** 分页 */
40
21
  pagination: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-trade-service-node-sdk",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "EcommerceTradeService Node.js SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,9 @@
13
13
  "@fastify/request-context": "6.2.1",
14
14
  "axios": "1.13.2",
15
15
  "axios-retry": "4.0.0",
16
- "uuid": "9.0.1",
17
- "tsoa": "^6.6.0"
16
+ "safe-stable-stringify": "^2.5.0",
17
+ "tsoa": "^6.6.0",
18
+ "uuid": "9.0.1"
18
19
  },
19
20
  "scripts": {
20
21
  "build": "rm -rf ./dist && tsc && cp package.json README.md ./dist/ 2>/dev/null || true",
package/types.d.ts CHANGED
@@ -154,7 +154,6 @@ export interface ITradeReverseOrder {
154
154
  isFullRefund: number;
155
155
  createdAt: number;
156
156
  updatedAt: number;
157
- orderItemIds: string[];
158
157
  }
159
158
  /** 资源扩展信息类型 */
160
159
  export interface IBizExtraInfo {
package/utils/http.js CHANGED
@@ -41,6 +41,7 @@ const axios_1 = __importDefault(require("axios"));
41
41
  const uuid_1 = require("uuid");
42
42
  const axios_retry_1 = __importDefault(require("axios-retry"));
43
43
  const request_context_1 = require("@fastify/request-context");
44
+ const safe_stable_stringify_1 = __importDefault(require("safe-stable-stringify"));
44
45
  (0, axios_retry_1.default)(axios_1.default, {
45
46
  retries: 1,
46
47
  retryCondition(error) {
@@ -51,7 +52,7 @@ const request_context_1 = require("@fastify/request-context");
51
52
  return retryCount * 500;
52
53
  },
53
54
  onRetry(retryCount, error, requestConfig) {
54
- console.info(`retryCount: ${retryCount}, onRetry: ${error.message}, requestHeader: ${JSON.stringify(requestConfig.headers)}`);
55
+ console.info(`retryCount: ${retryCount}, onRetry: ${error.message}, requestHeader: ${(0, safe_stable_stringify_1.default)(requestConfig.headers)}`);
55
56
  },
56
57
  });
57
58
  async function callApi(url, request) {
@@ -61,7 +62,7 @@ async function callApi(url, request) {
61
62
  const pandoraRoleId = request_context_1.requestContext.get('pandoraRoleId') || '';
62
63
  const realIp = request_context_1.requestContext.get('realIp') || '';
63
64
  try {
64
- console.info(`准备发起ecommerce-trade-service请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
65
+ console.info(`准备发起ecommerce-trade-service请求[${requestId}]: ${url}, 参数: ${(0, safe_stable_stringify_1.default)(request)}`);
65
66
  const response = await axios_1.default.post(url, request, {
66
67
  headers: {
67
68
  'x-request-id': requestId,
@@ -81,7 +82,7 @@ async function callApi(url, request) {
81
82
  const data = response.data;
82
83
  console.error(`ecommerce-trade-service 异常: ${axiosError.message},requestId: ${requestId}`);
83
84
  console.info('响应信息', data.message);
84
- console.error('异常堆栈', JSON.stringify(error.stack));
85
+ console.error('异常堆栈', (0, safe_stable_stringify_1.default)(error.stack));
85
86
  // throw new Error(data.errorType + ' - ' + data.message)
86
87
  throw error;
87
88
  }
@@ -93,16 +94,16 @@ async function callApi(url, request) {
93
94
  console.error(err.message);
94
95
  reject(err);
95
96
  }
96
- console.info(`lookup: ${JSON.stringify(lookupRes)}`);
97
+ console.info(`lookup: ${(0, safe_stable_stringify_1.default)(lookupRes)}`);
97
98
  resolve(address);
98
99
  });
99
100
  });
100
101
  try {
101
102
  const address = await dnsPromise;
102
- console.info(`address: ${JSON.stringify(address)}`);
103
+ console.info(`address: ${(0, safe_stable_stringify_1.default)(address)}`);
103
104
  }
104
105
  catch (error) {
105
- console.info(`error: ${JSON.stringify(error)}`);
106
+ console.info(`error: ${(0, safe_stable_stringify_1.default)(error)}`);
106
107
  }
107
108
  console.error(`ecommerce-trade-service 未知异常: ${axiosError.message}`, error.stack);
108
109
  throw error;