From 13e97be0fb11191e59f04db4afc74df3fabc13bd Mon Sep 17 00:00:00 2001 From: bill Date: Wed, 21 Nov 2018 16:42:32 -0700 Subject: [PATCH] getLoginClient added for digest auth batched calls --- lib/api.coffee | 1 + lib/client.coffee | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/api.coffee b/lib/api.coffee index e3a402f..6f7e084 100644 --- a/lib/api.coffee +++ b/lib/api.coffee @@ -30,4 +30,5 @@ module.exports = RetsParamError: errors.RetsParamError Client: Client getAutoLogoutClient: Client.getAutoLogoutClient + getLoginClient: Client.getLoginClient getReplyTag: replyCodes.getReplyTag diff --git a/lib/client.coffee b/lib/client.coffee index 0e76607..b811c37 100644 --- a/lib/client.coffee +++ b/lib/client.coffee @@ -125,5 +125,11 @@ Client.getAutoLogoutClient = (settings, handler) -> Promise.try () -> .finally () -> client.logout() +Client.getLoginClient = (settings, handler) -> Promise.try () -> + client = new Client(settings) + client.login() + .then () -> + Promise.try () -> + handler(client) module.exports = Client