@resolveio/server-lib 3.2.11 → 3.2.12
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/collections/active-subscription.collection.d.ts +7 -0
- package/collections/active-subscription.collection.js +68 -0
- package/collections/app-status.collection.d.ts +7 -0
- package/collections/app-status.collection.js +43 -0
- package/collections/app-version.collection.d.ts +7 -0
- package/collections/app-version.collection.js +56 -0
- package/collections/billing-logged-in-users.collection.d.ts +7 -0
- package/collections/billing-logged-in-users.collection.js +73 -0
- package/collections/counter.collection.d.ts +9 -0
- package/collections/counter.collection.js +73 -0
- package/collections/cron-job-history.collection.d.ts +7 -0
- package/collections/cron-job-history.collection.js +86 -0
- package/collections/cron-job.collection.d.ts +7 -0
- package/collections/cron-job.collection.js +89 -0
- package/collections/file.collection.d.ts +9 -0
- package/collections/file.collection.js +73 -0
- package/collections/flag.collection.d.ts +7 -0
- package/collections/flag.collection.js +47 -0
- package/collections/log.collection.d.ts +7 -0
- package/collections/log.collection.js +65 -0
- package/collections/logged-in-users.collection.d.ts +7 -0
- package/collections/logged-in-users.collection.js +70 -0
- package/collections/method-call.collection.d.ts +6 -0
- package/collections/method-call.collection.js +44 -0
- package/collections/method-response.collection.d.ts +6 -0
- package/collections/method-response.collection.js +48 -0
- package/collections/notification.collection.d.ts +7 -0
- package/collections/notification.collection.js +43 -0
- package/collections/queue-flag.collection.d.ts +7 -0
- package/collections/queue-flag.collection.js +41 -0
- package/collections/queue-method.collection.d.ts +7 -0
- package/collections/queue-method.collection.js +119 -0
- package/collections/queue-response.collection.d.ts +7 -0
- package/collections/queue-response.collection.js +74 -0
- package/collections/support-ticket.collection.d.ts +7 -0
- package/collections/support-ticket.collection.js +200 -0
- package/collections/user.collection.d.ts +9 -0
- package/collections/user.collection.js +153 -0
- package/cron/cron.d.ts +5 -0
- package/cron/cron.js +160 -0
- package/fixtures/cron-jobs.d.ts +1 -0
- package/fixtures/cron-jobs.js +90 -0
- package/fixtures/init.d.ts +1 -0
- package/fixtures/init.js +67 -0
- package/http/auth.d.ts +2 -0
- package/http/auth.js +468 -0
- package/http/health.d.ts +1 -0
- package/http/health.js +8 -0
- package/index.d.ts +16 -0
- package/index.js +125 -0
- package/managers/cron.manager.d.ts +16 -0
- package/managers/cron.manager.js +202 -0
- package/managers/database.manager.d.ts +6 -0
- package/managers/database.manager.js +12 -0
- package/managers/method.manager.d.ts +28 -0
- package/managers/method.manager.js +584 -0
- package/managers/queue-method.manager.d.ts +13 -0
- package/managers/queue-method.manager.js +240 -0
- package/managers/subscription.manager.d.ts +28 -0
- package/managers/subscription.manager.js +808 -0
- package/managers/support.manager.d.ts +22 -0
- package/managers/support.manager.js +320 -0
- package/methods/accounts.d.ts +2 -0
- package/methods/accounts.js +253 -0
- package/methods/aws.d.ts +2 -0
- package/methods/aws.js +387 -0
- package/methods/cloudconvert.d.ts +2 -0
- package/methods/cloudconvert.js +37 -0
- package/methods/collections.d.ts +2 -0
- package/methods/collections.js +750 -0
- package/methods/counters.d.ts +2 -0
- package/methods/counters.js +107 -0
- package/methods/cron-jobs.d.ts +2 -0
- package/methods/cron-jobs.js +132 -0
- package/methods/flags.d.ts +2 -0
- package/methods/flags.js +6 -0
- package/methods/logs.d.ts +2 -0
- package/methods/logs.js +29 -0
- package/methods/pdf.d.ts +2 -0
- package/methods/pdf.js +303 -0
- package/models/active-subscription.model.d.ts +13 -0
- package/models/active-subscription.model.js +2 -0
- package/models/app-status.model.d.ts +4 -0
- package/models/app-status.model.js +2 -0
- package/models/app-version.model.d.ts +4 -0
- package/models/app-version.model.js +2 -0
- package/models/billing-logged-in-users.model.d.ts +7 -0
- package/models/billing-logged-in-users.model.js +2 -0
- package/models/collection-document.model.d.ts +6 -0
- package/models/collection-document.model.js +2 -0
- package/models/counter.model.d.ts +5 -0
- package/models/counter.model.js +2 -0
- package/models/cron-job-history.model.d.ts +12 -0
- package/models/cron-job-history.model.js +2 -0
- package/models/cron-job.model.d.ts +13 -0
- package/models/cron-job.model.js +2 -0
- package/models/dialog.model.d.ts +23 -0
- package/models/dialog.model.js +2 -0
- package/models/file.model.d.ts +9 -0
- package/models/file.model.js +2 -0
- package/models/flag.model.d.ts +5 -0
- package/models/flag.model.js +2 -0
- package/models/log.model.d.ts +11 -0
- package/models/log.model.js +2 -0
- package/models/logged-in-users.model.d.ts +9 -0
- package/models/logged-in-users.model.js +2 -0
- package/models/method-call.model.d.ts +7 -0
- package/models/method-call.model.js +2 -0
- package/models/method-response.model.d.ts +8 -0
- package/models/method-response.model.js +2 -0
- package/models/method.model.d.ts +10 -0
- package/models/method.model.js +2 -0
- package/models/notification.model.d.ts +4 -0
- package/models/notification.model.js +2 -0
- package/models/pagination.model.d.ts +11 -0
- package/models/pagination.model.js +20 -0
- package/models/permission.model.d.ts +12 -0
- package/models/permission.model.js +2 -0
- package/models/queue-method.model.d.ts +10 -0
- package/models/queue-method.model.js +2 -0
- package/models/queue-response.model.d.ts +10 -0
- package/models/queue-response.model.js +2 -0
- package/models/select-data-label.model.d.ts +9 -0
- package/models/select-data-label.model.js +2 -0
- package/models/server-response.model.d.ts +5 -0
- package/models/server-response.model.js +2 -0
- package/models/subscription.model.d.ts +30 -0
- package/models/subscription.model.js +2 -0
- package/models/support-method.model.d.ts +9 -0
- package/models/support-method.model.js +2 -0
- package/models/support-ticket.model.d.ts +61 -0
- package/models/support-ticket.model.js +2 -0
- package/models/user.model.d.ts +14 -0
- package/models/user.model.js +2 -0
- package/package.json +1 -1
- package/private/email-templates/enrollment.html +12 -0
- package/private/email-templates/forgot-password.html +12 -0
- package/private/email-templates/support-ticket-deleted.html +40 -0
- package/private/email-templates/support-ticket-modified.html +71 -0
- package/private/email-templates/support-ticket.html +71 -0
- package/private/images/ResolveIO.png +0 -0
- package/publications/app-status.d.ts +2 -0
- package/publications/app-status.js +14 -0
- package/publications/app-version.d.ts +2 -0
- package/publications/app-version.js +14 -0
- package/publications/billing-logged-in-users.d.ts +1 -0
- package/publications/billing-logged-in-users.js +63 -0
- package/publications/cron-jobs.d.ts +2 -0
- package/publications/cron-jobs.js +14 -0
- package/publications/files.d.ts +2 -0
- package/publications/files.js +71 -0
- package/publications/flags.d.ts +2 -0
- package/publications/flags.js +23 -0
- package/publications/logs.d.ts +2 -0
- package/publications/logs.js +26 -0
- package/publications/method-calls.d.ts +2 -0
- package/publications/method-calls.js +14 -0
- package/publications/method-responses.d.ts +2 -0
- package/publications/method-responses.js +14 -0
- package/publications/notifications.d.ts +2 -0
- package/publications/notifications.js +14 -0
- package/publications/super-admin.d.ts +2 -0
- package/publications/super-admin.js +21 -0
- package/publications/support-tickets.d.ts +1 -0
- package/publications/support-tickets.js +200 -0
- package/server-app.d.ts +35 -0
- package/server-app.js +638 -0
- package/support-methods/aws.d.ts +2 -0
- package/support-methods/aws.js +276 -0
- package/support-methods/collections.d.ts +2 -0
- package/support-methods/collections.js +471 -0
- package/support-methods/counters.d.ts +2 -0
- package/support-methods/counters.js +189 -0
- package/support-methods/support.d.ts +2 -0
- package/support-methods/support.js +236 -0
- package/util/common.d.ts +14 -0
- package/util/common.js +341 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<style type="text/css">
|
|
2
|
+
* {
|
|
3
|
+
font-size: 14px;
|
|
4
|
+
font-family: Arial;
|
|
5
|
+
background-color: white;
|
|
6
|
+
}
|
|
7
|
+
.header {
|
|
8
|
+
font-weight: bold;
|
|
9
|
+
min-width: 20px;
|
|
10
|
+
}
|
|
11
|
+
.td {
|
|
12
|
+
border: 1px solid black;
|
|
13
|
+
}
|
|
14
|
+
.tr {
|
|
15
|
+
border: 1px solid gray;
|
|
16
|
+
}
|
|
17
|
+
.tg {border-collapse:collapse;border-spacing:0;border-color:#999;}
|
|
18
|
+
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#999;color:#444;background-color:#F7FDFA;border-top-width:1px;border-bottom-width:1px;}
|
|
19
|
+
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#999;color:#fff;background-color:black;border-top-width:1px;border-bottom-width:1px;}
|
|
20
|
+
.tg .tg-baqh{text-align:left;vertical-align:top}
|
|
21
|
+
.tg .tg-yw4l{vertical-align:top;}
|
|
22
|
+
</style>
|
|
23
|
+
|
|
24
|
+
New support ticket #{{support_ticket_number_string}} has been created by {{user_created}}.
|
|
25
|
+
<br><br>
|
|
26
|
+
<div id="containter">
|
|
27
|
+
<table class="tg">
|
|
28
|
+
<thead>
|
|
29
|
+
<tr>
|
|
30
|
+
<th class="tg-yw4l" style="padding: 0; margin: 0; border-left: 1px solid #999;">
|
|
31
|
+
<img src="{{logo}}" style="width: auto; height: 90px; background-color: white; margin-left: -10px; margin-bottom: -10px;" alt="Logo">
|
|
32
|
+
</th>
|
|
33
|
+
<th class="tg-yw4l" style="min-width: 800px; max-width: 800px; font-size: 20px; color: white; text-align: right; padding: 30px;">Support Ticket</th>
|
|
34
|
+
</tr>
|
|
35
|
+
</thead>
|
|
36
|
+
<tbody>
|
|
37
|
+
<tr>
|
|
38
|
+
<td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Support Ticket <br>Number</td>
|
|
39
|
+
<td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{support_ticket_number_string}}</td>
|
|
40
|
+
</tr>
|
|
41
|
+
<tr>
|
|
42
|
+
<td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Client</td>
|
|
43
|
+
<td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{client}}</td>
|
|
44
|
+
</tr>
|
|
45
|
+
<tr>
|
|
46
|
+
<td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Type</td>
|
|
47
|
+
<td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{type}}</td>
|
|
48
|
+
</tr>
|
|
49
|
+
<tr>
|
|
50
|
+
<td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Issue <br>Description</td>
|
|
51
|
+
<td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{issue}}</td>
|
|
52
|
+
</tr>
|
|
53
|
+
<tr>
|
|
54
|
+
<td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Priority</td>
|
|
55
|
+
<td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{priority}}</td>
|
|
56
|
+
</tr>
|
|
57
|
+
<tr>
|
|
58
|
+
<td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Status</td>
|
|
59
|
+
<td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{status}}</td>
|
|
60
|
+
</tr>
|
|
61
|
+
<tr>
|
|
62
|
+
<td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Substatus</td>
|
|
63
|
+
<td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{substatus}}</td>
|
|
64
|
+
</tr>
|
|
65
|
+
<tr>
|
|
66
|
+
<td class="tg-baqh" style="min-width: 30%; max-width: 30%; font-weight: bold;">Date created</td>
|
|
67
|
+
<td class="tg-baqh" style="min-width: 60%; max-width: 60%;">{{date_created_string}}</td>
|
|
68
|
+
</tr>
|
|
69
|
+
</tbody>
|
|
70
|
+
</table>
|
|
71
|
+
</div>
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var app_status_collection_1 = require("../collections/app-status.collection");
|
|
4
|
+
function loadAppStatusPublications(subscriptionManager) {
|
|
5
|
+
subscriptionManager.publications({
|
|
6
|
+
appstatus: {
|
|
7
|
+
function: function () {
|
|
8
|
+
return app_status_collection_1.AppStatus.findOne().exec();
|
|
9
|
+
},
|
|
10
|
+
collections: ['app-statuses']
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.loadAppStatusPublications = loadAppStatusPublications;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var app_version_collection_1 = require("../collections/app-version.collection");
|
|
4
|
+
function loadAppVersionPublications(subscriptionManager) {
|
|
5
|
+
subscriptionManager.publications({
|
|
6
|
+
appversion: {
|
|
7
|
+
function: function () {
|
|
8
|
+
return app_version_collection_1.AppVersions.findOne({}).exec();
|
|
9
|
+
},
|
|
10
|
+
collections: ['app-versions']
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.loadAppVersionPublications = loadAppVersionPublications;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadBillingLoggedInUsersPublications(subscriptionManager: any): void;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
4
|
+
var billing_logged_in_users_collection_1 = require("../collections/billing-logged-in-users.collection");
|
|
5
|
+
function loadBillingLoggedInUsersPublications(subscriptionManager) {
|
|
6
|
+
subscriptionManager.publications({
|
|
7
|
+
billingloggedinusers: {
|
|
8
|
+
function: function () {
|
|
9
|
+
return billing_logged_in_users_collection_1.BillingLoggedInUsers.find().sort({ date: -1 }).exec();
|
|
10
|
+
},
|
|
11
|
+
collections: ['billing-logged-in-users']
|
|
12
|
+
},
|
|
13
|
+
billingloggedinusersWithClientAndUserId: {
|
|
14
|
+
function: function (client, id_user) {
|
|
15
|
+
return billing_logged_in_users_collection_1.BillingLoggedInUsers.find({
|
|
16
|
+
$and: [
|
|
17
|
+
{ client: client },
|
|
18
|
+
{ id_user: id_user }
|
|
19
|
+
]
|
|
20
|
+
}).exec();
|
|
21
|
+
},
|
|
22
|
+
check: new simpl_schema_1.default({
|
|
23
|
+
client: {
|
|
24
|
+
type: String
|
|
25
|
+
},
|
|
26
|
+
id_user: {
|
|
27
|
+
type: String
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
collections: ['billing-logged-in-users'],
|
|
31
|
+
fetchFunction: function (document, client, id_user) {
|
|
32
|
+
return document['id_user'] === id_user && document['client'] === client;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
billingloggedinusersWithClientAndDates: {
|
|
36
|
+
function: function (client, date_start, date_end) {
|
|
37
|
+
return billing_logged_in_users_collection_1.BillingLoggedInUsers.find({
|
|
38
|
+
$and: [
|
|
39
|
+
{ client: client },
|
|
40
|
+
{ date: { $gte: date_start } },
|
|
41
|
+
{ date: { $lte: date_end } }
|
|
42
|
+
]
|
|
43
|
+
}).exec();
|
|
44
|
+
},
|
|
45
|
+
check: new simpl_schema_1.default({
|
|
46
|
+
client: {
|
|
47
|
+
type: String
|
|
48
|
+
},
|
|
49
|
+
date_start: {
|
|
50
|
+
type: Date
|
|
51
|
+
},
|
|
52
|
+
date_end: {
|
|
53
|
+
type: Date
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
collections: ['billing-logged-in-users'],
|
|
57
|
+
fetchFunction: function (document, date_start, date_end) {
|
|
58
|
+
return document['date'].getTime() >= date_start && document['date'].getTime() <= date_end;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.loadBillingLoggedInUsersPublications = loadBillingLoggedInUsersPublications;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var cron_job_collection_1 = require("../collections/cron-job.collection");
|
|
4
|
+
function loadCronJobPublications(subscriptionManager) {
|
|
5
|
+
subscriptionManager.publications({
|
|
6
|
+
cronjobs: {
|
|
7
|
+
function: function () {
|
|
8
|
+
return cron_job_collection_1.CronJobs.find().sort({ name: 1 }).exec();
|
|
9
|
+
},
|
|
10
|
+
collections: ['cron-jobs']
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.loadCronJobPublications = loadCronJobPublications;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
4
|
+
var file_collection_1 = require("./../collections/file.collection");
|
|
5
|
+
function loadFilePublications(subscriptionManager) {
|
|
6
|
+
subscriptionManager.publications({
|
|
7
|
+
fileWithId: {
|
|
8
|
+
function: function (id_file) {
|
|
9
|
+
return file_collection_1.Files.findById(id_file).sort({ name: 1 }).exec();
|
|
10
|
+
},
|
|
11
|
+
check: new simpl_schema_1.default({
|
|
12
|
+
id_file: {
|
|
13
|
+
type: String
|
|
14
|
+
}
|
|
15
|
+
}),
|
|
16
|
+
collections: ['files'],
|
|
17
|
+
fetchFunction: function (document, id_file) {
|
|
18
|
+
return document._id === id_file;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
filesIn: {
|
|
22
|
+
function: function (id_files) {
|
|
23
|
+
return file_collection_1.Files.find({ _id: { $in: id_files } }).sort({ name: 1 }).exec();
|
|
24
|
+
},
|
|
25
|
+
check: new simpl_schema_1.default({
|
|
26
|
+
id_files: {
|
|
27
|
+
type: Array
|
|
28
|
+
},
|
|
29
|
+
'id_files.$': {
|
|
30
|
+
type: String
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
collections: ['files'],
|
|
34
|
+
fetchFunction: function (document, id_files) {
|
|
35
|
+
return id_files.includes(document._id);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
supportFileWithId: {
|
|
39
|
+
function: function (id_file) {
|
|
40
|
+
return file_collection_1.SupportFiles.findById(id_file).sort({ name: 1 }).exec();
|
|
41
|
+
},
|
|
42
|
+
check: new simpl_schema_1.default({
|
|
43
|
+
id_file: {
|
|
44
|
+
type: String
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
collections: ['files'],
|
|
48
|
+
fetchFunction: function (document, id_file) {
|
|
49
|
+
return document._id === id_file;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
supportFilesIn: {
|
|
53
|
+
function: function (id_files) {
|
|
54
|
+
return file_collection_1.SupportFiles.find({ _id: { $in: id_files } }).sort({ name: 1 }).exec();
|
|
55
|
+
},
|
|
56
|
+
check: new simpl_schema_1.default({
|
|
57
|
+
id_files: {
|
|
58
|
+
type: Array
|
|
59
|
+
},
|
|
60
|
+
'id_files.$': {
|
|
61
|
+
type: String
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
collections: ['files'],
|
|
65
|
+
fetchFunction: function (document, id_files) {
|
|
66
|
+
return id_files.includes(document._id);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
exports.loadFilePublications = loadFilePublications;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
4
|
+
var flag_collection_1 = require("../collections/flag.collection");
|
|
5
|
+
function loadFlagsPublications(subscriptionManager) {
|
|
6
|
+
subscriptionManager.publications({
|
|
7
|
+
flagWithType: {
|
|
8
|
+
function: function (flagType) {
|
|
9
|
+
return flag_collection_1.Flags.findOne({ type: flagType }).exec();
|
|
10
|
+
},
|
|
11
|
+
check: new simpl_schema_1.default({
|
|
12
|
+
flagType: {
|
|
13
|
+
type: String
|
|
14
|
+
}
|
|
15
|
+
}),
|
|
16
|
+
collections: ['flags'],
|
|
17
|
+
fetchFunction: function (document, flagType) {
|
|
18
|
+
return document['type'] === flagType;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.loadFlagsPublications = loadFlagsPublications;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
4
|
+
var log_collection_1 = require("../collections/log.collection");
|
|
5
|
+
function loadLogPublications(subscriptionManager) {
|
|
6
|
+
subscriptionManager.publications({
|
|
7
|
+
logsWithType: {
|
|
8
|
+
function: function (type) {
|
|
9
|
+
if (type === 'all') {
|
|
10
|
+
return log_collection_1.Logs.find().sort({ date: -1 }).exec();
|
|
11
|
+
}
|
|
12
|
+
return log_collection_1.Logs.find({ type: type }).sort({ date: -1 }).exec();
|
|
13
|
+
},
|
|
14
|
+
check: new simpl_schema_1.default({
|
|
15
|
+
type: {
|
|
16
|
+
type: String
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
collections: ['logs'],
|
|
20
|
+
fetchFunction: function (document, type) {
|
|
21
|
+
return document['type'] === type;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.loadLogPublications = loadLogPublications;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var method_call_collection_1 = require("../collections/method-call.collection");
|
|
4
|
+
function loadMethodCallsPublications(subscriptionManager) {
|
|
5
|
+
subscriptionManager.publications({
|
|
6
|
+
methodcalls: {
|
|
7
|
+
function: function () {
|
|
8
|
+
return method_call_collection_1.MethodCalls.find({}).exec();
|
|
9
|
+
},
|
|
10
|
+
collections: ['method-calls']
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.loadMethodCallsPublications = loadMethodCallsPublications;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var method_response_collection_1 = require("../collections/method-response.collection");
|
|
4
|
+
function loadMethodResponsePublications(subscriptionManager) {
|
|
5
|
+
subscriptionManager.publications({
|
|
6
|
+
methodresponses: {
|
|
7
|
+
function: function () {
|
|
8
|
+
return method_response_collection_1.MethodResponses.find({}).exec();
|
|
9
|
+
},
|
|
10
|
+
collections: ['method-responses']
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.loadMethodResponsePublications = loadMethodResponsePublications;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var notification_collection_1 = require("../collections/notification.collection");
|
|
4
|
+
function loadNotificationPublications(subscriptionManager) {
|
|
5
|
+
subscriptionManager.publications({
|
|
6
|
+
notifications: {
|
|
7
|
+
function: function () {
|
|
8
|
+
return notification_collection_1.Notifications.find({}).sort({ name: 1 }).exec();
|
|
9
|
+
},
|
|
10
|
+
collections: ['notifications']
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.loadNotificationPublications = loadNotificationPublications;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var logged_in_users_collection_1 = require("../collections/logged-in-users.collection");
|
|
4
|
+
var active_subscription_collection_1 = require("../collections/active-subscription.collection");
|
|
5
|
+
function loadSuperAdminPublications(subscriptionManager) {
|
|
6
|
+
subscriptionManager.publications({
|
|
7
|
+
loggedInUsers: {
|
|
8
|
+
function: function () {
|
|
9
|
+
return logged_in_users_collection_1.LoggedInUsers.find({}).sort({ user: 1 }).exec();
|
|
10
|
+
},
|
|
11
|
+
collections: ['logged-in-users']
|
|
12
|
+
},
|
|
13
|
+
currentSubscriptions: {
|
|
14
|
+
function: function () {
|
|
15
|
+
return active_subscription_collection_1.ActiveSubscriptions.find({}).sort({ publication: 1 }).exec();
|
|
16
|
+
},
|
|
17
|
+
collections: ['active-subscriptions']
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.loadSuperAdminPublications = loadSuperAdminPublications;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadSupportTicketPublications(subscriptionManager: any): void;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
var support_ticket_collection_1 = require("../collections/support-ticket.collection");
|
|
39
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
40
|
+
var pagination_model_1 = require("../models/pagination.model");
|
|
41
|
+
var index_1 = require("../index");
|
|
42
|
+
function loadSupportTicketPublications(subscriptionManager) {
|
|
43
|
+
var _this = this;
|
|
44
|
+
subscriptionManager.publications({
|
|
45
|
+
supporttickets: {
|
|
46
|
+
function: function () {
|
|
47
|
+
return support_ticket_collection_1.SupportTickets.find({ client: index_1.ResolveIOServer.getClientName() }).sort({ type: 1 }).exec();
|
|
48
|
+
},
|
|
49
|
+
collections: ['support-tickets'],
|
|
50
|
+
fetchFunction: function (document) {
|
|
51
|
+
return document['client'] === index_1.ResolveIOServer.getClientName() ? true : false;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
supportticketWithId: {
|
|
55
|
+
function: function (id_support_ticket) {
|
|
56
|
+
return support_ticket_collection_1.SupportTickets.findById(id_support_ticket).exec();
|
|
57
|
+
},
|
|
58
|
+
check: new simpl_schema_1.default({
|
|
59
|
+
id_support_ticket: {
|
|
60
|
+
type: String
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
collections: ['support-tickets'],
|
|
64
|
+
fetchFunction: function (document, id_support_ticket) {
|
|
65
|
+
return document._id === id_support_ticket;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
supportticketDetails: {
|
|
69
|
+
function: function (id_support_ticket) {
|
|
70
|
+
return support_ticket_collection_1.SupportTickets.aggregate([
|
|
71
|
+
{
|
|
72
|
+
$match: { _id: id_support_ticket }
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
$lookup: {
|
|
76
|
+
from: 'files',
|
|
77
|
+
localField: 'files',
|
|
78
|
+
foreignField: '_id',
|
|
79
|
+
as: 'dbFiles'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]).exec();
|
|
83
|
+
},
|
|
84
|
+
check: new simpl_schema_1.default({
|
|
85
|
+
id_support_ticket: {
|
|
86
|
+
type: String
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
collections: ['support-tickets', 'files'],
|
|
90
|
+
preFunction: function (id_support_ticket) { return __awaiter(_this, void 0, void 0, function () {
|
|
91
|
+
var support_ticket;
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0: return [4 /*yield*/, support_ticket_collection_1.SupportTickets.findOne({ _id: id_support_ticket })];
|
|
95
|
+
case 1:
|
|
96
|
+
support_ticket = _a.sent();
|
|
97
|
+
if (!support_ticket) {
|
|
98
|
+
return [2 /*return*/, {
|
|
99
|
+
_id: '',
|
|
100
|
+
support_ticket: []
|
|
101
|
+
}];
|
|
102
|
+
}
|
|
103
|
+
return [2 /*return*/, {
|
|
104
|
+
_id: support_ticket._id,
|
|
105
|
+
files: support_ticket.files
|
|
106
|
+
}];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}); },
|
|
110
|
+
fetchFunction: function (document, fetchData) {
|
|
111
|
+
return document._id === fetchData['_id'] ||
|
|
112
|
+
fetchData['files'].includes(document._id);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
supportticketsWithOptions: {
|
|
116
|
+
function: function (options, search, filters) {
|
|
117
|
+
return support_ticket_collection_1.SupportTickets.find(searchQuery.call(_this, search, filters)).sort(options.sort).limit(options.limit).skip(options.skip).select(options.fields).exec();
|
|
118
|
+
},
|
|
119
|
+
check: new simpl_schema_1.default({
|
|
120
|
+
options: {
|
|
121
|
+
type: pagination_model_1.PaginationOptionsSchema
|
|
122
|
+
},
|
|
123
|
+
search: {
|
|
124
|
+
type: String,
|
|
125
|
+
optional: true
|
|
126
|
+
},
|
|
127
|
+
filters: {
|
|
128
|
+
type: Array,
|
|
129
|
+
optional: true
|
|
130
|
+
},
|
|
131
|
+
'filters.$': {
|
|
132
|
+
type: Object
|
|
133
|
+
},
|
|
134
|
+
'filters.$.prop': {
|
|
135
|
+
type: String
|
|
136
|
+
},
|
|
137
|
+
'filters.$.data': {
|
|
138
|
+
type: String
|
|
139
|
+
}
|
|
140
|
+
}),
|
|
141
|
+
collections: ['support-tickets']
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
exports.loadSupportTicketPublications = loadSupportTicketPublications;
|
|
146
|
+
function searchQuery(search, filters) {
|
|
147
|
+
if (!search && (!filters || !filters.length)) {
|
|
148
|
+
return {};
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
var searchObj_1 = {};
|
|
152
|
+
if (filters && filters.length) {
|
|
153
|
+
searchObj_1['$and'] = [];
|
|
154
|
+
filters.forEach(function (filter) {
|
|
155
|
+
var _a;
|
|
156
|
+
searchObj_1['$and'].push((_a = {}, _a[filter['prop']] = filter['data'], _a));
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (search) {
|
|
160
|
+
var searchRegEx = { '$regex': '.*' + (search || '') + '.*', '$options': 'i' };
|
|
161
|
+
if (searchObj_1['$and']) {
|
|
162
|
+
searchObj_1['$and'].push({
|
|
163
|
+
$or: [
|
|
164
|
+
{
|
|
165
|
+
support_ticket_number_string: searchRegEx
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
date_created_string: searchRegEx
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
status: searchRegEx
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
user_created: searchRegEx
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
searchObj_1 = {
|
|
181
|
+
$or: [
|
|
182
|
+
{
|
|
183
|
+
support_ticket_number_string: searchRegEx
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
date_created_string: searchRegEx
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
status: searchRegEx
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
user_created: searchRegEx
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return searchObj_1;
|
|
199
|
+
}
|
|
200
|
+
}
|
package/server-app.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as WebSocket from 'ws';
|
|
2
|
+
import { CronManager } from './managers/cron.manager';
|
|
3
|
+
import { MethodManager } from './managers/method.manager';
|
|
4
|
+
import { SubscriptionManager } from './managers/subscription.manager';
|
|
5
|
+
import { SupportManager } from './managers/support.manager';
|
|
6
|
+
import { QueueMethodManager } from './managers/queue-method.manager';
|
|
7
|
+
export default class ResolveIOMainServer {
|
|
8
|
+
private _app;
|
|
9
|
+
private _server;
|
|
10
|
+
private _port;
|
|
11
|
+
private _wss;
|
|
12
|
+
private _serverConfig;
|
|
13
|
+
private _clientDir;
|
|
14
|
+
private _msgQueue;
|
|
15
|
+
private _msgQueueRunning;
|
|
16
|
+
private _resolveioServer;
|
|
17
|
+
private _subscriptionManager;
|
|
18
|
+
private _methodManager;
|
|
19
|
+
private _queueManager;
|
|
20
|
+
private _cronManager;
|
|
21
|
+
private _supportManager;
|
|
22
|
+
constructor(mainServer: any, serverConfig: any, clientDir: any);
|
|
23
|
+
getWS(id_ws: string): any;
|
|
24
|
+
getWSList(): any[];
|
|
25
|
+
getCronManager(): CronManager;
|
|
26
|
+
getMethodManager(): MethodManager;
|
|
27
|
+
getSubscriptionManager(): SubscriptionManager;
|
|
28
|
+
getQueueManager(): QueueMethodManager;
|
|
29
|
+
getSupportManager(): SupportManager;
|
|
30
|
+
private createServer;
|
|
31
|
+
private setUpMongoose;
|
|
32
|
+
private setUpPassport;
|
|
33
|
+
private listen;
|
|
34
|
+
unsubscribeWS(ws: WebSocket): void;
|
|
35
|
+
}
|