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.

fix(client-axios): stabilize beforeRequest typing across strictFunctionTypes

+48 -36
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 39 + options: RequestOptions<TData, boolean, Url>, 40 + ) => { 39 41 const opts = { 40 42 ..._config, 41 43 ...options, ··· 58 60 opts.body = opts.bodySerializer(opts.body); 59 61 } 60 62 61 - const url = buildUrl(opts); 63 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 62 64 63 65 return { opts, url }; 64 66 }; 65 67 66 68 // @ts-expect-error 67 69 const request: Client['request'] = async (options) => { 68 - // @ts-expect-error 69 70 const { opts, url } = await beforeRequest(options); 70 71 try { 71 72 // assign Axios here for consistency with fetch
+4 -3
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 <TData = unknown, Url extends string = string>( 37 + options: RequestOptions<TData, boolean, Url>, 38 + ) => { 37 39 const opts = { 38 40 ..._config, 39 41 ...options, ··· 56 58 opts.body = opts.bodySerializer(opts.body); 57 59 } 58 60 59 - const url = buildUrl(opts); 61 + const url = buildUrl(opts as RequestOptions<unknown, boolean, string>); 60 62 61 63 return { opts, url }; 62 64 }; 63 65 64 66 // @ts-expect-error 65 67 const request: Client['request'] = async (options) => { 66 - // @ts-expect-error 67 68 const { opts, url } = await beforeRequest(options); 68 69 try { 69 70 // assign Axios here for consistency with fetch