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.
Files changed (2) hide show
  1. package/dist/cli.cjs +14 -5
  2. 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
- definitions: allSchemas,
239
- type: "object",
240
- // <-- الإصلاح هنا
241
- properties: {}
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 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
+ );
247
256
  typesContent += tsType + "\n";
248
257
  } catch (compileError) {
249
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.59",
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": {