@katlux/providers 0.1.1-alpha.105 → 0.1.1-alpha.106
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/index.cjs +482 -124
- package/dist/index.d.cts +136 -7
- package/dist/index.d.mts +136 -7
- package/dist/index.d.ts +136 -7
- package/dist/index.mjs +473 -125
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,10 @@ interface IEncryptedPayload {
|
|
|
10
10
|
wrappedKey?: string;
|
|
11
11
|
sharedKey?: boolean;
|
|
12
12
|
epk?: JsonWebKey;
|
|
13
|
+
/** Optional Key Identifier for role-based key routing and key rotation */
|
|
14
|
+
kid?: string;
|
|
15
|
+
/** True if AEAD additionalData was bound during encryption */
|
|
16
|
+
aad?: boolean;
|
|
13
17
|
}
|
|
14
18
|
type TRawKey = string | CryptoKey | Uint8Array | ArrayBuffer;
|
|
15
19
|
type TKeyProvider = TRawKey | (() => TRawKey | Promise<TRawKey>);
|
|
@@ -20,6 +24,13 @@ interface IEncryptionContext {
|
|
|
20
24
|
/** Whitelist of specific field names to encrypt/decrypt (e.g. ['name', 'surname']). Any unlisted field remains plaintext. */
|
|
21
25
|
fields?: string[];
|
|
22
26
|
key?: TKeyProvider | IKeyPair;
|
|
27
|
+
/** Optional Key Identifier for multi-role key routing and rotation */
|
|
28
|
+
kid?: string;
|
|
29
|
+
keyId?: string;
|
|
30
|
+
/** Authenticated Additional Data (AAD) bound to the ciphertext to prevent field/record swapping */
|
|
31
|
+
aad?: string | Uint8Array | ArrayBuffer;
|
|
32
|
+
/** Internal flag indicating that key derivation has already been warmed for this batch */
|
|
33
|
+
_warmedKey?: any;
|
|
23
34
|
/** Whether to encrypt/decrypt individual values while preserving JSON keys (default: true) */
|
|
24
35
|
valueEncryption?: boolean;
|
|
25
36
|
publicKey?: CryptoKey;
|
|
@@ -49,6 +60,11 @@ interface IProviderEncryptionOptions {
|
|
|
49
60
|
enabled?: boolean;
|
|
50
61
|
/** Secret key, passphrase, CryptoKey, key pair, or async key provider function */
|
|
51
62
|
key?: TKeyProvider | IKeyPair;
|
|
63
|
+
/** Optional Key Identifier for multi-role key routing and key rotation */
|
|
64
|
+
kid?: string;
|
|
65
|
+
keyId?: string;
|
|
66
|
+
/** Authenticated Additional Data (AAD) bound to the ciphertext to prevent field/record swapping */
|
|
67
|
+
aad?: string | Uint8Array | ArrayBuffer;
|
|
52
68
|
/**
|
|
53
69
|
* Whether decryption is permitted during Server-Side Rendering (SSR).
|
|
54
70
|
* In an End-to-End (E2E) zero-trust model, defaults to false to prevent
|
|
@@ -63,11 +79,16 @@ interface IProviderEncryptionOptions {
|
|
|
63
79
|
fields?: string[];
|
|
64
80
|
/** Cryptographic algorithm identifier (defaults to 'AES-GCM') */
|
|
65
81
|
algorithm?: 'AES-GCM' | string;
|
|
82
|
+
/** Custom cipher adapter implementing IEncryptionProvider (e.g. CRSAEncryptionProvider, CECDHEncryptionProvider, CWebCryptoAESCBCProvider) */
|
|
83
|
+
customProvider?: IEncryptionProvider;
|
|
66
84
|
/** Whether to use synchronous Node.js crypto provider (CNodeCryptoEncryptionProvider) */
|
|
67
85
|
sync?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Key Derivation Function strategy ('none' | 'pbkdf2' | 'hkdf'). Defaults to 'pbkdf2'.
|
|
88
|
+
* - 'pbkdf2': Recommended for human passphrases/passwords (OWASP recommended with work factor iterations).
|
|
89
|
+
* - 'hkdf': For deriving subkeys from high-entropy cryptographic keys or secrets (not for low-entropy human passwords).
|
|
90
|
+
* - 'none': Direct key import for raw high-entropy 256-bit symmetric keys or CryptoKeys.
|
|
91
|
+
*/
|
|
71
92
|
kdf?: 'none' | 'pbkdf2' | 'hkdf';
|
|
72
93
|
/** Number of PBKDF2 iterations (default: 310,000 per OWASP recommendation) */
|
|
73
94
|
kdfIterations?: number;
|
|
@@ -275,6 +296,7 @@ type TPageDataHandler<TRow = TDataRow> = (currentPage: number, pageSize: number,
|
|
|
275
296
|
signal?: AbortSignal;
|
|
276
297
|
}) => IDataResult<TRow> | Promise<IDataResult<TRow>>;
|
|
277
298
|
interface IDataProviderOptions {
|
|
299
|
+
apiUrl?: string;
|
|
278
300
|
idKey?: string;
|
|
279
301
|
filter?: IDataFilter;
|
|
280
302
|
sortList?: IDataSort[];
|
|
@@ -439,6 +461,9 @@ declare abstract class ADataProvider<TRow = TDataRow> {
|
|
|
439
461
|
set filter(f: IDataFilter | null);
|
|
440
462
|
get sortList(): IDataSort[];
|
|
441
463
|
set sortList(s: IDataSort[]);
|
|
464
|
+
get hasMore(): boolean;
|
|
465
|
+
nextPage(): Promise<void>;
|
|
466
|
+
loadMore(): Promise<void>;
|
|
442
467
|
private _listeners;
|
|
443
468
|
private _stateListeners;
|
|
444
469
|
private _pendingChangedKeys;
|
|
@@ -464,7 +489,7 @@ declare abstract class ADataProvider<TRow = TDataRow> {
|
|
|
464
489
|
setFilter(filter: IDataFilter | null, immediate?: boolean): void;
|
|
465
490
|
setSortList(sortList: IDataSort[], immediate?: boolean): void;
|
|
466
491
|
setCurrentPage(currentPage: number): void;
|
|
467
|
-
setPageSize(pageSize: number): void;
|
|
492
|
+
setPageSize(pageSize: number, resetPage?: boolean): void;
|
|
468
493
|
setSelectedRows(rows: TRow[]): void;
|
|
469
494
|
setSelectAll(val: boolean): void;
|
|
470
495
|
abstract loadPageData(options?: {
|
|
@@ -532,9 +557,19 @@ declare class RequestProvider {
|
|
|
532
557
|
setCacheProvider(provider?: ACacheProvider | ECacheStrategy): void;
|
|
533
558
|
setCacheLifetime(lifetime: number): void;
|
|
534
559
|
setDeduplicate(deduplicate: boolean): void;
|
|
560
|
+
setQueue(queue: boolean): void;
|
|
535
561
|
encryption?: IProviderEncryptionOptions;
|
|
536
562
|
private _cachedCipherProvider?;
|
|
537
563
|
private _lastEncryptionConfig?;
|
|
564
|
+
private _scopedCipherProviders;
|
|
565
|
+
/**
|
|
566
|
+
* Configures E2EE payload encryption for outbound mutations and inbound responses.
|
|
567
|
+
*
|
|
568
|
+
* Threat Model: Protects sensitive SaaS tenant data against backend/database breaches.
|
|
569
|
+
* Multi-user sharing is supported by role-based session keys passed dynamically.
|
|
570
|
+
* Local client endpoint compromise (malware, trojans, keyloggers) is out of scope.
|
|
571
|
+
*/
|
|
572
|
+
private disposeCipherInstance;
|
|
538
573
|
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
539
574
|
clearEncryption(): void;
|
|
540
575
|
onDataReceived(callback: (data: any, generation?: number) => void): void;
|
|
@@ -543,7 +578,7 @@ declare class RequestProvider {
|
|
|
543
578
|
refresh(hardRefresh?: boolean): Promise<any>;
|
|
544
579
|
private resolveContext;
|
|
545
580
|
private getInFlightMap;
|
|
546
|
-
|
|
581
|
+
getUniqueKey(url: string, options?: IRequestOptions): string;
|
|
547
582
|
registerRequest<T>(url: string, options?: IRequestOptions): Promise<T>;
|
|
548
583
|
static executeAll(): void;
|
|
549
584
|
private isSameOriginUrl;
|
|
@@ -556,7 +591,7 @@ declare class RequestProvider {
|
|
|
556
591
|
|
|
557
592
|
declare function getCipherProvider(encryption?: IProviderEncryptionOptions): IEncryptionProvider | undefined;
|
|
558
593
|
declare function clearCachedCipherProvider(encryption?: IProviderEncryptionOptions): void;
|
|
559
|
-
declare function isDataEncrypted(provider?: IEncryptionProvider, data?: any
|
|
594
|
+
declare function isDataEncrypted(provider?: IEncryptionProvider, data?: any): boolean;
|
|
560
595
|
declare function buildEncryptionContext(encryption?: IProviderEncryptionOptions, url?: string, _defaultIdKey?: string): IEncryptionContext;
|
|
561
596
|
declare function decryptPageRows<T = any>(rows: T[], encryption?: IProviderEncryptionOptions, apiUrl?: string, idKey?: string): Promise<{
|
|
562
597
|
rows: T[];
|
|
@@ -586,7 +621,10 @@ declare class CAPIFlatClientDataProvider<TRow = TDataRow> extends CFlatClientDat
|
|
|
586
621
|
cacheLifetime: number;
|
|
587
622
|
refreshOnMutation: boolean | undefined;
|
|
588
623
|
encryption?: IProviderEncryptionOptions;
|
|
624
|
+
private _isAccumulating;
|
|
625
|
+
private _inFlightLoadMore;
|
|
589
626
|
constructor(options?: IDataProviderOptions);
|
|
627
|
+
loadMore(): Promise<void>;
|
|
590
628
|
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
591
629
|
clearEncryption(): void;
|
|
592
630
|
setContextKey(key: string): void;
|
|
@@ -650,6 +688,7 @@ declare class CTreeClientDataProvider<TRow extends TDataRow = TDataRow> extends
|
|
|
650
688
|
private _nodeMapCache;
|
|
651
689
|
private _sortedNodeIdsCache;
|
|
652
690
|
private _filteredNodesCache;
|
|
691
|
+
private _allVisibleRowsCache;
|
|
653
692
|
invalidateStaticCache(): void;
|
|
654
693
|
setFilter(filter: IDataFilter | null, immediate?: boolean): void;
|
|
655
694
|
protected onFilterUpdated(): void;
|
|
@@ -668,6 +707,9 @@ declare class CTreeClientDataProvider<TRow extends TDataRow = TDataRow> extends
|
|
|
668
707
|
loadPageData(): Promise<void>;
|
|
669
708
|
get treeNodes(): ITreeNode<TRow>[];
|
|
670
709
|
get allVisibleNodes(): ITreeNode<TRow>[];
|
|
710
|
+
get rowMap(): readonly (TRow & ITreeNode<TRow> & {
|
|
711
|
+
__treeNode: ITreeNode<TRow>;
|
|
712
|
+
})[];
|
|
671
713
|
get allVisibleRows(): (TRow & ITreeNode<TRow> & {
|
|
672
714
|
__treeNode: ITreeNode<TRow>;
|
|
673
715
|
})[];
|
|
@@ -927,6 +969,7 @@ declare class CCookieCache extends ACacheProvider {
|
|
|
927
969
|
|
|
928
970
|
declare class CLocalStorageCache extends ACacheProvider {
|
|
929
971
|
private static instance;
|
|
972
|
+
private static _writeCount;
|
|
930
973
|
static getInstance(): CLocalStorageCache;
|
|
931
974
|
type: string;
|
|
932
975
|
private quotaOptions;
|
|
@@ -1440,6 +1483,11 @@ declare class CKeyManager {
|
|
|
1440
1483
|
static resolveSalt(salt?: Uint8Array | ArrayBuffer | string): Uint8Array;
|
|
1441
1484
|
/**
|
|
1442
1485
|
* Generates a random AES CryptoKey suitable for AES-GCM or AES-CBC.
|
|
1486
|
+
*
|
|
1487
|
+
* E2EE Threat Model Note: Focuses on protecting GDPR/tenant data against database and
|
|
1488
|
+
* server-side leaks. Keys remain extractable by default to enable role-based key sharing,
|
|
1489
|
+
* wrapping, and transfer between authorized client sessions in multi-user SaaS apps.
|
|
1490
|
+
* Client-side malware/trojan protection is out of scope.
|
|
1443
1491
|
*/
|
|
1444
1492
|
static generateAESKey(length?: 128 | 256, algorithm?: 'AES-GCM' | 'AES-CBC' | 'AES-KW', extractable?: boolean): Promise<CryptoKey>;
|
|
1445
1493
|
/**
|
|
@@ -1535,7 +1583,20 @@ interface ICWebCryptoOptions {
|
|
|
1535
1583
|
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
1536
1584
|
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
1537
1585
|
info?: string | Uint8Array | ArrayBuffer;
|
|
1586
|
+
kid?: string;
|
|
1587
|
+
keyId?: string;
|
|
1538
1588
|
}
|
|
1589
|
+
/**
|
|
1590
|
+
* Zero-dependency AES-256-GCM cipher provider using native Web Crypto API (crypto.subtle).
|
|
1591
|
+
*
|
|
1592
|
+
* E2EE Threat Model Scope:
|
|
1593
|
+
* - Purpose: Provides client-side End-to-End Encryption (E2EE) to safeguard GDPR and tenant
|
|
1594
|
+
* records against database and server-side data breaches in multi-tenant SaaS systems.
|
|
1595
|
+
* - Multi-User Key Sharing: Authorized users in the same tenant encrypt/decrypt shared data
|
|
1596
|
+
* based on database roles that distribute symmetric or wrapped keys.
|
|
1597
|
+
* - Non-Goals: Client-side trojan, keylogger, or DOM-scraping malware defense is out of scope
|
|
1598
|
+
* and remains the responsibility of the client endpoint device owner.
|
|
1599
|
+
*/
|
|
1539
1600
|
declare class CWebCryptoEncryptionProvider extends AEncryptionProvider {
|
|
1540
1601
|
private _defaultKdf;
|
|
1541
1602
|
private _cachedKey?;
|
|
@@ -1544,6 +1605,8 @@ declare class CWebCryptoEncryptionProvider extends AEncryptionProvider {
|
|
|
1544
1605
|
private _cachedKdf?;
|
|
1545
1606
|
private _cachedIter?;
|
|
1546
1607
|
private _cachedHash?;
|
|
1608
|
+
private _cachedKeyId?;
|
|
1609
|
+
private _configuredKid?;
|
|
1547
1610
|
private _decryptSaltCache;
|
|
1548
1611
|
setDefaultKey(key: TKeyProvider): void;
|
|
1549
1612
|
clearKeys(): void;
|
|
@@ -1572,6 +1635,8 @@ interface ICWebCryptoAESCBCOptions {
|
|
|
1572
1635
|
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
1573
1636
|
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
1574
1637
|
info?: string | Uint8Array | ArrayBuffer;
|
|
1638
|
+
kid?: string;
|
|
1639
|
+
keyId?: string;
|
|
1575
1640
|
}
|
|
1576
1641
|
/**
|
|
1577
1642
|
* Authenticated AES-CBC-256 provider with Encrypt-then-MAC (HMAC-SHA-256).
|
|
@@ -1590,6 +1655,7 @@ declare class CWebCryptoAESCBCProvider extends AEncryptionProvider {
|
|
|
1590
1655
|
private _cachedKdf?;
|
|
1591
1656
|
private _cachedIter?;
|
|
1592
1657
|
private _cachedHash?;
|
|
1658
|
+
private _configuredKid?;
|
|
1593
1659
|
private _kdfOptions?;
|
|
1594
1660
|
private _decryptSaltCache;
|
|
1595
1661
|
constructor(key?: TKeyProvider | IKeyPair, options?: ICWebCryptoAESCBCOptions);
|
|
@@ -1625,6 +1691,12 @@ declare class CWebCryptoAESCBCProvider extends AEncryptionProvider {
|
|
|
1625
1691
|
* 3. The AES-GCM data key is wrapped with the recipient's RSA-OAEP public key.
|
|
1626
1692
|
* 4. The envelope packages ciphertext, IV, and wrappedKey.
|
|
1627
1693
|
* 5. Only the holder of the matching RSA private key can unwrap the data key and decrypt.
|
|
1694
|
+
*
|
|
1695
|
+
* Security Advisory (Sender Authenticity): Asymmetric hybrid encryption guarantees confidentiality
|
|
1696
|
+
* for the recipient, but does NOT authenticate the identity of the sender. Any party in possession
|
|
1697
|
+
* of the recipient's public key can encrypt data. In multi-user / multi-tenant workflows where sender
|
|
1698
|
+
* authenticity is required, sign payloads with a digital signature (e.g. ECDSA/RSA-PSS) or use
|
|
1699
|
+
* authenticated symmetric role keys (AES-GCM) governed by database role permissions.
|
|
1628
1700
|
*/
|
|
1629
1701
|
declare class CRSAEncryptionProvider extends AEncryptionProvider {
|
|
1630
1702
|
private publicKey?;
|
|
@@ -1676,6 +1748,12 @@ type TECDHCurve = 'P-256' | 'P-384' | 'P-521';
|
|
|
1676
1748
|
* 4. Payload is encrypted with AES-GCM.
|
|
1677
1749
|
* 5. Ephemeral public key (JWK) is attached to the envelope (`epk`).
|
|
1678
1750
|
* 6. Only the recipient with the matching private key can agree with `epk` and decrypt.
|
|
1751
|
+
*
|
|
1752
|
+
* Security Advisory (Sender Authenticity): ECDH ephemeral-static hybrid encryption guarantees confidentiality
|
|
1753
|
+
* for the recipient, but does NOT authenticate the identity of the sender. Any party with the recipient's
|
|
1754
|
+
* public key can generate an ephemeral keypair and send encrypted envelopes. In multi-user / multi-tenant
|
|
1755
|
+
* SaaS environments requiring sender authenticity, sign payloads with a digital signature (ECDSA/Ed25519)
|
|
1756
|
+
* or use authenticated symmetric role keys (AES-GCM) managed via database role permissions.
|
|
1679
1757
|
*/
|
|
1680
1758
|
declare class CECDHEncryptionProvider extends AEncryptionProvider {
|
|
1681
1759
|
private recipientPublicKey?;
|
|
@@ -1736,6 +1814,8 @@ interface ICNodeCryptoOptions {
|
|
|
1736
1814
|
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
1737
1815
|
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
1738
1816
|
info?: string | Uint8Array | ArrayBuffer;
|
|
1817
|
+
kid?: string;
|
|
1818
|
+
keyId?: string;
|
|
1739
1819
|
}
|
|
1740
1820
|
/**
|
|
1741
1821
|
* Server-side synchronous AES-GCM-256 encryption provider using Node.js native `node:crypto`.
|
|
@@ -1755,6 +1835,7 @@ declare class CNodeCryptoEncryptionProvider extends AEncryptionProvider {
|
|
|
1755
1835
|
private _cachedKdf?;
|
|
1756
1836
|
private _cachedIter?;
|
|
1757
1837
|
private _cachedHash?;
|
|
1838
|
+
private _configuredKid?;
|
|
1758
1839
|
setDefaultKey(key: TKeyProvider): void;
|
|
1759
1840
|
clearKeys(): void;
|
|
1760
1841
|
warmupKey(options?: IEncryptionContext): Promise<void>;
|
|
@@ -1803,10 +1884,58 @@ declare class CNodeCryptoEncryptionProvider extends AEncryptionProvider {
|
|
|
1803
1884
|
*/
|
|
1804
1885
|
declare function createEncryptionProvider(options?: IProviderEncryptionOptions): IEncryptionProvider;
|
|
1805
1886
|
|
|
1887
|
+
/**
|
|
1888
|
+
* Shared cryptographic utilities for Web Crypto API access and random byte generation.
|
|
1889
|
+
* Internal module for Katlux Encryption Providers.
|
|
1890
|
+
*/
|
|
1891
|
+
/**
|
|
1892
|
+
* Resolves the SubtleCrypto instance from globalThis.
|
|
1893
|
+
* Throws a descriptive error if Web Crypto API is unavailable.
|
|
1894
|
+
*/
|
|
1895
|
+
declare function getSubtleCrypto(): SubtleCrypto;
|
|
1896
|
+
/**
|
|
1897
|
+
* Fills a typed array with cryptographically secure random values using crypto.getRandomValues.
|
|
1898
|
+
*/
|
|
1899
|
+
declare function getRandomValues(array: Uint8Array): Uint8Array;
|
|
1900
|
+
declare const textEncoder: TextEncoder;
|
|
1901
|
+
declare const textDecoder: TextDecoder;
|
|
1902
|
+
/**
|
|
1903
|
+
* Resolves an HKDF info / context parameter into a Uint8Array.
|
|
1904
|
+
* Safely preserves raw binary buffers (Uint8Array, ArrayBuffer) without string coercion.
|
|
1905
|
+
*/
|
|
1906
|
+
declare function resolveInfoBytes(info?: string | Uint8Array | ArrayBuffer, fallback?: string): Uint8Array;
|
|
1907
|
+
/**
|
|
1908
|
+
* Safely assigns a property to a target object, preventing prototype pollution attacks
|
|
1909
|
+
* via __proto__, constructor, or prototype manipulation.
|
|
1910
|
+
*/
|
|
1911
|
+
declare function safeSetProperty(target: Record<string, any>, key: string, value: any): void;
|
|
1912
|
+
/**
|
|
1913
|
+
* Converts an ArrayBuffer or Uint8Array into a Base64-encoded string.
|
|
1914
|
+
*/
|
|
1915
|
+
declare function toBase64(buffer: ArrayBuffer | Uint8Array): string;
|
|
1916
|
+
/**
|
|
1917
|
+
* Fast 64-bit FNV-1a hash formatted as a hex string.
|
|
1918
|
+
* Non-cryptographic, zero-allocation, synchronous hash used for safe heap cache indexing
|
|
1919
|
+
* without retaining plaintext secrets in compound Map keys.
|
|
1920
|
+
*/
|
|
1921
|
+
declare function fastKeyHash(str: string): string;
|
|
1922
|
+
/**
|
|
1923
|
+
* Computes a collision-free, safe string identifier for a resolved key.
|
|
1924
|
+
* Hashes raw string passphrases to ensure secrets never reside in compound Map keys (Minor 8)
|
|
1925
|
+
* and resolves function outputs so multi-tenant SSR requests never collide on function references (Major 3).
|
|
1926
|
+
*/
|
|
1927
|
+
declare function getSafeKeyIdentifier(rawKey: any): string;
|
|
1928
|
+
/**
|
|
1929
|
+
* Returns a collision-free string identifier for a key provider or fallback key.
|
|
1930
|
+
* Uses a hashed identifier for strings and WeakMap for objects to prevent
|
|
1931
|
+
* cross-tenant cache collisions and avoid storing secrets in heap Map keys.
|
|
1932
|
+
*/
|
|
1933
|
+
declare function getKeyIdentifier(keyProvider?: any, defaultKey?: any): string;
|
|
1934
|
+
|
|
1806
1935
|
/**
|
|
1807
1936
|
* Universal helper that verifies whether an arbitrary object is a Katlux encrypted payload envelope.
|
|
1808
1937
|
*/
|
|
1809
1938
|
declare function isEncrypted(payload: any): boolean;
|
|
1810
1939
|
|
|
1811
|
-
export { AAPIDataProvider, ADataProvider, AEncryptionProvider, CAPIFlatClientDataProvider, CAPIFlatServerDataProvider, CAPITreeClientDataProvider, CAPITreeServerDataProvider, CApplicationCache, CBrowserSessionCache, CCookieCache, CECDHEncryptionProvider, CFlatClientDataProvider, CFlatServerDataProvider, CIndexedDBCache, CKeyManager, CLocalStorageCache, CMemoryCache, CNodeCryptoEncryptionProvider, CRSAEncryptionProvider, CServerSessionCache, CTreeClientDataProvider, CTreeServerDataProvider, CWebCryptoAESCBCProvider, CWebCryptoEncryptionProvider, CacheProviderFactory, DefaultHydrationAdapter, ECacheStrategy, EDataFilterOperator, EQueueStorage, KatluxIndexedDB, QueueStorageFactory, RequestProvider, RequestProviderRegistry, RequestQueue, SENSITIVE_HEADER_KEYS, applyOperator, buildEncryptionContext, clearCachedCipherProvider, clearSSRData, compareAnd, compareEqual, compareIn, compareOr, compareValues, createEncryptionProvider, debounce, decryptPageRows, evaluateFilter, fetchWithSSR, filterData, filterTreeData, getAppRoute, getAppRouter, getCipherProvider, getHydrationAdapter, getPlatformApp, getSSRData, getSSRPayload, isDataEncrypted, isEncrypted, onPlatformReady, setHydrationAdapter, sortData, useDebounce, useFilterLogic, useSortLogic };
|
|
1940
|
+
export { AAPIDataProvider, ADataProvider, AEncryptionProvider, CAPIFlatClientDataProvider, CAPIFlatServerDataProvider, CAPITreeClientDataProvider, CAPITreeServerDataProvider, CApplicationCache, CBrowserSessionCache, CCookieCache, CECDHEncryptionProvider, CFlatClientDataProvider, CFlatServerDataProvider, CIndexedDBCache, CKeyManager, CLocalStorageCache, CMemoryCache, CNodeCryptoEncryptionProvider, CRSAEncryptionProvider, CServerSessionCache, CTreeClientDataProvider, CTreeServerDataProvider, CWebCryptoAESCBCProvider, CWebCryptoEncryptionProvider, CacheProviderFactory, DefaultHydrationAdapter, ECacheStrategy, EDataFilterOperator, EQueueStorage, KatluxIndexedDB, QueueStorageFactory, RequestProvider, RequestProviderRegistry, RequestQueue, SENSITIVE_HEADER_KEYS, applyOperator, buildEncryptionContext, clearCachedCipherProvider, clearSSRData, compareAnd, compareEqual, compareIn, compareOr, compareValues, createEncryptionProvider, debounce, decryptPageRows, evaluateFilter, fastKeyHash, fetchWithSSR, filterData, filterTreeData, getAppRoute, getAppRouter, getCipherProvider, getHydrationAdapter, getKeyIdentifier, getPlatformApp, getRandomValues, getSSRData, getSSRPayload, getSafeKeyIdentifier, getSubtleCrypto, isDataEncrypted, isEncrypted, onPlatformReady, resolveInfoBytes, safeSetProperty, setHydrationAdapter, sortData, textDecoder, textEncoder, toBase64, useDebounce, useFilterLogic, useSortLogic };
|
|
1812
1941
|
export type { CacheDriverLoader, ICNodeCryptoOptions, ICWebCryptoAESCBCOptions, ICWebCryptoOptions, ICacheEntry, ICacheQuotaOptions, IDataFilter, IDataProviderOptions, IDataProviderSetStateOptions, IDataProviderState, IDataResult, IDataSort, IDeadLetterItem, IDebouncedFunction, IEncryptedPayload, IEncryptionContext, IEncryptionProvider, IFlushOptions, IHKDFFromSecretOptions, IKDFOptions, IKDatatableAction, IKeyPair, IPlatformRouter, IProviderEncryptionOptions, IQueueStorageAdapter, IQueuedOperation, IRequestOptions, ISSRHydrationAdapter, ITreeDataProvider, ITreeDataProviderOptions, ITreeNode, ITreeNodeStatic, IVirtualScrollState, IWrappedKey, KProductItemData, KProductRowAction, TDataProviderListener, TDataProviderStateChangeListener, TDataRow, TECDHCurve, TKatluxStore, TKeyProvider, TPageDataHandler, TQueueItemStatus, TRawKey, TTreePageDataHandler, TTreeRow, TUnsubscribe, TreePaginationMode };
|
package/dist/index.d.mts
CHANGED
|
@@ -10,6 +10,10 @@ interface IEncryptedPayload {
|
|
|
10
10
|
wrappedKey?: string;
|
|
11
11
|
sharedKey?: boolean;
|
|
12
12
|
epk?: JsonWebKey;
|
|
13
|
+
/** Optional Key Identifier for role-based key routing and key rotation */
|
|
14
|
+
kid?: string;
|
|
15
|
+
/** True if AEAD additionalData was bound during encryption */
|
|
16
|
+
aad?: boolean;
|
|
13
17
|
}
|
|
14
18
|
type TRawKey = string | CryptoKey | Uint8Array | ArrayBuffer;
|
|
15
19
|
type TKeyProvider = TRawKey | (() => TRawKey | Promise<TRawKey>);
|
|
@@ -20,6 +24,13 @@ interface IEncryptionContext {
|
|
|
20
24
|
/** Whitelist of specific field names to encrypt/decrypt (e.g. ['name', 'surname']). Any unlisted field remains plaintext. */
|
|
21
25
|
fields?: string[];
|
|
22
26
|
key?: TKeyProvider | IKeyPair;
|
|
27
|
+
/** Optional Key Identifier for multi-role key routing and rotation */
|
|
28
|
+
kid?: string;
|
|
29
|
+
keyId?: string;
|
|
30
|
+
/** Authenticated Additional Data (AAD) bound to the ciphertext to prevent field/record swapping */
|
|
31
|
+
aad?: string | Uint8Array | ArrayBuffer;
|
|
32
|
+
/** Internal flag indicating that key derivation has already been warmed for this batch */
|
|
33
|
+
_warmedKey?: any;
|
|
23
34
|
/** Whether to encrypt/decrypt individual values while preserving JSON keys (default: true) */
|
|
24
35
|
valueEncryption?: boolean;
|
|
25
36
|
publicKey?: CryptoKey;
|
|
@@ -49,6 +60,11 @@ interface IProviderEncryptionOptions {
|
|
|
49
60
|
enabled?: boolean;
|
|
50
61
|
/** Secret key, passphrase, CryptoKey, key pair, or async key provider function */
|
|
51
62
|
key?: TKeyProvider | IKeyPair;
|
|
63
|
+
/** Optional Key Identifier for multi-role key routing and key rotation */
|
|
64
|
+
kid?: string;
|
|
65
|
+
keyId?: string;
|
|
66
|
+
/** Authenticated Additional Data (AAD) bound to the ciphertext to prevent field/record swapping */
|
|
67
|
+
aad?: string | Uint8Array | ArrayBuffer;
|
|
52
68
|
/**
|
|
53
69
|
* Whether decryption is permitted during Server-Side Rendering (SSR).
|
|
54
70
|
* In an End-to-End (E2E) zero-trust model, defaults to false to prevent
|
|
@@ -63,11 +79,16 @@ interface IProviderEncryptionOptions {
|
|
|
63
79
|
fields?: string[];
|
|
64
80
|
/** Cryptographic algorithm identifier (defaults to 'AES-GCM') */
|
|
65
81
|
algorithm?: 'AES-GCM' | string;
|
|
82
|
+
/** Custom cipher adapter implementing IEncryptionProvider (e.g. CRSAEncryptionProvider, CECDHEncryptionProvider, CWebCryptoAESCBCProvider) */
|
|
83
|
+
customProvider?: IEncryptionProvider;
|
|
66
84
|
/** Whether to use synchronous Node.js crypto provider (CNodeCryptoEncryptionProvider) */
|
|
67
85
|
sync?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Key Derivation Function strategy ('none' | 'pbkdf2' | 'hkdf'). Defaults to 'pbkdf2'.
|
|
88
|
+
* - 'pbkdf2': Recommended for human passphrases/passwords (OWASP recommended with work factor iterations).
|
|
89
|
+
* - 'hkdf': For deriving subkeys from high-entropy cryptographic keys or secrets (not for low-entropy human passwords).
|
|
90
|
+
* - 'none': Direct key import for raw high-entropy 256-bit symmetric keys or CryptoKeys.
|
|
91
|
+
*/
|
|
71
92
|
kdf?: 'none' | 'pbkdf2' | 'hkdf';
|
|
72
93
|
/** Number of PBKDF2 iterations (default: 310,000 per OWASP recommendation) */
|
|
73
94
|
kdfIterations?: number;
|
|
@@ -275,6 +296,7 @@ type TPageDataHandler<TRow = TDataRow> = (currentPage: number, pageSize: number,
|
|
|
275
296
|
signal?: AbortSignal;
|
|
276
297
|
}) => IDataResult<TRow> | Promise<IDataResult<TRow>>;
|
|
277
298
|
interface IDataProviderOptions {
|
|
299
|
+
apiUrl?: string;
|
|
278
300
|
idKey?: string;
|
|
279
301
|
filter?: IDataFilter;
|
|
280
302
|
sortList?: IDataSort[];
|
|
@@ -439,6 +461,9 @@ declare abstract class ADataProvider<TRow = TDataRow> {
|
|
|
439
461
|
set filter(f: IDataFilter | null);
|
|
440
462
|
get sortList(): IDataSort[];
|
|
441
463
|
set sortList(s: IDataSort[]);
|
|
464
|
+
get hasMore(): boolean;
|
|
465
|
+
nextPage(): Promise<void>;
|
|
466
|
+
loadMore(): Promise<void>;
|
|
442
467
|
private _listeners;
|
|
443
468
|
private _stateListeners;
|
|
444
469
|
private _pendingChangedKeys;
|
|
@@ -464,7 +489,7 @@ declare abstract class ADataProvider<TRow = TDataRow> {
|
|
|
464
489
|
setFilter(filter: IDataFilter | null, immediate?: boolean): void;
|
|
465
490
|
setSortList(sortList: IDataSort[], immediate?: boolean): void;
|
|
466
491
|
setCurrentPage(currentPage: number): void;
|
|
467
|
-
setPageSize(pageSize: number): void;
|
|
492
|
+
setPageSize(pageSize: number, resetPage?: boolean): void;
|
|
468
493
|
setSelectedRows(rows: TRow[]): void;
|
|
469
494
|
setSelectAll(val: boolean): void;
|
|
470
495
|
abstract loadPageData(options?: {
|
|
@@ -532,9 +557,19 @@ declare class RequestProvider {
|
|
|
532
557
|
setCacheProvider(provider?: ACacheProvider | ECacheStrategy): void;
|
|
533
558
|
setCacheLifetime(lifetime: number): void;
|
|
534
559
|
setDeduplicate(deduplicate: boolean): void;
|
|
560
|
+
setQueue(queue: boolean): void;
|
|
535
561
|
encryption?: IProviderEncryptionOptions;
|
|
536
562
|
private _cachedCipherProvider?;
|
|
537
563
|
private _lastEncryptionConfig?;
|
|
564
|
+
private _scopedCipherProviders;
|
|
565
|
+
/**
|
|
566
|
+
* Configures E2EE payload encryption for outbound mutations and inbound responses.
|
|
567
|
+
*
|
|
568
|
+
* Threat Model: Protects sensitive SaaS tenant data against backend/database breaches.
|
|
569
|
+
* Multi-user sharing is supported by role-based session keys passed dynamically.
|
|
570
|
+
* Local client endpoint compromise (malware, trojans, keyloggers) is out of scope.
|
|
571
|
+
*/
|
|
572
|
+
private disposeCipherInstance;
|
|
538
573
|
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
539
574
|
clearEncryption(): void;
|
|
540
575
|
onDataReceived(callback: (data: any, generation?: number) => void): void;
|
|
@@ -543,7 +578,7 @@ declare class RequestProvider {
|
|
|
543
578
|
refresh(hardRefresh?: boolean): Promise<any>;
|
|
544
579
|
private resolveContext;
|
|
545
580
|
private getInFlightMap;
|
|
546
|
-
|
|
581
|
+
getUniqueKey(url: string, options?: IRequestOptions): string;
|
|
547
582
|
registerRequest<T>(url: string, options?: IRequestOptions): Promise<T>;
|
|
548
583
|
static executeAll(): void;
|
|
549
584
|
private isSameOriginUrl;
|
|
@@ -556,7 +591,7 @@ declare class RequestProvider {
|
|
|
556
591
|
|
|
557
592
|
declare function getCipherProvider(encryption?: IProviderEncryptionOptions): IEncryptionProvider | undefined;
|
|
558
593
|
declare function clearCachedCipherProvider(encryption?: IProviderEncryptionOptions): void;
|
|
559
|
-
declare function isDataEncrypted(provider?: IEncryptionProvider, data?: any
|
|
594
|
+
declare function isDataEncrypted(provider?: IEncryptionProvider, data?: any): boolean;
|
|
560
595
|
declare function buildEncryptionContext(encryption?: IProviderEncryptionOptions, url?: string, _defaultIdKey?: string): IEncryptionContext;
|
|
561
596
|
declare function decryptPageRows<T = any>(rows: T[], encryption?: IProviderEncryptionOptions, apiUrl?: string, idKey?: string): Promise<{
|
|
562
597
|
rows: T[];
|
|
@@ -586,7 +621,10 @@ declare class CAPIFlatClientDataProvider<TRow = TDataRow> extends CFlatClientDat
|
|
|
586
621
|
cacheLifetime: number;
|
|
587
622
|
refreshOnMutation: boolean | undefined;
|
|
588
623
|
encryption?: IProviderEncryptionOptions;
|
|
624
|
+
private _isAccumulating;
|
|
625
|
+
private _inFlightLoadMore;
|
|
589
626
|
constructor(options?: IDataProviderOptions);
|
|
627
|
+
loadMore(): Promise<void>;
|
|
590
628
|
setEncryption(encryption?: IProviderEncryptionOptions): void;
|
|
591
629
|
clearEncryption(): void;
|
|
592
630
|
setContextKey(key: string): void;
|
|
@@ -650,6 +688,7 @@ declare class CTreeClientDataProvider<TRow extends TDataRow = TDataRow> extends
|
|
|
650
688
|
private _nodeMapCache;
|
|
651
689
|
private _sortedNodeIdsCache;
|
|
652
690
|
private _filteredNodesCache;
|
|
691
|
+
private _allVisibleRowsCache;
|
|
653
692
|
invalidateStaticCache(): void;
|
|
654
693
|
setFilter(filter: IDataFilter | null, immediate?: boolean): void;
|
|
655
694
|
protected onFilterUpdated(): void;
|
|
@@ -668,6 +707,9 @@ declare class CTreeClientDataProvider<TRow extends TDataRow = TDataRow> extends
|
|
|
668
707
|
loadPageData(): Promise<void>;
|
|
669
708
|
get treeNodes(): ITreeNode<TRow>[];
|
|
670
709
|
get allVisibleNodes(): ITreeNode<TRow>[];
|
|
710
|
+
get rowMap(): readonly (TRow & ITreeNode<TRow> & {
|
|
711
|
+
__treeNode: ITreeNode<TRow>;
|
|
712
|
+
})[];
|
|
671
713
|
get allVisibleRows(): (TRow & ITreeNode<TRow> & {
|
|
672
714
|
__treeNode: ITreeNode<TRow>;
|
|
673
715
|
})[];
|
|
@@ -927,6 +969,7 @@ declare class CCookieCache extends ACacheProvider {
|
|
|
927
969
|
|
|
928
970
|
declare class CLocalStorageCache extends ACacheProvider {
|
|
929
971
|
private static instance;
|
|
972
|
+
private static _writeCount;
|
|
930
973
|
static getInstance(): CLocalStorageCache;
|
|
931
974
|
type: string;
|
|
932
975
|
private quotaOptions;
|
|
@@ -1440,6 +1483,11 @@ declare class CKeyManager {
|
|
|
1440
1483
|
static resolveSalt(salt?: Uint8Array | ArrayBuffer | string): Uint8Array;
|
|
1441
1484
|
/**
|
|
1442
1485
|
* Generates a random AES CryptoKey suitable for AES-GCM or AES-CBC.
|
|
1486
|
+
*
|
|
1487
|
+
* E2EE Threat Model Note: Focuses on protecting GDPR/tenant data against database and
|
|
1488
|
+
* server-side leaks. Keys remain extractable by default to enable role-based key sharing,
|
|
1489
|
+
* wrapping, and transfer between authorized client sessions in multi-user SaaS apps.
|
|
1490
|
+
* Client-side malware/trojan protection is out of scope.
|
|
1443
1491
|
*/
|
|
1444
1492
|
static generateAESKey(length?: 128 | 256, algorithm?: 'AES-GCM' | 'AES-CBC' | 'AES-KW', extractable?: boolean): Promise<CryptoKey>;
|
|
1445
1493
|
/**
|
|
@@ -1535,7 +1583,20 @@ interface ICWebCryptoOptions {
|
|
|
1535
1583
|
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
1536
1584
|
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
1537
1585
|
info?: string | Uint8Array | ArrayBuffer;
|
|
1586
|
+
kid?: string;
|
|
1587
|
+
keyId?: string;
|
|
1538
1588
|
}
|
|
1589
|
+
/**
|
|
1590
|
+
* Zero-dependency AES-256-GCM cipher provider using native Web Crypto API (crypto.subtle).
|
|
1591
|
+
*
|
|
1592
|
+
* E2EE Threat Model Scope:
|
|
1593
|
+
* - Purpose: Provides client-side End-to-End Encryption (E2EE) to safeguard GDPR and tenant
|
|
1594
|
+
* records against database and server-side data breaches in multi-tenant SaaS systems.
|
|
1595
|
+
* - Multi-User Key Sharing: Authorized users in the same tenant encrypt/decrypt shared data
|
|
1596
|
+
* based on database roles that distribute symmetric or wrapped keys.
|
|
1597
|
+
* - Non-Goals: Client-side trojan, keylogger, or DOM-scraping malware defense is out of scope
|
|
1598
|
+
* and remains the responsibility of the client endpoint device owner.
|
|
1599
|
+
*/
|
|
1539
1600
|
declare class CWebCryptoEncryptionProvider extends AEncryptionProvider {
|
|
1540
1601
|
private _defaultKdf;
|
|
1541
1602
|
private _cachedKey?;
|
|
@@ -1544,6 +1605,8 @@ declare class CWebCryptoEncryptionProvider extends AEncryptionProvider {
|
|
|
1544
1605
|
private _cachedKdf?;
|
|
1545
1606
|
private _cachedIter?;
|
|
1546
1607
|
private _cachedHash?;
|
|
1608
|
+
private _cachedKeyId?;
|
|
1609
|
+
private _configuredKid?;
|
|
1547
1610
|
private _decryptSaltCache;
|
|
1548
1611
|
setDefaultKey(key: TKeyProvider): void;
|
|
1549
1612
|
clearKeys(): void;
|
|
@@ -1572,6 +1635,8 @@ interface ICWebCryptoAESCBCOptions {
|
|
|
1572
1635
|
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
1573
1636
|
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
1574
1637
|
info?: string | Uint8Array | ArrayBuffer;
|
|
1638
|
+
kid?: string;
|
|
1639
|
+
keyId?: string;
|
|
1575
1640
|
}
|
|
1576
1641
|
/**
|
|
1577
1642
|
* Authenticated AES-CBC-256 provider with Encrypt-then-MAC (HMAC-SHA-256).
|
|
@@ -1590,6 +1655,7 @@ declare class CWebCryptoAESCBCProvider extends AEncryptionProvider {
|
|
|
1590
1655
|
private _cachedKdf?;
|
|
1591
1656
|
private _cachedIter?;
|
|
1592
1657
|
private _cachedHash?;
|
|
1658
|
+
private _configuredKid?;
|
|
1593
1659
|
private _kdfOptions?;
|
|
1594
1660
|
private _decryptSaltCache;
|
|
1595
1661
|
constructor(key?: TKeyProvider | IKeyPair, options?: ICWebCryptoAESCBCOptions);
|
|
@@ -1625,6 +1691,12 @@ declare class CWebCryptoAESCBCProvider extends AEncryptionProvider {
|
|
|
1625
1691
|
* 3. The AES-GCM data key is wrapped with the recipient's RSA-OAEP public key.
|
|
1626
1692
|
* 4. The envelope packages ciphertext, IV, and wrappedKey.
|
|
1627
1693
|
* 5. Only the holder of the matching RSA private key can unwrap the data key and decrypt.
|
|
1694
|
+
*
|
|
1695
|
+
* Security Advisory (Sender Authenticity): Asymmetric hybrid encryption guarantees confidentiality
|
|
1696
|
+
* for the recipient, but does NOT authenticate the identity of the sender. Any party in possession
|
|
1697
|
+
* of the recipient's public key can encrypt data. In multi-user / multi-tenant workflows where sender
|
|
1698
|
+
* authenticity is required, sign payloads with a digital signature (e.g. ECDSA/RSA-PSS) or use
|
|
1699
|
+
* authenticated symmetric role keys (AES-GCM) governed by database role permissions.
|
|
1628
1700
|
*/
|
|
1629
1701
|
declare class CRSAEncryptionProvider extends AEncryptionProvider {
|
|
1630
1702
|
private publicKey?;
|
|
@@ -1676,6 +1748,12 @@ type TECDHCurve = 'P-256' | 'P-384' | 'P-521';
|
|
|
1676
1748
|
* 4. Payload is encrypted with AES-GCM.
|
|
1677
1749
|
* 5. Ephemeral public key (JWK) is attached to the envelope (`epk`).
|
|
1678
1750
|
* 6. Only the recipient with the matching private key can agree with `epk` and decrypt.
|
|
1751
|
+
*
|
|
1752
|
+
* Security Advisory (Sender Authenticity): ECDH ephemeral-static hybrid encryption guarantees confidentiality
|
|
1753
|
+
* for the recipient, but does NOT authenticate the identity of the sender. Any party with the recipient's
|
|
1754
|
+
* public key can generate an ephemeral keypair and send encrypted envelopes. In multi-user / multi-tenant
|
|
1755
|
+
* SaaS environments requiring sender authenticity, sign payloads with a digital signature (ECDSA/Ed25519)
|
|
1756
|
+
* or use authenticated symmetric role keys (AES-GCM) managed via database role permissions.
|
|
1679
1757
|
*/
|
|
1680
1758
|
declare class CECDHEncryptionProvider extends AEncryptionProvider {
|
|
1681
1759
|
private recipientPublicKey?;
|
|
@@ -1736,6 +1814,8 @@ interface ICNodeCryptoOptions {
|
|
|
1736
1814
|
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
1737
1815
|
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
1738
1816
|
info?: string | Uint8Array | ArrayBuffer;
|
|
1817
|
+
kid?: string;
|
|
1818
|
+
keyId?: string;
|
|
1739
1819
|
}
|
|
1740
1820
|
/**
|
|
1741
1821
|
* Server-side synchronous AES-GCM-256 encryption provider using Node.js native `node:crypto`.
|
|
@@ -1755,6 +1835,7 @@ declare class CNodeCryptoEncryptionProvider extends AEncryptionProvider {
|
|
|
1755
1835
|
private _cachedKdf?;
|
|
1756
1836
|
private _cachedIter?;
|
|
1757
1837
|
private _cachedHash?;
|
|
1838
|
+
private _configuredKid?;
|
|
1758
1839
|
setDefaultKey(key: TKeyProvider): void;
|
|
1759
1840
|
clearKeys(): void;
|
|
1760
1841
|
warmupKey(options?: IEncryptionContext): Promise<void>;
|
|
@@ -1803,10 +1884,58 @@ declare class CNodeCryptoEncryptionProvider extends AEncryptionProvider {
|
|
|
1803
1884
|
*/
|
|
1804
1885
|
declare function createEncryptionProvider(options?: IProviderEncryptionOptions): IEncryptionProvider;
|
|
1805
1886
|
|
|
1887
|
+
/**
|
|
1888
|
+
* Shared cryptographic utilities for Web Crypto API access and random byte generation.
|
|
1889
|
+
* Internal module for Katlux Encryption Providers.
|
|
1890
|
+
*/
|
|
1891
|
+
/**
|
|
1892
|
+
* Resolves the SubtleCrypto instance from globalThis.
|
|
1893
|
+
* Throws a descriptive error if Web Crypto API is unavailable.
|
|
1894
|
+
*/
|
|
1895
|
+
declare function getSubtleCrypto(): SubtleCrypto;
|
|
1896
|
+
/**
|
|
1897
|
+
* Fills a typed array with cryptographically secure random values using crypto.getRandomValues.
|
|
1898
|
+
*/
|
|
1899
|
+
declare function getRandomValues(array: Uint8Array): Uint8Array;
|
|
1900
|
+
declare const textEncoder: TextEncoder;
|
|
1901
|
+
declare const textDecoder: TextDecoder;
|
|
1902
|
+
/**
|
|
1903
|
+
* Resolves an HKDF info / context parameter into a Uint8Array.
|
|
1904
|
+
* Safely preserves raw binary buffers (Uint8Array, ArrayBuffer) without string coercion.
|
|
1905
|
+
*/
|
|
1906
|
+
declare function resolveInfoBytes(info?: string | Uint8Array | ArrayBuffer, fallback?: string): Uint8Array;
|
|
1907
|
+
/**
|
|
1908
|
+
* Safely assigns a property to a target object, preventing prototype pollution attacks
|
|
1909
|
+
* via __proto__, constructor, or prototype manipulation.
|
|
1910
|
+
*/
|
|
1911
|
+
declare function safeSetProperty(target: Record<string, any>, key: string, value: any): void;
|
|
1912
|
+
/**
|
|
1913
|
+
* Converts an ArrayBuffer or Uint8Array into a Base64-encoded string.
|
|
1914
|
+
*/
|
|
1915
|
+
declare function toBase64(buffer: ArrayBuffer | Uint8Array): string;
|
|
1916
|
+
/**
|
|
1917
|
+
* Fast 64-bit FNV-1a hash formatted as a hex string.
|
|
1918
|
+
* Non-cryptographic, zero-allocation, synchronous hash used for safe heap cache indexing
|
|
1919
|
+
* without retaining plaintext secrets in compound Map keys.
|
|
1920
|
+
*/
|
|
1921
|
+
declare function fastKeyHash(str: string): string;
|
|
1922
|
+
/**
|
|
1923
|
+
* Computes a collision-free, safe string identifier for a resolved key.
|
|
1924
|
+
* Hashes raw string passphrases to ensure secrets never reside in compound Map keys (Minor 8)
|
|
1925
|
+
* and resolves function outputs so multi-tenant SSR requests never collide on function references (Major 3).
|
|
1926
|
+
*/
|
|
1927
|
+
declare function getSafeKeyIdentifier(rawKey: any): string;
|
|
1928
|
+
/**
|
|
1929
|
+
* Returns a collision-free string identifier for a key provider or fallback key.
|
|
1930
|
+
* Uses a hashed identifier for strings and WeakMap for objects to prevent
|
|
1931
|
+
* cross-tenant cache collisions and avoid storing secrets in heap Map keys.
|
|
1932
|
+
*/
|
|
1933
|
+
declare function getKeyIdentifier(keyProvider?: any, defaultKey?: any): string;
|
|
1934
|
+
|
|
1806
1935
|
/**
|
|
1807
1936
|
* Universal helper that verifies whether an arbitrary object is a Katlux encrypted payload envelope.
|
|
1808
1937
|
*/
|
|
1809
1938
|
declare function isEncrypted(payload: any): boolean;
|
|
1810
1939
|
|
|
1811
|
-
export { AAPIDataProvider, ADataProvider, AEncryptionProvider, CAPIFlatClientDataProvider, CAPIFlatServerDataProvider, CAPITreeClientDataProvider, CAPITreeServerDataProvider, CApplicationCache, CBrowserSessionCache, CCookieCache, CECDHEncryptionProvider, CFlatClientDataProvider, CFlatServerDataProvider, CIndexedDBCache, CKeyManager, CLocalStorageCache, CMemoryCache, CNodeCryptoEncryptionProvider, CRSAEncryptionProvider, CServerSessionCache, CTreeClientDataProvider, CTreeServerDataProvider, CWebCryptoAESCBCProvider, CWebCryptoEncryptionProvider, CacheProviderFactory, DefaultHydrationAdapter, ECacheStrategy, EDataFilterOperator, EQueueStorage, KatluxIndexedDB, QueueStorageFactory, RequestProvider, RequestProviderRegistry, RequestQueue, SENSITIVE_HEADER_KEYS, applyOperator, buildEncryptionContext, clearCachedCipherProvider, clearSSRData, compareAnd, compareEqual, compareIn, compareOr, compareValues, createEncryptionProvider, debounce, decryptPageRows, evaluateFilter, fetchWithSSR, filterData, filterTreeData, getAppRoute, getAppRouter, getCipherProvider, getHydrationAdapter, getPlatformApp, getSSRData, getSSRPayload, isDataEncrypted, isEncrypted, onPlatformReady, setHydrationAdapter, sortData, useDebounce, useFilterLogic, useSortLogic };
|
|
1940
|
+
export { AAPIDataProvider, ADataProvider, AEncryptionProvider, CAPIFlatClientDataProvider, CAPIFlatServerDataProvider, CAPITreeClientDataProvider, CAPITreeServerDataProvider, CApplicationCache, CBrowserSessionCache, CCookieCache, CECDHEncryptionProvider, CFlatClientDataProvider, CFlatServerDataProvider, CIndexedDBCache, CKeyManager, CLocalStorageCache, CMemoryCache, CNodeCryptoEncryptionProvider, CRSAEncryptionProvider, CServerSessionCache, CTreeClientDataProvider, CTreeServerDataProvider, CWebCryptoAESCBCProvider, CWebCryptoEncryptionProvider, CacheProviderFactory, DefaultHydrationAdapter, ECacheStrategy, EDataFilterOperator, EQueueStorage, KatluxIndexedDB, QueueStorageFactory, RequestProvider, RequestProviderRegistry, RequestQueue, SENSITIVE_HEADER_KEYS, applyOperator, buildEncryptionContext, clearCachedCipherProvider, clearSSRData, compareAnd, compareEqual, compareIn, compareOr, compareValues, createEncryptionProvider, debounce, decryptPageRows, evaluateFilter, fastKeyHash, fetchWithSSR, filterData, filterTreeData, getAppRoute, getAppRouter, getCipherProvider, getHydrationAdapter, getKeyIdentifier, getPlatformApp, getRandomValues, getSSRData, getSSRPayload, getSafeKeyIdentifier, getSubtleCrypto, isDataEncrypted, isEncrypted, onPlatformReady, resolveInfoBytes, safeSetProperty, setHydrationAdapter, sortData, textDecoder, textEncoder, toBase64, useDebounce, useFilterLogic, useSortLogic };
|
|
1812
1941
|
export type { CacheDriverLoader, ICNodeCryptoOptions, ICWebCryptoAESCBCOptions, ICWebCryptoOptions, ICacheEntry, ICacheQuotaOptions, IDataFilter, IDataProviderOptions, IDataProviderSetStateOptions, IDataProviderState, IDataResult, IDataSort, IDeadLetterItem, IDebouncedFunction, IEncryptedPayload, IEncryptionContext, IEncryptionProvider, IFlushOptions, IHKDFFromSecretOptions, IKDFOptions, IKDatatableAction, IKeyPair, IPlatformRouter, IProviderEncryptionOptions, IQueueStorageAdapter, IQueuedOperation, IRequestOptions, ISSRHydrationAdapter, ITreeDataProvider, ITreeDataProviderOptions, ITreeNode, ITreeNodeStatic, IVirtualScrollState, IWrappedKey, KProductItemData, KProductRowAction, TDataProviderListener, TDataProviderStateChangeListener, TDataRow, TECDHCurve, TKatluxStore, TKeyProvider, TPageDataHandler, TQueueItemStatus, TRawKey, TTreePageDataHandler, TTreeRow, TUnsubscribe, TreePaginationMode };
|