tango-api-schema 2.0.30 → 2.0.31

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,28 +1,28 @@
1
- import mongoose from 'mongoose';
2
- import mongooseUniqueValidator from 'mongoose-unique-validator';
3
-
4
- const countryCodes = new mongoose.Schema(
5
- {
6
- countryName: {
7
- type: String,
8
- required: true,
9
- unique: true,
10
- },
11
- countryAlpha2Code: {
12
- type: String,
13
- required: true,
14
- },
15
- countryCode: {
16
- type: String,
17
- required: true,
18
- },
19
- },
20
- {
21
- strict: true,
22
- versionKey: false,
23
- timestamps: true,
24
- },
25
- );
26
-
27
- countryCodes.plugin( mongooseUniqueValidator );
28
- export default mongoose.model( 'countryCodes', countryCodes , 'countryCodes');
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const countryCodes = new mongoose.Schema(
5
+ {
6
+ countryName: {
7
+ type: String,
8
+ required: true,
9
+ unique: true,
10
+ },
11
+ countryAlpha2Code: {
12
+ type: String,
13
+ required: true,
14
+ },
15
+ countryCode: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ },
20
+ {
21
+ strict: true,
22
+ versionKey: false,
23
+ timestamps: true,
24
+ },
25
+ );
26
+
27
+ countryCodes.plugin( mongooseUniqueValidator );
28
+ export default mongoose.model( 'countryCodes', countryCodes , 'countryCodes');
@@ -1,29 +1,29 @@
1
- import mongoose from 'mongoose';
2
- import mongooseUniqueValidator from 'mongoose-unique-validator';
3
-
4
- const edgeAppVersion = new mongoose.Schema(
5
- {
6
- appVersion: {
7
- type: String,
8
- unique: true,
9
- },
10
- isActive: {
11
- type: Boolean,
12
- default: true,
13
- },
14
- isDefault: {
15
- type: Boolean,
16
- },
17
- exeName:{
18
- type: String,
19
- }
20
- },
21
- {
22
- strict: true,
23
- versionKey: false,
24
- timestamps: true,
25
- },
26
- );
27
-
28
- edgeAppVersion.plugin( mongooseUniqueValidator );
29
- export default mongoose.model( 'edgeappVersion', edgeAppVersion, 'edgeappVersion' );
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const edgeAppVersion = new mongoose.Schema(
5
+ {
6
+ appVersion: {
7
+ type: String,
8
+ unique: true,
9
+ },
10
+ isActive: {
11
+ type: Boolean,
12
+ default: true,
13
+ },
14
+ isDefault: {
15
+ type: Boolean,
16
+ },
17
+ exeName:{
18
+ type: String,
19
+ }
20
+ },
21
+ {
22
+ strict: true,
23
+ versionKey: false,
24
+ timestamps: true,
25
+ },
26
+ );
27
+
28
+ edgeAppVersion.plugin( mongooseUniqueValidator );
29
+ export default mongoose.model( 'edgeappVersion', edgeAppVersion, 'edgeappVersion' );
@@ -1,33 +1,33 @@
1
- import mongoose from "mongoose";
2
- import uniqueValidator from "mongoose-unique-validator";
3
-
4
- const edgeappAuth = new mongoose.Schema(
5
- {
6
- token: {
7
- type: String,
8
- trim: true,
9
- unique: true,
10
- required: true,
11
- },
12
- type: {
13
- type: String,
14
- enum: ["edgeappAuth-token"],
15
- default: "edgeappAuth-token",
16
- },
17
- storeId: {
18
- type: String,
19
- trim: true,
20
- },
21
- },
22
- {
23
- strict: true,
24
- versionKey: false,
25
- timestamps: true,
26
- }
27
- );
28
-
29
- edgeappAuth.plugin(uniqueValidator)
30
- edgeappAuth.index( { createdAt: 1 }, { expires: '1d' })
31
- edgeappAuth.index( { storeId: 1 })
32
-
1
+ import mongoose from "mongoose";
2
+ import uniqueValidator from "mongoose-unique-validator";
3
+
4
+ const edgeappAuth = new mongoose.Schema(
5
+ {
6
+ token: {
7
+ type: String,
8
+ trim: true,
9
+ unique: true,
10
+ required: true,
11
+ },
12
+ type: {
13
+ type: String,
14
+ enum: ["edgeappAuth-token"],
15
+ default: "edgeappAuth-token",
16
+ },
17
+ storeId: {
18
+ type: String,
19
+ trim: true,
20
+ },
21
+ },
22
+ {
23
+ strict: true,
24
+ versionKey: false,
25
+ timestamps: true,
26
+ }
27
+ );
28
+
29
+ edgeappAuth.plugin(uniqueValidator)
30
+ edgeappAuth.index( { createdAt: 1 }, { expires: '1d' })
31
+ edgeappAuth.index( { storeId: 1 })
32
+
33
33
  export default mongoose.model( 'edgeappAuth', edgeappAuth,'edgeappAuth' );
@@ -1,27 +1,27 @@
1
- import mongoose from 'mongoose';
2
- import mongooseUniqueValidator from 'mongoose-unique-validator';
3
-
4
- const group = new mongoose.Schema(
5
- {
6
- groupName: {
7
- type: String,
8
- },
9
- storeList: {
10
- type:Array
11
- },
12
- clientId:{
13
- type: String
14
- },
15
- description: {
16
- type: String
17
- }
18
- },
19
- {
20
- strict: true,
21
- versionKey: false,
22
- timestamps: true,
23
- },
24
- );
25
-
26
- group.plugin( mongooseUniqueValidator );
27
- export default mongoose.model( 'group', group);
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const group = new mongoose.Schema(
5
+ {
6
+ groupName: {
7
+ type: String,
8
+ },
9
+ storeList: {
10
+ type:Array
11
+ },
12
+ clientId:{
13
+ type: String
14
+ },
15
+ description: {
16
+ type: String
17
+ }
18
+ },
19
+ {
20
+ strict: true,
21
+ versionKey: false,
22
+ timestamps: true,
23
+ },
24
+ );
25
+
26
+ group.plugin( mongooseUniqueValidator );
27
+ export default mongoose.model( 'group', group);
@@ -1,45 +1,45 @@
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
- parentName: {
12
- type: String
13
- },
14
- order: {
15
- type: Number
16
- },
17
- toolTips: [
18
- {
19
- name: {
20
- type: String
21
- },
22
- order: {
23
- type: Number
24
- },
25
- }
26
- ],
27
- stepstoResolve: [{
28
- name: {
29
- type: String
30
- },
31
- order: {
32
- type: Number
33
- },
34
- }
35
- ],
36
- },
37
- {
38
- strict: true,
39
- versionKey: false,
40
- timestamps: true,
41
- },
42
- );
43
-
44
-
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
+ parentName: {
12
+ type: String
13
+ },
14
+ order: {
15
+ type: Number
16
+ },
17
+ toolTips: [
18
+ {
19
+ name: {
20
+ type: String
21
+ },
22
+ order: {
23
+ type: Number
24
+ },
25
+ }
26
+ ],
27
+ stepstoResolve: [{
28
+ name: {
29
+ type: String
30
+ },
31
+ order: {
32
+ type: Number
33
+ },
34
+ }
35
+ ],
36
+ },
37
+ {
38
+ strict: true,
39
+ versionKey: false,
40
+ timestamps: true,
41
+ },
42
+ );
43
+
44
+
45
45
  export default mongoose.model('infraReasons', infraReasons, 'infraReasons');
@@ -1,40 +1,40 @@
1
- import mongoose from 'mongoose';
2
- import uniqueValidator from 'mongoose-unique-validator';
3
- const collection = new mongoose.Schema(
4
- {
5
- ipDetails: [
6
- {
7
- ip: {
8
- type: String,
9
- trim: true,
10
- },
11
- manufacturer: {
12
- type: String,
13
- trim: true,
14
- },
15
- macId: {
16
- type: String,
17
- trim: true,
18
- },
19
- },
20
- ],
21
- storeId: {
22
- type: mongoose.Schema.Types.ObjectId,
23
- ref: 'Store',
24
- },
25
- brandId: {
26
- type: mongoose.Schema.Types.ObjectId,
27
- ref: 'Brand',
28
- },
29
- },
30
- {
31
- timestamps: true,
32
- versionKey: false,
33
- strict: true,
34
- },
35
- );
36
- collection.index( { createdAt: 1 }, { expires: '1d' } );
37
- collection.index( { storeId: 1 } );
38
- collection.plugin( uniqueValidator );
39
-
1
+ import mongoose from 'mongoose';
2
+ import uniqueValidator from 'mongoose-unique-validator';
3
+ const collection = new mongoose.Schema(
4
+ {
5
+ ipDetails: [
6
+ {
7
+ ip: {
8
+ type: String,
9
+ trim: true,
10
+ },
11
+ manufacturer: {
12
+ type: String,
13
+ trim: true,
14
+ },
15
+ macId: {
16
+ type: String,
17
+ trim: true,
18
+ },
19
+ },
20
+ ],
21
+ storeId: {
22
+ type: mongoose.Schema.Types.ObjectId,
23
+ ref: 'Store',
24
+ },
25
+ brandId: {
26
+ type: mongoose.Schema.Types.ObjectId,
27
+ ref: 'Brand',
28
+ },
29
+ },
30
+ {
31
+ timestamps: true,
32
+ versionKey: false,
33
+ strict: true,
34
+ },
35
+ );
36
+ collection.index( { createdAt: 1 }, { expires: '1d' } );
37
+ collection.index( { storeId: 1 } );
38
+ collection.plugin( uniqueValidator );
39
+
40
40
  export default mongoose.model( 'ipLog', collection, 'ipLog' );
@@ -1,75 +1,75 @@
1
- import mongoose from 'mongoose';
2
- import mongooseUniqueValidator from 'mongoose-unique-validator';
3
-
4
- const lead = new mongoose.Schema(
5
- {
6
- clientName: {
7
- type: String,
8
- trim: true,
9
- required: true,
10
- unique: true,
11
- },
12
- firstName: {
13
- type: String,
14
- required: true,
15
- },
16
- lastName: {
17
- type: String,
18
- },
19
- corporateEmail: {
20
- type: String,
21
- required: true,
22
- unique: true,
23
- },
24
- countryCode: {
25
- type: String,
26
- },
27
- mobileNumber: {
28
- type: Number,
29
- required: true,
30
- },
31
- password: {
32
- type: String,
33
- required: true,
34
- },
35
- planDetails: {
36
- totalStores: {
37
- type: String,
38
- required: true,
39
- },
40
- storeSize: {
41
- type: String,
42
- required: true,
43
- },
44
- totalCamera: {
45
- type: Number,
46
- required: true,
47
- },
48
- subscriptionPeriod: {
49
- type: String,
50
- enum: [ 'monthly', 'quarterly', 'annual' ],
51
- },
52
- subscriptionType: {
53
- type: String,
54
- enum: [ 'free', 'premium', 'enterprise' ],
55
- },
56
- product: {
57
- type: Array,
58
- },
59
-
60
- },
61
- status: {
62
- type: String,
63
- enum: [ 'pending', 'rejected', 'approved' ],
64
- default: 'pending',
65
- },
66
- },
67
- {
68
- strict: true,
69
- versionKey: false,
70
- timestamps: true,
71
- },
72
- );
73
-
74
- lead.plugin( mongooseUniqueValidator );
75
- export default mongoose.model( 'lead', lead );
1
+ import mongoose from 'mongoose';
2
+ import mongooseUniqueValidator from 'mongoose-unique-validator';
3
+
4
+ const lead = new mongoose.Schema(
5
+ {
6
+ clientName: {
7
+ type: String,
8
+ trim: true,
9
+ required: true,
10
+ unique: true,
11
+ },
12
+ firstName: {
13
+ type: String,
14
+ required: true,
15
+ },
16
+ lastName: {
17
+ type: String,
18
+ },
19
+ corporateEmail: {
20
+ type: String,
21
+ required: true,
22
+ unique: true,
23
+ },
24
+ countryCode: {
25
+ type: String,
26
+ },
27
+ mobileNumber: {
28
+ type: Number,
29
+ required: true,
30
+ },
31
+ password: {
32
+ type: String,
33
+ required: true,
34
+ },
35
+ planDetails: {
36
+ totalStores: {
37
+ type: String,
38
+ required: true,
39
+ },
40
+ storeSize: {
41
+ type: String,
42
+ required: true,
43
+ },
44
+ totalCamera: {
45
+ type: Number,
46
+ required: true,
47
+ },
48
+ subscriptionPeriod: {
49
+ type: String,
50
+ enum: [ 'monthly', 'quarterly', 'annual' ],
51
+ },
52
+ subscriptionType: {
53
+ type: String,
54
+ enum: [ 'free', 'premium', 'enterprise' ],
55
+ },
56
+ product: {
57
+ type: Array,
58
+ },
59
+
60
+ },
61
+ status: {
62
+ type: String,
63
+ enum: [ 'pending', 'rejected', 'approved' ],
64
+ default: 'pending',
65
+ },
66
+ },
67
+ {
68
+ strict: true,
69
+ versionKey: false,
70
+ timestamps: true,
71
+ },
72
+ );
73
+
74
+ lead.plugin( mongooseUniqueValidator );
75
+ export default mongoose.model( 'lead', lead );
@@ -1,29 +1,29 @@
1
- import uniqueValidator from 'mongoose-unique-validator';
2
- import mongoose from 'mongoose';
3
-
4
- // schema
5
- const collection = new mongoose.Schema( {
6
- email: {
7
- type: String,
8
- trim: true,
9
- unique: true,
10
- },
11
- otp: {
12
- type: Number,
13
- },
14
- type: {
15
- type: String,
16
- enum: [ 'signup' ],
17
- },
18
- },
19
- {
20
- timestamps: true,
21
- strict: true,
22
- versionKey: false,
23
- } );
24
-
25
- collection.plugin( uniqueValidator );
26
- collection.index( { createdAt: 1 }, { expires: '1d' } );
27
- collection.index( { type: 1, email: 1 } );
28
-
1
+ import uniqueValidator from 'mongoose-unique-validator';
2
+ import mongoose from 'mongoose';
3
+
4
+ // schema
5
+ const collection = new mongoose.Schema( {
6
+ email: {
7
+ type: String,
8
+ trim: true,
9
+ unique: true,
10
+ },
11
+ otp: {
12
+ type: Number,
13
+ },
14
+ type: {
15
+ type: String,
16
+ enum: [ 'signup' ],
17
+ },
18
+ },
19
+ {
20
+ timestamps: true,
21
+ strict: true,
22
+ versionKey: false,
23
+ } );
24
+
25
+ collection.plugin( uniqueValidator );
26
+ collection.index( { createdAt: 1 }, { expires: '1d' } );
27
+ collection.index( { type: 1, email: 1 } );
28
+
29
29
  export default mongoose.model( 'otp', collection );
@@ -1,33 +1,33 @@
1
- import { Schema, model } from 'mongoose';
2
-
3
-
4
- const reportschema = new Schema( {
5
- fileName: {
6
- type: String,
7
- required: true,
8
- },
9
- fileType: {
10
- type: String,
11
- required: true,
12
- },
13
- reportName: {
14
- type: String,
15
- },
16
- email: {
17
- type: Array,
18
- required: true,
19
- },
20
- clientId: {
21
- type: String,
22
- },
23
- client: {
24
- type: Schema.Types.ObjectId,
25
- },
26
- },
27
- {
28
- strict: true,
29
- versionKey: false,
30
- timestamps: true,
31
- } );
32
-
33
- export default model( 'report', reportschema );
1
+ import { Schema, model } from 'mongoose';
2
+
3
+
4
+ const reportschema = new Schema( {
5
+ fileName: {
6
+ type: String,
7
+ required: true,
8
+ },
9
+ fileType: {
10
+ type: String,
11
+ required: true,
12
+ },
13
+ reportName: {
14
+ type: String,
15
+ },
16
+ email: {
17
+ type: Array,
18
+ required: true,
19
+ },
20
+ clientId: {
21
+ type: String,
22
+ },
23
+ client: {
24
+ type: Schema.Types.ObjectId,
25
+ },
26
+ },
27
+ {
28
+ strict: true,
29
+ versionKey: false,
30
+ timestamps: true,
31
+ } );
32
+
33
+ export default model( 'report', reportschema );