@kubb/plugin-ts 3.16.2 → 3.16.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.
Files changed (39) hide show
  1. package/dist/components-6F5RoYuJ.js +2240 -0
  2. package/dist/components-6F5RoYuJ.js.map +1 -0
  3. package/dist/components-B-Jx1kI5.cjs +2256 -0
  4. package/dist/components-B-Jx1kI5.cjs.map +1 -0
  5. package/dist/components.cjs +3 -15
  6. package/dist/components.d.cts +40 -26
  7. package/dist/components.d.ts +40 -26
  8. package/dist/components.js +3 -3
  9. package/dist/generators.cjs +4 -16
  10. package/dist/generators.d.cts +8 -9
  11. package/dist/generators.d.ts +8 -9
  12. package/dist/generators.js +4 -4
  13. package/dist/index.cjs +4 -17
  14. package/dist/index.d.cts +6 -8
  15. package/dist/index.d.ts +6 -8
  16. package/dist/index.js +3 -6
  17. package/dist/plugin-BXxI6FcR.cjs +378 -0
  18. package/dist/plugin-BXxI6FcR.cjs.map +1 -0
  19. package/dist/plugin-DXUISuTd.js +355 -0
  20. package/dist/plugin-DXUISuTd.js.map +1 -0
  21. package/dist/types-BL0qEGbB.d.cts +1223 -0
  22. package/dist/types-DFDnGwpy.d.ts +1223 -0
  23. package/package.json +22 -27
  24. package/dist/chunk-AUYOLJ62.js +0 -358
  25. package/dist/chunk-AUYOLJ62.js.map +0 -1
  26. package/dist/chunk-NAZDWNS6.cjs +0 -387
  27. package/dist/chunk-NAZDWNS6.cjs.map +0 -1
  28. package/dist/chunk-NDI35YW5.cjs +0 -2611
  29. package/dist/chunk-NDI35YW5.cjs.map +0 -1
  30. package/dist/chunk-V4C2DOV5.js +0 -2585
  31. package/dist/chunk-V4C2DOV5.js.map +0 -1
  32. package/dist/components.cjs.map +0 -1
  33. package/dist/components.js.map +0 -1
  34. package/dist/generators.cjs.map +0 -1
  35. package/dist/generators.js.map +0 -1
  36. package/dist/index.cjs.map +0 -1
  37. package/dist/index.js.map +0 -1
  38. package/dist/types-DkvPgLAK.d.cts +0 -116
  39. package/dist/types-DkvPgLAK.d.ts +0 -116
@@ -1,116 +0,0 @@
1
- import { Output, Group, ResolveNameParams, PluginFactoryOptions } from '@kubb/core';
2
- import { Oas, contentType } from '@kubb/oas';
3
- import { Exclude, Include, Override, Generator, ResolvePathOptions } from '@kubb/plugin-oas';
4
- import ts from 'typescript';
5
-
6
- type Options = {
7
- /**
8
- * Specify the export location for the files and define the behavior of the output
9
- * @default { path: 'types', barrelType: 'named' }
10
- */
11
- output?: Output<Oas>;
12
- /**
13
- * Define which contentType should be used.
14
- * By default, the first JSON valid mediaType will be used
15
- */
16
- contentType?: contentType;
17
- /**
18
- * Group the clients based on the provided name.
19
- */
20
- group?: Group;
21
- /**
22
- * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
23
- */
24
- exclude?: Array<Exclude>;
25
- /**
26
- * Array containing include parameters to include tags/operations/methods/paths.
27
- */
28
- include?: Array<Include>;
29
- /**
30
- * Array containing override parameters to override `options` based on tags/operations/methods/paths.
31
- */
32
- override?: Array<Override<ResolvedOptions>>;
33
- /**
34
- * Choose to use `enum` or `as const` for enums
35
- * @default 'asConst'
36
- * asPascalConst is deprecated
37
- */
38
- enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal';
39
- /**
40
- * Switch between type or interface for creating TypeScript types
41
- * @default 'type'
42
- */
43
- syntaxType?: 'type' | 'interface';
44
- /**
45
- * Set a suffix for the generated enums.
46
- * @default 'enum'
47
- */
48
- enumSuffix?: string;
49
- /**
50
- * Choose to use `date` or `datetime` as JavaScript `Date` instead of `string`.
51
- * @default 'string'
52
- */
53
- dateType?: 'string' | 'date';
54
- /**
55
- * Which type to use when the Swagger/OpenAPI file is not providing more information.
56
- * @default 'any'
57
- */
58
- unknownType?: 'any' | 'unknown' | 'void';
59
- /**
60
- * Which type to use for empty schema values
61
- * @default `unknownType`
62
- */
63
- emptySchemaType?: 'any' | 'unknown' | 'void';
64
- /**
65
- * Choose what to use as mode for an optional value.
66
- * @examples 'questionToken': type?: string
67
- * @examples 'undefined': type: string | undefined
68
- * @examples 'questionTokenAndUndefined': type?: string | undefined
69
- * @default 'questionToken'
70
- */
71
- optionalType?: 'questionToken' | 'undefined' | 'questionTokenAndUndefined';
72
- transformers?: {
73
- /**
74
- * Customize the names based on the type that is provided by the plugin.
75
- */
76
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
77
- };
78
- /**
79
- * Export an Oas object as Oas type with `import type { Infer } from '@kubb/oas'`
80
- */
81
- oasType?: 'infer' | false;
82
- /**
83
- * @example
84
- * Use https://ts-ast-viewer.com to generate factory code(see createPropertySignature)
85
- * category: factory.createPropertySignature(
86
- * undefined,
87
- * factory.createIdentifier("category"),
88
- * factory.createToken(ts.SyntaxKind.QuestionToken),
89
- * factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword)
90
- * )
91
- */
92
- mapper?: Record<string, ts.PropertySignature>;
93
- /**
94
- * Define some generators next to the ts generators
95
- */
96
- generators?: Array<Generator<PluginTs>>;
97
- };
98
- type ResolvedOptions = {
99
- output: Output<Oas>;
100
- group: Options['group'];
101
- override: NonNullable<Options['override']>;
102
- enumType: NonNullable<Options['enumType']>;
103
- enumSuffix: NonNullable<Options['enumSuffix']>;
104
- dateType: NonNullable<Options['dateType']>;
105
- unknownType: NonNullable<Options['unknownType']>;
106
- emptySchemaType: NonNullable<Options['emptySchemaType']>;
107
- optionalType: NonNullable<Options['optionalType']>;
108
- transformers: NonNullable<Options['transformers']>;
109
- oasType: NonNullable<Options['oasType']>;
110
- syntaxType: NonNullable<Options['syntaxType']>;
111
- usedEnumNames: Record<string, number>;
112
- mapper: Record<string, any>;
113
- };
114
- type PluginTs = PluginFactoryOptions<'plugin-ts', Options, ResolvedOptions, never, ResolvePathOptions>;
115
-
116
- export type { Options as O, PluginTs as P };
@@ -1,116 +0,0 @@
1
- import { Output, Group, ResolveNameParams, PluginFactoryOptions } from '@kubb/core';
2
- import { Oas, contentType } from '@kubb/oas';
3
- import { Exclude, Include, Override, Generator, ResolvePathOptions } from '@kubb/plugin-oas';
4
- import ts from 'typescript';
5
-
6
- type Options = {
7
- /**
8
- * Specify the export location for the files and define the behavior of the output
9
- * @default { path: 'types', barrelType: 'named' }
10
- */
11
- output?: Output<Oas>;
12
- /**
13
- * Define which contentType should be used.
14
- * By default, the first JSON valid mediaType will be used
15
- */
16
- contentType?: contentType;
17
- /**
18
- * Group the clients based on the provided name.
19
- */
20
- group?: Group;
21
- /**
22
- * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
23
- */
24
- exclude?: Array<Exclude>;
25
- /**
26
- * Array containing include parameters to include tags/operations/methods/paths.
27
- */
28
- include?: Array<Include>;
29
- /**
30
- * Array containing override parameters to override `options` based on tags/operations/methods/paths.
31
- */
32
- override?: Array<Override<ResolvedOptions>>;
33
- /**
34
- * Choose to use `enum` or `as const` for enums
35
- * @default 'asConst'
36
- * asPascalConst is deprecated
37
- */
38
- enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal';
39
- /**
40
- * Switch between type or interface for creating TypeScript types
41
- * @default 'type'
42
- */
43
- syntaxType?: 'type' | 'interface';
44
- /**
45
- * Set a suffix for the generated enums.
46
- * @default 'enum'
47
- */
48
- enumSuffix?: string;
49
- /**
50
- * Choose to use `date` or `datetime` as JavaScript `Date` instead of `string`.
51
- * @default 'string'
52
- */
53
- dateType?: 'string' | 'date';
54
- /**
55
- * Which type to use when the Swagger/OpenAPI file is not providing more information.
56
- * @default 'any'
57
- */
58
- unknownType?: 'any' | 'unknown' | 'void';
59
- /**
60
- * Which type to use for empty schema values
61
- * @default `unknownType`
62
- */
63
- emptySchemaType?: 'any' | 'unknown' | 'void';
64
- /**
65
- * Choose what to use as mode for an optional value.
66
- * @examples 'questionToken': type?: string
67
- * @examples 'undefined': type: string | undefined
68
- * @examples 'questionTokenAndUndefined': type?: string | undefined
69
- * @default 'questionToken'
70
- */
71
- optionalType?: 'questionToken' | 'undefined' | 'questionTokenAndUndefined';
72
- transformers?: {
73
- /**
74
- * Customize the names based on the type that is provided by the plugin.
75
- */
76
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
77
- };
78
- /**
79
- * Export an Oas object as Oas type with `import type { Infer } from '@kubb/oas'`
80
- */
81
- oasType?: 'infer' | false;
82
- /**
83
- * @example
84
- * Use https://ts-ast-viewer.com to generate factory code(see createPropertySignature)
85
- * category: factory.createPropertySignature(
86
- * undefined,
87
- * factory.createIdentifier("category"),
88
- * factory.createToken(ts.SyntaxKind.QuestionToken),
89
- * factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword)
90
- * )
91
- */
92
- mapper?: Record<string, ts.PropertySignature>;
93
- /**
94
- * Define some generators next to the ts generators
95
- */
96
- generators?: Array<Generator<PluginTs>>;
97
- };
98
- type ResolvedOptions = {
99
- output: Output<Oas>;
100
- group: Options['group'];
101
- override: NonNullable<Options['override']>;
102
- enumType: NonNullable<Options['enumType']>;
103
- enumSuffix: NonNullable<Options['enumSuffix']>;
104
- dateType: NonNullable<Options['dateType']>;
105
- unknownType: NonNullable<Options['unknownType']>;
106
- emptySchemaType: NonNullable<Options['emptySchemaType']>;
107
- optionalType: NonNullable<Options['optionalType']>;
108
- transformers: NonNullable<Options['transformers']>;
109
- oasType: NonNullable<Options['oasType']>;
110
- syntaxType: NonNullable<Options['syntaxType']>;
111
- usedEnumNames: Record<string, number>;
112
- mapper: Record<string, any>;
113
- };
114
- type PluginTs = PluginFactoryOptions<'plugin-ts', Options, ResolvedOptions, never, ResolvePathOptions>;
115
-
116
- export type { Options as O, PluginTs as P };