@justair/justair-library 4.5.3 → 4.6.0

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/src/index.js CHANGED
@@ -1,113 +1,113 @@
1
- import { adminSchema, Admin } from "./models/admin.js";
2
- import {
3
- configurationsSchema,
4
- Configurations,
5
- } from "./models/configurations.js";
6
- import {
7
- measurementsSchema,
8
- Measurements,
9
- Audit,
10
- auditSchema,
11
- } from "./models/measurements.js";
12
- import {
13
- monitorRequestsSchema,
14
- MonitorRequests,
15
- } from "./models/monitorRequests.js";
16
- import {
17
- monitorsSchema,
18
- Monitors,
19
- monitorAuditSchema,
20
- MonitorAudit,
21
- } from "./models/monitors.js";
22
- import { organizationsSchema, Organizations } from "./models/organizations.js";
23
- import {
24
- referenceMonitorInfoSchema,
25
- ReferenceMonitorInfo,
26
- } from "./models/referenceMonitorInfo.js";
27
- import { lightMonitorSchema, LightMonitors } from "./models/lightmonitors.js";
28
- import {
29
- monitorSuppliersSchema,
30
- MonitorSuppliers,
31
- } from "./models/monitorSuppliers.js";
32
- import { contextsSchema, Contexts } from "./models/contexts.js";
33
- import { parametersSchema, Parameters } from "./models/parameters.js";
34
- import { usersSchema, Users } from "./models/users.js";
35
- import {
36
- eventsSchema,
37
- Events,
38
- eventsAuditSchema,
39
- EventsAudit,
40
- } from "./models/events.js";
41
- import { announcementSchema, Announcements } from "./models/announcements.js";
42
- import { jobsSchema, Jobs } from "./models/jobs.js";
43
- import { apiKeySchema, ApiKey } from "./models/apiKey.js";
44
- import { UsageMetrics, usageMetricsSchema } from "./models/usageMetrics.js";
45
- import {
46
- AlertsAudit,
47
- Alerts,
48
- alertsSchema,
49
- alertsAuditSchema,
50
- } from "./models/alerts.js";
51
- import { Features, featuresSchema } from "./models/features.js";
52
- import {
53
- DataCompleteness,
54
- dataCompletenessSchema,
55
- } from "./models/dataCompleteness.js";
56
- import Database from "./config/db.js"; // Import the new Database class
57
- import CustomLogger from "./config/logger.js";
58
-
59
- export function createLoggerInstance({ DATADOG_API_KEY, APPLICATION_NAME }) {
60
- return new CustomLogger({ DATADOG_API_KEY, APPLICATION_NAME });
61
- }
62
-
63
- export {
64
- Database, // Export the Database class
65
- adminSchema,
66
- Admin,
67
- configurationsSchema,
68
- Configurations,
69
- measurementsSchema,
70
- Measurements,
71
- monitorRequestsSchema,
72
- MonitorRequests,
73
- monitorsSchema,
74
- Monitors,
75
- organizationsSchema,
76
- Organizations,
77
- referenceMonitorInfoSchema,
78
- ReferenceMonitorInfo,
79
- usersSchema,
80
- Users,
81
- eventsSchema,
82
- Events,
83
- lightMonitorSchema,
84
- LightMonitors,
85
- monitorSuppliersSchema,
86
- MonitorSuppliers,
87
- contextsSchema,
88
- Contexts,
89
- parametersSchema,
90
- Parameters,
91
- announcementSchema,
92
- Announcements,
93
- jobsSchema,
94
- Jobs,
95
- apiKeySchema,
96
- ApiKey,
97
- UsageMetrics,
98
- usageMetricsSchema,
99
- Audit,
100
- auditSchema,
101
- EventsAudit,
102
- eventsAuditSchema,
103
- MonitorAudit,
104
- monitorAuditSchema,
105
- AlertsAudit,
106
- Alerts,
107
- alertsSchema,
108
- alertsAuditSchema,
109
- Features,
110
- featuresSchema,
111
- dataCompletenessSchema,
112
- DataCompleteness,
113
- };
1
+ import { adminSchema, Admin } from "./models/admin.js";
2
+ import {
3
+ configurationsSchema,
4
+ Configurations,
5
+ } from "./models/configurations.js";
6
+ import {
7
+ measurementsSchema,
8
+ Measurements,
9
+ Audit,
10
+ auditSchema,
11
+ } from "./models/measurements.js";
12
+ import {
13
+ monitorRequestsSchema,
14
+ MonitorRequests,
15
+ } from "./models/monitorRequests.js";
16
+ import {
17
+ monitorsSchema,
18
+ Monitors,
19
+ monitorAuditSchema,
20
+ MonitorAudit,
21
+ } from "./models/monitors.js";
22
+ import { organizationsSchema, Organizations } from "./models/organizations.js";
23
+ import {
24
+ referenceMonitorInfoSchema,
25
+ ReferenceMonitorInfo,
26
+ } from "./models/referenceMonitorInfo.js";
27
+ import { lightMonitorSchema, LightMonitors } from "./models/lightmonitors.js";
28
+ import {
29
+ monitorSuppliersSchema,
30
+ MonitorSuppliers,
31
+ } from "./models/monitorSuppliers.js";
32
+ import { contextsSchema, Contexts } from "./models/contexts.js";
33
+ import { parametersSchema, Parameters } from "./models/parameters.js";
34
+ import { usersSchema, Users } from "./models/users.js";
35
+ import {
36
+ eventsSchema,
37
+ Events,
38
+ eventsAuditSchema,
39
+ EventsAudit,
40
+ } from "./models/events.js";
41
+ import { announcementSchema, Announcements } from "./models/announcements.js";
42
+ import { jobsSchema, Jobs } from "./models/jobs.js";
43
+ import { apiKeySchema, ApiKey } from "./models/apiKey.js";
44
+ import { UsageMetrics, usageMetricsSchema } from "./models/usageMetrics.js";
45
+ import {
46
+ AlertsAudit,
47
+ Alerts,
48
+ alertsSchema,
49
+ alertsAuditSchema,
50
+ } from "./models/alerts.js";
51
+ import { Features, featuresSchema } from "./models/features.js";
52
+ import {
53
+ DataCompleteness,
54
+ dataCompletenessSchema,
55
+ } from "./models/dataCompleteness.js";
56
+ import Database from "./config/db.js"; // Import the new Database class
57
+ import CustomLogger from "./config/logger.js";
58
+
59
+ export function createLoggerInstance({ DATADOG_API_KEY, APPLICATION_NAME }) {
60
+ return new CustomLogger({ DATADOG_API_KEY, APPLICATION_NAME });
61
+ }
62
+
63
+ export {
64
+ Database, // Export the Database class
65
+ adminSchema,
66
+ Admin,
67
+ configurationsSchema,
68
+ Configurations,
69
+ measurementsSchema,
70
+ Measurements,
71
+ monitorRequestsSchema,
72
+ MonitorRequests,
73
+ monitorsSchema,
74
+ Monitors,
75
+ organizationsSchema,
76
+ Organizations,
77
+ referenceMonitorInfoSchema,
78
+ ReferenceMonitorInfo,
79
+ usersSchema,
80
+ Users,
81
+ eventsSchema,
82
+ Events,
83
+ lightMonitorSchema,
84
+ LightMonitors,
85
+ monitorSuppliersSchema,
86
+ MonitorSuppliers,
87
+ contextsSchema,
88
+ Contexts,
89
+ parametersSchema,
90
+ Parameters,
91
+ announcementSchema,
92
+ Announcements,
93
+ jobsSchema,
94
+ Jobs,
95
+ apiKeySchema,
96
+ ApiKey,
97
+ UsageMetrics,
98
+ usageMetricsSchema,
99
+ Audit,
100
+ auditSchema,
101
+ EventsAudit,
102
+ eventsAuditSchema,
103
+ MonitorAudit,
104
+ monitorAuditSchema,
105
+ AlertsAudit,
106
+ Alerts,
107
+ alertsSchema,
108
+ alertsAuditSchema,
109
+ Features,
110
+ featuresSchema,
111
+ dataCompletenessSchema,
112
+ DataCompleteness,
113
+ };
@@ -1,23 +1,23 @@
1
- import mongoose from 'mongoose';
2
-
3
- const adminSchema = mongoose.Schema({
4
- name: String,
5
- phone: String,
6
- email: String,
7
- password: String,
8
- orgId: { type: mongoose.Types.ObjectId, ref: 'Organizations' },
9
- permissionName: {type: String, enum: ['Super Admin', 'Admin', 'Member', 'Partner']},
10
- permissions: [{type: String, enum: ['create', 'read', 'update', 'delete', 'communicate']}],
11
- authorized: { type: Boolean, default: false },
12
- isActive: { type: Boolean, default: false },
13
- },
14
- {
15
- timestamps: true
16
- });
17
-
18
- adminSchema.index({email: 1});
19
-
20
-
21
- const Admin = mongoose.model('Admin', adminSchema);
22
-
1
+ import mongoose from 'mongoose';
2
+
3
+ const adminSchema = mongoose.Schema({
4
+ name: String,
5
+ phone: String,
6
+ email: String,
7
+ password: String,
8
+ orgId: { type: mongoose.Types.ObjectId, ref: 'Organizations' },
9
+ permissionName: {type: String, enum: ['Super Admin', 'Admin', 'Member', 'Partner']},
10
+ permissions: [{type: String, enum: ['create', 'read', 'update', 'delete', 'communicate']}],
11
+ authorized: { type: Boolean, default: false },
12
+ isActive: { type: Boolean, default: false },
13
+ },
14
+ {
15
+ timestamps: true
16
+ });
17
+
18
+ adminSchema.index({email: 1});
19
+
20
+
21
+ const Admin = mongoose.model('Admin', adminSchema);
22
+
23
23
  export {adminSchema, Admin};