@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
@@ -34,7 +34,7 @@ function _async_to_generator(fn) {
34
34
  };
35
35
  }
36
36
  function _ts_generator(thisArg, body) {
37
- var f, y, t, g, _ = {
37
+ var f, y, t, _ = {
38
38
  label: 0,
39
39
  sent: function() {
40
40
  if (t[0] & 1) throw t[1];
@@ -42,12 +42,8 @@ function _ts_generator(thisArg, body) {
42
42
  },
43
43
  trys: [],
44
44
  ops: []
45
- };
46
- return g = {
47
- next: verb(0),
48
- "throw": verb(1),
49
- "return": verb(2)
50
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
46
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
51
47
  return this;
52
48
  }), g;
53
49
  function verb(n) {
@@ -60,7 +56,7 @@ function _ts_generator(thisArg, body) {
60
56
  }
61
57
  function step(op) {
62
58
  if (f) throw new TypeError("Generator is already executing.");
63
- while(_)try {
59
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
64
60
  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;
65
61
  if (y = 0, t) op = [
66
62
  op[0] & 2,
@@ -151,187 +147,199 @@ describe('Api Key Request Plugin', function() {
151
147
  method: 'get'
152
148
  };
153
149
  });
154
- it('Static API key should be added to the default header.', /*#__PURE__*/ _async_to_generator(function() {
155
- var plugin, runner;
156
- return _ts_generator(this, function(_state) {
157
- switch(_state.label){
158
- case 0:
159
- plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key');
160
- runner = plugin.load();
161
- return [
162
- 4,
163
- runner.transform(options)
164
- ];
165
- case 1:
166
- _state.sent();
167
- expect(options.headers.get('x-api-key')).toBe('key');
168
- return [
169
- 2
170
- ];
171
- }
172
- });
173
- }));
174
- it('Static API key should be added to the specified header.', /*#__PURE__*/ _async_to_generator(function() {
175
- var plugin, runner;
176
- return _ts_generator(this, function(_state) {
177
- switch(_state.label){
178
- case 0:
179
- plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key', {
180
- apiKeyHeader: 'custom-header'
181
- });
182
- runner = plugin.load();
183
- return [
184
- 4,
185
- runner.transform(options)
186
- ];
187
- case 1:
188
- _state.sent();
189
- expect(options.headers.get('custom-header')).toBe('key');
190
- expect(options.headers.get('x-api-key')).toBeNull();
191
- return [
192
- 2
193
- ];
194
- }
195
- });
196
- }));
197
- it('Static OID override should compute the right ama-ctx', /*#__PURE__*/ _async_to_generator(function() {
198
- var plugin, runner, amaCtx;
199
- return _ts_generator(this, function(_state) {
200
- switch(_state.label){
201
- case 0:
202
- plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key', {
203
- officeId: 'TESTOID'
204
- });
205
- runner = plugin.load();
206
- return [
207
- 4,
208
- runner.transform(options)
209
- ];
210
- case 1:
211
- _state.sent();
212
- amaCtx = options.headers.get('ama-ctx');
213
- expect(amaCtx).toBeDefined();
214
- expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
215
- oid: 'TESTOID'
216
- }));
217
- return [
218
- 2
219
- ];
220
- }
221
- });
222
- }));
223
- it('API key and OID as functions that return strings should result in the right headers', /*#__PURE__*/ _async_to_generator(function() {
224
- var plugin, runner, amaCtx;
225
- return _ts_generator(this, function(_state) {
226
- switch(_state.label){
227
- case 0:
228
- plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(returnInSequence('key', 'secondKey'), {
229
- officeId: returnInSequence('TESTOID', 'SECONDOID')
230
- });
231
- runner = plugin.load();
232
- return [
233
- 4,
234
- runner.transform(options)
235
- ];
236
- case 1:
237
- _state.sent();
238
- amaCtx = options.headers.get('ama-ctx');
239
- expect(options.headers.get('x-api-key')).toBe('key');
240
- expect(amaCtx).toBeDefined();
241
- expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
242
- oid: 'TESTOID'
243
- }));
244
- return [
245
- 4,
246
- runner.transform(options)
247
- ];
248
- case 2:
249
- _state.sent();
250
- amaCtx = options.headers.get('ama-ctx');
251
- expect(options.headers.get('x-api-key')).toBe('secondKey');
252
- expect(amaCtx).toBeDefined();
253
- expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
254
- oid: 'SECONDOID'
255
- }));
256
- return [
257
- 2
258
- ];
259
- }
260
- });
261
- }));
262
- it('API key and OID as functions that return promises should result in the right headers', /*#__PURE__*/ _async_to_generator(function() {
263
- var plugin, runner, amaCtx;
264
- return _ts_generator(this, function(_state) {
265
- switch(_state.label){
266
- case 0:
267
- plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(returnInSequence(Promise.resolve('key'), Promise.resolve('secondKey')), {
268
- officeId: returnInSequence(Promise.resolve('TESTOID'), Promise.resolve('SECONDOID'))
269
- });
270
- runner = plugin.load();
271
- return [
272
- 4,
273
- runner.transform(options)
274
- ];
275
- case 1:
276
- _state.sent();
277
- amaCtx = options.headers.get('ama-ctx');
278
- expect(options.headers.get('x-api-key')).toBe('key');
279
- expect(amaCtx).toBeDefined();
280
- expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
281
- oid: 'TESTOID'
282
- }));
283
- return [
284
- 4,
285
- runner.transform(options)
286
- ];
287
- case 2:
288
- _state.sent();
289
- amaCtx = options.headers.get('ama-ctx');
290
- expect(options.headers.get('x-api-key')).toBe('secondKey');
291
- expect(amaCtx).toBeDefined();
292
- expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
293
- oid: 'SECONDOID'
294
- }));
295
- return [
296
- 2
297
- ];
298
- }
299
- });
300
- }));
301
- it('Setting API key and OID using the setters should result in the right headers', /*#__PURE__*/ _async_to_generator(function() {
302
- var plugin, runner, amaCtx;
303
- return _ts_generator(this, function(_state) {
304
- switch(_state.label){
305
- case 0:
306
- plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key');
307
- runner = plugin.load();
308
- return [
309
- 4,
310
- runner.transform(options)
311
- ];
312
- case 1:
313
- _state.sent();
314
- amaCtx = options.headers.get('ama-ctx');
315
- expect(options.headers.get('x-api-key')).toBe('key');
316
- expect(amaCtx).toBeNull();
317
- plugin.setApiKey('secondApiKey');
318
- plugin.setOfficeId('OID');
319
- return [
320
- 4,
321
- runner.transform(options)
322
- ];
323
- case 2:
324
- _state.sent();
325
- amaCtx = options.headers.get('ama-ctx');
326
- expect(options.headers.get('x-api-key')).toBe('secondApiKey');
327
- expect(amaCtx).toBeDefined();
328
- expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
329
- oid: 'OID'
330
- }));
331
- return [
332
- 2
333
- ];
334
- }
335
- });
336
- }));
150
+ it('Static API key should be added to the default header.', function() {
151
+ return _async_to_generator(function() {
152
+ var plugin, runner;
153
+ return _ts_generator(this, function(_state) {
154
+ switch(_state.label){
155
+ case 0:
156
+ plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key');
157
+ runner = plugin.load();
158
+ return [
159
+ 4,
160
+ runner.transform(options)
161
+ ];
162
+ case 1:
163
+ _state.sent();
164
+ expect(options.headers.get('x-api-key')).toBe('key');
165
+ return [
166
+ 2
167
+ ];
168
+ }
169
+ });
170
+ })();
171
+ });
172
+ it('Static API key should be added to the specified header.', function() {
173
+ return _async_to_generator(function() {
174
+ var plugin, runner;
175
+ return _ts_generator(this, function(_state) {
176
+ switch(_state.label){
177
+ case 0:
178
+ plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key', {
179
+ apiKeyHeader: 'custom-header'
180
+ });
181
+ runner = plugin.load();
182
+ return [
183
+ 4,
184
+ runner.transform(options)
185
+ ];
186
+ case 1:
187
+ _state.sent();
188
+ expect(options.headers.get('custom-header')).toBe('key');
189
+ expect(options.headers.get('x-api-key')).toBeNull();
190
+ return [
191
+ 2
192
+ ];
193
+ }
194
+ });
195
+ })();
196
+ });
197
+ it('Static OID override should compute the right ama-ctx', function() {
198
+ return _async_to_generator(function() {
199
+ var plugin, runner, amaCtx;
200
+ return _ts_generator(this, function(_state) {
201
+ switch(_state.label){
202
+ case 0:
203
+ plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key', {
204
+ officeId: 'TESTOID'
205
+ });
206
+ runner = plugin.load();
207
+ return [
208
+ 4,
209
+ runner.transform(options)
210
+ ];
211
+ case 1:
212
+ _state.sent();
213
+ amaCtx = options.headers.get('ama-ctx');
214
+ expect(amaCtx).toBeDefined();
215
+ expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
216
+ oid: 'TESTOID'
217
+ }));
218
+ return [
219
+ 2
220
+ ];
221
+ }
222
+ });
223
+ })();
224
+ });
225
+ it('API key and OID as functions that return strings should result in the right headers', function() {
226
+ return _async_to_generator(function() {
227
+ var plugin, runner, amaCtx;
228
+ return _ts_generator(this, function(_state) {
229
+ switch(_state.label){
230
+ case 0:
231
+ plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(returnInSequence('key', 'secondKey'), {
232
+ officeId: returnInSequence('TESTOID', 'SECONDOID')
233
+ });
234
+ runner = plugin.load();
235
+ return [
236
+ 4,
237
+ runner.transform(options)
238
+ ];
239
+ case 1:
240
+ _state.sent();
241
+ amaCtx = options.headers.get('ama-ctx');
242
+ expect(options.headers.get('x-api-key')).toBe('key');
243
+ expect(amaCtx).toBeDefined();
244
+ expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
245
+ oid: 'TESTOID'
246
+ }));
247
+ return [
248
+ 4,
249
+ runner.transform(options)
250
+ ];
251
+ case 2:
252
+ _state.sent();
253
+ amaCtx = options.headers.get('ama-ctx');
254
+ expect(options.headers.get('x-api-key')).toBe('secondKey');
255
+ expect(amaCtx).toBeDefined();
256
+ expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
257
+ oid: 'SECONDOID'
258
+ }));
259
+ return [
260
+ 2
261
+ ];
262
+ }
263
+ });
264
+ })();
265
+ });
266
+ it('API key and OID as functions that return promises should result in the right headers', function() {
267
+ return _async_to_generator(function() {
268
+ var plugin, runner, amaCtx;
269
+ return _ts_generator(this, function(_state) {
270
+ switch(_state.label){
271
+ case 0:
272
+ plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(returnInSequence(Promise.resolve('key'), Promise.resolve('secondKey')), {
273
+ officeId: returnInSequence(Promise.resolve('TESTOID'), Promise.resolve('SECONDOID'))
274
+ });
275
+ runner = plugin.load();
276
+ return [
277
+ 4,
278
+ runner.transform(options)
279
+ ];
280
+ case 1:
281
+ _state.sent();
282
+ amaCtx = options.headers.get('ama-ctx');
283
+ expect(options.headers.get('x-api-key')).toBe('key');
284
+ expect(amaCtx).toBeDefined();
285
+ expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
286
+ oid: 'TESTOID'
287
+ }));
288
+ return [
289
+ 4,
290
+ runner.transform(options)
291
+ ];
292
+ case 2:
293
+ _state.sent();
294
+ amaCtx = options.headers.get('ama-ctx');
295
+ expect(options.headers.get('x-api-key')).toBe('secondKey');
296
+ expect(amaCtx).toBeDefined();
297
+ expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
298
+ oid: 'SECONDOID'
299
+ }));
300
+ return [
301
+ 2
302
+ ];
303
+ }
304
+ });
305
+ })();
306
+ });
307
+ it('Setting API key and OID using the setters should result in the right headers', function() {
308
+ return _async_to_generator(function() {
309
+ var plugin, runner, amaCtx;
310
+ return _ts_generator(this, function(_state) {
311
+ switch(_state.label){
312
+ case 0:
313
+ plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key');
314
+ runner = plugin.load();
315
+ return [
316
+ 4,
317
+ runner.transform(options)
318
+ ];
319
+ case 1:
320
+ _state.sent();
321
+ amaCtx = options.headers.get('ama-ctx');
322
+ expect(options.headers.get('x-api-key')).toBe('key');
323
+ expect(amaCtx).toBeNull();
324
+ plugin.setApiKey('secondApiKey');
325
+ plugin.setOfficeId('OID');
326
+ return [
327
+ 4,
328
+ runner.transform(options)
329
+ ];
330
+ case 2:
331
+ _state.sent();
332
+ amaCtx = options.headers.get('ama-ctx');
333
+ expect(options.headers.get('x-api-key')).toBe('secondApiKey');
334
+ expect(amaCtx).toBeDefined();
335
+ expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
336
+ oid: 'OID'
337
+ }));
338
+ return [
339
+ 2
340
+ ];
341
+ }
342
+ });
343
+ })();
344
+ });
337
345
  });
@@ -5,14 +5,14 @@ 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
- TimeoutFetch: function() {
12
+ get TimeoutFetch () {
13
13
  return TimeoutFetch;
14
14
  },
15
- impervaCaptchaEventHandlerFactory: function() {
15
+ get impervaCaptchaEventHandlerFactory () {
16
16
  return impervaCaptchaEventHandlerFactory;
17
17
  }
18
18
  });
@@ -90,7 +90,7 @@ function _type_of(obj) {
90
90
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
91
91
  }
92
92
  function _ts_generator(thisArg, body) {
93
- var f, y, t, g, _ = {
93
+ var f, y, t, _ = {
94
94
  label: 0,
95
95
  sent: function() {
96
96
  if (t[0] & 1) throw t[1];
@@ -98,12 +98,8 @@ function _ts_generator(thisArg, body) {
98
98
  },
99
99
  trys: [],
100
100
  ops: []
101
- };
102
- return g = {
103
- next: verb(0),
104
- "throw": verb(1),
105
- "return": verb(2)
106
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
101
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
102
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
107
103
  return this;
108
104
  }), g;
109
105
  function verb(n) {
@@ -116,7 +112,7 @@ function _ts_generator(thisArg, body) {
116
112
  }
117
113
  function step(op) {
118
114
  if (f) throw new TypeError("Generator is already executing.");
119
- while(_)try {
115
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
120
116
  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;
121
117
  if (y = 0, t) op = [
122
118
  op[0] & 2,
@@ -247,19 +243,20 @@ var TimeoutFetch = /*#__PURE__*/ function() {
247
243
  return {
248
244
  transform: function(fetchCall) {
249
245
  return(// eslint-disable-next-line no-async-promise-executor -- all await are handled with a try-catch block
250
- new Promise(/*#__PURE__*/ function() {
251
- var _ref = _async_to_generator(function(resolve, reject) {
252
- var timeoutCallback, timer, timerCallback, _context_controller, response, ex;
246
+ new Promise(function(resolve, reject) {
247
+ return _async_to_generator(function() {
248
+ var _this, timeoutCallback, timer, timerCallback, _context_controller, response, ex;
253
249
  return _ts_generator(this, function(_state) {
254
250
  switch(_state.label){
255
251
  case 0:
252
+ _this = this;
256
253
  timeoutCallback = function() {
257
254
  var // Fetch abort controller is now supported by all modern browser and node 15+. It should always be defined
258
255
  _context_controller;
259
256
  reject(new _errors.ResponseTimeoutError("in ".concat(_this.timeout, "ms")));
260
257
  (_context_controller = context.controller) === null || _context_controller === void 0 ? void 0 : _context_controller.abort();
261
258
  };
262
- timer = _this.timerPauseState === 'timeoutStopped' ? undefined : setTimeout(timeoutCallback, _this.timeout);
259
+ timer = this.timerPauseState === 'timeoutStopped' ? undefined : setTimeout(timeoutCallback, this.timeout);
263
260
  timerCallback = function(pauseStatus) {
264
261
  if (timer && pauseStatus === 'timeoutStopped') {
265
262
  clearTimeout(timer);
@@ -270,7 +267,7 @@ var TimeoutFetch = /*#__PURE__*/ function() {
270
267
  (context.logger || console).log('[SDK Plugins] Timeout restarted.');
271
268
  }
272
269
  };
273
- _this.timerSubscription.push(timerCallback);
270
+ this.timerSubscription.push(timerCallback);
274
271
  _state.label = 1;
275
272
  case 1:
276
273
  _state.trys.push([
@@ -303,7 +300,7 @@ var TimeoutFetch = /*#__PURE__*/ function() {
303
300
  if (timer) {
304
301
  clearTimeout(timer);
305
302
  }
306
- _this.timerSubscription = _this.timerSubscription.filter(function(callback) {
303
+ this.timerSubscription = this.timerSubscription.filter(function(callback) {
307
304
  return timerCallback !== callback;
308
305
  });
309
306
  return [
@@ -315,11 +312,8 @@ var TimeoutFetch = /*#__PURE__*/ function() {
315
312
  ];
316
313
  }
317
314
  });
318
- });
319
- return function(resolve, reject) {
320
- return _ref.apply(this, arguments);
321
- };
322
- }()));
315
+ }).call(_this);
316
+ }));
323
317
  }
324
318
  };
325
319
  }