@openinc/parse-server-opendash 3.31.25 → 3.32.0
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/dist/features/cloudcode/classes/CloudCodeClass.d.ts +10 -0
- package/dist/features/cloudcode/classes/CloudCodeClass.js +24 -0
- package/dist/features/cloudcode/helper/checkCloudCodeFunction.d.ts +7 -0
- package/dist/features/cloudcode/helper/checkCloudCodeFunction.js +14 -0
- package/dist/features/cloudcode/index.d.ts +3 -0
- package/dist/features/cloudcode/index.js +11 -0
- package/dist/features/cloudcode/services/loadCloudCode.d.ts +9 -0
- package/dist/features/cloudcode/services/loadCloudCode.js +44 -0
- package/dist/features/cloudcode/types/CloudCodeFunction.d.ts +7 -0
- package/dist/features/cloudcode/types/CloudCodeFunction.js +2 -0
- package/dist/features/config/helper/getConfig.d.ts +18 -0
- package/dist/features/config/helper/getConfig.js +36 -0
- package/dist/features/config/index.d.ts +1 -0
- package/dist/features/config/index.js +4 -1
- package/dist/features/openservice/functions/assignUsersAndRoles.js +3 -1
- package/dist/features/permissions/helper/ensurePermission.d.ts +10 -0
- package/dist/features/permissions/helper/ensurePermission.js +34 -0
- package/dist/features/permissions/helper/hasPermission.d.ts +7 -0
- package/dist/features/permissions/helper/hasPermission.js +16 -0
- package/dist/features/permissions/helper/requirePermission.d.ts +13 -0
- package/dist/features/permissions/helper/requirePermission.js +28 -0
- package/dist/features/permissions/index.d.ts +3 -0
- package/dist/features/permissions/index.js +7 -1
- package/dist/features/schema/classes/SchemaClass.d.ts +9 -0
- package/dist/features/schema/classes/SchemaClass.js +24 -0
- package/dist/features/schema/helper/defaultHandler.d.ts +33 -0
- package/dist/features/schema/helper/defaultHandler.js +106 -0
- package/dist/features/schema/helper/ensureRole.d.ts +17 -0
- package/dist/features/schema/helper/ensureRole.js +68 -0
- package/dist/features/schema/helper/ensureUserRole.d.ts +7 -0
- package/dist/features/schema/helper/ensureUserRole.js +25 -0
- package/dist/features/schema/helper/immutableField.d.ts +16 -0
- package/dist/features/schema/helper/immutableField.js +26 -0
- package/dist/features/schema/helper/isClassEnabled.d.ts +1 -0
- package/dist/features/schema/helper/isClassEnabled.js +18 -0
- package/dist/features/schema/index.d.ts +12 -0
- package/dist/features/schema/index.js +41 -0
- package/dist/features/schema/services/afterDeleteHook.d.ts +13 -0
- package/dist/features/schema/services/afterDeleteHook.js +28 -0
- package/dist/features/schema/services/afterSaveHook.d.ts +12 -0
- package/dist/features/schema/services/afterSaveHook.js +27 -0
- package/dist/features/schema/services/beforeDeleteHook.d.ts +11 -0
- package/dist/features/schema/services/beforeDeleteHook.js +26 -0
- package/dist/features/schema/services/beforeSaveHook.d.ts +12 -0
- package/dist/features/schema/services/beforeSaveHook.js +27 -0
- package/dist/features/schema/services/initDefaultData.d.ts +1 -0
- package/dist/features/schema/services/initDefaultData.js +45 -0
- package/dist/features/schema/services/initDefaultRoles.d.ts +1 -0
- package/dist/features/schema/services/initDefaultRoles.js +16 -0
- package/dist/features/schema/services/initSchema.d.ts +1 -0
- package/dist/features/schema/services/initSchema.js +32 -0
- package/dist/features/schema/types/hookTypes.d.ts +13 -0
- package/dist/features/schema/types/hookTypes.js +2 -0
- package/dist/features/webpush/index.d.ts +1 -0
- package/dist/features/webpush/index.js +5 -0
- package/dist/features/webpush/services/initWebPush.d.ts +1 -0
- package/dist/features/webpush/services/initWebPush.js +20 -0
- package/dist/functions/getSchemaForAdmin.js +2 -2
- package/dist/hooks/Alarm.js +4 -4
- package/dist/hooks/AlarmAction.js +4 -4
- package/dist/hooks/AlarmWebhook.js +4 -4
- package/dist/hooks/Assets.js +6 -6
- package/dist/hooks/Attachment.js +5 -5
- package/dist/hooks/BDE_Form.js +3 -3
- package/dist/hooks/BDE_List.js +3 -3
- package/dist/hooks/BDE_ListEntry.js +3 -3
- package/dist/hooks/BDE_Page.js +4 -4
- package/dist/hooks/BDE_Result.js +3 -3
- package/dist/hooks/BDE_Unit.js +3 -3
- package/dist/hooks/Company.js +5 -5
- package/dist/hooks/Config.js +4 -4
- package/dist/hooks/Config_open_service.js +4 -4
- package/dist/hooks/Contact.js +5 -5
- package/dist/hooks/Core_Email.js +2 -2
- package/dist/hooks/Core_Token.js +2 -2
- package/dist/hooks/Dashboard.js +4 -4
- package/dist/hooks/Documentation_Category.js +5 -5
- package/dist/hooks/Documentation_Config.js +6 -6
- package/dist/hooks/Documentation_Document.js +5 -5
- package/dist/hooks/GTFS_Agency.js +5 -5
- package/dist/hooks/GTFS_Bikes_Allowed.js +5 -5
- package/dist/hooks/GTFS_Calendar.js +5 -5
- package/dist/hooks/GTFS_Direction.js +5 -5
- package/dist/hooks/GTFS_Level.js +5 -5
- package/dist/hooks/GTFS_Location_Type.js +5 -5
- package/dist/hooks/GTFS_Route.js +5 -5
- package/dist/hooks/GTFS_Route_Type.js +5 -5
- package/dist/hooks/GTFS_Stop.js +5 -5
- package/dist/hooks/GTFS_Stop_Times.js +5 -5
- package/dist/hooks/GTFS_Trip.js +5 -5
- package/dist/hooks/GTFS_Wheelchair_Accessible.js +5 -5
- package/dist/hooks/GTFS_Wheelchair_Boarding.js +5 -5
- package/dist/hooks/Knowledge_Article.js +5 -5
- package/dist/hooks/Knowledge_Category.js +5 -5
- package/dist/hooks/Knowledge_Chat.js +5 -5
- package/dist/hooks/Knowledge_ChatMessage.js +5 -5
- package/dist/hooks/Knowledge_Document.js +7 -7
- package/dist/hooks/Knowledge_DocumentPage.js +6 -6
- package/dist/hooks/Knowledge_Video.js +5 -5
- package/dist/hooks/Language.js +5 -5
- package/dist/hooks/Log.js +5 -5
- package/dist/hooks/MES_Article.js +5 -5
- package/dist/hooks/MES_Order.js +5 -5
- package/dist/hooks/MES_OrderPlan.js +5 -5
- package/dist/hooks/MIAAS_MDSEndpoint.js +5 -5
- package/dist/hooks/ML_DataSelection.js +5 -5
- package/dist/hooks/MailTemplate.js +5 -5
- package/dist/hooks/Maintenance_Downtime.js +5 -5
- package/dist/hooks/Maintenance_Duedate.js +5 -5
- package/dist/hooks/Maintenance_Frequency.js +5 -5
- package/dist/hooks/Maintenance_Issuecategory.js +5 -5
- package/dist/hooks/Maintenance_Item.js +5 -5
- package/dist/hooks/Maintenance_Kanban_State.js +5 -5
- package/dist/hooks/Maintenance_Media.js +5 -5
- package/dist/hooks/Maintenance_Message.js +5 -5
- package/dist/hooks/Maintenance_Order.js +5 -5
- package/dist/hooks/Maintenance_Priority.js +5 -5
- package/dist/hooks/Maintenance_Project.js +5 -5
- package/dist/hooks/Maintenance_Restriction.js +5 -5
- package/dist/hooks/Maintenance_Schedule.js +6 -6
- package/dist/hooks/Maintenance_Schedule_Execution.js +5 -5
- package/dist/hooks/Maintenance_Schedule_Execution_Step.js +5 -5
- package/dist/hooks/Maintenance_Schedule_Step.js +5 -5
- package/dist/hooks/Maintenance_Schedule_Template.js +7 -7
- package/dist/hooks/Maintenance_Source_File.js +5 -5
- package/dist/hooks/Maintenance_Ticket.js +5 -5
- package/dist/hooks/Maintenance_Ticket_Assignment.js +5 -5
- package/dist/hooks/Maintenance_Ticket_FormConfig.js +5 -5
- package/dist/hooks/Maintenance_Ticket_Issuecategory.js +5 -5
- package/dist/hooks/Maintenance_Ticket_Kanban_State.js +7 -6
- package/dist/hooks/Maintenance_Ticket_Kanban_State_Current.js +5 -5
- package/dist/hooks/Maintenance_Ticket_Material.js +5 -5
- package/dist/hooks/Maintenance_Ticket_Project.js +5 -5
- package/dist/hooks/Maintenance_Ticket_QR_Code.js +5 -5
- package/dist/hooks/Maintenance_Ticket_Source.js +5 -5
- package/dist/hooks/Maintenance_Ticket_Title.js +5 -5
- package/dist/hooks/Monitoring_DataHierachies.js +5 -5
- package/dist/hooks/Monitoring_Jobs.js +5 -5
- package/dist/hooks/Monitoring_ParseTableSensor.js +5 -5
- package/dist/hooks/Monitoring_ReportImage.js +5 -5
- package/dist/hooks/Monitoring_Slideshow.js +4 -4
- package/dist/hooks/NavigationGroup.js +4 -4
- package/dist/hooks/NavigationItem.js +4 -4
- package/dist/hooks/Notification.js +6 -6
- package/dist/hooks/Notification_Setting.js +5 -5
- package/dist/hooks/OWPlcDevice.js +3 -3
- package/dist/hooks/OWPlcItem.js +3 -3
- package/dist/hooks/Permission.js +5 -5
- package/dist/hooks/Push.js +4 -4
- package/dist/hooks/Report.js +4 -4
- package/dist/hooks/Share.js +4 -4
- package/dist/hooks/Source.js +9 -8
- package/dist/hooks/SourceMeta.js +4 -4
- package/dist/hooks/Tenant.js +7 -7
- package/dist/hooks/TenantMeta.js +5 -5
- package/dist/hooks/TenantTrustedDomain.js +4 -4
- package/dist/hooks/UserData.js +4 -4
- package/dist/hooks/User_Setting.js +5 -5
- package/dist/hooks/VirtualKPI.js +5 -5
- package/dist/hooks/WebPush.js +5 -5
- package/dist/hooks/Widget.js +4 -4
- package/dist/hooks/WidgetPreset.js +6 -5
- package/dist/hooks/_ChangeLog.js +6 -6
- package/dist/hooks/_Role.js +2 -2
- package/dist/hooks/_User.js +13 -13
- package/dist/index.d.ts +4 -186
- package/dist/index.js +29 -553
- package/dist/types/Documentation_Category.d.ts +1 -1
- package/dist/types/Documentation_Document.d.ts +1 -1
- package/dist/types/EMS_ChargePoint.d.ts +51 -0
- package/dist/types/EMS_ChargePoint.js +89 -0
- package/dist/types/Maintenance_Schedule.d.ts +2 -2
- package/dist/types/Maintenance_Ticket_Data.d.ts +6 -7
- package/dist/types/Notification.d.ts +3 -0
- package/dist/types/Notification.js +6 -0
- package/dist/types/RAG_Data.d.ts +50 -0
- package/dist/types/RAG_Data.js +89 -0
- package/dist/types/RAG_Interview.d.ts +23 -0
- package/dist/types/RAG_Interview.js +35 -0
- package/dist/types/RAG_Meta.d.ts +23 -0
- package/dist/types/RAG_Meta.js +35 -0
- package/dist/types/RAG_Prompts.d.ts +31 -0
- package/dist/types/RAG_Prompts.js +53 -0
- package/dist/types/RAG_Questions.d.ts +16 -0
- package/dist/types/RAG_Questions.js +23 -0
- package/dist/types/RAG_Request.d.ts +23 -0
- package/dist/types/RAG_Request.js +35 -0
- package/dist/types/Spreadsheet_Workbook.d.ts +34 -0
- package/dist/types/Spreadsheet_Workbook.js +53 -0
- package/dist/types/index.d.ts +22 -3
- package/dist/types/index.js +19 -3
- package/package.json +4 -3
- package/schema/Documentation_Category.json +6 -15
- package/schema/Documentation_Document.json +8 -20
- package/schema/EMS_ChargePoint.json +80 -0
- package/schema/Knowledge_Chat.json +3 -0
- package/schema/Maintenance_Schedule.json +1 -1
- package/schema/Maintenance_Ticket_Data.json +1 -1
- package/schema/Notification.json +5 -0
- package/schema/RAG_Data.json +94 -0
- package/schema/RAG_Interview.json +54 -0
- package/schema/RAG_Meta.json +54 -0
- package/schema/RAG_Prompts.json +57 -0
- package/schema/RAG_Questions.json +42 -0
- package/schema/RAG_Request.json +53 -0
- package/schema/Spreadsheet_Workbook.json +73 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Monitoring_ParseTableSensor, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request, { allowCustomACL: true });
|
|
11
11
|
// TODO
|
|
12
12
|
});
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.afterSaveHook)(types_1.Monitoring_ParseTableSensor, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
15
|
// TODO
|
|
16
16
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Monitoring_ReportImage, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
11
11
|
// TODO
|
|
12
12
|
});
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.afterSaveHook)(types_1.Monitoring_ReportImage, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
15
|
// TODO
|
|
16
16
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Monitoring_Slideshow, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
// TODO
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, schema_1.afterSaveHook)(types_1.Monitoring_Slideshow, async (request) => {
|
|
13
13
|
const { object, original, user } = request;
|
|
14
14
|
// TODO
|
|
15
15
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.NavigationGroup, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, schema_1.afterSaveHook)(types_1.NavigationGroup, async ({ object, original, user }) => {
|
|
12
12
|
// TODO
|
|
13
13
|
});
|
|
14
14
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.NavigationItem, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
// TODO
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, schema_1.afterSaveHook)(types_1.NavigationItem, async ({ object, original, user }) => {
|
|
13
13
|
// TODO
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -5,19 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.init = init;
|
|
7
7
|
const web_push_1 = __importDefault(require("web-push"));
|
|
8
|
-
const
|
|
8
|
+
const schema_1 = require("../features/schema");
|
|
9
9
|
const config_1 = require("../features/config");
|
|
10
10
|
const notifications_1 = require("../features/notifications");
|
|
11
11
|
const types_1 = require("../types");
|
|
12
12
|
async function init() {
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.beforeSaveHook)(types_1.Notification, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
|
-
await (0,
|
|
16
|
-
await (0,
|
|
15
|
+
await (0, schema_1.defaultHandler)(request);
|
|
16
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
17
17
|
});
|
|
18
|
-
(0,
|
|
18
|
+
(0, schema_1.afterSaveHook)(types_1.Notification, async ({ object, original, user }) => {
|
|
19
19
|
if (!object.get("isSent")) {
|
|
20
|
-
const icon = object.get("iconPath") || (await (0,
|
|
20
|
+
const icon = object.get("iconPath") || (await (0, config_1.getConfig)("WEB_PUSH_ICON"));
|
|
21
21
|
const title = object.get("title");
|
|
22
22
|
const description = object.get("description");
|
|
23
23
|
const user = object.get("user");
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Notification_Setting, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
11
11
|
// TODO
|
|
12
12
|
});
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.afterSaveHook)(types_1.Notification_Setting, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
15
|
// TODO
|
|
16
16
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.OWPlcDevice, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
9
|
});
|
|
10
|
-
(0,
|
|
10
|
+
(0, schema_1.afterSaveHook)(types_1.OWPlcDevice, async (request) => {
|
|
11
11
|
const { object, original, user } = request;
|
|
12
12
|
});
|
|
13
13
|
}
|
package/dist/hooks/OWPlcItem.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
8
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.OWPlcItem, async (request) => { });
|
|
8
|
+
(0, schema_1.afterSaveHook)(types_1.OWPlcItem, async (request) => { });
|
|
9
9
|
}
|
package/dist/hooks/Permission.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
const masterKeyPermission = [
|
|
7
7
|
"opendash:can-admin-tenants",
|
|
@@ -10,18 +10,18 @@ const masterKeyPermission = [
|
|
|
10
10
|
"opendash:source:write-tag-group",
|
|
11
11
|
];
|
|
12
12
|
async function init() {
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.beforeSaveHook)(types_1.Permission, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
15
|
if (masterKeyPermission.includes(object.get("key")) && !request.master) {
|
|
16
16
|
throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, `User is not allowed to create or update permission with key '${object.get("key")}' without master key`);
|
|
17
17
|
}
|
|
18
|
-
await (0,
|
|
19
|
-
await (0,
|
|
18
|
+
await (0, schema_1.defaultHandler)(request);
|
|
19
|
+
await (0, schema_1.defaultAclHandler)(request, {
|
|
20
20
|
allowCustomACL: true,
|
|
21
21
|
denyTenantUserRead: true,
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
-
(0,
|
|
24
|
+
(0, schema_1.afterSaveHook)(types_1.Permission, async ({ object, original, user }) => {
|
|
25
25
|
// TODO
|
|
26
26
|
});
|
|
27
27
|
}
|
package/dist/hooks/Push.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Push, async (request) => {
|
|
8
8
|
const { object, installationId, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
if (!user && !object.get("user")) {
|
|
11
11
|
throw new Parse.Error(142, "User Missing");
|
|
12
12
|
}
|
|
@@ -23,7 +23,7 @@ async function init() {
|
|
|
23
23
|
[object.get("user").id]: { read: true, write: true },
|
|
24
24
|
}));
|
|
25
25
|
});
|
|
26
|
-
(0,
|
|
26
|
+
(0, schema_1.afterSaveHook)(types_1.Push, async ({ object, original, user }) => {
|
|
27
27
|
// TODO
|
|
28
28
|
});
|
|
29
29
|
}
|
package/dist/hooks/Report.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Report, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
// TODO
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, schema_1.afterSaveHook)(types_1.Report, async ({ object, original, user }) => {
|
|
13
13
|
// TODO
|
|
14
14
|
});
|
|
15
15
|
}
|
package/dist/hooks/Share.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Share, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
// TODO
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, schema_1.afterSaveHook)(types_1.Share, async ({ object, original, user }) => {
|
|
13
13
|
// TODO
|
|
14
14
|
});
|
|
15
15
|
}
|
package/dist/hooks/Source.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
|
+
const permissions_1 = require("../features/permissions");
|
|
5
6
|
const types_1 = require("../types");
|
|
6
7
|
async function init() {
|
|
7
|
-
(0,
|
|
8
|
+
(0, schema_1.beforeSaveHook)(types_1.Source, async (request) => {
|
|
8
9
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
11
|
// ACL start
|
|
11
12
|
let acl = object.getACL();
|
|
12
13
|
if (!acl) {
|
|
@@ -15,13 +16,13 @@ async function init() {
|
|
|
15
16
|
if (object.get("tag") && object.get("tag") !== original?.get("tag")) {
|
|
16
17
|
// Handle group: regex tags, which require special permission
|
|
17
18
|
if (object.get("tag")?.startsWith("group:")) {
|
|
18
|
-
await (0,
|
|
19
|
+
await (0, permissions_1.requirePermission)(request, "opendash:source:write-tag-group", "User is not allowed to write sources with a tag starting with 'group:'");
|
|
19
20
|
}
|
|
20
21
|
// Handle tenant prefix, which requires special permission
|
|
21
22
|
const tenant = await object.get("tenant")?.fetch({ useMasterKey: true });
|
|
22
23
|
if (tenant && tenant.get("tagPrefix")) {
|
|
23
24
|
if (!object.get("tag")?.startsWith(tenant.get("tagPrefix"))) {
|
|
24
|
-
await (0,
|
|
25
|
+
await (0, permissions_1.requirePermission)(request, "opendash:source:write-tag-ignore-tenant-prefix", "User is not allowed to use tag which ignores tenant prefix");
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
// Handle duplicates, which require special permission
|
|
@@ -30,7 +31,7 @@ async function init() {
|
|
|
30
31
|
.equalTo("tag", object.get("tag"))
|
|
31
32
|
.find({ useMasterKey: true });
|
|
32
33
|
if (duplicates.length > 0) {
|
|
33
|
-
await (0,
|
|
34
|
+
await (0, permissions_1.requirePermission)(request, "opendash:source:write-tag-duplicate", "User is not allowed to write sources with a duplicate tag");
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
acl.setRoleReadAccess("od-admin", true);
|
|
@@ -43,7 +44,7 @@ async function init() {
|
|
|
43
44
|
object.setACL(acl);
|
|
44
45
|
// ACL end
|
|
45
46
|
});
|
|
46
|
-
(0,
|
|
47
|
+
(0, schema_1.afterSaveHook)(types_1.Source, async ({ object, original, user }) => {
|
|
47
48
|
try {
|
|
48
49
|
const permissions = await new Parse.Query("AccessPermissions")
|
|
49
50
|
.equalTo("source", object)
|
|
@@ -76,7 +77,7 @@ async function init() {
|
|
|
76
77
|
console.log(error);
|
|
77
78
|
}
|
|
78
79
|
});
|
|
79
|
-
(0,
|
|
80
|
+
(0, schema_1.beforeDeleteHook)(types_1.Source, async ({ object, original, user }) => {
|
|
80
81
|
try {
|
|
81
82
|
const permissions = await new Parse.Query("AccessPermissions")
|
|
82
83
|
.equalTo("source", object)
|
package/dist/hooks/SourceMeta.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.SourceMeta, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
// ACL start
|
|
11
11
|
let acl = object.getACL();
|
|
12
12
|
if (!acl) {
|
|
@@ -21,7 +21,7 @@ async function init() {
|
|
|
21
21
|
}
|
|
22
22
|
object.setACL(acl);
|
|
23
23
|
});
|
|
24
|
-
(0,
|
|
24
|
+
(0, schema_1.afterSaveHook)(types_1.SourceMeta, async (request) => {
|
|
25
25
|
const { object, original, user } = request;
|
|
26
26
|
// TODO
|
|
27
27
|
});
|
package/dist/hooks/Tenant.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Tenant, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.immutableField)(request, "tagPrefix", "opendash:tenant:change-tag-prefix");
|
|
11
11
|
if (object.id) {
|
|
12
12
|
object.setACL(new Parse.ACL({
|
|
13
13
|
[`role:od-tenant-user-${object.id}`]: {
|
|
@@ -29,7 +29,7 @@ async function init() {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
(0,
|
|
32
|
+
(0, schema_1.afterSaveHook)(types_1.Tenant, async ({ object, original, user }) => {
|
|
33
33
|
// Handle Data Source
|
|
34
34
|
if (object.id && !original?.get("dataSource")) {
|
|
35
35
|
const rootSource = await new Parse.Query(types_1.Source)
|
|
@@ -55,10 +55,10 @@ async function init() {
|
|
|
55
55
|
object.set("dataSource", dataSource);
|
|
56
56
|
await object.save(null, { useMasterKey: true });
|
|
57
57
|
}
|
|
58
|
-
await (0,
|
|
58
|
+
await (0, schema_1.ensureRole)(`od-tenant-admin-${object.id}`, {
|
|
59
59
|
label: `${object.get("label")} (Admin)`,
|
|
60
60
|
});
|
|
61
|
-
await (0,
|
|
61
|
+
await (0, schema_1.ensureRole)(`od-tenant-user-${object.id}`, {
|
|
62
62
|
label: object.get("label"),
|
|
63
63
|
acl: new Parse.ACL({
|
|
64
64
|
[`role:od-tenant-user-${object.id}`]: {
|
package/dist/hooks/TenantMeta.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.TenantMeta, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
11
11
|
// TODO
|
|
12
12
|
});
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.afterSaveHook)(types_1.TenantMeta, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
15
|
// TODO
|
|
16
16
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
8
|
-
await (0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.TenantTrustedDomain, async (request) => {
|
|
8
|
+
await (0, schema_1.defaultHandler)(request);
|
|
9
9
|
});
|
|
10
|
-
(0,
|
|
10
|
+
(0, schema_1.afterSaveHook)(types_1.TenantTrustedDomain, async (request) => { });
|
|
11
11
|
}
|
package/dist/hooks/UserData.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.UserData, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
// TODO
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, schema_1.afterSaveHook)(types_1.UserData, async ({ object, original, user }) => {
|
|
13
13
|
// TODO
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.User_Setting, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request, { allowCustomACL: true });
|
|
11
11
|
// TODO
|
|
12
12
|
});
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.afterSaveHook)(types_1.User_Setting, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
15
|
// TODO
|
|
16
16
|
});
|
package/dist/hooks/VirtualKPI.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.VirtualKPI, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
11
11
|
// TODO
|
|
12
12
|
});
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.afterSaveHook)(types_1.VirtualKPI, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
15
|
// TODO
|
|
16
16
|
});
|
package/dist/hooks/WebPush.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.WebPush, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
11
11
|
// TODO
|
|
12
12
|
});
|
|
13
|
-
(0,
|
|
13
|
+
(0, schema_1.afterSaveHook)(types_1.WebPush, async (request) => {
|
|
14
14
|
const { object, original, user } = request;
|
|
15
15
|
// TODO
|
|
16
16
|
});
|
package/dist/hooks/Widget.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
|
-
(0,
|
|
7
|
+
(0, schema_1.beforeSaveHook)(types_1.Widget, async (request) => {
|
|
8
8
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, schema_1.defaultHandler)(request);
|
|
10
10
|
// TODO
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, schema_1.afterSaveHook)(types_1.Widget, async ({ object, original, user }) => {
|
|
13
13
|
// TODO
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
|
+
const schema_2 = require("../features/schema");
|
|
5
6
|
const types_1 = require("../types");
|
|
6
7
|
async function init() {
|
|
7
|
-
(0,
|
|
8
|
+
(0, schema_2.beforeSaveHook)(types_1.WidgetPreset, async (request) => {
|
|
8
9
|
const { object, original, user } = request;
|
|
9
|
-
await (0,
|
|
10
|
-
await (0,
|
|
10
|
+
await (0, schema_1.defaultHandler)(request);
|
|
11
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
11
12
|
// TODO
|
|
12
13
|
});
|
|
13
|
-
(0,
|
|
14
|
+
(0, schema_2.afterSaveHook)(types_1.WidgetPreset, async (request) => {
|
|
14
15
|
const { object, original, user } = request;
|
|
15
16
|
// TODO
|
|
16
17
|
});
|
package/dist/hooks/_ChangeLog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const schema_1 = require("../features/schema");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
async function init() {
|
|
7
7
|
const schema = await Parse.Schema.all();
|
|
@@ -14,10 +14,10 @@ async function init() {
|
|
|
14
14
|
.filter((c) => c.length > 0),
|
|
15
15
|
];
|
|
16
16
|
console.log(`ChangeLog blacklisted classes: ${blacklistedClasses.join(", ") || "None"}`);
|
|
17
|
-
(0,
|
|
17
|
+
(0, schema_1.beforeSaveHook)(types_1.Changelog.className, async (request) => {
|
|
18
18
|
const { object, original, user } = request;
|
|
19
|
-
await (0,
|
|
20
|
-
await (0,
|
|
19
|
+
await (0, schema_1.defaultHandler)(request);
|
|
20
|
+
await (0, schema_1.defaultAclHandler)(request);
|
|
21
21
|
if (user && object && object.getACL()) {
|
|
22
22
|
object.getACL().setReadAccess(user.id, true);
|
|
23
23
|
}
|
|
@@ -34,7 +34,7 @@ async function init() {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
console.log(`Registering ChangeLog hook for class ${classSchema?.className || "CLASSNAME_MISSING"}`);
|
|
37
|
-
(0,
|
|
37
|
+
(0, schema_1.beforeDeleteHook)(classSchema.className, async (request) => {
|
|
38
38
|
console.log(`Creating ChangeLog entry for DELETE on class ${classSchema.className} and object ${request.object.id}`);
|
|
39
39
|
try {
|
|
40
40
|
const { object, user, master } = request;
|
|
@@ -61,7 +61,7 @@ async function init() {
|
|
|
61
61
|
":", JSON.stringify(e), "\n" + "-".repeat(80) + "\n");
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
(0,
|
|
64
|
+
(0, schema_1.afterSaveHook)(classSchema.className, async (request) => {
|
|
65
65
|
console.log(`Creating ChangeLog entry for class ${classSchema.className} and object ${request.object.id}`);
|
|
66
66
|
try {
|
|
67
67
|
const { object, original, user, master, context } = request;
|