|
|
@ -9,6 +9,7 @@ import Model from '../../models/Model'; |
|
|
|
import populateSamplePayload from '../helpers/populateSamplePayload'; |
|
|
|
import populateSamplePayload from '../helpers/populateSamplePayload'; |
|
|
|
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
|
|
|
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
|
|
|
import { metaApiMetrics } from '../helpers/apiMetrics'; |
|
|
|
import { metaApiMetrics } from '../helpers/apiMetrics'; |
|
|
|
|
|
|
|
import { getAjvValidatorMw } from './helpers' |
|
|
|
|
|
|
|
|
|
|
|
export async function hookList( |
|
|
|
export async function hookList( |
|
|
|
req: Request<any, any, any>, |
|
|
|
req: Request<any, any, any>, |
|
|
@ -85,11 +86,13 @@ router.get( |
|
|
|
router.post( |
|
|
|
router.post( |
|
|
|
'/api/v1/db/meta/tables/:tableId/hooks/test', |
|
|
|
'/api/v1/db/meta/tables/:tableId/hooks/test', |
|
|
|
metaApiMetrics, |
|
|
|
metaApiMetrics, |
|
|
|
|
|
|
|
getAjvValidatorMw('swagger.json#/components/schemas/HookTestReq'), |
|
|
|
ncMetaAclMw(hookTest, 'hookTest') |
|
|
|
ncMetaAclMw(hookTest, 'hookTest') |
|
|
|
); |
|
|
|
); |
|
|
|
router.post( |
|
|
|
router.post( |
|
|
|
'/api/v1/db/meta/tables/:tableId/hooks', |
|
|
|
'/api/v1/db/meta/tables/:tableId/hooks', |
|
|
|
metaApiMetrics, |
|
|
|
metaApiMetrics, |
|
|
|
|
|
|
|
getAjvValidatorMw('swagger.json#/components/schemas/HookReq'), |
|
|
|
ncMetaAclMw(hookCreate, 'hookCreate') |
|
|
|
ncMetaAclMw(hookCreate, 'hookCreate') |
|
|
|
); |
|
|
|
); |
|
|
|
router.delete( |
|
|
|
router.delete( |
|
|
@ -100,6 +103,7 @@ router.delete( |
|
|
|
router.patch( |
|
|
|
router.patch( |
|
|
|
'/api/v1/db/meta/hooks/:hookId', |
|
|
|
'/api/v1/db/meta/hooks/:hookId', |
|
|
|
metaApiMetrics, |
|
|
|
metaApiMetrics, |
|
|
|
|
|
|
|
getAjvValidatorMw('swagger.json#/components/schemas/HookReq'), |
|
|
|
ncMetaAclMw(hookUpdate, 'hookUpdate') |
|
|
|
ncMetaAclMw(hookUpdate, 'hookUpdate') |
|
|
|
); |
|
|
|
); |
|
|
|
router.get( |
|
|
|
router.get( |
|
|
|