Adds Hooks API

Adds Parse.Hooks.js in src/cloud-code/Parse.Hooks.js
Moves Cloud code related functions in src/cloud-code
This commit is contained in:
Florent Vilmart
2016-02-05 14:38:09 -05:00
parent a7262dafd8
commit 9ac7a52e40
19 changed files with 1121 additions and 104 deletions

View File

@@ -134,7 +134,7 @@ RestWrite.prototype.runBeforeTrigger = function() {
return Promise.resolve().then(() => {
return triggers.maybeRunTrigger(
'beforeSave', this.auth, updatedObject, originalObject);
'beforeSave', this.auth, updatedObject, originalObject, this.config.applicationId);
}).then((response) => {
if (response && response.object) {
this.data = response.object;
@@ -294,7 +294,7 @@ RestWrite.prototype.handleOAuthAuthData = function(provider) {
if (!validateAuthData || !validateAppId) {
return false;
};
return validateAuthData(authData, oauthOptions)
.then(() => {
if (appIds && typeof validateAppId === "function") {
@@ -789,7 +789,7 @@ RestWrite.prototype.runAfterTrigger = function() {
originalObject = triggers.inflate(extraData, this.originalData);
}
triggers.maybeRunTrigger('afterSave', this.auth, inflatedObject, originalObject);
triggers.maybeRunTrigger('afterSave', this.auth, inflatedObject, originalObject, this.config.applicationId);
};
// A helper to figure out what location this operation happens at.