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.
- package/AI-INTEGRATION-GUIDE.md +25 -5
- package/LICENSE +21 -35
- package/README.md +30 -28
- package/dist/LICENSE +21 -35
- package/dist/README.md +30 -28
- package/dist/adapters/capacitor/FilesystemAdapter.d.ts +0 -1
- package/dist/adapters/capacitor/PreferencesAdapter.d.ts +0 -1
- package/dist/adapters/capacitor/SecureAdapter.d.ts +0 -1
- package/dist/adapters/capacitor/SqliteAdapter.d.ts +0 -1
- package/dist/adapters/capacitor/index.d.ts +0 -1
- package/dist/adapters/web/CacheAdapter.d.ts +0 -1
- package/dist/adapters/web/CookieAdapter.d.ts +0 -1
- package/dist/adapters/web/IndexedDBAdapter.d.ts +0 -1
- package/dist/adapters/web/LocalStorageAdapter.d.ts +0 -1
- package/dist/adapters/web/MemoryAdapter.d.ts +0 -1
- package/dist/adapters/web/SessionStorageAdapter.d.ts +0 -1
- package/dist/adapters/web/URLAdapter.d.ts +0 -1
- package/dist/adapters/web/index.d.ts +0 -1
- package/dist/capacitor.d.ts +0 -1
- package/dist/config/support.d.ts +0 -1
- package/dist/core/AdapterRegistry.d.ts +0 -1
- package/dist/core/BaseAdapter.d.ts +0 -1
- package/dist/core/Strata.d.ts +0 -1
- package/dist/features/compression/index.d.ts +0 -1
- package/dist/features/compression.d.ts +0 -1
- package/dist/features/encryption/index.d.ts +0 -1
- package/dist/features/encryption.d.ts +0 -1
- package/dist/features/integrity.d.ts +0 -1
- package/dist/features/migration.d.ts +0 -1
- package/dist/features/observer/index.d.ts +0 -1
- package/dist/features/observer.d.ts +0 -1
- package/dist/features/query/index.d.ts +0 -1
- package/dist/features/query.d.ts +0 -1
- package/dist/features/sync/index.d.ts +0 -1
- package/dist/features/sync.d.ts +0 -1
- package/dist/features/ttl/index.d.ts +0 -1
- package/dist/features/ttl.d.ts +0 -1
- package/dist/firebase.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/integrations/angular/index.d.ts +0 -1
- package/dist/integrations/index.d.ts +0 -1
- package/dist/integrations/react/index.d.ts +0 -1
- package/dist/integrations/vue/index.d.ts +0 -1
- package/dist/package.json +9 -4
- package/dist/plugin/definitions.d.ts +0 -1
- package/dist/plugin/index.d.ts +0 -1
- package/dist/plugin/web.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/utils/errors.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/logger.d.ts +0 -1
- package/package.json +15 -5
- package/android/AGENTS.md +0 -66
- package/android/CLAUDE.md +0 -122
- package/dist/adapters/capacitor/FilesystemAdapter.d.ts.map +0 -1
- package/dist/adapters/capacitor/PreferencesAdapter.d.ts.map +0 -1
- package/dist/adapters/capacitor/SecureAdapter.d.ts.map +0 -1
- package/dist/adapters/capacitor/SqliteAdapter.d.ts.map +0 -1
- package/dist/adapters/capacitor/index.d.ts.map +0 -1
- package/dist/adapters/web/CacheAdapter.d.ts.map +0 -1
- package/dist/adapters/web/CookieAdapter.d.ts.map +0 -1
- package/dist/adapters/web/IndexedDBAdapter.d.ts.map +0 -1
- package/dist/adapters/web/LocalStorageAdapter.d.ts.map +0 -1
- package/dist/adapters/web/MemoryAdapter.d.ts.map +0 -1
- package/dist/adapters/web/SessionStorageAdapter.d.ts.map +0 -1
- package/dist/adapters/web/URLAdapter.d.ts.map +0 -1
- package/dist/adapters/web/index.d.ts.map +0 -1
- package/dist/capacitor.d.ts.map +0 -1
- package/dist/config/support.d.ts.map +0 -1
- package/dist/core/AdapterRegistry.d.ts.map +0 -1
- package/dist/core/BaseAdapter.d.ts.map +0 -1
- package/dist/core/Strata.d.ts.map +0 -1
- package/dist/features/compression/index.d.ts.map +0 -1
- package/dist/features/compression.d.ts.map +0 -1
- package/dist/features/encryption/index.d.ts.map +0 -1
- package/dist/features/encryption.d.ts.map +0 -1
- package/dist/features/integrity.d.ts.map +0 -1
- package/dist/features/migration.d.ts.map +0 -1
- package/dist/features/observer/index.d.ts.map +0 -1
- package/dist/features/observer.d.ts.map +0 -1
- package/dist/features/query/index.d.ts.map +0 -1
- package/dist/features/query.d.ts.map +0 -1
- package/dist/features/sync/index.d.ts.map +0 -1
- package/dist/features/sync.d.ts.map +0 -1
- package/dist/features/ttl/index.d.ts.map +0 -1
- package/dist/features/ttl.d.ts.map +0 -1
- package/dist/firebase.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/integrations/angular/index.d.ts.map +0 -1
- package/dist/integrations/index.d.ts.map +0 -1
- package/dist/integrations/react/index.d.ts.map +0 -1
- package/dist/integrations/vue/index.d.ts.map +0 -1
- package/dist/plugin/definitions.d.ts.map +0 -1
- package/dist/plugin/index.d.ts.map +0 -1
- package/dist/plugin/web.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/ios/AGENTS.md +0 -59
- package/ios/CLAUDE.md +0 -106
package/AI-INTEGRATION-GUIDE.md
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
[](https://www.npmjs.com/package/strata-storage)
|
|
8
|
-
[](LICENSE)
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
10
|
[](https://stratastorage.aoneahsan.com)
|
|
11
11
|
|
|
12
|
-
- **Version:** `2.
|
|
13
|
-
- **License:**
|
|
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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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
|
-
📚 **
|
|
482
|
-
🤖 **For AI agents
|
|
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](
|
|
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](
|
|
489
|
-
- [All adapters](
|
|
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](
|
|
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](
|
|
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](
|
|
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
|
-
|
|
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
|
-
|
|
527
|
-
|
|
528
|
-
|
|
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
|
-
|
|
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
|
-
|
|
541
|
-
<!-- project-links:end -->
|
|
543
|
+
**One API. Every Storage. Everywhere.**
|
package/dist/LICENSE
CHANGED
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
[](https://www.npmjs.com/package/strata-storage)
|
|
8
|
-
[](LICENSE)
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
10
|
[](https://stratastorage.aoneahsan.com)
|
|
11
11
|
|
|
12
|
-
- **Version:** `2.
|
|
13
|
-
- **License:**
|
|
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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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
|
-
📚 **
|
|
482
|
-
🤖 **For AI agents
|
|
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](
|
|
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](
|
|
489
|
-
- [All adapters](
|
|
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](
|
|
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](
|
|
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](
|
|
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
|
-
|
|
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
|
-
|
|
527
|
-
|
|
528
|
-
|
|
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
|
-
|
|
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
|
-
|
|
541
|
-
<!-- project-links:end -->
|
|
543
|
+
**One API. Every Storage. Everywhere.**
|
package/dist/capacitor.d.ts
CHANGED
package/dist/config/support.d.ts
CHANGED
package/dist/core/Strata.d.ts
CHANGED
|
@@ -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
|
package/dist/features/query.d.ts
CHANGED