@be-link/ecommerce-backend-bff-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.
@@ -23,6 +23,7 @@ export declare namespace MiniprogramUserService {
23
23
  status: string;
24
24
  hasAllStore: boolean;
25
25
  hasAllWarehouse: boolean;
26
+ storeCount: number;
26
27
  stores?: Array<{
27
28
  id: string;
28
29
  name: string;
@@ -17,4 +17,5 @@ export declare class PandoraFranchiseeService extends BaseService implements Ser
17
17
  getFranchiseeIdByUserId(request: Service.Request.getFranchiseeIdByUserId): Promise<StandardResponse<Service.Response.getFranchiseeIdByUserId>>;
18
18
  updateStatus(request: Service.Request.updateStatus): Promise<StandardResponse<Service.Response.updateStatus>>;
19
19
  listFranchiseeOptions(request: Service.Request.franchiseeOptions): Promise<StandardResponse<Service.Response.franchiseeOptions>>;
20
+ exportFranchiseeListToExcel(request: Service.Request.exportFranchiseeListToExcel): Promise<StandardResponse<Service.Response.exportFranchiseeListToExcel>>;
20
21
  }
@@ -42,5 +42,8 @@ class PandoraFranchiseeService extends BaseService_1.default {
42
42
  listFranchiseeOptions(request) {
43
43
  return this.request(this.listFranchiseeOptions, request);
44
44
  }
45
+ exportFranchiseeListToExcel(request) {
46
+ return this.request(this.exportFranchiseeListToExcel, request);
47
+ }
45
48
  }
46
49
  exports.PandoraFranchiseeService = PandoraFranchiseeService;
@@ -92,6 +92,21 @@ export declare namespace PandoraFranchiseeService {
92
92
  interface franchiseeOptions {
93
93
  name?: string;
94
94
  }
95
+ /**
96
+ * 导出加盟商列表
97
+ */
98
+ interface exportFranchiseeListToExcel {
99
+ name?: string;
100
+ directorName?: string;
101
+ directorPhone?: string;
102
+ bdDirector?: string;
103
+ status?: 'VALID' | 'INVALID';
104
+ approvalStatus?: string;
105
+ financeGroup?: string;
106
+ storeIds?: string[];
107
+ pageIndex?: number;
108
+ pageSize?: number;
109
+ }
95
110
  }
96
111
  namespace Response {
97
112
  /**
@@ -203,6 +218,13 @@ export declare namespace PandoraFranchiseeService {
203
218
  name: string;
204
219
  }>;
205
220
  }
221
+ /**
222
+ * 导出加盟商列表响应
223
+ */
224
+ interface exportFranchiseeListToExcel {
225
+ headerMap: Record<string, string>;
226
+ data: Record<string, any>[];
227
+ }
206
228
  }
207
229
  /**
208
230
  * Franchisee Controller 接口定义
@@ -217,5 +239,6 @@ export declare namespace PandoraFranchiseeService {
217
239
  getFranchiseeIdByUserId(request: Request.getFranchiseeIdByUserId): Promise<StandardResponse<Response.getFranchiseeIdByUserId>>;
218
240
  updateStatus(request: Request.updateStatus): Promise<StandardResponse<Response.updateStatus>>;
219
241
  listFranchiseeOptions(request: Request.franchiseeOptions): Promise<StandardResponse<Response.franchiseeOptions>>;
242
+ exportFranchiseeListToExcel(request: Request.exportFranchiseeListToExcel): Promise<StandardResponse<Response.exportFranchiseeListToExcel>>;
220
243
  }
221
244
  }
@@ -228,6 +228,8 @@ export declare namespace PandoraProductService {
228
228
  pageSize: number;
229
229
  /** 商品Id列表 */
230
230
  productIds?: string[];
231
+ /** 直播分组ids */
232
+ liveGroupIds?: string[];
231
233
  /** 商品名称列表 */
232
234
  productNames?: string[];
233
235
  /** 69码列表 */
@@ -80,6 +80,7 @@ export declare namespace RoomService {
80
80
  liveStreamRoomId: string;
81
81
  /** 门店ID列表 */
82
82
  bind: string[];
83
+ operator: string;
83
84
  }
84
85
  /**
85
86
  * 根据门店绑定关系查询直播间列表
@@ -141,6 +141,7 @@ export declare namespace PandoraUserService {
141
141
  status: string;
142
142
  hasAllStore: boolean;
143
143
  hasAllWarehouse: boolean;
144
+ storeCount: number;
144
145
  stores?: Array<{
145
146
  id: string;
146
147
  name: string;
@@ -10,4 +10,5 @@ export declare class PandoraUserManagementService extends BaseService implements
10
10
  bindUsersToStore(request: PandoraUserManagementTypes.Request.bindUsersToStore): Promise<StandardResponse<PandoraUserManagementTypes.Response.bindUsersToStore>>;
11
11
  unbindUsersFromStore(request: PandoraUserManagementTypes.Request.unbindUsersFromStore): Promise<StandardResponse<PandoraUserManagementTypes.Response.unbindUsersFromStore>>;
12
12
  getUserByUnionId(request: PandoraUserManagementTypes.Request.getUserByUnionId): Promise<StandardResponse<PandoraUserManagementTypes.Response.getUserByUnionId>>;
13
+ batchTransferUsersStore(request: PandoraUserManagementTypes.Request.batchTransferUsersStore): Promise<StandardResponse<PandoraUserManagementTypes.Response.batchTransferUsersStore>>;
13
14
  }
@@ -31,5 +31,8 @@ class PandoraUserManagementService extends BaseService_1.default {
31
31
  getUserByUnionId(request) {
32
32
  return this.request(this.getUserByUnionId, request);
33
33
  }
34
+ batchTransferUsersStore(request) {
35
+ return this.request(this.batchTransferUsersStore, request);
36
+ }
34
37
  }
35
38
  exports.PandoraUserManagementService = PandoraUserManagementService;
@@ -15,5 +15,6 @@ export declare namespace PandoraUserManagementTypes {
15
15
  bindUsersToStore(request: Request.bindUsersToStore): Promise<StandardResponse<Response.bindUsersToStore>>;
16
16
  unbindUsersFromStore(request: Request.unbindUsersFromStore): Promise<StandardResponse<Response.unbindUsersFromStore>>;
17
17
  getUserByUnionId(request: Request.getUserByUnionId): Promise<StandardResponse<Response.getUserByUnionId>>;
18
+ batchTransferUsersStore(request: Request.batchTransferUsersStore): Promise<StandardResponse<Response.batchTransferUsersStore>>;
18
19
  }
19
20
  }
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.MiniProgramRequestStrategy = exports.WebRequestStrategy = exports.BaseRequestStrategy = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
+ const safe_stable_stringify_1 = __importDefault(require("safe-stable-stringify"));
8
9
  const errors_1 = require("../../errors");
9
10
  const env_1 = require("../../utils/env");
10
11
  /**
@@ -40,7 +41,7 @@ class WebRequestStrategy extends BaseRequestStrategy {
40
41
  const url = `${(0, env_1.getContainerHost)(this.environment)}${path}`;
41
42
  try {
42
43
  if (console?.info) {
43
- console.info(`[SDK][${requestId}] 发起请求: ${url}`, data ? `参数: ${JSON.stringify(data)}` : '');
44
+ console.info(`[SDK][${requestId}] 发起请求: ${url}`, data ? `参数: ${(0, safe_stable_stringify_1.default)(data)}` : '');
44
45
  }
45
46
  const response = await axios_1.default.post(url, data, {
46
47
  headers,
@@ -75,7 +76,7 @@ class WebRequestStrategy extends BaseRequestStrategy {
75
76
  console.error(`[SDK][${requestId}] Axios 错误: ${message}`);
76
77
  if (axiosError.response) {
77
78
  console.error(`[SDK][${requestId}] 响应状态: ${axiosError.response.status}`);
78
- console.error(`[SDK][${requestId}] 响应数据:`, JSON.stringify(axiosError.response.data));
79
+ console.error(`[SDK][${requestId}] 响应数据:`, (0, safe_stable_stringify_1.default)(axiosError.response.data));
79
80
  }
80
81
  else {
81
82
  console.error(`[SDK][${requestId}] 错误信息: ${axiosError.message}`);
@@ -128,7 +129,7 @@ class MiniProgramRequestStrategy extends BaseRequestStrategy {
128
129
  // 构造完整的 URL
129
130
  const url = `${(0, env_1.getContainerHost)(this.environment)}${path}`;
130
131
  if (console?.info) {
131
- console.info(`[SDK][${requestId}] 发起小程序请求: ${url}`, data ? `参数: ${JSON.stringify(data)}` : '');
132
+ console.info(`[SDK][${requestId}] 发起小程序请求: ${url}`, data ? `参数: ${(0, safe_stable_stringify_1.default)(data)}` : '');
132
133
  }
133
134
  // 使用 Promise 包装 wx.request
134
135
  const response = await new Promise((resolve, reject) => {
@@ -155,7 +156,7 @@ class MiniProgramRequestStrategy extends BaseRequestStrategy {
155
156
  // 非 2xx 状态码
156
157
  const errorMessage = response.data?.message || '请求失败';
157
158
  if (console?.error) {
158
- console.error(`[SDK][${requestId}] HTTP 错误: ${errorMessage}`, `状态码: ${response.statusCode}`, `响应数据: ${JSON.stringify(response.data)}`);
159
+ console.error(`[SDK][${requestId}] HTTP 错误: ${errorMessage}`, `状态码: ${response.statusCode}`, `响应数据: ${(0, safe_stable_stringify_1.default)(response.data)}`);
159
160
  }
160
161
  const ErrorClass = response.statusCode >= 400 && response.statusCode < 500 ? errors_1.BizError : errors_1.SystemError;
161
162
  throw new ErrorClass(errorMessage, response.statusCode);
package/cjs/utils/http.js CHANGED
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.callApi = callApi;
7
7
  const axios_1 = __importDefault(require("axios"));
8
+ const safe_stable_stringify_1 = __importDefault(require("safe-stable-stringify"));
8
9
  /**
9
10
  * 生成简单的请求 ID
10
11
  */
@@ -18,7 +19,7 @@ function generateRequestId() {
18
19
  async function callApi(url, request) {
19
20
  const requestId = generateRequestId();
20
21
  try {
21
- console.info(`准备发起ecommerce-backend-bff-service请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
22
+ console.info(`准备发起ecommerce-backend-bff-service请求[${requestId}]: ${url}, 参数: ${(0, safe_stable_stringify_1.default)(request)}`);
22
23
  const response = await axios_1.default.post(url, request, { headers: { 'x-request-id': requestId } });
23
24
  const responseData = response.data;
24
25
  return responseData.data;
@@ -30,7 +31,7 @@ async function callApi(url, request) {
30
31
  const data = response.data;
31
32
  console.error(`ecommerce-backend-bff-service 异常: ${axiosError.message},requestId: ${requestId}`);
32
33
  console.info('响应信息', data.message);
33
- console.error('异常堆栈', JSON.stringify(error.stack));
34
+ console.error('异常堆栈', (0, safe_stable_stringify_1.default)(error.stack));
34
35
  throw error;
35
36
  }
36
37
  console.error(`ecommerce-backend-bff-service 未知异常: ${axiosError.message}`, error.stack);
@@ -23,6 +23,7 @@ export declare namespace MiniprogramUserService {
23
23
  status: string;
24
24
  hasAllStore: boolean;
25
25
  hasAllWarehouse: boolean;
26
+ storeCount: number;
26
27
  stores?: Array<{
27
28
  id: string;
28
29
  name: string;
@@ -17,4 +17,5 @@ export declare class PandoraFranchiseeService extends BaseService implements Ser
17
17
  getFranchiseeIdByUserId(request: Service.Request.getFranchiseeIdByUserId): Promise<StandardResponse<Service.Response.getFranchiseeIdByUserId>>;
18
18
  updateStatus(request: Service.Request.updateStatus): Promise<StandardResponse<Service.Response.updateStatus>>;
19
19
  listFranchiseeOptions(request: Service.Request.franchiseeOptions): Promise<StandardResponse<Service.Response.franchiseeOptions>>;
20
+ exportFranchiseeListToExcel(request: Service.Request.exportFranchiseeListToExcel): Promise<StandardResponse<Service.Response.exportFranchiseeListToExcel>>;
20
21
  }
@@ -36,4 +36,7 @@ export class PandoraFranchiseeService extends BaseService {
36
36
  listFranchiseeOptions(request) {
37
37
  return this.request(this.listFranchiseeOptions, request);
38
38
  }
39
+ exportFranchiseeListToExcel(request) {
40
+ return this.request(this.exportFranchiseeListToExcel, request);
41
+ }
39
42
  }
@@ -92,6 +92,21 @@ export declare namespace PandoraFranchiseeService {
92
92
  interface franchiseeOptions {
93
93
  name?: string;
94
94
  }
95
+ /**
96
+ * 导出加盟商列表
97
+ */
98
+ interface exportFranchiseeListToExcel {
99
+ name?: string;
100
+ directorName?: string;
101
+ directorPhone?: string;
102
+ bdDirector?: string;
103
+ status?: 'VALID' | 'INVALID';
104
+ approvalStatus?: string;
105
+ financeGroup?: string;
106
+ storeIds?: string[];
107
+ pageIndex?: number;
108
+ pageSize?: number;
109
+ }
95
110
  }
96
111
  namespace Response {
97
112
  /**
@@ -203,6 +218,13 @@ export declare namespace PandoraFranchiseeService {
203
218
  name: string;
204
219
  }>;
205
220
  }
221
+ /**
222
+ * 导出加盟商列表响应
223
+ */
224
+ interface exportFranchiseeListToExcel {
225
+ headerMap: Record<string, string>;
226
+ data: Record<string, any>[];
227
+ }
206
228
  }
207
229
  /**
208
230
  * Franchisee Controller 接口定义
@@ -217,5 +239,6 @@ export declare namespace PandoraFranchiseeService {
217
239
  getFranchiseeIdByUserId(request: Request.getFranchiseeIdByUserId): Promise<StandardResponse<Response.getFranchiseeIdByUserId>>;
218
240
  updateStatus(request: Request.updateStatus): Promise<StandardResponse<Response.updateStatus>>;
219
241
  listFranchiseeOptions(request: Request.franchiseeOptions): Promise<StandardResponse<Response.franchiseeOptions>>;
242
+ exportFranchiseeListToExcel(request: Request.exportFranchiseeListToExcel): Promise<StandardResponse<Response.exportFranchiseeListToExcel>>;
220
243
  }
221
244
  }
@@ -228,6 +228,8 @@ export declare namespace PandoraProductService {
228
228
  pageSize: number;
229
229
  /** 商品Id列表 */
230
230
  productIds?: string[];
231
+ /** 直播分组ids */
232
+ liveGroupIds?: string[];
231
233
  /** 商品名称列表 */
232
234
  productNames?: string[];
233
235
  /** 69码列表 */
@@ -80,6 +80,7 @@ export declare namespace RoomService {
80
80
  liveStreamRoomId: string;
81
81
  /** 门店ID列表 */
82
82
  bind: string[];
83
+ operator: string;
83
84
  }
84
85
  /**
85
86
  * 根据门店绑定关系查询直播间列表
@@ -141,6 +141,7 @@ export declare namespace PandoraUserService {
141
141
  status: string;
142
142
  hasAllStore: boolean;
143
143
  hasAllWarehouse: boolean;
144
+ storeCount: number;
144
145
  stores?: Array<{
145
146
  id: string;
146
147
  name: string;
@@ -10,4 +10,5 @@ export declare class PandoraUserManagementService extends BaseService implements
10
10
  bindUsersToStore(request: PandoraUserManagementTypes.Request.bindUsersToStore): Promise<StandardResponse<PandoraUserManagementTypes.Response.bindUsersToStore>>;
11
11
  unbindUsersFromStore(request: PandoraUserManagementTypes.Request.unbindUsersFromStore): Promise<StandardResponse<PandoraUserManagementTypes.Response.unbindUsersFromStore>>;
12
12
  getUserByUnionId(request: PandoraUserManagementTypes.Request.getUserByUnionId): Promise<StandardResponse<PandoraUserManagementTypes.Response.getUserByUnionId>>;
13
+ batchTransferUsersStore(request: PandoraUserManagementTypes.Request.batchTransferUsersStore): Promise<StandardResponse<PandoraUserManagementTypes.Response.batchTransferUsersStore>>;
13
14
  }
@@ -25,4 +25,7 @@ export class PandoraUserManagementService extends BaseService {
25
25
  getUserByUnionId(request) {
26
26
  return this.request(this.getUserByUnionId, request);
27
27
  }
28
+ batchTransferUsersStore(request) {
29
+ return this.request(this.batchTransferUsersStore, request);
30
+ }
28
31
  }
@@ -15,5 +15,6 @@ export declare namespace PandoraUserManagementTypes {
15
15
  bindUsersToStore(request: Request.bindUsersToStore): Promise<StandardResponse<Response.bindUsersToStore>>;
16
16
  unbindUsersFromStore(request: Request.unbindUsersFromStore): Promise<StandardResponse<Response.unbindUsersFromStore>>;
17
17
  getUserByUnionId(request: Request.getUserByUnionId): Promise<StandardResponse<Response.getUserByUnionId>>;
18
+ batchTransferUsersStore(request: Request.batchTransferUsersStore): Promise<StandardResponse<Response.batchTransferUsersStore>>;
18
19
  }
19
20
  }
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios';
2
+ import stringify from 'safe-stable-stringify';
2
3
  import { SdkError, BizError, SystemError } from '../../errors/index.mjs';
3
4
  import { getContainerHost } from '../../utils/env.mjs';
4
5
  /**
@@ -33,7 +34,7 @@ export class WebRequestStrategy extends BaseRequestStrategy {
33
34
  const url = `${getContainerHost(this.environment)}${path}`;
34
35
  try {
35
36
  if (console?.info) {
36
- console.info(`[SDK][${requestId}] 发起请求: ${url}`, data ? `参数: ${JSON.stringify(data)}` : '');
37
+ console.info(`[SDK][${requestId}] 发起请求: ${url}`, data ? `参数: ${stringify(data)}` : '');
37
38
  }
38
39
  const response = await axios.post(url, data, {
39
40
  headers,
@@ -68,7 +69,7 @@ export class WebRequestStrategy extends BaseRequestStrategy {
68
69
  console.error(`[SDK][${requestId}] Axios 错误: ${message}`);
69
70
  if (axiosError.response) {
70
71
  console.error(`[SDK][${requestId}] 响应状态: ${axiosError.response.status}`);
71
- console.error(`[SDK][${requestId}] 响应数据:`, JSON.stringify(axiosError.response.data));
72
+ console.error(`[SDK][${requestId}] 响应数据:`, stringify(axiosError.response.data));
72
73
  }
73
74
  else {
74
75
  console.error(`[SDK][${requestId}] 错误信息: ${axiosError.message}`);
@@ -120,7 +121,7 @@ export class MiniProgramRequestStrategy extends BaseRequestStrategy {
120
121
  // 构造完整的 URL
121
122
  const url = `${getContainerHost(this.environment)}${path}`;
122
123
  if (console?.info) {
123
- console.info(`[SDK][${requestId}] 发起小程序请求: ${url}`, data ? `参数: ${JSON.stringify(data)}` : '');
124
+ console.info(`[SDK][${requestId}] 发起小程序请求: ${url}`, data ? `参数: ${stringify(data)}` : '');
124
125
  }
125
126
  // 使用 Promise 包装 wx.request
126
127
  const response = await new Promise((resolve, reject) => {
@@ -147,7 +148,7 @@ export class MiniProgramRequestStrategy extends BaseRequestStrategy {
147
148
  // 非 2xx 状态码
148
149
  const errorMessage = response.data?.message || '请求失败';
149
150
  if (console?.error) {
150
- console.error(`[SDK][${requestId}] HTTP 错误: ${errorMessage}`, `状态码: ${response.statusCode}`, `响应数据: ${JSON.stringify(response.data)}`);
151
+ console.error(`[SDK][${requestId}] HTTP 错误: ${errorMessage}`, `状态码: ${response.statusCode}`, `响应数据: ${stringify(response.data)}`);
151
152
  }
152
153
  const ErrorClass = response.statusCode >= 400 && response.statusCode < 500 ? BizError : SystemError;
153
154
  throw new ErrorClass(errorMessage, response.statusCode);
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios';
2
+ import stringify from 'safe-stable-stringify';
2
3
  /**
3
4
  * 生成简单的请求 ID
4
5
  */
@@ -12,7 +13,7 @@ function generateRequestId() {
12
13
  export async function callApi(url, request) {
13
14
  const requestId = generateRequestId();
14
15
  try {
15
- console.info(`准备发起ecommerce-backend-bff-service请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
16
+ console.info(`准备发起ecommerce-backend-bff-service请求[${requestId}]: ${url}, 参数: ${stringify(request)}`);
16
17
  const response = await axios.post(url, request, { headers: { 'x-request-id': requestId } });
17
18
  const responseData = response.data;
18
19
  return responseData.data;
@@ -24,7 +25,7 @@ export async function callApi(url, request) {
24
25
  const data = response.data;
25
26
  console.error(`ecommerce-backend-bff-service 异常: ${axiosError.message},requestId: ${requestId}`);
26
27
  console.info('响应信息', data.message);
27
- console.error('异常堆栈', JSON.stringify(error.stack));
28
+ console.error('异常堆栈', stringify(error.stack));
28
29
  throw error;
29
30
  }
30
31
  console.error(`ecommerce-backend-bff-service 未知异常: ${axiosError.message}`, error.stack);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-backend-bff-service-node-sdk",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "EcommerceBackendBffService Node.js SDK",
5
5
  "type": "commonjs",
6
6
  "main": "./cjs/index.js",
@@ -24,17 +24,18 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@be-link/ecommerce-trade-service-node-sdk": "^0.1.47",
27
+ "@be-link/ecommerce-trade-service-node-sdk": "^0.1.54",
28
28
  "@be-link/ecommerce-backend-user-service-node-sdk": "^0.1.11",
29
29
  "@be-link/ecommerce-volcengine-open-api-sdk": "^1.0.22",
30
- "@be-link/ecommerce-client-backend-service-node-sdk": "^0.1.18",
30
+ "@be-link/ecommerce-client-backend-service-node-sdk": "^0.1.28",
31
31
  "@be-link/ecommerce-tag-service-node-sdk": "^0.1.1",
32
32
  "@be-link/ecommerce-store-service-node-sdk": "^0.1.8",
33
33
  "@be-link/ecommerce-promotion-service-node-sdk": "^0.1.3",
34
34
  "axios": "^1.13.2",
35
- "@be-link/ecommerce-user-service-node-sdk": "^0.1.30",
36
- "@be-link/ecommerce-product-service-node-sdk": "^0.1.10",
37
- "@be-link/ecommerce-task-center-service-node-sdk": "^0.1.12"
35
+ "@be-link/ecommerce-user-service-node-sdk": "^0.1.34",
36
+ "@be-link/ecommerce-product-service-node-sdk": "^0.1.13",
37
+ "safe-stable-stringify": "^2.5.0",
38
+ "@be-link/ecommerce-task-center-service-node-sdk": "^0.1.13"
38
39
  },
39
40
  "devDependencies": {
40
41
  "tsoa": "^6.4.0",