Class: JinFrame<TPASS, TFAIL>
Definition HTTP Request
Type parameters
Name | Type | Description |
---|---|---|
TPASS | unknown | AxiosResponse type argument case of valid status. eg. AxiosResponse<TPASS> |
TFAIL | TPASS | AxiosResponse type argument case of invalid status. eg. AxiosResponse<TFAIL> |
Hierarchy
↳
JinFrame
Implements
IJinFrameFunction
<TPASS
,TFAIL
>
Constructors
constructor
• new JinFrame<TPASS
, TFAIL
>(args
)
Type parameters
Name | Type |
---|---|
TPASS | unknown |
TFAIL | TPASS |
Parameters
Name | Type |
---|---|
args | Object |
args.contentType? | string |
args.customBody? | Object |
args.host? | string |
args.method | Method |
args.path? | string |
Overrides
Defined in
jin-frame/src/frames/JinFrame.ts:39
Properties
contentType
• Readonly
contentType: string
content-type of API Request endpoint
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:87
customBody
• Optional
Readonly
customBody: Object
custom object of POST Request body data
Index signature
▪ [key: string
]: any
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:90
host
• Optional
Readonly
host: string
host of API Request endpoint
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:78
method
• Readonly
method: Method
method of API Request endpoint
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:84
path
• Optional
Readonly
path: string
pathname of API Request endpoint
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:81
startAt
• Protected
startAt: Date
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:95
transformRequest
• Optional
Readonly
transformRequest: AxiosRequestTransformer
| AxiosRequestTransformer
[]
transformRequest function of POST Request
Inherited from
AbstractJinFrame.transformRequest
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:93
BodySymbolBox
▪ Static
BodySymbolBox: symbol
Inherited from
AbstractJinFrame.BodySymbolBox
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:36
HeaderSymbolBox
▪ Static
HeaderSymbolBox: symbol
Inherited from
AbstractJinFrame.HeaderSymbolBox
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:40
ObjectBodySymbolBox
▪ Static
ObjectBodySymbolBox: symbol
Inherited from
AbstractJinFrame.ObjectBodySymbolBox
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:38
ParamSymbolBox
▪ Static
ParamSymbolBox: symbol
Inherited from
AbstractJinFrame.ParamSymbolBox
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:32
QuerySymbolBox
▪ Static
QuerySymbolBox: symbol
Inherited from
AbstractJinFrame.QuerySymbolBox
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:34
Methods
create
▸ create(option?
): () => Promise
<AxiosResponse
<TPASS
, any
>>
Generate an AxiosRequestConfig value and use it to return a functions that invoke HTTP APIs
Parameters
Name | Type | Description |
---|---|---|
option? | IJinFrameRequestConfig & IJinFrameCreateConfig | same with AxiosRequestConfig, bug exclude some filed ignored |
Returns
fn
Functions that invoke HTTP APIs
▸ (): Promise
<AxiosResponse
<TPASS
, any
>>
Generate an AxiosRequestConfig value and use it to return a functions that invoke HTTP APIs
Returns
Promise
<AxiosResponse
<TPASS
, any
>>
Functions that invoke HTTP APIs
Implementation of
Defined in
jin-frame/src/frames/JinFrame.ts:77
execute
▸ execute(option?
): Promise
<AxiosResponse
<TPASS
, any
>>
Generate an AxiosRequestConfig value and invoke HTTP APIs
Parameters
Name | Type | Description |
---|---|---|
option? | IJinFrameRequestConfig & IJinFrameCreateConfig | same with AxiosRequestConfig, bug exclude some filed ignored |
Returns
Promise
<AxiosResponse
<TPASS
, any
>>
AxiosResponse With PassFailEither
Implementation of
Defined in
jin-frame/src/frames/JinFrame.ts:162
getFormData
▸ getFormData(bodies
): Record
<string
, any
> | FormData
Parameters
Name | Type |
---|---|
bodies | Record <string , any > |
Returns
Record
<string
, any
> | FormData
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:143
getTransformRequest
▸ getTransformRequest(): undefined
| AxiosRequestTransformer
| AxiosRequestTransformer
[]
Returns
undefined
| AxiosRequestTransformer
| AxiosRequestTransformer
[]
Inherited from
AbstractJinFrame.getTransformRequest
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:125
request
▸ request(option?
): AxiosRequestConfig
<any
>
AxiosRequestConfig create using by class member variable.
Parameters
Name | Type | Description |
---|---|---|
option? | IJinFrameRequestConfig & IJinFrameCreateConfig | same with AxiosRequestConfig, bug exclude some filed ignored |
Returns
AxiosRequestConfig
<any
>
created AxiosRequestConfig
Overrides
Defined in
jin-frame/src/frames/JinFrame.ts:49
body
▸ Static
body(option?
): (target
: Function
) => void
(target
: Object
, propertyKey
: string
| symbol
) => void
decorator to set class variable to HTTP API body parameter
Parameters
Name | Type | Description |
---|---|---|
option? | Partial <Except <IBodyFieldOption , "type" >> | body parameter option |
Returns
fn
▸ (target
): void
Parameters
Name | Type |
---|---|
target | Function |
Returns
void
▸ (target
, propertyKey
): void
Parameters
Name | Type |
---|---|
target | Object |
propertyKey | string | symbol |
Returns
void
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:60
header
▸ Static
header(option?
): (target
: Function
) => void
(target
: Object
, propertyKey
: string
| symbol
) => void
decorator to set class variable to HTTP API header parameter
Parameters
Name | Type | Description |
---|---|---|
option? | Partial <Except <IHeaderFieldOption , "type" >> | header parameter option |
Returns
fn
▸ (target
): void
Parameters
Name | Type |
---|---|
target | Function |
Returns
void
▸ (target
, propertyKey
): void
Parameters
Name | Type |
---|---|
target | Object |
propertyKey | string | symbol |
Returns
void
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:74
objectBody
▸ Static
objectBody(option?
): (target
: Function
) => void
(target
: Object
, propertyKey
: string
| symbol
) => void
decorator to set class variable to HTTP API body parameter
Parameters
Name | Type | Description |
---|---|---|
option? | Partial <Except <IObjectBodyFieldOption , "type" >> | body parameter option |
Returns
fn
▸ (target
): void
Parameters
Name | Type |
---|---|
target | Function |
Returns
void
▸ (target
, propertyKey
): void
Parameters
Name | Type |
---|---|
target | Object |
propertyKey | string | symbol |
Returns
void
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:67
param
▸ Static
param(option?
): (target
: Function
) => void
(target
: Object
, propertyKey
: string
| symbol
) => void
decorator to set class variable to HTTP API path parameter
Parameters
Name | Type | Description |
---|---|---|
option? | Partial <Omit <IParamFieldOption , "type" >> | path parameter option |
Returns
fn
▸ (target
): void
Parameters
Name | Type |
---|---|
target | Function |
Returns
void
▸ (target
, propertyKey
): void
Parameters
Name | Type |
---|---|
target | Object |
propertyKey | string | symbol |
Returns
void
Inherited from
Defined in
jin-frame/src/frames/AbstractJinFrame.ts:46
query
▸ Static
query(option?
): (target
: Function
) => void
(target
: Object
, propertyKey
: string
| symbol
) => void
decorator to set class variable to HTTP API query parameter
Parameters
Name | Type | Description |
---|---|---|
option? | Partial <Omit <IQueryFieldOption , "type" >> | query parameter option |
Returns
fn
▸ (target
): void
Parameters
Name | Type |
---|---|
target | Function |
Returns
void
▸ (target
, propertyKey
): void
Parameters
Name | Type |
---|---|
target | Object |
propertyKey | string | symbol |
Returns
void