@kubb/plugin-oas 3.16.1 → 3.16.3

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 (111) hide show
  1. package/dist/Oas-CuqAnIw-.js +60 -0
  2. package/dist/Oas-CuqAnIw-.js.map +1 -0
  3. package/dist/Oas-Cv_pyXRM.cjs +78 -0
  4. package/dist/Oas-Cv_pyXRM.cjs.map +1 -0
  5. package/dist/OperationGenerator-CgbXErhW.d.cts +900 -0
  6. package/dist/OperationGenerator-OtLcGk2y.d.ts +900 -0
  7. package/dist/Schema-DJshqHto.d.cts +38 -0
  8. package/dist/Schema-DOXGUW1m.d.ts +38 -0
  9. package/dist/SchemaGenerator-8205BXCp.cjs +942 -0
  10. package/dist/SchemaGenerator-8205BXCp.cjs.map +1 -0
  11. package/dist/SchemaGenerator-B8Io6kky.js +930 -0
  12. package/dist/SchemaGenerator-B8Io6kky.js.map +1 -0
  13. package/dist/SchemaMapper-BaZQKrQB.js +54 -0
  14. package/dist/SchemaMapper-BaZQKrQB.js.map +1 -0
  15. package/dist/SchemaMapper-BiagBQN4.d.cts +388 -0
  16. package/dist/SchemaMapper-C2J2d3o4.d.ts +388 -0
  17. package/dist/SchemaMapper-D8J0V9Pj.cjs +66 -0
  18. package/dist/SchemaMapper-D8J0V9Pj.cjs.map +1 -0
  19. package/dist/chunk-CUT6urMc.cjs +30 -0
  20. package/dist/components.cjs +4 -19
  21. package/dist/components.d.cts +42 -35
  22. package/dist/components.d.ts +42 -35
  23. package/dist/components.js +3 -3
  24. package/dist/generators-BhLMlRNk.js +137 -0
  25. package/dist/generators-BhLMlRNk.js.map +1 -0
  26. package/dist/generators-DLH2kvlh.cjs +155 -0
  27. package/dist/generators-DLH2kvlh.cjs.map +1 -0
  28. package/dist/generators.cjs +4 -13
  29. package/dist/generators.d.cts +5 -7
  30. package/dist/generators.d.ts +5 -7
  31. package/dist/generators.js +5 -5
  32. package/dist/getFooter-BChY2kC1.cjs +43 -0
  33. package/dist/getFooter-BChY2kC1.cjs.map +1 -0
  34. package/dist/getFooter-T7_pZ6f8.js +31 -0
  35. package/dist/getFooter-T7_pZ6f8.js.map +1 -0
  36. package/dist/getSchemas-D8mP129c.cjs +67 -0
  37. package/dist/getSchemas-D8mP129c.cjs.map +1 -0
  38. package/dist/getSchemas-WoSBIxG8.js +55 -0
  39. package/dist/getSchemas-WoSBIxG8.js.map +1 -0
  40. package/dist/hooks.cjs +213 -195
  41. package/dist/hooks.cjs.map +1 -1
  42. package/dist/hooks.d.cts +91 -86
  43. package/dist/hooks.d.ts +91 -86
  44. package/dist/hooks.js +212 -193
  45. package/dist/hooks.js.map +1 -1
  46. package/dist/index.cjs +280 -344
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +7 -10
  49. package/dist/index.d.ts +7 -10
  50. package/dist/index.js +274 -318
  51. package/dist/index.js.map +1 -1
  52. package/dist/mocks.cjs +802 -737
  53. package/dist/mocks.cjs.map +1 -1
  54. package/dist/mocks.d.cts +12 -11
  55. package/dist/mocks.d.ts +12 -11
  56. package/dist/mocks.js +802 -735
  57. package/dist/mocks.js.map +1 -1
  58. package/dist/parseFromConfig-CMNGsef2.cjs +33 -0
  59. package/dist/parseFromConfig-CMNGsef2.cjs.map +1 -0
  60. package/dist/parseFromConfig-yAiFK03V.js +27 -0
  61. package/dist/parseFromConfig-yAiFK03V.js.map +1 -0
  62. package/dist/utils.cjs +58 -74
  63. package/dist/utils.cjs.map +1 -1
  64. package/dist/utils.d.cts +96 -42
  65. package/dist/utils.d.ts +96 -42
  66. package/dist/utils.js +47 -46
  67. package/dist/utils.js.map +1 -1
  68. package/package.json +28 -36
  69. package/src/SchemaGenerator.ts +6 -1
  70. package/src/components/Operation.tsx +1 -2
  71. package/src/mocks/schemas.ts +39 -0
  72. package/src/utils/getBanner.ts +5 -5
  73. package/src/utils/getFooter.ts +4 -4
  74. package/dist/OperationGenerator-C7NPZtOM.d.ts +0 -288
  75. package/dist/OperationGenerator-DJE2XQ83.d.cts +0 -288
  76. package/dist/Schema-AjebpeVY.d.ts +0 -32
  77. package/dist/Schema-M6983FL1.d.cts +0 -32
  78. package/dist/SchemaMapper-B21ZmWag.d.cts +0 -275
  79. package/dist/SchemaMapper-B21ZmWag.d.ts +0 -275
  80. package/dist/chunk-6S7YFY6F.js +0 -33
  81. package/dist/chunk-6S7YFY6F.js.map +0 -1
  82. package/dist/chunk-76E35IZ2.js +0 -56
  83. package/dist/chunk-76E35IZ2.js.map +0 -1
  84. package/dist/chunk-7RFNM43R.cjs +0 -41
  85. package/dist/chunk-7RFNM43R.cjs.map +0 -1
  86. package/dist/chunk-DTD4ZUDA.cjs +0 -36
  87. package/dist/chunk-DTD4ZUDA.cjs.map +0 -1
  88. package/dist/chunk-G3FDK7YW.js +0 -35
  89. package/dist/chunk-G3FDK7YW.js.map +0 -1
  90. package/dist/chunk-JNN4JPWK.js +0 -28
  91. package/dist/chunk-JNN4JPWK.js.map +0 -1
  92. package/dist/chunk-MBX66JAT.js +0 -93
  93. package/dist/chunk-MBX66JAT.js.map +0 -1
  94. package/dist/chunk-NFLZLRQS.cjs +0 -869
  95. package/dist/chunk-NFLZLRQS.cjs.map +0 -1
  96. package/dist/chunk-P2VXWGXZ.js +0 -862
  97. package/dist/chunk-P2VXWGXZ.js.map +0 -1
  98. package/dist/chunk-PORSNYI5.js +0 -47
  99. package/dist/chunk-PORSNYI5.js.map +0 -1
  100. package/dist/chunk-QJMOOF2A.cjs +0 -97
  101. package/dist/chunk-QJMOOF2A.cjs.map +0 -1
  102. package/dist/chunk-YWMMI3MO.cjs +0 -59
  103. package/dist/chunk-YWMMI3MO.cjs.map +0 -1
  104. package/dist/chunk-Z2NREI4X.cjs +0 -32
  105. package/dist/chunk-Z2NREI4X.cjs.map +0 -1
  106. package/dist/chunk-ZVFL3NXX.cjs +0 -50
  107. package/dist/chunk-ZVFL3NXX.cjs.map +0 -1
  108. package/dist/components.cjs.map +0 -1
  109. package/dist/components.js.map +0 -1
  110. package/dist/generators.cjs.map +0 -1
  111. package/dist/generators.js.map +0 -1
@@ -1,275 +0,0 @@
1
- import { KubbFile } from '@kubb/core/fs';
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
- url: {
15
- keyword: 'url';
16
- };
17
- readOnly: {
18
- keyword: 'readOnly';
19
- };
20
- writeOnly: {
21
- keyword: 'writeOnly';
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
- rest?: Schema;
67
- };
68
- };
69
- array: {
70
- keyword: 'array';
71
- args: {
72
- items: Schema[];
73
- min?: number;
74
- max?: number;
75
- unique?: boolean;
76
- };
77
- };
78
- enum: {
79
- keyword: 'enum';
80
- args: {
81
- name: string;
82
- typeName: string;
83
- asConst: boolean;
84
- items: Array<{
85
- name: string | number;
86
- format: 'string' | 'number' | 'boolean';
87
- value?: string | number | boolean;
88
- }>;
89
- };
90
- };
91
- and: {
92
- keyword: 'and';
93
- args: Schema[];
94
- };
95
- const: {
96
- keyword: 'const';
97
- args: {
98
- name: string | number;
99
- format: 'string' | 'number' | 'boolean';
100
- value?: string | number | boolean;
101
- };
102
- };
103
- union: {
104
- keyword: 'union';
105
- args: Schema[];
106
- };
107
- ref: {
108
- keyword: 'ref';
109
- args: {
110
- name: string;
111
- $ref: string;
112
- /**
113
- * Full qualified path.
114
- */
115
- path: KubbFile.OptionalPath;
116
- /**
117
- * When true `File.Import` will be used.
118
- * When false a reference will be used inside the current file.
119
- */
120
- isImportable: boolean;
121
- };
122
- };
123
- matches: {
124
- keyword: 'matches';
125
- args?: string;
126
- };
127
- boolean: {
128
- keyword: 'boolean';
129
- };
130
- default: {
131
- keyword: 'default';
132
- args: string | number | boolean;
133
- };
134
- string: {
135
- keyword: 'string';
136
- };
137
- integer: {
138
- keyword: 'integer';
139
- };
140
- number: {
141
- keyword: 'number';
142
- };
143
- max: {
144
- keyword: 'max';
145
- args: number;
146
- };
147
- min: {
148
- keyword: 'min';
149
- args: number;
150
- };
151
- describe: {
152
- keyword: 'describe';
153
- args: string;
154
- };
155
- example: {
156
- keyword: 'example';
157
- args: string;
158
- };
159
- deprecated: {
160
- keyword: 'deprecated';
161
- };
162
- optional: {
163
- keyword: 'optional';
164
- };
165
- undefined: {
166
- keyword: 'undefined';
167
- };
168
- nullish: {
169
- keyword: 'nullish';
170
- };
171
- nullable: {
172
- keyword: 'nullable';
173
- };
174
- null: {
175
- keyword: 'null';
176
- };
177
- any: {
178
- keyword: 'any';
179
- };
180
- unknown: {
181
- keyword: 'unknown';
182
- };
183
- void: {
184
- keyword: 'void';
185
- };
186
- blob: {
187
- keyword: 'blob';
188
- };
189
- schema: {
190
- keyword: 'schema';
191
- args: {
192
- type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
193
- format?: string;
194
- };
195
- };
196
- name: {
197
- keyword: 'name';
198
- args: string;
199
- };
200
- catchall: {
201
- keyword: 'catchall';
202
- };
203
- interface: {
204
- keyword: 'interface';
205
- };
206
- };
207
- declare const schemaKeywords: {
208
- any: "any";
209
- unknown: "unknown";
210
- number: "number";
211
- integer: "integer";
212
- string: "string";
213
- boolean: "boolean";
214
- undefined: "undefined";
215
- nullable: "nullable";
216
- null: "null";
217
- nullish: "nullish";
218
- array: "array";
219
- tuple: "tuple";
220
- enum: "enum";
221
- union: "union";
222
- datetime: "datetime";
223
- date: "date";
224
- email: "email";
225
- uuid: "uuid";
226
- url: "url";
227
- void: "void";
228
- default: "default";
229
- const: "const";
230
- and: "and";
231
- describe: "describe";
232
- min: "min";
233
- max: "max";
234
- optional: "optional";
235
- readOnly: "readOnly";
236
- writeOnly: "writeOnly";
237
- object: "object";
238
- ref: "ref";
239
- matches: "matches";
240
- firstName: "firstName";
241
- lastName: "lastName";
242
- password: "password";
243
- phone: "phone";
244
- blob: "blob";
245
- deprecated: "deprecated";
246
- example: "example";
247
- schema: "schema";
248
- catchall: "catchall";
249
- time: "time";
250
- name: "name";
251
- interface: "interface";
252
- };
253
- type SchemaKeyword = keyof SchemaKeywordMapper;
254
- type SchemaMapper<T = string | null | undefined> = {
255
- [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined;
256
- };
257
- type SchemaKeywordBase<T> = {
258
- keyword: SchemaKeyword;
259
- args: T;
260
- };
261
- type Schema = {
262
- keyword: string;
263
- } | SchemaKeywordMapper[keyof SchemaKeywordMapper];
264
- type SchemaTree = {
265
- parent: Schema | undefined;
266
- current: Schema;
267
- siblings: Schema[];
268
- /**
269
- * this will be equal to the key of a property(object)
270
- */
271
- name?: string;
272
- };
273
- declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
274
-
275
- export { type Schema as S, type SchemaTree as a, type SchemaKeyword as b, type SchemaKeywordBase as c, type SchemaKeywordMapper as d, type SchemaMapper as e, isKeyword as i, schemaKeywords as s };
@@ -1,275 +0,0 @@
1
- import { KubbFile } from '@kubb/core/fs';
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
- url: {
15
- keyword: 'url';
16
- };
17
- readOnly: {
18
- keyword: 'readOnly';
19
- };
20
- writeOnly: {
21
- keyword: 'writeOnly';
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
- rest?: Schema;
67
- };
68
- };
69
- array: {
70
- keyword: 'array';
71
- args: {
72
- items: Schema[];
73
- min?: number;
74
- max?: number;
75
- unique?: boolean;
76
- };
77
- };
78
- enum: {
79
- keyword: 'enum';
80
- args: {
81
- name: string;
82
- typeName: string;
83
- asConst: boolean;
84
- items: Array<{
85
- name: string | number;
86
- format: 'string' | 'number' | 'boolean';
87
- value?: string | number | boolean;
88
- }>;
89
- };
90
- };
91
- and: {
92
- keyword: 'and';
93
- args: Schema[];
94
- };
95
- const: {
96
- keyword: 'const';
97
- args: {
98
- name: string | number;
99
- format: 'string' | 'number' | 'boolean';
100
- value?: string | number | boolean;
101
- };
102
- };
103
- union: {
104
- keyword: 'union';
105
- args: Schema[];
106
- };
107
- ref: {
108
- keyword: 'ref';
109
- args: {
110
- name: string;
111
- $ref: string;
112
- /**
113
- * Full qualified path.
114
- */
115
- path: KubbFile.OptionalPath;
116
- /**
117
- * When true `File.Import` will be used.
118
- * When false a reference will be used inside the current file.
119
- */
120
- isImportable: boolean;
121
- };
122
- };
123
- matches: {
124
- keyword: 'matches';
125
- args?: string;
126
- };
127
- boolean: {
128
- keyword: 'boolean';
129
- };
130
- default: {
131
- keyword: 'default';
132
- args: string | number | boolean;
133
- };
134
- string: {
135
- keyword: 'string';
136
- };
137
- integer: {
138
- keyword: 'integer';
139
- };
140
- number: {
141
- keyword: 'number';
142
- };
143
- max: {
144
- keyword: 'max';
145
- args: number;
146
- };
147
- min: {
148
- keyword: 'min';
149
- args: number;
150
- };
151
- describe: {
152
- keyword: 'describe';
153
- args: string;
154
- };
155
- example: {
156
- keyword: 'example';
157
- args: string;
158
- };
159
- deprecated: {
160
- keyword: 'deprecated';
161
- };
162
- optional: {
163
- keyword: 'optional';
164
- };
165
- undefined: {
166
- keyword: 'undefined';
167
- };
168
- nullish: {
169
- keyword: 'nullish';
170
- };
171
- nullable: {
172
- keyword: 'nullable';
173
- };
174
- null: {
175
- keyword: 'null';
176
- };
177
- any: {
178
- keyword: 'any';
179
- };
180
- unknown: {
181
- keyword: 'unknown';
182
- };
183
- void: {
184
- keyword: 'void';
185
- };
186
- blob: {
187
- keyword: 'blob';
188
- };
189
- schema: {
190
- keyword: 'schema';
191
- args: {
192
- type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
193
- format?: string;
194
- };
195
- };
196
- name: {
197
- keyword: 'name';
198
- args: string;
199
- };
200
- catchall: {
201
- keyword: 'catchall';
202
- };
203
- interface: {
204
- keyword: 'interface';
205
- };
206
- };
207
- declare const schemaKeywords: {
208
- any: "any";
209
- unknown: "unknown";
210
- number: "number";
211
- integer: "integer";
212
- string: "string";
213
- boolean: "boolean";
214
- undefined: "undefined";
215
- nullable: "nullable";
216
- null: "null";
217
- nullish: "nullish";
218
- array: "array";
219
- tuple: "tuple";
220
- enum: "enum";
221
- union: "union";
222
- datetime: "datetime";
223
- date: "date";
224
- email: "email";
225
- uuid: "uuid";
226
- url: "url";
227
- void: "void";
228
- default: "default";
229
- const: "const";
230
- and: "and";
231
- describe: "describe";
232
- min: "min";
233
- max: "max";
234
- optional: "optional";
235
- readOnly: "readOnly";
236
- writeOnly: "writeOnly";
237
- object: "object";
238
- ref: "ref";
239
- matches: "matches";
240
- firstName: "firstName";
241
- lastName: "lastName";
242
- password: "password";
243
- phone: "phone";
244
- blob: "blob";
245
- deprecated: "deprecated";
246
- example: "example";
247
- schema: "schema";
248
- catchall: "catchall";
249
- time: "time";
250
- name: "name";
251
- interface: "interface";
252
- };
253
- type SchemaKeyword = keyof SchemaKeywordMapper;
254
- type SchemaMapper<T = string | null | undefined> = {
255
- [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined;
256
- };
257
- type SchemaKeywordBase<T> = {
258
- keyword: SchemaKeyword;
259
- args: T;
260
- };
261
- type Schema = {
262
- keyword: string;
263
- } | SchemaKeywordMapper[keyof SchemaKeywordMapper];
264
- type SchemaTree = {
265
- parent: Schema | undefined;
266
- current: Schema;
267
- siblings: Schema[];
268
- /**
269
- * this will be equal to the key of a property(object)
270
- */
271
- name?: string;
272
- };
273
- declare function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]>;
274
-
275
- export { type Schema as S, type SchemaTree as a, type SchemaKeyword as b, type SchemaKeywordBase as c, type SchemaKeywordMapper as d, type SchemaMapper as e, isKeyword as i, schemaKeywords as s };
@@ -1,33 +0,0 @@
1
- import { getDefaultBanner } from '@kubb/core';
2
- import { isFunction } from 'remeda';
3
-
4
- // src/utils/getBanner.ts
5
- function getBanner({ output, oas, config }) {
6
- let banner = "";
7
- if (config?.output?.defaultBanner !== false && config) {
8
- const { title, description, version } = oas.api?.info || {};
9
- banner = getDefaultBanner({ title, description, version, config });
10
- }
11
- if (!output.banner) {
12
- return banner;
13
- }
14
- if (isFunction(output.banner)) {
15
- return `${output.banner(oas)}
16
- ${banner}`;
17
- }
18
- return `${output.banner}
19
- ${banner}`;
20
- }
21
- function getFooter({ output, oas }) {
22
- if (!output.footer) {
23
- return void 0;
24
- }
25
- if (isFunction(output.footer)) {
26
- return output.footer(oas);
27
- }
28
- return output.footer;
29
- }
30
-
31
- export { getBanner, getFooter };
32
- //# sourceMappingURL=chunk-6S7YFY6F.js.map
33
- //# sourceMappingURL=chunk-6S7YFY6F.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/getBanner.ts","../src/utils/getFooter.ts"],"names":["isFunction"],"mappings":";;;;AAUO,SAAS,SAAU,CAAA,EAAE,MAAQ,EAAA,GAAA,EAAK,QAAiB,EAAA;AACxD,EAAA,IAAI,MAAS,GAAA,EAAA;AACb,EAAA,IAAI,MAAQ,EAAA,MAAA,EAAQ,aAAkB,KAAA,KAAA,IAAS,MAAQ,EAAA;AACrD,IAAM,MAAA,EAAE,OAAO,WAAa,EAAA,OAAA,KAAY,GAAI,CAAA,GAAA,EAAK,QAAQ,EAAC;AAE1D,IAAA,MAAA,GAAS,iBAAiB,EAAE,KAAA,EAAO,WAAa,EAAA,OAAA,EAAS,QAAQ,CAAA;AAAA;AAGnE,EAAI,IAAA,CAAC,OAAO,MAAQ,EAAA;AAClB,IAAO,OAAA,MAAA;AAAA;AAGT,EAAI,IAAA,UAAA,CAAW,MAAO,CAAA,MAAM,CAAG,EAAA;AAC7B,IAAA,OAAO,CAAG,EAAA,MAAA,CAAO,MAAO,CAAA,GAAG,CAAC;AAAA,EAAK,MAAM,CAAA,CAAA;AAAA;AAGzC,EAAO,OAAA,CAAA,EAAG,OAAO,MAAM;AAAA,EAAK,MAAM,CAAA,CAAA;AACpC;AClBO,SAAS,SAAU,CAAA,EAAE,MAAQ,EAAA,GAAA,EAAc,EAAA;AAChD,EAAI,IAAA,CAAC,OAAO,MAAQ,EAAA;AAClB,IAAO,OAAA,MAAA;AAAA;AAGT,EAAIA,IAAAA,UAAAA,CAAW,MAAO,CAAA,MAAM,CAAG,EAAA;AAC7B,IAAO,OAAA,MAAA,CAAO,OAAO,GAAG,CAAA;AAAA;AAG1B,EAAA,OAAO,MAAO,CAAA,MAAA;AAChB","file":"chunk-6S7YFY6F.js","sourcesContent":["import { getDefaultBanner, type Config, type Output } from '@kubb/core'\nimport type { Oas } from '@kubb/oas'\nimport { isFunction } from 'remeda'\n\ntype Props = {\n oas: Oas\n output: Output<Oas>\n config?: Config\n}\n\nexport function getBanner({ output, oas, config }: Props) {\n let banner = ''\n if (config?.output?.defaultBanner !== false && config) {\n const { title, description, version } = oas.api?.info || {}\n\n banner = getDefaultBanner({ title, description, version, config })\n }\n\n if (!output.banner) {\n return banner\n }\n\n if (isFunction(output.banner)) {\n return `${output.banner(oas)}\\n${banner}`\n }\n\n return `${output.banner}\\n${banner}`\n}\n","import type { Output } from '@kubb/core'\nimport type { Oas } from '@kubb/oas'\nimport { isFunction } from 'remeda'\n\ntype Props = {\n oas: Oas\n output: Output<Oas>\n}\n\nexport function getFooter({ output, oas }: Props) {\n if (!output.footer) {\n return undefined\n }\n\n if (isFunction(output.footer)) {\n return output.footer(oas)\n }\n\n return output.footer\n}\n"]}
@@ -1,56 +0,0 @@
1
- // src/SchemaMapper.ts
2
- var schemaKeywords = {
3
- any: "any",
4
- unknown: "unknown",
5
- number: "number",
6
- integer: "integer",
7
- string: "string",
8
- boolean: "boolean",
9
- undefined: "undefined",
10
- nullable: "nullable",
11
- null: "null",
12
- nullish: "nullish",
13
- array: "array",
14
- tuple: "tuple",
15
- enum: "enum",
16
- union: "union",
17
- datetime: "datetime",
18
- date: "date",
19
- email: "email",
20
- uuid: "uuid",
21
- url: "url",
22
- void: "void",
23
- /* intersection */
24
- default: "default",
25
- const: "const",
26
- and: "and",
27
- describe: "describe",
28
- min: "min",
29
- max: "max",
30
- optional: "optional",
31
- readOnly: "readOnly",
32
- writeOnly: "writeOnly",
33
- // custom ones
34
- object: "object",
35
- ref: "ref",
36
- matches: "matches",
37
- firstName: "firstName",
38
- lastName: "lastName",
39
- password: "password",
40
- phone: "phone",
41
- blob: "blob",
42
- deprecated: "deprecated",
43
- example: "example",
44
- schema: "schema",
45
- catchall: "catchall",
46
- time: "time",
47
- name: "name",
48
- interface: "interface"
49
- };
50
- function isKeyword(meta, keyword) {
51
- return meta.keyword === keyword;
52
- }
53
-
54
- export { isKeyword, schemaKeywords };
55
- //# sourceMappingURL=chunk-76E35IZ2.js.map
56
- //# sourceMappingURL=chunk-76E35IZ2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/SchemaMapper.ts"],"names":[],"mappings":";AA6FO,IAAM,cAAiB,GAAA;AAAA,EAC5B,GAAK,EAAA,KAAA;AAAA,EACL,OAAS,EAAA,SAAA;AAAA,EACT,MAAQ,EAAA,QAAA;AAAA,EACR,OAAS,EAAA,SAAA;AAAA,EACT,MAAQ,EAAA,QAAA;AAAA,EACR,OAAS,EAAA,SAAA;AAAA,EACT,SAAW,EAAA,WAAA;AAAA,EACX,QAAU,EAAA,UAAA;AAAA,EACV,IAAM,EAAA,MAAA;AAAA,EACN,OAAS,EAAA,SAAA;AAAA,EACT,KAAO,EAAA,OAAA;AAAA,EACP,KAAO,EAAA,OAAA;AAAA,EACP,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,OAAA;AAAA,EACP,QAAU,EAAA,UAAA;AAAA,EACV,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,OAAA;AAAA,EACP,IAAM,EAAA,MAAA;AAAA,EACN,GAAK,EAAA,KAAA;AAAA,EACL,IAAM,EAAA,MAAA;AAAA;AAAA,EAEN,OAAS,EAAA,SAAA;AAAA,EACT,KAAO,EAAA,OAAA;AAAA,EACP,GAAK,EAAA,KAAA;AAAA,EACL,QAAU,EAAA,UAAA;AAAA,EACV,GAAK,EAAA,KAAA;AAAA,EACL,GAAK,EAAA,KAAA;AAAA,EACL,QAAU,EAAA,UAAA;AAAA,EACV,QAAU,EAAA,UAAA;AAAA,EACV,SAAW,EAAA,WAAA;AAAA;AAAA,EAGX,MAAQ,EAAA,QAAA;AAAA,EACR,GAAK,EAAA,KAAA;AAAA,EACL,OAAS,EAAA,SAAA;AAAA,EACT,SAAW,EAAA,WAAA;AAAA,EACX,QAAU,EAAA,UAAA;AAAA,EACV,QAAU,EAAA,UAAA;AAAA,EACV,KAAO,EAAA,OAAA;AAAA,EACP,IAAM,EAAA,MAAA;AAAA,EACN,UAAY,EAAA,YAAA;AAAA,EACZ,OAAS,EAAA,SAAA;AAAA,EACT,MAAQ,EAAA,QAAA;AAAA,EACR,QAAU,EAAA,UAAA;AAAA,EACV,IAAM,EAAA,MAAA;AAAA,EACN,IAAM,EAAA,MAAA;AAAA,EACN,SAAW,EAAA;AACb;AA2BO,SAAS,SAAA,CAAiE,MAAS,OAAwD,EAAA;AAChJ,EAAA,OAAO,KAAK,OAAY,KAAA,OAAA;AAC1B","file":"chunk-76E35IZ2.js","sourcesContent":["import type { KubbFile } from '@kubb/core/fs'\n\nexport type SchemaKeywordMapper = {\n object: {\n keyword: 'object'\n args: {\n properties: { [x: string]: Schema[] }\n additionalProperties: Schema[]\n strict?: boolean\n }\n }\n url: { keyword: 'url' }\n readOnly: { keyword: 'readOnly' }\n writeOnly: { keyword: 'writeOnly' }\n uuid: { keyword: 'uuid' }\n email: { keyword: 'email' }\n firstName: { keyword: 'firstName' }\n lastName: { keyword: 'lastName' }\n phone: { keyword: 'phone' }\n password: { keyword: 'password' }\n date: { keyword: 'date'; args: { type?: 'date' | 'string' } }\n time: { keyword: 'time'; args: { type?: 'date' | 'string' } }\n datetime: { keyword: 'datetime'; args: { offset?: boolean; local?: boolean } }\n tuple: { keyword: 'tuple'; args: { items: Schema[]; min?: number; max?: number; rest?: Schema } }\n array: {\n keyword: 'array'\n args: { items: Schema[]; min?: number; max?: number; unique?: boolean }\n }\n enum: {\n keyword: 'enum'\n args: {\n name: string\n typeName: string\n asConst: boolean\n items: Array<{\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }>\n }\n }\n and: { keyword: 'and'; args: Schema[] }\n const: {\n keyword: 'const'\n args: {\n name: string | number\n format: 'string' | 'number' | 'boolean'\n value?: string | number | boolean\n }\n }\n union: { keyword: 'union'; args: Schema[] }\n ref: {\n keyword: 'ref'\n args: {\n name: string\n $ref: string\n /**\n * Full qualified path.\n */\n path: KubbFile.OptionalPath\n /**\n * When true `File.Import` will be used.\n * When false a reference will be used inside the current file.\n */\n isImportable: boolean\n }\n }\n matches: { keyword: 'matches'; args?: string }\n boolean: { keyword: 'boolean' }\n default: { keyword: 'default'; args: string | number | boolean }\n string: { keyword: 'string' }\n integer: { keyword: 'integer' }\n number: { keyword: 'number' }\n max: { keyword: 'max'; args: number }\n min: { keyword: 'min'; args: number }\n describe: { keyword: 'describe'; args: string }\n example: { keyword: 'example'; args: string }\n deprecated: { keyword: 'deprecated' }\n optional: { keyword: 'optional' }\n undefined: { keyword: 'undefined' }\n nullish: { keyword: 'nullish' }\n nullable: { keyword: 'nullable' }\n null: { keyword: 'null' }\n any: { keyword: 'any' }\n unknown: { keyword: 'unknown' }\n void: { keyword: 'void' }\n blob: { keyword: 'blob' }\n schema: { keyword: 'schema'; args: { type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object'; format?: string } }\n name: { keyword: 'name'; args: string }\n catchall: { keyword: 'catchall' }\n interface: { keyword: 'interface' }\n}\n\nexport const schemaKeywords = {\n any: 'any',\n unknown: 'unknown',\n number: 'number',\n integer: 'integer',\n string: 'string',\n boolean: 'boolean',\n undefined: 'undefined',\n nullable: 'nullable',\n null: 'null',\n nullish: 'nullish',\n array: 'array',\n tuple: 'tuple',\n enum: 'enum',\n union: 'union',\n datetime: 'datetime',\n date: 'date',\n email: 'email',\n uuid: 'uuid',\n url: 'url',\n void: 'void',\n /* intersection */\n default: 'default',\n const: 'const',\n and: 'and',\n describe: 'describe',\n min: 'min',\n max: 'max',\n optional: 'optional',\n readOnly: 'readOnly',\n writeOnly: 'writeOnly',\n\n // custom ones\n object: 'object',\n ref: 'ref',\n matches: 'matches',\n firstName: 'firstName',\n lastName: 'lastName',\n password: 'password',\n phone: 'phone',\n blob: 'blob',\n deprecated: 'deprecated',\n example: 'example',\n schema: 'schema',\n catchall: 'catchall',\n time: 'time',\n name: 'name',\n interface: 'interface',\n} satisfies {\n [K in keyof SchemaKeywordMapper]: SchemaKeywordMapper[K]['keyword']\n}\n\nexport type SchemaKeyword = keyof SchemaKeywordMapper\n\nexport type SchemaMapper<T = string | null | undefined> = {\n [K in keyof SchemaKeywordMapper]: (() => T | undefined) | undefined\n}\n\nexport type SchemaKeywordBase<T> = {\n keyword: SchemaKeyword\n args: T\n}\n\nexport type Schema = { keyword: string } | SchemaKeywordMapper[keyof SchemaKeywordMapper]\n\nexport type SchemaTree = {\n parent: Schema | undefined\n current: Schema\n siblings: Schema[]\n /**\n * this will be equal to the key of a property(object)\n */\n name?: string\n}\n\nexport function isKeyword<T extends Schema, K extends keyof SchemaKeywordMapper>(meta: T, keyword: K): meta is Extract<T, SchemaKeywordMapper[K]> {\n return meta.keyword === keyword\n}\n"]}
@@ -1,41 +0,0 @@
1
- 'use strict';
2
-
3
- var path = require('path');
4
- var utils = require('@kubb/core/utils');
5
- var oas = require('@kubb/oas');
6
- var yaml = require('@stoplight/yaml');
7
-
8
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
-
10
- var yaml__default = /*#__PURE__*/_interopDefault(yaml);
11
-
12
- // src/utils/parseFromConfig.ts
13
- function parseFromConfig(config, oasClass = oas.Oas) {
14
- if ("data" in config.input) {
15
- if (typeof config.input.data === "object") {
16
- const api2 = JSON.parse(JSON.stringify(config.input.data));
17
- return oas.parse(api2, { oasClass });
18
- }
19
- try {
20
- const api2 = yaml__default.default.parse(config.input.data);
21
- return oas.parse(api2, { oasClass });
22
- } catch (_e) {
23
- }
24
- const api = JSON.parse(JSON.stringify(config.input.data));
25
- return oas.parse(api, { oasClass });
26
- }
27
- if (Array.isArray(config.input)) {
28
- return oas.merge(
29
- config.input.map((input) => input.path),
30
- { oasClass }
31
- );
32
- }
33
- if (new utils.URLPath(config.input.path).isURL) {
34
- return oas.parse(config.input.path, { oasClass });
35
- }
36
- return oas.parse(path.resolve(config.root, config.input.path), { oasClass });
37
- }
38
-
39
- exports.parseFromConfig = parseFromConfig;
40
- //# sourceMappingURL=chunk-7RFNM43R.cjs.map
41
- //# sourceMappingURL=chunk-7RFNM43R.cjs.map