@resolveio/server-lib 1.0.0-rc19 → 1.0.0-rc2
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.js +1 -68
- package/collections/app-status.collection.js +1 -43
- package/collections/app-version.collection.js +1 -56
- package/collections/counter.collection.js +1 -73
- package/collections/cron-job-history.collection.js +1 -86
- package/collections/cron-job.collection.js +1 -89
- package/collections/file.collection.js +1 -73
- package/collections/flag.collection.js +1 -47
- package/collections/log.collection.js +1 -64
- package/collections/logged-in-users.collection.js +1 -70
- package/collections/method-call.collection.js +1 -44
- package/collections/method-response.collection.js +1 -48
- package/collections/queue-flag.collection.js +1 -41
- package/collections/queue-method.collection.js +1 -116
- package/collections/queue-response.collection.js +1 -78
- package/collections/support-ticket.collection.js +1 -146
- package/collections/user.collection.js +1 -108
- package/cron/cron.js +1 -160
- package/fixtures/cron-jobs.js +1 -72
- package/fixtures/init.js +1 -73
- package/http/auth.js +1 -472
- package/http/health.js +1 -8
- package/index.js +1 -123
- package/managers/cron.manager.js +1 -193
- package/managers/method.manager.js +1 -513
- package/managers/queue-method.manager.js +1 -239
- package/managers/subscription.manager.js +1 -700
- package/managers/support.manager.js +1 -208
- package/methods/accounts.js +1 -253
- package/methods/aws.js +1 -323
- package/methods/cloudconvert.js +1 -37
- package/methods/collections.js +1 -738
- package/methods/counters.js +1 -404
- package/methods/cron-jobs.js +1 -63
- package/methods/flags.js +1 -6
- package/methods/logs.js +1 -29
- package/methods/pdf.js +1 -303
- package/models/active-subscription.model.js +1 -2
- package/models/app-status.model.js +1 -2
- package/models/app-version.model.js +1 -2
- package/models/collection-document.model.js +1 -2
- package/models/counter.model.js +1 -2
- package/models/cron-job-history.model.js +1 -2
- package/models/cron-job.model.js +1 -2
- package/models/dialog.model.js +1 -2
- package/models/file.model.js +1 -2
- package/models/flag.model.js +1 -2
- package/models/log.model.js +1 -2
- package/models/logged-in-users.model.js +1 -2
- package/models/method-call.model.js +1 -2
- package/models/method-response.model.js +1 -2
- package/models/method.model.js +1 -2
- package/models/pagination.model.js +1 -20
- package/models/permission.model.js +1 -2
- package/models/queue-method.model.js +1 -2
- package/models/queue-response.model.js +1 -2
- package/models/select-data-label.model.js +1 -2
- package/models/server-response.model.js +1 -2
- package/models/subscription.model.js +1 -2
- package/models/support-method.model.js +1 -2
- package/models/support-ticket.model.js +1 -2
- package/models/user.model.js +1 -2
- package/package.json +2 -5
- package/publications/app-status.js +1 -14
- package/publications/app-version.js +1 -14
- package/publications/cron-jobs.js +1 -14
- package/publications/files.js +1 -71
- package/publications/flags.js +1 -23
- package/publications/logs.js +1 -26
- package/publications/method-calls.js +1 -14
- package/publications/method-responses.js +1 -14
- package/publications/super-admin.js +1 -21
- package/publications/support-tickets.js +1 -118
- package/server-app.js +1 -640
- package/support-methods/aws.js +1 -276
- package/support-methods/collections.js +1 -471
- package/support-methods/counters.js +1 -189
- package/support-methods/support.js +1 -19
- package/util/common.js +1 -334
- package/collections/active-subscription.collection.d.ts +0 -8
- package/collections/app-status.collection.d.ts +0 -8
- package/collections/app-version.collection.d.ts +0 -8
- package/collections/counter.collection.d.ts +0 -10
- package/collections/cron-job-history.collection.d.ts +0 -8
- package/collections/cron-job.collection.d.ts +0 -8
- package/collections/file.collection.d.ts +0 -10
- package/collections/flag.collection.d.ts +0 -8
- package/collections/log.collection.d.ts +0 -8
- package/collections/logged-in-users.collection.d.ts +0 -8
- package/collections/method-call.collection.d.ts +0 -7
- package/collections/method-response.collection.d.ts +0 -7
- package/collections/queue-flag.collection.d.ts +0 -8
- package/collections/queue-method.collection.d.ts +0 -8
- package/collections/queue-response.collection.d.ts +0 -8
- package/collections/support-ticket.collection.d.ts +0 -8
- package/collections/user.collection.d.ts +0 -9
- package/cron/cron.d.ts +0 -6
- package/fixtures/cron-jobs.d.ts +0 -2
- package/fixtures/init.d.ts +0 -2
- package/http/auth.d.ts +0 -3
- package/http/health.d.ts +0 -2
- package/index.d.ts +0 -15
- package/managers/cron.manager.d.ts +0 -17
- package/managers/method.manager.d.ts +0 -27
- package/managers/queue-method.manager.d.ts +0 -14
- package/managers/subscription.manager.d.ts +0 -27
- package/managers/support.manager.d.ts +0 -18
- package/methods/accounts.d.ts +0 -3
- package/methods/aws.d.ts +0 -3
- package/methods/cloudconvert.d.ts +0 -3
- package/methods/collections.d.ts +0 -3
- package/methods/counters.d.ts +0 -3
- package/methods/cron-jobs.d.ts +0 -3
- package/methods/flags.d.ts +0 -3
- package/methods/logs.d.ts +0 -3
- package/methods/pdf.d.ts +0 -3
- package/models/active-subscription.model.d.ts +0 -14
- package/models/app-status.model.d.ts +0 -5
- package/models/app-version.model.d.ts +0 -5
- package/models/collection-document.model.d.ts +0 -7
- package/models/counter.model.d.ts +0 -6
- package/models/cron-job-history.model.d.ts +0 -13
- package/models/cron-job.model.d.ts +0 -14
- package/models/dialog.model.d.ts +0 -24
- package/models/file.model.d.ts +0 -10
- package/models/flag.model.d.ts +0 -6
- package/models/log.model.d.ts +0 -12
- package/models/logged-in-users.model.d.ts +0 -10
- package/models/method-call.model.d.ts +0 -8
- package/models/method-response.model.d.ts +0 -9
- package/models/method.model.d.ts +0 -11
- package/models/pagination.model.d.ts +0 -12
- package/models/permission.model.d.ts +0 -13
- package/models/queue-method.model.d.ts +0 -10
- package/models/queue-response.model.d.ts +0 -11
- package/models/select-data-label.model.d.ts +0 -10
- package/models/server-response.model.d.ts +0 -6
- package/models/subscription.model.d.ts +0 -31
- package/models/support-method.model.d.ts +0 -10
- package/models/support-ticket.model.d.ts +0 -40
- package/models/user.model.d.ts +0 -15
- package/publications/app-status.d.ts +0 -3
- package/publications/app-version.d.ts +0 -3
- package/publications/cron-jobs.d.ts +0 -3
- package/publications/files.d.ts +0 -3
- package/publications/flags.d.ts +0 -3
- package/publications/logs.d.ts +0 -3
- package/publications/method-calls.d.ts +0 -3
- package/publications/method-responses.d.ts +0 -3
- package/publications/super-admin.d.ts +0 -3
- package/publications/support-tickets.d.ts +0 -2
- package/server-app.d.ts +0 -33
- package/support-methods/aws.d.ts +0 -3
- package/support-methods/collections.d.ts +0 -3
- package/support-methods/counters.d.ts +0 -3
- package/support-methods/support.d.ts +0 -3
- package/util/common.d.ts +0 -15
package/publications/flags.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var simpl_schema_1=require("simpl-schema"),flag_collection_1=require("../collections/flag.collection");function loadFlagsPublications(e){e.publications({flagWithType:{function:function(e){return flag_collection_1.Flags.findOne({type:e}).exec()},check:new simpl_schema_1.default({flagType:{type:String}}),collections:["flags"],fetchFunction:function(e,l){return e.type===l}}})}exports.loadFlagsPublications=loadFlagsPublications;
|
package/publications/logs.js
CHANGED
|
@@ -1,26 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var simpl_schema_1=require("simpl-schema"),log_collection_1=require("../collections/log.collection");function loadLogPublications(o){o.publications({logsWithType:{function:function(o){return"all"===o?log_collection_1.Logs.find().sort({date:-1}).exec():log_collection_1.Logs.find({type:o}).sort({date:-1}).exec()},check:new simpl_schema_1.default({type:{type:String}}),collections:["logs"],fetchFunction:function(o,e){return o.type===e}}})}exports.loadLogPublications=loadLogPublications;
|
|
@@ -1,14 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var method_call_collection_1=require("../collections/method-call.collection");function loadMethodCallsPublications(l){l.publications({methodcalls:{function:function(){return method_call_collection_1.MethodCalls.find({}).exec()},collections:["method-calls"]}})}exports.loadMethodCallsPublications=loadMethodCallsPublications;
|
|
@@ -1,14 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var method_response_collection_1=require("../collections/method-response.collection");function loadMethodResponsePublications(e){e.publications({methodresponses:{function:function(){return method_response_collection_1.MethodResponses.find({}).exec()},collections:["method-responses"]}})}exports.loadMethodResponsePublications=loadMethodResponsePublications;
|
|
@@ -1,21 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var logged_in_users_collection_1=require("../collections/logged-in-users.collection"),active_subscription_collection_1=require("../collections/active-subscription.collection");function loadSuperAdminPublications(i){i.publications({loggedInUsers:{function:function(){return logged_in_users_collection_1.LoggedInUsers.find({}).sort({user:1}).exec()},collections:["logged-in-users"]},currentSubscriptions:{function:function(){return active_subscription_collection_1.ActiveSubscriptions.find({}).sort({publication:1}).exec()},collections:["active-subscriptions"]}})}exports.loadSuperAdminPublications=loadSuperAdminPublications;
|
|
@@ -1,118 +1 @@
|
|
|
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
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var support_ticket_collection_1=require("../collections/support-ticket.collection"),simpl_schema_1=require("simpl-schema"),pagination_model_1=require("../models/pagination.model"),index_1=require("../index");function loadSupportTicketPublications(t){var n=this;t.publications({supporttickets:{function:function(){return support_ticket_collection_1.SupportTickets.find({client:index_1.default.getClientName()}).sort({type:1}).exec()},collections:["support-tickets"],fetchFunction:function(t){return t.client===index_1.default.getClientName()}},supportticketWithId:{function:function(t){return support_ticket_collection_1.SupportTickets.findById(t).exec()},check:new simpl_schema_1.default({id_support_ticket:{type:String}}),collections:["support-tickets"],fetchFunction:function(t,e){return t._id===e}},supportticketsWithOptions:{function:function(t,e,i){return support_ticket_collection_1.SupportTickets.find(searchQuery.call(n,e,i)).sort(t.sort).limit(t.limit).skip(t.skip).select(t.fields).exec()},check:new simpl_schema_1.default({options:{type:pagination_model_1.PaginationOptionsSchema},search:{type:String,optional:!0},filters:{type:Array,optional:!0},"filters.$":{type:Object},"filters.$.prop":{type:String},"filters.$.data":{type:String}}),collections:["support-tickets"]}})}function searchQuery(t,e){if(t||e&&e.length){var i={};if(e&&e.length&&(i.$and=[],e.forEach(function(t){var e;i.$and.push(((e={})[t.prop]=t.data,e))})),t){var n={$regex:".*"+(t||"")+".*",$options:"i"};i.$and?i.$and.push({$or:[{support_ticket_number_string:n},{date_created_string:n},{status:n},{user_created:n}]}):i={$or:[{support_ticket_number_string:n},{date_created_string:n},{status:n},{user_created:n}]}}return i}return{}}exports.loadSupportTicketPublications=loadSupportTicketPublications;
|