@pageproof/sdk-pr 600.0.1755832742355 → 600.0.1755861248052

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Session=require("../models/Session");var _Session2=_interopRequireDefault(_Session);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var AccountsSSO=function(_API){_inherits(AccountsSSO,_API);function AccountsSSO(){_classCallCheck(this,AccountsSSO);return _possibleConstructorReturn(this,_API.apply(this,arguments))}AccountsSSO.prototype.getSession=function getSession(){var _this2=this;return this.client.request("sso.get-public-key").then(function(response){return response.data.ServerPublicKey}).then(function(serverPublicKey){return _this2.client.crypto().generateWrappedSymmetricKey(serverPublicKey)}).then(function(_ref){var key=_ref.key,key$=_ref.key$;return Promise.all([key,_this2.client.request("sso.get-session",{nonce:key$})])}).then(function(_ref2){var key=_ref2[0],response=_ref2[1];var session=(new _Session2.default).fromSession(response.data);return Promise.all([session,_this2.client.crypto().decryptManagedPrivateKey(session.privateKeyPEM$,key)])}).then(function(_ref3){var session=_ref3[0],privateKeyPEM=_ref3[1];session.privateKeyPEM=privateKeyPEM;return session})};AccountsSSO.prototype.getLoginOptions=function getLoginOptions(email){return this.client.request("sso.get-login-options",{email:email}).then(function(response){return response.data})};AccountsSSO.prototype.initiateLogin=function initiateLogin(email,sessionId,source){return this.client.request("sso.initiate-login",{email:email,sessionId:sessionId,source:source}).then(function(response){return response.data})};AccountsSSO.prototype.getIsolatedLoginStatus=function getIsolatedLoginStatus(email,sessionId,source){return this.client.request("sso.get-isolated-login-status",{email:email,sessionId:sessionId,source:source}).then(function(response){return response.data})};AccountsSSO.prototype.getIsolatedLoginToken=function getIsolatedLoginToken(sessionId,source,tokenKey){var _this3=this;return this.client.request("sso.get-public-key").then(function(response){return _this3.client.crypto().generateWrappedSymmetricKey(response.data.ServerPublicKey)}).then(function(_ref4){var key=_ref4.key,key$=_ref4.key$;return Promise.all([key,_this3.client.request("sso.get-isolated-login-token",{sessionId:sessionId,source:source,tokenKey:tokenKey,nonce:key$})])}).then(function(_ref5){var key=_ref5[0],response=_ref5[1];var session=(new _Session2.default).fromSession(response.data.token);return Promise.all([session,_this3.client.crypto().decryptManagedPrivateKey(session.privateKeyPEM$,key)])}).then(function(_ref6){var session=_ref6[0],privateKeyPEM=_ref6[1];session.privateKeyPEM=privateKeyPEM;_this3.client.setSession(session)})};return AccountsSSO}(_API3.default);exports.default=AccountsSSO;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Session=require("../models/Session");var _Session2=_interopRequireDefault(_Session);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var AccountsSSO=function(_API){_inherits(AccountsSSO,_API);function AccountsSSO(){_classCallCheck(this,AccountsSSO);return _possibleConstructorReturn(this,_API.apply(this,arguments))}AccountsSSO.prototype.getSession=function getSession(){var _this2=this;return this.client.request("sso.get-public-key").then(function(response){return response.data.ServerPublicKey}).then(function(serverPublicKey){return _this2.client.crypto().generateWrappedSymmetricKey(serverPublicKey)}).then(function(_ref){var key=_ref.key,key$=_ref.key$;return Promise.all([key,_this2.client.request("sso.get-session",{nonce:key$})])}).then(function(_ref2){var key=_ref2[0],response=_ref2[1];var session=(new _Session2.default).fromSession(response.data);return Promise.all([session,_this2.client.crypto().decryptManagedPrivateKey(session.privateKeyPEM$,key)])}).then(function(_ref3){var session=_ref3[0],privateKeyPEM=_ref3[1];session.privateKeyPEM=privateKeyPEM;return session})};AccountsSSO.prototype.getLoginOptions=function getLoginOptions(email){return this.client.request("sso.get-login-options",{email:email}).then(function(response){return response.data})};AccountsSSO.prototype.initiateLogin=function initiateLogin(email,sessionId,source){return this.client.request("sso.initiate-login",{email:email,sessionId:sessionId,source:source}).then(function(response){return response.data})};AccountsSSO.prototype.getIsolatedLoginStatus=function getIsolatedLoginStatus(email,sessionId,source){return this.client.request("sso.get-isolated-login-status",{email:email,sessionId:sessionId,source:source}).then(function(response){return response.data})};AccountsSSO.prototype.getIsolatedLoginToken=function getIsolatedLoginToken(sessionId,source,tokenKey){var _this3=this;return this.client.request("sso.get-public-key").then(function(response){return _this3.client.crypto().generateWrappedSymmetricKey(response.data.ServerPublicKey)}).then(function(_ref4){var key=_ref4.key,key$=_ref4.key$;return Promise.all([key,_this3.client.request("sso.get-isolated-login-token",{sessionId:sessionId,source:source,tokenKey:tokenKey,nonce:key$})])}).then(function(_ref5){var key=_ref5[0],response=_ref5[1];var session=(new _Session2.default).fromSession(response.data.token);return Promise.all([session,_this3.client.crypto().decryptManagedPrivateKey(session.privateKeyPEM$,key)])}).then(function(_ref6){var session=_ref6[0],privateKeyPEM=_ref6[1];session.privateKeyPEM=privateKeyPEM;return session})};return AccountsSSO}(_API3.default);exports.default=AccountsSSO;