@be-link/ecommerce-client-backend-service-node-sdk 0.1.37 → 0.1.39

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.
@@ -78,6 +78,47 @@ export declare namespace DataService {
78
78
  /** 事件发生时间,毫秒时间戳 */
79
79
  eventAt: number;
80
80
  }
81
+ /**
82
+ * 直播间观看任务信息分发结构
83
+ */
84
+ interface taskDurationPublish {
85
+ /** 直播间id */
86
+ liveStreamRoomId: string;
87
+ /** 任务id */
88
+ taskId: string;
89
+ /** 用户id */
90
+ userId: string;
91
+ /** 当时时间 */
92
+ currentTime: number;
93
+ /** 任务轮次时长 */
94
+ watchTime: number;
95
+ }
96
+ /**
97
+ * 用户直播间观看任务
98
+ */
99
+ interface userWatchTask {
100
+ /** 用户存储时长redis key */
101
+ userKey: string;
102
+ /** 直播间id */
103
+ liveStreamRoomId: string;
104
+ /** 当前时间 */
105
+ currentTime: number;
106
+ /** 任务 */
107
+ tasks: Task[];
108
+ }
109
+ /**
110
+ * 直播任务
111
+ */
112
+ interface Task {
113
+ id: string;
114
+ status: number;
115
+ taskStartTime: number;
116
+ taskEndTime: number;
117
+ liveStreamRoomId: string;
118
+ watchTime: number;
119
+ watchTimeRound: number;
120
+ updatedAt: number;
121
+ }
81
122
  /**
82
123
  * 根据用户id查询所在直播间信息
83
124
  */
@@ -17,6 +17,8 @@ declare class RoomServiceClass extends BaseService implements RoomService.BaseCo
17
17
  listByStoreBind(request: RoomService.Request.ListByStoreBind): Promise<RoomService.Response.ListByStoreBind>;
18
18
  /** 观看记录查询 */
19
19
  viewRecord(request: RoomService.Request.ViewRecord): Promise<RoomService.Response.ViewRecord>;
20
+ /** 门店直播规则查询 */
21
+ storeLiveStreamRule(request: RoomService.Request.StoreLiveStreamRule): Promise<RoomService.Response.StoreLiveStreamRule>;
20
22
  }
21
23
  export declare const roomService: RoomServiceClass;
22
24
  export default roomService;
@@ -59,6 +59,10 @@ let RoomServiceClass = class RoomServiceClass extends BaseService_1.default {
59
59
  viewRecord(request) {
60
60
  return (0, http_1.callApi)(this.getApiUrl(this.viewRecord), request);
61
61
  }
62
+ /** 门店直播规则查询 */
63
+ storeLiveStreamRule(request) {
64
+ return (0, http_1.callApi)(this.getApiUrl(this.storeLiveStreamRule), request);
65
+ }
62
66
  };
63
67
  __decorate([
64
68
  (0, tsoa_1.OperationId)('同步活动'),
@@ -120,6 +124,11 @@ __decorate([
120
124
  (0, tsoa_1.Post)('view-record'),
121
125
  __param(0, (0, tsoa_1.Body)())
122
126
  ], RoomServiceClass.prototype, "viewRecord", null);
127
+ __decorate([
128
+ (0, tsoa_1.OperationId)('门店直播规则查询'),
129
+ (0, tsoa_1.Post)('store-live-stream-rule'),
130
+ __param(0, (0, tsoa_1.Body)())
131
+ ], RoomServiceClass.prototype, "storeLiveStreamRule", null);
123
132
  RoomServiceClass = __decorate([
124
133
  (0, tsoa_1.Route)('room'),
125
134
  (0, tsoa_1.Tags)('Room')
@@ -61,6 +61,12 @@ export declare namespace RoomService {
61
61
  /** 直播间ID */
62
62
  liveStreamRoomId: string;
63
63
  }
64
+ interface StoreLiveStreamRule {
65
+ /** 直播间ID */
66
+ liveStreamRoomId: string;
67
+ /** 门店ID */
68
+ storeId: string;
69
+ }
64
70
  /**
65
71
  * 绑定门店
66
72
  */
@@ -185,6 +191,9 @@ export declare namespace RoomService {
185
191
  list: ViewRecordType[];
186
192
  total: number;
187
193
  }
194
+ interface StoreLiveStreamRule {
195
+ rule: boolean;
196
+ }
188
197
  }
189
198
  interface BaseController {
190
199
  sync(request: ListActivityAPIRequest): Promise<ListActivityAPIResponse>;
@@ -202,5 +211,6 @@ export declare namespace RoomService {
202
211
  */
203
212
  listByStoreBind(request: Request.ListByStoreBind, req?: FastifyRequest): Promise<Response.ListByStoreBind>;
204
213
  viewRecord(request: Request.ViewRecord, req?: FastifyRequest): Promise<Response.ViewRecord>;
214
+ storeLiveStreamRule(request: Request.StoreLiveStreamRule, req?: FastifyRequest): Promise<Response.StoreLiveStreamRule>;
205
215
  }
206
216
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-client-backend-service-node-sdk",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "EcommerceClientBackendService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/utils/http.js CHANGED
@@ -89,7 +89,7 @@ async function callApi(url, request) {
89
89
  const beLinkUserId = ctx?.get('beLinkUserId') || '';
90
90
  const pandoraRoleId = ctx?.get('pandoraRoleId') || '';
91
91
  const realIp = ctx?.get('realIp') || '';
92
- const response = await axios_1.default.post(url, request, {
92
+ const response = await axios_1.default.post(url, request || {}, {
93
93
  headers: {
94
94
  'x-request-id': requestId,
95
95
  'x-belink-pandora-userid': pandoraUserId,