@plyaz/api 1.6.7 → 1.6.8
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/api/client/helpers/interceptors.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/upload/browser.d.ts +9 -0
- package/dist/api/upload/browser.d.ts.map +1 -0
- package/dist/api/upload/config.d.ts +9 -0
- package/dist/api/upload/config.d.ts.map +1 -0
- package/dist/api/upload/constants.d.ts +23 -0
- package/dist/api/upload/constants.d.ts.map +1 -0
- package/dist/api/upload/index.d.ts +24 -0
- package/dist/api/upload/index.d.ts.map +1 -0
- package/dist/api/upload/node.d.ts +9 -0
- package/dist/api/upload/node.d.ts.map +1 -0
- package/dist/api/upload/retry.d.ts +34 -0
- package/dist/api/upload/retry.d.ts.map +1 -0
- package/dist/api/upload/uploadWithProgress.d.ts +41 -0
- package/dist/api/upload/uploadWithProgress.d.ts.map +1 -0
- package/dist/api/upload/utils.d.ts +33 -0
- package/dist/api/upload/utils.d.ts.map +1 -0
- package/dist/entry-frontend.cjs +1 -1
- package/dist/entry-frontend.cjs.map +1 -1
- package/dist/entry-frontend.mjs +2 -2
- package/dist/entry-frontend.mjs.map +1 -1
- package/dist/index.cjs +561 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +562 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiPackageError as ApiPackageError$1, emitScopedErrorEvent, generateCorrelationId, generateRequestId, generateTraceCorrelationId, registerEventFactory, registerErrorHandler as registerErrorHandler$1, registerScopedHandlers, setErrorHandlers as setErrorHandlers$1, getErrorHandlers as getErrorHandlers$1, unregisterScopedHandlers, clearErrorHandlers as clearErrorHandlers$1, registerOnceErrorHandler, isErrorSystemInitialized, setErrorLocale, addMessageCatalog, initializeErrorSystem } from '@plyaz/errors';
|
|
1
|
+
import { ApiPackageError as ApiPackageError$1, emitScopedErrorEvent, generateCorrelationId, generateRequestId, generateTraceCorrelationId, registerEventFactory, registerErrorHandler as registerErrorHandler$1, registerScopedHandlers, setErrorHandlers as setErrorHandlers$1, getErrorHandlers as getErrorHandlers$1, unregisterScopedHandlers, clearErrorHandlers as clearErrorHandlers$1, registerOnceErrorHandler, isErrorSystemInitialized, setErrorLocale, addMessageCatalog, initializeErrorSystem, getErrorCodeByStatus } from '@plyaz/errors';
|
|
2
2
|
export { getErrorCategory, getErrorCodeByStatus, getErrorDefinition } from '@plyaz/errors';
|
|
3
3
|
import { abortRequest as abortRequest$1, isSlowConnection as isSlowConnection$1, deleteCache as deleteCache$1, getCache as getCache$1, mutate, setCache as setCache$1, subscribe as subscribe$1, revalidateAll as revalidateAll$1, revalidate, setDefaultConfig, createApiFetcher } from 'fetchff';
|
|
4
4
|
export { removeRevalidators, revalidate, revalidateAll } from 'fetchff';
|
|
@@ -6,7 +6,7 @@ import { PRIORITY_LEVEL, EVENT_SCOPES_WITH_TEMPORARY, EVENT_NAMESPACES, HEADER_E
|
|
|
6
6
|
export { NETWORK_QUALITY, PUB_SUB_EVENT } from '@plyaz/types/api';
|
|
7
7
|
import { ApiLogger } from '@plyaz/logger';
|
|
8
8
|
import { LOGGER_SERVICES } from '@plyaz/types';
|
|
9
|
-
import { isDev, HTTP_STATUS, TIME_CONSTANTS, AWS_CLOUDFRONT_CONFIG, NUMERIC_CONSTANTS, MULTIPLIERS,
|
|
9
|
+
import { isDev, HTTP_STATUS, TIME_CONSTANTS, AWS_CLOUDFRONT_CONFIG, NUMERIC_CONSTANTS, MULTIPLIERS, MATH_CONSTANTS as MATH_CONSTANTS$1, RETRY_DELAYS, RETRY_BACKOFF, NUMBER_SYSTEM, NETWORK_SCORES, NETWORK_TIMEOUTS, RETRY_ATTEMPTS, DEDUPE_TIME, CACHE_STALE, CACHE_TTL, BATCH_SIZES, PAGE_SIZES, TIMEZONE_REGIONS, LOCALE_REGIONS_DETAILED, COUNTRY_REGIONS_DETAILED, DEFAULT_API_CONFIG, DEFAULT_API_CLIENT_OPTIONS } from '@plyaz/config';
|
|
10
10
|
import 'events';
|
|
11
11
|
import { INTERNAL_STATUS_CODES, API_ERROR_CODES as API_ERROR_CODES$1, COMMON_OPERATIONS } from '@plyaz/types/errors';
|
|
12
12
|
export { API_ERROR_CODES, ERROR_DEFINITIONS, COMMON_FIELDS as ERROR_FIELDS, COMMON_OPERATIONS as OPERATIONS, COMMON_STORAGE_TYPES as STORAGE_TYPES } from '@plyaz/types/errors';
|
|
@@ -21607,7 +21607,7 @@ function createOnErrorHandler(handlers, clearTemporaryOverrides2, clearOnComplet
|
|
|
21607
21607
|
const apiError = new ApiPackageError(
|
|
21608
21608
|
"request.failed",
|
|
21609
21609
|
PACKAGE_STATUS_CODES.REQUEST_FAILED,
|
|
21610
|
-
error.status ?
|
|
21610
|
+
error.status ? getErrorCodeByStatus(error.status) ?? API_ERROR_CODES.CLIENT_ERROR : API_ERROR_CODES.NETWORK_ERROR,
|
|
21611
21611
|
{
|
|
21612
21612
|
cause: error,
|
|
21613
21613
|
context: {
|
|
@@ -22233,6 +22233,546 @@ function applyQualityBasedConfiguration(resolvedConfig, quality, networkAware, n
|
|
|
22233
22233
|
}
|
|
22234
22234
|
}
|
|
22235
22235
|
__name(applyQualityBasedConfiguration, "applyQualityBasedConfiguration");
|
|
22236
|
+
var PROGRESS_CHUNK_SIZE_MULTIPLIER = 64;
|
|
22237
|
+
var UPLOAD_CONSTANTS = {
|
|
22238
|
+
DEFAULT_CHUNK_SIZE: PROGRESS_CHUNK_SIZE_MULTIPLIER * NUMBER_SYSTEM.BYTES_PER_KB,
|
|
22239
|
+
DEFAULT_THROTTLE_MS: TIME_CONSTANTS.HUNDRED_MS,
|
|
22240
|
+
DEFAULT_CONTENT_TYPE: "application/octet-stream",
|
|
22241
|
+
DEFAULT_TIMEOUT: TIME_CONSTANTS.TWO_MINUTES,
|
|
22242
|
+
DEFAULT_RETRY_DELAY: RETRY_DELAYS.SHORT,
|
|
22243
|
+
DEFAULT_RETRY_BACKOFF: RETRY_BACKOFF.MEDIUM,
|
|
22244
|
+
DEFAULT_RETRY_MAX_DELAY: RETRY_DELAYS.MAX,
|
|
22245
|
+
PROGRESS_PERCENTAGE_THRESHOLD: NUMERIC_CONSTANTS.FIVE,
|
|
22246
|
+
FULL_PERCENTAGE: MATH_CONSTANTS$1.PERCENTAGE_MAX,
|
|
22247
|
+
HTTPS_DEFAULT_PORT: TIME_CONSTANTS.HTTPS_PORT,
|
|
22248
|
+
HTTP_DEFAULT_PORT: TIME_CONSTANTS.HTTP_PORT,
|
|
22249
|
+
/** Max server error status code (exclusive boundary for 5xx range) */
|
|
22250
|
+
MAX_SERVER_ERROR_STATUS: 600
|
|
22251
|
+
};
|
|
22252
|
+
var RETRYABLE_ERROR_CODES = [
|
|
22253
|
+
"ETIMEDOUT",
|
|
22254
|
+
"ECONNRESET",
|
|
22255
|
+
"ECONNREFUSED",
|
|
22256
|
+
"ENOTFOUND",
|
|
22257
|
+
"ENETUNREACH",
|
|
22258
|
+
"EAI_AGAIN"
|
|
22259
|
+
];
|
|
22260
|
+
var RETRYABLE_MESSAGE_PATTERNS = [
|
|
22261
|
+
"timeout",
|
|
22262
|
+
"timed out",
|
|
22263
|
+
"network",
|
|
22264
|
+
"econnreset",
|
|
22265
|
+
"econnrefused",
|
|
22266
|
+
"etimedout",
|
|
22267
|
+
"service unavailable",
|
|
22268
|
+
"rate limit",
|
|
22269
|
+
"too many requests"
|
|
22270
|
+
];
|
|
22271
|
+
|
|
22272
|
+
// src/api/upload/config.ts
|
|
22273
|
+
function extractGlobalHeaders(globalConfig) {
|
|
22274
|
+
const globalHeaders = {};
|
|
22275
|
+
if (!globalConfig.headers || typeof globalConfig.headers !== "object") {
|
|
22276
|
+
return globalHeaders;
|
|
22277
|
+
}
|
|
22278
|
+
if (!("presets" in globalConfig.headers) && !("static" in globalConfig.headers)) {
|
|
22279
|
+
Object.entries(globalConfig.headers).forEach(([key, value]) => {
|
|
22280
|
+
if (typeof value === "string") {
|
|
22281
|
+
globalHeaders[key] = value;
|
|
22282
|
+
}
|
|
22283
|
+
});
|
|
22284
|
+
return globalHeaders;
|
|
22285
|
+
}
|
|
22286
|
+
if ("static" in globalConfig.headers) {
|
|
22287
|
+
const staticHeaders = globalConfig.headers.static;
|
|
22288
|
+
if (staticHeaders) {
|
|
22289
|
+
Object.entries(staticHeaders).forEach(([key, value]) => {
|
|
22290
|
+
if (typeof value === "string") {
|
|
22291
|
+
globalHeaders[key] = value;
|
|
22292
|
+
}
|
|
22293
|
+
});
|
|
22294
|
+
}
|
|
22295
|
+
}
|
|
22296
|
+
return globalHeaders;
|
|
22297
|
+
}
|
|
22298
|
+
__name(extractGlobalHeaders, "extractGlobalHeaders");
|
|
22299
|
+
function mergeRetryConfig(optionRetry, globalRetry) {
|
|
22300
|
+
if (optionRetry !== void 0) return optionRetry;
|
|
22301
|
+
if (globalRetry !== void 0) return globalRetry;
|
|
22302
|
+
return false;
|
|
22303
|
+
}
|
|
22304
|
+
__name(mergeRetryConfig, "mergeRetryConfig");
|
|
22305
|
+
function buildLocalConfig(options) {
|
|
22306
|
+
return {
|
|
22307
|
+
headers: options.headers ?? {},
|
|
22308
|
+
timeout: options.timeout ?? UPLOAD_CONSTANTS.DEFAULT_TIMEOUT,
|
|
22309
|
+
baseURL: options.baseURL,
|
|
22310
|
+
retry: options.retry ?? false,
|
|
22311
|
+
onError: options.onError,
|
|
22312
|
+
withCredentials: options.withCredentials ?? false
|
|
22313
|
+
};
|
|
22314
|
+
}
|
|
22315
|
+
__name(buildLocalConfig, "buildLocalConfig");
|
|
22316
|
+
function getMergedConfig(options) {
|
|
22317
|
+
if (options.useGlobalConfig === false) {
|
|
22318
|
+
return buildLocalConfig(options);
|
|
22319
|
+
}
|
|
22320
|
+
const globalConfig = getGlobalConfig();
|
|
22321
|
+
const globalHeaders = extractGlobalHeaders(globalConfig);
|
|
22322
|
+
return {
|
|
22323
|
+
headers: { ...globalHeaders, ...options.headers ?? {} },
|
|
22324
|
+
timeout: options.timeout ?? globalConfig.timeout ?? UPLOAD_CONSTANTS.DEFAULT_TIMEOUT,
|
|
22325
|
+
baseURL: options.baseURL ?? globalConfig.baseURL,
|
|
22326
|
+
retry: mergeRetryConfig(options.retry, globalConfig.retry),
|
|
22327
|
+
onError: options.onError,
|
|
22328
|
+
withCredentials: options.withCredentials ?? globalConfig.withCredentials ?? false
|
|
22329
|
+
};
|
|
22330
|
+
}
|
|
22331
|
+
__name(getMergedConfig, "getMergedConfig");
|
|
22332
|
+
function checkRetryableFlag(error) {
|
|
22333
|
+
if (typeof error.isRetryable === "function") return error.isRetryable();
|
|
22334
|
+
if (typeof error.isRetryable === "boolean") return error.isRetryable;
|
|
22335
|
+
if (typeof error.retryable === "boolean") return error.retryable;
|
|
22336
|
+
return void 0;
|
|
22337
|
+
}
|
|
22338
|
+
__name(checkRetryableFlag, "checkRetryableFlag");
|
|
22339
|
+
function isRetryableStatus(status) {
|
|
22340
|
+
if (status === void 0) return false;
|
|
22341
|
+
if (status === HTTP_STATUS.TOO_MANY_REQUESTS) return true;
|
|
22342
|
+
return status >= HTTP_STATUS.INTERNAL_SERVER_ERROR && status < UPLOAD_CONSTANTS.MAX_SERVER_ERROR_STATUS;
|
|
22343
|
+
}
|
|
22344
|
+
__name(isRetryableStatus, "isRetryableStatus");
|
|
22345
|
+
function hasRetryableErrorCode(error) {
|
|
22346
|
+
return Boolean(
|
|
22347
|
+
error.code && RETRYABLE_ERROR_CODES.includes(error.code)
|
|
22348
|
+
);
|
|
22349
|
+
}
|
|
22350
|
+
__name(hasRetryableErrorCode, "hasRetryableErrorCode");
|
|
22351
|
+
function hasRetryableMessage(error) {
|
|
22352
|
+
const message = error.message?.toLowerCase() ?? "";
|
|
22353
|
+
return RETRYABLE_MESSAGE_PATTERNS.some((pattern) => message.includes(pattern));
|
|
22354
|
+
}
|
|
22355
|
+
__name(hasRetryableMessage, "hasRetryableMessage");
|
|
22356
|
+
function isRetryableError(error, status) {
|
|
22357
|
+
if (!error) return false;
|
|
22358
|
+
const errorWithRetryable = error;
|
|
22359
|
+
const flagResult = checkRetryableFlag(errorWithRetryable);
|
|
22360
|
+
if (flagResult !== void 0) return flagResult;
|
|
22361
|
+
if (hasRetryableErrorCode(errorWithRetryable)) return true;
|
|
22362
|
+
if (hasRetryableMessage(error)) return true;
|
|
22363
|
+
const httpStatus = status ?? errorWithRetryable.statusCode;
|
|
22364
|
+
return isRetryableStatus(httpStatus);
|
|
22365
|
+
}
|
|
22366
|
+
__name(isRetryableError, "isRetryableError");
|
|
22367
|
+
function calculateRetryDelay(attempt, config) {
|
|
22368
|
+
const delay = config.delay ?? UPLOAD_CONSTANTS.DEFAULT_RETRY_DELAY;
|
|
22369
|
+
const backoff = config.backoff ?? UPLOAD_CONSTANTS.DEFAULT_RETRY_BACKOFF;
|
|
22370
|
+
const maxDelay = config.maxDelay ?? UPLOAD_CONSTANTS.DEFAULT_RETRY_MAX_DELAY;
|
|
22371
|
+
const calculatedDelay = delay * Math.pow(backoff, attempt);
|
|
22372
|
+
return Math.min(calculatedDelay, maxDelay);
|
|
22373
|
+
}
|
|
22374
|
+
__name(calculateRetryDelay, "calculateRetryDelay");
|
|
22375
|
+
function notifyRetryError(params) {
|
|
22376
|
+
const { ctx, message, status, statusText, cause } = params;
|
|
22377
|
+
if (!ctx.config.onError) return;
|
|
22378
|
+
ctx.config.onError({
|
|
22379
|
+
message,
|
|
22380
|
+
status,
|
|
22381
|
+
statusText,
|
|
22382
|
+
cause,
|
|
22383
|
+
retryable: true,
|
|
22384
|
+
attempt: ctx.attempt,
|
|
22385
|
+
maxAttempts: ctx.maxAttempts
|
|
22386
|
+
});
|
|
22387
|
+
}
|
|
22388
|
+
__name(notifyRetryError, "notifyRetryError");
|
|
22389
|
+
function notifyFinalError(ctx, error) {
|
|
22390
|
+
if (!ctx.config.onError) return;
|
|
22391
|
+
ctx.config.onError({
|
|
22392
|
+
message: error.message,
|
|
22393
|
+
cause: error,
|
|
22394
|
+
retryable: false,
|
|
22395
|
+
attempt: ctx.attempt,
|
|
22396
|
+
maxAttempts: ctx.maxAttempts
|
|
22397
|
+
});
|
|
22398
|
+
}
|
|
22399
|
+
__name(notifyFinalError, "notifyFinalError");
|
|
22400
|
+
function shouldRetryResult(result, config, attempt, maxAttempts) {
|
|
22401
|
+
if (result.success) return false;
|
|
22402
|
+
if (!config.retry) return false;
|
|
22403
|
+
if (attempt >= maxAttempts - 1) return false;
|
|
22404
|
+
return isRetryableError(new Error(result.statusText ?? "Upload failed"), result.status);
|
|
22405
|
+
}
|
|
22406
|
+
__name(shouldRetryResult, "shouldRetryResult");
|
|
22407
|
+
function shouldRetryError(error, config, attempt, maxAttempts) {
|
|
22408
|
+
if (!config.retry) return false;
|
|
22409
|
+
if (attempt >= maxAttempts - 1) return false;
|
|
22410
|
+
return isRetryableError(error);
|
|
22411
|
+
}
|
|
22412
|
+
__name(shouldRetryError, "shouldRetryError");
|
|
22413
|
+
async function handleRetryDelay(attempt, config) {
|
|
22414
|
+
await sleep(calculateRetryDelay(attempt, config));
|
|
22415
|
+
}
|
|
22416
|
+
__name(handleRetryDelay, "handleRetryDelay");
|
|
22417
|
+
function resolveUrl(url, baseURL) {
|
|
22418
|
+
if (url.startsWith("http://") || url.startsWith("https://")) {
|
|
22419
|
+
return url;
|
|
22420
|
+
}
|
|
22421
|
+
if (!baseURL) {
|
|
22422
|
+
return url;
|
|
22423
|
+
}
|
|
22424
|
+
const base = baseURL.replace(/\/$/, "");
|
|
22425
|
+
const path = url.startsWith("/") ? url : `/${url}`;
|
|
22426
|
+
return `${base}${path}`;
|
|
22427
|
+
}
|
|
22428
|
+
__name(resolveUrl, "resolveUrl");
|
|
22429
|
+
function normalizeData(data) {
|
|
22430
|
+
if (Buffer.isBuffer(data)) return data;
|
|
22431
|
+
if (data instanceof Uint8Array) return data;
|
|
22432
|
+
if (data instanceof ArrayBuffer) return new Uint8Array(data);
|
|
22433
|
+
throw new ApiPackageError(
|
|
22434
|
+
"Blob data type is only supported in browser environment",
|
|
22435
|
+
void 0,
|
|
22436
|
+
API_ERROR_CODES$1.VALIDATION_ERROR
|
|
22437
|
+
);
|
|
22438
|
+
}
|
|
22439
|
+
__name(normalizeData, "normalizeData");
|
|
22440
|
+
function createUploadState(totalSize) {
|
|
22441
|
+
const now2 = Date.now();
|
|
22442
|
+
return {
|
|
22443
|
+
status: "uploading",
|
|
22444
|
+
startTime: now2,
|
|
22445
|
+
bytesUploaded: 0,
|
|
22446
|
+
totalBytes: totalSize,
|
|
22447
|
+
lastProgressTime: now2,
|
|
22448
|
+
lastBytesUploaded: 0
|
|
22449
|
+
};
|
|
22450
|
+
}
|
|
22451
|
+
__name(createUploadState, "createUploadState");
|
|
22452
|
+
function calculateProgress(state) {
|
|
22453
|
+
const now2 = Date.now();
|
|
22454
|
+
const timeDelta = (now2 - state.lastProgressTime) / TIME_CONSTANTS.SECOND;
|
|
22455
|
+
const bytesDelta = state.bytesUploaded - state.lastBytesUploaded;
|
|
22456
|
+
const speed = timeDelta > 0 ? bytesDelta / timeDelta : 0;
|
|
22457
|
+
const percentage2 = Math.round(
|
|
22458
|
+
state.bytesUploaded / state.totalBytes * UPLOAD_CONSTANTS.FULL_PERCENTAGE
|
|
22459
|
+
);
|
|
22460
|
+
const remainingBytes = state.totalBytes - state.bytesUploaded;
|
|
22461
|
+
return {
|
|
22462
|
+
loaded: state.bytesUploaded,
|
|
22463
|
+
total: state.totalBytes,
|
|
22464
|
+
percentage: percentage2,
|
|
22465
|
+
speed: speed > 0 ? speed : void 0,
|
|
22466
|
+
estimatedTimeRemaining: speed > 0 ? remainingBytes / speed : void 0
|
|
22467
|
+
};
|
|
22468
|
+
}
|
|
22469
|
+
__name(calculateProgress, "calculateProgress");
|
|
22470
|
+
function emitFinalProgress(onProgress, totalSize, startTime) {
|
|
22471
|
+
if (!onProgress) return;
|
|
22472
|
+
const elapsed = (Date.now() - startTime) / TIME_CONSTANTS.SECOND;
|
|
22473
|
+
onProgress({
|
|
22474
|
+
loaded: totalSize,
|
|
22475
|
+
total: totalSize,
|
|
22476
|
+
percentage: UPLOAD_CONSTANTS.FULL_PERCENTAGE,
|
|
22477
|
+
speed: elapsed > 0 ? totalSize / elapsed : void 0,
|
|
22478
|
+
estimatedTimeRemaining: 0
|
|
22479
|
+
});
|
|
22480
|
+
}
|
|
22481
|
+
__name(emitFinalProgress, "emitFinalProgress");
|
|
22482
|
+
function shouldEmitProgress(state, totalSize, throttleMs) {
|
|
22483
|
+
const now2 = Date.now();
|
|
22484
|
+
const timeSinceLastProgress = now2 - state.lastProgressTime;
|
|
22485
|
+
const currentPct = Math.round(
|
|
22486
|
+
state.bytesUploaded / totalSize * UPLOAD_CONSTANTS.FULL_PERCENTAGE
|
|
22487
|
+
);
|
|
22488
|
+
const lastPct = Math.round(
|
|
22489
|
+
state.lastBytesUploaded / totalSize * UPLOAD_CONSTANTS.FULL_PERCENTAGE
|
|
22490
|
+
);
|
|
22491
|
+
return timeSinceLastProgress >= throttleMs || currentPct - lastPct >= UPLOAD_CONSTANTS.PROGRESS_PERCENTAGE_THRESHOLD;
|
|
22492
|
+
}
|
|
22493
|
+
__name(shouldEmitProgress, "shouldEmitProgress");
|
|
22494
|
+
function parseNodeHeaders(headers2) {
|
|
22495
|
+
const result = {};
|
|
22496
|
+
for (const [key, value] of Object.entries(headers2)) {
|
|
22497
|
+
if (value !== void 0) {
|
|
22498
|
+
result[key] = Array.isArray(value) ? value.join(", ") : value;
|
|
22499
|
+
}
|
|
22500
|
+
}
|
|
22501
|
+
return result;
|
|
22502
|
+
}
|
|
22503
|
+
__name(parseNodeHeaders, "parseNodeHeaders");
|
|
22504
|
+
|
|
22505
|
+
// src/api/upload/node.ts
|
|
22506
|
+
var createTimeoutError = /* @__PURE__ */ __name((url) => new ApiPackageError("Upload timed out", void 0, API_ERROR_CODES$1.REQUEST_TIMEOUT, {
|
|
22507
|
+
context: { url }
|
|
22508
|
+
}), "createTimeoutError");
|
|
22509
|
+
var createAbortError = /* @__PURE__ */ __name((url) => new ApiPackageError("Upload aborted", void 0, API_ERROR_CODES$1.REQUEST_ABORTED, {
|
|
22510
|
+
context: { url }
|
|
22511
|
+
}), "createAbortError");
|
|
22512
|
+
var normalizeError = /* @__PURE__ */ __name((error) => error instanceof Error ? error : new ApiPackageError(String(error), void 0, API_ERROR_CODES$1.UNKNOWN_ERROR), "normalizeError");
|
|
22513
|
+
async function uploadOnce(options, config, resolvedUrl) {
|
|
22514
|
+
const {
|
|
22515
|
+
data,
|
|
22516
|
+
method = "PUT",
|
|
22517
|
+
contentType = UPLOAD_CONSTANTS.DEFAULT_CONTENT_TYPE,
|
|
22518
|
+
onProgress,
|
|
22519
|
+
abortSignal
|
|
22520
|
+
} = options;
|
|
22521
|
+
const chunkSize = options.chunkSize ?? UPLOAD_CONSTANTS.DEFAULT_CHUNK_SIZE;
|
|
22522
|
+
const throttleMs = options.throttleMs ?? UPLOAD_CONSTANTS.DEFAULT_THROTTLE_MS;
|
|
22523
|
+
const { headers: mergedHeaders, timeout } = config;
|
|
22524
|
+
const buffer = normalizeData(data);
|
|
22525
|
+
const totalSize = buffer.length;
|
|
22526
|
+
const parsedUrl = new URL(resolvedUrl);
|
|
22527
|
+
const isHttps = parsedUrl.protocol === "https:";
|
|
22528
|
+
const httpModule = await (isHttps ? import('https') : import('http'));
|
|
22529
|
+
const state = createUploadState(totalSize);
|
|
22530
|
+
return new Promise((resolve, reject) => {
|
|
22531
|
+
let timeoutId;
|
|
22532
|
+
if (timeout > 0) timeoutId = setTimeout(() => reject(createTimeoutError(resolvedUrl)), timeout);
|
|
22533
|
+
const clearUploadTimeout = /* @__PURE__ */ __name(() => {
|
|
22534
|
+
if (timeoutId) {
|
|
22535
|
+
clearTimeout(timeoutId);
|
|
22536
|
+
timeoutId = void 0;
|
|
22537
|
+
}
|
|
22538
|
+
}, "clearUploadTimeout");
|
|
22539
|
+
onProgress?.({ loaded: 0, total: totalSize, percentage: 0 });
|
|
22540
|
+
const requestOptions = {
|
|
22541
|
+
hostname: parsedUrl.hostname,
|
|
22542
|
+
port: parsedUrl.port || (isHttps ? UPLOAD_CONSTANTS.HTTPS_DEFAULT_PORT : UPLOAD_CONSTANTS.HTTP_DEFAULT_PORT),
|
|
22543
|
+
path: parsedUrl.pathname + parsedUrl.search,
|
|
22544
|
+
method,
|
|
22545
|
+
headers: {
|
|
22546
|
+
"Content-Type": contentType,
|
|
22547
|
+
"Content-Length": totalSize.toString(),
|
|
22548
|
+
...mergedHeaders
|
|
22549
|
+
}
|
|
22550
|
+
};
|
|
22551
|
+
const req = httpModule.request(requestOptions, (res) => {
|
|
22552
|
+
let responseData = "";
|
|
22553
|
+
res.on("data", (chunk) => {
|
|
22554
|
+
responseData += chunk;
|
|
22555
|
+
});
|
|
22556
|
+
res.on("end", () => {
|
|
22557
|
+
clearUploadTimeout();
|
|
22558
|
+
const success = res.statusCode !== void 0 && res.statusCode >= HTTP_STATUS.OK && res.statusCode < HTTP_STATUS.MULTIPLE_CHOICES;
|
|
22559
|
+
if (success) emitFinalProgress(onProgress, totalSize, state.startTime);
|
|
22560
|
+
resolve({
|
|
22561
|
+
status: res.statusCode ?? 0,
|
|
22562
|
+
statusText: res.statusMessage ?? "",
|
|
22563
|
+
data: responseData || void 0,
|
|
22564
|
+
headers: parseNodeHeaders(res.headers),
|
|
22565
|
+
success
|
|
22566
|
+
});
|
|
22567
|
+
});
|
|
22568
|
+
});
|
|
22569
|
+
if (abortSignal)
|
|
22570
|
+
abortSignal.addEventListener("abort", () => {
|
|
22571
|
+
clearUploadTimeout();
|
|
22572
|
+
req.destroy();
|
|
22573
|
+
state.status = "aborted";
|
|
22574
|
+
reject(createAbortError(resolvedUrl));
|
|
22575
|
+
});
|
|
22576
|
+
req.on("error", (error) => {
|
|
22577
|
+
clearUploadTimeout();
|
|
22578
|
+
state.status = "failed";
|
|
22579
|
+
state.error = error;
|
|
22580
|
+
reject(error);
|
|
22581
|
+
});
|
|
22582
|
+
let offset = 0;
|
|
22583
|
+
const writeNextChunk = /* @__PURE__ */ __name(() => {
|
|
22584
|
+
while (offset < totalSize) {
|
|
22585
|
+
const end = Math.min(offset + chunkSize, totalSize);
|
|
22586
|
+
const canContinue = req.write(buffer.subarray(offset, end));
|
|
22587
|
+
state.bytesUploaded = end;
|
|
22588
|
+
offset = end;
|
|
22589
|
+
if (onProgress && shouldEmitProgress(state, totalSize, throttleMs)) {
|
|
22590
|
+
onProgress(calculateProgress(state));
|
|
22591
|
+
state.lastProgressTime = Date.now();
|
|
22592
|
+
state.lastBytesUploaded = state.bytesUploaded;
|
|
22593
|
+
}
|
|
22594
|
+
if (!canContinue) {
|
|
22595
|
+
req.once("drain", writeNextChunk);
|
|
22596
|
+
return;
|
|
22597
|
+
}
|
|
22598
|
+
}
|
|
22599
|
+
state.status = "completed";
|
|
22600
|
+
req.end();
|
|
22601
|
+
}, "writeNextChunk");
|
|
22602
|
+
writeNextChunk();
|
|
22603
|
+
});
|
|
22604
|
+
}
|
|
22605
|
+
__name(uploadOnce, "uploadOnce");
|
|
22606
|
+
async function uploadWithProgressNode(options) {
|
|
22607
|
+
const config = getMergedConfig(options);
|
|
22608
|
+
const resolvedUrl = resolveUrl(options.url, config.baseURL);
|
|
22609
|
+
const maxAttempts = config.retry ? (config.retry.attempts ?? 0) + 1 : 1;
|
|
22610
|
+
let lastError;
|
|
22611
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
22612
|
+
const ctx = { config, maxAttempts, attempt };
|
|
22613
|
+
try {
|
|
22614
|
+
const result = await uploadOnce(options, config, resolvedUrl);
|
|
22615
|
+
if (shouldRetryResult(result, config, attempt, maxAttempts)) {
|
|
22616
|
+
notifyRetryError({
|
|
22617
|
+
ctx,
|
|
22618
|
+
message: `Upload failed: ${result.status}`,
|
|
22619
|
+
status: result.status,
|
|
22620
|
+
statusText: result.statusText
|
|
22621
|
+
});
|
|
22622
|
+
await handleRetryDelay(attempt, config.retry);
|
|
22623
|
+
continue;
|
|
22624
|
+
}
|
|
22625
|
+
return { ...result, attempts: attempt };
|
|
22626
|
+
} catch (error) {
|
|
22627
|
+
lastError = normalizeError(error);
|
|
22628
|
+
if (shouldRetryError(lastError, config, attempt, maxAttempts)) {
|
|
22629
|
+
notifyRetryError({ ctx, message: lastError.message, cause: lastError });
|
|
22630
|
+
await handleRetryDelay(attempt, config.retry);
|
|
22631
|
+
continue;
|
|
22632
|
+
}
|
|
22633
|
+
notifyFinalError(ctx, lastError);
|
|
22634
|
+
throw lastError;
|
|
22635
|
+
}
|
|
22636
|
+
}
|
|
22637
|
+
throw lastError ?? new ApiPackageError(
|
|
22638
|
+
"Upload failed after all retry attempts",
|
|
22639
|
+
void 0,
|
|
22640
|
+
API_ERROR_CODES$1.NETWORK_ERROR
|
|
22641
|
+
);
|
|
22642
|
+
}
|
|
22643
|
+
__name(uploadWithProgressNode, "uploadWithProgressNode");
|
|
22644
|
+
var normalizeError2 = /* @__PURE__ */ __name((error) => error instanceof Error ? error : new ApiPackageError(String(error), void 0, API_ERROR_CODES$1.UNKNOWN_ERROR), "normalizeError");
|
|
22645
|
+
async function uploadOnce2(options, config, resolvedUrl) {
|
|
22646
|
+
const {
|
|
22647
|
+
data,
|
|
22648
|
+
method = "PUT",
|
|
22649
|
+
contentType = UPLOAD_CONSTANTS.DEFAULT_CONTENT_TYPE,
|
|
22650
|
+
onProgress,
|
|
22651
|
+
abortSignal
|
|
22652
|
+
} = options;
|
|
22653
|
+
const { headers: mergedHeaders, timeout, withCredentials } = config;
|
|
22654
|
+
return new Promise((resolve, reject) => {
|
|
22655
|
+
const xhr = new XMLHttpRequest();
|
|
22656
|
+
const startTime = Date.now();
|
|
22657
|
+
if (timeout > 0) xhr.timeout = timeout;
|
|
22658
|
+
xhr.addEventListener(
|
|
22659
|
+
"timeout",
|
|
22660
|
+
() => reject(
|
|
22661
|
+
new ApiPackageError("Upload timed out", void 0, API_ERROR_CODES$1.REQUEST_TIMEOUT, {
|
|
22662
|
+
context: { url: resolvedUrl }
|
|
22663
|
+
})
|
|
22664
|
+
)
|
|
22665
|
+
);
|
|
22666
|
+
xhr.upload.addEventListener("progress", (event) => {
|
|
22667
|
+
if (!event.lengthComputable || !onProgress) return;
|
|
22668
|
+
const elapsed = (Date.now() - startTime) / TIME_CONSTANTS.SECOND;
|
|
22669
|
+
const speed = elapsed > 0 ? event.loaded / elapsed : 0;
|
|
22670
|
+
const remaining = event.total - event.loaded;
|
|
22671
|
+
onProgress({
|
|
22672
|
+
loaded: event.loaded,
|
|
22673
|
+
total: event.total,
|
|
22674
|
+
percentage: Math.round(event.loaded / event.total * UPLOAD_CONSTANTS.FULL_PERCENTAGE),
|
|
22675
|
+
speed,
|
|
22676
|
+
estimatedTimeRemaining: speed > 0 ? remaining / speed : void 0
|
|
22677
|
+
});
|
|
22678
|
+
});
|
|
22679
|
+
xhr.addEventListener("load", () => {
|
|
22680
|
+
const success = xhr.status >= HTTP_STATUS.OK && xhr.status < HTTP_STATUS.MULTIPLE_CHOICES;
|
|
22681
|
+
const responseHeaders = {};
|
|
22682
|
+
const headerLines = xhr.getAllResponseHeaders().trim().split("\n");
|
|
22683
|
+
for (const line of headerLines) {
|
|
22684
|
+
const [key, ...valueParts] = line.split(":");
|
|
22685
|
+
if (key) responseHeaders[key.trim().toLowerCase()] = valueParts.join(":").trim();
|
|
22686
|
+
}
|
|
22687
|
+
resolve({
|
|
22688
|
+
status: xhr.status,
|
|
22689
|
+
statusText: xhr.statusText,
|
|
22690
|
+
data: xhr.responseText || void 0,
|
|
22691
|
+
headers: responseHeaders,
|
|
22692
|
+
success
|
|
22693
|
+
});
|
|
22694
|
+
});
|
|
22695
|
+
xhr.addEventListener(
|
|
22696
|
+
"error",
|
|
22697
|
+
() => reject(
|
|
22698
|
+
new ApiPackageError(
|
|
22699
|
+
`Upload failed: ${xhr.statusText || "Network error"}`,
|
|
22700
|
+
void 0,
|
|
22701
|
+
API_ERROR_CODES$1.NETWORK_ERROR,
|
|
22702
|
+
{ context: { url: resolvedUrl, statusText: xhr.statusText } }
|
|
22703
|
+
)
|
|
22704
|
+
)
|
|
22705
|
+
);
|
|
22706
|
+
xhr.addEventListener(
|
|
22707
|
+
"abort",
|
|
22708
|
+
() => reject(
|
|
22709
|
+
new ApiPackageError("Upload aborted", void 0, API_ERROR_CODES$1.REQUEST_ABORTED, {
|
|
22710
|
+
context: { url: resolvedUrl }
|
|
22711
|
+
})
|
|
22712
|
+
)
|
|
22713
|
+
);
|
|
22714
|
+
if (abortSignal) abortSignal.addEventListener("abort", () => xhr.abort());
|
|
22715
|
+
xhr.open(method, resolvedUrl);
|
|
22716
|
+
if (withCredentials) xhr.withCredentials = true;
|
|
22717
|
+
xhr.setRequestHeader("Content-Type", contentType);
|
|
22718
|
+
for (const [key, value] of Object.entries(mergedHeaders)) xhr.setRequestHeader(key, value);
|
|
22719
|
+
if (data instanceof Blob || data instanceof ArrayBuffer) {
|
|
22720
|
+
xhr.send(data);
|
|
22721
|
+
} else if (data instanceof Uint8Array) {
|
|
22722
|
+
xhr.send(new Uint8Array(data));
|
|
22723
|
+
} else {
|
|
22724
|
+
xhr.send(data);
|
|
22725
|
+
}
|
|
22726
|
+
});
|
|
22727
|
+
}
|
|
22728
|
+
__name(uploadOnce2, "uploadOnce");
|
|
22729
|
+
async function uploadWithProgressBrowser(options) {
|
|
22730
|
+
const config = getMergedConfig(options);
|
|
22731
|
+
const resolvedUrl = resolveUrl(options.url, config.baseURL);
|
|
22732
|
+
const maxAttempts = config.retry ? (config.retry.attempts ?? 0) + 1 : 1;
|
|
22733
|
+
let lastError;
|
|
22734
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
22735
|
+
const ctx = { config, maxAttempts, attempt };
|
|
22736
|
+
try {
|
|
22737
|
+
const result = await uploadOnce2(options, config, resolvedUrl);
|
|
22738
|
+
if (shouldRetryResult(result, config, attempt, maxAttempts)) {
|
|
22739
|
+
notifyRetryError({
|
|
22740
|
+
ctx,
|
|
22741
|
+
message: `Upload failed: ${result.status}`,
|
|
22742
|
+
status: result.status,
|
|
22743
|
+
statusText: result.statusText
|
|
22744
|
+
});
|
|
22745
|
+
await handleRetryDelay(attempt, config.retry);
|
|
22746
|
+
continue;
|
|
22747
|
+
}
|
|
22748
|
+
return { ...result, attempts: attempt };
|
|
22749
|
+
} catch (error) {
|
|
22750
|
+
lastError = normalizeError2(error);
|
|
22751
|
+
if (shouldRetryError(lastError, config, attempt, maxAttempts)) {
|
|
22752
|
+
notifyRetryError({ ctx, message: lastError.message, cause: lastError });
|
|
22753
|
+
await handleRetryDelay(attempt, config.retry);
|
|
22754
|
+
continue;
|
|
22755
|
+
}
|
|
22756
|
+
notifyFinalError(ctx, lastError);
|
|
22757
|
+
throw lastError;
|
|
22758
|
+
}
|
|
22759
|
+
}
|
|
22760
|
+
throw lastError ?? new ApiPackageError(
|
|
22761
|
+
"Upload failed after all retry attempts",
|
|
22762
|
+
void 0,
|
|
22763
|
+
API_ERROR_CODES$1.NETWORK_ERROR
|
|
22764
|
+
);
|
|
22765
|
+
}
|
|
22766
|
+
__name(uploadWithProgressBrowser, "uploadWithProgressBrowser");
|
|
22767
|
+
|
|
22768
|
+
// src/api/upload/uploadWithProgress.ts
|
|
22769
|
+
async function uploadWithProgress(options) {
|
|
22770
|
+
if (isNode()) {
|
|
22771
|
+
return uploadWithProgressNode(options);
|
|
22772
|
+
}
|
|
22773
|
+
return uploadWithProgressBrowser(options);
|
|
22774
|
+
}
|
|
22775
|
+
__name(uploadWithProgress, "uploadWithProgress");
|
|
22236
22776
|
|
|
22237
22777
|
// src/api/hooks/factories/defaults.ts
|
|
22238
22778
|
var DEFAULT_QUERY_OPTIONS = {};
|
|
@@ -24380,13 +24920,13 @@ function isAbortError(error) {
|
|
|
24380
24920
|
return message.includes("abort") || message.includes("cancel");
|
|
24381
24921
|
}
|
|
24382
24922
|
__name(isAbortError, "isAbortError");
|
|
24383
|
-
function
|
|
24923
|
+
function createAbortError2(message = "Request aborted") {
|
|
24384
24924
|
if (message === null || message === void 0) {
|
|
24385
24925
|
return "Request aborted";
|
|
24386
24926
|
}
|
|
24387
24927
|
return message;
|
|
24388
24928
|
}
|
|
24389
|
-
__name(
|
|
24929
|
+
__name(createAbortError2, "createAbortError");
|
|
24390
24930
|
|
|
24391
24931
|
// src/api/request/tracker.ts
|
|
24392
24932
|
var RequestTracker = class {
|
|
@@ -24436,7 +24976,7 @@ var RequestTracker = class {
|
|
|
24436
24976
|
controller.abort(reason);
|
|
24437
24977
|
this.unregister(key);
|
|
24438
24978
|
}
|
|
24439
|
-
void abortRequest(key,
|
|
24979
|
+
void abortRequest(key, createAbortError2(reason ?? "Request aborted"));
|
|
24440
24980
|
}
|
|
24441
24981
|
/**
|
|
24442
24982
|
* Abort all requests in a group
|
|
@@ -24462,7 +25002,7 @@ var RequestTracker = class {
|
|
|
24462
25002
|
});
|
|
24463
25003
|
this.activeRequests.clear();
|
|
24464
25004
|
this.requestGroups.clear();
|
|
24465
|
-
void abortRequest("*",
|
|
25005
|
+
void abortRequest("*", createAbortError2(reason ?? "All requests aborted"));
|
|
24466
25006
|
}
|
|
24467
25007
|
/**
|
|
24468
25008
|
* Get active request count
|
|
@@ -24519,14 +25059,14 @@ function useRequestCleanup() {
|
|
|
24519
25059
|
}, "untrackRequest");
|
|
24520
25060
|
const abortTracked = /* @__PURE__ */ __name((reason) => {
|
|
24521
25061
|
requestKeys.current.forEach((key) => {
|
|
24522
|
-
void abortRequest(key,
|
|
25062
|
+
void abortRequest(key, createAbortError2(reason ?? "Manual abort"));
|
|
24523
25063
|
});
|
|
24524
25064
|
requestKeys.current.clear();
|
|
24525
25065
|
}, "abortTracked");
|
|
24526
25066
|
useEffect(() => {
|
|
24527
25067
|
return () => {
|
|
24528
25068
|
requestKeys.current.forEach((key) => {
|
|
24529
|
-
void abortRequest(key,
|
|
25069
|
+
void abortRequest(key, createAbortError2("Component unmounted"));
|
|
24530
25070
|
});
|
|
24531
25071
|
requestKeys.current.clear();
|
|
24532
25072
|
};
|
|
@@ -24547,14 +25087,14 @@ function useAbortableRequest(key) {
|
|
|
24547
25087
|
controllerRef.current.abort("Component unmounted or dependency changed");
|
|
24548
25088
|
requestTracker.unregister(key);
|
|
24549
25089
|
}
|
|
24550
|
-
void abortRequest(key,
|
|
25090
|
+
void abortRequest(key, createAbortError2("Request cancelled"));
|
|
24551
25091
|
};
|
|
24552
25092
|
}, [key]);
|
|
24553
25093
|
const abort = /* @__PURE__ */ __name((reason) => {
|
|
24554
25094
|
if (controllerRef.current) {
|
|
24555
25095
|
controllerRef.current.abort(reason);
|
|
24556
25096
|
}
|
|
24557
|
-
void abortRequest(key,
|
|
25097
|
+
void abortRequest(key, createAbortError2(reason ?? "Request aborted by user"));
|
|
24558
25098
|
}, "abort");
|
|
24559
25099
|
return {
|
|
24560
25100
|
signal,
|
|
@@ -24616,9 +25156,9 @@ function setupRouteChangeCleanup(router, options = {}) {
|
|
|
24616
25156
|
}
|
|
24617
25157
|
const pattern = options.abortPattern ?? "*";
|
|
24618
25158
|
if (options.preservePatterns && options.preservePatterns.length > 0) {
|
|
24619
|
-
void abortRequest(pattern,
|
|
25159
|
+
void abortRequest(pattern, createAbortError2(`Route changed to ${url}`));
|
|
24620
25160
|
} else {
|
|
24621
|
-
void abortRequest(pattern,
|
|
25161
|
+
void abortRequest(pattern, createAbortError2(`Route changed to ${url}`));
|
|
24622
25162
|
}
|
|
24623
25163
|
}, "executeAbort");
|
|
24624
25164
|
if (options.delay && options.delay > 0) {
|
|
@@ -24665,7 +25205,7 @@ function createRouteGuard(pattern = "*") {
|
|
|
24665
25205
|
}, "enter"),
|
|
24666
25206
|
leave: /* @__PURE__ */ __name((reason) => {
|
|
24667
25207
|
if (isActive) {
|
|
24668
|
-
void abortRequest(pattern,
|
|
25208
|
+
void abortRequest(pattern, createAbortError2(reason ?? "Leaving route"));
|
|
24669
25209
|
isActive = false;
|
|
24670
25210
|
}
|
|
24671
25211
|
}, "leave"),
|
|
@@ -24697,7 +25237,7 @@ __name(createRouteScope, "createRouteScope");
|
|
|
24697
25237
|
|
|
24698
25238
|
// src/api/request/utils.ts
|
|
24699
25239
|
function abortByPattern(pattern, reason) {
|
|
24700
|
-
void abortRequest(pattern,
|
|
25240
|
+
void abortRequest(pattern, createAbortError2(reason ?? `Requests matching ${pattern} aborted`));
|
|
24701
25241
|
}
|
|
24702
25242
|
__name(abortByPattern, "abortByPattern");
|
|
24703
25243
|
function abortSearchRequests(reason) {
|
|
@@ -24715,25 +25255,25 @@ __name(abortAllRequests, "abortAllRequests");
|
|
|
24715
25255
|
function createScopedAbort(scope) {
|
|
24716
25256
|
return (key, reason) => {
|
|
24717
25257
|
const fullKey = key.startsWith("/") ? `${scope}${key}` : `${scope}/${key}`;
|
|
24718
|
-
void abortRequest(fullKey,
|
|
25258
|
+
void abortRequest(fullKey, createAbortError2(reason ?? "Scoped request aborted"));
|
|
24719
25259
|
};
|
|
24720
25260
|
}
|
|
24721
25261
|
__name(createScopedAbort, "createScopedAbort");
|
|
24722
25262
|
function createDebouncedAbort(delay = 300) {
|
|
24723
25263
|
return debounce((key, reason) => {
|
|
24724
|
-
void abortRequest(key,
|
|
25264
|
+
void abortRequest(key, createAbortError2(reason ?? "Debounced abort"));
|
|
24725
25265
|
}, delay);
|
|
24726
25266
|
}
|
|
24727
25267
|
__name(createDebouncedAbort, "createDebouncedAbort");
|
|
24728
25268
|
function createThrottledAbort(limit = 1e3) {
|
|
24729
25269
|
return throttle((key, reason) => {
|
|
24730
|
-
void abortRequest(key,
|
|
25270
|
+
void abortRequest(key, createAbortError2(reason ?? "Throttled abort"));
|
|
24731
25271
|
}, limit);
|
|
24732
25272
|
}
|
|
24733
25273
|
__name(createThrottledAbort, "createThrottledAbort");
|
|
24734
25274
|
async function requestWithTimeout(key, fetcher, timeoutMs) {
|
|
24735
25275
|
const timeoutId = setTimeout(() => {
|
|
24736
|
-
void abortRequest(key,
|
|
25276
|
+
void abortRequest(key, createAbortError2(`Request timeout after ${timeoutMs}ms`));
|
|
24737
25277
|
}, timeoutMs);
|
|
24738
25278
|
try {
|
|
24739
25279
|
return await fetcher();
|
|
@@ -24746,7 +25286,7 @@ async function raceRequests(requests) {
|
|
|
24746
25286
|
const abortLosers = /* @__PURE__ */ __name((winnerKey) => {
|
|
24747
25287
|
requests.forEach((req) => {
|
|
24748
25288
|
if (req.key !== winnerKey) {
|
|
24749
|
-
void abortRequest(req.key,
|
|
25289
|
+
void abortRequest(req.key, createAbortError2("Lost race"));
|
|
24750
25290
|
}
|
|
24751
25291
|
});
|
|
24752
25292
|
}, "abortLosers");
|
|
@@ -24767,7 +25307,7 @@ async function sequentialRequests(requests) {
|
|
|
24767
25307
|
results.push(result);
|
|
24768
25308
|
} catch (error) {
|
|
24769
25309
|
for (let j = i + 1; j < requests.length; j++) {
|
|
24770
|
-
void abortRequest(requests[j].key,
|
|
25310
|
+
void abortRequest(requests[j].key, createAbortError2("Previous request in chain failed"));
|
|
24771
25311
|
}
|
|
24772
25312
|
throw error;
|
|
24773
25313
|
}
|
|
@@ -26874,6 +27414,6 @@ function ApiProvider({
|
|
|
26874
27414
|
}
|
|
26875
27415
|
__name(ApiProvider, "ApiProvider");
|
|
26876
27416
|
|
|
26877
|
-
export { ALL_EVENTS, ApiInitializationError, ApiInitializationLoading, ApiPackageError, ApiProvider, CACHE_EVENTS2 as CACHE_EVENTS, CLIENT_EVENTS2 as CLIENT_EVENTS, CONFIG_EVENTS2 as CONFIG_EVENTS, ClientEventManager, ClientHintsInterceptor, ConfigBuilder, DEBUG_EVENTS2 as DEBUG_EVENTS, ERROR_EVENTS2 as ERROR_EVENTS, EVENT_NAMESPACES2 as EVENT_NAMESPACES, EVENT_SCOPES, EVENT_SCOPES_WITH_TEMPORARY2 as EVENT_SCOPES_WITH_TEMPORARY, Environment, EventHelpers, EventManager, HANDLER_SCOPES, HEADER_EVENTS2 as HEADER_EVENTS, HeaderBuilder, IntervalManager, MEDIA_EXTENSIONS, MEDIA_MIME_PREFIXES, MinimumConnectionGuard, NETWORK_EVENTS2 as NETWORK_EVENTS, NetworkConfigurationManager, NetworkDetectionMiddleware, NetworkGuard, NetworkInfoParam, NetworkPresetNames, NetworkProperty, NoDataSaverGuard, PERFORMANCE_EVENTS2 as PERFORMANCE_EVENTS, RequestTracker, UnifiedDebugger, abortAllRequests, abortByPattern, abortRequest, abortSearchRequests, abortUploadRequests, addClientHintsToResponse, addInterval, addTime, analyzeComplianceIssues, analyzeConfigImpact, analyzeConflictPatterns, analyzeEventSystemIssues, analyzeHistoryPatterns, analyzePerformanceIssues, applyCacheStrategyConfig, applyConfigOverride, applyConfigPreset, applyConfigUpdate, applyCustomQualityPresetStrategies, applyHeaderPresets, applyIndividualStrategies, applyPerformancePresetConfig, applyPollingStrategy, applyPollingStrategyConfig, applyRetryStrategy, applyRetryStrategyConfig, applyRevalidationStrategy, applyTemporaryNetworkOverride, applyUnifiedStrategy, applyUnifiedStrategyToConfig, arrayOf, average, base64ToBytes, buildCacheKey, buildEndpointUrl, buildFullUrl, buildUrl, bulkValidateInfobipEmails, bytesToBase64, cacheKeyPatterns, cacheStrategies, calculateCacheDuration, calculatePerformanceImpact, calculatePollingDuration, calculateRequestMetrics, campaignEndpoints, canPerformHeavyOperation, cdnEndpoints, checkFeatureFlagEnabled, checkOverrideTriggers, clamp, clampedPercentage, clearErrorHandlers, clearNetworkDebugData, clearTemporaryOverrides, cloneConfig, cloudFrontCreateInvalidation, cloudFrontEndpoints, cloudflareEndpoints, cloudflarePurgeCache, compactHistory, configConflictDetector, configureForEnvironment, containsAny, convertEndpointsToFetchff, createAbortError, createAdaptiveResponse, createApiClient, createCachePattern, createCacheStrategy, createCampaign, createComplianceReport, createConditionalInterval, createConditionalPolling, createConfigBuilder, createConfigHistoryEntry, createConfigState, createConflict, createCustomPreset, createCustomUnifiedStrategy, createDate, createDebouncedAbort, createDebugReport, createDecryptionInterceptor, createDelay, createEncryptionInterceptor, createEncryptionInterceptors, createEventEmitter, createFeatureFlag, createHistoryEntry, createHistorySummary, createLimitedInterval, createManagedInterval, createNetworkDetectionMiddleware, createPerformanceAnalysis, createPerformanceBenchmark, createPollingStrategy, createPreservedConfig, createProgressivePolling, createRetryConfig, createRetryStrategy, createRevalidationKey, createRevalidationStrategy, createRouteGuard, createRouteScope, createScopedAbort, createStatusCodeLimits, createThrottledAbort, createTypedSubscription, createVisibilityAwarePolling, dateDiff, debounce, decrypt, deepMerge, deleteCache, deleteCampaign, deleteFeatureFlag, deleteFile, detectConfigConflicts, detectConflicts, detectPlatform, determinePrecedenceReason, disableNetworkConfigDebug, downloadFile, enableNetworkConfigDebug, encrypt, endOfDay, endpointCacheKey, endpointCachePattern, endpointCachePatterns, endpoints, evaluateAllFeatureFlags, evaluateFeatureFlag, eventManager, exportKeyToBase64, extendPresets as extendRevalidationPresets, extractFields, extractUrlParams, fastlyEndpoints, fastlyPurgeUrl, featureFlagEndpoints, fetchCampaign, fetchCampaignParticipants, fetchCampaignStats, fetchCampaigns, fetchFeatureFlagHealth, fetchFeatureFlagRules, fetchInfobipEmailLogs, fetchInfobipEmailReports, fetchInfobipScheduledEmailStatuses, fetchInfobipScheduledEmails, fetchInfobipValidations, filesEndpoints, filterHistory, filterObject, findEndpointsByPattern, findMatchingPaths, flattenObject, formatDuration, formatReportForConsole, formatTimeForInterval, fromFetchffConfig, fromISOString, fromUnixTimestamp, generateComprehensiveReport, generateDocument, generateIV, generateIssueBreakdown, generateRandomKey, generateRecommendations, generateUUID, getActiveOverrideKeys, getAdaptiveApiConfig, getAdaptiveBatchSize, getAdaptiveCacheDuration, getAdaptiveConfig, getAdaptivePageSize, getAdaptiveTimeout, getAllEndpointUrls, getAllFieldPaths, getAllMediaExtensions, getAnalysisResult, getAppVersion, getAuthenticationType, getCache, getCacheAffectingHeaders, getCacheStrategy, getClientHintHeaders, getConfigHierarchy, getConnection, getConnectionType, getConsole, getContextHeaders, getCrypto, getDefaultApiClient, getDeviceId, getDeviceInfo, getDocument, getEffectiveConfig, getEffectiveConnectionType, getEndpointConfig, getEndpointMetadata, getEndpointParams, getEndpointUrl, getEndpointsByMethod, getEnhancedClientHints, getEntries, getEnv, getEnvironmentInfo, getEnvironmentName, getErrorHandlers, getEventManager, getExtendedEnvironmentInfo, getFieldValue, getFile, getFileExtension, getFrameworkAdaptiveBatchSize, getFrameworkAdaptiveTimeout, getGlobal, getGlobalConfig, getHeaderFingerprint, getHeaderSummary, getISOWeek, getIntervalBoundaries, getIntervalDifference, getIntervalEnd, getIntervalStart, getJSONSize, getKeys, getLocalStorage, getLocation, getMatchingPresets, getNavigator, getNetworkConfigFromHeaders, getNetworkDebugStats, getNetworkEventStats, getNetworkInfo, getNetworkInfoFromHeaders, getNetworkInfoFromRequest, getNetworkOptimizedConfig, getNetworkPreset, getNetworkQuality, getNetworkQualityFromHeaders, getNetworkQualityScore, getNetworkQualityWithThresholds, getNetworkRTT, getNetworkSpeed, getNonCacheAffectingHeaders, getOptimizedNetworkConfig, getPresetForNetworkInfo, getPresetForQuality, getPresetNames, getProcess, getQuarter, getQueryClient, getRelativeTime, getRetryStrategy, getPreset as getRevalidationPreset, getPresets as getRevalidationPresets, getRevalidationStrategy, getRuntimeEnvironment, getSSRSafeConfig, getSSRSafePollingConfig, getSessionStorage, getSignedUrl, getTimeComponents, getUnifiedDebugger, getUnifiedStrategy, getUnifiedStrategyNames, getUnixTimestamp, getUserAgent, getValues, getWindow, groupBy, handleArrayMerge, handleObjectMerge, hasAnyExtension, hasAuthentication, hasEncryptableFields, hasEndpoint, hasGlobal, hasIndexedDB, hasLocalStorage, hasMatchingFields, hasNavigator, hasNetworkInfo2 as hasNetworkInfoExpress, hasNetworkInfo as hasNetworkInfoNextjs, hasPathParams, hasPreset, hasProperty, hasSessionStorage, hasWebGL, hasWebPSupport, headerPresets, headers, headersContext, importKey, inBrowser, inRange, inServer, infobipEmailEndpoints, infobipEndpoints, invalidationScenarios, inverseLerp, isAbortError, isArray, isBoolean, isBrowser, isBun, isCI, isCacheValid, isCellularConnection, isCryptoAvailable, isDataFresh, isDataSaverEnabled, isDataSaverEnabledFromHeaders, isDebug, isDeno, isDevelopment, isDocumentVisible, isElectron, isEmpty, isEmptyObject, isEncryptedMetadata, isError, isFunction, isFuture, isInIframe, isInRange, isInteger, isMergeableObject, isMobile, isNetworkAPISupported, isNode, isNonEmptyArray, isNonEmptyObject, isNonEmptyString2 as isNonEmptyString, isNonNegativeNumber, isNotNullish, isNullish, isNumber, isObject, isOffline, isOneOfIgnoreCase, isOnline, isPageFocused, isPast, isPlainObject, isPollingActive, isPositiveNumber, isProduction, isPromise, isReactNative, isRevalidationSupported, isSSR, isSameDay, isSameInterval, isServer, isSlowConnection, isStaging, isString, isTest, isToday, isTouchDevice, isUnifiedStrategyName, isValidDate, isValidEnumValue, isValidFieldPath, isValidJSON, isValidNumber2 as isValidNumber, isValidPollingConfig, isValidStrategyName as isValidRevalidationStrategyName, isWebWorker, isWifiConnection, isWildcard, isWithinDedupeWindow, joinCampaign, jsonClone, jsonEquals, keyBy, leaveCampaign, lerp, logNetworkConfigReport, mapKeys, mapObject, mapRange, matchFieldPath, matchesAny, max, median, mergeCacheStrategies, mergeConfigs, mergeConflicts, mergeHeaders, mergePollingConfigs, mergePresets, mergeRetryStrategies, mergeRevalidationStrategies, mergeUnifiedStrategy, min, msToSeconds, mutate2 as mutate, networkConfigDebugger, networkConfigManager, networkDetectionMiddleware, networkPresets, networkStatus, normalizeHeaders2 as normalizeHeaders, now, nowInSeconds, omit, onOffline, onOnline, onceErrorHandler, oneOf, parseAndValidateNumber, parseFieldPath, percentage, pick, pollingEndpoints, pollingStrategies, prepareRequestConfig, prepareRequestConfigWithEnrichedHeaders, prettyStringify, processHeaders2 as processHeaders, raceRequests, randomBetween, randomInt, refreshFeatureFlagCache, registerErrorHandler, registerErrorHandlers, removeCircularReferences, removeEmpty, removeFeatureFlagOverride, removeNullish, removeSensitiveHeaders, removeUndefined, requestTracker, requestWithTimeout, rescheduleInfobipEmails, resetGlobalConfig, resetQueryClient, resetPresets as resetRevalidationPresets, resolveConflict, retryConditions, retryStrategies, genericPresets as revalidationPresets, revalidationStrategies, round, runWithHeaders, runWithHeadersAsync, safeParseJSON, safeStringify, sanitizeHeaders, secondsToMs, sendInfobipAdvancedEmail, sendInfobipEmail, sequentialRequests, setCache, setConfigWarnings, setDefaultApiClient, setErrorHandlers, setFeatureFlagOverride, setFieldValue, setGlobalConfig, setupClientEvents, setupNetworkMonitoring, setupRouteChangeCleanup, setupTemporaryOverride, shouldApplyConfig, shouldAutoRefresh, shouldPrefetch, shouldServeHighQuality, shouldUseAggressiveCaching, sleep, sortIssuesByPriority, startNetworkEventMonitoring, startOfDay, startRequestTracking, subscribe, subscribeMultiple, subscribeOnce, subscribeWithTimeout, sum, supportsBroadcastChannel, supportsFetch, supportsGeolocation, supportsIntersectionObserver, supportsLocalStorage, supportsNotifications, supportsPushNotifications, supportsRequestIdleCallback, supportsServiceWorker, supportsSessionStorage, supportsWebSocket, throttle, timeAgo, toFetchffConfig, toFetchffRevalidationConfig, toISOString, trackConfig, trackDirectCacheConfig, trackNetworkOverride, trackSpreadProperties, trackableSpread, transformFields, truncateJSON, unifiedStrategies, unregisterErrorHandlers, updateCampaign, updateFeatureFlag, updateGlobalConfig, updateInfobipScheduledEmailStatuses, uploadFile, uploadFileForScanning, uploadFiles, useAbortableRequest, useApiConfigConflicts, useApiDebugInfo, useApiMonitor, useApiNetworkQuality, useCampaign, useCampaignParticipants, useCampaignStats, useCampaigns, useCheckFeatureFlagEnabled, useConditionalSubscription, useCreateCampaign, useCreateFeatureFlag, useDebouncedSubscription, useDeleteCampaign, useDeleteFeatureFlag, useDeleteFile, useDownloadFile, useEvaluateAllFeatureFlags, useGenerateDocument, useGetFile, useGetSignedUrl, useJoinCampaign, useLeaveCampaign, useMultipleSubscriptions, useOptimisticUpdate, useRealTimeData, useRemoveFeatureFlagOverride, useRequestCleanup, useRequestGroup, useRouteAwareRequest, useSubscription, useSubscriptionState, useUpdateCampaign, useUpdateFeatureFlag, useUploadFile, useUploadFiles, validateConfigUpdate, validateEncryptionConfig, validateHeaders, validateInfobipEmail, validatePathParams, validatePreset, virusTotalEndpoints, waitForOnline, withNetworkDetection, withNetworkInfo, withTimeout };
|
|
27417
|
+
export { ALL_EVENTS, ApiInitializationError, ApiInitializationLoading, ApiPackageError, ApiProvider, CACHE_EVENTS2 as CACHE_EVENTS, CLIENT_EVENTS2 as CLIENT_EVENTS, CONFIG_EVENTS2 as CONFIG_EVENTS, ClientEventManager, ClientHintsInterceptor, ConfigBuilder, DEBUG_EVENTS2 as DEBUG_EVENTS, ERROR_EVENTS2 as ERROR_EVENTS, EVENT_NAMESPACES2 as EVENT_NAMESPACES, EVENT_SCOPES, EVENT_SCOPES_WITH_TEMPORARY2 as EVENT_SCOPES_WITH_TEMPORARY, Environment, EventHelpers, EventManager, HANDLER_SCOPES, HEADER_EVENTS2 as HEADER_EVENTS, HeaderBuilder, IntervalManager, MEDIA_EXTENSIONS, MEDIA_MIME_PREFIXES, MinimumConnectionGuard, NETWORK_EVENTS2 as NETWORK_EVENTS, NetworkConfigurationManager, NetworkDetectionMiddleware, NetworkGuard, NetworkInfoParam, NetworkPresetNames, NetworkProperty, NoDataSaverGuard, PERFORMANCE_EVENTS2 as PERFORMANCE_EVENTS, RequestTracker, UnifiedDebugger, abortAllRequests, abortByPattern, abortRequest, abortSearchRequests, abortUploadRequests, addClientHintsToResponse, addInterval, addTime, analyzeComplianceIssues, analyzeConfigImpact, analyzeConflictPatterns, analyzeEventSystemIssues, analyzeHistoryPatterns, analyzePerformanceIssues, applyCacheStrategyConfig, applyConfigOverride, applyConfigPreset, applyConfigUpdate, applyCustomQualityPresetStrategies, applyHeaderPresets, applyIndividualStrategies, applyPerformancePresetConfig, applyPollingStrategy, applyPollingStrategyConfig, applyRetryStrategy, applyRetryStrategyConfig, applyRevalidationStrategy, applyTemporaryNetworkOverride, applyUnifiedStrategy, applyUnifiedStrategyToConfig, arrayOf, average, base64ToBytes, buildCacheKey, buildEndpointUrl, buildFullUrl, buildUrl, bulkValidateInfobipEmails, bytesToBase64, cacheKeyPatterns, cacheStrategies, calculateCacheDuration, calculatePerformanceImpact, calculatePollingDuration, calculateRequestMetrics, campaignEndpoints, canPerformHeavyOperation, cdnEndpoints, checkFeatureFlagEnabled, checkOverrideTriggers, clamp, clampedPercentage, clearErrorHandlers, clearNetworkDebugData, clearTemporaryOverrides, cloneConfig, cloudFrontCreateInvalidation, cloudFrontEndpoints, cloudflareEndpoints, cloudflarePurgeCache, compactHistory, configConflictDetector, configureForEnvironment, containsAny, convertEndpointsToFetchff, createAbortError2 as createAbortError, createAdaptiveResponse, createApiClient, createCachePattern, createCacheStrategy, createCampaign, createComplianceReport, createConditionalInterval, createConditionalPolling, createConfigBuilder, createConfigHistoryEntry, createConfigState, createConflict, createCustomPreset, createCustomUnifiedStrategy, createDate, createDebouncedAbort, createDebugReport, createDecryptionInterceptor, createDelay, createEncryptionInterceptor, createEncryptionInterceptors, createEventEmitter, createFeatureFlag, createHistoryEntry, createHistorySummary, createLimitedInterval, createManagedInterval, createNetworkDetectionMiddleware, createPerformanceAnalysis, createPerformanceBenchmark, createPollingStrategy, createPreservedConfig, createProgressivePolling, createRetryConfig, createRetryStrategy, createRevalidationKey, createRevalidationStrategy, createRouteGuard, createRouteScope, createScopedAbort, createStatusCodeLimits, createThrottledAbort, createTypedSubscription, createVisibilityAwarePolling, dateDiff, debounce, decrypt, deepMerge, deleteCache, deleteCampaign, deleteFeatureFlag, deleteFile, detectConfigConflicts, detectConflicts, detectPlatform, determinePrecedenceReason, disableNetworkConfigDebug, downloadFile, enableNetworkConfigDebug, encrypt, endOfDay, endpointCacheKey, endpointCachePattern, endpointCachePatterns, endpoints, evaluateAllFeatureFlags, evaluateFeatureFlag, eventManager, exportKeyToBase64, extendPresets as extendRevalidationPresets, extractFields, extractUrlParams, fastlyEndpoints, fastlyPurgeUrl, featureFlagEndpoints, fetchCampaign, fetchCampaignParticipants, fetchCampaignStats, fetchCampaigns, fetchFeatureFlagHealth, fetchFeatureFlagRules, fetchInfobipEmailLogs, fetchInfobipEmailReports, fetchInfobipScheduledEmailStatuses, fetchInfobipScheduledEmails, fetchInfobipValidations, filesEndpoints, filterHistory, filterObject, findEndpointsByPattern, findMatchingPaths, flattenObject, formatDuration, formatReportForConsole, formatTimeForInterval, fromFetchffConfig, fromISOString, fromUnixTimestamp, generateComprehensiveReport, generateDocument, generateIV, generateIssueBreakdown, generateRandomKey, generateRecommendations, generateUUID, getActiveOverrideKeys, getAdaptiveApiConfig, getAdaptiveBatchSize, getAdaptiveCacheDuration, getAdaptiveConfig, getAdaptivePageSize, getAdaptiveTimeout, getAllEndpointUrls, getAllFieldPaths, getAllMediaExtensions, getAnalysisResult, getAppVersion, getAuthenticationType, getCache, getCacheAffectingHeaders, getCacheStrategy, getClientHintHeaders, getConfigHierarchy, getConnection, getConnectionType, getConsole, getContextHeaders, getCrypto, getDefaultApiClient, getDeviceId, getDeviceInfo, getDocument, getEffectiveConfig, getEffectiveConnectionType, getEndpointConfig, getEndpointMetadata, getEndpointParams, getEndpointUrl, getEndpointsByMethod, getEnhancedClientHints, getEntries, getEnv, getEnvironmentInfo, getEnvironmentName, getErrorHandlers, getEventManager, getExtendedEnvironmentInfo, getFieldValue, getFile, getFileExtension, getFrameworkAdaptiveBatchSize, getFrameworkAdaptiveTimeout, getGlobal, getGlobalConfig, getHeaderFingerprint, getHeaderSummary, getISOWeek, getIntervalBoundaries, getIntervalDifference, getIntervalEnd, getIntervalStart, getJSONSize, getKeys, getLocalStorage, getLocation, getMatchingPresets, getNavigator, getNetworkConfigFromHeaders, getNetworkDebugStats, getNetworkEventStats, getNetworkInfo, getNetworkInfoFromHeaders, getNetworkInfoFromRequest, getNetworkOptimizedConfig, getNetworkPreset, getNetworkQuality, getNetworkQualityFromHeaders, getNetworkQualityScore, getNetworkQualityWithThresholds, getNetworkRTT, getNetworkSpeed, getNonCacheAffectingHeaders, getOptimizedNetworkConfig, getPresetForNetworkInfo, getPresetForQuality, getPresetNames, getProcess, getQuarter, getQueryClient, getRelativeTime, getRetryStrategy, getPreset as getRevalidationPreset, getPresets as getRevalidationPresets, getRevalidationStrategy, getRuntimeEnvironment, getSSRSafeConfig, getSSRSafePollingConfig, getSessionStorage, getSignedUrl, getTimeComponents, getUnifiedDebugger, getUnifiedStrategy, getUnifiedStrategyNames, getUnixTimestamp, getUserAgent, getValues, getWindow, groupBy, handleArrayMerge, handleObjectMerge, hasAnyExtension, hasAuthentication, hasEncryptableFields, hasEndpoint, hasGlobal, hasIndexedDB, hasLocalStorage, hasMatchingFields, hasNavigator, hasNetworkInfo2 as hasNetworkInfoExpress, hasNetworkInfo as hasNetworkInfoNextjs, hasPathParams, hasPreset, hasProperty, hasSessionStorage, hasWebGL, hasWebPSupport, headerPresets, headers, headersContext, importKey, inBrowser, inRange, inServer, infobipEmailEndpoints, infobipEndpoints, invalidationScenarios, inverseLerp, isAbortError, isArray, isBoolean, isBrowser, isBun, isCI, isCacheValid, isCellularConnection, isCryptoAvailable, isDataFresh, isDataSaverEnabled, isDataSaverEnabledFromHeaders, isDebug, isDeno, isDevelopment, isDocumentVisible, isElectron, isEmpty, isEmptyObject, isEncryptedMetadata, isError, isFunction, isFuture, isInIframe, isInRange, isInteger, isMergeableObject, isMobile, isNetworkAPISupported, isNode, isNonEmptyArray, isNonEmptyObject, isNonEmptyString2 as isNonEmptyString, isNonNegativeNumber, isNotNullish, isNullish, isNumber, isObject, isOffline, isOneOfIgnoreCase, isOnline, isPageFocused, isPast, isPlainObject, isPollingActive, isPositiveNumber, isProduction, isPromise, isReactNative, isRevalidationSupported, isSSR, isSameDay, isSameInterval, isServer, isSlowConnection, isStaging, isString, isTest, isToday, isTouchDevice, isUnifiedStrategyName, isValidDate, isValidEnumValue, isValidFieldPath, isValidJSON, isValidNumber2 as isValidNumber, isValidPollingConfig, isValidStrategyName as isValidRevalidationStrategyName, isWebWorker, isWifiConnection, isWildcard, isWithinDedupeWindow, joinCampaign, jsonClone, jsonEquals, keyBy, leaveCampaign, lerp, logNetworkConfigReport, mapKeys, mapObject, mapRange, matchFieldPath, matchesAny, max, median, mergeCacheStrategies, mergeConfigs, mergeConflicts, mergeHeaders, mergePollingConfigs, mergePresets, mergeRetryStrategies, mergeRevalidationStrategies, mergeUnifiedStrategy, min, msToSeconds, mutate2 as mutate, networkConfigDebugger, networkConfigManager, networkDetectionMiddleware, networkPresets, networkStatus, normalizeHeaders2 as normalizeHeaders, now, nowInSeconds, omit, onOffline, onOnline, onceErrorHandler, oneOf, parseAndValidateNumber, parseFieldPath, percentage, pick, pollingEndpoints, pollingStrategies, prepareRequestConfig, prepareRequestConfigWithEnrichedHeaders, prettyStringify, processHeaders2 as processHeaders, raceRequests, randomBetween, randomInt, refreshFeatureFlagCache, registerErrorHandler, registerErrorHandlers, removeCircularReferences, removeEmpty, removeFeatureFlagOverride, removeNullish, removeSensitiveHeaders, removeUndefined, requestTracker, requestWithTimeout, rescheduleInfobipEmails, resetGlobalConfig, resetQueryClient, resetPresets as resetRevalidationPresets, resolveConflict, retryConditions, retryStrategies, genericPresets as revalidationPresets, revalidationStrategies, round, runWithHeaders, runWithHeadersAsync, safeParseJSON, safeStringify, sanitizeHeaders, secondsToMs, sendInfobipAdvancedEmail, sendInfobipEmail, sequentialRequests, setCache, setConfigWarnings, setDefaultApiClient, setErrorHandlers, setFeatureFlagOverride, setFieldValue, setGlobalConfig, setupClientEvents, setupNetworkMonitoring, setupRouteChangeCleanup, setupTemporaryOverride, shouldApplyConfig, shouldAutoRefresh, shouldPrefetch, shouldServeHighQuality, shouldUseAggressiveCaching, sleep, sortIssuesByPriority, startNetworkEventMonitoring, startOfDay, startRequestTracking, subscribe, subscribeMultiple, subscribeOnce, subscribeWithTimeout, sum, supportsBroadcastChannel, supportsFetch, supportsGeolocation, supportsIntersectionObserver, supportsLocalStorage, supportsNotifications, supportsPushNotifications, supportsRequestIdleCallback, supportsServiceWorker, supportsSessionStorage, supportsWebSocket, throttle, timeAgo, toFetchffConfig, toFetchffRevalidationConfig, toISOString, trackConfig, trackDirectCacheConfig, trackNetworkOverride, trackSpreadProperties, trackableSpread, transformFields, truncateJSON, unifiedStrategies, unregisterErrorHandlers, updateCampaign, updateFeatureFlag, updateGlobalConfig, updateInfobipScheduledEmailStatuses, uploadFile, uploadFileForScanning, uploadFiles, uploadWithProgress, useAbortableRequest, useApiConfigConflicts, useApiDebugInfo, useApiMonitor, useApiNetworkQuality, useCampaign, useCampaignParticipants, useCampaignStats, useCampaigns, useCheckFeatureFlagEnabled, useConditionalSubscription, useCreateCampaign, useCreateFeatureFlag, useDebouncedSubscription, useDeleteCampaign, useDeleteFeatureFlag, useDeleteFile, useDownloadFile, useEvaluateAllFeatureFlags, useGenerateDocument, useGetFile, useGetSignedUrl, useJoinCampaign, useLeaveCampaign, useMultipleSubscriptions, useOptimisticUpdate, useRealTimeData, useRemoveFeatureFlagOverride, useRequestCleanup, useRequestGroup, useRouteAwareRequest, useSubscription, useSubscriptionState, useUpdateCampaign, useUpdateFeatureFlag, useUploadFile, useUploadFiles, validateConfigUpdate, validateEncryptionConfig, validateHeaders, validateInfobipEmail, validatePathParams, validatePreset, virusTotalEndpoints, waitForOnline, withNetworkDetection, withNetworkInfo, withTimeout };
|
|
26878
27418
|
//# sourceMappingURL=index.mjs.map
|
|
26879
27419
|
//# sourceMappingURL=index.mjs.map
|