@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.
@@ -28,6 +28,12 @@ export interface StorageConfig {
28
28
  autoCleanup?: boolean;
29
29
  /** Auto cleanup interval in ms (default: 60000 - 1 minute) */
30
30
  cleanupInterval?: number;
31
+ /** Enable in-memory caching for faster reads (default: true) */
32
+ enableCache?: boolean;
33
+ /** Verify data integrity with SHA-256 on every read (default: false to improve performance) */
34
+ verifyIntegrityOnRead?: boolean;
35
+ /** Storage engine to use: localStorage or sessionStorage (default: localStorage) */
36
+ storageEngine?: Storage;
31
37
  }
32
38
  /**
33
39
  * Debug configuration options
@@ -55,6 +61,36 @@ export interface SecureStorageConfig {
55
61
  /** Debug configuration */
56
62
  debug?: DebugConfig;
57
63
  }
64
+ /**
65
+ * Cookie configuration options
66
+ */
67
+ export interface CookieOptions {
68
+ /** Expiration date for the cookie */
69
+ expires?: Date;
70
+ /** Max age in seconds */
71
+ maxAge?: number;
72
+ /** Domain for the cookie (e.g. '.example.com' for subdomains) */
73
+ domain?: string;
74
+ /** Path for the cookie (default: '/') */
75
+ path?: string;
76
+ /** Whether the cookie is secure (HTTPS only) */
77
+ secure?: boolean;
78
+ /** SameSite attribute ('strict' | 'lax' | 'none') */
79
+ sameSite?: 'strict' | 'lax' | 'none';
80
+ }
81
+ /**
82
+ * Complete configuration for SecureCookie
83
+ */
84
+ export interface SecureCookieConfig {
85
+ /** Encryption configuration */
86
+ encryption?: EncryptionConfig;
87
+ /** Base cookie options applied to all cookies */
88
+ cookieOptions?: CookieOptions;
89
+ /** Enable compression for cookie values (default: true) */
90
+ compression?: boolean;
91
+ /** Debug configuration */
92
+ debug?: DebugConfig;
93
+ }
58
94
  /**
59
95
  * Stored value with metadata
60
96
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bantis/local-cipher",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Client-side encryption for localStorage - Framework-agnostic with React and Angular support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -94,7 +94,7 @@
94
94
  },
95
95
  "peerDependencies": {
96
96
  "@angular/core": ">=15.0.0",
97
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
97
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
98
98
  "rxjs": "^7.0.0"
99
99
  },
100
100
  "peerDependenciesMeta": {