@be-link/ecommerce-client-backend-service-node-sdk 0.0.13 → 0.0.14

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.
package/enum.d.ts CHANGED
@@ -181,4 +181,15 @@ export declare namespace ENUM {
181
181
  DELETE = 2
182
182
  }
183
183
  }
184
+ namespace LIVE_STREAM_AUDIENCE {
185
+ /**
186
+ * 观看类型
187
+ */
188
+ enum VIEW_TYPE {
189
+ /** 观看直播 */
190
+ WatchLive = 0,
191
+ /** 观看回放 */
192
+ WatchReplay = 1
193
+ }
194
+ }
184
195
  }
package/enum.js CHANGED
@@ -204,4 +204,17 @@ var ENUM;
204
204
  ACTION[ACTION["DELETE"] = 2] = "DELETE";
205
205
  })(ACTION = LIVE_STREAM_TYPE.ACTION || (LIVE_STREAM_TYPE.ACTION = {}));
206
206
  })(LIVE_STREAM_TYPE = ENUM.LIVE_STREAM_TYPE || (ENUM.LIVE_STREAM_TYPE = {}));
207
+ let LIVE_STREAM_AUDIENCE;
208
+ (function (LIVE_STREAM_AUDIENCE) {
209
+ /**
210
+ * 观看类型
211
+ */
212
+ let VIEW_TYPE;
213
+ (function (VIEW_TYPE) {
214
+ /** 观看直播 */
215
+ VIEW_TYPE[VIEW_TYPE["WatchLive"] = 0] = "WatchLive";
216
+ /** 观看回放 */
217
+ VIEW_TYPE[VIEW_TYPE["WatchReplay"] = 1] = "WatchReplay";
218
+ })(VIEW_TYPE = LIVE_STREAM_AUDIENCE.VIEW_TYPE || (LIVE_STREAM_AUDIENCE.VIEW_TYPE = {}));
219
+ })(LIVE_STREAM_AUDIENCE = ENUM.LIVE_STREAM_AUDIENCE || (ENUM.LIVE_STREAM_AUDIENCE = {}));
207
220
  })(ENUM || (exports.ENUM = ENUM = {}));
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export type { RoomService } from './modules/room/types';
2
+ export type { DataService } from './modules/data/types';
2
3
  export { roomService } from './modules/room/service';
3
4
  export { ENUM as CLIENT_BACKEND_ENUM } from './enum';
4
5
  export type { Room, RoomAutoStartConfig, RoomLoopVideo, RoomTag, RoomBindStore } from './types';
@@ -0,0 +1,42 @@
1
+ import { ENUM } from '../../enum';
2
+ import { FastifyRequest } from 'fastify';
3
+ export declare namespace DataService {
4
+ namespace Request {
5
+ /**
6
+ * 从缓存中查询用户观看时长
7
+ */
8
+ interface UserViewDuration {
9
+ /** 直播间id */
10
+ liveStreamRoomId: string;
11
+ /** 用户id */
12
+ userId: string;
13
+ /** 任务id */
14
+ taskId: string;
15
+ /** 查询类型 */
16
+ viewType: ENUM.LIVE_STREAM_AUDIENCE.VIEW_TYPE;
17
+ /** 是否需要总时长 */
18
+ needTotalDuration?: boolean;
19
+ }
20
+ }
21
+ namespace Response {
22
+ /**
23
+ * 从缓存中查询用户观看时长响应
24
+ */
25
+ interface UserViewDuration {
26
+ /** 直播间id */
27
+ liveStreamRoomId: string;
28
+ /** 用户id */
29
+ userId: string;
30
+ /** 查询类型 */
31
+ viewType: ENUM.LIVE_STREAM_AUDIENCE.VIEW_TYPE;
32
+ /** 观看时长,单位秒 */
33
+ duration: number;
34
+ /** 观看总时长,单位秒 */
35
+ totalDuration?: number;
36
+ }
37
+ }
38
+ interface BaseController {
39
+ /** 从缓存中获取 */
40
+ getUserViewDuration(request: Request.UserViewDuration, req?: FastifyRequest): Promise<Response.UserViewDuration>;
41
+ }
42
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-client-backend-service-node-sdk",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "EcommerceClientBackendService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",