@algoan/connect
Advanced tools
Comparing version 6.3.0 to 6.3.1
@@ -1,3 +0,3 @@ | ||
/*! Algoan Connect v6.3.0 */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AlgoanConnect=t():e.AlgoanConnect=t()}(self,(function(){return(()=>{"use strict";var e={614:function(e,t,n){var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.addWidget=void 0;var r=n(593),a=n(712),s=n(416),i=n(772),c=function(e){var t=e.iframeUrl;return null!=t?t:"https://connect.algoan.com"},l=function(e,t){window.addEventListener("message",(function(n){if(n.origin===c(e))switch(n.data.eventName){case a.Events.WIDGET_STARTING:!function(e,t){var n=o(o({},e),{onSuccessUrl:e.onSuccessUrl||window.location.href,onCancelUrl:e.onCancelUrl||window.location.href,onErrorUrl:e.onErrorUrl||window.location.href,parentUrl:e.parentUrl||window.location.href});(0,s.postMessage)(t,{type:s.MessageTypes.CONFIG,payload:n})}(e,t);break;case a.Events.AGGREGATION_START:t.style.width="100%",t.style.height="100%";break;default:return}}))};t.addWidget=function(e){try{!function(e){if("object"!=typeof e)throw new i.AlgoanConnectError("Invalid config provided.");if(!e.apiKey)throw new i.AlgoanConnectError("The apiKey should be provided.");if(!e.customIdentifier)throw new i.AlgoanConnectError("The customIdentifier should be provided.")}(e);var t=(0,r.getConnectElement)();if(null===t)throw new i.AlgoanConnectError("No container element found. Are you sure you created a div with id `algoan-connect`?");var n=function(e){var t=document.createElement("iframe"),n=new URL("".concat(c(e),"?apiKey=").concat(e.apiKey)),o=new URLSearchParams(window.location.search);return o.has("algoan_customIdentifier")&&o.has("algoan_username")&&(n.searchParams.append("customIdentifier",o.get("algoan_customIdentifier")),n.searchParams.append("username",o.get("algoan_username"))),t.src=n.toString(),t.style.border="none",t.style.width="100%",t.style.height=e.quickStart?"100%":"130px",t.style.transition="all 0.2s ease-out",t}(e);l(e,n),t.appendChild(n)}catch(e){if(!("message"in e))throw e;var o=e;console.error(o.message)}}},772:function(e,t){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)});Object.defineProperty(t,"__esModule",{value:!0}),t.AlgoanConnectError=void 0;var r=function(e){function t(t){return e.call(this,"Algoan Connect - ".concat(t))||this}return o(t,e),t}(Error);t.AlgoanConnectError=r},712:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Events=void 0,function(e){e.WIDGET_STARTING="widget_starting",e.AGGREGATION_START="aggregation_start",e.AGGREGATION_SUCCESS="aggregation_success",e.AGGREGATION_CANCEL="aggregation_cancel",e.AGGREGATION_ERROR="aggregation_error",e.AUTHENTICATION_ERROR="authentication_error"}(t.Events||(t.Events={}))},607:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(614),t),r(n(712),t),r(n(8),t),r(n(20),t),r(n(73),t)},8:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},416:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.postMessage=t.MessageTypes=void 0,function(e){e.CONFIG="CONFIG",e.PERSONAL_DETAILS="PERSONAL_DETAILS",e.ACCESS_TOKEN="ACCESS_TOKEN"}(t.MessageTypes||(t.MessageTypes={}));t.postMessage=function(e,t){var n,o=e.src;null===(n=e.contentWindow)||void 0===n||n.postMessage(t,o)}},73:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setAccessToken=void 0;var o=n(772),r=n(416),a=n(593);t.setAccessToken=function(e){try{var t=(0,a.getConnectIframe)();if(!t)throw new o.AlgoanConnectError("Unable to find Connect iframe. Connect should be added to use this function.");(0,r.postMessage)(t,{type:r.MessageTypes.ACCESS_TOKEN,payload:e})}catch(e){if(!("message"in e))throw e;var n=e;console.error(n.message)}}},20:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setCustomerPersonalDetails=void 0;var o=n(772),r=n(416),a=n(593);t.setCustomerPersonalDetails=function(e){try{var t=(0,a.getConnectIframe)();if(!t)throw new o.AlgoanConnectError("Unable to find Connect iframe. Connect should be added to use this function.");(0,r.postMessage)(t,{type:r.MessageTypes.PERSONAL_DETAILS,payload:e})}catch(e){if(!("message"in e))throw e;var n=e;console.error(n.message)}}},593:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getConnectIframe=t.getConnectElement=void 0;t.getConnectElement=function(){return document.getElementById("algoan-connect")};t.getConnectIframe=function(){var e=(0,t.getConnectElement)();return null==e?void 0:e.getElementsByTagName("iframe")[0]}}},t={};return function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}(607)})()})); | ||
/*! Algoan Connect v6.3.1 */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AlgoanConnect=t():e.AlgoanConnect=t()}(self,(function(){return(()=>{"use strict";var e={614:function(e,t,n){var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.addWidget=void 0;var r=n(593),a=n(712),s=n(416),i=n(772),c=function(e){var t=e.iframeUrl;return null!=t?t:"https://connect.algoan.com"},l=function(e,t){window.addEventListener("message",(function(n){if(n.origin===c(e))switch(n.data.eventName){case a.Events.WIDGET_STARTING:!function(e,t){var n=o(o({},e),{onSuccessUrl:e.onSuccessUrl||window.location.href,onCancelUrl:e.onCancelUrl||window.location.href,onErrorUrl:e.onErrorUrl||window.location.href,parentUrl:e.parentUrl||window.location.href});(0,s.postMessage)(t,{type:s.MessageTypes.CONFIG,payload:n})}(e,t);break;case a.Events.AGGREGATION_START:t.style.width="100%",t.style.height="100%";break;default:return}}))};t.addWidget=function(e){try{!function(e){if("object"!=typeof e)throw new i.AlgoanConnectError("Invalid config provided.");if(!e.apiKey)throw new i.AlgoanConnectError("The apiKey should be provided.");if(!e.customIdentifier)throw new i.AlgoanConnectError("The customIdentifier should be provided.")}(e);var t=(0,r.getConnectElement)();if(null===t)throw new i.AlgoanConnectError("No container element found. Are you sure you created a div with id `algoan-connect`?");var n=function(e){var t=document.createElement("iframe"),n=new URL("".concat(c(e),"?apiKey=").concat(e.apiKey)),o=new URLSearchParams(window.location.search),r=e.quickStart;return o.has("algoan_customIdentifier")&&o.has("algoan_username")&&(n.searchParams.append("customIdentifier",o.get("algoan_customIdentifier")),n.searchParams.append("username",o.get("algoan_username")),r=!0),t.src=n.toString(),t.style.border="none",t.style.width="100%",t.style.height=r?"100%":"130px",t.style.transition="all 0.2s ease-out",t}(e);l(e,n),t.appendChild(n)}catch(e){if(!("message"in e))throw e;var o=e;console.error(o.message)}}},772:function(e,t){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)});Object.defineProperty(t,"__esModule",{value:!0}),t.AlgoanConnectError=void 0;var r=function(e){function t(t){return e.call(this,"Algoan Connect - ".concat(t))||this}return o(t,e),t}(Error);t.AlgoanConnectError=r},712:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Events=void 0,function(e){e.WIDGET_STARTING="widget_starting",e.AGGREGATION_START="aggregation_start",e.AGGREGATION_SUCCESS="aggregation_success",e.AGGREGATION_CANCEL="aggregation_cancel",e.AGGREGATION_ERROR="aggregation_error",e.AUTHENTICATION_ERROR="authentication_error"}(t.Events||(t.Events={}))},607:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(614),t),r(n(712),t),r(n(8),t),r(n(20),t),r(n(73),t)},8:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},416:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.postMessage=t.MessageTypes=void 0,function(e){e.CONFIG="CONFIG",e.PERSONAL_DETAILS="PERSONAL_DETAILS",e.ACCESS_TOKEN="ACCESS_TOKEN"}(t.MessageTypes||(t.MessageTypes={}));t.postMessage=function(e,t){var n,o=e.src;null===(n=e.contentWindow)||void 0===n||n.postMessage(t,o)}},73:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setAccessToken=void 0;var o=n(772),r=n(416),a=n(593);t.setAccessToken=function(e){try{var t=(0,a.getConnectIframe)();if(!t)throw new o.AlgoanConnectError("Unable to find Connect iframe. Connect should be added to use this function.");(0,r.postMessage)(t,{type:r.MessageTypes.ACCESS_TOKEN,payload:e})}catch(e){if(!("message"in e))throw e;var n=e;console.error(n.message)}}},20:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setCustomerPersonalDetails=void 0;var o=n(772),r=n(416),a=n(593);t.setCustomerPersonalDetails=function(e){try{var t=(0,a.getConnectIframe)();if(!t)throw new o.AlgoanConnectError("Unable to find Connect iframe. Connect should be added to use this function.");(0,r.postMessage)(t,{type:r.MessageTypes.PERSONAL_DETAILS,payload:e})}catch(e){if(!("message"in e))throw e;var n=e;console.error(n.message)}}},593:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getConnectIframe=t.getConnectElement=void 0;t.getConnectElement=function(){return document.getElementById("algoan-connect")};t.getConnectIframe=function(){var e=(0,t.getConnectElement)();return null==e?void 0:e.getElementsByTagName("iframe")[0]}}},t={};return function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}(607)})()})); | ||
//# sourceMappingURL=algoan-connect.js.map |
@@ -37,5 +37,7 @@ var __assign = (this && this.__assign) || function () { | ||
var currentSearchParams = new URLSearchParams(window.location.search); | ||
var quickStart = config.quickStart; | ||
if (currentSearchParams.has('algoan_customIdentifier') && currentSearchParams.has('algoan_username')) { | ||
iframeUrl.searchParams.append('customIdentifier', currentSearchParams.get('algoan_customIdentifier')); | ||
iframeUrl.searchParams.append('username', currentSearchParams.get('algoan_username')); | ||
quickStart = true; | ||
} | ||
@@ -45,3 +47,3 @@ iframe.src = iframeUrl.toString(); | ||
iframe.style.width = '100%'; | ||
iframe.style.height = config.quickStart ? '100%' : '130px'; | ||
iframe.style.height = quickStart ? '100%' : '130px'; | ||
iframe.style.transition = 'all 0.2s ease-out'; | ||
@@ -48,0 +50,0 @@ return iframe; |
@@ -40,5 +40,7 @@ "use strict"; | ||
var currentSearchParams = new URLSearchParams(window.location.search); | ||
var quickStart = config.quickStart; | ||
if (currentSearchParams.has('algoan_customIdentifier') && currentSearchParams.has('algoan_username')) { | ||
iframeUrl.searchParams.append('customIdentifier', currentSearchParams.get('algoan_customIdentifier')); | ||
iframeUrl.searchParams.append('username', currentSearchParams.get('algoan_username')); | ||
quickStart = true; | ||
} | ||
@@ -48,3 +50,3 @@ iframe.src = iframeUrl.toString(); | ||
iframe.style.width = '100%'; | ||
iframe.style.height = config.quickStart ? '100%' : '130px'; | ||
iframe.style.height = quickStart ? '100%' : '130px'; | ||
iframe.style.transition = 'all 0.2s ease-out'; | ||
@@ -51,0 +53,0 @@ return iframe; |
{ | ||
"name": "@algoan/connect", | ||
"version": "6.3.0", | ||
"version": "6.3.1", | ||
"description": "Library for Algoan Connect", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65427
796
1