@justair/justair-library 4.8.11 → 4.8.13

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.
Files changed (35) hide show
  1. package/.github/workflows/publish.yml +28 -0
  2. package/README +146 -146
  3. package/package.json +27 -27
  4. package/src/config/db.js +116 -116
  5. package/src/config/logger.js +143 -143
  6. package/src/index.js +116 -116
  7. package/src/models/admin.js +27 -27
  8. package/src/models/alerts.js +219 -219
  9. package/src/models/announcements.js +31 -31
  10. package/src/models/apiKey.js +22 -22
  11. package/src/models/configurations.js +17 -17
  12. package/src/models/contexts.js +13 -13
  13. package/src/models/dataCompleteness.js +35 -35
  14. package/src/models/events.js +128 -128
  15. package/src/models/features.js +14 -14
  16. package/src/models/jobs.js +43 -43
  17. package/src/models/lightmonitors.js +30 -30
  18. package/src/models/measurements.js +263 -263
  19. package/src/models/monitorRequests.js +25 -25
  20. package/src/models/monitorSuppliers.js +49 -49
  21. package/src/models/monitors.js +394 -394
  22. package/src/models/networkMetrics.js +42 -42
  23. package/src/models/organizations.js +97 -97
  24. package/src/models/parameters.js +11 -11
  25. package/src/models/referenceMonitorInfo.js +18 -18
  26. package/src/models/tests/admin.test.js +42 -42
  27. package/src/models/tests/configurations.test.js +44 -44
  28. package/src/models/tests/measurements.test.js +46 -46
  29. package/src/models/tests/monitorRequests.test.js +46 -46
  30. package/src/models/tests/monitors.test.js +62 -62
  31. package/src/models/tests/organizations.test.js +51 -51
  32. package/src/models/tests/users.test.js +54 -54
  33. package/src/models/usageMetrics.js +28 -28
  34. package/src/models/users.js +55 -55
  35. package/tsconfig.json +10 -10
@@ -1,219 +1,219 @@
1
- import mongoose, { Schema } from "mongoose";
2
-
3
- const recipientSchema = new Schema(
4
- {
5
- adminId: {
6
- type: mongoose.Types.ObjectId,
7
- ref: "Admin",
8
- },
9
- typeOfCommunication: String,
10
- dateCommunicated: {
11
- type: Date,
12
- defult: Date.now,
13
- },
14
- },
15
- { _id: false }
16
- );
17
-
18
- const alertsSchema = mongoose.Schema(
19
- {
20
- type: {
21
- type: String,
22
- enum: ["Data Review"],
23
- },
24
- alertConfigurationId: mongoose.Types.ObjectId,
25
- flagType: String,
26
- orgId: { type: mongoose.Types.ObjectId, ref: "Organizations" },
27
- monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
28
- status: {
29
- type: String,
30
- enum: ["Active", "Ack", "Mute"],
31
- },
32
- activeUntil: { type: Date },
33
- actionBy: { type: mongoose.Types.ObjectId, ref: "Admin" },
34
- actionDate: { type: Date, default: Date.now },
35
- recipients: [recipientSchema],
36
- metaData: Object,
37
- flaggedDataCompleteness: [Object],
38
- flaggedMeasurementIds: [
39
- {
40
- type: mongoose.Types.ObjectId,
41
- ref: "Measurements",
42
- },
43
- ],
44
- flaggedMeasurements: [Object]
45
- },
46
- {
47
- timestamps: true,
48
- }
49
- );
50
-
51
- // Organization-based queries with timestamp ordering
52
- alertsSchema.index({ orgId: 1, updatedAt: -1 });
53
- // Monitor-based queries for lookups with timestamp ordering
54
- alertsSchema.index({ monitorId: 1, updatedAt: -1 });
55
- // Status-based filtering with organization and timestamp
56
- alertsSchema.index({ orgId: 1, status: 1, updatedAt: -1 });
57
- // Alert configuration matching - already optimal
58
- alertsSchema.index({ alertConfigurationId: 1 });
59
-
60
- alertsSchema.index({ type: 1 });
61
-
62
- const alertsAuditSchema = mongoose.Schema(
63
- {
64
- timeUpdated: Date,
65
- deletedAt: { type: Date, default: Date.now },
66
- type: {
67
- type: String,
68
- enum: ["Data Review"],
69
- },
70
- alertConfigurationId: mongoose.Types.ObjectId,
71
- orgId: { type: mongoose.Types.ObjectId, ref: "Organizations" },
72
- monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
73
- status: {
74
- type: String,
75
- enum: ["Active", "Ack", "Mute"],
76
- },
77
- activeUntil: {type: Date},
78
- actionBy: { type: mongoose.Types.ObjectId, ref: "Admin" },
79
- actionDate: { type: Date, default: Date.now },
80
- recipients: [recipientSchema],
81
- metaData: Object,
82
- flaggedMeasurementIds: [
83
- {
84
- type: mongoose.Types.ObjectId,
85
- ref: "Measurements",
86
- },
87
- ],
88
- },
89
- {
90
- timestamps: true,
91
- }
92
- );
93
-
94
- const AlertsAudit = mongoose.model("AlertsAudit", alertsAuditSchema);
95
-
96
- // Fix the typo in the hook name - 'sindOneAndDelete' to 'findOneAndDelete'
97
- alertsSchema.pre("findOneAndDelete", async function () {
98
- const docToDelete = await this.model.findOne(this.getFilter());
99
- if (docToDelete) {
100
- console.log("Logging findOneAndDelete to audit", docToDelete);
101
- const auditLog = new AlertsAudit({
102
- timeUpdated: docToDelete.updatedAt,
103
- type: docToDelete.type,
104
- orgId: docToDelete.orgId,
105
- alertConfigurationId: docToDelete.alertConfigurationId,
106
- monitorId: docToDelete.monitorId,
107
- status: docToDelete.status,
108
- activeUntil: docToDelete.activeUntil,
109
- actionBy: docToDelete.actionBy,
110
- actionDate: docToDelete.actionDate,
111
- recipients: docToDelete.recipients,
112
- flaggedMeasurementIds: docToDelete.flaggedMeasurementIds,
113
- deletedAt: new Date(),
114
- });
115
- await auditLog.save();
116
- }
117
- });
118
-
119
- // Pre-hook to log multiple alert deletions
120
- alertsSchema.pre("deleteMany", async function () {
121
- console.log("deleteMany pre-hook triggered");
122
- const docsToDelete = await this.model.find(this.getFilter()).lean();
123
-
124
- if (docsToDelete.length) {
125
- console.log(`Logging ${docsToDelete.length} documents to audit`);
126
- const auditLogs = docsToDelete.map((doc) => ({
127
- timeUpdated: doc.updatedAt,
128
- type: doc.type,
129
- alertConfigurationId: doc.alertConfigurationId,
130
- orgId: doc.orgId,
131
- monitorId: doc.monitorId,
132
- status: doc.status,
133
- activeUntil: doc.activeUntil,
134
- actionBy: doc.actionBy,
135
- actionDate: doc.actionDate,
136
- recipients: doc.recipients,
137
- flaggedMeasurementIds: doc.flaggedMeasurementIds,
138
- deletedAt: new Date(),
139
- }));
140
-
141
- await AlertsAudit.insertMany(auditLogs);
142
- }
143
- });
144
-
145
- // Pre-hook to log a single alert deletion (for deleteOne)
146
- alertsSchema.pre("deleteOne", async function () {
147
- console.log("deleteOne pre-hook triggered");
148
- const docToDelete = await this.model.findOne(this.getFilter()).lean();
149
-
150
- if (docToDelete) {
151
- console.log("Logging deleteOne to audit", docToDelete);
152
- const auditLog = new AlertsAudit({
153
- timeUpdated: docToDelete.updatedAt,
154
- type: docToDelete.type,
155
- alertConfigurationId: docToDelete.alertConfigurationId,
156
- orgId: docToDelete.orgId,
157
- monitorId: docToDelete.monitorId,
158
- status: docToDelete.status,
159
- activeUntil: docToDelete.activeUntil,
160
- actionBy: docToDelete.actionBy,
161
- actionDate: docToDelete.actionDate,
162
- recipients: docToDelete.recipients,
163
- flaggedMeasurementIds: docToDelete.flaggedMeasurementIds,
164
- deletedAt: new Date(),
165
- });
166
- await auditLog.save();
167
- }
168
- });
169
-
170
- // Pre-hook to log single alert updates
171
- alertsSchema.pre("findOneAndUpdate", async function () {
172
- const docToUpdate = await this.model.findOne(this.getFilter()).lean();
173
- if (docToUpdate) {
174
- console.log("Logging findOneAndUpdate to audit", docToUpdate);
175
- const auditLog = new AlertsAudit({
176
- timeUpdated: docToUpdate.updatedAt,
177
- type: docToUpdate.type,
178
- alertConfigurationId: docToUpdate.alertConfigurationId,
179
- orgId: docToUpdate.orgId,
180
- monitorId: docToUpdate.monitorId,
181
- status: docToUpdate.status,
182
- activeUntil: docToUpdate.activeUntil,
183
- actionBy: docToUpdate.actionBy,
184
- actionDate: docToUpdate.actionDate,
185
- recipients: docToUpdate.recipients,
186
- flaggedMeasurementIds: docToUpdate.flaggedMeasurementIds,
187
- deletedAt: null, // No deletion happening
188
- });
189
- await auditLog.save();
190
- }
191
- });
192
-
193
- // Pre-hook to log multiple alert updates
194
- alertsSchema.pre("updateMany", async function () {
195
- const docsToUpdate = await this.model.find(this.getFilter()).lean();
196
- if (docsToUpdate.length) {
197
- console.log(`Logging ${docsToUpdate.length} documents to audit`);
198
- const auditLogs = docsToUpdate.map((doc) => ({
199
- timeUpdated: doc.updatedAt,
200
- type: doc.type,
201
- alertConfigurationId: doc.alertConfigurationId,
202
- orgId: doc.orgId,
203
- monitorId: doc.monitorId,
204
- status: doc.status,
205
- activeUntil: doc.activeUntil,
206
- actionBy: doc.actionBy,
207
- actionDate: doc.actionDate,
208
- recipients: doc.recipients,
209
- flaggedMeasurementIds: doc.flaggedMeasurementIds,
210
- deletedAt: null, // No deletion happening
211
- }));
212
-
213
- await AlertsAudit.insertMany(auditLogs);
214
- }
215
- });
216
-
217
- const Alerts = mongoose.model("Alerts", alertsSchema);
218
-
219
- export { alertsSchema, Alerts, AlertsAudit, alertsAuditSchema };
1
+ import mongoose, { Schema } from "mongoose";
2
+
3
+ const recipientSchema = new Schema(
4
+ {
5
+ adminId: {
6
+ type: mongoose.Types.ObjectId,
7
+ ref: "Admin",
8
+ },
9
+ typeOfCommunication: String,
10
+ dateCommunicated: {
11
+ type: Date,
12
+ defult: Date.now,
13
+ },
14
+ },
15
+ { _id: false }
16
+ );
17
+
18
+ const alertsSchema = mongoose.Schema(
19
+ {
20
+ type: {
21
+ type: String,
22
+ enum: ["Data Review"],
23
+ },
24
+ alertConfigurationId: mongoose.Types.ObjectId,
25
+ flagType: String,
26
+ orgId: { type: mongoose.Types.ObjectId, ref: "Organizations" },
27
+ monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
28
+ status: {
29
+ type: String,
30
+ enum: ["Active", "Ack", "Mute"],
31
+ },
32
+ activeUntil: { type: Date },
33
+ actionBy: { type: mongoose.Types.ObjectId, ref: "Admin" },
34
+ actionDate: { type: Date, default: Date.now },
35
+ recipients: [recipientSchema],
36
+ metaData: Object,
37
+ flaggedDataCompleteness: [Object],
38
+ flaggedMeasurementIds: [
39
+ {
40
+ type: mongoose.Types.ObjectId,
41
+ ref: "Measurements",
42
+ },
43
+ ],
44
+ flaggedMeasurements: [Object]
45
+ },
46
+ {
47
+ timestamps: true,
48
+ }
49
+ );
50
+
51
+ // Organization-based queries with timestamp ordering
52
+ alertsSchema.index({ orgId: 1, updatedAt: -1 });
53
+ // Monitor-based queries for lookups with timestamp ordering
54
+ alertsSchema.index({ monitorId: 1, updatedAt: -1 });
55
+ // Status-based filtering with organization and timestamp
56
+ alertsSchema.index({ orgId: 1, status: 1, updatedAt: -1 });
57
+ // Alert configuration matching - already optimal
58
+ alertsSchema.index({ alertConfigurationId: 1 });
59
+
60
+ alertsSchema.index({ type: 1 });
61
+
62
+ const alertsAuditSchema = mongoose.Schema(
63
+ {
64
+ timeUpdated: Date,
65
+ deletedAt: { type: Date, default: Date.now },
66
+ type: {
67
+ type: String,
68
+ enum: ["Data Review"],
69
+ },
70
+ alertConfigurationId: mongoose.Types.ObjectId,
71
+ orgId: { type: mongoose.Types.ObjectId, ref: "Organizations" },
72
+ monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
73
+ status: {
74
+ type: String,
75
+ enum: ["Active", "Ack", "Mute"],
76
+ },
77
+ activeUntil: {type: Date},
78
+ actionBy: { type: mongoose.Types.ObjectId, ref: "Admin" },
79
+ actionDate: { type: Date, default: Date.now },
80
+ recipients: [recipientSchema],
81
+ metaData: Object,
82
+ flaggedMeasurementIds: [
83
+ {
84
+ type: mongoose.Types.ObjectId,
85
+ ref: "Measurements",
86
+ },
87
+ ],
88
+ },
89
+ {
90
+ timestamps: true,
91
+ }
92
+ );
93
+
94
+ const AlertsAudit = mongoose.model("AlertsAudit", alertsAuditSchema);
95
+
96
+ // Fix the typo in the hook name - 'sindOneAndDelete' to 'findOneAndDelete'
97
+ alertsSchema.pre("findOneAndDelete", async function () {
98
+ const docToDelete = await this.model.findOne(this.getFilter());
99
+ if (docToDelete) {
100
+ console.log("Logging findOneAndDelete to audit", docToDelete);
101
+ const auditLog = new AlertsAudit({
102
+ timeUpdated: docToDelete.updatedAt,
103
+ type: docToDelete.type,
104
+ orgId: docToDelete.orgId,
105
+ alertConfigurationId: docToDelete.alertConfigurationId,
106
+ monitorId: docToDelete.monitorId,
107
+ status: docToDelete.status,
108
+ activeUntil: docToDelete.activeUntil,
109
+ actionBy: docToDelete.actionBy,
110
+ actionDate: docToDelete.actionDate,
111
+ recipients: docToDelete.recipients,
112
+ flaggedMeasurementIds: docToDelete.flaggedMeasurementIds,
113
+ deletedAt: new Date(),
114
+ });
115
+ await auditLog.save();
116
+ }
117
+ });
118
+
119
+ // Pre-hook to log multiple alert deletions
120
+ alertsSchema.pre("deleteMany", async function () {
121
+ console.log("deleteMany pre-hook triggered");
122
+ const docsToDelete = await this.model.find(this.getFilter()).lean();
123
+
124
+ if (docsToDelete.length) {
125
+ console.log(`Logging ${docsToDelete.length} documents to audit`);
126
+ const auditLogs = docsToDelete.map((doc) => ({
127
+ timeUpdated: doc.updatedAt,
128
+ type: doc.type,
129
+ alertConfigurationId: doc.alertConfigurationId,
130
+ orgId: doc.orgId,
131
+ monitorId: doc.monitorId,
132
+ status: doc.status,
133
+ activeUntil: doc.activeUntil,
134
+ actionBy: doc.actionBy,
135
+ actionDate: doc.actionDate,
136
+ recipients: doc.recipients,
137
+ flaggedMeasurementIds: doc.flaggedMeasurementIds,
138
+ deletedAt: new Date(),
139
+ }));
140
+
141
+ await AlertsAudit.insertMany(auditLogs);
142
+ }
143
+ });
144
+
145
+ // Pre-hook to log a single alert deletion (for deleteOne)
146
+ alertsSchema.pre("deleteOne", async function () {
147
+ console.log("deleteOne pre-hook triggered");
148
+ const docToDelete = await this.model.findOne(this.getFilter()).lean();
149
+
150
+ if (docToDelete) {
151
+ console.log("Logging deleteOne to audit", docToDelete);
152
+ const auditLog = new AlertsAudit({
153
+ timeUpdated: docToDelete.updatedAt,
154
+ type: docToDelete.type,
155
+ alertConfigurationId: docToDelete.alertConfigurationId,
156
+ orgId: docToDelete.orgId,
157
+ monitorId: docToDelete.monitorId,
158
+ status: docToDelete.status,
159
+ activeUntil: docToDelete.activeUntil,
160
+ actionBy: docToDelete.actionBy,
161
+ actionDate: docToDelete.actionDate,
162
+ recipients: docToDelete.recipients,
163
+ flaggedMeasurementIds: docToDelete.flaggedMeasurementIds,
164
+ deletedAt: new Date(),
165
+ });
166
+ await auditLog.save();
167
+ }
168
+ });
169
+
170
+ // Pre-hook to log single alert updates
171
+ alertsSchema.pre("findOneAndUpdate", async function () {
172
+ const docToUpdate = await this.model.findOne(this.getFilter()).lean();
173
+ if (docToUpdate) {
174
+ console.log("Logging findOneAndUpdate to audit", docToUpdate);
175
+ const auditLog = new AlertsAudit({
176
+ timeUpdated: docToUpdate.updatedAt,
177
+ type: docToUpdate.type,
178
+ alertConfigurationId: docToUpdate.alertConfigurationId,
179
+ orgId: docToUpdate.orgId,
180
+ monitorId: docToUpdate.monitorId,
181
+ status: docToUpdate.status,
182
+ activeUntil: docToUpdate.activeUntil,
183
+ actionBy: docToUpdate.actionBy,
184
+ actionDate: docToUpdate.actionDate,
185
+ recipients: docToUpdate.recipients,
186
+ flaggedMeasurementIds: docToUpdate.flaggedMeasurementIds,
187
+ deletedAt: null, // No deletion happening
188
+ });
189
+ await auditLog.save();
190
+ }
191
+ });
192
+
193
+ // Pre-hook to log multiple alert updates
194
+ alertsSchema.pre("updateMany", async function () {
195
+ const docsToUpdate = await this.model.find(this.getFilter()).lean();
196
+ if (docsToUpdate.length) {
197
+ console.log(`Logging ${docsToUpdate.length} documents to audit`);
198
+ const auditLogs = docsToUpdate.map((doc) => ({
199
+ timeUpdated: doc.updatedAt,
200
+ type: doc.type,
201
+ alertConfigurationId: doc.alertConfigurationId,
202
+ orgId: doc.orgId,
203
+ monitorId: doc.monitorId,
204
+ status: doc.status,
205
+ activeUntil: doc.activeUntil,
206
+ actionBy: doc.actionBy,
207
+ actionDate: doc.actionDate,
208
+ recipients: doc.recipients,
209
+ flaggedMeasurementIds: doc.flaggedMeasurementIds,
210
+ deletedAt: null, // No deletion happening
211
+ }));
212
+
213
+ await AlertsAudit.insertMany(auditLogs);
214
+ }
215
+ });
216
+
217
+ const Alerts = mongoose.model("Alerts", alertsSchema);
218
+
219
+ export { alertsSchema, Alerts, AlertsAudit, alertsAuditSchema };
@@ -1,31 +1,31 @@
1
- import mongoose from "mongoose";
2
-
3
- const locationSchema = mongoose.Schema(
4
- {
5
- city: { type: String, default: null },
6
- county: { type: String, default: null },
7
- state: { type: String, required: [true, "state is required"] },
8
- },
9
- {
10
- timestamps: false,
11
- _id: false,
12
- }
13
- );
14
-
15
- const announcementSchema = mongoose.Schema(
16
- {
17
- category: { type: String, required: [true, "category is required"]},
18
- message: { type: String, required: [true, "message is required"] },
19
- link: String,
20
- location: { type: locationSchema, required: [true, "location is required"] },
21
- isActive: { type: Boolean, default: false },
22
- },
23
- {
24
- timestamps: true,
25
- }
26
- );
27
-
28
- const Announcements = mongoose.model("Announcements", announcementSchema);
29
-
30
- export { announcementSchema, Announcements };
31
-
1
+ import mongoose from "mongoose";
2
+
3
+ const locationSchema = mongoose.Schema(
4
+ {
5
+ city: { type: String, default: null },
6
+ county: { type: String, default: null },
7
+ state: { type: String, required: [true, "state is required"] },
8
+ },
9
+ {
10
+ timestamps: false,
11
+ _id: false,
12
+ }
13
+ );
14
+
15
+ const announcementSchema = mongoose.Schema(
16
+ {
17
+ category: { type: String, required: [true, "category is required"]},
18
+ message: { type: String, required: [true, "message is required"] },
19
+ link: String,
20
+ location: { type: locationSchema, required: [true, "location is required"] },
21
+ isActive: { type: Boolean, default: false },
22
+ },
23
+ {
24
+ timestamps: true,
25
+ }
26
+ );
27
+
28
+ const Announcements = mongoose.model("Announcements", announcementSchema);
29
+
30
+ export { announcementSchema, Announcements };
31
+
@@ -1,23 +1,23 @@
1
- import mongoose from "mongoose";
2
- const apiKeySchema = mongoose.Schema(
3
- {
4
- adminId: { type: mongoose.Schema.Types.ObjectId, ref: "Admin" },
5
- clientKey: { type: String, unique: true },
6
- permissions: {
7
- type: Object,
8
- of: [{ type: mongoose.Schema.Types.ObjectId }],
9
- default: new Map(),
10
- },
11
- accessToken: String,
12
- refreshToken: String,
13
- lastUsedAt: Date,
14
- isActive: Boolean,
15
- },
16
- {
17
- timestamps: true,
18
- }
19
- );
20
-
21
- const ApiKey = mongoose.model("ApiKey", apiKeySchema);
22
-
1
+ import mongoose from "mongoose";
2
+ const apiKeySchema = mongoose.Schema(
3
+ {
4
+ adminId: { type: mongoose.Schema.Types.ObjectId, ref: "Admin" },
5
+ clientKey: { type: String, unique: true },
6
+ permissions: {
7
+ type: Object,
8
+ of: [{ type: mongoose.Schema.Types.ObjectId }],
9
+ default: new Map(),
10
+ },
11
+ accessToken: String,
12
+ refreshToken: String,
13
+ lastUsedAt: Date,
14
+ isActive: Boolean,
15
+ },
16
+ {
17
+ timestamps: true,
18
+ }
19
+ );
20
+
21
+ const ApiKey = mongoose.model("ApiKey", apiKeySchema);
22
+
23
23
  export { apiKeySchema, ApiKey };
@@ -1,17 +1,17 @@
1
- import mongoose from 'mongoose';
2
-
3
- const configurationsSchema = mongoose.Schema({
4
- type: { type: String, enum: ['flag'] },
5
- name: String,
6
- properties: Object,
7
- isActive: { type: Boolean, default: false },
8
- firstRun: {type: Boolean, default: false}
9
- }, {
10
- timestamps: true
11
- });
12
-
13
- configurationsSchema.index({name: 1});
14
-
15
- const Configurations = mongoose.model('Configurations', configurationsSchema);
16
-
17
- export {configurationsSchema, Configurations};
1
+ import mongoose from 'mongoose';
2
+
3
+ const configurationsSchema = mongoose.Schema({
4
+ type: { type: String, enum: ['flag'] },
5
+ name: String,
6
+ properties: Object,
7
+ isActive: { type: Boolean, default: false },
8
+ firstRun: {type: Boolean, default: false}
9
+ }, {
10
+ timestamps: true
11
+ });
12
+
13
+ configurationsSchema.index({name: 1});
14
+
15
+ const Configurations = mongoose.model('Configurations', configurationsSchema);
16
+
17
+ export {configurationsSchema, Configurations};
@@ -1,14 +1,14 @@
1
- import mongoose from "mongoose";
2
-
3
- const contextsSchema = mongoose.Schema(
4
- {
5
- name: String
6
- },
7
- {
8
- timestamps: true
9
- }
10
- );
11
-
12
- const Contexts = mongoose.model("Contexts", contextsSchema);
13
-
1
+ import mongoose from "mongoose";
2
+
3
+ const contextsSchema = mongoose.Schema(
4
+ {
5
+ name: String
6
+ },
7
+ {
8
+ timestamps: true
9
+ }
10
+ );
11
+
12
+ const Contexts = mongoose.model("Contexts", contextsSchema);
13
+
14
14
  export {contextsSchema, Contexts};