@pristine-ts/http 0.0.167 → 0.0.171

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.
Files changed (36) hide show
  1. package/dist/lib/cjs/clients/http.client.js +22 -15
  2. package/dist/lib/cjs/clients/http.client.js.map +1 -1
  3. package/dist/lib/cjs/interceptors/http-error-response-logging.interceptor.js +58 -0
  4. package/dist/lib/cjs/interceptors/http-error-response-logging.interceptor.js.map +1 -0
  5. package/dist/lib/cjs/interceptors/http-request-logging.interceptor.js +2 -0
  6. package/dist/lib/cjs/interceptors/http-request-logging.interceptor.js.map +1 -1
  7. package/dist/lib/cjs/interceptors/http-response-logging.interceptor.js +2 -0
  8. package/dist/lib/cjs/interceptors/http-response-logging.interceptor.js.map +1 -1
  9. package/dist/lib/cjs/interceptors/interceptors.js +1 -0
  10. package/dist/lib/cjs/interceptors/interceptors.js.map +1 -1
  11. package/dist/lib/cjs/interfaces/http-error-response-interceptor.interface.js +3 -0
  12. package/dist/lib/cjs/interfaces/http-error-response-interceptor.interface.js.map +1 -0
  13. package/dist/lib/cjs/interfaces/interfaces.js +1 -0
  14. package/dist/lib/cjs/interfaces/interfaces.js.map +1 -1
  15. package/dist/lib/esm/clients/http.client.js +22 -15
  16. package/dist/lib/esm/clients/http.client.js.map +1 -1
  17. package/dist/lib/esm/interceptors/http-error-response-logging.interceptor.js +55 -0
  18. package/dist/lib/esm/interceptors/http-error-response-logging.interceptor.js.map +1 -0
  19. package/dist/lib/esm/interceptors/http-request-logging.interceptor.js +3 -1
  20. package/dist/lib/esm/interceptors/http-request-logging.interceptor.js.map +1 -1
  21. package/dist/lib/esm/interceptors/http-response-logging.interceptor.js +3 -1
  22. package/dist/lib/esm/interceptors/http-response-logging.interceptor.js.map +1 -1
  23. package/dist/lib/esm/interceptors/interceptors.js +1 -0
  24. package/dist/lib/esm/interceptors/interceptors.js.map +1 -1
  25. package/dist/lib/esm/interfaces/http-error-response-interceptor.interface.js +2 -0
  26. package/dist/lib/esm/interfaces/http-error-response-interceptor.interface.js.map +1 -0
  27. package/dist/lib/esm/interfaces/interfaces.js +1 -0
  28. package/dist/lib/esm/interfaces/interfaces.js.map +1 -1
  29. package/dist/types/clients/http.client.d.ts +5 -2
  30. package/dist/types/interceptors/http-error-response-logging.interceptor.d.ts +21 -0
  31. package/dist/types/interceptors/http-request-logging.interceptor.d.ts +1 -0
  32. package/dist/types/interceptors/http-response-logging.interceptor.d.ts +1 -0
  33. package/dist/types/interceptors/interceptors.d.ts +1 -0
  34. package/dist/types/interfaces/http-error-response-interceptor.interface.d.ts +21 -0
  35. package/dist/types/interfaces/interfaces.d.ts +1 -0
  36. package/package.json +4 -4
@@ -40,12 +40,14 @@ let HttpClient = class HttpClient {
40
40
  * This service is an http client for any http request you need to make outside of Pristine.
41
41
  * @param httpWrapper The wrapper around NodeJS http.
42
42
  * @param httpRequestInterceptors The interceptors to run before sending the request. All services with the tag ServiceDefinitionTagEnum.HttpRequestInterceptor will be automatically injected here.
43
- * @param httpResponseInterceptors The interceptors to run when receiving the reponse. All services with the tag ServiceDefinitionTagEnum.HttpResponseInterceptor will be automatically injected here.
43
+ * @param httpResponseInterceptors The interceptors to run when receiving the response. All services with the tag ServiceDefinitionTagEnum.HttpResponseInterceptor will be automatically injected here.
44
+ * @param httpErrorResponseInterceptors The interceptors to run when receiving a response that contains an error. All services with the tag ServiceDefinitionTagEnum.HttpErrorResponseInterceptor will be automatically injected here.
44
45
  */
45
- constructor(httpWrapper, httpRequestInterceptors = [], httpResponseInterceptors = []) {
46
+ constructor(httpWrapper, httpRequestInterceptors = [], httpResponseInterceptors = [], httpErrorResponseInterceptors = []) {
46
47
  this.httpWrapper = httpWrapper;
47
48
  this.httpRequestInterceptors = httpRequestInterceptors;
48
49
  this.httpResponseInterceptors = httpResponseInterceptors;
50
+ this.httpErrorResponseInterceptors = httpErrorResponseInterceptors;
49
51
  this.defaultOptions = {
50
52
  followRedirects: true,
51
53
  maximumNumberOfRedirects: 5,
@@ -139,19 +141,23 @@ let HttpClient = class HttpClient {
139
141
  handleResponseError(request, requestOptions, response, currentRetryCount = 0) {
140
142
  return __awaiter(this, void 0, void 0, function* () {
141
143
  let updatedResponse = response;
142
- // First check to determine if this request should be retried or not, only if the response is an error code
143
- if (this.isResponseError(updatedResponse) &&
144
- requestOptions.isRetryable && requestOptions.isRetryable(request, updatedResponse)) {
145
- if (requestOptions.maximumNumberOfRetries && requestOptions.maximumNumberOfRetries <= currentRetryCount) {
146
- // Simply return the errored out response.
147
- return updatedResponse;
144
+ if (this.isResponseError(updatedResponse)) {
145
+ for (const httpErrorResponseInterceptor of this.httpErrorResponseInterceptors) {
146
+ updatedResponse = yield httpErrorResponseInterceptor.interceptErrorResponse(request, requestOptions, updatedResponse);
147
+ }
148
+ // First check to determine if this request should be retried or not, only if the response is an error code
149
+ if (requestOptions.isRetryable && requestOptions.isRetryable(request, updatedResponse)) {
150
+ if (requestOptions.maximumNumberOfRetries && requestOptions.maximumNumberOfRetries <= currentRetryCount) {
151
+ // Simply return the errored out response.
152
+ return updatedResponse;
153
+ }
154
+ const updatedRetryCount = ++currentRetryCount;
155
+ // Retry the request using an exponential backoff with jitter.
156
+ updatedResponse = yield new Promise(resolve => setTimeout(() => __awaiter(this, void 0, void 0, function* () {
157
+ return resolve(yield this.httpWrapper.executeRequest(request));
158
+ }), math_utils_1.MathUtils.exponentialBackoffWithJitter(updatedRetryCount)));
159
+ return this.handleResponseError(request, requestOptions, updatedResponse, updatedRetryCount);
148
160
  }
149
- const updatedRetryCount = ++currentRetryCount;
150
- // Retry the request using an exponential backoff with jitter.
151
- updatedResponse = yield new Promise(resolve => setTimeout(() => __awaiter(this, void 0, void 0, function* () {
152
- return resolve(yield this.httpWrapper.executeRequest(request));
153
- }), math_utils_1.MathUtils.exponentialBackoffWithJitter(updatedRetryCount)));
154
- return this.handleResponseError(request, requestOptions, updatedResponse, updatedRetryCount);
155
161
  }
156
162
  return updatedResponse;
157
163
  });
@@ -206,7 +212,8 @@ HttpClient = __decorate([
206
212
  __param(0, tsyringe_1.inject('HttpWrapperInterface')),
207
213
  __param(1, tsyringe_1.injectAll(common_1.ServiceDefinitionTagEnum.HttpRequestInterceptor)),
208
214
  __param(2, tsyringe_1.injectAll(common_1.ServiceDefinitionTagEnum.HttpResponseInterceptor)),
209
- __metadata("design:paramtypes", [Object, Array, Array])
215
+ __param(3, tsyringe_1.injectAll(common_1.ServiceDefinitionTagEnum.HttpErrorResponseInterceptor)),
216
+ __metadata("design:paramtypes", [Object, Array, Array, Array])
210
217
  ], HttpClient);
211
218
  exports.HttpClient = HttpClient;
212
219
  //# sourceMappingURL=http.client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.client.js","sourceRoot":"","sources":["../../../../src/clients/http.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuD;AAIvD,0DAA4B;AAC5B,oEAA6D;AAE7D,mCAA8B;AAC9B,gDAAkE;AAGlE,oDAA8C;AAC9C,uGAA8F;AAG9F;;GAEG;AAGH,IAAa,UAAU,GAAvB,MAAa,UAAU;IAWnB;;;;;OAKG;IACH,YAA6D,WAAiC,EACL,0BAA6D,EAAE,EAC9D,2BAA+D,EAAE;QAF9F,gBAAW,GAAX,WAAW,CAAsB;QACL,4BAAuB,GAAvB,uBAAuB,CAAwC;QAC9D,6BAAwB,GAAxB,wBAAwB,CAAyC;QAlBpJ,mBAAc,GAAuB;YACxC,eAAe,EAAE,IAAI;YACrB,wBAAwB,EAAE,CAAC;YAC3B,WAAW,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,EAAE;gBACzD,OAAO,qBAAqB,CAAC,MAAM,IAAI,GAAG,IAAI,qBAAqB,CAAC,MAAM,GAAG,GAAG,CAAC;YACrF,CAAC;YACD,sBAAsB,EAAE,CAAC;YACzB,YAAY,EAAE,qCAAgB,CAAC,GAAG;SACrC,CAAC;IAYF,CAAC;IAED;;;;;OAKG;IACG,OAAO,CAAC,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AC9B,WAAA,oBAAS,CAAC,iCAAwB,CAAC,sBAAsB,CAAC,CAAA;IAC1D,WAAA,oBAAS,CAAC,iCAAwB,CAAC,uBAAuB,CAAC,CAAA;IAC3D,WAAA,oBAAS,CAAC,iCAAwB,CAAC,4BAA4B,CAAC,CAAA;;GArBpE,UAAU,CAkMtB;AAlMY,gCAAU"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.HttpErrorResponseLoggingInterceptor = void 0;
25
+ const tsyringe_1 = require("tsyringe");
26
+ const common_1 = require("@pristine-ts/common");
27
+ const http_module_keyname_1 = require("../http.module.keyname");
28
+ /**
29
+ * This class is an interceptor to log incoming http responses that have errors.
30
+ * It is tagged as an HttpErrorResponseInterceptor so it can be automatically injected with the all the other HttpErrorResponseInterceptors.
31
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
32
+ */
33
+ let HttpErrorResponseLoggingInterceptor = class HttpErrorResponseLoggingInterceptor {
34
+ constructor(logHandler) {
35
+ this.logHandler = logHandler;
36
+ }
37
+ /**
38
+ * This method intercepts an incoming http response that has an error and logs it.
39
+ * @param request
40
+ * @param options
41
+ * @param response
42
+ */
43
+ interceptErrorResponse(request, options, response) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ this.logHandler.error("Receiving http response that has an error", { response, options }, http_module_keyname_1.HttpModuleKeyname);
46
+ return response;
47
+ });
48
+ }
49
+ };
50
+ HttpErrorResponseLoggingInterceptor = __decorate([
51
+ common_1.tag(common_1.ServiceDefinitionTagEnum.HttpErrorResponseInterceptor),
52
+ common_1.moduleScoped(http_module_keyname_1.HttpModuleKeyname),
53
+ tsyringe_1.injectable(),
54
+ __param(0, tsyringe_1.inject("LogHandlerInterface")),
55
+ __metadata("design:paramtypes", [Object])
56
+ ], HttpErrorResponseLoggingInterceptor);
57
+ exports.HttpErrorResponseLoggingInterceptor = HttpErrorResponseLoggingInterceptor;
58
+ //# sourceMappingURL=http-error-response-logging.interceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-error-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-error-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAkF;AAKlF,gEAAyD;AAGzD;;;;GAIG;AAIH,IAAa,mCAAmC,GAAhD,MAAa,mCAAmC;IAC5C,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;;OAKG;IACG,sBAAsB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACpH,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,2CAA2C,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,uCAAiB,CAAC,CAAC;YAC3G,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CAEJ,CAAA;AAfY,mCAAmC;IAH/C,YAAG,CAAC,iCAAwB,CAAC,4BAA4B,CAAC;IAC1D,qBAAY,CAAC,uCAAiB,CAAC;IAC/B,qBAAU,EAAE;IAEI,WAAA,iBAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,mCAAmC,CAe/C;AAfY,kFAAmC"}
@@ -28,6 +28,7 @@ const http_module_keyname_1 = require("../http.module.keyname");
28
28
  /**
29
29
  * This class is an interceptor to log outgoing http requests.
30
30
  * It is tagged as an HttpRequestInterceptor so it can be automatically injected with the all the other HttpRequestInterceptors.
31
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
31
32
  */
32
33
  let HttpRequestLoggingInterceptor = class HttpRequestLoggingInterceptor {
33
34
  constructor(logHandler) {
@@ -47,6 +48,7 @@ let HttpRequestLoggingInterceptor = class HttpRequestLoggingInterceptor {
47
48
  };
48
49
  HttpRequestLoggingInterceptor = __decorate([
49
50
  common_1.tag(common_1.ServiceDefinitionTagEnum.HttpRequestInterceptor),
51
+ common_1.moduleScoped(http_module_keyname_1.HttpModuleKeyname),
50
52
  tsyringe_1.injectable(),
51
53
  __param(0, tsyringe_1.inject("LogHandlerInterface")),
52
54
  __metadata("design:paramtypes", [Object])
@@ -1 +1 @@
1
- {"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,gDAAkE;AAIlE,gEAAyD;AAEzD;;;GAGG;AAGH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IACtC,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC7E,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC,EAAE,uCAAiB,CAAC,CAAC;YACrF,OAAO,OAAO,CAAC;QACnB,CAAC;KAAA;CACJ,CAAA;AAbY,6BAA6B;IAFzC,YAAG,CAAC,iCAAwB,CAAC,sBAAsB,CAAC;IACpD,qBAAU,EAAE;IAEI,WAAA,iBAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,6BAA6B,CAazC;AAbY,sEAA6B"}
1
+ {"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,gDAAkF;AAIlF,gEAAyD;AAEzD;;;;GAIG;AAIH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IACtC,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC7E,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC,EAAE,uCAAiB,CAAC,CAAC;YACrF,OAAO,OAAO,CAAC;QACnB,CAAC;KAAA;CACJ,CAAA;AAbY,6BAA6B;IAHzC,YAAG,CAAC,iCAAwB,CAAC,sBAAsB,CAAC;IACpD,qBAAY,CAAC,uCAAiB,CAAC;IAC/B,qBAAU,EAAE;IAEI,WAAA,iBAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,6BAA6B,CAazC;AAbY,sEAA6B"}
@@ -28,6 +28,7 @@ const http_module_keyname_1 = require("../http.module.keyname");
28
28
  /**
29
29
  * This class is an interceptor to log incoming http responses.
30
30
  * It is tagged as an HttpResponseInterceptor so it can be automatically injected with the all the other HttpResponseInterceptors.
31
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
31
32
  */
32
33
  let HttpResponseLoggingInterceptor = class HttpResponseLoggingInterceptor {
33
34
  constructor(logHandler) {
@@ -48,6 +49,7 @@ let HttpResponseLoggingInterceptor = class HttpResponseLoggingInterceptor {
48
49
  };
49
50
  HttpResponseLoggingInterceptor = __decorate([
50
51
  common_1.tag(common_1.ServiceDefinitionTagEnum.HttpResponseInterceptor),
52
+ common_1.moduleScoped(http_module_keyname_1.HttpModuleKeyname),
51
53
  tsyringe_1.injectable(),
52
54
  __param(0, tsyringe_1.inject("LogHandlerInterface")),
53
55
  __metadata("design:paramtypes", [Object])
@@ -1 +1 @@
1
- {"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAkE;AAMlE,gEAAyD;AAEzD;;;GAGG;AAGH,IAAa,8BAA8B,GAA3C,MAAa,8BAA8B;IACvC,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;;OAKG;IACG,iBAAiB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YAC/G,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,uCAAiB,CAAC,CAAC;YACxF,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CAEJ,CAAA;AAfY,8BAA8B;IAF1C,YAAG,CAAC,iCAAwB,CAAC,uBAAuB,CAAC;IACrD,qBAAU,EAAE;IAEI,WAAA,iBAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,8BAA8B,CAe1C;AAfY,wEAA8B"}
1
+ {"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAkF;AAMlF,gEAAyD;AAEzD;;;;GAIG;AAIH,IAAa,8BAA8B,GAA3C,MAAa,8BAA8B;IACvC,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;;OAKG;IACG,iBAAiB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YAC/G,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,uCAAiB,CAAC,CAAC;YACxF,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CAEJ,CAAA;AAfY,8BAA8B;IAH1C,YAAG,CAAC,iCAAwB,CAAC,uBAAuB,CAAC;IACrD,qBAAY,CAAC,uCAAiB,CAAC;IAC/B,qBAAU,EAAE;IAEI,WAAA,iBAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,8BAA8B,CAe1C;AAfY,wEAA8B"}
@@ -10,6 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./http-error-response-logging.interceptor"), exports);
13
14
  __exportStar(require("./http-request-logging.interceptor"), exports);
14
15
  __exportStar(require("./http-response-logging.interceptor"), exports);
15
16
  //# sourceMappingURL=interceptors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interceptors.js","sourceRoot":"","sources":["../../../../src/interceptors/interceptors.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qEAAkD;AAClD,sEAAmD"}
1
+ {"version":3,"file":"interceptors.js","sourceRoot":"","sources":["../../../../src/interceptors/interceptors.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4EAAyD;AACzD,qEAAkD;AAClD,sEAAmD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=http-error-response-interceptor.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-error-response-interceptor.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/http-error-response-interceptor.interface.ts"],"names":[],"mappings":""}
@@ -11,6 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./http-client.interface"), exports);
14
+ __exportStar(require("./http-error-response-interceptor.interface"), exports);
14
15
  __exportStar(require("./http-request.interface"), exports);
15
16
  __exportStar(require("./http-request-interceptor.interface"), exports);
16
17
  __exportStar(require("./http-response.interface"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAwC;AACxC,2DAAyC;AACzC,uEAAqD;AACrD,4DAA0C;AAC1C,wEAAsD;AACtD,2DAAyC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAwC;AACxC,8EAA4D;AAC5D,2DAAyC;AACzC,uEAAqD;AACrD,4DAA0C;AAC1C,wEAAsD;AACtD,2DAAyC"}
@@ -34,12 +34,14 @@ let HttpClient = class HttpClient {
34
34
  * This service is an http client for any http request you need to make outside of Pristine.
35
35
  * @param httpWrapper The wrapper around NodeJS http.
36
36
  * @param httpRequestInterceptors The interceptors to run before sending the request. All services with the tag ServiceDefinitionTagEnum.HttpRequestInterceptor will be automatically injected here.
37
- * @param httpResponseInterceptors The interceptors to run when receiving the reponse. All services with the tag ServiceDefinitionTagEnum.HttpResponseInterceptor will be automatically injected here.
37
+ * @param httpResponseInterceptors The interceptors to run when receiving the response. All services with the tag ServiceDefinitionTagEnum.HttpResponseInterceptor will be automatically injected here.
38
+ * @param httpErrorResponseInterceptors The interceptors to run when receiving a response that contains an error. All services with the tag ServiceDefinitionTagEnum.HttpErrorResponseInterceptor will be automatically injected here.
38
39
  */
39
- constructor(httpWrapper, httpRequestInterceptors = [], httpResponseInterceptors = []) {
40
+ constructor(httpWrapper, httpRequestInterceptors = [], httpResponseInterceptors = [], httpErrorResponseInterceptors = []) {
40
41
  this.httpWrapper = httpWrapper;
41
42
  this.httpRequestInterceptors = httpRequestInterceptors;
42
43
  this.httpResponseInterceptors = httpResponseInterceptors;
44
+ this.httpErrorResponseInterceptors = httpErrorResponseInterceptors;
43
45
  this.defaultOptions = {
44
46
  followRedirects: true,
45
47
  maximumNumberOfRedirects: 5,
@@ -133,19 +135,23 @@ let HttpClient = class HttpClient {
133
135
  handleResponseError(request, requestOptions, response, currentRetryCount = 0) {
134
136
  return __awaiter(this, void 0, void 0, function* () {
135
137
  let updatedResponse = response;
136
- // First check to determine if this request should be retried or not, only if the response is an error code
137
- if (this.isResponseError(updatedResponse) &&
138
- requestOptions.isRetryable && requestOptions.isRetryable(request, updatedResponse)) {
139
- if (requestOptions.maximumNumberOfRetries && requestOptions.maximumNumberOfRetries <= currentRetryCount) {
140
- // Simply return the errored out response.
141
- return updatedResponse;
138
+ if (this.isResponseError(updatedResponse)) {
139
+ for (const httpErrorResponseInterceptor of this.httpErrorResponseInterceptors) {
140
+ updatedResponse = yield httpErrorResponseInterceptor.interceptErrorResponse(request, requestOptions, updatedResponse);
141
+ }
142
+ // First check to determine if this request should be retried or not, only if the response is an error code
143
+ if (requestOptions.isRetryable && requestOptions.isRetryable(request, updatedResponse)) {
144
+ if (requestOptions.maximumNumberOfRetries && requestOptions.maximumNumberOfRetries <= currentRetryCount) {
145
+ // Simply return the errored out response.
146
+ return updatedResponse;
147
+ }
148
+ const updatedRetryCount = ++currentRetryCount;
149
+ // Retry the request using an exponential backoff with jitter.
150
+ updatedResponse = yield new Promise(resolve => setTimeout(() => __awaiter(this, void 0, void 0, function* () {
151
+ return resolve(yield this.httpWrapper.executeRequest(request));
152
+ }), MathUtils.exponentialBackoffWithJitter(updatedRetryCount)));
153
+ return this.handleResponseError(request, requestOptions, updatedResponse, updatedRetryCount);
142
154
  }
143
- const updatedRetryCount = ++currentRetryCount;
144
- // Retry the request using an exponential backoff with jitter.
145
- updatedResponse = yield new Promise(resolve => setTimeout(() => __awaiter(this, void 0, void 0, function* () {
146
- return resolve(yield this.httpWrapper.executeRequest(request));
147
- }), MathUtils.exponentialBackoffWithJitter(updatedRetryCount)));
148
- return this.handleResponseError(request, requestOptions, updatedResponse, updatedRetryCount);
149
155
  }
150
156
  return updatedResponse;
151
157
  });
@@ -200,7 +206,8 @@ HttpClient = __decorate([
200
206
  __param(0, inject('HttpWrapperInterface')),
201
207
  __param(1, injectAll(ServiceDefinitionTagEnum.HttpRequestInterceptor)),
202
208
  __param(2, injectAll(ServiceDefinitionTagEnum.HttpResponseInterceptor)),
203
- __metadata("design:paramtypes", [Object, Array, Array])
209
+ __param(3, injectAll(ServiceDefinitionTagEnum.HttpErrorResponseInterceptor)),
210
+ __metadata("design:paramtypes", [Object, Array, Array, Array])
204
211
  ], HttpClient);
205
212
  export { HttpClient };
206
213
  //# sourceMappingURL=http.client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.client.js","sourceRoot":"","sources":["../../../../src/clients/http.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAIvD,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAC,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAq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desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ import { inject, injectable } from "tsyringe";
23
+ import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
24
+ import { HttpModuleKeyname } from "../http.module.keyname";
25
+ /**
26
+ * This class is an interceptor to log incoming http responses that have errors.
27
+ * It is tagged as an HttpErrorResponseInterceptor so it can be automatically injected with the all the other HttpErrorResponseInterceptors.
28
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
29
+ */
30
+ let HttpErrorResponseLoggingInterceptor = class HttpErrorResponseLoggingInterceptor {
31
+ constructor(logHandler) {
32
+ this.logHandler = logHandler;
33
+ }
34
+ /**
35
+ * This method intercepts an incoming http response that has an error and logs it.
36
+ * @param request
37
+ * @param options
38
+ * @param response
39
+ */
40
+ interceptErrorResponse(request, options, response) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ this.logHandler.error("Receiving http response that has an error", { response, options }, HttpModuleKeyname);
43
+ return response;
44
+ });
45
+ }
46
+ };
47
+ HttpErrorResponseLoggingInterceptor = __decorate([
48
+ tag(ServiceDefinitionTagEnum.HttpErrorResponseInterceptor),
49
+ moduleScoped(HttpModuleKeyname),
50
+ injectable(),
51
+ __param(0, inject("LogHandlerInterface")),
52
+ __metadata("design:paramtypes", [Object])
53
+ ], HttpErrorResponseLoggingInterceptor);
54
+ export { HttpErrorResponseLoggingInterceptor };
55
+ //# sourceMappingURL=http-error-response-logging.interceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-error-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-error-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAKlF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAGzD;;;;GAIG;AAIH,IAAa,mCAAmC,GAAhD,MAAa,mCAAmC;IAC5C,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;;OAKG;IACG,sBAAsB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACpH,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,2CAA2C,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,iBAAiB,CAAC,CAAC;YAC3G,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CAEJ,CAAA;AAfY,mCAAmC;IAH/C,GAAG,CAAC,wBAAwB,CAAC,4BAA4B,CAAC;IAC1D,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAEI,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,mCAAmC,CAe/C;SAfY,mCAAmC"}
@@ -20,11 +20,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  import { inject, injectable } from "tsyringe";
23
- import { ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
23
+ import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
24
24
  import { HttpModuleKeyname } from "../http.module.keyname";
25
25
  /**
26
26
  * This class is an interceptor to log outgoing http requests.
27
27
  * It is tagged as an HttpRequestInterceptor so it can be automatically injected with the all the other HttpRequestInterceptors.
28
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
28
29
  */
29
30
  let HttpRequestLoggingInterceptor = class HttpRequestLoggingInterceptor {
30
31
  constructor(logHandler) {
@@ -44,6 +45,7 @@ let HttpRequestLoggingInterceptor = class HttpRequestLoggingInterceptor {
44
45
  };
45
46
  HttpRequestLoggingInterceptor = __decorate([
46
47
  tag(ServiceDefinitionTagEnum.HttpRequestInterceptor),
48
+ moduleScoped(HttpModuleKeyname),
47
49
  injectable(),
48
50
  __param(0, inject("LogHandlerInterface")),
49
51
  __metadata("design:paramtypes", [Object])
@@ -1 +1 @@
1
- {"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAC,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAIlE,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;GAGG;AAGH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IACtC,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC7E,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC,EAAE,iBAAiB,CAAC,CAAC;YACrF,OAAO,OAAO,CAAC;QACnB,CAAC;KAAA;CACJ,CAAA;AAbY,6BAA6B;IAFzC,GAAG,CAAC,wBAAwB,CAAC,sBAAsB,CAAC;IACpD,UAAU,EAAE;IAEI,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,6BAA6B,CAazC;SAbY,6BAA6B"}
1
+ {"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAIlF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AAIH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IACtC,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC7E,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC,EAAE,iBAAiB,CAAC,CAAC;YACrF,OAAO,OAAO,CAAC;QACnB,CAAC;KAAA;CACJ,CAAA;AAbY,6BAA6B;IAHzC,GAAG,CAAC,wBAAwB,CAAC,sBAAsB,CAAC;IACpD,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAEI,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,6BAA6B,CAazC;SAbY,6BAA6B"}
@@ -20,11 +20,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  import { inject, injectable } from "tsyringe";
23
- import { ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
23
+ import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
24
24
  import { HttpModuleKeyname } from "../http.module.keyname";
25
25
  /**
26
26
  * This class is an interceptor to log incoming http responses.
27
27
  * It is tagged as an HttpResponseInterceptor so it can be automatically injected with the all the other HttpResponseInterceptors.
28
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
28
29
  */
29
30
  let HttpResponseLoggingInterceptor = class HttpResponseLoggingInterceptor {
30
31
  constructor(logHandler) {
@@ -45,6 +46,7 @@ let HttpResponseLoggingInterceptor = class HttpResponseLoggingInterceptor {
45
46
  };
46
47
  HttpResponseLoggingInterceptor = __decorate([
47
48
  tag(ServiceDefinitionTagEnum.HttpResponseInterceptor),
49
+ moduleScoped(HttpModuleKeyname),
48
50
  injectable(),
49
51
  __param(0, inject("LogHandlerInterface")),
50
52
  __metadata("design:paramtypes", [Object])
@@ -1 +1 @@
1
- {"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAC,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAMlE,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;GAGG;AAGH,IAAa,8BAA8B,GAA3C,MAAa,8BAA8B;IACvC,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;;OAKG;IACG,iBAAiB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YAC/G,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,iBAAiB,CAAC,CAAC;YACxF,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CAEJ,CAAA;AAfY,8BAA8B;IAF1C,GAAG,CAAC,wBAAwB,CAAC,uBAAuB,CAAC;IACrD,UAAU,EAAE;IAEI,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,8BAA8B,CAe1C;SAfY,8BAA8B"}
1
+ {"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAMlF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AAIH,IAAa,8BAA8B,GAA3C,MAAa,8BAA8B;IACvC,YAA4D,UAA+B;QAA/B,eAAU,GAAV,UAAU,CAAqB;IAC3F,CAAC;IAED;;;;;OAKG;IACG,iBAAiB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YAC/G,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,iBAAiB,CAAC,CAAC;YACxF,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CAEJ,CAAA;AAfY,8BAA8B;IAH1C,GAAG,CAAC,wBAAwB,CAAC,uBAAuB,CAAC;IACrD,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAEI,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;;GADjC,8BAA8B,CAe1C;SAfY,8BAA8B"}
@@ -1,3 +1,4 @@
1
+ export * from "./http-error-response-logging.interceptor";
1
2
  export * from "./http-request-logging.interceptor";
2
3
  export * from "./http-response-logging.interceptor";
3
4
  //# sourceMappingURL=interceptors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interceptors.js","sourceRoot":"","sources":["../../../../src/interceptors/interceptors.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,qCAAqC,CAAA"}
1
+ {"version":3,"file":"interceptors.js","sourceRoot":"","sources":["../../../../src/interceptors/interceptors.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAA;AACzD,cAAc,oCAAoC,CAAA;AAClD,cAAc,qCAAqC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=http-error-response-interceptor.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-error-response-interceptor.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/http-error-response-interceptor.interface.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  export * from "./http-client.interface";
2
+ export * from "./http-error-response-interceptor.interface";
2
3
  export * from "./http-request.interface";
3
4
  export * from "./http-request-interceptor.interface";
4
5
  export * from "./http-response.interface";
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC"}
@@ -5,6 +5,7 @@ import { HttpRequestOptions } from "../options/http-request.options.";
5
5
  import { HttpRequestInterceptorInterface } from "../interfaces/http-request-interceptor.interface";
6
6
  import { HttpResponseInterceptorInterface } from "../interfaces/http-response-interceptor.interface";
7
7
  import { HttpWrapperInterface } from "../interfaces/http-wrapper.interface";
8
+ import { HttpErrorResponseInterceptorInterface } from "../interfaces/http-error-response-interceptor.interface";
8
9
  /**
9
10
  * This service is an http client for any http request you need to make outside of Pristine.
10
11
  */
@@ -12,14 +13,16 @@ export declare class HttpClient implements HttpClientInterface {
12
13
  private readonly httpWrapper;
13
14
  private readonly httpRequestInterceptors;
14
15
  private readonly httpResponseInterceptors;
16
+ private readonly httpErrorResponseInterceptors;
15
17
  defaultOptions: HttpRequestOptions;
16
18
  /**
17
19
  * This service is an http client for any http request you need to make outside of Pristine.
18
20
  * @param httpWrapper The wrapper around NodeJS http.
19
21
  * @param httpRequestInterceptors The interceptors to run before sending the request. All services with the tag ServiceDefinitionTagEnum.HttpRequestInterceptor will be automatically injected here.
20
- * @param httpResponseInterceptors The interceptors to run when receiving the reponse. All services with the tag ServiceDefinitionTagEnum.HttpResponseInterceptor will be automatically injected here.
22
+ * @param httpResponseInterceptors The interceptors to run when receiving the response. All services with the tag ServiceDefinitionTagEnum.HttpResponseInterceptor will be automatically injected here.
23
+ * @param httpErrorResponseInterceptors The interceptors to run when receiving a response that contains an error. All services with the tag ServiceDefinitionTagEnum.HttpErrorResponseInterceptor will be automatically injected here.
21
24
  */
22
- constructor(httpWrapper: HttpWrapperInterface, httpRequestInterceptors?: HttpRequestInterceptorInterface[], httpResponseInterceptors?: HttpResponseInterceptorInterface[]);
25
+ constructor(httpWrapper: HttpWrapperInterface, httpRequestInterceptors?: HttpRequestInterceptorInterface[], httpResponseInterceptors?: HttpResponseInterceptorInterface[], httpErrorResponseInterceptors?: HttpErrorResponseInterceptorInterface[]);
23
26
  /**
24
27
  * This method is the entry point where the request is passed as an argument and the response is returned.
25
28
  *
@@ -0,0 +1,21 @@
1
+ import { HttpRequestInterface } from "../interfaces/http-request.interface";
2
+ import { HttpRequestOptions } from "../options/http-request.options.";
3
+ import { LogHandlerInterface } from "@pristine-ts/logging";
4
+ import { HttpResponseInterface } from "../interfaces/http-response.interface";
5
+ import { HttpErrorResponseInterceptorInterface } from "../interfaces/http-error-response-interceptor.interface";
6
+ /**
7
+ * This class is an interceptor to log incoming http responses that have errors.
8
+ * It is tagged as an HttpErrorResponseInterceptor so it can be automatically injected with the all the other HttpErrorResponseInterceptors.
9
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
10
+ */
11
+ export declare class HttpErrorResponseLoggingInterceptor implements HttpErrorResponseInterceptorInterface {
12
+ private readonly logHandler;
13
+ constructor(logHandler: LogHandlerInterface);
14
+ /**
15
+ * This method intercepts an incoming http response that has an error and logs it.
16
+ * @param request
17
+ * @param options
18
+ * @param response
19
+ */
20
+ interceptErrorResponse(request: HttpRequestInterface, options: HttpRequestOptions, response: HttpResponseInterface): Promise<HttpResponseInterface>;
21
+ }
@@ -5,6 +5,7 @@ import { LogHandlerInterface } from "@pristine-ts/logging";
5
5
  /**
6
6
  * This class is an interceptor to log outgoing http requests.
7
7
  * It is tagged as an HttpRequestInterceptor so it can be automatically injected with the all the other HttpRequestInterceptors.
8
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
8
9
  */
9
10
  export declare class HttpRequestLoggingInterceptor implements HttpRequestInterceptorInterface {
10
11
  private readonly logHandler;
@@ -6,6 +6,7 @@ import { HttpResponseInterface } from "../interfaces/http-response.interface";
6
6
  /**
7
7
  * This class is an interceptor to log incoming http responses.
8
8
  * It is tagged as an HttpResponseInterceptor so it can be automatically injected with the all the other HttpResponseInterceptors.
9
+ * It is module scoped to the http module so that it is only registered if the http module is imported.
9
10
  */
10
11
  export declare class HttpResponseLoggingInterceptor implements HttpResponseInterceptorInterface {
11
12
  private readonly logHandler;
@@ -1,2 +1,3 @@
1
+ export * from "./http-error-response-logging.interceptor";
1
2
  export * from "./http-request-logging.interceptor";
2
3
  export * from "./http-response-logging.interceptor";
@@ -0,0 +1,21 @@
1
+ import { HttpRequestInterface } from "./http-request.interface";
2
+ import { HttpResponseInterface } from "./http-response.interface";
3
+ import { HttpRequestOptions } from "../options/http-request.options.";
4
+ /**
5
+ * The Http Error Response Interceptor Interface defines the methods that an Http Error Response Interceptor must implement. This
6
+ * interceptor is called when receiving a response that has an error to an http request before returning the final response to
7
+ * the caller or retrying the request.
8
+ */
9
+ export interface HttpErrorResponseInterceptorInterface {
10
+ /**
11
+ * This method receives an http response object and the associated request and must return a transformed http response object.
12
+ * If you don't want to manipulate the response object (when logging for example), juste resolve a promise with the response passed to this method.
13
+ *
14
+ * If you force to never resolve the promise, the execution will stall. Be careful.
15
+ *
16
+ * @param response
17
+ * @param options
18
+ * @param request
19
+ */
20
+ interceptErrorResponse(request: HttpRequestInterface, options: HttpRequestOptions, response: HttpResponseInterface): Promise<HttpResponseInterface>;
21
+ }
@@ -1,4 +1,5 @@
1
1
  export * from "./http-client.interface";
2
+ export * from "./http-error-response-interceptor.interface";
2
3
  export * from "./http-request.interface";
3
4
  export * from "./http-request-interceptor.interface";
4
5
  export * from "./http-response.interface";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pristine-ts/http",
3
- "version": "0.0.167",
3
+ "version": "0.0.171",
4
4
  "description": "",
5
5
  "module": "dist/lib/esm/http.module.js",
6
6
  "main": "dist/lib/cjs/http.module.js",
@@ -14,8 +14,8 @@
14
14
  "dist"
15
15
  ],
16
16
  "dependencies": {
17
- "@pristine-ts/common": "^0.0.167",
18
- "@pristine-ts/logging": "^0.0.167",
17
+ "@pristine-ts/common": "^0.0.171",
18
+ "@pristine-ts/logging": "^0.0.171",
19
19
  "lodash": "^4.17.21",
20
20
  "url-parse": "^1.4.7"
21
21
  },
@@ -58,5 +58,5 @@
58
58
  "src/*.{js,ts}"
59
59
  ]
60
60
  },
61
- "gitHead": "199caaccfe024ee23218b491a814ed58c2b719cd"
61
+ "gitHead": "c4eaf7eff5917142595f2664f303c2fed7298259"
62
62
  }