@vtex/api 6.45.16 → 6.45.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ declare type ClientOptions = IOContext & Partial<InstanceOptions>;
7
7
  export declare class HttpClient {
8
8
  name: string;
9
9
  private logger;
10
+ private cacheableType;
10
11
  private runMiddlewares;
11
12
  constructor(opts: ClientOptions);
12
13
  get: <T = any>(url: string, config?: RequestConfig) => Promise<T>;
@@ -96,14 +96,15 @@ class HttpClient {
96
96
  return context.response;
97
97
  };
98
98
  this.getConfig = (url, config = {}) => ({
99
- cacheable: cache_1.CacheType.Memory,
99
+ cacheable: this.cacheableType,
100
100
  memoizable: true,
101
101
  ...config,
102
102
  url,
103
103
  });
104
- const { baseURL, authToken, authType, memoryCache, diskCache, locale, name, metrics, product, serverTiming, recorder, userAgent, timeout = DEFAULT_TIMEOUT_MS, segmentToken, sessionToken, retries, concurrency, headers: defaultHeaders, host, params, operationId, tenant, binding, verbose, cancellation, exponentialTimeoutCoefficient, initialBackoffDelay, exponentialBackoffCoefficient, httpsAgent, tracer, logger, } = opts;
104
+ const { baseURL, authToken, authType, memoryCache, diskCache, locale, name, metrics, product, serverTiming, recorder, userAgent, timeout = DEFAULT_TIMEOUT_MS, segmentToken, sessionToken, retries, concurrency, headers: defaultHeaders, host, params, operationId, tenant, binding, verbose, cancellation, exponentialTimeoutCoefficient, initialBackoffDelay, exponentialBackoffCoefficient, httpsAgent, tracer, logger, cacheableType = cache_1.CacheType.Memory, } = opts;
105
105
  this.name = name || baseURL || 'unknown';
106
106
  this.logger = logger;
107
+ this.cacheableType = cacheableType;
107
108
  const limit = concurrency && concurrency > 0 && p_limit_1.default(concurrency) || undefined;
108
109
  const headers = {
109
110
  ...defaultHeaders,
@@ -106,6 +106,7 @@ export interface InstanceOptions {
106
106
  name?: string;
107
107
  serverTimings?: Record<string, string>;
108
108
  httpsAgent?: AxiosRequestConfig['httpsAgent'];
109
+ cacheableType?: CacheType;
109
110
  }
110
111
  export interface IOResponse<T> {
111
112
  data: T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/api",
3
- "version": "6.45.16",
3
+ "version": "6.45.17",
4
4
  "description": "VTEX I/O API client",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",