api-core-lib 12.0.59 → 12.0.61
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.cjs +14 -5
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -235,15 +235,24 @@ async function _generateTypesFile(moduleFolderPath, moduleName, typeNames, spec)
|
|
|
235
235
|
};
|
|
236
236
|
const rootSchemaForCompilation = {
|
|
237
237
|
$id: "allSchemas",
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
components: {
|
|
239
|
+
schemas: allSchemas
|
|
240
|
+
}
|
|
241
|
+
// لقد قمنا بإزالة السطرين التاليين:
|
|
242
|
+
// type: "object" as const,
|
|
243
|
+
// properties: {}
|
|
242
244
|
};
|
|
243
245
|
for (const typeName of Array.from(typeNames).sort()) {
|
|
244
246
|
if (allSchemas[typeName]) {
|
|
245
247
|
try {
|
|
246
|
-
const
|
|
248
|
+
const tempSchemaToCompile = {
|
|
249
|
+
$ref: `#/components/schemas/${typeName}`
|
|
250
|
+
};
|
|
251
|
+
const tsType = await (0, import_json_schema_to_typescript.compile)(
|
|
252
|
+
{ ...rootSchemaForCompilation, ...tempSchemaToCompile },
|
|
253
|
+
typeName,
|
|
254
|
+
compilationOptions
|
|
255
|
+
);
|
|
247
256
|
typesContent += tsType + "\n";
|
|
248
257
|
} catch (compileError) {
|
|
249
258
|
console.error(import_chalk.default.red(` - Error compiling type "${typeName}": ${compileError.message}`));
|