api-core-lib 12.0.61 → 12.0.63
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 +4 -6
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -233,14 +233,10 @@ async function _generateTypesFile(moduleFolderPath, moduleName, typeNames, spec)
|
|
|
233
233
|
additionalProperties: false,
|
|
234
234
|
declareExternallyReferenced: true
|
|
235
235
|
};
|
|
236
|
-
const
|
|
237
|
-
$id: "allSchemas",
|
|
236
|
+
const schemaContainer = {
|
|
238
237
|
components: {
|
|
239
238
|
schemas: allSchemas
|
|
240
239
|
}
|
|
241
|
-
// لقد قمنا بإزالة السطرين التاليين:
|
|
242
|
-
// type: "object" as const,
|
|
243
|
-
// properties: {}
|
|
244
240
|
};
|
|
245
241
|
for (const typeName of Array.from(typeNames).sort()) {
|
|
246
242
|
if (allSchemas[typeName]) {
|
|
@@ -248,9 +244,11 @@ async function _generateTypesFile(moduleFolderPath, moduleName, typeNames, spec)
|
|
|
248
244
|
const tempSchemaToCompile = {
|
|
249
245
|
$ref: `#/components/schemas/${typeName}`
|
|
250
246
|
};
|
|
247
|
+
const finalSchema = { ...schemaContainer, ...tempSchemaToCompile };
|
|
251
248
|
const tsType = await (0, import_json_schema_to_typescript.compile)(
|
|
252
|
-
|
|
249
|
+
finalSchema,
|
|
253
250
|
typeName,
|
|
251
|
+
// <-- هذا الاسم سيُستخدم الآن بنجاح!
|
|
254
252
|
compilationOptions
|
|
255
253
|
);
|
|
256
254
|
typesContent += tsType + "\n";
|