@bantis/local-cipher 2.2.0 → 2.3.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.
@@ -13,6 +13,7 @@ export declare class EncryptionHelper {
13
13
  private baseKey;
14
14
  private baseKeyPromise;
15
15
  private keyVersion;
16
+ private keyNameCache;
16
17
  constructor(config?: EncryptionConfig);
17
18
  /**
18
19
  * Get current key version
@@ -0,0 +1,41 @@
1
+ import type { SecureCookieConfig, CookieOptions } from '../types';
2
+ /**
3
+ * SecureCookie - API de alto nivel para almacenamiento en cookies cifradas
4
+ * Soporta opciones de cookies incluyendo domininios/subdominios y compresión.
5
+ */
6
+ export declare class SecureCookie {
7
+ private static instance;
8
+ private encryptionHelper;
9
+ private logger;
10
+ private config;
11
+ private constructor();
12
+ /**
13
+ * Obtiene la instancia singleton de SecureCookie
14
+ */
15
+ static getInstance(config?: SecureCookieConfig): SecureCookie;
16
+ /**
17
+ * Serializa las opciones de cookie en un string
18
+ */
19
+ private serializeOptions;
20
+ /**
21
+ * Guarda un valor encriptado en una cookie
22
+ */
23
+ set(name: string, value: string, options?: CookieOptions): Promise<void>;
24
+ /**
25
+ * Pide una cookie por nombre
26
+ * Retorna el string o null si no existe
27
+ */
28
+ private getRawCookie;
29
+ /**
30
+ * Recupera y desencripta un valor de cookie
31
+ */
32
+ get(name: string): Promise<string | null>;
33
+ /**
34
+ * Elimina una cookie
35
+ */
36
+ remove(name: string, options?: Pick<CookieOptions, 'path' | 'domain'>): Promise<void>;
37
+ /**
38
+ * Limpia la instancia actual (útil para testing o refresco)
39
+ */
40
+ destroy(): void;
41
+ }
@@ -12,6 +12,7 @@ export declare class SecureStorage {
12
12
  private logger;
13
13
  private config;
14
14
  private cleanupInterval;
15
+ private memoryCache;
15
16
  private constructor();
16
17
  /**
17
18
  * Obtiene la instancia singleton de SecureStorage
package/dist/index.d.ts CHANGED
@@ -10,11 +10,15 @@ export { SecureStorage } from './core/SecureStorage';
10
10
  export { EventEmitter } from './core/EventEmitter';
11
11
  export { KeyRotation } from './core/KeyRotation';
12
12
  export { NamespacedStorage } from './core/NamespacedStorage';
13
- export type { EncryptionConfig, StorageConfig, DebugConfig, SecureStorageConfig, StoredValue, ExpiryOptions, EncryptedBackup, IntegrityInfo, StorageEventType, StorageEventData, EventListener, LogLevel, } from './types';
13
+ export { SecureCookie } from './core/SecureCookie';
14
+ export type { EncryptionConfig, StorageConfig, DebugConfig, SecureStorageConfig, StoredValue, ExpiryOptions, EncryptedBackup, IntegrityInfo, StorageEventType, StorageEventData, EventListener, LogLevel, CookieOptions, SecureCookieConfig, } from './types';
14
15
  export { DEFAULT_CONFIG, LIBRARY_VERSION, STORAGE_VERSION } from './types';
15
16
  export { Logger } from './utils/logger';
16
17
  export { compress, decompress, shouldCompress, isCompressionSupported } from './utils/compression';
17
18
  export { debugEncryptionState, forceMigration } from './utils/debug';
19
+ export * from './managers';
18
20
  import { SecureStorage } from './core/SecureStorage';
21
+ import { SecureCookie } from './core/SecureCookie';
19
22
  export declare const secureStorage: SecureStorage;
20
- export declare const VERSION = "2.1.0";
23
+ export declare const secureCookie: SecureCookie;
24
+ export declare const VERSION = "2.2.0";