MCPcopy Index your code
hub / github.com/parse-community/parse-server / maybeRunGlobalConfigTrigger

Function maybeRunGlobalConfigTrigger

src/triggers.js:1113–1146  ·  view source on GitHub ↗
(triggerType, auth, configObject, originalConfigObject, config, context)

Source from the content-addressed store, hash-verified

1111}
1112
1113export async function maybeRunGlobalConfigTrigger(triggerType, auth, configObject, originalConfigObject, config, context) {
1114 const GlobalConfigClassName = getClassName(Parse.Config);
1115 const configTrigger = getTrigger(GlobalConfigClassName, triggerType, config.applicationId);
1116 if (typeof configTrigger === 'function') {
1117 try {
1118 const request = getRequestObject(triggerType, auth, configObject, originalConfigObject, config, context);
1119 await maybeRunValidator(request, `${triggerType}.${GlobalConfigClassName}`, auth);
1120 if (request.skipWithMasterKey) {
1121 return configObject;
1122 }
1123 const result = await configTrigger(request);
1124 logTriggerSuccessBeforeHook(
1125 triggerType,
1126 'Parse.Config',
1127 configObject,
1128 result,
1129 auth,
1130 config.logLevels.triggerBeforeSuccess
1131 );
1132 return result || configObject;
1133 } catch (error) {
1134 logTriggerErrorBeforeHook(
1135 triggerType,
1136 'Parse.Config',
1137 configObject,
1138 auth,
1139 error,
1140 config.logLevels.triggerBeforeError
1141 );
1142 throw error;
1143 }
1144 }
1145 return configObject;
1146}

Callers

nothing calls this directly

Calls 6

getClassNameFunction · 0.85
getTriggerFunction · 0.85
getRequestObjectFunction · 0.85
maybeRunValidatorFunction · 0.85

Tested by

no test coverage detected