This is the base class for all generated API classes.
+ new BaseAPI(configuration
: Configuration‹›): BaseAPI
Parameters:
Name | Type | Default |
---|---|---|
configuration |
Configuration‹› | new Configuration() |
Returns: BaseAPI
• configuration: Configuration‹›
• middleware: Middleware[]
▸ clone‹T›(this
: T): T
Create a shallow clone of this
by constructing a new instance
and then shallow cloning data members.
Type parameters:
▪ T: BaseAPI
Parameters:
Name | Type |
---|---|
this |
T |
Returns: T
▸ createFetchParams(context
: RequestOpts): object
Parameters:
Name | Type |
---|---|
context |
RequestOpts |
Returns: object
-
init(): object
-
body: any
-
credentials: RequestCredentials = this.configuration.credentials
-
headers: HTTPHeaders = headers
-
method: HTTPMethod = context.method
-
-
url: string
▸ fetchApi(url
: string, init
: RequestInit): Promise‹Response›
Parameters:
Name | Type |
---|---|
url |
string |
init |
RequestInit |
Returns: Promise‹Response›
▸ request(context
: RequestOpts): Promise‹Response›
Parameters:
Name | Type |
---|---|
context |
RequestOpts |
Returns: Promise‹Response›
▸ withMiddleware‹T›(this
: T, ...middlewares
: Middleware[]): T
Type parameters:
▪ T: BaseAPI
Parameters:
Name | Type |
---|---|
this |
T |
...middlewares |
Middleware[] |
Returns: T
▸ withPostMiddleware‹T›(this
: T, ...postMiddlewares
: Array‹Middleware["post"]›): T
Type parameters:
▪ T: BaseAPI
Parameters:
Name | Type |
---|---|
this |
T |
...postMiddlewares |
Array‹Middleware["post"]› |
Returns: T
▸ withPreMiddleware‹T›(this
: T, ...preMiddlewares
: Array‹Middleware["pre"]›): T
Type parameters:
▪ T: BaseAPI
Parameters:
Name | Type |
---|---|
this |
T |
...preMiddlewares |
Array‹Middleware["pre"]› |
Returns: T