mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-12 07:14:23 +00:00
Upgrading to Realm Sync 3.0.0-rc.2 (#1706)
* Adding role to __User. * Update to Realm Sync 3.0.0 * Renamed defaultSyncConfiguration to automaticSyncConfiguration
This commit is contained in:
parent
edfdd933b0
commit
9435490ea3
@ -26,7 +26,7 @@
|
|||||||
- For non-synced Realms, all privileges are always granted.
|
- For non-synced Realms, all privileges are always granted.
|
||||||
- For more details, please read the reference documentation.
|
- For more details, please read the reference documentation.
|
||||||
* [Sync] Revoke refresh token upon logout (#1354).
|
* [Sync] Revoke refresh token upon logout (#1354).
|
||||||
* Added `Realm.defaultSyncConfiguration()` which will return the configuration for a default synced Realm (#1688).
|
* Added `Realm.automaticSyncConfiguration()` which will return the configuration for a default synced Realm (#1688).
|
||||||
* [Sync] Deprecated `Realm.Sync.setFeatureToken` (#1689).
|
* [Sync] Deprecated `Realm.Sync.setFeatureToken` (#1689).
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
### Internal
|
### Internal
|
||||||
* Updated to Realm Core 5.4.0.
|
* Updated to Realm Core 5.4.0.
|
||||||
* Updated to Realm Sync 3.0.0-rc.1.
|
* Updated to Realm Sync 3.0.0.
|
||||||
* Tested against Realm Object Server 3.0.0-alpha.8.
|
* Tested against Realm Object Server 3.0.0-alpha.8.
|
||||||
* Added `_disablePartialSyncUrlChecks` to `Realm.Configuration`.
|
* Added `_disablePartialSyncUrlChecks` to `Realm.Configuration`.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
PACKAGE_NAME=realm-js
|
PACKAGE_NAME=realm-js
|
||||||
VERSION=2.3.0-beta.3
|
VERSION=2.3.0-beta.3
|
||||||
REALM_CORE_VERSION=5.4.0
|
REALM_CORE_VERSION=5.4.0
|
||||||
REALM_SYNC_VERSION=3.0.0-rc.1
|
REALM_SYNC_VERSION=3.0.0
|
||||||
REALM_OBJECT_SERVER_VERSION=3.0.0-alpha.8
|
REALM_OBJECT_SERVER_VERSION=3.0.0-alpha.8
|
@ -126,7 +126,7 @@ class Realm {
|
|||||||
* @returns {Realm~Configuration} - a configuration matching a default synced Realm.
|
* @returns {Realm~Configuration} - a configuration matching a default synced Realm.
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
*/
|
*/
|
||||||
static defaultSyncConfiguration() {}
|
static automaticSyncConfiguration() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes this Realm so it may be re-opened with a newer schema version.
|
* Closes this Realm so it may be re-opened with a newer schema version.
|
||||||
|
@ -152,7 +152,7 @@ module.exports = function(realmConstructor) {
|
|||||||
setConstructorOnPrototype(realmConstructor.Sync.Session);
|
setConstructorOnPrototype(realmConstructor.Sync.Session);
|
||||||
|
|
||||||
// A configuration for a default Realm
|
// A configuration for a default Realm
|
||||||
realmConstructor.defaultSyncConfiguration = function() {
|
realmConstructor.automaticSyncConfiguration = function() {
|
||||||
let users = this.Sync.User.all;
|
let users = this.Sync.User.all;
|
||||||
let identities = Object.keys(users);
|
let identities = Object.keys(users);
|
||||||
if (identities.length === 1) {
|
if (identities.length === 1) {
|
||||||
@ -215,7 +215,8 @@ module.exports = function(realmConstructor) {
|
|||||||
name: '__User',
|
name: '__User',
|
||||||
primaryKey: 'id',
|
primaryKey: 'id',
|
||||||
properties: {
|
properties: {
|
||||||
id: 'string'
|
id: 'string',
|
||||||
|
role: '__Role'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
lib/index.d.ts
vendored
2
lib/index.d.ts
vendored
@ -569,7 +569,7 @@ declare class Realm {
|
|||||||
/**
|
/**
|
||||||
* Return a configuration for a default Realm.
|
* Return a configuration for a default Realm.
|
||||||
*/
|
*/
|
||||||
static defaultSyncConfiguration(): string;
|
static automaticSyncConfiguration(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the Realm file for the given configuration.
|
* Delete the Realm file for the given configuration.
|
||||||
|
@ -180,7 +180,7 @@ module.exports = {
|
|||||||
.then(() => Realm.Sync.User.login('http://localhost:9080', username, 'password'))
|
.then(() => Realm.Sync.User.login('http://localhost:9080', username, 'password'))
|
||||||
.then(u => {
|
.then(u => {
|
||||||
user = u;
|
user = u;
|
||||||
return Realm.open(Realm.defaultSyncConfiguration());
|
return Realm.open(Realm.automaticSyncConfiguration());
|
||||||
})
|
})
|
||||||
.then(realm => {
|
.then(realm => {
|
||||||
let actualObjectsCount = realm.objects('Dog').length;
|
let actualObjectsCount = realm.objects('Dog').length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user