@openinc/parse-server-opendash 2.3.13 → 2.3.14
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/config.d.ts +2 -2
- package/dist/config.js +455 -455
- package/dist/featuremap.json +75 -75
- package/dist/functions/_init.d.ts +1 -1
- package/dist/functions/_init.js +20 -20
- package/dist/functions/getAdminConfig.d.ts +1 -1
- package/dist/functions/getAdminConfig.js +63 -63
- package/dist/functions/getSchemaForAdmin.d.ts +1 -1
- package/dist/functions/getSchemaForAdmin.js +14 -14
- package/dist/functions/opendash-geo-features.d.ts +1 -1
- package/dist/functions/opendash-geo-features.js +19 -19
- package/dist/functions/openinc-auth-change-password.d.ts +1 -1
- package/dist/functions/openinc-auth-change-password.js +30 -30
- package/dist/functions/openinc-auth-confirm-email.d.ts +1 -1
- package/dist/functions/openinc-auth-confirm-email.js +18 -18
- package/dist/functions/openinc-auth-email-confirmation-request.d.ts +1 -1
- package/dist/functions/openinc-auth-email-confirmation-request.js +42 -42
- package/dist/functions/openinc-auth-email-confirmation.d.ts +1 -1
- package/dist/functions/openinc-auth-email-confirmation.js +23 -23
- package/dist/functions/openinc-auth-login-admin.d.ts +1 -1
- package/dist/functions/openinc-auth-login-admin.js +69 -69
- package/dist/functions/openinc-auth-login-passwordless.d.ts +1 -1
- package/dist/functions/openinc-auth-login-passwordless.js +50 -50
- package/dist/functions/openinc-auth-login.d.ts +1 -1
- package/dist/functions/openinc-auth-login.js +45 -45
- package/dist/functions/openinc-auth-password-reset-request.d.ts +1 -1
- package/dist/functions/openinc-auth-password-reset-request.js +42 -42
- package/dist/functions/openinc-auth-password-reset.d.ts +1 -1
- package/dist/functions/openinc-auth-password-reset.js +28 -28
- package/dist/functions/openinc-auth-signup.d.ts +1 -1
- package/dist/functions/openinc-auth-signup.js +88 -88
- package/dist/functions/openinc-auth-validate-token.d.ts +1 -1
- package/dist/functions/openinc-auth-validate-token.js +37 -37
- package/dist/functions/openinc-auth.common.d.ts +15 -15
- package/dist/functions/openinc-auth.common.js +67 -67
- package/dist/functions/openinc-config.d.ts +1 -1
- package/dist/functions/openinc-config.js +92 -92
- package/dist/functions/openinc-geo-google-autocomplete.d.ts +1 -1
- package/dist/functions/openinc-geo-google-autocomplete.js +58 -58
- package/dist/functions/openinc-geo-google.common.d.ts +2 -2
- package/dist/functions/openinc-geo-google.common.js +34 -34
- package/dist/functions/openinc-geo-graphhopper-geocode-reverse-raw.d.ts +1 -1
- package/dist/functions/openinc-geo-graphhopper-geocode-reverse-raw.js +24 -24
- package/dist/functions/openinc-geo-graphhopper-geocode-reverse.d.ts +1 -1
- package/dist/functions/openinc-geo-graphhopper-geocode-reverse.js +24 -24
- package/dist/functions/openinc-geo-graphhopper-geocode.d.ts +1 -1
- package/dist/functions/openinc-geo-graphhopper-geocode.js +24 -24
- package/dist/functions/openinc-geo-graphhopper-route-simple.d.ts +1 -1
- package/dist/functions/openinc-geo-graphhopper-route-simple.js +33 -33
- package/dist/functions/openinc-geo-graphhopper.common.d.ts +2 -2
- package/dist/functions/openinc-geo-graphhopper.common.js +60 -60
- package/dist/helper/Config.d.ts +33 -33
- package/dist/helper/Config.js +156 -156
- package/dist/helper/pdf2img.d.ts +12 -12
- package/dist/helper/pdf2img.js +111 -111
- package/dist/hooks/Alarm.d.ts +1 -1
- package/dist/hooks/Alarm.js +40 -40
- package/dist/hooks/AlarmAction.d.ts +1 -1
- package/dist/hooks/AlarmAction.js +15 -15
- package/dist/hooks/AlarmWebhook.d.ts +1 -1
- package/dist/hooks/AlarmWebhook.js +16 -16
- package/dist/hooks/Attachment.d.ts +1 -1
- package/dist/hooks/Attachment.js +18 -18
- package/dist/hooks/BDE_Form.d.ts +1 -1
- package/dist/hooks/BDE_Form.js +53 -53
- package/dist/hooks/BDE_List.d.ts +1 -1
- package/dist/hooks/BDE_List.js +17 -17
- package/dist/hooks/BDE_ListEntry.d.ts +1 -1
- package/dist/hooks/BDE_ListEntry.js +17 -17
- package/dist/hooks/BDE_Page.d.ts +1 -1
- package/dist/hooks/BDE_Page.js +44 -44
- package/dist/hooks/BDE_Result.d.ts +1 -1
- package/dist/hooks/BDE_Result.js +128 -128
- package/dist/hooks/BDE_Unit.d.ts +1 -1
- package/dist/hooks/BDE_Unit.js +17 -17
- package/dist/hooks/Config.d.ts +1 -1
- package/dist/hooks/Config.js +16 -16
- package/dist/hooks/Core_Email.d.ts +11 -11
- package/dist/hooks/Core_Email.js +111 -111
- package/dist/hooks/Core_Token.d.ts +1 -1
- package/dist/hooks/Core_Token.js +11 -11
- package/dist/hooks/Dashboard.d.ts +1 -1
- package/dist/hooks/Dashboard.js +33 -33
- package/dist/hooks/GTFS_Agency.d.ts +1 -1
- package/dist/hooks/GTFS_Agency.js +18 -18
- package/dist/hooks/GTFS_Bikes_Allowed.d.ts +1 -1
- package/dist/hooks/GTFS_Bikes_Allowed.js +18 -18
- package/dist/hooks/GTFS_Calendar.d.ts +1 -1
- package/dist/hooks/GTFS_Calendar.js +18 -18
- package/dist/hooks/GTFS_Direction.d.ts +1 -1
- package/dist/hooks/GTFS_Direction.js +18 -18
- package/dist/hooks/GTFS_Level.d.ts +1 -1
- package/dist/hooks/GTFS_Level.js +18 -18
- package/dist/hooks/GTFS_Location_Type.d.ts +1 -1
- package/dist/hooks/GTFS_Location_Type.js +18 -18
- package/dist/hooks/GTFS_Route.d.ts +1 -1
- package/dist/hooks/GTFS_Route.js +18 -18
- package/dist/hooks/GTFS_Route_Type.d.ts +1 -1
- package/dist/hooks/GTFS_Route_Type.js +18 -18
- package/dist/hooks/GTFS_Stop.d.ts +1 -1
- package/dist/hooks/GTFS_Stop.js +18 -18
- package/dist/hooks/GTFS_Stop_Times.d.ts +1 -1
- package/dist/hooks/GTFS_Stop_Times.js +18 -18
- package/dist/hooks/GTFS_Trip.d.ts +1 -1
- package/dist/hooks/GTFS_Trip.js +18 -18
- package/dist/hooks/GTFS_Wheelchair_Accessible.d.ts +1 -1
- package/dist/hooks/GTFS_Wheelchair_Accessible.js +18 -18
- package/dist/hooks/GTFS_Wheelchair_Boarding.d.ts +1 -1
- package/dist/hooks/GTFS_Wheelchair_Boarding.js +18 -18
- package/dist/hooks/Group.d.ts +1 -1
- package/dist/hooks/Group.js +56 -56
- package/dist/hooks/Knowledge_Article.d.ts +1 -1
- package/dist/hooks/Knowledge_Article.js +18 -18
- package/dist/hooks/Knowledge_Category.d.ts +1 -1
- package/dist/hooks/Knowledge_Category.js +18 -18
- package/dist/hooks/Knowledge_Document.d.ts +1 -1
- package/dist/hooks/Knowledge_Document.js +60 -60
- package/dist/hooks/Knowledge_DocumentPage.d.ts +1 -1
- package/dist/hooks/Knowledge_DocumentPage.js +22 -22
- package/dist/hooks/Knowledge_Video.d.ts +1 -1
- package/dist/hooks/Knowledge_Video.js +18 -18
- package/dist/hooks/Language.d.ts +1 -1
- package/dist/hooks/Language.js +18 -18
- package/dist/hooks/Log.d.ts +1 -1
- package/dist/hooks/Log.js +18 -18
- package/dist/hooks/MIAAS_MDSEndpoint.d.ts +1 -1
- package/dist/hooks/MIAAS_MDSEndpoint.js +18 -18
- package/dist/hooks/Maintenance_Article.d.ts +1 -1
- package/dist/hooks/Maintenance_Article.js +18 -18
- package/dist/hooks/Maintenance_Downtime.d.ts +1 -1
- package/dist/hooks/Maintenance_Downtime.js +18 -18
- package/dist/hooks/Maintenance_Duedate.d.ts +1 -1
- package/dist/hooks/Maintenance_Duedate.js +18 -18
- package/dist/hooks/Maintenance_Frequency.d.ts +1 -1
- package/dist/hooks/Maintenance_Frequency.js +18 -18
- package/dist/hooks/Maintenance_Issuecategory.d.ts +1 -1
- package/dist/hooks/Maintenance_Issuecategory.js +21 -21
- package/dist/hooks/Maintenance_Item.d.ts +1 -1
- package/dist/hooks/Maintenance_Item.js +18 -18
- package/dist/hooks/Maintenance_Kanban_State.d.ts +1 -1
- package/dist/hooks/Maintenance_Kanban_State.js +18 -18
- package/dist/hooks/Maintenance_Media.d.ts +1 -1
- package/dist/hooks/Maintenance_Media.js +18 -18
- package/dist/hooks/Maintenance_Message.d.ts +1 -1
- package/dist/hooks/Maintenance_Message.js +18 -18
- package/dist/hooks/Maintenance_Message_Body.d.ts +1 -1
- package/dist/hooks/Maintenance_Message_Body.js +18 -18
- package/dist/hooks/Maintenance_Order.d.ts +1 -1
- package/dist/hooks/Maintenance_Order.js +18 -18
- package/dist/hooks/Maintenance_Priority.d.ts +1 -1
- package/dist/hooks/Maintenance_Priority.js +18 -18
- package/dist/hooks/Maintenance_Restriction.d.ts +1 -1
- package/dist/hooks/Maintenance_Restriction.js +18 -18
- package/dist/hooks/Maintenance_Schedule.d.ts +1 -1
- package/dist/hooks/Maintenance_Schedule.js +18 -18
- package/dist/hooks/Maintenance_Schedule_Execution.d.ts +1 -1
- package/dist/hooks/Maintenance_Schedule_Execution.js +18 -18
- package/dist/hooks/Maintenance_Schedule_Execution_Step.d.ts +1 -1
- package/dist/hooks/Maintenance_Schedule_Execution_Step.js +18 -18
- package/dist/hooks/Maintenance_Schedule_Step.d.ts +1 -1
- package/dist/hooks/Maintenance_Schedule_Step.js +18 -18
- package/dist/hooks/Maintenance_SourceMeta.d.ts +1 -1
- package/dist/hooks/Maintenance_SourceMeta.js +18 -18
- package/dist/hooks/Maintenance_Ticket.d.ts +1 -1
- package/dist/hooks/Maintenance_Ticket.js +18 -18
- package/dist/hooks/Maintenance_Ticket_Issuecategory.d.ts +1 -1
- package/dist/hooks/Maintenance_Ticket_Issuecategory.js +18 -18
- package/dist/hooks/Maintenance_Ticket_Kanban_State.d.ts +1 -1
- package/dist/hooks/Maintenance_Ticket_Kanban_State.js +23 -23
- package/dist/hooks/Maintenance_Ticket_Source.d.ts +1 -1
- package/dist/hooks/Maintenance_Ticket_Source.js +18 -18
- package/dist/hooks/Monitoring_Slideshow.d.ts +1 -1
- package/dist/hooks/Monitoring_Slideshow.js +17 -17
- package/dist/hooks/NavigationGroup.d.ts +1 -1
- package/dist/hooks/NavigationGroup.js +15 -15
- package/dist/hooks/NavigationItem.d.ts +1 -1
- package/dist/hooks/NavigationItem.js +16 -16
- package/dist/hooks/Notification.d.ts +1 -1
- package/dist/hooks/Notification.js +73 -73
- package/dist/hooks/Permission.d.ts +1 -1
- package/dist/hooks/Permission.js +19 -19
- package/dist/hooks/Push.d.ts +1 -1
- package/dist/hooks/Push.js +30 -30
- package/dist/hooks/Report.d.ts +1 -1
- package/dist/hooks/Report.js +16 -16
- package/dist/hooks/Share.d.ts +1 -1
- package/dist/hooks/Share.js +16 -16
- package/dist/hooks/Source.d.ts +1 -1
- package/dist/hooks/Source.js +91 -91
- package/dist/hooks/Tenant.d.ts +1 -1
- package/dist/hooks/Tenant.js +75 -75
- package/dist/hooks/TenantTrustedDomain.d.ts +1 -1
- package/dist/hooks/TenantTrustedDomain.js +12 -12
- package/dist/hooks/UserData.d.ts +1 -1
- package/dist/hooks/UserData.js +16 -16
- package/dist/hooks/VirtualKPI.d.ts +1 -1
- package/dist/hooks/VirtualKPI.js +18 -18
- package/dist/hooks/Widget.d.ts +1 -1
- package/dist/hooks/Widget.js +16 -16
- package/dist/hooks/WidgetPreset.d.ts +1 -1
- package/dist/hooks/WidgetPreset.js +18 -18
- package/dist/hooks/_User.d.ts +1 -1
- package/dist/hooks/_User.js +108 -108
- package/dist/hooks/_beforeLogin.d.ts +1 -1
- package/dist/hooks/_beforeLogin.js +22 -22
- package/dist/hooks/_init.d.ts +1 -1
- package/dist/hooks/_init.js +23 -23
- package/dist/index.d.ts +65 -65
- package/dist/index.js +399 -399
- package/dist/ow.d.ts +20 -20
- package/dist/ow.js +88 -91
- package/dist/types/Alarm.d.ts +36 -36
- package/dist/types/Alarm.js +59 -59
- package/dist/types/AlarmAction.d.ts +42 -42
- package/dist/types/AlarmAction.js +71 -71
- package/dist/types/AlarmWebhook.d.ts +40 -40
- package/dist/types/AlarmWebhook.js +65 -65
- package/dist/types/Attachment.d.ts +21 -21
- package/dist/types/Attachment.js +29 -29
- package/dist/types/BDE_Form.d.ts +26 -26
- package/dist/types/BDE_Form.js +41 -41
- package/dist/types/BDE_List.d.ts +14 -14
- package/dist/types/BDE_List.js +17 -17
- package/dist/types/BDE_ListEntry.d.ts +21 -21
- package/dist/types/BDE_ListEntry.js +29 -29
- package/dist/types/BDE_Page.d.ts +17 -17
- package/dist/types/BDE_Page.js +23 -23
- package/dist/types/BDE_Result.d.ts +20 -20
- package/dist/types/BDE_Result.js +29 -29
- package/dist/types/BDE_Unit.d.ts +23 -23
- package/dist/types/BDE_Unit.js +32 -32
- package/dist/types/Config.d.ts +24 -24
- package/dist/types/Config.js +35 -35
- package/dist/types/Core_Email.d.ts +26 -26
- package/dist/types/Core_Email.js +41 -41
- package/dist/types/Core_Token.d.ts +23 -23
- package/dist/types/Core_Token.js +35 -35
- package/dist/types/Dashboard.d.ts +34 -34
- package/dist/types/Dashboard.js +53 -53
- package/dist/types/GTFS_Agency.d.ts +39 -39
- package/dist/types/GTFS_Agency.js +65 -65
- package/dist/types/GTFS_Bikes_Allowed.d.ts +21 -21
- package/dist/types/GTFS_Bikes_Allowed.js +29 -29
- package/dist/types/GTFS_Calendar.d.ts +42 -42
- package/dist/types/GTFS_Calendar.js +71 -71
- package/dist/types/GTFS_Direction.d.ts +21 -21
- package/dist/types/GTFS_Direction.js +29 -29
- package/dist/types/GTFS_Level.d.ts +21 -21
- package/dist/types/GTFS_Level.js +29 -29
- package/dist/types/GTFS_Location_Type.d.ts +24 -24
- package/dist/types/GTFS_Location_Type.js +35 -35
- package/dist/types/GTFS_Route.d.ts +46 -46
- package/dist/types/GTFS_Route.js +77 -77
- package/dist/types/GTFS_Route_Type.d.ts +24 -24
- package/dist/types/GTFS_Route_Type.js +35 -35
- package/dist/types/GTFS_Stop.d.ts +60 -60
- package/dist/types/GTFS_Stop.js +101 -101
- package/dist/types/GTFS_Stop_Times.d.ts +32 -32
- package/dist/types/GTFS_Stop_Times.js +47 -47
- package/dist/types/GTFS_Trip.d.ts +41 -41
- package/dist/types/GTFS_Trip.js +59 -59
- package/dist/types/GTFS_Wheelchair_Accessible.d.ts +21 -21
- package/dist/types/GTFS_Wheelchair_Accessible.js +29 -29
- package/dist/types/GTFS_Wheelchair_Boarding.d.ts +24 -24
- package/dist/types/GTFS_Wheelchair_Boarding.js +35 -35
- package/dist/types/Group.d.ts +32 -32
- package/dist/types/Group.js +47 -47
- package/dist/types/Knowledge_Article.d.ts +29 -29
- package/dist/types/Knowledge_Article.js +41 -41
- package/dist/types/Knowledge_Category.d.ts +25 -25
- package/dist/types/Knowledge_Category.js +35 -35
- package/dist/types/Knowledge_Document.d.ts +29 -29
- package/dist/types/Knowledge_Document.js +41 -41
- package/dist/types/Knowledge_DocumentPage.d.ts +31 -31
- package/dist/types/Knowledge_DocumentPage.js +47 -47
- package/dist/types/Knowledge_Video.d.ts +35 -35
- package/dist/types/Knowledge_Video.js +53 -53
- package/dist/types/Language.d.ts +14 -14
- package/dist/types/Language.js +17 -17
- package/dist/types/Log.d.ts +17 -17
- package/dist/types/Log.js +23 -23
- package/dist/types/MIAAS_MDSEndpoint.d.ts +29 -29
- package/dist/types/MIAAS_MDSEndpoint.js +47 -47
- package/dist/types/Maintenance_Article.d.ts +32 -32
- package/dist/types/Maintenance_Article.js +44 -44
- package/dist/types/Maintenance_Downtime.d.ts +26 -26
- package/dist/types/Maintenance_Downtime.js +35 -35
- package/dist/types/Maintenance_Duedate.d.ts +35 -35
- package/dist/types/Maintenance_Duedate.js +53 -53
- package/dist/types/Maintenance_Frequency.d.ts +26 -26
- package/dist/types/Maintenance_Frequency.js +35 -35
- package/dist/types/Maintenance_Issuecategory.d.ts +36 -36
- package/dist/types/Maintenance_Issuecategory.js +56 -56
- package/dist/types/Maintenance_Item.d.ts +21 -21
- package/dist/types/Maintenance_Item.js +29 -29
- package/dist/types/Maintenance_Kanban_State.d.ts +33 -33
- package/dist/types/Maintenance_Kanban_State.js +53 -53
- package/dist/types/Maintenance_Media.d.ts +21 -21
- package/dist/types/Maintenance_Media.js +29 -29
- package/dist/types/Maintenance_Message.d.ts +27 -27
- package/dist/types/Maintenance_Message.js +41 -41
- package/dist/types/Maintenance_Message_Body.d.ts +22 -22
- package/dist/types/Maintenance_Message_Body.js +29 -29
- package/dist/types/Maintenance_Order.d.ts +24 -24
- package/dist/types/Maintenance_Order.js +32 -32
- package/dist/types/Maintenance_Priority.d.ts +26 -26
- package/dist/types/Maintenance_Priority.js +35 -35
- package/dist/types/Maintenance_Restriction.d.ts +26 -26
- package/dist/types/Maintenance_Restriction.js +35 -35
- package/dist/types/Maintenance_Schedule.d.ts +37 -37
- package/dist/types/Maintenance_Schedule.js +56 -56
- package/dist/types/Maintenance_Schedule_Execution.d.ts +39 -39
- package/dist/types/Maintenance_Schedule_Execution.js +56 -56
- package/dist/types/Maintenance_Schedule_Execution_Step.d.ts +44 -44
- package/dist/types/Maintenance_Schedule_Execution_Step.js +71 -71
- package/dist/types/Maintenance_Schedule_Step.d.ts +38 -38
- package/dist/types/Maintenance_Schedule_Step.js +59 -59
- package/dist/types/Maintenance_SourceMeta.d.ts +23 -23
- package/dist/types/Maintenance_SourceMeta.js +29 -29
- package/dist/types/Maintenance_Ticket.d.ts +30 -30
- package/dist/types/Maintenance_Ticket.js +41 -41
- package/dist/types/Maintenance_Ticket_Issuecategory.d.ts +27 -27
- package/dist/types/Maintenance_Ticket_Issuecategory.js +35 -35
- package/dist/types/Maintenance_Ticket_Kanban_State.d.ts +27 -27
- package/dist/types/Maintenance_Ticket_Kanban_State.js +35 -35
- package/dist/types/Maintenance_Ticket_Source.d.ts +27 -27
- package/dist/types/Maintenance_Ticket_Source.js +35 -35
- package/dist/types/Monitoring_Slideshow.d.ts +20 -20
- package/dist/types/Monitoring_Slideshow.js +26 -26
- package/dist/types/NavigationGroup.d.ts +24 -24
- package/dist/types/NavigationGroup.js +35 -35
- package/dist/types/NavigationItem.d.ts +48 -48
- package/dist/types/NavigationItem.js +83 -83
- package/dist/types/Notification.d.ts +30 -30
- package/dist/types/Notification.js +47 -47
- package/dist/types/Permission.d.ts +18 -18
- package/dist/types/Permission.js +23 -23
- package/dist/types/Push.d.ts +27 -27
- package/dist/types/Push.js +41 -41
- package/dist/types/Report.d.ts +39 -39
- package/dist/types/Report.js +65 -65
- package/dist/types/Share.d.ts +34 -34
- package/dist/types/Share.js +53 -53
- package/dist/types/Source.d.ts +26 -26
- package/dist/types/Source.js +38 -38
- package/dist/types/Tenant.d.ts +45 -45
- package/dist/types/Tenant.js +77 -77
- package/dist/types/TenantTrustedDomain.d.ts +18 -18
- package/dist/types/TenantTrustedDomain.js +23 -23
- package/dist/types/UserData.d.ts +21 -21
- package/dist/types/UserData.js +29 -29
- package/dist/types/VirtualKPI.d.ts +21 -21
- package/dist/types/VirtualKPI.js +29 -29
- package/dist/types/Widget.d.ts +24 -24
- package/dist/types/Widget.js +35 -35
- package/dist/types/WidgetPreset.d.ts +40 -40
- package/dist/types/WidgetPreset.js +65 -65
- package/dist/types/_Role.d.ts +13 -13
- package/dist/types/_Role.js +2 -2
- package/dist/types/_Session.d.ts +15 -15
- package/dist/types/_Session.js +2 -2
- package/dist/types/_User.d.ts +28 -28
- package/dist/types/_User.js +2 -2
- package/dist/types/index.d.ts +152 -152
- package/dist/types/index.js +150 -150
- package/package.json +1 -1
package/dist/hooks/_User.js
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.init = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
async function init() {
|
|
7
|
-
(0, __1.beforeSaveHook)(Parse.User, async (request) => {
|
|
8
|
-
const user = request.object;
|
|
9
|
-
const tenant = user.get("tenant");
|
|
10
|
-
const tenantId = tenant?.id;
|
|
11
|
-
user.set("username", user.get("username")?.toLowerCase());
|
|
12
|
-
if (tenant) {
|
|
13
|
-
await tenant.fetch({ useMasterKey: true });
|
|
14
|
-
}
|
|
15
|
-
user.set("tenantBanned", !!user.get("tenantBanned"));
|
|
16
|
-
user.set("tenantVerified", !!tenant && !!user.get("tenantVerified"));
|
|
17
|
-
if (!!tenant &&
|
|
18
|
-
!!user.get("emailVerified") &&
|
|
19
|
-
!user.get("tenantVerified")) {
|
|
20
|
-
const email = user.get("email");
|
|
21
|
-
const domains = await new Parse.Query(`${__1.PREFIX}TenantTrustedDomain`)
|
|
22
|
-
.equalTo("tenant", tenant)
|
|
23
|
-
.find({ useMasterKey: true });
|
|
24
|
-
for (const domain of domains) {
|
|
25
|
-
if (email?.endsWith("@" + domain.get("host"))) {
|
|
26
|
-
user.set("tenantVerified", true);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
user.set("tenantGlobal", !!tenant && !!user.get("tenantGlobal"));
|
|
31
|
-
if (tenant && request.original?.get("tenant")?.id !== tenant?.id) {
|
|
32
|
-
user.set("tenantGlobal", !!tenant.get("interactWithOtherTenants"));
|
|
33
|
-
}
|
|
34
|
-
user.set("tenantAdmin", !!user.get("tenantVerified") && !!user.get("tenantAdmin"));
|
|
35
|
-
user.set("tenantChanged", !!user.get("tenantChanged"));
|
|
36
|
-
if (user.get("tenantChanged")) {
|
|
37
|
-
user.set("tenantChanged", false);
|
|
38
|
-
if (!request.context) {
|
|
39
|
-
request.context = {};
|
|
40
|
-
}
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
request.context.tenantChanged = true;
|
|
43
|
-
}
|
|
44
|
-
// fetch user groups
|
|
45
|
-
const groups = user.id
|
|
46
|
-
? await new Parse.Query(types_1.Group)
|
|
47
|
-
.equalTo("users", user)
|
|
48
|
-
.equalTo("usersSeeEachOther", true)
|
|
49
|
-
.limit(1000000)
|
|
50
|
-
.find({ useMasterKey: true })
|
|
51
|
-
: [];
|
|
52
|
-
user.setACL(new Parse.ACL({
|
|
53
|
-
...(tenantId && {
|
|
54
|
-
[`role:od-tenant-user-${tenantId}`]: { read: true },
|
|
55
|
-
[`role:od-tenant-admin-${tenantId}`]: { read: true, write: true },
|
|
56
|
-
}),
|
|
57
|
-
...(user.get("tenantGlobal") && {
|
|
58
|
-
"role:od-tenant-global-visible": { read: true },
|
|
59
|
-
}),
|
|
60
|
-
...(user.id && {
|
|
61
|
-
[user.id]: { read: true },
|
|
62
|
-
}),
|
|
63
|
-
...Object.fromEntries(groups.map((group) => [
|
|
64
|
-
"role:od-group-user-" + group.id,
|
|
65
|
-
{ read: true },
|
|
66
|
-
])),
|
|
67
|
-
"role:od-admin": { read: true, write: true },
|
|
68
|
-
}));
|
|
69
|
-
});
|
|
70
|
-
(0, __1.afterSaveHook)(Parse.User, async (request) => {
|
|
71
|
-
const object = request.object;
|
|
72
|
-
const original = request.original;
|
|
73
|
-
const tenant = object.get("tenant");
|
|
74
|
-
if (tenant) {
|
|
75
|
-
await tenant.fetch({ useMasterKey: true });
|
|
76
|
-
}
|
|
77
|
-
const tenantId = object.get("tenant")?.id;
|
|
78
|
-
const prevTenantId = original?.get("tenant")?.id;
|
|
79
|
-
const tenantBanned = !!object.get("tenantBanned");
|
|
80
|
-
const isTenant = !!tenantId && !tenantBanned;
|
|
81
|
-
const wasTenant = !!prevTenantId;
|
|
82
|
-
const isAdmin = isTenant && !!object.get("tenantAdmin");
|
|
83
|
-
const wasAdmin = !!original?.get("tenantAdmin");
|
|
84
|
-
const isVerified = isTenant && !!object.get("tenantVerified");
|
|
85
|
-
const wasVerified = wasTenant && !!object.get("tenantVerified");
|
|
86
|
-
const isGlobal = isVerified && !!object.get("tenantGlobal");
|
|
87
|
-
const changedTenant = isTenant !== wasTenant || tenantId !== prevTenantId;
|
|
88
|
-
const changedAdmin = isAdmin !== wasAdmin;
|
|
89
|
-
const changedVerified = isVerified !== wasVerified;
|
|
90
|
-
const changedContext = !!request.context?.tenantChanged;
|
|
91
|
-
if (changedTenant || changedAdmin || changedVerified || changedContext) {
|
|
92
|
-
await (0, __1.ensureUserRole)(object, `od-user`, isTenant);
|
|
93
|
-
await (0, __1.ensureUserRole)(object, `od-tenant-user`, isTenant);
|
|
94
|
-
await (0, __1.ensureUserRole)(object, `od-tenant-verified`, isVerified);
|
|
95
|
-
await (0, __1.ensureUserRole)(object, `od-tenant-admin`, isAdmin);
|
|
96
|
-
await (0, __1.ensureUserRole)(object, `od-tenant-global-visible`, isGlobal);
|
|
97
|
-
if (tenantId) {
|
|
98
|
-
await (0, __1.ensureUserRole)(object, `od-tenant-user-${tenantId}`, true);
|
|
99
|
-
await (0, __1.ensureUserRole)(object, `od-tenant-admin-${tenantId}`, isAdmin);
|
|
100
|
-
}
|
|
101
|
-
if (wasTenant && tenantId !== prevTenantId) {
|
|
102
|
-
await (0, __1.ensureUserRole)(object, `od-tenant-user-${prevTenantId}`, false);
|
|
103
|
-
await (0, __1.ensureUserRole)(object, `od-tenant-admin-${prevTenantId}`, false);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
exports.init = init;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.init = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
async function init() {
|
|
7
|
+
(0, __1.beforeSaveHook)(Parse.User, async (request) => {
|
|
8
|
+
const user = request.object;
|
|
9
|
+
const tenant = user.get("tenant");
|
|
10
|
+
const tenantId = tenant?.id;
|
|
11
|
+
user.set("username", user.get("username")?.toLowerCase());
|
|
12
|
+
if (tenant) {
|
|
13
|
+
await tenant.fetch({ useMasterKey: true });
|
|
14
|
+
}
|
|
15
|
+
user.set("tenantBanned", !!user.get("tenantBanned"));
|
|
16
|
+
user.set("tenantVerified", !!tenant && !!user.get("tenantVerified"));
|
|
17
|
+
if (!!tenant &&
|
|
18
|
+
!!user.get("emailVerified") &&
|
|
19
|
+
!user.get("tenantVerified")) {
|
|
20
|
+
const email = user.get("email");
|
|
21
|
+
const domains = await new Parse.Query(`${__1.PREFIX}TenantTrustedDomain`)
|
|
22
|
+
.equalTo("tenant", tenant)
|
|
23
|
+
.find({ useMasterKey: true });
|
|
24
|
+
for (const domain of domains) {
|
|
25
|
+
if (email?.endsWith("@" + domain.get("host"))) {
|
|
26
|
+
user.set("tenantVerified", true);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
user.set("tenantGlobal", !!tenant && !!user.get("tenantGlobal"));
|
|
31
|
+
if (tenant && request.original?.get("tenant")?.id !== tenant?.id) {
|
|
32
|
+
user.set("tenantGlobal", !!tenant.get("interactWithOtherTenants"));
|
|
33
|
+
}
|
|
34
|
+
user.set("tenantAdmin", !!user.get("tenantVerified") && !!user.get("tenantAdmin"));
|
|
35
|
+
user.set("tenantChanged", !!user.get("tenantChanged"));
|
|
36
|
+
if (user.get("tenantChanged")) {
|
|
37
|
+
user.set("tenantChanged", false);
|
|
38
|
+
if (!request.context) {
|
|
39
|
+
request.context = {};
|
|
40
|
+
}
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
request.context.tenantChanged = true;
|
|
43
|
+
}
|
|
44
|
+
// fetch user groups
|
|
45
|
+
const groups = user.id
|
|
46
|
+
? await new Parse.Query(types_1.Group)
|
|
47
|
+
.equalTo("users", user)
|
|
48
|
+
.equalTo("usersSeeEachOther", true)
|
|
49
|
+
.limit(1000000)
|
|
50
|
+
.find({ useMasterKey: true })
|
|
51
|
+
: [];
|
|
52
|
+
user.setACL(new Parse.ACL({
|
|
53
|
+
...(tenantId && {
|
|
54
|
+
[`role:od-tenant-user-${tenantId}`]: { read: true },
|
|
55
|
+
[`role:od-tenant-admin-${tenantId}`]: { read: true, write: true },
|
|
56
|
+
}),
|
|
57
|
+
...(user.get("tenantGlobal") && {
|
|
58
|
+
"role:od-tenant-global-visible": { read: true },
|
|
59
|
+
}),
|
|
60
|
+
...(user.id && {
|
|
61
|
+
[user.id]: { read: true },
|
|
62
|
+
}),
|
|
63
|
+
...Object.fromEntries(groups.map((group) => [
|
|
64
|
+
"role:od-group-user-" + group.id,
|
|
65
|
+
{ read: true },
|
|
66
|
+
])),
|
|
67
|
+
"role:od-admin": { read: true, write: true },
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
(0, __1.afterSaveHook)(Parse.User, async (request) => {
|
|
71
|
+
const object = request.object;
|
|
72
|
+
const original = request.original;
|
|
73
|
+
const tenant = object.get("tenant");
|
|
74
|
+
if (tenant) {
|
|
75
|
+
await tenant.fetch({ useMasterKey: true });
|
|
76
|
+
}
|
|
77
|
+
const tenantId = object.get("tenant")?.id;
|
|
78
|
+
const prevTenantId = original?.get("tenant")?.id;
|
|
79
|
+
const tenantBanned = !!object.get("tenantBanned");
|
|
80
|
+
const isTenant = !!tenantId && !tenantBanned;
|
|
81
|
+
const wasTenant = !!prevTenantId;
|
|
82
|
+
const isAdmin = isTenant && !!object.get("tenantAdmin");
|
|
83
|
+
const wasAdmin = !!original?.get("tenantAdmin");
|
|
84
|
+
const isVerified = isTenant && !!object.get("tenantVerified");
|
|
85
|
+
const wasVerified = wasTenant && !!object.get("tenantVerified");
|
|
86
|
+
const isGlobal = isVerified && !!object.get("tenantGlobal");
|
|
87
|
+
const changedTenant = isTenant !== wasTenant || tenantId !== prevTenantId;
|
|
88
|
+
const changedAdmin = isAdmin !== wasAdmin;
|
|
89
|
+
const changedVerified = isVerified !== wasVerified;
|
|
90
|
+
const changedContext = !!request.context?.tenantChanged;
|
|
91
|
+
if (changedTenant || changedAdmin || changedVerified || changedContext) {
|
|
92
|
+
await (0, __1.ensureUserRole)(object, `od-user`, isTenant);
|
|
93
|
+
await (0, __1.ensureUserRole)(object, `od-tenant-user`, isTenant);
|
|
94
|
+
await (0, __1.ensureUserRole)(object, `od-tenant-verified`, isVerified);
|
|
95
|
+
await (0, __1.ensureUserRole)(object, `od-tenant-admin`, isAdmin);
|
|
96
|
+
await (0, __1.ensureUserRole)(object, `od-tenant-global-visible`, isGlobal);
|
|
97
|
+
if (tenantId) {
|
|
98
|
+
await (0, __1.ensureUserRole)(object, `od-tenant-user-${tenantId}`, true);
|
|
99
|
+
await (0, __1.ensureUserRole)(object, `od-tenant-admin-${tenantId}`, isAdmin);
|
|
100
|
+
}
|
|
101
|
+
if (wasTenant && tenantId !== prevTenantId) {
|
|
102
|
+
await (0, __1.ensureUserRole)(object, `od-tenant-user-${prevTenantId}`, false);
|
|
103
|
+
await (0, __1.ensureUserRole)(object, `od-tenant-admin-${prevTenantId}`, false);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
exports.init = init;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function init(): Promise<void>;
|
|
1
|
+
export declare function init(): Promise<void>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.init = void 0;
|
|
4
|
-
const config_1 = require("../config");
|
|
5
|
-
async function init() {
|
|
6
|
-
Parse.Cloud.beforeLogin(async ({ object }) => {
|
|
7
|
-
const verifyEmail = config_1.config.getBoolean("AUTH_VERIFY_EMAIL");
|
|
8
|
-
if (verifyEmail && !object.get("emailVerified")) {
|
|
9
|
-
throw new Parse.Error(-1, "OPENDASH_ACCOUNT_EMAIL_VERIFICATION");
|
|
10
|
-
}
|
|
11
|
-
if (object.get("tenant")) {
|
|
12
|
-
const verifyTenant = config_1.config.getBoolean("AUTH_VERIFY_TENANT");
|
|
13
|
-
if (verifyTenant && !object.get("tenantVerified")) {
|
|
14
|
-
throw new Parse.Error(-1, "OPENDASH_ACCOUNT_TENANT_VERIFICATION");
|
|
15
|
-
}
|
|
16
|
-
if (object.get("tenantBanned")) {
|
|
17
|
-
throw new Parse.Error(-1, "OPENDASH_ACCOUNT_BANNED");
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
exports.init = init;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.init = void 0;
|
|
4
|
+
const config_1 = require("../config");
|
|
5
|
+
async function init() {
|
|
6
|
+
Parse.Cloud.beforeLogin(async ({ object }) => {
|
|
7
|
+
const verifyEmail = config_1.config.getBoolean("AUTH_VERIFY_EMAIL");
|
|
8
|
+
if (verifyEmail && !object.get("emailVerified")) {
|
|
9
|
+
throw new Parse.Error(-1, "OPENDASH_ACCOUNT_EMAIL_VERIFICATION");
|
|
10
|
+
}
|
|
11
|
+
if (object.get("tenant")) {
|
|
12
|
+
const verifyTenant = config_1.config.getBoolean("AUTH_VERIFY_TENANT");
|
|
13
|
+
if (verifyTenant && !object.get("tenantVerified")) {
|
|
14
|
+
throw new Parse.Error(-1, "OPENDASH_ACCOUNT_TENANT_VERIFICATION");
|
|
15
|
+
}
|
|
16
|
+
if (object.get("tenantBanned")) {
|
|
17
|
+
throw new Parse.Error(-1, "OPENDASH_ACCOUNT_BANNED");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
exports.init = init;
|
package/dist/hooks/_init.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function init(): Promise<void>;
|
|
1
|
+
export declare function init(): Promise<void>;
|
package/dist/hooks/_init.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.init = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
async function init() {
|
|
9
|
-
const classNames = [
|
|
10
|
-
"_beforeLogin",
|
|
11
|
-
"_User",
|
|
12
|
-
...fs_1.default
|
|
13
|
-
.readdirSync(__dirname)
|
|
14
|
-
.filter((filename) => !filename.startsWith("_"))
|
|
15
|
-
.filter((filename) => filename.endsWith(".js"))
|
|
16
|
-
.map((filename) => filename.replace(".js", "")),
|
|
17
|
-
];
|
|
18
|
-
for (const name of classNames) {
|
|
19
|
-
const { init } = require(`./${name}`);
|
|
20
|
-
await init().catch((e) => console.error(e));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.init = init;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.init = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
async function init() {
|
|
9
|
+
const classNames = [
|
|
10
|
+
"_beforeLogin",
|
|
11
|
+
"_User",
|
|
12
|
+
...fs_1.default
|
|
13
|
+
.readdirSync(__dirname)
|
|
14
|
+
.filter((filename) => !filename.startsWith("_"))
|
|
15
|
+
.filter((filename) => filename.endsWith(".js"))
|
|
16
|
+
.map((filename) => filename.replace(".js", "")),
|
|
17
|
+
];
|
|
18
|
+
for (const name of classNames) {
|
|
19
|
+
const { init } = require(`./${name}`);
|
|
20
|
+
await init().catch((e) => console.error(e));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.init = init;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import type { Cloud as ParseCloud } from "parse";
|
|
2
|
-
export { Config } from "./helper/Config";
|
|
3
|
-
export { sendSimpleEmail, sendTemplateEmail } from "./hooks/Core_Email";
|
|
4
|
-
export declare let PREFIX: string;
|
|
5
|
-
export interface ConfigInterface {
|
|
6
|
-
configPath?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function init(): Promise<void>;
|
|
9
|
-
export declare function hasPermission(sessionToken: string, key: string): Promise<boolean>;
|
|
10
|
-
export declare function requirePermission(request: {
|
|
11
|
-
master?: boolean;
|
|
12
|
-
sessionToken: string | undefined;
|
|
13
|
-
}, key: string | null, message: string): Promise<void>;
|
|
14
|
-
export declare function getConfig(key: string): Promise<string | undefined>;
|
|
15
|
-
export declare function getConfigBoolean(key: string): Promise<boolean>;
|
|
16
|
-
export declare function ensureRole(name: string, options?: {
|
|
17
|
-
label?: string;
|
|
18
|
-
acl?: Parse.ACL;
|
|
19
|
-
childRoles?: string[];
|
|
20
|
-
}): Promise<void>;
|
|
21
|
-
export declare function ensureUserRole(user: Parse.User, roleName: string, add?: boolean): Promise<void>;
|
|
22
|
-
export declare function immutableField(request: {
|
|
23
|
-
original?: Parse.Object;
|
|
24
|
-
object: Parse.Object;
|
|
25
|
-
master?: boolean;
|
|
26
|
-
sessionToken: string | undefined;
|
|
27
|
-
}, fieldName: string, permissionName?: string | null): Promise<void>;
|
|
28
|
-
export declare function defaultHandler(request: {
|
|
29
|
-
original?: Parse.Object;
|
|
30
|
-
object: Parse.Object;
|
|
31
|
-
user?: Parse.User;
|
|
32
|
-
master?: boolean;
|
|
33
|
-
sessionToken: string | undefined;
|
|
34
|
-
}): Promise<void>;
|
|
35
|
-
export declare function defaultAclHandler(request: Parse.Cloud.BeforeSaveRequest, options?: {
|
|
36
|
-
allowCustomACL?: boolean;
|
|
37
|
-
allowTenantUserWrite?: boolean;
|
|
38
|
-
denyTenantUserRead?: boolean;
|
|
39
|
-
}): Promise<void>;
|
|
40
|
-
type beforeSaveHookType<T extends Parse.Object<Parse.Attributes>> = (request: ParseCloud.BeforeSaveRequest<T> & {
|
|
41
|
-
sessionToken: string | undefined;
|
|
42
|
-
}) => Promise<void>;
|
|
43
|
-
export declare function beforeSaveHook<T extends Parse.Object<Parse.Attributes>>(target: string | {
|
|
44
|
-
new (): T;
|
|
45
|
-
}, callback: beforeSaveHookType<T>): void;
|
|
46
|
-
type afterSaveHookType<T extends Parse.Object<Parse.Attributes>> = (request: ParseCloud.AfterSaveRequest<T> & {
|
|
47
|
-
sessionToken: string | undefined;
|
|
48
|
-
}) => Promise<void>;
|
|
49
|
-
export declare function afterSaveHook<T extends Parse.Object<Parse.Attributes>>(target: string | {
|
|
50
|
-
new (): T;
|
|
51
|
-
}, callback: afterSaveHookType<T>): void;
|
|
52
|
-
type beforeDeleteHookType<T extends Parse.Object<Parse.Attributes>> = (request: ParseCloud.BeforeDeleteRequest<T> & {
|
|
53
|
-
sessionToken: string | undefined;
|
|
54
|
-
}) => Promise<void>;
|
|
55
|
-
export declare function beforeDeleteHook<T extends Parse.Object<Parse.Attributes>>(target: string | {
|
|
56
|
-
new (): T;
|
|
57
|
-
}, callback: beforeDeleteHookType<T>): void;
|
|
58
|
-
type afterDeleteHookType<T extends Parse.Object<Parse.Attributes>> = (request: ParseCloud.AfterDeleteRequest<T> & {
|
|
59
|
-
sessionToken: string | undefined;
|
|
60
|
-
}) => Promise<void>;
|
|
61
|
-
export declare function afterDeleteHook<T extends Parse.Object<Parse.Attributes>>(target: string | {
|
|
62
|
-
new (): T;
|
|
63
|
-
}, callback: afterDeleteHookType<T>): void;
|
|
64
|
-
export declare function autoloadCloudCode(path: string, regex?: RegExp): Promise<void>;
|
|
65
|
-
export declare function initAutoload(): Promise<void>;
|
|
1
|
+
import type { Cloud as ParseCloud } from "parse";
|
|
2
|
+
export { Config } from "./helper/Config";
|
|
3
|
+
export { sendSimpleEmail, sendTemplateEmail } from "./hooks/Core_Email";
|
|
4
|
+
export declare let PREFIX: string;
|
|
5
|
+
export interface ConfigInterface {
|
|
6
|
+
configPath?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function init(): Promise<void>;
|
|
9
|
+
export declare function hasPermission(sessionToken: string, key: string): Promise<boolean>;
|
|
10
|
+
export declare function requirePermission(request: {
|
|
11
|
+
master?: boolean;
|
|
12
|
+
sessionToken: string | undefined;
|
|
13
|
+
}, key: string | null, message: string): Promise<void>;
|
|
14
|
+
export declare function getConfig(key: string): Promise<string | undefined>;
|
|
15
|
+
export declare function getConfigBoolean(key: string): Promise<boolean>;
|
|
16
|
+
export declare function ensureRole(name: string, options?: {
|
|
17
|
+
label?: string;
|
|
18
|
+
acl?: Parse.ACL;
|
|
19
|
+
childRoles?: string[];
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
export declare function ensureUserRole(user: Parse.User, roleName: string, add?: boolean): Promise<void>;
|
|
22
|
+
export declare function immutableField(request: {
|
|
23
|
+
original?: Parse.Object;
|
|
24
|
+
object: Parse.Object;
|
|
25
|
+
master?: boolean;
|
|
26
|
+
sessionToken: string | undefined;
|
|
27
|
+
}, fieldName: string, permissionName?: string | null): Promise<void>;
|
|
28
|
+
export declare function defaultHandler(request: {
|
|
29
|
+
original?: Parse.Object;
|
|
30
|
+
object: Parse.Object;
|
|
31
|
+
user?: Parse.User;
|
|
32
|
+
master?: boolean;
|
|
33
|
+
sessionToken: string | undefined;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
export declare function defaultAclHandler(request: Parse.Cloud.BeforeSaveRequest, options?: {
|
|
36
|
+
allowCustomACL?: boolean;
|
|
37
|
+
allowTenantUserWrite?: boolean;
|
|
38
|
+
denyTenantUserRead?: boolean;
|
|
39
|
+
}): Promise<void>;
|
|
40
|
+
type beforeSaveHookType<T extends Parse.Object<Parse.Attributes>> = (request: ParseCloud.BeforeSaveRequest<T> & {
|
|
41
|
+
sessionToken: string | undefined;
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
export declare function beforeSaveHook<T extends Parse.Object<Parse.Attributes>>(target: string | {
|
|
44
|
+
new (): T;
|
|
45
|
+
}, callback: beforeSaveHookType<T>): void;
|
|
46
|
+
type afterSaveHookType<T extends Parse.Object<Parse.Attributes>> = (request: ParseCloud.AfterSaveRequest<T> & {
|
|
47
|
+
sessionToken: string | undefined;
|
|
48
|
+
}) => Promise<void>;
|
|
49
|
+
export declare function afterSaveHook<T extends Parse.Object<Parse.Attributes>>(target: string | {
|
|
50
|
+
new (): T;
|
|
51
|
+
}, callback: afterSaveHookType<T>): void;
|
|
52
|
+
type beforeDeleteHookType<T extends Parse.Object<Parse.Attributes>> = (request: ParseCloud.BeforeDeleteRequest<T> & {
|
|
53
|
+
sessionToken: string | undefined;
|
|
54
|
+
}) => Promise<void>;
|
|
55
|
+
export declare function beforeDeleteHook<T extends Parse.Object<Parse.Attributes>>(target: string | {
|
|
56
|
+
new (): T;
|
|
57
|
+
}, callback: beforeDeleteHookType<T>): void;
|
|
58
|
+
type afterDeleteHookType<T extends Parse.Object<Parse.Attributes>> = (request: ParseCloud.AfterDeleteRequest<T> & {
|
|
59
|
+
sessionToken: string | undefined;
|
|
60
|
+
}) => Promise<void>;
|
|
61
|
+
export declare function afterDeleteHook<T extends Parse.Object<Parse.Attributes>>(target: string | {
|
|
62
|
+
new (): T;
|
|
63
|
+
}, callback: afterDeleteHookType<T>): void;
|
|
64
|
+
export declare function autoloadCloudCode(path: string, regex?: RegExp): Promise<void>;
|
|
65
|
+
export declare function initAutoload(): Promise<void>;
|