Skip to content

Commit 36ac807

Browse files
Merge pull request #918 from devtron-labs/fix/proxy-host
fix: update version to 1.20.5-pre-6 and add isProxyHost option to API interfaces
2 parents 946131c + 36f57be commit 36ac807

5 files changed

Lines changed: 13 additions & 9 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.20.5-pre-5",
3+
"version": "1.20.5-pre-6",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/API/CoreAPI.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ class CoreAPI {
240240
preventLicenseRedirect: options?.preventLicenseRedirect || false,
241241
shouldParseServerErrorForUnauthorizedUser: options?.shouldParseServerErrorForUnauthorizedUser,
242242
isMultipartRequest,
243+
isProxyHost: options?.isProxyHost || false,
243244
}),
244245
timeoutPromise,
245246
]).catch((err) => {

src/Common/API/types.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ export interface FetchInTimeParamsType<Data = object> {
3939

4040
export interface FetchAPIParamsType<Data = object>
4141
extends Omit<FetchInTimeParamsType<Data>, 'options'>,
42-
Pick<APIOptions, 'preventAutoLogout' | 'preventLicenseRedirect' | 'shouldParseServerErrorForUnauthorizedUser'> {
43-
/**
44-
* @default false
45-
* @description - If true, will override the default host (orchestrator or whatever defined initially in CoreAPI constructor) with the `proxy` host
46-
*/
47-
isProxyHost?: boolean
42+
Pick<
43+
APIOptions,
44+
'preventAutoLogout' | 'preventLicenseRedirect' | 'shouldParseServerErrorForUnauthorizedUser' | 'isProxyHost'
45+
> {
4846
signal: AbortSignal
4947
}

src/Common/Types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export interface APIOptions {
7979
* @default false
8080
*/
8181
shouldParseServerErrorForUnauthorizedUser?: boolean
82+
/**
83+
* @default false
84+
* @description - If true, will override the default host (orchestrator or whatever defined initially in CoreAPI constructor) with the `proxy` host
85+
*/
86+
isProxyHost?: boolean
8287
}
8388

8489
export interface OptionType<T = string, K = string> {

0 commit comments

Comments
 (0)