tango-api-schema 2.0.19 → 2.0.21
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.js +5 -1
- package/infraReason.model.js +42 -0
- package/package.json +3 -2
- package/schema/user.model.js +1 -26
- package/schema/userPermission.model.js +71 -0
package/index.js
CHANGED
|
@@ -12,6 +12,8 @@ import applicationDefaultModel from "./schema/applicationDefault.model.js";
|
|
|
12
12
|
import cameraModel from "./schema/camera.model.js";
|
|
13
13
|
import reportModel from "./schema/report.model.js";
|
|
14
14
|
import standaredRoleModel from "./schema/standaredRole.model.js";
|
|
15
|
+
import userPermissionModel from "./schema/userPermission.model.js";
|
|
16
|
+
import infraReasonModel from "./infraReason.model.js";
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
export default {
|
|
@@ -28,5 +30,7 @@ export default {
|
|
|
28
30
|
applicationDefaultModel,
|
|
29
31
|
cameraModel,
|
|
30
32
|
reportModel,
|
|
31
|
-
standaredRoleModel
|
|
33
|
+
standaredRoleModel,
|
|
34
|
+
userPermissionModel,
|
|
35
|
+
infraReasonModel
|
|
32
36
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
const infraReasons = new mongoose.Schema(
|
|
4
|
+
{
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
},
|
|
8
|
+
parentId: {
|
|
9
|
+
type: mongoose.Types.ObjectId
|
|
10
|
+
},
|
|
11
|
+
order: {
|
|
12
|
+
type: Number
|
|
13
|
+
},
|
|
14
|
+
toolTips: [
|
|
15
|
+
{
|
|
16
|
+
name: {
|
|
17
|
+
type: String
|
|
18
|
+
},
|
|
19
|
+
order: {
|
|
20
|
+
type: Number
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
stepstoResolve: [{
|
|
25
|
+
name: {
|
|
26
|
+
type: String
|
|
27
|
+
},
|
|
28
|
+
order: {
|
|
29
|
+
type: Number
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
strict: true,
|
|
36
|
+
versionKey: false,
|
|
37
|
+
timestamps: true,
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export default mongoose.model('infraReasons', infraReasons, 'infraReasons');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-api-schema",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.21",
|
|
4
4
|
"description": "tangoEye model schema",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"express": "^4.18.2",
|
|
23
23
|
"mongoose": "^7.5.3",
|
|
24
24
|
"mongoose-unique-validator": "^4.0.0",
|
|
25
|
-
"nodemon": "^3.0.1"
|
|
25
|
+
"nodemon": "^3.0.1",
|
|
26
|
+
"tango-api-schema": "^2.0.20"
|
|
26
27
|
}
|
|
27
28
|
}
|
package/schema/user.model.js
CHANGED
|
@@ -40,32 +40,7 @@ const user = new mongoose.Schema(
|
|
|
40
40
|
type: String,
|
|
41
41
|
enum:['tango','client']
|
|
42
42
|
},
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
featureName: {
|
|
46
|
-
type: String,
|
|
47
|
-
},
|
|
48
|
-
product: [
|
|
49
|
-
{
|
|
50
|
-
name: {
|
|
51
|
-
type: String,
|
|
52
|
-
},
|
|
53
|
-
isView: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
},
|
|
56
|
-
isEdit: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
},
|
|
59
|
-
isDownload: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
},
|
|
62
|
-
isDelete: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
43
|
+
|
|
69
44
|
},
|
|
70
45
|
{
|
|
71
46
|
strict: true,
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import mongooseUniqueValidator from 'mongoose-unique-validator';
|
|
3
|
+
|
|
4
|
+
const userPermission = new mongoose.Schema(
|
|
5
|
+
{
|
|
6
|
+
userName: {
|
|
7
|
+
type: String,
|
|
8
|
+
},
|
|
9
|
+
email: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
unique: true,
|
|
13
|
+
},
|
|
14
|
+
clientId:{
|
|
15
|
+
type: String
|
|
16
|
+
},
|
|
17
|
+
role: {
|
|
18
|
+
type: String,
|
|
19
|
+
enum: [ 'superadmin', 'admin', 'user' ],
|
|
20
|
+
default: 'user',
|
|
21
|
+
},
|
|
22
|
+
// Assigned: {
|
|
23
|
+
// type: {
|
|
24
|
+
// type: String,
|
|
25
|
+
// enum: [ 'store', 'group' ],
|
|
26
|
+
// },
|
|
27
|
+
// list: {
|
|
28
|
+
// type: Array,
|
|
29
|
+
// },
|
|
30
|
+
// },
|
|
31
|
+
userType:{
|
|
32
|
+
type: String,
|
|
33
|
+
enum:['tango','client']
|
|
34
|
+
},
|
|
35
|
+
permission: [
|
|
36
|
+
{
|
|
37
|
+
featureName: {
|
|
38
|
+
type: String,
|
|
39
|
+
},
|
|
40
|
+
product: [
|
|
41
|
+
{
|
|
42
|
+
name: {
|
|
43
|
+
type: String,
|
|
44
|
+
},
|
|
45
|
+
isView: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
},
|
|
48
|
+
isEdit: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
},
|
|
51
|
+
isDownload: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
},
|
|
54
|
+
isDelete: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
strict: true,
|
|
65
|
+
versionKey: false,
|
|
66
|
+
timestamps: true,
|
|
67
|
+
},
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
userPermission.plugin( mongooseUniqueValidator );
|
|
71
|
+
export default mongoose.model( 'userPermission', userPermission );
|