File tree Expand file tree Collapse file tree
openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios
import-file-extension-ts/client
sdk-client-optional/client
sdk-client-required/client
tsconfig-node16-sdk/client
tsconfig-nodenext-sdk/client
openapi-ts/src/plugins/@hey-api/client-axios/bundle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535 return getConfig ( ) ;
3636 } ;
3737
38- const beforeRequest = async ( options : RequestOptions ) => {
38+ const beforeRequest = async < TData = unknown , Url extends string = string > (
39+ options : RequestOptions < TData , boolean , Url > ,
40+ ) => {
3941 const opts = {
4042 ..._config ,
4143 ...options ,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860 opts . body = opts . bodySerializer ( opts . body ) ;
5961 }
6062
61- const url = buildUrl ( opts ) ;
63+ const url = buildUrl ( opts as RequestOptions < unknown , boolean , string > ) ;
6264
6365 return { opts, url } ;
6466 } ;
6567
6668 // @ts -expect-error
6769 const request : Client [ 'request' ] = async ( options ) => {
68- // @ts -expect-error
6970 const { opts, url } = await beforeRequest ( options ) ;
7071 try {
7172 // assign Axios here for consistency with fetch
You can’t perform that action at this time.
0 commit comments