2018-10-02 00:21:48 +00:00
|
|
|
module.exports = function(s,config){
|
|
|
|
s.cloudDiskUseStartupExtensions = {}
|
2020-06-15 14:53:08 +00:00
|
|
|
s.cloudDiskUseOnGetVideoDataExtensions = {}
|
2022-07-03 21:09:56 +00:00
|
|
|
function createExtension(nameOfExtension,nameOfExtensionContainer,objective){
|
2022-07-03 20:50:53 +00:00
|
|
|
nameOfExtensionContainer = nameOfExtensionContainer || `${nameOfExtension}Extensions`
|
2022-07-03 21:09:56 +00:00
|
|
|
if(objective){
|
|
|
|
s[nameOfExtensionContainer] = []
|
|
|
|
s[nameOfExtension] = function(nameOfCallback,callback){
|
|
|
|
s[nameOfExtensionContainer][nameOfCallback] = callback
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
s[nameOfExtensionContainer] = []
|
|
|
|
s[nameOfExtension] = function(callback){
|
|
|
|
s[nameOfExtensionContainer].push(callback)
|
|
|
|
}
|
2022-07-03 20:50:53 +00:00
|
|
|
}
|
2018-10-02 00:21:48 +00:00
|
|
|
}
|
2022-07-03 20:50:53 +00:00
|
|
|
////// USER //////
|
|
|
|
createExtension(`onSocketAuthentication`)
|
|
|
|
createExtension(`onUserLog`)
|
|
|
|
createExtension(`loadGroupExtender`,`loadGroupExtensions`)
|
|
|
|
createExtension(`loadGroupAppExtender`,`loadGroupAppExtensions`)
|
|
|
|
createExtension(`unloadGroupAppExtender`,`unloadGroupAppExtensions`)
|
|
|
|
createExtension(`onAccountSave`)
|
|
|
|
createExtension(`beforeAccountSave`)
|
|
|
|
createExtension(`onTwoFactorAuthCodeNotification`)
|
|
|
|
createExtension(`onStalePurgeLock`)
|
|
|
|
////// EVENTS //////
|
|
|
|
createExtension(`onEventTrigger`)
|
|
|
|
createExtension(`onEventTriggerBeforeFilter`)
|
|
|
|
createExtension(`onFilterEvent`)
|
2018-10-03 00:52:49 +00:00
|
|
|
////// MONITOR //////
|
2022-07-03 20:50:53 +00:00
|
|
|
createExtension(`onMonitorInit`)
|
|
|
|
createExtension(`onMonitorStart`)
|
|
|
|
createExtension(`onMonitorStop`)
|
|
|
|
createExtension(`onMonitorSave`)
|
|
|
|
createExtension(`onMonitorUnexpectedExit`)
|
|
|
|
createExtension(`onDetectorNoTriggerTimeout`)
|
|
|
|
createExtension(`onFfmpegCameraStringCreation`)
|
|
|
|
createExtension(`onFfmpegBuildMainStream`)
|
|
|
|
createExtension(`onFfmpegBuildStreamChannel`)
|
|
|
|
createExtension(`onMonitorPingFailed`)
|
|
|
|
createExtension(`onMonitorDied`)
|
|
|
|
createExtension(`onMonitorCreateStreamPipe`)
|
2018-12-12 22:56:29 +00:00
|
|
|
///////// SYSTEM ////////
|
2022-07-03 20:50:53 +00:00
|
|
|
createExtension(`onProcessReady`)
|
|
|
|
createExtension(`onProcessExit`)
|
|
|
|
createExtension(`onBeforeDatabaseLoad`)
|
|
|
|
createExtension(`onFFmpegLoaded`)
|
|
|
|
createExtension(`beforeMonitorsLoadedOnStartup`)
|
|
|
|
createExtension(`onWebSocketConnection`)
|
|
|
|
createExtension(`onWebSocketDisconnection`)
|
|
|
|
createExtension(`onWebsocketMessageSend`)
|
|
|
|
createExtension(`onOtherWebSocketMessages`)
|
|
|
|
createExtension(`onGetCpuUsage`)
|
|
|
|
createExtension(`onGetRamUsage`)
|
|
|
|
createExtension(`onSubscriptionCheck`)
|
|
|
|
createExtension(`onDataPortMessage`)
|
2022-07-03 21:52:30 +00:00
|
|
|
createExtension(`onHttpRequestUpgrade`,null,true)
|
2019-05-05 20:30:07 +00:00
|
|
|
/////// VIDEOS ////////
|
2022-07-03 20:50:53 +00:00
|
|
|
createExtension(`insertCompletedVideoExtender`,`insertCompletedVideoExtensions`)
|
2022-10-12 03:14:59 +00:00
|
|
|
createExtension(`onEventBasedRecordingComplete`)
|
2022-07-03 20:50:53 +00:00
|
|
|
createExtension(`onBeforeInsertCompletedVideo`)
|
2019-05-05 20:30:07 +00:00
|
|
|
/////// TIMELAPSE ////////
|
2022-07-03 20:50:53 +00:00
|
|
|
createExtension(`onInsertTimelapseFrame`)
|
2018-10-02 00:21:48 +00:00
|
|
|
}
|