webhook.ts 984 B

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