@kubb/plugin-ts 3.1.0 → 3.3.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/{chunk-S3YBOGZU.cjs → chunk-2M6PDW4T.cjs} +19 -15
- package/dist/chunk-2M6PDW4T.cjs.map +1 -0
- package/dist/{chunk-AINA467R.js → chunk-65CJCKDZ.js} +46 -42
- package/dist/chunk-65CJCKDZ.js.map +1 -0
- package/dist/{chunk-D5E6VJUL.cjs → chunk-WETJULJE.cjs} +44 -41
- package/dist/chunk-WETJULJE.cjs.map +1 -0
- package/dist/{chunk-PIS5H4LF.js → chunk-Z7RYCWNL.js} +11 -7
- package/dist/chunk-Z7RYCWNL.js.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.d.cts +3 -2
- package/dist/components.d.ts +3 -2
- 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-Dy6NIaQp.d.cts → types-9taMMp9y.d.cts} +6 -0
- package/dist/{types-Dy6NIaQp.d.ts → types-9taMMp9y.d.ts} +6 -0
- package/package.json +10 -10
- package/src/components/Type.tsx +45 -39
- package/src/generators/__snapshots__/bodyUploadFileApiAssetsPost.ts +5 -5
- package/src/generators/__snapshots__/catTypeAsConst.ts +10 -10
- package/src/generators/__snapshots__/createPet.ts +27 -28
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +27 -28
- package/src/generators/__snapshots__/deletePet.ts +5 -6
- package/src/generators/__snapshots__/dogTypeAsConst.ts +10 -10
- package/src/generators/__snapshots__/enumAllOf.ts +7 -7
- package/src/generators/__snapshots__/enumArray.ts +12 -16
- package/src/generators/__snapshots__/enumInObject.ts +10 -10
- package/src/generators/__snapshots__/enumItems.ts +5 -5
- package/src/generators/__snapshots__/enumNames.ts +3 -3
- package/src/generators/__snapshots__/enumNamesConst.ts +3 -3
- package/src/generators/__snapshots__/enumNamesLiteral.ts +2 -2
- package/src/generators/__snapshots__/enumNamesPascalConst.ts +5 -5
- package/src/generators/__snapshots__/enumNamesType.ts +5 -5
- package/src/generators/__snapshots__/enumNullableMember.ts +5 -5
- package/src/generators/__snapshots__/enumNullableType.ts +5 -5
- package/src/generators/__snapshots__/enumString.ts +7 -7
- package/src/generators/__snapshots__/enumVarNamesType.ts +5 -5
- package/src/generators/__snapshots__/getPets.ts +19 -20
- package/src/generators/__snapshots__/mixedValueTypeConst.ts +6 -6
- package/src/generators/__snapshots__/nullConstNull.ts +4 -5
- package/src/generators/__snapshots__/numberValueConst.ts +6 -6
- package/src/generators/__snapshots__/petMapper.ts +14 -14
- package/src/generators/__snapshots__/petQuestionToken.ts +18 -19
- package/src/generators/__snapshots__/petQuestionTokenAndUndefined.ts +18 -19
- package/src/generators/__snapshots__/petUndefined.ts +18 -19
- package/src/generators/__snapshots__/pets.ts +13 -13
- package/src/generators/__snapshots__/petsInterface.ts +14 -0
- package/src/generators/__snapshots__/petsStoreAdvancedDiscriminator.ts +32 -29
- package/src/generators/__snapshots__/petsStoreDiscriminator.ts +10 -10
- package/src/generators/__snapshots__/petsStoreRef.ts +1 -1
- package/src/generators/__snapshots__/plainDateDate.ts +1 -1
- package/src/generators/__snapshots__/plainDateString.ts +1 -1
- package/src/generators/__snapshots__/plainEmail.ts +1 -1
- package/src/generators/__snapshots__/plainFile.ts +1 -1
- package/src/generators/__snapshots__/plainTimeDate.ts +1 -1
- package/src/generators/__snapshots__/plainUuid.ts +1 -1
- package/src/generators/__snapshots__/readOnly.ts +19 -20
- package/src/generators/__snapshots__/showPetById.ts +24 -25
- package/src/generators/__snapshots__/stringValueConst.ts +6 -6
- package/src/generators/typeGenerator.tsx +4 -2
- package/src/parser/index.ts +2 -1
- package/src/plugin.ts +2 -0
- package/src/types.ts +6 -0
- package/dist/chunk-AINA467R.js.map +0 -1
- package/dist/chunk-D5E6VJUL.cjs.map +0 -1
- package/dist/chunk-PIS5H4LF.js.map +0 -1
- package/dist/chunk-S3YBOGZU.cjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export const enumInObjectReasonEnum2 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} as const
|
|
2
|
+
created_at: 'created_at',
|
|
3
|
+
description: 'description',
|
|
4
|
+
} as const
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export type EnumInObjectReasonEnum2 = (typeof enumInObjectReasonEnum2)[keyof typeof enumInObjectReasonEnum2]
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
8
|
+
export type enumInObject = {
|
|
9
|
+
/**
|
|
10
|
+
* @type string | undefined
|
|
11
|
+
*/
|
|
12
|
+
reason?: EnumInObjectReasonEnum2
|
|
13
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const enumItemsEnum2 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} as const
|
|
2
|
+
created_at: 'created_at',
|
|
3
|
+
description: 'description',
|
|
4
|
+
} as const
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export type EnumItemsEnum2 = (typeof enumItemsEnum2)[keyof typeof enumItemsEnum2]
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export type enumItems = EnumItemsEnum2[]
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type EnumNamesTypeEnum2 = 0 | 1
|
|
1
|
+
export type EnumNamesTypeEnum2 = 0 | 1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export type enumNamesType = EnumNamesTypeEnum2
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const EnumNamesTypeEnum2 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} as const
|
|
2
|
+
Pending: 0,
|
|
3
|
+
Received: 1,
|
|
4
|
+
} as const
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type EnumNamesTypeEnum2 = (typeof EnumNamesTypeEnum2)[keyof typeof EnumNamesTypeEnum2]
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export type enumNamesType = EnumNamesTypeEnum2
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const enumNamesType = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} as const
|
|
2
|
+
Pending: 0,
|
|
3
|
+
Received: 1,
|
|
4
|
+
} as const
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export type EnumNamesTypeEnum2 = (typeof enumNamesType)[keyof typeof enumNamesType]
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export type enumNamesType = EnumNamesTypeEnum2
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const enumNullableMemberEnum2 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} as const
|
|
2
|
+
first: 'first',
|
|
3
|
+
second: 'second',
|
|
4
|
+
} as const
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export type EnumNullableMemberEnum2 = (typeof enumNullableMemberEnum2)[keyof typeof enumNullableMemberEnum2]
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export type enumNullableMember = EnumNullableMemberEnum2 | null
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const enumNullableTypeEnum2 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} as const
|
|
2
|
+
first: 'first',
|
|
3
|
+
second: 'second',
|
|
4
|
+
} as const
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export type EnumNullableTypeEnum2 = (typeof enumNullableTypeEnum2)[keyof typeof enumNullableTypeEnum2]
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export type enumNullableType = EnumNullableTypeEnum2 | null
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const enumStringEnum2 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} as const
|
|
2
|
+
created_at: 'created_at',
|
|
3
|
+
description: 'description',
|
|
4
|
+
'FILE.UPLOADED': 'FILE.UPLOADED',
|
|
5
|
+
'FILE.DOWNLOADED': 'FILE.DOWNLOADED',
|
|
6
|
+
} as const
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export type EnumStringEnum2 = (typeof enumStringEnum2)[keyof typeof enumStringEnum2]
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
export type enumString = EnumStringEnum2
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const enumVarNamesTypeEnum2 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} as const
|
|
2
|
+
Pending: 0,
|
|
3
|
+
Received: 1,
|
|
4
|
+
} as const
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export type EnumVarNamesTypeEnum2 = (typeof enumVarNamesTypeEnum2)[keyof typeof enumVarNamesTypeEnum2]
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export type enumVarNamesType = EnumVarNamesTypeEnum2
|
|
@@ -1,26 +1,25 @@
|
|
|
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
|
+
}
|
|
1
8
|
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description How many items to return at one time (max 100)
|
|
5
|
-
* @type string | undefined
|
|
6
|
-
*/
|
|
7
|
-
limit?: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
/**
|
|
9
|
+
/**
|
|
11
10
|
* @description A paged array of pets
|
|
12
|
-
*/
|
|
13
|
-
export type ListPets200 = pets
|
|
11
|
+
*/
|
|
12
|
+
export type ListPets200 = pets
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
/**
|
|
16
15
|
* @description unexpected error
|
|
17
|
-
*/
|
|
18
|
-
export type ListPetsError = error
|
|
16
|
+
*/
|
|
17
|
+
export type ListPetsError = error
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
export type ListPetsQueryResponse = listPets200
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
21
|
+
export type listPetsQuery = {
|
|
22
|
+
Response: listPets200
|
|
23
|
+
QueryParams: listPetsQueryParams
|
|
24
|
+
Errors: any
|
|
25
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
1
|
+
/**
|
|
3
2
|
* @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
|
-
*/
|
|
3
|
+
*/
|
|
5
4
|
export type nullConst = {
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
withoutValue?: null
|
|
6
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export type pet = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* @type integer, int64
|
|
4
|
+
*/
|
|
5
|
+
id: number
|
|
6
|
+
/**
|
|
7
|
+
* @type string
|
|
8
|
+
*/
|
|
9
|
+
name: string
|
|
10
|
+
/**
|
|
11
|
+
* @type string | undefined
|
|
12
|
+
*/
|
|
13
|
+
tag?: string
|
|
14
|
+
category?: string
|
|
15
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
1
|
+
export type pet = {
|
|
2
|
+
/**
|
|
3
|
+
* @type integer, int64
|
|
4
|
+
*/
|
|
5
|
+
id: number
|
|
6
|
+
/**
|
|
7
|
+
* @type string
|
|
8
|
+
*/
|
|
9
|
+
name: string
|
|
10
|
+
/**
|
|
11
|
+
* @type string | undefined
|
|
12
|
+
*/
|
|
13
|
+
tag?: string
|
|
14
|
+
/**
|
|
15
|
+
* @type object | undefined
|
|
16
|
+
*/
|
|
17
|
+
category?: category
|
|
18
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
1
|
+
export type pet = {
|
|
2
|
+
/**
|
|
3
|
+
* @type integer, int64
|
|
4
|
+
*/
|
|
5
|
+
id: number
|
|
6
|
+
/**
|
|
7
|
+
* @type string
|
|
8
|
+
*/
|
|
9
|
+
name: string
|
|
10
|
+
/**
|
|
11
|
+
* @type string | undefined
|
|
12
|
+
*/
|
|
13
|
+
tag?: string | undefined
|
|
14
|
+
/**
|
|
15
|
+
* @type object | undefined
|
|
16
|
+
*/
|
|
17
|
+
category?: category | undefined
|
|
18
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
1
|
+
export type pet = {
|
|
2
|
+
/**
|
|
3
|
+
* @type integer, int64
|
|
4
|
+
*/
|
|
5
|
+
id: number
|
|
6
|
+
/**
|
|
7
|
+
* @type string
|
|
8
|
+
*/
|
|
9
|
+
name: string
|
|
10
|
+
/**
|
|
11
|
+
* @type string | undefined
|
|
12
|
+
*/
|
|
13
|
+
tag: string | undefined
|
|
14
|
+
/**
|
|
15
|
+
* @type object | undefined
|
|
16
|
+
*/
|
|
17
|
+
category: category | undefined
|
|
18
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export type pets = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}[]
|
|
2
|
+
/**
|
|
3
|
+
* @type integer, int64
|
|
4
|
+
*/
|
|
5
|
+
id: number
|
|
6
|
+
/**
|
|
7
|
+
* @type string
|
|
8
|
+
*/
|
|
9
|
+
name: string
|
|
10
|
+
/**
|
|
11
|
+
* @type string | undefined
|
|
12
|
+
*/
|
|
13
|
+
tag?: string
|
|
14
|
+
}[]
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
+
export const advancedTypeEnum2 = {
|
|
2
|
+
enum: 'enum',
|
|
3
|
+
range: 'range',
|
|
4
|
+
regex: 'regex',
|
|
5
|
+
slider: 'slider',
|
|
6
|
+
} as const
|
|
1
7
|
|
|
2
|
-
|
|
3
|
-
"enum": "enum",
|
|
4
|
-
"range": "range",
|
|
5
|
-
"regex": "regex",
|
|
6
|
-
"slider": "slider"
|
|
7
|
-
} as const;
|
|
8
|
+
export type AdvancedTypeEnum2 = (typeof advancedTypeEnum2)[keyof typeof advancedTypeEnum2]
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
10
|
+
export type advanced =
|
|
11
|
+
| (enumerationValueSpecificationDto & {
|
|
12
|
+
/**
|
|
13
|
+
* @type string
|
|
14
|
+
*/
|
|
15
|
+
readonly type: AdvancedTypeEnum2
|
|
16
|
+
})
|
|
17
|
+
| (rangeValueSpecificationDto & {
|
|
18
|
+
/**
|
|
19
|
+
* @type string
|
|
20
|
+
*/
|
|
21
|
+
readonly type: AdvancedTypeEnum2
|
|
22
|
+
})
|
|
23
|
+
| (regexValueSpecificationDto & {
|
|
24
|
+
/**
|
|
25
|
+
* @type string
|
|
26
|
+
*/
|
|
27
|
+
readonly type: AdvancedTypeEnum2
|
|
28
|
+
})
|
|
29
|
+
| (sliderValueSpecificationDto & {
|
|
30
|
+
/**
|
|
31
|
+
* @type string
|
|
32
|
+
*/
|
|
33
|
+
readonly type: AdvancedTypeEnum2
|
|
34
|
+
})
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @description A project is an analysis project. It has a name, an id, and has a dataset
|
|
3
|
-
*/
|
|
3
|
+
*/
|
|
4
4
|
export type petstore = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
* @type integer
|
|
7
|
+
*/
|
|
8
|
+
id: number
|
|
9
|
+
/**
|
|
10
|
+
* @type array | undefined
|
|
11
|
+
*/
|
|
12
|
+
pets?: (cat | dog)[]
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type pets = pet[]
|
|
1
|
+
export type pets = pet[]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type plainDate = Date
|
|
1
|
+
export type plainDate = Date
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type plainDate = string
|
|
1
|
+
export type plainDate = string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type plainEmail = string
|
|
1
|
+
export type plainEmail = string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type plainFile = Blob
|
|
1
|
+
export type plainFile = Blob
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type plainTime = Date
|
|
1
|
+
export type plainTime = Date
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type plainUuid = string
|
|
1
|
+
export type plainUuid = string
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
1
|
+
export type demo = {
|
|
2
|
+
/**
|
|
3
|
+
* @type integer | undefined
|
|
4
|
+
*/
|
|
5
|
+
readonly attribute_readonly?: number
|
|
6
|
+
/**
|
|
7
|
+
* @description not required
|
|
8
|
+
* @type integer | undefined
|
|
9
|
+
*/
|
|
10
|
+
attribute_writeOnly?: number
|
|
11
|
+
/**
|
|
12
|
+
* @type integer | undefined
|
|
13
|
+
*/
|
|
14
|
+
readonly attribute_with_ref?: attributeReadonly
|
|
15
|
+
/**
|
|
16
|
+
* @type integer | undefined
|
|
17
|
+
*/
|
|
18
|
+
attribute_with_ref_readonly?: attributeWriteOnly
|
|
19
|
+
}
|