@kubb/plugin-oas 3.0.0-alpha.8 → 3.0.0-beta.1

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 (100) hide show
  1. package/README.md +14 -5
  2. package/dist/OperationGenerator-BgQeGRzk.d.cts +550 -0
  3. package/dist/OperationGenerator-BgQeGRzk.d.ts +550 -0
  4. package/dist/{Schema-B1vcPGiK.d.ts → Schema-1iM2I0dK.d.ts} +1 -12
  5. package/dist/{Schema-DoSFh7Qd.d.cts → Schema-5o-c5UOy.d.cts} +1 -12
  6. package/dist/chunk-ABOQ73FL.cjs +36 -0
  7. package/dist/chunk-ABOQ73FL.cjs.map +1 -0
  8. package/dist/chunk-BG77DP54.js +30 -0
  9. package/dist/chunk-BG77DP54.js.map +1 -0
  10. package/dist/chunk-GF26SDHQ.js +28 -0
  11. package/dist/chunk-GF26SDHQ.js.map +1 -0
  12. package/dist/chunk-PADR76WZ.cjs +4 -0
  13. package/dist/chunk-PADR76WZ.cjs.map +1 -0
  14. package/dist/chunk-QAFBZLJA.cjs +48 -0
  15. package/dist/chunk-QAFBZLJA.cjs.map +1 -0
  16. package/dist/chunk-QT6ZFRNJ.cjs +752 -0
  17. package/dist/chunk-QT6ZFRNJ.cjs.map +1 -0
  18. package/dist/chunk-QWO5NQGQ.js +88 -0
  19. package/dist/chunk-QWO5NQGQ.js.map +1 -0
  20. package/dist/chunk-R47XMJ32.js +3 -0
  21. package/dist/chunk-R47XMJ32.js.map +1 -0
  22. package/dist/chunk-SR63CBLH.cjs +92 -0
  23. package/dist/chunk-SR63CBLH.cjs.map +1 -0
  24. package/dist/chunk-V2JO6RHI.js +744 -0
  25. package/dist/chunk-V2JO6RHI.js.map +1 -0
  26. package/dist/chunk-XNCEFOE6.js +45 -0
  27. package/dist/chunk-XNCEFOE6.js.map +1 -0
  28. package/dist/chunk-ZWHQ54JM.cjs +32 -0
  29. package/dist/chunk-ZWHQ54JM.cjs.map +1 -0
  30. package/dist/components.cjs +20 -12
  31. package/dist/components.cjs.map +1 -1
  32. package/dist/components.d.cts +3 -6
  33. package/dist/components.d.ts +3 -6
  34. package/dist/components.js +3 -12
  35. package/dist/components.js.map +1 -1
  36. package/dist/generators.cjs +14 -0
  37. package/dist/generators.cjs.map +1 -0
  38. package/dist/generators.d.cts +9 -0
  39. package/dist/generators.d.ts +9 -0
  40. package/dist/generators.js +5 -0
  41. package/dist/generators.js.map +1 -0
  42. package/dist/hooks.cjs +102 -57
  43. package/dist/hooks.cjs.map +1 -1
  44. package/dist/hooks.d.cts +41 -10
  45. package/dist/hooks.d.ts +41 -10
  46. package/dist/hooks.js +91 -53
  47. package/dist/hooks.js.map +1 -1
  48. package/dist/index.cjs +137 -187
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.cts +2 -5
  51. package/dist/index.d.ts +2 -5
  52. package/dist/index.js +76 -153
  53. package/dist/index.js.map +1 -1
  54. package/dist/utils.cjs +32 -41
  55. package/dist/utils.cjs.map +1 -1
  56. package/dist/utils.d.cts +5 -13
  57. package/dist/utils.d.ts +5 -13
  58. package/dist/utils.js +8 -40
  59. package/dist/utils.js.map +1 -1
  60. package/package.json +20 -14
  61. package/src/OperationGenerator.ts +23 -30
  62. package/src/SchemaGenerator.ts +79 -22
  63. package/src/SchemaMapper.ts +6 -4
  64. package/src/components/Schema.tsx +1 -99
  65. package/src/{parser.tsx → generator.tsx} +30 -22
  66. package/src/generators/index.ts +1 -0
  67. package/src/generators/jsonGenerator.ts +32 -0
  68. package/src/hooks/index.ts +2 -0
  69. package/src/hooks/useOperationManager.ts +77 -30
  70. package/src/hooks/useSchemaManager.ts +77 -0
  71. package/src/index.ts +3 -3
  72. package/src/plugin.ts +69 -56
  73. package/src/types.ts +24 -18
  74. package/src/utils/getParams.ts +1 -1
  75. package/src/utils/getSchemaFactory.ts +1 -1
  76. package/src/utils/index.ts +2 -1
  77. package/src/utils/parseFromConfig.ts +7 -7
  78. package/dist/OperationGenerator-DeXrfGDC.d.ts +0 -158
  79. package/dist/OperationGenerator-DhJ0MBKc.d.cts +0 -158
  80. package/dist/SchemaMapper-sGcY1xL5.d.cts +0 -247
  81. package/dist/SchemaMapper-sGcY1xL5.d.ts +0 -247
  82. package/dist/chunk-75BIOXB7.cjs +0 -7
  83. package/dist/chunk-75BIOXB7.cjs.map +0 -1
  84. package/dist/chunk-MUI5DWM3.js +0 -3966
  85. package/dist/chunk-MUI5DWM3.js.map +0 -1
  86. package/dist/chunk-N7EEVJA6.js +0 -35
  87. package/dist/chunk-N7EEVJA6.js.map +0 -1
  88. package/dist/chunk-NU4F7G47.cjs +0 -89
  89. package/dist/chunk-NU4F7G47.cjs.map +0 -1
  90. package/dist/chunk-O76YQFZB.cjs +0 -35
  91. package/dist/chunk-O76YQFZB.cjs.map +0 -1
  92. package/dist/chunk-SQ64ESS4.js +0 -7
  93. package/dist/chunk-SQ64ESS4.js.map +0 -1
  94. package/dist/chunk-SZDO532A.js +0 -89
  95. package/dist/chunk-SZDO532A.js.map +0 -1
  96. package/dist/chunk-VSVVTCQB.cjs +0 -3966
  97. package/dist/chunk-VSVVTCQB.cjs.map +0 -1
  98. package/dist/types-CZTUCaE5.d.cts +0 -145
  99. package/dist/types-CZTUCaE5.d.ts +0 -145
  100. package/src/utils/refSorter.ts +0 -13
@@ -1,158 +0,0 @@
1
- import { FileMetaBase, ResolveNameParams, PluginFactoryOptions, Generator, PluginManager, Plugin } from '@kubb/core';
2
- import * as KubbFile from '@kubb/fs/types';
3
- import { SchemaObject, Oas, contentType, Operation } from '@kubb/oas';
4
- import { d as OperationSchema, b as Refs, g as Override, f as OperationsByMethod, e as OperationSchemas, E as Exclude, I as Include } from './types-CZTUCaE5.js';
5
- import { KubbNode } from '@kubb/react/types';
6
- import { S as Schema, c as SchemaKeywordMapper } from './SchemaMapper-sGcY1xL5.js';
7
-
8
- type GetSchemaGeneratorOptions<T extends SchemaGenerator<any, any, any>> = T extends SchemaGenerator<infer Options, any, any> ? Options : never;
9
- type SchemaMethodResult<TFileMeta extends FileMetaBase> = Promise<KubbFile.File<TFileMeta> | Array<KubbFile.File<TFileMeta>> | null>;
10
- type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
11
- oas: Oas;
12
- pluginManager: PluginManager;
13
- /**
14
- * Current plugin
15
- */
16
- plugin: Plugin<TPluginOptions>;
17
- mode: KubbFile.Mode;
18
- include?: Array<'schemas' | 'responses' | 'requestBodies'>;
19
- override: Array<Override<TOptions>> | undefined;
20
- contentType?: contentType;
21
- output?: string;
22
- };
23
- type SchemaGeneratorOptions = {
24
- dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
25
- unknownType: 'any' | 'unknown';
26
- enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal';
27
- enumSuffix?: string;
28
- usedEnumNames?: Record<string, number>;
29
- mapper?: Record<string, string>;
30
- typed?: boolean;
31
- transformers: {
32
- /**
33
- * Customize the names based on the type that is provided by the plugin.
34
- */
35
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
36
- /**
37
- * Receive schema and name(propertName) and return FakerMeta array
38
- * TODO TODO add docs
39
- * @beta
40
- */
41
- schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Schema[] | undefined;
42
- };
43
- };
44
- type SchemaGeneratorBuildOptions = Omit<OperationSchema, 'name' | 'schema'>;
45
- type SchemaProps$1 = {
46
- schema?: SchemaObject;
47
- name?: string;
48
- parentName?: string;
49
- };
50
- declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends Generator<TOptions, Context$1<TOptions, TPluginOptions>> {
51
- #private;
52
- refs: Refs;
53
- /**
54
- * Creates a type node from a given schema.
55
- * Delegates to getBaseTypeFromSchema internally and
56
- * optionally adds a union with null.
57
- */
58
- parse(props: SchemaProps$1): Schema[];
59
- deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][];
60
- find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
61
- static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][];
62
- static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
63
- static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
64
- build(...parsers: Array<Parser<Extract<TOptions, PluginFactoryOptions>>>): Promise<Array<KubbFile.File<TFileMeta>>>;
65
- /**
66
- * Schema
67
- */
68
- schema(name: string, object: SchemaObject, options: TOptions): SchemaMethodResult<TFileMeta>;
69
- }
70
-
71
- type OperationsProps<TOptions extends PluginFactoryOptions> = {
72
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
73
- options: TOptions['resolvedOptions'];
74
- operations: Array<Operation>;
75
- operationsByMethod: OperationsByMethod;
76
- };
77
- type OperationProps<TOptions extends PluginFactoryOptions> = {
78
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
79
- options: TOptions['resolvedOptions'];
80
- operation: Operation;
81
- };
82
- type SchemaProps<TOptions extends PluginFactoryOptions> = {
83
- instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
84
- name: string;
85
- schema: SchemaObject;
86
- options: TOptions['resolvedOptions'];
87
- };
88
- type ParserOptions<TOptions extends PluginFactoryOptions> = {
89
- name: string;
90
- operations?: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
91
- operation?: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
92
- schema?: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
93
- };
94
- type Parser<TOptions extends PluginFactoryOptions> = ParserOptions<TOptions>;
95
- declare function createParser<TOptions extends PluginFactoryOptions>(parseOptions: ParserOptions<TOptions>): Parser<TOptions>;
96
- type ParserReactOptions<TOptions extends PluginFactoryOptions> = {
97
- name: string;
98
- Operations?: (props: OperationsProps<TOptions>) => KubbNode;
99
- Operation?: (props: OperationProps<TOptions>) => KubbNode;
100
- Schema?: (props: SchemaProps<TOptions>) => KubbNode;
101
- };
102
- declare function createReactParser<TOptions extends PluginFactoryOptions>(parseOptions: ParserReactOptions<TOptions>): Parser<TOptions>;
103
-
104
- type GetOperationGeneratorOptions<T extends OperationGenerator<any, any, any>> = T extends OperationGenerator<infer Options, any, any> ? Options : never;
105
- type OperationMethodResult<TFileMeta extends FileMetaBase> = Promise<KubbFile.File<TFileMeta> | Array<KubbFile.File<TFileMeta>> | null>;
106
- type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
107
- oas: Oas;
108
- exclude: Array<Exclude> | undefined;
109
- include: Array<Include> | undefined;
110
- override: Array<Override<TOptions>> | undefined;
111
- contentType: contentType | undefined;
112
- pluginManager: PluginManager;
113
- /**
114
- * Current plugin
115
- */
116
- plugin: Plugin<TPluginOptions>;
117
- mode: KubbFile.Mode;
118
- };
119
- declare class OperationGenerator<TOptions = unknown, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends Generator<TOptions, Context<TOptions, TPluginOptions>> {
120
- #private;
121
- get operationsByMethod(): OperationsByMethod;
122
- set operationsByMethod(paths: OperationsByMethod);
123
- getSchemas(operation: Operation, { forStatusCode, resolveName, }?: {
124
- forStatusCode?: string | number;
125
- resolveName?: (name: string) => string;
126
- }): OperationSchemas;
127
- build(...parsers: Array<Parser<Extract<TOptions, PluginFactoryOptions>>>): Promise<Array<KubbFile.File<TFileMeta>>>;
128
- /**
129
- * Operation
130
- */
131
- operation(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
132
- /**
133
- * GET
134
- */
135
- get(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
136
- /**
137
- * POST
138
- */
139
- post(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
140
- /**
141
- * PATCH
142
- */
143
- patch(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
144
- /**
145
- * PUT
146
- */
147
- put(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
148
- /**
149
- * DELETE
150
- */
151
- delete(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
152
- /**
153
- * Combination of GET, POST, PATCH, PUT, DELETE
154
- */
155
- all(operations: Operation[], paths: OperationsByMethod): OperationMethodResult<TFileMeta>;
156
- }
157
-
158
- export { type GetOperationGeneratorOptions as G, type OperationMethodResult as O, type ParserReactOptions as P, type SchemaGeneratorBuildOptions as S, OperationGenerator as a, type GetSchemaGeneratorOptions as b, type SchemaGeneratorOptions as c, type SchemaMethodResult as d, SchemaGenerator as e, createParser as f, createReactParser as g, type Parser as h, type ParserOptions as i };
@@ -1,158 +0,0 @@
1
- import { FileMetaBase, ResolveNameParams, PluginFactoryOptions, Generator, PluginManager, Plugin } from '@kubb/core';
2
- import * as KubbFile from '@kubb/fs/types';
3
- import { SchemaObject, Oas, contentType, Operation } from '@kubb/oas';
4
- import { d as OperationSchema, b as Refs, g as Override, f as OperationsByMethod, e as OperationSchemas, E as Exclude, I as Include } from './types-CZTUCaE5.cjs';
5
- import { KubbNode } from '@kubb/react/types';
6
- import { S as Schema, c as SchemaKeywordMapper } from './SchemaMapper-sGcY1xL5.cjs';
7
-
8
- type GetSchemaGeneratorOptions<T extends SchemaGenerator<any, any, any>> = T extends SchemaGenerator<infer Options, any, any> ? Options : never;
9
- type SchemaMethodResult<TFileMeta extends FileMetaBase> = Promise<KubbFile.File<TFileMeta> | Array<KubbFile.File<TFileMeta>> | null>;
10
- type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
11
- oas: Oas;
12
- pluginManager: PluginManager;
13
- /**
14
- * Current plugin
15
- */
16
- plugin: Plugin<TPluginOptions>;
17
- mode: KubbFile.Mode;
18
- include?: Array<'schemas' | 'responses' | 'requestBodies'>;
19
- override: Array<Override<TOptions>> | undefined;
20
- contentType?: contentType;
21
- output?: string;
22
- };
23
- type SchemaGeneratorOptions = {
24
- dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
25
- unknownType: 'any' | 'unknown';
26
- enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal';
27
- enumSuffix?: string;
28
- usedEnumNames?: Record<string, number>;
29
- mapper?: Record<string, string>;
30
- typed?: boolean;
31
- transformers: {
32
- /**
33
- * Customize the names based on the type that is provided by the plugin.
34
- */
35
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
36
- /**
37
- * Receive schema and name(propertName) and return FakerMeta array
38
- * TODO TODO add docs
39
- * @beta
40
- */
41
- schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Schema[] | undefined;
42
- };
43
- };
44
- type SchemaGeneratorBuildOptions = Omit<OperationSchema, 'name' | 'schema'>;
45
- type SchemaProps$1 = {
46
- schema?: SchemaObject;
47
- name?: string;
48
- parentName?: string;
49
- };
50
- declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends Generator<TOptions, Context$1<TOptions, TPluginOptions>> {
51
- #private;
52
- refs: Refs;
53
- /**
54
- * Creates a type node from a given schema.
55
- * Delegates to getBaseTypeFromSchema internally and
56
- * optionally adds a union with null.
57
- */
58
- parse(props: SchemaProps$1): Schema[];
59
- deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][];
60
- find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
61
- static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][];
62
- static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
63
- static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
64
- build(...parsers: Array<Parser<Extract<TOptions, PluginFactoryOptions>>>): Promise<Array<KubbFile.File<TFileMeta>>>;
65
- /**
66
- * Schema
67
- */
68
- schema(name: string, object: SchemaObject, options: TOptions): SchemaMethodResult<TFileMeta>;
69
- }
70
-
71
- type OperationsProps<TOptions extends PluginFactoryOptions> = {
72
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
73
- options: TOptions['resolvedOptions'];
74
- operations: Array<Operation>;
75
- operationsByMethod: OperationsByMethod;
76
- };
77
- type OperationProps<TOptions extends PluginFactoryOptions> = {
78
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
79
- options: TOptions['resolvedOptions'];
80
- operation: Operation;
81
- };
82
- type SchemaProps<TOptions extends PluginFactoryOptions> = {
83
- instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
84
- name: string;
85
- schema: SchemaObject;
86
- options: TOptions['resolvedOptions'];
87
- };
88
- type ParserOptions<TOptions extends PluginFactoryOptions> = {
89
- name: string;
90
- operations?: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
91
- operation?: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
92
- schema?: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
93
- };
94
- type Parser<TOptions extends PluginFactoryOptions> = ParserOptions<TOptions>;
95
- declare function createParser<TOptions extends PluginFactoryOptions>(parseOptions: ParserOptions<TOptions>): Parser<TOptions>;
96
- type ParserReactOptions<TOptions extends PluginFactoryOptions> = {
97
- name: string;
98
- Operations?: (props: OperationsProps<TOptions>) => KubbNode;
99
- Operation?: (props: OperationProps<TOptions>) => KubbNode;
100
- Schema?: (props: SchemaProps<TOptions>) => KubbNode;
101
- };
102
- declare function createReactParser<TOptions extends PluginFactoryOptions>(parseOptions: ParserReactOptions<TOptions>): Parser<TOptions>;
103
-
104
- type GetOperationGeneratorOptions<T extends OperationGenerator<any, any, any>> = T extends OperationGenerator<infer Options, any, any> ? Options : never;
105
- type OperationMethodResult<TFileMeta extends FileMetaBase> = Promise<KubbFile.File<TFileMeta> | Array<KubbFile.File<TFileMeta>> | null>;
106
- type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
107
- oas: Oas;
108
- exclude: Array<Exclude> | undefined;
109
- include: Array<Include> | undefined;
110
- override: Array<Override<TOptions>> | undefined;
111
- contentType: contentType | undefined;
112
- pluginManager: PluginManager;
113
- /**
114
- * Current plugin
115
- */
116
- plugin: Plugin<TPluginOptions>;
117
- mode: KubbFile.Mode;
118
- };
119
- declare class OperationGenerator<TOptions = unknown, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends Generator<TOptions, Context<TOptions, TPluginOptions>> {
120
- #private;
121
- get operationsByMethod(): OperationsByMethod;
122
- set operationsByMethod(paths: OperationsByMethod);
123
- getSchemas(operation: Operation, { forStatusCode, resolveName, }?: {
124
- forStatusCode?: string | number;
125
- resolveName?: (name: string) => string;
126
- }): OperationSchemas;
127
- build(...parsers: Array<Parser<Extract<TOptions, PluginFactoryOptions>>>): Promise<Array<KubbFile.File<TFileMeta>>>;
128
- /**
129
- * Operation
130
- */
131
- operation(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
132
- /**
133
- * GET
134
- */
135
- get(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
136
- /**
137
- * POST
138
- */
139
- post(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
140
- /**
141
- * PATCH
142
- */
143
- patch(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
144
- /**
145
- * PUT
146
- */
147
- put(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
148
- /**
149
- * DELETE
150
- */
151
- delete(operation: Operation, options: TOptions): OperationMethodResult<TFileMeta>;
152
- /**
153
- * Combination of GET, POST, PATCH, PUT, DELETE
154
- */
155
- all(operations: Operation[], paths: OperationsByMethod): OperationMethodResult<TFileMeta>;
156
- }
157
-
158
- export { type GetOperationGeneratorOptions as G, type OperationMethodResult as O, type ParserReactOptions as P, type SchemaGeneratorBuildOptions as S, OperationGenerator as a, type GetSchemaGeneratorOptions as b, type SchemaGeneratorOptions as c, type SchemaMethodResult as d, SchemaGenerator as e, createParser as f, createReactParser as g, type Parser as h, type ParserOptions as i };
@@ -1,247 +0,0 @@
1
- import * as KubbFile from '@kubb/fs/types';
2
-
3
- type SchemaKeywordMapper = {
4
- object: {
5
- keyword: 'object';
6
- args: {
7
- properties: {
8
- [x: string]: Schema[];
9
- };
10
- additionalProperties: Schema[];
11
- strict?: boolean;
12
- };
13
- };
14
- strict: {
15
- keyword: 'strict';
16
- };
17
- url: {
18
- keyword: 'url';
19
- };
20
- readOnly: {
21
- keyword: 'readOnly';
22
- };
23
- uuid: {
24
- keyword: 'uuid';
25
- };
26
- email: {
27
- keyword: 'email';
28
- };
29
- firstName: {
30
- keyword: 'firstName';
31
- };
32
- lastName: {
33
- keyword: 'lastName';
34
- };
35
- phone: {
36
- keyword: 'phone';
37
- };
38
- password: {
39
- keyword: 'password';
40
- };
41
- date: {
42
- keyword: 'date';
43
- args: {
44
- type?: 'date' | 'string';
45
- };
46
- };
47
- time: {
48
- keyword: 'time';
49
- args: {
50
- type?: 'date' | 'string';
51
- };
52
- };
53
- datetime: {
54
- keyword: 'datetime';
55
- args: {
56
- offset?: boolean;
57
- local?: boolean;
58
- };
59
- };
60
- tuple: {
61
- keyword: 'tuple';
62
- args: {
63
- items: Schema[];
64
- min?: number;
65
- max?: number;
66
- };
67
- };
68
- array: {
69
- keyword: 'array';
70
- args: {
71
- items: Schema[];
72
- min?: number;
73
- max?: number;
74
- };
75
- };
76
- enum: {
77
- keyword: 'enum';
78
- args: {
79
- name: string;
80
- typeName: string;
81
- asConst: boolean;
82
- items: Array<{
83
- name: string | number;
84
- format: 'string' | 'number';
85
- value?: string | number;
86
- }>;
87
- };
88
- };
89
- and: {
90
- keyword: 'and';
91
- args: Schema[];
92
- };
93
- const: {
94
- keyword: 'const';
95
- args: {
96
- name: string | number;
97
- format: 'string' | 'number';
98
- value?: string | number;
99
- };
100
- };
101
- union: {
102
- keyword: 'union';
103
- args: Schema[];
104
- };
105
- ref: {
106
- keyword: 'ref';
107
- args: {
108
- name: string;
109
- path: KubbFile.OptionalPath;
110
- };
111
- };
112
- matches: {
113
- keyword: 'matches';
114
- args?: string;
115
- };
116
- boolean: {
117
- keyword: 'boolean';
118
- };
119
- default: {
120
- keyword: 'default';
121
- args: string | number | boolean;
122
- };
123
- string: {
124
- keyword: 'string';
125
- };
126
- integer: {
127
- keyword: 'integer';
128
- };
129
- number: {
130
- keyword: 'number';
131
- };
132
- max: {
133
- keyword: 'max';
134
- args: number;
135
- };
136
- min: {
137
- keyword: 'min';
138
- args: number;
139
- };
140
- describe: {
141
- keyword: 'describe';
142
- args: string;
143
- };
144
- example: {
145
- keyword: 'example';
146
- args: string;
147
- };
148
- deprecated: {
149
- keyword: 'deprecated';
150
- };
151
- optional: {
152
- keyword: 'optional';
153
- };
154
- undefined: {
155
- keyword: 'undefined';
156
- };
157
- nullish: {
158
- keyword: 'nullish';
159
- };
160
- nullable: {
161
- keyword: 'nullable';
162
- };
163
- null: {
164
- keyword: 'null';
165
- };
166
- any: {
167
- keyword: 'any';
168
- };
169
- unknown: {
170
- keyword: 'unknown';
171
- };
172
- blob: {
173
- keyword: 'blob';
174
- };
175
- schema: {
176
- keyword: 'schema';
177
- args: {
178
- type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
179
- format?: string;
180
- };
181
- };
182
- name: {
183
- keyword: 'name';
184
- args: string;
185
- };
186
- catchall: {
187
- keyword: 'catchall';
188
- };
189
- };
190
- declare const schemaKeywords: {
191
- any: "any";
192
- strict: "strict";
193
- unknown: "unknown";
194
- number: "number";
195
- integer: "integer";
196
- string: "string";
197
- boolean: "boolean";
198
- undefined: "undefined";
199
- nullable: "nullable";
200
- null: "null";
201
- nullish: "nullish";
202
- array: "array";
203
- tuple: "tuple";
204
- enum: "enum";
205
- union: "union";
206
- datetime: "datetime";
207
- date: "date";
208
- email: "email";
209
- uuid: "uuid";
210
- url: "url";
211
- default: "default";
212
- const: "const";
213
- and: "and";
214
- describe: "describe";
215
- min: "min";
216
- max: "max";
217
- optional: "optional";
218
- readOnly: "readOnly";
219
- object: "object";
220
- ref: "ref";
221
- matches: "matches";
222
- firstName: "firstName";
223
- lastName: "lastName";
224
- password: "password";
225
- phone: "phone";
226
- blob: "blob";
227
- deprecated: "deprecated";
228
- example: "example";
229
- schema: "schema";
230
- catchall: "catchall";
231
- time: "time";
232
- name: "name";
233
- };
234
- type SchemaKeyword = keyof SchemaKeywordMapper;
235
- type SchemaMapper<T = string | null | undefined> = {
236
- [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined;
237
- };
238
- type SchemaKeywordBase<T> = {
239
- keyword: SchemaKeyword;
240
- args: T;
241
- };
242
- type Schema = {
243
- keyword: string;
244
- } | SchemaKeywordMapper[keyof SchemaKeywordMapper];
245
- declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
246
-
247
- export { type Schema as S, type SchemaKeyword as a, type SchemaKeywordBase as b, type SchemaKeywordMapper as c, type SchemaMapper as d, isKeyword as i, schemaKeywords as s };