diff --git a/CHANGELOG.md b/CHANGELOG.md index 059e7eae0..31144a03d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added +- Allow passing request config to VBase's getJSON method + ## [6.46.0] - 2023-10-25 ### Added - Add disk cache steps and retry count to tracing diff --git a/src/clients/infra/VBase.ts b/src/clients/infra/VBase.ts index 291ab918e..e9a833e96 100644 --- a/src/clients/infra/VBase.ts +++ b/src/clients/infra/VBase.ts @@ -11,6 +11,7 @@ import { inflightUrlWithQuery, InstanceOptions, IOResponse, + RequestConfig, RequestTracingConfig, } from '../../HttpClient' import { @@ -83,8 +84,15 @@ export class VBase extends InfraClient { }}) } - public getJSON = (bucket: string, path: string, nullIfNotFound?: boolean, conflictsResolver?: ConflictsResolver, tracingConfig?: RequestTracingConfig) => { - return this.getRawJSON(bucket, path, nullIfNotFound, conflictsResolver, tracingConfig) + public getJSON = ( + bucket: string, + path: string, + nullIfNotFound?: boolean, + conflictsResolver?: ConflictsResolver, + tracingConfig?: RequestTracingConfig, + requestConfig?: RequestConfig + ) => { + return this.getRawJSON(bucket, path, nullIfNotFound, conflictsResolver, tracingConfig, requestConfig) .then(response => response.data) } @@ -93,7 +101,8 @@ export class VBase extends InfraClient { path: string, nullIfNotFound?: boolean, conflictsResolver?: ConflictsResolver, - tracingConfig?: RequestTracingConfig + tracingConfig?: RequestTracingConfig, + requestConfig?: RequestConfig ) => { const headers = conflictsResolver ? { 'X-Vtex-Detect-Conflicts': true } : {} const inflightKey = inflightURL @@ -108,6 +117,7 @@ export class VBase extends InfraClient { requestSpanNameSuffix: metric, ...tracingConfig?.tracing, }, + ...requestConfig, } as IgnoreNotFoundRequestConfig) .catch(async (error: AxiosError) => { const { response } = error