api-core-lib 12.0.60 → 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.
Files changed (2) hide show
  1. package/dist/cli.cjs +12 -5
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -235,17 +235,24 @@ async function _generateTypesFile(moduleFolderPath, moduleName, typeNames, spec)
235
235
  };
236
236
  const rootSchemaForCompilation = {
237
237
  $id: "allSchemas",
238
- // بدلاً من "definitions", قم ببناء المسار الصحيح
239
238
  components: {
240
239
  schemas: allSchemas
241
- },
242
- type: "object",
243
- properties: {}
240
+ }
241
+ // لقد قمنا بإزالة السطرين التاليين:
242
+ // type: "object" as const,
243
+ // properties: {}
244
244
  };
245
245
  for (const typeName of Array.from(typeNames).sort()) {
246
246
  if (allSchemas[typeName]) {
247
247
  try {
248
- const tsType = await (0, import_json_schema_to_typescript.compile)(rootSchemaForCompilation, typeName, compilationOptions);
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
+ );
249
256
  typesContent += tsType + "\n";
250
257
  } catch (compileError) {
251
258
  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.61",
4
4
  "description": "A flexible and powerful API client library for modern web applications.",
5
5
  "type": "module",
6
6
  "exports": {