@kubb/plugin-oas 3.0.0-alpha.3 → 3.0.0-alpha.30

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 (105) hide show
  1. package/README.md +13 -4
  2. package/dist/OperationGenerator-DhPriVDJ.d.cts +554 -0
  3. package/dist/OperationGenerator-DhPriVDJ.d.ts +554 -0
  4. package/dist/Schema-BfZVq77f.d.cts +22 -0
  5. package/dist/Schema-IlDbvlbP.d.ts +22 -0
  6. package/dist/chunk-4H2KTGZM.cjs +92 -0
  7. package/dist/chunk-4H2KTGZM.cjs.map +1 -0
  8. package/dist/chunk-ABIWUCV7.js +88 -0
  9. package/dist/chunk-ABIWUCV7.js.map +1 -0
  10. package/dist/chunk-ABOQ73FL.cjs +36 -0
  11. package/dist/chunk-ABOQ73FL.cjs.map +1 -0
  12. package/dist/chunk-BG77DP54.js +30 -0
  13. package/dist/chunk-BG77DP54.js.map +1 -0
  14. package/dist/chunk-GF26SDHQ.js +28 -0
  15. package/dist/chunk-GF26SDHQ.js.map +1 -0
  16. package/dist/chunk-PADR76WZ.cjs +4 -0
  17. package/dist/chunk-PADR76WZ.cjs.map +1 -0
  18. package/dist/chunk-QAFBZLJA.cjs +48 -0
  19. package/dist/chunk-QAFBZLJA.cjs.map +1 -0
  20. package/dist/chunk-QT6ZFRNJ.cjs +752 -0
  21. package/dist/chunk-QT6ZFRNJ.cjs.map +1 -0
  22. package/dist/chunk-R47XMJ32.js +3 -0
  23. package/dist/chunk-R47XMJ32.js.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 +4 -7
  33. package/dist/components.d.ts +4 -7
  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 +192 -258
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.cts +3 -6
  51. package/dist/index.d.ts +3 -6
  52. package/dist/index.js +135 -228
  53. package/dist/index.js.map +1 -1
  54. package/dist/utils.cjs +32 -87
  55. package/dist/utils.cjs.map +1 -1
  56. package/dist/utils.d.cts +8 -43
  57. package/dist/utils.d.ts +8 -43
  58. package/dist/utils.js +8 -86
  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 +80 -23
  63. package/src/SchemaMapper.ts +7 -5
  64. package/src/components/Oas.tsx +1 -1
  65. package/src/components/Operation.tsx +1 -1
  66. package/src/components/Schema.tsx +2 -102
  67. package/src/{parser.tsx → generator.tsx} +35 -22
  68. package/src/generators/index.ts +1 -0
  69. package/src/generators/jsonGenerator.ts +32 -0
  70. package/src/hooks/index.ts +2 -0
  71. package/src/hooks/useOperationManager.ts +77 -29
  72. package/src/hooks/useSchemaManager.ts +77 -0
  73. package/src/index.ts +3 -3
  74. package/src/plugin.ts +67 -59
  75. package/src/types.ts +24 -16
  76. package/src/utils/getParams.ts +2 -2
  77. package/src/utils/getSchemaFactory.ts +1 -1
  78. package/src/utils/index.ts +2 -2
  79. package/src/utils/parseFromConfig.ts +7 -7
  80. package/dist/OperationGenerator-D7rSlflc.d.cts +0 -158
  81. package/dist/OperationGenerator-vw0Zf-Mi.d.ts +0 -158
  82. package/dist/Schema-DxyOIX7q.d.cts +0 -35
  83. package/dist/Schema-gHgN14i2.d.ts +0 -35
  84. package/dist/SchemaMapper-BM1IGWqD.d.cts +0 -248
  85. package/dist/SchemaMapper-BM1IGWqD.d.ts +0 -248
  86. package/dist/chunk-264TCCJF.cjs +0 -3973
  87. package/dist/chunk-264TCCJF.cjs.map +0 -1
  88. package/dist/chunk-7KIEQOVZ.cjs +0 -7
  89. package/dist/chunk-7KIEQOVZ.cjs.map +0 -1
  90. package/dist/chunk-FZN3PBEK.js +0 -3973
  91. package/dist/chunk-FZN3PBEK.js.map +0 -1
  92. package/dist/chunk-P42X362U.cjs +0 -101
  93. package/dist/chunk-P42X362U.cjs.map +0 -1
  94. package/dist/chunk-QLJIL3U5.cjs +0 -35
  95. package/dist/chunk-QLJIL3U5.cjs.map +0 -1
  96. package/dist/chunk-TWKZEVSM.js +0 -7
  97. package/dist/chunk-TWKZEVSM.js.map +0 -1
  98. package/dist/chunk-UB552H4J.js +0 -101
  99. package/dist/chunk-UB552H4J.js.map +0 -1
  100. package/dist/chunk-Y4V7HHX7.js +0 -35
  101. package/dist/chunk-Y4V7HHX7.js.map +0 -1
  102. package/dist/types-C2RXaY0_.d.cts +0 -143
  103. package/dist/types-C2RXaY0_.d.ts +0 -143
  104. package/src/utils/getGroupedByTagFiles.ts +0 -82
  105. package/src/utils/refSorter.ts +0 -13
@@ -1,248 +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
- isTypeOnly?: boolean;
111
- };
112
- };
113
- matches: {
114
- keyword: 'matches';
115
- args?: string;
116
- };
117
- boolean: {
118
- keyword: 'boolean';
119
- };
120
- default: {
121
- keyword: 'default';
122
- args: string | number | boolean;
123
- };
124
- string: {
125
- keyword: 'string';
126
- };
127
- integer: {
128
- keyword: 'integer';
129
- };
130
- number: {
131
- keyword: 'number';
132
- };
133
- max: {
134
- keyword: 'max';
135
- args: number;
136
- };
137
- min: {
138
- keyword: 'min';
139
- args: number;
140
- };
141
- describe: {
142
- keyword: 'describe';
143
- args: string;
144
- };
145
- example: {
146
- keyword: 'example';
147
- args: string;
148
- };
149
- deprecated: {
150
- keyword: 'deprecated';
151
- };
152
- optional: {
153
- keyword: 'optional';
154
- };
155
- undefined: {
156
- keyword: 'undefined';
157
- };
158
- nullish: {
159
- keyword: 'nullish';
160
- };
161
- nullable: {
162
- keyword: 'nullable';
163
- };
164
- null: {
165
- keyword: 'null';
166
- };
167
- any: {
168
- keyword: 'any';
169
- };
170
- unknown: {
171
- keyword: 'unknown';
172
- };
173
- blob: {
174
- keyword: 'blob';
175
- };
176
- schema: {
177
- keyword: 'schema';
178
- args: {
179
- type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
180
- format?: string;
181
- };
182
- };
183
- name: {
184
- keyword: 'name';
185
- args: string;
186
- };
187
- catchall: {
188
- keyword: 'catchall';
189
- };
190
- };
191
- declare const schemaKeywords: {
192
- any: "any";
193
- strict: "strict";
194
- unknown: "unknown";
195
- number: "number";
196
- integer: "integer";
197
- string: "string";
198
- boolean: "boolean";
199
- undefined: "undefined";
200
- nullable: "nullable";
201
- null: "null";
202
- nullish: "nullish";
203
- array: "array";
204
- tuple: "tuple";
205
- enum: "enum";
206
- union: "union";
207
- datetime: "datetime";
208
- date: "date";
209
- email: "email";
210
- uuid: "uuid";
211
- url: "url";
212
- default: "default";
213
- const: "const";
214
- and: "and";
215
- describe: "describe";
216
- min: "min";
217
- max: "max";
218
- optional: "optional";
219
- readOnly: "readOnly";
220
- object: "object";
221
- ref: "ref";
222
- matches: "matches";
223
- firstName: "firstName";
224
- lastName: "lastName";
225
- password: "password";
226
- phone: "phone";
227
- blob: "blob";
228
- deprecated: "deprecated";
229
- example: "example";
230
- schema: "schema";
231
- catchall: "catchall";
232
- time: "time";
233
- name: "name";
234
- };
235
- type SchemaKeyword = keyof SchemaKeywordMapper;
236
- type SchemaMapper<T = string | null | undefined> = {
237
- [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined;
238
- };
239
- type SchemaKeywordBase<T> = {
240
- keyword: SchemaKeyword;
241
- args: T;
242
- };
243
- type Schema = {
244
- keyword: string;
245
- } | SchemaKeywordMapper[keyof SchemaKeywordMapper];
246
- declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
247
-
248
- 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 };
@@ -1,248 +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
- isTypeOnly?: boolean;
111
- };
112
- };
113
- matches: {
114
- keyword: 'matches';
115
- args?: string;
116
- };
117
- boolean: {
118
- keyword: 'boolean';
119
- };
120
- default: {
121
- keyword: 'default';
122
- args: string | number | boolean;
123
- };
124
- string: {
125
- keyword: 'string';
126
- };
127
- integer: {
128
- keyword: 'integer';
129
- };
130
- number: {
131
- keyword: 'number';
132
- };
133
- max: {
134
- keyword: 'max';
135
- args: number;
136
- };
137
- min: {
138
- keyword: 'min';
139
- args: number;
140
- };
141
- describe: {
142
- keyword: 'describe';
143
- args: string;
144
- };
145
- example: {
146
- keyword: 'example';
147
- args: string;
148
- };
149
- deprecated: {
150
- keyword: 'deprecated';
151
- };
152
- optional: {
153
- keyword: 'optional';
154
- };
155
- undefined: {
156
- keyword: 'undefined';
157
- };
158
- nullish: {
159
- keyword: 'nullish';
160
- };
161
- nullable: {
162
- keyword: 'nullable';
163
- };
164
- null: {
165
- keyword: 'null';
166
- };
167
- any: {
168
- keyword: 'any';
169
- };
170
- unknown: {
171
- keyword: 'unknown';
172
- };
173
- blob: {
174
- keyword: 'blob';
175
- };
176
- schema: {
177
- keyword: 'schema';
178
- args: {
179
- type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
180
- format?: string;
181
- };
182
- };
183
- name: {
184
- keyword: 'name';
185
- args: string;
186
- };
187
- catchall: {
188
- keyword: 'catchall';
189
- };
190
- };
191
- declare const schemaKeywords: {
192
- any: "any";
193
- strict: "strict";
194
- unknown: "unknown";
195
- number: "number";
196
- integer: "integer";
197
- string: "string";
198
- boolean: "boolean";
199
- undefined: "undefined";
200
- nullable: "nullable";
201
- null: "null";
202
- nullish: "nullish";
203
- array: "array";
204
- tuple: "tuple";
205
- enum: "enum";
206
- union: "union";
207
- datetime: "datetime";
208
- date: "date";
209
- email: "email";
210
- uuid: "uuid";
211
- url: "url";
212
- default: "default";
213
- const: "const";
214
- and: "and";
215
- describe: "describe";
216
- min: "min";
217
- max: "max";
218
- optional: "optional";
219
- readOnly: "readOnly";
220
- object: "object";
221
- ref: "ref";
222
- matches: "matches";
223
- firstName: "firstName";
224
- lastName: "lastName";
225
- password: "password";
226
- phone: "phone";
227
- blob: "blob";
228
- deprecated: "deprecated";
229
- example: "example";
230
- schema: "schema";
231
- catchall: "catchall";
232
- time: "time";
233
- name: "name";
234
- };
235
- type SchemaKeyword = keyof SchemaKeywordMapper;
236
- type SchemaMapper<T = string | null | undefined> = {
237
- [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined;
238
- };
239
- type SchemaKeywordBase<T> = {
240
- keyword: SchemaKeyword;
241
- args: T;
242
- };
243
- type Schema = {
244
- keyword: string;
245
- } | SchemaKeywordMapper[keyof SchemaKeywordMapper];
246
- declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
247
-
248
- 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 };