strata-storage 2.7.1 → 2.8.1

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.
Files changed (101) hide show
  1. package/AI-INTEGRATION-GUIDE.md +25 -5
  2. package/LICENSE +21 -35
  3. package/README.md +30 -28
  4. package/dist/LICENSE +21 -35
  5. package/dist/README.md +30 -28
  6. package/dist/adapters/capacitor/FilesystemAdapter.d.ts +0 -1
  7. package/dist/adapters/capacitor/PreferencesAdapter.d.ts +0 -1
  8. package/dist/adapters/capacitor/SecureAdapter.d.ts +0 -1
  9. package/dist/adapters/capacitor/SqliteAdapter.d.ts +0 -1
  10. package/dist/adapters/capacitor/index.d.ts +0 -1
  11. package/dist/adapters/web/CacheAdapter.d.ts +0 -1
  12. package/dist/adapters/web/CookieAdapter.d.ts +0 -1
  13. package/dist/adapters/web/IndexedDBAdapter.d.ts +0 -1
  14. package/dist/adapters/web/LocalStorageAdapter.d.ts +0 -1
  15. package/dist/adapters/web/MemoryAdapter.d.ts +0 -1
  16. package/dist/adapters/web/SessionStorageAdapter.d.ts +0 -1
  17. package/dist/adapters/web/URLAdapter.d.ts +0 -1
  18. package/dist/adapters/web/index.d.ts +0 -1
  19. package/dist/capacitor.d.ts +0 -1
  20. package/dist/config/support.d.ts +0 -1
  21. package/dist/core/AdapterRegistry.d.ts +0 -1
  22. package/dist/core/BaseAdapter.d.ts +0 -1
  23. package/dist/core/Strata.d.ts +0 -1
  24. package/dist/features/compression/index.d.ts +0 -1
  25. package/dist/features/compression.d.ts +0 -1
  26. package/dist/features/encryption/index.d.ts +0 -1
  27. package/dist/features/encryption.d.ts +0 -1
  28. package/dist/features/integrity.d.ts +0 -1
  29. package/dist/features/migration.d.ts +0 -1
  30. package/dist/features/observer/index.d.ts +0 -1
  31. package/dist/features/observer.d.ts +0 -1
  32. package/dist/features/query/index.d.ts +0 -1
  33. package/dist/features/query.d.ts +0 -1
  34. package/dist/features/sync/index.d.ts +0 -1
  35. package/dist/features/sync.d.ts +0 -1
  36. package/dist/features/ttl/index.d.ts +0 -1
  37. package/dist/features/ttl.d.ts +0 -1
  38. package/dist/firebase.d.ts +0 -1
  39. package/dist/index.d.ts +0 -1
  40. package/dist/integrations/angular/index.d.ts +0 -1
  41. package/dist/integrations/index.d.ts +0 -1
  42. package/dist/integrations/react/index.d.ts +0 -1
  43. package/dist/integrations/vue/index.d.ts +0 -1
  44. package/dist/package.json +9 -4
  45. package/dist/plugin/definitions.d.ts +0 -1
  46. package/dist/plugin/index.d.ts +0 -1
  47. package/dist/plugin/web.d.ts +0 -1
  48. package/dist/types/index.d.ts +0 -1
  49. package/dist/utils/errors.d.ts +0 -1
  50. package/dist/utils/index.d.ts +0 -1
  51. package/dist/utils/logger.d.ts +0 -1
  52. package/package.json +15 -5
  53. package/android/AGENTS.md +0 -66
  54. package/android/CLAUDE.md +0 -122
  55. package/dist/adapters/capacitor/FilesystemAdapter.d.ts.map +0 -1
  56. package/dist/adapters/capacitor/PreferencesAdapter.d.ts.map +0 -1
  57. package/dist/adapters/capacitor/SecureAdapter.d.ts.map +0 -1
  58. package/dist/adapters/capacitor/SqliteAdapter.d.ts.map +0 -1
  59. package/dist/adapters/capacitor/index.d.ts.map +0 -1
  60. package/dist/adapters/web/CacheAdapter.d.ts.map +0 -1
  61. package/dist/adapters/web/CookieAdapter.d.ts.map +0 -1
  62. package/dist/adapters/web/IndexedDBAdapter.d.ts.map +0 -1
  63. package/dist/adapters/web/LocalStorageAdapter.d.ts.map +0 -1
  64. package/dist/adapters/web/MemoryAdapter.d.ts.map +0 -1
  65. package/dist/adapters/web/SessionStorageAdapter.d.ts.map +0 -1
  66. package/dist/adapters/web/URLAdapter.d.ts.map +0 -1
  67. package/dist/adapters/web/index.d.ts.map +0 -1
  68. package/dist/capacitor.d.ts.map +0 -1
  69. package/dist/config/support.d.ts.map +0 -1
  70. package/dist/core/AdapterRegistry.d.ts.map +0 -1
  71. package/dist/core/BaseAdapter.d.ts.map +0 -1
  72. package/dist/core/Strata.d.ts.map +0 -1
  73. package/dist/features/compression/index.d.ts.map +0 -1
  74. package/dist/features/compression.d.ts.map +0 -1
  75. package/dist/features/encryption/index.d.ts.map +0 -1
  76. package/dist/features/encryption.d.ts.map +0 -1
  77. package/dist/features/integrity.d.ts.map +0 -1
  78. package/dist/features/migration.d.ts.map +0 -1
  79. package/dist/features/observer/index.d.ts.map +0 -1
  80. package/dist/features/observer.d.ts.map +0 -1
  81. package/dist/features/query/index.d.ts.map +0 -1
  82. package/dist/features/query.d.ts.map +0 -1
  83. package/dist/features/sync/index.d.ts.map +0 -1
  84. package/dist/features/sync.d.ts.map +0 -1
  85. package/dist/features/ttl/index.d.ts.map +0 -1
  86. package/dist/features/ttl.d.ts.map +0 -1
  87. package/dist/firebase.d.ts.map +0 -1
  88. package/dist/index.d.ts.map +0 -1
  89. package/dist/integrations/angular/index.d.ts.map +0 -1
  90. package/dist/integrations/index.d.ts.map +0 -1
  91. package/dist/integrations/react/index.d.ts.map +0 -1
  92. package/dist/integrations/vue/index.d.ts.map +0 -1
  93. package/dist/plugin/definitions.d.ts.map +0 -1
  94. package/dist/plugin/index.d.ts.map +0 -1
  95. package/dist/plugin/web.d.ts.map +0 -1
  96. package/dist/types/index.d.ts.map +0 -1
  97. package/dist/utils/errors.d.ts.map +0 -1
  98. package/dist/utils/index.d.ts.map +0 -1
  99. package/dist/utils/logger.d.ts.map +0 -1
  100. package/ios/AGENTS.md +0 -59
  101. package/ios/CLAUDE.md +0 -106
@@ -1,6 +1,6 @@
1
1
  # AI Integration Guide - strata-storage
2
2
 
3
- Quick reference for AI development agents (Claude Code, Cursor, Copilot, etc.) to integrate `strata-storage` into web and mobile projects. Current version: **2.7.0**.
3
+ Quick reference for AI development agents (Claude Code, Cursor, Copilot, etc.) to integrate `strata-storage` into web and mobile projects. Current version: **2.8.1**.
4
4
 
5
5
  ## Installation
6
6
 
@@ -209,9 +209,16 @@ const storage = defineStorage();
209
209
 
210
210
  ### Capacitor (native)
211
211
 
212
+ `strata-storage` ships as a Capacitor plugin (native iOS + Android). In a Capacitor
213
+ app, after installing run **`npx cap sync`** so the native module is copied into the
214
+ iOS/Android projects — the native adapters (`secure`, `sqlite`, `preferences`,
215
+ `filesystem`) **do not work on-device without it**. No manual plugin registration in
216
+ JS is needed; Capacitor auto-discovers the `StrataStorage` plugin.
217
+
212
218
  ```typescript
213
219
  import { defineStorage } from 'strata-storage';
214
220
  import {
221
+ registerCapacitorAdapters,
215
222
  PreferencesAdapter,
216
223
  SecureAdapter,
217
224
  SqliteAdapter,
@@ -219,10 +226,15 @@ import {
219
226
  } from 'strata-storage/capacitor';
220
227
 
221
228
  const storage = defineStorage();
222
- storage.registerAdapter(new PreferencesAdapter());
223
- storage.registerAdapter(new SecureAdapter());
224
- storage.registerAdapter(new SqliteAdapter()); // 2.6.0 — multi-store (database + table)
225
- storage.registerAdapter(new FilesystemAdapter()); // 2.6.0 — file-per-key, atomic writes
229
+
230
+ // Easiest — register all four native adapters at once (also refreshes the active set):
231
+ await registerCapacitorAdapters(storage);
232
+
233
+ // …or register individually for fine-grained control / custom adapter config:
234
+ // storage.registerAdapter(new SecureAdapter());
235
+ // storage.registerAdapter(new SqliteAdapter()); // 2.6.0 — multi-store (database + table)
236
+ // storage.registerAdapter(new FilesystemAdapter()); // 2.6.0 — file-per-key, atomic writes
237
+
226
238
  await storage.set('secret', token, { storage: 'secure' });
227
239
  ```
228
240
 
@@ -315,6 +327,8 @@ const storage = defineStorage({
315
327
  | Issue | Solution |
316
328
  |-------|----------|
317
329
  | Framework import fails | Ensure `strata-storage >= 2.5.0` (earlier versions never shipped the built entry points). |
330
+ | TS can't find types for `strata-storage/react` \| `/vue` \| `/angular` \| `/capacitor` \| `/firebase` | Set `"moduleResolution": "bundler"` (or `"nodenext"`) in `tsconfig.json`. The package is ESM-only and exposes typed `exports` subpaths; classic `"node"` resolution can't see them. Modern Vite / Angular / Vue templates already use `bundler`/`nodenext`. |
331
+ | Native adapters do nothing on device | Run `npx cap sync` after install so the native iOS/Android module is wired in, then register the Capacitor adapters (`registerCapacitorAdapters(storage)`). |
318
332
  | "does not support synchronous operations" | The targeted adapter is async-only; use the async API or a sync-capable adapter. |
319
333
  | Sync set throws on encrypt/compress | Encryption/compression are async — use `await storage.set(...)`. |
320
334
  | `useStrata must be used within <StrataProvider>` | Use `createStrataHooks(instance)` for provider-free code. |
@@ -333,3 +347,9 @@ Full documentation lives at **https://stratastorage-docs.aoneahsan.com**:
333
347
  - [Recovery & Integrity](https://stratastorage-docs.aoneahsan.com/api/features/recovery)
334
348
  - [Changelog](https://stratastorage-docs.aoneahsan.com/reference/changelog)
335
349
  - Machine-readable: [`/llms.txt`](https://stratastorage-docs.aoneahsan.com/llms.txt) · [`/llms-full.txt`](https://stratastorage-docs.aoneahsan.com/llms-full.txt)
350
+
351
+ Project: [npm](https://www.npmjs.com/package/strata-storage) · [GitHub](https://github.com/aoneahsan/strata-storage) · [Report an issue](https://github.com/aoneahsan/strata-storage/issues)
352
+
353
+ ---
354
+
355
+ Developed with ❤️ by the **Strata Storage Team** — maintained by [Ahsan Mahmood](https://aoneahsan.com). Questions or integration help: **aoneahsan@gmail.com**.
package/LICENSE CHANGED
@@ -1,35 +1,21 @@
1
- Copyright 2024 Ahsan Mahmood
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
-
15
- ================================================================================
16
-
17
- Full Apache License 2.0 text: https://www.apache.org/licenses/LICENSE-2.0.txt
18
-
19
- ================================================================================
20
-
21
- Additional Terms:
22
-
23
- 1. Attribution Requirement:
24
- You must retain all copyright notices and this license in any distribution.
25
-
26
- 2. Contribution Agreement:
27
- Any contributions submitted for inclusion shall be under the same license.
28
-
29
- 3. Name and Trademark:
30
- "Strata Storage" name may not be used for derivative works without permission.
31
-
32
- 4. Patent Grant:
33
- This license includes express patent grants from contributors.
34
-
35
- For the complete license terms and plain English explanation, see LICENSE.md
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 Ahsan Mahmood
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -5,12 +5,12 @@
5
5
  - **[AI Integration Guide](./AI-INTEGRATION-GUIDE.md)** — quick reference for AI development agents (Claude Code, Cursor, Copilot).
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/strata-storage.svg)](https://www.npmjs.com/package/strata-storage)
8
- [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
8
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
9
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue.svg)](https://www.typescriptlang.org/)
10
10
  [![Platform](https://img.shields.io/badge/platform-Web%20%7C%20iOS%20%7C%20Android-lightgrey.svg)](https://stratastorage.aoneahsan.com)
11
11
 
12
- - **Version:** `2.7.1`
13
- - **License:** Apache-2.0
12
+ - **Version:** `2.8.0`
13
+ - **License:** MIT
14
14
  - **Node.js:** `>= 24.13.0`
15
15
  - **Module format:** ESM only
16
16
 
@@ -390,11 +390,14 @@ const active = await storage.query({
390
390
 
391
391
  ### iOS and Android (via Capacitor)
392
392
 
393
+ Strata ships as a Capacitor plugin (native iOS + Android). In a Capacitor app, after `yarn add strata-storage` run **`npx cap sync`** so the native module is copied into your iOS/Android projects — the native adapters (`secure`, `sqlite`, `preferences`, `filesystem`) won't work on-device without it.
394
+
393
395
  Register the native adapters you need when running under Capacitor. All four are zero-runtime-dependency: SQLite is hand-rolled (no plugin dependency) and filesystem uses the platform's native `FileManager` / `java.io.File`.
394
396
 
395
397
  ```typescript
396
398
  import { defineStorage } from 'strata-storage';
397
399
  import {
400
+ registerCapacitorAdapters,
398
401
  PreferencesAdapter,
399
402
  SecureAdapter,
400
403
  SqliteAdapter,
@@ -402,10 +405,15 @@ import {
402
405
  } from 'strata-storage/capacitor';
403
406
 
404
407
  const storage = defineStorage();
405
- storage.registerAdapter(new PreferencesAdapter()); // UserDefaults / SharedPreferences
406
- storage.registerAdapter(new SecureAdapter()); // Keychain / EncryptedSharedPreferences
407
- storage.registerAdapter(new SqliteAdapter()); // native SQLite
408
- storage.registerAdapter(new FilesystemAdapter()); // native files
408
+
409
+ // Easiest: register all native adapters at once (also refreshes the active set).
410
+ await registerCapacitorAdapters(storage);
411
+
412
+ // …or register individually for fine-grained control / custom adapter config:
413
+ // storage.registerAdapter(new PreferencesAdapter()); // UserDefaults / SharedPreferences
414
+ // storage.registerAdapter(new SecureAdapter()); // Keychain / EncryptedSharedPreferences
415
+ // storage.registerAdapter(new SqliteAdapter()); // native SQLite
416
+ // storage.registerAdapter(new FilesystemAdapter()); // native files
409
417
 
410
418
  await storage.set('secret', token, { storage: 'secure' });
411
419
  ```
@@ -478,24 +486,24 @@ Optional peer dependencies (install only the ones you use): `react >= 19.2.3`, `
478
486
 
479
487
  ## Documentation
480
488
 
481
- 📚 **Full documentation: [stratastorage-docs.aoneahsan.com](https://stratastorage-docs.aoneahsan.com)**
482
- 🤖 **For AI agents: [stratastorage-docs.aoneahsan.com/ai](https://stratastorage-docs.aoneahsan.com/ai)** (plus [`/llms.txt`](https://stratastorage-docs.aoneahsan.com/llms.txt) and [`/llms-full.txt`](https://stratastorage-docs.aoneahsan.com/llms-full.txt))
489
+ 📚 **Docs:** browse in-repo in [`./docs`](./docs/intro.md) · hosted at [stratastorage-docs.aoneahsan.com](https://stratastorage-docs.aoneahsan.com)
490
+ 🤖 **For AI agents:** [`AI-INTEGRATION-GUIDE.md`](./AI-INTEGRATION-GUIDE.md) · hosted [/ai](https://stratastorage-docs.aoneahsan.com/ai) · [`/llms.txt`](https://stratastorage-docs.aoneahsan.com/llms.txt)
483
491
 
484
492
  ### Getting Started
485
- - [Installation](https://stratastorage-docs.aoneahsan.com/installation) · [Quick Start](https://stratastorage-docs.aoneahsan.com/quick-start) · [Configuration](https://stratastorage-docs.aoneahsan.com/configuration)
493
+ - [Introduction](./docs/intro.md) · [Installation](./docs/installation.md) · [Quick Start](./docs/quick-start.md) · [Configuration](./docs/configuration.md)
486
494
 
487
495
  ### API
488
- - [API Reference](https://stratastorage-docs.aoneahsan.com/api) · [Core (`Strata`)](https://stratastorage-docs.aoneahsan.com/api/core/strata) · [Types](https://stratastorage-docs.aoneahsan.com/api/core/types) · [Errors](https://stratastorage-docs.aoneahsan.com/api/core/errors)
489
- - [All adapters](https://stratastorage-docs.aoneahsan.com/api/adapters) — web (localStorage, IndexedDB, cookies, Cache, URL, …) + Capacitor (Preferences, Secure, SQLite, Filesystem) + remote (Firebase)
496
+ - [API Reference](./docs/api/README.md) · [Core (`Strata`)](./docs/api/core/strata.md) · [Types](./docs/api/core/types.md) · [Errors](./docs/api/core/errors.md)
497
+ - [All adapters](./docs/api/adapters/README.md) — web (localStorage, IndexedDB, cookies, Cache, URL, …) + Capacitor (Preferences, Secure, SQLite, Filesystem) + remote (Firebase)
490
498
 
491
499
  ### Features
492
- - [Encryption](https://stratastorage-docs.aoneahsan.com/guides/features/encryption) · [Compression](https://stratastorage-docs.aoneahsan.com/guides/features/compression) · [TTL](https://stratastorage-docs.aoneahsan.com/api/features/ttl) · [Sync](https://stratastorage-docs.aoneahsan.com/guides/features/sync) · [Queries](https://stratastorage-docs.aoneahsan.com/guides/features/queries) · [Migrations](https://stratastorage-docs.aoneahsan.com/guides/features/migrations) · [Recovery & Integrity](https://stratastorage-docs.aoneahsan.com/api/features/recovery)
500
+ - [Encryption](./docs/guides/features/encryption.md) · [Compression](./docs/guides/features/compression.md) · [TTL](./docs/api/features/ttl.md) · [Sync](./docs/guides/features/sync.md) · [Queries](./docs/guides/features/queries.md) · [Migrations](./docs/guides/features/migrations.md) · [Recovery & Integrity](./docs/api/features/recovery.md)
493
501
 
494
502
  ### Platforms
495
- - [Web](https://stratastorage-docs.aoneahsan.com/guides/platforms/web) · [iOS](https://stratastorage-docs.aoneahsan.com/guides/platforms/ios) · [Android](https://stratastorage-docs.aoneahsan.com/guides/platforms/android) · [Capacitor](https://stratastorage-docs.aoneahsan.com/guides/platforms/capacitor) · [Firebase](https://stratastorage-docs.aoneahsan.com/guides/platforms/firebase)
503
+ - [Web](./docs/guides/platforms/web.md) · [iOS](./docs/guides/platforms/ios.md) · [Android](./docs/guides/platforms/android.md) · [Capacitor](./docs/guides/platforms/capacitor.md) · [Firebase](./docs/guides/platforms/firebase.md)
496
504
 
497
505
  ### Examples & Reference
498
- - [Examples](https://stratastorage-docs.aoneahsan.com/examples) · [Changelog](https://stratastorage-docs.aoneahsan.com/reference/changelog) · [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) · [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting) · [Migration](https://stratastorage-docs.aoneahsan.com/migration)
506
+ - [Examples](./docs/examples/README.md) · [Changelog](./docs/reference/changelog.md) · [FAQ](./docs/reference/faq.md) · [Troubleshooting](./docs/reference/troubleshooting.md) · [Migration](./docs/migration.md)
499
507
 
500
508
  ## Contributing
501
509
 
@@ -503,7 +511,7 @@ Contributions are welcome — please read the [Contributing Guide](./.github/CON
503
511
 
504
512
  ## License
505
513
 
506
- Apache License 2.0 — see [LICENSE](LICENSE). Free for commercial use, modification, and distribution with patent protection; attribution required; provided without warranty.
514
+ MIT License — see [LICENSE](LICENSE). Free for commercial and non-commercial use, modification, distribution, and sublicensing; the only condition is keeping the copyright and license notice; provided without warranty.
507
515
 
508
516
  ## Author
509
517
 
@@ -518,24 +526,18 @@ Apache License 2.0 — see [LICENSE](LICENSE). Free for commercial use, modifica
518
526
  ## Links
519
527
 
520
528
  - **NPM Package:** https://www.npmjs.com/package/strata-storage
529
+ - **GitHub Repo:** https://github.com/aoneahsan/strata-storage
521
530
  - **Documentation:** https://stratastorage-docs.aoneahsan.com
522
531
  - **Website:** https://stratastorage.aoneahsan.com
523
532
 
524
533
  ## Support
525
534
 
526
- 1. Check the [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) and [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting)
527
- 2. Browse the [documentation](https://stratastorage-docs.aoneahsan.com)
528
- 3. [Contact us / report an issue](https://stratastorage.aoneahsan.com/contact)
535
+ - 🐛 **Found a bug or have a feature request?** [Open a GitHub issue](https://github.com/aoneahsan/strata-storage/issues).
536
+ - 📖 Read the [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) and [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting), or browse the full [documentation](https://stratastorage-docs.aoneahsan.com).
537
+ - 💬 Anything else? [Contact us](https://stratastorage.aoneahsan.com/contact).
529
538
 
530
539
  ---
531
540
 
532
- Made by [Ahsan Mahmood](https://aoneahsan.com). **One API. Every Storage. Everywhere.**
533
-
534
- <!-- project-links:start -->
535
- ## Links
536
-
537
- - Live: https://www.npmjs.com/package/strata-storage
538
- - NPM: https://www.npmjs.com/package/strata-storage
541
+ Developed with ❤️ by the **Strata Storage Team** — maintained by [Ahsan Mahmood](https://aoneahsan.com) · aoneahsan@gmail.com.
539
542
 
540
- _URL source of truth: `01-code/projects/project-live-urls.json` (auto-generated — do not hand-edit between these markers)._
541
- <!-- project-links:end -->
543
+ **One API. Every Storage. Everywhere.**
package/dist/LICENSE CHANGED
@@ -1,35 +1,21 @@
1
- Copyright 2024 Ahsan Mahmood
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
-
15
- ================================================================================
16
-
17
- Full Apache License 2.0 text: https://www.apache.org/licenses/LICENSE-2.0.txt
18
-
19
- ================================================================================
20
-
21
- Additional Terms:
22
-
23
- 1. Attribution Requirement:
24
- You must retain all copyright notices and this license in any distribution.
25
-
26
- 2. Contribution Agreement:
27
- Any contributions submitted for inclusion shall be under the same license.
28
-
29
- 3. Name and Trademark:
30
- "Strata Storage" name may not be used for derivative works without permission.
31
-
32
- 4. Patent Grant:
33
- This license includes express patent grants from contributors.
34
-
35
- For the complete license terms and plain English explanation, see LICENSE.md
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 Ahsan Mahmood
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/README.md CHANGED
@@ -5,12 +5,12 @@
5
5
  - **[AI Integration Guide](./AI-INTEGRATION-GUIDE.md)** — quick reference for AI development agents (Claude Code, Cursor, Copilot).
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/strata-storage.svg)](https://www.npmjs.com/package/strata-storage)
8
- [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
8
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
9
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue.svg)](https://www.typescriptlang.org/)
10
10
  [![Platform](https://img.shields.io/badge/platform-Web%20%7C%20iOS%20%7C%20Android-lightgrey.svg)](https://stratastorage.aoneahsan.com)
11
11
 
12
- - **Version:** `2.7.1`
13
- - **License:** Apache-2.0
12
+ - **Version:** `2.8.0`
13
+ - **License:** MIT
14
14
  - **Node.js:** `>= 24.13.0`
15
15
  - **Module format:** ESM only
16
16
 
@@ -390,11 +390,14 @@ const active = await storage.query({
390
390
 
391
391
  ### iOS and Android (via Capacitor)
392
392
 
393
+ Strata ships as a Capacitor plugin (native iOS + Android). In a Capacitor app, after `yarn add strata-storage` run **`npx cap sync`** so the native module is copied into your iOS/Android projects — the native adapters (`secure`, `sqlite`, `preferences`, `filesystem`) won't work on-device without it.
394
+
393
395
  Register the native adapters you need when running under Capacitor. All four are zero-runtime-dependency: SQLite is hand-rolled (no plugin dependency) and filesystem uses the platform's native `FileManager` / `java.io.File`.
394
396
 
395
397
  ```typescript
396
398
  import { defineStorage } from 'strata-storage';
397
399
  import {
400
+ registerCapacitorAdapters,
398
401
  PreferencesAdapter,
399
402
  SecureAdapter,
400
403
  SqliteAdapter,
@@ -402,10 +405,15 @@ import {
402
405
  } from 'strata-storage/capacitor';
403
406
 
404
407
  const storage = defineStorage();
405
- storage.registerAdapter(new PreferencesAdapter()); // UserDefaults / SharedPreferences
406
- storage.registerAdapter(new SecureAdapter()); // Keychain / EncryptedSharedPreferences
407
- storage.registerAdapter(new SqliteAdapter()); // native SQLite
408
- storage.registerAdapter(new FilesystemAdapter()); // native files
408
+
409
+ // Easiest: register all native adapters at once (also refreshes the active set).
410
+ await registerCapacitorAdapters(storage);
411
+
412
+ // …or register individually for fine-grained control / custom adapter config:
413
+ // storage.registerAdapter(new PreferencesAdapter()); // UserDefaults / SharedPreferences
414
+ // storage.registerAdapter(new SecureAdapter()); // Keychain / EncryptedSharedPreferences
415
+ // storage.registerAdapter(new SqliteAdapter()); // native SQLite
416
+ // storage.registerAdapter(new FilesystemAdapter()); // native files
409
417
 
410
418
  await storage.set('secret', token, { storage: 'secure' });
411
419
  ```
@@ -478,24 +486,24 @@ Optional peer dependencies (install only the ones you use): `react >= 19.2.3`, `
478
486
 
479
487
  ## Documentation
480
488
 
481
- 📚 **Full documentation: [stratastorage-docs.aoneahsan.com](https://stratastorage-docs.aoneahsan.com)**
482
- 🤖 **For AI agents: [stratastorage-docs.aoneahsan.com/ai](https://stratastorage-docs.aoneahsan.com/ai)** (plus [`/llms.txt`](https://stratastorage-docs.aoneahsan.com/llms.txt) and [`/llms-full.txt`](https://stratastorage-docs.aoneahsan.com/llms-full.txt))
489
+ 📚 **Docs:** browse in-repo in [`./docs`](./docs/intro.md) · hosted at [stratastorage-docs.aoneahsan.com](https://stratastorage-docs.aoneahsan.com)
490
+ 🤖 **For AI agents:** [`AI-INTEGRATION-GUIDE.md`](./AI-INTEGRATION-GUIDE.md) · hosted [/ai](https://stratastorage-docs.aoneahsan.com/ai) · [`/llms.txt`](https://stratastorage-docs.aoneahsan.com/llms.txt)
483
491
 
484
492
  ### Getting Started
485
- - [Installation](https://stratastorage-docs.aoneahsan.com/installation) · [Quick Start](https://stratastorage-docs.aoneahsan.com/quick-start) · [Configuration](https://stratastorage-docs.aoneahsan.com/configuration)
493
+ - [Introduction](./docs/intro.md) · [Installation](./docs/installation.md) · [Quick Start](./docs/quick-start.md) · [Configuration](./docs/configuration.md)
486
494
 
487
495
  ### API
488
- - [API Reference](https://stratastorage-docs.aoneahsan.com/api) · [Core (`Strata`)](https://stratastorage-docs.aoneahsan.com/api/core/strata) · [Types](https://stratastorage-docs.aoneahsan.com/api/core/types) · [Errors](https://stratastorage-docs.aoneahsan.com/api/core/errors)
489
- - [All adapters](https://stratastorage-docs.aoneahsan.com/api/adapters) — web (localStorage, IndexedDB, cookies, Cache, URL, …) + Capacitor (Preferences, Secure, SQLite, Filesystem) + remote (Firebase)
496
+ - [API Reference](./docs/api/README.md) · [Core (`Strata`)](./docs/api/core/strata.md) · [Types](./docs/api/core/types.md) · [Errors](./docs/api/core/errors.md)
497
+ - [All adapters](./docs/api/adapters/README.md) — web (localStorage, IndexedDB, cookies, Cache, URL, …) + Capacitor (Preferences, Secure, SQLite, Filesystem) + remote (Firebase)
490
498
 
491
499
  ### Features
492
- - [Encryption](https://stratastorage-docs.aoneahsan.com/guides/features/encryption) · [Compression](https://stratastorage-docs.aoneahsan.com/guides/features/compression) · [TTL](https://stratastorage-docs.aoneahsan.com/api/features/ttl) · [Sync](https://stratastorage-docs.aoneahsan.com/guides/features/sync) · [Queries](https://stratastorage-docs.aoneahsan.com/guides/features/queries) · [Migrations](https://stratastorage-docs.aoneahsan.com/guides/features/migrations) · [Recovery & Integrity](https://stratastorage-docs.aoneahsan.com/api/features/recovery)
500
+ - [Encryption](./docs/guides/features/encryption.md) · [Compression](./docs/guides/features/compression.md) · [TTL](./docs/api/features/ttl.md) · [Sync](./docs/guides/features/sync.md) · [Queries](./docs/guides/features/queries.md) · [Migrations](./docs/guides/features/migrations.md) · [Recovery & Integrity](./docs/api/features/recovery.md)
493
501
 
494
502
  ### Platforms
495
- - [Web](https://stratastorage-docs.aoneahsan.com/guides/platforms/web) · [iOS](https://stratastorage-docs.aoneahsan.com/guides/platforms/ios) · [Android](https://stratastorage-docs.aoneahsan.com/guides/platforms/android) · [Capacitor](https://stratastorage-docs.aoneahsan.com/guides/platforms/capacitor) · [Firebase](https://stratastorage-docs.aoneahsan.com/guides/platforms/firebase)
503
+ - [Web](./docs/guides/platforms/web.md) · [iOS](./docs/guides/platforms/ios.md) · [Android](./docs/guides/platforms/android.md) · [Capacitor](./docs/guides/platforms/capacitor.md) · [Firebase](./docs/guides/platforms/firebase.md)
496
504
 
497
505
  ### Examples & Reference
498
- - [Examples](https://stratastorage-docs.aoneahsan.com/examples) · [Changelog](https://stratastorage-docs.aoneahsan.com/reference/changelog) · [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) · [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting) · [Migration](https://stratastorage-docs.aoneahsan.com/migration)
506
+ - [Examples](./docs/examples/README.md) · [Changelog](./docs/reference/changelog.md) · [FAQ](./docs/reference/faq.md) · [Troubleshooting](./docs/reference/troubleshooting.md) · [Migration](./docs/migration.md)
499
507
 
500
508
  ## Contributing
501
509
 
@@ -503,7 +511,7 @@ Contributions are welcome — please read the [Contributing Guide](./.github/CON
503
511
 
504
512
  ## License
505
513
 
506
- Apache License 2.0 — see [LICENSE](LICENSE). Free for commercial use, modification, and distribution with patent protection; attribution required; provided without warranty.
514
+ MIT License — see [LICENSE](LICENSE). Free for commercial and non-commercial use, modification, distribution, and sublicensing; the only condition is keeping the copyright and license notice; provided without warranty.
507
515
 
508
516
  ## Author
509
517
 
@@ -518,24 +526,18 @@ Apache License 2.0 — see [LICENSE](LICENSE). Free for commercial use, modifica
518
526
  ## Links
519
527
 
520
528
  - **NPM Package:** https://www.npmjs.com/package/strata-storage
529
+ - **GitHub Repo:** https://github.com/aoneahsan/strata-storage
521
530
  - **Documentation:** https://stratastorage-docs.aoneahsan.com
522
531
  - **Website:** https://stratastorage.aoneahsan.com
523
532
 
524
533
  ## Support
525
534
 
526
- 1. Check the [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) and [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting)
527
- 2. Browse the [documentation](https://stratastorage-docs.aoneahsan.com)
528
- 3. [Contact us / report an issue](https://stratastorage.aoneahsan.com/contact)
535
+ - 🐛 **Found a bug or have a feature request?** [Open a GitHub issue](https://github.com/aoneahsan/strata-storage/issues).
536
+ - 📖 Read the [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) and [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting), or browse the full [documentation](https://stratastorage-docs.aoneahsan.com).
537
+ - 💬 Anything else? [Contact us](https://stratastorage.aoneahsan.com/contact).
529
538
 
530
539
  ---
531
540
 
532
- Made by [Ahsan Mahmood](https://aoneahsan.com). **One API. Every Storage. Everywhere.**
533
-
534
- <!-- project-links:start -->
535
- ## Links
536
-
537
- - Live: https://www.npmjs.com/package/strata-storage
538
- - NPM: https://www.npmjs.com/package/strata-storage
541
+ Developed with ❤️ by the **Strata Storage Team** — maintained by [Ahsan Mahmood](https://aoneahsan.com) · aoneahsan@gmail.com.
539
542
 
540
- _URL source of truth: `01-code/projects/project-live-urls.json` (auto-generated — do not hand-edit between these markers)._
541
- <!-- project-links:end -->
543
+ **One API. Every Storage. Everywhere.**
@@ -43,4 +43,3 @@ export declare class FilesystemAdapter extends BaseAdapter {
43
43
  */
44
44
  size(detailed?: boolean): Promise<SizeInfo>;
45
45
  }
46
- //# sourceMappingURL=FilesystemAdapter.d.ts.map
@@ -43,4 +43,3 @@ export declare class PreferencesAdapter extends BaseAdapter {
43
43
  */
44
44
  size(detailed?: boolean): Promise<SizeInfo>;
45
45
  }
46
- //# sourceMappingURL=PreferencesAdapter.d.ts.map
@@ -66,4 +66,3 @@ export declare class SecureAdapter extends BaseAdapter {
66
66
  */
67
67
  getEncryptedPreference(key: string, fileName?: string): Promise<unknown>;
68
68
  }
69
- //# sourceMappingURL=SecureAdapter.d.ts.map
@@ -86,4 +86,3 @@ export declare class SqliteAdapter extends BaseAdapter {
86
86
  */
87
87
  transaction(): Promise<Transaction>;
88
88
  }
89
- //# sourceMappingURL=SqliteAdapter.d.ts.map
@@ -6,4 +6,3 @@ export { PreferencesAdapter } from "./PreferencesAdapter.js";
6
6
  export { SqliteAdapter } from "./SqliteAdapter.js";
7
7
  export { SecureAdapter } from "./SecureAdapter.js";
8
8
  export { FilesystemAdapter } from "./FilesystemAdapter.js";
9
- //# sourceMappingURL=index.d.ts.map
@@ -88,4 +88,3 @@ export declare class CacheAdapter extends BaseAdapter {
88
88
  */
89
89
  private isQuotaError;
90
90
  }
91
- //# sourceMappingURL=CacheAdapter.d.ts.map
@@ -110,4 +110,3 @@ export declare class CookieAdapter extends BaseAdapter {
110
110
  private getAllCookies;
111
111
  }
112
112
  export {};
113
- //# sourceMappingURL=CookieAdapter.d.ts.map
@@ -82,4 +82,3 @@ export declare class IndexedDBAdapter extends BaseAdapter {
82
82
  */
83
83
  private isQuotaError;
84
84
  }
85
- //# sourceMappingURL=IndexedDBAdapter.d.ts.map
@@ -91,4 +91,3 @@ export declare class LocalStorageAdapter extends BaseAdapter {
91
91
  */
92
92
  protected isQuotaError(error: unknown): boolean;
93
93
  }
94
- //# sourceMappingURL=LocalStorageAdapter.d.ts.map
@@ -97,4 +97,3 @@ export declare class MemoryAdapter extends BaseAdapter {
97
97
  */
98
98
  close(): Promise<void>;
99
99
  }
100
- //# sourceMappingURL=MemoryAdapter.d.ts.map
@@ -74,4 +74,3 @@ export declare class SessionStorageAdapter extends LocalStorageAdapter {
74
74
  */
75
75
  subscribe(callback: import("../../types/index.js").SubscriptionCallback): import("../../types/index.js").UnsubscribeFunction;
76
76
  }
77
- //# sourceMappingURL=SessionStorageAdapter.d.ts.map
@@ -56,4 +56,3 @@ export declare class URLAdapter extends BaseAdapter {
56
56
  private snapshotParams;
57
57
  private handleExternalChange;
58
58
  }
59
- //# sourceMappingURL=URLAdapter.d.ts.map
@@ -8,4 +8,3 @@ export { IndexedDBAdapter } from "./IndexedDBAdapter.js";
8
8
  export { CookieAdapter } from "./CookieAdapter.js";
9
9
  export { CacheAdapter } from "./CacheAdapter.js";
10
10
  export { URLAdapter, type URLAdapterConfig } from "./URLAdapter.js";
11
- //# sourceMappingURL=index.d.ts.map
@@ -17,4 +17,3 @@ export declare function isCapacitorEnvironment(): boolean;
17
17
  * Get Capacitor-specific storage types
18
18
  */
19
19
  export declare function getCapacitorStorageTypes(): string[];
20
- //# sourceMappingURL=capacitor.d.ts.map
@@ -7,4 +7,3 @@ export declare const SUPPORT_CONFIG: {
7
7
  readonly label: "Support the Project";
8
8
  readonly description: "Help us keep strata-storage free and improving";
9
9
  };
10
- //# sourceMappingURL=support.d.ts.map
@@ -49,4 +49,3 @@ export declare class AdapterRegistry {
49
49
  */
50
50
  closeAll(): Promise<void>;
51
51
  }
52
- //# sourceMappingURL=AdapterRegistry.d.ts.map
@@ -100,4 +100,3 @@ export declare abstract class BaseAdapter implements StorageAdapter {
100
100
  abstract remove(key: string): Promise<void>;
101
101
  abstract keys(pattern?: string | RegExp): Promise<string[]>;
102
102
  }
103
- //# sourceMappingURL=BaseAdapter.d.ts.map
@@ -375,4 +375,3 @@ export declare class Strata {
375
375
  private startAutoBackup;
376
376
  private selectAdapter;
377
377
  }
378
- //# sourceMappingURL=Strata.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from "../compression.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -81,4 +81,3 @@ export declare class CompressionManager {
81
81
  */
82
82
  getSavingsPercentage(compressedData: CompressedData): number;
83
83
  }
84
- //# sourceMappingURL=compression.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from "../encryption.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -118,4 +118,3 @@ export declare class EncryptionManager {
118
118
  */
119
119
  hash(data: string): Promise<string>;
120
120
  }
121
- //# sourceMappingURL=encryption.d.ts.map
@@ -13,4 +13,3 @@ export declare function computeChecksum(value: unknown): string;
13
13
  * stored (nothing to verify) so this is safe to call unconditionally.
14
14
  */
15
15
  export declare function verifyChecksum(value: unknown, expected: string | undefined): boolean;
16
- //# sourceMappingURL=integrity.d.ts.map
@@ -14,4 +14,3 @@ export declare class MigrationManager {
14
14
  private getCurrentVersion;
15
15
  private setVersion;
16
16
  }
17
- //# sourceMappingURL=migration.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from "../observer.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -17,4 +17,3 @@ export declare class StorageObserver {
17
17
  */
18
18
  clear(): void;
19
19
  }
20
- //# sourceMappingURL=observer.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from "../query.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -79,4 +79,3 @@ export declare class QueryEngine {
79
79
  * Create a query engine instance
80
80
  */
81
81
  export declare function createQueryEngine(): QueryEngine;
82
- //# sourceMappingURL=query.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from "../sync.js";
2
- //# sourceMappingURL=index.d.ts.map