@kubb/plugin-client 3.0.0-beta.2 → 3.0.0-beta.4

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/client.ts CHANGED
@@ -28,17 +28,38 @@ export type ResponseConfig<TData = unknown> = {
28
28
  headers?: AxiosResponse['headers']
29
29
  }
30
30
 
31
- export const axiosInstance = axios.create({
31
+ let _config: Partial<RequestConfig> = {
32
32
  baseURL: typeof AXIOS_BASE !== 'undefined' ? AXIOS_BASE : undefined,
33
33
  headers: typeof AXIOS_HEADERS !== 'undefined' ? (JSON.parse(AXIOS_HEADERS) as AxiosHeaders) : undefined,
34
- })
34
+ }
35
+
36
+ export const getConfig = () => _config
37
+
38
+ export const setConfig = (config: RequestConfig) => {
39
+ _config = config
40
+ return getConfig()
41
+ }
42
+
43
+ export const axiosInstance = axios.create(getConfig())
35
44
 
36
45
  export const axiosClient = async <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {
37
- const promise = axiosInstance.request<TData, ResponseConfig<TData>>(config).catch((e: AxiosError<TError>) => {
38
- throw e
39
- })
46
+ const globalConfig = getConfig()
40
47
 
41
- return promise
48
+ return axiosInstance
49
+ .request<TData, ResponseConfig<TData>>({
50
+ ...globalConfig,
51
+ ...config,
52
+ headers: {
53
+ ...globalConfig.headers,
54
+ ...config.headers,
55
+ },
56
+ })
57
+ .catch((e: AxiosError<TError>) => {
58
+ throw e
59
+ })
42
60
  }
43
61
 
62
+ axiosClient.getConfig = getConfig
63
+ axiosClient.setConfig = setConfig
64
+
44
65
  export default axiosClient
package/dist/client.cjs CHANGED
@@ -9,20 +9,37 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
  var axios__default = /*#__PURE__*/_interopDefault(axios);
10
10
 
11
11
  // client.ts
12
- var axiosInstance = axios__default.default.create({
12
+ var _config = {
13
13
  baseURL: typeof AXIOS_BASE !== "undefined" ? AXIOS_BASE : void 0,
14
14
  headers: typeof AXIOS_HEADERS !== "undefined" ? JSON.parse(AXIOS_HEADERS) : void 0
15
- });
15
+ };
16
+ var getConfig = () => _config;
17
+ var setConfig = (config) => {
18
+ _config = config;
19
+ return getConfig();
20
+ };
21
+ var axiosInstance = axios__default.default.create(getConfig());
16
22
  var axiosClient = async (config) => {
17
- const promise = axiosInstance.request(config).catch((e) => {
23
+ const globalConfig = getConfig();
24
+ return axiosInstance.request({
25
+ ...globalConfig,
26
+ ...config,
27
+ headers: {
28
+ ...globalConfig.headers,
29
+ ...config.headers
30
+ }
31
+ }).catch((e) => {
18
32
  throw e;
19
33
  });
20
- return promise;
21
34
  };
35
+ axiosClient.getConfig = getConfig;
36
+ axiosClient.setConfig = setConfig;
22
37
  var client_default = axiosClient;
23
38
 
24
39
  exports.axiosClient = axiosClient;
25
40
  exports.axiosInstance = axiosInstance;
26
41
  exports.default = client_default;
42
+ exports.getConfig = getConfig;
43
+ exports.setConfig = setConfig;
27
44
  //# sourceMappingURL=client.cjs.map
28
45
  //# sourceMappingURL=client.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../client.ts"],"names":["axios"],"mappings":";;;;;;;;;;;AA8Ba,IAAA,aAAA,GAAgBA,uBAAM,MAAO,CAAA;AAAA,EACxC,OAAS,EAAA,OAAO,UAAe,KAAA,WAAA,GAAc,UAAa,GAAA,KAAA,CAAA;AAAA,EAC1D,SAAS,OAAO,aAAA,KAAkB,cAAe,IAAK,CAAA,KAAA,CAAM,aAAa,CAAqB,GAAA,KAAA,CAAA;AAChG,CAAC,EAAA;AAEY,IAAA,WAAA,GAAc,OAAsD,MAAsE,KAAA;AACrJ,EAAA,MAAM,UAAU,aAAc,CAAA,OAAA,CAAsC,MAAM,CAAE,CAAA,KAAA,CAAM,CAAC,CAA0B,KAAA;AAC3G,IAAM,MAAA,CAAA,CAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAO,OAAA,OAAA,CAAA;AACT,EAAA;AAEA,IAAO,cAAQ,GAAA","file":"client.cjs","sourcesContent":["import axios from 'axios'\n\nimport type { AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios'\n\ndeclare const AXIOS_BASE: string\ndeclare const AXIOS_HEADERS: string\n\n/**\n * Subset of AxiosRequestConfig\n */\nexport type RequestConfig<TData = unknown> = {\n baseURL?: string\n url?: string\n method: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS'\n params?: unknown\n data?: TData | FormData\n responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n signal?: AbortSignal\n headers?: AxiosRequestConfig['headers']\n}\n/**\n * Subset of AxiosResponse\n */\nexport type ResponseConfig<TData = unknown> = {\n data: TData\n status: number\n statusText: string\n headers?: AxiosResponse['headers']\n}\n\nexport const axiosInstance = axios.create({\n baseURL: typeof AXIOS_BASE !== 'undefined' ? AXIOS_BASE : undefined,\n headers: typeof AXIOS_HEADERS !== 'undefined' ? (JSON.parse(AXIOS_HEADERS) as AxiosHeaders) : undefined,\n})\n\nexport const axiosClient = async <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {\n const promise = axiosInstance.request<TData, ResponseConfig<TData>>(config).catch((e: AxiosError<TError>) => {\n throw e\n })\n\n return promise\n}\n\nexport default axiosClient\n"]}
1
+ {"version":3,"sources":["../client.ts"],"names":["axios"],"mappings":";;;;;;;;;;;AA8BA,IAAI,OAAkC,GAAA;AAAA,EACpC,OAAS,EAAA,OAAO,UAAe,KAAA,WAAA,GAAc,UAAa,GAAA,KAAA,CAAA;AAAA,EAC1D,SAAS,OAAO,aAAA,KAAkB,cAAe,IAAK,CAAA,KAAA,CAAM,aAAa,CAAqB,GAAA,KAAA,CAAA;AAChG,CAAA,CAAA;AAEO,IAAM,YAAY,MAAM,QAAA;AAElB,IAAA,SAAA,GAAY,CAAC,MAA0B,KAAA;AAClD,EAAU,OAAA,GAAA,MAAA,CAAA;AACV,EAAA,OAAO,SAAU,EAAA,CAAA;AACnB,EAAA;AAEO,IAAM,aAAgB,GAAAA,sBAAA,CAAM,MAAO,CAAA,SAAA,EAAW,EAAA;AAExC,IAAA,WAAA,GAAc,OAAsD,MAAsE,KAAA;AACrJ,EAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAE/B,EAAA,OAAO,cACJ,OAAsC,CAAA;AAAA,IACrC,GAAG,YAAA;AAAA,IACH,GAAG,MAAA;AAAA,IACH,OAAS,EAAA;AAAA,MACP,GAAG,YAAa,CAAA,OAAA;AAAA,MAChB,GAAG,MAAO,CAAA,OAAA;AAAA,KACZ;AAAA,GACD,CAAA,CACA,KAAM,CAAA,CAAC,CAA0B,KAAA;AAChC,IAAM,MAAA,CAAA,CAAA;AAAA,GACP,CAAA,CAAA;AACL,EAAA;AAEA,WAAA,CAAY,SAAY,GAAA,SAAA,CAAA;AACxB,WAAA,CAAY,SAAY,GAAA,SAAA,CAAA;AAExB,IAAO,cAAQ,GAAA","file":"client.cjs","sourcesContent":["import axios from 'axios'\n\nimport type { AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios'\n\ndeclare const AXIOS_BASE: string\ndeclare const AXIOS_HEADERS: string\n\n/**\n * Subset of AxiosRequestConfig\n */\nexport type RequestConfig<TData = unknown> = {\n baseURL?: string\n url?: string\n method: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS'\n params?: unknown\n data?: TData | FormData\n responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n signal?: AbortSignal\n headers?: AxiosRequestConfig['headers']\n}\n/**\n * Subset of AxiosResponse\n */\nexport type ResponseConfig<TData = unknown> = {\n data: TData\n status: number\n statusText: string\n headers?: AxiosResponse['headers']\n}\n\nlet _config: Partial<RequestConfig> = {\n baseURL: typeof AXIOS_BASE !== 'undefined' ? AXIOS_BASE : undefined,\n headers: typeof AXIOS_HEADERS !== 'undefined' ? (JSON.parse(AXIOS_HEADERS) as AxiosHeaders) : undefined,\n}\n\nexport const getConfig = () => _config\n\nexport const setConfig = (config: RequestConfig) => {\n _config = config\n return getConfig()\n}\n\nexport const axiosInstance = axios.create(getConfig())\n\nexport const axiosClient = async <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {\n const globalConfig = getConfig()\n\n return axiosInstance\n .request<TData, ResponseConfig<TData>>({\n ...globalConfig,\n ...config,\n headers: {\n ...globalConfig.headers,\n ...config.headers,\n },\n })\n .catch((e: AxiosError<TError>) => {\n throw e\n })\n}\n\naxiosClient.getConfig = getConfig\naxiosClient.setConfig = setConfig\n\nexport default axiosClient\n"]}
package/dist/client.d.cts CHANGED
@@ -23,7 +23,13 @@ type ResponseConfig<TData = unknown> = {
23
23
  statusText: string;
24
24
  headers?: AxiosResponse['headers'];
25
25
  };
26
+ declare const getConfig: () => Partial<RequestConfig<unknown>>;
27
+ declare const setConfig: (config: RequestConfig) => Partial<RequestConfig<unknown>>;
26
28
  declare const axiosInstance: axios.AxiosInstance;
27
- declare const axiosClient: <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>) => Promise<ResponseConfig<TData>>;
29
+ declare const axiosClient: {
30
+ <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>>;
31
+ getConfig: () => Partial<RequestConfig<unknown>>;
32
+ setConfig: (config: RequestConfig) => Partial<RequestConfig<unknown>>;
33
+ };
28
34
 
29
- export { type RequestConfig, type ResponseConfig, axiosClient, axiosInstance, axiosClient as default };
35
+ export { type RequestConfig, type ResponseConfig, axiosClient, axiosInstance, axiosClient as default, getConfig, setConfig };
package/dist/client.d.ts CHANGED
@@ -23,7 +23,13 @@ type ResponseConfig<TData = unknown> = {
23
23
  statusText: string;
24
24
  headers?: AxiosResponse['headers'];
25
25
  };
26
+ declare const getConfig: () => Partial<RequestConfig<unknown>>;
27
+ declare const setConfig: (config: RequestConfig) => Partial<RequestConfig<unknown>>;
26
28
  declare const axiosInstance: axios.AxiosInstance;
27
- declare const axiosClient: <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>) => Promise<ResponseConfig<TData>>;
29
+ declare const axiosClient: {
30
+ <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>>;
31
+ getConfig: () => Partial<RequestConfig<unknown>>;
32
+ setConfig: (config: RequestConfig) => Partial<RequestConfig<unknown>>;
33
+ };
28
34
 
29
- export { type RequestConfig, type ResponseConfig, axiosClient, axiosInstance, axiosClient as default };
35
+ export { type RequestConfig, type ResponseConfig, axiosClient, axiosInstance, axiosClient as default, getConfig, setConfig };
package/dist/client.js CHANGED
@@ -1,18 +1,33 @@
1
1
  import axios from 'axios';
2
2
 
3
3
  // client.ts
4
- var axiosInstance = axios.create({
4
+ var _config = {
5
5
  baseURL: typeof AXIOS_BASE !== "undefined" ? AXIOS_BASE : void 0,
6
6
  headers: typeof AXIOS_HEADERS !== "undefined" ? JSON.parse(AXIOS_HEADERS) : void 0
7
- });
7
+ };
8
+ var getConfig = () => _config;
9
+ var setConfig = (config) => {
10
+ _config = config;
11
+ return getConfig();
12
+ };
13
+ var axiosInstance = axios.create(getConfig());
8
14
  var axiosClient = async (config) => {
9
- const promise = axiosInstance.request(config).catch((e) => {
15
+ const globalConfig = getConfig();
16
+ return axiosInstance.request({
17
+ ...globalConfig,
18
+ ...config,
19
+ headers: {
20
+ ...globalConfig.headers,
21
+ ...config.headers
22
+ }
23
+ }).catch((e) => {
10
24
  throw e;
11
25
  });
12
- return promise;
13
26
  };
27
+ axiosClient.getConfig = getConfig;
28
+ axiosClient.setConfig = setConfig;
14
29
  var client_default = axiosClient;
15
30
 
16
- export { axiosClient, axiosInstance, client_default as default };
31
+ export { axiosClient, axiosInstance, client_default as default, getConfig, setConfig };
17
32
  //# sourceMappingURL=client.js.map
18
33
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../client.ts"],"names":[],"mappings":";;;AA8Ba,IAAA,aAAA,GAAgB,MAAM,MAAO,CAAA;AAAA,EACxC,OAAS,EAAA,OAAO,UAAe,KAAA,WAAA,GAAc,UAAa,GAAA,KAAA,CAAA;AAAA,EAC1D,SAAS,OAAO,aAAA,KAAkB,cAAe,IAAK,CAAA,KAAA,CAAM,aAAa,CAAqB,GAAA,KAAA,CAAA;AAChG,CAAC,EAAA;AAEY,IAAA,WAAA,GAAc,OAAsD,MAAsE,KAAA;AACrJ,EAAA,MAAM,UAAU,aAAc,CAAA,OAAA,CAAsC,MAAM,CAAE,CAAA,KAAA,CAAM,CAAC,CAA0B,KAAA;AAC3G,IAAM,MAAA,CAAA,CAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAO,OAAA,OAAA,CAAA;AACT,EAAA;AAEA,IAAO,cAAQ,GAAA","file":"client.js","sourcesContent":["import axios from 'axios'\n\nimport type { AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios'\n\ndeclare const AXIOS_BASE: string\ndeclare const AXIOS_HEADERS: string\n\n/**\n * Subset of AxiosRequestConfig\n */\nexport type RequestConfig<TData = unknown> = {\n baseURL?: string\n url?: string\n method: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS'\n params?: unknown\n data?: TData | FormData\n responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n signal?: AbortSignal\n headers?: AxiosRequestConfig['headers']\n}\n/**\n * Subset of AxiosResponse\n */\nexport type ResponseConfig<TData = unknown> = {\n data: TData\n status: number\n statusText: string\n headers?: AxiosResponse['headers']\n}\n\nexport const axiosInstance = axios.create({\n baseURL: typeof AXIOS_BASE !== 'undefined' ? AXIOS_BASE : undefined,\n headers: typeof AXIOS_HEADERS !== 'undefined' ? (JSON.parse(AXIOS_HEADERS) as AxiosHeaders) : undefined,\n})\n\nexport const axiosClient = async <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {\n const promise = axiosInstance.request<TData, ResponseConfig<TData>>(config).catch((e: AxiosError<TError>) => {\n throw e\n })\n\n return promise\n}\n\nexport default axiosClient\n"]}
1
+ {"version":3,"sources":["../client.ts"],"names":[],"mappings":";;;AA8BA,IAAI,OAAkC,GAAA;AAAA,EACpC,OAAS,EAAA,OAAO,UAAe,KAAA,WAAA,GAAc,UAAa,GAAA,KAAA,CAAA;AAAA,EAC1D,SAAS,OAAO,aAAA,KAAkB,cAAe,IAAK,CAAA,KAAA,CAAM,aAAa,CAAqB,GAAA,KAAA,CAAA;AAChG,CAAA,CAAA;AAEO,IAAM,YAAY,MAAM,QAAA;AAElB,IAAA,SAAA,GAAY,CAAC,MAA0B,KAAA;AAClD,EAAU,OAAA,GAAA,MAAA,CAAA;AACV,EAAA,OAAO,SAAU,EAAA,CAAA;AACnB,EAAA;AAEO,IAAM,aAAgB,GAAA,KAAA,CAAM,MAAO,CAAA,SAAA,EAAW,EAAA;AAExC,IAAA,WAAA,GAAc,OAAsD,MAAsE,KAAA;AACrJ,EAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAE/B,EAAA,OAAO,cACJ,OAAsC,CAAA;AAAA,IACrC,GAAG,YAAA;AAAA,IACH,GAAG,MAAA;AAAA,IACH,OAAS,EAAA;AAAA,MACP,GAAG,YAAa,CAAA,OAAA;AAAA,MAChB,GAAG,MAAO,CAAA,OAAA;AAAA,KACZ;AAAA,GACD,CAAA,CACA,KAAM,CAAA,CAAC,CAA0B,KAAA;AAChC,IAAM,MAAA,CAAA,CAAA;AAAA,GACP,CAAA,CAAA;AACL,EAAA;AAEA,WAAA,CAAY,SAAY,GAAA,SAAA,CAAA;AACxB,WAAA,CAAY,SAAY,GAAA,SAAA,CAAA;AAExB,IAAO,cAAQ,GAAA","file":"client.js","sourcesContent":["import axios from 'axios'\n\nimport type { AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios'\n\ndeclare const AXIOS_BASE: string\ndeclare const AXIOS_HEADERS: string\n\n/**\n * Subset of AxiosRequestConfig\n */\nexport type RequestConfig<TData = unknown> = {\n baseURL?: string\n url?: string\n method: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS'\n params?: unknown\n data?: TData | FormData\n responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n signal?: AbortSignal\n headers?: AxiosRequestConfig['headers']\n}\n/**\n * Subset of AxiosResponse\n */\nexport type ResponseConfig<TData = unknown> = {\n data: TData\n status: number\n statusText: string\n headers?: AxiosResponse['headers']\n}\n\nlet _config: Partial<RequestConfig> = {\n baseURL: typeof AXIOS_BASE !== 'undefined' ? AXIOS_BASE : undefined,\n headers: typeof AXIOS_HEADERS !== 'undefined' ? (JSON.parse(AXIOS_HEADERS) as AxiosHeaders) : undefined,\n}\n\nexport const getConfig = () => _config\n\nexport const setConfig = (config: RequestConfig) => {\n _config = config\n return getConfig()\n}\n\nexport const axiosInstance = axios.create(getConfig())\n\nexport const axiosClient = async <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {\n const globalConfig = getConfig()\n\n return axiosInstance\n .request<TData, ResponseConfig<TData>>({\n ...globalConfig,\n ...config,\n headers: {\n ...globalConfig.headers,\n ...config.headers,\n },\n })\n .catch((e: AxiosError<TError>) => {\n throw e\n })\n}\n\naxiosClient.getConfig = getConfig\naxiosClient.setConfig = setConfig\n\nexport default axiosClient\n"]}
@@ -2,7 +2,7 @@ import { Operation } from '@kubb/oas';
2
2
  import { OperationSchemas } from '@kubb/plugin-oas';
3
3
  import { FunctionParams } from '@kubb/react';
4
4
  import { KubbNode } from '@kubb/react/types';
5
- import { P as PluginClient } from './types-Bk_NZurp.cjs';
5
+ import { P as PluginClient } from './types-DGbetpQ9.cjs';
6
6
  import '@kubb/core';
7
7
 
8
8
  type Props = {
@@ -2,7 +2,7 @@ import { Operation } from '@kubb/oas';
2
2
  import { OperationSchemas } from '@kubb/plugin-oas';
3
3
  import { FunctionParams } from '@kubb/react';
4
4
  import { KubbNode } from '@kubb/react/types';
5
- import { P as PluginClient } from './types-Bk_NZurp.js';
5
+ import { P as PluginClient } from './types-DGbetpQ9.js';
6
6
  import '@kubb/core';
7
7
 
8
8
  type Props = {
@@ -1,5 +1,5 @@
1
1
  import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginClient } from './types-Bk_NZurp.cjs';
2
+ import { P as PluginClient } from './types-DGbetpQ9.cjs';
3
3
  import '@kubb/core';
4
4
 
5
5
  declare const clientGenerator: _kubb_plugin_oas.Generator<PluginClient>;
@@ -1,5 +1,5 @@
1
1
  import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginClient } from './types-Bk_NZurp.js';
2
+ import { P as PluginClient } from './types-DGbetpQ9.js';
3
3
  import '@kubb/core';
4
4
 
5
5
  declare const clientGenerator: _kubb_plugin_oas.Generator<PluginClient>;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginClient } from './types-Bk_NZurp.cjs';
2
+ import { O as Options, P as PluginClient } from './types-DGbetpQ9.cjs';
3
3
  import '@kubb/plugin-oas';
4
4
 
5
5
  declare const pluginClientName = "plugin-client";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _kubb_core from '@kubb/core';
2
- import { O as Options, P as PluginClient } from './types-Bk_NZurp.js';
2
+ import { O as Options, P as PluginClient } from './types-DGbetpQ9.js';
3
3
  import '@kubb/plugin-oas';
4
4
 
5
5
  declare const pluginClientName = "plugin-client";
@@ -25,7 +25,7 @@ type Options = {
25
25
  override?: Array<Override<ResolvedOptions>>;
26
26
  /**
27
27
  * Create `operations.ts` file with all operations grouped by methods.
28
- * @default `false`
28
+ * @default false
29
29
  */
30
30
  operations?: boolean;
31
31
  /**
@@ -37,27 +37,21 @@ type Options = {
37
37
  importPath?: string;
38
38
  /**
39
39
  * ReturnType that will be used when calling the client.
40
- *
41
- * `Data` will return ResponseConfig[data].
42
- *
43
- * `Full` will return ResponseConfig.
44
- * @default `'data'`
45
- * @private
40
+ * - 'data' will return ResponseConfig[data].
41
+ * - 'full' will return ResponseConfig.
42
+ * @default 'data'
46
43
  */
47
44
  dataReturnType?: 'data' | 'full';
48
45
  /**
49
46
  * How to pass your pathParams.
50
- *
51
- * `object` will return the pathParams as an object.
52
- *
53
- * `inline` will return the pathParams as comma separated params.
54
- * @default `'inline'`
55
- * @private
47
+ * - 'object' will return the pathParams as an object.
48
+ * - 'inline' will return the pathParams as comma separated params.
49
+ * @default 'inline'
56
50
  */
57
51
  pathParamsType?: 'object' | 'inline';
58
52
  /**
59
53
  * Which parser can be used before returning the data
60
- * `'zod'` will use `@kubb/plugin-zod` to parse the data.
54
+ * - 'zod' will use `@kubb/plugin-zod` to parse the data.
61
55
  * @default 'client'
62
56
  */
63
57
  parser?: 'client' | 'zod';
@@ -25,7 +25,7 @@ type Options = {
25
25
  override?: Array<Override<ResolvedOptions>>;
26
26
  /**
27
27
  * Create `operations.ts` file with all operations grouped by methods.
28
- * @default `false`
28
+ * @default false
29
29
  */
30
30
  operations?: boolean;
31
31
  /**
@@ -37,27 +37,21 @@ type Options = {
37
37
  importPath?: string;
38
38
  /**
39
39
  * ReturnType that will be used when calling the client.
40
- *
41
- * `Data` will return ResponseConfig[data].
42
- *
43
- * `Full` will return ResponseConfig.
44
- * @default `'data'`
45
- * @private
40
+ * - 'data' will return ResponseConfig[data].
41
+ * - 'full' will return ResponseConfig.
42
+ * @default 'data'
46
43
  */
47
44
  dataReturnType?: 'data' | 'full';
48
45
  /**
49
46
  * How to pass your pathParams.
50
- *
51
- * `object` will return the pathParams as an object.
52
- *
53
- * `inline` will return the pathParams as comma separated params.
54
- * @default `'inline'`
55
- * @private
47
+ * - 'object' will return the pathParams as an object.
48
+ * - 'inline' will return the pathParams as comma separated params.
49
+ * @default 'inline'
56
50
  */
57
51
  pathParamsType?: 'object' | 'inline';
58
52
  /**
59
53
  * Which parser can be used before returning the data
60
- * `'zod'` will use `@kubb/plugin-zod` to parse the data.
54
+ * - 'zod' will use `@kubb/plugin-zod` to parse the data.
61
55
  * @default 'client'
62
56
  */
63
57
  parser?: 'client' | 'zod';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-client",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "Generator plugin-client",
5
5
  "keywords": [
6
6
  "typescript",
@@ -72,24 +72,24 @@
72
72
  "!/**/__tests__/**"
73
73
  ],
74
74
  "dependencies": {
75
- "@kubb/core": "3.0.0-beta.2",
76
- "@kubb/fs": "3.0.0-beta.2",
77
- "@kubb/oas": "3.0.0-beta.2",
78
- "@kubb/plugin-oas": "3.0.0-beta.2",
79
- "@kubb/plugin-ts": "3.0.0-beta.2",
80
- "@kubb/plugin-zod": "3.0.0-beta.2",
81
- "@kubb/react": "3.0.0-beta.2"
75
+ "@kubb/core": "3.0.0-beta.4",
76
+ "@kubb/fs": "3.0.0-beta.4",
77
+ "@kubb/oas": "3.0.0-beta.4",
78
+ "@kubb/plugin-oas": "3.0.0-beta.4",
79
+ "@kubb/plugin-ts": "3.0.0-beta.4",
80
+ "@kubb/plugin-zod": "3.0.0-beta.4",
81
+ "@kubb/react": "3.0.0-beta.4"
82
82
  },
83
83
  "devDependencies": {
84
84
  "axios": "^1.7.7",
85
85
  "tsup": "^8.3.0",
86
86
  "typescript": "^5.6.2",
87
- "@kubb/config-ts": "3.0.0-beta.2",
88
- "@kubb/config-tsup": "3.0.0-beta.2"
87
+ "@kubb/config-ts": "3.0.0-beta.4",
88
+ "@kubb/config-tsup": "3.0.0-beta.4"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "axios": "^1.7.2",
92
- "@kubb/react": "3.0.0-beta.2"
92
+ "@kubb/react": "3.0.0-beta.4"
93
93
  },
94
94
  "peerDependenciesMeta": {
95
95
  "axios": {
package/src/types.ts CHANGED
@@ -26,7 +26,7 @@ export type Options = {
26
26
  override?: Array<Override<ResolvedOptions>>
27
27
  /**
28
28
  * Create `operations.ts` file with all operations grouped by methods.
29
- * @default `false`
29
+ * @default false
30
30
  */
31
31
  operations?: boolean
32
32
  /**
@@ -38,27 +38,21 @@ export type Options = {
38
38
  importPath?: string
39
39
  /**
40
40
  * ReturnType that will be used when calling the client.
41
- *
42
- * `Data` will return ResponseConfig[data].
43
- *
44
- * `Full` will return ResponseConfig.
45
- * @default `'data'`
46
- * @private
41
+ * - 'data' will return ResponseConfig[data].
42
+ * - 'full' will return ResponseConfig.
43
+ * @default 'data'
47
44
  */
48
45
  dataReturnType?: 'data' | 'full'
49
46
  /**
50
47
  * How to pass your pathParams.
51
- *
52
- * `object` will return the pathParams as an object.
53
- *
54
- * `inline` will return the pathParams as comma separated params.
55
- * @default `'inline'`
56
- * @private
48
+ * - 'object' will return the pathParams as an object.
49
+ * - 'inline' will return the pathParams as comma separated params.
50
+ * @default 'inline'
57
51
  */
58
52
  pathParamsType?: 'object' | 'inline'
59
53
  /**
60
54
  * Which parser can be used before returning the data
61
- * `'zod'` will use `@kubb/plugin-zod` to parse the data.
55
+ * - 'zod' will use `@kubb/plugin-zod` to parse the data.
62
56
  * @default 'client'
63
57
  */
64
58
  parser?: 'client' | 'zod'