@gradientedge/commercetools-utils 4.15.0 → 4.16.0

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.
@@ -432,7 +432,6 @@ export declare class CommercetoolsApi {
432
432
  request<T = any, R = any>(options: FetchOptions<T>): Promise<R>;
433
433
  getRetryConfig(methodRetryConfig?: CommercetoolsRetryConfig): CommercetoolsRetryConfig;
434
434
  getRequestOptions(options: FetchOptions): Promise<any>;
435
- calculateDelay(retryCount: number, retryConfig?: CommercetoolsRetryConfig): number;
436
435
  isRetryableError(error: any): boolean;
437
436
  extractCommonRequestOptions(options?: CommonRequestOptions): CommonRequestOptions;
438
437
  applyStore(path: string, storeKey: string | undefined | null): string;
@@ -0,0 +1,2 @@
1
+ import { CommercetoolsRetryConfig } from '../api';
2
+ export declare function calculateDelay(retryCount: number, retryConfig?: CommercetoolsRetryConfig): number;
@@ -1,3 +1,5 @@
1
+ export * from './calculate-delay';
1
2
  export * from './format';
2
- export * from './useragent';
3
3
  export * from './mask';
4
+ export * from './retry-on-conflict';
5
+ export * from './useragent';
@@ -0,0 +1,7 @@
1
+ export interface RetryOnConflictParams<T = any> {
2
+ executeFn: (...args: any) => Promise<T>;
3
+ delayMs?: number;
4
+ maxRetries?: number;
5
+ jitter?: boolean;
6
+ }
7
+ export declare function retryOnConflict<T = any>(options: RetryOnConflictParams): Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/commercetools-utils",
3
- "version": "4.15.0",
3
+ "version": "4.16.0",
4
4
  "description": "Provide utility classes and functions for interacting with the commercetools API",
5
5
  "main": "./dist/ge-commercetools-utils-node.cjs.js",
6
6
  "module": "./dist/ge-commercetools-utils-node.esm.js",
@@ -87,6 +87,7 @@
87
87
  "webpack-cli": "4.9.2"
88
88
  },
89
89
  "dependencies": {
90
+ "@tshttp/status": "^2.0.0",
90
91
  "axios": "0.26.1",
91
92
  "json-stringify-safe": "5.0.1",
92
93
  "lodash.clonedeep": "4.5.0",