apify-client 2.23.2-beta.0 → 2.23.2-beta.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.
- package/dist/bundle.js +832 -840
- package/dist/bundle.js.map +1 -1
- package/dist/resource_clients/request_queue.d.ts +13 -0
- package/dist/resource_clients/request_queue.d.ts.map +1 -1
- package/dist/resource_clients/request_queue.js +29 -10
- package/dist/resource_clients/request_queue.js.map +1 -1
- package/dist/utils.d.ts +9 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +26 -8
- package/dist/utils.js.map +1 -1
- package/package.json +17 -18
package/dist/bundle.js
CHANGED
|
@@ -20,6 +20,445 @@
|
|
|
20
20
|
})(globalThis, () => {
|
|
21
21
|
return (() => {
|
|
22
22
|
var __webpack_modules__ = ({
|
|
23
|
+
8890(module, exports) {
|
|
24
|
+
"use strict";
|
|
25
|
+
|
|
26
|
+
/// <reference lib="es2018"/>
|
|
27
|
+
/// <reference lib="dom"/>
|
|
28
|
+
/// <reference types="node"/>
|
|
29
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
30
|
+
const typedArrayTypeNames = [
|
|
31
|
+
'Int8Array',
|
|
32
|
+
'Uint8Array',
|
|
33
|
+
'Uint8ClampedArray',
|
|
34
|
+
'Int16Array',
|
|
35
|
+
'Uint16Array',
|
|
36
|
+
'Int32Array',
|
|
37
|
+
'Uint32Array',
|
|
38
|
+
'Float32Array',
|
|
39
|
+
'Float64Array',
|
|
40
|
+
'BigInt64Array',
|
|
41
|
+
'BigUint64Array'
|
|
42
|
+
];
|
|
43
|
+
function isTypedArrayName(name) {
|
|
44
|
+
return typedArrayTypeNames.includes(name);
|
|
45
|
+
}
|
|
46
|
+
const objectTypeNames = [
|
|
47
|
+
'Function',
|
|
48
|
+
'Generator',
|
|
49
|
+
'AsyncGenerator',
|
|
50
|
+
'GeneratorFunction',
|
|
51
|
+
'AsyncGeneratorFunction',
|
|
52
|
+
'AsyncFunction',
|
|
53
|
+
'Observable',
|
|
54
|
+
'Array',
|
|
55
|
+
'Buffer',
|
|
56
|
+
'Blob',
|
|
57
|
+
'Object',
|
|
58
|
+
'RegExp',
|
|
59
|
+
'Date',
|
|
60
|
+
'Error',
|
|
61
|
+
'Map',
|
|
62
|
+
'Set',
|
|
63
|
+
'WeakMap',
|
|
64
|
+
'WeakSet',
|
|
65
|
+
'ArrayBuffer',
|
|
66
|
+
'SharedArrayBuffer',
|
|
67
|
+
'DataView',
|
|
68
|
+
'Promise',
|
|
69
|
+
'URL',
|
|
70
|
+
'FormData',
|
|
71
|
+
'URLSearchParams',
|
|
72
|
+
'HTMLElement',
|
|
73
|
+
...typedArrayTypeNames
|
|
74
|
+
];
|
|
75
|
+
function isObjectTypeName(name) {
|
|
76
|
+
return objectTypeNames.includes(name);
|
|
77
|
+
}
|
|
78
|
+
const primitiveTypeNames = [
|
|
79
|
+
'null',
|
|
80
|
+
'undefined',
|
|
81
|
+
'string',
|
|
82
|
+
'number',
|
|
83
|
+
'bigint',
|
|
84
|
+
'boolean',
|
|
85
|
+
'symbol'
|
|
86
|
+
];
|
|
87
|
+
function isPrimitiveTypeName(name) {
|
|
88
|
+
return primitiveTypeNames.includes(name);
|
|
89
|
+
}
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
91
|
+
function isOfType(type) {
|
|
92
|
+
return (value) => typeof value === type;
|
|
93
|
+
}
|
|
94
|
+
const { toString } = Object.prototype;
|
|
95
|
+
const getObjectType = (value) => {
|
|
96
|
+
const objectTypeName = toString.call(value).slice(8, -1);
|
|
97
|
+
if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) {
|
|
98
|
+
return 'HTMLElement';
|
|
99
|
+
}
|
|
100
|
+
if (isObjectTypeName(objectTypeName)) {
|
|
101
|
+
return objectTypeName;
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
};
|
|
105
|
+
const isObjectOfType = (type) => (value) => getObjectType(value) === type;
|
|
106
|
+
function is(value) {
|
|
107
|
+
if (value === null) {
|
|
108
|
+
return 'null';
|
|
109
|
+
}
|
|
110
|
+
switch (typeof value) {
|
|
111
|
+
case 'undefined':
|
|
112
|
+
return 'undefined';
|
|
113
|
+
case 'string':
|
|
114
|
+
return 'string';
|
|
115
|
+
case 'number':
|
|
116
|
+
return 'number';
|
|
117
|
+
case 'boolean':
|
|
118
|
+
return 'boolean';
|
|
119
|
+
case 'function':
|
|
120
|
+
return 'Function';
|
|
121
|
+
case 'bigint':
|
|
122
|
+
return 'bigint';
|
|
123
|
+
case 'symbol':
|
|
124
|
+
return 'symbol';
|
|
125
|
+
default:
|
|
126
|
+
}
|
|
127
|
+
if (is.observable(value)) {
|
|
128
|
+
return 'Observable';
|
|
129
|
+
}
|
|
130
|
+
if (is.array(value)) {
|
|
131
|
+
return 'Array';
|
|
132
|
+
}
|
|
133
|
+
if (is.buffer(value)) {
|
|
134
|
+
return 'Buffer';
|
|
135
|
+
}
|
|
136
|
+
const tagType = getObjectType(value);
|
|
137
|
+
if (tagType) {
|
|
138
|
+
return tagType;
|
|
139
|
+
}
|
|
140
|
+
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
|
|
141
|
+
throw new TypeError('Please don\'t use object wrappers for primitive types');
|
|
142
|
+
}
|
|
143
|
+
return 'Object';
|
|
144
|
+
}
|
|
145
|
+
is.undefined = isOfType('undefined');
|
|
146
|
+
is.string = isOfType('string');
|
|
147
|
+
const isNumberType = isOfType('number');
|
|
148
|
+
is.number = (value) => isNumberType(value) && !is.nan(value);
|
|
149
|
+
is.bigint = isOfType('bigint');
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
151
|
+
is.function_ = isOfType('function');
|
|
152
|
+
is.null_ = (value) => value === null;
|
|
153
|
+
is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
|
|
154
|
+
is.boolean = (value) => value === true || value === false;
|
|
155
|
+
is.symbol = isOfType('symbol');
|
|
156
|
+
is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value));
|
|
157
|
+
is.array = (value, assertion) => {
|
|
158
|
+
if (!Array.isArray(value)) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
if (!is.function_(assertion)) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
return value.every(assertion);
|
|
165
|
+
};
|
|
166
|
+
is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; };
|
|
167
|
+
is.blob = (value) => isObjectOfType('Blob')(value);
|
|
168
|
+
is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
|
|
169
|
+
is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value));
|
|
170
|
+
is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); };
|
|
171
|
+
is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); };
|
|
172
|
+
is.generator = (value) => { var _a, _b; return is.iterable(value) && is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.next) && is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.throw); };
|
|
173
|
+
is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw);
|
|
174
|
+
is.nativePromise = (value) => isObjectOfType('Promise')(value);
|
|
175
|
+
const hasPromiseAPI = (value) => {
|
|
176
|
+
var _a, _b;
|
|
177
|
+
return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) &&
|
|
178
|
+
is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch);
|
|
179
|
+
};
|
|
180
|
+
is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
|
|
181
|
+
is.generatorFunction = isObjectOfType('GeneratorFunction');
|
|
182
|
+
is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction';
|
|
183
|
+
is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction';
|
|
184
|
+
// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types
|
|
185
|
+
is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
|
|
186
|
+
is.regExp = isObjectOfType('RegExp');
|
|
187
|
+
is.date = isObjectOfType('Date');
|
|
188
|
+
is.error = isObjectOfType('Error');
|
|
189
|
+
is.map = (value) => isObjectOfType('Map')(value);
|
|
190
|
+
is.set = (value) => isObjectOfType('Set')(value);
|
|
191
|
+
is.weakMap = (value) => isObjectOfType('WeakMap')(value);
|
|
192
|
+
is.weakSet = (value) => isObjectOfType('WeakSet')(value);
|
|
193
|
+
is.int8Array = isObjectOfType('Int8Array');
|
|
194
|
+
is.uint8Array = isObjectOfType('Uint8Array');
|
|
195
|
+
is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray');
|
|
196
|
+
is.int16Array = isObjectOfType('Int16Array');
|
|
197
|
+
is.uint16Array = isObjectOfType('Uint16Array');
|
|
198
|
+
is.int32Array = isObjectOfType('Int32Array');
|
|
199
|
+
is.uint32Array = isObjectOfType('Uint32Array');
|
|
200
|
+
is.float32Array = isObjectOfType('Float32Array');
|
|
201
|
+
is.float64Array = isObjectOfType('Float64Array');
|
|
202
|
+
is.bigInt64Array = isObjectOfType('BigInt64Array');
|
|
203
|
+
is.bigUint64Array = isObjectOfType('BigUint64Array');
|
|
204
|
+
is.arrayBuffer = isObjectOfType('ArrayBuffer');
|
|
205
|
+
is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer');
|
|
206
|
+
is.dataView = isObjectOfType('DataView');
|
|
207
|
+
is.enumCase = (value, targetEnum) => Object.values(targetEnum).includes(value);
|
|
208
|
+
is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype;
|
|
209
|
+
is.urlInstance = (value) => isObjectOfType('URL')(value);
|
|
210
|
+
is.urlString = (value) => {
|
|
211
|
+
if (!is.string(value)) {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
new URL(value); // eslint-disable-line no-new
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
catch (_a) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);`
|
|
223
|
+
is.truthy = (value) => Boolean(value);
|
|
224
|
+
// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);`
|
|
225
|
+
is.falsy = (value) => !value;
|
|
226
|
+
is.nan = (value) => Number.isNaN(value);
|
|
227
|
+
is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value);
|
|
228
|
+
is.integer = (value) => Number.isInteger(value);
|
|
229
|
+
is.safeInteger = (value) => Number.isSafeInteger(value);
|
|
230
|
+
is.plainObject = (value) => {
|
|
231
|
+
// From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
232
|
+
if (toString.call(value) !== '[object Object]') {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
const prototype = Object.getPrototypeOf(value);
|
|
236
|
+
return prototype === null || prototype === Object.getPrototypeOf({});
|
|
237
|
+
};
|
|
238
|
+
is.typedArray = (value) => isTypedArrayName(getObjectType(value));
|
|
239
|
+
const isValidLength = (value) => is.safeInteger(value) && value >= 0;
|
|
240
|
+
is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
|
|
241
|
+
is.inRange = (value, range) => {
|
|
242
|
+
if (is.number(range)) {
|
|
243
|
+
return value >= Math.min(0, range) && value <= Math.max(range, 0);
|
|
244
|
+
}
|
|
245
|
+
if (is.array(range) && range.length === 2) {
|
|
246
|
+
return value >= Math.min(...range) && value <= Math.max(...range);
|
|
247
|
+
}
|
|
248
|
+
throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
|
|
249
|
+
};
|
|
250
|
+
const NODE_TYPE_ELEMENT = 1;
|
|
251
|
+
const DOM_PROPERTIES_TO_CHECK = [
|
|
252
|
+
'innerHTML',
|
|
253
|
+
'ownerDocument',
|
|
254
|
+
'style',
|
|
255
|
+
'attributes',
|
|
256
|
+
'nodeValue'
|
|
257
|
+
];
|
|
258
|
+
is.domElement = (value) => {
|
|
259
|
+
return is.object(value) &&
|
|
260
|
+
value.nodeType === NODE_TYPE_ELEMENT &&
|
|
261
|
+
is.string(value.nodeName) &&
|
|
262
|
+
!is.plainObject(value) &&
|
|
263
|
+
DOM_PROPERTIES_TO_CHECK.every(property => property in value);
|
|
264
|
+
};
|
|
265
|
+
is.observable = (value) => {
|
|
266
|
+
var _a, _b, _c, _d;
|
|
267
|
+
if (!value) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
// eslint-disable-next-line no-use-extend-native/no-use-extend-native
|
|
271
|
+
if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) {
|
|
272
|
+
return true;
|
|
273
|
+
}
|
|
274
|
+
if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) {
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
};
|
|
279
|
+
is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value);
|
|
280
|
+
is.infinite = (value) => value === Infinity || value === -Infinity;
|
|
281
|
+
const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder;
|
|
282
|
+
is.evenInteger = isAbsoluteMod2(0);
|
|
283
|
+
is.oddInteger = isAbsoluteMod2(1);
|
|
284
|
+
is.emptyArray = (value) => is.array(value) && value.length === 0;
|
|
285
|
+
is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
|
|
286
|
+
is.emptyString = (value) => is.string(value) && value.length === 0;
|
|
287
|
+
const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value);
|
|
288
|
+
is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
|
|
289
|
+
// TODO: Use `not ''` when the `not` operator is available.
|
|
290
|
+
is.nonEmptyString = (value) => is.string(value) && value.length > 0;
|
|
291
|
+
// TODO: Use `not ''` when the `not` operator is available.
|
|
292
|
+
is.nonEmptyStringAndNotWhitespace = (value) => is.string(value) && !is.emptyStringOrWhitespace(value);
|
|
293
|
+
is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
|
|
294
|
+
// TODO: Use `not` operator here to remove `Map` and `Set` from type guard:
|
|
295
|
+
// - https://github.com/Microsoft/TypeScript/pull/29317
|
|
296
|
+
is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
|
|
297
|
+
is.emptySet = (value) => is.set(value) && value.size === 0;
|
|
298
|
+
is.nonEmptySet = (value) => is.set(value) && value.size > 0;
|
|
299
|
+
is.emptyMap = (value) => is.map(value) && value.size === 0;
|
|
300
|
+
is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
|
|
301
|
+
// `PropertyKey` is any value that can be used as an object key (string, number, or symbol)
|
|
302
|
+
is.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value);
|
|
303
|
+
is.formData = (value) => isObjectOfType('FormData')(value);
|
|
304
|
+
is.urlSearchParams = (value) => isObjectOfType('URLSearchParams')(value);
|
|
305
|
+
const predicateOnArray = (method, predicate, values) => {
|
|
306
|
+
if (!is.function_(predicate)) {
|
|
307
|
+
throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
|
|
308
|
+
}
|
|
309
|
+
if (values.length === 0) {
|
|
310
|
+
throw new TypeError('Invalid number of values');
|
|
311
|
+
}
|
|
312
|
+
return method.call(values, predicate);
|
|
313
|
+
};
|
|
314
|
+
is.any = (predicate, ...values) => {
|
|
315
|
+
const predicates = is.array(predicate) ? predicate : [predicate];
|
|
316
|
+
return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values));
|
|
317
|
+
};
|
|
318
|
+
is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);
|
|
319
|
+
const assertType = (condition, description, value, options = {}) => {
|
|
320
|
+
if (!condition) {
|
|
321
|
+
const { multipleValues } = options;
|
|
322
|
+
const valuesMessage = multipleValues ?
|
|
323
|
+
`received values of types ${[
|
|
324
|
+
...new Set(value.map(singleValue => `\`${is(singleValue)}\``))
|
|
325
|
+
].join(', ')}` :
|
|
326
|
+
`received value of type \`${is(value)}\``;
|
|
327
|
+
throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`);
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
exports.assert = {
|
|
331
|
+
// Unknowns.
|
|
332
|
+
undefined: (value) => assertType(is.undefined(value), 'undefined', value),
|
|
333
|
+
string: (value) => assertType(is.string(value), 'string', value),
|
|
334
|
+
number: (value) => assertType(is.number(value), 'number', value),
|
|
335
|
+
bigint: (value) => assertType(is.bigint(value), 'bigint', value),
|
|
336
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
337
|
+
function_: (value) => assertType(is.function_(value), 'Function', value),
|
|
338
|
+
null_: (value) => assertType(is.null_(value), 'null', value),
|
|
339
|
+
class_: (value) => assertType(is.class_(value), "Class" /* class_ */, value),
|
|
340
|
+
boolean: (value) => assertType(is.boolean(value), 'boolean', value),
|
|
341
|
+
symbol: (value) => assertType(is.symbol(value), 'symbol', value),
|
|
342
|
+
numericString: (value) => assertType(is.numericString(value), "string with a number" /* numericString */, value),
|
|
343
|
+
array: (value, assertion) => {
|
|
344
|
+
const assert = assertType;
|
|
345
|
+
assert(is.array(value), 'Array', value);
|
|
346
|
+
if (assertion) {
|
|
347
|
+
value.forEach(assertion);
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
buffer: (value) => assertType(is.buffer(value), 'Buffer', value),
|
|
351
|
+
blob: (value) => assertType(is.blob(value), 'Blob', value),
|
|
352
|
+
nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value),
|
|
353
|
+
object: (value) => assertType(is.object(value), 'Object', value),
|
|
354
|
+
iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value),
|
|
355
|
+
asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value),
|
|
356
|
+
generator: (value) => assertType(is.generator(value), 'Generator', value),
|
|
357
|
+
asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value),
|
|
358
|
+
nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value),
|
|
359
|
+
promise: (value) => assertType(is.promise(value), 'Promise', value),
|
|
360
|
+
generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value),
|
|
361
|
+
asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value),
|
|
362
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
363
|
+
asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value),
|
|
364
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
365
|
+
boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value),
|
|
366
|
+
regExp: (value) => assertType(is.regExp(value), 'RegExp', value),
|
|
367
|
+
date: (value) => assertType(is.date(value), 'Date', value),
|
|
368
|
+
error: (value) => assertType(is.error(value), 'Error', value),
|
|
369
|
+
map: (value) => assertType(is.map(value), 'Map', value),
|
|
370
|
+
set: (value) => assertType(is.set(value), 'Set', value),
|
|
371
|
+
weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value),
|
|
372
|
+
weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value),
|
|
373
|
+
int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value),
|
|
374
|
+
uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value),
|
|
375
|
+
uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value),
|
|
376
|
+
int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value),
|
|
377
|
+
uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value),
|
|
378
|
+
int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value),
|
|
379
|
+
uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value),
|
|
380
|
+
float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value),
|
|
381
|
+
float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value),
|
|
382
|
+
bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value),
|
|
383
|
+
bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value),
|
|
384
|
+
arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value),
|
|
385
|
+
sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value),
|
|
386
|
+
dataView: (value) => assertType(is.dataView(value), 'DataView', value),
|
|
387
|
+
enumCase: (value, targetEnum) => assertType(is.enumCase(value, targetEnum), 'EnumCase', value),
|
|
388
|
+
urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value),
|
|
389
|
+
urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value),
|
|
390
|
+
truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value),
|
|
391
|
+
falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value),
|
|
392
|
+
nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value),
|
|
393
|
+
primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value),
|
|
394
|
+
integer: (value) => assertType(is.integer(value), "integer" /* integer */, value),
|
|
395
|
+
safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value),
|
|
396
|
+
plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value),
|
|
397
|
+
typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value),
|
|
398
|
+
arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value),
|
|
399
|
+
domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value),
|
|
400
|
+
observable: (value) => assertType(is.observable(value), 'Observable', value),
|
|
401
|
+
nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value),
|
|
402
|
+
infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value),
|
|
403
|
+
emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value),
|
|
404
|
+
nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value),
|
|
405
|
+
emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value),
|
|
406
|
+
emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value),
|
|
407
|
+
nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value),
|
|
408
|
+
nonEmptyStringAndNotWhitespace: (value) => assertType(is.nonEmptyStringAndNotWhitespace(value), "non-empty string and not whitespace" /* nonEmptyStringAndNotWhitespace */, value),
|
|
409
|
+
emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value),
|
|
410
|
+
nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value),
|
|
411
|
+
emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value),
|
|
412
|
+
nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value),
|
|
413
|
+
emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value),
|
|
414
|
+
nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value),
|
|
415
|
+
propertyKey: (value) => assertType(is.propertyKey(value), 'PropertyKey', value),
|
|
416
|
+
formData: (value) => assertType(is.formData(value), 'FormData', value),
|
|
417
|
+
urlSearchParams: (value) => assertType(is.urlSearchParams(value), 'URLSearchParams', value),
|
|
418
|
+
// Numbers.
|
|
419
|
+
evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value),
|
|
420
|
+
oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value),
|
|
421
|
+
// Two arguments.
|
|
422
|
+
directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance),
|
|
423
|
+
inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value),
|
|
424
|
+
// Variadic functions.
|
|
425
|
+
any: (predicate, ...values) => {
|
|
426
|
+
return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true });
|
|
427
|
+
},
|
|
428
|
+
all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true })
|
|
429
|
+
};
|
|
430
|
+
// Some few keywords are reserved, but we'll populate them for Node.js users
|
|
431
|
+
// See https://github.com/Microsoft/TypeScript/issues/2536
|
|
432
|
+
Object.defineProperties(is, {
|
|
433
|
+
class: {
|
|
434
|
+
value: is.class_
|
|
435
|
+
},
|
|
436
|
+
function: {
|
|
437
|
+
value: is.function_
|
|
438
|
+
},
|
|
439
|
+
null: {
|
|
440
|
+
value: is.null_
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
Object.defineProperties(exports.assert, {
|
|
444
|
+
class: {
|
|
445
|
+
value: exports.assert.class_
|
|
446
|
+
},
|
|
447
|
+
function: {
|
|
448
|
+
value: exports.assert.function_
|
|
449
|
+
},
|
|
450
|
+
null: {
|
|
451
|
+
value: exports.assert.null_
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
exports["default"] = is;
|
|
455
|
+
// For CommonJS default export support
|
|
456
|
+
module.exports = is;
|
|
457
|
+
module.exports["default"] = is;
|
|
458
|
+
module.exports.assert = exports.assert;
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
},
|
|
23
462
|
313(module, __unused_rspack_exports, __webpack_require__) {
|
|
24
463
|
"use strict";
|
|
25
464
|
/* provided dependency */ var process = __webpack_require__(5606);
|
|
@@ -6215,7 +6654,7 @@ exports.MapPredicate = MapPredicate;
|
|
|
6215
6654
|
|
|
6216
6655
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6217
6656
|
exports.NumberPredicate = void 0;
|
|
6218
|
-
const is_1 = __webpack_require__(
|
|
6657
|
+
const is_1 = __webpack_require__(8890);
|
|
6219
6658
|
const predicate_1 = __webpack_require__(1830);
|
|
6220
6659
|
class NumberPredicate extends predicate_1.Predicate {
|
|
6221
6660
|
/**
|
|
@@ -6409,7 +6848,7 @@ exports.NumberPredicate = NumberPredicate;
|
|
|
6409
6848
|
|
|
6410
6849
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6411
6850
|
exports.ObjectPredicate = void 0;
|
|
6412
|
-
const is_1 = __webpack_require__(
|
|
6851
|
+
const is_1 = __webpack_require__(8890);
|
|
6413
6852
|
const dotProp = __webpack_require__(8486);
|
|
6414
6853
|
const isEqual = __webpack_require__(8142);
|
|
6415
6854
|
const has_items_1 = __webpack_require__(3779);
|
|
@@ -6588,7 +7027,7 @@ exports.ObjectPredicate = ObjectPredicate;
|
|
|
6588
7027
|
|
|
6589
7028
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6590
7029
|
exports.Predicate = exports.validatorSymbol = void 0;
|
|
6591
|
-
const is_1 = __webpack_require__(
|
|
7030
|
+
const is_1 = __webpack_require__(8890);
|
|
6592
7031
|
const argument_error_1 = __webpack_require__(2202);
|
|
6593
7032
|
const not_1 = __webpack_require__(6931);
|
|
6594
7033
|
const base_predicate_1 = __webpack_require__(7006);
|
|
@@ -6893,7 +7332,7 @@ exports.SetPredicate = SetPredicate;
|
|
|
6893
7332
|
|
|
6894
7333
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6895
7334
|
exports.StringPredicate = void 0;
|
|
6896
|
-
const is_1 = __webpack_require__(
|
|
7335
|
+
const is_1 = __webpack_require__(8890);
|
|
6897
7336
|
const valiDate = __webpack_require__(302);
|
|
6898
7337
|
const predicate_1 = __webpack_require__(1830);
|
|
6899
7338
|
class StringPredicate extends predicate_1.Predicate {
|
|
@@ -7253,721 +7692,282 @@ class WeakSetPredicate extends predicate_1.Predicate {
|
|
|
7253
7692
|
hasAny(...items) {
|
|
7254
7693
|
return this.addValidator({
|
|
7255
7694
|
message: (_, label) => `Expected ${label} to have any item of \`${JSON.stringify(items)}\``,
|
|
7256
|
-
validator: set => items.some(item => set.has(item))
|
|
7257
|
-
});
|
|
7258
|
-
}
|
|
7259
|
-
}
|
|
7260
|
-
exports.WeakSetPredicate = WeakSetPredicate;
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
},
|
|
7264
|
-
9514(__unused_rspack_module, exports, __webpack_require__) {
|
|
7265
|
-
"use strict";
|
|
7266
|
-
|
|
7267
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7268
|
-
const base_predicate_1 = __webpack_require__(7006);
|
|
7269
|
-
/**
|
|
7270
|
-
Validate the value against the provided predicate.
|
|
7271
|
-
|
|
7272
|
-
@hidden
|
|
7273
|
-
|
|
7274
|
-
@param value - Value to test.
|
|
7275
|
-
@param label - Label which should be used in error messages.
|
|
7276
|
-
@param predicate - Predicate to test to value against.
|
|
7277
|
-
@param idLabel - If true, the label is a variable or type. Default: true.
|
|
7278
|
-
*/
|
|
7279
|
-
function test(value, label, predicate, idLabel = true) {
|
|
7280
|
-
predicate[base_predicate_1.testSymbol](value, test, label, idLabel);
|
|
7281
|
-
}
|
|
7282
|
-
exports["default"] = test;
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
},
|
|
7286
|
-
5810(__unused_rspack_module, exports) {
|
|
7287
|
-
"use strict";
|
|
7288
|
-
|
|
7289
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7290
|
-
exports.generateArgumentErrorMessage = void 0;
|
|
7291
|
-
/**
|
|
7292
|
-
Generates a complete message from all errors generated by predicates.
|
|
7293
|
-
|
|
7294
|
-
@param errors - The errors generated by the predicates.
|
|
7295
|
-
@param isAny - If this function is called from the any argument.
|
|
7296
|
-
@hidden
|
|
7297
|
-
*/
|
|
7298
|
-
const generateArgumentErrorMessage = (errors, isAny = false) => {
|
|
7299
|
-
const message = [];
|
|
7300
|
-
const errorArray = [...errors.entries()];
|
|
7301
|
-
const anyErrorWithoutOneItemOnly = errorArray.some(([, array]) => array.size !== 1);
|
|
7302
|
-
// If only one error "key" is present, enumerate all of those errors only.
|
|
7303
|
-
if (errorArray.length === 1) {
|
|
7304
|
-
const [, returnedErrors] = errorArray[0];
|
|
7305
|
-
if (!isAny && returnedErrors.size === 1) {
|
|
7306
|
-
const [errorMessage] = returnedErrors;
|
|
7307
|
-
return errorMessage;
|
|
7308
|
-
}
|
|
7309
|
-
for (const entry of returnedErrors) {
|
|
7310
|
-
message.push(`${isAny ? ' - ' : ''}${entry}`);
|
|
7311
|
-
}
|
|
7312
|
-
return message.join('\n');
|
|
7313
|
-
}
|
|
7314
|
-
// If every predicate returns just one error, enumerate them as is.
|
|
7315
|
-
if (!anyErrorWithoutOneItemOnly) {
|
|
7316
|
-
return errorArray.map(([, [item]]) => ` - ${item}`).join('\n');
|
|
7317
|
-
}
|
|
7318
|
-
// Else, iterate through all the errors and enumerate them.
|
|
7319
|
-
for (const [key, value] of errorArray) {
|
|
7320
|
-
message.push(`Errors from the "${key}" predicate:`);
|
|
7321
|
-
for (const entry of value) {
|
|
7322
|
-
message.push(` - ${entry}`);
|
|
7323
|
-
}
|
|
7324
|
-
}
|
|
7325
|
-
return message.join('\n');
|
|
7326
|
-
};
|
|
7327
|
-
exports.generateArgumentErrorMessage = generateArgumentErrorMessage;
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
},
|
|
7331
|
-
5450(__unused_rspack_module, exports) {
|
|
7332
|
-
"use strict";
|
|
7333
|
-
|
|
7334
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7335
|
-
exports.generateStackTrace = void 0;
|
|
7336
|
-
/**
|
|
7337
|
-
Generates a useful stacktrace that points to the user's code where the error happened on platforms without the `Error.captureStackTrace()` method.
|
|
7338
|
-
|
|
7339
|
-
@hidden
|
|
7340
|
-
*/
|
|
7341
|
-
const generateStackTrace = () => {
|
|
7342
|
-
const stack = new RangeError('INTERNAL_OW_ERROR').stack;
|
|
7343
|
-
return stack;
|
|
7344
|
-
};
|
|
7345
|
-
exports.generateStackTrace = generateStackTrace;
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
},
|
|
7349
|
-
3779(__unused_rspack_module, exports) {
|
|
7350
|
-
"use strict";
|
|
7351
|
-
|
|
7352
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7353
|
-
/**
|
|
7354
|
-
Retrieve the missing values in a collection based on an array of items.
|
|
7355
|
-
|
|
7356
|
-
@hidden
|
|
7357
|
-
|
|
7358
|
-
@param source - Source collection to search through.
|
|
7359
|
-
@param items - Items to search for.
|
|
7360
|
-
@param maxValues - Maximum number of values after the search process is stopped. Default: 5.
|
|
7361
|
-
*/
|
|
7362
|
-
exports["default"] = (source, items, maxValues = 5) => {
|
|
7363
|
-
const missingValues = [];
|
|
7364
|
-
for (const value of items) {
|
|
7365
|
-
if (source.has(value)) {
|
|
7366
|
-
continue;
|
|
7367
|
-
}
|
|
7368
|
-
missingValues.push(value);
|
|
7369
|
-
if (missingValues.length === maxValues) {
|
|
7370
|
-
return missingValues;
|
|
7371
|
-
}
|
|
7372
|
-
}
|
|
7373
|
-
return missingValues.length === 0 ? true : missingValues;
|
|
7374
|
-
};
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
},
|
|
7378
|
-
9843(__unused_rspack_module, exports) {
|
|
7379
|
-
"use strict";
|
|
7380
|
-
|
|
7381
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7382
|
-
exports.inferLabel = void 0;
|
|
7383
|
-
const inferLabel = () => { };
|
|
7384
|
-
exports.inferLabel = inferLabel;
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
},
|
|
7388
|
-
4863(__unused_rspack_module, exports, __webpack_require__) {
|
|
7389
|
-
"use strict";
|
|
7390
|
-
|
|
7391
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7392
|
-
exports.exact = exports.partial = void 0;
|
|
7393
|
-
const is_1 = __webpack_require__(5864);
|
|
7394
|
-
const test_1 = __webpack_require__(9514);
|
|
7395
|
-
const base_predicate_1 = __webpack_require__(7006);
|
|
7396
|
-
/**
|
|
7397
|
-
Test if the `object` matches the `shape` partially.
|
|
7398
|
-
|
|
7399
|
-
@hidden
|
|
7400
|
-
|
|
7401
|
-
@param object - Object to test against the provided shape.
|
|
7402
|
-
@param shape - Shape to test the object against.
|
|
7403
|
-
@param parent - Name of the parent property.
|
|
7404
|
-
*/
|
|
7405
|
-
function partial(object, shape, parent) {
|
|
7406
|
-
try {
|
|
7407
|
-
for (const key of Object.keys(shape)) {
|
|
7408
|
-
const label = parent ? `${parent}.${key}` : key;
|
|
7409
|
-
if ((0, base_predicate_1.isPredicate)(shape[key])) {
|
|
7410
|
-
(0, test_1.default)(object[key], label, shape[key]);
|
|
7411
|
-
}
|
|
7412
|
-
else if (is_1.default.plainObject(shape[key])) {
|
|
7413
|
-
const result = partial(object[key], shape[key], label);
|
|
7414
|
-
if (result !== true) {
|
|
7415
|
-
return result;
|
|
7416
|
-
}
|
|
7417
|
-
}
|
|
7418
|
-
}
|
|
7419
|
-
return true;
|
|
7420
|
-
}
|
|
7421
|
-
catch (error) {
|
|
7422
|
-
return error.message;
|
|
7423
|
-
}
|
|
7424
|
-
}
|
|
7425
|
-
exports.partial = partial;
|
|
7426
|
-
/**
|
|
7427
|
-
Test if the `object` matches the `shape` exactly.
|
|
7428
|
-
|
|
7429
|
-
@hidden
|
|
7430
|
-
|
|
7431
|
-
@param object - Object to test against the provided shape.
|
|
7432
|
-
@param shape - Shape to test the object against.
|
|
7433
|
-
@param parent - Name of the parent property.
|
|
7434
|
-
*/
|
|
7435
|
-
function exact(object, shape, parent, isArray) {
|
|
7436
|
-
try {
|
|
7437
|
-
const objectKeys = new Set(Object.keys(object));
|
|
7438
|
-
for (const key of Object.keys(shape)) {
|
|
7439
|
-
objectKeys.delete(key);
|
|
7440
|
-
const label = parent ? `${parent}.${key}` : key;
|
|
7441
|
-
if ((0, base_predicate_1.isPredicate)(shape[key])) {
|
|
7442
|
-
(0, test_1.default)(object[key], label, shape[key]);
|
|
7443
|
-
}
|
|
7444
|
-
else if (is_1.default.plainObject(shape[key])) {
|
|
7445
|
-
if (!Object.prototype.hasOwnProperty.call(object, key)) {
|
|
7446
|
-
return `Expected \`${label}\` to exist`;
|
|
7447
|
-
}
|
|
7448
|
-
const result = exact(object[key], shape[key], label);
|
|
7449
|
-
if (result !== true) {
|
|
7450
|
-
return result;
|
|
7451
|
-
}
|
|
7452
|
-
}
|
|
7453
|
-
}
|
|
7454
|
-
if (objectKeys.size > 0) {
|
|
7455
|
-
const firstKey = [...objectKeys.keys()][0];
|
|
7456
|
-
const label = parent ? `${parent}.${firstKey}` : firstKey;
|
|
7457
|
-
return `Did not expect ${isArray ? 'element' : 'property'} \`${label}\` to exist, got \`${object[firstKey]}\``;
|
|
7458
|
-
}
|
|
7459
|
-
return true;
|
|
7460
|
-
}
|
|
7461
|
-
catch (error) {
|
|
7462
|
-
return error.message;
|
|
7695
|
+
validator: set => items.some(item => set.has(item))
|
|
7696
|
+
});
|
|
7463
7697
|
}
|
|
7464
7698
|
}
|
|
7465
|
-
exports.
|
|
7699
|
+
exports.WeakSetPredicate = WeakSetPredicate;
|
|
7466
7700
|
|
|
7467
7701
|
|
|
7468
7702
|
},
|
|
7469
|
-
|
|
7703
|
+
9514(__unused_rspack_module, exports, __webpack_require__) {
|
|
7470
7704
|
"use strict";
|
|
7471
7705
|
|
|
7472
7706
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7473
|
-
const
|
|
7474
|
-
const test_1 = __webpack_require__(9514);
|
|
7475
|
-
const ofTypeDeep = (object, predicate) => {
|
|
7476
|
-
if (!is_1.default.plainObject(object)) {
|
|
7477
|
-
(0, test_1.default)(object, 'deep values', predicate, false);
|
|
7478
|
-
return true;
|
|
7479
|
-
}
|
|
7480
|
-
return Object.values(object).every(value => ofTypeDeep(value, predicate));
|
|
7481
|
-
};
|
|
7707
|
+
const base_predicate_1 = __webpack_require__(7006);
|
|
7482
7708
|
/**
|
|
7483
|
-
|
|
7709
|
+
Validate the value against the provided predicate.
|
|
7484
7710
|
|
|
7485
7711
|
@hidden
|
|
7486
7712
|
|
|
7487
|
-
@param
|
|
7713
|
+
@param value - Value to test.
|
|
7714
|
+
@param label - Label which should be used in error messages.
|
|
7715
|
+
@param predicate - Predicate to test to value against.
|
|
7716
|
+
@param idLabel - If true, the label is a variable or type. Default: true.
|
|
7488
7717
|
*/
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
catch (error) {
|
|
7494
|
-
return error.message;
|
|
7495
|
-
}
|
|
7496
|
-
};
|
|
7718
|
+
function test(value, label, predicate, idLabel = true) {
|
|
7719
|
+
predicate[base_predicate_1.testSymbol](value, test, label, idLabel);
|
|
7720
|
+
}
|
|
7721
|
+
exports["default"] = test;
|
|
7497
7722
|
|
|
7498
7723
|
|
|
7499
7724
|
},
|
|
7500
|
-
|
|
7725
|
+
5810(__unused_rspack_module, exports) {
|
|
7501
7726
|
"use strict";
|
|
7502
7727
|
|
|
7503
7728
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7504
|
-
|
|
7729
|
+
exports.generateArgumentErrorMessage = void 0;
|
|
7505
7730
|
/**
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
@hidden
|
|
7509
|
-
@param source Source collection to test.
|
|
7510
|
-
@param name The name to call the collection of values, such as `values` or `keys`.
|
|
7511
|
-
@param predicate Predicate to test every item in the source collection against.
|
|
7512
|
-
*/
|
|
7513
|
-
exports["default"] = (source, name, predicate) => {
|
|
7514
|
-
try {
|
|
7515
|
-
for (const item of source) {
|
|
7516
|
-
(0, test_1.default)(item, name, predicate, false);
|
|
7517
|
-
}
|
|
7518
|
-
return true;
|
|
7519
|
-
}
|
|
7520
|
-
catch (error) {
|
|
7521
|
-
return error.message;
|
|
7522
|
-
}
|
|
7523
|
-
};
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
},
|
|
7527
|
-
4693(__unused_rspack_module, exports) {
|
|
7528
|
-
"use strict";
|
|
7529
|
-
|
|
7530
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7531
|
-
exports["default"] = () => Math.random().toString(16).slice(2);
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
},
|
|
7535
|
-
5864(module, exports) {
|
|
7536
|
-
"use strict";
|
|
7731
|
+
Generates a complete message from all errors generated by predicates.
|
|
7537
7732
|
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
const
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
}
|
|
7558
|
-
const objectTypeNames = [
|
|
7559
|
-
'Function',
|
|
7560
|
-
'Generator',
|
|
7561
|
-
'AsyncGenerator',
|
|
7562
|
-
'GeneratorFunction',
|
|
7563
|
-
'AsyncGeneratorFunction',
|
|
7564
|
-
'AsyncFunction',
|
|
7565
|
-
'Observable',
|
|
7566
|
-
'Array',
|
|
7567
|
-
'Buffer',
|
|
7568
|
-
'Blob',
|
|
7569
|
-
'Object',
|
|
7570
|
-
'RegExp',
|
|
7571
|
-
'Date',
|
|
7572
|
-
'Error',
|
|
7573
|
-
'Map',
|
|
7574
|
-
'Set',
|
|
7575
|
-
'WeakMap',
|
|
7576
|
-
'WeakSet',
|
|
7577
|
-
'ArrayBuffer',
|
|
7578
|
-
'SharedArrayBuffer',
|
|
7579
|
-
'DataView',
|
|
7580
|
-
'Promise',
|
|
7581
|
-
'URL',
|
|
7582
|
-
'FormData',
|
|
7583
|
-
'URLSearchParams',
|
|
7584
|
-
'HTMLElement',
|
|
7585
|
-
...typedArrayTypeNames
|
|
7586
|
-
];
|
|
7587
|
-
function isObjectTypeName(name) {
|
|
7588
|
-
return objectTypeNames.includes(name);
|
|
7589
|
-
}
|
|
7590
|
-
const primitiveTypeNames = [
|
|
7591
|
-
'null',
|
|
7592
|
-
'undefined',
|
|
7593
|
-
'string',
|
|
7594
|
-
'number',
|
|
7595
|
-
'bigint',
|
|
7596
|
-
'boolean',
|
|
7597
|
-
'symbol'
|
|
7598
|
-
];
|
|
7599
|
-
function isPrimitiveTypeName(name) {
|
|
7600
|
-
return primitiveTypeNames.includes(name);
|
|
7601
|
-
}
|
|
7602
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
7603
|
-
function isOfType(type) {
|
|
7604
|
-
return (value) => typeof value === type;
|
|
7605
|
-
}
|
|
7606
|
-
const { toString } = Object.prototype;
|
|
7607
|
-
const getObjectType = (value) => {
|
|
7608
|
-
const objectTypeName = toString.call(value).slice(8, -1);
|
|
7609
|
-
if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) {
|
|
7610
|
-
return 'HTMLElement';
|
|
7611
|
-
}
|
|
7612
|
-
if (isObjectTypeName(objectTypeName)) {
|
|
7613
|
-
return objectTypeName;
|
|
7614
|
-
}
|
|
7615
|
-
return undefined;
|
|
7616
|
-
};
|
|
7617
|
-
const isObjectOfType = (type) => (value) => getObjectType(value) === type;
|
|
7618
|
-
function is(value) {
|
|
7619
|
-
if (value === null) {
|
|
7620
|
-
return 'null';
|
|
7621
|
-
}
|
|
7622
|
-
switch (typeof value) {
|
|
7623
|
-
case 'undefined':
|
|
7624
|
-
return 'undefined';
|
|
7625
|
-
case 'string':
|
|
7626
|
-
return 'string';
|
|
7627
|
-
case 'number':
|
|
7628
|
-
return 'number';
|
|
7629
|
-
case 'boolean':
|
|
7630
|
-
return 'boolean';
|
|
7631
|
-
case 'function':
|
|
7632
|
-
return 'Function';
|
|
7633
|
-
case 'bigint':
|
|
7634
|
-
return 'bigint';
|
|
7635
|
-
case 'symbol':
|
|
7636
|
-
return 'symbol';
|
|
7637
|
-
default:
|
|
7638
|
-
}
|
|
7639
|
-
if (is.observable(value)) {
|
|
7640
|
-
return 'Observable';
|
|
7641
|
-
}
|
|
7642
|
-
if (is.array(value)) {
|
|
7643
|
-
return 'Array';
|
|
7644
|
-
}
|
|
7645
|
-
if (is.buffer(value)) {
|
|
7646
|
-
return 'Buffer';
|
|
7647
|
-
}
|
|
7648
|
-
const tagType = getObjectType(value);
|
|
7649
|
-
if (tagType) {
|
|
7650
|
-
return tagType;
|
|
7651
|
-
}
|
|
7652
|
-
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
|
|
7653
|
-
throw new TypeError('Please don\'t use object wrappers for primitive types');
|
|
7654
|
-
}
|
|
7655
|
-
return 'Object';
|
|
7656
|
-
}
|
|
7657
|
-
is.undefined = isOfType('undefined');
|
|
7658
|
-
is.string = isOfType('string');
|
|
7659
|
-
const isNumberType = isOfType('number');
|
|
7660
|
-
is.number = (value) => isNumberType(value) && !is.nan(value);
|
|
7661
|
-
is.bigint = isOfType('bigint');
|
|
7662
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
7663
|
-
is.function_ = isOfType('function');
|
|
7664
|
-
is.null_ = (value) => value === null;
|
|
7665
|
-
is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
|
|
7666
|
-
is.boolean = (value) => value === true || value === false;
|
|
7667
|
-
is.symbol = isOfType('symbol');
|
|
7668
|
-
is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value));
|
|
7669
|
-
is.array = (value, assertion) => {
|
|
7670
|
-
if (!Array.isArray(value)) {
|
|
7671
|
-
return false;
|
|
7672
|
-
}
|
|
7673
|
-
if (!is.function_(assertion)) {
|
|
7674
|
-
return true;
|
|
7675
|
-
}
|
|
7676
|
-
return value.every(assertion);
|
|
7677
|
-
};
|
|
7678
|
-
is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; };
|
|
7679
|
-
is.blob = (value) => isObjectOfType('Blob')(value);
|
|
7680
|
-
is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
|
|
7681
|
-
is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value));
|
|
7682
|
-
is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); };
|
|
7683
|
-
is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); };
|
|
7684
|
-
is.generator = (value) => { var _a, _b; return is.iterable(value) && is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.next) && is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.throw); };
|
|
7685
|
-
is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw);
|
|
7686
|
-
is.nativePromise = (value) => isObjectOfType('Promise')(value);
|
|
7687
|
-
const hasPromiseAPI = (value) => {
|
|
7688
|
-
var _a, _b;
|
|
7689
|
-
return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) &&
|
|
7690
|
-
is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch);
|
|
7691
|
-
};
|
|
7692
|
-
is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
|
|
7693
|
-
is.generatorFunction = isObjectOfType('GeneratorFunction');
|
|
7694
|
-
is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction';
|
|
7695
|
-
is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction';
|
|
7696
|
-
// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types
|
|
7697
|
-
is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
|
|
7698
|
-
is.regExp = isObjectOfType('RegExp');
|
|
7699
|
-
is.date = isObjectOfType('Date');
|
|
7700
|
-
is.error = isObjectOfType('Error');
|
|
7701
|
-
is.map = (value) => isObjectOfType('Map')(value);
|
|
7702
|
-
is.set = (value) => isObjectOfType('Set')(value);
|
|
7703
|
-
is.weakMap = (value) => isObjectOfType('WeakMap')(value);
|
|
7704
|
-
is.weakSet = (value) => isObjectOfType('WeakSet')(value);
|
|
7705
|
-
is.int8Array = isObjectOfType('Int8Array');
|
|
7706
|
-
is.uint8Array = isObjectOfType('Uint8Array');
|
|
7707
|
-
is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray');
|
|
7708
|
-
is.int16Array = isObjectOfType('Int16Array');
|
|
7709
|
-
is.uint16Array = isObjectOfType('Uint16Array');
|
|
7710
|
-
is.int32Array = isObjectOfType('Int32Array');
|
|
7711
|
-
is.uint32Array = isObjectOfType('Uint32Array');
|
|
7712
|
-
is.float32Array = isObjectOfType('Float32Array');
|
|
7713
|
-
is.float64Array = isObjectOfType('Float64Array');
|
|
7714
|
-
is.bigInt64Array = isObjectOfType('BigInt64Array');
|
|
7715
|
-
is.bigUint64Array = isObjectOfType('BigUint64Array');
|
|
7716
|
-
is.arrayBuffer = isObjectOfType('ArrayBuffer');
|
|
7717
|
-
is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer');
|
|
7718
|
-
is.dataView = isObjectOfType('DataView');
|
|
7719
|
-
is.enumCase = (value, targetEnum) => Object.values(targetEnum).includes(value);
|
|
7720
|
-
is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype;
|
|
7721
|
-
is.urlInstance = (value) => isObjectOfType('URL')(value);
|
|
7722
|
-
is.urlString = (value) => {
|
|
7723
|
-
if (!is.string(value)) {
|
|
7724
|
-
return false;
|
|
7733
|
+
@param errors - The errors generated by the predicates.
|
|
7734
|
+
@param isAny - If this function is called from the any argument.
|
|
7735
|
+
@hidden
|
|
7736
|
+
*/
|
|
7737
|
+
const generateArgumentErrorMessage = (errors, isAny = false) => {
|
|
7738
|
+
const message = [];
|
|
7739
|
+
const errorArray = [...errors.entries()];
|
|
7740
|
+
const anyErrorWithoutOneItemOnly = errorArray.some(([, array]) => array.size !== 1);
|
|
7741
|
+
// If only one error "key" is present, enumerate all of those errors only.
|
|
7742
|
+
if (errorArray.length === 1) {
|
|
7743
|
+
const [, returnedErrors] = errorArray[0];
|
|
7744
|
+
if (!isAny && returnedErrors.size === 1) {
|
|
7745
|
+
const [errorMessage] = returnedErrors;
|
|
7746
|
+
return errorMessage;
|
|
7747
|
+
}
|
|
7748
|
+
for (const entry of returnedErrors) {
|
|
7749
|
+
message.push(`${isAny ? ' - ' : ''}${entry}`);
|
|
7750
|
+
}
|
|
7751
|
+
return message.join('\n');
|
|
7725
7752
|
}
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
return
|
|
7753
|
+
// If every predicate returns just one error, enumerate them as is.
|
|
7754
|
+
if (!anyErrorWithoutOneItemOnly) {
|
|
7755
|
+
return errorArray.map(([, [item]]) => ` - ${item}`).join('\n');
|
|
7729
7756
|
}
|
|
7730
|
-
|
|
7731
|
-
|
|
7757
|
+
// Else, iterate through all the errors and enumerate them.
|
|
7758
|
+
for (const [key, value] of errorArray) {
|
|
7759
|
+
message.push(`Errors from the "${key}" predicate:`);
|
|
7760
|
+
for (const entry of value) {
|
|
7761
|
+
message.push(` - ${entry}`);
|
|
7762
|
+
}
|
|
7732
7763
|
}
|
|
7764
|
+
return message.join('\n');
|
|
7733
7765
|
};
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7766
|
+
exports.generateArgumentErrorMessage = generateArgumentErrorMessage;
|
|
7767
|
+
|
|
7768
|
+
|
|
7769
|
+
},
|
|
7770
|
+
5450(__unused_rspack_module, exports) {
|
|
7771
|
+
"use strict";
|
|
7772
|
+
|
|
7773
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7774
|
+
exports.generateStackTrace = void 0;
|
|
7775
|
+
/**
|
|
7776
|
+
Generates a useful stacktrace that points to the user's code where the error happened on platforms without the `Error.captureStackTrace()` method.
|
|
7777
|
+
|
|
7778
|
+
@hidden
|
|
7779
|
+
*/
|
|
7780
|
+
const generateStackTrace = () => {
|
|
7781
|
+
const stack = new RangeError('INTERNAL_OW_ERROR').stack;
|
|
7782
|
+
return stack;
|
|
7749
7783
|
};
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7784
|
+
exports.generateStackTrace = generateStackTrace;
|
|
7785
|
+
|
|
7786
|
+
|
|
7787
|
+
},
|
|
7788
|
+
3779(__unused_rspack_module, exports) {
|
|
7789
|
+
"use strict";
|
|
7790
|
+
|
|
7791
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7792
|
+
/**
|
|
7793
|
+
Retrieve the missing values in a collection based on an array of items.
|
|
7794
|
+
|
|
7795
|
+
@hidden
|
|
7796
|
+
|
|
7797
|
+
@param source - Source collection to search through.
|
|
7798
|
+
@param items - Items to search for.
|
|
7799
|
+
@param maxValues - Maximum number of values after the search process is stopped. Default: 5.
|
|
7800
|
+
*/
|
|
7801
|
+
exports["default"] = (source, items, maxValues = 5) => {
|
|
7802
|
+
const missingValues = [];
|
|
7803
|
+
for (const value of items) {
|
|
7804
|
+
if (source.has(value)) {
|
|
7805
|
+
continue;
|
|
7806
|
+
}
|
|
7807
|
+
missingValues.push(value);
|
|
7808
|
+
if (missingValues.length === maxValues) {
|
|
7809
|
+
return missingValues;
|
|
7810
|
+
}
|
|
7759
7811
|
}
|
|
7760
|
-
|
|
7761
|
-
};
|
|
7762
|
-
const NODE_TYPE_ELEMENT = 1;
|
|
7763
|
-
const DOM_PROPERTIES_TO_CHECK = [
|
|
7764
|
-
'innerHTML',
|
|
7765
|
-
'ownerDocument',
|
|
7766
|
-
'style',
|
|
7767
|
-
'attributes',
|
|
7768
|
-
'nodeValue'
|
|
7769
|
-
];
|
|
7770
|
-
is.domElement = (value) => {
|
|
7771
|
-
return is.object(value) &&
|
|
7772
|
-
value.nodeType === NODE_TYPE_ELEMENT &&
|
|
7773
|
-
is.string(value.nodeName) &&
|
|
7774
|
-
!is.plainObject(value) &&
|
|
7775
|
-
DOM_PROPERTIES_TO_CHECK.every(property => property in value);
|
|
7812
|
+
return missingValues.length === 0 ? true : missingValues;
|
|
7776
7813
|
};
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7814
|
+
|
|
7815
|
+
|
|
7816
|
+
},
|
|
7817
|
+
9843(__unused_rspack_module, exports) {
|
|
7818
|
+
"use strict";
|
|
7819
|
+
|
|
7820
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7821
|
+
exports.inferLabel = void 0;
|
|
7822
|
+
const inferLabel = () => { };
|
|
7823
|
+
exports.inferLabel = inferLabel;
|
|
7824
|
+
|
|
7825
|
+
|
|
7826
|
+
},
|
|
7827
|
+
4863(__unused_rspack_module, exports, __webpack_require__) {
|
|
7828
|
+
"use strict";
|
|
7829
|
+
|
|
7830
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7831
|
+
exports.exact = exports.partial = void 0;
|
|
7832
|
+
const is_1 = __webpack_require__(8890);
|
|
7833
|
+
const test_1 = __webpack_require__(9514);
|
|
7834
|
+
const base_predicate_1 = __webpack_require__(7006);
|
|
7835
|
+
/**
|
|
7836
|
+
Test if the `object` matches the `shape` partially.
|
|
7837
|
+
|
|
7838
|
+
@hidden
|
|
7839
|
+
|
|
7840
|
+
@param object - Object to test against the provided shape.
|
|
7841
|
+
@param shape - Shape to test the object against.
|
|
7842
|
+
@param parent - Name of the parent property.
|
|
7843
|
+
*/
|
|
7844
|
+
function partial(object, shape, parent) {
|
|
7845
|
+
try {
|
|
7846
|
+
for (const key of Object.keys(shape)) {
|
|
7847
|
+
const label = parent ? `${parent}.${key}` : key;
|
|
7848
|
+
if ((0, base_predicate_1.isPredicate)(shape[key])) {
|
|
7849
|
+
(0, test_1.default)(object[key], label, shape[key]);
|
|
7850
|
+
}
|
|
7851
|
+
else if (is_1.default.plainObject(shape[key])) {
|
|
7852
|
+
const result = partial(object[key], shape[key], label);
|
|
7853
|
+
if (result !== true) {
|
|
7854
|
+
return result;
|
|
7855
|
+
}
|
|
7856
|
+
}
|
|
7857
|
+
}
|
|
7784
7858
|
return true;
|
|
7785
7859
|
}
|
|
7786
|
-
|
|
7860
|
+
catch (error) {
|
|
7861
|
+
return error.message;
|
|
7862
|
+
}
|
|
7863
|
+
}
|
|
7864
|
+
exports.partial = partial;
|
|
7865
|
+
/**
|
|
7866
|
+
Test if the `object` matches the `shape` exactly.
|
|
7867
|
+
|
|
7868
|
+
@hidden
|
|
7869
|
+
|
|
7870
|
+
@param object - Object to test against the provided shape.
|
|
7871
|
+
@param shape - Shape to test the object against.
|
|
7872
|
+
@param parent - Name of the parent property.
|
|
7873
|
+
*/
|
|
7874
|
+
function exact(object, shape, parent, isArray) {
|
|
7875
|
+
try {
|
|
7876
|
+
const objectKeys = new Set(Object.keys(object));
|
|
7877
|
+
for (const key of Object.keys(shape)) {
|
|
7878
|
+
objectKeys.delete(key);
|
|
7879
|
+
const label = parent ? `${parent}.${key}` : key;
|
|
7880
|
+
if ((0, base_predicate_1.isPredicate)(shape[key])) {
|
|
7881
|
+
(0, test_1.default)(object[key], label, shape[key]);
|
|
7882
|
+
}
|
|
7883
|
+
else if (is_1.default.plainObject(shape[key])) {
|
|
7884
|
+
if (!Object.prototype.hasOwnProperty.call(object, key)) {
|
|
7885
|
+
return `Expected \`${label}\` to exist`;
|
|
7886
|
+
}
|
|
7887
|
+
const result = exact(object[key], shape[key], label);
|
|
7888
|
+
if (result !== true) {
|
|
7889
|
+
return result;
|
|
7890
|
+
}
|
|
7891
|
+
}
|
|
7892
|
+
}
|
|
7893
|
+
if (objectKeys.size > 0) {
|
|
7894
|
+
const firstKey = [...objectKeys.keys()][0];
|
|
7895
|
+
const label = parent ? `${parent}.${firstKey}` : firstKey;
|
|
7896
|
+
return `Did not expect ${isArray ? 'element' : 'property'} \`${label}\` to exist, got \`${object[firstKey]}\``;
|
|
7897
|
+
}
|
|
7787
7898
|
return true;
|
|
7788
7899
|
}
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value);
|
|
7792
|
-
is.infinite = (value) => value === Infinity || value === -Infinity;
|
|
7793
|
-
const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder;
|
|
7794
|
-
is.evenInteger = isAbsoluteMod2(0);
|
|
7795
|
-
is.oddInteger = isAbsoluteMod2(1);
|
|
7796
|
-
is.emptyArray = (value) => is.array(value) && value.length === 0;
|
|
7797
|
-
is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
|
|
7798
|
-
is.emptyString = (value) => is.string(value) && value.length === 0;
|
|
7799
|
-
const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value);
|
|
7800
|
-
is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
|
|
7801
|
-
// TODO: Use `not ''` when the `not` operator is available.
|
|
7802
|
-
is.nonEmptyString = (value) => is.string(value) && value.length > 0;
|
|
7803
|
-
// TODO: Use `not ''` when the `not` operator is available.
|
|
7804
|
-
is.nonEmptyStringAndNotWhitespace = (value) => is.string(value) && !is.emptyStringOrWhitespace(value);
|
|
7805
|
-
is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
|
|
7806
|
-
// TODO: Use `not` operator here to remove `Map` and `Set` from type guard:
|
|
7807
|
-
// - https://github.com/Microsoft/TypeScript/pull/29317
|
|
7808
|
-
is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
|
|
7809
|
-
is.emptySet = (value) => is.set(value) && value.size === 0;
|
|
7810
|
-
is.nonEmptySet = (value) => is.set(value) && value.size > 0;
|
|
7811
|
-
is.emptyMap = (value) => is.map(value) && value.size === 0;
|
|
7812
|
-
is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
|
|
7813
|
-
// `PropertyKey` is any value that can be used as an object key (string, number, or symbol)
|
|
7814
|
-
is.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value);
|
|
7815
|
-
is.formData = (value) => isObjectOfType('FormData')(value);
|
|
7816
|
-
is.urlSearchParams = (value) => isObjectOfType('URLSearchParams')(value);
|
|
7817
|
-
const predicateOnArray = (method, predicate, values) => {
|
|
7818
|
-
if (!is.function_(predicate)) {
|
|
7819
|
-
throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
|
|
7900
|
+
catch (error) {
|
|
7901
|
+
return error.message;
|
|
7820
7902
|
}
|
|
7821
|
-
|
|
7822
|
-
|
|
7903
|
+
}
|
|
7904
|
+
exports.exact = exact;
|
|
7905
|
+
|
|
7906
|
+
|
|
7907
|
+
},
|
|
7908
|
+
8921(__unused_rspack_module, exports, __webpack_require__) {
|
|
7909
|
+
"use strict";
|
|
7910
|
+
|
|
7911
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7912
|
+
const is_1 = __webpack_require__(8890);
|
|
7913
|
+
const test_1 = __webpack_require__(9514);
|
|
7914
|
+
const ofTypeDeep = (object, predicate) => {
|
|
7915
|
+
if (!is_1.default.plainObject(object)) {
|
|
7916
|
+
(0, test_1.default)(object, 'deep values', predicate, false);
|
|
7917
|
+
return true;
|
|
7823
7918
|
}
|
|
7824
|
-
return
|
|
7825
|
-
};
|
|
7826
|
-
is.any = (predicate, ...values) => {
|
|
7827
|
-
const predicates = is.array(predicate) ? predicate : [predicate];
|
|
7828
|
-
return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values));
|
|
7919
|
+
return Object.values(object).every(value => ofTypeDeep(value, predicate));
|
|
7829
7920
|
};
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7921
|
+
/**
|
|
7922
|
+
Test all the values in the object against a provided predicate.
|
|
7923
|
+
|
|
7924
|
+
@hidden
|
|
7925
|
+
|
|
7926
|
+
@param predicate - Predicate to test every value in the given object against.
|
|
7927
|
+
*/
|
|
7928
|
+
exports["default"] = (object, predicate) => {
|
|
7929
|
+
try {
|
|
7930
|
+
return ofTypeDeep(object, predicate);
|
|
7931
|
+
}
|
|
7932
|
+
catch (error) {
|
|
7933
|
+
return error.message;
|
|
7840
7934
|
}
|
|
7841
7935
|
};
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7936
|
+
|
|
7937
|
+
|
|
7938
|
+
},
|
|
7939
|
+
6678(__unused_rspack_module, exports, __webpack_require__) {
|
|
7940
|
+
"use strict";
|
|
7941
|
+
|
|
7942
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7943
|
+
const test_1 = __webpack_require__(9514);
|
|
7944
|
+
/**
|
|
7945
|
+
Test all the values in the collection against a provided predicate.
|
|
7946
|
+
|
|
7947
|
+
@hidden
|
|
7948
|
+
@param source Source collection to test.
|
|
7949
|
+
@param name The name to call the collection of values, such as `values` or `keys`.
|
|
7950
|
+
@param predicate Predicate to test every item in the source collection against.
|
|
7951
|
+
*/
|
|
7952
|
+
exports["default"] = (source, name, predicate) => {
|
|
7953
|
+
try {
|
|
7954
|
+
for (const item of source) {
|
|
7955
|
+
(0, test_1.default)(item, name, predicate, false);
|
|
7860
7956
|
}
|
|
7861
|
-
|
|
7862
|
-
buffer: (value) => assertType(is.buffer(value), 'Buffer', value),
|
|
7863
|
-
blob: (value) => assertType(is.blob(value), 'Blob', value),
|
|
7864
|
-
nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value),
|
|
7865
|
-
object: (value) => assertType(is.object(value), 'Object', value),
|
|
7866
|
-
iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value),
|
|
7867
|
-
asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value),
|
|
7868
|
-
generator: (value) => assertType(is.generator(value), 'Generator', value),
|
|
7869
|
-
asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value),
|
|
7870
|
-
nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value),
|
|
7871
|
-
promise: (value) => assertType(is.promise(value), 'Promise', value),
|
|
7872
|
-
generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value),
|
|
7873
|
-
asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value),
|
|
7874
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
7875
|
-
asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value),
|
|
7876
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
7877
|
-
boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value),
|
|
7878
|
-
regExp: (value) => assertType(is.regExp(value), 'RegExp', value),
|
|
7879
|
-
date: (value) => assertType(is.date(value), 'Date', value),
|
|
7880
|
-
error: (value) => assertType(is.error(value), 'Error', value),
|
|
7881
|
-
map: (value) => assertType(is.map(value), 'Map', value),
|
|
7882
|
-
set: (value) => assertType(is.set(value), 'Set', value),
|
|
7883
|
-
weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value),
|
|
7884
|
-
weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value),
|
|
7885
|
-
int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value),
|
|
7886
|
-
uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value),
|
|
7887
|
-
uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value),
|
|
7888
|
-
int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value),
|
|
7889
|
-
uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value),
|
|
7890
|
-
int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value),
|
|
7891
|
-
uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value),
|
|
7892
|
-
float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value),
|
|
7893
|
-
float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value),
|
|
7894
|
-
bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value),
|
|
7895
|
-
bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value),
|
|
7896
|
-
arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value),
|
|
7897
|
-
sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value),
|
|
7898
|
-
dataView: (value) => assertType(is.dataView(value), 'DataView', value),
|
|
7899
|
-
enumCase: (value, targetEnum) => assertType(is.enumCase(value, targetEnum), 'EnumCase', value),
|
|
7900
|
-
urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value),
|
|
7901
|
-
urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value),
|
|
7902
|
-
truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value),
|
|
7903
|
-
falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value),
|
|
7904
|
-
nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value),
|
|
7905
|
-
primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value),
|
|
7906
|
-
integer: (value) => assertType(is.integer(value), "integer" /* integer */, value),
|
|
7907
|
-
safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value),
|
|
7908
|
-
plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value),
|
|
7909
|
-
typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value),
|
|
7910
|
-
arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value),
|
|
7911
|
-
domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value),
|
|
7912
|
-
observable: (value) => assertType(is.observable(value), 'Observable', value),
|
|
7913
|
-
nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value),
|
|
7914
|
-
infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value),
|
|
7915
|
-
emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value),
|
|
7916
|
-
nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value),
|
|
7917
|
-
emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value),
|
|
7918
|
-
emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value),
|
|
7919
|
-
nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value),
|
|
7920
|
-
nonEmptyStringAndNotWhitespace: (value) => assertType(is.nonEmptyStringAndNotWhitespace(value), "non-empty string and not whitespace" /* nonEmptyStringAndNotWhitespace */, value),
|
|
7921
|
-
emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value),
|
|
7922
|
-
nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value),
|
|
7923
|
-
emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value),
|
|
7924
|
-
nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value),
|
|
7925
|
-
emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value),
|
|
7926
|
-
nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value),
|
|
7927
|
-
propertyKey: (value) => assertType(is.propertyKey(value), 'PropertyKey', value),
|
|
7928
|
-
formData: (value) => assertType(is.formData(value), 'FormData', value),
|
|
7929
|
-
urlSearchParams: (value) => assertType(is.urlSearchParams(value), 'URLSearchParams', value),
|
|
7930
|
-
// Numbers.
|
|
7931
|
-
evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value),
|
|
7932
|
-
oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value),
|
|
7933
|
-
// Two arguments.
|
|
7934
|
-
directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance),
|
|
7935
|
-
inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value),
|
|
7936
|
-
// Variadic functions.
|
|
7937
|
-
any: (predicate, ...values) => {
|
|
7938
|
-
return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true });
|
|
7939
|
-
},
|
|
7940
|
-
all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true })
|
|
7941
|
-
};
|
|
7942
|
-
// Some few keywords are reserved, but we'll populate them for Node.js users
|
|
7943
|
-
// See https://github.com/Microsoft/TypeScript/issues/2536
|
|
7944
|
-
Object.defineProperties(is, {
|
|
7945
|
-
class: {
|
|
7946
|
-
value: is.class_
|
|
7947
|
-
},
|
|
7948
|
-
function: {
|
|
7949
|
-
value: is.function_
|
|
7950
|
-
},
|
|
7951
|
-
null: {
|
|
7952
|
-
value: is.null_
|
|
7957
|
+
return true;
|
|
7953
7958
|
}
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
class: {
|
|
7957
|
-
value: exports.assert.class_
|
|
7958
|
-
},
|
|
7959
|
-
function: {
|
|
7960
|
-
value: exports.assert.function_
|
|
7961
|
-
},
|
|
7962
|
-
null: {
|
|
7963
|
-
value: exports.assert.null_
|
|
7959
|
+
catch (error) {
|
|
7960
|
+
return error.message;
|
|
7964
7961
|
}
|
|
7965
|
-
}
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7962
|
+
};
|
|
7963
|
+
|
|
7964
|
+
|
|
7965
|
+
},
|
|
7966
|
+
4693(__unused_rspack_module, exports) {
|
|
7967
|
+
"use strict";
|
|
7968
|
+
|
|
7969
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7970
|
+
exports["default"] = () => Math.random().toString(16).slice(2);
|
|
7971
7971
|
|
|
7972
7972
|
|
|
7973
7973
|
},
|
|
@@ -16087,8 +16087,13 @@ const SAFETY_BUFFER_PERCENT = 0.01 / 100; // 0.01%
|
|
|
16087
16087
|
var _this = this;
|
|
16088
16088
|
ow__rspack_import_4_default()(options, ow__rspack_import_4_default().object.exactShape({
|
|
16089
16089
|
limit: (ow__rspack_import_4_default().optional.number.not.negative),
|
|
16090
|
-
exclusiveStartId: (ow__rspack_import_4_default().optional.string)
|
|
16091
|
-
|
|
16090
|
+
exclusiveStartId: (ow__rspack_import_4_default().optional.string),
|
|
16091
|
+
cursor: (ow__rspack_import_4_default().optional.string),
|
|
16092
|
+
filter: ow__rspack_import_4_default().optional.array.ofType(ow__rspack_import_4_default().string.oneOf([
|
|
16093
|
+
'locked',
|
|
16094
|
+
'pending'
|
|
16095
|
+
])).minLength(1)
|
|
16096
|
+
}).validate((0,_utils__rspack_import_3.mutuallyExclusive)('exclusiveStartId', 'cursor')));
|
|
16092
16097
|
const getPaginatedList = async function() {
|
|
16093
16098
|
let rqListOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
16094
16099
|
const response = await _this.httpClient.call({
|
|
@@ -16097,6 +16102,7 @@ const SAFETY_BUFFER_PERCENT = 0.01 / 100; // 0.01%
|
|
|
16097
16102
|
timeout: Math.min(_base_resource_client__rspack_import_2.MEDIUM_TIMEOUT_MILLIS, _this.timeoutMillis ?? Infinity),
|
|
16098
16103
|
params: _this._params({
|
|
16099
16104
|
...rqListOptions,
|
|
16105
|
+
filter: rqListOptions.filter ? rqListOptions.filter.join(',') : undefined,
|
|
16100
16106
|
clientKey: _this.clientKey
|
|
16101
16107
|
})
|
|
16102
16108
|
});
|
|
@@ -16110,13 +16116,15 @@ const SAFETY_BUFFER_PERCENT = 0.01 / 100; // 0.01%
|
|
|
16110
16116
|
// RQ API response does not indicate whether there are more requests left, so we have to try and in case
|
|
16111
16117
|
// of exhausting all requests we get response with empty items which ends the loop.
|
|
16112
16118
|
while(currentPage.items.length > 0 && // Continue only if at least some items were returned in the last page.
|
|
16119
|
+
currentPage.nextCursor && // Continue only if the API returned a cursor for the next page.
|
|
16113
16120
|
(remainingItems === undefined || remainingItems > 0 // Continue only if the limit was not exceeded.
|
|
16114
16121
|
)){
|
|
16115
|
-
const exclusiveStartId = currentPage.items[currentPage.items.length - 1].id;
|
|
16116
16122
|
const newOptions = {
|
|
16117
16123
|
...options,
|
|
16118
16124
|
limit: remainingItems,
|
|
16119
|
-
exclusiveStartId
|
|
16125
|
+
// remove original exclusiveStartId, if there was any, and use cursor-based pagination
|
|
16126
|
+
exclusiveStartId: undefined,
|
|
16127
|
+
cursor: currentPage.nextCursor
|
|
16120
16128
|
};
|
|
16121
16129
|
currentPage = await getPaginatedList(newOptions);
|
|
16122
16130
|
yield* currentPage.items;
|
|
@@ -16169,13 +16177,22 @@ const SAFETY_BUFFER_PERCENT = 0.01 / 100; // 0.01%
|
|
|
16169
16177
|
ow__rspack_import_4_default()(options, ow__rspack_import_4_default().object.exactShape({
|
|
16170
16178
|
limit: (ow__rspack_import_4_default().optional.number.not.negative),
|
|
16171
16179
|
maxPageLimit: (ow__rspack_import_4_default().optional.number),
|
|
16172
|
-
exclusiveStartId: (ow__rspack_import_4_default().optional.string)
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16176
|
-
|
|
16180
|
+
exclusiveStartId: (ow__rspack_import_4_default().optional.string),
|
|
16181
|
+
cursor: (ow__rspack_import_4_default().optional.string),
|
|
16182
|
+
filter: ow__rspack_import_4_default().optional.array.ofType(ow__rspack_import_4_default().string.oneOf([
|
|
16183
|
+
'locked',
|
|
16184
|
+
'pending'
|
|
16185
|
+
])).minLength(1)
|
|
16186
|
+
}).validate((0,_utils__rspack_import_3.mutuallyExclusive)('exclusiveStartId', 'cursor')));
|
|
16187
|
+
const { limit, exclusiveStartId, cursor, filter, maxPageLimit = DEFAULT_REQUEST_QUEUE_REQUEST_PAGE_LIMIT } = options;
|
|
16188
|
+
return new _utils__rspack_import_3.RequestQueuePaginationIterator({
|
|
16189
|
+
getPage: async (pageOptions)=>this.listRequests({
|
|
16190
|
+
...pageOptions,
|
|
16191
|
+
filter
|
|
16192
|
+
}),
|
|
16177
16193
|
limit,
|
|
16178
16194
|
exclusiveStartId,
|
|
16195
|
+
cursor,
|
|
16179
16196
|
maxPageLimit
|
|
16180
16197
|
});
|
|
16181
16198
|
}
|
|
@@ -17854,7 +17871,7 @@ class Statistics {
|
|
|
17854
17871
|
"use strict";
|
|
17855
17872
|
__webpack_require__.r(__webpack_exports__);
|
|
17856
17873
|
__webpack_require__.d(__webpack_exports__, {
|
|
17857
|
-
|
|
17874
|
+
RequestQueuePaginationIterator: () => (RequestQueuePaginationIterator),
|
|
17858
17875
|
applyQueryParamsToUrl: () => (applyQueryParamsToUrl),
|
|
17859
17876
|
asArray: () => (asArray),
|
|
17860
17877
|
cast: () => (cast),
|
|
@@ -17864,6 +17881,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
17864
17881
|
isNode: () => (isNode),
|
|
17865
17882
|
isStream: () => (isStream),
|
|
17866
17883
|
maybeGzipValue: () => (maybeGzipValue),
|
|
17884
|
+
mutuallyExclusive: () => (mutuallyExclusive),
|
|
17867
17885
|
parseDateFields: () => (parseDateFields),
|
|
17868
17886
|
pluckData: () => (pluckData),
|
|
17869
17887
|
sliceArrayByByteLength: () => (sliceArrayByByteLength),
|
|
@@ -18002,7 +18020,7 @@ function isStream(value) {
|
|
|
18002
18020
|
function getVersionData() {
|
|
18003
18021
|
if (true) {
|
|
18004
18022
|
return {
|
|
18005
|
-
version: "2.23.2-beta.
|
|
18023
|
+
version: "2.23.2-beta.2"
|
|
18006
18024
|
};
|
|
18007
18025
|
}
|
|
18008
18026
|
// eslint-disable-next-line
|
|
@@ -18012,24 +18030,27 @@ _computedKey = Symbol.asyncIterator;
|
|
|
18012
18030
|
let _computedKey1 = _computedKey;
|
|
18013
18031
|
/**
|
|
18014
18032
|
* Helper class to create async iterators from paginated list endpoints with exclusive start key.
|
|
18015
|
-
*/ class
|
|
18033
|
+
*/ class RequestQueuePaginationIterator {
|
|
18016
18034
|
async *[_computedKey1]() {
|
|
18017
|
-
let
|
|
18035
|
+
let nextCursor = this.cursor;
|
|
18036
|
+
// allow using exclusiveStartId for the first page, but then we'll delete it to avoid using it for any later page
|
|
18037
|
+
let nextExclusiveStartId = this.exclusiveStartId;
|
|
18018
18038
|
let iterateItemCount = 0;
|
|
18019
18039
|
while(true){
|
|
18020
18040
|
const pageLimit = this.limit ? Math.min(this.maxPageLimit, this.limit - iterateItemCount) : this.maxPageLimit;
|
|
18021
|
-
const pageExclusiveStartId = nextPageExclusiveStartId || this.exclusiveStartId;
|
|
18022
18041
|
const page = await this.getPage({
|
|
18023
18042
|
limit: pageLimit,
|
|
18024
|
-
|
|
18043
|
+
cursor: nextCursor,
|
|
18044
|
+
exclusiveStartId: nextExclusiveStartId
|
|
18025
18045
|
});
|
|
18026
18046
|
// There are no more pages to iterate
|
|
18027
18047
|
if (page.items.length === 0) return;
|
|
18028
18048
|
yield page;
|
|
18029
18049
|
iterateItemCount += page.items.length;
|
|
18030
18050
|
// Limit reached stopping to iterate
|
|
18031
|
-
if (this.limit && iterateItemCount >= this.limit) return;
|
|
18032
|
-
|
|
18051
|
+
if (this.limit && iterateItemCount >= this.limit || !page.nextCursor) return;
|
|
18052
|
+
nextCursor = page.nextCursor;
|
|
18053
|
+
nextExclusiveStartId = undefined; // see comment above - delete it for any page after the first one, and paginate with cursor
|
|
18033
18054
|
}
|
|
18034
18055
|
}
|
|
18035
18056
|
constructor(options){
|
|
@@ -18037,9 +18058,11 @@ let _computedKey1 = _computedKey;
|
|
|
18037
18058
|
(0,_swc_helpers_define_property__rspack_import_1._)(this, "getPage", void 0);
|
|
18038
18059
|
(0,_swc_helpers_define_property__rspack_import_1._)(this, "limit", void 0);
|
|
18039
18060
|
(0,_swc_helpers_define_property__rspack_import_1._)(this, "exclusiveStartId", void 0);
|
|
18061
|
+
(0,_swc_helpers_define_property__rspack_import_1._)(this, "cursor", void 0);
|
|
18040
18062
|
this.maxPageLimit = options.maxPageLimit;
|
|
18041
18063
|
this.limit = options.limit;
|
|
18042
18064
|
this.exclusiveStartId = options.exclusiveStartId;
|
|
18065
|
+
this.cursor = options.cursor;
|
|
18043
18066
|
this.getPage = options.getPage;
|
|
18044
18067
|
}
|
|
18045
18068
|
}
|
|
@@ -18069,6 +18092,18 @@ function asArray(value) {
|
|
|
18069
18092
|
}
|
|
18070
18093
|
return url;
|
|
18071
18094
|
}
|
|
18095
|
+
const mutuallyExclusive = function() {
|
|
18096
|
+
for(var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++){
|
|
18097
|
+
keys[_key] = arguments[_key];
|
|
18098
|
+
}
|
|
18099
|
+
return (value)=>{
|
|
18100
|
+
const presentKeys = keys.filter((key)=>typeof value[key] !== 'undefined');
|
|
18101
|
+
return {
|
|
18102
|
+
validator: presentKeys.length <= 1,
|
|
18103
|
+
message: `At most one of the following fields is allowed: ${keys.join(', ')}`
|
|
18104
|
+
};
|
|
18105
|
+
};
|
|
18106
|
+
};
|
|
18072
18107
|
|
|
18073
18108
|
|
|
18074
18109
|
},
|
|
@@ -19748,10 +19783,8 @@ var FORBIDDEN_USERNAMES_REGEXPS = [
|
|
|
19748
19783
|
"reel",
|
|
19749
19784
|
"video-reel",
|
|
19750
19785
|
"mcp",
|
|
19751
|
-
"mcpc",
|
|
19752
19786
|
"model-context-protocol",
|
|
19753
19787
|
"modelcontextprotocol",
|
|
19754
|
-
// 'apify.com' intentionally unescaped so "." matches any character, also blocking variants like "apify_com" or "apifyxcom"
|
|
19755
19788
|
"apify.com",
|
|
19756
19789
|
"design-kit",
|
|
19757
19790
|
"press-kit",
|
|
@@ -19819,8 +19852,6 @@ var FORBIDDEN_USERNAMES_REGEXPS = [
|
|
|
19819
19852
|
"trust-center",
|
|
19820
19853
|
"security-center",
|
|
19821
19854
|
// Brand protection / impersonation prevention
|
|
19822
|
-
"brand",
|
|
19823
|
-
"branding",
|
|
19824
19855
|
"verified",
|
|
19825
19856
|
"apify-support",
|
|
19826
19857
|
"apify-team",
|
|
@@ -21779,20 +21810,18 @@ const factory = (env) => {
|
|
|
21779
21810
|
test(() => {
|
|
21780
21811
|
let duplexAccessed = false;
|
|
21781
21812
|
|
|
21782
|
-
const
|
|
21783
|
-
|
|
21813
|
+
const body = new ReadableStream();
|
|
21814
|
+
|
|
21815
|
+
const hasContentType = new Request(_platform_index_js__rspack_import_1["default"].origin, {
|
|
21816
|
+
body,
|
|
21784
21817
|
method: 'POST',
|
|
21785
21818
|
get duplex() {
|
|
21786
21819
|
duplexAccessed = true;
|
|
21787
21820
|
return 'half';
|
|
21788
21821
|
},
|
|
21789
|
-
});
|
|
21822
|
+
}).headers.has('Content-Type');
|
|
21790
21823
|
|
|
21791
|
-
|
|
21792
|
-
|
|
21793
|
-
if (request.body != null) {
|
|
21794
|
-
request.body.cancel();
|
|
21795
|
-
}
|
|
21824
|
+
body.cancel();
|
|
21796
21825
|
|
|
21797
21826
|
return duplexAccessed && !hasContentType;
|
|
21798
21827
|
});
|
|
@@ -21936,19 +21965,6 @@ const factory = (env) => {
|
|
|
21936
21965
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
21937
21966
|
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
|
21938
21967
|
|
|
21939
|
-
// If data is FormData and Content-Type is multipart/form-data without boundary,
|
|
21940
|
-
// delete it so fetch can set it correctly with the boundary
|
|
21941
|
-
if (_utils_js__rspack_import_0["default"].isFormData(data)) {
|
|
21942
|
-
const contentType = headers.getContentType();
|
|
21943
|
-
if (
|
|
21944
|
-
contentType &&
|
|
21945
|
-
/^multipart\/form-data/i.test(contentType) &&
|
|
21946
|
-
!/boundary=/i.test(contentType)
|
|
21947
|
-
) {
|
|
21948
|
-
headers.delete('content-type');
|
|
21949
|
-
}
|
|
21950
|
-
}
|
|
21951
|
-
|
|
21952
21968
|
const resolvedOptions = {
|
|
21953
21969
|
...fetchOptions,
|
|
21954
21970
|
signal: composedSignal,
|
|
@@ -22935,40 +22951,40 @@ class AxiosError extends Error {
|
|
|
22935
22951
|
return axiosError;
|
|
22936
22952
|
}
|
|
22937
22953
|
|
|
22938
|
-
|
|
22939
|
-
|
|
22940
|
-
|
|
22941
|
-
|
|
22942
|
-
|
|
22943
|
-
|
|
22944
|
-
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
|
|
22962
|
-
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
|
|
22966
|
-
|
|
22967
|
-
|
|
22968
|
-
|
|
22969
|
-
|
|
22954
|
+
/**
|
|
22955
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
22956
|
+
*
|
|
22957
|
+
* @param {string} message The error message.
|
|
22958
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
22959
|
+
* @param {Object} [config] The config.
|
|
22960
|
+
* @param {Object} [request] The request.
|
|
22961
|
+
* @param {Object} [response] The response.
|
|
22962
|
+
*
|
|
22963
|
+
* @returns {Error} The created error.
|
|
22964
|
+
*/
|
|
22965
|
+
constructor(message, code, config, request, response) {
|
|
22966
|
+
super(message);
|
|
22967
|
+
|
|
22968
|
+
// Make message enumerable to maintain backward compatibility
|
|
22969
|
+
// The native Error constructor sets message as non-enumerable,
|
|
22970
|
+
// but axios < v1.13.3 had it as enumerable
|
|
22971
|
+
Object.defineProperty(this, 'message', {
|
|
22972
|
+
value: message,
|
|
22973
|
+
enumerable: true,
|
|
22974
|
+
writable: true,
|
|
22975
|
+
configurable: true
|
|
22976
|
+
});
|
|
22977
|
+
|
|
22978
|
+
this.name = 'AxiosError';
|
|
22979
|
+
this.isAxiosError = true;
|
|
22980
|
+
code && (this.code = code);
|
|
22981
|
+
config && (this.config = config);
|
|
22982
|
+
request && (this.request = request);
|
|
22983
|
+
if (response) {
|
|
22984
|
+
this.response = response;
|
|
22985
|
+
this.status = response.status;
|
|
22986
|
+
}
|
|
22970
22987
|
}
|
|
22971
|
-
}
|
|
22972
22988
|
|
|
22973
22989
|
toJSON() {
|
|
22974
22990
|
return {
|
|
@@ -23004,7 +23020,6 @@ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
|
23004
23020
|
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
23005
23021
|
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
23006
23022
|
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
23007
|
-
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
23008
23023
|
|
|
23009
23024
|
/* export default */ const __rspack_default_export = (AxiosError);
|
|
23010
23025
|
|
|
@@ -23025,41 +23040,41 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
23025
23040
|
|
|
23026
23041
|
const $internals = Symbol('internals');
|
|
23027
23042
|
|
|
23028
|
-
const
|
|
23029
|
-
|
|
23030
|
-
function trimSPorHTAB(str) {
|
|
23031
|
-
let start = 0;
|
|
23032
|
-
let end = str.length;
|
|
23043
|
+
const isValidHeaderValue = (value) => !/[\r\n]/.test(value);
|
|
23033
23044
|
|
|
23034
|
-
|
|
23035
|
-
|
|
23045
|
+
function assertValidHeaderValue(value, header) {
|
|
23046
|
+
if (value === false || value == null) {
|
|
23047
|
+
return;
|
|
23048
|
+
}
|
|
23036
23049
|
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
|
|
23050
|
+
if (_utils_js__rspack_import_0["default"].isArray(value)) {
|
|
23051
|
+
value.forEach((v) => assertValidHeaderValue(v, header));
|
|
23052
|
+
return;
|
|
23053
|
+
}
|
|
23040
23054
|
|
|
23041
|
-
|
|
23055
|
+
if (!isValidHeaderValue(String(value))) {
|
|
23056
|
+
throw new Error(`Invalid character in header content ["${header}"]`);
|
|
23042
23057
|
}
|
|
23058
|
+
}
|
|
23059
|
+
|
|
23060
|
+
function normalizeHeader(header) {
|
|
23061
|
+
return header && String(header).trim().toLowerCase();
|
|
23062
|
+
}
|
|
23063
|
+
|
|
23064
|
+
function stripTrailingCRLF(str) {
|
|
23065
|
+
let end = str.length;
|
|
23043
23066
|
|
|
23044
|
-
while (end >
|
|
23045
|
-
const
|
|
23067
|
+
while (end > 0) {
|
|
23068
|
+
const charCode = str.charCodeAt(end - 1);
|
|
23046
23069
|
|
|
23047
|
-
if (
|
|
23070
|
+
if (charCode !== 10 && charCode !== 13) {
|
|
23048
23071
|
break;
|
|
23049
23072
|
}
|
|
23050
23073
|
|
|
23051
23074
|
end -= 1;
|
|
23052
23075
|
}
|
|
23053
23076
|
|
|
23054
|
-
return
|
|
23055
|
-
}
|
|
23056
|
-
|
|
23057
|
-
function normalizeHeader(header) {
|
|
23058
|
-
return header && String(header).trim().toLowerCase();
|
|
23059
|
-
}
|
|
23060
|
-
|
|
23061
|
-
function sanitizeHeaderValue(str) {
|
|
23062
|
-
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
|
|
23077
|
+
return end === str.length ? str : str.slice(0, end);
|
|
23063
23078
|
}
|
|
23064
23079
|
|
|
23065
23080
|
function normalizeValue(value) {
|
|
@@ -23067,7 +23082,7 @@ function normalizeValue(value) {
|
|
|
23067
23082
|
return value;
|
|
23068
23083
|
}
|
|
23069
23084
|
|
|
23070
|
-
return _utils_js__rspack_import_0["default"].isArray(value) ? value.map(normalizeValue) :
|
|
23085
|
+
return _utils_js__rspack_import_0["default"].isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
|
|
23071
23086
|
}
|
|
23072
23087
|
|
|
23073
23088
|
function parseTokens(str) {
|
|
@@ -23149,6 +23164,7 @@ class AxiosHeaders {
|
|
|
23149
23164
|
_rewrite === true ||
|
|
23150
23165
|
(_rewrite === undefined && self[key] !== false)
|
|
23151
23166
|
) {
|
|
23167
|
+
assertValidHeaderValue(_value, _header);
|
|
23152
23168
|
self[key || _header] = normalizeValue(_value);
|
|
23153
23169
|
}
|
|
23154
23170
|
}
|
|
@@ -23505,7 +23521,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
23505
23521
|
*/
|
|
23506
23522
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
23507
23523
|
let isRelativeUrl = !(0,_helpers_isAbsoluteURL_js__rspack_import_0["default"])(requestedURL);
|
|
23508
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls
|
|
23524
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
23509
23525
|
return (0,_helpers_combineURLs_js__rspack_import_1["default"])(baseURL, requestedURL);
|
|
23510
23526
|
}
|
|
23511
23527
|
return requestedURL;
|
|
@@ -23671,9 +23687,9 @@ function mergeConfig(config1, config2) {
|
|
|
23671
23687
|
|
|
23672
23688
|
// eslint-disable-next-line consistent-return
|
|
23673
23689
|
function mergeDirectKeys(a, b, prop) {
|
|
23674
|
-
if (
|
|
23690
|
+
if (prop in config2) {
|
|
23675
23691
|
return getMergedValue(a, b);
|
|
23676
|
-
} else if (
|
|
23692
|
+
} else if (prop in config1) {
|
|
23677
23693
|
return getMergedValue(undefined, a);
|
|
23678
23694
|
}
|
|
23679
23695
|
}
|
|
@@ -23714,9 +23730,7 @@ function mergeConfig(config1, config2) {
|
|
|
23714
23730
|
_utils_js__rspack_import_1["default"].forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
23715
23731
|
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
23716
23732
|
const merge = _utils_js__rspack_import_1["default"].hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
23717
|
-
const
|
|
23718
|
-
const b = _utils_js__rspack_import_1["default"].hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
|
23719
|
-
const configValue = merge(a, b, prop);
|
|
23733
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
23720
23734
|
(_utils_js__rspack_import_1["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
23721
23735
|
});
|
|
23722
23736
|
|
|
@@ -23829,8 +23843,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
23829
23843
|
|
|
23830
23844
|
|
|
23831
23845
|
|
|
23832
|
-
const own = (obj, key) => (obj != null && _utils_js__rspack_import_0["default"].hasOwnProp(obj, key) ? obj[key] : undefined);
|
|
23833
|
-
|
|
23834
23846
|
/**
|
|
23835
23847
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
23836
23848
|
* of the input
|
|
@@ -23898,22 +23910,20 @@ const defaults = {
|
|
|
23898
23910
|
let isFileList;
|
|
23899
23911
|
|
|
23900
23912
|
if (isObjectPayload) {
|
|
23901
|
-
const formSerializer = own(this, 'formSerializer');
|
|
23902
23913
|
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
23903
|
-
return (0,_helpers_toURLEncodedForm_js__rspack_import_3["default"])(data, formSerializer).toString();
|
|
23914
|
+
return (0,_helpers_toURLEncodedForm_js__rspack_import_3["default"])(data, this.formSerializer).toString();
|
|
23904
23915
|
}
|
|
23905
23916
|
|
|
23906
23917
|
if (
|
|
23907
23918
|
(isFileList = _utils_js__rspack_import_0["default"].isFileList(data)) ||
|
|
23908
23919
|
contentType.indexOf('multipart/form-data') > -1
|
|
23909
23920
|
) {
|
|
23910
|
-
const
|
|
23911
|
-
const _FormData = env && env.FormData;
|
|
23921
|
+
const _FormData = this.env && this.env.FormData;
|
|
23912
23922
|
|
|
23913
23923
|
return (0,_helpers_toFormData_js__rspack_import_4["default"])(
|
|
23914
23924
|
isFileList ? { 'files[]': data } : data,
|
|
23915
23925
|
_FormData && new _FormData(),
|
|
23916
|
-
formSerializer
|
|
23926
|
+
this.formSerializer
|
|
23917
23927
|
);
|
|
23918
23928
|
}
|
|
23919
23929
|
}
|
|
@@ -23929,10 +23939,9 @@ const defaults = {
|
|
|
23929
23939
|
|
|
23930
23940
|
transformResponse: [
|
|
23931
23941
|
function transformResponse(data) {
|
|
23932
|
-
const transitional =
|
|
23942
|
+
const transitional = this.transitional || defaults.transitional;
|
|
23933
23943
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
23934
|
-
const
|
|
23935
|
-
const JSONRequested = responseType === 'json';
|
|
23944
|
+
const JSONRequested = this.responseType === 'json';
|
|
23936
23945
|
|
|
23937
23946
|
if (_utils_js__rspack_import_0["default"].isResponse(data) || _utils_js__rspack_import_0["default"].isReadableStream(data)) {
|
|
23938
23947
|
return data;
|
|
@@ -23941,17 +23950,17 @@ const defaults = {
|
|
|
23941
23950
|
if (
|
|
23942
23951
|
data &&
|
|
23943
23952
|
_utils_js__rspack_import_0["default"].isString(data) &&
|
|
23944
|
-
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
23953
|
+
((forcedJSONParsing && !this.responseType) || JSONRequested)
|
|
23945
23954
|
) {
|
|
23946
23955
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
23947
23956
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
23948
23957
|
|
|
23949
23958
|
try {
|
|
23950
|
-
return JSON.parse(data,
|
|
23959
|
+
return JSON.parse(data, this.parseReviver);
|
|
23951
23960
|
} catch (e) {
|
|
23952
23961
|
if (strictJSONParsing) {
|
|
23953
23962
|
if (e.name === 'SyntaxError') {
|
|
23954
|
-
throw _core_AxiosError_js__rspack_import_5["default"].from(e, _core_AxiosError_js__rspack_import_5["default"].ERR_BAD_RESPONSE, this, null,
|
|
23963
|
+
throw _core_AxiosError_js__rspack_import_5["default"].from(e, _core_AxiosError_js__rspack_import_5["default"].ERR_BAD_RESPONSE, this, null, this.response);
|
|
23955
23964
|
}
|
|
23956
23965
|
throw e;
|
|
23957
23966
|
}
|
|
@@ -24022,7 +24031,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24022
24031
|
__webpack_require__.d(__webpack_exports__, {
|
|
24023
24032
|
VERSION: () => (VERSION)
|
|
24024
24033
|
});
|
|
24025
|
-
const VERSION = "1.15.
|
|
24034
|
+
const VERSION = "1.15.0";
|
|
24026
24035
|
|
|
24027
24036
|
},
|
|
24028
24037
|
5267(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
@@ -24052,8 +24061,9 @@ function encode(str) {
|
|
|
24052
24061
|
')': '%29',
|
|
24053
24062
|
'~': '%7E',
|
|
24054
24063
|
'%20': '+',
|
|
24064
|
+
'%00': '\x00',
|
|
24055
24065
|
};
|
|
24056
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
24066
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
24057
24067
|
return charMap[match];
|
|
24058
24068
|
});
|
|
24059
24069
|
}
|
|
@@ -24500,9 +24510,7 @@ function formDataToJSON(formData) {
|
|
|
24500
24510
|
|
|
24501
24511
|
if (isLast) {
|
|
24502
24512
|
if (_utils_js__rspack_import_0["default"].hasOwnProp(target, name)) {
|
|
24503
|
-
target[name] =
|
|
24504
|
-
? target[name].concat(value)
|
|
24505
|
-
: [target[name], value];
|
|
24513
|
+
target[name] = [target[name], value];
|
|
24506
24514
|
} else {
|
|
24507
24515
|
target[name] = value;
|
|
24508
24516
|
}
|
|
@@ -24743,13 +24751,13 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
24743
24751
|
const _speedometer = (0,_speedometer_js__rspack_import_0["default"])(50, 250);
|
|
24744
24752
|
|
|
24745
24753
|
return (0,_throttle_js__rspack_import_1["default"])((e) => {
|
|
24746
|
-
const
|
|
24754
|
+
const loaded = e.loaded;
|
|
24747
24755
|
const total = e.lengthComputable ? e.total : undefined;
|
|
24748
|
-
const
|
|
24749
|
-
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
24756
|
+
const progressBytes = loaded - bytesNotified;
|
|
24750
24757
|
const rate = _speedometer(progressBytes);
|
|
24758
|
+
const inRange = loaded <= total;
|
|
24751
24759
|
|
|
24752
|
-
bytesNotified =
|
|
24760
|
+
bytesNotified = loaded;
|
|
24753
24761
|
|
|
24754
24762
|
const data = {
|
|
24755
24763
|
loaded,
|
|
@@ -24757,7 +24765,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
24757
24765
|
progress: total ? loaded / total : undefined,
|
|
24758
24766
|
bytes: progressBytes,
|
|
24759
24767
|
rate: rate ? rate : undefined,
|
|
24760
|
-
estimated: rate && total ? (total - loaded) / rate : undefined,
|
|
24768
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
24761
24769
|
event: e,
|
|
24762
24770
|
lengthComputable: total != null,
|
|
24763
24771
|
[isDownloadStream ? 'download' : 'upload']: true,
|
|
@@ -24858,18 +24866,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
24858
24866
|
// Specifically not if we're in a web worker, or react-native.
|
|
24859
24867
|
|
|
24860
24868
|
if (_platform_index_js__rspack_import_5["default"].hasStandardBrowserEnv) {
|
|
24861
|
-
|
|
24862
|
-
withXSRFToken = withXSRFToken(newConfig);
|
|
24863
|
-
}
|
|
24864
|
-
|
|
24865
|
-
// Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
|
|
24866
|
-
// and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
|
|
24867
|
-
// the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
|
|
24868
|
-
const shouldSendXSRF =
|
|
24869
|
-
withXSRFToken === true ||
|
|
24870
|
-
(withXSRFToken == null && (0,_isURLSameOrigin_js__rspack_import_6["default"])(newConfig.url));
|
|
24869
|
+
withXSRFToken && _utils_js__rspack_import_4["default"].isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
24871
24870
|
|
|
24872
|
-
if (
|
|
24871
|
+
if (withXSRFToken || (withXSRFToken !== false && (0,_isURLSameOrigin_js__rspack_import_6["default"])(newConfig.url))) {
|
|
24872
|
+
// Add xsrf header
|
|
24873
24873
|
const xsrfValue = xsrfHeaderName && xsrfCookieName && _cookies_js__rspack_import_7["default"].read(xsrfCookieName);
|
|
24874
24874
|
|
|
24875
24875
|
if (xsrfValue) {
|
|
@@ -25164,7 +25164,6 @@ function toFormData(obj, formData, options) {
|
|
|
25164
25164
|
const dots = options.dots;
|
|
25165
25165
|
const indexes = options.indexes;
|
|
25166
25166
|
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
25167
|
-
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
25168
25167
|
const useBlob = _Blob && _utils_js__rspack_import_0["default"].isSpecCompliantForm(formData);
|
|
25169
25168
|
|
|
25170
25169
|
if (!_utils_js__rspack_import_0["default"].isFunction(visitor)) {
|
|
@@ -25257,16 +25256,9 @@ function toFormData(obj, formData, options) {
|
|
|
25257
25256
|
isVisitable,
|
|
25258
25257
|
});
|
|
25259
25258
|
|
|
25260
|
-
function build(value, path
|
|
25259
|
+
function build(value, path) {
|
|
25261
25260
|
if (_utils_js__rspack_import_0["default"].isUndefined(value)) return;
|
|
25262
25261
|
|
|
25263
|
-
if (depth > maxDepth) {
|
|
25264
|
-
throw new _core_AxiosError_js__rspack_import_2["default"](
|
|
25265
|
-
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
25266
|
-
_core_AxiosError_js__rspack_import_2["default"].ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
25267
|
-
);
|
|
25268
|
-
}
|
|
25269
|
-
|
|
25270
25262
|
if (stack.indexOf(value) !== -1) {
|
|
25271
25263
|
throw Error('Circular reference detected in ' + path.join('.'));
|
|
25272
25264
|
}
|
|
@@ -25279,7 +25271,7 @@ function toFormData(obj, formData, options) {
|
|
|
25279
25271
|
visitor.call(formData, el, _utils_js__rspack_import_0["default"].isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
25280
25272
|
|
|
25281
25273
|
if (result === true) {
|
|
25282
|
-
build(el, path ? path.concat(key) : [key]
|
|
25274
|
+
build(el, path ? path.concat(key) : [key]);
|
|
25283
25275
|
}
|
|
25284
25276
|
});
|
|
25285
25277
|
|
|
@@ -25958,16 +25950,16 @@ const G = getGlobal();
|
|
|
25958
25950
|
const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
25959
25951
|
|
|
25960
25952
|
const isFormData = (thing) => {
|
|
25961
|
-
|
|
25962
|
-
|
|
25963
|
-
|
|
25964
|
-
|
|
25965
|
-
|
|
25966
|
-
|
|
25967
|
-
|
|
25968
|
-
|
|
25969
|
-
|
|
25970
|
-
|
|
25953
|
+
let kind;
|
|
25954
|
+
return thing && (
|
|
25955
|
+
(FormDataCtor && thing instanceof FormDataCtor) || (
|
|
25956
|
+
isFunction(thing.append) && (
|
|
25957
|
+
(kind = kindOf(thing)) === 'formdata' ||
|
|
25958
|
+
// detect form-data instance
|
|
25959
|
+
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
|
|
25960
|
+
)
|
|
25961
|
+
)
|
|
25962
|
+
);
|
|
25971
25963
|
};
|
|
25972
25964
|
|
|
25973
25965
|
/**
|
|
@@ -26623,7 +26615,7 @@ const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
|
26623
26615
|
},
|
|
26624
26616
|
8330(module) {
|
|
26625
26617
|
"use strict";
|
|
26626
|
-
module.exports = JSON.parse('{"name":"apify-client","version":"2.23.2-beta.
|
|
26618
|
+
module.exports = JSON.parse('{"name":"apify-client","version":"2.23.2-beta.2","description":"Apify API client for JavaScript","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","browser":"dist/bundle.js","unpkg":"dist/bundle.js","exports":{"./package.json":"./package.json","./browser":"./dist/bundle.js",".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./dist/index.d.ts","browser":"./dist/bundle.js"}},"keywords":["apify","api","apifier","crawler","scraper"],"author":{"name":"Apify","email":"support@apify.com","url":"https://apify.com"},"contributors":["Jan Curn <jan@apify.com>","Marek Trunkát <marek@apify.com>","Ondra Urban <ondra@apify.com>","Jakub Drobník <jakub.drobnik@apify.com>"],"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/apify/apify-client-js"},"bugs":{"url":"https://github.com/apify/apify-client-js/issues"},"homepage":"https://docs.apify.com/api/client/js/","files":["dist","!dist/*.tsbuildinfo"],"scripts":{"build":"pnpm clean && pnpm build:node && pnpm build:browser","postbuild":"gen-esm-wrapper dist/index.js dist/index.mjs","prepublishOnly":"(test $CI || (echo \\"Publishing is reserved to CI!\\"; exit 1))","clean":"rimraf dist","test":"pnpm build && vitest run","test:bundling":"pnpm build && pnpm --prefix=./test/bundling run bundle:all","lint":"eslint","lint:fix":"eslint --fix","tsc-check-tests":"tsc --noEmit --project test/tsconfig.json","format":"prettier --write .","format:check":"prettier --check .","build:node":"tsc","build:browser":"rsbuild build","preinstall":"npx only-allow pnpm"},"dependencies":{"@apify/consts":"^2.50.0","@apify/log":"^2.2.6","@apify/utilities":"^2.23.2","@crawlee/types":"^3.3.0","ansi-colors":"^4.1.1","async-retry":"^1.3.3","axios":"^1.6.7","content-type":"^1.0.5","ow":"^0.28.2","proxy-agent":"^6.5.0","tslib":"^2.5.0","type-fest":"^4.0.0"},"devDependencies":{"@apify/eslint-config":"^1.0.0","@apify/tsconfig":"^0.1.1","@crawlee/puppeteer":"^3.2.2","@rsbuild/core":"^1.3.6","@rsbuild/plugin-node-polyfill":"^1.3.0","@rspack/cli":"^1.7.6","@rspack/core":"^1.7.6","@stylistic/eslint-plugin-ts":"^4.2.0","@types/async-retry":"^1.4.5","@types/compression":"^1.8.1","@types/content-type":"^1.1.5","@types/express":"^5.0.0","@types/node":"^24.0.0","ajv":"^8.17.1","body-parser":"^2.0.0","compression":"^1.7.4","esbuild":"0.27.4","eslint":"^9.24.0","eslint-config-prettier":"^10.1.2","express":"^5.0.0","gen-esm-wrapper":"^1.1.2","globals":"^17.0.0","prettier":"^3.5.3","puppeteer":"^24.0.0","rimraf":"^6.0.0","rolldown":"^1.0.0-rc.4","typescript":"^5.8.3","typescript-eslint":"^8.29.1","vitest":"^4.0.16","webpack":"^5.105.2","webpack-cli":"^7.0.0"},"packageManager":"pnpm@10.24.0"}')
|
|
26627
26619
|
|
|
26628
26620
|
},
|
|
26629
26621
|
|