webhook.ts 979 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import type { IUser } from "../auth/User"
  2. import type { TResType } from "../discussion/DiscussionListCard"
  3. import type { IWebhookEvent } from "../webhook/WebhookTpl"
  4. export type TReceiverType = "wechat" | "dingtalk";
  5. export interface IWebhookRequest {
  6. res_type: TResType;
  7. res_id: string;
  8. url: string;
  9. receiver: TReceiverType;
  10. event?: string[] | null;
  11. event2?: IWebhookEvent[] | null;
  12. status?: string;
  13. }
  14. export interface IWebhookApiData {
  15. id: string;
  16. res_type: TResType;
  17. res_id: string;
  18. url: string;
  19. receiver: TReceiverType;
  20. event: string[] | null;
  21. event2?: IWebhookEvent[] | null;
  22. fail: number;
  23. success: number;
  24. status: string;
  25. editor: IUser;
  26. created_at: string | null;
  27. updated_at: string | null;
  28. }
  29. export interface IWebhookResponse {
  30. ok: boolean;
  31. message: string;
  32. data: IWebhookApiData;
  33. }
  34. export interface IWebhookListResponse {
  35. ok: boolean;
  36. message: string;
  37. data: {
  38. rows: IWebhookApiData[];
  39. count: number;
  40. };
  41. }