@ama-sdk/core 12.1.8 → 12.1.11

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 (111) hide show
  1. package/cjs/clients/api-angular-client.js +13 -18
  2. package/cjs/clients/api-fetch-client.js +16 -21
  3. package/cjs/fwk/api.helpers.js +11 -11
  4. package/cjs/fwk/date.js +5 -5
  5. package/cjs/fwk/errors.js +7 -7
  6. package/cjs/fwk/mocks/alf-mock-adapter.js +58 -60
  7. package/cjs/fwk/mocks/base-mock-adapter.js +15 -19
  8. package/cjs/fwk/mocks/helpers.js +3 -3
  9. package/cjs/fwk/param-serialization.js +6 -6
  10. package/cjs/fwk/reviver.js +4 -4
  11. package/cjs/plugins/abort/abort.spec.js +83 -81
  12. package/cjs/plugins/additional-params/additional-params.request.js +18 -25
  13. package/cjs/plugins/additional-params/additional-params.spec.js +194 -186
  14. package/cjs/plugins/api-configuration-override/api-configuration-override.request.js +10 -17
  15. package/cjs/plugins/api-configuration-override/api-configuration-override.spec.js +83 -81
  16. package/cjs/plugins/api-key/api-key.request.js +12 -19
  17. package/cjs/plugins/api-key/api-key.spec.js +50 -50
  18. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +25 -36
  19. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +343 -327
  20. package/cjs/plugins/client-facts/client-facts.request.js +18 -25
  21. package/cjs/plugins/client-facts/client-facts.spec.js +218 -208
  22. package/cjs/plugins/concurrent/concurrent.fetch.js +12 -20
  23. package/cjs/plugins/concurrent/concurrent.spec.js +99 -99
  24. package/cjs/plugins/custom-info/custom-info.spec.js +90 -90
  25. package/cjs/plugins/fetch-cache/fetch-cache.spec.js +100 -98
  26. package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +60 -60
  27. package/cjs/plugins/json-token/json-token.spec.js +109 -107
  28. package/cjs/plugins/keepalive/keepalive.request.js +7 -12
  29. package/cjs/plugins/keepalive/keepalive.spec.js +32 -34
  30. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.helpers.js +11 -23
  31. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +18 -28
  32. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +212 -204
  33. package/cjs/plugins/mock-intercept/mock-intercept.angular.js +94 -100
  34. package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +15 -22
  35. package/cjs/plugins/mock-intercept/mock-intercept.interface.js +3 -3
  36. package/cjs/plugins/mock-intercept/mock-intercept.request.js +12 -19
  37. package/cjs/plugins/mock-intercept/mock-intercept.spec.js +245 -237
  38. package/cjs/plugins/perf-metric/perf-metric.fetch.js +11 -18
  39. package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +19 -27
  40. package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +404 -386
  41. package/cjs/plugins/raw-response-info/raw-response-info.spec.js +67 -67
  42. package/cjs/plugins/retry/retry.fetch.js +18 -27
  43. package/cjs/plugins/retry/retry.spec.js +233 -225
  44. package/cjs/plugins/reviver/reviver.spec.js +88 -86
  45. package/cjs/plugins/session-id/session-id.spec.js +98 -94
  46. package/cjs/plugins/si-token/si-token.spec.js +27 -29
  47. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +17 -24
  48. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +199 -191
  49. package/cjs/plugins/timeout/timeout.fetch.js +16 -22
  50. package/cjs/plugins/timeout/timeout.spec.js +211 -205
  51. package/cjs/plugins/url-rewrite/url-rewrite.request.js +9 -16
  52. package/cjs/plugins/url-rewrite/url-rewrite.spec.js +48 -48
  53. package/cjs/plugins/wait-for/wait-for.fetch.js +19 -29
  54. package/cjs/plugins/wait-for/wait-for.spec.js +211 -203
  55. package/cjs/utils/crypto.js +15 -27
  56. package/cjs/utils/generic-api.js +9 -14
  57. package/cjs/utils/json-token.js +19 -26
  58. package/cjs/utils/json-token.spec.js +495 -497
  59. package/cjs/utils/mime-types.js +3 -3
  60. package/esm2015/clients/api-angular-client.js +13 -18
  61. package/esm2015/clients/api-fetch-client.js +16 -21
  62. package/esm2015/fwk/mocks/alf-mock-adapter.js +58 -60
  63. package/esm2015/fwk/mocks/base-mock-adapter.js +15 -19
  64. package/esm2015/plugins/abort/abort.spec.js +83 -81
  65. package/esm2015/plugins/additional-params/additional-params.request.js +15 -22
  66. package/esm2015/plugins/additional-params/additional-params.spec.js +194 -186
  67. package/esm2015/plugins/api-configuration-override/api-configuration-override.request.js +10 -17
  68. package/esm2015/plugins/api-configuration-override/api-configuration-override.spec.js +83 -81
  69. package/esm2015/plugins/api-key/api-key.request.js +12 -19
  70. package/esm2015/plugins/api-key/api-key.spec.js +50 -50
  71. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +21 -32
  72. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +343 -327
  73. package/esm2015/plugins/client-facts/client-facts.request.js +15 -22
  74. package/esm2015/plugins/client-facts/client-facts.spec.js +218 -208
  75. package/esm2015/plugins/concurrent/concurrent.fetch.js +12 -20
  76. package/esm2015/plugins/concurrent/concurrent.spec.js +99 -99
  77. package/esm2015/plugins/custom-info/custom-info.spec.js +90 -90
  78. package/esm2015/plugins/fetch-cache/fetch-cache.spec.js +100 -98
  79. package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +60 -60
  80. package/esm2015/plugins/json-token/json-token.spec.js +109 -107
  81. package/esm2015/plugins/keepalive/keepalive.request.js +7 -12
  82. package/esm2015/plugins/keepalive/keepalive.spec.js +32 -34
  83. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.helpers.js +8 -20
  84. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +18 -28
  85. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +212 -204
  86. package/esm2015/plugins/mock-intercept/mock-intercept.angular.js +94 -100
  87. package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +15 -22
  88. package/esm2015/plugins/mock-intercept/mock-intercept.request.js +12 -19
  89. package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +245 -237
  90. package/esm2015/plugins/perf-metric/perf-metric.fetch.js +11 -18
  91. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +15 -23
  92. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +404 -386
  93. package/esm2015/plugins/raw-response-info/raw-response-info.spec.js +67 -67
  94. package/esm2015/plugins/retry/retry.fetch.js +18 -27
  95. package/esm2015/plugins/retry/retry.spec.js +233 -225
  96. package/esm2015/plugins/reviver/reviver.spec.js +88 -86
  97. package/esm2015/plugins/session-id/session-id.spec.js +98 -94
  98. package/esm2015/plugins/si-token/si-token.spec.js +27 -29
  99. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +17 -24
  100. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +199 -191
  101. package/esm2015/plugins/timeout/timeout.fetch.js +13 -19
  102. package/esm2015/plugins/timeout/timeout.spec.js +211 -205
  103. package/esm2015/plugins/url-rewrite/url-rewrite.request.js +9 -16
  104. package/esm2015/plugins/url-rewrite/url-rewrite.spec.js +48 -48
  105. package/esm2015/plugins/wait-for/wait-for.fetch.js +19 -29
  106. package/esm2015/plugins/wait-for/wait-for.spec.js +211 -203
  107. package/esm2015/utils/crypto.js +8 -20
  108. package/esm2015/utils/generic-api.js +9 -14
  109. package/esm2015/utils/json-token.js +10 -17
  110. package/esm2015/utils/json-token.spec.js +495 -497
  111. package/package.json +6 -6
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- PiiTokenizerRequest: function() {
12
+ get PiiTokenizerRequest () {
13
13
  return PiiTokenizerRequest;
14
14
  },
15
- createJwePiiEncoder: function() {
15
+ get createJwePiiEncoder () {
16
16
  return createJwePiiEncoder;
17
17
  },
18
- createJwtPiiEncoder: function() {
18
+ get createJwtPiiEncoder () {
19
19
  return createJwtPiiEncoder;
20
20
  }
21
21
  });
@@ -97,7 +97,7 @@ function _object_spread(target) {
97
97
  return target;
98
98
  }
99
99
  function _ts_generator(thisArg, body) {
100
- var f, y, t, g, _ = {
100
+ var f, y, t, _ = {
101
101
  label: 0,
102
102
  sent: function() {
103
103
  if (t[0] & 1) throw t[1];
@@ -105,12 +105,8 @@ function _ts_generator(thisArg, body) {
105
105
  },
106
106
  trys: [],
107
107
  ops: []
108
- };
109
- return g = {
110
- next: verb(0),
111
- "throw": verb(1),
112
- "return": verb(2)
113
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
108
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
109
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
114
110
  return this;
115
111
  }), g;
116
112
  function verb(n) {
@@ -123,7 +119,7 @@ function _ts_generator(thisArg, body) {
123
119
  }
124
120
  function step(op) {
125
121
  if (f) throw new TypeError("Generator is already executing.");
126
- while(_)try {
122
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
127
123
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
128
124
  if (y = 0, t) op = [
129
125
  op[0] & 2,
@@ -249,7 +245,6 @@ var PiiTokenizerRequest = /*#__PURE__*/ function() {
249
245
  * @param requestOptions Request options to generate the token
250
246
  * @param logger Logger (optional, fallback to console logger if undefined)
251
247
  */ function appendEncodedToken(requestOptions, logger) {
252
- var _this = this;
253
248
  return _async_to_generator(function() {
254
249
  var e;
255
250
  return _ts_generator(this, function(_state) {
@@ -263,7 +258,7 @@ var PiiTokenizerRequest = /*#__PURE__*/ function() {
263
258
  ]);
264
259
  return [
265
260
  4,
266
- _this.tokenEncoder(requestOptions.tokenizedOptions.values)
261
+ this.tokenEncoder(requestOptions.tokenizedOptions.values)
267
262
  ];
268
263
  case 1:
269
264
  return [
@@ -272,7 +267,7 @@ var PiiTokenizerRequest = /*#__PURE__*/ function() {
272
267
  ];
273
268
  case 2:
274
269
  e = _state.sent();
275
- if (_this.silent) {
270
+ if (this.silent) {
276
271
  (logger || console).error('Couldn\'t encode the token', e);
277
272
  } else {
278
273
  throw new Error('Couldn\'t encode the token');
@@ -287,7 +282,7 @@ var PiiTokenizerRequest = /*#__PURE__*/ function() {
287
282
  ];
288
283
  }
289
284
  });
290
- })();
285
+ }).call(this);
291
286
  }
292
287
  },
293
288
  {
@@ -295,8 +290,8 @@ var PiiTokenizerRequest = /*#__PURE__*/ function() {
295
290
  value: /** @inheritdoc */ function load(context) {
296
291
  var _this = this;
297
292
  return {
298
- transform: /*#__PURE__*/ function() {
299
- var _ref = _async_to_generator(function(data) {
293
+ transform: function(data) {
294
+ return _async_to_generator(function() {
300
295
  var _data_metadata, _data_metadata_deepLinkOptions, token, challengeAnswers, token1;
301
296
  return _ts_generator(this, function(_state) {
302
297
  switch(_state.label){
@@ -306,9 +301,9 @@ var PiiTokenizerRequest = /*#__PURE__*/ function() {
306
301
  1
307
302
  ];
308
303
  _data_metadata_deepLinkOptions = data.metadata.deepLinkOptions, token = _data_metadata_deepLinkOptions.token, challengeAnswers = _data_metadata_deepLinkOptions.challengeAnswers;
309
- data.headers.append(_this.tokensHeader, token);
304
+ data.headers.append(this.tokensHeader, token);
310
305
  if (challengeAnswers) {
311
- data.headers.append(_this.challengeHeader, JSON.stringify(challengeAnswers));
306
+ data.headers.append(this.challengeHeader, JSON.stringify(challengeAnswers));
312
307
  }
313
308
  return [
314
309
  3,
@@ -333,12 +328,12 @@ var PiiTokenizerRequest = /*#__PURE__*/ function() {
333
328
  data.queryParams = _object_spread({}, data.queryParams, data.tokenizedOptions.queryParams);
334
329
  return [
335
330
  4,
336
- _this.appendEncodedToken(data, context === null || context === void 0 ? void 0 : context.logger)
331
+ this.appendEncodedToken(data, context === null || context === void 0 ? void 0 : context.logger)
337
332
  ];
338
333
  case 3:
339
334
  token1 = _state.sent();
340
335
  if (token1) {
341
- data.headers.append(_this.tokensHeader, token1);
336
+ data.headers.append(this.tokensHeader, token1);
342
337
  }
343
338
  _state.label = 4;
344
339
  case 4:
@@ -348,11 +343,8 @@ var PiiTokenizerRequest = /*#__PURE__*/ function() {
348
343
  ];
349
344
  }
350
345
  });
351
- });
352
- return function(data) {
353
- return _ref.apply(this, arguments);
354
- };
355
- }()
346
+ }).call(_this);
347
+ }
356
348
  };
357
349
  }
358
350
  }