@contentstack/cli-utilities 1.14.3 → 1.14.4

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.
@@ -50,12 +50,6 @@ class AuthenticationHandler {
50
50
  }
51
51
  async refreshAccessToken(error, maxRetryCount = 1) {
52
52
  var _a, _b;
53
- // Add configurable delay only for CI/CD pipelines
54
- const delayMs = process.env.DELAY_MS;
55
- if (delayMs) {
56
- const delay = parseInt(delayMs, 10);
57
- await new Promise((resolve) => setTimeout(resolve, delay));
58
- }
59
53
  if (error.response && error.response.status) {
60
54
  switch (error.response.status) {
61
55
  case 401:
@@ -19,6 +19,7 @@ class ManagementSDKInitiator {
19
19
  maxRequests: 10,
20
20
  retryLimit: 3,
21
21
  timeout: 60000,
22
+ delayMs: config.delayMs,
22
23
  httpsAgent: new node_https_1.Agent({
23
24
  maxSockets: 100,
24
25
  maxFreeSockets: 10,
@@ -36,6 +37,7 @@ class ManagementSDKInitiator {
36
37
  case 401:
37
38
  case 429:
38
39
  case 408:
40
+ case 422:
39
41
  return true;
40
42
  default:
41
43
  return false;
@@ -225,6 +225,13 @@ export declare class HttpClient implements IHttpClient {
225
225
  * @returns {Request}
226
226
  */
227
227
  createAndSendRequest(method: HttpMethod, url: string): Promise<AxiosResponse>;
228
+ /**
229
+ * Get the axios instance for interceptor access
230
+ */
231
+ get interceptors(): {
232
+ request: import("axios").AxiosInterceptorManager<import("axios").InternalAxiosRequestConfig<any>>;
233
+ response: import("axios").AxiosInterceptorManager<AxiosResponse<any, any, {}>>;
234
+ };
228
235
  /**
229
236
  * Returns the request payload depending on the selected request payload format.
230
237
  */
@@ -334,6 +334,12 @@ class HttpClient {
334
334
  return await this.axiosInstance(Object.assign(Object.assign({ url,
335
335
  method, withCredentials: true }, this.request), { data: this.prepareRequestPayload() }));
336
336
  }
337
+ /**
338
+ * Get the axios instance for interceptor access
339
+ */
340
+ get interceptors() {
341
+ return this.axiosInstance.interceptors;
342
+ }
337
343
  /**
338
344
  * Returns the request payload depending on the selected request payload format.
339
345
  */
@@ -37,9 +37,9 @@ class Logger {
37
37
  get loggerOptions() {
38
38
  return {
39
39
  filename: '',
40
- maxFiles: 20,
40
+ maxFiles: 50,
41
41
  tailable: true,
42
- maxsize: 1000000,
42
+ maxsize: 5000000, // 5MB
43
43
  };
44
44
  }
45
45
  createLogger(level, filePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/cli-utilities",
3
- "version": "1.14.3",
3
+ "version": "1.14.4",
4
4
  "description": "Utilities for contentstack projects",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -32,8 +32,8 @@
32
32
  "author": "contentstack",
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@contentstack/management": "~1.22.0",
36
- "@contentstack/marketplace-sdk": "^1.2.8",
35
+ "@contentstack/management": "~1.25.1",
36
+ "@contentstack/marketplace-sdk": "^1.4.0",
37
37
  "@oclif/core": "^4.3.0",
38
38
  "axios": "^1.9.0",
39
39
  "chalk": "^4.1.2",