api-core-lib 12.0.60 → 12.0.62

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +12 -7
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -233,19 +233,24 @@ async function _generateTypesFile(moduleFolderPath, moduleName, typeNames, spec)
233
233
  additionalProperties: false,
234
234
  declareExternallyReferenced: true
235
235
  };
236
- const rootSchemaForCompilation = {
237
- $id: "allSchemas",
238
- // بدلاً من "definitions", قم ببناء المسار الصحيح
236
+ const schemaContainer = {
239
237
  components: {
240
238
  schemas: allSchemas
241
- },
242
- type: "object",
243
- properties: {}
239
+ }
244
240
  };
245
241
  for (const typeName of Array.from(typeNames).sort()) {
246
242
  if (allSchemas[typeName]) {
247
243
  try {
248
- const tsType = await (0, import_json_schema_to_typescript.compile)(rootSchemaForCompilation, typeName, compilationOptions);
244
+ const tempSchemaToCompile = {
245
+ $ref: `#/components/schemas/${typeName}`
246
+ };
247
+ const finalSchema = { ...schemaContainer, ...tempSchemaToCompile };
248
+ const tsType = await (0, import_json_schema_to_typescript.compile)(
249
+ finalSchema,
250
+ typeName,
251
+ // <-- هذا الاسم سيُستخدم الآن بنجاح!
252
+ compilationOptions
253
+ );
249
254
  typesContent += tsType + "\n";
250
255
  } catch (compileError) {
251
256
  console.error(import_chalk.default.red(` - Error compiling type "${typeName}": ${compileError.message}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-core-lib",
3
- "version": "12.0.60",
3
+ "version": "12.0.62",
4
4
  "description": "A flexible and powerful API client library for modern web applications.",
5
5
  "type": "module",
6
6
  "exports": {