@kubb/plugin-client 0.0.0-canary-20241213202051 → 0.0.0-canary-20241214001945
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 -11
- package/src/generators/__snapshots__/deletePet.ts +11 -6
- package/src/generators/__snapshots__/deletePetObject.ts +11 -8
- package/src/generators/__snapshots__/findByTags.ts +5 -5
- package/src/generators/__snapshots__/findByTagsFull.ts +5 -5
- package/src/generators/__snapshots__/findByTagsObject.ts +6 -8
- package/src/generators/__snapshots__/findByTagsWithZod.ts +5 -5
- package/src/generators/__snapshots__/findByTagsWithZodFull.ts +5 -5
- package/src/generators/__snapshots__/importPath.ts +5 -5
- package/src/generators/__snapshots__/operations.ts +81 -81
- package/src/generators/__snapshots__/updatePetById.ts +10 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-client",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20241214001945",
|
|
4
4
|
"description": "Generator plugin-client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -78,23 +78,23 @@
|
|
|
78
78
|
"!/**/__tests__/**"
|
|
79
79
|
],
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@kubb/core": "0.0.0-canary-
|
|
82
|
-
"@kubb/fs": "0.0.0-canary-
|
|
83
|
-
"@kubb/oas": "0.0.0-canary-
|
|
84
|
-
"@kubb/plugin-oas": "0.0.0-canary-
|
|
85
|
-
"@kubb/plugin-ts": "0.0.0-canary-
|
|
86
|
-
"@kubb/plugin-zod": "0.0.0-canary-
|
|
87
|
-
"@kubb/react": "0.0.0-canary-
|
|
81
|
+
"@kubb/core": "0.0.0-canary-20241214001945",
|
|
82
|
+
"@kubb/fs": "0.0.0-canary-20241214001945",
|
|
83
|
+
"@kubb/oas": "0.0.0-canary-20241214001945",
|
|
84
|
+
"@kubb/plugin-oas": "0.0.0-canary-20241214001945",
|
|
85
|
+
"@kubb/plugin-ts": "0.0.0-canary-20241214001945",
|
|
86
|
+
"@kubb/plugin-zod": "0.0.0-canary-20241214001945",
|
|
87
|
+
"@kubb/react": "0.0.0-canary-20241214001945"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"axios": "^1.7.9",
|
|
91
91
|
"tsup": "^8.3.5",
|
|
92
92
|
"typescript": "^5.7.2",
|
|
93
|
-
"@kubb/config-ts": "0.0.0-canary-
|
|
94
|
-
"@kubb/config-tsup": "0.0.0-canary-
|
|
93
|
+
"@kubb/config-ts": "0.0.0-canary-20241214001945",
|
|
94
|
+
"@kubb/config-tsup": "0.0.0-canary-20241214001945"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
|
-
"@kubb/react": "0.0.0-canary-
|
|
97
|
+
"@kubb/react": "0.0.0-canary-20241214001945",
|
|
98
98
|
"axios": "^1.7.2"
|
|
99
99
|
},
|
|
100
100
|
"peerDependenciesMeta": {
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from '@kubb/plugin-client/clients/axios'
|
|
3
|
+
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @description delete a pet
|
|
7
7
|
* @summary Deletes a pet
|
|
8
8
|
* {@link /pet/:petId}
|
|
9
9
|
*/
|
|
10
|
-
export async function deletePet(petId: DeletePetPathParams[
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export async function deletePet(petId: DeletePetPathParams['petId'], headers?: DeletePetHeaderParams, config: Partial<RequestConfig> = {}) {
|
|
11
|
+
const res = await client<DeletePetMutationResponse, DeletePet400, unknown>({
|
|
12
|
+
method: 'DELETE',
|
|
13
|
+
url: `/pet/${petId}`,
|
|
14
|
+
headers: { ...headers, ...config.headers },
|
|
15
|
+
...config,
|
|
16
|
+
})
|
|
17
|
+
return res.data
|
|
13
18
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from '@kubb/plugin-client/clients/axios'
|
|
3
|
+
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @description delete a pet
|
|
7
7
|
* @summary Deletes a pet
|
|
8
8
|
* {@link /pet/:petId}
|
|
9
9
|
*/
|
|
10
|
-
export async function deletePet({ petId }: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export async function deletePet({ petId }: { petId: DeletePetPathParams['petId'] }, headers?: DeletePetHeaderParams, config: Partial<RequestConfig> = {}) {
|
|
11
|
+
const res = await client<DeletePetMutationResponse, DeletePet400, unknown>({
|
|
12
|
+
method: 'DELETE',
|
|
13
|
+
url: `/pet/${petId}`,
|
|
14
|
+
headers: { ...headers, ...config.headers },
|
|
15
|
+
...config,
|
|
16
|
+
})
|
|
17
|
+
return res.data
|
|
15
18
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from '@kubb/plugin-client/clients/axios'
|
|
3
|
+
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
7
7
|
* @summary Finds Pets by tags
|
|
8
8
|
* {@link /pet/findByTags}
|
|
9
9
|
*/
|
|
10
10
|
export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'GET', url: `/pet/findByTags`, params, ...config })
|
|
12
|
+
return res.data
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from '@kubb/plugin-client/clients/axios'
|
|
3
|
+
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
7
7
|
* @summary Finds Pets by tags
|
|
8
8
|
* {@link /pet/findByTags}
|
|
9
9
|
*/
|
|
10
10
|
export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'GET', url: `/pet/findByTags`, params, ...config })
|
|
12
|
+
return res
|
|
13
13
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from '@kubb/plugin-client/clients/axios'
|
|
3
|
+
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
7
7
|
* @summary Finds Pets by tags
|
|
8
8
|
* {@link /pet/findByTags}
|
|
9
9
|
*/
|
|
10
|
-
export async function findPetsByTags({ params }: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "GET", url: `/pet/findByTags`, params, ...config });
|
|
14
|
-
return res.data;
|
|
10
|
+
export async function findPetsByTags({ params }: { params?: FindPetsByTagsQueryParams }, config: Partial<RequestConfig> = {}) {
|
|
11
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'GET', url: `/pet/findByTags`, params, ...config })
|
|
12
|
+
return res.data
|
|
15
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from '@kubb/plugin-client/clients/axios'
|
|
3
|
+
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
7
7
|
* @summary Finds Pets by tags
|
|
8
8
|
* {@link /pet/findByTags}
|
|
9
9
|
*/
|
|
10
10
|
export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'GET', url: `/pet/findByTags`, params, ...config })
|
|
12
|
+
return findPetsByTagsQueryResponse.parse(res.data)
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from '@kubb/plugin-client/clients/axios'
|
|
3
|
+
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
7
7
|
* @summary Finds Pets by tags
|
|
8
8
|
* {@link /pet/findByTags}
|
|
9
9
|
*/
|
|
10
10
|
export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'GET', url: `/pet/findByTags`, params, ...config })
|
|
12
|
+
return { ...res, data: findPetsByTagsQueryResponse.parse(res.data) }
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from 'axios'
|
|
3
|
+
import type { RequestConfig } from 'axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
7
7
|
* @summary Finds Pets by tags
|
|
8
8
|
* {@link /pet/findByTags}
|
|
9
9
|
*/
|
|
10
10
|
export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'GET', url: `/pet/findByTags`, params, ...config })
|
|
12
|
+
return res.data
|
|
13
13
|
}
|
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
export const operations = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
} as const
|
|
2
|
+
updatePet: {
|
|
3
|
+
path: '/pet',
|
|
4
|
+
method: 'put',
|
|
5
|
+
},
|
|
6
|
+
addPet: {
|
|
7
|
+
path: '/pet',
|
|
8
|
+
method: 'post',
|
|
9
|
+
},
|
|
10
|
+
findPetsByStatus: {
|
|
11
|
+
path: '/pet/findByStatus',
|
|
12
|
+
method: 'get',
|
|
13
|
+
},
|
|
14
|
+
findPetsByTags: {
|
|
15
|
+
path: '/pet/findByTags',
|
|
16
|
+
method: 'get',
|
|
17
|
+
},
|
|
18
|
+
getPetById: {
|
|
19
|
+
path: '/pet/:petId',
|
|
20
|
+
method: 'get',
|
|
21
|
+
},
|
|
22
|
+
updatePetWithForm: {
|
|
23
|
+
path: '/pet/:petId',
|
|
24
|
+
method: 'post',
|
|
25
|
+
},
|
|
26
|
+
deletePet: {
|
|
27
|
+
path: '/pet/:petId',
|
|
28
|
+
method: 'delete',
|
|
29
|
+
},
|
|
30
|
+
uploadFile: {
|
|
31
|
+
path: '/pet/:petId/uploadImage',
|
|
32
|
+
method: 'post',
|
|
33
|
+
},
|
|
34
|
+
getInventory: {
|
|
35
|
+
path: '/store/inventory',
|
|
36
|
+
method: 'get',
|
|
37
|
+
},
|
|
38
|
+
placeOrder: {
|
|
39
|
+
path: '/store/order',
|
|
40
|
+
method: 'post',
|
|
41
|
+
},
|
|
42
|
+
placeOrderPatch: {
|
|
43
|
+
path: '/store/order',
|
|
44
|
+
method: 'patch',
|
|
45
|
+
},
|
|
46
|
+
getOrderById: {
|
|
47
|
+
path: '/store/order/:orderId',
|
|
48
|
+
method: 'get',
|
|
49
|
+
},
|
|
50
|
+
deleteOrder: {
|
|
51
|
+
path: '/store/order/:orderId',
|
|
52
|
+
method: 'delete',
|
|
53
|
+
},
|
|
54
|
+
createUser: {
|
|
55
|
+
path: '/user',
|
|
56
|
+
method: 'post',
|
|
57
|
+
},
|
|
58
|
+
createUsersWithListInput: {
|
|
59
|
+
path: '/user/createWithList',
|
|
60
|
+
method: 'post',
|
|
61
|
+
},
|
|
62
|
+
loginUser: {
|
|
63
|
+
path: '/user/login',
|
|
64
|
+
method: 'get',
|
|
65
|
+
},
|
|
66
|
+
logoutUser: {
|
|
67
|
+
path: '/user/logout',
|
|
68
|
+
method: 'get',
|
|
69
|
+
},
|
|
70
|
+
getUserByName: {
|
|
71
|
+
path: '/user/:username',
|
|
72
|
+
method: 'get',
|
|
73
|
+
},
|
|
74
|
+
updateUser: {
|
|
75
|
+
path: '/user/:username',
|
|
76
|
+
method: 'put',
|
|
77
|
+
},
|
|
78
|
+
deleteUser: {
|
|
79
|
+
path: '/user/:username',
|
|
80
|
+
method: 'delete',
|
|
81
|
+
},
|
|
82
|
+
} as const
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
|
-
import client from
|
|
3
|
-
import type { RequestConfig } from
|
|
2
|
+
import client from '@kubb/plugin-client/clients/axios'
|
|
3
|
+
import type { RequestConfig } from '@kubb/plugin-client/clients/axios'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* @summary Updates a pet in the store with form data
|
|
7
7
|
* {@link /pet/:petId}
|
|
8
8
|
*/
|
|
9
|
-
export async function updatePetWithForm(
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export async function updatePetWithForm(
|
|
10
|
+
petId: UpdatePetWithFormPathParams['petId'],
|
|
11
|
+
params?: UpdatePetWithFormQueryParams,
|
|
12
|
+
config: Partial<RequestConfig> = {},
|
|
13
|
+
) {
|
|
14
|
+
const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, unknown>({ method: 'POST', url: `/pet/${petId}`, params, ...config })
|
|
15
|
+
return res.data
|
|
12
16
|
}
|