ngx-http-resilience
Advanced tools
Comparing version 0.2.5 to 0.3.2
@@ -20,3 +20,3 @@ import { HttpStatusCode } from '@angular/common/http'; | ||
*/ | ||
export declare const STANDARD_RETRYABLE_STATUS_CODES: HttpStatusCode[]; | ||
export declare const STANDARD_RETRYABLE_STATUS_CODES: readonly [HttpStatusCode.RequestTimeout, HttpStatusCode.BadGateway, HttpStatusCode.ServiceUnavailable, HttpStatusCode.GatewayTimeout]; | ||
/** | ||
@@ -23,0 +23,0 @@ * Match any error with a status code matching the given options. |
import { HttpInterceptorFn } from '@angular/common/http'; | ||
import { RetryPolicy } from './types'; | ||
import { RetryInterceptorOptions, RetryPolicy } from './types'; | ||
/** | ||
@@ -15,3 +15,3 @@ * Creates an HttpInterceptorFn that will retry requests based on the provided | ||
*/ | ||
export declare function createHttpRetryInterceptorFn(policy: RetryPolicy): HttpInterceptorFn; | ||
export declare function createHttpRetryInterceptorFn(policy: RetryPolicy, options?: RetryInterceptorOptions): HttpInterceptorFn; | ||
export declare function validateRetryStrategy(strategy: RetryPolicy): void; |
import { HttpEvent, HttpHandlerFn, HttpRequest } from '@angular/common/http'; | ||
import { Observable } from 'rxjs'; | ||
import { RetryPolicy } from '../types'; | ||
export declare function retryRequestWithStrategy(req: HttpRequest<unknown>, next: HttpHandlerFn, strategy: RetryPolicy): Observable<HttpEvent<unknown>>; | ||
import { Observable, Subject } from 'rxjs'; | ||
import { RetryInterceptorEvent, RetryPolicy } from '../types'; | ||
export declare function retryRequestWithStrategy(req: HttpRequest<unknown>, next: HttpHandlerFn, strategy: RetryPolicy, events$: Subject<RetryInterceptorEvent>): Observable<HttpEvent<unknown>>; |
import { HttpRequest } from '@angular/common/http'; | ||
import { Subject } from 'rxjs'; | ||
import { RetryState } from './internal'; | ||
@@ -19,2 +20,29 @@ export type Predicate<T> = (input: T) => boolean; | ||
} | ||
export type RetryInterceptorRequestType = 'Ignored' | 'Failed' | 'Succeeded'; | ||
export declare const RetryInterceptorRequestTypes: { | ||
readonly Ignored: "Ignored"; | ||
readonly Failed: "Failed"; | ||
readonly Succeeded: "Succeeded"; | ||
}; | ||
interface BaseRetryInterceptorRequest { | ||
req: HttpRequest<unknown>; | ||
type: RetryInterceptorRequestType; | ||
} | ||
export interface RetryInterceptorRequestIgnoredEvent extends BaseRetryInterceptorRequest { | ||
type: 'Ignored'; | ||
} | ||
export interface RetryInterceptorRequestFailedEvent extends BaseRetryInterceptorRequest { | ||
type: 'Failed'; | ||
error: unknown; | ||
attempt: number; | ||
} | ||
export interface RetryInterceptorRequestSucceededEvent extends BaseRetryInterceptorRequest { | ||
type: 'Succeeded'; | ||
res: unknown; | ||
attempt: number; | ||
} | ||
export type RetryInterceptorEvent = RetryInterceptorRequestIgnoredEvent | RetryInterceptorRequestFailedEvent | RetryInterceptorRequestSucceededEvent; | ||
export interface RetryInterceptorOptions { | ||
events$?: Subject<RetryInterceptorEvent>; | ||
} | ||
export interface PredicateBuilder<T> { | ||
@@ -24,1 +52,2 @@ build: () => Predicate<T>; | ||
} | ||
export {}; |
{ | ||
"name": "ngx-http-resilience", | ||
"version": "0.2.5", | ||
"version": "0.3.2", | ||
"description": "Angular HttpInterceptors that provide resiliency capabilities ", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153897
1445