@bagelink/sdk 1.0.13 → 1.0.16

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/index.cjs CHANGED
@@ -379,8 +379,9 @@ function generateTypes(schemas) {
379
379
  const varType = formatVarType({ varName: key, schema: value });
380
380
  return ` ${varType}`;
381
381
  }).join(";\n ");
382
+ const indexSignature = schema.additionalProperties === true ? "\n [key: string]: any;" : "";
382
383
  return `export type ${typeName} = {
383
- ${properties};
384
+ ${properties};${indexSignature}
384
385
  };
385
386
  `;
386
387
  }).join("\n");
package/dist/index.mjs CHANGED
@@ -373,8 +373,9 @@ function generateTypes(schemas) {
373
373
  const varType = formatVarType({ varName: key, schema: value });
374
374
  return ` ${varType}`;
375
375
  }).join(";\n ");
376
+ const indexSignature = schema.additionalProperties === true ? "\n [key: string]: any;" : "";
376
377
  return `export type ${typeName} = {
377
- ${properties};
378
+ ${properties};${indexSignature}
378
379
  };
379
380
  `;
380
381
  }).join("\n");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/sdk",
3
3
  "type": "module",
4
- "version": "1.0.13",
4
+ "version": "1.0.16",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -44,7 +44,10 @@ export function generateTypes(schemas: SchemasObject): string {
44
44
  })
45
45
  .join(';\n ')
46
46
 
47
- return `export type ${typeName} = {\n ${properties};\n };\n`
47
+ // Add index signature for additionalProperties if true
48
+ const indexSignature = schema.additionalProperties === true ? '\n\t\t[key: string]: any;' : ''
49
+
50
+ return `export type ${typeName} = {\n ${properties};${indexSignature}\n };\n`
48
51
  })
49
52
  .join('\n')
50
53
  }