|
|
@ -7,6 +7,7 @@ import { |
|
|
|
import Noco from '../Noco'; |
|
|
|
import Noco from '../Noco'; |
|
|
|
import NocoCache from '../cache/NocoCache'; |
|
|
|
import NocoCache from '../cache/NocoCache'; |
|
|
|
import { extractProps } from '../meta/helpers/extractProps'; |
|
|
|
import { extractProps } from '../meta/helpers/extractProps'; |
|
|
|
|
|
|
|
import { NcError } from '../meta/helpers/catchError'; |
|
|
|
import Model from './Model'; |
|
|
|
import Model from './Model'; |
|
|
|
import Filter from './Filter'; |
|
|
|
import Filter from './Filter'; |
|
|
|
import HookFilter from './HookFilter'; |
|
|
|
import HookFilter from './HookFilter'; |
|
|
@ -187,8 +188,18 @@ export default class Hook implements HookType { |
|
|
|
'retry_interval', |
|
|
|
'retry_interval', |
|
|
|
'timeout', |
|
|
|
'timeout', |
|
|
|
'active', |
|
|
|
'active', |
|
|
|
|
|
|
|
'version', |
|
|
|
]); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
updateObj.version && |
|
|
|
|
|
|
|
updateObj.operation && |
|
|
|
|
|
|
|
updateObj.version === 'v1' && |
|
|
|
|
|
|
|
['bulkInsert', 'bulkUpdate', 'bulkDelete'].includes(updateObj.operation) |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
NcError.badRequest(`${updateObj.operation} not supported in v1 hook`); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (updateObj.notification && typeof updateObj.notification === 'object') { |
|
|
|
if (updateObj.notification && typeof updateObj.notification === 'object') { |
|
|
|
updateObj.notification = JSON.stringify(updateObj.notification); |
|
|
|
updateObj.notification = JSON.stringify(updateObj.notification); |
|
|
|
} |
|
|
|
} |
|
|
|