@be-link/ecommerce-client-backend-service-node-sdk 0.1.54 → 0.1.56
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/index.d.ts +2 -0
- package/index.js +11 -9
- package/modules/data/service.d.ts +8 -0
- package/modules/data/service.js +32 -0
- package/modules/data/types.d.ts +4 -0
- package/modules/roomData/service.d.ts +13 -0
- package/modules/roomData/service.js +78 -0
- package/modules/roomData/types.d.ts +132 -0
- package/modules/roomData/types.js +2 -0
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export type { RoomService } from './modules/room/types';
|
|
2
|
+
export type { RoomDataService } from './modules/roomData/types';
|
|
2
3
|
export type { DataService } from './modules/data/types';
|
|
3
4
|
export type { DomainService } from './modules/domain/types';
|
|
4
5
|
export type { RuleService } from './modules/rule/types';
|
|
5
6
|
export type { MiniProgramService } from './modules/miniprogram/types';
|
|
6
7
|
export { roomService } from './modules/room/service';
|
|
8
|
+
export { roomDataService } from './modules/roomData/service';
|
|
7
9
|
export { dataService } from './modules/data/service';
|
|
8
10
|
export { domainService } from './modules/domain/service';
|
|
9
11
|
export { ruleService } from './modules/rule/service';
|
package/index.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLIENT_BACKEND_ENUM = exports.miniProgramService = exports.ruleService = exports.domainService = exports.dataService = exports.roomService = void 0;
|
|
3
|
+
exports.CLIENT_BACKEND_ENUM = 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
|
-
var service_2 = require("./modules/
|
|
7
|
-
Object.defineProperty(exports, "
|
|
8
|
-
var service_3 = require("./modules/
|
|
9
|
-
Object.defineProperty(exports, "
|
|
10
|
-
var service_4 = require("./modules/
|
|
11
|
-
Object.defineProperty(exports, "
|
|
12
|
-
var service_5 = require("./modules/
|
|
13
|
-
Object.defineProperty(exports, "
|
|
6
|
+
var service_2 = require("./modules/roomData/service");
|
|
7
|
+
Object.defineProperty(exports, "roomDataService", { enumerable: true, get: function () { return service_2.roomDataService; } });
|
|
8
|
+
var service_3 = require("./modules/data/service");
|
|
9
|
+
Object.defineProperty(exports, "dataService", { enumerable: true, get: function () { return service_3.dataService; } });
|
|
10
|
+
var service_4 = require("./modules/domain/service");
|
|
11
|
+
Object.defineProperty(exports, "domainService", { enumerable: true, get: function () { return service_4.domainService; } });
|
|
12
|
+
var service_5 = require("./modules/rule/service");
|
|
13
|
+
Object.defineProperty(exports, "ruleService", { enumerable: true, get: function () { return service_5.ruleService; } });
|
|
14
|
+
var service_6 = require("./modules/miniprogram/service");
|
|
15
|
+
Object.defineProperty(exports, "miniProgramService", { enumerable: true, get: function () { return service_6.miniProgramService; } });
|
|
14
16
|
var enum_1 = require("./enum");
|
|
15
17
|
Object.defineProperty(exports, "CLIENT_BACKEND_ENUM", { enumerable: true, get: function () { return enum_1.ENUM; } });
|
|
16
18
|
// 服务.模块.枚举名称.枚举值 示例: DEMO_ENUM.ORDER_ENUM.STATUS.PENDING
|
|
@@ -22,6 +22,14 @@ declare class DataServiceClass extends BaseService implements DataService.BaseCo
|
|
|
22
22
|
syncTask(request: DataService.Payload.Task): Promise<void>;
|
|
23
23
|
/** 用户观看时长统计任务 */
|
|
24
24
|
userWatchDurationTask(): Promise<void>;
|
|
25
|
+
/** 每日更新用户7天累计消费金额 */
|
|
26
|
+
dailyUpdateUserSevenDaysAmount(): Promise<void>;
|
|
27
|
+
/** 初始化用户数据-刷入所有用户 */
|
|
28
|
+
initUserExtraInfoUsers(): Promise<void>;
|
|
29
|
+
/** 初始化用户数据-刷最近看播时间 */
|
|
30
|
+
initUserExtraInfoLastWatchTime(): Promise<void>;
|
|
31
|
+
/** 初始化用户数据-刷7天累计消费 */
|
|
32
|
+
initUserExtraInfoSevenDaysAmount(): Promise<void>;
|
|
25
33
|
}
|
|
26
34
|
export declare const dataService: DataServiceClass;
|
|
27
35
|
export default dataService;
|
package/modules/data/service.js
CHANGED
|
@@ -65,6 +65,22 @@ let DataServiceClass = class DataServiceClass extends BaseService_1.default {
|
|
|
65
65
|
userWatchDurationTask() {
|
|
66
66
|
return (0, http_1.callApi)(this.getApiUrl(this.userWatchDurationTask), undefined);
|
|
67
67
|
}
|
|
68
|
+
/** 每日更新用户7天累计消费金额 */
|
|
69
|
+
dailyUpdateUserSevenDaysAmount() {
|
|
70
|
+
return (0, http_1.callApi)(this.getApiUrl(this.dailyUpdateUserSevenDaysAmount), undefined);
|
|
71
|
+
}
|
|
72
|
+
/** 初始化用户数据-刷入所有用户 */
|
|
73
|
+
initUserExtraInfoUsers() {
|
|
74
|
+
return (0, http_1.callApi)(this.getApiUrl(this.initUserExtraInfoUsers), undefined);
|
|
75
|
+
}
|
|
76
|
+
/** 初始化用户数据-刷最近看播时间 */
|
|
77
|
+
initUserExtraInfoLastWatchTime() {
|
|
78
|
+
return (0, http_1.callApi)(this.getApiUrl(this.initUserExtraInfoLastWatchTime), undefined);
|
|
79
|
+
}
|
|
80
|
+
/** 初始化用户数据-刷7天累计消费 */
|
|
81
|
+
initUserExtraInfoSevenDaysAmount() {
|
|
82
|
+
return (0, http_1.callApi)(this.getApiUrl(this.initUserExtraInfoSevenDaysAmount), undefined);
|
|
83
|
+
}
|
|
68
84
|
};
|
|
69
85
|
__decorate([
|
|
70
86
|
(0, tsoa_1.OperationId)('获取用户观看时长'),
|
|
@@ -124,6 +140,22 @@ __decorate([
|
|
|
124
140
|
(0, tsoa_1.OperationId)('用户观看时长统计任务'),
|
|
125
141
|
(0, tsoa_1.Post)('user-watch-duration-task')
|
|
126
142
|
], DataServiceClass.prototype, "userWatchDurationTask", null);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, tsoa_1.OperationId)('每日更新用户7天累计消费金额'),
|
|
145
|
+
(0, tsoa_1.Post)('daily-update-user-seven-days-amount')
|
|
146
|
+
], DataServiceClass.prototype, "dailyUpdateUserSevenDaysAmount", null);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, tsoa_1.OperationId)('初始化用户数据-刷入所有用户'),
|
|
149
|
+
(0, tsoa_1.Post)('init-user-extra-info-users')
|
|
150
|
+
], DataServiceClass.prototype, "initUserExtraInfoUsers", null);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, tsoa_1.OperationId)('初始化用户数据-刷最近看播时间'),
|
|
153
|
+
(0, tsoa_1.Post)('init-user-extra-info-last-watch-time')
|
|
154
|
+
], DataServiceClass.prototype, "initUserExtraInfoLastWatchTime", null);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, tsoa_1.OperationId)('初始化用户数据-刷7天累计消费'),
|
|
157
|
+
(0, tsoa_1.Post)('init-user-extra-info-seven-days-amount')
|
|
158
|
+
], DataServiceClass.prototype, "initUserExtraInfoSevenDaysAmount", null);
|
|
127
159
|
DataServiceClass = __decorate([
|
|
128
160
|
(0, tsoa_1.Route)('data'),
|
|
129
161
|
(0, tsoa_1.Tags)('Data')
|
package/modules/data/types.d.ts
CHANGED
|
@@ -235,6 +235,10 @@ export declare namespace DataService {
|
|
|
235
235
|
liveStreamRoomDataArchive(req?: FastifyRequest): Promise<void>;
|
|
236
236
|
syncTask(request: Payload.Task): Promise<void>;
|
|
237
237
|
userWatchDurationTask(): Promise<void>;
|
|
238
|
+
dailyUpdateUserSevenDaysAmount(req?: FastifyRequest): Promise<void>;
|
|
239
|
+
initUserExtraInfoUsers(req?: FastifyRequest): Promise<void>;
|
|
240
|
+
initUserExtraInfoLastWatchTime(req?: FastifyRequest): Promise<void>;
|
|
241
|
+
initUserExtraInfoSevenDaysAmount(req?: FastifyRequest): Promise<void>;
|
|
238
242
|
}
|
|
239
243
|
}
|
|
240
244
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RoomDataService } from './types';
|
|
2
|
+
import BaseService from '../BaseService';
|
|
3
|
+
declare class RoomDataServiceClass extends BaseService implements RoomDataService.BaseController {
|
|
4
|
+
protected prefixUrl: string;
|
|
5
|
+
listByStoreWithRule(request: RoomDataService.Request.ListByStoreWithRule): Promise<RoomDataService.Response.ListByStoreWithRule>;
|
|
6
|
+
detailWithStatistics(request: RoomDataService.Request.DetailWithStatistics): Promise<RoomDataService.Response.DetailWithStatistics>;
|
|
7
|
+
nonViewers(request: RoomDataService.Request.NonViewers): Promise<RoomDataService.Response.NonViewers>;
|
|
8
|
+
viewers(request: RoomDataService.Request.Viewers): Promise<RoomDataService.Response.Viewers>;
|
|
9
|
+
productSalesRanking(request: RoomDataService.Request.ProductSalesRanking): Promise<RoomDataService.Response.ProductSalesRanking>;
|
|
10
|
+
getViewerCountForSales(request: RoomDataService.Request.GetViewerCountForSales): Promise<RoomDataService.Response.GetViewerCountForSales>;
|
|
11
|
+
}
|
|
12
|
+
export declare const roomDataService: RoomDataServiceClass;
|
|
13
|
+
export default roomDataService;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
9
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.roomDataService = void 0;
|
|
16
|
+
const tsoa_1 = require("tsoa");
|
|
17
|
+
const http_1 = require("../../utils/http");
|
|
18
|
+
const BaseService_1 = __importDefault(require("../BaseService"));
|
|
19
|
+
let RoomDataServiceClass = class RoomDataServiceClass extends BaseService_1.default {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.prefixUrl = '/room';
|
|
23
|
+
}
|
|
24
|
+
listByStoreWithRule(request) {
|
|
25
|
+
return (0, http_1.callApi)(this.getApiUrl(this.listByStoreWithRule), request);
|
|
26
|
+
}
|
|
27
|
+
detailWithStatistics(request) {
|
|
28
|
+
return (0, http_1.callApi)(this.getApiUrl(this.detailWithStatistics), request);
|
|
29
|
+
}
|
|
30
|
+
nonViewers(request) {
|
|
31
|
+
return (0, http_1.callApi)(this.getApiUrl(this.nonViewers), request);
|
|
32
|
+
}
|
|
33
|
+
viewers(request) {
|
|
34
|
+
return (0, http_1.callApi)(this.getApiUrl(this.viewers), request);
|
|
35
|
+
}
|
|
36
|
+
productSalesRanking(request) {
|
|
37
|
+
return (0, http_1.callApi)(this.getApiUrl(this.productSalesRanking), request);
|
|
38
|
+
}
|
|
39
|
+
getViewerCountForSales(request) {
|
|
40
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getViewerCountForSales), request);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, tsoa_1.OperationId)('直播间列表接口(门店维度)'),
|
|
45
|
+
(0, tsoa_1.Post)('list-by-store-with-rule'),
|
|
46
|
+
__param(0, (0, tsoa_1.Body)())
|
|
47
|
+
], RoomDataServiceClass.prototype, "listByStoreWithRule", null);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, tsoa_1.OperationId)('直播详情接口 - 带统计数据'),
|
|
50
|
+
(0, tsoa_1.Post)('detail-with-statistics'),
|
|
51
|
+
__param(0, (0, tsoa_1.Body)())
|
|
52
|
+
], RoomDataServiceClass.prototype, "detailWithStatistics", null);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, tsoa_1.OperationId)('未看播用户列表'),
|
|
55
|
+
(0, tsoa_1.Post)('non-viewers'),
|
|
56
|
+
__param(0, (0, tsoa_1.Body)())
|
|
57
|
+
], RoomDataServiceClass.prototype, "nonViewers", null);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, tsoa_1.OperationId)('看播用户列表'),
|
|
60
|
+
(0, tsoa_1.Post)('viewers'),
|
|
61
|
+
__param(0, (0, tsoa_1.Body)())
|
|
62
|
+
], RoomDataServiceClass.prototype, "viewers", null);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, tsoa_1.OperationId)('商品销售榜单(门店维度)'),
|
|
65
|
+
(0, tsoa_1.Post)('product-sales-ranking'),
|
|
66
|
+
__param(0, (0, tsoa_1.Body)())
|
|
67
|
+
], RoomDataServiceClass.prototype, "productSalesRanking", null);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, tsoa_1.OperationId)('查询看播人数(用于销售看板)'),
|
|
70
|
+
(0, tsoa_1.Post)('get-viewer-count-for-sales'),
|
|
71
|
+
__param(0, (0, tsoa_1.Body)())
|
|
72
|
+
], RoomDataServiceClass.prototype, "getViewerCountForSales", null);
|
|
73
|
+
RoomDataServiceClass = __decorate([
|
|
74
|
+
(0, tsoa_1.Route)('room'),
|
|
75
|
+
(0, tsoa_1.Tags)('RoomData')
|
|
76
|
+
], RoomDataServiceClass);
|
|
77
|
+
exports.roomDataService = new RoomDataServiceClass();
|
|
78
|
+
exports.default = exports.roomDataService;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { FastifyRequest } from 'fastify';
|
|
2
|
+
export declare namespace RoomDataService {
|
|
3
|
+
namespace Request {
|
|
4
|
+
/**
|
|
5
|
+
* 直播间列表接口(门店维度)
|
|
6
|
+
*/
|
|
7
|
+
interface ListByStoreWithRule {
|
|
8
|
+
storeId: string;
|
|
9
|
+
startTime?: number;
|
|
10
|
+
endTime?: number;
|
|
11
|
+
pageIndex?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 直播详情接口 - 带统计数据
|
|
16
|
+
*/
|
|
17
|
+
interface DetailWithStatistics {
|
|
18
|
+
liveStreamRoomId: string;
|
|
19
|
+
storeId?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 未看播用户列表
|
|
23
|
+
*/
|
|
24
|
+
interface NonViewers {
|
|
25
|
+
liveStreamRoomId: string;
|
|
26
|
+
storeId: string;
|
|
27
|
+
pageIndex?: number;
|
|
28
|
+
pageSize?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 看播用户列表
|
|
32
|
+
*/
|
|
33
|
+
interface Viewers {
|
|
34
|
+
liveStreamRoomId: string;
|
|
35
|
+
storeId: string;
|
|
36
|
+
pageIndex?: number;
|
|
37
|
+
pageSize?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 商品销售榜单(门店维度)
|
|
41
|
+
*/
|
|
42
|
+
interface ProductSalesRanking {
|
|
43
|
+
liveStreamRoomId: string;
|
|
44
|
+
storeId: string;
|
|
45
|
+
pageIndex?: number;
|
|
46
|
+
pageSize?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 查询看播人数(用于销售看板)
|
|
50
|
+
*/
|
|
51
|
+
interface GetViewerCountForSales {
|
|
52
|
+
/** 开始日期(毫秒级时间戳) */
|
|
53
|
+
startDate: number;
|
|
54
|
+
/** 结束日期(毫秒级时间戳) */
|
|
55
|
+
endDate: number;
|
|
56
|
+
/** 门店ID列表(可选,为空或null表示所有门店) */
|
|
57
|
+
storeIds?: string[] | null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
namespace Response {
|
|
61
|
+
interface RoomItem {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
status: number;
|
|
65
|
+
coverImage: string;
|
|
66
|
+
verticalCoverImage: string;
|
|
67
|
+
liveTime: number;
|
|
68
|
+
endTime: number;
|
|
69
|
+
viewUrl: string;
|
|
70
|
+
}
|
|
71
|
+
interface ListByStoreWithRule {
|
|
72
|
+
list: RoomItem[];
|
|
73
|
+
total: number;
|
|
74
|
+
}
|
|
75
|
+
interface DetailWithStatistics {
|
|
76
|
+
totalGmv: number;
|
|
77
|
+
orderCount: number;
|
|
78
|
+
buyerCount: number;
|
|
79
|
+
viewerCount: number;
|
|
80
|
+
avgOrderAmount: number;
|
|
81
|
+
arpu: number;
|
|
82
|
+
refundGmv: number;
|
|
83
|
+
refundOrderCount: number;
|
|
84
|
+
netGmv: number;
|
|
85
|
+
}
|
|
86
|
+
interface NonViewerItem {
|
|
87
|
+
userId: string;
|
|
88
|
+
userName: string;
|
|
89
|
+
userAvatar: string;
|
|
90
|
+
isViewed: boolean;
|
|
91
|
+
lastWatchTime: string;
|
|
92
|
+
totalAmount: number;
|
|
93
|
+
}
|
|
94
|
+
interface NonViewers {
|
|
95
|
+
list: NonViewerItem[];
|
|
96
|
+
total: number;
|
|
97
|
+
}
|
|
98
|
+
interface ViewerItem {
|
|
99
|
+
userId: string;
|
|
100
|
+
userName: string;
|
|
101
|
+
userAvatar: string;
|
|
102
|
+
isViewed: boolean;
|
|
103
|
+
liveAmount: number;
|
|
104
|
+
}
|
|
105
|
+
interface Viewers {
|
|
106
|
+
list: ViewerItem[];
|
|
107
|
+
total: number;
|
|
108
|
+
}
|
|
109
|
+
interface ProductSalesItem {
|
|
110
|
+
productId: string;
|
|
111
|
+
productName: string;
|
|
112
|
+
productImage: string;
|
|
113
|
+
actualQuantity: number;
|
|
114
|
+
price: number;
|
|
115
|
+
}
|
|
116
|
+
interface ProductSalesRanking {
|
|
117
|
+
list: ProductSalesItem[];
|
|
118
|
+
total: number;
|
|
119
|
+
}
|
|
120
|
+
interface GetViewerCountForSales {
|
|
121
|
+
viewerCount: number;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
interface BaseController {
|
|
125
|
+
listByStoreWithRule(request: Request.ListByStoreWithRule, req?: FastifyRequest): Promise<Response.ListByStoreWithRule>;
|
|
126
|
+
detailWithStatistics(request: Request.DetailWithStatistics, req?: FastifyRequest): Promise<Response.DetailWithStatistics>;
|
|
127
|
+
nonViewers(request: Request.NonViewers, req?: FastifyRequest): Promise<Response.NonViewers>;
|
|
128
|
+
viewers(request: Request.Viewers, req?: FastifyRequest): Promise<Response.Viewers>;
|
|
129
|
+
productSalesRanking(request: Request.ProductSalesRanking, req?: FastifyRequest): Promise<Response.ProductSalesRanking>;
|
|
130
|
+
getViewerCountForSales(request: Request.GetViewerCountForSales, req?: FastifyRequest): Promise<Response.GetViewerCountForSales>;
|
|
131
|
+
}
|
|
132
|
+
}
|
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.
|
|
3
|
+
"version": "0.1.56",
|
|
4
4
|
"description": "EcommerceClientBackendService Node.js SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@be-link/ecommerce-volcengine-open-api-sdk": "
|
|
14
|
-
"@be-link/ecommerce-user-service-node-sdk": "
|
|
13
|
+
"@be-link/ecommerce-volcengine-open-api-sdk": "1.0.11",
|
|
14
|
+
"@be-link/ecommerce-user-service-node-sdk": "0.0.26",
|
|
15
15
|
"@fastify/request-context": "6.2.1",
|
|
16
16
|
"axios": "1.13.2",
|
|
17
17
|
"axios-retry": "4.0.0",
|