@wopee-io/wopee.wdio 4.7.0 → 5.0.2

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 (131) hide show
  1. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.d.ts +2 -2
  2. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.d.ts.map +1 -1
  3. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.js +18 -20
  4. package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.js.map +1 -1
  5. package/build/desktopBrowser/commands/trackElement.js +2 -2
  6. package/build/desktopBrowser/commands/trackElement.js.map +1 -1
  7. package/build/desktopBrowser/commands/trackScreen.js +2 -2
  8. package/build/desktopBrowser/commands/trackScreen.js.map +1 -1
  9. package/build/desktopBrowser/methods/images.d.ts +1 -1
  10. package/build/desktopBrowser/methods/images.d.ts.map +1 -1
  11. package/build/desktopBrowser/methods/images.interfaces.d.ts +2 -2
  12. package/build/desktopBrowser/methods/images.interfaces.d.ts.map +1 -1
  13. package/build/desktopBrowser/methods/images.interfaces.js.map +1 -1
  14. package/build/desktopBrowser/methods/images.js +5 -5
  15. package/build/desktopBrowser/methods/images.js.map +1 -1
  16. package/build/domain/model/config.interface.d.ts +82 -13
  17. package/build/domain/model/config.interface.d.ts.map +1 -1
  18. package/build/domain/model/config.interface.js +16 -1
  19. package/build/domain/model/config.interface.js.map +1 -1
  20. package/build/domain/model/service.interface.d.ts +3 -3
  21. package/build/domain/model/service.interface.d.ts.map +1 -1
  22. package/build/domain/model/service.interface.js.map +1 -1
  23. package/build/domain/service/configurationService.d.ts +5 -0
  24. package/build/domain/service/configurationService.d.ts.map +1 -0
  25. package/build/domain/service/configurationService.js +65 -0
  26. package/build/domain/service/configurationService.js.map +1 -0
  27. package/build/domain/service/wopeeService.d.ts.map +1 -1
  28. package/build/domain/service/wopeeService.js +2 -2
  29. package/build/domain/service/wopeeService.js.map +1 -1
  30. package/build/utils/versionMetadata.js +2 -2
  31. package/docs/configuration.md +9 -18
  32. package/node_modules/@autonomous-testing/sdk/.github/workflows/ci_cd.yaml +3 -1
  33. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationStepPayload.interface.d.ts +6 -0
  34. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationStepPayload.interface.js +2 -0
  35. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/index.d.ts +9 -13
  36. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/index.js +5 -1
  37. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssert.interface.d.ts +22 -0
  38. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssert.interface.js +18 -0
  39. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssertPayload.interface.d.ts +17 -0
  40. package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssertPayload.interface.js +11 -0
  41. package/node_modules/@autonomous-testing/sdk/build/core/ports/api.d.ts +2 -1
  42. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/adapter.d.ts +2 -1
  43. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/adapter.js +10 -0
  44. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/factories.d.ts +5 -3
  45. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/factories.js +23 -0
  46. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/interface.d.ts +63 -4
  47. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/interface.js +21 -2
  48. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/mutations.d.ts +1 -0
  49. package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/mutations.js +8 -1
  50. package/node_modules/@autonomous-testing/sdk/build/shared/metadata/versionMetadata.js +2 -2
  51. package/node_modules/@autonomous-testing/sdk/package.json +7 -5
  52. package/node_modules/axios/CHANGELOG.md +157 -61
  53. package/node_modules/axios/README.md +271 -80
  54. package/node_modules/axios/SECURITY.md +3 -3
  55. package/node_modules/axios/UPGRADE_GUIDE.md +37 -15
  56. package/node_modules/axios/bin/check-build-version.js +19 -0
  57. package/node_modules/axios/bin/ssl_hotfix.js +22 -0
  58. package/node_modules/axios/dist/axios.js +2014 -2222
  59. package/node_modules/axios/dist/axios.js.map +1 -0
  60. package/node_modules/axios/dist/axios.min.js +2 -3
  61. package/node_modules/axios/dist/axios.min.js.map +1 -0
  62. package/node_modules/axios/dist/esm/axios.js +2379 -0
  63. package/node_modules/axios/dist/esm/axios.js.map +1 -0
  64. package/node_modules/axios/dist/esm/axios.min.js +2 -0
  65. package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  66. package/node_modules/axios/index.d.ts +106 -19
  67. package/node_modules/axios/lib/adapters/http.js +155 -116
  68. package/node_modules/axios/lib/adapters/xhr.js +15 -11
  69. package/node_modules/axios/lib/axios.js +5 -1
  70. package/node_modules/axios/lib/cancel/CancelToken.js +4 -5
  71. package/node_modules/axios/lib/cancel/CanceledError.js +4 -2
  72. package/node_modules/axios/lib/core/Axios.js +18 -2
  73. package/node_modules/axios/lib/core/AxiosError.js +12 -1
  74. package/node_modules/axios/lib/core/InterceptorManager.js +9 -0
  75. package/node_modules/axios/lib/core/buildFullPath.js +5 -2
  76. package/node_modules/axios/lib/core/dispatchRequest.js +7 -0
  77. package/node_modules/axios/lib/core/mergeConfig.js +3 -0
  78. package/node_modules/axios/lib/core/transformData.js +3 -2
  79. package/node_modules/axios/lib/defaults/index.js +42 -13
  80. package/node_modules/axios/lib/env/data.js +1 -1
  81. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +42 -0
  82. package/node_modules/axios/lib/helpers/bind.js +1 -5
  83. package/node_modules/axios/lib/helpers/buildURL.js +18 -33
  84. package/node_modules/axios/lib/helpers/combineURLs.js +1 -1
  85. package/node_modules/axios/lib/helpers/formDataToJSON.js +74 -0
  86. package/node_modules/axios/lib/helpers/fromDataURI.js +51 -0
  87. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +12 -12
  88. package/node_modules/axios/lib/helpers/parseHeaders.js +2 -2
  89. package/node_modules/axios/lib/helpers/toFormData.js +141 -34
  90. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
  91. package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  92. package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
  93. package/node_modules/axios/lib/platform/browser/index.js +11 -0
  94. package/node_modules/axios/lib/platform/index.js +3 -0
  95. package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  96. package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +5 -0
  97. package/node_modules/axios/lib/platform/node/index.js +11 -0
  98. package/node_modules/axios/lib/utils.js +68 -16
  99. package/node_modules/axios/package.json +20 -7
  100. package/node_modules/axios/rollup.config.js +60 -0
  101. package/node_modules/proxy-from-env/.eslintrc +29 -0
  102. package/node_modules/proxy-from-env/.travis.yml +10 -0
  103. package/node_modules/proxy-from-env/LICENSE +20 -0
  104. package/node_modules/proxy-from-env/README.md +131 -0
  105. package/node_modules/proxy-from-env/index.js +108 -0
  106. package/node_modules/proxy-from-env/package.json +34 -0
  107. package/node_modules/proxy-from-env/test.js +483 -0
  108. package/package.json +4 -4
  109. package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.d.ts +0 -10
  110. package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.d.ts.map +0 -1
  111. package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.d.ts +0 -28
  112. package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.d.ts.map +0 -1
  113. package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.js +0 -12
  114. package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.js.map +0 -1
  115. package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.js +0 -57
  116. package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.js.map +0 -1
  117. package/build/domain/model/croppingOptions.interface.d.ts +0 -8
  118. package/build/domain/model/croppingOptions.interface.d.ts.map +0 -1
  119. package/build/domain/model/croppingOptions.interface.js +0 -12
  120. package/build/domain/model/croppingOptions.interface.js.map +0 -1
  121. package/build/port/driven/configDrivingPort/configDrivingPort.d.ts +0 -9
  122. package/build/port/driven/configDrivingPort/configDrivingPort.d.ts.map +0 -1
  123. package/build/port/driven/configDrivingPort/configDrivingPort.js +0 -15
  124. package/build/port/driven/configDrivingPort/configDrivingPort.js.map +0 -1
  125. package/build/port/driven/configDrivingPort/configDrivingPortDefaults.d.ts +0 -6
  126. package/build/port/driven/configDrivingPort/configDrivingPortDefaults.d.ts.map +0 -1
  127. package/build/port/driven/configDrivingPort/configDrivingPortDefaults.js +0 -36
  128. package/build/port/driven/configDrivingPort/configDrivingPortDefaults.js.map +0 -1
  129. package/node_modules/axios/dist/axios.map +0 -1
  130. package/node_modules/axios/dist/axios.min.map +0 -1
  131. /package/node_modules/axios/lib/{defaults/env → env/classes}/FormData.js +0 -0
@@ -1,19 +1,79 @@
1
1
  'use strict';
2
2
 
3
3
  var utils = require('../utils');
4
+ var AxiosError = require('../core/AxiosError');
5
+ var envFormData = require('../env/classes/FormData');
6
+
7
+ function isVisitable(thing) {
8
+ return utils.isPlainObject(thing) || utils.isArray(thing);
9
+ }
10
+
11
+ function removeBrackets(key) {
12
+ return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
13
+ }
14
+
15
+ function renderKey(path, key, dots) {
16
+ if (!path) return key;
17
+ return path.concat(key).map(function each(token, i) {
18
+ // eslint-disable-next-line no-param-reassign
19
+ token = removeBrackets(token);
20
+ return !dots && i ? '[' + token + ']' : token;
21
+ }).join(dots ? '.' : '');
22
+ }
23
+
24
+ function isFlatArray(arr) {
25
+ return utils.isArray(arr) && !arr.some(isVisitable);
26
+ }
27
+
28
+ var predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
29
+ return /^is[A-Z]/.test(prop);
30
+ });
31
+
32
+ function isSpecCompliant(thing) {
33
+ return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];
34
+ }
4
35
 
5
36
  /**
6
37
  * Convert a data object to FormData
7
38
  * @param {Object} obj
8
39
  * @param {?Object} [formData]
40
+ * @param {?Object} [options]
41
+ * @param {Function} [options.visitor]
42
+ * @param {Boolean} [options.metaTokens = true]
43
+ * @param {Boolean} [options.dots = false]
44
+ * @param {?Boolean} [options.indexes = false]
9
45
  * @returns {Object}
10
46
  **/
11
47
 
12
- function toFormData(obj, formData) {
48
+ function toFormData(obj, formData, options) {
49
+ if (!utils.isObject(obj)) {
50
+ throw new TypeError('target must be an object');
51
+ }
52
+
13
53
  // eslint-disable-next-line no-param-reassign
14
- formData = formData || new FormData();
54
+ formData = formData || new (envFormData || FormData)();
15
55
 
16
- var stack = [];
56
+ // eslint-disable-next-line no-param-reassign
57
+ options = utils.toFlatObject(options, {
58
+ metaTokens: true,
59
+ dots: false,
60
+ indexes: false
61
+ }, false, function defined(option, source) {
62
+ // eslint-disable-next-line no-eq-null,eqeqeq
63
+ return !utils.isUndefined(source[option]);
64
+ });
65
+
66
+ var metaTokens = options.metaTokens;
67
+ // eslint-disable-next-line no-use-before-define
68
+ var visitor = options.visitor || defaultVisitor;
69
+ var dots = options.dots;
70
+ var indexes = options.indexes;
71
+ var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
72
+ var useBlob = _Blob && isSpecCompliant(formData);
73
+
74
+ if (!utils.isFunction(visitor)) {
75
+ throw new TypeError('visitor must be a function');
76
+ }
17
77
 
18
78
  function convertValue(value) {
19
79
  if (value === null) return '';
@@ -22,46 +82,93 @@ function toFormData(obj, formData) {
22
82
  return value.toISOString();
23
83
  }
24
84
 
85
+ if (!useBlob && utils.isBlob(value)) {
86
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
87
+ }
88
+
25
89
  if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
26
- return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
90
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
27
91
  }
28
92
 
29
93
  return value;
30
94
  }
31
95
 
32
- function build(data, parentKey) {
33
- if (utils.isPlainObject(data) || utils.isArray(data)) {
34
- if (stack.indexOf(data) !== -1) {
35
- throw Error('Circular reference detected in ' + parentKey);
96
+ /**
97
+ *
98
+ * @param {*} value
99
+ * @param {String|Number} key
100
+ * @param {Array<String|Number>} path
101
+ * @this {FormData}
102
+ * @returns {boolean} return true to visit the each prop of the value recursively
103
+ */
104
+ function defaultVisitor(value, key, path) {
105
+ var arr = value;
106
+
107
+ if (value && !path && typeof value === 'object') {
108
+ if (utils.endsWith(key, '{}')) {
109
+ // eslint-disable-next-line no-param-reassign
110
+ key = metaTokens ? key : key.slice(0, -2);
111
+ // eslint-disable-next-line no-param-reassign
112
+ value = JSON.stringify(value);
113
+ } else if (
114
+ (utils.isArray(value) && isFlatArray(value)) ||
115
+ (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))
116
+ )) {
117
+ // eslint-disable-next-line no-param-reassign
118
+ key = removeBrackets(key);
119
+
120
+ arr.forEach(function each(el, index) {
121
+ !(utils.isUndefined(el) || el === null) && formData.append(
122
+ // eslint-disable-next-line no-nested-ternary
123
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
124
+ convertValue(el)
125
+ );
126
+ });
127
+ return false;
36
128
  }
129
+ }
37
130
 
38
- stack.push(data);
39
-
40
- utils.forEach(data, function each(value, key) {
41
- if (utils.isUndefined(value)) return;
42
- var fullKey = parentKey ? parentKey + '.' + key : key;
43
- var arr;
44
-
45
- if (value && !parentKey && typeof value === 'object') {
46
- if (utils.endsWith(key, '{}')) {
47
- // eslint-disable-next-line no-param-reassign
48
- value = JSON.stringify(value);
49
- } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
50
- // eslint-disable-next-line func-names
51
- arr.forEach(function(el) {
52
- !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
53
- });
54
- return;
55
- }
56
- }
57
-
58
- build(value, fullKey);
59
- });
60
-
61
- stack.pop();
62
- } else {
63
- formData.append(parentKey, convertValue(data));
131
+ if (isVisitable(value)) {
132
+ return true;
64
133
  }
134
+
135
+ formData.append(renderKey(path, key, dots), convertValue(value));
136
+
137
+ return false;
138
+ }
139
+
140
+ var stack = [];
141
+
142
+ var exposedHelpers = Object.assign(predicates, {
143
+ defaultVisitor: defaultVisitor,
144
+ convertValue: convertValue,
145
+ isVisitable: isVisitable
146
+ });
147
+
148
+ function build(value, path) {
149
+ if (utils.isUndefined(value)) return;
150
+
151
+ if (stack.indexOf(value) !== -1) {
152
+ throw Error('Circular reference detected in ' + path.join('.'));
153
+ }
154
+
155
+ stack.push(value);
156
+
157
+ utils.forEach(value, function each(el, key) {
158
+ var result = !(utils.isUndefined(el) || el === null) && visitor.call(
159
+ formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
160
+ );
161
+
162
+ if (result === true) {
163
+ build(el, path ? path.concat(key) : [key]);
164
+ }
165
+ });
166
+
167
+ stack.pop();
168
+ }
169
+
170
+ if (!utils.isObject(obj)) {
171
+ throw new TypeError('data must be an object');
65
172
  }
66
173
 
67
174
  build(obj);
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var utils = require('../utils');
4
+ var toFormData = require('./toFormData');
5
+ var platform = require('../platform/');
6
+
7
+ module.exports = function toURLEncodedForm(data, options) {
8
+ return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
9
+ visitor: function(value, key, path, helpers) {
10
+ if (platform.isNode && utils.isBuffer(value)) {
11
+ this.append(key, value.toString('base64'));
12
+ return false;
13
+ }
14
+
15
+ return helpers.defaultVisitor.apply(this, arguments);
16
+ }
17
+ }, options));
18
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = FormData;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var AxiosURLSearchParams = require('../../../helpers/AxiosURLSearchParams');
4
+
5
+ module.exports = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ isBrowser: true,
5
+ classes: {
6
+ URLSearchParams: require('./classes/URLSearchParams'),
7
+ FormData: require('./classes/FormData'),
8
+ Blob: Blob
9
+ },
10
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
11
+ };
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('./node/');
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('form-data');
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var url = require('url');
4
+
5
+ module.exports = url.URLSearchParams;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ isNode: true,
5
+ classes: {
6
+ URLSearchParams: require('./classes/URLSearchParams'),
7
+ FormData: require('./classes/FormData'),
8
+ Blob: typeof Blob !== 'undefined' && Blob || null
9
+ },
10
+ protocols: [ 'http', 'https', 'file', 'data' ]
11
+ };
@@ -124,6 +124,16 @@ function isPlainObject(val) {
124
124
  return prototype === null || prototype === Object.prototype;
125
125
  }
126
126
 
127
+ /**
128
+ * Determine if a value is a empty Object
129
+ *
130
+ * @param {Object} val The value to test
131
+ * @return {boolean} True if value is a empty Object, otherwise false
132
+ */
133
+ function isEmptyObject(val) {
134
+ return val && Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
135
+ }
136
+
127
137
  /**
128
138
  * Determine if a value is a Date
129
139
  *
@@ -210,7 +220,7 @@ var isURLSearchParams = kindOfTest('URLSearchParams');
210
220
  * @returns {String} The String freed of excess whitespace
211
221
  */
212
222
  function trim(str) {
213
- return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
223
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
214
224
  }
215
225
 
216
226
  /**
@@ -229,15 +239,16 @@ function trim(str) {
229
239
  * navigator.product -> 'NativeScript' or 'NS'
230
240
  */
231
241
  function isStandardBrowserEnv() {
232
- if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
233
- navigator.product === 'NativeScript' ||
234
- navigator.product === 'NS')) {
242
+ var product;
243
+ if (typeof navigator !== 'undefined' && (
244
+ (product = navigator.product) === 'ReactNative' ||
245
+ product === 'NativeScript' ||
246
+ product === 'NS')
247
+ ) {
235
248
  return false;
236
249
  }
237
- return (
238
- typeof window !== 'undefined' &&
239
- typeof document !== 'undefined'
240
- );
250
+
251
+ return typeof window !== 'undefined' && typeof document !== 'undefined';
241
252
  }
242
253
 
243
254
  /**
@@ -366,29 +377,32 @@ function inherits(constructor, superConstructor, props, descriptors) {
366
377
  * Resolve object with deep prototype chain to a flat object
367
378
  * @param {Object} sourceObj source object
368
379
  * @param {Object} [destObj]
369
- * @param {Function} [filter]
380
+ * @param {Function|Boolean} [filter]
381
+ * @param {Function} [propFilter]
370
382
  * @returns {Object}
371
383
  */
372
384
 
373
- function toFlatObject(sourceObj, destObj, filter) {
385
+ function toFlatObject(sourceObj, destObj, filter, propFilter) {
374
386
  var props;
375
387
  var i;
376
388
  var prop;
377
389
  var merged = {};
378
390
 
379
391
  destObj = destObj || {};
392
+ // eslint-disable-next-line no-eq-null,eqeqeq
393
+ if (sourceObj == null) return destObj;
380
394
 
381
395
  do {
382
396
  props = Object.getOwnPropertyNames(sourceObj);
383
397
  i = props.length;
384
398
  while (i-- > 0) {
385
399
  prop = props[i];
386
- if (!merged[prop]) {
400
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
387
401
  destObj[prop] = sourceObj[prop];
388
402
  merged[prop] = true;
389
403
  }
390
404
  }
391
- sourceObj = Object.getPrototypeOf(sourceObj);
405
+ sourceObj = filter !== false && Object.getPrototypeOf(sourceObj);
392
406
  } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
393
407
 
394
408
  return destObj;
@@ -413,14 +427,15 @@ function endsWith(str, searchString, position) {
413
427
 
414
428
 
415
429
  /**
416
- * Returns new array from array like object
430
+ * Returns new array from array like object or null if failed
417
431
  * @param {*} [thing]
418
- * @returns {Array}
432
+ * @returns {?Array}
419
433
  */
420
434
  function toArray(thing) {
421
435
  if (!thing) return null;
436
+ if (isArray(thing)) return thing;
422
437
  var i = thing.length;
423
- if (isUndefined(i)) return null;
438
+ if (!isNumber(i)) return null;
424
439
  var arr = new Array(i);
425
440
  while (i-- > 0) {
426
441
  arr[i] = thing[i];
@@ -436,6 +451,38 @@ var isTypedArray = (function(TypedArray) {
436
451
  };
437
452
  })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
438
453
 
454
+ function forEachEntry(obj, fn) {
455
+ var generator = obj && obj[Symbol.iterator];
456
+
457
+ var iterator = generator.call(obj);
458
+
459
+ var result;
460
+
461
+ while ((result = iterator.next()) && !result.done) {
462
+ var pair = result.value;
463
+ fn.call(obj, pair[0], pair[1]);
464
+ }
465
+ }
466
+
467
+ function matchAll(regExp, str) {
468
+ var matches;
469
+ var arr = [];
470
+
471
+ while ((matches = regExp.exec(str)) !== null) {
472
+ arr.push(matches);
473
+ }
474
+
475
+ return arr;
476
+ }
477
+
478
+ var isHTMLForm = kindOfTest('HTMLFormElement');
479
+
480
+ var hasOwnProperty = (function resolver(_hasOwnProperty) {
481
+ return function(obj, prop) {
482
+ return _hasOwnProperty.call(obj, prop);
483
+ };
484
+ })(Object.prototype.hasOwnProperty);
485
+
439
486
  module.exports = {
440
487
  isArray: isArray,
441
488
  isArrayBuffer: isArrayBuffer,
@@ -446,6 +493,7 @@ module.exports = {
446
493
  isNumber: isNumber,
447
494
  isObject: isObject,
448
495
  isPlainObject: isPlainObject,
496
+ isEmptyObject: isEmptyObject,
449
497
  isUndefined: isUndefined,
450
498
  isDate: isDate,
451
499
  isFile: isFile,
@@ -466,5 +514,9 @@ module.exports = {
466
514
  endsWith: endsWith,
467
515
  toArray: toArray,
468
516
  isTypedArray: isTypedArray,
469
- isFileList: isFileList
517
+ isFileList: isFileList,
518
+ forEachEntry: forEachEntry,
519
+ matchAll: matchAll,
520
+ isHTMLForm: isHTMLForm,
521
+ hasOwnProperty: hasOwnProperty
470
522
  };
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "0.27.2",
3
+ "version": "0.30.0",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
8
- "test": "grunt test && dtslint",
8
+ "test": "node bin/ssl_hotfix.js grunt test && node bin/ssl_hotfix.js dtslint --localTs node_modules/typescript/lib",
9
9
  "start": "node ./sandbox/server.js",
10
10
  "preversion": "grunt version && npm test",
11
- "build": "NODE_ENV=production grunt build",
11
+ "build": "cross-env NODE_ENV=production grunt build",
12
12
  "examples": "node ./examples/server.js",
13
13
  "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
14
14
  "fix": "eslint --fix lib/**/*.js"
@@ -31,10 +31,18 @@
31
31
  },
32
32
  "homepage": "https://axios-http.com",
33
33
  "devDependencies": {
34
+ "@rollup/plugin-babel": "^5.3.0",
35
+ "@rollup/plugin-commonjs": "^15.1.0",
36
+ "@rollup/plugin-json": "^4.1.0",
37
+ "@rollup/plugin-multi-entry": "^4.0.0",
38
+ "@rollup/plugin-node-resolve": "^9.0.0",
34
39
  "abortcontroller-polyfill": "^1.7.3",
40
+ "body-parser": "^1.20.0",
35
41
  "coveralls": "^3.1.1",
42
+ "cross-env": "^7.0.3",
36
43
  "dtslint": "^4.2.1",
37
44
  "es6-promise": "^4.2.8",
45
+ "express": "^4.18.1",
38
46
  "formidable": "^2.0.1",
39
47
  "grunt": "^1.4.1",
40
48
  "grunt-banner": "^0.6.0",
@@ -44,6 +52,7 @@
44
52
  "grunt-eslint": "^24.0.0",
45
53
  "grunt-karma": "^4.0.2",
46
54
  "grunt-mocha-test": "^0.13.3",
55
+ "grunt-shell": "^3.0.1",
47
56
  "grunt-webpack": "^5.0.0",
48
57
  "istanbul-instrumenter-loader": "^3.0.1",
49
58
  "jasmine-core": "^2.4.1",
@@ -60,6 +69,9 @@
60
69
  "load-grunt-tasks": "^5.1.0",
61
70
  "minimist": "^1.2.6",
62
71
  "mocha": "^8.2.1",
72
+ "multer": "^1.4.4",
73
+ "rollup": "^2.67.0",
74
+ "rollup-plugin-terser": "^7.0.2",
63
75
  "sinon": "^4.5.0",
64
76
  "terser-webpack-plugin": "^4.2.3",
65
77
  "typescript": "^4.6.3",
@@ -69,14 +81,15 @@
69
81
  },
70
82
  "browser": {
71
83
  "./lib/adapters/http.js": "./lib/adapters/xhr.js",
72
- "./lib/defaults/env/FormData.js": "./lib/helpers/null.js"
84
+ "./lib/platform/node/index.js": "./lib/platform/browser/index.js"
73
85
  },
74
86
  "jsdelivr": "dist/axios.min.js",
75
87
  "unpkg": "dist/axios.min.js",
76
88
  "typings": "./index.d.ts",
77
89
  "dependencies": {
78
- "follow-redirects": "^1.14.9",
79
- "form-data": "^4.0.0"
90
+ "follow-redirects": "^1.15.4",
91
+ "form-data": "^4.0.0",
92
+ "proxy-from-env": "^1.1.0"
80
93
  },
81
94
  "bundlesize": [
82
95
  {
@@ -84,4 +97,4 @@
84
97
  "threshold": "5kB"
85
98
  }
86
99
  ]
87
- }
100
+ }
@@ -0,0 +1,60 @@
1
+ import resolve from '@rollup/plugin-node-resolve';
2
+ import commonjs from '@rollup/plugin-commonjs';
3
+ import {terser} from "rollup-plugin-terser";
4
+ import json from '@rollup/plugin-json';
5
+
6
+ const lib = require("./package.json");
7
+ const outputFileName = 'axios';
8
+ const name = "axios";
9
+ const input = './lib/axios.js';
10
+
11
+ const buildConfig = (config) => {
12
+
13
+ const build = ({minified}) => ({
14
+ input,
15
+ ...config,
16
+ output: {
17
+ ...config.output,
18
+ file: `${config.output.file}.${minified ? "min.js" : "js"}`
19
+ },
20
+ plugins: [
21
+ json(),
22
+ resolve({browser: true}),
23
+ commonjs(),
24
+ minified && terser(),
25
+ ...(config.plugins || []),
26
+ ]
27
+ });
28
+
29
+ return [
30
+ build({minified: false}),
31
+ build({minified: true}),
32
+ ];
33
+ };
34
+
35
+ export default async () => {
36
+ const year = new Date().getFullYear();
37
+ const banner = `// ${lib.name} v${lib.version} Copyright (c) ${year} ${lib.author}`;
38
+
39
+ return [
40
+ ...buildConfig({
41
+ output: {
42
+ file: `dist/${outputFileName}`,
43
+ name,
44
+ format: "umd",
45
+ exports: "default",
46
+ banner
47
+ }
48
+ }),
49
+
50
+ ...buildConfig({
51
+ output: {
52
+ file: `dist/esm/${outputFileName}`,
53
+ format: "esm",
54
+ preferConst: true,
55
+ exports: "named",
56
+ banner
57
+ }
58
+ })
59
+ ]
60
+ };
@@ -0,0 +1,29 @@
1
+ {
2
+ "env": {
3
+ "node": true
4
+ },
5
+ "rules": {
6
+ "array-bracket-spacing": [2, "never"],
7
+ "block-scoped-var": 2,
8
+ "brace-style": [2, "1tbs"],
9
+ "camelcase": 1,
10
+ "computed-property-spacing": [2, "never"],
11
+ "curly": 2,
12
+ "eol-last": 2,
13
+ "eqeqeq": [2, "smart"],
14
+ "max-depth": [1, 3],
15
+ "max-len": [1, 80],
16
+ "max-statements": [1, 15],
17
+ "new-cap": 1,
18
+ "no-extend-native": 2,
19
+ "no-mixed-spaces-and-tabs": 2,
20
+ "no-trailing-spaces": 2,
21
+ "no-unused-vars": 1,
22
+ "no-use-before-define": [2, "nofunc"],
23
+ "object-curly-spacing": [2, "never"],
24
+ "quotes": [2, "single", "avoid-escape"],
25
+ "semi": [2, "always"],
26
+ "keyword-spacing": [2, {"before": true, "after": true}],
27
+ "space-unary-ops": 2
28
+ }
29
+ }
@@ -0,0 +1,10 @@
1
+ language: node_js
2
+ node_js:
3
+ - node
4
+ - lts/*
5
+ script:
6
+ - npm run lint
7
+ # test-coverage will also run the tests, but does not print helpful output upon test failure.
8
+ # So we also run the tests separately.
9
+ - npm run test
10
+ - npm run test-coverage && cat coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf coverage
@@ -0,0 +1,20 @@
1
+ The MIT License
2
+
3
+ Copyright (C) 2016-2018 Rob Wu <rob@robwu.nl>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.