tango-api-schema 2.0.30 → 2.0.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "2.0.30",
3
+ "version": "2.0.32",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,4 +23,4 @@ const userAuth = new mongoose.Schema(
23
23
  },
24
24
  );
25
25
 
26
- export default mongoose.model( 'userAuth', userAuth);
26
+ export default mongoose.model( 'userAuth', userAuth, 'userAuth');
@@ -1,119 +1,118 @@
1
- import { Schema, model } from 'mongoose';
1
+ import { Schema, model } from "mongoose";
2
+ import mongooseUniqueValidator from "mongoose-unique-validator";
2
3
 
3
4
  const collection = new Schema(
4
- {
5
- store: {
6
- type: Schema.Types.ObjectId,
7
- ref: 'Store',
8
- required: true,
9
- },
10
- storeId: {
11
- type: String,
12
- trim: true,
13
- },
14
- masterServer: {
15
- type: String,
16
- trim: true,
17
- },
18
- clientId: {
19
- type: String,
20
- trim: true,
21
- },
22
- client: {
23
- type: Schema.Types.ObjectId,
24
- ref: 'client',
25
- required: true,
26
- },
27
- // tagging: [ // need to disscuss with praveen
28
- // {
29
- // type: Schema.Types.ObjectId,
30
- // ref: 'Tagging',
31
- // },
32
- // ],
33
- ip: {
34
- type: String,
35
- trim: true,
36
- },
37
- manufacture: {
38
- type: String,
39
- trim: true,
40
- },
41
- camNumber: {
42
- type: String,
43
- trim: true,
44
- },
45
- userName: {
46
- type: String,
47
- trim: true,
48
- },
49
- password: {
50
- type: String,
51
- trim: true,
52
- },
53
- subType: {
54
- type: String,
55
- trim: true,
56
- },
57
- RTSP: {
58
- type: String,
59
- trim: true,
60
- },
61
- retentionPeriod: {
62
- type: Number,
63
- },
64
- streamName: {
65
- type: String,
66
- trim: true,
67
- unique: true,
68
- },
69
- thumbnailImage: {
70
- type: String,
71
- trim: true,
72
- },
73
- status: {
74
- type: String,
75
- trim: true,
76
- },
77
- isActivated: {
78
- type: Boolean,
79
- },
80
- isUp: {
81
- type: Boolean,
82
- },
83
- captureAt: {
84
- type: Date,
85
- default: Date.now,
86
- },
87
- macId: {
5
+ {
6
+ storeId: {
7
+ type: String,
8
+ trim: true,
9
+ },
10
+ masterServer: {
11
+ type: String,
12
+ trim: true,
13
+ },
14
+ clientId: {
15
+ type: String,
16
+ trim: true,
17
+ },
18
+ ip: {
19
+ type: String,
20
+ trim: true,
21
+ },
22
+ manufacture: {
23
+ type: String,
24
+ trim: true,
25
+ },
26
+ camNumber: {
27
+ type: String,
28
+ trim: true,
29
+ },
30
+ username: {
31
+ type: String,
32
+ trim: true,
33
+ },
34
+ password: {
35
+ type: String,
36
+ trim: true,
37
+ },
38
+ subType: {
39
+ type: String,
40
+ trim: true,
41
+ },
42
+ RTSP: {
43
+ type: String,
44
+ trim: true,
45
+ },
46
+ retentionPeriod: {
47
+ type: Number,
48
+ },
49
+ streamName: {
50
+ type: String,
51
+ trim: true,
52
+ unique: true,
53
+ },
54
+ thumbnailImage: {
55
+ type: String,
56
+ trim: true,
57
+ },
58
+ status: {
59
+ type: String,
60
+ trim: true,
61
+ },
62
+ isActivated: {
63
+ type: Boolean,
64
+ },
65
+ isUp: {
66
+ type: Boolean,
67
+ },
68
+ captureAt: {
69
+ type: Date,
70
+ default: Date.now,
71
+ },
72
+ macId: {
73
+ type: String,
74
+ },
75
+ timeElapsed: {
76
+ type: Number,
77
+ default: 13,
78
+ },
79
+ camName: {
80
+ type: String,
81
+ trim: true,
82
+ },
83
+ filters: {
84
+ yolo: {
88
85
  type: String,
86
+ default: true,
89
87
  },
90
- timeElapsed: {
91
- type: Number,
92
- default: 13,
93
- },
94
- dataProcess: {
95
- type: Boolean,
96
- default: false,
97
- },
98
- camName: {
88
+ yoloProcess: {
99
89
  type: String,
100
- trim: true,
101
- },
102
- filters: {
103
- yolo: {
104
- type: String,
105
- default: true
106
- },
107
- yoloProcess: {
108
- type: String,
109
- default: 10
110
- }
90
+ default: 10,
111
91
  },
112
92
  },
113
- {
114
- strict: true,
115
- versionKey: false,
116
- timestamps: true
117
- } );
93
+ productModule: {
94
+ type: Array,
95
+ },
96
+ IsVideoStream: {
97
+ type: Boolean,
98
+ default: false,
99
+ },
100
+ },
101
+ {
102
+ strict: true,
103
+ versionKey: false,
104
+ timestamps: true,
105
+ }
106
+ );
107
+
108
+ collection.index({
109
+ storeId: 1,
110
+ clientId: 1,
111
+ streamName: 1,
112
+ isActivated: 1,
113
+ isUp: 1,
114
+ });
115
+
116
+ collection.plugin(mongooseUniqueValidator);
118
117
 
119
- export default model( 'camera', collection );
118
+ export default model("camera", collection);