diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d13e1f7..480b5cd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # next release +# 8.0.1 + +Fixes: +- Not working `customFetch` + Error: `Failed to execute 'fetch' on 'Window': Illegal invocation` + # 8.0.0 BREAKING_CHANGES: diff --git a/package-lock.json b/package-lock.json index 890ac917..15000de8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "swagger-typescript-api", - "version": "8.0.0", + "version": "8.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5d9a31a2..ae2bf656 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "swagger-typescript-api", - "version": "8.0.0", + "version": "8.0.1", "description": "Generate typescript/javascript api from swagger schema", "scripts": { "cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts", diff --git a/templates/base/http-clients/fetch-http-client.eta b/templates/base/http-clients/fetch-http-client.eta index b7bcf5c2..0dda48d3 100644 --- a/templates/base/http-clients/fetch-http-client.eta +++ b/templates/base/http-clients/fetch-http-client.eta @@ -31,7 +31,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -52,7 +52,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: 'same-origin', diff --git a/tests/generated/v2.0/adafruit.ts b/tests/generated/v2.0/adafruit.ts index d1a05171..296b54a2 100644 --- a/tests/generated/v2.0/adafruit.ts +++ b/tests/generated/v2.0/adafruit.ts @@ -192,7 +192,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -213,7 +213,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/another-example.ts b/tests/generated/v2.0/another-example.ts index 05e5bbd3..80282bb4 100644 --- a/tests/generated/v2.0/another-example.ts +++ b/tests/generated/v2.0/another-example.ts @@ -168,7 +168,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -189,7 +189,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/another-schema.ts b/tests/generated/v2.0/another-schema.ts index b3fdbbdc..43eaa01a 100644 --- a/tests/generated/v2.0/another-schema.ts +++ b/tests/generated/v2.0/another-schema.ts @@ -60,7 +60,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -81,7 +81,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/api-with-examples.ts b/tests/generated/v2.0/api-with-examples.ts index 55cf244c..d838b0ac 100644 --- a/tests/generated/v2.0/api-with-examples.ts +++ b/tests/generated/v2.0/api-with-examples.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/authentiq.ts b/tests/generated/v2.0/authentiq.ts index e5512bc3..ad0bbf51 100644 --- a/tests/generated/v2.0/authentiq.ts +++ b/tests/generated/v2.0/authentiq.ts @@ -89,7 +89,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -110,7 +110,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/enums.ts b/tests/generated/v2.0/enums.ts index 2c882efe..ea7c804c 100644 --- a/tests/generated/v2.0/enums.ts +++ b/tests/generated/v2.0/enums.ts @@ -102,7 +102,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -123,7 +123,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/example1.ts b/tests/generated/v2.0/example1.ts index 00b4f427..03c08801 100644 --- a/tests/generated/v2.0/example1.ts +++ b/tests/generated/v2.0/example1.ts @@ -64,7 +64,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -85,7 +85,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/file-formdata-example.ts b/tests/generated/v2.0/file-formdata-example.ts index fc6c0e78..3444d012 100644 --- a/tests/generated/v2.0/file-formdata-example.ts +++ b/tests/generated/v2.0/file-formdata-example.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/furkot-example.ts b/tests/generated/v2.0/furkot-example.ts index 6ae341d7..f1eb690c 100644 --- a/tests/generated/v2.0/furkot-example.ts +++ b/tests/generated/v2.0/furkot-example.ts @@ -100,7 +100,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -121,7 +121,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/giphy.ts b/tests/generated/v2.0/giphy.ts index 4e51559c..4ba95720 100644 --- a/tests/generated/v2.0/giphy.ts +++ b/tests/generated/v2.0/giphy.ts @@ -319,7 +319,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -340,7 +340,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/github-swagger.ts b/tests/generated/v2.0/github-swagger.ts index e5fa0292..93b4a85f 100644 --- a/tests/generated/v2.0/github-swagger.ts +++ b/tests/generated/v2.0/github-swagger.ts @@ -1472,7 +1472,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -1493,7 +1493,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/path-args.ts b/tests/generated/v2.0/path-args.ts index 17de507d..a4d5ba97 100644 --- a/tests/generated/v2.0/path-args.ts +++ b/tests/generated/v2.0/path-args.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/petstore-expanded.ts b/tests/generated/v2.0/petstore-expanded.ts index 9564fcb1..28732c1c 100644 --- a/tests/generated/v2.0/petstore-expanded.ts +++ b/tests/generated/v2.0/petstore-expanded.ts @@ -74,7 +74,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -95,7 +95,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/petstore-minimal.ts b/tests/generated/v2.0/petstore-minimal.ts index ab712307..8e06165f 100644 --- a/tests/generated/v2.0/petstore-minimal.ts +++ b/tests/generated/v2.0/petstore-minimal.ts @@ -45,7 +45,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -66,7 +66,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/petstore-simple.ts b/tests/generated/v2.0/petstore-simple.ts index 1a529ea2..4fb3ebdb 100644 --- a/tests/generated/v2.0/petstore-simple.ts +++ b/tests/generated/v2.0/petstore-simple.ts @@ -60,7 +60,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -81,7 +81,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/petstore-swagger-io.ts b/tests/generated/v2.0/petstore-swagger-io.ts index 2eac9a00..c86dceb2 100644 --- a/tests/generated/v2.0/petstore-swagger-io.ts +++ b/tests/generated/v2.0/petstore-swagger-io.ts @@ -105,7 +105,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -126,7 +126,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/petstore-with-external-docs.ts b/tests/generated/v2.0/petstore-with-external-docs.ts index 8997920e..521d40a2 100644 --- a/tests/generated/v2.0/petstore-with-external-docs.ts +++ b/tests/generated/v2.0/petstore-with-external-docs.ts @@ -50,7 +50,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -71,7 +71,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/petstore.ts b/tests/generated/v2.0/petstore.ts index 5cabb1e9..005cb174 100644 --- a/tests/generated/v2.0/petstore.ts +++ b/tests/generated/v2.0/petstore.ts @@ -52,7 +52,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -73,7 +73,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/query-path-param.ts b/tests/generated/v2.0/query-path-param.ts index c90add11..10b5a9dc 100644 --- a/tests/generated/v2.0/query-path-param.ts +++ b/tests/generated/v2.0/query-path-param.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v2.0/uber.ts b/tests/generated/v2.0/uber.ts index 97ef8720..b15c5839 100644 --- a/tests/generated/v2.0/uber.ts +++ b/tests/generated/v2.0/uber.ts @@ -132,7 +132,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -153,7 +153,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/additional-properties.ts b/tests/generated/v3.0/additional-properties.ts index 6dab8d21..9792c373 100644 --- a/tests/generated/v3.0/additional-properties.ts +++ b/tests/generated/v3.0/additional-properties.ts @@ -44,7 +44,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -65,7 +65,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/additional-properties2.ts b/tests/generated/v3.0/additional-properties2.ts index 35b11561..f82d0a6b 100644 --- a/tests/generated/v3.0/additional-properties2.ts +++ b/tests/generated/v3.0/additional-properties2.ts @@ -41,7 +41,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -62,7 +62,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/allof-example.ts b/tests/generated/v3.0/allof-example.ts index 806224bb..e5fb76be 100644 --- a/tests/generated/v3.0/allof-example.ts +++ b/tests/generated/v3.0/allof-example.ts @@ -45,7 +45,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -66,7 +66,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/anyof-example.ts b/tests/generated/v3.0/anyof-example.ts index b28443fb..6c6400d1 100644 --- a/tests/generated/v3.0/anyof-example.ts +++ b/tests/generated/v3.0/anyof-example.ts @@ -47,7 +47,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -68,7 +68,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/api-with-examples.ts b/tests/generated/v3.0/api-with-examples.ts index 803cecff..c5b6c779 100644 --- a/tests/generated/v3.0/api-with-examples.ts +++ b/tests/generated/v3.0/api-with-examples.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/callback-example.ts b/tests/generated/v3.0/callback-example.ts index 0b2dbc46..d46d28fd 100644 --- a/tests/generated/v3.0/callback-example.ts +++ b/tests/generated/v3.0/callback-example.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/components-responses.ts b/tests/generated/v3.0/components-responses.ts index 19cb9986..e59635a5 100644 --- a/tests/generated/v3.0/components-responses.ts +++ b/tests/generated/v3.0/components-responses.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/explode-param-3.0.1.ts b/tests/generated/v3.0/explode-param-3.0.1.ts index 468ae1a0..407ed178 100644 --- a/tests/generated/v3.0/explode-param-3.0.1.ts +++ b/tests/generated/v3.0/explode-param-3.0.1.ts @@ -57,7 +57,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -78,7 +78,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/full-swagger-scheme.ts b/tests/generated/v3.0/full-swagger-scheme.ts index bc16b2f2..3235cd80 100644 --- a/tests/generated/v3.0/full-swagger-scheme.ts +++ b/tests/generated/v3.0/full-swagger-scheme.ts @@ -8981,7 +8981,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -9002,7 +9002,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/link-example.ts b/tests/generated/v3.0/link-example.ts index 0010ac2a..75386ce3 100644 --- a/tests/generated/v3.0/link-example.ts +++ b/tests/generated/v3.0/link-example.ts @@ -54,7 +54,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -75,7 +75,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/no-definitions-schema.ts b/tests/generated/v3.0/no-definitions-schema.ts index 5bfef145..e807b4e9 100644 --- a/tests/generated/v3.0/no-definitions-schema.ts +++ b/tests/generated/v3.0/no-definitions-schema.ts @@ -50,7 +50,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -71,7 +71,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/nullable-refs.ts b/tests/generated/v3.0/nullable-refs.ts index af503cd9..93bad182 100644 --- a/tests/generated/v3.0/nullable-refs.ts +++ b/tests/generated/v3.0/nullable-refs.ts @@ -51,7 +51,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -72,7 +72,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/oneof-example.ts b/tests/generated/v3.0/oneof-example.ts index 404c3251..3289f9df 100644 --- a/tests/generated/v3.0/oneof-example.ts +++ b/tests/generated/v3.0/oneof-example.ts @@ -47,7 +47,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -68,7 +68,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/personal-api-example.ts b/tests/generated/v3.0/personal-api-example.ts index 395d7f0c..ad4abbf9 100644 --- a/tests/generated/v3.0/personal-api-example.ts +++ b/tests/generated/v3.0/personal-api-example.ts @@ -238,7 +238,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -259,7 +259,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/petstore-expanded.ts b/tests/generated/v3.0/petstore-expanded.ts index ba61ee3b..0a13266f 100644 --- a/tests/generated/v3.0/petstore-expanded.ts +++ b/tests/generated/v3.0/petstore-expanded.ts @@ -50,7 +50,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -71,7 +71,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/petstore.ts b/tests/generated/v3.0/petstore.ts index b7ef4ddb..b525eb93 100644 --- a/tests/generated/v3.0/petstore.ts +++ b/tests/generated/v3.0/petstore.ts @@ -54,7 +54,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -75,7 +75,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/recursive-schema.ts b/tests/generated/v3.0/recursive-schema.ts index 9d5a6cf5..75e11849 100644 --- a/tests/generated/v3.0/recursive-schema.ts +++ b/tests/generated/v3.0/recursive-schema.ts @@ -51,7 +51,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -72,7 +72,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/responses.ts b/tests/generated/v3.0/responses.ts index 97611894..31153a5a 100644 --- a/tests/generated/v3.0/responses.ts +++ b/tests/generated/v3.0/responses.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/swaggerhub-template.ts b/tests/generated/v3.0/swaggerhub-template.ts index 033a48a0..fa09f432 100644 --- a/tests/generated/v3.0/swaggerhub-template.ts +++ b/tests/generated/v3.0/swaggerhub-template.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/tsoa-odd-types-3.0.2.ts b/tests/generated/v3.0/tsoa-odd-types-3.0.2.ts index b0268624..14a473ba 100644 --- a/tests/generated/v3.0/tsoa-odd-types-3.0.2.ts +++ b/tests/generated/v3.0/tsoa-odd-types-3.0.2.ts @@ -158,7 +158,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -179,7 +179,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/up-banking.ts b/tests/generated/v3.0/up-banking.ts index b6e8417d..05977526 100644 --- a/tests/generated/v3.0/up-banking.ts +++ b/tests/generated/v3.0/up-banking.ts @@ -575,7 +575,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -596,7 +596,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/uspto.ts b/tests/generated/v3.0/uspto.ts index 243072f7..2827cbd0 100644 --- a/tests/generated/v3.0/uspto.ts +++ b/tests/generated/v3.0/uspto.ts @@ -54,7 +54,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -75,7 +75,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/wrong-enum-subtypes.ts b/tests/generated/v3.0/wrong-enum-subtypes.ts index f1a55537..24aa52fe 100644 --- a/tests/generated/v3.0/wrong-enum-subtypes.ts +++ b/tests/generated/v3.0/wrong-enum-subtypes.ts @@ -39,7 +39,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -60,7 +60,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/generated/v3.0/wrong-schema-names.ts b/tests/generated/v3.0/wrong-schema-names.ts index 30f58c9f..1e23f51c 100644 --- a/tests/generated/v3.0/wrong-schema-names.ts +++ b/tests/generated/v3.0/wrong-schema-names.ts @@ -61,7 +61,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -82,7 +82,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/defaultAsSuccess/schema.ts b/tests/spec/defaultAsSuccess/schema.ts index 49f3737b..0b6cef76 100644 --- a/tests/spec/defaultAsSuccess/schema.ts +++ b/tests/spec/defaultAsSuccess/schema.ts @@ -89,7 +89,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -110,7 +110,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/defaultResponse/schema.ts b/tests/spec/defaultResponse/schema.ts index 64463587..cb24e38f 100644 --- a/tests/spec/defaultResponse/schema.ts +++ b/tests/spec/defaultResponse/schema.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/enumNamesAsValues/schema.ts b/tests/spec/enumNamesAsValues/schema.ts index 06f53e2d..be7bbf2c 100644 --- a/tests/spec/enumNamesAsValues/schema.ts +++ b/tests/spec/enumNamesAsValues/schema.ts @@ -235,7 +235,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -256,7 +256,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/extractRequestParams/schema.ts b/tests/spec/extractRequestParams/schema.ts index d3de6026..ef7b6715 100644 --- a/tests/spec/extractRequestParams/schema.ts +++ b/tests/spec/extractRequestParams/schema.ts @@ -129,7 +129,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -150,7 +150,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/js/schema.d.ts b/tests/spec/js/schema.d.ts index c4030348..33783a24 100644 --- a/tests/spec/js/schema.d.ts +++ b/tests/spec/js/schema.d.ts @@ -1727,7 +1727,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { data: D; diff --git a/tests/spec/js/schema.js b/tests/spec/js/schema.js index 156726b9..ff508f2e 100644 --- a/tests/spec/js/schema.js +++ b/tests/spec/js/schema.js @@ -20,7 +20,7 @@ export class HttpClient { this.baseUrl = "https://api.github.com"; this.securityData = null; this.abortControllers = new Map(); - this.customFetch = fetch; + this.customFetch = (...fetchParams) => fetch(...fetchParams); this.baseApiParams = { credentials: "same-origin", headers: {}, diff --git a/tests/spec/modular/http-client.ts b/tests/spec/modular/http-client.ts index 985d4401..7d6bf15d 100644 --- a/tests/spec/modular/http-client.ts +++ b/tests/spec/modular/http-client.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/moduleNameFirstTag/schema.ts b/tests/spec/moduleNameFirstTag/schema.ts index ef250ad5..4a2a8d28 100644 --- a/tests/spec/moduleNameFirstTag/schema.ts +++ b/tests/spec/moduleNameFirstTag/schema.ts @@ -165,7 +165,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -186,7 +186,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/moduleNameIndex/schema.ts b/tests/spec/moduleNameIndex/schema.ts index 3f4ec33b..6e9d6f94 100644 --- a/tests/spec/moduleNameIndex/schema.ts +++ b/tests/spec/moduleNameIndex/schema.ts @@ -165,7 +165,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -186,7 +186,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/partialBaseTemplate/schema.ts b/tests/spec/partialBaseTemplate/schema.ts index 381b89ae..9ed59710 100644 --- a/tests/spec/partialBaseTemplate/schema.ts +++ b/tests/spec/partialBaseTemplate/schema.ts @@ -49,7 +49,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -70,7 +70,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/partialDefaultTemplate/schema.ts b/tests/spec/partialDefaultTemplate/schema.ts index a78115ce..0500edc3 100644 --- a/tests/spec/partialDefaultTemplate/schema.ts +++ b/tests/spec/partialDefaultTemplate/schema.ts @@ -45,7 +45,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -66,7 +66,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/responses/schema.ts b/tests/spec/responses/schema.ts index d2d30a1c..d19646ba 100644 --- a/tests/spec/responses/schema.ts +++ b/tests/spec/responses/schema.ts @@ -89,7 +89,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -110,7 +110,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/singleHttpClient/schema.ts b/tests/spec/singleHttpClient/schema.ts index 033b0640..93cc8cfc 100644 --- a/tests/spec/singleHttpClient/schema.ts +++ b/tests/spec/singleHttpClient/schema.ts @@ -37,7 +37,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -58,7 +58,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/typeSuffixPrefix/schema.ts b/tests/spec/typeSuffixPrefix/schema.ts index 4a957753..3fbe8991 100644 --- a/tests/spec/typeSuffixPrefix/schema.ts +++ b/tests/spec/typeSuffixPrefix/schema.ts @@ -1482,7 +1482,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -1503,7 +1503,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin", diff --git a/tests/spec/unionEnums/schema.ts b/tests/spec/unionEnums/schema.ts index 84a58df1..ff4461e8 100644 --- a/tests/spec/unionEnums/schema.ts +++ b/tests/spec/unionEnums/schema.ts @@ -49,7 +49,7 @@ export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; - customFetch?: (input: RequestInfo, init?: RequestInit) => Promise; + customFetch?: typeof fetch; } export interface HttpResponse extends Response { @@ -70,7 +70,7 @@ export class HttpClient { private securityData: SecurityDataType | null = null; private securityWorker?: ApiConfig["securityWorker"]; private abortControllers = new Map(); - private customFetch = fetch; + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); private baseApiParams: RequestParams = { credentials: "same-origin",