2023-11-16 16:38:15 +01:00
|
|
|
import { errors } from '@strapi/utils';
|
|
|
|
import type { Webhook } from '@strapi/types';
|
|
|
|
|
|
|
|
/**
|
2023-11-21 11:40:51 +00:00
|
|
|
* /webhooks - GET all webhooks
|
2023-11-16 16:38:15 +01:00
|
|
|
*/
|
2023-11-21 11:40:51 +00:00
|
|
|
export declare namespace GetWebhooks {
|
2023-11-16 16:38:15 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|