@resolveio/server-lib 12.5.52 → 12.5.54
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/.nodemon.json +5 -0
- package/.vscode/settings.json +3 -0
- package/README.md +22 -0
- package/compileDTS.pl +64 -0
- package/gulpfile.js +127 -0
- package/mongodbensurers.js +2 -0
- package/mongostop.js +3 -0
- package/package.json +1 -1
- package/settings.development.json +13 -0
- package/src/client-server-app.ts +7 -0
- package/src/collections/app-status.collection.ts +51 -0
- package/src/collections/counter.collection.ts +54 -0
- package/src/collections/cron-job-history.collection.ts +82 -0
- package/src/collections/cron-job.collection.ts +85 -0
- package/src/collections/email-history.collection.ts +66 -0
- package/src/collections/email-verified.collection.ts +61 -0
- package/src/collections/file.collection.ts +73 -0
- package/src/collections/flag.collection.ts +56 -0
- package/src/collections/log-method-latency.collection.ts +64 -0
- package/src/collections/log-subscription.collection.ts +68 -0
- package/src/collections/log-ts.collection.ts +78 -0
- package/src/collections/log.collection.ts +77 -0
- package/src/collections/logged-in-users.collection.ts +65 -0
- package/src/collections/method-response.collection.ts +66 -0
- package/src/collections/monitor-cpu.collection.ts +63 -0
- package/src/collections/monitor-memory.collection.ts +75 -0
- package/src/collections/monitor-mongo.collection.ts +69 -0
- package/src/collections/notification.collection.ts +51 -0
- package/src/collections/report-builder-dashboard-builder.collection.ts +109 -0
- package/src/collections/report-builder-library.collection.ts +89 -0
- package/src/collections/report-builder-report.collection.ts +149 -0
- package/src/collections/user-group.collection.ts +90 -0
- package/src/collections/user-guide.collection.ts +57 -0
- package/src/collections/user.collection.ts +259 -0
- package/src/cron/cron.ts +188 -0
- package/src/fixtures/cron-jobs.ts +25 -0
- package/src/fixtures/init.ts +10 -0
- package/src/http/auth.ts +732 -0
- package/src/http/health.ts +7 -0
- package/src/http/home.ts +71 -0
- package/src/index.ts +71 -0
- package/src/managers/cron.manager.ts +208 -0
- package/src/managers/method.manager.ts +607 -0
- package/src/managers/mongo.manager.ts +2282 -0
- package/src/managers/monitor.manager.ts +323 -0
- package/src/managers/subscription.manager.ts +1196 -0
- package/{managers/subscription.performance.js → src/managers/subscription.performance.ts} +68 -33
- package/src/methods/accounts.ts +202 -0
- package/src/methods/aws.ts +507 -0
- package/src/methods/collections.ts +512 -0
- package/src/methods/counters.ts +75 -0
- package/src/methods/cron-jobs.ts +1454 -0
- package/src/methods/flags.ts +7 -0
- package/src/methods/logs.ts +327 -0
- package/src/methods/monitor.ts +548 -0
- package/src/methods/pdf.ts +615 -0
- package/src/methods/report-builder.ts +876 -0
- package/src/methods/support.ts +146 -0
- package/{models/app-status.model.d.ts → src/models/app-status.model.ts} +3 -2
- package/{models/billing-logged-in-users.model.d.ts → src/models/billing-logged-in-users.model.ts} +5 -4
- package/src/models/collection-document.model.ts +22 -0
- package/{models/counter.model.d.ts → src/models/counter.model.ts} +4 -3
- package/src/models/cron-job-history.model.ts +13 -0
- package/src/models/cron-job.model.ts +14 -0
- package/src/models/dialog.model.ts +25 -0
- package/{models/email-history.model.d.ts → src/models/email-history.model.ts} +8 -7
- package/{models/email-verified.model.d.ts → src/models/email-verified.model.ts} +6 -5
- package/{models/file.model.d.ts → src/models/file.model.ts} +8 -7
- package/{models/flag.model.d.ts → src/models/flag.model.ts} +4 -3
- package/{models/log-method-latency.model.d.ts → src/models/log-method-latency.model.ts} +5 -4
- package/{models/log-subscription.model.d.ts → src/models/log-subscription.model.ts} +8 -6
- package/{models/log.model.d.ts → src/models/log.model.ts} +12 -10
- package/{models/logged-in-users.model.d.ts → src/models/logged-in-users.model.ts} +6 -5
- package/{models/method-response.model.d.ts → src/models/method-response.model.ts} +7 -6
- package/src/models/method.model.ts +11 -0
- package/{models/monitor-cpu.model.d.ts → src/models/monitor-cpu.model.ts} +9 -7
- package/src/models/monitor-memory.model.ts +17 -0
- package/src/models/monitor-mongo.model.ts +15 -0
- package/{models/notification.model.d.ts → src/models/notification.model.ts} +3 -2
- package/src/models/pagination.model.ts +30 -0
- package/src/models/permission.model.ts +14 -0
- package/src/models/report-builder-dashboard-builder.model.ts +29 -0
- package/src/models/report-builder-library.model.ts +20 -0
- package/src/models/report-builder-report.model.ts +110 -0
- package/src/models/report-builder.model.ts +68 -0
- package/src/models/select-data-label.model.ts +9 -0
- package/src/models/server-response.model.ts +5 -0
- package/src/models/subscription.model.ts +64 -0
- package/src/models/support-ticket.model.ts +81 -0
- package/src/models/user-group.model.ts +23 -0
- package/{models/user-guide.model.d.ts → src/models/user-guide.model.ts} +5 -4
- package/src/models/user.model.ts +79 -0
- package/{public_api.d.ts → src/public_api.ts} +1 -1
- package/src/publications/app-status.ts +13 -0
- package/src/publications/cron-jobs.ts +30 -0
- package/src/publications/files.ts +34 -0
- package/src/publications/flags.ts +20 -0
- package/src/publications/logs.ts +164 -0
- package/src/publications/method-responses.ts +13 -0
- package/src/publications/notifications.ts +13 -0
- package/src/publications/report-builder-dashboard-builders.ts +39 -0
- package/src/publications/report-builder-libraries.ts +41 -0
- package/src/publications/report-builder-reports.ts +48 -0
- package/src/publications/super-admin.ts +13 -0
- package/src/publications/user-groups.ts +12 -0
- package/src/publications/user-guides.ts +12 -0
- package/src/server-app.ts +769 -0
- package/src/util/common.ts +519 -0
- package/src/util/schema-report-builder.ts +413 -0
- package/tsconfig.json +30 -0
- package/tslint.json +143 -0
- package/client-server-app.d.ts +0 -1
- package/client-server-app.js +0 -48
- package/client-server-app.js.map +0 -1
- package/collections/app-status.collection.d.ts +0 -3
- package/collections/app-status.collection.js +0 -51
- package/collections/app-status.collection.js.map +0 -1
- package/collections/counter.collection.d.ts +0 -3
- package/collections/counter.collection.js +0 -54
- package/collections/counter.collection.js.map +0 -1
- package/collections/cron-job-history.collection.d.ts +0 -3
- package/collections/cron-job-history.collection.js +0 -82
- package/collections/cron-job-history.collection.js.map +0 -1
- package/collections/cron-job.collection.d.ts +0 -3
- package/collections/cron-job.collection.js +0 -85
- package/collections/cron-job.collection.js.map +0 -1
- package/collections/email-history.collection.d.ts +0 -3
- package/collections/email-history.collection.js +0 -66
- package/collections/email-history.collection.js.map +0 -1
- package/collections/email-verified.collection.d.ts +0 -3
- package/collections/email-verified.collection.js +0 -61
- package/collections/email-verified.collection.js.map +0 -1
- package/collections/file.collection.d.ts +0 -3
- package/collections/file.collection.js +0 -73
- package/collections/file.collection.js.map +0 -1
- package/collections/flag.collection.d.ts +0 -3
- package/collections/flag.collection.js +0 -56
- package/collections/flag.collection.js.map +0 -1
- package/collections/log-method-latency.collection.d.ts +0 -3
- package/collections/log-method-latency.collection.js +0 -64
- package/collections/log-method-latency.collection.js.map +0 -1
- package/collections/log-subscription.collection.d.ts +0 -3
- package/collections/log-subscription.collection.js +0 -68
- package/collections/log-subscription.collection.js.map +0 -1
- package/collections/log-ts.collection.d.ts +0 -3
- package/collections/log-ts.collection.js +0 -78
- package/collections/log-ts.collection.js.map +0 -1
- package/collections/log.collection.d.ts +0 -3
- package/collections/log.collection.js +0 -77
- package/collections/log.collection.js.map +0 -1
- package/collections/logged-in-users.collection.d.ts +0 -3
- package/collections/logged-in-users.collection.js +0 -65
- package/collections/logged-in-users.collection.js.map +0 -1
- package/collections/method-response.collection.d.ts +0 -3
- package/collections/method-response.collection.js +0 -66
- package/collections/method-response.collection.js.map +0 -1
- package/collections/monitor-cpu.collection.d.ts +0 -3
- package/collections/monitor-cpu.collection.js +0 -63
- package/collections/monitor-cpu.collection.js.map +0 -1
- package/collections/monitor-memory.collection.d.ts +0 -3
- package/collections/monitor-memory.collection.js +0 -75
- package/collections/monitor-memory.collection.js.map +0 -1
- package/collections/monitor-mongo.collection.d.ts +0 -3
- package/collections/monitor-mongo.collection.js +0 -69
- package/collections/monitor-mongo.collection.js.map +0 -1
- package/collections/notification.collection.d.ts +0 -3
- package/collections/notification.collection.js +0 -51
- package/collections/notification.collection.js.map +0 -1
- package/collections/report-builder-dashboard-builder.collection.d.ts +0 -3
- package/collections/report-builder-dashboard-builder.collection.js +0 -109
- package/collections/report-builder-dashboard-builder.collection.js.map +0 -1
- package/collections/report-builder-library.collection.d.ts +0 -3
- package/collections/report-builder-library.collection.js +0 -87
- package/collections/report-builder-library.collection.js.map +0 -1
- package/collections/report-builder-report.collection.d.ts +0 -4
- package/collections/report-builder-report.collection.js +0 -149
- package/collections/report-builder-report.collection.js.map +0 -1
- package/collections/user-group.collection.d.ts +0 -4
- package/collections/user-group.collection.js +0 -90
- package/collections/user-group.collection.js.map +0 -1
- package/collections/user-guide.collection.d.ts +0 -3
- package/collections/user-guide.collection.js +0 -57
- package/collections/user-guide.collection.js.map +0 -1
- package/collections/user.collection.d.ts +0 -4
- package/collections/user.collection.js +0 -259
- package/collections/user.collection.js.map +0 -1
- package/cron/cron.d.ts +0 -5
- package/cron/cron.js +0 -162
- package/cron/cron.js.map +0 -1
- package/fixtures/cron-jobs.d.ts +0 -1
- package/fixtures/cron-jobs.js +0 -73
- package/fixtures/cron-jobs.js.map +0 -1
- package/fixtures/init.d.ts +0 -1
- package/fixtures/init.js +0 -59
- package/fixtures/init.js.map +0 -1
- package/http/auth.d.ts +0 -2
- package/http/auth.js +0 -763
- package/http/auth.js.map +0 -1
- package/http/health.d.ts +0 -1
- package/http/health.js +0 -12
- package/http/health.js.map +0 -1
- package/http/home.d.ts +0 -2
- package/http/home.js +0 -66
- package/http/home.js.map +0 -1
- package/index.d.ts +0 -23
- package/index.js +0 -127
- package/index.js.map +0 -1
- package/managers/cron.manager.d.ts +0 -17
- package/managers/cron.manager.js +0 -242
- package/managers/cron.manager.js.map +0 -1
- package/managers/method.manager.d.ts +0 -38
- package/managers/method.manager.js +0 -595
- package/managers/method.manager.js.map +0 -1
- package/managers/mongo.manager.d.ts +0 -178
- package/managers/mongo.manager.js +0 -2221
- package/managers/mongo.manager.js.map +0 -1
- package/managers/monitor.manager.d.ts +0 -59
- package/managers/monitor.manager.js +0 -351
- package/managers/monitor.manager.js.map +0 -1
- package/managers/subscription.manager.d.ts +0 -50
- package/managers/subscription.manager.js +0 -1091
- package/managers/subscription.manager.js.map +0 -1
- package/managers/subscription.performance.d.ts +0 -1
- package/managers/subscription.performance.js.map +0 -1
- package/methods/accounts.d.ts +0 -2
- package/methods/accounts.js +0 -274
- package/methods/accounts.js.map +0 -1
- package/methods/aws.d.ts +0 -2
- package/methods/aws.js +0 -617
- package/methods/aws.js.map +0 -1
- package/methods/collections.d.ts +0 -2
- package/methods/collections.js +0 -499
- package/methods/collections.js.map +0 -1
- package/methods/counters.d.ts +0 -2
- package/methods/counters.js +0 -122
- package/methods/counters.js.map +0 -1
- package/methods/cron-jobs.d.ts +0 -2
- package/methods/cron-jobs.js +0 -1315
- package/methods/cron-jobs.js.map +0 -1
- package/methods/flags.d.ts +0 -2
- package/methods/flags.js +0 -9
- package/methods/flags.js.map +0 -1
- package/methods/logs.d.ts +0 -2
- package/methods/logs.js +0 -371
- package/methods/logs.js.map +0 -1
- package/methods/monitor.d.ts +0 -2
- package/methods/monitor.js +0 -565
- package/methods/monitor.js.map +0 -1
- package/methods/pdf.d.ts +0 -2
- package/methods/pdf.js +0 -324
- package/methods/pdf.js.map +0 -1
- package/methods/report-builder.d.ts +0 -2
- package/methods/report-builder.js +0 -858
- package/methods/report-builder.js.map +0 -1
- package/methods/support.d.ts +0 -2
- package/methods/support.js +0 -246
- package/methods/support.js.map +0 -1
- package/models/app-status.model.js +0 -4
- package/models/app-status.model.js.map +0 -1
- package/models/billing-logged-in-users.model.js +0 -4
- package/models/billing-logged-in-users.model.js.map +0 -1
- package/models/collection-document.model.d.ts +0 -19
- package/models/collection-document.model.js +0 -4
- package/models/collection-document.model.js.map +0 -1
- package/models/counter.model.js +0 -4
- package/models/counter.model.js.map +0 -1
- package/models/cron-job-history.model.d.ts +0 -12
- package/models/cron-job-history.model.js +0 -4
- package/models/cron-job-history.model.js.map +0 -1
- package/models/cron-job.model.d.ts +0 -13
- package/models/cron-job.model.js +0 -4
- package/models/cron-job.model.js.map +0 -1
- package/models/dialog.model.d.ts +0 -23
- package/models/dialog.model.js +0 -4
- package/models/dialog.model.js.map +0 -1
- package/models/email-history.model.js +0 -4
- package/models/email-history.model.js.map +0 -1
- package/models/email-verified.model.js +0 -4
- package/models/email-verified.model.js.map +0 -1
- package/models/file.model.js +0 -4
- package/models/file.model.js.map +0 -1
- package/models/flag.model.js +0 -4
- package/models/flag.model.js.map +0 -1
- package/models/log-method-latency.model.js +0 -4
- package/models/log-method-latency.model.js.map +0 -1
- package/models/log-subscription.model.js +0 -4
- package/models/log-subscription.model.js.map +0 -1
- package/models/log.model.js +0 -4
- package/models/log.model.js.map +0 -1
- package/models/logged-in-users.model.js +0 -4
- package/models/logged-in-users.model.js.map +0 -1
- package/models/method-response.model.js +0 -4
- package/models/method-response.model.js.map +0 -1
- package/models/method.model.d.ts +0 -9
- package/models/method.model.js +0 -4
- package/models/method.model.js.map +0 -1
- package/models/monitor-cpu.model.js +0 -4
- package/models/monitor-cpu.model.js.map +0 -1
- package/models/monitor-memory.model.d.ts +0 -15
- package/models/monitor-memory.model.js +0 -4
- package/models/monitor-memory.model.js.map +0 -1
- package/models/monitor-mongo.model.d.ts +0 -13
- package/models/monitor-mongo.model.js +0 -4
- package/models/monitor-mongo.model.js.map +0 -1
- package/models/notification.model.js +0 -4
- package/models/notification.model.js.map +0 -1
- package/models/pagination.model.d.ts +0 -10
- package/models/pagination.model.js +0 -24
- package/models/pagination.model.js.map +0 -1
- package/models/permission.model.d.ts +0 -12
- package/models/permission.model.js +0 -4
- package/models/permission.model.js.map +0 -1
- package/models/report-builder-dashboard-builder.model.d.ts +0 -25
- package/models/report-builder-dashboard-builder.model.js +0 -4
- package/models/report-builder-dashboard-builder.model.js.map +0 -1
- package/models/report-builder-library.model.d.ts +0 -17
- package/models/report-builder-library.model.js +0 -4
- package/models/report-builder-library.model.js.map +0 -1
- package/models/report-builder-report.model.d.ts +0 -98
- package/models/report-builder-report.model.js +0 -4
- package/models/report-builder-report.model.js.map +0 -1
- package/models/report-builder.model.d.ts +0 -61
- package/models/report-builder.model.js +0 -4
- package/models/report-builder.model.js.map +0 -1
- package/models/select-data-label.model.d.ts +0 -9
- package/models/select-data-label.model.js +0 -4
- package/models/select-data-label.model.js.map +0 -1
- package/models/server-response.model.d.ts +0 -5
- package/models/server-response.model.js +0 -4
- package/models/server-response.model.js.map +0 -1
- package/models/subscription.model.d.ts +0 -23
- package/models/subscription.model.js +0 -4
- package/models/subscription.model.js.map +0 -1
- package/models/support-ticket.model.d.ts +0 -72
- package/models/support-ticket.model.js +0 -4
- package/models/support-ticket.model.js.map +0 -1
- package/models/user-group.model.d.ts +0 -19
- package/models/user-group.model.js +0 -4
- package/models/user-group.model.js.map +0 -1
- package/models/user-guide.model.js +0 -4
- package/models/user-guide.model.js.map +0 -1
- package/models/user.model.d.ts +0 -70
- package/models/user.model.js +0 -4
- package/models/user.model.js.map +0 -1
- package/public_api.js +0 -75
- package/public_api.js.map +0 -1
- package/publications/app-status.d.ts +0 -2
- package/publications/app-status.js +0 -17
- package/publications/app-status.js.map +0 -1
- package/publications/cron-jobs.d.ts +0 -2
- package/publications/cron-jobs.js +0 -33
- package/publications/cron-jobs.js.map +0 -1
- package/publications/files.d.ts +0 -2
- package/publications/files.js +0 -37
- package/publications/files.js.map +0 -1
- package/publications/flags.d.ts +0 -2
- package/publications/flags.js +0 -23
- package/publications/flags.js.map +0 -1
- package/publications/logs.d.ts +0 -2
- package/publications/logs.js +0 -165
- package/publications/logs.js.map +0 -1
- package/publications/method-responses.d.ts +0 -2
- package/publications/method-responses.js +0 -17
- package/publications/method-responses.js.map +0 -1
- package/publications/notifications.d.ts +0 -2
- package/publications/notifications.js +0 -17
- package/publications/notifications.js.map +0 -1
- package/publications/report-builder-dashboard-builders.d.ts +0 -2
- package/publications/report-builder-dashboard-builders.js +0 -43
- package/publications/report-builder-dashboard-builders.js.map +0 -1
- package/publications/report-builder-libraries.d.ts +0 -2
- package/publications/report-builder-libraries.js +0 -90
- package/publications/report-builder-libraries.js.map +0 -1
- package/publications/report-builder-reports.d.ts +0 -2
- package/publications/report-builder-reports.js +0 -51
- package/publications/report-builder-reports.js.map +0 -1
- package/publications/super-admin.d.ts +0 -2
- package/publications/super-admin.js +0 -17
- package/publications/super-admin.js.map +0 -1
- package/publications/user-groups.d.ts +0 -1
- package/publications/user-groups.js +0 -17
- package/publications/user-groups.js.map +0 -1
- package/publications/user-guides.d.ts +0 -1
- package/publications/user-guides.js +0 -17
- package/publications/user-guides.js.map +0 -1
- package/server-app.d.ts +0 -52
- package/server-app.js +0 -739
- package/server-app.js.map +0 -1
- package/util/common.d.ts +0 -25
- package/util/common.js +0 -524
- package/util/common.js.map +0 -1
- package/util/schema-report-builder.d.ts +0 -6
- package/util/schema-report-builder.js +0 -453
- package/util/schema-report-builder.js.map +0 -1
- /package/{private → src/private}/email-templates/enrollment.html +0 -0
- /package/{private → src/private}/email-templates/forgot-password.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket-deleted.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket-modified.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket.html +0 -0
- /package/{private → src/private}/images/ResolveIO.png +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { FileModel } from '../models/file.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
__v: {
|
|
11
|
+
type: Number,
|
|
12
|
+
optional: true
|
|
13
|
+
},
|
|
14
|
+
updatedAt: {
|
|
15
|
+
type: Date,
|
|
16
|
+
optional: true
|
|
17
|
+
},
|
|
18
|
+
createdAt: {
|
|
19
|
+
type: Date,
|
|
20
|
+
optional: true
|
|
21
|
+
},
|
|
22
|
+
name: {
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
type: Number
|
|
27
|
+
},
|
|
28
|
+
key: {
|
|
29
|
+
type: String
|
|
30
|
+
},
|
|
31
|
+
type: {
|
|
32
|
+
type: String
|
|
33
|
+
},
|
|
34
|
+
order: {
|
|
35
|
+
type: Number
|
|
36
|
+
},
|
|
37
|
+
status: {
|
|
38
|
+
type: String,
|
|
39
|
+
optional: true
|
|
40
|
+
},
|
|
41
|
+
default: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
optional: true
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export let Files: MongoManagerCollection<FileModel> = null;
|
|
48
|
+
|
|
49
|
+
initializeCollection();
|
|
50
|
+
|
|
51
|
+
function initializeCollection() {
|
|
52
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
53
|
+
const model = new MongoManagerModel<FileModel>({
|
|
54
|
+
collectionName: 'files',
|
|
55
|
+
schema: schema,
|
|
56
|
+
useVersionCollection: false,
|
|
57
|
+
useReportBuilder: true,
|
|
58
|
+
reportBuilderLookupTables: [],
|
|
59
|
+
timestamps: true,
|
|
60
|
+
createLogs: false,
|
|
61
|
+
checkSchema: true,
|
|
62
|
+
collectionOptions: null
|
|
63
|
+
});
|
|
64
|
+
Files = model.collection_main;
|
|
65
|
+
Files.createIndex({type: 1, createdAt: 1});
|
|
66
|
+
Files.createIndex({key: 1});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
initializeCollection();
|
|
71
|
+
}, 1);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { FlagModel } from '../models/flag.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
__v: {
|
|
11
|
+
type: Number,
|
|
12
|
+
optional: true
|
|
13
|
+
},
|
|
14
|
+
updatedAt: {
|
|
15
|
+
type: Date,
|
|
16
|
+
optional: true
|
|
17
|
+
},
|
|
18
|
+
createdAt: {
|
|
19
|
+
type: Date,
|
|
20
|
+
optional: true
|
|
21
|
+
},
|
|
22
|
+
type: {
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
value: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
optional: true
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export let Flags: MongoManagerCollection<FlagModel> = null;
|
|
32
|
+
|
|
33
|
+
initializeCollection();
|
|
34
|
+
|
|
35
|
+
function initializeCollection() {
|
|
36
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
37
|
+
const model = new MongoManagerModel<FlagModel>({
|
|
38
|
+
collectionName: 'flags',
|
|
39
|
+
schema: schema,
|
|
40
|
+
useVersionCollection: false,
|
|
41
|
+
useReportBuilder: false,
|
|
42
|
+
reportBuilderLookupTables: [],
|
|
43
|
+
timestamps: true,
|
|
44
|
+
createLogs: false,
|
|
45
|
+
checkSchema: true,
|
|
46
|
+
collectionOptions: null
|
|
47
|
+
});
|
|
48
|
+
Flags = model.collection_main;
|
|
49
|
+
Flags.createIndex({type: 1}, {unique: true});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
initializeCollection();
|
|
54
|
+
}, 0);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { LogMethodLatencyModel } from '../models/log-method-latency.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
__v: {
|
|
11
|
+
type: Number,
|
|
12
|
+
optional: true
|
|
13
|
+
},
|
|
14
|
+
updatedAt: {
|
|
15
|
+
type: Date,
|
|
16
|
+
optional: true
|
|
17
|
+
},
|
|
18
|
+
createdAt: {
|
|
19
|
+
type: Date,
|
|
20
|
+
optional: true
|
|
21
|
+
},
|
|
22
|
+
date_start: {
|
|
23
|
+
type: Date
|
|
24
|
+
},
|
|
25
|
+
date_end: {
|
|
26
|
+
type: Date,
|
|
27
|
+
optional: true
|
|
28
|
+
},
|
|
29
|
+
latency_ms: {
|
|
30
|
+
type: Number
|
|
31
|
+
},
|
|
32
|
+
method: {
|
|
33
|
+
type: String
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export let LogMethodLatencies: MongoManagerCollection<LogMethodLatencyModel> = null;
|
|
38
|
+
|
|
39
|
+
initializeCollection();
|
|
40
|
+
|
|
41
|
+
function initializeCollection() {
|
|
42
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
43
|
+
const model = new MongoManagerModel<LogMethodLatencyModel>({
|
|
44
|
+
collectionName: 'log-method-latencies',
|
|
45
|
+
schema: schema,
|
|
46
|
+
useVersionCollection: false,
|
|
47
|
+
useReportBuilder: true,
|
|
48
|
+
reportBuilderLookupTables: [],
|
|
49
|
+
timestamps: true,
|
|
50
|
+
createLogs: false,
|
|
51
|
+
checkSchema: true,
|
|
52
|
+
collectionOptions: null
|
|
53
|
+
});
|
|
54
|
+
LogMethodLatencies = model.collection_main;
|
|
55
|
+
LogMethodLatencies.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 30});
|
|
56
|
+
LogMethodLatencies.createIndex({latency_ms: 1});
|
|
57
|
+
LogMethodLatencies.createIndex({method: 1});
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
initializeCollection();
|
|
62
|
+
}, 1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { LogSubscriptionModel } from '../models/log-subscription.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
__v: {
|
|
11
|
+
type: Number,
|
|
12
|
+
optional: true
|
|
13
|
+
},
|
|
14
|
+
updatedAt: {
|
|
15
|
+
type: Date,
|
|
16
|
+
optional: true
|
|
17
|
+
},
|
|
18
|
+
createdAt: {
|
|
19
|
+
type: Date,
|
|
20
|
+
optional: true
|
|
21
|
+
},
|
|
22
|
+
date: {
|
|
23
|
+
type: Date
|
|
24
|
+
},
|
|
25
|
+
type: {
|
|
26
|
+
type: String
|
|
27
|
+
},
|
|
28
|
+
subscription: {
|
|
29
|
+
type: String
|
|
30
|
+
},
|
|
31
|
+
collection_name: {
|
|
32
|
+
type: String
|
|
33
|
+
},
|
|
34
|
+
subData: {
|
|
35
|
+
type: String
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export let LogSubscriptions: MongoManagerCollection<LogSubscriptionModel> = null;
|
|
40
|
+
|
|
41
|
+
initializeCollection();
|
|
42
|
+
|
|
43
|
+
function initializeCollection() {
|
|
44
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
45
|
+
const model = new MongoManagerModel<LogSubscriptionModel>({
|
|
46
|
+
collectionName: 'log-subscriptions',
|
|
47
|
+
schema: schema,
|
|
48
|
+
useVersionCollection: false,
|
|
49
|
+
useReportBuilder: true,
|
|
50
|
+
reportBuilderLookupTables: [],
|
|
51
|
+
timestamps: true,
|
|
52
|
+
createLogs: false,
|
|
53
|
+
checkSchema: true,
|
|
54
|
+
collectionOptions: null
|
|
55
|
+
});
|
|
56
|
+
LogSubscriptions = model.collection_main;
|
|
57
|
+
LogSubscriptions.createIndex({date: 1}, {expireAfterSeconds: 60 * 60 * 24 * 30});
|
|
58
|
+
LogSubscriptions.createIndex({type: 1});
|
|
59
|
+
LogSubscriptions.createIndex({collection_name: 1});
|
|
60
|
+
LogSubscriptions.createIndex({date: 1, type: 1});
|
|
61
|
+
LogSubscriptions.createIndex({createdAt: 1});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
initializeCollection();
|
|
66
|
+
}, 1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { LogModel } from '../models/log.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
createdAt: {
|
|
11
|
+
type: Date,
|
|
12
|
+
optional: true
|
|
13
|
+
},
|
|
14
|
+
metadata: {
|
|
15
|
+
type: Object
|
|
16
|
+
},
|
|
17
|
+
'metadata.type': {
|
|
18
|
+
type: String
|
|
19
|
+
},
|
|
20
|
+
'metadata.collection': {
|
|
21
|
+
type: String
|
|
22
|
+
},
|
|
23
|
+
id_document: {
|
|
24
|
+
type: String
|
|
25
|
+
},
|
|
26
|
+
payload: {
|
|
27
|
+
type: String
|
|
28
|
+
},
|
|
29
|
+
method: {
|
|
30
|
+
type: String
|
|
31
|
+
},
|
|
32
|
+
id_user: {
|
|
33
|
+
type: String
|
|
34
|
+
},
|
|
35
|
+
user: {
|
|
36
|
+
type: String
|
|
37
|
+
},
|
|
38
|
+
messageId: {
|
|
39
|
+
type: Number
|
|
40
|
+
},
|
|
41
|
+
route: {
|
|
42
|
+
type: String
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export let Logs: MongoManagerCollection<LogModel> = null;
|
|
47
|
+
|
|
48
|
+
initializeCollection();
|
|
49
|
+
|
|
50
|
+
function initializeCollection() {
|
|
51
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
52
|
+
const model = new MongoManagerModel<LogModel>({
|
|
53
|
+
collectionName: 'logs',
|
|
54
|
+
schema: schema,
|
|
55
|
+
useVersionCollection: false,
|
|
56
|
+
useReportBuilder: false,
|
|
57
|
+
reportBuilderLookupTables: [],
|
|
58
|
+
timestamps: true,
|
|
59
|
+
createLogs: false,
|
|
60
|
+
checkSchema: true,
|
|
61
|
+
collectionOptions: null
|
|
62
|
+
});
|
|
63
|
+
Logs = model.collection_main;
|
|
64
|
+
Logs.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 90});
|
|
65
|
+
Logs.createIndex({createdAt: -1, type: 1, id_document: 1});
|
|
66
|
+
Logs.createIndex({createdAt: -1, type: 1, user: 1});
|
|
67
|
+
Logs.createIndex({createdAt: -1, type: 1, method: 1});
|
|
68
|
+
Logs.createIndex({createdAt: -1, type: 1, route: 1});
|
|
69
|
+
Logs.createIndex({createdAt: -1, type: 1, collection: 1, id_document: 1});
|
|
70
|
+
Logs.createIndex({createdAt: -1, type: 1, collection: 1, method: 1, route: 1});
|
|
71
|
+
Logs.createIndex({createdAt: -1, type: 1, collection: 1, route: 1});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
initializeCollection();
|
|
76
|
+
}, 1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { LogModel } from '../models/log.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
__v: {
|
|
11
|
+
type: Number,
|
|
12
|
+
optional: true
|
|
13
|
+
},
|
|
14
|
+
updatedAt: {
|
|
15
|
+
type: Date,
|
|
16
|
+
optional: true
|
|
17
|
+
},
|
|
18
|
+
createdAt: {
|
|
19
|
+
type: Date,
|
|
20
|
+
optional: true
|
|
21
|
+
},
|
|
22
|
+
type: {
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
collection: {
|
|
26
|
+
type: String
|
|
27
|
+
},
|
|
28
|
+
id_document: {
|
|
29
|
+
type: String
|
|
30
|
+
},
|
|
31
|
+
payload: {
|
|
32
|
+
type: String
|
|
33
|
+
},
|
|
34
|
+
method: {
|
|
35
|
+
type: String
|
|
36
|
+
},
|
|
37
|
+
id_user: {
|
|
38
|
+
type: String
|
|
39
|
+
},
|
|
40
|
+
user: {
|
|
41
|
+
type: String
|
|
42
|
+
},
|
|
43
|
+
messageId: {
|
|
44
|
+
type: Number
|
|
45
|
+
},
|
|
46
|
+
route: {
|
|
47
|
+
type: String
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export let Logs: MongoManagerCollection<LogModel> = null;
|
|
52
|
+
|
|
53
|
+
initializeCollection();
|
|
54
|
+
|
|
55
|
+
function initializeCollection() {
|
|
56
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
57
|
+
const model = new MongoManagerModel<LogModel>({
|
|
58
|
+
collectionName: 'logs',
|
|
59
|
+
schema: schema,
|
|
60
|
+
useVersionCollection: false,
|
|
61
|
+
useReportBuilder: false,
|
|
62
|
+
reportBuilderLookupTables: [],
|
|
63
|
+
timestamps: true,
|
|
64
|
+
createLogs: false,
|
|
65
|
+
checkSchema: true,
|
|
66
|
+
collectionOptions: null
|
|
67
|
+
});
|
|
68
|
+
Logs = model.collection_main;
|
|
69
|
+
Logs.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 90});
|
|
70
|
+
Logs.createIndex({createdAt: -1, type: 1, id_document: 1});
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
initializeCollection();
|
|
75
|
+
}, 1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { LoggedInUserModel } from '../models/logged-in-users.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
__v: {
|
|
11
|
+
type: Number,
|
|
12
|
+
optional: true
|
|
13
|
+
},
|
|
14
|
+
updatedAt: {
|
|
15
|
+
type: Date,
|
|
16
|
+
optional: true
|
|
17
|
+
},
|
|
18
|
+
createdAt: {
|
|
19
|
+
type: Date,
|
|
20
|
+
optional: true
|
|
21
|
+
},
|
|
22
|
+
date: {
|
|
23
|
+
type: Date
|
|
24
|
+
},
|
|
25
|
+
id_user: {
|
|
26
|
+
type: String
|
|
27
|
+
},
|
|
28
|
+
user: {
|
|
29
|
+
type: String
|
|
30
|
+
},
|
|
31
|
+
id_ws: {
|
|
32
|
+
type: String
|
|
33
|
+
},
|
|
34
|
+
latency: {
|
|
35
|
+
type: Number,
|
|
36
|
+
optional: true
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export let LoggedInUsers: MongoManagerCollection<LoggedInUserModel> = null;
|
|
41
|
+
|
|
42
|
+
initializeCollection();
|
|
43
|
+
|
|
44
|
+
function initializeCollection() {
|
|
45
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
46
|
+
const model = new MongoManagerModel<LoggedInUserModel>({
|
|
47
|
+
collectionName: 'logged-in-users',
|
|
48
|
+
schema: schema,
|
|
49
|
+
useVersionCollection: false,
|
|
50
|
+
useReportBuilder: false,
|
|
51
|
+
reportBuilderLookupTables: [],
|
|
52
|
+
timestamps: true,
|
|
53
|
+
createLogs: false,
|
|
54
|
+
checkSchema: true,
|
|
55
|
+
collectionOptions: null
|
|
56
|
+
});
|
|
57
|
+
LoggedInUsers = model.collection_main;
|
|
58
|
+
LoggedInUsers.createIndex({id_ws: 1});
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
initializeCollection();
|
|
63
|
+
}, 1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { MethodResponseModel } from '../models/method-response.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
__v: {
|
|
11
|
+
type: Number,
|
|
12
|
+
optional: true
|
|
13
|
+
},
|
|
14
|
+
updatedAt: {
|
|
15
|
+
type: Date,
|
|
16
|
+
optional: true
|
|
17
|
+
},
|
|
18
|
+
createdAt: {
|
|
19
|
+
type: Date,
|
|
20
|
+
optional: true
|
|
21
|
+
},
|
|
22
|
+
id_user: {
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
message_id: {
|
|
26
|
+
type: Number
|
|
27
|
+
},
|
|
28
|
+
method: {
|
|
29
|
+
type: String
|
|
30
|
+
},
|
|
31
|
+
response: {
|
|
32
|
+
type: Object,
|
|
33
|
+
blackbox: true
|
|
34
|
+
},
|
|
35
|
+
date: {
|
|
36
|
+
type: Date
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export let MethodResponses: MongoManagerCollection<MethodResponseModel> = null;
|
|
41
|
+
|
|
42
|
+
initializeCollection();
|
|
43
|
+
|
|
44
|
+
function initializeCollection() {
|
|
45
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
46
|
+
const model = new MongoManagerModel<MethodResponseModel>({
|
|
47
|
+
collectionName: 'method-responses',
|
|
48
|
+
schema: schema,
|
|
49
|
+
useVersionCollection: false,
|
|
50
|
+
useReportBuilder: false,
|
|
51
|
+
reportBuilderLookupTables: [],
|
|
52
|
+
timestamps: true,
|
|
53
|
+
createLogs: false,
|
|
54
|
+
checkSchema: true,
|
|
55
|
+
collectionOptions: null
|
|
56
|
+
});
|
|
57
|
+
MethodResponses = model.collection_main;
|
|
58
|
+
MethodResponses.createIndex({id_user: 1, message_id: 1});
|
|
59
|
+
MethodResponses.createIndex({createdAt: 1}, {expireAfterSeconds: 86400});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
initializeCollection();
|
|
64
|
+
}, 1);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { MonitorCPUModel } from '../models/monitor-cpu.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
metadata: {
|
|
11
|
+
type: Object
|
|
12
|
+
},
|
|
13
|
+
'metadata.client': {
|
|
14
|
+
type: String
|
|
15
|
+
},
|
|
16
|
+
'metadata.instance': {
|
|
17
|
+
type: String
|
|
18
|
+
},
|
|
19
|
+
date: {
|
|
20
|
+
type: Date
|
|
21
|
+
},
|
|
22
|
+
app: {
|
|
23
|
+
type: Number
|
|
24
|
+
},
|
|
25
|
+
system: {
|
|
26
|
+
type: Number
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export let MonitorCPUs: MongoManagerCollection<MonitorCPUModel> = null;
|
|
31
|
+
|
|
32
|
+
initializeCollection();
|
|
33
|
+
|
|
34
|
+
function initializeCollection() {
|
|
35
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
36
|
+
const model = new MongoManagerModel<MonitorCPUModel>({
|
|
37
|
+
collectionName: 'monitor-cpus',
|
|
38
|
+
schema: schema,
|
|
39
|
+
useVersionCollection: false,
|
|
40
|
+
useReportBuilder: false,
|
|
41
|
+
reportBuilderLookupTables: [],
|
|
42
|
+
timestamps: false,
|
|
43
|
+
createLogs: false,
|
|
44
|
+
checkSchema: false,
|
|
45
|
+
collectionOptions: {
|
|
46
|
+
timeseries: {
|
|
47
|
+
timeField: 'date',
|
|
48
|
+
granularity: 'seconds',
|
|
49
|
+
metaField: 'metadata'
|
|
50
|
+
},
|
|
51
|
+
expireAfterSeconds: 60 * 60 * 24 * 3
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
MonitorCPUs = model.collection_main;
|
|
55
|
+
MonitorCPUs.createIndex({'metadata.client': 1, date: 1});
|
|
56
|
+
MonitorCPUs.createIndex({'metadata.client': 1, 'metadata.instance': 1, date: 1});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
initializeCollection();
|
|
61
|
+
}, 1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ResolveIOServer } from '../index';
|
|
2
|
+
import { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';
|
|
3
|
+
import { MonitorMemoryModel } from '../models/monitor-memory.model';
|
|
4
|
+
|
|
5
|
+
let schema: any = {
|
|
6
|
+
_id: {
|
|
7
|
+
type: String,
|
|
8
|
+
optional: true
|
|
9
|
+
},
|
|
10
|
+
metadata: {
|
|
11
|
+
type: Object
|
|
12
|
+
},
|
|
13
|
+
'metadata.client': {
|
|
14
|
+
type: String
|
|
15
|
+
},
|
|
16
|
+
'metadata.instance': {
|
|
17
|
+
type: String
|
|
18
|
+
},
|
|
19
|
+
date: {
|
|
20
|
+
type: Date
|
|
21
|
+
},
|
|
22
|
+
physical_total: {
|
|
23
|
+
type: Number
|
|
24
|
+
},
|
|
25
|
+
physical_used: {
|
|
26
|
+
type: Number
|
|
27
|
+
},
|
|
28
|
+
physical_free: {
|
|
29
|
+
type: Number
|
|
30
|
+
},
|
|
31
|
+
virtual: {
|
|
32
|
+
type: Number
|
|
33
|
+
},
|
|
34
|
+
private: {
|
|
35
|
+
type: Number
|
|
36
|
+
},
|
|
37
|
+
physical: {
|
|
38
|
+
type: Number
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export let MonitorMemorys: MongoManagerCollection<MonitorMemoryModel> = null;
|
|
43
|
+
|
|
44
|
+
initializeCollection();
|
|
45
|
+
|
|
46
|
+
function initializeCollection() {
|
|
47
|
+
if (ResolveIOServer && ResolveIOServer.getMainDB()) {
|
|
48
|
+
const model = new MongoManagerModel<MonitorMemoryModel>({
|
|
49
|
+
collectionName: 'monitor-memorys',
|
|
50
|
+
schema: schema,
|
|
51
|
+
useVersionCollection: false,
|
|
52
|
+
useReportBuilder: false,
|
|
53
|
+
reportBuilderLookupTables: [],
|
|
54
|
+
timestamps: false,
|
|
55
|
+
createLogs: false,
|
|
56
|
+
checkSchema: false,
|
|
57
|
+
collectionOptions: {
|
|
58
|
+
timeseries: {
|
|
59
|
+
timeField: 'date',
|
|
60
|
+
granularity: 'seconds',
|
|
61
|
+
metaField: 'metadata'
|
|
62
|
+
},
|
|
63
|
+
expireAfterSeconds: 60 * 60 * 24 * 3
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
MonitorMemorys = model.collection_main;
|
|
67
|
+
MonitorMemorys.createIndex({'metadata.client': 1, date: 1});
|
|
68
|
+
MonitorMemorys.createIndex({'metadata.client': 1, 'metadata.instance': 1, date: 1});
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
initializeCollection();
|
|
73
|
+
}, 1);
|
|
74
|
+
}
|
|
75
|
+
}
|