tango-api-schema 2.0.16 → 2.0.17

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 CHANGED
@@ -11,6 +11,7 @@ import edgeAppVersionModel from './schema/edgeAppVersion.model.js';
11
11
  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
+ import standaredRoleModel from "./schema/standaredRole.model.js";
14
15
 
15
16
 
16
17
  export default {
@@ -26,5 +27,6 @@ export default {
26
27
  edgeAppVersionModel,
27
28
  applicationDefaultModel,
28
29
  cameraModel,
29
- reportModel
30
+ reportModel,
31
+ standaredRoleModel
30
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,57 @@
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const roles = new mongoose.Schema(
5
+ {
6
+ roleName: {
7
+ type: String,
8
+ unique: true,
9
+ enum: [ 'superadmin', 'admin', 'user' ],
10
+ },
11
+ userType: {
12
+ type: String,
13
+ enum: [ 'client', 'tango' ],
14
+ },
15
+ isActive: {
16
+ type: Boolean,
17
+ default: false,
18
+ },
19
+ // AssignedUsers: {
20
+ // type:Array
21
+ // },
22
+ permission: [
23
+ {
24
+ featureName: {
25
+ type: String,
26
+ },
27
+ product: [
28
+ {
29
+ name: {
30
+ type: String,
31
+ },
32
+ isView: {
33
+ type: Boolean,
34
+ },
35
+ isEdit: {
36
+ type: Boolean,
37
+ },
38
+ isDownload: {
39
+ type: Boolean,
40
+ },
41
+ isDelete: {
42
+ type: Boolean,
43
+ },
44
+ },
45
+ ],
46
+ },
47
+ ],
48
+ },
49
+ {
50
+ strict: true,
51
+ versionKey: false,
52
+ timestamps: true,
53
+ },
54
+ );
55
+
56
+ user.plugin( mongooseUniqueValidator );
57
+ export default mongoose.model( 'standaredRoles', roles ,'standaredRoles');