@kubb/plugin-client 4.29.1 → 4.31.1
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/dist/types-DGWXyUI0.d.ts +0 -159
- 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,105 +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
|
-
GetInventoryQueryResponse,
|
|
8
|
-
PlaceOrderMutationRequest,
|
|
9
|
-
PlaceOrderMutationResponse,
|
|
10
|
-
PlaceOrder405,
|
|
11
|
-
PlaceOrderPatchMutationRequest,
|
|
12
|
-
PlaceOrderPatchMutationResponse,
|
|
13
|
-
PlaceOrderPatch405,
|
|
14
|
-
GetOrderByIdQueryResponse,
|
|
15
|
-
GetOrderByIdPathParams,
|
|
16
|
-
GetOrderById400,
|
|
17
|
-
GetOrderById404,
|
|
18
|
-
DeleteOrderMutationResponse,
|
|
19
|
-
DeleteOrderPathParams,
|
|
20
|
-
DeleteOrder400,
|
|
21
|
-
DeleteOrder404,
|
|
22
|
-
} from './findByTags'
|
|
23
|
-
import { fetch, mergeConfig } from './test/.kubb/fetch'
|
|
24
|
-
|
|
25
|
-
export class Store {
|
|
26
|
-
static #config: Partial<RequestConfig> & { client?: Client } = {}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @description Returns a map of status codes to quantities
|
|
30
|
-
* @summary Returns pet inventories by status
|
|
31
|
-
* {@link /store/inventory}
|
|
32
|
-
*/
|
|
33
|
-
static async getInventory(config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
34
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
35
|
-
const res = await request<GetInventoryQueryResponse, ResponseErrorConfig<Error>, unknown>({ ...requestConfig, method: 'GET', url: `/store/inventory` })
|
|
36
|
-
return res.data
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @description Place a new order in the store
|
|
41
|
-
* @summary Place an order for a pet
|
|
42
|
-
* {@link /store/order}
|
|
43
|
-
*/
|
|
44
|
-
static async placeOrder(data?: PlaceOrderMutationRequest, config: Partial<RequestConfig<PlaceOrderMutationRequest>> & { client?: Client } = {}) {
|
|
45
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
46
|
-
const requestData = data
|
|
47
|
-
const res = await request<PlaceOrderMutationResponse, ResponseErrorConfig<PlaceOrder405>, PlaceOrderMutationRequest>({
|
|
48
|
-
...requestConfig,
|
|
49
|
-
method: 'POST',
|
|
50
|
-
url: `/store/order`,
|
|
51
|
-
data: requestData,
|
|
52
|
-
})
|
|
53
|
-
return res.data
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @description Place a new order in the store with patch
|
|
58
|
-
* @summary Place an order for a pet with patch
|
|
59
|
-
* {@link /store/order}
|
|
60
|
-
*/
|
|
61
|
-
static async placeOrderPatch(
|
|
62
|
-
data?: PlaceOrderPatchMutationRequest,
|
|
63
|
-
config: Partial<RequestConfig<PlaceOrderPatchMutationRequest>> & { client?: Client } = {},
|
|
64
|
-
) {
|
|
65
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
66
|
-
const requestData = data
|
|
67
|
-
const res = await request<PlaceOrderPatchMutationResponse, ResponseErrorConfig<PlaceOrderPatch405>, PlaceOrderPatchMutationRequest>({
|
|
68
|
-
...requestConfig,
|
|
69
|
-
method: 'PATCH',
|
|
70
|
-
url: `/store/order`,
|
|
71
|
-
data: requestData,
|
|
72
|
-
})
|
|
73
|
-
return res.data
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* @description For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
|
|
78
|
-
* @summary Find purchase order by ID
|
|
79
|
-
* {@link /store/order/:orderId}
|
|
80
|
-
*/
|
|
81
|
-
static async getOrderById(orderId: GetOrderByIdPathParams['orderId'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
82
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
83
|
-
const res = await request<GetOrderByIdQueryResponse, ResponseErrorConfig<GetOrderById400 | GetOrderById404>, unknown>({
|
|
84
|
-
...requestConfig,
|
|
85
|
-
method: 'GET',
|
|
86
|
-
url: `/store/order/${orderId}`,
|
|
87
|
-
})
|
|
88
|
-
return res.data
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
|
93
|
-
* @summary Delete purchase order by ID
|
|
94
|
-
* {@link /store/order/:orderId}
|
|
95
|
-
*/
|
|
96
|
-
static async deleteOrder(orderId: DeleteOrderPathParams['orderId'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
97
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
98
|
-
const res = await request<DeleteOrderMutationResponse, ResponseErrorConfig<DeleteOrder400 | DeleteOrder404>, unknown>({
|
|
99
|
-
...requestConfig,
|
|
100
|
-
method: 'DELETE',
|
|
101
|
-
url: `/store/order/${orderId}`,
|
|
102
|
-
})
|
|
103
|
-
return res.data
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -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
|
-
}
|