@yildizpay/http-adapter 3.1.0 → 3.3.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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,sDAAoC;AACpC,6DAA2C;AAG3C,6DAA2C;AAG3C,mDAAiC;AACjC,oDAAkC;AAClC,2DAAyC;AACzC,2DAAyC;AAGzC,wEAAsD;AACtD,oEAAkD;AAGlD,8DAA4C;AAC5C,kFAAgE;AAChE,uFAAqE;AACrE,+EAA6D;AAG7D,kEAAgD;AAChD,4DAA0C;AAG1C,8EAA4D;AAC5D,sEAAoD;AACpD,sEAAoD;AACpD,sEAAoD;AACpD,kEAAgD;AAChD,yEAAuD;AACvD,iEAA+C;AAC/C,gEAA8C;AAC9C,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,sDAAoC;AACpC,6DAA2C;AAG3C,6DAA2C;AAC3C,kEAAgD;AAGhD,mDAAiC;AACjC,oDAAkC;AAClC,2DAAyC;AACzC,2DAAyC;AAGzC,wEAAsD;AACtD,oEAAkD;AAClD,0EAAwD;AAGxD,8DAA4C;AAC5C,kFAAgE;AAChE,uFAAqE;AACrE,+EAA6D;AAG7D,kEAAgD;AAChD,4DAA0C;AAG1C,8EAA4D;AAC5D,sEAAoD;AACpD,sEAAoD;AACpD,sEAAoD;AACpD,kEAAgD;AAChD,yEAAuD;AACvD,iEAA+C;AAC/C,oEAAkD;AAClD,gEAA8C;AAC9C,yDAAuC"}
@@ -1,6 +1,7 @@
1
1
  import { HttpMethod } from '../common/enums/http-method.enum';
2
2
  import { HttpBody } from '../common/types/http.types';
3
3
  import { RequestOptions } from './request-options';
4
+ import { ResponseValidator } from '../contracts/response-validator.contract';
4
5
  export declare class Request {
5
6
  readonly baseUrl: string;
6
7
  readonly endpoint: string;
@@ -9,9 +10,10 @@ export declare class Request {
9
10
  readonly queryParams: Record<string, string>;
10
11
  readonly body: HttpBody | null;
11
12
  readonly options: RequestOptions;
13
+ readonly validators: ResponseValidator[];
12
14
  readonly systemCorrelationId: string;
13
15
  timestamp: Date;
14
- constructor(baseUrl: string, endpoint: string, method?: HttpMethod, headers?: Record<string, string>, queryParams?: Record<string, string>, body?: HttpBody | null, options?: RequestOptions);
16
+ constructor(baseUrl: string, endpoint: string, method?: HttpMethod, headers?: Record<string, string>, queryParams?: Record<string, string>, body?: HttpBody | null, options?: RequestOptions, validators?: ResponseValidator[]);
15
17
  addParam(key: string, value: string | number | Record<string, any>): void;
16
18
  addHeader(key: string, value: string): void;
17
19
  addQueryParam(key: string, value: string): void;
@@ -5,7 +5,7 @@ const str_util_1 = require("../common/utils/str.util");
5
5
  const http_method_enum_1 = require("../common/enums/http-method.enum");
6
6
  const request_options_1 = require("./request-options");
7
7
  class Request {
8
- constructor(baseUrl, endpoint, method = http_method_enum_1.HttpMethod.POST, headers = {}, queryParams = {}, body = null, options = new request_options_1.RequestOptions()) {
8
+ constructor(baseUrl, endpoint, method = http_method_enum_1.HttpMethod.POST, headers = {}, queryParams = {}, body = null, options = new request_options_1.RequestOptions(), validators = []) {
9
9
  this.baseUrl = baseUrl;
10
10
  this.endpoint = endpoint;
11
11
  this.method = method;
@@ -13,6 +13,7 @@ class Request {
13
13
  this.queryParams = queryParams;
14
14
  this.body = body;
15
15
  this.options = options;
16
+ this.validators = validators;
16
17
  this.systemCorrelationId = str_util_1.StrUtil.generateUuid();
17
18
  this.timestamp = new Date();
18
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/models/request.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,uEAA8D;AAE9D,uDAAmD;AASnD,MAAa,OAAO;IAsBlB,YACkB,OAAe,EACf,QAAgB,EAChB,SAAqB,6BAA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