@bagelink/sdk 0.0.460 → 0.0.464
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
|
@@ -208,11 +208,11 @@ function generateFunctionForOperation(method, path, operation) {
|
|
|
208
208
|
}
|
|
209
209
|
const generateRandomString = () => Math.random().toString(36).substring(7);
|
|
210
210
|
function fileTemplate(tsString, typeForImport, baseURL) {
|
|
211
|
-
const templateCode = `import axios
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
axios.defaults.baseURL = ${baseURL};
|
|
211
|
+
const templateCode = `import axios as ax from 'axios';
|
|
212
|
+
import type { AxiosResponse } from 'axios';
|
|
213
|
+
import type {${typeForImport.join(", ")}} from './types.d';
|
|
215
214
|
|
|
215
|
+
const axios = ax.create({baseURL:${baseURL}});
|
|
216
216
|
${tsString}`;
|
|
217
217
|
const doubleQuoteRegex = /"([^"]+)":/g;
|
|
218
218
|
return templateCode.replace(doubleQuoteRegex, "$1:");
|
package/dist/index.mjs
CHANGED
|
@@ -202,11 +202,11 @@ function generateFunctionForOperation(method, path, operation) {
|
|
|
202
202
|
}
|
|
203
203
|
const generateRandomString = () => Math.random().toString(36).substring(7);
|
|
204
204
|
function fileTemplate(tsString, typeForImport, baseURL) {
|
|
205
|
-
const templateCode = `import axios
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
axios.defaults.baseURL = ${baseURL};
|
|
205
|
+
const templateCode = `import axios as ax from 'axios';
|
|
206
|
+
import type { AxiosResponse } from 'axios';
|
|
207
|
+
import type {${typeForImport.join(", ")}} from './types.d';
|
|
209
208
|
|
|
209
|
+
const axios = ax.create({baseURL:${baseURL}});
|
|
210
210
|
${tsString}`;
|
|
211
211
|
const doubleQuoteRegex = /"([^"]+)":/g;
|
|
212
212
|
return templateCode.replace(doubleQuoteRegex, "$1:");
|
package/package.json
CHANGED
|
@@ -163,11 +163,11 @@ const generateRandomString = () => Math.random().toString(36).substring(7);
|
|
|
163
163
|
|
|
164
164
|
function fileTemplate(tsString: string, typeForImport: string[], baseURL: string) {
|
|
165
165
|
const templateCode = (
|
|
166
|
-
`import axios
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
axios.defaults.baseURL = ${baseURL};
|
|
166
|
+
`import axios as ax from 'axios';
|
|
167
|
+
import type { AxiosResponse } from 'axios';
|
|
168
|
+
import type {${typeForImport.join(', ')}} from './types.d';
|
|
170
169
|
|
|
170
|
+
const axios = ax.create({baseURL:${baseURL}});
|
|
171
171
|
${tsString}`
|
|
172
172
|
);
|
|
173
173
|
const doubleQuoteRegex = /"([^"]+)":/g;
|