(triggerType, auth, fileObject, config)
| 1040 | } |
| 1041 | |
| 1042 | export function getRequestFileObject(triggerType, auth, fileObject, config) { |
| 1043 | const request = { |
| 1044 | ...fileObject, |
| 1045 | triggerName: triggerType, |
| 1046 | master: false, |
| 1047 | isReadOnly: false, |
| 1048 | log: config.loggerController, |
| 1049 | headers: config.headers, |
| 1050 | ip: config.ip, |
| 1051 | config, |
| 1052 | }; |
| 1053 | |
| 1054 | if (!auth) { |
| 1055 | return request; |
| 1056 | } |
| 1057 | if (auth.isMaster) { |
| 1058 | request['master'] = true; |
| 1059 | } |
| 1060 | if (auth.isReadOnly) { |
| 1061 | request['isReadOnly'] = true; |
| 1062 | } |
| 1063 | if (auth.user) { |
| 1064 | request['user'] = auth.user; |
| 1065 | } |
| 1066 | if (auth.installationId) { |
| 1067 | request['installationId'] = auth.installationId; |
| 1068 | } |
| 1069 | return request; |
| 1070 | } |
| 1071 | |
| 1072 | export async function maybeRunFileTrigger(triggerType, fileObject, config, auth) { |
| 1073 | const FileClassName = getClassName(Parse.File); |
no outgoing calls
no test coverage detected