fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #3660 from showhereco/tomvdv/fix-client-axios-ts2578

authored by

Lubos and committed by
GitHub
edd0702c d7e660e6

+2957 -972
+5
.changeset/fix-client-axios-ts2578.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + **plugin(@hey-api/client-axios)**: fix: improve `beforeRequest` typing
+5
.changeset/khaki-kiwis-travel-2.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + **plugin(@hey-api/client-ky)**: fix: improve `beforeRequest` typing
+5
.changeset/khaki-kiwis-travel.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + **plugin(@hey-api/client-next)**: fix: improve `beforeRequest` typing
+5
.changeset/nine-kiwis-call-3.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + **plugin(@hey-api/client-angular)**: fix: improve `beforeRequest` typing
+5
.changeset/sour-numbers-divide.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + **plugin(@hey-api/client-fetch)**: fix: improve `beforeRequest` typing
+8 -2
examples/openapi-ts-angular-common/src/client/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
examples/openapi-ts-angular/src/client/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+7 -2
examples/openapi-ts-axios/src/client/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
examples/openapi-ts-axios/src/client/client/types.gen.ts
··· 115 115 116 116 type BuildUrlFn = < 117 117 TData extends { 118 - body?: unknown; 119 118 path?: Record<string, unknown>; 120 119 query?: Record<string, unknown>; 121 120 url: string; 122 121 }, 123 122 >( 124 - options: TData & Options<TData>, 123 + options: TData & 124 + Pick< 125 + RequestOptions<unknown, boolean>, 126 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 127 + >, 125 128 ) => string; 126 129 127 130 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
examples/openapi-ts-fastify/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
examples/openapi-ts-fetch/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
examples/openapi-ts-ky/src/client/client/client.gen.ts
··· 36 36 37 37 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 38 38 39 - const beforeRequest = async (options: RequestOptions) => { 39 + const beforeRequest = async < 40 + TData = unknown, 41 + TResponseStyle extends 'data' | 'fields' = 'fields', 42 + ThrowOnError extends boolean = boolean, 43 + Url extends string = string, 44 + >( 45 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 46 + ) => { 40 47 const opts = { 41 48 ..._config, 42 49 ...options, ··· 64 71 opts.headers.delete('Content-Type'); 65 72 } 66 73 67 - const url = buildUrl(opts); 74 + const resolvedOpts = opts as typeof opts & 75 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 76 + const url = buildUrl(resolvedOpts); 68 77 69 - return { opts, url }; 78 + return { opts: resolvedOpts, url }; 70 79 }; 71 80 72 81 const parseErrorResponse = async ( ··· 113 122 }; 114 123 115 124 const request: Client['request'] = async (options) => { 116 - // @ts-expect-error 117 125 const { opts, url } = await beforeRequest(options); 118 126 119 127 const kyInstance = opts.ky!;
+12 -4
examples/openapi-ts-nestjs/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+10 -4
examples/openapi-ts-next/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+12 -4
examples/openapi-ts-openai/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
examples/openapi-ts-pinia-colada/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+8 -2
examples/openapi-ts-tanstack-angular-query-experimental/src/client/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+12 -4
examples/openapi-ts-tanstack-react-query/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
examples/openapi-ts-tanstack-svelte-query/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
examples/openapi-ts-tanstack-vue-query/src/client/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/__snapshots__/plugins/@tanstack/meta/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/preact-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/preact-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/preact-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/preact-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/preact-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/useMutation/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-binary-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/preact-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/preact-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/preact-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/preact-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/preact-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/useMutation/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-api-key/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-http-bearer/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-oauth2/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-open-id-connect/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-allof-response-wrapper/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-array/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transforms-read-write/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/body-response-text-plain/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-false/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-node16-sdk/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-false/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-false/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-node16-sdk/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-node16-sdk/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-node16-sdk/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-false/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-node16-sdk/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/client/client.gen.ts
··· 30 30 31 31 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 32 32 33 - const beforeRequest = async (options: RequestOptions) => { 33 + const beforeRequest = async < 34 + TData = unknown, 35 + TResponseStyle extends 'data' | 'fields' = 'fields', 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 40 + ) => { 34 41 const opts = { 35 42 ..._config, 36 43 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const parseErrorResponse = async ( ··· 107 116 }; 108 117 109 118 const request: Client['request'] = async (options) => { 110 - // @ts-expect-error 111 119 const { opts, url } = await beforeRequest(options); 112 120 113 121 const kyInstance = opts.ky!;
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-node16-sdk/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/content-types/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/content-types/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/headers/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/internal-name-conflict/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/pagination-ref/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false-axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false-axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-ignore/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/preact-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/preact-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/preact-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/preact-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/preact-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/useMutation/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/name-builder/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-api-key/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-false/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-http-bearer/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-oauth2/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-open-id-connect/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+8 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-angular/client/client.gen.ts
··· 97 97 return { opts, req, url }; 98 98 }; 99 99 100 - const beforeRequest = async (options: RequestOptions) => { 100 + const beforeRequest = async < 101 + TData = unknown, 102 + TResponseStyle extends ResponseStyle = 'fields', 103 + ThrowOnError extends boolean = boolean, 104 + Url extends string = string, 105 + >( 106 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 107 + ) => { 101 108 const { opts, req, url } = requestOptions(options); 102 109 103 110 if (opts.security) { ··· 115 122 }; 116 123 117 124 const request: Client['request'] = async (options) => { 118 - // @ts-expect-error 119 125 const { opts, req: initialReq } = await beforeRequest(options); 120 126 121 127 let req = initialReq;
+7 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-axios/client/client.gen.ts
··· 35 35 return getConfig(); 36 36 }; 37 37 38 - const beforeRequest = async (options: RequestOptions) => { 38 + const beforeRequest = async < 39 + TData = unknown, 40 + ThrowOnError extends boolean = boolean, 41 + Url extends string = string, 42 + >( 43 + options: RequestOptions<TData, ThrowOnError, Url>, 44 + ) => { 39 45 const opts = { 40 46 ..._config, 41 47 ...options, ··· 65 71 66 72 // @ts-expect-error 67 73 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 74 const { opts, url } = await beforeRequest(options); 70 75 try { 71 76 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-axios/client/types.gen.ts
··· 118 118 119 119 type BuildUrlFn = < 120 120 TData extends { 121 - body?: unknown; 122 121 path?: Record<string, unknown>; 123 122 query?: Record<string, unknown>; 124 123 url: string; 125 124 }, 126 125 >( 127 - options: TData & Options<TData>, 126 + options: TData & 127 + Pick< 128 + RequestOptions<unknown, boolean>, 129 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 130 + >, 128 131 ) => string; 129 132 130 133 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-fetch/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+10 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-next/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + ThrowOnError extends boolean = boolean, 37 + Url extends string = string, 38 + >( 39 + options: RequestOptions<TData, ThrowOnError, Url>, 40 + ) => { 35 41 const opts = { 36 42 ..._config, 37 43 ...options, ··· 60 66 opts.headers.delete('Content-Type'); 61 67 } 62 68 63 - const url = buildUrl(opts); 69 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 64 71 65 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 66 73 }; 67 74 68 75 // @ts-expect-error 69 76 const request: Client['request'] = async (options) => { 70 - // @ts-expect-error 71 77 const { opts, url } = await beforeRequest(options); 72 78 73 79 for (const fn of interceptors.request.fns) {
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-tanstack-react-query/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-additional-properties/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-allof-response-wrapper/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-array/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-one-of-discriminated/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transforms-read-write/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/class/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/flat/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/instance/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/sdks/__snapshots__/opencode/export-all/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/sdks/__snapshots__/opencode/flat/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/sdks/__snapshots__/opencode/grouped/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/valibot/v1/__snapshots__/3.1.x/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/2.0.x/mini/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/2.0.x/v3/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/2.0.x/v4/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/3.0.x/mini/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/3.0.x/v3/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/3.0.x/v4/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/3.1.x/mini/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/3.1.x/v3/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+12 -4
packages/openapi-ts-tests/zod/v4/__snapshots__/3.1.x/v4/type-format/client/client.gen.ts
··· 31 31 32 32 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 33 33 34 - const beforeRequest = async (options: RequestOptions) => { 34 + const beforeRequest = async < 35 + TData = unknown, 36 + TResponseStyle extends 'data' | 'fields' = 'fields', 37 + ThrowOnError extends boolean = boolean, 38 + Url extends string = string, 39 + >( 40 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 41 + ) => { 35 42 const opts = { 36 43 ..._config, 37 44 ...options, ··· 60 67 opts.headers.delete('Content-Type'); 61 68 } 62 69 63 - const url = buildUrl(opts); 70 + const resolvedOpts = opts as typeof opts & 71 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 72 + const url = buildUrl(resolvedOpts); 64 73 65 - return { opts, url }; 74 + return { opts: resolvedOpts, url }; 66 75 }; 67 76 68 77 const request: Client['request'] = async (options) => { 69 - // @ts-expect-error 70 78 const { opts, url } = await beforeRequest(options); 71 79 const requestInit: ReqInit = { 72 80 redirect: 'follow',
+8 -2
packages/openapi-ts/src/plugins/@hey-api/client-angular/bundle/client.ts
··· 95 95 return { opts, req, url }; 96 96 }; 97 97 98 - const beforeRequest = async (options: RequestOptions) => { 98 + const beforeRequest = async < 99 + TData = unknown, 100 + TResponseStyle extends ResponseStyle = 'fields', 101 + ThrowOnError extends boolean = boolean, 102 + Url extends string = string, 103 + >( 104 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 105 + ) => { 99 106 const { opts, req, url } = requestOptions(options); 100 107 101 108 if (opts.security) { ··· 113 120 }; 114 121 115 122 const request: Client['request'] = async (options) => { 116 - // @ts-expect-error 117 123 const { opts, req: initialReq } = await beforeRequest(options); 118 124 119 125 let req = initialReq;
+7 -2
packages/openapi-ts/src/plugins/@hey-api/client-axios/bundle/client.ts
··· 33 33 return getConfig(); 34 34 }; 35 35 36 - const beforeRequest = async (options: RequestOptions) => { 36 + const beforeRequest = async < 37 + TData = unknown, 38 + ThrowOnError extends boolean = boolean, 39 + Url extends string = string, 40 + >( 41 + options: RequestOptions<TData, ThrowOnError, Url>, 42 + ) => { 37 43 const opts = { 38 44 ..._config, 39 45 ...options, ··· 63 69 64 70 // @ts-expect-error 65 71 const request: Client['request'] = async (options) => { 66 - // @ts-expect-error 67 72 const { opts, url } = await beforeRequest(options); 68 73 try { 69 74 // assign Axios here for consistency with fetch
+5 -2
packages/openapi-ts/src/plugins/@hey-api/client-axios/bundle/types.ts
··· 116 116 117 117 type BuildUrlFn = < 118 118 TData extends { 119 - body?: unknown; 120 119 path?: Record<string, unknown>; 121 120 query?: Record<string, unknown>; 122 121 url: string; 123 122 }, 124 123 >( 125 - options: TData & Options<TData>, 124 + options: TData & 125 + Pick< 126 + RequestOptions<unknown, boolean>, 127 + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' 128 + >, 126 129 ) => string; 127 130 128 131 export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+12 -4
packages/openapi-ts/src/plugins/@hey-api/client-fetch/bundle/client.ts
··· 29 29 30 30 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 31 31 32 - const beforeRequest = async (options: RequestOptions) => { 32 + const beforeRequest = async < 33 + TData = unknown, 34 + TResponseStyle extends 'data' | 'fields' = 'fields', 35 + ThrowOnError extends boolean = boolean, 36 + Url extends string = string, 37 + >( 38 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 39 + ) => { 33 40 const opts = { 34 41 ..._config, 35 42 ...options, ··· 58 65 opts.headers.delete('Content-Type'); 59 66 } 60 67 61 - const url = buildUrl(opts); 68 + const resolvedOpts = opts as typeof opts & 69 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 70 + const url = buildUrl(resolvedOpts); 62 71 63 - return { opts, url }; 72 + return { opts: resolvedOpts, url }; 64 73 }; 65 74 66 75 const request: Client['request'] = async (options) => { 67 - // @ts-expect-error 68 76 const { opts, url } = await beforeRequest(options); 69 77 const requestInit: ReqInit = { 70 78 redirect: 'follow',
+12 -4
packages/openapi-ts/src/plugins/@hey-api/client-ky/bundle/client.ts
··· 28 28 29 29 const interceptors = createInterceptors<Request, Response, unknown, ResolvedRequestOptions>(); 30 30 31 - const beforeRequest = async (options: RequestOptions) => { 31 + const beforeRequest = async < 32 + TData = unknown, 33 + TResponseStyle extends 'data' | 'fields' = 'fields', 34 + ThrowOnError extends boolean = boolean, 35 + Url extends string = string, 36 + >( 37 + options: RequestOptions<TData, TResponseStyle, ThrowOnError, Url>, 38 + ) => { 32 39 const opts = { 33 40 ..._config, 34 41 ...options, ··· 56 63 opts.headers.delete('Content-Type'); 57 64 } 58 65 59 - const url = buildUrl(opts); 66 + const resolvedOpts = opts as typeof opts & 67 + ResolvedRequestOptions<TResponseStyle, ThrowOnError, Url>; 68 + const url = buildUrl(resolvedOpts); 60 69 61 - return { opts, url }; 70 + return { opts: resolvedOpts, url }; 62 71 }; 63 72 64 73 const parseErrorResponse = async ( ··· 105 114 }; 106 115 107 116 const request: Client['request'] = async (options) => { 108 - // @ts-expect-error 109 117 const { opts, url } = await beforeRequest(options); 110 118 111 119 const kyInstance = opts.ky!;
+10 -4
packages/openapi-ts/src/plugins/@hey-api/client-next/bundle/client.ts
··· 29 29 30 30 const interceptors = createInterceptors<Response, unknown, ResolvedRequestOptions>(); 31 31 32 - const beforeRequest = async (options: RequestOptions) => { 32 + const beforeRequest = async < 33 + TData = unknown, 34 + ThrowOnError extends boolean = boolean, 35 + Url extends string = string, 36 + >( 37 + options: RequestOptions<TData, ThrowOnError, Url>, 38 + ) => { 33 39 const opts = { 34 40 ..._config, 35 41 ...options, ··· 58 64 opts.headers.delete('Content-Type'); 59 65 } 60 66 61 - const url = buildUrl(opts); 67 + const resolvedOpts = opts as typeof opts & ResolvedRequestOptions<ThrowOnError, Url>; 68 + const url = buildUrl(resolvedOpts); 62 69 63 - return { opts, url }; 70 + return { opts: resolvedOpts, url }; 64 71 }; 65 72 66 73 // @ts-expect-error 67 74 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 75 const { opts, url } = await beforeRequest(options); 70 76 71 77 for (const fn of interceptors.request.fns) {