appwrite-utils-cli 0.0.30 → 0.0.32
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.
|
@@ -180,6 +180,11 @@ export class SchemaGenerator {
|
|
|
180
180
|
createSchemaString = (name, attributes) => {
|
|
181
181
|
const pascalName = toPascalCase(name);
|
|
182
182
|
let imports = `import { z } from "zod";\n`;
|
|
183
|
+
const hasDescription = attributes.some((attr) => attr.description);
|
|
184
|
+
if (hasDescription) {
|
|
185
|
+
imports += `import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";\n`;
|
|
186
|
+
imports += `extendZodWithOpenApi(z);\n`;
|
|
187
|
+
}
|
|
183
188
|
// Use the relationshipMap to find related collections
|
|
184
189
|
const relationshipDetails = this.relationshipMap.get(name) || [];
|
|
185
190
|
const relatedCollections = relationshipDetails
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appwrite-utils-cli",
|
|
3
3
|
"description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.32",
|
|
5
5
|
"main": "src/main.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -241,6 +241,11 @@ export class SchemaGenerator {
|
|
|
241
241
|
createSchemaString = (name: string, attributes: Attribute[]): string => {
|
|
242
242
|
const pascalName = toPascalCase(name);
|
|
243
243
|
let imports = `import { z } from "zod";\n`;
|
|
244
|
+
const hasDescription = attributes.some((attr) => attr.description);
|
|
245
|
+
if (hasDescription) {
|
|
246
|
+
imports += `import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";\n`;
|
|
247
|
+
imports += `extendZodWithOpenApi(z);\n`;
|
|
248
|
+
}
|
|
244
249
|
|
|
245
250
|
// Use the relationshipMap to find related collections
|
|
246
251
|
const relationshipDetails = this.relationshipMap.get(name) || [];
|