@bantis/local-cipher 2.1.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.
- package/README.md +85 -2
- package/dist/angular/SecureStorageService.d.ts +1 -1
- package/dist/angular/StorageService.d.ts +22 -0
- package/dist/angular.d.ts +1 -0
- package/dist/angular.esm.js +539 -53
- package/dist/angular.esm.js.map +1 -1
- package/dist/angular.js +550 -52
- package/dist/angular.js.map +1 -1
- package/dist/core/EncryptionHelper.d.ts +1 -0
- package/dist/core/NamespacedStorage.d.ts +3 -0
- package/dist/core/SecureCookie.d.ts +41 -0
- package/dist/core/SecureStorage.d.ts +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.esm.js +493 -51
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +503 -50
- package/dist/index.js.map +1 -1
- package/dist/managers/CookieManager.d.ts +17 -0
- package/dist/managers/PlainCookie.d.ts +14 -0
- package/dist/managers/PlainStorage.d.ts +13 -0
- package/dist/managers/StorageManager.d.ts +17 -0
- package/dist/managers/index.d.ts +17 -0
- package/dist/react/hooks.d.ts +20 -2
- package/dist/react.d.ts +1 -1
- package/dist/react.esm.js +518 -59
- package/dist/react.esm.js.map +1 -1
- package/dist/react.js +529 -59
- package/dist/react.js.map +1 -1
- package/dist/types/index.d.ts +36 -0
- package/package.json +8 -4
|
@@ -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
|
+
}
|
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
|
|
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
|
|
23
|
+
export declare const secureCookie: SecureCookie;
|
|
24
|
+
export declare const VERSION = "2.2.0";
|