@plyaz/api 1.3.0 → 1.4.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/endpoints/cdn.d.ts +122 -0
- package/dist/api/endpoints/cdn.d.ts.map +1 -0
- package/dist/api/endpoints/index.d.ts +34 -4
- package/dist/api/endpoints/index.d.ts.map +1 -1
- package/dist/api/endpoints/virustotal.d.ts +91 -0
- package/dist/api/endpoints/virustotal.d.ts.map +1 -0
- package/dist/api/services/cdn/cloudflare/POST/cloudflarePurgeCache.d.ts +35 -0
- package/dist/api/services/cdn/cloudflare/POST/cloudflarePurgeCache.d.ts.map +1 -0
- package/dist/api/services/cdn/cloudflare/POST/index.d.ts +5 -0
- package/dist/api/services/cdn/cloudflare/POST/index.d.ts.map +1 -0
- package/dist/api/services/cdn/cloudflare/index.d.ts +5 -0
- package/dist/api/services/cdn/cloudflare/index.d.ts.map +1 -0
- package/dist/api/services/cdn/cloudfront/POST/cloudFrontCreateInvalidation.d.ts +38 -0
- package/dist/api/services/cdn/cloudfront/POST/cloudFrontCreateInvalidation.d.ts.map +1 -0
- package/dist/api/services/cdn/cloudfront/POST/index.d.ts +5 -0
- package/dist/api/services/cdn/cloudfront/POST/index.d.ts.map +1 -0
- package/dist/api/services/cdn/cloudfront/index.d.ts +5 -0
- package/dist/api/services/cdn/cloudfront/index.d.ts.map +1 -0
- package/dist/api/services/cdn/fastly/POST/fastlyPurgeUrl.d.ts +35 -0
- package/dist/api/services/cdn/fastly/POST/fastlyPurgeUrl.d.ts.map +1 -0
- package/dist/api/services/cdn/fastly/POST/index.d.ts +5 -0
- package/dist/api/services/cdn/fastly/POST/index.d.ts.map +1 -0
- package/dist/api/services/cdn/fastly/index.d.ts +5 -0
- package/dist/api/services/cdn/fastly/index.d.ts.map +1 -0
- package/dist/api/services/cdn/index.d.ts +8 -0
- package/dist/api/services/cdn/index.d.ts.map +1 -0
- package/dist/api/services/index.d.ts +2 -0
- package/dist/api/services/index.d.ts.map +1 -1
- package/dist/api/services/virustotal/analyses/GET/getAnalysisResult.d.ts +35 -0
- package/dist/api/services/virustotal/analyses/GET/getAnalysisResult.d.ts.map +1 -0
- package/dist/api/services/virustotal/analyses/GET/index.d.ts +6 -0
- package/dist/api/services/virustotal/analyses/GET/index.d.ts.map +1 -0
- package/dist/api/services/virustotal/analyses/index.d.ts +6 -0
- package/dist/api/services/virustotal/analyses/index.d.ts.map +1 -0
- package/dist/api/services/virustotal/files/POST/index.d.ts +6 -0
- package/dist/api/services/virustotal/files/POST/index.d.ts.map +1 -0
- package/dist/api/services/virustotal/files/POST/uploadFileForScanning.d.ts +36 -0
- package/dist/api/services/virustotal/files/POST/uploadFileForScanning.d.ts.map +1 -0
- package/dist/api/services/virustotal/files/index.d.ts +6 -0
- package/dist/api/services/virustotal/files/index.d.ts.map +1 -0
- package/dist/api/services/virustotal/index.d.ts +8 -0
- package/dist/api/services/virustotal/index.d.ts.map +1 -0
- package/dist/api/utils/aws/index.d.ts +7 -0
- package/dist/api/utils/aws/index.d.ts.map +1 -0
- package/dist/api/utils/aws/signature-v4.d.ts +41 -0
- package/dist/api/utils/aws/signature-v4.d.ts.map +1 -0
- package/dist/api/utils/aws/xml/cloudfront.d.ts +37 -0
- package/dist/api/utils/aws/xml/cloudfront.d.ts.map +1 -0
- package/dist/api/utils/aws/xml/index.d.ts +6 -0
- package/dist/api/utils/aws/xml/index.d.ts.map +1 -0
- package/dist/index.cjs +475 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +446 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -6,13 +6,14 @@ 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, NUMERIC_CONSTANTS, MULTIPLIERS, NETWORK_SCORES, NETWORK_TIMEOUTS, RETRY_BACKOFF, RETRY_DELAYS, 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';
|
|
9
|
+
import { isDev, HTTP_STATUS, TIME_CONSTANTS, AWS_CLOUDFRONT_CONFIG, NUMERIC_CONSTANTS, MULTIPLIERS, NETWORK_SCORES, NETWORK_TIMEOUTS, RETRY_BACKOFF, RETRY_DELAYS, 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';
|
|
13
13
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
14
14
|
import { Injectable, createParamDecorator } from '@nestjs/common';
|
|
15
15
|
import { Observable } from 'rxjs';
|
|
16
|
+
import * as crypto2 from 'crypto';
|
|
16
17
|
import { createHash } from 'crypto';
|
|
17
18
|
import { useQueryClient, useQuery, useMutation } from '@tanstack/react-query';
|
|
18
19
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
@@ -616,7 +617,7 @@ function getCrypto() {
|
|
|
616
617
|
}
|
|
617
618
|
__name(getCrypto, "getCrypto");
|
|
618
619
|
function generateUUID() {
|
|
619
|
-
const
|
|
620
|
+
const crypto3 = getCrypto();
|
|
620
621
|
const UUID_CONSTANTS = {
|
|
621
622
|
BYTES: 16,
|
|
622
623
|
VERSION_POSITION: 6,
|
|
@@ -633,12 +634,12 @@ function generateUUID() {
|
|
|
633
634
|
// eslint-disable-next-line no-magic-numbers
|
|
634
635
|
POSITIONS: [8, 12, 16, 20, 32]
|
|
635
636
|
};
|
|
636
|
-
if (
|
|
637
|
-
return
|
|
637
|
+
if (crypto3 && typeof crypto3.randomUUID === "function") {
|
|
638
|
+
return crypto3.randomUUID();
|
|
638
639
|
}
|
|
639
|
-
if (
|
|
640
|
+
if (crypto3?.getRandomValues) {
|
|
640
641
|
const bytes = new Uint8Array(UUID_CONSTANTS.BYTES);
|
|
641
|
-
|
|
642
|
+
crypto3.getRandomValues(bytes);
|
|
642
643
|
bytes[UUID_CONSTANTS.VERSION_POSITION] = bytes[UUID_CONSTANTS.VERSION_POSITION] & UUID_CONSTANTS.VERSION_MASK | UUID_CONSTANTS.VERSION_VALUE;
|
|
643
644
|
bytes[UUID_CONSTANTS.VARIANT_POSITION] = bytes[UUID_CONSTANTS.VARIANT_POSITION] & UUID_CONSTANTS.VARIANT_MASK | UUID_CONSTANTS.VARIANT_VALUE;
|
|
644
645
|
const hex = Array.from(
|
|
@@ -14021,6 +14022,108 @@ var infobipEndpoints = {
|
|
|
14021
14022
|
...infobipEmailEndpoints
|
|
14022
14023
|
};
|
|
14023
14024
|
|
|
14025
|
+
// src/api/endpoints/virustotal.ts
|
|
14026
|
+
var virusTotalEndpoints = {
|
|
14027
|
+
// ========== File Scanning ==========
|
|
14028
|
+
/**
|
|
14029
|
+
* POST /files - Upload file for scanning
|
|
14030
|
+
* Multipart/form-data with file attachment
|
|
14031
|
+
* See official documentation for current free tier limits:
|
|
14032
|
+
* https://developers.virustotal.com/reference/overview#public-vs-premium-api
|
|
14033
|
+
*
|
|
14034
|
+
* @returns {object} response - Upload response with analysis ID
|
|
14035
|
+
* @returns {string} response.data.id - Analysis ID for polling results
|
|
14036
|
+
*/
|
|
14037
|
+
uploadFileForScanning: {
|
|
14038
|
+
url: "/files",
|
|
14039
|
+
method: "POST"
|
|
14040
|
+
},
|
|
14041
|
+
/**
|
|
14042
|
+
* GET /analyses/{id} - Get analysis result
|
|
14043
|
+
* Retrieve scan results for previously uploaded file
|
|
14044
|
+
*
|
|
14045
|
+
* @param {string} id - Analysis ID from upload response
|
|
14046
|
+
* @returns {object} response - Analysis result with threat details
|
|
14047
|
+
*/
|
|
14048
|
+
getAnalysisResult: {
|
|
14049
|
+
url: "/analyses/:id",
|
|
14050
|
+
method: "GET",
|
|
14051
|
+
cacheTime: 0
|
|
14052
|
+
// Don't cache scan results (they update)
|
|
14053
|
+
},
|
|
14054
|
+
// ========== Health & Info ==========
|
|
14055
|
+
/**
|
|
14056
|
+
* GET /version - Get API version info (health check)
|
|
14057
|
+
* Simple endpoint to verify API availability
|
|
14058
|
+
*/
|
|
14059
|
+
getApiVersion: {
|
|
14060
|
+
url: "/version",
|
|
14061
|
+
method: "GET",
|
|
14062
|
+
cacheTime: 300,
|
|
14063
|
+
// Cache for 5 minutes
|
|
14064
|
+
staleTime: 600
|
|
14065
|
+
}
|
|
14066
|
+
};
|
|
14067
|
+
({
|
|
14068
|
+
...virusTotalEndpoints
|
|
14069
|
+
});
|
|
14070
|
+
var cloudflareEndpoints = {
|
|
14071
|
+
/**
|
|
14072
|
+
* POST /zones/{zoneId}/purge_cache - Purge files from cache
|
|
14073
|
+
* Purge specific files or all files in a zone
|
|
14074
|
+
* Rate limits may change; see official documentation for current limits:
|
|
14075
|
+
* https://developers.cloudflare.com/api/operations/zone-purge#rate-limits
|
|
14076
|
+
*
|
|
14077
|
+
* @param {string} zoneId - Cloudflare Zone ID
|
|
14078
|
+
* @returns {object} response - Purge result with success status
|
|
14079
|
+
*/
|
|
14080
|
+
cloudflarePurgeCache: {
|
|
14081
|
+
url: "/zones/:zoneId/purge_cache",
|
|
14082
|
+
method: "POST",
|
|
14083
|
+
cacheTime: 0
|
|
14084
|
+
// Don't cache purge operations
|
|
14085
|
+
}
|
|
14086
|
+
};
|
|
14087
|
+
var cloudFrontEndpoints = {
|
|
14088
|
+
/**
|
|
14089
|
+
* POST /{apiVersion}/distribution/{distributionId}/invalidation - Create invalidation
|
|
14090
|
+
* Creates an invalidation batch for specified paths
|
|
14091
|
+
* Rate limits may change; see the official AWS documentation for current limits:
|
|
14092
|
+
* https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html
|
|
14093
|
+
* Requires AWS Signature Version 4 authentication
|
|
14094
|
+
*
|
|
14095
|
+
* @param {string} distributionId - CloudFront Distribution ID
|
|
14096
|
+
* @returns {object} response - Invalidation result with ID and status
|
|
14097
|
+
*/
|
|
14098
|
+
cloudFrontCreateInvalidation: {
|
|
14099
|
+
url: `/${AWS_CLOUDFRONT_CONFIG.API_VERSION}/distribution/:distributionId/invalidation`,
|
|
14100
|
+
method: "POST",
|
|
14101
|
+
cacheTime: 0
|
|
14102
|
+
}
|
|
14103
|
+
};
|
|
14104
|
+
var fastlyEndpoints = {
|
|
14105
|
+
/**
|
|
14106
|
+
* POST /service/{serviceId}/purge/{url} - Purge single URL
|
|
14107
|
+
* Instant soft-purge of specific URL
|
|
14108
|
+
* Rate limit: Unlimited soft-purges. Hard-purges are limited to 1000 requests per hour per service (as of 2024-06). See Fastly documentation for updates:
|
|
14109
|
+
* @see https://developer.fastly.com/reference/api/purging/#rate-limits
|
|
14110
|
+
*
|
|
14111
|
+
* @param {string} serviceId - Fastly Service ID
|
|
14112
|
+
* @param {string} url - URL to purge (URL-encoded)
|
|
14113
|
+
* @returns {object} response - Purge result with status
|
|
14114
|
+
*/
|
|
14115
|
+
fastlyPurgeUrl: {
|
|
14116
|
+
url: "/service/:serviceId/purge/:url",
|
|
14117
|
+
method: "POST",
|
|
14118
|
+
cacheTime: 0
|
|
14119
|
+
}
|
|
14120
|
+
};
|
|
14121
|
+
var cdnEndpoints = {
|
|
14122
|
+
...cloudflareEndpoints,
|
|
14123
|
+
...cloudFrontEndpoints,
|
|
14124
|
+
...fastlyEndpoints
|
|
14125
|
+
};
|
|
14126
|
+
|
|
14024
14127
|
// src/api/endpoints/utils.ts
|
|
14025
14128
|
function getEndpointUrl(name) {
|
|
14026
14129
|
return endpoints[name].url;
|
|
@@ -14195,7 +14298,13 @@ var endpoints = {
|
|
|
14195
14298
|
// These are only examples for the polling, none of these endpoints doesnt exist yet
|
|
14196
14299
|
...pollingEndpoints,
|
|
14197
14300
|
// Infobip third-party provider endpoints (Email, SMS, WhatsApp)
|
|
14198
|
-
...infobipEndpoints
|
|
14301
|
+
...infobipEndpoints,
|
|
14302
|
+
// VirusTotal third-party provider endpoints (Virus/Malware scanning)
|
|
14303
|
+
...virusTotalEndpoints,
|
|
14304
|
+
// CDN provider endpoints (Cloudflare, CloudFront, Fastly)
|
|
14305
|
+
...cloudflareEndpoints,
|
|
14306
|
+
...cloudFrontEndpoints,
|
|
14307
|
+
...fastlyEndpoints
|
|
14199
14308
|
};
|
|
14200
14309
|
var isSlowConnection = isSlowConnection$1;
|
|
14201
14310
|
function isNetworkAPISupported() {
|
|
@@ -25415,6 +25524,335 @@ async function updateInfobipScheduledEmailStatuses(params, payload, options) {
|
|
|
25415
25524
|
});
|
|
25416
25525
|
}
|
|
25417
25526
|
__name(updateInfobipScheduledEmailStatuses, "updateInfobipScheduledEmailStatuses");
|
|
25527
|
+
async function uploadFileForScanning(payload, options) {
|
|
25528
|
+
const client = options?.apiClient ?? getDefaultApiClient();
|
|
25529
|
+
if (!payload.file) {
|
|
25530
|
+
throw new ApiPackageError(
|
|
25531
|
+
"Missing required field: file",
|
|
25532
|
+
void 0,
|
|
25533
|
+
API_ERROR_CODES.REQUIRED_FIELD_MISSING
|
|
25534
|
+
);
|
|
25535
|
+
}
|
|
25536
|
+
if (!payload.filename) {
|
|
25537
|
+
throw new ApiPackageError(
|
|
25538
|
+
"Missing required field: filename",
|
|
25539
|
+
void 0,
|
|
25540
|
+
API_ERROR_CODES.REQUIRED_FIELD_MISSING
|
|
25541
|
+
);
|
|
25542
|
+
}
|
|
25543
|
+
if (payload.file.length === 0) {
|
|
25544
|
+
throw new ApiPackageError(
|
|
25545
|
+
"File buffer cannot be empty",
|
|
25546
|
+
void 0,
|
|
25547
|
+
API_ERROR_CODES.INVALID_INPUT
|
|
25548
|
+
);
|
|
25549
|
+
}
|
|
25550
|
+
const serviceDefaults = {
|
|
25551
|
+
retry: { attempts: 2 },
|
|
25552
|
+
// Allow retries for network issues
|
|
25553
|
+
timeout: 6e4
|
|
25554
|
+
// 60 second timeout for file uploads
|
|
25555
|
+
};
|
|
25556
|
+
const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
|
|
25557
|
+
const updateOptions = {
|
|
25558
|
+
strategy: "temporary",
|
|
25559
|
+
...options?.updateConfigOptions
|
|
25560
|
+
};
|
|
25561
|
+
if (shouldApplyConfig(mergedConfig, updateOptions)) {
|
|
25562
|
+
client.updateConfig(mergedConfig, updateOptions);
|
|
25563
|
+
}
|
|
25564
|
+
const formData = new FormData();
|
|
25565
|
+
const blob = new Blob([new Uint8Array(payload.file)]);
|
|
25566
|
+
formData.append("file", blob, payload.filename);
|
|
25567
|
+
return client.uploadFileForScanning({
|
|
25568
|
+
body: formData
|
|
25569
|
+
});
|
|
25570
|
+
}
|
|
25571
|
+
__name(uploadFileForScanning, "uploadFileForScanning");
|
|
25572
|
+
async function getAnalysisResult(payload, options) {
|
|
25573
|
+
const client = options?.apiClient ?? getDefaultApiClient();
|
|
25574
|
+
if (!payload.analysisId) {
|
|
25575
|
+
throw new ApiPackageError(
|
|
25576
|
+
"Missing required field: analysisId",
|
|
25577
|
+
void 0,
|
|
25578
|
+
API_ERROR_CODES.REQUIRED_FIELD_MISSING
|
|
25579
|
+
);
|
|
25580
|
+
}
|
|
25581
|
+
const serviceDefaults = {
|
|
25582
|
+
retry: { attempts: 3 },
|
|
25583
|
+
// Allow retries for polling
|
|
25584
|
+
timeout: 3e4,
|
|
25585
|
+
// 30 second timeout
|
|
25586
|
+
cacheTime: 0
|
|
25587
|
+
// Don't cache (results change as scan progresses)
|
|
25588
|
+
};
|
|
25589
|
+
const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
|
|
25590
|
+
const updateOptions = {
|
|
25591
|
+
strategy: "temporary",
|
|
25592
|
+
...options?.updateConfigOptions
|
|
25593
|
+
};
|
|
25594
|
+
if (shouldApplyConfig(mergedConfig, updateOptions)) {
|
|
25595
|
+
client.updateConfig(mergedConfig, updateOptions);
|
|
25596
|
+
}
|
|
25597
|
+
return client.getAnalysisResult({
|
|
25598
|
+
params: { id: payload.analysisId }
|
|
25599
|
+
});
|
|
25600
|
+
}
|
|
25601
|
+
__name(getAnalysisResult, "getAnalysisResult");
|
|
25602
|
+
async function cloudflarePurgeCache(payload, options) {
|
|
25603
|
+
const client = options?.apiClient ?? getDefaultApiClient();
|
|
25604
|
+
if (!payload.zoneId) {
|
|
25605
|
+
throw new ApiPackageError(
|
|
25606
|
+
"Missing required field: zoneId",
|
|
25607
|
+
HTTP_STATUS.BAD_REQUEST,
|
|
25608
|
+
API_ERROR_CODES.CLOUDFLARE_ZONE_NOT_FOUND
|
|
25609
|
+
);
|
|
25610
|
+
}
|
|
25611
|
+
if (!payload.apiToken) {
|
|
25612
|
+
throw new ApiPackageError(
|
|
25613
|
+
"Missing required field: apiToken",
|
|
25614
|
+
HTTP_STATUS.UNAUTHORIZED,
|
|
25615
|
+
API_ERROR_CODES.CLOUDFLARE_AUTHENTICATION_FAILED
|
|
25616
|
+
);
|
|
25617
|
+
}
|
|
25618
|
+
if (!payload.files || payload.files.length === 0) {
|
|
25619
|
+
throw new ApiPackageError(
|
|
25620
|
+
"Missing required field: files (must be non-empty array)",
|
|
25621
|
+
HTTP_STATUS.BAD_REQUEST,
|
|
25622
|
+
API_ERROR_CODES.CLOUDFLARE_INVALID_URL
|
|
25623
|
+
);
|
|
25624
|
+
}
|
|
25625
|
+
const serviceDefaults = {
|
|
25626
|
+
retry: { attempts: 2 },
|
|
25627
|
+
timeout: 3e4
|
|
25628
|
+
// 30 seconds
|
|
25629
|
+
};
|
|
25630
|
+
const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
|
|
25631
|
+
const updateOptions = {
|
|
25632
|
+
strategy: "temporary",
|
|
25633
|
+
...options?.updateConfigOptions
|
|
25634
|
+
};
|
|
25635
|
+
if (shouldApplyConfig(mergedConfig, updateOptions)) {
|
|
25636
|
+
client.updateConfig(mergedConfig, updateOptions);
|
|
25637
|
+
}
|
|
25638
|
+
return client.cloudflarePurgeCache({
|
|
25639
|
+
params: { zoneId: payload.zoneId },
|
|
25640
|
+
headers: {
|
|
25641
|
+
Authorization: `Bearer ${payload.apiToken}`
|
|
25642
|
+
},
|
|
25643
|
+
body: {
|
|
25644
|
+
files: payload.files,
|
|
25645
|
+
zoneId: payload.zoneId,
|
|
25646
|
+
apiToken: payload.apiToken
|
|
25647
|
+
}
|
|
25648
|
+
});
|
|
25649
|
+
}
|
|
25650
|
+
__name(cloudflarePurgeCache, "cloudflarePurgeCache");
|
|
25651
|
+
function generateAWSSignatureV4(options) {
|
|
25652
|
+
const {
|
|
25653
|
+
accessKeyId,
|
|
25654
|
+
secretAccessKey,
|
|
25655
|
+
sessionToken,
|
|
25656
|
+
region,
|
|
25657
|
+
service,
|
|
25658
|
+
method,
|
|
25659
|
+
path,
|
|
25660
|
+
queryString = "",
|
|
25661
|
+
headers: headers2,
|
|
25662
|
+
payload,
|
|
25663
|
+
host
|
|
25664
|
+
} = options;
|
|
25665
|
+
const timestamp = options.timestamp ?? (/* @__PURE__ */ new Date()).toISOString().replace(/[:-]|\.\d{3}/g, "");
|
|
25666
|
+
const dateStamp = timestamp.split("T")[0];
|
|
25667
|
+
const baseHeaders = { ...headers2 };
|
|
25668
|
+
if (!Object.keys(baseHeaders).some((h) => h.toLowerCase() === "host")) {
|
|
25669
|
+
baseHeaders["Host"] = host;
|
|
25670
|
+
}
|
|
25671
|
+
if (sessionToken) {
|
|
25672
|
+
baseHeaders["X-Amz-Security-Token"] = sessionToken;
|
|
25673
|
+
}
|
|
25674
|
+
baseHeaders["X-Amz-Date"] = timestamp;
|
|
25675
|
+
const canonicalHeaders = Object.keys(baseHeaders).sort().map((key) => `${key.toLowerCase()}:${baseHeaders[key].trim()}`).join("\n");
|
|
25676
|
+
const signedHeaders = Object.keys(baseHeaders).sort().map((key) => key.toLowerCase()).join(";");
|
|
25677
|
+
const payloadHash = crypto2.createHash("sha256").update(payload).digest("hex");
|
|
25678
|
+
const canonicalRequest = [
|
|
25679
|
+
method,
|
|
25680
|
+
path,
|
|
25681
|
+
queryString,
|
|
25682
|
+
canonicalHeaders + "\n",
|
|
25683
|
+
signedHeaders,
|
|
25684
|
+
payloadHash
|
|
25685
|
+
].join("\n");
|
|
25686
|
+
const algorithm = "AWS4-HMAC-SHA256";
|
|
25687
|
+
const credentialScope = `${dateStamp}/${region}/${service}/aws4_request`;
|
|
25688
|
+
const canonicalRequestHash = crypto2.createHash("sha256").update(canonicalRequest).digest("hex");
|
|
25689
|
+
const stringToSign = [algorithm, timestamp, credentialScope, canonicalRequestHash].join("\n");
|
|
25690
|
+
const kDate = crypto2.createHmac("sha256", `AWS4${secretAccessKey}`).update(dateStamp).digest();
|
|
25691
|
+
const kRegion = crypto2.createHmac("sha256", kDate).update(region).digest();
|
|
25692
|
+
const kService = crypto2.createHmac("sha256", kRegion).update(service).digest();
|
|
25693
|
+
const kSigning = crypto2.createHmac("sha256", kService).update("aws4_request").digest();
|
|
25694
|
+
const signature = crypto2.createHmac("sha256", kSigning).update(stringToSign).digest("hex");
|
|
25695
|
+
const authorization = `${algorithm} Credential=${accessKeyId}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signature}`;
|
|
25696
|
+
return {
|
|
25697
|
+
headers: baseHeaders,
|
|
25698
|
+
authorization
|
|
25699
|
+
};
|
|
25700
|
+
}
|
|
25701
|
+
__name(generateAWSSignatureV4, "generateAWSSignatureV4");
|
|
25702
|
+
|
|
25703
|
+
// src/api/utils/aws/xml/cloudfront.ts
|
|
25704
|
+
function generateCloudFrontInvalidationXML(paths, callerReference) {
|
|
25705
|
+
const items = paths.map((path) => `<Path>${escapeXml(path)}</Path>`).join("\n ");
|
|
25706
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
25707
|
+
<InvalidationBatch xmlns="http://cloudfront.amazonaws.com/doc/2020-05-31/">
|
|
25708
|
+
<Paths>
|
|
25709
|
+
<Quantity>${paths.length}</Quantity>
|
|
25710
|
+
<Items>
|
|
25711
|
+
${items}
|
|
25712
|
+
</Items>
|
|
25713
|
+
</Paths>
|
|
25714
|
+
<CallerReference>${escapeXml(callerReference)}</CallerReference>
|
|
25715
|
+
</InvalidationBatch>`;
|
|
25716
|
+
}
|
|
25717
|
+
__name(generateCloudFrontInvalidationXML, "generateCloudFrontInvalidationXML");
|
|
25718
|
+
function escapeXml(str) {
|
|
25719
|
+
const xmlEscapes = {
|
|
25720
|
+
"&": "&",
|
|
25721
|
+
"<": "<",
|
|
25722
|
+
">": ">",
|
|
25723
|
+
'"': """,
|
|
25724
|
+
"'": "'"
|
|
25725
|
+
};
|
|
25726
|
+
return str.replace(/[&<>"']/g, (ch) => xmlEscapes[ch]);
|
|
25727
|
+
}
|
|
25728
|
+
__name(escapeXml, "escapeXml");
|
|
25729
|
+
function generateCloudFrontCallerReference(prefix = "api") {
|
|
25730
|
+
return `${prefix}-${Date.now()}`;
|
|
25731
|
+
}
|
|
25732
|
+
__name(generateCloudFrontCallerReference, "generateCloudFrontCallerReference");
|
|
25733
|
+
|
|
25734
|
+
// src/api/services/cdn/cloudfront/POST/cloudFrontCreateInvalidation.ts
|
|
25735
|
+
async function cloudFrontCreateInvalidation(payload, options) {
|
|
25736
|
+
const client = options?.apiClient ?? getDefaultApiClient();
|
|
25737
|
+
if (!payload.distributionId) {
|
|
25738
|
+
throw new ApiPackageError(
|
|
25739
|
+
"Missing required field: distributionId",
|
|
25740
|
+
HTTP_STATUS.BAD_REQUEST,
|
|
25741
|
+
API_ERROR_CODES.CLOUDFRONT_DISTRIBUTION_NOT_FOUND
|
|
25742
|
+
);
|
|
25743
|
+
}
|
|
25744
|
+
if (!payload.accessKeyId) {
|
|
25745
|
+
throw new ApiPackageError(
|
|
25746
|
+
"Missing required field: accessKeyId",
|
|
25747
|
+
HTTP_STATUS.UNAUTHORIZED,
|
|
25748
|
+
API_ERROR_CODES.CLOUDFRONT_AUTHENTICATION_FAILED
|
|
25749
|
+
);
|
|
25750
|
+
}
|
|
25751
|
+
if (!payload.secretAccessKey) {
|
|
25752
|
+
throw new ApiPackageError(
|
|
25753
|
+
"Missing required field: secretAccessKey",
|
|
25754
|
+
HTTP_STATUS.UNAUTHORIZED,
|
|
25755
|
+
API_ERROR_CODES.CLOUDFRONT_AUTHENTICATION_FAILED
|
|
25756
|
+
);
|
|
25757
|
+
}
|
|
25758
|
+
if (!payload.paths || payload.paths.length === 0) {
|
|
25759
|
+
throw new ApiPackageError(
|
|
25760
|
+
"Missing required field: paths (must be non-empty array)",
|
|
25761
|
+
HTTP_STATUS.BAD_REQUEST,
|
|
25762
|
+
API_ERROR_CODES.CLOUDFRONT_INVALID_PATH
|
|
25763
|
+
);
|
|
25764
|
+
}
|
|
25765
|
+
const region = payload.region ?? AWS_CLOUDFRONT_CONFIG.DEFAULT_REGION;
|
|
25766
|
+
const service = AWS_CLOUDFRONT_CONFIG.SERVICE_NAME;
|
|
25767
|
+
const host = AWS_CLOUDFRONT_CONFIG.HOST;
|
|
25768
|
+
const method = "POST";
|
|
25769
|
+
const path = `/${AWS_CLOUDFRONT_CONFIG.API_VERSION}/distribution/${payload.distributionId}/invalidation`;
|
|
25770
|
+
const callerReference = generateCloudFrontCallerReference("api");
|
|
25771
|
+
const body = generateCloudFrontInvalidationXML(payload.paths, callerReference);
|
|
25772
|
+
const { headers: signedHeaders, authorization } = generateAWSSignatureV4({
|
|
25773
|
+
accessKeyId: payload.accessKeyId,
|
|
25774
|
+
secretAccessKey: payload.secretAccessKey,
|
|
25775
|
+
sessionToken: payload.sessionToken,
|
|
25776
|
+
region,
|
|
25777
|
+
service,
|
|
25778
|
+
method,
|
|
25779
|
+
path,
|
|
25780
|
+
host,
|
|
25781
|
+
headers: {
|
|
25782
|
+
"Content-Type": "application/xml"
|
|
25783
|
+
},
|
|
25784
|
+
payload: body
|
|
25785
|
+
});
|
|
25786
|
+
const serviceDefaults = {
|
|
25787
|
+
retry: { attempts: 2 },
|
|
25788
|
+
timeout: 3e4
|
|
25789
|
+
// 30 seconds
|
|
25790
|
+
};
|
|
25791
|
+
const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
|
|
25792
|
+
const updateOptions = {
|
|
25793
|
+
strategy: "temporary",
|
|
25794
|
+
...options?.updateConfigOptions
|
|
25795
|
+
};
|
|
25796
|
+
if (shouldApplyConfig(mergedConfig, updateOptions)) {
|
|
25797
|
+
client.updateConfig(mergedConfig, updateOptions);
|
|
25798
|
+
}
|
|
25799
|
+
return client.cloudFrontCreateInvalidation({
|
|
25800
|
+
params: { distributionId: payload.distributionId },
|
|
25801
|
+
headers: {
|
|
25802
|
+
...signedHeaders,
|
|
25803
|
+
Authorization: authorization
|
|
25804
|
+
},
|
|
25805
|
+
body
|
|
25806
|
+
});
|
|
25807
|
+
}
|
|
25808
|
+
__name(cloudFrontCreateInvalidation, "cloudFrontCreateInvalidation");
|
|
25809
|
+
async function fastlyPurgeUrl(payload, options) {
|
|
25810
|
+
const client = options?.apiClient ?? getDefaultApiClient();
|
|
25811
|
+
if (!payload.serviceId) {
|
|
25812
|
+
throw new ApiPackageError(
|
|
25813
|
+
"Missing required field: serviceId",
|
|
25814
|
+
HTTP_STATUS.BAD_REQUEST,
|
|
25815
|
+
API_ERROR_CODES.FASTLY_SERVICE_NOT_FOUND
|
|
25816
|
+
);
|
|
25817
|
+
}
|
|
25818
|
+
if (!payload.apiToken) {
|
|
25819
|
+
throw new ApiPackageError(
|
|
25820
|
+
"Missing required field: apiToken",
|
|
25821
|
+
HTTP_STATUS.UNAUTHORIZED,
|
|
25822
|
+
API_ERROR_CODES.FASTLY_AUTHENTICATION_FAILED
|
|
25823
|
+
);
|
|
25824
|
+
}
|
|
25825
|
+
if (!payload.url) {
|
|
25826
|
+
throw new ApiPackageError(
|
|
25827
|
+
"Missing required field: url",
|
|
25828
|
+
HTTP_STATUS.BAD_REQUEST,
|
|
25829
|
+
API_ERROR_CODES.FASTLY_INVALID_URL
|
|
25830
|
+
);
|
|
25831
|
+
}
|
|
25832
|
+
const serviceDefaults = {
|
|
25833
|
+
retry: { attempts: 2 },
|
|
25834
|
+
timeout: 15e3
|
|
25835
|
+
// 15 seconds
|
|
25836
|
+
};
|
|
25837
|
+
const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
|
|
25838
|
+
const updateOptions = {
|
|
25839
|
+
strategy: "temporary",
|
|
25840
|
+
...options?.updateConfigOptions
|
|
25841
|
+
};
|
|
25842
|
+
if (shouldApplyConfig(mergedConfig, updateOptions)) {
|
|
25843
|
+
client.updateConfig(mergedConfig, updateOptions);
|
|
25844
|
+
}
|
|
25845
|
+
return client.fastlyPurgeUrl({
|
|
25846
|
+
params: {
|
|
25847
|
+
serviceId: payload.serviceId,
|
|
25848
|
+
url: encodeURIComponent(payload.url)
|
|
25849
|
+
},
|
|
25850
|
+
headers: {
|
|
25851
|
+
"Fastly-Key": payload.apiToken
|
|
25852
|
+
}
|
|
25853
|
+
});
|
|
25854
|
+
}
|
|
25855
|
+
__name(fastlyPurgeUrl, "fastlyPurgeUrl");
|
|
25418
25856
|
function getSSRSafeConfig(config) {
|
|
25419
25857
|
if (!isBrowser()) {
|
|
25420
25858
|
return {
|
|
@@ -25632,6 +26070,6 @@ __name(toFetchffRevalidationConfig, "toFetchffRevalidationConfig");
|
|
|
25632
26070
|
resources: revalidationStrategies.static
|
|
25633
26071
|
});
|
|
25634
26072
|
|
|
25635
|
-
export { ALL_EVENTS, ApiPackageError, 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, checkOverrideTriggers, clamp, clampedPercentage, clearErrorHandlers, clearNetworkDebugData, clearTemporaryOverrides, cloneConfig, 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, 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, detectConfigConflicts, detectConflicts, detectPlatform, determinePrecedenceReason, disableNetworkConfigDebug, enableNetworkConfigDebug, encrypt, endOfDay, endpointCacheKey, endpointCachePattern, endpointCachePatterns, endpoints, eventManager, exportKeyToBase64, extendPresets as extendRevalidationPresets, extractFields, extractUrlParams, fetchCampaign, fetchCampaignParticipants, fetchCampaignStats, fetchCampaigns, fetchInfobipEmailLogs, fetchInfobipEmailReports, fetchInfobipScheduledEmailStatuses, fetchInfobipScheduledEmails, fetchInfobipValidations, filterHistory, filterObject, findEndpointsByPattern, findMatchingPaths, flattenObject, formatDuration, formatReportForConsole, formatTimeForInterval, fromFetchffConfig, fromISOString, fromUnixTimestamp, generateComprehensiveReport, generateIV, generateIssueBreakdown, generateRandomKey, generateRecommendations, generateUUID, getActiveOverrideKeys, getAdaptiveApiConfig, getAdaptiveBatchSize, getAdaptiveCacheDuration, getAdaptiveConfig, getAdaptivePageSize, getAdaptiveTimeout, getAllEndpointUrls, getAllFieldPaths, getAllMediaExtensions, 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, 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, getRelativeTime, getRetryStrategy, getPreset as getRevalidationPreset, getPresets as getRevalidationPresets, getRevalidationStrategy, getRuntimeEnvironment, getSSRSafeConfig, getSSRSafePollingConfig, getSessionStorage, 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, normalizeHeaders3 as normalizeHeaders, now, nowInSeconds, omit, onOffline, onOnline, onceErrorHandler, oneOf, parseAndValidateNumber, parseFieldPath, percentage, pick, pollingEndpoints, pollingStrategies, prepareRequestConfig, prepareRequestConfigWithEnrichedHeaders, prettyStringify, processHeaders2 as processHeaders, raceRequests, randomBetween, randomInt, registerErrorHandler, registerErrorHandlers, removeCircularReferences, removeEmpty, removeNullish, removeSensitiveHeaders, removeUndefined, requestTracker, requestWithTimeout, rescheduleInfobipEmails, resetGlobalConfig, resetPresets as resetRevalidationPresets, resolveConflict, retryConditions, retryStrategies, genericPresets as revalidationPresets, revalidationStrategies, round, runWithHeaders, runWithHeadersAsync, safeParseJSON, safeStringify, sanitizeHeaders2 as sanitizeHeaders, secondsToMs, sendInfobipAdvancedEmail, sendInfobipEmail, sequentialRequests, setCache, setConfigWarnings, setDefaultApiClient, setErrorHandlers, 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, updateGlobalConfig, updateInfobipScheduledEmailStatuses, useAbortableRequest, useApiConfigConflicts, useApiDebugInfo, useApiMonitor, useApiNetworkQuality, useCampaign, useCampaignParticipants, useCampaignStats, useCampaigns, useConditionalSubscription, useCreateCampaign, useDebouncedSubscription, useDeleteCampaign, useJoinCampaign, useLeaveCampaign, useMultipleSubscriptions, useOptimisticUpdate, useRealTimeData, useRequestCleanup, useRequestGroup, useRouteAwareRequest, useSubscription, useSubscriptionState, useUpdateCampaign, validateConfigUpdate, validateEncryptionConfig, validateHeaders2 as validateHeaders, validateInfobipEmail, validatePathParams, validatePreset, waitForOnline, withNetworkDetection, withNetworkInfo, withTimeout };
|
|
26073
|
+
export { ALL_EVENTS, ApiPackageError, 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, 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, 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, detectConfigConflicts, detectConflicts, detectPlatform, determinePrecedenceReason, disableNetworkConfigDebug, enableNetworkConfigDebug, encrypt, endOfDay, endpointCacheKey, endpointCachePattern, endpointCachePatterns, endpoints, eventManager, exportKeyToBase64, extendPresets as extendRevalidationPresets, extractFields, extractUrlParams, fastlyEndpoints, fastlyPurgeUrl, fetchCampaign, fetchCampaignParticipants, fetchCampaignStats, fetchCampaigns, fetchInfobipEmailLogs, fetchInfobipEmailReports, fetchInfobipScheduledEmailStatuses, fetchInfobipScheduledEmails, fetchInfobipValidations, filterHistory, filterObject, findEndpointsByPattern, findMatchingPaths, flattenObject, formatDuration, formatReportForConsole, formatTimeForInterval, fromFetchffConfig, fromISOString, fromUnixTimestamp, generateComprehensiveReport, 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, 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, getRelativeTime, getRetryStrategy, getPreset as getRevalidationPreset, getPresets as getRevalidationPresets, getRevalidationStrategy, getRuntimeEnvironment, getSSRSafeConfig, getSSRSafePollingConfig, getSessionStorage, 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, normalizeHeaders3 as normalizeHeaders, now, nowInSeconds, omit, onOffline, onOnline, onceErrorHandler, oneOf, parseAndValidateNumber, parseFieldPath, percentage, pick, pollingEndpoints, pollingStrategies, prepareRequestConfig, prepareRequestConfigWithEnrichedHeaders, prettyStringify, processHeaders2 as processHeaders, raceRequests, randomBetween, randomInt, registerErrorHandler, registerErrorHandlers, removeCircularReferences, removeEmpty, removeNullish, removeSensitiveHeaders, removeUndefined, requestTracker, requestWithTimeout, rescheduleInfobipEmails, resetGlobalConfig, resetPresets as resetRevalidationPresets, resolveConflict, retryConditions, retryStrategies, genericPresets as revalidationPresets, revalidationStrategies, round, runWithHeaders, runWithHeadersAsync, safeParseJSON, safeStringify, sanitizeHeaders2 as sanitizeHeaders, secondsToMs, sendInfobipAdvancedEmail, sendInfobipEmail, sequentialRequests, setCache, setConfigWarnings, setDefaultApiClient, setErrorHandlers, 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, updateGlobalConfig, updateInfobipScheduledEmailStatuses, uploadFileForScanning, useAbortableRequest, useApiConfigConflicts, useApiDebugInfo, useApiMonitor, useApiNetworkQuality, useCampaign, useCampaignParticipants, useCampaignStats, useCampaigns, useConditionalSubscription, useCreateCampaign, useDebouncedSubscription, useDeleteCampaign, useJoinCampaign, useLeaveCampaign, useMultipleSubscriptions, useOptimisticUpdate, useRealTimeData, useRequestCleanup, useRequestGroup, useRouteAwareRequest, useSubscription, useSubscriptionState, useUpdateCampaign, validateConfigUpdate, validateEncryptionConfig, validateHeaders2 as validateHeaders, validateInfobipEmail, validatePathParams, validatePreset, virusTotalEndpoints, waitForOnline, withNetworkDetection, withNetworkInfo, withTimeout };
|
|
25636
26074
|
//# sourceMappingURL=index.mjs.map
|
|
25637
26075
|
//# sourceMappingURL=index.mjs.map
|