@kubb/plugin-client 4.29.1 → 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.31.0",
|
|
4
4
|
"description": "API client generator plugin for Kubb, creating type-safe HTTP clients (Axios, Fetch) from OpenAPI specifications for making API requests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-client",
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
"*.d.ts",
|
|
98
98
|
"*.d.cts",
|
|
99
99
|
"!/**/**.test.**",
|
|
100
|
-
"!/**/__tests__/**"
|
|
100
|
+
"!/**/__tests__/**",
|
|
101
|
+
"!/**/__snapshots__/**"
|
|
101
102
|
],
|
|
102
103
|
"size-limit": [
|
|
103
104
|
{
|
|
@@ -107,18 +108,18 @@
|
|
|
107
108
|
}
|
|
108
109
|
],
|
|
109
110
|
"dependencies": {
|
|
110
|
-
"@kubb/react-fabric": "0.13.
|
|
111
|
-
"@kubb/core": "4.
|
|
112
|
-
"@kubb/oas": "4.
|
|
113
|
-
"@kubb/plugin-oas": "4.
|
|
114
|
-
"@kubb/plugin-ts": "4.
|
|
115
|
-
"@kubb/plugin-zod": "4.
|
|
111
|
+
"@kubb/react-fabric": "0.13.2",
|
|
112
|
+
"@kubb/core": "4.31.0",
|
|
113
|
+
"@kubb/oas": "4.31.0",
|
|
114
|
+
"@kubb/plugin-oas": "4.31.0",
|
|
115
|
+
"@kubb/plugin-ts": "4.31.0",
|
|
116
|
+
"@kubb/plugin-zod": "4.31.0"
|
|
116
117
|
},
|
|
117
118
|
"devDependencies": {
|
|
118
|
-
"axios": "^1.13.
|
|
119
|
+
"axios": "^1.13.6"
|
|
119
120
|
},
|
|
120
121
|
"peerDependencies": {
|
|
121
|
-
"@kubb/react-fabric": "0.13.
|
|
122
|
+
"@kubb/react-fabric": "0.13.2",
|
|
122
123
|
"axios": "^1.7.2"
|
|
123
124
|
},
|
|
124
125
|
"peerDependenciesMeta": {
|
|
@@ -1,186 +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
|
-
UpdatePetMutationRequest,
|
|
8
|
-
UpdatePetMutationResponse,
|
|
9
|
-
UpdatePet400,
|
|
10
|
-
UpdatePet404,
|
|
11
|
-
UpdatePet405,
|
|
12
|
-
AddPetMutationRequest,
|
|
13
|
-
AddPetMutationResponse,
|
|
14
|
-
AddPet405,
|
|
15
|
-
FindPetsByStatusQueryResponse,
|
|
16
|
-
FindPetsByStatusQueryParams,
|
|
17
|
-
FindPetsByStatus400,
|
|
18
|
-
FindPetsByTagsQueryResponse,
|
|
19
|
-
FindPetsByTagsQueryParams,
|
|
20
|
-
FindPetsByTags400,
|
|
21
|
-
GetPetByIdQueryResponse,
|
|
22
|
-
GetPetByIdPathParams,
|
|
23
|
-
GetPetById400,
|
|
24
|
-
GetPetById404,
|
|
25
|
-
UpdatePetWithFormMutationResponse,
|
|
26
|
-
UpdatePetWithFormPathParams,
|
|
27
|
-
UpdatePetWithFormQueryParams,
|
|
28
|
-
UpdatePetWithForm405,
|
|
29
|
-
DeletePetMutationResponse,
|
|
30
|
-
DeletePetPathParams,
|
|
31
|
-
DeletePetHeaderParams,
|
|
32
|
-
DeletePet400,
|
|
33
|
-
UploadFileMutationRequest,
|
|
34
|
-
UploadFileMutationResponse,
|
|
35
|
-
UploadFilePathParams,
|
|
36
|
-
UploadFileQueryParams,
|
|
37
|
-
} from './findByTags'
|
|
38
|
-
import { buildFormData } from './test/.kubb/config'
|
|
39
|
-
import { fetch, mergeConfig } from './test/.kubb/fetch'
|
|
40
|
-
|
|
41
|
-
export class Pet {
|
|
42
|
-
#config: Partial<RequestConfig> & { client?: Client }
|
|
43
|
-
|
|
44
|
-
constructor(config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
45
|
-
this.#config = config
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @description Update an existing pet by Id
|
|
50
|
-
* @summary Update an existing pet
|
|
51
|
-
* {@link /pet}
|
|
52
|
-
*/
|
|
53
|
-
async updatePet(data: UpdatePetMutationRequest, config: Partial<RequestConfig<UpdatePetMutationRequest>> & { client?: Client } = {}) {
|
|
54
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
55
|
-
const requestData = data
|
|
56
|
-
const res = await request<UpdatePetMutationResponse, ResponseErrorConfig<UpdatePet400 | UpdatePet404 | UpdatePet405>, UpdatePetMutationRequest>({
|
|
57
|
-
...requestConfig,
|
|
58
|
-
method: 'PUT',
|
|
59
|
-
url: `/pet`,
|
|
60
|
-
data: requestData,
|
|
61
|
-
})
|
|
62
|
-
return res.data
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @description Add a new pet to the store
|
|
67
|
-
* @summary Add a new pet to the store
|
|
68
|
-
* {@link /pet}
|
|
69
|
-
*/
|
|
70
|
-
async addPet(data: AddPetMutationRequest, config: Partial<RequestConfig<AddPetMutationRequest>> & { client?: Client } = {}) {
|
|
71
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
72
|
-
const requestData = data
|
|
73
|
-
const res = await request<AddPetMutationResponse, ResponseErrorConfig<AddPet405>, AddPetMutationRequest>({
|
|
74
|
-
...requestConfig,
|
|
75
|
-
method: 'POST',
|
|
76
|
-
url: `/pet`,
|
|
77
|
-
data: requestData,
|
|
78
|
-
})
|
|
79
|
-
return res.data
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @description Multiple status values can be provided with comma separated strings
|
|
84
|
-
* @summary Finds Pets by status
|
|
85
|
-
* {@link /pet/findByStatus}
|
|
86
|
-
*/
|
|
87
|
-
async findPetsByStatus(params?: FindPetsByStatusQueryParams, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
88
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
89
|
-
const res = await request<FindPetsByStatusQueryResponse, ResponseErrorConfig<FindPetsByStatus400>, unknown>({
|
|
90
|
-
...requestConfig,
|
|
91
|
-
method: 'GET',
|
|
92
|
-
url: `/pet/findByStatus`,
|
|
93
|
-
params,
|
|
94
|
-
})
|
|
95
|
-
return res.data
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
100
|
-
* @summary Finds Pets by tags
|
|
101
|
-
* {@link /pet/findByTags}
|
|
102
|
-
*/
|
|
103
|
-
async findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
104
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
105
|
-
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
106
|
-
...requestConfig,
|
|
107
|
-
method: 'GET',
|
|
108
|
-
url: `/pet/findByTags`,
|
|
109
|
-
params,
|
|
110
|
-
})
|
|
111
|
-
return res.data
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @description Returns a single pet
|
|
116
|
-
* @summary Find pet by ID
|
|
117
|
-
* {@link /pet/:petId}
|
|
118
|
-
*/
|
|
119
|
-
async getPetById(petId: GetPetByIdPathParams['petId'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
120
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
121
|
-
const res = await request<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, unknown>({
|
|
122
|
-
...requestConfig,
|
|
123
|
-
method: 'GET',
|
|
124
|
-
url: `/pet/${petId}`,
|
|
125
|
-
})
|
|
126
|
-
return res.data
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @summary Updates a pet in the store with form data
|
|
131
|
-
* {@link /pet/:petId}
|
|
132
|
-
*/
|
|
133
|
-
async updatePetWithForm(
|
|
134
|
-
petId: UpdatePetWithFormPathParams['petId'],
|
|
135
|
-
params?: UpdatePetWithFormQueryParams,
|
|
136
|
-
config: Partial<RequestConfig> & { client?: Client } = {},
|
|
137
|
-
) {
|
|
138
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
139
|
-
const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, unknown>({
|
|
140
|
-
...requestConfig,
|
|
141
|
-
method: 'POST',
|
|
142
|
-
url: `/pet/${petId}`,
|
|
143
|
-
params,
|
|
144
|
-
})
|
|
145
|
-
return res.data
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @description delete a pet
|
|
150
|
-
* @summary Deletes a pet
|
|
151
|
-
* {@link /pet/:petId}
|
|
152
|
-
*/
|
|
153
|
-
async deletePet(petId: DeletePetPathParams['petId'], headers?: DeletePetHeaderParams, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
154
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
155
|
-
const res = await request<DeletePetMutationResponse, ResponseErrorConfig<DeletePet400>, unknown>({
|
|
156
|
-
...requestConfig,
|
|
157
|
-
method: 'DELETE',
|
|
158
|
-
url: `/pet/${petId}`,
|
|
159
|
-
headers: { ...headers, ...requestConfig.headers },
|
|
160
|
-
})
|
|
161
|
-
return res.data
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @summary uploads an image
|
|
166
|
-
* {@link /pet/:petId/uploadImage}
|
|
167
|
-
*/
|
|
168
|
-
async uploadFile(
|
|
169
|
-
petId: UploadFilePathParams['petId'],
|
|
170
|
-
data: UploadFileMutationRequest,
|
|
171
|
-
params?: UploadFileQueryParams,
|
|
172
|
-
config: Partial<RequestConfig<UploadFileMutationRequest>> & { client?: Client } = {},
|
|
173
|
-
) {
|
|
174
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
175
|
-
const requestData = data
|
|
176
|
-
const formData = buildFormData(requestData)
|
|
177
|
-
const res = await request<UploadFileMutationResponse, ResponseErrorConfig<Error>, UploadFileMutationRequest>({
|
|
178
|
-
...requestConfig,
|
|
179
|
-
method: 'POST',
|
|
180
|
-
url: `/pet/${petId}/uploadImage`,
|
|
181
|
-
params,
|
|
182
|
-
data: formData as FormData,
|
|
183
|
-
})
|
|
184
|
-
return res.data
|
|
185
|
-
}
|
|
186
|
-
}
|
|
@@ -1,106 +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
|
-
#config: Partial<RequestConfig> & { client?: Client }
|
|
27
|
-
|
|
28
|
-
constructor(config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
29
|
-
this.#config = config
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @description Returns a map of status codes to quantities
|
|
34
|
-
* @summary Returns pet inventories by status
|
|
35
|
-
* {@link /store/inventory}
|
|
36
|
-
*/
|
|
37
|
-
async getInventory(config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
38
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
39
|
-
const res = await request<GetInventoryQueryResponse, ResponseErrorConfig<Error>, unknown>({ ...requestConfig, method: 'GET', url: `/store/inventory` })
|
|
40
|
-
return res.data
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @description Place a new order in the store
|
|
45
|
-
* @summary Place an order for a pet
|
|
46
|
-
* {@link /store/order}
|
|
47
|
-
*/
|
|
48
|
-
async placeOrder(data?: PlaceOrderMutationRequest, config: Partial<RequestConfig<PlaceOrderMutationRequest>> & { client?: Client } = {}) {
|
|
49
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
50
|
-
const requestData = data
|
|
51
|
-
const res = await request<PlaceOrderMutationResponse, ResponseErrorConfig<PlaceOrder405>, PlaceOrderMutationRequest>({
|
|
52
|
-
...requestConfig,
|
|
53
|
-
method: 'POST',
|
|
54
|
-
url: `/store/order`,
|
|
55
|
-
data: requestData,
|
|
56
|
-
})
|
|
57
|
-
return res.data
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @description Place a new order in the store with patch
|
|
62
|
-
* @summary Place an order for a pet with patch
|
|
63
|
-
* {@link /store/order}
|
|
64
|
-
*/
|
|
65
|
-
async placeOrderPatch(data?: PlaceOrderPatchMutationRequest, config: Partial<RequestConfig<PlaceOrderPatchMutationRequest>> & { client?: Client } = {}) {
|
|
66
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
67
|
-
const requestData = data
|
|
68
|
-
const res = await request<PlaceOrderPatchMutationResponse, ResponseErrorConfig<PlaceOrderPatch405>, PlaceOrderPatchMutationRequest>({
|
|
69
|
-
...requestConfig,
|
|
70
|
-
method: 'PATCH',
|
|
71
|
-
url: `/store/order`,
|
|
72
|
-
data: requestData,
|
|
73
|
-
})
|
|
74
|
-
return res.data
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @description For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
|
|
79
|
-
* @summary Find purchase order by ID
|
|
80
|
-
* {@link /store/order/:orderId}
|
|
81
|
-
*/
|
|
82
|
-
async getOrderById(orderId: GetOrderByIdPathParams['orderId'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
83
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
84
|
-
const res = await request<GetOrderByIdQueryResponse, ResponseErrorConfig<GetOrderById400 | GetOrderById404>, unknown>({
|
|
85
|
-
...requestConfig,
|
|
86
|
-
method: 'GET',
|
|
87
|
-
url: `/store/order/${orderId}`,
|
|
88
|
-
})
|
|
89
|
-
return res.data
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
|
94
|
-
* @summary Delete purchase order by ID
|
|
95
|
-
* {@link /store/order/:orderId}
|
|
96
|
-
*/
|
|
97
|
-
async deleteOrder(orderId: DeleteOrderPathParams['orderId'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
98
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
99
|
-
const res = await request<DeleteOrderMutationResponse, ResponseErrorConfig<DeleteOrder400 | DeleteOrder404>, unknown>({
|
|
100
|
-
...requestConfig,
|
|
101
|
-
method: 'DELETE',
|
|
102
|
-
url: `/store/order/${orderId}`,
|
|
103
|
-
})
|
|
104
|
-
return res.data
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1,147 +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
|
-
#config: Partial<RequestConfig> & { client?: Client }
|
|
31
|
-
|
|
32
|
-
constructor(config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
33
|
-
this.#config = config
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @description This can only be done by the logged in user.
|
|
38
|
-
* @summary Create user
|
|
39
|
-
* {@link /user}
|
|
40
|
-
*/
|
|
41
|
-
async createUser(data?: CreateUserMutationRequest, config: Partial<RequestConfig<CreateUserMutationRequest>> & { client?: Client } = {}) {
|
|
42
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
43
|
-
const requestData = data
|
|
44
|
-
const res = await request<CreateUserMutationResponse, ResponseErrorConfig<Error>, CreateUserMutationRequest>({
|
|
45
|
-
...requestConfig,
|
|
46
|
-
method: 'POST',
|
|
47
|
-
url: `/user`,
|
|
48
|
-
data: requestData,
|
|
49
|
-
})
|
|
50
|
-
return res.data
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @description Creates list of users with given input array
|
|
55
|
-
* @summary Creates list of users with given input array
|
|
56
|
-
* {@link /user/createWithList}
|
|
57
|
-
*/
|
|
58
|
-
async createUsersWithListInput(
|
|
59
|
-
data?: CreateUsersWithListInputMutationRequest,
|
|
60
|
-
config: Partial<RequestConfig<CreateUsersWithListInputMutationRequest>> & { client?: Client } = {},
|
|
61
|
-
) {
|
|
62
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
63
|
-
const requestData = data
|
|
64
|
-
const res = await request<CreateUsersWithListInputMutationResponse, ResponseErrorConfig<Error>, CreateUsersWithListInputMutationRequest>({
|
|
65
|
-
...requestConfig,
|
|
66
|
-
method: 'POST',
|
|
67
|
-
url: `/user/createWithList`,
|
|
68
|
-
data: requestData,
|
|
69
|
-
})
|
|
70
|
-
return res.data
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @summary Logs user into the system
|
|
75
|
-
* {@link /user/login}
|
|
76
|
-
*/
|
|
77
|
-
async loginUser(params?: LoginUserQueryParams, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
78
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
79
|
-
const res = await request<LoginUserQueryResponse, ResponseErrorConfig<LoginUser400>, unknown>({
|
|
80
|
-
...requestConfig,
|
|
81
|
-
method: 'GET',
|
|
82
|
-
url: `/user/login`,
|
|
83
|
-
params,
|
|
84
|
-
})
|
|
85
|
-
return res.data
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* @summary Logs out current logged in user session
|
|
90
|
-
* {@link /user/logout}
|
|
91
|
-
*/
|
|
92
|
-
async logoutUser(config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
93
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
94
|
-
const res = await request<LogoutUserQueryResponse, ResponseErrorConfig<Error>, unknown>({ ...requestConfig, method: 'GET', url: `/user/logout` })
|
|
95
|
-
return res.data
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @summary Get user by user name
|
|
100
|
-
* {@link /user/:username}
|
|
101
|
-
*/
|
|
102
|
-
async getUserByName(username: GetUserByNamePathParams['username'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
103
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
104
|
-
const res = await request<GetUserByNameQueryResponse, ResponseErrorConfig<GetUserByName400 | GetUserByName404>, unknown>({
|
|
105
|
-
...requestConfig,
|
|
106
|
-
method: 'GET',
|
|
107
|
-
url: `/user/${username}`,
|
|
108
|
-
})
|
|
109
|
-
return res.data
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @description This can only be done by the logged in user.
|
|
114
|
-
* @summary Update user
|
|
115
|
-
* {@link /user/:username}
|
|
116
|
-
*/
|
|
117
|
-
async updateUser(
|
|
118
|
-
username: UpdateUserPathParams['username'],
|
|
119
|
-
data?: UpdateUserMutationRequest,
|
|
120
|
-
config: Partial<RequestConfig<UpdateUserMutationRequest>> & { client?: Client } = {},
|
|
121
|
-
) {
|
|
122
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
123
|
-
const requestData = data
|
|
124
|
-
const res = await request<UpdateUserMutationResponse, ResponseErrorConfig<Error>, UpdateUserMutationRequest>({
|
|
125
|
-
...requestConfig,
|
|
126
|
-
method: 'PUT',
|
|
127
|
-
url: `/user/${username}`,
|
|
128
|
-
data: requestData,
|
|
129
|
-
})
|
|
130
|
-
return res.data
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @description This can only be done by the logged in user.
|
|
135
|
-
* @summary Delete user
|
|
136
|
-
* {@link /user/:username}
|
|
137
|
-
*/
|
|
138
|
-
async deleteUser(username: DeleteUserPathParams['username'], config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
139
|
-
const { client: request = fetch, ...requestConfig } = mergeConfig(this.#config, config)
|
|
140
|
-
const res = await request<DeleteUserMutationResponse, ResponseErrorConfig<DeleteUser400 | DeleteUser404>, unknown>({
|
|
141
|
-
...requestConfig,
|
|
142
|
-
method: 'DELETE',
|
|
143
|
-
url: `/user/${username}`,
|
|
144
|
-
})
|
|
145
|
-
return res.data
|
|
146
|
-
}
|
|
147
|
-
}
|
|
@@ -1,33 +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 getDeletePetUrl(petId: DeletePetPathParams['petId']) {
|
|
10
|
-
const res = { method: 'DELETE', url: `/pet/${petId}` as const }
|
|
11
|
-
return res
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @description delete a pet
|
|
16
|
-
* @summary Deletes a pet
|
|
17
|
-
* {@link /pet/:petId}
|
|
18
|
-
*/
|
|
19
|
-
export async function deletePet(
|
|
20
|
-
petId: DeletePetPathParams['petId'],
|
|
21
|
-
headers?: DeletePetHeaderParams,
|
|
22
|
-
config: Partial<RequestConfig> & { client?: Client } = {},
|
|
23
|
-
) {
|
|
24
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
25
|
-
|
|
26
|
-
const res = await request<DeletePetMutationResponse, ResponseErrorConfig<DeletePet400>, unknown>({
|
|
27
|
-
method: 'DELETE',
|
|
28
|
-
url: getDeletePetUrl(petId).url.toString(),
|
|
29
|
-
...requestConfig,
|
|
30
|
-
headers: { ...headers, ...requestConfig.headers },
|
|
31
|
-
})
|
|
32
|
-
return res.data
|
|
33
|
-
}
|
|
@@ -1,33 +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 getDeletePetUrl({ petId }: { petId: DeletePetPathParams['petId'] }) {
|
|
10
|
-
const res = { method: 'DELETE', url: `/pet/${petId}` as const }
|
|
11
|
-
return res
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @description delete a pet
|
|
16
|
-
* @summary Deletes a pet
|
|
17
|
-
* {@link /pet/:petId}
|
|
18
|
-
*/
|
|
19
|
-
export async function deletePet(
|
|
20
|
-
{ petId }: { petId: DeletePetPathParams['petId'] },
|
|
21
|
-
headers?: DeletePetHeaderParams,
|
|
22
|
-
config: Partial<RequestConfig> & { client?: Client } = {},
|
|
23
|
-
) {
|
|
24
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
25
|
-
|
|
26
|
-
const res = await request<DeletePetMutationResponse, ResponseErrorConfig<DeletePet400>, unknown>({
|
|
27
|
-
method: 'DELETE',
|
|
28
|
-
url: getDeletePetUrl({ petId }).url.toString(),
|
|
29
|
-
...requestConfig,
|
|
30
|
-
headers: { ...headers, ...requestConfig.headers },
|
|
31
|
-
})
|
|
32
|
-
return res.data
|
|
33
|
-
}
|
|
@@ -1,29 +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 getFindPetsByStatusUrl() {
|
|
10
|
-
const res = { method: 'GET', url: `/pet/findByStatus` as const }
|
|
11
|
-
return res
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @description Multiple status values can be provided with comma separated strings
|
|
16
|
-
* @summary Finds Pets by status
|
|
17
|
-
* {@link /pet/findByStatus}
|
|
18
|
-
*/
|
|
19
|
-
export async function findPetsByStatus({ params }: { params?: FindPetsByStatusQueryParams } = {}, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
20
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
21
|
-
|
|
22
|
-
const res = await request<FindPetsByStatusQueryResponse, ResponseErrorConfig<FindPetsByStatus400>, unknown>({
|
|
23
|
-
method: 'GET',
|
|
24
|
-
url: getFindPetsByStatusUrl().url.toString(),
|
|
25
|
-
params,
|
|
26
|
-
...requestConfig,
|
|
27
|
-
})
|
|
28
|
-
return res.data
|
|
29
|
-
}
|
|
@@ -1,29 +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 getFindPetsByStatusUrl() {
|
|
10
|
-
const res = { method: 'GET', url: `/pet/findByStatus` as const }
|
|
11
|
-
return res
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @description Multiple status values can be provided with comma separated strings
|
|
16
|
-
* @summary Finds Pets by status
|
|
17
|
-
* {@link /pet/findByStatus}
|
|
18
|
-
*/
|
|
19
|
-
export async function findPetsByStatus(params?: FindPetsByStatusQueryParams, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
20
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
21
|
-
|
|
22
|
-
const res = await request<FindPetsByStatusQueryResponse, ResponseErrorConfig<FindPetsByStatus400>, unknown>({
|
|
23
|
-
method: 'GET',
|
|
24
|
-
url: getFindPetsByStatusUrl().url.toString(),
|
|
25
|
-
params,
|
|
26
|
-
...requestConfig,
|
|
27
|
-
})
|
|
28
|
-
return res.data
|
|
29
|
-
}
|
|
@@ -1,29 +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 getFindPetsByTagsUrl() {
|
|
10
|
-
const res = { method: 'GET', url: `/pet/findByTags` as const }
|
|
11
|
-
return res
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
16
|
-
* @summary Finds Pets by tags
|
|
17
|
-
* {@link /pet/findByTags}
|
|
18
|
-
*/
|
|
19
|
-
export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
20
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
21
|
-
|
|
22
|
-
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
23
|
-
method: 'GET',
|
|
24
|
-
url: getFindPetsByTagsUrl().url.toString(),
|
|
25
|
-
params,
|
|
26
|
-
...requestConfig,
|
|
27
|
-
})
|
|
28
|
-
return res.data
|
|
29
|
-
}
|
|
@@ -1,29 +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 getFindPetsByTagsUrl() {
|
|
10
|
-
const res = { method: 'GET', url: `/pet/findByTags` as const }
|
|
11
|
-
return res
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
16
|
-
* @summary Finds Pets by tags
|
|
17
|
-
* {@link /pet/findByTags}
|
|
18
|
-
*/
|
|
19
|
-
export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: Client } = {}) {
|
|
20
|
-
const { client: request = fetch, ...requestConfig } = config
|
|
21
|
-
|
|
22
|
-
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
|
|
23
|
-
method: 'GET',
|
|
24
|
-
url: getFindPetsByTagsUrl().url.toString(),
|
|
25
|
-
params,
|
|
26
|
-
...requestConfig,
|
|
27
|
-
})
|
|
28
|
-
return res
|
|
29
|
-
}
|