@kubb/plugin-client 4.27.4 → 4.28.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/dist/generators.d.cts
CHANGED
|
@@ -371,6 +371,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
371
371
|
};
|
|
372
372
|
type SchemaGeneratorOptions = {
|
|
373
373
|
dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
|
|
374
|
+
integerType?: 'number' | 'bigint';
|
|
374
375
|
unknownType: 'any' | 'unknown' | 'void';
|
|
375
376
|
emptySchemaType: 'any' | 'unknown' | 'void';
|
|
376
377
|
enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral';
|
package/dist/generators.d.ts
CHANGED
|
@@ -371,6 +371,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
371
371
|
};
|
|
372
372
|
type SchemaGeneratorOptions = {
|
|
373
373
|
dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
|
|
374
|
+
integerType?: 'number' | 'bigint';
|
|
374
375
|
unknownType: 'any' | 'unknown' | 'void';
|
|
375
376
|
emptySchemaType: 'any' | 'unknown' | 'void';
|
|
376
377
|
enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.28.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",
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
],
|
|
112
112
|
"dependencies": {
|
|
113
113
|
"@kubb/react-fabric": "0.12.11",
|
|
114
|
-
"@kubb/core": "4.
|
|
115
|
-
"@kubb/
|
|
116
|
-
"@kubb/plugin-
|
|
117
|
-
"@kubb/plugin-
|
|
118
|
-
"@kubb/
|
|
114
|
+
"@kubb/core": "4.28.0",
|
|
115
|
+
"@kubb/oas": "4.28.0",
|
|
116
|
+
"@kubb/plugin-oas": "4.28.0",
|
|
117
|
+
"@kubb/plugin-ts": "4.28.0",
|
|
118
|
+
"@kubb/plugin-zod": "4.28.0"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"axios": "^1.13.5"
|
|
@@ -0,0 +1,34 @@
|
|
|
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 getCreateOrderUrl() {
|
|
10
|
+
const res = { method: 'POST', url: `/orders` as const }
|
|
11
|
+
return res
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* {@link /orders}
|
|
16
|
+
*/
|
|
17
|
+
export async function createOrder(
|
|
18
|
+
data: CreateOrderMutationRequest,
|
|
19
|
+
headers?: CreateOrderHeaderParams,
|
|
20
|
+
config: Partial<RequestConfig<CreateOrderMutationRequest>> & { client?: Client } = {},
|
|
21
|
+
) {
|
|
22
|
+
const { client: request = fetch, ...requestConfig } = config
|
|
23
|
+
|
|
24
|
+
const requestData = data
|
|
25
|
+
|
|
26
|
+
const res = await request<CreateOrderMutationResponse, ResponseErrorConfig<Error>, CreateOrderMutationRequest>({
|
|
27
|
+
method: 'POST',
|
|
28
|
+
url: getCreateOrderUrl().url.toString(),
|
|
29
|
+
data: requestData,
|
|
30
|
+
...requestConfig,
|
|
31
|
+
headers: { ...headers, ...requestConfig.headers },
|
|
32
|
+
})
|
|
33
|
+
return res.data
|
|
34
|
+
}
|