From 49b0506f9a89567c42000844bc371e416c03e4b6 Mon Sep 17 00:00:00 2001 From: scriptPilot Date: Sun, 3 Mar 2024 23:52:09 +0100 Subject: [PATCH 1/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a8ed519..8a2134d 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ Based on the installation path above. ```js import { db } from './store' + db.tasks.add({ title: 'New Task' }).then( db.tasks.where('$deleted').notEqual(1).reverse().sortBy('$created').then(console.log) ) From 2838bbcb4e78f0e43f2b2d5d01af23f7d8d4d3db Mon Sep 17 00:00:00 2001 From: scriptPilot Date: Sun, 3 Mar 2024 23:53:41 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8a2134d..6b24dea 100644 --- a/README.md +++ b/README.md @@ -95,10 +95,15 @@ Based on the installation path above. ```js import { db } from './store' - - db.tasks.add({ title: 'New Task' }).then( - db.tasks.where('$deleted').notEqual(1).reverse().sortBy('$created').then(console.log) - ) + + db.tasks + .add({ title: 'New Task' }) + .then( + db.tasks + .where('$deleted').notEqual(1) + .reverse().sortBy('$created') + .then(console.log) + ) ``` Run `npm run dev`, open http://localhost:5173 and see how the task list is logged to the console. From 9f571e14b2d55a6a0e44febe05ec9a6b6ee237ec Mon Sep 17 00:00:00 2001 From: scriptPilot Date: Sun, 3 Mar 2024 23:56:34 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6b24dea..c82abfe 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,9 @@ const sync = new Sync() ## Function Details -### sync.add(table, path, options) +### Synchronization + +#### sync.add(table, path, options) Starts the synchronization to and from remote. Multiple browser windows are supported. @@ -151,37 +153,41 @@ A local table can be synchronized with only one remote table. A remote table can be synchronized with one or more local tables. -### sync.emptyTable(table) +#### sync.emptyTable(table) Removes all records from a local table without synchronizing them as deleted to the server. - `table`: [Dexie.js Table](https://dexie.org/docs/Dexie/Dexie.%5Btable%5D) -### sync.reset() +#### sync.reset() Resets all synchronizations. All local and remote documents are synchronized again. - `database`: [Dexie.js Database](https://dexie.org/docs/Dexie/Dexie) -### sync.register(username, password) +### Authentication + +See: [Database Authentication Documentation](https://github.com/mevdschee/php-crud-api?tab=readme-ov-file#database-authentication) for the PHP CRUD API + +#### sync.register(username, password) Creates a new user. -### sync.login(username, password) +#### sync.login(username, password) Logs the user in, clears all local tables and resets the synchronization. -### sync.password(username, password, newPassword) +#### sync.password(username, password, newPassword) Updates the password of the user. -### sync.user(callback) +#### sync.user(callback) Returns the use details or null. - `callback`: `` *optional*, callback on any user change with user details or null -### sync.logout() +#### sync.logout() Logs the user out, clears all local tables and resets the synchronization. From df43ab65dfcd873f361fa28fdd54e992709a44c0 Mon Sep 17 00:00:00 2001 From: scriptPilot Date: Sun, 3 Mar 2024 23:57:32 +0100 Subject: [PATCH 4/4] 5.0.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13b500e..c75cb69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dexie-mysql-sync", - "version": "5.0.1", + "version": "5.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dexie-mysql-sync", - "version": "5.0.1", + "version": "5.0.2", "license": "MIT", "dependencies": { "js-crud-api": "^0.4.0", diff --git a/package.json b/package.json index 13ad05e..9ecb491 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dexie-mysql-sync", - "version": "5.0.1", + "version": "5.0.2", "description": "", "main": "lib/index.js", "type": "module",