sqlite-cloud-backup 0.1.0 → 0.1.3

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 (3) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +24 -21
  3. package/package.json +7 -3
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 1291pravin
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 1291pravin
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
@@ -204,27 +204,6 @@ app.on('ready', async () => {
204
204
  });
205
205
  ```
206
206
 
207
- ### React Native
208
-
209
- ```typescript
210
- import SqliteCloudBackup from 'sqlite-cloud-backup';
211
- import RNFS from 'react-native-fs';
212
-
213
- const dbPath = `${RNFS.DocumentDirectoryPath}/app.db`;
214
- const sync = new SqliteCloudBackup({
215
- dbPath,
216
- provider: 'google-drive',
217
- credentials: { /* ... */ }
218
- });
219
-
220
- // Sync when app comes to foreground
221
- AppState.addEventListener('change', async (state) => {
222
- if (state === 'active') {
223
- await sync.sync();
224
- }
225
- });
226
- ```
227
-
228
207
  ### CLI Tools
229
208
 
230
209
  ```typescript
@@ -252,6 +231,30 @@ await sync.pushToCloud();
252
231
  **Coming in v0.2+:**
253
232
  - ⏳ Additional providers (Dropbox, S3)
254
233
 
234
+ ## Important Limitations
235
+
236
+ ### Single-Device Use Only
237
+
238
+ This library is designed for **single-device backup scenarios**. The sync logic uses timestamps to determine whether to push or pull, which works reliably when only one device accesses the cloud backup.
239
+
240
+ **Not supported:**
241
+ - Multiple devices syncing to the same cloud folder simultaneously
242
+ - Real-time collaboration or multi-user scenarios
243
+ - Conflict resolution between concurrent modifications
244
+
245
+ If you need multi-device sync, consider a full database sync solution like [PowerSync](https://www.powersync.com/), [ElectricSQL](https://electric-sql.com/), or a traditional backend database.
246
+
247
+ ### Security Note for Distributed Apps
248
+
249
+ If you're distributing an Electron app or CLI tool, be aware that OAuth client secrets embedded in your application can be extracted by users. For desktop applications, Google recommends:
250
+
251
+ 1. **Use a public OAuth client** (no secret required) with PKCE flow
252
+ 2. **Or** accept that the secret is not truly secret in distributed apps
253
+
254
+ The client secret primarily protects against other developers impersonating your app, not end-users. Your users' data remains protected by their own OAuth consent.
255
+
256
+ For server-side applications where the secret stays on your server, this is not a concern.
257
+
255
258
  ## Requirements
256
259
 
257
260
  - Node.js 18+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sqlite-cloud-backup",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Lightweight SQLite database synchronization to Google Drive with zero vendor lock-in",
6
6
  "main": "./dist/index.cjs",
@@ -25,7 +25,10 @@
25
25
  "typecheck": "tsc --noEmit",
26
26
  "lint": "eslint src --ext .ts",
27
27
  "lint:fix": "eslint src --ext .ts --fix",
28
- "prepare": "npm run build"
28
+ "prepare": "npm run build",
29
+ "publish:patch": "node scripts/publish.js patch",
30
+ "publish:minor": "node scripts/publish.js minor",
31
+ "publish:major": "node scripts/publish.js major"
29
32
  },
30
33
  "keywords": [
31
34
  "sqlite",
@@ -36,7 +39,8 @@
36
39
  "database",
37
40
  "offline-first",
38
41
  "electron",
39
- "react-native"
42
+ "nodejs",
43
+ "cli"
40
44
  ],
41
45
  "author": "1291pravin",
42
46
  "license": "MIT",