credential.ts 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // @ts-ignore
  2. /* eslint-disable */
  3. import request from '@repo/api-client'
  4. /** Create a credential Creates a credential that can be used by nodes of the specified type. POST /credentials */
  5. export async function postCredentials(body: API.credential, options?: { [key: string]: any }) {
  6. return request<API.createCredentialResponse>('/credentials', {
  7. method: 'POST',
  8. headers: {
  9. 'Content-Type': 'application/json'
  10. },
  11. data: body,
  12. ...(options || {})
  13. })
  14. }
  15. /** Delete credential by ID Deletes a credential from your instance. You must be the owner of the credentials DELETE /credentials/${param0} */
  16. export async function deleteCredential(
  17. // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  18. params: API.deleteCredentialParams,
  19. options?: { [key: string]: any }
  20. ) {
  21. const { id: param0, ...queryParams } = params
  22. return request<API.credential>(`/credentials/${param0}`, {
  23. method: 'DELETE',
  24. params: { ...queryParams },
  25. ...(options || {})
  26. })
  27. }
  28. /** Update credential by ID Updates an existing credential. You must be the owner of the credential. PATCH /credentials/${param0} */
  29. export async function updateCredential(
  30. // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  31. params: API.updateCredentialParams,
  32. body: API.updateCredentialRequest,
  33. options?: { [key: string]: any }
  34. ) {
  35. const { id: param0, ...queryParams } = params
  36. return request<API.createCredentialResponse>(`/credentials/${param0}`, {
  37. method: 'PATCH',
  38. headers: {
  39. 'Content-Type': 'application/json'
  40. },
  41. params: { ...queryParams },
  42. data: body,
  43. ...(options || {})
  44. })
  45. }
  46. /** Transfer a credential to another project. Transfer a credential to another project. PUT /credentials/${param0}/transfer */
  47. export async function putCredentialsIdTransfer(
  48. // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  49. params: API.putCredentialsIdTransferParams,
  50. body: {
  51. /** The ID of the project to transfer the credential to. */
  52. destinationProjectId: string
  53. },
  54. options?: { [key: string]: any }
  55. ) {
  56. const { id: param0, ...queryParams } = params
  57. return request<any>(`/credentials/${param0}/transfer`, {
  58. method: 'PUT',
  59. headers: {
  60. 'Content-Type': 'application/json'
  61. },
  62. params: { ...queryParams },
  63. data: body,
  64. ...(options || {})
  65. })
  66. }
  67. /** Show credential data schema GET /credentials/schema/${param0} */
  68. export async function getCredentialsSchemaCredentialTypeName(
  69. // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  70. params: API.getCredentialsSchemaCredentialTypeNameParams,
  71. options?: { [key: string]: any }
  72. ) {
  73. const { credentialTypeName: param0, ...queryParams } = params
  74. return request<Record<string, any>>(`/credentials/schema/${param0}`, {
  75. method: 'GET',
  76. params: { ...queryParams },
  77. ...(options || {})
  78. })
  79. }