@tachybase/module-user 1.3.25 → 1.5.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.
@@ -1,11 +1,48 @@
1
1
  {
2
+ "Active": "正常",
3
+ "Add status": "添加状态",
2
4
  "Add users": "添加用户",
5
+ "Allow Login": "允许登录",
3
6
  "Are you sure you want to remove it?": "你确定要移除吗?",
7
+ "Auto": "自动",
8
+ "Color": "颜色",
9
+ "Created At": "创建时间",
10
+ "Created By": "操作人",
11
+ "Delete statuses": "删除状态",
12
+ "Description": "描述",
13
+ "Edit status": "编辑状态",
4
14
  "Edited successfully": "编辑成功",
15
+ "Expire At": "过期时间",
16
+ "From Status": "变更前状态",
17
+ "Login Error Message": "登录错误提示",
18
+ "Manual": "手动",
19
+ "Manually disabled by administrator": "管理员手动禁用",
20
+ "Normal active user": "正常活跃用户",
21
+ "Operation Type": "操作类型",
22
+ "Package Name": "包名",
23
+ "Pending": "待审核",
5
24
  "Please fill in your mobile phone number in your personal information first": "请先在个人资料填写手机号",
25
+ "Previous Status": "原状态",
6
26
  "Random password": "随机密码",
27
+ "Reason": "变更原因",
7
28
  "Remove user": "移除用户",
8
29
  "Send verification code to phone: {{phoneNumber}}": "将发送验证码给手机:{{phoneNumber}}",
30
+ "Sort": "排序",
31
+ "Status": "状态",
32
+ "Status Expire At": "状态过期时间",
33
+ "Status Key": "状态键",
34
+ "Status Reason": "状态变更原因",
35
+ "Status Title": "状态名称",
36
+ "System": "系统",
37
+ "System Defined": "系统内置",
38
+ "To Status": "变更后状态",
39
+ "User": "用户",
40
+ "User ID": "用户ID",
41
+ "User Status Histories": "用户状态历史",
42
+ "User Statuses": "用户状态",
43
+ "User waiting for approval": "用户等待审核",
9
44
  "Users & Permissions": "用户和权限",
10
- "Users Settings": "用户设置"
45
+ "Users Settings": "用户设置",
46
+ "Your account has been disabled, please contact administrator if you have any questions": "您的账号已被禁用,如有疑问请联系管理员",
47
+ "Your account is under review, please wait for administrator approval": "您的账号正在审核中,请等待管理员批准"
11
48
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@tego/server").CollectionOptions;
2
+ export default _default;
@@ -0,0 +1,180 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var userStatusHistories_exports = {};
19
+ __export(userStatusHistories_exports, {
20
+ default: () => userStatusHistories_default
21
+ });
22
+ module.exports = __toCommonJS(userStatusHistories_exports);
23
+ var import_server = require("@tego/server");
24
+ var userStatusHistories_default = (0, import_server.defineCollection)({
25
+ origin: "@tachybase/module-user",
26
+ dumpRules: {
27
+ group: "log"
28
+ },
29
+ name: "userStatusHistories",
30
+ title: '{{t("User Status Histories")}}',
31
+ createdAt: true,
32
+ createdBy: true,
33
+ fields: [
34
+ {
35
+ type: "bigInt",
36
+ name: "id",
37
+ autoIncrement: true,
38
+ primaryKey: true,
39
+ allowNull: false,
40
+ uiSchema: {
41
+ type: "number",
42
+ title: '{{t("ID")}}',
43
+ "x-component": "InputNumber",
44
+ "x-read-pretty": true
45
+ }
46
+ },
47
+ {
48
+ type: "bigInt",
49
+ name: "userId",
50
+ allowNull: false,
51
+ comment: "\u7528\u6237ID",
52
+ uiSchema: {
53
+ type: "number",
54
+ title: '{{t("User ID")}}',
55
+ "x-component": "InputNumber",
56
+ "x-read-pretty": true
57
+ }
58
+ },
59
+ {
60
+ type: "string",
61
+ name: "fromStatus",
62
+ comment: "\u53D8\u66F4\u524D\u72B6\u6001",
63
+ uiSchema: {
64
+ type: "string",
65
+ title: '{{t("From Status")}}',
66
+ "x-component": "Input",
67
+ "x-read-pretty": true
68
+ }
69
+ },
70
+ {
71
+ type: "string",
72
+ name: "toStatus",
73
+ allowNull: false,
74
+ comment: "\u53D8\u66F4\u540E\u72B6\u6001",
75
+ uiSchema: {
76
+ type: "string",
77
+ title: '{{t("To Status")}}',
78
+ "x-component": "Input",
79
+ "x-read-pretty": true
80
+ }
81
+ },
82
+ {
83
+ type: "text",
84
+ name: "reason",
85
+ comment: "\u53D8\u66F4\u539F\u56E0",
86
+ uiSchema: {
87
+ type: "string",
88
+ title: '{{t("Reason")}}',
89
+ "x-component": "Input.TextArea",
90
+ "x-read-pretty": true
91
+ }
92
+ },
93
+ {
94
+ type: "date",
95
+ name: "expireAt",
96
+ comment: "\u8BBE\u7F6E\u7684\u8FC7\u671F\u65F6\u95F4\uFF08\u5982\u6709\uFF09",
97
+ uiSchema: {
98
+ type: "string",
99
+ title: '{{t("Expire At")}}',
100
+ "x-component": "DatePicker",
101
+ "x-component-props": {
102
+ showTime: true
103
+ },
104
+ "x-read-pretty": true
105
+ }
106
+ },
107
+ {
108
+ type: "string",
109
+ name: "operationType",
110
+ defaultValue: "manual",
111
+ allowNull: false,
112
+ comment: "\u64CD\u4F5C\u7C7B\u578B\uFF1Amanual-\u624B\u52A8, auto-\u81EA\u52A8, system-\u7CFB\u7EDF",
113
+ uiSchema: {
114
+ type: "string",
115
+ title: '{{t("Operation Type")}}',
116
+ "x-component": "Select",
117
+ enum: [
118
+ { label: '{{t("Manual")}}', value: "manual" },
119
+ { label: '{{t("Auto")}}', value: "auto" },
120
+ { label: '{{t("System")}}', value: "system" }
121
+ ],
122
+ "x-read-pretty": true
123
+ }
124
+ },
125
+ {
126
+ type: "belongsTo",
127
+ name: "user",
128
+ target: "users",
129
+ foreignKey: "userId",
130
+ onDelete: "CASCADE",
131
+ uiSchema: {
132
+ type: "object",
133
+ title: '{{t("User")}}',
134
+ "x-component": "AssociationField",
135
+ "x-component-props": {
136
+ fieldNames: {
137
+ label: "nickname",
138
+ value: "id"
139
+ }
140
+ }
141
+ }
142
+ },
143
+ {
144
+ type: "belongsTo",
145
+ name: "fromStatusInfo",
146
+ target: "userStatuses",
147
+ foreignKey: "fromStatus",
148
+ targetKey: "key",
149
+ uiSchema: {
150
+ type: "object",
151
+ title: '{{t("From Status")}}',
152
+ "x-component": "AssociationField",
153
+ "x-component-props": {
154
+ fieldNames: {
155
+ label: "title",
156
+ value: "key"
157
+ }
158
+ }
159
+ }
160
+ },
161
+ {
162
+ type: "belongsTo",
163
+ name: "toStatusInfo",
164
+ target: "userStatuses",
165
+ foreignKey: "toStatus",
166
+ targetKey: "key",
167
+ uiSchema: {
168
+ type: "object",
169
+ title: '{{t("To Status")}}',
170
+ "x-component": "AssociationField",
171
+ "x-component-props": {
172
+ fieldNames: {
173
+ label: "title",
174
+ value: "key"
175
+ }
176
+ }
177
+ }
178
+ }
179
+ ]
180
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@tego/server").CollectionOptions;
2
+ export default _default;
@@ -0,0 +1,144 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var userStatuses_exports = {};
19
+ __export(userStatuses_exports, {
20
+ default: () => userStatuses_default
21
+ });
22
+ module.exports = __toCommonJS(userStatuses_exports);
23
+ var import_server = require("@tego/server");
24
+ var userStatuses_default = (0, import_server.defineCollection)({
25
+ origin: "@tachybase/module-user",
26
+ dumpRules: {
27
+ group: "user"
28
+ },
29
+ name: "userStatuses",
30
+ title: '{{t("User Statuses")}}',
31
+ sortable: "sort",
32
+ fields: [
33
+ {
34
+ type: "string",
35
+ name: "key",
36
+ primaryKey: true,
37
+ allowNull: false,
38
+ unique: true,
39
+ comment: "\u72B6\u6001\u552F\u4E00\u6807\u8BC6",
40
+ uiSchema: {
41
+ type: "string",
42
+ title: '{{t("Status Key")}}',
43
+ "x-component": "Input",
44
+ required: true
45
+ }
46
+ },
47
+ {
48
+ type: "string",
49
+ name: "title",
50
+ allowNull: false,
51
+ comment: "\u72B6\u6001\u663E\u793A\u540D\u79F0",
52
+ uiSchema: {
53
+ type: "string",
54
+ title: '{{t("Status Title")}}',
55
+ "x-component": "Input",
56
+ required: true
57
+ }
58
+ },
59
+ {
60
+ type: "string",
61
+ name: "color",
62
+ defaultValue: "default",
63
+ comment: "\u72B6\u6001\u6807\u8BC6\u989C\u8272",
64
+ uiSchema: {
65
+ type: "string",
66
+ title: '{{t("Color")}}',
67
+ "x-component": "ColorPicker"
68
+ }
69
+ },
70
+ {
71
+ type: "boolean",
72
+ name: "allowLogin",
73
+ defaultValue: true,
74
+ allowNull: false,
75
+ comment: "\u662F\u5426\u5141\u8BB8\u767B\u5F55",
76
+ uiSchema: {
77
+ type: "boolean",
78
+ title: '{{t("Allow Login")}}',
79
+ "x-component": "Checkbox"
80
+ }
81
+ },
82
+ {
83
+ type: "text",
84
+ name: "loginErrorMessage",
85
+ comment: "\u4E0D\u5141\u8BB8\u767B\u5F55\u65F6\u7684\u9519\u8BEF\u63D0\u793A\u4FE1\u606F",
86
+ uiSchema: {
87
+ type: "string",
88
+ title: '{{t("Login Error Message")}}',
89
+ "x-component": "Input.TextArea"
90
+ }
91
+ },
92
+ {
93
+ type: "boolean",
94
+ name: "isSystemDefined",
95
+ defaultValue: false,
96
+ allowNull: false,
97
+ comment: "\u662F\u5426\u7CFB\u7EDF\u5185\u7F6E\uFF08\u4E0D\u53EF\u5220\u9664\uFF09",
98
+ uiSchema: {
99
+ type: "boolean",
100
+ title: '{{t("System Defined")}}',
101
+ "x-component": "Checkbox",
102
+ "x-read-pretty": true
103
+ }
104
+ },
105
+ {
106
+ type: "integer",
107
+ name: "sort",
108
+ defaultValue: 0,
109
+ comment: "\u6392\u5E8F\u6743\u91CD",
110
+ uiSchema: {
111
+ type: "number",
112
+ title: '{{t("Sort")}}',
113
+ "x-component": "InputNumber"
114
+ }
115
+ },
116
+ {
117
+ type: "string",
118
+ name: "packageName",
119
+ comment: "\u5B9A\u4E49\u8BE5\u72B6\u6001\u7684\u63D2\u4EF6\u5305\u540D\uFF0C\u7CFB\u7EDF\u5185\u7F6E\u4E3A@tachybase/module-user",
120
+ uiSchema: {
121
+ type: "string",
122
+ title: '{{t("Package Name")}}',
123
+ "x-component": "Input",
124
+ "x-read-pretty": true
125
+ }
126
+ },
127
+ {
128
+ type: "text",
129
+ name: "description",
130
+ comment: "\u72B6\u6001\u63CF\u8FF0\u8BF4\u660E",
131
+ uiSchema: {
132
+ type: "string",
133
+ title: '{{t("Description")}}',
134
+ "x-component": "Input.TextArea"
135
+ }
136
+ },
137
+ {
138
+ type: "json",
139
+ name: "config",
140
+ defaultValue: {},
141
+ comment: "\u6269\u5C55\u914D\u7F6E\u9879"
142
+ }
143
+ ]
144
+ });
@@ -122,6 +122,109 @@ var users_default = (0, import_server.defineCollection)({
122
122
  {
123
123
  type: "string",
124
124
  name: "specialRole"
125
+ },
126
+ {
127
+ type: "string",
128
+ name: "status",
129
+ defaultValue: "active",
130
+ comment: "\u7528\u6237\u72B6\u6001\uFF1Aactive-\u6B63\u5E38, pending-\u5F85\u5BA1\u6838, locked-\u9501\u5B9A, disabled-\u505C\u7528",
131
+ uiSchema: {
132
+ type: "string",
133
+ title: '{{t("Status")}}',
134
+ "x-component": "Select",
135
+ "x-component-props": {
136
+ fieldNames: {
137
+ label: "title",
138
+ value: "key"
139
+ }
140
+ }
141
+ }
142
+ },
143
+ {
144
+ type: "date",
145
+ name: "statusExpireAt",
146
+ comment: "\u72B6\u6001\u8FC7\u671F\u65F6\u95F4\uFF0Cnull\u8868\u793A\u6C38\u4E45",
147
+ uiSchema: {
148
+ type: "string",
149
+ title: '{{t("Status Expire At")}}',
150
+ "x-component": "DatePicker",
151
+ "x-component-props": {
152
+ showTime: true
153
+ }
154
+ }
155
+ },
156
+ {
157
+ type: "string",
158
+ name: "previousStatus",
159
+ comment: "\u539F\u72B6\u6001\uFF0C\u7528\u4E8E\u72B6\u6001\u8FC7\u671F\u540E\u81EA\u52A8\u6062\u590D",
160
+ uiSchema: {
161
+ type: "string",
162
+ title: '{{t("Previous Status")}}',
163
+ "x-component": "Select",
164
+ "x-component-props": {
165
+ fieldNames: {
166
+ label: "title",
167
+ value: "key"
168
+ }
169
+ }
170
+ }
171
+ },
172
+ {
173
+ type: "text",
174
+ name: "statusReason",
175
+ comment: "\u72B6\u6001\u53D8\u66F4\u539F\u56E0\u8BF4\u660E",
176
+ uiSchema: {
177
+ type: "string",
178
+ title: '{{t("Status Reason")}}',
179
+ "x-component": "Input.TextArea"
180
+ }
181
+ },
182
+ {
183
+ type: "belongsTo",
184
+ name: "statusInfo",
185
+ target: "userStatuses",
186
+ foreignKey: "status",
187
+ targetKey: "key",
188
+ uiSchema: {
189
+ type: "object",
190
+ title: '{{t("Status")}}',
191
+ "x-component": "AssociationField",
192
+ "x-component-props": {
193
+ fieldNames: {
194
+ label: "title",
195
+ value: "key"
196
+ }
197
+ }
198
+ }
199
+ },
200
+ {
201
+ type: "belongsTo",
202
+ name: "previousStatusInfo",
203
+ target: "userStatuses",
204
+ foreignKey: "previousStatus",
205
+ targetKey: "key",
206
+ uiSchema: {
207
+ type: "object",
208
+ title: '{{t("Previous Status")}}',
209
+ "x-component": "AssociationField",
210
+ "x-component-props": {
211
+ fieldNames: {
212
+ label: "title",
213
+ value: "key"
214
+ }
215
+ }
216
+ }
217
+ },
218
+ {
219
+ type: "hasMany",
220
+ name: "statusHistories",
221
+ target: "userStatusHistories",
222
+ foreignKey: "userId",
223
+ uiSchema: {
224
+ type: "array",
225
+ title: '{{t("Status History")}}',
226
+ "x-component": "AssociationField"
227
+ }
125
228
  }
126
229
  ]
127
230
  });
@@ -0,0 +1,6 @@
1
+ import { Migration } from '@tego/server';
2
+ export default class AddUserStatusFieldsMigration extends Migration {
3
+ appVersion: string;
4
+ up(): Promise<void>;
5
+ down(): Promise<void>;
6
+ }