@ama-sdk/client-fetch 14.0.0-prerelease.26 → 14.0.0-prerelease.28

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.
@@ -44,7 +44,7 @@ function _type_of(obj) {
44
44
  "@swc/helpers - typeof";
45
45
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
46
46
  }
47
- var isPromise = function(result) {
47
+ var isPromise = function isPromise(result) {
48
48
  if ((typeof result === "undefined" ? "undefined" : _type_of(result)) !== 'object') {
49
49
  return false;
50
50
  }
@@ -63,7 +63,7 @@ var AbortFetch = /*#__PURE__*/ function() {
63
63
  value: /** @inheritDoc */ function load(context) {
64
64
  var _this = this;
65
65
  return {
66
- transform: function(fetchCall) {
66
+ transform: function transform(fetchCall) {
67
67
  var abortCallbackResult = _this.abortCallback();
68
68
  if (isPromise(abortCallbackResult)) {
69
69
  void abortCallbackResult.then(function(res) {
@@ -204,12 +204,12 @@ var ConcurrentFetch = /*#__PURE__*/ function() {
204
204
  var _this = this;
205
205
  this.poolSize++;
206
206
  return {
207
- canStart: function() {
207
+ canStart: function canStart() {
208
208
  return new Promise(function(resolve) {
209
209
  return _this.canStart() ? resolve(true) : _this.waitingResolvers.push(resolve);
210
210
  });
211
211
  },
212
- transform: function(fetchCall) {
212
+ transform: function transform(fetchCall) {
213
213
  return _async_to_generator(function() {
214
214
  var fetchResponse;
215
215
  return _ts_generator(this, function(_state) {
@@ -279,7 +279,7 @@ var KeepaliveRequest = /*#__PURE__*/ function() {
279
279
  value: function load() {
280
280
  var _this = this;
281
281
  return {
282
- transform: function(data) {
282
+ transform: function transform(data) {
283
283
  return _object_spread_props(_object_spread({}, data), {
284
284
  keepalive: _this.active
285
285
  });
@@ -201,7 +201,7 @@ var MockInterceptFetch = /*#__PURE__*/ function() {
201
201
  this.checkMockInterceptFetchPlugin(requestPlugins);
202
202
  }
203
203
  return {
204
- transform: function(fetchCall) {
204
+ transform: function transform(fetchCall) {
205
205
  return _async_to_generator(function() {
206
206
  var _, _1, responsePromise, delay, _tmp, resp, operationId, mock, response;
207
207
  return _ts_generator(this, function(_state) {
@@ -368,7 +368,7 @@ describe('Mock intercept', function() {
368
368
  url: 'myurl',
369
369
  apiClient: {
370
370
  options: {
371
- requestPlugins: function() {
371
+ requestPlugins: function requestPlugins() {
372
372
  return Promise.resolve([]);
373
373
  }
374
374
  }
@@ -451,7 +451,7 @@ describe('Mock intercept', function() {
451
451
  case 0:
452
452
  plugin = new _mockinterceptfetch.MockInterceptFetch({
453
453
  adapter: testMockAdapter,
454
- delayTiming: function() {
454
+ delayTiming: function delayTiming() {
455
455
  return 800;
456
456
  }
457
457
  });
@@ -223,7 +223,7 @@ var PerformanceMetricPlugin = /*#__PURE__*/ function(PerformanceMetricService) {
223
223
  value: /** @inheritDoc */ function load(context) {
224
224
  var _this = this;
225
225
  return {
226
- transform: function(fetchCall) {
226
+ transform: function transform(fetchCall) {
227
227
  return _async_to_generator(function() {
228
228
  var markId, response, exception;
229
229
  return _ts_generator(this, function(_state) {
@@ -276,7 +276,7 @@ var RetryFetch = /*#__PURE__*/ function() {
276
276
  var _this = this;
277
277
  var countDown = this.numberOfRetry;
278
278
  return {
279
- transform: function(fetchCall) {
279
+ transform: function transform(fetchCall) {
280
280
  return _async_to_generator(function() {
281
281
  var result, conditionResult, e, conditionResult1;
282
282
  return _ts_generator(this, function(_state) {
@@ -182,7 +182,7 @@ describe('Retry Fetch Plugin', function() {
182
182
  call = Promise.resolve({
183
183
  text: 'test',
184
184
  ok: false,
185
- clone: function() {
185
+ clone: function clone() {
186
186
  return {};
187
187
  }
188
188
  });
@@ -194,9 +194,9 @@ function _ts_generator(thisArg, body) {
194
194
  */ function isImpervaCaptchaMessage(message) {
195
195
  return !!message && Object.prototype.hasOwnProperty.call(message, 'impervaChallenge') && Object.prototype.hasOwnProperty.call(message.impervaChallenge, 'status') && Object.prototype.hasOwnProperty.call(message.impervaChallenge, 'type') && message.impervaChallenge.type === 'captcha';
196
196
  }
197
- var impervaCaptchaEventHandlerFactory = function(config) {
197
+ var impervaCaptchaEventHandlerFactory = function impervaCaptchaEventHandlerFactory(config) {
198
198
  return function(timeoutPauseCallback) {
199
- var onImpervaCaptcha = function(event) {
199
+ var onImpervaCaptcha = function onImpervaCaptcha(event) {
200
200
  var originHostname = new URL(event.origin).hostname;
201
201
  if (originHostname !== location.hostname && !((config === null || config === void 0 ? void 0 : config.whiteListedHostNames) || []).includes(originHostname)) {
202
202
  return;
@@ -248,7 +248,7 @@ var TimeoutFetch = /*#__PURE__*/ function() {
248
248
  value: function load(context) {
249
249
  var _this = this;
250
250
  return {
251
- transform: function(fetchCall) {
251
+ transform: function transform(fetchCall) {
252
252
  return(// eslint-disable-next-line no-async-promise-executor -- all await are handled with a try-catch block
253
253
  new Promise(function(resolve, reject) {
254
254
  return _async_to_generator(function() {
@@ -257,13 +257,13 @@ var TimeoutFetch = /*#__PURE__*/ function() {
257
257
  switch(_state.label){
258
258
  case 0:
259
259
  _this = this;
260
- timeoutCallback = function() {
260
+ timeoutCallback = function timeoutCallback() {
261
261
  reject(new _core.ResponseTimeoutError("in ".concat(_this.timeout, "ms")));
262
262
  // Fetch abort controller is now supported by all modern browser and node 15+. It should always be defined
263
263
  context.controller.abort();
264
264
  };
265
265
  timer = this.timerPauseState === 'timeoutStopped' ? undefined : setTimeout(timeoutCallback, this.timeout);
266
- timerCallback = function(pauseStatus) {
266
+ timerCallback = function timerCallback(pauseStatus) {
267
267
  if (timer && pauseStatus === 'timeoutStopped') {
268
268
  clearTimeout(timer);
269
269
  (context.logger || console).log('[SDK Plugins] Timeout cancelled.');
@@ -255,8 +255,8 @@ describe('Timeout Fetch Plugin', function() {
255
255
  switch(_state.label){
256
256
  case 0:
257
257
  timeoutPauseEvent = {
258
- emitEvent: function(_status) {},
259
- handler: function(timeoutPauseCallback) {
258
+ emitEvent: function emitEvent(_status) {},
259
+ handler: function handler(timeoutPauseCallback) {
260
260
  timeoutPauseEvent.emitEvent = timeoutPauseCallback;
261
261
  return function() {};
262
262
  }
@@ -303,8 +303,8 @@ describe('Timeout Fetch Plugin', function() {
303
303
  switch(_state.label){
304
304
  case 0:
305
305
  timeoutPauseEvent = {
306
- emitEvent: function(_status) {},
307
- handler: function(timeoutPauseCallback) {
306
+ emitEvent: function emitEvent(_status) {},
307
+ handler: function handler(timeoutPauseCallback) {
308
308
  timeoutPauseEvent.emitEvent = timeoutPauseCallback;
309
309
  return function() {};
310
310
  }
@@ -355,7 +355,7 @@ describe('impervaCaptchaEventHandlerFactory', function() {
355
355
  });
356
356
  (_global1 = global).addEventListener || (_global1.addEventListener = jest.fn().mockImplementation(function(event, handler) {
357
357
  if (event === 'message') {
358
- postMessageTemp = function(msg, origin) {
358
+ postMessageTemp = function postMessageTemp(msg, origin) {
359
359
  var eventObject = {
360
360
  origin: origin || 'https://test',
361
361
  data: msg
@@ -226,7 +226,7 @@ var WaitForFetch = /*#__PURE__*/ function() {
226
226
  var data;
227
227
  return {
228
228
  // eslint-disable-next-line no-async-promise-executor -- all await are handled with a try-catch block
229
- canStart: function() {
229
+ canStart: function canStart() {
230
230
  return new Promise(function(resolve) {
231
231
  return _async_to_generator(function() {
232
232
  var didTimeOut, timer, canStartCondition, canStart, unused;
@@ -293,7 +293,7 @@ var WaitForFetch = /*#__PURE__*/ function() {
293
293
  }).call(_this);
294
294
  });
295
295
  },
296
- transform: function(fetchCall) {
296
+ transform: function transform(fetchCall) {
297
297
  return _async_to_generator(function() {
298
298
  var response, e;
299
299
  return _ts_generator(this, function(_state) {
@@ -34,7 +34,7 @@ function _type_of(obj) {
34
34
  "@swc/helpers - typeof";
35
35
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
36
36
  }
37
- var isPromise = function(result) {
37
+ var isPromise = function isPromise(result) {
38
38
  if ((typeof result === "undefined" ? "undefined" : _type_of(result)) !== 'object') {
39
39
  return false;
40
40
  }
@@ -53,7 +53,7 @@ var isPromise = function(result) {
53
53
  value: /** @inheritDoc */ function load(context) {
54
54
  var _this = this;
55
55
  return {
56
- transform: function(fetchCall) {
56
+ transform: function transform(fetchCall) {
57
57
  var abortCallbackResult = _this.abortCallback();
58
58
  if (isPromise(abortCallbackResult)) {
59
59
  void abortCallbackResult.then(function(res) {
@@ -196,12 +196,12 @@ function _ts_generator(thisArg, body) {
196
196
  var _this = this;
197
197
  this.poolSize++;
198
198
  return {
199
- canStart: function() {
199
+ canStart: function canStart() {
200
200
  return new Promise(function(resolve) {
201
201
  return _this.canStart() ? resolve(true) : _this.waitingResolvers.push(resolve);
202
202
  });
203
203
  },
204
- transform: function(fetchCall) {
204
+ transform: function transform(fetchCall) {
205
205
  return _async_to_generator(function() {
206
206
  var fetchResponse;
207
207
  return _ts_generator(this, function(_state) {
@@ -271,7 +271,7 @@ function _ts_generator(thisArg, body) {
271
271
  value: function load() {
272
272
  var _this = this;
273
273
  return {
274
- transform: function(data) {
274
+ transform: function transform(data) {
275
275
  return _object_spread_props(_object_spread({}, data), {
276
276
  keepalive: _this.active
277
277
  });
@@ -196,7 +196,7 @@ import { CUSTOM_MOCK_OPERATION_ID_HEADER, MockInterceptRequest } from '@ama-sdk/
196
196
  this.checkMockInterceptFetchPlugin(requestPlugins);
197
197
  }
198
198
  return {
199
- transform: function(fetchCall) {
199
+ transform: function transform(fetchCall) {
200
200
  return _async_to_generator(function() {
201
201
  var _, _1, responsePromise, delay, _tmp, resp, operationId, mock, response;
202
202
  return _ts_generator(this, function(_state) {
@@ -364,7 +364,7 @@ describe('Mock intercept', function() {
364
364
  url: 'myurl',
365
365
  apiClient: {
366
366
  options: {
367
- requestPlugins: function() {
367
+ requestPlugins: function requestPlugins() {
368
368
  return Promise.resolve([]);
369
369
  }
370
370
  }
@@ -447,7 +447,7 @@ describe('Mock intercept', function() {
447
447
  case 0:
448
448
  plugin = new MockInterceptFetch({
449
449
  adapter: testMockAdapter,
450
- delayTiming: function() {
450
+ delayTiming: function delayTiming() {
451
451
  return 800;
452
452
  }
453
453
  });
@@ -215,7 +215,7 @@ import { PerformanceMetricService } from '@ama-sdk/core';
215
215
  value: /** @inheritDoc */ function load(context) {
216
216
  var _this = this;
217
217
  return {
218
- transform: function(fetchCall) {
218
+ transform: function transform(fetchCall) {
219
219
  return _async_to_generator(function() {
220
220
  var markId, response, exception;
221
221
  return _ts_generator(this, function(_state) {
@@ -268,7 +268,7 @@ import { CanceledCallError } from '@ama-sdk/core';
268
268
  var _this = this;
269
269
  var countDown = this.numberOfRetry;
270
270
  return {
271
- transform: function(fetchCall) {
271
+ transform: function transform(fetchCall) {
272
272
  return _async_to_generator(function() {
273
273
  var result, conditionResult, e, conditionResult1;
274
274
  return _ts_generator(this, function(_state) {
@@ -178,7 +178,7 @@ describe('Retry Fetch Plugin', function() {
178
178
  call = Promise.resolve({
179
179
  text: 'test',
180
180
  ok: false,
181
- clone: function() {
181
+ clone: function clone() {
182
182
  return {};
183
183
  }
184
184
  });
@@ -181,9 +181,9 @@ import { ResponseTimeoutError } from '@ama-sdk/core';
181
181
  * It can only be used for browser's integrating imperva captcha
182
182
  * @param config list of host names that can trigger a captcha event
183
183
  * @returns removeEventListener
184
- */ export var impervaCaptchaEventHandlerFactory = function(config) {
184
+ */ export var impervaCaptchaEventHandlerFactory = function impervaCaptchaEventHandlerFactory(config) {
185
185
  return function(timeoutPauseCallback) {
186
- var onImpervaCaptcha = function(event) {
186
+ var onImpervaCaptcha = function onImpervaCaptcha(event) {
187
187
  var originHostname = new URL(event.origin).hostname;
188
188
  if (originHostname !== location.hostname && !((config === null || config === void 0 ? void 0 : config.whiteListedHostNames) || []).includes(originHostname)) {
189
189
  return;
@@ -237,7 +237,7 @@ import { ResponseTimeoutError } from '@ama-sdk/core';
237
237
  value: function load(context) {
238
238
  var _this = this;
239
239
  return {
240
- transform: function(fetchCall) {
240
+ transform: function transform(fetchCall) {
241
241
  return(// eslint-disable-next-line no-async-promise-executor -- all await are handled with a try-catch block
242
242
  new Promise(function(resolve, reject) {
243
243
  return _async_to_generator(function() {
@@ -246,13 +246,13 @@ import { ResponseTimeoutError } from '@ama-sdk/core';
246
246
  switch(_state.label){
247
247
  case 0:
248
248
  _this = this;
249
- timeoutCallback = function() {
249
+ timeoutCallback = function timeoutCallback() {
250
250
  reject(new ResponseTimeoutError("in ".concat(_this.timeout, "ms")));
251
251
  // Fetch abort controller is now supported by all modern browser and node 15+. It should always be defined
252
252
  context.controller.abort();
253
253
  };
254
254
  timer = this.timerPauseState === 'timeoutStopped' ? undefined : setTimeout(timeoutCallback, this.timeout);
255
- timerCallback = function(pauseStatus) {
255
+ timerCallback = function timerCallback(pauseStatus) {
256
256
  if (timer && pauseStatus === 'timeoutStopped') {
257
257
  clearTimeout(timer);
258
258
  (context.logger || console).log('[SDK Plugins] Timeout cancelled.');
@@ -251,8 +251,8 @@ describe('Timeout Fetch Plugin', function() {
251
251
  switch(_state.label){
252
252
  case 0:
253
253
  timeoutPauseEvent = {
254
- emitEvent: function(_status) {},
255
- handler: function(timeoutPauseCallback) {
254
+ emitEvent: function emitEvent(_status) {},
255
+ handler: function handler(timeoutPauseCallback) {
256
256
  timeoutPauseEvent.emitEvent = timeoutPauseCallback;
257
257
  return function() {};
258
258
  }
@@ -299,8 +299,8 @@ describe('Timeout Fetch Plugin', function() {
299
299
  switch(_state.label){
300
300
  case 0:
301
301
  timeoutPauseEvent = {
302
- emitEvent: function(_status) {},
303
- handler: function(timeoutPauseCallback) {
302
+ emitEvent: function emitEvent(_status) {},
303
+ handler: function handler(timeoutPauseCallback) {
304
304
  timeoutPauseEvent.emitEvent = timeoutPauseCallback;
305
305
  return function() {};
306
306
  }
@@ -351,7 +351,7 @@ describe('impervaCaptchaEventHandlerFactory', function() {
351
351
  });
352
352
  (_global1 = global).addEventListener || (_global1.addEventListener = jest.fn().mockImplementation(function(event, handler) {
353
353
  if (event === 'message') {
354
- postMessageTemp = function(msg, origin) {
354
+ postMessageTemp = function postMessageTemp(msg, origin) {
355
355
  var eventObject = {
356
356
  origin: origin || 'https://test',
357
357
  data: msg
@@ -255,7 +255,7 @@ function _ts_generator(thisArg, body) {
255
255
  var data;
256
256
  return {
257
257
  // eslint-disable-next-line no-async-promise-executor -- all await are handled with a try-catch block
258
- canStart: function() {
258
+ canStart: function canStart() {
259
259
  return new Promise(function(resolve) {
260
260
  return _async_to_generator(function() {
261
261
  var didTimeOut, timer, canStartCondition, canStart, unused;
@@ -322,7 +322,7 @@ function _ts_generator(thisArg, body) {
322
322
  }).call(_this);
323
323
  });
324
324
  },
325
- transform: function(fetchCall) {
325
+ transform: function transform(fetchCall) {
326
326
  return _async_to_generator(function() {
327
327
  var response, e;
328
328
  return _ts_generator(this, function(_state) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ama-sdk/client-fetch",
3
- "version": "14.0.0-prerelease.26",
3
+ "version": "14.0.0-prerelease.28",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,17 +35,17 @@
35
35
  "build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest"
36
36
  },
37
37
  "dependencies": {
38
- "@o3r/schematics": "~14.0.0-prerelease.26",
38
+ "@o3r/schematics": "~14.0.0-prerelease.28",
39
39
  "@swc/helpers": "~0.5.17",
40
40
  "tslib": "^2.6.2",
41
41
  "uuid": "~13.0.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@ama-sdk/core": "~14.0.0-prerelease.26",
44
+ "@ama-sdk/core": "~14.0.0-prerelease.28",
45
45
  "@angular-devkit/schematics": "^21.0.0",
46
46
  "@angular/cli": "^21.0.0",
47
47
  "@angular/common": "^21.0.0",
48
- "@o3r/schematics": "~14.0.0-prerelease.26",
48
+ "@o3r/schematics": "~14.0.0-prerelease.28",
49
49
  "@schematics/angular": "^21.0.0",
50
50
  "isomorphic-fetch": "^3.0.0",
51
51
  "type-fest": "^5.3.1",
@@ -78,7 +78,7 @@
78
78
  }
79
79
  },
80
80
  "devDependencies": {
81
- "@ama-sdk/core": "~14.0.0-prerelease.26",
81
+ "@ama-sdk/core": "~14.0.0-prerelease.28",
82
82
  "@angular-devkit/core": "~21.0.2",
83
83
  "@angular-devkit/schematics": "~21.0.2",
84
84
  "@angular/common": "~21.0.3",
@@ -86,9 +86,9 @@
86
86
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
87
87
  "@nx/eslint-plugin": "~22.3.3",
88
88
  "@nx/jest": "~22.3.3",
89
- "@o3r/build-helpers": "~14.0.0-prerelease.26",
90
- "@o3r/eslint-plugin": "~14.0.0-prerelease.26",
91
- "@o3r/test-helpers": "~14.0.0-prerelease.26",
89
+ "@o3r/build-helpers": "~14.0.0-prerelease.28",
90
+ "@o3r/eslint-plugin": "~14.0.0-prerelease.28",
91
+ "@o3r/test-helpers": "~14.0.0-prerelease.28",
92
92
  "@schematics/angular": "~21.0.2",
93
93
  "@stylistic/eslint-plugin": "~5.6.0",
94
94
  "@swc/cli": "~0.7.9",