revdev 0.331.0 → 0.332.0
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/lib/back/admin/entity.d.ts +22 -0
- package/lib/back/admin/entity.js +2 -0
- package/lib/back/admin/index.d.ts +2 -0
- package/lib/back/admin/index.js +18 -0
- package/lib/back/admin/request.d.ts +19 -0
- package/lib/back/admin/request.js +2 -0
- package/lib/back/auth/entity.d.ts +11 -0
- package/lib/back/common/entity.d.ts +2 -0
- package/lib/back/index.d.ts +1 -0
- package/lib/back/index.js +1 -0
- package/lib/common/enums.d.ts +13 -0
- package/lib/common/enums.js +15 -1
- package/lib/common/exception.d.ts +1 -0
- package/lib/common/exception.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PermissionName, ValueOption } from "../../common";
|
|
2
|
+
export interface BoAdminPermissionOption {
|
|
3
|
+
name: PermissionName;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BoRoleModifier {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
permissions: PermissionName[];
|
|
10
|
+
}
|
|
11
|
+
export interface BoAdminRoleRecord extends BoRoleModifier {
|
|
12
|
+
}
|
|
13
|
+
export interface BoAdminModifier {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
username: string;
|
|
17
|
+
email: string;
|
|
18
|
+
roles: ValueOption[];
|
|
19
|
+
}
|
|
20
|
+
export interface BoAdminRecord extends BoAdminModifier {
|
|
21
|
+
created: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./entity"), exports);
|
|
18
|
+
__exportStar(require("./request"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PermissionName } from "../../common";
|
|
2
|
+
export interface BoCreateRoleRequest {
|
|
3
|
+
name: string;
|
|
4
|
+
permissions: PermissionName[];
|
|
5
|
+
}
|
|
6
|
+
export interface BoUpdateRoleRequest extends BoCreateRoleRequest {
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BoCreateAdminRequest {
|
|
10
|
+
name: string;
|
|
11
|
+
email: string;
|
|
12
|
+
username: string;
|
|
13
|
+
password: string;
|
|
14
|
+
roleIds: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface BoUpdateAdminRequest extends Omit<BoCreateAdminRequest, "password"> {
|
|
17
|
+
id: string;
|
|
18
|
+
password?: string;
|
|
19
|
+
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import { PermissionName } from "../../common";
|
|
1
2
|
export interface BoLoginRequest {
|
|
2
3
|
username: string;
|
|
3
4
|
password: string;
|
|
4
5
|
}
|
|
6
|
+
export interface BoAuthUser {
|
|
7
|
+
name: string;
|
|
8
|
+
username: string;
|
|
9
|
+
email: string;
|
|
10
|
+
permissions: PermissionName[];
|
|
11
|
+
}
|
|
12
|
+
export interface BoAuthLoginResponse {
|
|
13
|
+
token: string;
|
|
14
|
+
user: BoAuthUser;
|
|
15
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IdCodeOption, StringOption } from "../../common";
|
|
2
2
|
import { AppSettings } from "../../shared";
|
|
3
|
+
import { BoAdminPermissionOption } from "../admin";
|
|
3
4
|
export interface BoInitData {
|
|
4
5
|
langOptions: StringOption[];
|
|
5
6
|
speechPartOptions: IdCodeOption[];
|
|
6
7
|
quizCodes: string[];
|
|
7
8
|
localeCodes: string[];
|
|
8
9
|
settings: AppSettings;
|
|
10
|
+
permissionOptions: BoAdminPermissionOption[];
|
|
9
11
|
}
|
package/lib/back/index.d.ts
CHANGED
package/lib/back/index.js
CHANGED
|
@@ -36,4 +36,5 @@ __exportStar(require("./episode"), exports);
|
|
|
36
36
|
__exportStar(require("./exercise"), exports);
|
|
37
37
|
__exportStar(require("./item"), exports);
|
|
38
38
|
__exportStar(require("./rule"), exports);
|
|
39
|
+
__exportStar(require("./admin"), exports);
|
|
39
40
|
__exportStar(require("./ai"), exports);
|
package/lib/common/enums.d.ts
CHANGED
|
@@ -101,6 +101,19 @@ export declare enum AudioSex {
|
|
|
101
101
|
Male = "male",
|
|
102
102
|
Female = "female"
|
|
103
103
|
}
|
|
104
|
+
export declare enum PermissionName {
|
|
105
|
+
Admin = "admin",
|
|
106
|
+
ManageLang = "manageLang",
|
|
107
|
+
ManageWord = "manageWord",
|
|
108
|
+
ManageList = "manageList",
|
|
109
|
+
ManageTable = "manageTable",
|
|
110
|
+
ManageUser = "manageUser",
|
|
111
|
+
ManageSmm = "manageSmm",
|
|
112
|
+
ManageCourse = "manageCourse",
|
|
113
|
+
ManageRule = "manageRule",
|
|
114
|
+
ManageImage = "manageImage",
|
|
115
|
+
ManageAI = "manageAI"
|
|
116
|
+
}
|
|
104
117
|
export declare enum AiPromptName {
|
|
105
118
|
WordTags = "wordTags",
|
|
106
119
|
Rule = "rule"
|
package/lib/common/enums.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AiPromptName = exports.AudioSex = exports.ImageKind = exports.AudioKind = exports.PointerMode = exports.ContentType = exports.PositionDirection = exports.PassExerciseStatus = exports.PassEpisodeStatus = exports.PassStatus = exports.PostStatus = exports.SetType = exports.ItemType = exports.ExerciseMode = exports.ExerciseType = exports.SmmCampaignType = exports.SmmCampaignStatus = exports.SocialProvider = exports.EntryStatus = exports.QuizMode = exports.UserReaction = exports.WordMode = exports.Knowing = void 0;
|
|
3
|
+
exports.AiPromptName = exports.PermissionName = exports.AudioSex = exports.ImageKind = exports.AudioKind = exports.PointerMode = exports.ContentType = exports.PositionDirection = exports.PassExerciseStatus = exports.PassEpisodeStatus = exports.PassStatus = exports.PostStatus = exports.SetType = exports.ItemType = exports.ExerciseMode = exports.ExerciseType = exports.SmmCampaignType = exports.SmmCampaignStatus = exports.SocialProvider = exports.EntryStatus = exports.QuizMode = exports.UserReaction = exports.WordMode = exports.Knowing = void 0;
|
|
4
4
|
var Knowing;
|
|
5
5
|
(function (Knowing) {
|
|
6
6
|
Knowing[Knowing["Known"] = 1] = "Known";
|
|
@@ -130,6 +130,20 @@ var AudioSex;
|
|
|
130
130
|
AudioSex["Male"] = "male";
|
|
131
131
|
AudioSex["Female"] = "female";
|
|
132
132
|
})(AudioSex || (exports.AudioSex = AudioSex = {}));
|
|
133
|
+
var PermissionName;
|
|
134
|
+
(function (PermissionName) {
|
|
135
|
+
PermissionName["Admin"] = "admin";
|
|
136
|
+
PermissionName["ManageLang"] = "manageLang";
|
|
137
|
+
PermissionName["ManageWord"] = "manageWord";
|
|
138
|
+
PermissionName["ManageList"] = "manageList";
|
|
139
|
+
PermissionName["ManageTable"] = "manageTable";
|
|
140
|
+
PermissionName["ManageUser"] = "manageUser";
|
|
141
|
+
PermissionName["ManageSmm"] = "manageSmm";
|
|
142
|
+
PermissionName["ManageCourse"] = "manageCourse";
|
|
143
|
+
PermissionName["ManageRule"] = "manageRule";
|
|
144
|
+
PermissionName["ManageImage"] = "manageImage";
|
|
145
|
+
PermissionName["ManageAI"] = "manageAI";
|
|
146
|
+
})(PermissionName || (exports.PermissionName = PermissionName = {}));
|
|
133
147
|
var AiPromptName;
|
|
134
148
|
(function (AiPromptName) {
|
|
135
149
|
AiPromptName["WordTags"] = "wordTags";
|
|
@@ -7,6 +7,7 @@ export interface ExceptionClass {
|
|
|
7
7
|
export declare enum ExceptionCodes {
|
|
8
8
|
ParameterInvalid = "ParameterInvalid",
|
|
9
9
|
InvalidConfigEnv = "InvalidConfigEnv",
|
|
10
|
+
InsufficientPermission = "InsufficientPermission",
|
|
10
11
|
UsernameExists = "UsernameExists",
|
|
11
12
|
UsernameInvalid = "UsernameInvalid",
|
|
12
13
|
EmailExists = "EmailExists",
|
package/lib/common/exception.js
CHANGED
|
@@ -6,6 +6,7 @@ var ExceptionCodes;
|
|
|
6
6
|
// common
|
|
7
7
|
ExceptionCodes["ParameterInvalid"] = "ParameterInvalid";
|
|
8
8
|
ExceptionCodes["InvalidConfigEnv"] = "InvalidConfigEnv";
|
|
9
|
+
ExceptionCodes["InsufficientPermission"] = "InsufficientPermission";
|
|
9
10
|
// auth
|
|
10
11
|
ExceptionCodes["UsernameExists"] = "UsernameExists";
|
|
11
12
|
ExceptionCodes["UsernameInvalid"] = "UsernameInvalid";
|