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