@cerios/openapi-to-zod 0.1.1 → 0.1.2
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/cli.js +11 -0
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +12 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -16
package/dist/index.d.mts
CHANGED
|
@@ -315,6 +315,10 @@ declare class ZodSchemaGenerator {
|
|
|
315
315
|
* @returns The generated TypeScript code as a string
|
|
316
316
|
*/
|
|
317
317
|
generateString(): string;
|
|
318
|
+
/**
|
|
319
|
+
* Ensure directory exists for a file path
|
|
320
|
+
*/
|
|
321
|
+
private ensureDirectoryExists;
|
|
318
322
|
/**
|
|
319
323
|
* Generate the complete output file
|
|
320
324
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -315,6 +315,10 @@ declare class ZodSchemaGenerator {
|
|
|
315
315
|
* @returns The generated TypeScript code as a string
|
|
316
316
|
*/
|
|
317
317
|
generateString(): string;
|
|
318
|
+
/**
|
|
319
|
+
* Ensure directory exists for a file path
|
|
320
|
+
*/
|
|
321
|
+
private ensureDirectoryExists;
|
|
318
322
|
/**
|
|
319
323
|
* Generate the complete output file
|
|
320
324
|
*/
|
package/dist/index.js
CHANGED
|
@@ -93,6 +93,7 @@ var ConfigurationError = class extends GeneratorError {
|
|
|
93
93
|
|
|
94
94
|
// src/generator.ts
|
|
95
95
|
var import_node_fs = require("fs");
|
|
96
|
+
var import_node_path = require("path");
|
|
96
97
|
var import_yaml = require("yaml");
|
|
97
98
|
|
|
98
99
|
// src/utils/name-utils.ts
|
|
@@ -1424,6 +1425,15 @@ var ZodSchemaGenerator = class {
|
|
|
1424
1425
|
}
|
|
1425
1426
|
return output.join("\n");
|
|
1426
1427
|
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Ensure directory exists for a file path
|
|
1430
|
+
*/
|
|
1431
|
+
ensureDirectoryExists(filePath) {
|
|
1432
|
+
const dir = (0, import_node_path.dirname)(filePath);
|
|
1433
|
+
if (!(0, import_node_fs.existsSync)(dir)) {
|
|
1434
|
+
(0, import_node_fs.mkdirSync)(dir, { recursive: true });
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1427
1437
|
/**
|
|
1428
1438
|
* Generate the complete output file
|
|
1429
1439
|
*/
|
|
@@ -1435,6 +1445,7 @@ var ZodSchemaGenerator = class {
|
|
|
1435
1445
|
);
|
|
1436
1446
|
}
|
|
1437
1447
|
const output = this.generateString();
|
|
1448
|
+
this.ensureDirectoryExists(this.options.output);
|
|
1438
1449
|
(0, import_node_fs.writeFileSync)(this.options.output, output);
|
|
1439
1450
|
}
|
|
1440
1451
|
/**
|