@kubb/plugin-client 3.0.0-alpha.16 → 3.0.0-alpha.18

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/README.md CHANGED
@@ -13,10 +13,6 @@
13
13
  [![Coverage][coverage-src]][coverage-href]
14
14
  [![License][license-src]][license-href]
15
15
 
16
- <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
17
- <!-- ALL-CONTRIBUTORS-BADGE:END -->
18
- </p>
19
-
20
16
  <h4>
21
17
  <a href="https://codesandbox.io/s/github/kubb-labs/kubb/tree/alpha/examples/typescript" target="_blank">View Demo</a>
22
18
  <span> · </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-client",
3
- "version": "3.0.0-alpha.16",
3
+ "version": "3.0.0-alpha.18",
4
4
  "description": "Generator plugin-client",
5
5
  "keywords": [
6
6
  "typescript",
@@ -72,28 +72,24 @@
72
72
  "!/**/__tests__/**"
73
73
  ],
74
74
  "dependencies": {
75
- "@kubb/core": "3.0.0-alpha.16",
76
- "@kubb/fs": "3.0.0-alpha.16",
77
- "@kubb/oas": "3.0.0-alpha.16",
78
- "@kubb/parser-ts": "3.0.0-alpha.16",
79
- "@kubb/plugin-oas": "3.0.0-alpha.16",
80
- "@kubb/plugin-ts": "3.0.0-alpha.16",
81
- "@kubb/plugin-zod": "3.0.0-alpha.16",
82
- "@kubb/react": "3.0.0-alpha.16"
75
+ "@kubb/core": "3.0.0-alpha.18",
76
+ "@kubb/fs": "3.0.0-alpha.18",
77
+ "@kubb/oas": "3.0.0-alpha.18",
78
+ "@kubb/plugin-oas": "3.0.0-alpha.18",
79
+ "@kubb/plugin-ts": "3.0.0-alpha.18",
80
+ "@kubb/plugin-zod": "3.0.0-alpha.18",
81
+ "@kubb/react": "3.0.0-alpha.18"
83
82
  },
84
83
  "devDependencies": {
85
- "@types/react": "^18.3.5",
86
84
  "axios": "^1.7.7",
87
- "react": "^18.3.1",
88
85
  "tsup": "^8.2.4",
89
86
  "typescript": "^5.6.2",
90
- "@kubb/config-biome": "3.0.0-alpha.16",
91
- "@kubb/config-ts": "3.0.0-alpha.16",
92
- "@kubb/config-tsup": "3.0.0-alpha.16"
87
+ "@kubb/config-ts": "3.0.0-alpha.18",
88
+ "@kubb/config-tsup": "3.0.0-alpha.18"
93
89
  },
94
90
  "peerDependencies": {
95
91
  "axios": "^1.7.2",
96
- "@kubb/react": "3.0.0-alpha.16"
92
+ "@kubb/react": "3.0.0-alpha.18"
97
93
  },
98
94
  "peerDependenciesMeta": {
99
95
  "axios": {
@@ -1,17 +1,12 @@
1
- import client from '@kubb/plugin-client/client'
2
- import type { RequestConfig } from '@kubb/plugin-client/client'
1
+ import client from "@kubb/plugin-client/client";
2
+ import type { RequestConfig } from "@kubb/plugin-client/client";
3
3
 
4
- /**
4
+ /**
5
5
  * @description delete a pet
6
6
  * @summary Deletes a pet
7
7
  * @link /pet/:petId
8
8
  */
9
- export async function deletePet(petId: DeletePetPathParams['petId'], headers?: DeletePetHeaderParams, config: Partial<RequestConfig> = {}) {
10
- const res = await client<DeletePetMutationResponse, DeletePet400, unknown>({
11
- method: 'delete',
12
- url: `/pet/${petId}`,
13
- headers: { ...headers, ...config.headers },
14
- ...config,
15
- })
16
- return res.data
9
+ export async function deletePet(petId: DeletePetPathParams["petId"], headers?: DeletePetHeaderParams, config: Partial<RequestConfig> = {}) {
10
+ const res = await client<DeletePetMutationResponse, DeletePet400, unknown>({ method: "delete", url: `/pet/${petId}`, headers: { ...headers, ...config.headers }, ...config });
11
+ return res.data;
17
12
  }
@@ -1,25 +1,14 @@
1
- import client from '@kubb/plugin-client/client'
2
- import type { RequestConfig } from '@kubb/plugin-client/client'
1
+ import client from "@kubb/plugin-client/client";
2
+ import type { RequestConfig } from "@kubb/plugin-client/client";
3
3
 
4
- /**
4
+ /**
5
5
  * @description delete a pet
6
6
  * @summary Deletes a pet
7
7
  * @link /pet/:petId
8
8
  */
9
- export async function deletePet(
10
- {
11
- petId,
12
- }: {
13
- petId: DeletePetPathParams['petId']
14
- },
15
- headers?: DeletePetHeaderParams,
16
- config: Partial<RequestConfig> = {},
17
- ) {
18
- const res = await client<DeletePetMutationResponse, DeletePet400, unknown>({
19
- method: 'delete',
20
- url: `/pet/${petId}`,
21
- headers: { ...headers, ...config.headers },
22
- ...config,
23
- })
24
- return res.data
9
+ export async function deletePet({ petId }: {
10
+ petId: DeletePetPathParams["petId"];
11
+ }, headers?: DeletePetHeaderParams, config: Partial<RequestConfig> = {}) {
12
+ const res = await client<DeletePetMutationResponse, DeletePet400, unknown>({ method: "delete", url: `/pet/${petId}`, headers: { ...headers, ...config.headers }, ...config });
13
+ return res.data;
25
14
  }
@@ -1,12 +1,12 @@
1
- import client from '@kubb/plugin-client/client'
2
- import type { RequestConfig } from '@kubb/plugin-client/client'
1
+ import client from "@kubb/plugin-client/client";
2
+ import type { RequestConfig } from "@kubb/plugin-client/client";
3
3
 
4
- /**
4
+ /**
5
5
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
6
6
  * @summary Finds Pets by tags
7
7
  * @link /pet/findByTags
8
8
  */
9
9
  export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
10
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'get', url: `/pet/findByTags`, params, ...config })
11
- return res.data
10
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, ...config });
11
+ return res.data;
12
12
  }
@@ -1,12 +1,12 @@
1
- import client from '@kubb/plugin-client/client'
2
- import type { RequestConfig } from '@kubb/plugin-client/client'
1
+ import client from "@kubb/plugin-client/client";
2
+ import type { RequestConfig } from "@kubb/plugin-client/client";
3
3
 
4
- /**
4
+ /**
5
5
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
6
6
  * @summary Finds Pets by tags
7
7
  * @link /pet/findByTags
8
8
  */
9
9
  export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
10
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'get', url: `/pet/findByTags`, params, ...config })
11
- return res
10
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, ...config });
11
+ return res;
12
12
  }
@@ -1,12 +1,12 @@
1
- import client from '@kubb/plugin-client/client'
2
- import type { RequestConfig } from '@kubb/plugin-client/client'
1
+ import client from "@kubb/plugin-client/client";
2
+ import type { RequestConfig } from "@kubb/plugin-client/client";
3
3
 
4
- /**
4
+ /**
5
5
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
6
6
  * @summary Finds Pets by tags
7
7
  * @link /pet/findByTags
8
8
  */
9
9
  export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
10
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'get', url: `/pet/findByTags`, params, ...config })
11
- return findPetsByTagsQueryResponse.parse(res.data)
10
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, ...config });
11
+ return findPetsByTagsQueryResponse.parse(res.data);
12
12
  }
@@ -1,12 +1,12 @@
1
- import client from '@kubb/plugin-client/client'
2
- import type { RequestConfig } from '@kubb/plugin-client/client'
1
+ import client from "@kubb/plugin-client/client";
2
+ import type { RequestConfig } from "@kubb/plugin-client/client";
3
3
 
4
- /**
4
+ /**
5
5
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
6
6
  * @summary Finds Pets by tags
7
7
  * @link /pet/findByTags
8
8
  */
9
9
  export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
10
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'get', url: `/pet/findByTags`, params, ...config })
11
- return { ...res, data: findPetsByTagsQueryResponse.parse(res.data) }
10
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, ...config });
11
+ return { ...res, data: findPetsByTagsQueryResponse.parse(res.data) };
12
12
  }
@@ -1,12 +1,12 @@
1
- import client from 'axios'
2
- import type { RequestConfig } from 'axios'
1
+ import client from "axios";
2
+ import type { RequestConfig } from "axios";
3
3
 
4
- /**
4
+ /**
5
5
  * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
6
6
  * @summary Finds Pets by tags
7
7
  * @link /pet/findByTags
8
8
  */
9
9
  export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
10
- const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: 'get', url: `/pet/findByTags`, params, ...config })
11
- return res.data
10
+ const res = await client<FindPetsByTagsQueryResponse, FindPetsByTags400, unknown>({ method: "get", url: `/pet/findByTags`, params, ...config });
11
+ return res.data;
12
12
  }
@@ -1,82 +1,82 @@
1
1
  export const operations = {
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
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,15 +1,11 @@
1
- import client from '@kubb/plugin-client/client'
2
- import type { RequestConfig } from '@kubb/plugin-client/client'
1
+ import client from "@kubb/plugin-client/client";
2
+ import type { RequestConfig } from "@kubb/plugin-client/client";
3
3
 
4
- /**
4
+ /**
5
5
  * @summary Updates a pet in the store with form data
6
6
  * @link /pet/:petId
7
7
  */
8
- export async function updatePetWithForm(
9
- petId: UpdatePetWithFormPathParams['petId'],
10
- params?: UpdatePetWithFormQueryParams,
11
- config: Partial<RequestConfig> = {},
12
- ) {
13
- const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, unknown>({ method: 'post', url: `/pet/${petId}`, params, ...config })
14
- return res.data
8
+ export async function updatePetWithForm(petId: UpdatePetWithFormPathParams["petId"], params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig> = {}) {
9
+ const res = await client<UpdatePetWithFormMutationResponse, UpdatePetWithForm405, unknown>({ method: "post", url: `/pet/${petId}`, params, ...config });
10
+ return res.data;
15
11
  }
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Plugin, PluginFactoryOptions, ResolveNameParams } from '@kubb/core'
1
+ import type { PluginFactoryOptions, ResolveNameParams } from '@kubb/core'
2
2
  import type * as KubbFile from '@kubb/fs/types'
3
3
 
4
4
  import type { Exclude, Include, Override, ResolvePathOptions } from '@kubb/plugin-oas'
@@ -113,9 +113,4 @@ type ResolvedOptions = {
113
113
  pathParamsType: NonNullable<Options['pathParamsType']>
114
114
  }
115
115
 
116
- export type FileMeta = {
117
- pluginKey?: Plugin['key']
118
- tag?: string
119
- }
120
-
121
116
  export type PluginClient = PluginFactoryOptions<'plugin-client', Options, ResolvedOptions, never, ResolvePathOptions>