api-core-lib 12.0.80 → 12.0.81

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 +10 -5
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -213,19 +213,24 @@ function parseSpecToModules(spec) {
213
213
  const allEnums = /* @__PURE__ */ new Map();
214
214
  const modulePaths = /* @__PURE__ */ new Map();
215
215
  const registerSchema = (schema, baseName) => {
216
- if (!schema) return "unknown";
216
+ if (!schema) return "Record<string, any>";
217
217
  if (schema.type === "array" && schema.items) {
218
218
  const itemSchema = schema.items;
219
219
  const itemBaseName = `${baseName}Item`;
220
- if (itemSchema.properties || itemSchema.type === "object") return `${registerSchema(itemSchema, itemBaseName)}[]`;
221
- return `${itemSchema.type || "unknown"}[]`;
220
+ if (itemSchema.properties || itemSchema.type === "object") {
221
+ return `${registerSchema(itemSchema, itemBaseName)}[]`;
222
+ }
223
+ const primitiveType = itemSchema.type === "integer" ? "number" : itemSchema.type || "any";
224
+ return `${primitiveType}[]`;
222
225
  }
223
226
  if (schema.type === "object" || schema.properties || schema.allOf || !schema.type) {
224
227
  const typeName = toPascalCase(baseName.replace(/_v\d+(Request|Response)$/, "$1"));
225
- if (!allSchemas.has(typeName)) allSchemas.set(typeName, parseSchema(typeName, schema, allEnums));
228
+ if (!allSchemas.has(typeName)) {
229
+ allSchemas.set(typeName, parseSchema(typeName, schema, allEnums));
230
+ }
226
231
  return typeName;
227
232
  }
228
- return schema.type === "integer" ? "number" : schema.type || "unknown";
233
+ return schema.type === "integer" ? "number" : schema.type || "any";
229
234
  };
230
235
  for (const apiPath in spec.paths) {
231
236
  const pathItem = spec.paths[apiPath];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-core-lib",
3
- "version": "12.0.80",
3
+ "version": "12.0.81",
4
4
  "description": "A flexible and powerful API client library for modern web applications.",
5
5
  "type": "module",
6
6
  "exports": {