@plyaz/api 1.1.1 → 1.2.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/helpers/interceptors.d.ts +2 -2
- package/dist/api/client/helpers/interceptors.d.ts.map +1 -1
- package/dist/api/debugger/UnifiedDebugger.d.ts.map +1 -1
- package/dist/api/encryption/crypto.d.ts +56 -0
- package/dist/api/encryption/crypto.d.ts.map +1 -0
- package/dist/api/encryption/field-path.d.ts +74 -0
- package/dist/api/encryption/field-path.d.ts.map +1 -0
- package/dist/api/encryption/index.d.ts +8 -0
- package/dist/api/encryption/index.d.ts.map +1 -0
- package/dist/api/encryption/interceptors.d.ts +103 -0
- package/dist/api/encryption/interceptors.d.ts.map +1 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/queue/EventQueueManager.d.ts.map +1 -1
- package/dist/index.cjs +727 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +700 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var fetchff = require('fetchff');
|
|
|
7
7
|
var async_hooks = require('async_hooks');
|
|
8
8
|
var common = require('@nestjs/common');
|
|
9
9
|
var rxjs = require('rxjs');
|
|
10
|
-
var crypto = require('crypto');
|
|
10
|
+
var crypto$1 = require('crypto');
|
|
11
11
|
var reactQuery = require('@tanstack/react-query');
|
|
12
12
|
var react = require('react');
|
|
13
13
|
|
|
@@ -610,7 +610,7 @@ function getCrypto() {
|
|
|
610
610
|
}
|
|
611
611
|
__name(getCrypto, "getCrypto");
|
|
612
612
|
function generateUUID() {
|
|
613
|
-
const
|
|
613
|
+
const crypto2 = getCrypto();
|
|
614
614
|
const UUID_CONSTANTS = {
|
|
615
615
|
BYTES: 16,
|
|
616
616
|
VERSION_POSITION: 6,
|
|
@@ -627,12 +627,12 @@ function generateUUID() {
|
|
|
627
627
|
// eslint-disable-next-line no-magic-numbers
|
|
628
628
|
POSITIONS: [8, 12, 16, 20, 32]
|
|
629
629
|
};
|
|
630
|
-
if (
|
|
631
|
-
return
|
|
630
|
+
if (crypto2 && typeof crypto2.randomUUID === "function") {
|
|
631
|
+
return crypto2.randomUUID();
|
|
632
632
|
}
|
|
633
|
-
if (
|
|
633
|
+
if (crypto2?.getRandomValues) {
|
|
634
634
|
const bytes = new Uint8Array(UUID_CONSTANTS.BYTES);
|
|
635
|
-
|
|
635
|
+
crypto2.getRandomValues(bytes);
|
|
636
636
|
bytes[UUID_CONSTANTS.VERSION_POSITION] = bytes[UUID_CONSTANTS.VERSION_POSITION] & UUID_CONSTANTS.VERSION_MASK | UUID_CONSTANTS.VERSION_VALUE;
|
|
637
637
|
bytes[UUID_CONSTANTS.VARIANT_POSITION] = bytes[UUID_CONSTANTS.VARIANT_POSITION] & UUID_CONSTANTS.VARIANT_MASK | UUID_CONSTANTS.VARIANT_VALUE;
|
|
638
638
|
const hex = Array.from(
|
|
@@ -10460,7 +10460,8 @@ var UnifiedDebugger = class _UnifiedDebugger {
|
|
|
10460
10460
|
default: "default configuration",
|
|
10461
10461
|
client: "client configuration",
|
|
10462
10462
|
interceptor: "interceptor configuration",
|
|
10463
|
-
contextHeaders: "context header configuration"
|
|
10463
|
+
contextHeaders: "context header configuration",
|
|
10464
|
+
encryption: "encryption configuration for sensitive data"
|
|
10464
10465
|
};
|
|
10465
10466
|
return reasons[winningSource] || `${winningSource} has higher precedence than ${losingSource}`;
|
|
10466
10467
|
}
|
|
@@ -21847,7 +21848,7 @@ function getHeaderFingerprint(headers2) {
|
|
|
21847
21848
|
return "no-cache-affecting-headers";
|
|
21848
21849
|
}
|
|
21849
21850
|
const content = parts.join("|");
|
|
21850
|
-
return crypto.createHash("sha256").update(content).digest("hex").substring(0, FINGERPRINT_LENGTH);
|
|
21851
|
+
return crypto$1.createHash("sha256").update(content).digest("hex").substring(0, FINGERPRINT_LENGTH);
|
|
21851
21852
|
}
|
|
21852
21853
|
__name(getHeaderFingerprint, "getHeaderFingerprint");
|
|
21853
21854
|
|
|
@@ -22183,6 +22184,669 @@ function createPreservedConfig(options) {
|
|
|
22183
22184
|
} : void 0);
|
|
22184
22185
|
}
|
|
22185
22186
|
__name(createPreservedConfig, "createPreservedConfig");
|
|
22187
|
+
|
|
22188
|
+
// src/api/encryption/crypto.ts
|
|
22189
|
+
var AES_256_KEY_SIZE_BYTES = 32;
|
|
22190
|
+
var BITS_PER_BYTE = 8;
|
|
22191
|
+
var ALGORITHM_PARAMS = {
|
|
22192
|
+
"AES-GCM": {
|
|
22193
|
+
name: "AES-GCM",
|
|
22194
|
+
length: 256,
|
|
22195
|
+
ivLength: 12,
|
|
22196
|
+
// 96 bits recommended for GCM
|
|
22197
|
+
tagLength: 128
|
|
22198
|
+
// 128 bits authentication tag
|
|
22199
|
+
},
|
|
22200
|
+
"AES-CBC": {
|
|
22201
|
+
name: "AES-CBC",
|
|
22202
|
+
length: 256,
|
|
22203
|
+
ivLength: 16
|
|
22204
|
+
// 128 bits for CBC
|
|
22205
|
+
},
|
|
22206
|
+
"ChaCha20-Poly1305": {
|
|
22207
|
+
name: "ChaCha20-Poly1305",
|
|
22208
|
+
length: 256,
|
|
22209
|
+
ivLength: 12
|
|
22210
|
+
// 96 bits nonce
|
|
22211
|
+
}
|
|
22212
|
+
};
|
|
22213
|
+
function isCryptoAvailable() {
|
|
22214
|
+
return typeof crypto !== "undefined" && crypto.subtle !== void 0;
|
|
22215
|
+
}
|
|
22216
|
+
__name(isCryptoAvailable, "isCryptoAvailable");
|
|
22217
|
+
function generateIV(algorithm) {
|
|
22218
|
+
if (!isCryptoAvailable()) {
|
|
22219
|
+
throw new ApiPackageError("Web Crypto API not available");
|
|
22220
|
+
}
|
|
22221
|
+
const params = ALGORITHM_PARAMS[algorithm];
|
|
22222
|
+
return crypto.getRandomValues(new Uint8Array(params.ivLength));
|
|
22223
|
+
}
|
|
22224
|
+
__name(generateIV, "generateIV");
|
|
22225
|
+
function base64ToBytes(base64) {
|
|
22226
|
+
const normalized = base64.replace(/-/g, "+").replace(/_/g, "/");
|
|
22227
|
+
const binary = atob(normalized);
|
|
22228
|
+
const bytes = new Uint8Array(binary.length);
|
|
22229
|
+
for (let i = 0; i < binary.length; i++) {
|
|
22230
|
+
bytes[i] = binary.charCodeAt(i);
|
|
22231
|
+
}
|
|
22232
|
+
return bytes;
|
|
22233
|
+
}
|
|
22234
|
+
__name(base64ToBytes, "base64ToBytes");
|
|
22235
|
+
function bytesToBase64(bytes) {
|
|
22236
|
+
let binary = "";
|
|
22237
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
22238
|
+
binary += String.fromCharCode(bytes[i]);
|
|
22239
|
+
}
|
|
22240
|
+
return btoa(binary);
|
|
22241
|
+
}
|
|
22242
|
+
__name(bytesToBase64, "bytesToBase64");
|
|
22243
|
+
async function importJwkKey(key, algorithmParams) {
|
|
22244
|
+
return await crypto.subtle.importKey(
|
|
22245
|
+
"jwk",
|
|
22246
|
+
key,
|
|
22247
|
+
algorithmParams,
|
|
22248
|
+
true,
|
|
22249
|
+
// extractable for key rotation and backup
|
|
22250
|
+
["encrypt", "decrypt"]
|
|
22251
|
+
);
|
|
22252
|
+
}
|
|
22253
|
+
__name(importJwkKey, "importJwkKey");
|
|
22254
|
+
async function importStringKey(key, format, algorithmParams) {
|
|
22255
|
+
const keyBytes = format === "base64" ? base64ToBytes(key) : new TextEncoder().encode(key);
|
|
22256
|
+
if (keyBytes.length !== AES_256_KEY_SIZE_BYTES) {
|
|
22257
|
+
throw new ApiPackageError(
|
|
22258
|
+
`Invalid key length: expected ${AES_256_KEY_SIZE_BYTES} bytes (256 bits), got ${keyBytes.length} bytes`
|
|
22259
|
+
);
|
|
22260
|
+
}
|
|
22261
|
+
return await crypto.subtle.importKey(
|
|
22262
|
+
"raw",
|
|
22263
|
+
keyBytes,
|
|
22264
|
+
algorithmParams,
|
|
22265
|
+
true,
|
|
22266
|
+
// extractable for key rotation and backup
|
|
22267
|
+
["encrypt", "decrypt"]
|
|
22268
|
+
);
|
|
22269
|
+
}
|
|
22270
|
+
__name(importStringKey, "importStringKey");
|
|
22271
|
+
function isCryptoKey(key) {
|
|
22272
|
+
return key instanceof CryptoKey || typeof key === "object" && key !== null && "type" in key;
|
|
22273
|
+
}
|
|
22274
|
+
__name(isCryptoKey, "isCryptoKey");
|
|
22275
|
+
async function importKey(key, algorithm, format = "raw") {
|
|
22276
|
+
if (isCryptoKey(key)) {
|
|
22277
|
+
return key;
|
|
22278
|
+
}
|
|
22279
|
+
if (!isCryptoAvailable()) {
|
|
22280
|
+
throw new ApiPackageError("Web Crypto API not available");
|
|
22281
|
+
}
|
|
22282
|
+
const algorithmParams = {
|
|
22283
|
+
name: ALGORITHM_PARAMS[algorithm].name,
|
|
22284
|
+
length: ALGORITHM_PARAMS[algorithm].length
|
|
22285
|
+
};
|
|
22286
|
+
if (format === "jwk" && typeof key === "object") {
|
|
22287
|
+
return await importJwkKey(key, algorithmParams);
|
|
22288
|
+
}
|
|
22289
|
+
if (typeof key === "string") {
|
|
22290
|
+
return await importStringKey(key, format, algorithmParams);
|
|
22291
|
+
}
|
|
22292
|
+
throw new ApiPackageError(`Unsupported key format: ${format}`);
|
|
22293
|
+
}
|
|
22294
|
+
__name(importKey, "importKey");
|
|
22295
|
+
async function encrypt(data, encryptionKey) {
|
|
22296
|
+
if (!isCryptoAvailable()) {
|
|
22297
|
+
throw new ApiPackageError("Web Crypto API not available");
|
|
22298
|
+
}
|
|
22299
|
+
const { algorithm, key, format, id: keyId } = encryptionKey;
|
|
22300
|
+
const params = ALGORITHM_PARAMS[algorithm];
|
|
22301
|
+
const cryptoKey = await importKey(key, algorithm, format);
|
|
22302
|
+
const iv = generateIV(algorithm);
|
|
22303
|
+
const dataString = typeof data === "string" ? data : JSON.stringify(data);
|
|
22304
|
+
const dataBytes = new TextEncoder().encode(dataString);
|
|
22305
|
+
const algorithmParams = {
|
|
22306
|
+
name: params.name,
|
|
22307
|
+
iv,
|
|
22308
|
+
...algorithm === "AES-GCM" && "tagLength" in params && { tagLength: params.tagLength }
|
|
22309
|
+
};
|
|
22310
|
+
const encryptedBuffer = await crypto.subtle.encrypt(algorithmParams, cryptoKey, dataBytes);
|
|
22311
|
+
const encryptedBytes = new Uint8Array(encryptedBuffer);
|
|
22312
|
+
let authTag;
|
|
22313
|
+
let ciphertext = encryptedBytes;
|
|
22314
|
+
if (algorithm === "AES-GCM" && "tagLength" in params) {
|
|
22315
|
+
const tagLength = params.tagLength / BITS_PER_BYTE;
|
|
22316
|
+
const ciphertextLength = encryptedBytes.length - tagLength;
|
|
22317
|
+
ciphertext = encryptedBytes.slice(0, ciphertextLength);
|
|
22318
|
+
const tagBytes = encryptedBytes.slice(ciphertextLength);
|
|
22319
|
+
authTag = bytesToBase64(tagBytes);
|
|
22320
|
+
}
|
|
22321
|
+
return {
|
|
22322
|
+
encrypted: true,
|
|
22323
|
+
algorithm,
|
|
22324
|
+
keyId,
|
|
22325
|
+
iv: bytesToBase64(iv),
|
|
22326
|
+
value: bytesToBase64(ciphertext),
|
|
22327
|
+
...authTag && { authTag }
|
|
22328
|
+
};
|
|
22329
|
+
}
|
|
22330
|
+
__name(encrypt, "encrypt");
|
|
22331
|
+
function parseDecryptedData(decryptedString) {
|
|
22332
|
+
try {
|
|
22333
|
+
return JSON.parse(decryptedString);
|
|
22334
|
+
} catch {
|
|
22335
|
+
return decryptedString;
|
|
22336
|
+
}
|
|
22337
|
+
}
|
|
22338
|
+
__name(parseDecryptedData, "parseDecryptedData");
|
|
22339
|
+
function prepareCiphertextForDecryption(ciphertext, algorithm, authTag) {
|
|
22340
|
+
if (algorithm === "AES-GCM" && authTag) {
|
|
22341
|
+
const tagBytes = base64ToBytes(authTag);
|
|
22342
|
+
const combined = new Uint8Array(ciphertext.length + tagBytes.length);
|
|
22343
|
+
combined.set(ciphertext);
|
|
22344
|
+
combined.set(tagBytes, ciphertext.length);
|
|
22345
|
+
return combined;
|
|
22346
|
+
}
|
|
22347
|
+
return ciphertext;
|
|
22348
|
+
}
|
|
22349
|
+
__name(prepareCiphertextForDecryption, "prepareCiphertextForDecryption");
|
|
22350
|
+
async function decrypt(encrypted, encryptionKey) {
|
|
22351
|
+
if (!isCryptoAvailable()) {
|
|
22352
|
+
throw new ApiPackageError("Web Crypto API not available");
|
|
22353
|
+
}
|
|
22354
|
+
if (typeof encrypted === "string") {
|
|
22355
|
+
throw new ApiPackageError(
|
|
22356
|
+
"Cannot decrypt string without metadata. Use EncryptedFieldMetadata format."
|
|
22357
|
+
);
|
|
22358
|
+
}
|
|
22359
|
+
const { algorithm, value, iv: ivBase64, authTag } = encrypted;
|
|
22360
|
+
const { key, format } = encryptionKey;
|
|
22361
|
+
const params = ALGORITHM_PARAMS[algorithm];
|
|
22362
|
+
if (encryptionKey.id !== encrypted.keyId) {
|
|
22363
|
+
throw new ApiPackageError(
|
|
22364
|
+
`Key ID mismatch: expected ${encrypted.keyId}, got ${encryptionKey.id}`
|
|
22365
|
+
);
|
|
22366
|
+
}
|
|
22367
|
+
const cryptoKey = await importKey(key, algorithm, format);
|
|
22368
|
+
const iv = base64ToBytes(ivBase64);
|
|
22369
|
+
const ciphertext = prepareCiphertextForDecryption(base64ToBytes(value), algorithm, authTag);
|
|
22370
|
+
const algorithmParams = {
|
|
22371
|
+
name: params.name,
|
|
22372
|
+
iv,
|
|
22373
|
+
...algorithm === "AES-GCM" && "tagLength" in params && { tagLength: params.tagLength }
|
|
22374
|
+
};
|
|
22375
|
+
try {
|
|
22376
|
+
const decryptedBuffer = await crypto.subtle.decrypt(
|
|
22377
|
+
algorithmParams,
|
|
22378
|
+
cryptoKey,
|
|
22379
|
+
ciphertext
|
|
22380
|
+
);
|
|
22381
|
+
const decryptedBytes = new Uint8Array(decryptedBuffer);
|
|
22382
|
+
const decryptedString = new TextDecoder().decode(decryptedBytes);
|
|
22383
|
+
return parseDecryptedData(decryptedString);
|
|
22384
|
+
} catch (error) {
|
|
22385
|
+
throw new ApiPackageError(
|
|
22386
|
+
`Decryption failed: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
22387
|
+
);
|
|
22388
|
+
}
|
|
22389
|
+
}
|
|
22390
|
+
__name(decrypt, "decrypt");
|
|
22391
|
+
function isEncryptedMetadata(value) {
|
|
22392
|
+
return typeof value === "object" && value !== null && "encrypted" in value && value.encrypted === true && "algorithm" in value && "keyId" in value && "iv" in value && "value" in value;
|
|
22393
|
+
}
|
|
22394
|
+
__name(isEncryptedMetadata, "isEncryptedMetadata");
|
|
22395
|
+
function generateRandomKey() {
|
|
22396
|
+
if (!isCryptoAvailable()) {
|
|
22397
|
+
throw new ApiPackageError("Web Crypto API not available");
|
|
22398
|
+
}
|
|
22399
|
+
return crypto.getRandomValues(new Uint8Array(AES_256_KEY_SIZE_BYTES));
|
|
22400
|
+
}
|
|
22401
|
+
__name(generateRandomKey, "generateRandomKey");
|
|
22402
|
+
async function exportKeyToBase64(key) {
|
|
22403
|
+
if (!isCryptoAvailable()) {
|
|
22404
|
+
throw new ApiPackageError("Web Crypto API not available");
|
|
22405
|
+
}
|
|
22406
|
+
const exported = await crypto.subtle.exportKey("raw", key);
|
|
22407
|
+
return bytesToBase64(new Uint8Array(exported));
|
|
22408
|
+
}
|
|
22409
|
+
__name(exportKeyToBase64, "exportKeyToBase64");
|
|
22410
|
+
|
|
22411
|
+
// src/api/encryption/field-path.ts
|
|
22412
|
+
function parseFieldPath(path) {
|
|
22413
|
+
return path.split(".").filter(Boolean);
|
|
22414
|
+
}
|
|
22415
|
+
__name(parseFieldPath, "parseFieldPath");
|
|
22416
|
+
function isWildcard(segment) {
|
|
22417
|
+
return segment === "*";
|
|
22418
|
+
}
|
|
22419
|
+
__name(isWildcard, "isWildcard");
|
|
22420
|
+
function matchFieldPath(path, pattern) {
|
|
22421
|
+
if (pattern.length !== path.length) {
|
|
22422
|
+
return false;
|
|
22423
|
+
}
|
|
22424
|
+
for (let i = 0; i < pattern.length; i++) {
|
|
22425
|
+
if (!isWildcard(pattern[i]) && pattern[i] !== path[i]) {
|
|
22426
|
+
return false;
|
|
22427
|
+
}
|
|
22428
|
+
}
|
|
22429
|
+
return true;
|
|
22430
|
+
}
|
|
22431
|
+
__name(matchFieldPath, "matchFieldPath");
|
|
22432
|
+
function getAllFieldPaths(obj, prefix = "") {
|
|
22433
|
+
if (typeof obj !== "object" || obj === null) {
|
|
22434
|
+
return [];
|
|
22435
|
+
}
|
|
22436
|
+
const paths = [];
|
|
22437
|
+
if (Array.isArray(obj)) {
|
|
22438
|
+
obj.forEach((item, index) => {
|
|
22439
|
+
const itemPrefix = prefix ? `${prefix}.${index}` : `${index}`;
|
|
22440
|
+
paths.push(itemPrefix);
|
|
22441
|
+
paths.push(...getAllFieldPaths(item, itemPrefix));
|
|
22442
|
+
});
|
|
22443
|
+
} else {
|
|
22444
|
+
Object.keys(obj).forEach((key) => {
|
|
22445
|
+
const fullPath = prefix ? `${prefix}.${key}` : key;
|
|
22446
|
+
paths.push(fullPath);
|
|
22447
|
+
paths.push(...getAllFieldPaths(obj[key], fullPath));
|
|
22448
|
+
});
|
|
22449
|
+
}
|
|
22450
|
+
return paths;
|
|
22451
|
+
}
|
|
22452
|
+
__name(getAllFieldPaths, "getAllFieldPaths");
|
|
22453
|
+
function getFieldValue(obj, path) {
|
|
22454
|
+
if (typeof obj !== "object" || obj === null) {
|
|
22455
|
+
return void 0;
|
|
22456
|
+
}
|
|
22457
|
+
const segments = parseFieldPath(path);
|
|
22458
|
+
let current = obj;
|
|
22459
|
+
for (const segment of segments) {
|
|
22460
|
+
if (typeof current !== "object" || current === null) {
|
|
22461
|
+
return void 0;
|
|
22462
|
+
}
|
|
22463
|
+
current = current[segment];
|
|
22464
|
+
}
|
|
22465
|
+
return current;
|
|
22466
|
+
}
|
|
22467
|
+
__name(getFieldValue, "getFieldValue");
|
|
22468
|
+
function setFieldValue(obj, path, value) {
|
|
22469
|
+
if (typeof obj !== "object" || obj === null) {
|
|
22470
|
+
return;
|
|
22471
|
+
}
|
|
22472
|
+
const segments = parseFieldPath(path);
|
|
22473
|
+
let current = obj;
|
|
22474
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
22475
|
+
const segment = segments[i];
|
|
22476
|
+
if (!(segment in current) || typeof current[segment] !== "object" || current[segment] === null) {
|
|
22477
|
+
current[segment] = {};
|
|
22478
|
+
}
|
|
22479
|
+
current = current[segment];
|
|
22480
|
+
}
|
|
22481
|
+
const lastSegment = segments[segments.length - 1];
|
|
22482
|
+
current[lastSegment] = value;
|
|
22483
|
+
}
|
|
22484
|
+
__name(setFieldValue, "setFieldValue");
|
|
22485
|
+
function findMatchingPaths(obj, pattern) {
|
|
22486
|
+
const allPaths = getAllFieldPaths(obj);
|
|
22487
|
+
const patternSegments = parseFieldPath(pattern);
|
|
22488
|
+
return allPaths.filter((path) => {
|
|
22489
|
+
const pathSegments = parseFieldPath(path);
|
|
22490
|
+
return matchFieldPath(pathSegments, patternSegments);
|
|
22491
|
+
});
|
|
22492
|
+
}
|
|
22493
|
+
__name(findMatchingPaths, "findMatchingPaths");
|
|
22494
|
+
async function transformFields(obj, patterns, transform, excludePatterns) {
|
|
22495
|
+
if (typeof obj !== "object" || obj === null) {
|
|
22496
|
+
return obj;
|
|
22497
|
+
}
|
|
22498
|
+
const result = JSON.parse(JSON.stringify(obj));
|
|
22499
|
+
const matchingPaths = [];
|
|
22500
|
+
for (const pattern of patterns) {
|
|
22501
|
+
matchingPaths.push(...findMatchingPaths(result, pattern));
|
|
22502
|
+
}
|
|
22503
|
+
let pathsToTransform = matchingPaths;
|
|
22504
|
+
if (excludePatterns && excludePatterns.length > 0) {
|
|
22505
|
+
const excludedPaths = /* @__PURE__ */ new Set();
|
|
22506
|
+
for (const excludePattern of excludePatterns) {
|
|
22507
|
+
findMatchingPaths(result, excludePattern).forEach((path) => excludedPaths.add(path));
|
|
22508
|
+
}
|
|
22509
|
+
pathsToTransform = matchingPaths.filter((path) => !excludedPaths.has(path));
|
|
22510
|
+
}
|
|
22511
|
+
for (const path of pathsToTransform) {
|
|
22512
|
+
const value = getFieldValue(result, path);
|
|
22513
|
+
const transformed = await transform(value, path);
|
|
22514
|
+
setFieldValue(result, path, transformed);
|
|
22515
|
+
}
|
|
22516
|
+
return result;
|
|
22517
|
+
}
|
|
22518
|
+
__name(transformFields, "transformFields");
|
|
22519
|
+
function extractFields(obj, patterns) {
|
|
22520
|
+
if (typeof obj !== "object" || obj === null) {
|
|
22521
|
+
return obj;
|
|
22522
|
+
}
|
|
22523
|
+
const result = {};
|
|
22524
|
+
for (const pattern of patterns) {
|
|
22525
|
+
const matchingPaths = findMatchingPaths(obj, pattern);
|
|
22526
|
+
for (const path of matchingPaths) {
|
|
22527
|
+
const value = getFieldValue(obj, path);
|
|
22528
|
+
setFieldValue(result, path, value);
|
|
22529
|
+
}
|
|
22530
|
+
}
|
|
22531
|
+
return result;
|
|
22532
|
+
}
|
|
22533
|
+
__name(extractFields, "extractFields");
|
|
22534
|
+
function hasMatchingFields(obj, patterns) {
|
|
22535
|
+
if (typeof obj !== "object" || obj === null) {
|
|
22536
|
+
return false;
|
|
22537
|
+
}
|
|
22538
|
+
for (const pattern of patterns) {
|
|
22539
|
+
const matching = findMatchingPaths(obj, pattern);
|
|
22540
|
+
if (matching.length > 0) {
|
|
22541
|
+
return true;
|
|
22542
|
+
}
|
|
22543
|
+
}
|
|
22544
|
+
return false;
|
|
22545
|
+
}
|
|
22546
|
+
__name(hasMatchingFields, "hasMatchingFields");
|
|
22547
|
+
function isValidFieldPath(path) {
|
|
22548
|
+
if (!path || typeof path !== "string") {
|
|
22549
|
+
return false;
|
|
22550
|
+
}
|
|
22551
|
+
if (/[^a-zA-Z0-9._*-]/.test(path)) {
|
|
22552
|
+
return false;
|
|
22553
|
+
}
|
|
22554
|
+
if (path.includes("..") || path.startsWith(".") || path.endsWith(".")) {
|
|
22555
|
+
return false;
|
|
22556
|
+
}
|
|
22557
|
+
const segments = parseFieldPath(path);
|
|
22558
|
+
if (segments.length === 0) {
|
|
22559
|
+
return false;
|
|
22560
|
+
}
|
|
22561
|
+
return true;
|
|
22562
|
+
}
|
|
22563
|
+
__name(isValidFieldPath, "isValidFieldPath");
|
|
22564
|
+
|
|
22565
|
+
// src/api/encryption/interceptors.ts
|
|
22566
|
+
async function resolveEncryptionKey(keyOrProvider, context) {
|
|
22567
|
+
if (typeof keyOrProvider === "function") {
|
|
22568
|
+
return await keyOrProvider(context);
|
|
22569
|
+
}
|
|
22570
|
+
return keyOrProvider;
|
|
22571
|
+
}
|
|
22572
|
+
__name(resolveEncryptionKey, "resolveEncryptionKey");
|
|
22573
|
+
function shouldEncryptTarget(target, targets) {
|
|
22574
|
+
if (!targets) {
|
|
22575
|
+
return true;
|
|
22576
|
+
}
|
|
22577
|
+
if (Array.isArray(targets)) {
|
|
22578
|
+
return targets.includes(target);
|
|
22579
|
+
}
|
|
22580
|
+
return targets === target;
|
|
22581
|
+
}
|
|
22582
|
+
__name(shouldEncryptTarget, "shouldEncryptTarget");
|
|
22583
|
+
function handleEncryptionError(error, path, value, onError) {
|
|
22584
|
+
const errorMessage = `Failed to encrypt field '${path}': ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
22585
|
+
if (onError === "throw") {
|
|
22586
|
+
throw new ApiPackageError(errorMessage);
|
|
22587
|
+
}
|
|
22588
|
+
if (onError === "skip") {
|
|
22589
|
+
return value;
|
|
22590
|
+
}
|
|
22591
|
+
return "[ENCRYPTION_FAILED]";
|
|
22592
|
+
}
|
|
22593
|
+
__name(handleEncryptionError, "handleEncryptionError");
|
|
22594
|
+
async function encryptFieldValue(value, path, config) {
|
|
22595
|
+
try {
|
|
22596
|
+
const encrypted = await encrypt(value, config.encryptionKey);
|
|
22597
|
+
return config.includeMetadata ? encrypted : encrypted.value;
|
|
22598
|
+
} catch (error) {
|
|
22599
|
+
return handleEncryptionError(error, path, value, config.onError);
|
|
22600
|
+
}
|
|
22601
|
+
}
|
|
22602
|
+
__name(encryptFieldValue, "encryptFieldValue");
|
|
22603
|
+
function shouldEncryptObject(obj, fields) {
|
|
22604
|
+
if (!obj || typeof obj !== "object") {
|
|
22605
|
+
return false;
|
|
22606
|
+
}
|
|
22607
|
+
if (!fields || fields.length === 0) {
|
|
22608
|
+
return false;
|
|
22609
|
+
}
|
|
22610
|
+
return true;
|
|
22611
|
+
}
|
|
22612
|
+
__name(shouldEncryptObject, "shouldEncryptObject");
|
|
22613
|
+
async function encryptObject(obj, config, encryptionKey) {
|
|
22614
|
+
if (!shouldEncryptObject(obj, config.fields)) {
|
|
22615
|
+
return obj;
|
|
22616
|
+
}
|
|
22617
|
+
const { fields, excludeFields, onError = "throw", includeMetadata = true } = config;
|
|
22618
|
+
try {
|
|
22619
|
+
return transformFields(
|
|
22620
|
+
obj,
|
|
22621
|
+
fields,
|
|
22622
|
+
async (value, path) => encryptFieldValue(value, path, { encryptionKey, includeMetadata, onError }),
|
|
22623
|
+
excludeFields
|
|
22624
|
+
);
|
|
22625
|
+
} catch (error) {
|
|
22626
|
+
if (onError === "throw") {
|
|
22627
|
+
throw error;
|
|
22628
|
+
}
|
|
22629
|
+
return obj;
|
|
22630
|
+
}
|
|
22631
|
+
}
|
|
22632
|
+
__name(encryptObject, "encryptObject");
|
|
22633
|
+
async function decryptObject(obj, config, encryptionKey) {
|
|
22634
|
+
if (!obj || typeof obj !== "object") {
|
|
22635
|
+
return obj;
|
|
22636
|
+
}
|
|
22637
|
+
const { onError = "throw" } = config;
|
|
22638
|
+
try {
|
|
22639
|
+
return await recursiveDecrypt(obj, encryptionKey, onError);
|
|
22640
|
+
} catch (error) {
|
|
22641
|
+
if (onError === "throw") {
|
|
22642
|
+
throw error;
|
|
22643
|
+
}
|
|
22644
|
+
return obj;
|
|
22645
|
+
}
|
|
22646
|
+
}
|
|
22647
|
+
__name(decryptObject, "decryptObject");
|
|
22648
|
+
function handleDecryptionError(error, obj, onError) {
|
|
22649
|
+
const errorMessage = `Failed to decrypt field: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
22650
|
+
if (onError === "throw") {
|
|
22651
|
+
throw new ApiPackageError(errorMessage);
|
|
22652
|
+
}
|
|
22653
|
+
if (onError === "skip") {
|
|
22654
|
+
return obj;
|
|
22655
|
+
}
|
|
22656
|
+
return "[DECRYPTION_FAILED]";
|
|
22657
|
+
}
|
|
22658
|
+
__name(handleDecryptionError, "handleDecryptionError");
|
|
22659
|
+
async function decryptEncryptedValue(obj, encryptionKey, onError) {
|
|
22660
|
+
try {
|
|
22661
|
+
return await decrypt(obj, encryptionKey);
|
|
22662
|
+
} catch (error) {
|
|
22663
|
+
return handleDecryptionError(error, obj, onError);
|
|
22664
|
+
}
|
|
22665
|
+
}
|
|
22666
|
+
__name(decryptEncryptedValue, "decryptEncryptedValue");
|
|
22667
|
+
async function decryptArray(arr, encryptionKey, onError) {
|
|
22668
|
+
const decrypted = await Promise.all(
|
|
22669
|
+
arr.map((item) => recursiveDecrypt(item, encryptionKey, onError))
|
|
22670
|
+
);
|
|
22671
|
+
return decrypted;
|
|
22672
|
+
}
|
|
22673
|
+
__name(decryptArray, "decryptArray");
|
|
22674
|
+
async function decryptObjectRecursively(obj, encryptionKey, onError) {
|
|
22675
|
+
const result = {};
|
|
22676
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
22677
|
+
result[key] = await recursiveDecrypt(value, encryptionKey, onError);
|
|
22678
|
+
}
|
|
22679
|
+
return result;
|
|
22680
|
+
}
|
|
22681
|
+
__name(decryptObjectRecursively, "decryptObjectRecursively");
|
|
22682
|
+
async function recursiveDecrypt(obj, encryptionKey, onError) {
|
|
22683
|
+
if (obj === null || obj === void 0) {
|
|
22684
|
+
return obj;
|
|
22685
|
+
}
|
|
22686
|
+
if (isEncryptedMetadata(obj)) {
|
|
22687
|
+
return await decryptEncryptedValue(obj, encryptionKey, onError);
|
|
22688
|
+
}
|
|
22689
|
+
if (Array.isArray(obj)) {
|
|
22690
|
+
return await decryptArray(obj, encryptionKey, onError);
|
|
22691
|
+
}
|
|
22692
|
+
if (typeof obj === "object") {
|
|
22693
|
+
const decrypted = await decryptObjectRecursively(
|
|
22694
|
+
obj,
|
|
22695
|
+
encryptionKey,
|
|
22696
|
+
onError
|
|
22697
|
+
);
|
|
22698
|
+
return decrypted;
|
|
22699
|
+
}
|
|
22700
|
+
return obj;
|
|
22701
|
+
}
|
|
22702
|
+
__name(recursiveDecrypt, "recursiveDecrypt");
|
|
22703
|
+
function createEncryptionInterceptor(config) {
|
|
22704
|
+
return async (requestConfig) => {
|
|
22705
|
+
if (!config.enabled) {
|
|
22706
|
+
return requestConfig;
|
|
22707
|
+
}
|
|
22708
|
+
const encryptionKey = await resolveEncryptionKey(config.key, {
|
|
22709
|
+
url: requestConfig.url,
|
|
22710
|
+
method: requestConfig.method
|
|
22711
|
+
});
|
|
22712
|
+
if (shouldEncryptTarget("body", config.target) && requestConfig.body) {
|
|
22713
|
+
requestConfig.body = await encryptObject(
|
|
22714
|
+
requestConfig.body,
|
|
22715
|
+
config,
|
|
22716
|
+
encryptionKey
|
|
22717
|
+
);
|
|
22718
|
+
}
|
|
22719
|
+
if (shouldEncryptTarget("params", config.target) && requestConfig.params) {
|
|
22720
|
+
requestConfig.params = await encryptObject(
|
|
22721
|
+
requestConfig.params,
|
|
22722
|
+
config,
|
|
22723
|
+
encryptionKey
|
|
22724
|
+
);
|
|
22725
|
+
}
|
|
22726
|
+
if (shouldEncryptTarget("headers", config.target) && requestConfig.headers) {
|
|
22727
|
+
requestConfig.headers = await encryptObject(
|
|
22728
|
+
requestConfig.headers,
|
|
22729
|
+
config,
|
|
22730
|
+
encryptionKey
|
|
22731
|
+
);
|
|
22732
|
+
}
|
|
22733
|
+
return requestConfig;
|
|
22734
|
+
};
|
|
22735
|
+
}
|
|
22736
|
+
__name(createEncryptionInterceptor, "createEncryptionInterceptor");
|
|
22737
|
+
function createDecryptionInterceptor(config) {
|
|
22738
|
+
return async (response) => {
|
|
22739
|
+
if (!config.enabled || !config.autoDecrypt) {
|
|
22740
|
+
return response;
|
|
22741
|
+
}
|
|
22742
|
+
if (!response.data) {
|
|
22743
|
+
return response;
|
|
22744
|
+
}
|
|
22745
|
+
const encryptionKey = await resolveEncryptionKey(config.key, {
|
|
22746
|
+
url: response.config?.url,
|
|
22747
|
+
method: response.config?.method
|
|
22748
|
+
});
|
|
22749
|
+
response.data = await decryptObject(response.data, config, encryptionKey);
|
|
22750
|
+
return response;
|
|
22751
|
+
};
|
|
22752
|
+
}
|
|
22753
|
+
__name(createDecryptionInterceptor, "createDecryptionInterceptor");
|
|
22754
|
+
function createEncryptionInterceptors(config) {
|
|
22755
|
+
return {
|
|
22756
|
+
onRequest: createEncryptionInterceptor(config),
|
|
22757
|
+
onResponse: createDecryptionInterceptor(config)
|
|
22758
|
+
};
|
|
22759
|
+
}
|
|
22760
|
+
__name(createEncryptionInterceptors, "createEncryptionInterceptors");
|
|
22761
|
+
function validateEncryptionKey(key) {
|
|
22762
|
+
if (!key) {
|
|
22763
|
+
throw new ApiPackageError("Encryption key is required when encryption is enabled");
|
|
22764
|
+
}
|
|
22765
|
+
}
|
|
22766
|
+
__name(validateEncryptionKey, "validateEncryptionKey");
|
|
22767
|
+
function validateAlgorithm(algorithm) {
|
|
22768
|
+
if (!algorithm) {
|
|
22769
|
+
return;
|
|
22770
|
+
}
|
|
22771
|
+
const validAlgorithms = ["AES-GCM", "AES-CBC", "ChaCha20-Poly1305"];
|
|
22772
|
+
if (!validAlgorithms.includes(algorithm)) {
|
|
22773
|
+
throw new ApiPackageError(
|
|
22774
|
+
`Invalid encryption algorithm: ${algorithm}. Must be one of: ${validAlgorithms.join(", ")}`
|
|
22775
|
+
);
|
|
22776
|
+
}
|
|
22777
|
+
}
|
|
22778
|
+
__name(validateAlgorithm, "validateAlgorithm");
|
|
22779
|
+
function validateErrorStrategy(onError) {
|
|
22780
|
+
if (!onError) {
|
|
22781
|
+
return;
|
|
22782
|
+
}
|
|
22783
|
+
const validStrategies = ["throw", "skip", "placeholder"];
|
|
22784
|
+
if (!validStrategies.includes(onError)) {
|
|
22785
|
+
throw new ApiPackageError(
|
|
22786
|
+
`Invalid error handling strategy: ${onError}. Must be one of: ${validStrategies.join(", ")}`
|
|
22787
|
+
);
|
|
22788
|
+
}
|
|
22789
|
+
}
|
|
22790
|
+
__name(validateErrorStrategy, "validateErrorStrategy");
|
|
22791
|
+
function validateTargets(target) {
|
|
22792
|
+
if (!target) {
|
|
22793
|
+
return;
|
|
22794
|
+
}
|
|
22795
|
+
const validTargets = ["body", "params", "headers"];
|
|
22796
|
+
const targets = Array.isArray(target) ? target : [target];
|
|
22797
|
+
for (const t of targets) {
|
|
22798
|
+
if (!validTargets.includes(t)) {
|
|
22799
|
+
throw new ApiPackageError(
|
|
22800
|
+
`Invalid encryption target: ${t}. Must be one of: ${validTargets.join(", ")}`
|
|
22801
|
+
);
|
|
22802
|
+
}
|
|
22803
|
+
}
|
|
22804
|
+
}
|
|
22805
|
+
__name(validateTargets, "validateTargets");
|
|
22806
|
+
function validateEncryptionConfig(config) {
|
|
22807
|
+
if (!config.enabled) {
|
|
22808
|
+
return;
|
|
22809
|
+
}
|
|
22810
|
+
validateEncryptionKey(config.key);
|
|
22811
|
+
validateAlgorithm(config.algorithm);
|
|
22812
|
+
validateErrorStrategy(config.onError);
|
|
22813
|
+
validateTargets(config.target);
|
|
22814
|
+
}
|
|
22815
|
+
__name(validateEncryptionConfig, "validateEncryptionConfig");
|
|
22816
|
+
function getTargetData(target, requestConfig) {
|
|
22817
|
+
if (target === "body") {
|
|
22818
|
+
return requestConfig.body;
|
|
22819
|
+
}
|
|
22820
|
+
if (target === "params") {
|
|
22821
|
+
return requestConfig.params;
|
|
22822
|
+
}
|
|
22823
|
+
if (target === "headers") {
|
|
22824
|
+
return requestConfig.headers;
|
|
22825
|
+
}
|
|
22826
|
+
return void 0;
|
|
22827
|
+
}
|
|
22828
|
+
__name(getTargetData, "getTargetData");
|
|
22829
|
+
function hasMatchingFieldsInTarget(target, requestConfig, config) {
|
|
22830
|
+
if (!shouldEncryptTarget(target, config.target)) {
|
|
22831
|
+
return false;
|
|
22832
|
+
}
|
|
22833
|
+
const targetData = getTargetData(target, requestConfig);
|
|
22834
|
+
if (!targetData) {
|
|
22835
|
+
return false;
|
|
22836
|
+
}
|
|
22837
|
+
return hasMatchingFields(targetData, config.fields ?? []);
|
|
22838
|
+
}
|
|
22839
|
+
__name(hasMatchingFieldsInTarget, "hasMatchingFieldsInTarget");
|
|
22840
|
+
function hasEncryptableFields(requestConfig, config) {
|
|
22841
|
+
if (!config.enabled || !config.fields || config.fields.length === 0) {
|
|
22842
|
+
return false;
|
|
22843
|
+
}
|
|
22844
|
+
const targets = ["body", "params", "headers"];
|
|
22845
|
+
return targets.some((target) => hasMatchingFieldsInTarget(target, requestConfig, config));
|
|
22846
|
+
}
|
|
22847
|
+
__name(hasEncryptableFields, "hasEncryptableFields");
|
|
22848
|
+
|
|
22849
|
+
// src/api/client/helpers/interceptors.ts
|
|
22186
22850
|
var DEFAULT_MAX_RETRIES = 3;
|
|
22187
22851
|
var DEFAULT_SUCCESS_STATUS = config.HTTP_STATUS.OK;
|
|
22188
22852
|
function trackHeaderChanges(beforeHeaders, afterHeaders, interceptorIndex) {
|
|
@@ -22244,7 +22908,7 @@ function createOnRetryHandler(handlers) {
|
|
|
22244
22908
|
};
|
|
22245
22909
|
}
|
|
22246
22910
|
__name(createOnRetryHandler, "createOnRetryHandler");
|
|
22247
|
-
function createOnRequestHandler(handlers, enrichedHeadersConfig) {
|
|
22911
|
+
function createOnRequestHandler(handlers, enrichedHeadersConfig, encryptionConfig) {
|
|
22248
22912
|
return async (config) => {
|
|
22249
22913
|
const performanceFactory = getPerformanceEventFactory();
|
|
22250
22914
|
const requestId = generateRequestId();
|
|
@@ -22276,6 +22940,16 @@ function createOnRequestHandler(handlers, enrichedHeadersConfig) {
|
|
|
22276
22940
|
console.error("Failed to enrich headers:", error);
|
|
22277
22941
|
}
|
|
22278
22942
|
}
|
|
22943
|
+
if (encryptionConfig?.enabled) {
|
|
22944
|
+
try {
|
|
22945
|
+
validateEncryptionConfig(encryptionConfig);
|
|
22946
|
+
const encryptionInterceptor = createEncryptionInterceptor(encryptionConfig);
|
|
22947
|
+
processedConfig = await encryptionInterceptor(processedConfig);
|
|
22948
|
+
UnifiedDebugger.getInstance().trackConfigChange({ encryption: "applied" }, "encryption");
|
|
22949
|
+
} catch (error) {
|
|
22950
|
+
console.error("Failed to encrypt request:", error);
|
|
22951
|
+
}
|
|
22952
|
+
}
|
|
22279
22953
|
if (handlers && handlers.length > 0) {
|
|
22280
22954
|
for (let i = 0; i < handlers.length; i++) {
|
|
22281
22955
|
const handler = handlers[i];
|
|
@@ -22288,7 +22962,7 @@ function createOnRequestHandler(handlers, enrichedHeadersConfig) {
|
|
|
22288
22962
|
};
|
|
22289
22963
|
}
|
|
22290
22964
|
__name(createOnRequestHandler, "createOnRequestHandler");
|
|
22291
|
-
function createOnResponseHandler(handlers, clearTemporaryOverrides2, clearOnComplete) {
|
|
22965
|
+
function createOnResponseHandler(handlers, clearTemporaryOverrides2, clearOnComplete, encryptionConfig) {
|
|
22292
22966
|
return async (response) => {
|
|
22293
22967
|
const performanceFactory = getPerformanceEventFactory();
|
|
22294
22968
|
performanceFactory.emitRequestComplete({
|
|
@@ -22307,6 +22981,15 @@ function createOnResponseHandler(handlers, clearTemporaryOverrides2, clearOnComp
|
|
|
22307
22981
|
}
|
|
22308
22982
|
}
|
|
22309
22983
|
}
|
|
22984
|
+
if (encryptionConfig?.enabled && encryptionConfig?.autoDecrypt) {
|
|
22985
|
+
try {
|
|
22986
|
+
const decryptionInterceptor = createDecryptionInterceptor(encryptionConfig);
|
|
22987
|
+
processedResponse = await decryptionInterceptor(processedResponse);
|
|
22988
|
+
UnifiedDebugger.getInstance().trackConfigChange({ decryption: "applied" }, "encryption");
|
|
22989
|
+
} catch (error) {
|
|
22990
|
+
console.error("Failed to decrypt response:", error);
|
|
22991
|
+
}
|
|
22992
|
+
}
|
|
22310
22993
|
if (clearOnComplete && clearTemporaryOverrides2) {
|
|
22311
22994
|
clearTemporaryOverrides2();
|
|
22312
22995
|
}
|
|
@@ -22400,9 +23083,15 @@ function setupUnifiedHandlers(params) {
|
|
|
22400
23083
|
clientOptions?.onRetry
|
|
22401
23084
|
);
|
|
22402
23085
|
const clearOnComplete = mergedConfig.configOverride?.clearOnComplete ?? globalConfig?.configOverride?.clearOnComplete ?? clientOptions?.configOverride?.clearOnComplete;
|
|
23086
|
+
const encryptionConfig = mergedConfig.encryption ?? globalConfig?.encryption ?? clientOptions?.encryption;
|
|
22403
23087
|
return {
|
|
22404
|
-
onRequest: createOnRequestHandler(mergedOnRequest, enrichedHeadersConfig),
|
|
22405
|
-
onResponse: createOnResponseHandler(
|
|
23088
|
+
onRequest: createOnRequestHandler(mergedOnRequest, enrichedHeadersConfig, encryptionConfig),
|
|
23089
|
+
onResponse: createOnResponseHandler(
|
|
23090
|
+
mergedOnResponse,
|
|
23091
|
+
clearTemporaryOverrides2,
|
|
23092
|
+
clearOnComplete,
|
|
23093
|
+
encryptionConfig
|
|
23094
|
+
),
|
|
22406
23095
|
onError: createOnErrorHandler(mergedOnError, clearTemporaryOverrides2, clearOnComplete),
|
|
22407
23096
|
onRetry: createOnRetryHandler(mergedOnRetry)
|
|
22408
23097
|
};
|
|
@@ -25150,7 +25839,9 @@ exports.applyTemporaryNetworkOverride = applyTemporaryNetworkOverride;
|
|
|
25150
25839
|
exports.applyUnifiedStrategy = applyUnifiedStrategy;
|
|
25151
25840
|
exports.arrayOf = arrayOf;
|
|
25152
25841
|
exports.average = average;
|
|
25842
|
+
exports.base64ToBytes = base64ToBytes;
|
|
25153
25843
|
exports.buildCacheKey = buildCacheKey;
|
|
25844
|
+
exports.bytesToBase64 = bytesToBase64;
|
|
25154
25845
|
exports.cacheKeyPatterns = cacheKeyPatterns;
|
|
25155
25846
|
exports.cacheStrategies = cacheStrategies;
|
|
25156
25847
|
exports.calculateCacheDuration = calculateCacheDuration;
|
|
@@ -25188,7 +25879,10 @@ exports.createCustomUnifiedStrategy = createCustomUnifiedStrategy;
|
|
|
25188
25879
|
exports.createDate = createDate;
|
|
25189
25880
|
exports.createDebouncedAbort = createDebouncedAbort;
|
|
25190
25881
|
exports.createDebugReport = createDebugReport;
|
|
25882
|
+
exports.createDecryptionInterceptor = createDecryptionInterceptor;
|
|
25191
25883
|
exports.createDelay = createDelay;
|
|
25884
|
+
exports.createEncryptionInterceptor = createEncryptionInterceptor;
|
|
25885
|
+
exports.createEncryptionInterceptors = createEncryptionInterceptors;
|
|
25192
25886
|
exports.createEventEmitter = createEventEmitter;
|
|
25193
25887
|
exports.createHistoryEntry = createHistoryEntry;
|
|
25194
25888
|
exports.createHistorySummary = createHistorySummary;
|
|
@@ -25214,6 +25908,7 @@ exports.createTypedSubscription = createTypedSubscription;
|
|
|
25214
25908
|
exports.createVisibilityAwarePolling = createVisibilityAwarePolling;
|
|
25215
25909
|
exports.dateDiff = dateDiff;
|
|
25216
25910
|
exports.debounce = debounce;
|
|
25911
|
+
exports.decrypt = decrypt;
|
|
25217
25912
|
exports.deepMerge = deepMerge;
|
|
25218
25913
|
exports.deleteCache = deleteCache;
|
|
25219
25914
|
exports.deleteCampaign = deleteCampaign;
|
|
@@ -25223,13 +25918,16 @@ exports.detectPlatform = detectPlatform;
|
|
|
25223
25918
|
exports.determinePrecedenceReason = determinePrecedenceReason;
|
|
25224
25919
|
exports.disableNetworkConfigDebug = disableNetworkConfigDebug;
|
|
25225
25920
|
exports.enableNetworkConfigDebug = enableNetworkConfigDebug;
|
|
25921
|
+
exports.encrypt = encrypt;
|
|
25226
25922
|
exports.endOfDay = endOfDay;
|
|
25227
25923
|
exports.eventManager = eventManager;
|
|
25924
|
+
exports.exportKeyToBase64 = exportKeyToBase64;
|
|
25228
25925
|
exports.extendRevalidationPresets = extendPresets;
|
|
25229
25926
|
exports.extractBaseCorrelationId = extractBaseCorrelationId;
|
|
25230
25927
|
exports.extractBaseId = extractBaseId;
|
|
25231
25928
|
exports.extractBaseRequestId = extractBaseRequestId;
|
|
25232
25929
|
exports.extractCorrelationType = extractCorrelationType;
|
|
25930
|
+
exports.extractFields = extractFields;
|
|
25233
25931
|
exports.extractLinkedCorrelationIds = extractLinkedCorrelationIds;
|
|
25234
25932
|
exports.fetchCampaign = fetchCampaign;
|
|
25235
25933
|
exports.fetchCampaignParticipants = fetchCampaignParticipants;
|
|
@@ -25237,6 +25935,7 @@ exports.fetchCampaignStats = fetchCampaignStats;
|
|
|
25237
25935
|
exports.fetchCampaigns = fetchCampaigns;
|
|
25238
25936
|
exports.filterHistory = filterHistory;
|
|
25239
25937
|
exports.filterObject = filterObject;
|
|
25938
|
+
exports.findMatchingPaths = findMatchingPaths;
|
|
25240
25939
|
exports.flattenObject = flattenObject;
|
|
25241
25940
|
exports.formatDuration = formatDuration;
|
|
25242
25941
|
exports.formatReportForConsole = formatReportForConsole;
|
|
@@ -25251,8 +25950,10 @@ exports.generateContextualCorrelationId = generateContextualCorrelationId;
|
|
|
25251
25950
|
exports.generateContextualId = generateContextualId;
|
|
25252
25951
|
exports.generateContextualRequestId = generateContextualRequestId;
|
|
25253
25952
|
exports.generateCorrelationId = generateCorrelationId;
|
|
25953
|
+
exports.generateIV = generateIV;
|
|
25254
25954
|
exports.generateIssueBreakdown = generateIssueBreakdown;
|
|
25255
25955
|
exports.generateNetworkCorrelationId = generateNetworkCorrelationId;
|
|
25956
|
+
exports.generateRandomKey = generateRandomKey;
|
|
25256
25957
|
exports.generateRecommendations = generateRecommendations;
|
|
25257
25958
|
exports.generateRequestId = generateRequestId;
|
|
25258
25959
|
exports.generateSessionCorrelationId = generateSessionCorrelationId;
|
|
@@ -25266,6 +25967,7 @@ exports.getAdaptiveCacheDuration = getAdaptiveCacheDuration;
|
|
|
25266
25967
|
exports.getAdaptiveConfig = getAdaptiveConfig;
|
|
25267
25968
|
exports.getAdaptivePageSize = getAdaptivePageSize;
|
|
25268
25969
|
exports.getAdaptiveTimeout = getAdaptiveTimeout;
|
|
25970
|
+
exports.getAllFieldPaths = getAllFieldPaths;
|
|
25269
25971
|
exports.getAllMediaExtensions = getAllMediaExtensions;
|
|
25270
25972
|
exports.getAppVersion = getAppVersion;
|
|
25271
25973
|
exports.getAuthenticationType = getAuthenticationType;
|
|
@@ -25296,6 +25998,7 @@ exports.getErrorDefinition = getErrorDefinition;
|
|
|
25296
25998
|
exports.getErrorHandlers = getErrorHandlers;
|
|
25297
25999
|
exports.getEventManager = getEventManager;
|
|
25298
26000
|
exports.getExtendedEnvironmentInfo = getExtendedEnvironmentInfo;
|
|
26001
|
+
exports.getFieldValue = getFieldValue;
|
|
25299
26002
|
exports.getFileExtension = getFileExtension;
|
|
25300
26003
|
exports.getFrameworkAdaptiveBatchSize = getFrameworkAdaptiveBatchSize;
|
|
25301
26004
|
exports.getFrameworkAdaptiveTimeout = getFrameworkAdaptiveTimeout;
|
|
@@ -25356,9 +26059,11 @@ exports.handleArrayMerge = handleArrayMerge;
|
|
|
25356
26059
|
exports.handleObjectMerge = handleObjectMerge;
|
|
25357
26060
|
exports.hasAnyExtension = hasAnyExtension;
|
|
25358
26061
|
exports.hasAuthentication = hasAuthentication;
|
|
26062
|
+
exports.hasEncryptableFields = hasEncryptableFields;
|
|
25359
26063
|
exports.hasGlobal = hasGlobal;
|
|
25360
26064
|
exports.hasIndexedDB = hasIndexedDB;
|
|
25361
26065
|
exports.hasLocalStorage = hasLocalStorage;
|
|
26066
|
+
exports.hasMatchingFields = hasMatchingFields;
|
|
25362
26067
|
exports.hasNavigator = hasNavigator;
|
|
25363
26068
|
exports.hasNetworkInfoExpress = hasNetworkInfo2;
|
|
25364
26069
|
exports.hasNetworkInfoNextjs = hasNetworkInfo;
|
|
@@ -25370,6 +26075,7 @@ exports.hasWebPSupport = hasWebPSupport;
|
|
|
25370
26075
|
exports.headerPresets = headerPresets;
|
|
25371
26076
|
exports.headers = headers;
|
|
25372
26077
|
exports.headersContext = headersContext;
|
|
26078
|
+
exports.importKey = importKey;
|
|
25373
26079
|
exports.inBrowser = inBrowser;
|
|
25374
26080
|
exports.inRange = inRange;
|
|
25375
26081
|
exports.inServer = inServer;
|
|
@@ -25383,6 +26089,7 @@ exports.isBun = isBun;
|
|
|
25383
26089
|
exports.isCI = isCI;
|
|
25384
26090
|
exports.isCacheValid = isCacheValid;
|
|
25385
26091
|
exports.isCellularConnection = isCellularConnection;
|
|
26092
|
+
exports.isCryptoAvailable = isCryptoAvailable;
|
|
25386
26093
|
exports.isDataFresh = isDataFresh;
|
|
25387
26094
|
exports.isDataSaverEnabled = isDataSaverEnabled;
|
|
25388
26095
|
exports.isDataSaverEnabledFromHeaders = isDataSaverEnabledFromHeaders;
|
|
@@ -25393,6 +26100,7 @@ exports.isDocumentVisible = isDocumentVisible;
|
|
|
25393
26100
|
exports.isElectron = isElectron;
|
|
25394
26101
|
exports.isEmpty = isEmpty;
|
|
25395
26102
|
exports.isEmptyObject = isEmptyObject;
|
|
26103
|
+
exports.isEncryptedMetadata = isEncryptedMetadata;
|
|
25396
26104
|
exports.isError = isError;
|
|
25397
26105
|
exports.isFunction = isFunction;
|
|
25398
26106
|
exports.isFuture = isFuture;
|
|
@@ -25437,6 +26145,7 @@ exports.isUnifiedStrategyName = isUnifiedStrategyName;
|
|
|
25437
26145
|
exports.isValidCorrelationId = isValidCorrelationId;
|
|
25438
26146
|
exports.isValidDate = isValidDate;
|
|
25439
26147
|
exports.isValidEnumValue = isValidEnumValue;
|
|
26148
|
+
exports.isValidFieldPath = isValidFieldPath;
|
|
25440
26149
|
exports.isValidId = isValidId;
|
|
25441
26150
|
exports.isValidJSON = isValidJSON;
|
|
25442
26151
|
exports.isValidNumber = isValidNumber2;
|
|
@@ -25445,6 +26154,7 @@ exports.isValidRequestId = isValidRequestId;
|
|
|
25445
26154
|
exports.isValidRevalidationStrategyName = isValidStrategyName;
|
|
25446
26155
|
exports.isWebWorker = isWebWorker;
|
|
25447
26156
|
exports.isWifiConnection = isWifiConnection;
|
|
26157
|
+
exports.isWildcard = isWildcard;
|
|
25448
26158
|
exports.isWithinDedupeWindow = isWithinDedupeWindow;
|
|
25449
26159
|
exports.joinCampaign = joinCampaign;
|
|
25450
26160
|
exports.jsonClone = jsonClone;
|
|
@@ -25457,6 +26167,7 @@ exports.logNetworkConfigReport = logNetworkConfigReport;
|
|
|
25457
26167
|
exports.mapKeys = mapKeys;
|
|
25458
26168
|
exports.mapObject = mapObject;
|
|
25459
26169
|
exports.mapRange = mapRange;
|
|
26170
|
+
exports.matchFieldPath = matchFieldPath;
|
|
25460
26171
|
exports.matchesAny = matchesAny;
|
|
25461
26172
|
exports.max = max;
|
|
25462
26173
|
exports.median = median;
|
|
@@ -25486,6 +26197,7 @@ exports.onOnline = onOnline;
|
|
|
25486
26197
|
exports.onceErrorHandler = onceErrorHandler;
|
|
25487
26198
|
exports.oneOf = oneOf;
|
|
25488
26199
|
exports.parseAndValidateNumber = parseAndValidateNumber;
|
|
26200
|
+
exports.parseFieldPath = parseFieldPath;
|
|
25489
26201
|
exports.parseId = parseId;
|
|
25490
26202
|
exports.percentage = percentage;
|
|
25491
26203
|
exports.pick = pick;
|
|
@@ -25524,6 +26236,7 @@ exports.setCache = setCache;
|
|
|
25524
26236
|
exports.setConfigWarnings = setConfigWarnings;
|
|
25525
26237
|
exports.setDefaultApiClient = setDefaultApiClient;
|
|
25526
26238
|
exports.setErrorHandlers = setErrorHandlers;
|
|
26239
|
+
exports.setFieldValue = setFieldValue;
|
|
25527
26240
|
exports.setGlobalConfig = setGlobalConfig;
|
|
25528
26241
|
exports.setupClientEvents = setupClientEvents;
|
|
25529
26242
|
exports.setupRouteChangeCleanup = setupRouteChangeCleanup;
|
|
@@ -25561,6 +26274,7 @@ exports.toISOString = toISOString;
|
|
|
25561
26274
|
exports.trackConfig = trackConfig;
|
|
25562
26275
|
exports.trackNetworkOverride = trackNetworkOverride;
|
|
25563
26276
|
exports.trackableSpread = trackableSpread;
|
|
26277
|
+
exports.transformFields = transformFields;
|
|
25564
26278
|
exports.truncateJSON = truncateJSON;
|
|
25565
26279
|
exports.unifiedStrategies = unifiedStrategies;
|
|
25566
26280
|
exports.unregisterErrorHandlers = unregisterErrorHandlers;
|
|
@@ -25591,6 +26305,7 @@ exports.useSubscription = useSubscription;
|
|
|
25591
26305
|
exports.useSubscriptionState = useSubscriptionState;
|
|
25592
26306
|
exports.useUpdateCampaign = useUpdateCampaign;
|
|
25593
26307
|
exports.validateConfigUpdate = validateConfigUpdate;
|
|
26308
|
+
exports.validateEncryptionConfig = validateEncryptionConfig;
|
|
25594
26309
|
exports.validateHeaders = validateHeaders2;
|
|
25595
26310
|
exports.validatePreset = validatePreset;
|
|
25596
26311
|
exports.waitForOnline = waitForOnline;
|