@orval/core 6.27.0 → 6.28.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/index.d.ts +19 -0
- package/dist/index.js +26 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ type NormalizedOutputOptions = {
|
|
|
31
31
|
workspace?: string;
|
|
32
32
|
target?: string;
|
|
33
33
|
schemas?: string;
|
|
34
|
+
fileExtension: string;
|
|
34
35
|
mode: OutputMode;
|
|
35
36
|
mock?: GlobalMockOptions | ClientMockBuilder;
|
|
36
37
|
override: NormalizedOverrideOutput;
|
|
@@ -38,6 +39,7 @@ type NormalizedOutputOptions = {
|
|
|
38
39
|
clean: boolean | string[];
|
|
39
40
|
prettier: boolean;
|
|
40
41
|
tslint: boolean;
|
|
42
|
+
biome: boolean;
|
|
41
43
|
tsconfig?: Tsconfig;
|
|
42
44
|
packageJson?: PackageJson;
|
|
43
45
|
headers: boolean;
|
|
@@ -136,6 +138,7 @@ type OutputOptions = {
|
|
|
136
138
|
workspace?: string;
|
|
137
139
|
target?: string;
|
|
138
140
|
schemas?: string;
|
|
141
|
+
fileExtension?: string;
|
|
139
142
|
mode?: OutputMode;
|
|
140
143
|
mock?: boolean | GlobalMockOptions | ClientMockBuilder;
|
|
141
144
|
override?: OverrideOutput;
|
|
@@ -143,6 +146,7 @@ type OutputOptions = {
|
|
|
143
146
|
clean?: boolean | string[];
|
|
144
147
|
prettier?: boolean;
|
|
145
148
|
tslint?: boolean;
|
|
149
|
+
biome?: boolean;
|
|
146
150
|
tsconfig?: string | Tsconfig;
|
|
147
151
|
packageJson?: string;
|
|
148
152
|
headers?: boolean;
|
|
@@ -298,6 +302,13 @@ type ZodOptions = {
|
|
|
298
302
|
body?: boolean;
|
|
299
303
|
response?: boolean;
|
|
300
304
|
};
|
|
305
|
+
coerce?: {
|
|
306
|
+
param?: boolean;
|
|
307
|
+
query?: boolean;
|
|
308
|
+
header?: boolean;
|
|
309
|
+
body?: boolean;
|
|
310
|
+
response?: boolean;
|
|
311
|
+
};
|
|
301
312
|
};
|
|
302
313
|
type NormalizedZodOptions = {
|
|
303
314
|
strict: {
|
|
@@ -307,6 +318,13 @@ type NormalizedZodOptions = {
|
|
|
307
318
|
body: boolean;
|
|
308
319
|
response: boolean;
|
|
309
320
|
};
|
|
321
|
+
coerce: {
|
|
322
|
+
param: boolean;
|
|
323
|
+
query: boolean;
|
|
324
|
+
header: boolean;
|
|
325
|
+
body: boolean;
|
|
326
|
+
response: boolean;
|
|
327
|
+
};
|
|
310
328
|
};
|
|
311
329
|
type HonoOptions = {
|
|
312
330
|
handlers?: string;
|
|
@@ -414,6 +432,7 @@ interface GlobalOptions {
|
|
|
414
432
|
clean?: boolean | string[];
|
|
415
433
|
prettier?: boolean;
|
|
416
434
|
tslint?: boolean;
|
|
435
|
+
biome?: boolean;
|
|
417
436
|
mock?: boolean | GlobalMockOptions;
|
|
418
437
|
client?: OutputClient;
|
|
419
438
|
mode?: OutputMode;
|
package/dist/index.js
CHANGED
|
@@ -42197,11 +42197,12 @@ var resolveDiscriminators = (schemas, context) => {
|
|
|
42197
42197
|
if (!subTypeSchema) {
|
|
42198
42198
|
continue;
|
|
42199
42199
|
}
|
|
42200
|
+
const property = subTypeSchema.properties?.[propertyName];
|
|
42200
42201
|
subTypeSchema.properties = {
|
|
42201
42202
|
...subTypeSchema.properties,
|
|
42202
42203
|
[propertyName]: {
|
|
42203
42204
|
type: "string",
|
|
42204
|
-
enum: [mappingKey]
|
|
42205
|
+
enum: [...property?.enum ?? [], mappingKey]
|
|
42205
42206
|
}
|
|
42206
42207
|
};
|
|
42207
42208
|
subTypeSchema.required = [
|
|
@@ -43874,7 +43875,8 @@ var writeSingleMode = async ({
|
|
|
43874
43875
|
}) => {
|
|
43875
43876
|
try {
|
|
43876
43877
|
const { path: path2, dirname: dirname3 } = getFileInfo(output.target, {
|
|
43877
|
-
backupFilename: camel(builder.info.title)
|
|
43878
|
+
backupFilename: camel(builder.info.title),
|
|
43879
|
+
extension: output.fileExtension
|
|
43878
43880
|
});
|
|
43879
43881
|
const {
|
|
43880
43882
|
imports,
|
|
@@ -43888,7 +43890,10 @@ var writeSingleMode = async ({
|
|
|
43888
43890
|
paramsSerializer
|
|
43889
43891
|
} = generateTarget(builder, output);
|
|
43890
43892
|
let data = header;
|
|
43891
|
-
const schemasPath = output.schemas ? path_exports.relativeSafe(
|
|
43893
|
+
const schemasPath = output.schemas ? path_exports.relativeSafe(
|
|
43894
|
+
dirname3,
|
|
43895
|
+
getFileInfo(output.schemas, { extension: output.fileExtension }).dirname
|
|
43896
|
+
) : void 0;
|
|
43892
43897
|
const isAllowSyntheticDefaultImports = isSyntheticDefaultImportsAllow(
|
|
43893
43898
|
output.tsconfig
|
|
43894
43899
|
);
|
|
@@ -43968,7 +43973,8 @@ var writeSplitMode = async ({
|
|
|
43968
43973
|
}) => {
|
|
43969
43974
|
try {
|
|
43970
43975
|
const { filename, dirname: dirname3, extension } = getFileInfo(output.target, {
|
|
43971
|
-
backupFilename: camel(builder.info.title)
|
|
43976
|
+
backupFilename: camel(builder.info.title),
|
|
43977
|
+
extension: output.fileExtension
|
|
43972
43978
|
});
|
|
43973
43979
|
const {
|
|
43974
43980
|
imports,
|
|
@@ -43983,7 +43989,10 @@ var writeSplitMode = async ({
|
|
|
43983
43989
|
} = generateTarget(builder, output);
|
|
43984
43990
|
let implementationData = header;
|
|
43985
43991
|
let mockData = header;
|
|
43986
|
-
const relativeSchemasPath = output.schemas ? path_exports.relativeSafe(
|
|
43992
|
+
const relativeSchemasPath = output.schemas ? path_exports.relativeSafe(
|
|
43993
|
+
dirname3,
|
|
43994
|
+
getFileInfo(output.schemas, { extension: output.fileExtension }).dirname
|
|
43995
|
+
) : "./" + filename + ".schemas";
|
|
43987
43996
|
const isAllowSyntheticDefaultImports = isSyntheticDefaultImportsAllow(
|
|
43988
43997
|
output.tsconfig
|
|
43989
43998
|
);
|
|
@@ -44206,7 +44215,8 @@ var writeSplitTagsMode = async ({
|
|
|
44206
44215
|
needSchema
|
|
44207
44216
|
}) => {
|
|
44208
44217
|
const { filename, dirname: dirname3, extension } = getFileInfo(output.target, {
|
|
44209
|
-
backupFilename: camel(builder.info.title)
|
|
44218
|
+
backupFilename: camel(builder.info.title),
|
|
44219
|
+
extension: output.fileExtension
|
|
44210
44220
|
});
|
|
44211
44221
|
const target = generateTargetForTags(builder, output);
|
|
44212
44222
|
const isAllowSyntheticDefaultImports = isSyntheticDefaultImportsAllow(
|
|
@@ -44228,7 +44238,10 @@ var writeSplitTagsMode = async ({
|
|
|
44228
44238
|
} = target2;
|
|
44229
44239
|
let implementationData = header;
|
|
44230
44240
|
let mockData = header;
|
|
44231
|
-
const relativeSchemasPath = output.schemas ? "../" + path_exports.relativeSafe(
|
|
44241
|
+
const relativeSchemasPath = output.schemas ? "../" + path_exports.relativeSafe(
|
|
44242
|
+
dirname3,
|
|
44243
|
+
getFileInfo(output.schemas, { extension: output.fileExtension }).dirname
|
|
44244
|
+
) : "../" + filename + ".schemas";
|
|
44232
44245
|
const importsForBuilder = output.schemas && !output.indexFiles ? (0, import_lodash12.default)(imports, "name").map((i3) => ({
|
|
44233
44246
|
exports: [i3],
|
|
44234
44247
|
dependency: path_exports.join(relativeSchemasPath, camel(i3.name))
|
|
@@ -44335,7 +44348,8 @@ var writeTagsMode = async ({
|
|
|
44335
44348
|
needSchema
|
|
44336
44349
|
}) => {
|
|
44337
44350
|
const { filename, dirname: dirname3, extension } = getFileInfo(output.target, {
|
|
44338
|
-
backupFilename: camel(builder.info.title)
|
|
44351
|
+
backupFilename: camel(builder.info.title),
|
|
44352
|
+
extension: output.fileExtension
|
|
44339
44353
|
});
|
|
44340
44354
|
const target = generateTargetForTags(builder, output);
|
|
44341
44355
|
const isAllowSyntheticDefaultImports = isSyntheticDefaultImportsAllow(
|
|
@@ -44356,7 +44370,10 @@ var writeTagsMode = async ({
|
|
|
44356
44370
|
paramsSerializer
|
|
44357
44371
|
} = target2;
|
|
44358
44372
|
let data = header;
|
|
44359
|
-
const schemasPathRelative = output.schemas ? path_exports.relativeSafe(
|
|
44373
|
+
const schemasPathRelative = output.schemas ? path_exports.relativeSafe(
|
|
44374
|
+
dirname3,
|
|
44375
|
+
getFileInfo(output.schemas, { extension: output.fileExtension }).dirname
|
|
44376
|
+
) : "./" + filename + ".schemas";
|
|
44360
44377
|
const importsForBuilder = [
|
|
44361
44378
|
{
|
|
44362
44379
|
exports: imports.filter(
|