@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
@@ -18,7 +18,7 @@
18
18
  * @param pathObjects the list of available path objects
19
19
  * @param method the optional HTTP method used in case of several matches
20
20
  */ export function getPath(requestUrl, pathObjects, method) {
21
- var pathName = new URL(requestUrl, requestUrl.startsWith("/") ? "http://example.com" : undefined).pathname;
21
+ var pathName = new URL(requestUrl, requestUrl.startsWith('/') ? 'http://example.com' : undefined).pathname;
22
22
  if (!pathName) {
23
23
  throw new Error("Couldn't parse url ".concat(requestUrl));
24
24
  }
@@ -27,7 +27,7 @@
27
27
  if (pathObject.regexp.test(pathName)) {
28
28
  newMatches.push({
29
29
  index: index,
30
- segments: pathObject.path.split("/"),
30
+ segments: pathObject.path.split('/'),
31
31
  methods: pathObject.operations.map(function(operation) {
32
32
  return operation.method;
33
33
  })
@@ -40,7 +40,7 @@
40
40
  while(matches.length > 1){
41
41
  matches = matches.reduce(function(newMatches, match) {
42
42
  var newIndex = match.segments.findIndex(function(segment) {
43
- return segment.startsWith("{") && segment.endsWith("}");
43
+ return segment.startsWith('{') && segment.endsWith('}');
44
44
  }, lastIndex + 1);
45
45
  // Complete static match so use some value that can't be exceeded
46
46
  if (newIndex === -1) {
@@ -1,10 +1,10 @@
1
- export * from "./alf-mock-adapter";
2
- export * from "./encoded-api-request";
3
- export * from "./mock-adapter";
4
- export * from "./mock";
5
- export * from "./operation";
6
- export * from "./path-object";
7
- export * from "./base-mock-adapter";
8
- export * from "./helpers";
9
- export * from "./random-mock-adapter";
10
- export * from "./sequential-mock-adapter";
1
+ export * from './alf-mock-adapter';
2
+ export * from './encoded-api-request';
3
+ export * from './mock-adapter';
4
+ export * from './mock';
5
+ export * from './operation';
6
+ export * from './path-object';
7
+ export * from './base-mock-adapter';
8
+ export * from './helpers';
9
+ export * from './random-mock-adapter';
10
+ export * from './sequential-mock-adapter';
@@ -96,7 +96,7 @@ function _create_super(Derived) {
96
96
  return _possible_constructor_return(this, result);
97
97
  };
98
98
  }
99
- import { BaseMockAdapter } from "./base-mock-adapter";
99
+ import { BaseMockAdapter } from './base-mock-adapter';
100
100
  /**
101
101
  * Mock adapter that, for each operation, runs through the list of mocks randomly
102
102
  */ export var RandomMockAdapter = /*#__PURE__*/ function(BaseMockAdapter) {
@@ -96,7 +96,7 @@ function _create_super(Derived) {
96
96
  return _possible_constructor_return(this, result);
97
97
  };
98
98
  }
99
- import { BaseMockAdapter } from "./base-mock-adapter";
99
+ import { BaseMockAdapter } from './base-mock-adapter';
100
100
  /**
101
101
  * Mock adapter that, for each operation, runs through the list of mocks sequentially.
102
102
  * Once reaching the end of the list, the counter resets to the beginning.
@@ -1,12 +1,12 @@
1
- import { reviveArray, reviveDictionarizedArray, reviveMap } from "./Reviver";
2
- describe("Revivers :", function() {
3
- it("reviveDictionarizedArray", function() {
1
+ import { reviveArray, reviveDictionarizedArray, reviveMap } from './Reviver';
2
+ describe('Revivers :', function() {
3
+ it('reviveDictionarizedArray', function() {
4
4
  var dictionary = {
5
5
  id1: {
6
- p1: "v1"
6
+ p1: 'v1'
7
7
  },
8
8
  id2: {
9
- p2: "v2"
9
+ p2: 'v2'
10
10
  }
11
11
  };
12
12
  expect(reviveDictionarizedArray(undefined, {}, function(data) {
@@ -16,8 +16,8 @@ describe("Revivers :", function() {
16
16
  return data;
17
17
  })).toEqual({});
18
18
  expect(reviveDictionarizedArray([
19
- "id1",
20
- "id2"
19
+ 'id1',
20
+ 'id2'
21
21
  ], {}, function(data) {
22
22
  return data;
23
23
  })).toEqual({
@@ -28,19 +28,19 @@ describe("Revivers :", function() {
28
28
  return data;
29
29
  })).toEqual({});
30
30
  var result = reviveDictionarizedArray([
31
- "id1",
32
- "id2"
31
+ 'id1',
32
+ 'id2'
33
33
  ], dictionary, function(data) {
34
34
  return data;
35
35
  });
36
36
  expect(result.id1).toEqual({
37
- p1: "v1"
37
+ p1: 'v1'
38
38
  });
39
39
  expect(result.id2).toEqual({
40
- p2: "v2"
40
+ p2: 'v2'
41
41
  });
42
42
  });
43
- it("should reviveArray propagate the options", function() {
43
+ it('should reviveArray propagate the options', function() {
44
44
  var reviver = jest.fn();
45
45
  var options = {
46
46
  logger: jest.fn()
@@ -50,30 +50,30 @@ describe("Revivers :", function() {
50
50
  ], null, reviver, options);
51
51
  expect(reviver).toHaveBeenCalledWith(1, null, options);
52
52
  });
53
- it("should reviveDictionarizedArray propagate the options", function() {
53
+ it('should reviveDictionarizedArray propagate the options', function() {
54
54
  var reviver = jest.fn();
55
55
  var options = {
56
56
  logger: jest.fn()
57
57
  };
58
58
  var dictionary = {
59
- key: "test"
59
+ key: 'test'
60
60
  };
61
61
  reviveDictionarizedArray([
62
- "key"
62
+ 'key'
63
63
  ], dictionary, reviver, options);
64
- expect(reviver).toHaveBeenCalledWith("test", dictionary, options);
64
+ expect(reviver).toHaveBeenCalledWith('test', dictionary, options);
65
65
  });
66
- it("should reviveMap propagate the options", function() {
66
+ it('should reviveMap propagate the options', function() {
67
67
  var reviver = jest.fn();
68
68
  var options = {
69
69
  logger: jest.fn()
70
70
  };
71
71
  var dictionary = {
72
- key: "test"
72
+ key: 'test'
73
73
  };
74
74
  reviveMap([
75
- "key"
75
+ 'key'
76
76
  ], dictionary, reviver, options);
77
- expect(reviver).toHaveBeenCalledWith("key", dictionary, options);
77
+ expect(reviver).toHaveBeenCalledWith('key', dictionary, options);
78
78
  });
79
79
  });
@@ -45,7 +45,7 @@ function _object_spread(target) {
45
45
  }
46
46
  return target;
47
47
  }
48
- import { isStringOrUndefined } from "./additional-params.request";
48
+ import { isStringOrUndefined } from './additional-params.request';
49
49
  /**
50
50
  * Plugin to add (or change) the request parameters
51
51
  */ export var AdditionalParamsSyncRequest = /*#__PURE__*/ function() {
@@ -62,8 +62,8 @@ import { isStringOrUndefined } from "./additional-params.request";
62
62
  var _this = this;
63
63
  return {
64
64
  transform: function(data) {
65
- var queryParams = typeof _this.additionalParams.queryParams === "function" ? _this.additionalParams.queryParams(data.queryParams) : _this.additionalParams.queryParams;
66
- var headers = typeof _this.additionalParams.headers === "function" ? _this.additionalParams.headers(data.headers) : _this.additionalParams.headers;
65
+ var queryParams = typeof _this.additionalParams.queryParams === 'function' ? _this.additionalParams.queryParams(data.queryParams) : _this.additionalParams.queryParams;
66
+ var headers = typeof _this.additionalParams.headers === 'function' ? _this.additionalParams.headers(data.headers) : _this.additionalParams.headers;
67
67
  var body = _this.additionalParams.body && isStringOrUndefined(data.body) ? _this.additionalParams.body(data.body) : undefined;
68
68
  if (queryParams) {
69
69
  data.queryParams = _object_spread({}, data.queryParams, queryParams);
@@ -179,7 +179,7 @@ function _ts_generator(thisArg, body) {
179
179
  * @param value
180
180
  */ export function isStringOrUndefined(value) {
181
181
  var type = typeof value === "undefined" ? "undefined" : _type_of(value);
182
- return type === "undefined" || type === "string";
182
+ return type === 'undefined' || type === 'string';
183
183
  }
184
184
  /**
185
185
  * Plugin to add (or change) the request parameters
@@ -202,7 +202,7 @@ function _ts_generator(thisArg, body) {
202
202
  return _ts_generator(this, function(_state) {
203
203
  switch(_state.label){
204
204
  case 0:
205
- if (!(typeof _this.additionalParams.queryParams === "function")) return [
205
+ if (!(typeof _this.additionalParams.queryParams === 'function')) return [
206
206
  3,
207
207
  2
208
208
  ];
@@ -221,7 +221,7 @@ function _ts_generator(thisArg, body) {
221
221
  _state.label = 3;
222
222
  case 3:
223
223
  queryParams = _tmp;
224
- if (!(typeof _this.additionalParams.headers === "function")) return [
224
+ if (!(typeof _this.additionalParams.headers === 'function')) return [
225
225
  3,
226
226
  5
227
227
  ];
@@ -122,35 +122,35 @@ function _ts_generator(thisArg, body) {
122
122
  };
123
123
  }
124
124
  }
125
- import { AdditionalParamsSyncRequest } from "./additional-params-sync.request";
126
- import { AdditionalParamsRequest } from "./additional-params.request";
127
- describe("Additional Params Request Plugin", function() {
125
+ import { AdditionalParamsSyncRequest } from './additional-params-sync.request';
126
+ import { AdditionalParamsRequest } from './additional-params.request';
127
+ describe('Additional Params Request Plugin', function() {
128
128
  var additionalGetParams = jest.fn().mockReturnValue({
129
- test: "ok"
129
+ test: 'ok'
130
130
  });
131
- var additionalBody = jest.fn().mockReturnValue("newBody");
131
+ var additionalBody = jest.fn().mockReturnValue('newBody');
132
132
  var defaultGetParams = {
133
- defaultTest: "ok"
133
+ defaultTest: 'ok'
134
134
  };
135
- var defaultBody = "default";
135
+ var defaultBody = 'default';
136
136
  var options;
137
137
  beforeEach(function() {
138
138
  options = {
139
- method: "get",
139
+ method: 'get',
140
140
  queryParams: defaultGetParams,
141
141
  headers: new Headers(),
142
142
  body: defaultBody,
143
- basePath: "http://test.com/truc"
143
+ basePath: 'http://test.com/truc'
144
144
  };
145
145
  });
146
- it("should add a specified query param", /*#__PURE__*/ _async_to_generator(function() {
146
+ it('should add a specified query param', /*#__PURE__*/ _async_to_generator(function() {
147
147
  var plugin, runner, result;
148
148
  return _ts_generator(this, function(_state) {
149
149
  switch(_state.label){
150
150
  case 0:
151
151
  plugin = new AdditionalParamsRequest({
152
152
  queryParams: {
153
- test: "ok"
153
+ test: 'ok'
154
154
  }
155
155
  });
156
156
  runner = plugin.load();
@@ -160,14 +160,14 @@ describe("Additional Params Request Plugin", function() {
160
160
  ];
161
161
  case 1:
162
162
  result = _state.sent();
163
- expect(result.queryParams.test).toBe("ok");
163
+ expect(result.queryParams.test).toBe('ok');
164
164
  return [
165
165
  2
166
166
  ];
167
167
  }
168
168
  });
169
169
  }));
170
- it("should add the query params returned by a function", /*#__PURE__*/ _async_to_generator(function() {
170
+ it('should add the query params returned by a function', /*#__PURE__*/ _async_to_generator(function() {
171
171
  var plugin, runner, result;
172
172
  return _ts_generator(this, function(_state) {
173
173
  switch(_state.label){
@@ -183,14 +183,14 @@ describe("Additional Params Request Plugin", function() {
183
183
  case 1:
184
184
  result = _state.sent();
185
185
  expect(additionalGetParams).toHaveBeenCalledWith(defaultGetParams);
186
- expect(result.queryParams.test).toBe("ok");
186
+ expect(result.queryParams.test).toBe('ok');
187
187
  return [
188
188
  2
189
189
  ];
190
190
  }
191
191
  });
192
192
  }));
193
- it("should modify body", /*#__PURE__*/ _async_to_generator(function() {
193
+ it('should modify body', /*#__PURE__*/ _async_to_generator(function() {
194
194
  var plugin, runner, result;
195
195
  return _ts_generator(this, function(_state) {
196
196
  switch(_state.label){
@@ -206,9 +206,9 @@ describe("Additional Params Request Plugin", function() {
206
206
  case 1:
207
207
  result = _state.sent();
208
208
  expect(result.queryParams.test).toBeUndefined();
209
- expect(result.queryParams.defaultTest).toBe("ok");
209
+ expect(result.queryParams.defaultTest).toBe('ok');
210
210
  expect(additionalBody).toHaveBeenCalledWith(defaultBody);
211
- expect(result.body).toBe("newBody");
211
+ expect(result.body).toBe('newBody');
212
212
  return [
213
213
  2
214
214
  ];
@@ -216,53 +216,53 @@ describe("Additional Params Request Plugin", function() {
216
216
  });
217
217
  }));
218
218
  });
219
- describe("Additional Params Request Sync Plugin", function() {
219
+ describe('Additional Params Request Sync Plugin', function() {
220
220
  var additionalGetParams = jest.fn().mockReturnValue({
221
- test: "ok"
221
+ test: 'ok'
222
222
  });
223
- var additionalBody = jest.fn().mockReturnValue("newBody");
223
+ var additionalBody = jest.fn().mockReturnValue('newBody');
224
224
  var defaultGetParams = {
225
- defaultTest: "ok"
225
+ defaultTest: 'ok'
226
226
  };
227
- var defaultBody = "default";
227
+ var defaultBody = 'default';
228
228
  var options;
229
229
  beforeEach(function() {
230
230
  options = {
231
- method: "get",
231
+ method: 'get',
232
232
  queryParams: defaultGetParams,
233
233
  headers: new Headers(),
234
234
  body: defaultBody,
235
- basePath: "http://test.com/truc"
235
+ basePath: 'http://test.com/truc'
236
236
  };
237
237
  });
238
- it("should add a specified query param", function() {
238
+ it('should add a specified query param', function() {
239
239
  var plugin = new AdditionalParamsSyncRequest({
240
240
  queryParams: {
241
- test: "ok"
241
+ test: 'ok'
242
242
  }
243
243
  });
244
244
  var runner = plugin.load();
245
245
  var result = runner.transform(options);
246
- expect(result.queryParams.test).toBe("ok");
246
+ expect(result.queryParams.test).toBe('ok');
247
247
  });
248
- it("should add the query params returned by a function", function() {
248
+ it('should add the query params returned by a function', function() {
249
249
  var plugin = new AdditionalParamsSyncRequest({
250
250
  queryParams: additionalGetParams
251
251
  });
252
252
  var runner = plugin.load();
253
253
  var result = runner.transform(options);
254
254
  expect(additionalGetParams).toHaveBeenCalledWith(defaultGetParams);
255
- expect(result.queryParams.test).toBe("ok");
255
+ expect(result.queryParams.test).toBe('ok');
256
256
  });
257
- it("should modify body", function() {
257
+ it('should modify body', function() {
258
258
  var plugin = new AdditionalParamsSyncRequest({
259
259
  body: additionalBody
260
260
  });
261
261
  var runner = plugin.load();
262
262
  var result = runner.transform(options);
263
263
  expect(result.queryParams.test).toBeUndefined();
264
- expect(result.queryParams.defaultTest).toBe("ok");
264
+ expect(result.queryParams.defaultTest).toBe('ok');
265
265
  expect(additionalBody).toHaveBeenCalledWith(defaultBody);
266
- expect(result.body).toBe("newBody");
266
+ expect(result.body).toBe('newBody');
267
267
  });
268
268
  });
@@ -1,2 +1,2 @@
1
- export * from "./additional-params.request";
2
- export * from "./additional-params-sync.request";
1
+ export * from './additional-params.request';
2
+ export * from './additional-params-sync.request';
@@ -161,7 +161,7 @@ function _ts_generator(thisArg, body) {
161
161
  */ export var ApiConfigurationOverride = /*#__PURE__*/ function() {
162
162
  "use strict";
163
163
  function ApiConfigurationOverride(jws) {
164
- var headerName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "ama-client-facts";
164
+ var headerName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'ama-client-facts';
165
165
  _class_call_check(this, ApiConfigurationOverride);
166
166
  _define_property(this, "jws", void 0);
167
167
  _define_property(this, "headerName", void 0);
@@ -182,7 +182,7 @@ function _ts_generator(thisArg, body) {
182
182
  case 0:
183
183
  return [
184
184
  4,
185
- typeof _this.jws === "function" ? _this.jws() : _this.jws
185
+ typeof _this.jws === 'function' ? _this.jws() : _this.jws
186
186
  ];
187
187
  case 1:
188
188
  jws = _state.sent();
@@ -140,8 +140,8 @@ function _ts_generator(thisArg, body) {
140
140
  };
141
141
  }
142
142
  }
143
- import { ApiConfigurationOverride } from "./api-configuration-override.request";
144
- describe("ApiConfigurationOverride Plugin", function() {
143
+ import { ApiConfigurationOverride } from './api-configuration-override.request';
144
+ describe('ApiConfigurationOverride Plugin', function() {
145
145
  var options;
146
146
  var FakeHeader = function FakeHeader() {
147
147
  "use strict";
@@ -160,17 +160,17 @@ describe("ApiConfigurationOverride Plugin", function() {
160
160
  };
161
161
  beforeEach(function() {
162
162
  options = {
163
- method: "get",
163
+ method: 'get',
164
164
  headers: new FakeHeader(),
165
- basePath: "http://test.com/api"
165
+ basePath: 'http://test.com/api'
166
166
  };
167
167
  });
168
- it("should add a specified string JWS", /*#__PURE__*/ _async_to_generator(function() {
168
+ it('should add a specified string JWS', /*#__PURE__*/ _async_to_generator(function() {
169
169
  var plugin, runner, result;
170
170
  return _ts_generator(this, function(_state) {
171
171
  switch(_state.label){
172
172
  case 0:
173
- plugin = new ApiConfigurationOverride("fakeJWS");
173
+ plugin = new ApiConfigurationOverride('fakeJWS');
174
174
  runner = plugin.load();
175
175
  return [
176
176
  4,
@@ -178,19 +178,19 @@ describe("ApiConfigurationOverride Plugin", function() {
178
178
  ];
179
179
  case 1:
180
180
  result = _state.sent();
181
- expect(result.headers.get("ama-client-facts")).toBe("fakeJWS");
181
+ expect(result.headers.get('ama-client-facts')).toBe('fakeJWS');
182
182
  return [
183
183
  2
184
184
  ];
185
185
  }
186
186
  });
187
187
  }));
188
- it("should add a specified string JWS with a custom header name", /*#__PURE__*/ _async_to_generator(function() {
188
+ it('should add a specified string JWS with a custom header name', /*#__PURE__*/ _async_to_generator(function() {
189
189
  var plugin, runner, result;
190
190
  return _ts_generator(this, function(_state) {
191
191
  switch(_state.label){
192
192
  case 0:
193
- plugin = new ApiConfigurationOverride("fakeJWS", "my-header");
193
+ plugin = new ApiConfigurationOverride('fakeJWS', 'my-header');
194
194
  runner = plugin.load();
195
195
  return [
196
196
  4,
@@ -198,21 +198,21 @@ describe("ApiConfigurationOverride Plugin", function() {
198
198
  ];
199
199
  case 1:
200
200
  result = _state.sent();
201
- expect(result.headers.get("my-header")).toBe("fakeJWS");
201
+ expect(result.headers.get('my-header')).toBe('fakeJWS');
202
202
  return [
203
203
  2
204
204
  ];
205
205
  }
206
206
  });
207
207
  }));
208
- it("should add a specified dynamic JWS", /*#__PURE__*/ _async_to_generator(function() {
208
+ it('should add a specified dynamic JWS', /*#__PURE__*/ _async_to_generator(function() {
209
209
  var counter, dynamicJws, plugin, runner, result;
210
210
  return _ts_generator(this, function(_state) {
211
211
  switch(_state.label){
212
212
  case 0:
213
213
  counter = 0;
214
214
  dynamicJws = function() {
215
- return Promise.resolve("dynamicJWS" + counter.toString());
215
+ return Promise.resolve('dynamicJWS' + counter.toString());
216
216
  };
217
217
  plugin = new ApiConfigurationOverride(dynamicJws);
218
218
  runner = plugin.load();
@@ -222,7 +222,7 @@ describe("ApiConfigurationOverride Plugin", function() {
222
222
  ];
223
223
  case 1:
224
224
  result = _state.sent();
225
- expect(result.headers.get("ama-client-facts")).toBe("dynamicJWS0");
225
+ expect(result.headers.get('ama-client-facts')).toBe('dynamicJWS0');
226
226
  counter++;
227
227
  runner = plugin.load();
228
228
  return [
@@ -231,7 +231,7 @@ describe("ApiConfigurationOverride Plugin", function() {
231
231
  ];
232
232
  case 2:
233
233
  result = _state.sent();
234
- expect(result.headers.get("ama-client-facts")).toContain("dynamicJWS1");
234
+ expect(result.headers.get('ama-client-facts')).toContain('dynamicJWS1');
235
235
  return [
236
236
  2
237
237
  ];
@@ -1 +1 @@
1
- export * from "./api-configuration-override.request";
1
+ export * from './api-configuration-override.request';
@@ -159,7 +159,7 @@ function _ts_generator(thisArg, body) {
159
159
  */ export var ApiKeyRequest = /*#__PURE__*/ function() {
160
160
  "use strict";
161
161
  function ApiKeyRequest(apiKey) {
162
- var apiKeyHeader = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "apiKey";
162
+ var apiKeyHeader = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'apiKey';
163
163
  _class_call_check(this, ApiKeyRequest);
164
164
  _define_property(this, "apiKey", void 0);
165
165
  _define_property(this, "apiKeyHeader", void 0);
@@ -178,7 +178,7 @@ function _ts_generator(thisArg, body) {
178
178
  return _ts_generator(this, function(_state) {
179
179
  switch(_state.label){
180
180
  case 0:
181
- if (!(typeof _this.apiKey === "string")) return [
181
+ if (!(typeof _this.apiKey === 'string')) return [
182
182
  3,
183
183
  1
184
184
  ];
@@ -122,24 +122,24 @@ function _ts_generator(thisArg, body) {
122
122
  };
123
123
  }
124
124
  }
125
- import { ApiKeyRequest } from "./api-key.request";
126
- describe("Api Key Request Plugin", function() {
125
+ import { ApiKeyRequest } from './api-key.request';
126
+ describe('Api Key Request Plugin', function() {
127
127
  var options;
128
128
  beforeEach(function() {
129
129
  var headers = new Headers();
130
- jest.spyOn(headers, "append");
130
+ jest.spyOn(headers, 'append');
131
131
  options = {
132
132
  headers: headers,
133
- basePath: "http://test.com/truc",
134
- method: "get"
133
+ basePath: 'http://test.com/truc',
134
+ method: 'get'
135
135
  };
136
136
  });
137
- it("should add the API Key to the headers", /*#__PURE__*/ _async_to_generator(function() {
137
+ it('should add the API Key to the headers', /*#__PURE__*/ _async_to_generator(function() {
138
138
  var plugin, runner;
139
139
  return _ts_generator(this, function(_state) {
140
140
  switch(_state.label){
141
141
  case 0:
142
- plugin = new ApiKeyRequest("test", "testKey");
142
+ plugin = new ApiKeyRequest('test', 'testKey');
143
143
  runner = plugin.load();
144
144
  return [
145
145
  4,
@@ -147,21 +147,21 @@ describe("Api Key Request Plugin", function() {
147
147
  ];
148
148
  case 1:
149
149
  _state.sent();
150
- expect(options.headers.append).toHaveBeenCalledWith("testKey", "test");
150
+ expect(options.headers.append).toHaveBeenCalledWith('testKey', 'test');
151
151
  return [
152
152
  2
153
153
  ];
154
154
  }
155
155
  });
156
156
  }));
157
- it("should execute the function to add the API Key to the headers", /*#__PURE__*/ _async_to_generator(function() {
157
+ it('should execute the function to add the API Key to the headers', /*#__PURE__*/ _async_to_generator(function() {
158
158
  var plugin, runner;
159
159
  return _ts_generator(this, function(_state) {
160
160
  switch(_state.label){
161
161
  case 0:
162
162
  plugin = new ApiKeyRequest(function() {
163
- return Promise.resolve("test");
164
- }, "testKey");
163
+ return Promise.resolve('test');
164
+ }, 'testKey');
165
165
  runner = plugin.load();
166
166
  return [
167
167
  4,
@@ -169,7 +169,7 @@ describe("Api Key Request Plugin", function() {
169
169
  ];
170
170
  case 1:
171
171
  _state.sent();
172
- expect(options.headers.append).toHaveBeenCalledWith("testKey", "test");
172
+ expect(options.headers.append).toHaveBeenCalledWith('testKey', 'test');
173
173
  return [
174
174
  2
175
175
  ];
@@ -1 +1 @@
1
- export * from "./api-key.request";
1
+ export * from './api-key.request';
@@ -162,8 +162,8 @@ function _ts_generator(thisArg, body) {
162
162
  * @param tokenTimeout How long the ABP script will wait for a new token before rejecting the promise
163
163
  */ export function impervaProtectionRetrieverFactory(protectionTimeout, tokenTimeout) {
164
164
  var protection;
165
- if (typeof window === "undefined") {
166
- throw new Error("impervaProtectionRetrieverFactory should be used in a browser context.");
165
+ if (typeof window === 'undefined') {
166
+ throw new Error('impervaProtectionRetrieverFactory should be used in a browser context.');
167
167
  }
168
168
  var getProtection = function() {
169
169
  return new Promise(function(resolve, reject) {
@@ -229,7 +229,7 @@ function _ts_generator(thisArg, body) {
229
229
  ];
230
230
  case 6:
231
231
  e1 = _state.sent();
232
- (logger || console).error("[SDK][Plug-in][BotProtectionFingerprintRequest] Timeout: no Token was received in time.");
232
+ (logger || console).error('[SDK][Plug-in][BotProtectionFingerprintRequest] Timeout: no Token was received in time.');
233
233
  return [
234
234
  2
235
235
  ];
@@ -250,9 +250,9 @@ function _ts_generator(thisArg, body) {
250
250
  * Will return the telemetry, or undefined if bmak object is not found
251
251
  * @param bmakOpt BMak object from Akamai. Default to `window.bmak` on browser if not provided.
252
252
  */ export function akamaiTelemetryRetrieverFactory(bmakOpt) {
253
- var bmak = bmakOpt || (typeof window !== "undefined" ? window.bmak : undefined);
253
+ var bmak = bmakOpt || (typeof window !== 'undefined' ? window.bmak : undefined);
254
254
  return function() {
255
- if (!bmak || !(typeof bmak.get_telemetry === "function")) {
255
+ if (!bmak || !(typeof bmak.get_telemetry === 'function')) {
256
256
  return;
257
257
  }
258
258
  return bmak.get_telemetry();