@be-link/ecommerce-client-backend-service-node-sdk 0.1.42 → 0.1.44

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
@@ -253,4 +253,19 @@ export declare namespace ENUM {
253
253
  Redirect = 3
254
254
  }
255
255
  }
256
+ /**
257
+ * MiniProgram 表枚举
258
+ */
259
+ namespace MINI_PROGRAM {
260
+ /** 状态:0-封禁,1-正常 */
261
+ enum DISPLAY {
262
+ Disabled = 0,
263
+ Enabled = 1
264
+ }
265
+ /** 是否使用中:0-否,1-是 */
266
+ enum USED {
267
+ No = 0,
268
+ Yes = 1
269
+ }
270
+ }
256
271
  }
package/enum.js CHANGED
@@ -288,4 +288,22 @@ var ENUM;
288
288
  CATE[CATE["Redirect"] = 3] = "Redirect";
289
289
  })(CATE = DOMAIN.CATE || (DOMAIN.CATE = {}));
290
290
  })(DOMAIN = ENUM.DOMAIN || (ENUM.DOMAIN = {}));
291
+ /**
292
+ * MiniProgram 表枚举
293
+ */
294
+ let MINI_PROGRAM;
295
+ (function (MINI_PROGRAM) {
296
+ /** 状态:0-封禁,1-正常 */
297
+ let DISPLAY;
298
+ (function (DISPLAY) {
299
+ DISPLAY[DISPLAY["Disabled"] = 0] = "Disabled";
300
+ DISPLAY[DISPLAY["Enabled"] = 1] = "Enabled";
301
+ })(DISPLAY = MINI_PROGRAM.DISPLAY || (MINI_PROGRAM.DISPLAY = {}));
302
+ /** 是否使用中:0-否,1-是 */
303
+ let USED;
304
+ (function (USED) {
305
+ USED[USED["No"] = 0] = "No";
306
+ USED[USED["Yes"] = 1] = "Yes";
307
+ })(USED = MINI_PROGRAM.USED || (MINI_PROGRAM.USED = {}));
308
+ })(MINI_PROGRAM = ENUM.MINI_PROGRAM || (ENUM.MINI_PROGRAM = {}));
291
309
  })(ENUM || (exports.ENUM = ENUM = {}));
package/index.d.ts CHANGED
@@ -2,10 +2,13 @@ export type { RoomService } from './modules/room/types';
2
2
  export type { DataService } from './modules/data/types';
3
3
  export type { DomainService } from './modules/domain/types';
4
4
  export type { RuleService } from './modules/rule/types';
5
+ export type { MiniProgramService } from './modules/miniprogram/types';
5
6
  export { roomService } from './modules/room/service';
6
7
  export { dataService } from './modules/data/service';
7
8
  export { domainService } from './modules/domain/service';
8
9
  export { ruleService } from './modules/rule/service';
10
+ export { miniProgramService } from './modules/miniprogram/service';
9
11
  export { ENUM as CLIENT_BACKEND_ENUM } from './enum';
10
12
  export type { Room, RoomAutoStartConfig, RoomLoopVideo, RoomTag, RoomBindStore } from './types';
11
13
  export type { Domain, Current } from './modules/domain/types';
14
+ export type { MiniProgram, Info as MiniProgramInfo } from './modules/miniprogram/types';
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLIENT_BACKEND_ENUM = exports.ruleService = exports.domainService = exports.dataService = exports.roomService = void 0;
3
+ exports.CLIENT_BACKEND_ENUM = exports.miniProgramService = exports.ruleService = exports.domainService = exports.dataService = 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/data/service");
@@ -9,6 +9,8 @@ var service_3 = require("./modules/domain/service");
9
9
  Object.defineProperty(exports, "domainService", { enumerable: true, get: function () { return service_3.domainService; } });
10
10
  var service_4 = require("./modules/rule/service");
11
11
  Object.defineProperty(exports, "ruleService", { enumerable: true, get: function () { return service_4.ruleService; } });
12
+ var service_5 = require("./modules/miniprogram/service");
13
+ Object.defineProperty(exports, "miniProgramService", { enumerable: true, get: function () { return service_5.miniProgramService; } });
12
14
  var enum_1 = require("./enum");
13
15
  Object.defineProperty(exports, "CLIENT_BACKEND_ENUM", { enumerable: true, get: function () { return enum_1.ENUM; } });
14
16
  // 服务.模块.枚举名称.枚举值 示例: DEMO_ENUM.ORDER_ENUM.STATUS.PENDING
@@ -249,6 +249,12 @@ export interface Audience {
249
249
  source: ENUM.LIVE_STREAM_AUDIENCE.VIEW_TYPE;
250
250
  /** 门店id */
251
251
  storeId: string;
252
+ /** 门店名称 */
253
+ storeName: string;
254
+ /** BD 负责人 ID */
255
+ bdDisplayId: string;
256
+ /** BD 负责人姓名 */
257
+ bdName: string;
252
258
  /** 用户id */
253
259
  userId: string;
254
260
  /** 用户名称 */
@@ -0,0 +1,16 @@
1
+ import { MiniProgramService } from './types';
2
+ import BaseService from '../BaseService';
3
+ declare class MiniProgramServiceClass extends BaseService implements MiniProgramService.BaseController {
4
+ protected prefixUrl: string;
5
+ used(): Promise<MiniProgramService.Response.Used>;
6
+ list(request: MiniProgramService.Request.List): Promise<MiniProgramService.Response.List>;
7
+ create(request: MiniProgramService.Request.Create): Promise<void>;
8
+ update(request: MiniProgramService.Request.Update): Promise<void>;
9
+ display(request: MiniProgramService.Request.Display): Promise<void>;
10
+ setUsed(request: MiniProgramService.Request.Used): Promise<void>;
11
+ getSecretByAppId(request: MiniProgramService.Request.GetSecretByAppId): Promise<MiniProgramService.Response.GetSecretByAppId>;
12
+ checkAppIdUsed(request: MiniProgramService.Request.CheckAppIdUsed): Promise<MiniProgramService.Response.CheckAppIdUsed>;
13
+ delete(request: MiniProgramService.Request.Delete): Promise<void>;
14
+ }
15
+ export declare const miniProgramService: MiniProgramServiceClass;
16
+ export default miniProgramService;
@@ -0,0 +1,101 @@
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.miniProgramService = void 0;
16
+ const tsoa_1 = require("tsoa");
17
+ const http_1 = require("../../utils/http");
18
+ const BaseService_1 = __importDefault(require("../BaseService"));
19
+ let MiniProgramServiceClass = class MiniProgramServiceClass extends BaseService_1.default {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.prefixUrl = '/mini-program';
23
+ }
24
+ used() {
25
+ return (0, http_1.callApi)(this.getApiUrl(this.used), undefined);
26
+ }
27
+ list(request) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.list), request);
29
+ }
30
+ create(request) {
31
+ return (0, http_1.callApi)(this.getApiUrl(this.create), request);
32
+ }
33
+ update(request) {
34
+ return (0, http_1.callApi)(this.getApiUrl(this.update), request);
35
+ }
36
+ display(request) {
37
+ return (0, http_1.callApi)(this.getApiUrl(this.display), request);
38
+ }
39
+ setUsed(request) {
40
+ return (0, http_1.callApi)(this.getApiUrl(this.setUsed), request);
41
+ }
42
+ getSecretByAppId(request) {
43
+ return (0, http_1.callApi)(this.getApiUrl(this.getSecretByAppId), request);
44
+ }
45
+ checkAppIdUsed(request) {
46
+ return (0, http_1.callApi)(this.getApiUrl(this.checkAppIdUsed), request);
47
+ }
48
+ delete(request) {
49
+ return (0, http_1.callApi)(this.getApiUrl(this.delete), request);
50
+ }
51
+ };
52
+ __decorate([
53
+ (0, tsoa_1.OperationId)('获取当前正在使用的小程序信息'),
54
+ (0, tsoa_1.Post)('used')
55
+ ], MiniProgramServiceClass.prototype, "used", null);
56
+ __decorate([
57
+ (0, tsoa_1.OperationId)('小程序列表查询'),
58
+ (0, tsoa_1.Post)('list'),
59
+ __param(0, (0, tsoa_1.Body)())
60
+ ], MiniProgramServiceClass.prototype, "list", null);
61
+ __decorate([
62
+ (0, tsoa_1.OperationId)('创建小程序'),
63
+ (0, tsoa_1.Post)('create'),
64
+ __param(0, (0, tsoa_1.Body)())
65
+ ], MiniProgramServiceClass.prototype, "create", null);
66
+ __decorate([
67
+ (0, tsoa_1.OperationId)('更新小程序'),
68
+ (0, tsoa_1.Post)('update'),
69
+ __param(0, (0, tsoa_1.Body)())
70
+ ], MiniProgramServiceClass.prototype, "update", null);
71
+ __decorate([
72
+ (0, tsoa_1.OperationId)('设置小程序显示状态'),
73
+ (0, tsoa_1.Post)('display'),
74
+ __param(0, (0, tsoa_1.Body)())
75
+ ], MiniProgramServiceClass.prototype, "display", null);
76
+ __decorate([
77
+ (0, tsoa_1.OperationId)('设置小程序使用状态'),
78
+ (0, tsoa_1.Post)('set-used'),
79
+ __param(0, (0, tsoa_1.Body)())
80
+ ], MiniProgramServiceClass.prototype, "setUsed", null);
81
+ __decorate([
82
+ (0, tsoa_1.OperationId)('根据AppId获取Secret'),
83
+ (0, tsoa_1.Post)('get-secret-by-appid'),
84
+ __param(0, (0, tsoa_1.Body)())
85
+ ], MiniProgramServiceClass.prototype, "getSecretByAppId", null);
86
+ __decorate([
87
+ (0, tsoa_1.OperationId)('检查AppId是否正在使用中'),
88
+ (0, tsoa_1.Post)('check-appid-used'),
89
+ __param(0, (0, tsoa_1.Body)())
90
+ ], MiniProgramServiceClass.prototype, "checkAppIdUsed", null);
91
+ __decorate([
92
+ (0, tsoa_1.OperationId)('删除小程序'),
93
+ (0, tsoa_1.Post)('delete'),
94
+ __param(0, (0, tsoa_1.Body)())
95
+ ], MiniProgramServiceClass.prototype, "delete", null);
96
+ MiniProgramServiceClass = __decorate([
97
+ (0, tsoa_1.Route)('mini-program'),
98
+ (0, tsoa_1.Tags)('MiniProgram')
99
+ ], MiniProgramServiceClass);
100
+ exports.miniProgramService = new MiniProgramServiceClass();
101
+ exports.default = exports.miniProgramService;
@@ -0,0 +1,167 @@
1
+ import { FastifyRequest } from 'fastify';
2
+ import { ENUM } from '../../enum';
3
+ export declare namespace MiniProgramService {
4
+ /**
5
+ * 请求参数
6
+ */
7
+ namespace Request {
8
+ /**
9
+ * 小程序列表查询
10
+ */
11
+ interface List {
12
+ /** 关键词搜索:小程序名称或 AppId */
13
+ keywords?: string;
14
+ /** 状态:0-封禁、1-正常 */
15
+ display?: ENUM.MINI_PROGRAM.DISPLAY;
16
+ /** 页码,从0开始 */
17
+ pageIndex: number;
18
+ /** 每页数量,默认20,最大100 */
19
+ pageSize?: number;
20
+ }
21
+ /**
22
+ * 创建小程序
23
+ */
24
+ interface Create {
25
+ /** 公司主体 */
26
+ corporate: string;
27
+ /** 小程序名称 */
28
+ name: string;
29
+ /** 小程序 AppId */
30
+ appId: string;
31
+ /** 小程序 Secret */
32
+ secret: string;
33
+ }
34
+ /**
35
+ * 更新小程序
36
+ */
37
+ interface Update {
38
+ /** 自增ID */
39
+ id: number;
40
+ /** 公司主体 */
41
+ corporate?: string;
42
+ /** 小程序名称 */
43
+ name?: string;
44
+ /** 小程序 AppId */
45
+ appId?: string;
46
+ /** 小程序 Secret */
47
+ secret?: string;
48
+ }
49
+ /**
50
+ * 设置小程序显示状态
51
+ */
52
+ interface Display {
53
+ /** 自增ID */
54
+ id: number;
55
+ /** 状态:0-封禁、1-正常 */
56
+ display: ENUM.MINI_PROGRAM.DISPLAY;
57
+ }
58
+ /**
59
+ * 设置小程序使用状态
60
+ */
61
+ interface Used {
62
+ /** 自增ID */
63
+ id: number;
64
+ }
65
+ /**
66
+ * 根据 AppId 获取 Secret
67
+ */
68
+ interface GetSecretByAppId {
69
+ /** 小程序 AppId */
70
+ appId: string;
71
+ }
72
+ /**
73
+ * 检查 AppId 是否正在使用中
74
+ */
75
+ interface CheckAppIdUsed {
76
+ /** 小程序 AppId */
77
+ appId: string;
78
+ }
79
+ /**
80
+ * 删除小程序
81
+ */
82
+ interface Delete {
83
+ id: number;
84
+ }
85
+ }
86
+ /**
87
+ * 响应参数
88
+ */
89
+ namespace Response {
90
+ /**
91
+ * 当前正在使用的小程序信息
92
+ */
93
+ interface Used {
94
+ used: Info | null;
95
+ }
96
+ /**
97
+ * 小程序列表
98
+ */
99
+ interface List {
100
+ list: MiniProgram[];
101
+ total: number;
102
+ }
103
+ /**
104
+ * 根据 AppId 获取 Secret
105
+ */
106
+ interface GetSecretByAppId {
107
+ /** 小程序 appId -> Secret */
108
+ [appId: string]: string;
109
+ }
110
+ /**
111
+ * 检查 AppId 是否正在使用中
112
+ */
113
+ interface CheckAppIdUsed {
114
+ /** 是否正在使用中 */
115
+ used: boolean;
116
+ }
117
+ }
118
+ interface BaseController {
119
+ used(req?: FastifyRequest): Promise<Response.Used>;
120
+ list(request: Request.List, req?: FastifyRequest): Promise<Response.List>;
121
+ create(request: Request.Create, req?: FastifyRequest): Promise<void>;
122
+ update(request: Request.Update, req?: FastifyRequest): Promise<void>;
123
+ display(request: Request.Display, req?: FastifyRequest): Promise<void>;
124
+ setUsed(request: Request.Used, req?: FastifyRequest): Promise<void>;
125
+ getSecretByAppId(request: Request.GetSecretByAppId, req?: FastifyRequest): Promise<Response.GetSecretByAppId>;
126
+ checkAppIdUsed(request: Request.CheckAppIdUsed, req?: FastifyRequest): Promise<Response.CheckAppIdUsed>;
127
+ delete(request: Request.Delete, req?: FastifyRequest): Promise<void>;
128
+ }
129
+ }
130
+ export interface MiniProgram {
131
+ /** 自增ID */
132
+ id: number;
133
+ /** 公司主体 */
134
+ corporate: string;
135
+ /** 小程序名称 */
136
+ name: string;
137
+ /** 小程序 AppId */
138
+ appId: string;
139
+ /** 小程序 Secret */
140
+ secret: string;
141
+ /** 状态:0-封禁、1-正常 */
142
+ display: ENUM.MINI_PROGRAM.DISPLAY;
143
+ /** 是否使用中:0-否、1-是 */
144
+ used: ENUM.MINI_PROGRAM.USED;
145
+ /** 创建时间 */
146
+ createdAt: number;
147
+ /** 更新时间 */
148
+ updatedAt: number;
149
+ /** 删除时间 */
150
+ deletedAt: number;
151
+ }
152
+ export interface Info {
153
+ /** 自增ID */
154
+ id: number;
155
+ /** 公司主体 */
156
+ corporate: string;
157
+ /** 小程序名称 */
158
+ name: string;
159
+ /** 小程序 AppId */
160
+ appId: string;
161
+ /** 小程序 Secret */
162
+ secret: string;
163
+ /** 状态:0-封禁、1-正常 */
164
+ display: ENUM.MINI_PROGRAM.DISPLAY;
165
+ /** 是否使用中:0-否、1-是 */
166
+ used: ENUM.MINI_PROGRAM.USED;
167
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -44,6 +44,8 @@ export declare namespace RuleService {
44
44
  liveStreamRoomId: string;
45
45
  /** 门店id */
46
46
  storeId: string;
47
+ /** 调用平台:client-客户端、backend-后台 */
48
+ platform?: string;
47
49
  }
48
50
  }
49
51
  namespace Response {
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.42",
3
+ "version": "0.1.44",
4
4
  "description": "EcommerceClientBackendService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",