@be-link/ecommerce-product-service-node-sdk 0.0.12 → 0.0.13

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.
@@ -85,7 +85,6 @@ export declare namespace ProductService {
85
85
  interface ProductData {
86
86
  productInfo: ProductInfo;
87
87
  skuList: SkuItem[];
88
- creatorId: string;
89
88
  }
90
89
  namespace Request {
91
90
  interface detail {
@@ -13,7 +13,6 @@ export declare namespace ProductExpService {
13
13
  }
14
14
  interface addSupplier {
15
15
  supplierName: string;
16
- creatorId: string;
17
16
  }
18
17
  interface getLiveGroupList {
19
18
  pageIndex: number;
@@ -22,7 +21,6 @@ export declare namespace ProductExpService {
22
21
  }
23
22
  interface addLiveGroup {
24
23
  liveGroupName: string;
25
- creatorId: string;
26
24
  }
27
25
  interface productCategoryList {
28
26
  level: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-product-service-node-sdk",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "EcommerceProductService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/utils/http.d.ts CHANGED
@@ -2,6 +2,9 @@ declare module '@fastify/request-context' {
2
2
  interface RequestContextData {
3
3
  requestId?: string;
4
4
  traceMessageId?: string;
5
+ pandoraUserId?: string;
6
+ beLinkUserId?: string;
7
+ pandoraRoleId?: string;
5
8
  }
6
9
  }
7
10
  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
@@ -56,10 +56,18 @@ const request_context_1 = require("@fastify/request-context");
56
56
  });
57
57
  async function callApi(url, request) {
58
58
  const requestId = request_context_1.requestContext.get('requestId') || request_context_1.requestContext.get('traceMessageId') || (0, uuid_1.v4)();
59
+ const pandoraUserId = request_context_1.requestContext.get('pandoraUserId') || '';
60
+ const beLinkUserId = request_context_1.requestContext.get('beLinkUserId') || '';
61
+ const pandoraRoleId = request_context_1.requestContext.get('pandoraRoleId') || '';
59
62
  try {
60
63
  console.info(`准备发起ecommerce-product-service请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
61
64
  const response = await axios_1.default.post(url, request || {}, {
62
- headers: { 'x-request-id': requestId },
65
+ headers: {
66
+ 'x-request-id': requestId,
67
+ 'x-belink-pandora-userid': pandoraUserId,
68
+ 'x-belink-userid': beLinkUserId,
69
+ 'x-belink-pandora-roleid': pandoraRoleId,
70
+ },
63
71
  });
64
72
  const responseData = response.data;
65
73
  return responseData.data;