@be-link/ecommerce-trade-service-node-sdk 0.0.40 → 0.0.42

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.
@@ -68,7 +68,7 @@ export declare namespace PosCoreService {
68
68
  /** 商品SKU ID */
69
69
  skuId: string;
70
70
  /** 直播间ID */
71
- liveRoomId: string;
71
+ liveRoomId?: string;
72
72
  /** 订单来源类型k */
73
73
  source: ENUM.OrderSource;
74
74
  /** 订单来源平台类型 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-trade-service-node-sdk",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "EcommerceTradeService Node.js SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/utils/http.d.ts CHANGED
@@ -5,6 +5,7 @@ declare module '@fastify/request-context' {
5
5
  pandoraUserId?: string;
6
6
  beLinkUserId?: string;
7
7
  pandoraRoleId?: string;
8
+ realIp?: string;
8
9
  }
9
10
  }
10
11
  export declare function callApi<T extends (...args: any[]) => Promise<any>>(url: string, request?: Parameters<T>[0]): Promise<Awaited<ReturnType<T>>>;
package/utils/http.js CHANGED
@@ -59,6 +59,7 @@ async function callApi(url, request) {
59
59
  const pandoraUserId = request_context_1.requestContext.get('pandoraUserId') || '';
60
60
  const beLinkUserId = request_context_1.requestContext.get('beLinkUserId') || '';
61
61
  const pandoraRoleId = request_context_1.requestContext.get('pandoraRoleId') || '';
62
+ const realIp = request_context_1.requestContext.get('realIp') || '';
62
63
  try {
63
64
  console.info(`准备发起ecommerce-trade-service请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
64
65
  const response = await axios_1.default.post(url, request, {
@@ -67,6 +68,7 @@ async function callApi(url, request) {
67
68
  'x-belink-pandora-userid': pandoraUserId,
68
69
  'x-belink-userid': beLinkUserId,
69
70
  'x-belink-pandora-roleid': pandoraRoleId,
71
+ 'x-real-ip': realIp,
70
72
  },
71
73
  });
72
74
  const responseData = response.data;