@bagelink/sdk 1.0.13 → 1.0.18
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/bin/index.ts
CHANGED
|
@@ -22,7 +22,7 @@ export async function loadTypes() {
|
|
|
22
22
|
await formatAndWriteCode(apiPath, `// eslint-disable no-null \n${code}`)
|
|
23
23
|
|
|
24
24
|
const indexPath = join(bagelinkDir, 'index.ts')
|
|
25
|
-
await formatAndWriteCode(indexPath, `export * from './api'\nexport * from './types'`)
|
|
25
|
+
await formatAndWriteCode(indexPath, `export * from './api'\nexport * from './types.d'`)
|
|
26
26
|
|
|
27
27
|
await handleAuthCode(withAuth, bagelinkDir)
|
|
28
28
|
|
package/dist/index.cjs
CHANGED
|
@@ -280,7 +280,7 @@ function fileTemplate(tsString, typeForImport, baseURL) {
|
|
|
280
280
|
tags?: string[]
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
export const axios = ax.create({baseURL:${baseURL}});
|
|
283
|
+
export const axios = ax.create({baseURL:${baseURL}, withCredentials: true});
|
|
284
284
|
${tsString}`;
|
|
285
285
|
return templateCode.replace(DOUBLE_QUOTE_REGEX, "$1:");
|
|
286
286
|
}
|
|
@@ -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
|
@@ -274,7 +274,7 @@ function fileTemplate(tsString, typeForImport, baseURL) {
|
|
|
274
274
|
tags?: string[]
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
export const axios = ax.create({baseURL:${baseURL}});
|
|
277
|
+
export const axios = ax.create({baseURL:${baseURL}, withCredentials: true});
|
|
278
278
|
${tsString}`;
|
|
279
279
|
return templateCode.replace(DOUBLE_QUOTE_REGEX, "$1:");
|
|
280
280
|
}
|
|
@@ -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
|
@@ -303,7 +303,7 @@ function fileTemplate(
|
|
|
303
303
|
tags?: string[]
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
export const axios = ax.create({baseURL:${baseURL}});
|
|
306
|
+
export const axios = ax.create({baseURL:${baseURL}, withCredentials: true});
|
|
307
307
|
${tsString}`
|
|
308
308
|
return templateCode.replace(DOUBLE_QUOTE_REGEX, '$1:')
|
|
309
309
|
}
|
|
@@ -44,7 +44,10 @@ export function generateTypes(schemas: SchemasObject): string {
|
|
|
44
44
|
})
|
|
45
45
|
.join(';\n ')
|
|
46
46
|
|
|
47
|
-
|
|
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
|
}
|