Deprecated setFeatureToken(). (#1694)

This commit is contained in:
Kenneth Geisshirt 2018-03-08 17:27:13 +01:00 committed by GitHub
parent 1066722a09
commit dfc6aea6a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -23,6 +23,7 @@
- Method `Realm.privilges()` to compute privileges on a Realm, a Realm object schema, or a Realm object. The method returns either a `Realm.Permissions.Realm` or `Realm.Permissions.Class` object. - Method `Realm.privilges()` to compute privileges on a Realm, a Realm object schema, or a Realm object. The method returns either a `Realm.Permissions.Realm` or `Realm.Permissions.Class` object.
- 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] Decrepated `Realm.Sync.setFeatureToken` (#1689).
### Internal ### Internal
* Updated to Realm Core 5.3.0. * Updated to Realm Core 5.3.0.

View File

@ -151,11 +151,7 @@ module.exports = function(realmConstructor) {
if (realmConstructor.Sync._setFeatureToken) { if (realmConstructor.Sync._setFeatureToken) {
realmConstructor.Sync.setFeatureToken = function(featureToken) { realmConstructor.Sync.setFeatureToken = function(featureToken) {
if (typeof featureToken !== 'string' && !(featureToken instanceof String)) { console.log('Realm.Sync.setFeatureToken() is deprecated and you can remove any calls to it.');
throw new Error("featureToken should be a string");
}
realmConstructor.Sync._setFeatureToken(featureToken.trim());
} }
} }

4
lib/index.d.ts vendored
View File

@ -448,6 +448,10 @@ declare namespace Realm.Sync {
function removeListener(regex: string, name: string, changeCallback: (changeEvent: ChangeEvent) => void): Promise<void>; function removeListener(regex: string, name: string, changeCallback: (changeEvent: ChangeEvent) => void): Promise<void>;
function setLogLevel(logLevel: 'all' | 'trace' | 'debug' | 'detail' | 'info' | 'warn' | 'error' | 'fatal' | 'off'): void; function setLogLevel(logLevel: 'all' | 'trace' | 'debug' | 'detail' | 'info' | 'warn' | 'error' | 'fatal' | 'off'): void;
function initiateClientReset(path: string): void; function initiateClientReset(path: string): void;
/**
* @deprecated, to be removed in future versions
*/
function setFeatureToken(token: string): void; function setFeatureToken(token: string): void;
type Instruction = { type Instruction = {