Skip to content

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 ​

Constructors ​

Constructor ​

new JinFrame<Response>(): JinFrame<Response>

Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:167

Returns ​

JinFrame<Response>

Inherited from ​

AbstractJinFrame.constructor

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 ​

AbstractJinFrame._eachStartAt


_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 ​

AbstractJinFrame._endAt


_option ​

Get Signature ​

get protected _option(): FrameOption

Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:163

Returns ​

FrameOption

Inherited from ​

AbstractJinFrame._option


_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 ​

AbstractJinFrame._startAt

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 ​

JinFrameFunction._create

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 ​

JinFrameFunction._execute

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 ​

AbstractJinFrame._getBodyInit


_getCacheKey() ​

_getCacheKey(): string | undefined

Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:260

Returns ​

string | undefined

Inherited from ​

AbstractJinFrame._getCacheKey


_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 ​

AbstractJinFrame._getData


_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 ​

AbstractJinFrame._getOption


_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 ​

JinRequestConfig

The outgoing request configuration.

_reply ​

JinResp<Response>

The complete status-discriminated response and validation result.

_debugInfo ​

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 ​

JinRequestConfig

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 ​

JinRequestConfig

created JinRequestConfig

Inherited from ​

AbstractJinFrame._request


_requestWrap() ​

_requestWrap(option?): JinRequestConfig

Defined in: packages/jin-frame/src/frames/JinFrame.ts:48

Parameters ​

option? ​

JinFrameRequestConfig & JinFrameCreateConfig

Returns ​

JinRequestConfig


_retry() ​

_retry(req, isValidateStatus, startAt): Promise<DedupeResult>

Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:454

Parameters ​

req ​

JinRequestConfig

isValidateStatus ​

(ok, status) => boolean

startAt ​

Date = ...

Returns ​

Promise<DedupeResult>

Inherited from ​

AbstractJinFrame._retry


_retryException() ​

protected _retryException(_req, _err): void | Promise<void>

Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:128

Parameters ​

_req ​

JinRequestConfig

_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 ​

JinRequestConfig

_res ​

Response

Returns ​

void | Promise<void>

Inherited from ​

AbstractJinFrame._retryFail


_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 ​

FrameInternal[K]

Returns ​

void

Inherited from ​

AbstractJinFrame._setData


_setFields() ​

_setFields(args): void

Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:188

Parameters ​

args ​

JinFrame<Response>

Returns ​

void

Inherited from ​

AbstractJinFrame._setFields


builder() ​

static builder<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 ​

AbstractJinFrame.builder


getDefaultValues() ​

protected static getDefaultValues(): 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() ​

static getEndpoint(): URL

Defined in: packages/jin-frame/src/frames/AbstractJinFrame.ts:43

Returns ​

URL

Inherited from ​

AbstractJinFrame.getEndpoint


of() ​

Call Signature ​

static of<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 ​

AbstractJinFrame.of

Call Signature ​

static of<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>

Inherited from ​

AbstractJinFrame.of