@kubb/plugin-ts 3.6.0 → 3.6.2
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/{chunk-4SOGPJKA.cjs → chunk-HODPITUW.cjs} +21 -21
- package/dist/{chunk-4SOGPJKA.cjs.map → chunk-HODPITUW.cjs.map} +1 -1
- package/dist/{chunk-BORNH5HV.cjs → chunk-ISG4ADLH.cjs} +93 -99
- package/dist/chunk-ISG4ADLH.cjs.map +1 -0
- package/dist/{chunk-6TOW4T6P.js → chunk-PM4CWXK4.js} +18 -18
- package/dist/{chunk-6TOW4T6P.js.map → chunk-PM4CWXK4.js.map} +1 -1
- package/dist/{chunk-ULWNGDG4.js → chunk-WBVEQ3D4.js} +93 -99
- package/dist/chunk-WBVEQ3D4.js.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{types-BJ5UjIUu.d.cts → types-DOx63BPA.d.cts} +3 -3
- package/dist/{types-BJ5UjIUu.d.ts → types-DOx63BPA.d.ts} +3 -3
- package/package.json +11 -11
- package/src/generators/__snapshots__/createPet.ts +7 -2
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +7 -2
- package/src/generators/__snapshots__/createPetWithUnknownTypeVoid.ts +38 -0
- package/src/generators/__snapshots__/enumArray.ts +2 -14
- package/src/generators/__snapshots__/enumArray20.ts +15 -0
- package/src/parser.ts +1 -0
- package/src/types.ts +1 -1
- package/dist/chunk-BORNH5HV.cjs.map +0 -1
- package/dist/chunk-ULWNGDG4.js.map +0 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Output, Group, ResolveNameParams, PluginFactoryOptions } from '@kubb/core';
|
|
2
2
|
import { Oas, contentType } from '@kubb/oas';
|
|
3
|
-
import {
|
|
3
|
+
import { Exclude, Include, Override, Generator, ResolvePathOptions } from '@kubb/plugin-oas';
|
|
4
4
|
import ts from 'typescript';
|
|
5
5
|
|
|
6
6
|
type Options = {
|
|
@@ -55,7 +55,7 @@ type Options = {
|
|
|
55
55
|
* Which type to use when the Swagger/OpenAPI file is not providing more information.
|
|
56
56
|
* @default 'any'
|
|
57
57
|
*/
|
|
58
|
-
unknownType?: 'any' | 'unknown';
|
|
58
|
+
unknownType?: 'any' | 'unknown' | 'void';
|
|
59
59
|
/**
|
|
60
60
|
* Choose what to use as mode for an optional value.
|
|
61
61
|
* @examples 'questionToken': type?: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Output, Group, ResolveNameParams, PluginFactoryOptions } from '@kubb/core';
|
|
2
2
|
import { Oas, contentType } from '@kubb/oas';
|
|
3
|
-
import {
|
|
3
|
+
import { Exclude, Include, Override, Generator, ResolvePathOptions } from '@kubb/plugin-oas';
|
|
4
4
|
import ts from 'typescript';
|
|
5
5
|
|
|
6
6
|
type Options = {
|
|
@@ -55,7 +55,7 @@ type Options = {
|
|
|
55
55
|
* Which type to use when the Swagger/OpenAPI file is not providing more information.
|
|
56
56
|
* @default 'any'
|
|
57
57
|
*/
|
|
58
|
-
unknownType?: 'any' | 'unknown';
|
|
58
|
+
unknownType?: 'any' | 'unknown' | 'void';
|
|
59
59
|
/**
|
|
60
60
|
* Choose what to use as mode for an optional value.
|
|
61
61
|
* @examples 'questionToken': type?: string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-ts",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2",
|
|
4
4
|
"description": "Generator plugin-ts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zod",
|
|
@@ -58,20 +58,20 @@
|
|
|
58
58
|
"!/**/__tests__/**"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@kubb/core": "3.6.
|
|
62
|
-
"@kubb/fs": "3.6.
|
|
63
|
-
"@kubb/oas": "3.6.
|
|
64
|
-
"@kubb/parser-ts": "3.6.
|
|
65
|
-
"@kubb/plugin-oas": "3.6.
|
|
66
|
-
"@kubb/react": "3.6.
|
|
61
|
+
"@kubb/core": "3.6.2",
|
|
62
|
+
"@kubb/fs": "3.6.2",
|
|
63
|
+
"@kubb/oas": "3.6.2",
|
|
64
|
+
"@kubb/parser-ts": "3.6.2",
|
|
65
|
+
"@kubb/plugin-oas": "3.6.2",
|
|
66
|
+
"@kubb/react": "3.6.2"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/react": "^18.3.18",
|
|
70
70
|
"react": "^18.3.1",
|
|
71
|
-
"tsup": "^8.
|
|
72
|
-
"typescript": "^5.
|
|
73
|
-
"@kubb/config-ts": "3.6.
|
|
74
|
-
"@kubb/config-tsup": "3.6.
|
|
71
|
+
"tsup": "^8.4.0",
|
|
72
|
+
"typescript": "^5.8.2",
|
|
73
|
+
"@kubb/config-ts": "3.6.2",
|
|
74
|
+
"@kubb/config-tsup": "3.6.2"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"@kubb/react": "^3.0.0"
|
|
@@ -8,6 +8,11 @@ export type CreatePets201 = error & {
|
|
|
8
8
|
name?: errorCode
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @description Accepted response
|
|
13
|
+
*/
|
|
14
|
+
export type CreatePets202 = any
|
|
15
|
+
|
|
11
16
|
/**
|
|
12
17
|
* @description unexpected error
|
|
13
18
|
*/
|
|
@@ -24,10 +29,10 @@ export type CreatePetsMutationRequest = {
|
|
|
24
29
|
tag: string
|
|
25
30
|
}
|
|
26
31
|
|
|
27
|
-
export type CreatePetsMutationResponse = createPets201
|
|
32
|
+
export type CreatePetsMutationResponse = createPets201 | createPets202
|
|
28
33
|
|
|
29
34
|
export type createPetsMutation = {
|
|
30
|
-
Response: createPets201
|
|
35
|
+
Response: createPets201 | createPets202
|
|
31
36
|
Request: createPetsMutationRequest
|
|
32
37
|
Errors: any
|
|
33
38
|
}
|
|
@@ -8,6 +8,11 @@ export type CreatePets201 = error & {
|
|
|
8
8
|
name?: errorCode
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @description Accepted response
|
|
13
|
+
*/
|
|
14
|
+
export type CreatePets202 = unknown
|
|
15
|
+
|
|
11
16
|
/**
|
|
12
17
|
* @description unexpected error
|
|
13
18
|
*/
|
|
@@ -24,10 +29,10 @@ export type CreatePetsMutationRequest = {
|
|
|
24
29
|
tag: string
|
|
25
30
|
}
|
|
26
31
|
|
|
27
|
-
export type CreatePetsMutationResponse = createPets201
|
|
32
|
+
export type CreatePetsMutationResponse = createPets201 | createPets202
|
|
28
33
|
|
|
29
34
|
export type createPetsMutation = {
|
|
30
|
-
Response: createPets201
|
|
35
|
+
Response: createPets201 | createPets202
|
|
31
36
|
Request: createPetsMutationRequest
|
|
32
37
|
Errors: any
|
|
33
38
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Null response
|
|
3
|
+
*/
|
|
4
|
+
export type CreatePets201 = error & {
|
|
5
|
+
/**
|
|
6
|
+
* @type object | undefined
|
|
7
|
+
*/
|
|
8
|
+
name?: errorCode
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description Accepted response
|
|
13
|
+
*/
|
|
14
|
+
export type CreatePets202 = void
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @description unexpected error
|
|
18
|
+
*/
|
|
19
|
+
export type CreatePetsError = error
|
|
20
|
+
|
|
21
|
+
export type CreatePetsMutationRequest = {
|
|
22
|
+
/**
|
|
23
|
+
* @type string
|
|
24
|
+
*/
|
|
25
|
+
name: string
|
|
26
|
+
/**
|
|
27
|
+
* @type string
|
|
28
|
+
*/
|
|
29
|
+
tag: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type CreatePetsMutationResponse = createPets201 | createPets202
|
|
33
|
+
|
|
34
|
+
export type createPetsMutation = {
|
|
35
|
+
Response: createPets201 | createPets202
|
|
36
|
+
Request: createPetsMutationRequest
|
|
37
|
+
Errors: any
|
|
38
|
+
}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
NW: 'NW',
|
|
3
|
-
NE: 'NE',
|
|
4
|
-
SW: 'SW',
|
|
5
|
-
SE: 'SE',
|
|
6
|
-
} as const
|
|
1
|
+
export type EnumArrayEnum2 = 'NW' | 'NE' | 'SW' | 'SE'
|
|
7
2
|
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
export type enumArray = {
|
|
11
|
-
/**
|
|
12
|
-
* @type array | undefined
|
|
13
|
-
*/
|
|
14
|
-
identifier?: [number, string, EnumArrayIdentifierEnum2]
|
|
15
|
-
}
|
|
3
|
+
export type enumArray = EnumArrayEnum2[]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const enumArrayIdentifierEnum2 = {
|
|
2
|
+
NW: 'NW',
|
|
3
|
+
NE: 'NE',
|
|
4
|
+
SW: 'SW',
|
|
5
|
+
SE: 'SE',
|
|
6
|
+
} as const
|
|
7
|
+
|
|
8
|
+
export type EnumArrayIdentifierEnum2 = (typeof enumArrayIdentifierEnum2)[keyof typeof enumArrayIdentifierEnum2]
|
|
9
|
+
|
|
10
|
+
export type enumArray = {
|
|
11
|
+
/**
|
|
12
|
+
* @type array | undefined
|
|
13
|
+
*/
|
|
14
|
+
identifier?: [number, string, EnumArrayIdentifierEnum2]
|
|
15
|
+
}
|
package/src/parser.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type ts from 'typescript'
|
|
|
8
8
|
export const typeKeywordMapper = {
|
|
9
9
|
any: () => factory.keywordTypeNodes.any,
|
|
10
10
|
unknown: () => factory.keywordTypeNodes.unknown,
|
|
11
|
+
void: () => factory.keywordTypeNodes.void,
|
|
11
12
|
number: () => factory.keywordTypeNodes.number,
|
|
12
13
|
integer: () => factory.keywordTypeNodes.number,
|
|
13
14
|
object: (nodes?: ts.TypeElement[]) => {
|
package/src/types.ts
CHANGED
|
@@ -55,7 +55,7 @@ export type Options = {
|
|
|
55
55
|
* Which type to use when the Swagger/OpenAPI file is not providing more information.
|
|
56
56
|
* @default 'any'
|
|
57
57
|
*/
|
|
58
|
-
unknownType?: 'any' | 'unknown'
|
|
58
|
+
unknownType?: 'any' | 'unknown' | 'void'
|
|
59
59
|
/**
|
|
60
60
|
* Choose what to use as mode for an optional value.
|
|
61
61
|
* @examples 'questionToken': type?: string
|