Skip to content

jin-frame / interfaces/options/IFrameOption / IFrameOption

Interface: IFrameOption

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:8

Properties

authorization?

optional authorization: AuthorizationData

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:77

Authorization data that will be passed to security providers This data can be used by providers to generate authentication information


authoriztion?

optional authoriztion: string | AxiosBasicCredentials

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:84

Deprecated

Use security and authorization instead. This field will be removed in v5.0.0 Legacy authorization field for backward compatibility eg. Bearer i-am-authorization-key


contentType

contentType: string

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:47

content-type of API Request endpoint


customBody?

optional customBody: unknown

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:53

custom object of POST Request body data


dedupe?

optional dedupe: boolean

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:94

이 값을 활성화 하는 경우 동일 요청이 반복되는 경우 dedupe 처리를 합니다


host?

optional host: string

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:17

host and path of API Request endpoint

원한다면 protocol://host/path 전체를 host에 전달해도 정상 동작한다. 그럼에도 불구하고 굳이 host와 path를 분리한 이유는 Parent Class에 host를 설정하고 그것을 계속 상속을 받아서 사용하는 방식으로 확장하는 경우, Child Class에서는 path만 설정할 수 있어야 하기 때문에 둘을 분리해서 처리할 수도 있어야 한다.


method

method: TMethod

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:44

method of API Request endpoint


path?

optional path: string

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:41

path of API Request endpoint


pathPrefix?

optional pathPrefix: string

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:38

Path prefix of API Request endpoint

For example, you can set the relative path defined in the OpenAPI Spec's servers field to pathPrefix. When set, this path will be prepended to the pathname when generating the Request URL.

Example

typescript
// OpenAPI servers configuration:
// servers: [{ "url": "/api/v3" }]
pathPrefix: '/api/v3'
path: '/users/{id}'
// Final URL: https://example.com/api/v3/users/123

// Multiple path prefixes for different services
pathPrefix: '/user-service/v1'  // User API
pathPrefix: '/order-service/v2' // Order API

retry?

optional retry: IFrameRetry

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:59

retry configuration


security?

optional security: ISecurityProvider | ISecurityProvider[]

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:71

Security providers for authentication Can be a single provider or array of providers for multiple authentication schemes


timeout?

optional timeout: number

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:65

timeout of the request


transformRequest?

optional transformRequest: AxiosRequestTransformer | AxiosRequestTransformer[]

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:56

transformRequest function of POST Request


useInstance

useInstance: boolean

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:62

if set true the field, create axios instance


userAgent?

optional userAgent: string

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:50

user agent of API Request endpoint


validator?

optional validator: BaseValidator<unknown, unknown, unknown>

Defined in: packages/jin-frame/src/interfaces/options/IFrameOption.ts:89

validation configuration