@be-link/ecommerce-store-service-node-sdk 0.1.18 → 0.1.20
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/modules/store/service.d.ts +2 -0
- package/modules/store/service.js +16 -0
- package/modules/store/types.d.ts +55 -2
- package/modules/store/types.js +2 -0
- package/modules/storeGroup/types.d.ts +2 -0
- package/package.json +7 -7
- package/utils/http.js +15 -20
|
@@ -15,6 +15,8 @@ declare class StoreService extends BaseService implements Store.StoreController
|
|
|
15
15
|
getStoreFullInfo(request: Store.Request.GetStoreFullInfo): Promise<Store.Response.GetStoreFullInfo>;
|
|
16
16
|
getStoreIdsByConditions(request: Store.Request.GetStoreIdsByConditions): Promise<Store.Response.GetStoreIdsByConditions>;
|
|
17
17
|
getStoreCount(): Promise<Store.Response.GetStoreCount>;
|
|
18
|
+
bindWelfareOfficial(request: Store.Request.BindWelfareOfficial): Promise<void>;
|
|
19
|
+
getWelfareOfficialByStoreId(request: Store.Request.GetWelfareOfficialByStoreId): Promise<Store.Response.GetWelfareOfficialByStoreId>;
|
|
18
20
|
}
|
|
19
21
|
export declare const storeService: StoreService;
|
|
20
22
|
export default storeService;
|
package/modules/store/service.js
CHANGED
|
@@ -60,6 +60,12 @@ let StoreService = class StoreService extends BaseService_1.default {
|
|
|
60
60
|
getStoreCount() {
|
|
61
61
|
return (0, http_1.callApi)(this.getApiUrl(this.getStoreCount));
|
|
62
62
|
}
|
|
63
|
+
bindWelfareOfficial(request) {
|
|
64
|
+
return (0, http_1.callApi)(this.getApiUrl(this.bindWelfareOfficial), request);
|
|
65
|
+
}
|
|
66
|
+
getWelfareOfficialByStoreId(request) {
|
|
67
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getWelfareOfficialByStoreId), request);
|
|
68
|
+
}
|
|
63
69
|
};
|
|
64
70
|
__decorate([
|
|
65
71
|
(0, tsoa_1.OperationId)('创建门店'),
|
|
@@ -125,6 +131,16 @@ __decorate([
|
|
|
125
131
|
(0, tsoa_1.OperationId)('获取门店数量'),
|
|
126
132
|
(0, tsoa_1.Post)('get-store-count')
|
|
127
133
|
], StoreService.prototype, "getStoreCount", null);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, tsoa_1.OperationId)('绑定福利官'),
|
|
136
|
+
(0, tsoa_1.Post)('bind-welfare-official'),
|
|
137
|
+
__param(0, (0, tsoa_1.Body)())
|
|
138
|
+
], StoreService.prototype, "bindWelfareOfficial", null);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, tsoa_1.OperationId)('通过门店获取福利官信息'),
|
|
141
|
+
(0, tsoa_1.Post)('get-welfare-official-by-store-id'),
|
|
142
|
+
__param(0, (0, tsoa_1.Body)())
|
|
143
|
+
], StoreService.prototype, "getWelfareOfficialByStoreId", null);
|
|
128
144
|
StoreService = __decorate([
|
|
129
145
|
(0, tsoa_1.Route)('store'),
|
|
130
146
|
(0, tsoa_1.Tags)('Store')
|
package/modules/store/types.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ export declare namespace Store {
|
|
|
90
90
|
interface StoreGroup {
|
|
91
91
|
/** 标签列表 */
|
|
92
92
|
tags: Array<{
|
|
93
|
+
tagId: string;
|
|
93
94
|
/** 标签名称 */
|
|
94
95
|
tagName: string;
|
|
95
96
|
}>;
|
|
@@ -128,6 +129,19 @@ export declare namespace Store {
|
|
|
128
129
|
/** 人员数量 */
|
|
129
130
|
userCount: number;
|
|
130
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* 门店福利官信息
|
|
134
|
+
*/
|
|
135
|
+
interface WelfareOfficial {
|
|
136
|
+
/** 福利官用户ID */
|
|
137
|
+
welfareOfficialUserId: string;
|
|
138
|
+
/** 福利官姓名 */
|
|
139
|
+
welfareOfficialName: string;
|
|
140
|
+
/** 福利官企微id */
|
|
141
|
+
welfareOfficialQyUserId: string;
|
|
142
|
+
/** 福利官企微二维码 */
|
|
143
|
+
welfareOfficialQrCodeUrl: string;
|
|
144
|
+
}
|
|
131
145
|
/**
|
|
132
146
|
* 完整门店信息(包含基础、结算、仓配信息)
|
|
133
147
|
*/
|
|
@@ -137,6 +151,7 @@ export declare namespace Store {
|
|
|
137
151
|
storeGroup?: StoreGroup;
|
|
138
152
|
storeUser?: StoreUser;
|
|
139
153
|
statistics?: StoreStatistics;
|
|
154
|
+
welfareOfficial?: WelfareOfficial;
|
|
140
155
|
}
|
|
141
156
|
}
|
|
142
157
|
namespace QueryBlock {
|
|
@@ -238,7 +253,9 @@ export declare namespace Store {
|
|
|
238
253
|
/** 门店人员信息表 */
|
|
239
254
|
STORE_USER = "STORE_USER",
|
|
240
255
|
/** 门店统计数据表 */
|
|
241
|
-
STATISTICS = "STATISTICS"
|
|
256
|
+
STATISTICS = "STATISTICS",
|
|
257
|
+
/** 门店福利官信息表 */
|
|
258
|
+
WELFARE_OFFICIAL = "WELFARE_OFFICIAL"
|
|
242
259
|
}
|
|
243
260
|
}
|
|
244
261
|
namespace Request {
|
|
@@ -467,6 +484,18 @@ export declare namespace Store {
|
|
|
467
484
|
/** 门店统计数据查询块 */
|
|
468
485
|
statisticsQuery?: QueryBlock.Statistics;
|
|
469
486
|
}
|
|
487
|
+
/** 绑定福利官 */
|
|
488
|
+
interface BindWelfareOfficial {
|
|
489
|
+
/** 门店ID */
|
|
490
|
+
storeIds: string[];
|
|
491
|
+
/** 福利官用户ID */
|
|
492
|
+
welfareOfficialUserId: string;
|
|
493
|
+
}
|
|
494
|
+
/** 通过门店获取福利官信息 */
|
|
495
|
+
interface GetWelfareOfficialByStoreId {
|
|
496
|
+
/** 门店ID */
|
|
497
|
+
storeId: string;
|
|
498
|
+
}
|
|
470
499
|
}
|
|
471
500
|
namespace Response {
|
|
472
501
|
/**
|
|
@@ -546,7 +575,10 @@ export declare namespace Store {
|
|
|
546
575
|
*/
|
|
547
576
|
interface GetStoreDetail {
|
|
548
577
|
/** 门店完整信息 */
|
|
549
|
-
store: Entity.StoreBasicInfo
|
|
578
|
+
store: Entity.StoreBasicInfo & {
|
|
579
|
+
/** 门店福利官信息 */
|
|
580
|
+
welfareOfficial?: Entity.WelfareOfficial;
|
|
581
|
+
};
|
|
550
582
|
}
|
|
551
583
|
/**
|
|
552
584
|
* 获取门店完整信息响应
|
|
@@ -568,6 +600,8 @@ export declare namespace Store {
|
|
|
568
600
|
storeUser?: Entity.StoreUser;
|
|
569
601
|
/** 统计信息 */
|
|
570
602
|
statistics?: Entity.StoreStatistics;
|
|
603
|
+
/** 门店福利官信息 */
|
|
604
|
+
welfareOfficial?: Entity.WelfareOfficial;
|
|
571
605
|
};
|
|
572
606
|
}
|
|
573
607
|
/**
|
|
@@ -590,6 +624,8 @@ export declare namespace Store {
|
|
|
590
624
|
storeUser?: Entity.StoreUser;
|
|
591
625
|
/** 门店统计数据(如果请求了该块) */
|
|
592
626
|
statistics?: Entity.StoreStatistics;
|
|
627
|
+
/** 门店福利官信息(如果请求了该块) */
|
|
628
|
+
welfareOfficial?: Entity.WelfareOfficial;
|
|
593
629
|
}>;
|
|
594
630
|
/** 未找到的门店ID列表 */
|
|
595
631
|
notFoundStoreIds?: string[];
|
|
@@ -614,6 +650,8 @@ export declare namespace Store {
|
|
|
614
650
|
storeUser?: Entity.StoreUser;
|
|
615
651
|
/** 门店统计数据(如果请求了该块) */
|
|
616
652
|
statistics?: Entity.StoreStatistics;
|
|
653
|
+
/** 门店福利官信息(如果请求了该块) */
|
|
654
|
+
welfareOfficial?: Entity.WelfareOfficial;
|
|
617
655
|
}>;
|
|
618
656
|
/** 总数 */
|
|
619
657
|
total: number;
|
|
@@ -648,6 +686,17 @@ export declare namespace Store {
|
|
|
648
686
|
/** 门店总数 */
|
|
649
687
|
totalStores: number;
|
|
650
688
|
}
|
|
689
|
+
/** 通过门店获取福利官信息响应 */
|
|
690
|
+
interface GetWelfareOfficialByStoreId {
|
|
691
|
+
/** 福利官用户ID */
|
|
692
|
+
welfareOfficialUserId: string;
|
|
693
|
+
/** 福利官姓名 */
|
|
694
|
+
welfareOfficialName: string;
|
|
695
|
+
/** 福利官企微id */
|
|
696
|
+
welfareOfficialQyUserId: string;
|
|
697
|
+
/** 福利官企微二维码 */
|
|
698
|
+
welfareOfficialQrCodeUrl: string;
|
|
699
|
+
}
|
|
651
700
|
}
|
|
652
701
|
/**
|
|
653
702
|
* Store Controller 接口定义
|
|
@@ -731,5 +780,9 @@ export declare namespace Store {
|
|
|
731
780
|
* @returns 响应数据
|
|
732
781
|
*/
|
|
733
782
|
getStoreCount(): Promise<Store.Response.GetStoreCount>;
|
|
783
|
+
/** 绑定福利官 */
|
|
784
|
+
bindWelfareOfficial(request: Store.Request.BindWelfareOfficial): Promise<void>;
|
|
785
|
+
/** 通过门店获取福利官信息 */
|
|
786
|
+
getWelfareOfficialByStoreId(request: Store.Request.GetWelfareOfficialByStoreId): Promise<Store.Response.GetWelfareOfficialByStoreId>;
|
|
734
787
|
}
|
|
735
788
|
}
|
package/modules/store/types.js
CHANGED
|
@@ -23,6 +23,8 @@ var Store;
|
|
|
23
23
|
BlockType["STORE_USER"] = "STORE_USER";
|
|
24
24
|
/** 门店统计数据表 */
|
|
25
25
|
BlockType["STATISTICS"] = "STATISTICS";
|
|
26
|
+
/** 门店福利官信息表 */
|
|
27
|
+
BlockType["WELFARE_OFFICIAL"] = "WELFARE_OFFICIAL";
|
|
26
28
|
})(BlockType = ResponseBlock.BlockType || (ResponseBlock.BlockType = {}));
|
|
27
29
|
})(ResponseBlock = Store.ResponseBlock || (Store.ResponseBlock = {}));
|
|
28
30
|
})(Store || (exports.Store = Store = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@be-link/ecommerce-store-service-node-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "EcommerceStoreService Node.js SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@be-link/ecommerce-tag-service-node-sdk": "
|
|
13
|
+
"@be-link/ecommerce-tag-service-node-sdk": "0.0.14",
|
|
14
14
|
"@fastify/request-context": "6.2.1",
|
|
15
15
|
"axios": "1.13.2",
|
|
16
16
|
"axios-retry": "4.0.0",
|
|
17
|
-
"safe-stable-stringify": "
|
|
17
|
+
"safe-stable-stringify": "2.4.3",
|
|
18
18
|
"uuid": "9.0.1",
|
|
19
|
-
"tsoa": "
|
|
20
|
-
"pino": "
|
|
21
|
-
"pino-pretty": "
|
|
22
|
-
"pino-roll": "
|
|
19
|
+
"tsoa": "6.6.0",
|
|
20
|
+
"pino": "10.1.0",
|
|
21
|
+
"pino-pretty": "13.1.3",
|
|
22
|
+
"pino-roll": "4.0.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "rm -rf ./dist && tsc && cp package.json README.md ./dist/ 2>/dev/null || true",
|
package/utils/http.js
CHANGED
|
@@ -89,24 +89,19 @@ 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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return responseData.data;
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
throw error;
|
|
111
|
-
}
|
|
92
|
+
const response = await axios_1.default.post(url, request || {}, {
|
|
93
|
+
headers: {
|
|
94
|
+
'x-request-id': requestId,
|
|
95
|
+
'x-belink-pandora-userid': pandoraUserId,
|
|
96
|
+
'x-belink-userid': beLinkUserId,
|
|
97
|
+
'x-belink-pandora-roleid': pandoraRoleId,
|
|
98
|
+
'x-real-ip': realIp,
|
|
99
|
+
Connection: 'keep-alive',
|
|
100
|
+
},
|
|
101
|
+
timeout: HTTP_CONFIG.requestTimeout,
|
|
102
|
+
httpAgent,
|
|
103
|
+
httpsAgent,
|
|
104
|
+
});
|
|
105
|
+
const responseData = response.data;
|
|
106
|
+
return responseData.data;
|
|
112
107
|
}
|