@be-link/ecommerce-client-backend-service-node-sdk 0.1.91 → 0.1.93
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/consts.d.ts +30 -0
- package/consts.js +36 -0
- package/index.d.ts +1 -0
- package/index.js +3 -1
- package/modules/data/service.d.ts +4 -0
- package/modules/data/service.js +18 -0
- package/modules/data/types.d.ts +45 -0
- package/modules/room/service.d.ts +1 -0
- package/modules/room/service.js +8 -0
- package/modules/room/types.d.ts +18 -0
- package/modules/userData/types.d.ts +18 -0
- package/package.json +1 -1
package/consts.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare namespace HOTEL_TRAVEL_MQ {
|
|
2
|
+
/** 酒旅 MQ vhost */
|
|
3
|
+
const VHOST = "trade";
|
|
4
|
+
/** 正向订单 MQ */
|
|
5
|
+
namespace POS {
|
|
6
|
+
/** 正向订单主题 */
|
|
7
|
+
const TOPIC = "positive-topic";
|
|
8
|
+
/** 正向订单路由键 */
|
|
9
|
+
const ROUTING_KEY: {
|
|
10
|
+
/** 创建 */
|
|
11
|
+
readonly CREATE: "order.positive.create";
|
|
12
|
+
/** 支付成功 */
|
|
13
|
+
readonly PAY_SUCCESS: "order.positive.pay_success";
|
|
14
|
+
/** 关闭 */
|
|
15
|
+
readonly CLOSED: "order.positive.close";
|
|
16
|
+
/** 定金补全 */
|
|
17
|
+
readonly DEPOSIT_RESERVE_COMPLETED: "order.positive.deposit_reserve_completed";
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** 逆向订单 MQ */
|
|
21
|
+
namespace ROS {
|
|
22
|
+
/** 逆向订单主题 */
|
|
23
|
+
const TOPIC = "reverse-topic";
|
|
24
|
+
/** 逆向订单路由键 */
|
|
25
|
+
const ROUTING_KEY: {
|
|
26
|
+
/** 退款成功 */
|
|
27
|
+
readonly SUCCESS: "order.reverse.success";
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
package/consts.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_TRAVEL_MQ = void 0;
|
|
4
|
+
var HOTEL_TRAVEL_MQ;
|
|
5
|
+
(function (HOTEL_TRAVEL_MQ) {
|
|
6
|
+
/** 酒旅 MQ vhost */
|
|
7
|
+
HOTEL_TRAVEL_MQ.VHOST = 'trade';
|
|
8
|
+
/** 正向订单 MQ */
|
|
9
|
+
let POS;
|
|
10
|
+
(function (POS) {
|
|
11
|
+
/** 正向订单主题 */
|
|
12
|
+
POS.TOPIC = 'positive-topic';
|
|
13
|
+
/** 正向订单路由键 */
|
|
14
|
+
POS.ROUTING_KEY = {
|
|
15
|
+
/** 创建 */
|
|
16
|
+
CREATE: 'order.positive.create',
|
|
17
|
+
/** 支付成功 */
|
|
18
|
+
PAY_SUCCESS: 'order.positive.pay_success',
|
|
19
|
+
/** 关闭 */
|
|
20
|
+
CLOSED: 'order.positive.close',
|
|
21
|
+
/** 定金补全 */
|
|
22
|
+
DEPOSIT_RESERVE_COMPLETED: 'order.positive.deposit_reserve_completed',
|
|
23
|
+
};
|
|
24
|
+
})(POS = HOTEL_TRAVEL_MQ.POS || (HOTEL_TRAVEL_MQ.POS = {}));
|
|
25
|
+
/** 逆向订单 MQ */
|
|
26
|
+
let ROS;
|
|
27
|
+
(function (ROS) {
|
|
28
|
+
/** 逆向订单主题 */
|
|
29
|
+
ROS.TOPIC = 'reverse-topic';
|
|
30
|
+
/** 逆向订单路由键 */
|
|
31
|
+
ROS.ROUTING_KEY = {
|
|
32
|
+
/** 退款成功 */
|
|
33
|
+
SUCCESS: 'order.reverse.success',
|
|
34
|
+
};
|
|
35
|
+
})(ROS = HOTEL_TRAVEL_MQ.ROS || (HOTEL_TRAVEL_MQ.ROS = {}));
|
|
36
|
+
})(HOTEL_TRAVEL_MQ || (exports.HOTEL_TRAVEL_MQ = HOTEL_TRAVEL_MQ = {}));
|
package/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { ruleService } from './modules/rule/service';
|
|
|
13
13
|
export { miniProgramService } from './modules/miniprogram/service';
|
|
14
14
|
export { userDataService } from './modules/userData/service';
|
|
15
15
|
export { ENUM as CLIENT_BACKEND_ENUM } from './enum';
|
|
16
|
+
export { HOTEL_TRAVEL_MQ } from './consts';
|
|
16
17
|
export { destroyHttpAgents } from './utils/http';
|
|
17
18
|
export type { Room, RoomAutoStartConfig, RoomLoopVideo, RoomTag, RoomBindStore } from './types';
|
|
18
19
|
export type { Domain, Current } from './modules/domain/types';
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.destroyHttpAgents = exports.CLIENT_BACKEND_ENUM = exports.userDataService = exports.miniProgramService = exports.ruleService = exports.domainService = exports.dataService = exports.roomDataService = exports.roomService = void 0;
|
|
3
|
+
exports.destroyHttpAgents = exports.HOTEL_TRAVEL_MQ = exports.CLIENT_BACKEND_ENUM = exports.userDataService = exports.miniProgramService = exports.ruleService = exports.domainService = exports.dataService = exports.roomDataService = exports.roomService = void 0;
|
|
4
4
|
var service_1 = require("./modules/room/service");
|
|
5
5
|
Object.defineProperty(exports, "roomService", { enumerable: true, get: function () { return service_1.roomService; } });
|
|
6
6
|
var service_2 = require("./modules/roomData/service");
|
|
@@ -17,6 +17,8 @@ var service_7 = require("./modules/userData/service");
|
|
|
17
17
|
Object.defineProperty(exports, "userDataService", { enumerable: true, get: function () { return service_7.userDataService; } });
|
|
18
18
|
var enum_1 = require("./enum");
|
|
19
19
|
Object.defineProperty(exports, "CLIENT_BACKEND_ENUM", { enumerable: true, get: function () { return enum_1.ENUM; } });
|
|
20
|
+
var consts_1 = require("./consts");
|
|
21
|
+
Object.defineProperty(exports, "HOTEL_TRAVEL_MQ", { enumerable: true, get: function () { return consts_1.HOTEL_TRAVEL_MQ; } });
|
|
20
22
|
var http_1 = require("./utils/http");
|
|
21
23
|
Object.defineProperty(exports, "destroyHttpAgents", { enumerable: true, get: function () { return http_1.destroyHttpAgents; } });
|
|
22
24
|
// 服务.模块.枚举名称.枚举值 示例: DEMO_ENUM.ORDER_ENUM.STATUS.PENDING
|
|
@@ -40,6 +40,10 @@ declare class DataServiceClass extends BaseService implements DataService.BaseCo
|
|
|
40
40
|
syncPreviewAudienceStatistics(): Promise<void>;
|
|
41
41
|
/** 从订单服务同步 trade_order(定时调度:order_change_log 扫单回写) */
|
|
42
42
|
syncTradeOrderFromOrderService(): Promise<void>;
|
|
43
|
+
/** 定时校准酒旅用户累计消费金额(脏用户集合回查) */
|
|
44
|
+
syncHotelTravelUserConsumptionAmount(request?: DataService.Request.SyncHotelTravelUserConsumptionAmount): Promise<void>;
|
|
45
|
+
/** 一次性历史回填酒旅用户累计消费金额(支持 userId 游标断点续传) */
|
|
46
|
+
backfillHotelTravelUserConsumptionAmount(request?: DataService.Request.BackfillHotelTravelUserConsumptionAmount): Promise<void>;
|
|
43
47
|
/** 补偿指定直播间的回放观众统计(拉火山回放写回放三字段,用于手动补偿) */
|
|
44
48
|
compensateReplayAudienceStatistics(request: DataService.Request.CompensateReplayAudienceStatistics): Promise<void>;
|
|
45
49
|
batchCompensateReplayAudienceStatistics(request: DataService.Request.BatchCompensateReplayAudienceStatistics): Promise<void>;
|
package/modules/data/service.js
CHANGED
|
@@ -101,6 +101,14 @@ let DataServiceClass = class DataServiceClass extends BaseService_1.default {
|
|
|
101
101
|
syncTradeOrderFromOrderService() {
|
|
102
102
|
return (0, http_1.callApi)(this.getApiUrl(this.syncTradeOrderFromOrderService), undefined);
|
|
103
103
|
}
|
|
104
|
+
/** 定时校准酒旅用户累计消费金额(脏用户集合回查) */
|
|
105
|
+
syncHotelTravelUserConsumptionAmount(request) {
|
|
106
|
+
return (0, http_1.callApi)(this.getApiUrl(this.syncHotelTravelUserConsumptionAmount), request);
|
|
107
|
+
}
|
|
108
|
+
/** 一次性历史回填酒旅用户累计消费金额(支持 userId 游标断点续传) */
|
|
109
|
+
backfillHotelTravelUserConsumptionAmount(request) {
|
|
110
|
+
return (0, http_1.callApi)(this.getApiUrl(this.backfillHotelTravelUserConsumptionAmount), request);
|
|
111
|
+
}
|
|
104
112
|
/** 补偿指定直播间的回放观众统计(拉火山回放写回放三字段,用于手动补偿) */
|
|
105
113
|
compensateReplayAudienceStatistics(request) {
|
|
106
114
|
return (0, http_1.callApi)(this.getApiUrl(this.compensateReplayAudienceStatistics), request);
|
|
@@ -254,6 +262,16 @@ __decorate([
|
|
|
254
262
|
(0, tsoa_1.OperationId)('从订单服务同步 trade_order'),
|
|
255
263
|
(0, tsoa_1.Post)('sync-trade-order-from-order-service')
|
|
256
264
|
], DataServiceClass.prototype, "syncTradeOrderFromOrderService", null);
|
|
265
|
+
__decorate([
|
|
266
|
+
(0, tsoa_1.OperationId)('定时校准酒旅用户累计消费金额'),
|
|
267
|
+
(0, tsoa_1.Post)('sync-hotel-travel-user-consumption-amount'),
|
|
268
|
+
__param(0, (0, tsoa_1.Body)())
|
|
269
|
+
], DataServiceClass.prototype, "syncHotelTravelUserConsumptionAmount", null);
|
|
270
|
+
__decorate([
|
|
271
|
+
(0, tsoa_1.OperationId)('一次性历史回填酒旅用户累计消费金额'),
|
|
272
|
+
(0, tsoa_1.Post)('backfill-hotel-travel-user-consumption-amount'),
|
|
273
|
+
__param(0, (0, tsoa_1.Body)())
|
|
274
|
+
], DataServiceClass.prototype, "backfillHotelTravelUserConsumptionAmount", null);
|
|
257
275
|
__decorate([
|
|
258
276
|
(0, tsoa_1.OperationId)('补偿回放观众统计'),
|
|
259
277
|
(0, tsoa_1.Post)('compensate-replay-audience-statistics'),
|
package/modules/data/types.d.ts
CHANGED
|
@@ -211,6 +211,22 @@ export declare namespace DataService {
|
|
|
211
211
|
/** 目标对账日期(ISO 8601格式,如 "2024-01-15"),不传则对账昨天 */
|
|
212
212
|
targetDate?: string;
|
|
213
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* 定时校准酒旅用户累计消费金额(脏用户集合回查)
|
|
216
|
+
*/
|
|
217
|
+
interface SyncHotelTravelUserConsumptionAmount {
|
|
218
|
+
/** 单次处理用户数(默认500,最大5000) */
|
|
219
|
+
batchSize?: number;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* 一次性历史回填酒旅用户累计消费金额(支持 userId 游标断点续传)
|
|
223
|
+
*/
|
|
224
|
+
interface BackfillHotelTravelUserConsumptionAmount {
|
|
225
|
+
/** 单次分页大小(默认500,最大5000) */
|
|
226
|
+
pageSize?: number;
|
|
227
|
+
/** 起始 userId(断点续传游标) */
|
|
228
|
+
startUserId?: string;
|
|
229
|
+
}
|
|
214
230
|
/**
|
|
215
231
|
* 批量更新用户消费数据(从CSV文件)
|
|
216
232
|
*/
|
|
@@ -302,6 +318,33 @@ export declare namespace DataService {
|
|
|
302
318
|
message: string;
|
|
303
319
|
}
|
|
304
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* 直播间统计缓存结构(Redis)
|
|
323
|
+
*/
|
|
324
|
+
interface LiveStreamRoomStatisticsCache {
|
|
325
|
+
/** 直播间id */
|
|
326
|
+
liveStreamRoomId: string;
|
|
327
|
+
/** 交易总金额(待支付金额+实收金额、含退款金额) */
|
|
328
|
+
gmv?: number;
|
|
329
|
+
/** 实收金额:支付成功且未退款金额 */
|
|
330
|
+
actualReceivedAmount?: number;
|
|
331
|
+
/** 退款金额 */
|
|
332
|
+
refundAmount?: number;
|
|
333
|
+
/** 待支付金额 */
|
|
334
|
+
pendingPaymentAmount?: number;
|
|
335
|
+
/** 成交订单数 */
|
|
336
|
+
transactOrderCount?: number;
|
|
337
|
+
/** 商品销售量 */
|
|
338
|
+
salesVolume?: number;
|
|
339
|
+
/** 待支付份数 */
|
|
340
|
+
pendingSalesVolume?: number;
|
|
341
|
+
/** 下单人数(去重) */
|
|
342
|
+
orderUserCount?: number;
|
|
343
|
+
/** 退款人数(去重) */
|
|
344
|
+
refundUserCount?: number;
|
|
345
|
+
/** 酒旅预计尾款(单位:分) */
|
|
346
|
+
hotelTravelEstimatedFinalPayment?: number;
|
|
347
|
+
}
|
|
305
348
|
interface BaseController {
|
|
306
349
|
userLiveStreamRelation(request: Request.UserLiveStreamRelation, req?: FastifyRequest): Promise<void>;
|
|
307
350
|
getUserViewDuration(request: Request.UserViewDuration, req?: FastifyRequest): Promise<Response.UserViewDuration>;
|
|
@@ -324,6 +367,8 @@ export declare namespace DataService {
|
|
|
324
367
|
syncReplayAudienceStatistics(): Promise<void>;
|
|
325
368
|
syncPreviewAudienceStatistics(): Promise<void>;
|
|
326
369
|
syncTradeOrderFromOrderService(): Promise<void>;
|
|
370
|
+
syncHotelTravelUserConsumptionAmount(request?: Request.SyncHotelTravelUserConsumptionAmount, req?: FastifyRequest): Promise<void>;
|
|
371
|
+
backfillHotelTravelUserConsumptionAmount(request?: Request.BackfillHotelTravelUserConsumptionAmount, req?: FastifyRequest): Promise<void>;
|
|
327
372
|
compensateReplayAudienceStatistics(request: Request.CompensateReplayAudienceStatistics, req?: FastifyRequest): Promise<void>;
|
|
328
373
|
batchCompensateReplayAudienceStatistics(request: Request.BatchCompensateReplayAudienceStatistics, req?: FastifyRequest): Promise<void>;
|
|
329
374
|
dailyUpdateUserFirstWatchTime(req?: FastifyRequest): Promise<void>;
|
|
@@ -19,6 +19,7 @@ declare class RoomServiceClass extends BaseService implements RoomService.BaseCo
|
|
|
19
19
|
viewRecord(request: RoomService.Request.ViewRecord): Promise<RoomService.Response.ViewRecord>;
|
|
20
20
|
/** 门店直播规则查询 */
|
|
21
21
|
storeLiveStreamRule(request: RoomService.Request.StoreLiveStreamRule): Promise<RoomService.Response.StoreLiveStreamRule>;
|
|
22
|
+
isNewCustomerLiveRoom(request: RoomService.Request.IsNewCustomerLiveRoom): Promise<RoomService.Response.IsNewCustomerLiveRoom>;
|
|
22
23
|
searchByName(request: RoomService.Request.SearchByName): Promise<RoomService.Response.SearchByName>;
|
|
23
24
|
getBasicInfo(request: RoomService.Request.GetBasicInfo): Promise<RoomService.Response.GetBasicInfo>;
|
|
24
25
|
getRoomTagValues(request: RoomService.Request.GetRoomTagValues): Promise<RoomService.Response.GetRoomTagValues>;
|
package/modules/room/service.js
CHANGED
|
@@ -63,6 +63,9 @@ let RoomServiceClass = class RoomServiceClass extends BaseService_1.default {
|
|
|
63
63
|
storeLiveStreamRule(request) {
|
|
64
64
|
return (0, http_1.callApi)(this.getApiUrl(this.storeLiveStreamRule), request);
|
|
65
65
|
}
|
|
66
|
+
isNewCustomerLiveRoom(request) {
|
|
67
|
+
return (0, http_1.callApi)(this.getApiUrl(this.isNewCustomerLiveRoom), request);
|
|
68
|
+
}
|
|
66
69
|
searchByName(request) {
|
|
67
70
|
return (0, http_1.callApi)(this.getApiUrl(this.searchByName), request);
|
|
68
71
|
}
|
|
@@ -144,6 +147,11 @@ __decorate([
|
|
|
144
147
|
(0, tsoa_1.Post)('store-live-stream-rule'),
|
|
145
148
|
__param(0, (0, tsoa_1.Body)())
|
|
146
149
|
], RoomServiceClass.prototype, "storeLiveStreamRule", null);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, tsoa_1.OperationId)('查询是否新客直播间'),
|
|
152
|
+
(0, tsoa_1.Post)('is-new-customer-live-room'),
|
|
153
|
+
__param(0, (0, tsoa_1.Body)())
|
|
154
|
+
], RoomServiceClass.prototype, "isNewCustomerLiveRoom", null);
|
|
147
155
|
__decorate([
|
|
148
156
|
(0, tsoa_1.OperationId)('根据名称搜索房间'),
|
|
149
157
|
(0, tsoa_1.Post)('search-by-name'),
|
package/modules/room/types.d.ts
CHANGED
|
@@ -67,6 +67,13 @@ export declare namespace RoomService {
|
|
|
67
67
|
/** 门店ID */
|
|
68
68
|
storeId: string;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* 查询是否新客直播间
|
|
72
|
+
*/
|
|
73
|
+
interface IsNewCustomerLiveRoom {
|
|
74
|
+
/** 直播间ID */
|
|
75
|
+
liveStreamRoomId: string;
|
|
76
|
+
}
|
|
70
77
|
/**
|
|
71
78
|
* 绑定门店
|
|
72
79
|
*/
|
|
@@ -253,6 +260,13 @@ export declare namespace RoomService {
|
|
|
253
260
|
interface StoreLiveStreamRule {
|
|
254
261
|
rule: boolean;
|
|
255
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* 查询是否新客直播间响应
|
|
265
|
+
*/
|
|
266
|
+
interface IsNewCustomerLiveRoom {
|
|
267
|
+
/** 是否新客直播间 */
|
|
268
|
+
isNewCustomerLiveRoom: boolean;
|
|
269
|
+
}
|
|
256
270
|
/**
|
|
257
271
|
* 房间基本信息
|
|
258
272
|
*/
|
|
@@ -363,6 +377,10 @@ export declare namespace RoomService {
|
|
|
363
377
|
listByStoreBind(request: Request.ListByStoreBind, req?: FastifyRequest): Promise<Response.ListByStoreBind>;
|
|
364
378
|
viewRecord(request: Request.ViewRecord, req?: FastifyRequest): Promise<Response.ViewRecord>;
|
|
365
379
|
storeLiveStreamRule(request: Request.StoreLiveStreamRule, req?: FastifyRequest): Promise<Response.StoreLiveStreamRule>;
|
|
380
|
+
/**
|
|
381
|
+
* 查询是否新客直播间
|
|
382
|
+
*/
|
|
383
|
+
isNewCustomerLiveRoom(request: Request.IsNewCustomerLiveRoom, req?: FastifyRequest): Promise<Response.IsNewCustomerLiveRoom>;
|
|
366
384
|
/**
|
|
367
385
|
* 根据名称搜索房间
|
|
368
386
|
*/
|
|
@@ -76,6 +76,12 @@ export declare namespace UserDataService {
|
|
|
76
76
|
nickname?: string;
|
|
77
77
|
/** 会员等级 */
|
|
78
78
|
memberLevel?: string;
|
|
79
|
+
/** 电商累计消费金额范围(分)[最小值, 最大值] */
|
|
80
|
+
accumulatedConsumptionAmountRange?: number[];
|
|
81
|
+
/** 总累计消费金额范围(分)[最小值, 最大值] */
|
|
82
|
+
totalAccumulatedConsumptionAmountRange?: number[];
|
|
83
|
+
/** 酒旅累计消费金额范围(分)[最小值, 最大值] */
|
|
84
|
+
hotelTravelAccumulatedConsumptionAmountRange?: number[];
|
|
79
85
|
/** 页码,从0开始 */
|
|
80
86
|
pageIndex: number;
|
|
81
87
|
/** 每页数量,默认20,最大1000 */
|
|
@@ -97,6 +103,12 @@ export declare namespace UserDataService {
|
|
|
97
103
|
nickname?: string;
|
|
98
104
|
/** 会员等级 */
|
|
99
105
|
memberLevel?: string;
|
|
106
|
+
/** 电商累计消费金额范围(分)[最小值, 最大值] */
|
|
107
|
+
accumulatedConsumptionAmountRange?: number[];
|
|
108
|
+
/** 总累计消费金额范围(分)[最小值, 最大值] */
|
|
109
|
+
totalAccumulatedConsumptionAmountRange?: number[];
|
|
110
|
+
/** 酒旅累计消费金额范围(分)[最小值, 最大值] */
|
|
111
|
+
hotelTravelAccumulatedConsumptionAmountRange?: number[];
|
|
100
112
|
/** 页码,从0开始 */
|
|
101
113
|
pageIndex: number;
|
|
102
114
|
/** 每页数量,默认20,最大1000 */
|
|
@@ -406,6 +418,12 @@ export interface LiveRoomUserItem {
|
|
|
406
418
|
replayConsumeAmount: number;
|
|
407
419
|
/** 累计消费金额(支付总额 - 退款总额,元) */
|
|
408
420
|
totalConsumeAmount: number;
|
|
421
|
+
/** 电商累计消费金额(元) */
|
|
422
|
+
accumulatedConsumptionAmount: number;
|
|
423
|
+
/** 总累计消费金额(元) */
|
|
424
|
+
totalAccumulatedConsumptionAmount: number;
|
|
425
|
+
/** 酒旅累计消费金额(元) */
|
|
426
|
+
hotelTravelAccumulatedConsumptionAmount: number;
|
|
409
427
|
/** 首次进入直播间时间(毫秒时间戳) */
|
|
410
428
|
firstEnterTime: number;
|
|
411
429
|
/** 最后进入直播间时间(毫秒时间戳) */
|