@kubb/plugin-ts 3.0.0-alpha.9 → 3.0.0-beta.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/README.md +14 -5
- package/dist/{chunk-UVAKTXUA.js → chunk-AG2BUY33.js} +86 -398
- package/dist/chunk-AG2BUY33.js.map +1 -0
- package/dist/chunk-L7QZ6DBL.cjs +332 -0
- package/dist/chunk-L7QZ6DBL.cjs.map +1 -0
- package/dist/chunk-QZ2DBYXR.js +303 -0
- package/dist/chunk-QZ2DBYXR.js.map +1 -0
- package/dist/{chunk-PV5Q7I5O.cjs → chunk-XMTK3ZZE.cjs} +185 -470
- package/dist/chunk-XMTK3ZZE.cjs.map +1 -0
- package/dist/components.cjs +11 -12
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +14 -44
- package/dist/components.d.ts +14 -44
- package/dist/components.js +2 -16
- package/dist/components.js.map +1 -1
- package/dist/generators.cjs +17 -0
- package/dist/generators.cjs.map +1 -0
- package/dist/generators.d.cts +10 -0
- package/dist/generators.d.ts +10 -0
- package/dist/generators.js +4 -0
- package/dist/generators.js.map +1 -0
- package/dist/index.cjs +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -123
- package/dist/index.d.ts +4 -123
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/dist/types-DoCOabdx.d.cts +98 -0
- package/dist/types-DoCOabdx.d.ts +98 -0
- package/package.json +21 -15
- package/src/components/OasType.tsx +3 -50
- package/src/components/{Schema.tsx → Type.tsx} +19 -54
- package/src/components/index.ts +1 -2
- package/src/generators/__snapshots__/bodyUploadFileApiAssetsPost.ts +6 -0
- package/src/generators/__snapshots__/catTypeAsConst.ts +11 -0
- package/src/generators/__snapshots__/createPet.ts +41 -0
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +41 -0
- package/src/generators/__snapshots__/deletePet.ts +5 -0
- package/src/generators/__snapshots__/dogTypeAsConst.ts +11 -0
- package/src/generators/__snapshots__/enumAllOf.ts +10 -0
- package/src/generators/__snapshots__/enumArray.ts +19 -0
- package/src/generators/__snapshots__/enumInObject.ts +13 -0
- package/src/generators/__snapshots__/enumItems.ts +8 -0
- package/src/generators/__snapshots__/enumNames.ts +6 -0
- package/src/generators/__snapshots__/enumNamesConst.ts +6 -0
- package/src/generators/__snapshots__/enumNamesLiteral.ts +3 -0
- package/src/generators/__snapshots__/enumNamesPascalConst.ts +8 -0
- package/src/generators/__snapshots__/enumNamesType.ts +8 -0
- package/src/generators/__snapshots__/enumNullableMember.ts +8 -0
- package/src/generators/__snapshots__/enumNullableType.ts +8 -0
- package/src/generators/__snapshots__/enumString.ts +10 -0
- package/src/generators/__snapshots__/enumVarNamesType.ts +8 -0
- package/src/generators/__snapshots__/getPets.ts +27 -0
- package/src/generators/__snapshots__/mixedValueTypeConst.ts +9 -0
- package/src/generators/__snapshots__/nullConstNull.ts +7 -0
- package/src/generators/__snapshots__/numberValueConst.ts +9 -0
- package/src/generators/__snapshots__/petMapper.ts +15 -0
- package/src/generators/__snapshots__/petQuestionToken.ts +19 -0
- package/src/generators/__snapshots__/petQuestionTokenAndUndefined.ts +19 -0
- package/src/generators/__snapshots__/petUndefined.ts +19 -0
- package/src/generators/__snapshots__/pets.ts +14 -0
- package/src/generators/__snapshots__/petsStoreAdvancedDiscriminator.ts +31 -0
- package/src/generators/__snapshots__/petsStoreDiscriminator.ts +13 -0
- package/src/generators/__snapshots__/petsStoreRef.ts +1 -0
- package/src/generators/__snapshots__/plainDateDate.ts +1 -0
- package/src/generators/__snapshots__/plainDateString.ts +1 -0
- package/src/generators/__snapshots__/plainEmail.ts +1 -0
- package/src/generators/__snapshots__/plainFile.ts +1 -0
- package/src/generators/__snapshots__/plainTimeDate.ts +1 -0
- package/src/generators/__snapshots__/plainUuid.ts +1 -0
- package/src/generators/__snapshots__/readOnly.ts +20 -0
- package/src/{components/__snapshots__/Schema → generators/__snapshots__}/showPetById.ts +9 -9
- package/src/generators/__snapshots__/stringValueConst.ts +9 -0
- package/src/generators/index.ts +2 -0
- package/src/generators/oasGenerator.tsx +29 -0
- package/src/generators/typeGenerator.tsx +200 -0
- package/src/parser/index.ts +12 -3
- package/src/plugin.ts +26 -33
- package/src/types.ts +16 -52
- package/dist/chunk-PV5Q7I5O.cjs.map +0 -1
- package/dist/chunk-SEH6NUCX.cjs +0 -42
- package/dist/chunk-SEH6NUCX.cjs.map +0 -1
- package/dist/chunk-TTGZBH7H.js +0 -42
- package/dist/chunk-TTGZBH7H.js.map +0 -1
- package/dist/chunk-UVAKTXUA.js.map +0 -1
- package/dist/oas.cjs +0 -7
- package/dist/oas.cjs.map +0 -1
- package/dist/oas.d.cts +0 -1
- package/dist/oas.d.ts +0 -1
- package/dist/oas.js +0 -7
- package/dist/oas.js.map +0 -1
- package/src/OperationGenerator.tsx +0 -49
- package/src/SchemaGenerator.tsx +0 -31
- package/src/components/OperationSchema.tsx +0 -161
- package/src/components/__snapshots__/Schema/pets.ts +0 -27
- package/src/oas/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-ts",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
4
4
|
"description": "Generator plugin-ts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zod",
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
"require": "./dist/index.cjs",
|
|
26
26
|
"default": "./dist/index.cjs"
|
|
27
27
|
},
|
|
28
|
+
"./generators": {
|
|
29
|
+
"import": "./dist/generators.js",
|
|
30
|
+
"require": "./dist/generators.cjs",
|
|
31
|
+
"default": "./dist/generators.cjs"
|
|
32
|
+
},
|
|
28
33
|
"./components": {
|
|
29
34
|
"import": "./dist/components.js",
|
|
30
35
|
"require": "./dist/components.cjs",
|
|
@@ -40,6 +45,9 @@
|
|
|
40
45
|
"*": {
|
|
41
46
|
"components": [
|
|
42
47
|
"./dist/components.d.ts"
|
|
48
|
+
],
|
|
49
|
+
"generators": [
|
|
50
|
+
"./dist/generators.d.ts"
|
|
43
51
|
]
|
|
44
52
|
}
|
|
45
53
|
},
|
|
@@ -50,25 +58,23 @@
|
|
|
50
58
|
"!/**/__tests__/**"
|
|
51
59
|
],
|
|
52
60
|
"dependencies": {
|
|
53
|
-
"@kubb/core": "3.0.0-
|
|
54
|
-
"@kubb/fs": "3.0.0-
|
|
55
|
-
"@kubb/oas": "3.0.0-
|
|
56
|
-
"@kubb/parser-ts": "3.0.0-
|
|
57
|
-
"@kubb/plugin-oas": "3.0.0-
|
|
58
|
-
"@kubb/react": "3.0.0-
|
|
61
|
+
"@kubb/core": "3.0.0-beta.2",
|
|
62
|
+
"@kubb/fs": "3.0.0-beta.2",
|
|
63
|
+
"@kubb/oas": "3.0.0-beta.2",
|
|
64
|
+
"@kubb/parser-ts": "3.0.0-beta.2",
|
|
65
|
+
"@kubb/plugin-oas": "3.0.0-beta.2",
|
|
66
|
+
"@kubb/react": "3.0.0-beta.2"
|
|
59
67
|
},
|
|
60
68
|
"devDependencies": {
|
|
61
|
-
"@types/react": "^18.3.
|
|
62
|
-
"prettier": "^3.3.3",
|
|
69
|
+
"@types/react": "^18.3.11",
|
|
63
70
|
"react": "^18.3.1",
|
|
64
|
-
"tsup": "^8.
|
|
65
|
-
"typescript": "^5.
|
|
66
|
-
"@kubb/config-
|
|
67
|
-
"@kubb/config-
|
|
68
|
-
"@kubb/config-tsup": "3.0.0-alpha.9"
|
|
71
|
+
"tsup": "^8.3.0",
|
|
72
|
+
"typescript": "^5.6.2",
|
|
73
|
+
"@kubb/config-ts": "3.0.0-beta.2",
|
|
74
|
+
"@kubb/config-tsup": "3.0.0-beta.2"
|
|
69
75
|
},
|
|
70
76
|
"peerDependencies": {
|
|
71
|
-
"@kubb/react": "3.0.0-
|
|
77
|
+
"@kubb/react": "3.0.0-beta.2"
|
|
72
78
|
},
|
|
73
79
|
"engines": {
|
|
74
80
|
"node": ">=20"
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { File, Type, useApp } from '@kubb/react'
|
|
1
|
+
import { File, Type } from '@kubb/react'
|
|
3
2
|
|
|
4
3
|
import type { OasTypes } from '@kubb/oas'
|
|
5
4
|
import type { ReactNode } from 'react'
|
|
6
|
-
import type { FileMeta, PluginTs } from '../types.ts'
|
|
7
5
|
|
|
8
|
-
type
|
|
6
|
+
type Props = {
|
|
9
7
|
/**
|
|
10
8
|
* Name of the function
|
|
11
9
|
*/
|
|
@@ -14,7 +12,7 @@ type TemplateProps = {
|
|
|
14
12
|
api: OasTypes.OASDocument
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
function
|
|
15
|
+
export function OasType({ name, typeName, api }: Props): ReactNode {
|
|
18
16
|
return (
|
|
19
17
|
<>
|
|
20
18
|
<File.Source name={name} isExportable isIndexable>
|
|
@@ -29,48 +27,3 @@ function Template({ name, typeName, api }: TemplateProps): ReactNode {
|
|
|
29
27
|
</>
|
|
30
28
|
)
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
const defaultTemplates = { default: Template } as const
|
|
34
|
-
|
|
35
|
-
type Props = {
|
|
36
|
-
name: string
|
|
37
|
-
typeName: string
|
|
38
|
-
/**
|
|
39
|
-
* This will make it possible to override the default behaviour.
|
|
40
|
-
*/
|
|
41
|
-
Template?: React.ComponentType<React.ComponentProps<typeof Template>>
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function OasType({ name, typeName, Template = defaultTemplates.default }: Props): ReactNode {
|
|
45
|
-
const oas = useOas()
|
|
46
|
-
|
|
47
|
-
return <Template name={name} typeName={typeName} api={oas.api} />
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
type FileProps = {
|
|
51
|
-
name: string
|
|
52
|
-
typeName: string
|
|
53
|
-
/**
|
|
54
|
-
* This will make it possible to override the default behaviour.
|
|
55
|
-
*/
|
|
56
|
-
templates?: typeof defaultTemplates
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
OasType.File = function ({ name, typeName, templates = defaultTemplates }: FileProps): ReactNode {
|
|
60
|
-
const {
|
|
61
|
-
pluginManager,
|
|
62
|
-
plugin: { key: pluginKey },
|
|
63
|
-
} = useApp<PluginTs>()
|
|
64
|
-
const file = pluginManager.getFile({ name, extName: '.ts', pluginKey })
|
|
65
|
-
|
|
66
|
-
const Template = templates.default
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>
|
|
70
|
-
<File.Import name={['Infer']} path="@kubb/oas" isTypeOnly />
|
|
71
|
-
<OasType Template={Template} name={name} typeName={typeName} />
|
|
72
|
-
</File>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
OasType.templates = defaultTemplates
|
|
@@ -1,48 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { File, useApp } from '@kubb/react'
|
|
1
|
+
import { File } from '@kubb/react'
|
|
3
2
|
|
|
4
3
|
import transformers from '@kubb/core/transformers'
|
|
5
|
-
import { print
|
|
4
|
+
import { print } from '@kubb/parser-ts'
|
|
6
5
|
import * as factory from '@kubb/parser-ts/factory'
|
|
7
|
-
import { SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'
|
|
8
|
-
import { useSchema } from '@kubb/plugin-oas/hooks'
|
|
6
|
+
import { type Schema, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'
|
|
9
7
|
import { Fragment, type ReactNode } from 'react'
|
|
8
|
+
import type ts from 'typescript'
|
|
10
9
|
import { parse, typeKeywordMapper } from '../parser/index.ts'
|
|
11
|
-
import { pluginTsName } from '../plugin.ts'
|
|
12
10
|
import type { PluginTs } from '../types.ts'
|
|
13
11
|
|
|
14
12
|
type Props = {
|
|
13
|
+
name: string
|
|
14
|
+
typedName: string
|
|
15
|
+
tree: Array<Schema>
|
|
16
|
+
optionalType: PluginTs['resolvedOptions']['optionalType']
|
|
17
|
+
enumType: PluginTs['resolvedOptions']['enumType']
|
|
18
|
+
mapper: PluginTs['resolvedOptions']['mapper']
|
|
15
19
|
description?: string
|
|
16
20
|
keysToOmit?: string[]
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
export function
|
|
20
|
-
const { keysToOmit, description } = props
|
|
21
|
-
const { tree, name } = useSchema()
|
|
22
|
-
const {
|
|
23
|
-
pluginManager,
|
|
24
|
-
plugin: {
|
|
25
|
-
options: { mapper, enumType, optionalType },
|
|
26
|
-
},
|
|
27
|
-
} = useApp<PluginTs>()
|
|
28
|
-
|
|
29
|
-
if (enumType === 'asPascalConst') {
|
|
30
|
-
pluginManager.logger.emit('warning', `enumType '${enumType}' is deprecated`)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// all checks are also inside this.schema(React)
|
|
34
|
-
const resolvedName = pluginManager.resolveName({
|
|
35
|
-
name,
|
|
36
|
-
pluginKey: [pluginTsName],
|
|
37
|
-
type: 'function',
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
const typeName = pluginManager.resolveName({
|
|
41
|
-
name,
|
|
42
|
-
pluginKey: [pluginTsName],
|
|
43
|
-
type: 'type',
|
|
44
|
-
})
|
|
45
|
-
|
|
23
|
+
export function Type({ name, typedName, tree, keysToOmit, optionalType, enumType, mapper, description }: Props): ReactNode {
|
|
46
24
|
const typeNodes: ts.Node[] = []
|
|
47
25
|
|
|
48
26
|
if (!tree.length) {
|
|
@@ -57,8 +35,8 @@ export function Schema(props: Props): ReactNode {
|
|
|
57
35
|
(tree
|
|
58
36
|
.map((schema) =>
|
|
59
37
|
parse(undefined, schema, {
|
|
60
|
-
name
|
|
61
|
-
typeName,
|
|
38
|
+
name,
|
|
39
|
+
typeName: typedName,
|
|
62
40
|
description,
|
|
63
41
|
keysToOmit,
|
|
64
42
|
optionalType,
|
|
@@ -89,7 +67,7 @@ export function Schema(props: Props): ReactNode {
|
|
|
89
67
|
|
|
90
68
|
const node = factory.createTypeAliasDeclaration({
|
|
91
69
|
modifiers: [factory.modifiers.export],
|
|
92
|
-
name
|
|
70
|
+
name,
|
|
93
71
|
type: keysToOmit?.length
|
|
94
72
|
? factory.createOmitDeclaration({
|
|
95
73
|
keys: keysToOmit,
|
|
@@ -101,7 +79,7 @@ export function Schema(props: Props): ReactNode {
|
|
|
101
79
|
|
|
102
80
|
const enumSchemas = SchemaGenerator.deepSearch(tree, schemaKeywords.enum)
|
|
103
81
|
|
|
104
|
-
const enums = enumSchemas.map((enumSchema) => {
|
|
82
|
+
const enums = [...new Set(enumSchemas)].map((enumSchema) => {
|
|
105
83
|
const name = enumType === 'asPascalConst' ? transformers.pascalCase(enumSchema.args.name) : transformers.camelCase(enumSchema.args.name)
|
|
106
84
|
const typeName = enumSchema.args.typeName
|
|
107
85
|
|
|
@@ -135,34 +113,21 @@ export function Schema(props: Props): ReactNode {
|
|
|
135
113
|
<Fragment key={[name, nameNode].join('-')}>
|
|
136
114
|
{nameNode && (
|
|
137
115
|
<File.Source name={name} isExportable isIndexable>
|
|
138
|
-
{print(nameNode)}
|
|
116
|
+
{print([nameNode])}
|
|
139
117
|
</File.Source>
|
|
140
118
|
)}
|
|
141
119
|
{
|
|
142
120
|
<File.Source name={typeName} isIndexable isExportable={['enum', 'asConst', 'constEnum', 'literal', undefined].includes(enumType)} isTypeOnly>
|
|
143
|
-
{print(typeNode)}
|
|
121
|
+
{print([typeNode])}
|
|
144
122
|
</File.Source>
|
|
145
123
|
}
|
|
146
124
|
</Fragment>
|
|
147
125
|
))}
|
|
148
|
-
{enums.every((item) => item.typeName !==
|
|
149
|
-
<File.Source name={
|
|
126
|
+
{enums.every((item) => item.typeName !== name) && (
|
|
127
|
+
<File.Source name={typedName} isTypeOnly isExportable isIndexable>
|
|
150
128
|
{print(typeNodes)}
|
|
151
129
|
</File.Source>
|
|
152
130
|
)}
|
|
153
131
|
</Fragment>
|
|
154
132
|
)
|
|
155
133
|
}
|
|
156
|
-
|
|
157
|
-
type FileProps = {}
|
|
158
|
-
|
|
159
|
-
Schema.File = function ({}: FileProps): ReactNode {
|
|
160
|
-
const { pluginManager } = useApp<PluginTs>()
|
|
161
|
-
const { schema } = useSchema()
|
|
162
|
-
|
|
163
|
-
return (
|
|
164
|
-
<Oas.Schema.File isTypeOnly output={pluginManager.config.output.path}>
|
|
165
|
-
<Schema description={schema?.description} />
|
|
166
|
-
</Oas.Schema.File>
|
|
167
|
-
)
|
|
168
|
-
}
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @description Null response
|
|
4
|
+
*/
|
|
5
|
+
export type CreatePets201 = (error & {
|
|
6
|
+
/**
|
|
7
|
+
* @type object | undefined
|
|
8
|
+
*/
|
|
9
|
+
name?: errorCode;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description unexpected error
|
|
14
|
+
*/
|
|
15
|
+
export type CreatePetsError = error;
|
|
16
|
+
|
|
17
|
+
export type CreatePetsMutationRequest = {
|
|
18
|
+
/**
|
|
19
|
+
* @type string
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* @type string
|
|
24
|
+
*/
|
|
25
|
+
tag: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @description Null response
|
|
30
|
+
*/
|
|
31
|
+
export type CreatePetsMutationResponse = (error & {
|
|
32
|
+
/**
|
|
33
|
+
* @type object | undefined
|
|
34
|
+
*/
|
|
35
|
+
name?: errorCode;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type createPetsMutation = {
|
|
39
|
+
Response: createPetsMutationResponse;
|
|
40
|
+
Request: createPetsMutationRequest;
|
|
41
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @description Null response
|
|
4
|
+
*/
|
|
5
|
+
export type CreatePets201 = (error & {
|
|
6
|
+
/**
|
|
7
|
+
* @type object | undefined
|
|
8
|
+
*/
|
|
9
|
+
name?: errorCode;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description unexpected error
|
|
14
|
+
*/
|
|
15
|
+
export type CreatePetsError = error;
|
|
16
|
+
|
|
17
|
+
export type CreatePetsMutationRequest = {
|
|
18
|
+
/**
|
|
19
|
+
* @type string
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* @type string
|
|
24
|
+
*/
|
|
25
|
+
tag: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @description Null response
|
|
30
|
+
*/
|
|
31
|
+
export type CreatePetsMutationResponse = (error & {
|
|
32
|
+
/**
|
|
33
|
+
* @type object | undefined
|
|
34
|
+
*/
|
|
35
|
+
name?: errorCode;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type createPetsMutation = {
|
|
39
|
+
Response: createPetsMutationResponse;
|
|
40
|
+
Request: createPetsMutationRequest;
|
|
41
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const enumAllOfReasonEnum2 = {
|
|
2
|
+
"created_at": "created_at",
|
|
3
|
+
"description": "description"
|
|
4
|
+
} as const;
|
|
5
|
+
|
|
6
|
+
export type EnumAllOfReasonEnum2 = (typeof enumAllOfReasonEnum2)[keyof typeof enumAllOfReasonEnum2];
|
|
7
|
+
|
|
8
|
+
export type enumAllOf = {
|
|
9
|
+
reason?: EnumAllOfReasonEnum2;
|
|
10
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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?: [
|
|
15
|
+
number,
|
|
16
|
+
string,
|
|
17
|
+
EnumArrayIdentifierEnum2
|
|
18
|
+
];
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const enumInObjectReasonEnum2 = {
|
|
2
|
+
"created_at": "created_at",
|
|
3
|
+
"description": "description"
|
|
4
|
+
} as const;
|
|
5
|
+
|
|
6
|
+
export type EnumInObjectReasonEnum2 = (typeof enumInObjectReasonEnum2)[keyof typeof enumInObjectReasonEnum2];
|
|
7
|
+
|
|
8
|
+
export type enumInObject = {
|
|
9
|
+
/**
|
|
10
|
+
* @type string | undefined
|
|
11
|
+
*/
|
|
12
|
+
reason?: EnumInObjectReasonEnum2;
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const enumNullableMemberEnum2 = {
|
|
2
|
+
"first": "first",
|
|
3
|
+
"second": "second"
|
|
4
|
+
} as const;
|
|
5
|
+
|
|
6
|
+
export type EnumNullableMemberEnum2 = (typeof enumNullableMemberEnum2)[keyof typeof enumNullableMemberEnum2];
|
|
7
|
+
|
|
8
|
+
export type enumNullableMember = EnumNullableMemberEnum2 | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const enumNullableTypeEnum2 = {
|
|
2
|
+
"first": "first",
|
|
3
|
+
"second": "second"
|
|
4
|
+
} as const;
|
|
5
|
+
|
|
6
|
+
export type EnumNullableTypeEnum2 = (typeof enumNullableTypeEnum2)[keyof typeof enumNullableTypeEnum2];
|
|
7
|
+
|
|
8
|
+
export type enumNullableType = EnumNullableTypeEnum2 | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const enumStringEnum2 = {
|
|
2
|
+
"created_at": "created_at",
|
|
3
|
+
"description": "description",
|
|
4
|
+
"FILE.UPLOADED": "FILE.UPLOADED",
|
|
5
|
+
"FILE.DOWNLOADED": "FILE.DOWNLOADED"
|
|
6
|
+
} as const;
|
|
7
|
+
|
|
8
|
+
export type EnumStringEnum2 = (typeof enumStringEnum2)[keyof typeof enumStringEnum2];
|
|
9
|
+
|
|
10
|
+
export type enumString = EnumStringEnum2;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type ListPetsQueryParams = {
|
|
2
|
+
/**
|
|
3
|
+
* @description How many items to return at one time (max 100)
|
|
4
|
+
* @type string | undefined
|
|
5
|
+
*/
|
|
6
|
+
limit?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @description A paged array of pets
|
|
11
|
+
*/
|
|
12
|
+
export type ListPets200 = pets;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @description unexpected error
|
|
16
|
+
*/
|
|
17
|
+
export type ListPetsError = error;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description A paged array of pets
|
|
21
|
+
*/
|
|
22
|
+
export type ListPetsQueryResponse = pets;
|
|
23
|
+
|
|
24
|
+
export type listPetsQuery = {
|
|
25
|
+
Response: listPetsQueryResponse;
|
|
26
|
+
QueryParams: listPetsQueryParams;
|
|
27
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @description The value of this keyword MAY be null.\nUse of this keyword is functionally equivalent to an \"enum\" (Section 6.1.2) with a single value.\nAn instance validates successfully against this keyword if its value is equal to the value of the keyword.\n
|
|
4
|
+
*/
|
|
5
|
+
export type nullConst = {
|
|
6
|
+
withoutValue?: null;
|
|
7
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
export type pet = {
|
|
3
|
+
/**
|
|
4
|
+
* @type integer, int64
|
|
5
|
+
*/
|
|
6
|
+
id: number;
|
|
7
|
+
/**
|
|
8
|
+
* @type string
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* @type string | undefined
|
|
13
|
+
*/
|
|
14
|
+
tag?: string;
|
|
15
|
+
/**
|
|
16
|
+
* @type object | undefined
|
|
17
|
+
*/
|
|
18
|
+
category?: category;
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
export type pet = {
|
|
3
|
+
/**
|
|
4
|
+
* @type integer, int64
|
|
5
|
+
*/
|
|
6
|
+
id: number;
|
|
7
|
+
/**
|
|
8
|
+
* @type string
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* @type string | undefined
|
|
13
|
+
*/
|
|
14
|
+
tag?: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* @type object | undefined
|
|
17
|
+
*/
|
|
18
|
+
category?: category | undefined;
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
export type pet = {
|
|
3
|
+
/**
|
|
4
|
+
* @type integer, int64
|
|
5
|
+
*/
|
|
6
|
+
id: number;
|
|
7
|
+
/**
|
|
8
|
+
* @type string
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* @type string | undefined
|
|
13
|
+
*/
|
|
14
|
+
tag: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* @type object | undefined
|
|
17
|
+
*/
|
|
18
|
+
category: category | undefined;
|
|
19
|
+
};
|