@openinc/parse-server-opendash 4.31.1 → 4.31.3
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.
|
@@ -121,6 +121,10 @@ var Permissions;
|
|
|
121
121
|
(function (BDE) {
|
|
122
122
|
BDE["timetracking_can_edit_times"] = "bde:timetracking-edit-times";
|
|
123
123
|
})(BDE = Permissions.BDE || (Permissions.BDE = {}));
|
|
124
|
+
let MONITORING;
|
|
125
|
+
(function (MONITORING) {
|
|
126
|
+
MONITORING["monitoring_access"] = "opendash:can-access-monitoring";
|
|
127
|
+
})(MONITORING = Permissions.MONITORING || (Permissions.MONITORING = {}));
|
|
124
128
|
// can also be used for nested permissions
|
|
125
129
|
// Example:
|
|
126
130
|
// export namespace TestPlugin {
|
|
@@ -26,28 +26,9 @@ const index_js_1 = require("../types/index.js");
|
|
|
26
26
|
*/
|
|
27
27
|
async function init(name) {
|
|
28
28
|
node_1.default.Cloud.define(name, async function (request) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
throw new node_1.default.Error(node_1.default.Error.INVALID_JSON, "No object was passed. Run this from the data browser on a selected row.");
|
|
34
|
-
}
|
|
35
|
-
if (object.className !== index_js_1.Service_Ticket.className) {
|
|
36
|
-
throw new node_1.default.Error(node_1.default.Error.INVALID_CLASS_NAME, `Expected a ${index_js_1.Service_Ticket.className} row, got ${object.className}.`);
|
|
37
|
-
}
|
|
38
|
-
await object.save(null, { useMasterKey: true });
|
|
39
|
-
return {
|
|
40
|
-
success: true,
|
|
41
|
-
id: object.id,
|
|
42
|
-
// Reported back so the dashboard shows what the row ended up with,
|
|
43
|
-
// rather than just "done". A ticket without a project legitimately has
|
|
44
|
-
// no project key.
|
|
45
|
-
statusOrder: object.get("statusOrder") ?? null,
|
|
46
|
-
projectSortKey: object.get("projectSortKey") ?? null,
|
|
47
|
-
equipmentSortKey: object.get("equipmentSortKey") ?? null,
|
|
48
|
-
};
|
|
49
|
-
}, {
|
|
50
|
-
// Parse Dashboard runs scripts with the master key.
|
|
51
|
-
requireMaster: true,
|
|
29
|
+
const outdatedTickets = await node_1.default.Query.or(new node_1.default.Query(index_js_1.Service_Ticket).doesNotExist("statusOrder"), new node_1.default.Query(index_js_1.Service_Ticket).doesNotExist("projectSortKey"), new node_1.default.Query(index_js_1.Service_Ticket).doesNotExist("equipmentSortKey")).findAll({ useMasterKey: true });
|
|
30
|
+
return await index_js_1.Service_Ticket.saveAll(outdatedTickets, {
|
|
31
|
+
useMasterKey: true,
|
|
32
|
+
});
|
|
52
33
|
});
|
|
53
34
|
}
|