[v0.3.0] Automated synchronization and conflict resolution with GitHub
Features
-
Added sync methods to GitDocumentDB
- sync(remoteURL, options) Synchronize with a remote repository
- getSynchronizer(remoteURL)
- getRemoteURLs()
- unregisterRemote(remoteURL)
-
Added Sync Class
- on(event, callback) Add SyncEvent handler
- off(event, callback) Remove SyncEvent handler
- pause() Pause synchronization
- resume(options) Resume synchronization
- tryPush(options) Try to push with retries
- trySync() Try to sync with retries
-
You can find examples in examples/src/sync.ts
-
Added revisions (Get back number of documents)
- get(docId, backNumber)
- getByRevision(fileSHA) Get a specific revision of a document
- getDocHistory(docID) Get revision history of a file from new to old
- getDocWithMetaData(docId, backNumber) Get a document with metadata(file_sha)
-
Added operational transformation for merging documents
-
Added insert() method to create a document if not exists.
-
Added update() method to update a document if exists.
Breaking changes
- get() and getByRevision() return undefined instead of throwing error.
- Renamed create() to createDB()
- Renamed statistics() to currentStatistics()