storageProvider.ts 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. // @ts-ignore
  2. /* eslint-disable */
  3. import request from '@repo/api-client'
  4. /** 检查存储引擎连通性 POST /api/ai/storage-provider/check */
  5. export async function postStorageProviderCheck(
  6. body: {
  7. provider: string
  8. config: {
  9. access_key_id: string
  10. bucket_name: string
  11. endpoint: string
  12. mode: string
  13. path_prefix: string
  14. provider: string
  15. secret_access_key: string
  16. use_ssl: boolean
  17. }
  18. },
  19. options?: { [key: string]: any }
  20. ) {
  21. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  22. '/api/ai/storage-provider/check',
  23. {
  24. method: 'POST',
  25. headers: {
  26. 'Content-Type': 'application/json'
  27. },
  28. data: body,
  29. ...(options || {})
  30. }
  31. )
  32. }
  33. /** 获取配置信息 POST /api/ai/storage-provider/config */
  34. export async function postStorageProviderConfig(
  35. body: {
  36. name: string
  37. },
  38. options?: { [key: string]: any }
  39. ) {
  40. return request<{
  41. isSuccess: boolean
  42. code: number
  43. result: {
  44. access_key_id: string
  45. mode: string
  46. endpoint: string
  47. provider: string
  48. use_ssl: boolean
  49. bucket_name: string
  50. secret_access_key: string
  51. path_prefix: string
  52. }
  53. isAuthorized: boolean
  54. }>('/api/ai/storage-provider/config', {
  55. method: 'POST',
  56. headers: {
  57. 'Content-Type': 'application/json'
  58. },
  59. data: body,
  60. ...(options || {})
  61. })
  62. }
  63. /** 获取默认存储厂商 POST /api/ai/storage-provider/default-provider */
  64. export async function postStorageProviderDefaultProvider(
  65. body: {},
  66. options?: { [key: string]: any }
  67. ) {
  68. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean; result?: string }>(
  69. '/api/ai/storage-provider/default-provider',
  70. {
  71. method: 'POST',
  72. headers: {
  73. 'Content-Type': 'application/json'
  74. },
  75. data: body,
  76. ...(options || {})
  77. }
  78. )
  79. }
  80. /** 获取支持的引擎列表 POST /api/ai/storage-provider/engines */
  81. export async function postStorageProviderEngines(body: {}, options?: { [key: string]: any }) {
  82. return request<{
  83. isSuccess: boolean
  84. code: number
  85. result: { allowed: boolean; available: boolean; description: string; name: string }[]
  86. isAuthorized: boolean
  87. }>('/api/ai/storage-provider/engines', {
  88. method: 'POST',
  89. headers: {
  90. 'Content-Type': 'application/json'
  91. },
  92. data: body,
  93. ...(options || {})
  94. })
  95. }
  96. /** 初始化存储厂商信息 POST /api/ai/storage-provider/initStorageProvider */
  97. export async function postStorageProviderInitStorageProvider(
  98. body: {},
  99. options?: { [key: string]: any }
  100. ) {
  101. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  102. '/api/ai/storage-provider/initStorageProvider',
  103. {
  104. method: 'POST',
  105. headers: {
  106. 'Content-Type': 'application/json'
  107. },
  108. data: body,
  109. ...(options || {})
  110. }
  111. )
  112. }
  113. /** 更新配置信息 POST /api/ai/storage-provider/update */
  114. export async function postStorageProviderUpdate(
  115. body: {
  116. default_provider: string
  117. cos: {
  118. app_id: string
  119. bucket_name: string
  120. path_prefix: string
  121. provider: string
  122. region: string
  123. secret_id: string
  124. secret_key: string
  125. }
  126. local: { path_prefix: string; provider: string }
  127. minio: {
  128. access_key_id: string
  129. bucket_name: string
  130. endpoint: string
  131. mode: string
  132. path_prefix: string
  133. provider: string
  134. secret_access_key: string
  135. use_ssl: boolean
  136. }
  137. oss: {
  138. access_key: string
  139. bucket_name: string
  140. endpoint: string
  141. path_prefix: string
  142. provider: string
  143. region: string
  144. secret_key: string
  145. temp_bucket_name: string
  146. temp_region: string
  147. use_temp_bucket: boolean
  148. }
  149. s3: {
  150. access_key: string
  151. bucket_name: string
  152. endpoint: string
  153. path_prefix: string
  154. provider: string
  155. region: string
  156. secret_key: string
  157. }
  158. tos: {
  159. access_key: string
  160. bucket_name: string
  161. endpoint: string
  162. path_prefix: string
  163. provider: string
  164. region: string
  165. secret_key: string
  166. }
  167. },
  168. options?: { [key: string]: any }
  169. ) {
  170. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  171. '/api/ai/storage-provider/update',
  172. {
  173. method: 'POST',
  174. headers: {
  175. 'Content-Type': 'application/json'
  176. },
  177. data: body,
  178. ...(options || {})
  179. }
  180. )
  181. }
  182. /** 更新默认存储厂商 POST /api/ai/storage-provider/updateDefaultProvider */
  183. export async function postStorageProviderUpdateDefaultProvider(
  184. body: {
  185. provider: string
  186. },
  187. options?: { [key: string]: any }
  188. ) {
  189. return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
  190. '/api/ai/storage-provider/updateDefaultProvider',
  191. {
  192. method: 'POST',
  193. headers: {
  194. 'Content-Type': 'application/json'
  195. },
  196. data: body,
  197. ...(options || {})
  198. }
  199. )
  200. }