From 7026af0e4a710f2d1b54eb8665328a7694abb689 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 21 Dec 2017 13:25:24 +0100 Subject: [PATCH] Updating jsdoc and ts definitions --- docs/sync.js | 11 +++++++++++ lib/index.d.ts | 1 + 2 files changed, 12 insertions(+) diff --git a/docs/sync.js b/docs/sync.js index d14a747d..7e4fa592 100644 --- a/docs/sync.js +++ b/docs/sync.js @@ -178,6 +178,17 @@ class User { */ static login(server, username, password, callback) {} + /** + * Authenticate a sync user with provider. + * @param {string} server - authentication server + * @param {string} provider - the provider (curently: 'password', and 'jwt') + * @param {object} options - options used by provider: + * - jwt - `token`; a JWT token + * - password - `username` and `password` + * @return {Promise} Returns a promise with a user + */ + static authenticate(server, provider, options) {} + /** * Register/login a sync user using an external login provider. * @param {string} server - authentication server diff --git a/lib/index.d.ts b/lib/index.d.ts index b3529fb2..7f4ecf37 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -290,6 +290,7 @@ declare namespace Realm.Sync { static registerWithProvider(server: string, options: { provider: string, providerToken: string, userInfo: any }, callback: (error: Error | null, user: User | null) => void): void; static registerWithProvider(server: string, options: { provider: string, providerToken: string, userInfo: any }): Promise; + authenticate(server: string, provider: string, options: any): Promise; logout(): void; openManagementRealm(): Realm; retrieveAccount(provider: string, username: string): Promise;