jin-frame / frames/JinFrame / JinFrame
Class: JinFrame<Response>
Defined in: packages/jin-frame/src/frames/JinFrame.ts:30
Definition HTTP Request
Extends
Type Parameters
Response
Response extends JinResponse = JinResponse
Status/data union covering all documented HTTP responses
Implements
JinFrameFunction<Response>
Constructors
Constructor
new JinFrame<
Response>():JinFrame<Response>
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:167
Returns
JinFrame<Response>
Inherited from
Properties
_validateStatus
readonly_validateStatus:StatusValidator=isValidateStatusDefault
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:124
Runtime default policy. Overrides do not change inferred response types.
Inherited from
AbstractJinFrame._validateStatus
Accessors
_eachStartAt
Get Signature
get _eachStartAt():
Date
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:139
Returns
Date
Inherited from
_endAt
Get Signature
get _endAt():
Date|undefined
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:144
Undefined while the most recently started execution is in progress.
Returns
Date | undefined
Inherited from
_option
Get Signature
get
protected_option():FrameOption
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:163
Returns
Inherited from
_startAt
Get Signature
get _startAt():
Date
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:135
Start of the most recently started execution, or construction time before execution.
Returns
Date
Inherited from
Methods
_beginExecution()
protected_beginExecution():Date
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:148
Returns
Date
Inherited from
AbstractJinFrame._beginExecution
_create()
Call Signature
_create<
TSelf>(option?): () =>Promise<JinRespBase&object&SuccessResponse<Response> &object>
Defined in: packages/jin-frame/src/frames/JinFrame.ts:80
Generate a request config and return a function that invokes HTTP APIs
Type Parameters
TSelf
TSelf extends JinFrame<Response> = JinFrame<Response>
Parameters
option?
JinFrameRequestConfig & Omit<JinFrameCreateConfig, "validateStatus"> & object
request configuration options
Returns
Function that invokes HTTP APIs
():
Promise<JinRespBase&object&SuccessResponse<Response> &object>
Returns
Promise<JinRespBase & object & SuccessResponse<Response> & object>
Implementation of
Call Signature
_create<
Validator,TSelf>(option?): () =>Promise<JinRespBase&object&ValidatedResponse<Response,Validator> &object>
Defined in: packages/jin-frame/src/frames/JinFrame.ts:87
Generate a request config and return a function that invokes HTTP APIs
Type Parameters
Validator
Validator extends StatusValidator | undefined
TSelf
TSelf extends JinFrame<Response> = JinFrame<Response>
Parameters
option?
JinFrameRequestConfig & Omit<JinFrameCreateConfig, "validateStatus"> & object
request configuration options
Returns
Function that invokes HTTP APIs
():
Promise<JinRespBase&object&ValidatedResponse<Response,Validator> &object>
Returns
Promise<JinRespBase & object & ValidatedResponse<Response, Validator> & object>
Implementation of
JinFrameFunction._create
_execute()
Call Signature
_execute<
TSelf>(option?):Promise<JinResp<SuccessResponse<Response>>>
Defined in: packages/jin-frame/src/frames/JinFrame.ts:260
Generate a request config and invoke HTTP APIs.
Function-based authorization values are awaited before building the request. Provider constructor suppliers remain synchronous and are evaluated during request assembly.
Type Parameters
TSelf
TSelf extends JinFrame<Response> = JinFrame<Response>
Parameters
option?
JinFrameRequestConfig & Omit<JinFrameCreateConfig, "validateStatus"> & object
request configuration options
Returns
Promise<JinResp<SuccessResponse<Response>>>
The status-discriminated response accepted by the call-level status policy.
Implementation of
Call Signature
_execute<
Validator,TSelf>(option?):Promise<JinResp<ValidatedResponse<Response,Validator>>>
Defined in: packages/jin-frame/src/frames/JinFrame.ts:267
Generate a request config and invoke HTTP APIs.
Function-based authorization values are awaited before building the request. Provider constructor suppliers remain synchronous and are evaluated during request assembly.
Type Parameters
Validator
Validator extends StatusValidator | undefined
TSelf
TSelf extends JinFrame<Response> = JinFrame<Response>
Parameters
option?
JinFrameRequestConfig & Omit<JinFrameCreateConfig, "validateStatus"> & object
request configuration options
Returns
Promise<JinResp<ValidatedResponse<Response, Validator>>>
The status-discriminated response accepted by the call-level status policy.
Implementation of
JinFrameFunction._execute
_finishExecution()
protected_finishExecution(startAt):void
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:156
Parameters
startAt
Date
Returns
void
Inherited from
AbstractJinFrame._finishExecution
_getBaseUrlString()
_getBaseUrlString(
paths,override?):string
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:300
Parameters
paths
Record<string, string>
override?
host?
string
path?
string
pathPrefix?
string
Returns
string
Inherited from
AbstractJinFrame._getBaseUrlString
_getBodyInit()
_getBodyInit(
bodies):BodyInit|undefined
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:194
Parameters
bodies
unknown
Returns
BodyInit | undefined
Inherited from
_getCacheKey()
_getCacheKey():
string|undefined
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:260
Returns
string | undefined
Inherited from
_getData()
_getData<
K>(kind):Pick<FrameInternal,"retry"|"body"|"header"|"param"|"query">[K]
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:174
Type Parameters
K
K extends "retry" | "body" | "header" | "param" | "query"
Parameters
kind
K
Returns
Pick<FrameInternal, "retry" | "body" | "header" | "param" | "query">[K]
Inherited from
_getOption()
_getOption<
K>(kind):FrameOption[K]
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:184
Type Parameters
K
K extends keyof FrameOption
Parameters
kind
K
Returns
FrameOption[K]
Inherited from
_postHook()
protected_postHook(_req,_reply,_debugInfo):void|Promise<void>
Defined in: packages/jin-frame/src/frames/JinFrame.ts:46
Observes a processed HTTP response, including rejected statuses.
Parameters
_req
The outgoing request configuration.
_reply
JinResp<Response>
The complete status-discriminated response and validation result.
_debugInfo
Execution timing and deduplication metadata.
Returns
void | Promise<void>
_preHook()
protected_preHook(_req):void|Promise<void>
Defined in: packages/jin-frame/src/frames/JinFrame.ts:38
Runs once before transport attempts; mutations affect the outgoing request.
Parameters
_req
The assembled request configuration.
Returns
void | Promise<void>
_request()
_request(
option?):JinRequestConfig
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:323
JinRequestConfig create using by class member variable.
Parameters
option?
JinFrameRequestConfig & JinFrameCreateConfig
same with JinRequestConfig, bug exclude some filed ignored
Returns
created JinRequestConfig
Inherited from
_requestWrap()
_requestWrap(
option?):JinRequestConfig
Defined in: packages/jin-frame/src/frames/JinFrame.ts:48
Parameters
option?
JinFrameRequestConfig & JinFrameCreateConfig
Returns
_retry()
_retry(
req,isValidateStatus,startAt):Promise<DedupeResult>
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:454
Parameters
req
isValidateStatus
(ok, status) => boolean
startAt
Date = ...
Returns
Promise<DedupeResult>
Inherited from
_retryException()
protected_retryException(_req,_err):void|Promise<void>
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:128
Parameters
_req
_err
Error
Returns
void | Promise<void>
Inherited from
AbstractJinFrame._retryException
_retryFail()
protected_retryFail(_req,_res):void|Promise<void>
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:126
Parameters
_req
_res
Response
Returns
void | Promise<void>
Inherited from
_setData()
protected_setData<K>(kind,value):void
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:180
Type Parameters
K
K extends "retry"
Parameters
kind
K
value
Returns
void
Inherited from
_setFields()
_setFields(
args):void
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:188
Parameters
args
JinFrame<Response>
Returns
void
Inherited from
builder()
staticbuilder<C>(this, ...ctorArgs):BuilderFor<C>
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:54
Type Parameters
C
C extends ConstructorFunction<unknown>
Parameters
this
C
ctorArgs
...ConstructorParameters<C>
Returns
BuilderFor<C>
Inherited from
getDefaultValues()
protectedstaticgetDefaultValues():object
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:50
Subclasses should declare Partial<PublicFieldsOf<ChildFrame>> to validate default fields.
Returns
object
Inherited from
AbstractJinFrame.getDefaultValues
getEndpoint()
staticgetEndpoint():URL
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:43
Returns
URL
Inherited from
of()
Call Signature
staticof<C>(this,args?, ...ctorArgs?):InstanceType<C>
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:92
Type Parameters
C
C extends ConstructorFunction<unknown>
Parameters
this
C & Partial<PublicFieldsOf<InstanceType<C>>> extends PublicFieldsOf<InstanceType<C>> ? unknown : never
args?
undefined
ctorArgs?
...ConstructorParameters<C>
Returns
InstanceType<C>
Inherited from
Call Signature
staticof<C>(this,args, ...ctorArgs):InstanceType<C>
Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:97
Type Parameters
C
C extends ConstructorFunction<unknown>
Parameters
this
C
args
PublicFieldsOf<InstanceType<C>> | (b) => unknown
ctorArgs
...ConstructorParameters<C>
Returns
InstanceType<C>