@ama-sdk/core 10.3.0-prerelease.9 → 11.0.0-next.1

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 (202) hide show
  1. package/cjs/clients/api-angular-client.js +36 -18
  2. package/cjs/clients/api-beacon-client.js +61 -19
  3. package/cjs/clients/api-fetch-client.js +60 -18
  4. package/cjs/fwk/api.helper.spec.js +20 -20
  5. package/cjs/fwk/api.helpers.js +14 -14
  6. package/cjs/fwk/core/api-client.js +1 -1
  7. package/cjs/fwk/core/base-api-constructor.js +1 -1
  8. package/cjs/fwk/date.js +9 -9
  9. package/cjs/fwk/date.spec.js +25 -25
  10. package/cjs/fwk/errors.js +3 -3
  11. package/cjs/fwk/mocks/alf-mock-adapter.js +4 -4
  12. package/cjs/fwk/mocks/base-mock-adapter.js +2 -2
  13. package/cjs/fwk/mocks/helpers.js +3 -3
  14. package/cjs/fwk/reviver.spec.js +19 -19
  15. package/cjs/plugins/additional-params/additional-params-sync.request.js +2 -2
  16. package/cjs/plugins/additional-params/additional-params.request.js +3 -3
  17. package/cjs/plugins/additional-params/additional-params.spec.js +30 -30
  18. package/cjs/plugins/api-configuration-override/api-configuration-override.request.js +2 -2
  19. package/cjs/plugins/api-configuration-override/api-configuration-override.spec.js +13 -13
  20. package/cjs/plugins/api-key/api-key.request.js +2 -2
  21. package/cjs/plugins/api-key/api-key.spec.js +11 -11
  22. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +5 -5
  23. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +33 -33
  24. package/cjs/plugins/client-facts/client-facts.request.js +3 -3
  25. package/cjs/plugins/client-facts/client-facts.spec.js +27 -27
  26. package/cjs/plugins/concurrent/concurrent.spec.js +4 -4
  27. package/cjs/plugins/custom-info/custom-info.spec.js +15 -15
  28. package/cjs/plugins/exception/exception.reply.js +2 -2
  29. package/cjs/plugins/exception/exception.spec.js +15 -15
  30. package/cjs/plugins/fetch-cache/fetch-cache.request.js +4 -4
  31. package/cjs/plugins/fetch-cache/fetch-cache.spec.js +20 -20
  32. package/cjs/plugins/fetch-credentials/fetch-credentials.request.js +1 -1
  33. package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +8 -8
  34. package/cjs/plugins/json-token/json-token.reply.js +5 -5
  35. package/cjs/plugins/json-token/json-token.request.js +4 -4
  36. package/cjs/plugins/json-token/json-token.spec.js +24 -24
  37. package/cjs/plugins/keepalive/keepalive.request.js +2 -2
  38. package/cjs/plugins/keepalive/keepalive.spec.js +4 -4
  39. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +11 -11
  40. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +25 -25
  41. package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +3 -3
  42. package/cjs/plugins/mock-intercept/mock-intercept.interface.js +2 -2
  43. package/cjs/plugins/mock-intercept/mock-intercept.request.js +3 -3
  44. package/cjs/plugins/mock-intercept/mock-intercept.spec.js +28 -28
  45. package/cjs/plugins/perf-metric/perf-metric.fetch.js +1 -1
  46. package/cjs/plugins/perf-metric/perf-metric.probe.spec.js +9 -9
  47. package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +11 -11
  48. package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +94 -94
  49. package/cjs/plugins/raw-response-info/raw-response-info.spec.js +12 -12
  50. package/cjs/plugins/retry/retry.spec.js +20 -20
  51. package/cjs/plugins/reviver/reviver.spec.js +4 -4
  52. package/cjs/plugins/session-id/session-id.request.js +6 -6
  53. package/cjs/plugins/session-id/session-id.spec.js +13 -13
  54. package/cjs/plugins/si-token/si-token.spec.js +9 -9
  55. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +4 -4
  56. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +44 -44
  57. package/cjs/plugins/timeout/timeout.fetch.js +11 -11
  58. package/cjs/plugins/timeout/timeout.spec.js +13 -13
  59. package/cjs/plugins/url-rewrite/url-rewrite.spec.js +9 -9
  60. package/cjs/plugins/wait-for/wait-for.spec.js +9 -9
  61. package/cjs/utils/crypto.js +14 -14
  62. package/cjs/utils/generic-api.js +253 -0
  63. package/cjs/utils/index.js +1 -0
  64. package/cjs/utils/json-token.js +30 -30
  65. package/cjs/utils/json-token.spec.js +31 -31
  66. package/cli/clear-index.cjs.map +1 -0
  67. package/cli/files-pack.cjs.map +1 -0
  68. package/esm2015/clients/api-angular-client.js +40 -22
  69. package/esm2015/clients/api-beacon-client.js +62 -20
  70. package/esm2015/clients/api-fetch-client.js +64 -22
  71. package/esm2015/clients/index.js +2 -2
  72. package/esm2015/fwk/api.helper.spec.js +21 -21
  73. package/esm2015/fwk/api.helpers.js +14 -14
  74. package/esm2015/fwk/core/api-client.js +1 -1
  75. package/esm2015/fwk/core/base-api-constructor.js +1 -1
  76. package/esm2015/fwk/core/index.js +2 -2
  77. package/esm2015/fwk/date.js +9 -9
  78. package/esm2015/fwk/date.spec.js +26 -26
  79. package/esm2015/fwk/errors.js +3 -3
  80. package/esm2015/fwk/index.js +10 -10
  81. package/esm2015/fwk/mocks/alf-mock-adapter.js +6 -6
  82. package/esm2015/fwk/mocks/base-mock-adapter.js +3 -3
  83. package/esm2015/fwk/mocks/helpers.js +3 -3
  84. package/esm2015/fwk/mocks/index.js +10 -10
  85. package/esm2015/fwk/mocks/random-mock-adapter.js +1 -1
  86. package/esm2015/fwk/mocks/sequential-mock-adapter.js +1 -1
  87. package/esm2015/fwk/reviver.spec.js +20 -20
  88. package/esm2015/plugins/additional-params/additional-params-sync.request.js +3 -3
  89. package/esm2015/plugins/additional-params/additional-params.request.js +3 -3
  90. package/esm2015/plugins/additional-params/additional-params.spec.js +32 -32
  91. package/esm2015/plugins/additional-params/index.js +2 -2
  92. package/esm2015/plugins/api-configuration-override/api-configuration-override.request.js +2 -2
  93. package/esm2015/plugins/api-configuration-override/api-configuration-override.spec.js +14 -14
  94. package/esm2015/plugins/api-configuration-override/index.js +1 -1
  95. package/esm2015/plugins/api-key/api-key.request.js +2 -2
  96. package/esm2015/plugins/api-key/api-key.spec.js +12 -12
  97. package/esm2015/plugins/api-key/index.js +1 -1
  98. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +5 -5
  99. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +34 -34
  100. package/esm2015/plugins/bot-protection-fingerprint/index.js +1 -1
  101. package/esm2015/plugins/client-facts/client-facts.request.js +4 -4
  102. package/esm2015/plugins/client-facts/client-facts.spec.js +28 -28
  103. package/esm2015/plugins/client-facts/index.js +1 -1
  104. package/esm2015/plugins/concurrent/concurrent.spec.js +5 -5
  105. package/esm2015/plugins/concurrent/index.js +1 -1
  106. package/esm2015/plugins/core/index.js +4 -4
  107. package/esm2015/plugins/custom-info/custom-info.spec.js +17 -17
  108. package/esm2015/plugins/custom-info/index.js +1 -1
  109. package/esm2015/plugins/exception/exception.reply.js +4 -4
  110. package/esm2015/plugins/exception/exception.spec.js +18 -18
  111. package/esm2015/plugins/exception/index.js +1 -1
  112. package/esm2015/plugins/fetch-cache/fetch-cache.request.js +4 -4
  113. package/esm2015/plugins/fetch-cache/fetch-cache.spec.js +21 -21
  114. package/esm2015/plugins/fetch-cache/index.js +1 -1
  115. package/esm2015/plugins/fetch-credentials/fetch-credentials.request.js +1 -1
  116. package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +9 -9
  117. package/esm2015/plugins/fetch-credentials/index.js +1 -1
  118. package/esm2015/plugins/index.js +25 -25
  119. package/esm2015/plugins/json-token/index.js +2 -2
  120. package/esm2015/plugins/json-token/json-token.reply.js +5 -5
  121. package/esm2015/plugins/json-token/json-token.request.js +4 -4
  122. package/esm2015/plugins/json-token/json-token.spec.js +27 -27
  123. package/esm2015/plugins/keepalive/index.js +1 -1
  124. package/esm2015/plugins/keepalive/keepalive.request.js +2 -2
  125. package/esm2015/plugins/keepalive/keepalive.spec.js +5 -5
  126. package/esm2015/plugins/mgw-mdw-auth/index.js +1 -1
  127. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +13 -13
  128. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +27 -27
  129. package/esm2015/plugins/mock-intercept/index.js +2 -2
  130. package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +5 -5
  131. package/esm2015/plugins/mock-intercept/mock-intercept.interface.js +2 -2
  132. package/esm2015/plugins/mock-intercept/mock-intercept.request.js +4 -4
  133. package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +32 -32
  134. package/esm2015/plugins/perf-metric/index.js +1 -1
  135. package/esm2015/plugins/perf-metric/perf-metric.fetch.js +2 -2
  136. package/esm2015/plugins/perf-metric/perf-metric.probe.spec.js +10 -10
  137. package/esm2015/plugins/pii-tokenizer/index.js +1 -1
  138. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +12 -12
  139. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +96 -96
  140. package/esm2015/plugins/raw-response-info/index.js +1 -1
  141. package/esm2015/plugins/raw-response-info/raw-response-info.spec.js +14 -14
  142. package/esm2015/plugins/retry/index.js +1 -1
  143. package/esm2015/plugins/retry/retry.fetch.js +1 -1
  144. package/esm2015/plugins/retry/retry.spec.js +21 -21
  145. package/esm2015/plugins/reviver/index.js +1 -1
  146. package/esm2015/plugins/reviver/reviver.spec.js +6 -6
  147. package/esm2015/plugins/session-id/index.js +1 -1
  148. package/esm2015/plugins/session-id/session-id.request.js +7 -7
  149. package/esm2015/plugins/session-id/session-id.spec.js +14 -14
  150. package/esm2015/plugins/si-token/index.js +1 -1
  151. package/esm2015/plugins/si-token/si-token.request.js +1 -1
  152. package/esm2015/plugins/si-token/si-token.spec.js +10 -10
  153. package/esm2015/plugins/simple-api-key-authentication/index.js +1 -1
  154. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +5 -5
  155. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +46 -46
  156. package/esm2015/plugins/timeout/index.js +1 -1
  157. package/esm2015/plugins/timeout/timeout.fetch.js +12 -12
  158. package/esm2015/plugins/timeout/timeout.spec.js +15 -15
  159. package/esm2015/plugins/url-rewrite/index.js +1 -1
  160. package/esm2015/plugins/url-rewrite/url-rewrite.spec.js +10 -10
  161. package/esm2015/plugins/wait-for/index.js +1 -1
  162. package/esm2015/plugins/wait-for/wait-for.spec.js +10 -10
  163. package/esm2015/public_api.js +4 -4
  164. package/esm2015/utils/crypto.js +15 -15
  165. package/esm2015/utils/generic-api.js +245 -0
  166. package/esm2015/utils/index.js +6 -5
  167. package/esm2015/utils/json-token.js +32 -32
  168. package/esm2015/utils/json-token.spec.js +32 -32
  169. package/package.json +7 -7
  170. package/schematics/ng-add/index.js.map +1 -0
  171. package/schematics/ng-add/schema.js.map +1 -0
  172. package/src/clients/api-angular-client.d.ts +6 -3
  173. package/src/clients/api-angular-client.d.ts.map +1 -1
  174. package/src/clients/api-angular-client.js +23 -11
  175. package/src/clients/api-angular-client.js.map +1 -1
  176. package/src/clients/api-beacon-client.d.ts +7 -5
  177. package/src/clients/api-beacon-client.d.ts.map +1 -1
  178. package/src/clients/api-beacon-client.js +22 -14
  179. package/src/clients/api-beacon-client.js.map +1 -1
  180. package/src/clients/api-fetch-client.d.ts +5 -3
  181. package/src/clients/api-fetch-client.d.ts.map +1 -1
  182. package/src/clients/api-fetch-client.js +22 -11
  183. package/src/clients/api-fetch-client.js.map +1 -1
  184. package/src/fwk/api.helpers.d.ts +1 -1
  185. package/src/fwk/api.helpers.d.ts.map +1 -1
  186. package/src/fwk/api.helpers.js +1 -1
  187. package/src/fwk/api.helpers.js.map +1 -1
  188. package/src/fwk/core/api-client.d.ts +36 -1
  189. package/src/fwk/core/api-client.d.ts.map +1 -1
  190. package/src/fwk/core/api-client.js.map +1 -1
  191. package/src/plugins/core/plugin.d.ts +6 -1
  192. package/src/plugins/core/plugin.d.ts.map +1 -1
  193. package/src/plugins/core/reply-plugin.d.ts +0 -2
  194. package/src/plugins/core/reply-plugin.d.ts.map +1 -1
  195. package/src/utils/generic-api.d.ts +39 -0
  196. package/src/utils/generic-api.d.ts.map +1 -0
  197. package/src/utils/generic-api.js +43 -0
  198. package/src/utils/generic-api.js.map +1 -0
  199. package/src/utils/index.d.ts +1 -0
  200. package/src/utils/index.d.ts.map +1 -1
  201. package/src/utils/index.js +1 -0
  202. package/src/utils/index.js.map +1 -1
@@ -3,50 +3,50 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  var _date = require("./date");
6
- describe("DateTime", function() {
7
- it("should support timestamp", function() {
6
+ describe('DateTime', function() {
7
+ it('should support timestamp', function() {
8
8
  var ts = new Date().getTime();
9
9
  var dateUtils = new _date.utils.DateTime(ts);
10
10
  expect(dateUtils.getTime()).toEqual(ts);
11
11
  });
12
- it("should support DateTime Utils", function() {
12
+ it('should support DateTime Utils', function() {
13
13
  var originalDate = new _date.utils.DateTime(new Date());
14
14
  expect(new _date.utils.DateTime(originalDate)).toEqual(originalDate);
15
15
  });
16
- it("should support a copy constructor", function() {
16
+ it('should support a copy constructor', function() {
17
17
  var originalDate = new _date.utils.DateTime(new Date());
18
18
  expect(new _date.utils.DateTime(originalDate)).toEqual(originalDate);
19
19
  });
20
- it("should support json conversions", function() {
20
+ it('should support json conversions', function() {
21
21
  var originalDate = new _date.utils.DateTime(new Date());
22
22
  var jsonDate = JSON.parse(JSON.stringify(originalDate));
23
23
  expect(new _date.utils.DateTime(jsonDate)).toEqual(originalDate);
24
24
  });
25
- it("should support date without time", function() {
26
- var date1 = "1988-06-07";
25
+ it('should support date without time', function() {
26
+ var date1 = '1988-06-07';
27
27
  var dateCompare = new Date(date1);
28
28
  expect(new _date.utils.DateTime(date1)).toEqual(dateCompare);
29
29
  });
30
- it("should support datetime without timezone", function() {
31
- var date1 = "2015-03-25T12:00:00Z";
32
- var dateCompare = new Date("2015-03-25");
30
+ it('should support datetime without timezone', function() {
31
+ var date1 = '2015-03-25T12:00:00Z';
32
+ var dateCompare = new Date('2015-03-25');
33
33
  dateCompare.setHours(12);
34
34
  dateCompare.setMinutes(0);
35
35
  var dateUtils = new _date.utils.DateTime(date1);
36
36
  expect(dateUtils).toEqual(dateCompare);
37
37
  });
38
- it("should ignore timezone of datetime", function() {
39
- var date1 = "2015-03-25T12:00:00-02:00";
40
- var date2 = "2015-03-25T12:00:00+05:00";
41
- var dateCompare = new Date("2015-03-25T12:00:00Z");
38
+ it('should ignore timezone of datetime', function() {
39
+ var date1 = '2015-03-25T12:00:00-02:00';
40
+ var date2 = '2015-03-25T12:00:00+05:00';
41
+ var dateCompare = new Date('2015-03-25T12:00:00Z');
42
42
  dateCompare.setHours(12);
43
43
  dateCompare.setMinutes(0);
44
44
  expect(new _date.utils.DateTime(date1)).toEqual(dateCompare);
45
45
  expect(new _date.utils.DateTime(date2)).toEqual(dateCompare);
46
46
  });
47
- it("should handle daylight change", function() {
48
- var dateStr1 = "2017-03-23T12:00:00Z";
49
- var dateStr2 = "2017-04-01T12:00:00Z";
47
+ it('should handle daylight change', function() {
48
+ var dateStr1 = '2017-03-23T12:00:00Z';
49
+ var dateStr2 = '2017-04-01T12:00:00Z';
50
50
  var date1 = new _date.utils.DateTime(dateStr1);
51
51
  var date2 = new _date.utils.DateTime(dateStr2);
52
52
  var compareDate1 = new Date(dateStr1);
@@ -54,28 +54,28 @@ describe("DateTime", function() {
54
54
  expect(date1.getTimezoneOffset() - date2.getTimezoneOffset()).toBe(compareDate1.getTimezoneOffset() - compareDate2.getTimezoneOffset());
55
55
  });
56
56
  });
57
- describe("Date", function() {
58
- it("should support timestamp", function() {
57
+ describe('Date', function() {
58
+ it('should support timestamp', function() {
59
59
  var ts = new Date().getTime();
60
60
  var dateUtils = new _date.utils.Date(ts);
61
61
  expect(dateUtils.getTime()).toEqual(ts);
62
62
  });
63
- it("should support Date Utils", function() {
63
+ it('should support Date Utils', function() {
64
64
  var originalDate = new _date.utils.Date(new Date());
65
65
  expect(new _date.utils.Date(originalDate)).toEqual(originalDate);
66
66
  });
67
- it("should support a copy constructor", function() {
67
+ it('should support a copy constructor', function() {
68
68
  var originalDate = new _date.utils.Date(new Date());
69
69
  expect(new _date.utils.Date(originalDate)).toEqual(originalDate);
70
70
  });
71
- it("should support json conversions", function() {
71
+ it('should support json conversions', function() {
72
72
  var originalDate = new _date.utils.Date(new Date());
73
73
  var jsonDate = JSON.parse(JSON.stringify(originalDate));
74
74
  expect(new _date.utils.Date(jsonDate)).toEqual(originalDate);
75
75
  });
76
- it("should be converted to a Js DateTime", function() {
77
- var date1 = "1988-06-07";
78
- var dateCompare = new _date.utils.DateTime("1988-06-07T00:00:00Z");
76
+ it('should be converted to a Js DateTime', function() {
77
+ var date1 = '1988-06-07';
78
+ var dateCompare = new _date.utils.DateTime('1988-06-07T00:00:00Z');
79
79
  expect(new _date.utils.Date(date1)).toEqual(dateCompare);
80
80
  });
81
81
  });
package/cjs/fwk/errors.js CHANGED
@@ -167,9 +167,9 @@ var GenericError = /*#__PURE__*/ function(Error1) {
167
167
  function GenericError(message, context) {
168
168
  _class_call_check(this, GenericError);
169
169
  var httpRegexp = /^https?:\/\//;
170
- var baseUrl = (context === null || context === void 0 ? void 0 : context.url) ? context.url.replace(httpRegexp, "") : "unknown";
171
- var origin = (context === null || context === void 0 ? void 0 : context.origin) ? context.origin.replace(httpRegexp, "") : "unknown";
172
- return _super.call(this, context ? "[SDK] [apiName: ".concat(context.apiName || "unknown", "] [operationId: ").concat(context.operationId || "unknown", "] [baseUrl: ").concat(baseUrl, "] [origin: ").concat(origin, "] [errorType: SDK] ").concat(message) : "[SDK] ".concat(message));
170
+ var baseUrl = (context === null || context === void 0 ? void 0 : context.url) ? context.url.replace(httpRegexp, '') : 'unknown';
171
+ var origin = (context === null || context === void 0 ? void 0 : context.origin) ? context.origin.replace(httpRegexp, '') : 'unknown';
172
+ return _super.call(this, context ? "[SDK] [apiName: ".concat(context.apiName || 'unknown', "] [operationId: ").concat(context.operationId || 'unknown', "] [baseUrl: ").concat(baseUrl, "] [origin: ").concat(origin, "] [errorType: SDK] ").concat(message) : "[SDK] ".concat(message));
173
173
  }
174
174
  return GenericError;
175
175
  }(_wrap_native_super(Error));
@@ -220,7 +220,7 @@ function _ts_generator(thisArg, body) {
220
220
  if (match && match[1] && match[2]) {
221
221
  // the match looks like this 1ASIUAIRFAC/v2/shopping/carts/19DXNCKB931CYX3S?refresh=true
222
222
  // so we remove the SAP information at the beginning and URL parameters at the end if any
223
- var requestUrl = match[2].substring(match[2].indexOf("/"), match[2].indexOf("?") > -1 ? match[2].indexOf("?") : match[2].length);
223
+ var requestUrl = match[2].substring(match[2].indexOf('/'), match[2].indexOf('?') > -1 ? match[2].indexOf('?') : match[2].length);
224
224
  var method = match[1];
225
225
  var pathObject = (0, _helpers.getPath)(requestUrl, operationAdapter, method);
226
226
  if (pathObject) {
@@ -247,7 +247,7 @@ function _ts_generator(thisArg, body) {
247
247
  * @returns JSON data that can be either the request or the response
248
248
  */ function getData(log) {
249
249
  var match = log.match(requestResponseJsonRegexp);
250
- return match && match[1] || "";
250
+ return match && match[1] || '';
251
251
  }
252
252
  /**
253
253
  * Retrieve path from logPath and parse it to find all the calls.
@@ -327,7 +327,7 @@ function _ts_generator(thisArg, body) {
327
327
  mockMap[alfCall.operationId] = [];
328
328
  }
329
329
  mockMap[alfCall.operationId].push({
330
- mockData: alfCall.response ? JSON.parse(alfCall.response) : ""
330
+ mockData: alfCall.response ? JSON.parse(alfCall.response) : ''
331
331
  });
332
332
  return mockMap;
333
333
  }, {});
@@ -355,7 +355,7 @@ function getAlfMockAdapter(binFilePath, operationAdapter) {
355
355
  ];
356
356
  case 2:
357
357
  content = _state.sent();
358
- if (!(typeof operationAdapter === "function")) return [
358
+ if (!(typeof operationAdapter === 'function')) return [
359
359
  3,
360
360
  4
361
361
  ];
@@ -174,7 +174,7 @@ var BaseMockAdapter = /*#__PURE__*/ function() {
174
174
  _define_property(this, "mockFactory", void 0);
175
175
  this.pathObjects = pathObjects;
176
176
  this.mocks = {};
177
- if (typeof mockMap !== "function") {
177
+ if (typeof mockMap !== 'function') {
178
178
  this.mocks = mockMap;
179
179
  } else {
180
180
  this.mockFactory = mockMap;
@@ -205,7 +205,7 @@ var BaseMockAdapter = /*#__PURE__*/ function() {
205
205
  return _ts_generator(this, function(_state) {
206
206
  switch(_state.label){
207
207
  case 0:
208
- if (!(typeof _this.pathObjects === "function")) return [
208
+ if (!(typeof _this.pathObjects === 'function')) return [
209
209
  3,
210
210
  2
211
211
  ];
@@ -27,7 +27,7 @@ function getOperationId(pathObject, method) {
27
27
  return operation.operationId || "".concat(pathObject.path, "_").concat(lcMethod);
28
28
  }
29
29
  function getPath(requestUrl, pathObjects, method) {
30
- var pathName = new URL(requestUrl, requestUrl.startsWith("/") ? "http://example.com" : undefined).pathname;
30
+ var pathName = new URL(requestUrl, requestUrl.startsWith('/') ? 'http://example.com' : undefined).pathname;
31
31
  if (!pathName) {
32
32
  throw new Error("Couldn't parse url ".concat(requestUrl));
33
33
  }
@@ -36,7 +36,7 @@ function getPath(requestUrl, pathObjects, method) {
36
36
  if (pathObject.regexp.test(pathName)) {
37
37
  newMatches.push({
38
38
  index: index,
39
- segments: pathObject.path.split("/"),
39
+ segments: pathObject.path.split('/'),
40
40
  methods: pathObject.operations.map(function(operation) {
41
41
  return operation.method;
42
42
  })
@@ -49,7 +49,7 @@ function getPath(requestUrl, pathObjects, method) {
49
49
  while(matches.length > 1){
50
50
  matches = matches.reduce(function(newMatches, match) {
51
51
  var newIndex = match.segments.findIndex(function(segment) {
52
- return segment.startsWith("{") && segment.endsWith("}");
52
+ return segment.startsWith('{') && segment.endsWith('}');
53
53
  }, lastIndex + 1);
54
54
  // Complete static match so use some value that can't be exceeded
55
55
  if (newIndex === -1) {
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  var _Reviver = require("./Reviver");
6
- describe("Revivers :", function() {
7
- it("reviveDictionarizedArray", function() {
6
+ describe('Revivers :', function() {
7
+ it('reviveDictionarizedArray', function() {
8
8
  var dictionary = {
9
9
  id1: {
10
- p1: "v1"
10
+ p1: 'v1'
11
11
  },
12
12
  id2: {
13
- p2: "v2"
13
+ p2: 'v2'
14
14
  }
15
15
  };
16
16
  expect((0, _Reviver.reviveDictionarizedArray)(undefined, {}, function(data) {
@@ -20,8 +20,8 @@ describe("Revivers :", function() {
20
20
  return data;
21
21
  })).toEqual({});
22
22
  expect((0, _Reviver.reviveDictionarizedArray)([
23
- "id1",
24
- "id2"
23
+ 'id1',
24
+ 'id2'
25
25
  ], {}, function(data) {
26
26
  return data;
27
27
  })).toEqual({
@@ -32,19 +32,19 @@ describe("Revivers :", function() {
32
32
  return data;
33
33
  })).toEqual({});
34
34
  var result = (0, _Reviver.reviveDictionarizedArray)([
35
- "id1",
36
- "id2"
35
+ 'id1',
36
+ 'id2'
37
37
  ], dictionary, function(data) {
38
38
  return data;
39
39
  });
40
40
  expect(result.id1).toEqual({
41
- p1: "v1"
41
+ p1: 'v1'
42
42
  });
43
43
  expect(result.id2).toEqual({
44
- p2: "v2"
44
+ p2: 'v2'
45
45
  });
46
46
  });
47
- it("should reviveArray propagate the options", function() {
47
+ it('should reviveArray propagate the options', function() {
48
48
  var reviver = jest.fn();
49
49
  var options = {
50
50
  logger: jest.fn()
@@ -54,30 +54,30 @@ describe("Revivers :", function() {
54
54
  ], null, reviver, options);
55
55
  expect(reviver).toHaveBeenCalledWith(1, null, options);
56
56
  });
57
- it("should reviveDictionarizedArray propagate the options", function() {
57
+ it('should reviveDictionarizedArray propagate the options', function() {
58
58
  var reviver = jest.fn();
59
59
  var options = {
60
60
  logger: jest.fn()
61
61
  };
62
62
  var dictionary = {
63
- key: "test"
63
+ key: 'test'
64
64
  };
65
65
  (0, _Reviver.reviveDictionarizedArray)([
66
- "key"
66
+ 'key'
67
67
  ], dictionary, reviver, options);
68
- expect(reviver).toHaveBeenCalledWith("test", dictionary, options);
68
+ expect(reviver).toHaveBeenCalledWith('test', dictionary, options);
69
69
  });
70
- it("should reviveMap propagate the options", function() {
70
+ it('should reviveMap propagate the options', function() {
71
71
  var reviver = jest.fn();
72
72
  var options = {
73
73
  logger: jest.fn()
74
74
  };
75
75
  var dictionary = {
76
- key: "test"
76
+ key: 'test'
77
77
  };
78
78
  (0, _Reviver.reviveMap)([
79
- "key"
79
+ 'key'
80
80
  ], dictionary, reviver, options);
81
- expect(reviver).toHaveBeenCalledWith("key", dictionary, options);
81
+ expect(reviver).toHaveBeenCalledWith('key', dictionary, options);
82
82
  });
83
83
  });
@@ -70,8 +70,8 @@ var AdditionalParamsSyncRequest = /*#__PURE__*/ function() {
70
70
  var _this = this;
71
71
  return {
72
72
  transform: function(data) {
73
- var queryParams = typeof _this.additionalParams.queryParams === "function" ? _this.additionalParams.queryParams(data.queryParams) : _this.additionalParams.queryParams;
74
- var headers = typeof _this.additionalParams.headers === "function" ? _this.additionalParams.headers(data.headers) : _this.additionalParams.headers;
73
+ var queryParams = typeof _this.additionalParams.queryParams === 'function' ? _this.additionalParams.queryParams(data.queryParams) : _this.additionalParams.queryParams;
74
+ var headers = typeof _this.additionalParams.headers === 'function' ? _this.additionalParams.headers(data.headers) : _this.additionalParams.headers;
75
75
  var body = _this.additionalParams.body && (0, _additionalparamsrequest.isStringOrUndefined)(data.body) ? _this.additionalParams.body(data.body) : undefined;
76
76
  if (queryParams) {
77
77
  data.queryParams = _object_spread({}, data.queryParams, queryParams);
@@ -193,7 +193,7 @@ function _ts_generator(thisArg, body) {
193
193
  }
194
194
  function isStringOrUndefined(value) {
195
195
  var type = typeof value === "undefined" ? "undefined" : _type_of(value);
196
- return type === "undefined" || type === "string";
196
+ return type === 'undefined' || type === 'string';
197
197
  }
198
198
  var AdditionalParamsRequest = /*#__PURE__*/ function() {
199
199
  "use strict";
@@ -214,7 +214,7 @@ var AdditionalParamsRequest = /*#__PURE__*/ function() {
214
214
  return _ts_generator(this, function(_state) {
215
215
  switch(_state.label){
216
216
  case 0:
217
- if (!(typeof _this.additionalParams.queryParams === "function")) return [
217
+ if (!(typeof _this.additionalParams.queryParams === 'function')) return [
218
218
  3,
219
219
  2
220
220
  ];
@@ -233,7 +233,7 @@ var AdditionalParamsRequest = /*#__PURE__*/ function() {
233
233
  _state.label = 3;
234
234
  case 3:
235
235
  queryParams = _tmp;
236
- if (!(typeof _this.additionalParams.headers === "function")) return [
236
+ if (!(typeof _this.additionalParams.headers === 'function')) return [
237
237
  3,
238
238
  5
239
239
  ];
@@ -128,33 +128,33 @@ function _ts_generator(thisArg, body) {
128
128
  };
129
129
  }
130
130
  }
131
- describe("Additional Params Request Plugin", function() {
131
+ describe('Additional Params Request Plugin', function() {
132
132
  var additionalGetParams = jest.fn().mockReturnValue({
133
- test: "ok"
133
+ test: 'ok'
134
134
  });
135
- var additionalBody = jest.fn().mockReturnValue("newBody");
135
+ var additionalBody = jest.fn().mockReturnValue('newBody');
136
136
  var defaultGetParams = {
137
- defaultTest: "ok"
137
+ defaultTest: 'ok'
138
138
  };
139
- var defaultBody = "default";
139
+ var defaultBody = 'default';
140
140
  var options;
141
141
  beforeEach(function() {
142
142
  options = {
143
- method: "get",
143
+ method: 'get',
144
144
  queryParams: defaultGetParams,
145
145
  headers: new Headers(),
146
146
  body: defaultBody,
147
- basePath: "http://test.com/truc"
147
+ basePath: 'http://test.com/truc'
148
148
  };
149
149
  });
150
- it("should add a specified query param", /*#__PURE__*/ _async_to_generator(function() {
150
+ it('should add a specified query param', /*#__PURE__*/ _async_to_generator(function() {
151
151
  var plugin, runner, result;
152
152
  return _ts_generator(this, function(_state) {
153
153
  switch(_state.label){
154
154
  case 0:
155
155
  plugin = new _additionalparamsrequest.AdditionalParamsRequest({
156
156
  queryParams: {
157
- test: "ok"
157
+ test: 'ok'
158
158
  }
159
159
  });
160
160
  runner = plugin.load();
@@ -164,14 +164,14 @@ describe("Additional Params Request Plugin", function() {
164
164
  ];
165
165
  case 1:
166
166
  result = _state.sent();
167
- expect(result.queryParams.test).toBe("ok");
167
+ expect(result.queryParams.test).toBe('ok');
168
168
  return [
169
169
  2
170
170
  ];
171
171
  }
172
172
  });
173
173
  }));
174
- it("should add the query params returned by a function", /*#__PURE__*/ _async_to_generator(function() {
174
+ it('should add the query params returned by a function', /*#__PURE__*/ _async_to_generator(function() {
175
175
  var plugin, runner, result;
176
176
  return _ts_generator(this, function(_state) {
177
177
  switch(_state.label){
@@ -187,14 +187,14 @@ describe("Additional Params Request Plugin", function() {
187
187
  case 1:
188
188
  result = _state.sent();
189
189
  expect(additionalGetParams).toHaveBeenCalledWith(defaultGetParams);
190
- expect(result.queryParams.test).toBe("ok");
190
+ expect(result.queryParams.test).toBe('ok');
191
191
  return [
192
192
  2
193
193
  ];
194
194
  }
195
195
  });
196
196
  }));
197
- it("should modify body", /*#__PURE__*/ _async_to_generator(function() {
197
+ it('should modify body', /*#__PURE__*/ _async_to_generator(function() {
198
198
  var plugin, runner, result;
199
199
  return _ts_generator(this, function(_state) {
200
200
  switch(_state.label){
@@ -210,9 +210,9 @@ describe("Additional Params Request Plugin", function() {
210
210
  case 1:
211
211
  result = _state.sent();
212
212
  expect(result.queryParams.test).toBeUndefined();
213
- expect(result.queryParams.defaultTest).toBe("ok");
213
+ expect(result.queryParams.defaultTest).toBe('ok');
214
214
  expect(additionalBody).toHaveBeenCalledWith(defaultBody);
215
- expect(result.body).toBe("newBody");
215
+ expect(result.body).toBe('newBody');
216
216
  return [
217
217
  2
218
218
  ];
@@ -220,53 +220,53 @@ describe("Additional Params Request Plugin", function() {
220
220
  });
221
221
  }));
222
222
  });
223
- describe("Additional Params Request Sync Plugin", function() {
223
+ describe('Additional Params Request Sync Plugin', function() {
224
224
  var additionalGetParams = jest.fn().mockReturnValue({
225
- test: "ok"
225
+ test: 'ok'
226
226
  });
227
- var additionalBody = jest.fn().mockReturnValue("newBody");
227
+ var additionalBody = jest.fn().mockReturnValue('newBody');
228
228
  var defaultGetParams = {
229
- defaultTest: "ok"
229
+ defaultTest: 'ok'
230
230
  };
231
- var defaultBody = "default";
231
+ var defaultBody = 'default';
232
232
  var options;
233
233
  beforeEach(function() {
234
234
  options = {
235
- method: "get",
235
+ method: 'get',
236
236
  queryParams: defaultGetParams,
237
237
  headers: new Headers(),
238
238
  body: defaultBody,
239
- basePath: "http://test.com/truc"
239
+ basePath: 'http://test.com/truc'
240
240
  };
241
241
  });
242
- it("should add a specified query param", function() {
242
+ it('should add a specified query param', function() {
243
243
  var plugin = new _additionalparamssyncrequest.AdditionalParamsSyncRequest({
244
244
  queryParams: {
245
- test: "ok"
245
+ test: 'ok'
246
246
  }
247
247
  });
248
248
  var runner = plugin.load();
249
249
  var result = runner.transform(options);
250
- expect(result.queryParams.test).toBe("ok");
250
+ expect(result.queryParams.test).toBe('ok');
251
251
  });
252
- it("should add the query params returned by a function", function() {
252
+ it('should add the query params returned by a function', function() {
253
253
  var plugin = new _additionalparamssyncrequest.AdditionalParamsSyncRequest({
254
254
  queryParams: additionalGetParams
255
255
  });
256
256
  var runner = plugin.load();
257
257
  var result = runner.transform(options);
258
258
  expect(additionalGetParams).toHaveBeenCalledWith(defaultGetParams);
259
- expect(result.queryParams.test).toBe("ok");
259
+ expect(result.queryParams.test).toBe('ok');
260
260
  });
261
- it("should modify body", function() {
261
+ it('should modify body', function() {
262
262
  var plugin = new _additionalparamssyncrequest.AdditionalParamsSyncRequest({
263
263
  body: additionalBody
264
264
  });
265
265
  var runner = plugin.load();
266
266
  var result = runner.transform(options);
267
267
  expect(result.queryParams.test).toBeUndefined();
268
- expect(result.queryParams.defaultTest).toBe("ok");
268
+ expect(result.queryParams.defaultTest).toBe('ok');
269
269
  expect(additionalBody).toHaveBeenCalledWith(defaultBody);
270
- expect(result.body).toBe("newBody");
270
+ expect(result.body).toBe('newBody');
271
271
  });
272
272
  });
@@ -167,7 +167,7 @@ function _ts_generator(thisArg, body) {
167
167
  var ApiConfigurationOverride = /*#__PURE__*/ function() {
168
168
  "use strict";
169
169
  function ApiConfigurationOverride(jws) {
170
- var headerName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "ama-client-facts";
170
+ var headerName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'ama-client-facts';
171
171
  _class_call_check(this, ApiConfigurationOverride);
172
172
  _define_property(this, "jws", void 0);
173
173
  _define_property(this, "headerName", void 0);
@@ -188,7 +188,7 @@ var ApiConfigurationOverride = /*#__PURE__*/ function() {
188
188
  case 0:
189
189
  return [
190
190
  4,
191
- typeof _this.jws === "function" ? _this.jws() : _this.jws
191
+ typeof _this.jws === 'function' ? _this.jws() : _this.jws
192
192
  ];
193
193
  case 1:
194
194
  jws = _state.sent();
@@ -145,7 +145,7 @@ function _ts_generator(thisArg, body) {
145
145
  };
146
146
  }
147
147
  }
148
- describe("ApiConfigurationOverride Plugin", function() {
148
+ describe('ApiConfigurationOverride Plugin', function() {
149
149
  var options;
150
150
  var FakeHeader = function FakeHeader() {
151
151
  "use strict";
@@ -164,17 +164,17 @@ describe("ApiConfigurationOverride Plugin", function() {
164
164
  };
165
165
  beforeEach(function() {
166
166
  options = {
167
- method: "get",
167
+ method: 'get',
168
168
  headers: new FakeHeader(),
169
- basePath: "http://test.com/api"
169
+ basePath: 'http://test.com/api'
170
170
  };
171
171
  });
172
- it("should add a specified string JWS", /*#__PURE__*/ _async_to_generator(function() {
172
+ it('should add a specified string JWS', /*#__PURE__*/ _async_to_generator(function() {
173
173
  var plugin, runner, result;
174
174
  return _ts_generator(this, function(_state) {
175
175
  switch(_state.label){
176
176
  case 0:
177
- plugin = new _apiconfigurationoverriderequest.ApiConfigurationOverride("fakeJWS");
177
+ plugin = new _apiconfigurationoverriderequest.ApiConfigurationOverride('fakeJWS');
178
178
  runner = plugin.load();
179
179
  return [
180
180
  4,
@@ -182,19 +182,19 @@ describe("ApiConfigurationOverride Plugin", function() {
182
182
  ];
183
183
  case 1:
184
184
  result = _state.sent();
185
- expect(result.headers.get("ama-client-facts")).toBe("fakeJWS");
185
+ expect(result.headers.get('ama-client-facts')).toBe('fakeJWS');
186
186
  return [
187
187
  2
188
188
  ];
189
189
  }
190
190
  });
191
191
  }));
192
- it("should add a specified string JWS with a custom header name", /*#__PURE__*/ _async_to_generator(function() {
192
+ it('should add a specified string JWS with a custom header name', /*#__PURE__*/ _async_to_generator(function() {
193
193
  var plugin, runner, result;
194
194
  return _ts_generator(this, function(_state) {
195
195
  switch(_state.label){
196
196
  case 0:
197
- plugin = new _apiconfigurationoverriderequest.ApiConfigurationOverride("fakeJWS", "my-header");
197
+ plugin = new _apiconfigurationoverriderequest.ApiConfigurationOverride('fakeJWS', 'my-header');
198
198
  runner = plugin.load();
199
199
  return [
200
200
  4,
@@ -202,21 +202,21 @@ describe("ApiConfigurationOverride Plugin", function() {
202
202
  ];
203
203
  case 1:
204
204
  result = _state.sent();
205
- expect(result.headers.get("my-header")).toBe("fakeJWS");
205
+ expect(result.headers.get('my-header')).toBe('fakeJWS');
206
206
  return [
207
207
  2
208
208
  ];
209
209
  }
210
210
  });
211
211
  }));
212
- it("should add a specified dynamic JWS", /*#__PURE__*/ _async_to_generator(function() {
212
+ it('should add a specified dynamic JWS', /*#__PURE__*/ _async_to_generator(function() {
213
213
  var counter, dynamicJws, plugin, runner, result;
214
214
  return _ts_generator(this, function(_state) {
215
215
  switch(_state.label){
216
216
  case 0:
217
217
  counter = 0;
218
218
  dynamicJws = function() {
219
- return Promise.resolve("dynamicJWS" + counter.toString());
219
+ return Promise.resolve('dynamicJWS' + counter.toString());
220
220
  };
221
221
  plugin = new _apiconfigurationoverriderequest.ApiConfigurationOverride(dynamicJws);
222
222
  runner = plugin.load();
@@ -226,7 +226,7 @@ describe("ApiConfigurationOverride Plugin", function() {
226
226
  ];
227
227
  case 1:
228
228
  result = _state.sent();
229
- expect(result.headers.get("ama-client-facts")).toBe("dynamicJWS0");
229
+ expect(result.headers.get('ama-client-facts')).toBe('dynamicJWS0');
230
230
  counter++;
231
231
  runner = plugin.load();
232
232
  return [
@@ -235,7 +235,7 @@ describe("ApiConfigurationOverride Plugin", function() {
235
235
  ];
236
236
  case 2:
237
237
  result = _state.sent();
238
- expect(result.headers.get("ama-client-facts")).toContain("dynamicJWS1");
238
+ expect(result.headers.get('ama-client-facts')).toContain('dynamicJWS1');
239
239
  return [
240
240
  2
241
241
  ];
@@ -167,7 +167,7 @@ function _ts_generator(thisArg, body) {
167
167
  var ApiKeyRequest = /*#__PURE__*/ function() {
168
168
  "use strict";
169
169
  function ApiKeyRequest(apiKey) {
170
- var apiKeyHeader = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "apiKey";
170
+ var apiKeyHeader = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'apiKey';
171
171
  _class_call_check(this, ApiKeyRequest);
172
172
  _define_property(this, "apiKey", void 0);
173
173
  _define_property(this, "apiKeyHeader", void 0);
@@ -186,7 +186,7 @@ var ApiKeyRequest = /*#__PURE__*/ function() {
186
186
  return _ts_generator(this, function(_state) {
187
187
  switch(_state.label){
188
188
  case 0:
189
- if (!(typeof _this.apiKey === "string")) return [
189
+ if (!(typeof _this.apiKey === 'string')) return [
190
190
  3,
191
191
  1
192
192
  ];