tango-api-schema 2.1.68 → 2.1.69
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 +1 -1
- package/schema/liveConnection.model.js +35 -31
package/package.json
CHANGED
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const liveConnectionSchema=new Schema({
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import mongooseUniqueValidator from 'mongoose-unique-validator';
|
|
4
3
|
|
|
4
|
+
const liveConnectionSchema = new mongoose.Schema(
|
|
5
|
+
{
|
|
5
6
|
clientId: {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
storeId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
8
13
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
required:true
|
|
14
|
+
remoteAddress: {
|
|
15
|
+
type: String,
|
|
12
16
|
},
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
remotePort: {
|
|
18
|
+
type: Number,
|
|
15
19
|
},
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
connectedAt: {
|
|
21
|
+
type: Date,
|
|
22
|
+
default: new Date(),
|
|
18
23
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
default: new Date()
|
|
24
|
+
streamName: {
|
|
25
|
+
type: String,
|
|
22
26
|
},
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
status: {
|
|
28
|
+
type: String,
|
|
29
|
+
enum: ["live", "completed", "idle"],
|
|
25
30
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
enum:["live", "completed","idle"]
|
|
31
|
+
module: {
|
|
32
|
+
type: String,
|
|
29
33
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
},{
|
|
34
|
+
},
|
|
35
|
+
{
|
|
34
36
|
timestamps: true,
|
|
35
37
|
versionKey: false,
|
|
36
|
-
strict: false,
|
|
37
|
-
}
|
|
38
|
+
strict: false,
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
liveConnectionSchema.plugin( mongooseUniqueValidator );
|
|
42
|
+
liveConnectionSchema.index({ clientId: 1 });
|
|
43
|
+
liveConnectionSchema.index({ storeId: 1 });
|
|
44
|
+
liveConnectionSchema.index({ status: 1 });
|
|
45
|
+
liveConnectionSchema.index({ createdAt: 1 }, { expires: "2d" });
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
liveConnectionSchema.index({storeId:1})
|
|
41
|
-
liveConnectionSchema.index({status:1})
|
|
42
|
-
liveConnectionSchema.index( { createdAt: 1 }, { expires: '2d'});
|
|
43
|
-
export default model( 'liveConnection', liveConnectionSchema,"liveConnection" );
|
|
47
|
+
export default mongoose.model( 'liveConnection', liveConnectionSchema, 'liveConnection' );
|