@plyaz/api 1.6.7 → 1.7.0
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/clientEventManager.d.ts.map +1 -1
- package/dist/api/client/helpers/interceptors.d.ts.map +1 -1
- package/dist/api/debugger/UnifiedDebugger.d.ts +14 -0
- package/dist/api/debugger/UnifiedDebugger.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 +32 -1
- package/dist/entry-frontend.cjs.map +1 -1
- package/dist/entry-frontend.mjs +33 -2
- package/dist/entry-frontend.mjs.map +1 -1
- package/dist/index.cjs +592 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +593 -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';
|
|
@@ -9132,6 +9132,9 @@ var UnifiedDebugger = class _UnifiedDebugger {
|
|
|
9132
9132
|
performanceMode = "minimal";
|
|
9133
9133
|
trackAllProperties = true;
|
|
9134
9134
|
// If false, uses TRACKED_PROPERTIES filter
|
|
9135
|
+
// Debug report control - disabled by default, enable via config:
|
|
9136
|
+
// createApiClient({ debugEvents: { comprehensiveReport: true } })
|
|
9137
|
+
comprehensiveReportEnabled = false;
|
|
9135
9138
|
// Tracking configuration from API config
|
|
9136
9139
|
trackingConfig = {};
|
|
9137
9140
|
// Configurable limits
|
|
@@ -9560,8 +9563,14 @@ var UnifiedDebugger = class _UnifiedDebugger {
|
|
|
9560
9563
|
}
|
|
9561
9564
|
/**
|
|
9562
9565
|
* Log comprehensive report to console
|
|
9566
|
+
*
|
|
9567
|
+
* Controlled via API config: debugEvents.comprehensiveReport = true
|
|
9568
|
+
* Or programmatically via setComprehensiveReportEnabled(true)
|
|
9563
9569
|
*/
|
|
9564
9570
|
async logComprehensiveReport() {
|
|
9571
|
+
if (!this.comprehensiveReportEnabled) {
|
|
9572
|
+
return;
|
|
9573
|
+
}
|
|
9565
9574
|
try {
|
|
9566
9575
|
const presetReport = this.getPresetChangeReport();
|
|
9567
9576
|
if (presetReport) {
|
|
@@ -9583,6 +9592,20 @@ var UnifiedDebugger = class _UnifiedDebugger {
|
|
|
9583
9592
|
throw error;
|
|
9584
9593
|
}
|
|
9585
9594
|
}
|
|
9595
|
+
/**
|
|
9596
|
+
* Enable or disable comprehensive debug report logging
|
|
9597
|
+
*
|
|
9598
|
+
* Typically configured via API config: debugEvents.comprehensiveReport
|
|
9599
|
+
*/
|
|
9600
|
+
setComprehensiveReportEnabled(enabled) {
|
|
9601
|
+
this.comprehensiveReportEnabled = enabled;
|
|
9602
|
+
}
|
|
9603
|
+
/**
|
|
9604
|
+
* Get current comprehensive report enabled state
|
|
9605
|
+
*/
|
|
9606
|
+
getComprehensiveReportEnabled() {
|
|
9607
|
+
return this.comprehensiveReportEnabled;
|
|
9608
|
+
}
|
|
9586
9609
|
/**
|
|
9587
9610
|
* Get debug report (alias for generateDebugReport for API consistency)
|
|
9588
9611
|
*/
|
|
@@ -16158,6 +16181,11 @@ var ClientEventManager = class _ClientEventManager {
|
|
|
16158
16181
|
this.config.configOverride.eventScopes ??= [...EVENT_SCOPES$1];
|
|
16159
16182
|
}
|
|
16160
16183
|
eventManager.setEventScopes(this.config.configOverride.eventScopes);
|
|
16184
|
+
if (this.config.debugEvents?.comprehensiveReport !== void 0) {
|
|
16185
|
+
getUnifiedDebugger().setComprehensiveReportEnabled(
|
|
16186
|
+
this.config.debugEvents.comprehensiveReport
|
|
16187
|
+
);
|
|
16188
|
+
}
|
|
16161
16189
|
this.setupEventHandlers();
|
|
16162
16190
|
}
|
|
16163
16191
|
static {
|
|
@@ -16815,6 +16843,9 @@ var ClientEventManager = class _ClientEventManager {
|
|
|
16815
16843
|
const id = setInterval(() => this.getDebugInfo(), interval);
|
|
16816
16844
|
this.monitoringState.intervals.push(id);
|
|
16817
16845
|
}
|
|
16846
|
+
if (debugConfig?.comprehensiveReport !== void 0) {
|
|
16847
|
+
getUnifiedDebugger().setComprehensiveReportEnabled(debugConfig.comprehensiveReport);
|
|
16848
|
+
}
|
|
16818
16849
|
}
|
|
16819
16850
|
/**
|
|
16820
16851
|
* Stop monitoring
|
|
@@ -21607,7 +21638,7 @@ function createOnErrorHandler(handlers, clearTemporaryOverrides2, clearOnComplet
|
|
|
21607
21638
|
const apiError = new ApiPackageError(
|
|
21608
21639
|
"request.failed",
|
|
21609
21640
|
PACKAGE_STATUS_CODES.REQUEST_FAILED,
|
|
21610
|
-
error.status ?
|
|
21641
|
+
error.status ? getErrorCodeByStatus(error.status) ?? API_ERROR_CODES.CLIENT_ERROR : API_ERROR_CODES.NETWORK_ERROR,
|
|
21611
21642
|
{
|
|
21612
21643
|
cause: error,
|
|
21613
21644
|
context: {
|
|
@@ -22233,6 +22264,546 @@ function applyQualityBasedConfiguration(resolvedConfig, quality, networkAware, n
|
|
|
22233
22264
|
}
|
|
22234
22265
|
}
|
|
22235
22266
|
__name(applyQualityBasedConfiguration, "applyQualityBasedConfiguration");
|
|
22267
|
+
var PROGRESS_CHUNK_SIZE_MULTIPLIER = 64;
|
|
22268
|
+
var UPLOAD_CONSTANTS = {
|
|
22269
|
+
DEFAULT_CHUNK_SIZE: PROGRESS_CHUNK_SIZE_MULTIPLIER * NUMBER_SYSTEM.BYTES_PER_KB,
|
|
22270
|
+
DEFAULT_THROTTLE_MS: TIME_CONSTANTS.HUNDRED_MS,
|
|
22271
|
+
DEFAULT_CONTENT_TYPE: "application/octet-stream",
|
|
22272
|
+
DEFAULT_TIMEOUT: TIME_CONSTANTS.TWO_MINUTES,
|
|
22273
|
+
DEFAULT_RETRY_DELAY: RETRY_DELAYS.SHORT,
|
|
22274
|
+
DEFAULT_RETRY_BACKOFF: RETRY_BACKOFF.MEDIUM,
|
|
22275
|
+
DEFAULT_RETRY_MAX_DELAY: RETRY_DELAYS.MAX,
|
|
22276
|
+
PROGRESS_PERCENTAGE_THRESHOLD: NUMERIC_CONSTANTS.FIVE,
|
|
22277
|
+
FULL_PERCENTAGE: MATH_CONSTANTS$1.PERCENTAGE_MAX,
|
|
22278
|
+
HTTPS_DEFAULT_PORT: TIME_CONSTANTS.HTTPS_PORT,
|
|
22279
|
+
HTTP_DEFAULT_PORT: TIME_CONSTANTS.HTTP_PORT,
|
|
22280
|
+
/** Max server error status code (exclusive boundary for 5xx range) */
|
|
22281
|
+
MAX_SERVER_ERROR_STATUS: 600
|
|
22282
|
+
};
|
|
22283
|
+
var RETRYABLE_ERROR_CODES = [
|
|
22284
|
+
"ETIMEDOUT",
|
|
22285
|
+
"ECONNRESET",
|
|
22286
|
+
"ECONNREFUSED",
|
|
22287
|
+
"ENOTFOUND",
|
|
22288
|
+
"ENETUNREACH",
|
|
22289
|
+
"EAI_AGAIN"
|
|
22290
|
+
];
|
|
22291
|
+
var RETRYABLE_MESSAGE_PATTERNS = [
|
|
22292
|
+
"timeout",
|
|
22293
|
+
"timed out",
|
|
22294
|
+
"network",
|
|
22295
|
+
"econnreset",
|
|
22296
|
+
"econnrefused",
|
|
22297
|
+
"etimedout",
|
|
22298
|
+
"service unavailable",
|
|
22299
|
+
"rate limit",
|
|
22300
|
+
"too many requests"
|
|
22301
|
+
];
|
|
22302
|
+
|
|
22303
|
+
// src/api/upload/config.ts
|
|
22304
|
+
function extractGlobalHeaders(globalConfig) {
|
|
22305
|
+
const globalHeaders = {};
|
|
22306
|
+
if (!globalConfig.headers || typeof globalConfig.headers !== "object") {
|
|
22307
|
+
return globalHeaders;
|
|
22308
|
+
}
|
|
22309
|
+
if (!("presets" in globalConfig.headers) && !("static" in globalConfig.headers)) {
|
|
22310
|
+
Object.entries(globalConfig.headers).forEach(([key, value]) => {
|
|
22311
|
+
if (typeof value === "string") {
|
|
22312
|
+
globalHeaders[key] = value;
|
|
22313
|
+
}
|
|
22314
|
+
});
|
|
22315
|
+
return globalHeaders;
|
|
22316
|
+
}
|
|
22317
|
+
if ("static" in globalConfig.headers) {
|
|
22318
|
+
const staticHeaders = globalConfig.headers.static;
|
|
22319
|
+
if (staticHeaders) {
|
|
22320
|
+
Object.entries(staticHeaders).forEach(([key, value]) => {
|
|
22321
|
+
if (typeof value === "string") {
|
|
22322
|
+
globalHeaders[key] = value;
|
|
22323
|
+
}
|
|
22324
|
+
});
|
|
22325
|
+
}
|
|
22326
|
+
}
|
|
22327
|
+
return globalHeaders;
|
|
22328
|
+
}
|
|
22329
|
+
__name(extractGlobalHeaders, "extractGlobalHeaders");
|
|
22330
|
+
function mergeRetryConfig(optionRetry, globalRetry) {
|
|
22331
|
+
if (optionRetry !== void 0) return optionRetry;
|
|
22332
|
+
if (globalRetry !== void 0) return globalRetry;
|
|
22333
|
+
return false;
|
|
22334
|
+
}
|
|
22335
|
+
__name(mergeRetryConfig, "mergeRetryConfig");
|
|
22336
|
+
function buildLocalConfig(options) {
|
|
22337
|
+
return {
|
|
22338
|
+
headers: options.headers ?? {},
|
|
22339
|
+
timeout: options.timeout ?? UPLOAD_CONSTANTS.DEFAULT_TIMEOUT,
|
|
22340
|
+
baseURL: options.baseURL,
|
|
22341
|
+
retry: options.retry ?? false,
|
|
22342
|
+
onError: options.onError,
|
|
22343
|
+
withCredentials: options.withCredentials ?? false
|
|
22344
|
+
};
|
|
22345
|
+
}
|
|
22346
|
+
__name(buildLocalConfig, "buildLocalConfig");
|
|
22347
|
+
function getMergedConfig(options) {
|
|
22348
|
+
if (options.useGlobalConfig === false) {
|
|
22349
|
+
return buildLocalConfig(options);
|
|
22350
|
+
}
|
|
22351
|
+
const globalConfig = getGlobalConfig();
|
|
22352
|
+
const globalHeaders = extractGlobalHeaders(globalConfig);
|
|
22353
|
+
return {
|
|
22354
|
+
headers: { ...globalHeaders, ...options.headers ?? {} },
|
|
22355
|
+
timeout: options.timeout ?? globalConfig.timeout ?? UPLOAD_CONSTANTS.DEFAULT_TIMEOUT,
|
|
22356
|
+
baseURL: options.baseURL ?? globalConfig.baseURL,
|
|
22357
|
+
retry: mergeRetryConfig(options.retry, globalConfig.retry),
|
|
22358
|
+
onError: options.onError,
|
|
22359
|
+
withCredentials: options.withCredentials ?? globalConfig.withCredentials ?? false
|
|
22360
|
+
};
|
|
22361
|
+
}
|
|
22362
|
+
__name(getMergedConfig, "getMergedConfig");
|
|
22363
|
+
function checkRetryableFlag(error) {
|
|
22364
|
+
if (typeof error.isRetryable === "function") return error.isRetryable();
|
|
22365
|
+
if (typeof error.isRetryable === "boolean") return error.isRetryable;
|
|
22366
|
+
if (typeof error.retryable === "boolean") return error.retryable;
|
|
22367
|
+
return void 0;
|
|
22368
|
+
}
|
|
22369
|
+
__name(checkRetryableFlag, "checkRetryableFlag");
|
|
22370
|
+
function isRetryableStatus(status) {
|
|
22371
|
+
if (status === void 0) return false;
|
|
22372
|
+
if (status === HTTP_STATUS.TOO_MANY_REQUESTS) return true;
|
|
22373
|
+
return status >= HTTP_STATUS.INTERNAL_SERVER_ERROR && status < UPLOAD_CONSTANTS.MAX_SERVER_ERROR_STATUS;
|
|
22374
|
+
}
|
|
22375
|
+
__name(isRetryableStatus, "isRetryableStatus");
|
|
22376
|
+
function hasRetryableErrorCode(error) {
|
|
22377
|
+
return Boolean(
|
|
22378
|
+
error.code && RETRYABLE_ERROR_CODES.includes(error.code)
|
|
22379
|
+
);
|
|
22380
|
+
}
|
|
22381
|
+
__name(hasRetryableErrorCode, "hasRetryableErrorCode");
|
|
22382
|
+
function hasRetryableMessage(error) {
|
|
22383
|
+
const message = error.message?.toLowerCase() ?? "";
|
|
22384
|
+
return RETRYABLE_MESSAGE_PATTERNS.some((pattern) => message.includes(pattern));
|
|
22385
|
+
}
|
|
22386
|
+
__name(hasRetryableMessage, "hasRetryableMessage");
|
|
22387
|
+
function isRetryableError(error, status) {
|
|
22388
|
+
if (!error) return false;
|
|
22389
|
+
const errorWithRetryable = error;
|
|
22390
|
+
const flagResult = checkRetryableFlag(errorWithRetryable);
|
|
22391
|
+
if (flagResult !== void 0) return flagResult;
|
|
22392
|
+
if (hasRetryableErrorCode(errorWithRetryable)) return true;
|
|
22393
|
+
if (hasRetryableMessage(error)) return true;
|
|
22394
|
+
const httpStatus = status ?? errorWithRetryable.statusCode;
|
|
22395
|
+
return isRetryableStatus(httpStatus);
|
|
22396
|
+
}
|
|
22397
|
+
__name(isRetryableError, "isRetryableError");
|
|
22398
|
+
function calculateRetryDelay(attempt, config) {
|
|
22399
|
+
const delay = config.delay ?? UPLOAD_CONSTANTS.DEFAULT_RETRY_DELAY;
|
|
22400
|
+
const backoff = config.backoff ?? UPLOAD_CONSTANTS.DEFAULT_RETRY_BACKOFF;
|
|
22401
|
+
const maxDelay = config.maxDelay ?? UPLOAD_CONSTANTS.DEFAULT_RETRY_MAX_DELAY;
|
|
22402
|
+
const calculatedDelay = delay * Math.pow(backoff, attempt);
|
|
22403
|
+
return Math.min(calculatedDelay, maxDelay);
|
|
22404
|
+
}
|
|
22405
|
+
__name(calculateRetryDelay, "calculateRetryDelay");
|
|
22406
|
+
function notifyRetryError(params) {
|
|
22407
|
+
const { ctx, message, status, statusText, cause } = params;
|
|
22408
|
+
if (!ctx.config.onError) return;
|
|
22409
|
+
ctx.config.onError({
|
|
22410
|
+
message,
|
|
22411
|
+
status,
|
|
22412
|
+
statusText,
|
|
22413
|
+
cause,
|
|
22414
|
+
retryable: true,
|
|
22415
|
+
attempt: ctx.attempt,
|
|
22416
|
+
maxAttempts: ctx.maxAttempts
|
|
22417
|
+
});
|
|
22418
|
+
}
|
|
22419
|
+
__name(notifyRetryError, "notifyRetryError");
|
|
22420
|
+
function notifyFinalError(ctx, error) {
|
|
22421
|
+
if (!ctx.config.onError) return;
|
|
22422
|
+
ctx.config.onError({
|
|
22423
|
+
message: error.message,
|
|
22424
|
+
cause: error,
|
|
22425
|
+
retryable: false,
|
|
22426
|
+
attempt: ctx.attempt,
|
|
22427
|
+
maxAttempts: ctx.maxAttempts
|
|
22428
|
+
});
|
|
22429
|
+
}
|
|
22430
|
+
__name(notifyFinalError, "notifyFinalError");
|
|
22431
|
+
function shouldRetryResult(result, config, attempt, maxAttempts) {
|
|
22432
|
+
if (result.success) return false;
|
|
22433
|
+
if (!config.retry) return false;
|
|
22434
|
+
if (attempt >= maxAttempts - 1) return false;
|
|
22435
|
+
return isRetryableError(new Error(result.statusText ?? "Upload failed"), result.status);
|
|
22436
|
+
}
|
|
22437
|
+
__name(shouldRetryResult, "shouldRetryResult");
|
|
22438
|
+
function shouldRetryError(error, config, attempt, maxAttempts) {
|
|
22439
|
+
if (!config.retry) return false;
|
|
22440
|
+
if (attempt >= maxAttempts - 1) return false;
|
|
22441
|
+
return isRetryableError(error);
|
|
22442
|
+
}
|
|
22443
|
+
__name(shouldRetryError, "shouldRetryError");
|
|
22444
|
+
async function handleRetryDelay(attempt, config) {
|
|
22445
|
+
await sleep(calculateRetryDelay(attempt, config));
|
|
22446
|
+
}
|
|
22447
|
+
__name(handleRetryDelay, "handleRetryDelay");
|
|
22448
|
+
function resolveUrl(url, baseURL) {
|
|
22449
|
+
if (url.startsWith("http://") || url.startsWith("https://")) {
|
|
22450
|
+
return url;
|
|
22451
|
+
}
|
|
22452
|
+
if (!baseURL) {
|
|
22453
|
+
return url;
|
|
22454
|
+
}
|
|
22455
|
+
const base = baseURL.replace(/\/$/, "");
|
|
22456
|
+
const path = url.startsWith("/") ? url : `/${url}`;
|
|
22457
|
+
return `${base}${path}`;
|
|
22458
|
+
}
|
|
22459
|
+
__name(resolveUrl, "resolveUrl");
|
|
22460
|
+
function normalizeData(data) {
|
|
22461
|
+
if (Buffer.isBuffer(data)) return data;
|
|
22462
|
+
if (data instanceof Uint8Array) return data;
|
|
22463
|
+
if (data instanceof ArrayBuffer) return new Uint8Array(data);
|
|
22464
|
+
throw new ApiPackageError(
|
|
22465
|
+
"Blob data type is only supported in browser environment",
|
|
22466
|
+
void 0,
|
|
22467
|
+
API_ERROR_CODES$1.VALIDATION_ERROR
|
|
22468
|
+
);
|
|
22469
|
+
}
|
|
22470
|
+
__name(normalizeData, "normalizeData");
|
|
22471
|
+
function createUploadState(totalSize) {
|
|
22472
|
+
const now2 = Date.now();
|
|
22473
|
+
return {
|
|
22474
|
+
status: "uploading",
|
|
22475
|
+
startTime: now2,
|
|
22476
|
+
bytesUploaded: 0,
|
|
22477
|
+
totalBytes: totalSize,
|
|
22478
|
+
lastProgressTime: now2,
|
|
22479
|
+
lastBytesUploaded: 0
|
|
22480
|
+
};
|
|
22481
|
+
}
|
|
22482
|
+
__name(createUploadState, "createUploadState");
|
|
22483
|
+
function calculateProgress(state) {
|
|
22484
|
+
const now2 = Date.now();
|
|
22485
|
+
const timeDelta = (now2 - state.lastProgressTime) / TIME_CONSTANTS.SECOND;
|
|
22486
|
+
const bytesDelta = state.bytesUploaded - state.lastBytesUploaded;
|
|
22487
|
+
const speed = timeDelta > 0 ? bytesDelta / timeDelta : 0;
|
|
22488
|
+
const percentage2 = Math.round(
|
|
22489
|
+
state.bytesUploaded / state.totalBytes * UPLOAD_CONSTANTS.FULL_PERCENTAGE
|
|
22490
|
+
);
|
|
22491
|
+
const remainingBytes = state.totalBytes - state.bytesUploaded;
|
|
22492
|
+
return {
|
|
22493
|
+
loaded: state.bytesUploaded,
|
|
22494
|
+
total: state.totalBytes,
|
|
22495
|
+
percentage: percentage2,
|
|
22496
|
+
speed: speed > 0 ? speed : void 0,
|
|
22497
|
+
estimatedTimeRemaining: speed > 0 ? remainingBytes / speed : void 0
|
|
22498
|
+
};
|
|
22499
|
+
}
|
|
22500
|
+
__name(calculateProgress, "calculateProgress");
|
|
22501
|
+
function emitFinalProgress(onProgress, totalSize, startTime) {
|
|
22502
|
+
if (!onProgress) return;
|
|
22503
|
+
const elapsed = (Date.now() - startTime) / TIME_CONSTANTS.SECOND;
|
|
22504
|
+
onProgress({
|
|
22505
|
+
loaded: totalSize,
|
|
22506
|
+
total: totalSize,
|
|
22507
|
+
percentage: UPLOAD_CONSTANTS.FULL_PERCENTAGE,
|
|
22508
|
+
speed: elapsed > 0 ? totalSize / elapsed : void 0,
|
|
22509
|
+
estimatedTimeRemaining: 0
|
|
22510
|
+
});
|
|
22511
|
+
}
|
|
22512
|
+
__name(emitFinalProgress, "emitFinalProgress");
|
|
22513
|
+
function shouldEmitProgress(state, totalSize, throttleMs) {
|
|
22514
|
+
const now2 = Date.now();
|
|
22515
|
+
const timeSinceLastProgress = now2 - state.lastProgressTime;
|
|
22516
|
+
const currentPct = Math.round(
|
|
22517
|
+
state.bytesUploaded / totalSize * UPLOAD_CONSTANTS.FULL_PERCENTAGE
|
|
22518
|
+
);
|
|
22519
|
+
const lastPct = Math.round(
|
|
22520
|
+
state.lastBytesUploaded / totalSize * UPLOAD_CONSTANTS.FULL_PERCENTAGE
|
|
22521
|
+
);
|
|
22522
|
+
return timeSinceLastProgress >= throttleMs || currentPct - lastPct >= UPLOAD_CONSTANTS.PROGRESS_PERCENTAGE_THRESHOLD;
|
|
22523
|
+
}
|
|
22524
|
+
__name(shouldEmitProgress, "shouldEmitProgress");
|
|
22525
|
+
function parseNodeHeaders(headers2) {
|
|
22526
|
+
const result = {};
|
|
22527
|
+
for (const [key, value] of Object.entries(headers2)) {
|
|
22528
|
+
if (value !== void 0) {
|
|
22529
|
+
result[key] = Array.isArray(value) ? value.join(", ") : value;
|
|
22530
|
+
}
|
|
22531
|
+
}
|
|
22532
|
+
return result;
|
|
22533
|
+
}
|
|
22534
|
+
__name(parseNodeHeaders, "parseNodeHeaders");
|
|
22535
|
+
|
|
22536
|
+
// src/api/upload/node.ts
|
|
22537
|
+
var createTimeoutError = /* @__PURE__ */ __name((url) => new ApiPackageError("Upload timed out", void 0, API_ERROR_CODES$1.REQUEST_TIMEOUT, {
|
|
22538
|
+
context: { url }
|
|
22539
|
+
}), "createTimeoutError");
|
|
22540
|
+
var createAbortError = /* @__PURE__ */ __name((url) => new ApiPackageError("Upload aborted", void 0, API_ERROR_CODES$1.REQUEST_ABORTED, {
|
|
22541
|
+
context: { url }
|
|
22542
|
+
}), "createAbortError");
|
|
22543
|
+
var normalizeError = /* @__PURE__ */ __name((error) => error instanceof Error ? error : new ApiPackageError(String(error), void 0, API_ERROR_CODES$1.UNKNOWN_ERROR), "normalizeError");
|
|
22544
|
+
async function uploadOnce(options, config, resolvedUrl) {
|
|
22545
|
+
const {
|
|
22546
|
+
data,
|
|
22547
|
+
method = "PUT",
|
|
22548
|
+
contentType = UPLOAD_CONSTANTS.DEFAULT_CONTENT_TYPE,
|
|
22549
|
+
onProgress,
|
|
22550
|
+
abortSignal
|
|
22551
|
+
} = options;
|
|
22552
|
+
const chunkSize = options.chunkSize ?? UPLOAD_CONSTANTS.DEFAULT_CHUNK_SIZE;
|
|
22553
|
+
const throttleMs = options.throttleMs ?? UPLOAD_CONSTANTS.DEFAULT_THROTTLE_MS;
|
|
22554
|
+
const { headers: mergedHeaders, timeout } = config;
|
|
22555
|
+
const buffer = normalizeData(data);
|
|
22556
|
+
const totalSize = buffer.length;
|
|
22557
|
+
const parsedUrl = new URL(resolvedUrl);
|
|
22558
|
+
const isHttps = parsedUrl.protocol === "https:";
|
|
22559
|
+
const httpModule = await (isHttps ? import('https') : import('http'));
|
|
22560
|
+
const state = createUploadState(totalSize);
|
|
22561
|
+
return new Promise((resolve, reject) => {
|
|
22562
|
+
let timeoutId;
|
|
22563
|
+
if (timeout > 0) timeoutId = setTimeout(() => reject(createTimeoutError(resolvedUrl)), timeout);
|
|
22564
|
+
const clearUploadTimeout = /* @__PURE__ */ __name(() => {
|
|
22565
|
+
if (timeoutId) {
|
|
22566
|
+
clearTimeout(timeoutId);
|
|
22567
|
+
timeoutId = void 0;
|
|
22568
|
+
}
|
|
22569
|
+
}, "clearUploadTimeout");
|
|
22570
|
+
onProgress?.({ loaded: 0, total: totalSize, percentage: 0 });
|
|
22571
|
+
const requestOptions = {
|
|
22572
|
+
hostname: parsedUrl.hostname,
|
|
22573
|
+
port: parsedUrl.port || (isHttps ? UPLOAD_CONSTANTS.HTTPS_DEFAULT_PORT : UPLOAD_CONSTANTS.HTTP_DEFAULT_PORT),
|
|
22574
|
+
path: parsedUrl.pathname + parsedUrl.search,
|
|
22575
|
+
method,
|
|
22576
|
+
headers: {
|
|
22577
|
+
"Content-Type": contentType,
|
|
22578
|
+
"Content-Length": totalSize.toString(),
|
|
22579
|
+
...mergedHeaders
|
|
22580
|
+
}
|
|
22581
|
+
};
|
|
22582
|
+
const req = httpModule.request(requestOptions, (res) => {
|
|
22583
|
+
let responseData = "";
|
|
22584
|
+
res.on("data", (chunk) => {
|
|
22585
|
+
responseData += chunk;
|
|
22586
|
+
});
|
|
22587
|
+
res.on("end", () => {
|
|
22588
|
+
clearUploadTimeout();
|
|
22589
|
+
const success = res.statusCode !== void 0 && res.statusCode >= HTTP_STATUS.OK && res.statusCode < HTTP_STATUS.MULTIPLE_CHOICES;
|
|
22590
|
+
if (success) emitFinalProgress(onProgress, totalSize, state.startTime);
|
|
22591
|
+
resolve({
|
|
22592
|
+
status: res.statusCode ?? 0,
|
|
22593
|
+
statusText: res.statusMessage ?? "",
|
|
22594
|
+
data: responseData || void 0,
|
|
22595
|
+
headers: parseNodeHeaders(res.headers),
|
|
22596
|
+
success
|
|
22597
|
+
});
|
|
22598
|
+
});
|
|
22599
|
+
});
|
|
22600
|
+
if (abortSignal)
|
|
22601
|
+
abortSignal.addEventListener("abort", () => {
|
|
22602
|
+
clearUploadTimeout();
|
|
22603
|
+
req.destroy();
|
|
22604
|
+
state.status = "aborted";
|
|
22605
|
+
reject(createAbortError(resolvedUrl));
|
|
22606
|
+
});
|
|
22607
|
+
req.on("error", (error) => {
|
|
22608
|
+
clearUploadTimeout();
|
|
22609
|
+
state.status = "failed";
|
|
22610
|
+
state.error = error;
|
|
22611
|
+
reject(error);
|
|
22612
|
+
});
|
|
22613
|
+
let offset = 0;
|
|
22614
|
+
const writeNextChunk = /* @__PURE__ */ __name(() => {
|
|
22615
|
+
while (offset < totalSize) {
|
|
22616
|
+
const end = Math.min(offset + chunkSize, totalSize);
|
|
22617
|
+
const canContinue = req.write(buffer.subarray(offset, end));
|
|
22618
|
+
state.bytesUploaded = end;
|
|
22619
|
+
offset = end;
|
|
22620
|
+
if (onProgress && shouldEmitProgress(state, totalSize, throttleMs)) {
|
|
22621
|
+
onProgress(calculateProgress(state));
|
|
22622
|
+
state.lastProgressTime = Date.now();
|
|
22623
|
+
state.lastBytesUploaded = state.bytesUploaded;
|
|
22624
|
+
}
|
|
22625
|
+
if (!canContinue) {
|
|
22626
|
+
req.once("drain", writeNextChunk);
|
|
22627
|
+
return;
|
|
22628
|
+
}
|
|
22629
|
+
}
|
|
22630
|
+
state.status = "completed";
|
|
22631
|
+
req.end();
|
|
22632
|
+
}, "writeNextChunk");
|
|
22633
|
+
writeNextChunk();
|
|
22634
|
+
});
|
|
22635
|
+
}
|
|
22636
|
+
__name(uploadOnce, "uploadOnce");
|
|
22637
|
+
async function uploadWithProgressNode(options) {
|
|
22638
|
+
const config = getMergedConfig(options);
|
|
22639
|
+
const resolvedUrl = resolveUrl(options.url, config.baseURL);
|
|
22640
|
+
const maxAttempts = config.retry ? (config.retry.attempts ?? 0) + 1 : 1;
|
|
22641
|
+
let lastError;
|
|
22642
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
22643
|
+
const ctx = { config, maxAttempts, attempt };
|
|
22644
|
+
try {
|
|
22645
|
+
const result = await uploadOnce(options, config, resolvedUrl);
|
|
22646
|
+
if (shouldRetryResult(result, config, attempt, maxAttempts)) {
|
|
22647
|
+
notifyRetryError({
|
|
22648
|
+
ctx,
|
|
22649
|
+
message: `Upload failed: ${result.status}`,
|
|
22650
|
+
status: result.status,
|
|
22651
|
+
statusText: result.statusText
|
|
22652
|
+
});
|
|
22653
|
+
await handleRetryDelay(attempt, config.retry);
|
|
22654
|
+
continue;
|
|
22655
|
+
}
|
|
22656
|
+
return { ...result, attempts: attempt };
|
|
22657
|
+
} catch (error) {
|
|
22658
|
+
lastError = normalizeError(error);
|
|
22659
|
+
if (shouldRetryError(lastError, config, attempt, maxAttempts)) {
|
|
22660
|
+
notifyRetryError({ ctx, message: lastError.message, cause: lastError });
|
|
22661
|
+
await handleRetryDelay(attempt, config.retry);
|
|
22662
|
+
continue;
|
|
22663
|
+
}
|
|
22664
|
+
notifyFinalError(ctx, lastError);
|
|
22665
|
+
throw lastError;
|
|
22666
|
+
}
|
|
22667
|
+
}
|
|
22668
|
+
throw lastError ?? new ApiPackageError(
|
|
22669
|
+
"Upload failed after all retry attempts",
|
|
22670
|
+
void 0,
|
|
22671
|
+
API_ERROR_CODES$1.NETWORK_ERROR
|
|
22672
|
+
);
|
|
22673
|
+
}
|
|
22674
|
+
__name(uploadWithProgressNode, "uploadWithProgressNode");
|
|
22675
|
+
var normalizeError2 = /* @__PURE__ */ __name((error) => error instanceof Error ? error : new ApiPackageError(String(error), void 0, API_ERROR_CODES$1.UNKNOWN_ERROR), "normalizeError");
|
|
22676
|
+
async function uploadOnce2(options, config, resolvedUrl) {
|
|
22677
|
+
const {
|
|
22678
|
+
data,
|
|
22679
|
+
method = "PUT",
|
|
22680
|
+
contentType = UPLOAD_CONSTANTS.DEFAULT_CONTENT_TYPE,
|
|
22681
|
+
onProgress,
|
|
22682
|
+
abortSignal
|
|
22683
|
+
} = options;
|
|
22684
|
+
const { headers: mergedHeaders, timeout, withCredentials } = config;
|
|
22685
|
+
return new Promise((resolve, reject) => {
|
|
22686
|
+
const xhr = new XMLHttpRequest();
|
|
22687
|
+
const startTime = Date.now();
|
|
22688
|
+
if (timeout > 0) xhr.timeout = timeout;
|
|
22689
|
+
xhr.addEventListener(
|
|
22690
|
+
"timeout",
|
|
22691
|
+
() => reject(
|
|
22692
|
+
new ApiPackageError("Upload timed out", void 0, API_ERROR_CODES$1.REQUEST_TIMEOUT, {
|
|
22693
|
+
context: { url: resolvedUrl }
|
|
22694
|
+
})
|
|
22695
|
+
)
|
|
22696
|
+
);
|
|
22697
|
+
xhr.upload.addEventListener("progress", (event) => {
|
|
22698
|
+
if (!event.lengthComputable || !onProgress) return;
|
|
22699
|
+
const elapsed = (Date.now() - startTime) / TIME_CONSTANTS.SECOND;
|
|
22700
|
+
const speed = elapsed > 0 ? event.loaded / elapsed : 0;
|
|
22701
|
+
const remaining = event.total - event.loaded;
|
|
22702
|
+
onProgress({
|
|
22703
|
+
loaded: event.loaded,
|
|
22704
|
+
total: event.total,
|
|
22705
|
+
percentage: Math.round(event.loaded / event.total * UPLOAD_CONSTANTS.FULL_PERCENTAGE),
|
|
22706
|
+
speed,
|
|
22707
|
+
estimatedTimeRemaining: speed > 0 ? remaining / speed : void 0
|
|
22708
|
+
});
|
|
22709
|
+
});
|
|
22710
|
+
xhr.addEventListener("load", () => {
|
|
22711
|
+
const success = xhr.status >= HTTP_STATUS.OK && xhr.status < HTTP_STATUS.MULTIPLE_CHOICES;
|
|
22712
|
+
const responseHeaders = {};
|
|
22713
|
+
const headerLines = xhr.getAllResponseHeaders().trim().split("\n");
|
|
22714
|
+
for (const line of headerLines) {
|
|
22715
|
+
const [key, ...valueParts] = line.split(":");
|
|
22716
|
+
if (key) responseHeaders[key.trim().toLowerCase()] = valueParts.join(":").trim();
|
|
22717
|
+
}
|
|
22718
|
+
resolve({
|
|
22719
|
+
status: xhr.status,
|
|
22720
|
+
statusText: xhr.statusText,
|
|
22721
|
+
data: xhr.responseText || void 0,
|
|
22722
|
+
headers: responseHeaders,
|
|
22723
|
+
success
|
|
22724
|
+
});
|
|
22725
|
+
});
|
|
22726
|
+
xhr.addEventListener(
|
|
22727
|
+
"error",
|
|
22728
|
+
() => reject(
|
|
22729
|
+
new ApiPackageError(
|
|
22730
|
+
`Upload failed: ${xhr.statusText || "Network error"}`,
|
|
22731
|
+
void 0,
|
|
22732
|
+
API_ERROR_CODES$1.NETWORK_ERROR,
|
|
22733
|
+
{ context: { url: resolvedUrl, statusText: xhr.statusText } }
|
|
22734
|
+
)
|
|
22735
|
+
)
|
|
22736
|
+
);
|
|
22737
|
+
xhr.addEventListener(
|
|
22738
|
+
"abort",
|
|
22739
|
+
() => reject(
|
|
22740
|
+
new ApiPackageError("Upload aborted", void 0, API_ERROR_CODES$1.REQUEST_ABORTED, {
|
|
22741
|
+
context: { url: resolvedUrl }
|
|
22742
|
+
})
|
|
22743
|
+
)
|
|
22744
|
+
);
|
|
22745
|
+
if (abortSignal) abortSignal.addEventListener("abort", () => xhr.abort());
|
|
22746
|
+
xhr.open(method, resolvedUrl);
|
|
22747
|
+
if (withCredentials) xhr.withCredentials = true;
|
|
22748
|
+
xhr.setRequestHeader("Content-Type", contentType);
|
|
22749
|
+
for (const [key, value] of Object.entries(mergedHeaders)) xhr.setRequestHeader(key, value);
|
|
22750
|
+
if (data instanceof Blob || data instanceof ArrayBuffer) {
|
|
22751
|
+
xhr.send(data);
|
|
22752
|
+
} else if (data instanceof Uint8Array) {
|
|
22753
|
+
xhr.send(new Uint8Array(data));
|
|
22754
|
+
} else {
|
|
22755
|
+
xhr.send(data);
|
|
22756
|
+
}
|
|
22757
|
+
});
|
|
22758
|
+
}
|
|
22759
|
+
__name(uploadOnce2, "uploadOnce");
|
|
22760
|
+
async function uploadWithProgressBrowser(options) {
|
|
22761
|
+
const config = getMergedConfig(options);
|
|
22762
|
+
const resolvedUrl = resolveUrl(options.url, config.baseURL);
|
|
22763
|
+
const maxAttempts = config.retry ? (config.retry.attempts ?? 0) + 1 : 1;
|
|
22764
|
+
let lastError;
|
|
22765
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
22766
|
+
const ctx = { config, maxAttempts, attempt };
|
|
22767
|
+
try {
|
|
22768
|
+
const result = await uploadOnce2(options, config, resolvedUrl);
|
|
22769
|
+
if (shouldRetryResult(result, config, attempt, maxAttempts)) {
|
|
22770
|
+
notifyRetryError({
|
|
22771
|
+
ctx,
|
|
22772
|
+
message: `Upload failed: ${result.status}`,
|
|
22773
|
+
status: result.status,
|
|
22774
|
+
statusText: result.statusText
|
|
22775
|
+
});
|
|
22776
|
+
await handleRetryDelay(attempt, config.retry);
|
|
22777
|
+
continue;
|
|
22778
|
+
}
|
|
22779
|
+
return { ...result, attempts: attempt };
|
|
22780
|
+
} catch (error) {
|
|
22781
|
+
lastError = normalizeError2(error);
|
|
22782
|
+
if (shouldRetryError(lastError, config, attempt, maxAttempts)) {
|
|
22783
|
+
notifyRetryError({ ctx, message: lastError.message, cause: lastError });
|
|
22784
|
+
await handleRetryDelay(attempt, config.retry);
|
|
22785
|
+
continue;
|
|
22786
|
+
}
|
|
22787
|
+
notifyFinalError(ctx, lastError);
|
|
22788
|
+
throw lastError;
|
|
22789
|
+
}
|
|
22790
|
+
}
|
|
22791
|
+
throw lastError ?? new ApiPackageError(
|
|
22792
|
+
"Upload failed after all retry attempts",
|
|
22793
|
+
void 0,
|
|
22794
|
+
API_ERROR_CODES$1.NETWORK_ERROR
|
|
22795
|
+
);
|
|
22796
|
+
}
|
|
22797
|
+
__name(uploadWithProgressBrowser, "uploadWithProgressBrowser");
|
|
22798
|
+
|
|
22799
|
+
// src/api/upload/uploadWithProgress.ts
|
|
22800
|
+
async function uploadWithProgress(options) {
|
|
22801
|
+
if (isNode()) {
|
|
22802
|
+
return uploadWithProgressNode(options);
|
|
22803
|
+
}
|
|
22804
|
+
return uploadWithProgressBrowser(options);
|
|
22805
|
+
}
|
|
22806
|
+
__name(uploadWithProgress, "uploadWithProgress");
|
|
22236
22807
|
|
|
22237
22808
|
// src/api/hooks/factories/defaults.ts
|
|
22238
22809
|
var DEFAULT_QUERY_OPTIONS = {};
|
|
@@ -24380,13 +24951,13 @@ function isAbortError(error) {
|
|
|
24380
24951
|
return message.includes("abort") || message.includes("cancel");
|
|
24381
24952
|
}
|
|
24382
24953
|
__name(isAbortError, "isAbortError");
|
|
24383
|
-
function
|
|
24954
|
+
function createAbortError2(message = "Request aborted") {
|
|
24384
24955
|
if (message === null || message === void 0) {
|
|
24385
24956
|
return "Request aborted";
|
|
24386
24957
|
}
|
|
24387
24958
|
return message;
|
|
24388
24959
|
}
|
|
24389
|
-
__name(
|
|
24960
|
+
__name(createAbortError2, "createAbortError");
|
|
24390
24961
|
|
|
24391
24962
|
// src/api/request/tracker.ts
|
|
24392
24963
|
var RequestTracker = class {
|
|
@@ -24436,7 +25007,7 @@ var RequestTracker = class {
|
|
|
24436
25007
|
controller.abort(reason);
|
|
24437
25008
|
this.unregister(key);
|
|
24438
25009
|
}
|
|
24439
|
-
void abortRequest(key,
|
|
25010
|
+
void abortRequest(key, createAbortError2(reason ?? "Request aborted"));
|
|
24440
25011
|
}
|
|
24441
25012
|
/**
|
|
24442
25013
|
* Abort all requests in a group
|
|
@@ -24462,7 +25033,7 @@ var RequestTracker = class {
|
|
|
24462
25033
|
});
|
|
24463
25034
|
this.activeRequests.clear();
|
|
24464
25035
|
this.requestGroups.clear();
|
|
24465
|
-
void abortRequest("*",
|
|
25036
|
+
void abortRequest("*", createAbortError2(reason ?? "All requests aborted"));
|
|
24466
25037
|
}
|
|
24467
25038
|
/**
|
|
24468
25039
|
* Get active request count
|
|
@@ -24519,14 +25090,14 @@ function useRequestCleanup() {
|
|
|
24519
25090
|
}, "untrackRequest");
|
|
24520
25091
|
const abortTracked = /* @__PURE__ */ __name((reason) => {
|
|
24521
25092
|
requestKeys.current.forEach((key) => {
|
|
24522
|
-
void abortRequest(key,
|
|
25093
|
+
void abortRequest(key, createAbortError2(reason ?? "Manual abort"));
|
|
24523
25094
|
});
|
|
24524
25095
|
requestKeys.current.clear();
|
|
24525
25096
|
}, "abortTracked");
|
|
24526
25097
|
useEffect(() => {
|
|
24527
25098
|
return () => {
|
|
24528
25099
|
requestKeys.current.forEach((key) => {
|
|
24529
|
-
void abortRequest(key,
|
|
25100
|
+
void abortRequest(key, createAbortError2("Component unmounted"));
|
|
24530
25101
|
});
|
|
24531
25102
|
requestKeys.current.clear();
|
|
24532
25103
|
};
|
|
@@ -24547,14 +25118,14 @@ function useAbortableRequest(key) {
|
|
|
24547
25118
|
controllerRef.current.abort("Component unmounted or dependency changed");
|
|
24548
25119
|
requestTracker.unregister(key);
|
|
24549
25120
|
}
|
|
24550
|
-
void abortRequest(key,
|
|
25121
|
+
void abortRequest(key, createAbortError2("Request cancelled"));
|
|
24551
25122
|
};
|
|
24552
25123
|
}, [key]);
|
|
24553
25124
|
const abort = /* @__PURE__ */ __name((reason) => {
|
|
24554
25125
|
if (controllerRef.current) {
|
|
24555
25126
|
controllerRef.current.abort(reason);
|
|
24556
25127
|
}
|
|
24557
|
-
void abortRequest(key,
|
|
25128
|
+
void abortRequest(key, createAbortError2(reason ?? "Request aborted by user"));
|
|
24558
25129
|
}, "abort");
|
|
24559
25130
|
return {
|
|
24560
25131
|
signal,
|
|
@@ -24616,9 +25187,9 @@ function setupRouteChangeCleanup(router, options = {}) {
|
|
|
24616
25187
|
}
|
|
24617
25188
|
const pattern = options.abortPattern ?? "*";
|
|
24618
25189
|
if (options.preservePatterns && options.preservePatterns.length > 0) {
|
|
24619
|
-
void abortRequest(pattern,
|
|
25190
|
+
void abortRequest(pattern, createAbortError2(`Route changed to ${url}`));
|
|
24620
25191
|
} else {
|
|
24621
|
-
void abortRequest(pattern,
|
|
25192
|
+
void abortRequest(pattern, createAbortError2(`Route changed to ${url}`));
|
|
24622
25193
|
}
|
|
24623
25194
|
}, "executeAbort");
|
|
24624
25195
|
if (options.delay && options.delay > 0) {
|
|
@@ -24665,7 +25236,7 @@ function createRouteGuard(pattern = "*") {
|
|
|
24665
25236
|
}, "enter"),
|
|
24666
25237
|
leave: /* @__PURE__ */ __name((reason) => {
|
|
24667
25238
|
if (isActive) {
|
|
24668
|
-
void abortRequest(pattern,
|
|
25239
|
+
void abortRequest(pattern, createAbortError2(reason ?? "Leaving route"));
|
|
24669
25240
|
isActive = false;
|
|
24670
25241
|
}
|
|
24671
25242
|
}, "leave"),
|
|
@@ -24697,7 +25268,7 @@ __name(createRouteScope, "createRouteScope");
|
|
|
24697
25268
|
|
|
24698
25269
|
// src/api/request/utils.ts
|
|
24699
25270
|
function abortByPattern(pattern, reason) {
|
|
24700
|
-
void abortRequest(pattern,
|
|
25271
|
+
void abortRequest(pattern, createAbortError2(reason ?? `Requests matching ${pattern} aborted`));
|
|
24701
25272
|
}
|
|
24702
25273
|
__name(abortByPattern, "abortByPattern");
|
|
24703
25274
|
function abortSearchRequests(reason) {
|
|
@@ -24715,25 +25286,25 @@ __name(abortAllRequests, "abortAllRequests");
|
|
|
24715
25286
|
function createScopedAbort(scope) {
|
|
24716
25287
|
return (key, reason) => {
|
|
24717
25288
|
const fullKey = key.startsWith("/") ? `${scope}${key}` : `${scope}/${key}`;
|
|
24718
|
-
void abortRequest(fullKey,
|
|
25289
|
+
void abortRequest(fullKey, createAbortError2(reason ?? "Scoped request aborted"));
|
|
24719
25290
|
};
|
|
24720
25291
|
}
|
|
24721
25292
|
__name(createScopedAbort, "createScopedAbort");
|
|
24722
25293
|
function createDebouncedAbort(delay = 300) {
|
|
24723
25294
|
return debounce((key, reason) => {
|
|
24724
|
-
void abortRequest(key,
|
|
25295
|
+
void abortRequest(key, createAbortError2(reason ?? "Debounced abort"));
|
|
24725
25296
|
}, delay);
|
|
24726
25297
|
}
|
|
24727
25298
|
__name(createDebouncedAbort, "createDebouncedAbort");
|
|
24728
25299
|
function createThrottledAbort(limit = 1e3) {
|
|
24729
25300
|
return throttle((key, reason) => {
|
|
24730
|
-
void abortRequest(key,
|
|
25301
|
+
void abortRequest(key, createAbortError2(reason ?? "Throttled abort"));
|
|
24731
25302
|
}, limit);
|
|
24732
25303
|
}
|
|
24733
25304
|
__name(createThrottledAbort, "createThrottledAbort");
|
|
24734
25305
|
async function requestWithTimeout(key, fetcher, timeoutMs) {
|
|
24735
25306
|
const timeoutId = setTimeout(() => {
|
|
24736
|
-
void abortRequest(key,
|
|
25307
|
+
void abortRequest(key, createAbortError2(`Request timeout after ${timeoutMs}ms`));
|
|
24737
25308
|
}, timeoutMs);
|
|
24738
25309
|
try {
|
|
24739
25310
|
return await fetcher();
|
|
@@ -24746,7 +25317,7 @@ async function raceRequests(requests) {
|
|
|
24746
25317
|
const abortLosers = /* @__PURE__ */ __name((winnerKey) => {
|
|
24747
25318
|
requests.forEach((req) => {
|
|
24748
25319
|
if (req.key !== winnerKey) {
|
|
24749
|
-
void abortRequest(req.key,
|
|
25320
|
+
void abortRequest(req.key, createAbortError2("Lost race"));
|
|
24750
25321
|
}
|
|
24751
25322
|
});
|
|
24752
25323
|
}, "abortLosers");
|
|
@@ -24767,7 +25338,7 @@ async function sequentialRequests(requests) {
|
|
|
24767
25338
|
results.push(result);
|
|
24768
25339
|
} catch (error) {
|
|
24769
25340
|
for (let j = i + 1; j < requests.length; j++) {
|
|
24770
|
-
void abortRequest(requests[j].key,
|
|
25341
|
+
void abortRequest(requests[j].key, createAbortError2("Previous request in chain failed"));
|
|
24771
25342
|
}
|
|
24772
25343
|
throw error;
|
|
24773
25344
|
}
|
|
@@ -26874,6 +27445,6 @@ function ApiProvider({
|
|
|
26874
27445
|
}
|
|
26875
27446
|
__name(ApiProvider, "ApiProvider");
|
|
26876
27447
|
|
|
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 };
|
|
27448
|
+
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
27449
|
//# sourceMappingURL=index.mjs.map
|
|
26879
27450
|
//# sourceMappingURL=index.mjs.map
|