@katlux/providers 0.1.1-alpha.129 → 0.1.1-alpha.130
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 +8 -6
- package/dist/index.d.cts +360 -353
- package/dist/index.d.mts +360 -353
- package/dist/index.d.ts +360 -353
- package/dist/index.mjs +8 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,66 @@
|
|
|
1
|
+
declare enum EDataFilterOperator {
|
|
2
|
+
Equal = "==",
|
|
3
|
+
NotEqual = "!=",
|
|
4
|
+
GreaterThan = ">",
|
|
5
|
+
LessThan = "<",
|
|
6
|
+
GreaterThanOrEqual = ">=",
|
|
7
|
+
LessThanOrEqual = "<=",
|
|
8
|
+
In = "in",
|
|
9
|
+
NotIn = "nin",
|
|
10
|
+
And = "and",
|
|
11
|
+
Or = "or",
|
|
12
|
+
Nand = "nand",
|
|
13
|
+
Nor = "nor"
|
|
14
|
+
}
|
|
15
|
+
interface IDataFilter {
|
|
16
|
+
operator: EDataFilterOperator;
|
|
17
|
+
field: TDataRow | IDataFilter | IDataFilter[];
|
|
18
|
+
active: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface IDataSort {
|
|
21
|
+
field: string;
|
|
22
|
+
direction: 'asc' | 'desc';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare enum ECacheStrategy {
|
|
26
|
+
Application = "Application",
|
|
27
|
+
ServerSession = "ServerSession",
|
|
28
|
+
BrowserSession = "BrowserSession",
|
|
29
|
+
Memory = "Memory",
|
|
30
|
+
LocalStorage = "LocalStorage",
|
|
31
|
+
IndexedDB = "IndexedDB",
|
|
32
|
+
Cookie = "Cookie"
|
|
33
|
+
}
|
|
34
|
+
interface ICacheEntry<T> {
|
|
35
|
+
data: T;
|
|
36
|
+
timestamp: number;
|
|
37
|
+
lifetime: number;
|
|
38
|
+
lastAccessed?: number;
|
|
39
|
+
accessCount?: number;
|
|
40
|
+
}
|
|
41
|
+
interface ICacheQuotaOptions {
|
|
42
|
+
maxEntries?: number;
|
|
43
|
+
maxSizeBytes?: number;
|
|
44
|
+
quotaThresholdRatio?: number;
|
|
45
|
+
fallbackToMemory?: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface ICookieCacheOptions {
|
|
48
|
+
/** Default: 'lax'. */
|
|
49
|
+
sameSite?: 'strict' | 'lax' | 'none';
|
|
50
|
+
/**
|
|
51
|
+
* Adds the `Secure` flag. Default: auto-detected from the request protocol
|
|
52
|
+
* (https => true). Set explicitly to force it on or off.
|
|
53
|
+
*/
|
|
54
|
+
secure?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Default: true. Only effective for cookies written on the server: browsers
|
|
57
|
+
* do not allow `document.cookie` to set HttpOnly, so client writes ignore it.
|
|
58
|
+
*/
|
|
59
|
+
httpOnly?: boolean;
|
|
60
|
+
/** Default: '/'. */
|
|
61
|
+
path?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
1
64
|
interface IEncryptedPayload {
|
|
2
65
|
__encrypted: true;
|
|
3
66
|
ciphertext: string;
|
|
@@ -25,192 +88,7 @@ interface IDecryptErrorInfo {
|
|
|
25
88
|
index?: number;
|
|
26
89
|
}
|
|
27
90
|
declare const DECRYPT_ERROR_SENTINEL: unique symbol;
|
|
28
|
-
|
|
29
|
-
url?: string;
|
|
30
|
-
method?: string;
|
|
31
|
-
isServer?: boolean;
|
|
32
|
-
/** Whether to bind the request context (URL and method as `req:${method}:${url}`) into AEAD Authenticated Additional Data (AAD) */
|
|
33
|
-
bindRequestContextAad?: boolean;
|
|
34
|
-
/** Whitelist of specific field names to encrypt/decrypt (e.g. ['name', 'surname']). Any unlisted field remains plaintext. */
|
|
35
|
-
fields?: string[];
|
|
36
|
-
/**
|
|
37
|
-
* Enforces strict encryption validation. When true:
|
|
38
|
-
* 1. Any field in `fields` that is NOT an encrypted envelope triggers a decryption error.
|
|
39
|
-
* 2. Envelope algorithm MUST match `allowedAlgorithms` (defaults to ['AES-GCM']).
|
|
40
|
-
* 3. Envelope `kid` (if present) MUST match `allowedKids`.
|
|
41
|
-
*/
|
|
42
|
-
strict?: boolean;
|
|
43
|
-
/** Whitelist of permitted cryptographic algorithms (e.g. ['AES-GCM']). Defaults to ['AES-GCM'] in strict mode. */
|
|
44
|
-
allowedAlgorithms?: string[];
|
|
45
|
-
/** Whitelist of allowed Key Identifiers (kid). */
|
|
46
|
-
allowedKids?: string[];
|
|
47
|
-
/** Built-in Keyring dictionary mapping Key Identifiers (kid) to keys or key provider functions */
|
|
48
|
-
keys?: Record<string, TKeyProvider | IKeyPair>;
|
|
49
|
-
/** Active key identifier from `keys` to use for all outbound encryption operations */
|
|
50
|
-
activeKid?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Hook invoked whenever decryption fails for an individual field or row.
|
|
53
|
-
* Can return a fallback cell value (e.g. sentinel or marker), or string/boolean.
|
|
54
|
-
*/
|
|
55
|
-
onDecryptError?: ((info: IDecryptErrorInfo) => any) | boolean | string;
|
|
56
|
-
key?: TKeyProvider | IKeyPair;
|
|
57
|
-
/** Optional Key Identifier for multi-role key routing and rotation */
|
|
58
|
-
kid?: string;
|
|
59
|
-
keyId?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Authenticated Additional Data (AAD) bound to the ciphertext to prevent field/record swapping.
|
|
62
|
-
* Can be static string/buffer or dynamic callback evaluated per record and field.
|
|
63
|
-
*/
|
|
64
|
-
aad?: string | Uint8Array | ArrayBuffer | ((record: any, field: string) => string | Uint8Array | ArrayBuffer);
|
|
65
|
-
/** Sibling record fields to deterministically bind into AEAD additional data (e.g. ['contact_id', 'version']) */
|
|
66
|
-
aadFields?: string[];
|
|
67
|
-
/** Optional base AAD prefix when aadFields or dynamic aad is enabled */
|
|
68
|
-
baseAad?: string;
|
|
69
|
-
/** Internal flag indicating that key derivation has already been warmed for this batch */
|
|
70
|
-
_warmedKey?: any;
|
|
71
|
-
/** Whether to encrypt/decrypt individual values while preserving JSON keys (default: true) */
|
|
72
|
-
valueEncryption?: boolean;
|
|
73
|
-
publicKey?: CryptoKey;
|
|
74
|
-
privateKey?: CryptoKey;
|
|
75
|
-
recipientPublicKey?: CryptoKey;
|
|
76
|
-
recipientPrivateKey?: CryptoKey;
|
|
77
|
-
curve?: 'P-256' | 'P-384' | 'P-521';
|
|
78
|
-
kdf?: 'none' | 'pbkdf2' | 'hkdf';
|
|
79
|
-
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
80
|
-
kdfIterations?: number;
|
|
81
|
-
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
82
|
-
info?: string | Uint8Array | ArrayBuffer;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Context options for single scalar field encryption/decryption with bound AAD.
|
|
86
|
-
*/
|
|
87
|
-
interface IFieldEncryptionContext extends Omit<IEncryptionContext, 'aadFields'> {
|
|
88
|
-
/** Record identifier to bind into AAD */
|
|
89
|
-
recordId?: string | number;
|
|
90
|
-
/** Target field name being encrypted/decrypted */
|
|
91
|
-
fieldName?: string;
|
|
92
|
-
/** Sibling record fields (map or array of keys) to deterministically bind into AEAD */
|
|
93
|
-
aadFields?: Record<string, any> | string[];
|
|
94
|
-
/** Optional base AAD prefix */
|
|
95
|
-
baseAad?: string;
|
|
96
|
-
}
|
|
97
|
-
interface IEncryptionProvider {
|
|
98
|
-
encrypt(data: any, options?: IEncryptionContext): Promise<IEncryptedPayload | any>;
|
|
99
|
-
decrypt(payload: IEncryptedPayload | any, options?: IEncryptionContext): Promise<any>;
|
|
100
|
-
/** Encrypts a single scalar value with contextual AAD binding */
|
|
101
|
-
encryptField?(value: any, context?: IFieldEncryptionContext): Promise<IEncryptedPayload>;
|
|
102
|
-
/** Decrypts a single scalar field envelope with contextual AAD */
|
|
103
|
-
decryptField?(envelope: IEncryptedPayload, context?: IFieldEncryptionContext): Promise<any>;
|
|
104
|
-
/** Computes deterministic HMAC-SHA256 blind index hash */
|
|
105
|
-
computeBlindIndex?(value: any, hmacKey?: CryptoKey | TKeyProvider): Promise<string>;
|
|
106
|
-
warmupKey?(options?: IEncryptionContext): Promise<void>;
|
|
107
|
-
isEncrypted?(payload: any): boolean;
|
|
108
|
-
setDefaultKey?(key: TKeyProvider | IKeyPair): void;
|
|
109
|
-
setKeyring?(keys: Record<string, TKeyProvider | IKeyPair>, activeKid?: string): void;
|
|
110
|
-
getKeyring?(): Record<string, TKeyProvider | IKeyPair> | undefined;
|
|
111
|
-
setActiveKid?(kid: string): void;
|
|
112
|
-
getActiveKid?(): string | undefined;
|
|
113
|
-
clearKeys?(): void;
|
|
114
|
-
dispose?(): void;
|
|
115
|
-
[Symbol.dispose]?(): void;
|
|
116
|
-
[Symbol.asyncDispose]?(): Promise<void>;
|
|
117
|
-
}
|
|
118
|
-
interface IProviderEncryptionOptions {
|
|
119
|
-
/** Enable or disable encryption */
|
|
120
|
-
enabled?: boolean;
|
|
121
|
-
/** Secret key, passphrase, CryptoKey, key pair, or async key provider function */
|
|
122
|
-
key?: TKeyProvider | IKeyPair;
|
|
123
|
-
/** Built-in Keyring dictionary mapping Key Identifiers (kid) to keys or key provider functions */
|
|
124
|
-
keys?: Record<string, TKeyProvider | IKeyPair>;
|
|
125
|
-
/** Active key identifier from `keys` to use for all outbound encryption operations */
|
|
126
|
-
activeKid?: string;
|
|
127
|
-
/** Optional Key Identifier for multi-role key routing and key rotation */
|
|
128
|
-
kid?: string;
|
|
129
|
-
keyId?: string;
|
|
130
|
-
/**
|
|
131
|
-
* Authenticated Additional Data (AAD) bound to the ciphertext to prevent field/record swapping.
|
|
132
|
-
* Can be static string/buffer or dynamic callback evaluated per record and field.
|
|
133
|
-
*/
|
|
134
|
-
aad?: string | Uint8Array | ArrayBuffer | ((record: any, field: string) => string | Uint8Array | ArrayBuffer);
|
|
135
|
-
/** Sibling record fields to deterministically bind into AEAD additional data (e.g. ['contact_id', 'version']) */
|
|
136
|
-
aadFields?: string[];
|
|
137
|
-
/** Optional base AAD prefix when aadFields or dynamic aad is enabled */
|
|
138
|
-
baseAad?: string;
|
|
139
|
-
/**
|
|
140
|
-
* Whether to bind the request context (HTTP method and URL as `req:${method}:${url}`) into AEAD Authenticated Additional Data (AAD).
|
|
141
|
-
* Defaults to true when URL or method is provided in context, mitigating replay and cross-endpoint confusion attacks (BUG-015).
|
|
142
|
-
* Set to false to disable request context AAD binding.
|
|
143
|
-
*/
|
|
144
|
-
bindRequestContextAad?: boolean;
|
|
145
|
-
/**
|
|
146
|
-
* Whether decryption is permitted during Server-Side Rendering (SSR).
|
|
147
|
-
* In an End-to-End (E2E) zero-trust model, defaults to false to prevent
|
|
148
|
-
* plaintext data in server memory or SSR payloads.
|
|
149
|
-
*/
|
|
150
|
-
decryptOnSSR?: boolean;
|
|
151
|
-
/** Whether to encrypt/decrypt individual values while preserving JSON object keys (default: true) */
|
|
152
|
-
valueEncryption?: boolean;
|
|
153
|
-
/** Whether to defer row/item decryption to active page rendering in DataProviders */
|
|
154
|
-
lazy?: boolean;
|
|
155
|
-
/** Whitelist of specific field names to encrypt/decrypt (e.g. ['name', 'surname']). Any unlisted field remains plaintext. */
|
|
156
|
-
fields?: string[];
|
|
157
|
-
/**
|
|
158
|
-
* Enforces strict encryption validation. When true:
|
|
159
|
-
* 1. Any field in `fields` that is NOT an encrypted envelope triggers a decryption error.
|
|
160
|
-
* 2. Envelope algorithm MUST match `allowedAlgorithms` (defaults to ['AES-GCM']).
|
|
161
|
-
* 3. Envelope `kid` (if present) MUST match `allowedKids`.
|
|
162
|
-
*/
|
|
163
|
-
strict?: boolean;
|
|
164
|
-
/** Whitelist of permitted cryptographic algorithms (e.g. ['AES-GCM']). Defaults to ['AES-GCM'] in strict mode. */
|
|
165
|
-
allowedAlgorithms?: string[];
|
|
166
|
-
/** Whitelist of allowed Key Identifiers (kid). */
|
|
167
|
-
allowedKids?: string[];
|
|
168
|
-
/**
|
|
169
|
-
* Hook invoked whenever decryption fails for an individual field or row.
|
|
170
|
-
* Can return a fallback cell value (e.g. sentinel or marker), or string/boolean.
|
|
171
|
-
*/
|
|
172
|
-
onDecryptError?: ((info: IDecryptErrorInfo) => any) | boolean | string;
|
|
173
|
-
/** Enable HMAC-SHA256 blind indexing and trigram search index on encrypted fields for local DataProviders */
|
|
174
|
-
searchIndex?: boolean;
|
|
175
|
-
/**
|
|
176
|
-
* Set to true if API endpoints or data sources return pre-encrypted ciphertext envelopes.
|
|
177
|
-
* When true, DataProviders decrypt search fields during ingest to populate CSearchIndex.
|
|
178
|
-
*/
|
|
179
|
-
preEncrypted?: boolean;
|
|
180
|
-
/** Optional dedicated HMAC key for search indexing (defaults to encryption key if omitted) */
|
|
181
|
-
hmacKey?: TKeyProvider;
|
|
182
|
-
/** Cryptographic algorithm identifier (defaults to 'AES-GCM') */
|
|
183
|
-
algorithm?: 'AES-GCM' | string;
|
|
184
|
-
/** Custom cipher adapter implementing IEncryptionProvider (e.g. CRSAEncryptionProvider, CECDHEncryptionProvider, CWebCryptoAESCBCProvider) */
|
|
185
|
-
customProvider?: IEncryptionProvider;
|
|
186
|
-
/** Whether to use synchronous Node.js crypto provider (CNodeCryptoEncryptionProvider) */
|
|
187
|
-
sync?: boolean;
|
|
188
|
-
/**
|
|
189
|
-
* Key Derivation Function strategy ('none' | 'pbkdf2' | 'hkdf'). Defaults to 'pbkdf2'.
|
|
190
|
-
* - 'pbkdf2': Recommended for human passphrases/passwords (OWASP recommended with work factor iterations).
|
|
191
|
-
* - 'hkdf': For deriving subkeys from high-entropy cryptographic keys or secrets (not for low-entropy human passwords).
|
|
192
|
-
* - 'none': Direct key import for raw high-entropy 256-bit symmetric keys or CryptoKeys.
|
|
193
|
-
*/
|
|
194
|
-
kdf?: 'none' | 'pbkdf2' | 'hkdf';
|
|
195
|
-
/** Number of PBKDF2 iterations (default: 310,000 per OWASP recommendation) */
|
|
196
|
-
kdfIterations?: number;
|
|
197
|
-
/** Hash algorithm for PBKDF2 or HKDF ('SHA-256' | 'SHA-512', default: 'SHA-256') */
|
|
198
|
-
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
199
|
-
/** Optional static salt for KDF. If omitted, a cryptographically secure random salt is generated and included in the envelope. */
|
|
200
|
-
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
201
|
-
/** Optional public key for asymmetric providers */
|
|
202
|
-
publicKey?: CryptoKey;
|
|
203
|
-
/** Optional private key for asymmetric providers */
|
|
204
|
-
privateKey?: CryptoKey;
|
|
205
|
-
/** Optional recipient public key for asymmetric/hybrid encryption */
|
|
206
|
-
recipientPublicKey?: CryptoKey;
|
|
207
|
-
/** Optional recipient private key for asymmetric/hybrid decryption */
|
|
208
|
-
recipientPrivateKey?: CryptoKey;
|
|
209
|
-
/** Elliptic curve name for ECDH ('P-256' | 'P-384' | 'P-521') */
|
|
210
|
-
curve?: 'P-256' | 'P-384' | 'P-521';
|
|
211
|
-
/** Optional context/info string or buffer for HKDF key derivation */
|
|
212
|
-
info?: string | Uint8Array | ArrayBuffer;
|
|
213
|
-
}
|
|
91
|
+
|
|
214
92
|
/**
|
|
215
93
|
* Public and private key pair container for asymmetric / hybrid encryption providers (RSA, ECDH).
|
|
216
94
|
*/
|
|
@@ -478,6 +356,194 @@ interface IVerifyAndPinResult {
|
|
|
478
356
|
/** Public key fingerprint of the verified key */
|
|
479
357
|
fingerprint: string;
|
|
480
358
|
}
|
|
359
|
+
|
|
360
|
+
interface IEncryptionContext {
|
|
361
|
+
url?: string;
|
|
362
|
+
method?: string;
|
|
363
|
+
isServer?: boolean;
|
|
364
|
+
/** Whether to bind the request context (URL and method as `req:${method}:${url}`) into AEAD Authenticated Additional Data (AAD) */
|
|
365
|
+
bindRequestContextAad?: boolean;
|
|
366
|
+
/** Whitelist of specific field names to encrypt/decrypt (e.g. ['name', 'surname']). Any unlisted field remains plaintext. */
|
|
367
|
+
fields?: string[];
|
|
368
|
+
/**
|
|
369
|
+
* Enforces strict encryption validation. When true:
|
|
370
|
+
* 1. Any field in `fields` that is NOT an encrypted envelope triggers a decryption error.
|
|
371
|
+
* 2. Envelope algorithm MUST match `allowedAlgorithms` (defaults to ['AES-GCM']).
|
|
372
|
+
* 3. Envelope `kid` (if present) MUST match `allowedKids`.
|
|
373
|
+
*/
|
|
374
|
+
strict?: boolean;
|
|
375
|
+
/** Whitelist of permitted cryptographic algorithms (e.g. ['AES-GCM']). Defaults to ['AES-GCM'] in strict mode. */
|
|
376
|
+
allowedAlgorithms?: string[];
|
|
377
|
+
/** Whitelist of allowed Key Identifiers (kid). */
|
|
378
|
+
allowedKids?: string[];
|
|
379
|
+
/** Built-in Keyring dictionary mapping Key Identifiers (kid) to keys or key provider functions */
|
|
380
|
+
keys?: Record<string, TKeyProvider | IKeyPair>;
|
|
381
|
+
/** Active key identifier from `keys` to use for all outbound encryption operations */
|
|
382
|
+
activeKid?: string;
|
|
383
|
+
/**
|
|
384
|
+
* Hook invoked whenever decryption fails for an individual field or row.
|
|
385
|
+
* Can return a fallback cell value (e.g. sentinel or marker), or string/boolean.
|
|
386
|
+
*/
|
|
387
|
+
onDecryptError?: ((info: IDecryptErrorInfo) => any) | boolean | string;
|
|
388
|
+
key?: TKeyProvider | IKeyPair;
|
|
389
|
+
/** Optional Key Identifier for multi-role key routing and rotation */
|
|
390
|
+
kid?: string;
|
|
391
|
+
keyId?: string;
|
|
392
|
+
/**
|
|
393
|
+
* Authenticated Additional Data (AAD) bound to the ciphertext to prevent field/record swapping.
|
|
394
|
+
* Can be static string/buffer or dynamic callback evaluated per record and field.
|
|
395
|
+
*/
|
|
396
|
+
aad?: string | Uint8Array | ArrayBuffer | ((record: any, field: string) => string | Uint8Array | ArrayBuffer);
|
|
397
|
+
/** Sibling record fields to deterministically bind into AEAD additional data (e.g. ['contact_id', 'version']) */
|
|
398
|
+
aadFields?: string[];
|
|
399
|
+
/** Optional base AAD prefix when aadFields or dynamic aad is enabled */
|
|
400
|
+
baseAad?: string;
|
|
401
|
+
/** Internal flag indicating that key derivation has already been warmed for this batch */
|
|
402
|
+
_warmedKey?: any;
|
|
403
|
+
/** Whether to encrypt/decrypt individual values while preserving JSON keys (default: true) */
|
|
404
|
+
valueEncryption?: boolean;
|
|
405
|
+
publicKey?: CryptoKey;
|
|
406
|
+
privateKey?: CryptoKey;
|
|
407
|
+
recipientPublicKey?: CryptoKey;
|
|
408
|
+
recipientPrivateKey?: CryptoKey;
|
|
409
|
+
curve?: 'P-256' | 'P-384' | 'P-521';
|
|
410
|
+
kdf?: 'none' | 'pbkdf2' | 'hkdf';
|
|
411
|
+
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
412
|
+
kdfIterations?: number;
|
|
413
|
+
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
414
|
+
info?: string | Uint8Array | ArrayBuffer;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Context options for single scalar field encryption/decryption with bound AAD.
|
|
418
|
+
*/
|
|
419
|
+
interface IFieldEncryptionContext extends Omit<IEncryptionContext, 'aadFields'> {
|
|
420
|
+
/** Record identifier to bind into AAD */
|
|
421
|
+
recordId?: string | number;
|
|
422
|
+
/** Target field name being encrypted/decrypted */
|
|
423
|
+
fieldName?: string;
|
|
424
|
+
/** Sibling record fields (map or array of keys) to deterministically bind into AEAD */
|
|
425
|
+
aadFields?: Record<string, any> | string[];
|
|
426
|
+
/** Optional base AAD prefix */
|
|
427
|
+
baseAad?: string;
|
|
428
|
+
}
|
|
429
|
+
interface IEncryptionProvider {
|
|
430
|
+
encrypt(data: any, options?: IEncryptionContext): Promise<IEncryptedPayload | any>;
|
|
431
|
+
decrypt(payload: IEncryptedPayload | any, options?: IEncryptionContext): Promise<any>;
|
|
432
|
+
/** Encrypts a single scalar value with contextual AAD binding */
|
|
433
|
+
encryptField?(value: any, context?: IFieldEncryptionContext): Promise<IEncryptedPayload>;
|
|
434
|
+
/** Decrypts a single scalar field envelope with contextual AAD */
|
|
435
|
+
decryptField?(envelope: IEncryptedPayload, context?: IFieldEncryptionContext): Promise<any>;
|
|
436
|
+
/** Computes deterministic HMAC-SHA256 blind index hash */
|
|
437
|
+
computeBlindIndex?(value: any, hmacKey?: CryptoKey | TKeyProvider): Promise<string>;
|
|
438
|
+
warmupKey?(options?: IEncryptionContext): Promise<void>;
|
|
439
|
+
isEncrypted?(payload: any): boolean;
|
|
440
|
+
setDefaultKey?(key: TKeyProvider | IKeyPair): void;
|
|
441
|
+
setKeyring?(keys: Record<string, TKeyProvider | IKeyPair>, activeKid?: string): void;
|
|
442
|
+
getKeyring?(): Record<string, TKeyProvider | IKeyPair> | undefined;
|
|
443
|
+
setActiveKid?(kid: string): void;
|
|
444
|
+
getActiveKid?(): string | undefined;
|
|
445
|
+
clearKeys?(): void;
|
|
446
|
+
dispose?(): void;
|
|
447
|
+
[Symbol.dispose]?(): void;
|
|
448
|
+
[Symbol.asyncDispose]?(): Promise<void>;
|
|
449
|
+
}
|
|
450
|
+
interface IProviderEncryptionOptions {
|
|
451
|
+
/** Enable or disable encryption */
|
|
452
|
+
enabled?: boolean;
|
|
453
|
+
/** Secret key, passphrase, CryptoKey, key pair, or async key provider function */
|
|
454
|
+
key?: TKeyProvider | IKeyPair;
|
|
455
|
+
/** Built-in Keyring dictionary mapping Key Identifiers (kid) to keys or key provider functions */
|
|
456
|
+
keys?: Record<string, TKeyProvider | IKeyPair>;
|
|
457
|
+
/** Active key identifier from `keys` to use for all outbound encryption operations */
|
|
458
|
+
activeKid?: string;
|
|
459
|
+
/** Optional Key Identifier for multi-role key routing and key rotation */
|
|
460
|
+
kid?: string;
|
|
461
|
+
keyId?: string;
|
|
462
|
+
/**
|
|
463
|
+
* Authenticated Additional Data (AAD) bound to the ciphertext to prevent field/record swapping.
|
|
464
|
+
* Can be static string/buffer or dynamic callback evaluated per record and field.
|
|
465
|
+
*/
|
|
466
|
+
aad?: string | Uint8Array | ArrayBuffer | ((record: any, field: string) => string | Uint8Array | ArrayBuffer);
|
|
467
|
+
/** Sibling record fields to deterministically bind into AEAD additional data (e.g. ['contact_id', 'version']) */
|
|
468
|
+
aadFields?: string[];
|
|
469
|
+
/** Optional base AAD prefix when aadFields or dynamic aad is enabled */
|
|
470
|
+
baseAad?: string;
|
|
471
|
+
/**
|
|
472
|
+
* Whether to bind the request context (HTTP method and URL as `req:${method}:${url}`) into AEAD Authenticated Additional Data (AAD).
|
|
473
|
+
* Defaults to true when URL or method is provided in context, mitigating replay and cross-endpoint confusion attacks (BUG-015).
|
|
474
|
+
* Set to false to disable request context AAD binding.
|
|
475
|
+
*/
|
|
476
|
+
bindRequestContextAad?: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* Whether decryption is permitted during Server-Side Rendering (SSR).
|
|
479
|
+
* In an End-to-End (E2E) zero-trust model, defaults to false to prevent
|
|
480
|
+
* plaintext data in server memory or SSR payloads.
|
|
481
|
+
*/
|
|
482
|
+
decryptOnSSR?: boolean;
|
|
483
|
+
/** Whether to encrypt/decrypt individual values while preserving JSON object keys (default: true) */
|
|
484
|
+
valueEncryption?: boolean;
|
|
485
|
+
/** Whether to defer row/item decryption to active page rendering in DataProviders */
|
|
486
|
+
lazy?: boolean;
|
|
487
|
+
/** Whitelist of specific field names to encrypt/decrypt (e.g. ['name', 'surname']). Any unlisted field remains plaintext. */
|
|
488
|
+
fields?: string[];
|
|
489
|
+
/**
|
|
490
|
+
* Enforces strict encryption validation. When true:
|
|
491
|
+
* 1. Any field in `fields` that is NOT an encrypted envelope triggers a decryption error.
|
|
492
|
+
* 2. Envelope algorithm MUST match `allowedAlgorithms` (defaults to ['AES-GCM']).
|
|
493
|
+
* 3. Envelope `kid` (if present) MUST match `allowedKids`.
|
|
494
|
+
*/
|
|
495
|
+
strict?: boolean;
|
|
496
|
+
/** Whitelist of permitted cryptographic algorithms (e.g. ['AES-GCM']). Defaults to ['AES-GCM'] in strict mode. */
|
|
497
|
+
allowedAlgorithms?: string[];
|
|
498
|
+
/** Whitelist of allowed Key Identifiers (kid). */
|
|
499
|
+
allowedKids?: string[];
|
|
500
|
+
/**
|
|
501
|
+
* Hook invoked whenever decryption fails for an individual field or row.
|
|
502
|
+
* Can return a fallback cell value (e.g. sentinel or marker), or string/boolean.
|
|
503
|
+
*/
|
|
504
|
+
onDecryptError?: ((info: IDecryptErrorInfo) => any) | boolean | string;
|
|
505
|
+
/** Enable HMAC-SHA256 blind indexing and trigram search index on encrypted fields for local DataProviders */
|
|
506
|
+
searchIndex?: boolean;
|
|
507
|
+
/**
|
|
508
|
+
* Set to true if API endpoints or data sources return pre-encrypted ciphertext envelopes.
|
|
509
|
+
* When true, DataProviders decrypt search fields during ingest to populate CSearchIndex.
|
|
510
|
+
*/
|
|
511
|
+
preEncrypted?: boolean;
|
|
512
|
+
/** Optional dedicated HMAC key for search indexing (defaults to encryption key if omitted) */
|
|
513
|
+
hmacKey?: TKeyProvider;
|
|
514
|
+
/** Cryptographic algorithm identifier (defaults to 'AES-GCM') */
|
|
515
|
+
algorithm?: 'AES-GCM' | string;
|
|
516
|
+
/** Custom cipher adapter implementing IEncryptionProvider (e.g. CRSAEncryptionProvider, CECDHEncryptionProvider, CWebCryptoAESCBCProvider) */
|
|
517
|
+
customProvider?: IEncryptionProvider;
|
|
518
|
+
/** Whether to use synchronous Node.js crypto provider (CNodeCryptoEncryptionProvider) */
|
|
519
|
+
sync?: boolean;
|
|
520
|
+
/**
|
|
521
|
+
* Key Derivation Function strategy ('none' | 'pbkdf2' | 'hkdf'). Defaults to 'pbkdf2'.
|
|
522
|
+
* - 'pbkdf2': Recommended for human passphrases/passwords (OWASP recommended with work factor iterations).
|
|
523
|
+
* - 'hkdf': For deriving subkeys from high-entropy cryptographic keys or secrets (not for low-entropy human passwords).
|
|
524
|
+
* - 'none': Direct key import for raw high-entropy 256-bit symmetric keys or CryptoKeys.
|
|
525
|
+
*/
|
|
526
|
+
kdf?: 'none' | 'pbkdf2' | 'hkdf';
|
|
527
|
+
/** Number of PBKDF2 iterations (default: 310,000 per OWASP recommendation) */
|
|
528
|
+
kdfIterations?: number;
|
|
529
|
+
/** Hash algorithm for PBKDF2 or HKDF ('SHA-256' | 'SHA-512', default: 'SHA-256') */
|
|
530
|
+
kdfHash?: 'SHA-256' | 'SHA-512';
|
|
531
|
+
/** Optional static salt for KDF. If omitted, a cryptographically secure random salt is generated and included in the envelope. */
|
|
532
|
+
kdfSalt?: string | Uint8Array | ArrayBuffer;
|
|
533
|
+
/** Optional public key for asymmetric providers */
|
|
534
|
+
publicKey?: CryptoKey;
|
|
535
|
+
/** Optional private key for asymmetric providers */
|
|
536
|
+
privateKey?: CryptoKey;
|
|
537
|
+
/** Optional recipient public key for asymmetric/hybrid encryption */
|
|
538
|
+
recipientPublicKey?: CryptoKey;
|
|
539
|
+
/** Optional recipient private key for asymmetric/hybrid decryption */
|
|
540
|
+
recipientPrivateKey?: CryptoKey;
|
|
541
|
+
/** Elliptic curve name for ECDH ('P-256' | 'P-384' | 'P-521') */
|
|
542
|
+
curve?: 'P-256' | 'P-384' | 'P-521';
|
|
543
|
+
/** Optional context/info string or buffer for HKDF key derivation */
|
|
544
|
+
info?: string | Uint8Array | ArrayBuffer;
|
|
545
|
+
}
|
|
546
|
+
|
|
481
547
|
/**
|
|
482
548
|
* Lifecycle status for blind-index HMAC keys in a multi-KID keyring.
|
|
483
549
|
*/
|
|
@@ -653,144 +719,8 @@ interface IMigrationSummary {
|
|
|
653
719
|
durationMs: number;
|
|
654
720
|
}
|
|
655
721
|
|
|
656
|
-
|
|
657
|
-
* types.ts — Framework-agnostic hydration and platform abstraction contracts.
|
|
658
|
-
*/
|
|
659
|
-
interface ISSRHydrationAdapter {
|
|
660
|
-
/**
|
|
661
|
-
* Retrieve pre-hydrated SSR state for a key. Returns null if not present.
|
|
662
|
-
*/
|
|
663
|
-
getSSRData<T>(key: string, context?: any): T | null;
|
|
664
|
-
/**
|
|
665
|
-
* Execute fetcher with SSR serialization/caching if in an SSR environment,
|
|
666
|
-
* or simply await fetcher() in standalone/client environments.
|
|
667
|
-
*/
|
|
668
|
-
fetchWithSSR<T>(key: string, fetcher: () => Promise<T>, context?: any): Promise<T | null>;
|
|
669
|
-
/**
|
|
670
|
-
* Invalidate or clear SSR cache for a key (e.g. after mutations).
|
|
671
|
-
*/
|
|
672
|
-
clearSSRData?(key: string, context?: any): void;
|
|
673
|
-
/**
|
|
674
|
-
* Extract SSR hydration payload dictionary (for cache initialization).
|
|
675
|
-
*/
|
|
676
|
-
getSSRPayload?(context?: any): Record<string, any> | null;
|
|
677
|
-
}
|
|
678
|
-
interface IPlatformRouter {
|
|
679
|
-
getRoute(): {
|
|
680
|
-
query: Record<string, any>;
|
|
681
|
-
path?: string;
|
|
682
|
-
} | null;
|
|
683
|
-
getRouter(): any;
|
|
684
|
-
onReady?(cb: () => void): void;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
type TDataProviderListener<T = any> = (provider: T) => void;
|
|
722
|
+
type TDataProviderListener<T = unknown> = (provider: T) => void;
|
|
688
723
|
type TUnsubscribe = () => void;
|
|
689
|
-
declare enum EDataFilterOperator {
|
|
690
|
-
Equal = "==",
|
|
691
|
-
NotEqual = "!=",
|
|
692
|
-
GreaterThan = ">",
|
|
693
|
-
LessThan = "<",
|
|
694
|
-
GreaterThanOrEqual = ">=",
|
|
695
|
-
LessThanOrEqual = "<=",
|
|
696
|
-
In = "in",
|
|
697
|
-
NotIn = "nin",
|
|
698
|
-
And = "and",
|
|
699
|
-
Or = "or",
|
|
700
|
-
Nand = "nand",
|
|
701
|
-
Nor = "nor"
|
|
702
|
-
}
|
|
703
|
-
declare enum ECacheStrategy {
|
|
704
|
-
Application = "Application",
|
|
705
|
-
ServerSession = "ServerSession",
|
|
706
|
-
BrowserSession = "BrowserSession",
|
|
707
|
-
Memory = "Memory",
|
|
708
|
-
LocalStorage = "LocalStorage",
|
|
709
|
-
IndexedDB = "IndexedDB",
|
|
710
|
-
Cookie = "Cookie"
|
|
711
|
-
}
|
|
712
|
-
interface ICacheEntry<T> {
|
|
713
|
-
data: T;
|
|
714
|
-
timestamp: number;
|
|
715
|
-
lifetime: number;
|
|
716
|
-
lastAccessed?: number;
|
|
717
|
-
accessCount?: number;
|
|
718
|
-
}
|
|
719
|
-
interface ICacheQuotaOptions {
|
|
720
|
-
maxEntries?: number;
|
|
721
|
-
maxSizeBytes?: number;
|
|
722
|
-
quotaThresholdRatio?: number;
|
|
723
|
-
fallbackToMemory?: boolean;
|
|
724
|
-
}
|
|
725
|
-
interface ICookieCacheOptions {
|
|
726
|
-
/** Default: 'lax'. */
|
|
727
|
-
sameSite?: 'strict' | 'lax' | 'none';
|
|
728
|
-
/**
|
|
729
|
-
* Adds the `Secure` flag. Default: auto-detected from the request protocol
|
|
730
|
-
* (https => true). Set explicitly to force it on or off.
|
|
731
|
-
*/
|
|
732
|
-
secure?: boolean;
|
|
733
|
-
/**
|
|
734
|
-
* Default: true. Only effective for cookies written on the server: browsers
|
|
735
|
-
* do not allow `document.cookie` to set HttpOnly, so client writes ignore it.
|
|
736
|
-
*/
|
|
737
|
-
httpOnly?: boolean;
|
|
738
|
-
/** Default: '/'. */
|
|
739
|
-
path?: string;
|
|
740
|
-
}
|
|
741
|
-
interface IRequestOptions {
|
|
742
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
743
|
-
body?: any;
|
|
744
|
-
headers?: Record<string, string>;
|
|
745
|
-
cacheStrategy?: ECacheStrategy;
|
|
746
|
-
lifetime?: number;
|
|
747
|
-
key?: string;
|
|
748
|
-
cacheKey?: string;
|
|
749
|
-
query?: Record<string, any>;
|
|
750
|
-
deduplicate?: boolean;
|
|
751
|
-
context?: any;
|
|
752
|
-
disableCache?: boolean;
|
|
753
|
-
queue?: boolean;
|
|
754
|
-
queueLabel?: string;
|
|
755
|
-
label?: string;
|
|
756
|
-
tags?: string[];
|
|
757
|
-
signal?: AbortSignal;
|
|
758
|
-
_generation?: number;
|
|
759
|
-
encryption?: IProviderEncryptionOptions;
|
|
760
|
-
/** If true, returns raw response without decrypting, useful for DataProvider lazy page-level decryption */
|
|
761
|
-
skipDecryption?: boolean;
|
|
762
|
-
credentials?: RequestCredentials;
|
|
763
|
-
}
|
|
764
|
-
/** Queue persistence backend with automatic fallback: IndexedDB → LocalStorage → Memory */
|
|
765
|
-
declare enum EQueueStorage {
|
|
766
|
-
Memory = "Memory",
|
|
767
|
-
LocalStorage = "LocalStorage",
|
|
768
|
-
IndexedDB = "IndexedDB"
|
|
769
|
-
}
|
|
770
|
-
/** Status of an item currently in the pending queue */
|
|
771
|
-
type TQueueItemStatus = 'pending' | 'flushing';
|
|
772
|
-
/** A single mutation operation waiting to be sent */
|
|
773
|
-
interface IQueuedOperation {
|
|
774
|
-
id: string;
|
|
775
|
-
url: string;
|
|
776
|
-
method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
777
|
-
options: IRequestOptions;
|
|
778
|
-
tags: string[];
|
|
779
|
-
label?: string;
|
|
780
|
-
createdAt: number;
|
|
781
|
-
flushAttempts: number;
|
|
782
|
-
status: TQueueItemStatus;
|
|
783
|
-
}
|
|
784
|
-
/** An operation that failed permanently and was moved to the dead-letter store */
|
|
785
|
-
interface IDeadLetterItem extends IQueuedOperation {
|
|
786
|
-
failedAt: number;
|
|
787
|
-
lastError: string;
|
|
788
|
-
httpStatus?: number;
|
|
789
|
-
}
|
|
790
|
-
/** Options for flush operations */
|
|
791
|
-
interface IFlushOptions {
|
|
792
|
-
tag?: string;
|
|
793
|
-
}
|
|
794
724
|
interface IKDatatableAction {
|
|
795
725
|
action: Function;
|
|
796
726
|
label: string;
|
|
@@ -802,15 +732,6 @@ interface IKDatatableAction {
|
|
|
802
732
|
type TDataRow = {
|
|
803
733
|
[key: string]: any;
|
|
804
734
|
};
|
|
805
|
-
interface IDataFilter {
|
|
806
|
-
operator: EDataFilterOperator;
|
|
807
|
-
field: TDataRow | IDataFilter[];
|
|
808
|
-
active: boolean;
|
|
809
|
-
}
|
|
810
|
-
interface IDataSort {
|
|
811
|
-
field: string;
|
|
812
|
-
direction: 'asc' | 'desc';
|
|
813
|
-
}
|
|
814
735
|
interface IDataResult<TRow = TDataRow> {
|
|
815
736
|
rowCount: number;
|
|
816
737
|
rows: TRow[];
|
|
@@ -831,7 +752,7 @@ interface IDataProviderOptions {
|
|
|
831
752
|
cacheStrategy?: ECacheStrategy;
|
|
832
753
|
cacheLifetime?: number;
|
|
833
754
|
deduplicate?: boolean;
|
|
834
|
-
context?:
|
|
755
|
+
context?: Record<string, unknown>;
|
|
835
756
|
contextKey?: string;
|
|
836
757
|
urlPageParam?: string;
|
|
837
758
|
refreshOnMutation?: boolean;
|
|
@@ -847,7 +768,7 @@ interface IDataProviderState<TRow = TDataRow> {
|
|
|
847
768
|
rowCount?: number;
|
|
848
769
|
loading?: boolean;
|
|
849
770
|
initialLoad?: boolean;
|
|
850
|
-
error?:
|
|
771
|
+
error?: Error | unknown;
|
|
851
772
|
pageData?: TRow[];
|
|
852
773
|
}
|
|
853
774
|
interface IDataProviderSetStateOptions {
|
|
@@ -863,6 +784,60 @@ interface IVirtualScrollState {
|
|
|
863
784
|
itemHeight: number;
|
|
864
785
|
}
|
|
865
786
|
|
|
787
|
+
interface IRequestOptions {
|
|
788
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
789
|
+
body?: any;
|
|
790
|
+
headers?: Record<string, string>;
|
|
791
|
+
cacheStrategy?: ECacheStrategy;
|
|
792
|
+
lifetime?: number;
|
|
793
|
+
key?: string;
|
|
794
|
+
cacheKey?: string;
|
|
795
|
+
query?: Record<string, unknown>;
|
|
796
|
+
deduplicate?: boolean;
|
|
797
|
+
context?: Record<string, unknown>;
|
|
798
|
+
disableCache?: boolean;
|
|
799
|
+
queue?: boolean;
|
|
800
|
+
queueLabel?: string;
|
|
801
|
+
label?: string;
|
|
802
|
+
tags?: string[];
|
|
803
|
+
signal?: AbortSignal;
|
|
804
|
+
_generation?: number;
|
|
805
|
+
encryption?: IProviderEncryptionOptions;
|
|
806
|
+
/** If true, returns raw response without decrypting, useful for DataProvider lazy page-level decryption */
|
|
807
|
+
skipDecryption?: boolean;
|
|
808
|
+
credentials?: RequestCredentials;
|
|
809
|
+
}
|
|
810
|
+
/** Queue persistence backend with automatic fallback: IndexedDB → LocalStorage → Memory */
|
|
811
|
+
declare enum EQueueStorage {
|
|
812
|
+
Memory = "Memory",
|
|
813
|
+
LocalStorage = "LocalStorage",
|
|
814
|
+
IndexedDB = "IndexedDB"
|
|
815
|
+
}
|
|
816
|
+
/** Status of an item currently in the pending queue */
|
|
817
|
+
type TQueueItemStatus = 'pending' | 'flushing';
|
|
818
|
+
/** A single mutation operation waiting to be sent */
|
|
819
|
+
interface IQueuedOperation {
|
|
820
|
+
id: string;
|
|
821
|
+
url: string;
|
|
822
|
+
method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
823
|
+
options: IRequestOptions;
|
|
824
|
+
tags: string[];
|
|
825
|
+
label?: string;
|
|
826
|
+
createdAt: number;
|
|
827
|
+
flushAttempts: number;
|
|
828
|
+
status: TQueueItemStatus;
|
|
829
|
+
}
|
|
830
|
+
/** An operation that failed permanently and was moved to the dead-letter store */
|
|
831
|
+
interface IDeadLetterItem extends IQueuedOperation {
|
|
832
|
+
failedAt: number;
|
|
833
|
+
lastError: string;
|
|
834
|
+
httpStatus?: number;
|
|
835
|
+
}
|
|
836
|
+
/** Options for flush operations */
|
|
837
|
+
interface IFlushOptions {
|
|
838
|
+
tag?: string;
|
|
839
|
+
}
|
|
840
|
+
|
|
866
841
|
interface ITreeNode<TRow = TDataRow> {
|
|
867
842
|
data: TRow;
|
|
868
843
|
id: string | number;
|
|
@@ -928,6 +903,7 @@ type TTreePageDataHandler<TRow = TDataRow> = (currentPage: number, pageSize: num
|
|
|
928
903
|
disableCache?: boolean;
|
|
929
904
|
signal?: AbortSignal;
|
|
930
905
|
}) => IDataResult<TRow> | Promise<IDataResult<TRow>>;
|
|
906
|
+
|
|
931
907
|
interface KProductItemData {
|
|
932
908
|
id: string | number;
|
|
933
909
|
title: string;
|
|
@@ -935,7 +911,7 @@ interface KProductItemData {
|
|
|
935
911
|
price?: number;
|
|
936
912
|
currency?: string;
|
|
937
913
|
description?: string;
|
|
938
|
-
[key: string]:
|
|
914
|
+
[key: string]: unknown;
|
|
939
915
|
}
|
|
940
916
|
interface KProductRowAction {
|
|
941
917
|
label: string;
|
|
@@ -944,6 +920,37 @@ interface KProductRowAction {
|
|
|
944
920
|
color?: 'primary' | 'danger' | 'success' | 'warning' | 'info' | 'light' | 'dark' | 'default';
|
|
945
921
|
}
|
|
946
922
|
|
|
923
|
+
/**
|
|
924
|
+
* types.ts — Framework-agnostic hydration and platform abstraction contracts.
|
|
925
|
+
*/
|
|
926
|
+
interface ISSRHydrationAdapter {
|
|
927
|
+
/**
|
|
928
|
+
* Retrieve pre-hydrated SSR state for a key. Returns null if not present.
|
|
929
|
+
*/
|
|
930
|
+
getSSRData<T>(key: string, context?: any): T | null;
|
|
931
|
+
/**
|
|
932
|
+
* Execute fetcher with SSR serialization/caching if in an SSR environment,
|
|
933
|
+
* or simply await fetcher() in standalone/client environments.
|
|
934
|
+
*/
|
|
935
|
+
fetchWithSSR<T>(key: string, fetcher: () => Promise<T>, context?: any): Promise<T | null>;
|
|
936
|
+
/**
|
|
937
|
+
* Invalidate or clear SSR cache for a key (e.g. after mutations).
|
|
938
|
+
*/
|
|
939
|
+
clearSSRData?(key: string, context?: any): void;
|
|
940
|
+
/**
|
|
941
|
+
* Extract SSR hydration payload dictionary (for cache initialization).
|
|
942
|
+
*/
|
|
943
|
+
getSSRPayload?(context?: any): Record<string, any> | null;
|
|
944
|
+
}
|
|
945
|
+
interface IPlatformRouter {
|
|
946
|
+
getRoute(): {
|
|
947
|
+
query: Record<string, any>;
|
|
948
|
+
path?: string;
|
|
949
|
+
} | null;
|
|
950
|
+
getRouter(): any;
|
|
951
|
+
onReady?(cb: () => void): void;
|
|
952
|
+
}
|
|
953
|
+
|
|
947
954
|
declare abstract class ADataProvider<TRow = TDataRow> {
|
|
948
955
|
idKey: string;
|
|
949
956
|
protected _pageData: TRow[];
|
|
@@ -1158,12 +1165,12 @@ declare class CFlatClientDataProvider<TRow = TDataRow> extends AEncryptedClientP
|
|
|
1158
1165
|
|
|
1159
1166
|
declare abstract class ACacheProvider {
|
|
1160
1167
|
constructor();
|
|
1161
|
-
abstract getKeyList(context?:
|
|
1162
|
-
abstract get<T>(key: string, context?:
|
|
1163
|
-
abstract set<T>(key: string, data: T, lifetime: number, context?:
|
|
1164
|
-
abstract remove(key: string, context?:
|
|
1165
|
-
abstract removeByPrefix(prefix: string, context?:
|
|
1166
|
-
abstract getRemainingTime(key: string, context?:
|
|
1168
|
+
abstract getKeyList(context?: unknown): Array<string> | Promise<Array<string>>;
|
|
1169
|
+
abstract get<T>(key: string, context?: unknown): Promise<T | null>;
|
|
1170
|
+
abstract set<T>(key: string, data: T, lifetime: number, context?: unknown): Promise<void>;
|
|
1171
|
+
abstract remove(key: string, context?: unknown): Promise<void>;
|
|
1172
|
+
abstract removeByPrefix(prefix: string, context?: unknown): Promise<void>;
|
|
1173
|
+
abstract getRemainingTime(key: string, context?: unknown): Promise<number | null>;
|
|
1167
1174
|
abstract cleanupExpired(): Promise<void>;
|
|
1168
1175
|
}
|
|
1169
1176
|
|
|
@@ -1256,9 +1263,9 @@ declare class CAPIFlatClientDataProvider<TRow = TDataRow> extends CFlatClientDat
|
|
|
1256
1263
|
disableCache?: boolean;
|
|
1257
1264
|
}): Promise<void>;
|
|
1258
1265
|
setAPIUrl(url: string): Promise<void>;
|
|
1259
|
-
create(item:
|
|
1260
|
-
update(item:
|
|
1261
|
-
delete(items:
|
|
1266
|
+
create(item: TRow): Promise<void>;
|
|
1267
|
+
update(item: TRow): Promise<void>;
|
|
1268
|
+
delete(items: TRow[]): Promise<void>;
|
|
1262
1269
|
loadPageData(): Promise<void>;
|
|
1263
1270
|
}
|
|
1264
1271
|
|
|
@@ -1297,9 +1304,9 @@ declare class CAPIFlatServerDataProvider<TRow = TDataRow> extends CFlatServerDat
|
|
|
1297
1304
|
disableCache?: boolean;
|
|
1298
1305
|
}): Promise<void>;
|
|
1299
1306
|
setAPIUrl(url: string): Promise<void>;
|
|
1300
|
-
delete(items:
|
|
1301
|
-
create(item:
|
|
1302
|
-
update(item:
|
|
1307
|
+
delete(items: TRow[]): Promise<void>;
|
|
1308
|
+
create(item: TRow): Promise<void>;
|
|
1309
|
+
update(item: TRow): Promise<void>;
|
|
1303
1310
|
}
|
|
1304
1311
|
|
|
1305
1312
|
declare class CTreeClientDataProvider<TRow extends TDataRow = TDataRow> extends CFlatClientDataProvider<TRow> implements ITreeDataProvider<TRow> {
|
|
@@ -1375,9 +1382,9 @@ declare class CAPITreeClientDataProvider<TRow extends TDataRow = TDataRow> exten
|
|
|
1375
1382
|
}): Promise<void>;
|
|
1376
1383
|
private _initialFetch;
|
|
1377
1384
|
setAPIUrl(url: string): Promise<void>;
|
|
1378
|
-
create(item:
|
|
1379
|
-
update(item:
|
|
1380
|
-
delete(items:
|
|
1385
|
+
create(item: TRow): Promise<void>;
|
|
1386
|
+
update(item: TRow): Promise<void>;
|
|
1387
|
+
delete(items: TRow[]): Promise<void>;
|
|
1381
1388
|
loadPageData(): Promise<void>;
|
|
1382
1389
|
}
|
|
1383
1390
|
|
|
@@ -1447,9 +1454,9 @@ declare class CAPITreeServerDataProvider<TRow = TDataRow> extends CTreeServerDat
|
|
|
1447
1454
|
disableCache?: boolean;
|
|
1448
1455
|
}): Promise<void>;
|
|
1449
1456
|
setAPIUrl(url: string): Promise<void>;
|
|
1450
|
-
delete(items:
|
|
1451
|
-
create(item:
|
|
1452
|
-
update(item:
|
|
1457
|
+
delete(items: TRow[]): Promise<void>;
|
|
1458
|
+
create(item: TRow): Promise<void>;
|
|
1459
|
+
update(item: TRow): Promise<void>;
|
|
1453
1460
|
}
|
|
1454
1461
|
|
|
1455
1462
|
/**
|