typings.d.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. declare namespace API {
  2. type AgentNode = {
  3. appAgentId: string
  4. creationTime: string
  5. creatorUserId: string
  6. data: NodeData
  7. height?: number
  8. id: string
  9. isDeleted?: boolean
  10. position: { x: number; y: number }
  11. selected?: boolean
  12. type: 'custom' | 'start' | 'end' | 'condition' | 'task' | 'http-request'
  13. updateTime?: string
  14. width?: number
  15. zIndex?: number
  16. }
  17. type HttpHeader = {
  18. name: string
  19. value: string
  20. }
  21. type NodeData = {
  22. outputs: {
  23. name: string
  24. describe: string
  25. type: 'string' | 'number' | 'boolean' | 'object' | 'array'
  26. }[]
  27. output_can_alter?: boolean
  28. variables?: string[]
  29. method: 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'options'
  30. ssl_verify?: boolean
  31. isInIteration?: boolean
  32. default_value?: string[]
  33. body?: RequestBody
  34. params?: string[]
  35. title: string
  36. type: 'http-request' | 'condition' | 'task'
  37. error_strategy?: 'none' | 'retry' | 'abort' | 'continue'
  38. retry_config?: { max_retries: number; retry_enabled: boolean; retry_interval: number }
  39. url: string
  40. authorization?: {
  41. type: 'none' | 'bearer' | 'basic' | 'api-key'
  42. config: { api_key?: string; header?: string; type?: string }
  43. }
  44. timeout_config?: {
  45. max_write_timeout: number
  46. max_read_timeout: number
  47. max_connect_timeout: number
  48. }
  49. heads?: HttpHeader[]
  50. selected?: boolean
  51. desc?: string
  52. isInLoop?: boolean
  53. }
  54. type postAgentGetAgentListParams = {
  55. pageIndex: number
  56. }
  57. type RequestBody = {
  58. data: RequestDataItem[]
  59. type: 'json' | 'form-data' | 'x-www-form-urlencoded' | 'raw' | 'binary'
  60. }
  61. type RequestDataItem = {
  62. type: 'text' | 'file' | 'json'
  63. value: string
  64. key?: string
  65. }
  66. }