|
3 | 3 | {{>licenseInfo}}
|
4 | 4 |
|
5 | 5 | import * as url from "url";
|
6 |
| -import * as portableFetch from "portable-fetch"; |
| 6 | +import * as isomorphicFetch from "isomorphic-fetch"; |
7 | 7 | import { Configuration } from "./configuration";
|
8 | 8 |
|
9 | 9 | const BASE_PATH = "{{{basePath}}}".replace(/\/+$/, "");
|
@@ -46,7 +46,7 @@ export interface FetchArgs {
|
46 | 46 | export class BaseAPI {
|
47 | 47 | protected configuration: Configuration;
|
48 | 48 |
|
49 |
| - constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected fetch: FetchAPI = portableFetch) { |
| 49 | + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected fetch: FetchAPI = isomorphicFetch) { |
50 | 50 | if (configuration) {
|
51 | 51 | this.configuration = configuration;
|
52 | 52 | this.basePath = configuration.basePath || this.basePath;
|
@@ -262,7 +262,7 @@ export const {{classname}}Fp = function(configuration?: Configuration) {
|
262 | 262 | */
|
263 | 263 | {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}}> {
|
264 | 264 | const localVarFetchArgs = {{classname}}FetchParamCreator(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options);
|
265 |
| - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { |
| 265 | + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { |
266 | 266 | return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
|
267 | 267 | if (response.status >= 200 && response.status < 300) {
|
268 | 268 | return response{{#returnType}}.json(){{/returnType}};
|
|
0 commit comments