@kubb/plugin-client 4.29.0 → 4.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -10
- package/src/generators/__snapshots__/Pet.ts +0 -186
- package/src/generators/__snapshots__/Store.ts +0 -106
- package/src/generators/__snapshots__/User.ts +0 -147
- package/src/generators/__snapshots__/deletePet.ts +0 -33
- package/src/generators/__snapshots__/deletePetObject.ts +0 -33
- package/src/generators/__snapshots__/findByStatusAllOptional.ts +0 -29
- package/src/generators/__snapshots__/findByStatusAllOptionalInline.ts +0 -29
- package/src/generators/__snapshots__/findByTags.ts +0 -29
- package/src/generators/__snapshots__/findByTagsFull.ts +0 -29
- package/src/generators/__snapshots__/findByTagsObject.ts +0 -29
- package/src/generators/__snapshots__/findByTagsWithBaseURL.ts +0 -29
- package/src/generators/__snapshots__/findByTagsWithTemplateString.ts +0 -29
- package/src/generators/__snapshots__/findByTagsWithZod.ts +0 -29
- package/src/generators/__snapshots__/findByTagsWithZodFull.ts +0 -29
- package/src/generators/__snapshots__/importPath.ts +0 -29
- package/src/generators/__snapshots__/operations.ts +0 -87
- package/src/generators/__snapshots__/requiredOneOfRequestBody.ts +0 -34
- package/src/generators/__snapshots__/static/Pet.ts +0 -182
- package/src/generators/__snapshots__/static/Store.ts +0 -105
- package/src/generators/__snapshots__/static/User.ts +0 -143
- package/src/generators/__snapshots__/updatePetById.ts +0 -32
- package/src/generators/__snapshots__/updatePetByIdClean.ts +0 -32
- package/src/generators/__snapshots__/uploadFile.ts +0 -37
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
3
|
-
* Do not edit manually.
|
|
4
|
-
*/
|
|
5
|
-
import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
|
|
6
|
-
import type {
|
|
7
|
-
CreateUserMutationRequest,
|
|
8
|
-
CreateUserMutationResponse,
|
|
9
|
-
CreateUsersWithListInputMutationRequest,
|
|
10
|
-
CreateUsersWithListInputMutationResponse,
|
|
11
|
-
LoginUserQueryResponse,
|
|
12
|
-
LoginUserQueryParams,
|
|
13
|
-
LoginUser400,
|
|
14
|
-
LogoutUserQueryResponse,
|
|
15
|
-
GetUserByNameQueryResponse,
|
|
16
|
-
GetUserByNamePathParams,
|
|
17
|
-
GetUserByName400,
|
|
18
|
-
GetUserByName404,
|
|
19
|
-
UpdateUserMutationRequest,
|
|
20
|
-
UpdateUserMutationResponse,
|
|
21
|
-
UpdateUserPathParams,
|
|
22
|
-
DeleteUserMutationResponse,
|
|
23
|
-
DeleteUserPathParams,
|
|
24
|
-
DeleteUser400,
|
|
25
|
-
DeleteUser404,
|
|
26
|
-
} from './findByTags'
|
|
27
|
-
import { fetch, mergeConfig } from './test/.kubb/fetch'
|
|
28
|
-
|
|
29
|
-
export class User {
|
|
30
|
-
static #config: Partial<RequestConfig> & { client?: Client } = {}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @description This can only be done by the logged in user.
|
|
34
|
-
* @summary Create user
|
|
35
|
-
* {@link /user}
|
|
36
|
-
*/
|
|
37
|
-
static async createUser(data?: CreateUserMutationRequest, config: Partial<RequestConfig<CreateUserMutationRequest>> & { client?: Client } = {}) {
|
|
38
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
39
|
-
const requestData = data
|
|
40
|
-
const res = await request<CreateUserMutationResponse, ResponseErrorConfig<Error>, CreateUserMutationRequest>({
|
|
41
|
-
...requestConfig,
|
|
42
|
-
method: 'POST',
|
|
43
|
-
url: `/user`,
|
|
44
|
-
data: requestData,
|
|
45
|
-
})
|
|
46
|
-
return res.data
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @description Creates list of users with given input array
|
|
51
|
-
* @summary Creates list of users with given input array
|
|
52
|
-
* {@link /user/createWithList}
|
|
53
|
-
*/
|
|
54
|
-
static async createUsersWithListInput(
|
|
55
|
-
data?: CreateUsersWithListInputMutationRequest,
|
|
56
|
-
config: Partial<RequestConfig<CreateUsersWithListInputMutationRequest>> & { client?: Client } = {},
|
|
57
|
-
) {
|
|
58
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
59
|
-
const requestData = data
|
|
60
|
-
const res = await request<CreateUsersWithListInputMutationResponse, ResponseErrorConfig<Error>, CreateUsersWithListInputMutationRequest>({
|
|
61
|
-
...requestConfig,
|
|
62
|
-
method: 'POST',
|
|
63
|
-
url: `/user/createWithList`,
|
|
64
|
-
data: requestData,
|
|
65
|
-
})
|
|
66
|
-
return res.data
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* @summary Logs user into the system
|
|
71
|
-
* {@link /user/login}
|
|
72
|
-
*/
|
|
73
|
-
static async loginUser(params?: LoginUserQueryParams, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
74
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
75
|
-
const res = await request<LoginUserQueryResponse, ResponseErrorConfig<LoginUser400>, unknown>({
|
|
76
|
-
...requestConfig,
|
|
77
|
-
method: 'GET',
|
|
78
|
-
url: `/user/login`,
|
|
79
|
-
params,
|
|
80
|
-
})
|
|
81
|
-
return res.data
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @summary Logs out current logged in user session
|
|
86
|
-
* {@link /user/logout}
|
|
87
|
-
*/
|
|
88
|
-
static async logoutUser(config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
89
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
90
|
-
const res = await request<LogoutUserQueryResponse, ResponseErrorConfig<Error>, unknown>({ ...requestConfig, method: 'GET', url: `/user/logout` })
|
|
91
|
-
return res.data
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* @summary Get user by user name
|
|
96
|
-
* {@link /user/:username}
|
|
97
|
-
*/
|
|
98
|
-
static async getUserByName(username: GetUserByNamePathParams['username'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
99
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
100
|
-
const res = await request<GetUserByNameQueryResponse, ResponseErrorConfig<GetUserByName400 | GetUserByName404>, unknown>({
|
|
101
|
-
...requestConfig,
|
|
102
|
-
method: 'GET',
|
|
103
|
-
url: `/user/${username}`,
|
|
104
|
-
})
|
|
105
|
-
return res.data
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @description This can only be done by the logged in user.
|
|
110
|
-
* @summary Update user
|
|
111
|
-
* {@link /user/:username}
|
|
112
|
-
*/
|
|
113
|
-
static async updateUser(
|
|
114
|
-
username: UpdateUserPathParams['username'],
|
|
115
|
-
data?: UpdateUserMutationRequest,
|
|
116
|
-
config: Partial<RequestConfig<UpdateUserMutationRequest>> & { client?: Client } = {},
|
|
117
|
-
) {
|
|
118
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
119
|
-
const requestData = data
|
|
120
|
-
const res = await request<UpdateUserMutationResponse, ResponseErrorConfig<Error>, UpdateUserMutationRequest>({
|
|
121
|
-
...requestConfig,
|
|
122
|
-
method: 'PUT',
|
|
123
|
-
url: `/user/${username}`,
|
|
124
|
-
data: requestData,
|
|
125
|
-
})
|
|
126
|
-
return res.data
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @description This can only be done by the logged in user.
|
|
131
|
-
* @summary Delete user
|
|
132
|
-
* {@link /user/:username}
|
|
133
|
-
*/
|
|
134
|
-
static async deleteUser(username: DeleteUserPathParams['username'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
135
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
136
|
-
const res = await request<DeleteUserMutationResponse, ResponseErrorConfig<DeleteUser400 | DeleteUser404>, unknown>({
|
|
137
|
-
...requestConfig,
|
|
138
|
-
method: 'DELETE',
|
|
139
|
-
url: `/user/${username}`,
|
|
140
|
-
})
|
|
141
|
-
return res.data
|
|
142
|
-
}
|
|
143
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-alert, no-console */
|
|
2
|
-
/**
|
|
3
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
4
|
-
* Do not edit manually.
|
|
5
|
-
*/
|
|
6
|
-
import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
|
|
7
|
-
import { fetch } from './test/.kubb/fetch'
|
|
8
|
-
|
|
9
|
-
export function getUpdatePetWithFormUrl(petId: UpdatePetWithFormPathParams['petId']) {
|
|
10
|
-
const res = { method: 'POST', url: `/pet/${petId}` as const }
|
|
11
|
-
return res
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @summary Updates a pet in the store with form data
|
|
16
|
-
* {@link /pet/:petId}
|
|
17
|
-
*/
|
|
18
|
-
export async function updatePetWithForm(
|
|
19
|
-
petId: UpdatePetWithFormPathParams['petId'],
|
|
20
|
-
params?: UpdatePetWithFormQueryParams,
|
|
21
|
-
config: Partial<RequestConfig> & { client?: Client } = {},
|
|
22
|
-
) {
|
|
23
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
24
|
-
|
|
25
|
-
const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, unknown>({
|
|
26
|
-
method: 'POST',
|
|
27
|
-
url: getUpdatePetWithFormUrl(petId).url.toString(),
|
|
28
|
-
params,
|
|
29
|
-
...requestConfig,
|
|
30
|
-
})
|
|
31
|
-
return res.data
|
|
32
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-alert, no-console */
|
|
2
|
-
/**
|
|
3
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
4
|
-
* Do not edit manually.
|
|
5
|
-
*/
|
|
6
|
-
import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
|
|
7
|
-
import { fetch } from './test/.kubb/fetch'
|
|
8
|
-
|
|
9
|
-
function getUpdatePetWithFormUrl(petId: UpdatePetWithFormPathParams['petId']) {
|
|
10
|
-
const res = { method: 'POST', url: `/pet/${petId}` as const }
|
|
11
|
-
return res
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @summary Updates a pet in the store with form data
|
|
16
|
-
* {@link /pet/:petId}
|
|
17
|
-
*/
|
|
18
|
-
export async function updatePetWithForm(
|
|
19
|
-
petId: UpdatePetWithFormPathParams['petId'],
|
|
20
|
-
params?: UpdatePetWithFormQueryParams,
|
|
21
|
-
config: Partial<RequestConfig> & { client?: Client } = {},
|
|
22
|
-
) {
|
|
23
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
24
|
-
|
|
25
|
-
const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, unknown>({
|
|
26
|
-
method: 'POST',
|
|
27
|
-
url: getUpdatePetWithFormUrl(petId).url.toString(),
|
|
28
|
-
params,
|
|
29
|
-
...requestConfig,
|
|
30
|
-
})
|
|
31
|
-
return res.data
|
|
32
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-alert, no-console */
|
|
2
|
-
/**
|
|
3
|
-
* Generated by Kubb (https://kubb.dev/).
|
|
4
|
-
* Do not edit manually.
|
|
5
|
-
*/
|
|
6
|
-
import type { Client, RequestConfig, ResponseErrorConfig } from './test/.kubb/fetch'
|
|
7
|
-
import { buildFormData } from './test/.kubb/config'
|
|
8
|
-
import { fetch } from './test/.kubb/fetch'
|
|
9
|
-
|
|
10
|
-
export function getUploadFileUrl(petId: UploadFilePathParams['petId']) {
|
|
11
|
-
const res = { method: 'POST', url: `/pet/${petId}/uploadImage` as const }
|
|
12
|
-
return res
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @summary uploads an image
|
|
17
|
-
* {@link /pet/:petId/uploadImage}
|
|
18
|
-
*/
|
|
19
|
-
export async function uploadFile(
|
|
20
|
-
petId: UploadFilePathParams['petId'],
|
|
21
|
-
data: UploadFileMutationRequest,
|
|
22
|
-
params?: UploadFileQueryParams,
|
|
23
|
-
config: Partial<RequestConfig<UploadFileMutationRequest>> & { client?: Client } = {},
|
|
24
|
-
) {
|
|
25
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
26
|
-
|
|
27
|
-
const requestData = data
|
|
28
|
-
const formData = buildFormData(requestData)
|
|
29
|
-
const res = await request<UploadFileMutationResponse, ResponseErrorConfig<Error>, UploadFileMutationRequest>({
|
|
30
|
-
method: 'POST',
|
|
31
|
-
url: getUploadFileUrl(petId).url.toString(),
|
|
32
|
-
params,
|
|
33
|
-
data: formData as FormData,
|
|
34
|
-
...requestConfig,
|
|
35
|
-
})
|
|
36
|
-
return res.data
|
|
37
|
-
}
|