@openinc/parse-server-opendash 4.31.2 → 4.31.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.
|
@@ -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
|
}
|
|
@@ -31,29 +31,9 @@ const index_js_1 = require("../types/index.js");
|
|
|
31
31
|
*/
|
|
32
32
|
async function init(name) {
|
|
33
33
|
node_1.default.Cloud.define(name, async function (request) {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
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.");
|
|
39
|
-
}
|
|
40
|
-
if (object.className !== index_js_1.Meta_Entry.className) {
|
|
41
|
-
throw new node_1.default.Error(node_1.default.Error.INVALID_CLASS_NAME, `Expected a ${index_js_1.Meta_Entry.className} row, got ${object.className}.`);
|
|
42
|
-
}
|
|
43
|
-
await object.save(null, { useMasterKey: true });
|
|
44
|
-
const acl = object.getACL();
|
|
45
|
-
const subjectId = object.get("entryObjectId");
|
|
46
|
-
return {
|
|
47
|
-
success: true,
|
|
48
|
-
id: object.id,
|
|
49
|
-
context: object.get("context"),
|
|
50
|
-
entryClassName: object.get("entryClassName"),
|
|
51
|
-
// Reported back so the dashboard shows whether the grant actually
|
|
52
|
-
// landed, rather than just "done".
|
|
53
|
-
subjectCanWrite: !!subjectId && !!acl?.getWriteAccess(subjectId),
|
|
54
|
-
};
|
|
55
|
-
}, {
|
|
56
|
-
// Parse Dashboard runs scripts with the master key.
|
|
57
|
-
requireMaster: true,
|
|
34
|
+
const metaEntries = await new node_1.default.Query(index_js_1.Meta_Entry).findAll({
|
|
35
|
+
useMasterKey: true,
|
|
36
|
+
});
|
|
37
|
+
return await index_js_1.Meta_Entry.saveAll(metaEntries, { useMasterKey: true });
|
|
58
38
|
});
|
|
59
39
|
}
|