mirror of
https://github.com/strapi/strapi.git
synced 2025-07-14 20:41:51 +00:00
129 lines
2.1 KiB
TypeScript
129 lines
2.1 KiB
TypeScript
![]() |
import { errors } from '@strapi/utils';
|
||
|
import type { Webhook } from '@strapi/types';
|
||
|
|
||
|
/**
|
||
|
* GET /webhooks - List all webhooks
|
||
|
*/
|
||
|
export declare namespace ListWebhooks {
|
||
|
export interface Request {
|
||
|
body: {};
|
||
|
query: {};
|
||
|
}
|
||
|
|
||
|
export interface Response {
|
||
|
data: Webhook[];
|
||
|
error?: errors.ApplicationError;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* GET /webhooks/:id - Get a webhook
|
||
|
*/
|
||
|
export declare namespace GetWebhook {
|
||
|
export interface Request {
|
||
|
body: {};
|
||
|
query: {};
|
||
|
}
|
||
|
|
||
|
export interface Params {
|
||
|
id: string;
|
||
|
}
|
||
|
|
||
|
export interface Response {
|
||
|
data: Webhook;
|
||
|
error?: errors.ApplicationError;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* POST /webhooks - Create a webhook
|
||
|
*/
|
||
|
export declare namespace CreateWebhook {
|
||
|
export interface Request {
|
||
|
body: Webhook;
|
||
|
query: {};
|
||
|
}
|
||
|
|
||
|
export interface Response {
|
||
|
data: Webhook;
|
||
|
error?: errors.ApplicationError | errors.YupValidationError;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* PUT /webhooks/:id - Update a webhook
|
||
|
*/
|
||
|
export declare namespace UpdateWebhook {
|
||
|
export interface Request {
|
||
|
body: Partial<Webhook>;
|
||
|
query: {};
|
||
|
}
|
||
|
|
||
|
export interface Params {
|
||
|
id: string;
|
||
|
}
|
||
|
|
||
|
export interface Response {
|
||
|
data: Webhook;
|
||
|
error?: errors.ApplicationError | errors.YupValidationError;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* DELETE /webhooks/:id - Delete a webhook
|
||
|
*/
|
||
|
export declare namespace DeleteWebhook {
|
||
|
export interface Request {
|
||
|
body: {};
|
||
|
query: {};
|
||
|
}
|
||
|
|
||
|
export interface Params {
|
||
|
id: string;
|
||
|
}
|
||
|
|
||
|
export interface Response {
|
||
|
data: Webhook;
|
||
|
error?: errors.ApplicationError;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* POST /webhooks/batch-delete' - Delete multiple webhooks
|
||
|
*/
|
||
|
export declare namespace DeleteWebhooks {
|
||
|
export interface Request {
|
||
|
body: {
|
||
|
ids: string[];
|
||
|
};
|
||
|
query: {};
|
||
|
}
|
||
|
|
||
|
export interface Response {
|
||
|
data: {};
|
||
|
error?: errors.ApplicationError;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* POST /webhooks/:id/trigger - Trigger a webhook
|
||
|
*/
|
||
|
export declare namespace TriggerWebhook {
|
||
|
export interface Request {
|
||
|
body: {};
|
||
|
query: {};
|
||
|
}
|
||
|
|
||
|
export interface Params {
|
||
|
id: string;
|
||
|
}
|
||
|
|
||
|
export interface Response {
|
||
|
data: {
|
||
|
statusCode: number;
|
||
|
message?: string;
|
||
|
};
|
||
|
error?: errors.ApplicationError;
|
||
|
}
|
||
|
}
|