typings.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 RequestBody = {
  55. data: RequestDataItem[]
  56. type: 'json' | 'form-data' | 'x-www-form-urlencoded' | 'raw' | 'binary'
  57. }
  58. type RequestDataItem = {
  59. type: 'text' | 'file' | 'json'
  60. value: string
  61. key?: string
  62. }
  63. }