@resolveio/server-lib 4.4.3 → 4.4.4
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/package.json +1 -1
- package/publications/cron-jobs.js +19 -0
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
3
4
|
var cron_job_collection_1 = require("../collections/cron-job.collection");
|
|
4
5
|
function loadCronJobPublications(subscriptionManager) {
|
|
5
6
|
subscriptionManager.publications({
|
|
@@ -8,6 +9,24 @@ function loadCronJobPublications(subscriptionManager) {
|
|
|
8
9
|
return cron_job_collection_1.CronJobs.find().sort({ name: 1 }).exec();
|
|
9
10
|
},
|
|
10
11
|
collections: ['cron-jobs']
|
|
12
|
+
},
|
|
13
|
+
cronjobsReportBuilderWithIdUser: {
|
|
14
|
+
function: function (id_user) {
|
|
15
|
+
return cron_job_collection_1.CronJobs.find({ $and: [
|
|
16
|
+
{ method_run_data: { $exists: 1 } },
|
|
17
|
+
{ 'method_run_data.id_user': id_user },
|
|
18
|
+
{ 'method_run_data.type': 'Report Builder Scheduled Job' }
|
|
19
|
+
] }).exec();
|
|
20
|
+
},
|
|
21
|
+
check: new simpl_schema_1.default({
|
|
22
|
+
id_user: {
|
|
23
|
+
type: String
|
|
24
|
+
}
|
|
25
|
+
}),
|
|
26
|
+
collections: ['cron-jobs'],
|
|
27
|
+
fetchFunction: function (document, id_user) {
|
|
28
|
+
return (document['method_run_data'] && document['method_run_data'].id_user === id_user && document['method_run_data'].type === 'Report Builder Scheduled Job');
|
|
29
|
+
}
|
|
11
30
|
}
|
|
12
31
|
});
|
|
13
32
|
}
|