@resolveio/server-lib 1.0.0-rc2 → 1.0.0-rc21
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 +8 -0
- package/collections/active-subscription.collection.js +68 -1
- package/collections/app-status.collection.d.ts +8 -0
- package/collections/app-status.collection.js +43 -1
- package/collections/app-version.collection.d.ts +8 -0
- package/collections/app-version.collection.js +56 -1
- package/collections/counter.collection.d.ts +10 -0
- package/collections/counter.collection.js +73 -1
- package/collections/cron-job-history.collection.d.ts +8 -0
- package/collections/cron-job-history.collection.js +86 -1
- package/collections/cron-job.collection.d.ts +8 -0
- package/collections/cron-job.collection.js +89 -1
- package/collections/file.collection.d.ts +10 -0
- package/collections/file.collection.js +73 -1
- package/collections/flag.collection.d.ts +8 -0
- package/collections/flag.collection.js +47 -1
- package/collections/log.collection.d.ts +8 -0
- package/collections/log.collection.js +64 -1
- package/collections/logged-in-users.collection.d.ts +8 -0
- package/collections/logged-in-users.collection.js +70 -1
- package/collections/method-call.collection.d.ts +7 -0
- package/collections/method-call.collection.js +44 -1
- package/collections/method-response.collection.d.ts +7 -0
- package/collections/method-response.collection.js +48 -1
- package/collections/queue-flag.collection.d.ts +8 -0
- package/collections/queue-flag.collection.js +41 -1
- package/collections/queue-method.collection.d.ts +8 -0
- package/collections/queue-method.collection.js +116 -1
- package/collections/queue-response.collection.d.ts +8 -0
- package/collections/queue-response.collection.js +78 -1
- package/collections/support-ticket.collection.d.ts +8 -0
- package/collections/support-ticket.collection.js +146 -1
- package/collections/user.collection.d.ts +9 -0
- package/collections/user.collection.js +108 -1
- package/cron/cron.d.ts +6 -0
- package/cron/cron.js +160 -1
- package/fixtures/cron-jobs.d.ts +2 -0
- package/fixtures/cron-jobs.js +72 -1
- package/fixtures/init.d.ts +2 -0
- package/fixtures/init.js +73 -1
- package/http/auth.d.ts +3 -0
- package/http/auth.js +472 -1
- package/http/health.d.ts +2 -0
- package/http/health.js +8 -1
- package/index.d.ts +15 -0
- package/index.js +123 -1
- package/managers/cron.manager.d.ts +17 -0
- package/managers/cron.manager.js +193 -1
- package/managers/method.manager.d.ts +27 -0
- package/managers/method.manager.js +513 -1
- package/managers/queue-method.manager.d.ts +14 -0
- package/managers/queue-method.manager.js +239 -1
- package/managers/subscription.manager.d.ts +27 -0
- package/managers/subscription.manager.js +700 -1
- package/managers/support.manager.d.ts +18 -0
- package/managers/support.manager.js +208 -1
- package/methods/accounts.d.ts +3 -0
- package/methods/accounts.js +253 -1
- package/methods/aws.d.ts +3 -0
- package/methods/aws.js +323 -1
- package/methods/cloudconvert.d.ts +3 -0
- package/methods/cloudconvert.js +37 -1
- package/methods/collections.d.ts +3 -0
- package/methods/collections.js +738 -1
- package/methods/counters.d.ts +3 -0
- package/methods/counters.js +404 -1
- package/methods/cron-jobs.d.ts +3 -0
- package/methods/cron-jobs.js +63 -1
- package/methods/flags.d.ts +3 -0
- package/methods/flags.js +6 -1
- package/methods/logs.d.ts +3 -0
- package/methods/logs.js +29 -1
- package/methods/pdf.d.ts +3 -0
- package/methods/pdf.js +303 -1
- package/models/active-subscription.model.d.ts +14 -0
- package/models/active-subscription.model.js +2 -1
- package/models/app-status.model.d.ts +5 -0
- package/models/app-status.model.js +2 -1
- package/models/app-version.model.d.ts +5 -0
- package/models/app-version.model.js +2 -1
- package/models/collection-document.model.d.ts +7 -0
- package/models/collection-document.model.js +2 -1
- package/models/counter.model.d.ts +6 -0
- package/models/counter.model.js +2 -1
- package/models/cron-job-history.model.d.ts +13 -0
- package/models/cron-job-history.model.js +2 -1
- package/models/cron-job.model.d.ts +14 -0
- package/models/cron-job.model.js +2 -1
- package/models/dialog.model.d.ts +24 -0
- package/models/dialog.model.js +2 -1
- package/models/file.model.d.ts +10 -0
- package/models/file.model.js +2 -1
- package/models/flag.model.d.ts +6 -0
- package/models/flag.model.js +2 -1
- package/models/log.model.d.ts +12 -0
- package/models/log.model.js +2 -1
- package/models/logged-in-users.model.d.ts +10 -0
- package/models/logged-in-users.model.js +2 -1
- package/models/method-call.model.d.ts +8 -0
- package/models/method-call.model.js +2 -1
- package/models/method-response.model.d.ts +9 -0
- package/models/method-response.model.js +2 -1
- package/models/method.model.d.ts +11 -0
- package/models/method.model.js +2 -1
- package/models/notification.model.d.ts +5 -0
- package/models/notification.model.js +2 -0
- package/models/pagination.model.d.ts +12 -0
- package/models/pagination.model.js +20 -1
- package/models/permission.model.d.ts +13 -0
- package/models/permission.model.js +2 -1
- package/models/queue-method.model.d.ts +10 -0
- package/models/queue-method.model.js +2 -1
- package/models/queue-response.model.d.ts +11 -0
- package/models/queue-response.model.js +2 -1
- package/models/select-data-label.model.d.ts +10 -0
- package/models/select-data-label.model.js +2 -1
- package/models/server-response.model.d.ts +6 -0
- package/models/server-response.model.js +2 -1
- package/models/subscription.model.d.ts +31 -0
- package/models/subscription.model.js +2 -1
- package/models/support-method.model.d.ts +10 -0
- package/models/support-method.model.js +2 -1
- package/models/support-ticket.model.d.ts +40 -0
- package/models/support-ticket.model.js +2 -1
- package/models/user.model.d.ts +15 -0
- package/models/user.model.js +2 -1
- package/package.json +5 -2
- package/publications/app-status.d.ts +3 -0
- package/publications/app-status.js +14 -1
- package/publications/app-version.d.ts +3 -0
- package/publications/app-version.js +14 -1
- package/publications/cron-jobs.d.ts +3 -0
- package/publications/cron-jobs.js +14 -1
- package/publications/files.d.ts +3 -0
- package/publications/files.js +71 -1
- package/publications/flags.d.ts +3 -0
- package/publications/flags.js +23 -1
- package/publications/logs.d.ts +3 -0
- package/publications/logs.js +26 -1
- package/publications/method-calls.d.ts +3 -0
- package/publications/method-calls.js +14 -1
- package/publications/method-responses.d.ts +3 -0
- package/publications/method-responses.js +14 -1
- package/publications/super-admin.d.ts +3 -0
- package/publications/super-admin.js +21 -1
- package/publications/support-tickets.d.ts +2 -0
- package/publications/support-tickets.js +118 -1
- package/server-app.d.ts +33 -0
- package/server-app.js +640 -1
- package/support-methods/aws.d.ts +3 -0
- package/support-methods/aws.js +276 -1
- package/support-methods/collections.d.ts +3 -0
- package/support-methods/collections.js +471 -1
- package/support-methods/counters.d.ts +3 -0
- package/support-methods/counters.js +189 -1
- package/support-methods/support.d.ts +3 -0
- package/support-methods/support.js +19 -1
- package/util/common.d.ts +15 -0
- package/util/common.js +334 -1
|
@@ -1 +1,118 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var support_ticket_collection_1 = require("../collections/support-ticket.collection");
|
|
4
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
5
|
+
var pagination_model_1 = require("../models/pagination.model");
|
|
6
|
+
var index_1 = require("../index");
|
|
7
|
+
function loadSupportTicketPublications(subscriptionManager) {
|
|
8
|
+
var _this = this;
|
|
9
|
+
subscriptionManager.publications({
|
|
10
|
+
supporttickets: {
|
|
11
|
+
function: function () {
|
|
12
|
+
return support_ticket_collection_1.SupportTickets.find({ client: index_1.ResolveIOServer.getClientName() }).sort({ type: 1 }).exec();
|
|
13
|
+
},
|
|
14
|
+
collections: ['support-tickets'],
|
|
15
|
+
fetchFunction: function (document) {
|
|
16
|
+
return document['client'] === index_1.ResolveIOServer.getClientName() ? true : false;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
supportticketWithId: {
|
|
20
|
+
function: function (id_support_ticket) {
|
|
21
|
+
return support_ticket_collection_1.SupportTickets.findById(id_support_ticket).exec();
|
|
22
|
+
},
|
|
23
|
+
check: new simpl_schema_1.default({
|
|
24
|
+
id_support_ticket: {
|
|
25
|
+
type: String
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
collections: ['support-tickets'],
|
|
29
|
+
fetchFunction: function (document, id_support_ticket) {
|
|
30
|
+
return document._id === id_support_ticket;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
supportticketsWithOptions: {
|
|
34
|
+
function: function (options, search, filters) {
|
|
35
|
+
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();
|
|
36
|
+
},
|
|
37
|
+
check: new simpl_schema_1.default({
|
|
38
|
+
options: {
|
|
39
|
+
type: pagination_model_1.PaginationOptionsSchema
|
|
40
|
+
},
|
|
41
|
+
search: {
|
|
42
|
+
type: String,
|
|
43
|
+
optional: true
|
|
44
|
+
},
|
|
45
|
+
filters: {
|
|
46
|
+
type: Array,
|
|
47
|
+
optional: true
|
|
48
|
+
},
|
|
49
|
+
'filters.$': {
|
|
50
|
+
type: Object
|
|
51
|
+
},
|
|
52
|
+
'filters.$.prop': {
|
|
53
|
+
type: String
|
|
54
|
+
},
|
|
55
|
+
'filters.$.data': {
|
|
56
|
+
type: String
|
|
57
|
+
}
|
|
58
|
+
}),
|
|
59
|
+
collections: ['support-tickets']
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.loadSupportTicketPublications = loadSupportTicketPublications;
|
|
64
|
+
function searchQuery(search, filters) {
|
|
65
|
+
if (!search && (!filters || !filters.length)) {
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
var searchObj_1 = {};
|
|
70
|
+
if (filters && filters.length) {
|
|
71
|
+
searchObj_1['$and'] = [];
|
|
72
|
+
filters.forEach(function (filter) {
|
|
73
|
+
var _a;
|
|
74
|
+
searchObj_1['$and'].push((_a = {}, _a[filter['prop']] = filter['data'], _a));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (search) {
|
|
78
|
+
var searchRegEx = { '$regex': '.*' + (search || '') + '.*', '$options': 'i' };
|
|
79
|
+
if (searchObj_1['$and']) {
|
|
80
|
+
searchObj_1['$and'].push({
|
|
81
|
+
$or: [
|
|
82
|
+
{
|
|
83
|
+
support_ticket_number_string: searchRegEx
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
date_created_string: searchRegEx
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
status: searchRegEx
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
user_created: searchRegEx
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
searchObj_1 = {
|
|
99
|
+
$or: [
|
|
100
|
+
{
|
|
101
|
+
support_ticket_number_string: searchRegEx
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
date_created_string: searchRegEx
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
status: searchRegEx
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
user_created: searchRegEx
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return searchObj_1;
|
|
117
|
+
}
|
|
118
|
+
}
|
package/server-app.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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 _resolveioServer;
|
|
14
|
+
private _subscriptionManager;
|
|
15
|
+
private _methodManager;
|
|
16
|
+
private _queueManager;
|
|
17
|
+
private _cronManager;
|
|
18
|
+
private _supportManager;
|
|
19
|
+
constructor(mainServer: any, serverConfig: any);
|
|
20
|
+
getWS(id_ws: string): any;
|
|
21
|
+
getWSList(): any[];
|
|
22
|
+
getCronManager(): CronManager;
|
|
23
|
+
getMethodManager(): MethodManager;
|
|
24
|
+
getSubscriptionManager(): SubscriptionManager;
|
|
25
|
+
getQueueManager(): QueueMethodManager;
|
|
26
|
+
getSupportManager(): SupportManager;
|
|
27
|
+
private createServer;
|
|
28
|
+
private setUpMongoose;
|
|
29
|
+
private setUpPassport;
|
|
30
|
+
private listen;
|
|
31
|
+
unsubscribeWS(ws: WebSocket): void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=server-app.d.ts.map
|