(triggerType, auth, configObject, originalConfigObject, config, context)
| 1111 | } |
| 1112 | |
| 1113 | export 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 | } |
nothing calls this directly
no test coverage detected