From e51abc58672c4e8f3ef0244495c4ca5a2937dd0d Mon Sep 17 00:00:00 2001 From: Erika-Grine <67650872+Erika-Grine@users.noreply.github.com> Date: Fri, 9 Jul 2021 17:29:54 +0100 Subject: [PATCH] Created new patch version 0.4.3 (#60) --- CHANGELOG.md | 8 +++++++- README.md | 2 +- dist/appid.min.js | 2 +- dist/appid.umd.min.js | 2 +- docs/AppID.html | 2 +- docs/global.html | 2 +- docs/index.html | 4 ++-- docs/index.js.html | 2 +- package-lock.json | 2 +- package.json | 2 +- 10 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1769af1..b0ff22e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log -## [v0.4.2](https://github.com/ibm-cloud-security/appid-clientsdk-js/releases/tag/0.4.2) (2021-06-16) +## [v0.4.3](https://github.com/ibm-cloud-security/appid-clientsdk-js/releases/tag/0.4.3) (2021-07-09) + +**Added** + +- Update dependency versions + +## [v0.4.2](https://github.com/ibm-cloud-security/appid-clientsdk-js/releases/tag/0.4.2) (2021-07-09) **Added** diff --git a/README.md b/README.md index 0fb8242..14b6019 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ import AppID from 'ibmcloud-appid-js'; From the CDN: ```html - + ``` Or for development purposes use the minified file in this repo: diff --git a/dist/appid.min.js b/dist/appid.min.js index 047311c..700a82b 100644 --- a/dist/appid.min.js +++ b/dist/appid.min.js @@ -33,4 +33,4 @@ var ot=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(? */ var i=r(9),n=r(10),s=r(11);function a(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(t).length;default:if(i)return K(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:m(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,i,n){var s,a=1,o=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;a=2,o/=2,h/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var c=-1;for(s=r;so&&(r=o-h),s=r;s>=0;s--){for(var l=!0,f=0;fn&&(i=n):i=n;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var a=0;a>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(c=u);break;case 2:128==(192&(s=t[n+1]))&&(h=(31&u)<<6|63&s)>127&&(c=h);break;case 3:s=t[n+1],a=t[n+2],128==(192&s)&&128==(192&a)&&(h=(15&u)<<12|(63&s)<<6|63&a)>2047&&(h<55296||h>57343)&&(c=h);break;case 4:s=t[n+1],a=t[n+2],o=t[n+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(h=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&h<1114112&&(c=h)}null===c?(c=65533,l=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",i=0;for(;i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(e>>>=0),o=Math.min(s,a),u=this.slice(i,n),c=t.slice(e,r),l=0;ln)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":return x(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,i,n,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function B(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function H(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function O(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,i,s){return s||O(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function V(t,e,r,i,s){return s||O(t,0,r,8),n.write(t,e,r,i,52,8),r+8}h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},h.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||N(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+n]=t/s&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):H(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}var s=0,a=1,o=0;for(this[e]=255&t;++s>0)-o&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}var s=r-1,a=1,o=0;for(this[e+s]=255&t;--s>=0&&(a*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):H(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(s<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function k(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(8))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),a=i[0],o=i[1],h=new s(function(t,e,r){return 3*(e+r)/4-r}(0,a,o)),c=0,l=o>0?a-4:a;for(r=0;r>16&255,h[c++]=e>>8&255,h[c++]=255&e;2===o&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[c++]=255&e);1===o&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[c++]=e>>8&255,h[c++]=255&e);return h},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,s=[],a=0,o=r-n;ao?o:a+16383));1===n?(e=t[r-1],s.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],s.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return s.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,h=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var n,s,a=[],o=e;o>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -e.read=function(t,e,r,i,n){var s,a,o=8*n-i-1,h=(1<>1,c=-7,l=r?n-1:0,f=r?-1:1,g=t[e+l];for(l+=f,s=g&(1<<-c)-1,g>>=-c,c+=o;c>0;s=256*s+t[e+l],l+=f,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=i;c>0;a=256*a+t[e+l],l+=f,c-=8);if(0===s)s=1-u;else{if(s===h)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,i),s-=u}return(g?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var a,o,h,u=8*s-n-1,c=(1<>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,g=i?0:s-1,d=i?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+l>=1?f/h:f*Math.pow(2,1-l))*h>=2&&(a++,h/=2),a+l>=c?(o=0,a=c):a+l>=1?(o=(e*h-1)*Math.pow(2,n),a+=l):(o=e*Math.pow(2,l-1)*Math.pow(2,n),a=0));n>=8;t[r+g]=255&o,g+=d,o/=256,n-=8);for(a=a<0;t[r+g]=255&a,g+=d,a/=256,u-=8);t[r+g-d]|=128*p}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){class r extends Error{constructor({error:t,description:e}){super(e||t),this.error=t,this.description=e}}t.exports=r},function(t,e,r){"use strict";var i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i)return i;throw new Error("unable to locate global object")}();t.exports=e=i.fetch,i.fetch&&(e.default=i.fetch.bind(i)),e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response},function(t,e){class r extends Error{constructor(t,e,r){super(t),this.status=e,this.originError=r}}t.exports=r},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(17);t.exports=class{constructor({w:t=window}={}){this.window=t}init(t){this.popupConfig=t}open(){const t=this.popupConfig.height,e=this.popupConfig.width,r=(window.screen.width-e)/2,n=(window.screen.height-t)/2;if(this.popup=this.window.open("","popup",`left=${r},top=${n},width=${e},height=${t},resizable,scrollbars=yes,status=1`),!this.popup)throw new i("Unable to open popup")}navigate(t){this.popup.location.href=t}close(){this.popup.close()}async waitForMessage({messageType:t}){return new Promise((e,r)=>{const n=setInterval(()=>{this.popup.closed&&(clearInterval(n),r(new i("Popup closed")))},1e3);window.addEventListener("message",r=>{r.data&&r.data.type===t&&e(r)})})}}},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(19);t.exports=class{constructor({w:t=window}={}){this.window=t}open(t){this.iFrame=this.window.document.createElement("iframe"),this.iFrame.src=t,this.iFrame.width=0,this.iFrame.height=0,this.window.document.body.appendChild(this.iFrame)}remove(){window.document.body.removeChild(this.iFrame)}async waitForMessage({messageType:t}){return new Promise((e,r)=>{const n=setInterval(()=>{r(new i("Silent sign-in timed out"))},5e3);window.addEventListener("message",r=>{r.data&&r.data.type===t&&(clearInterval(n),e(r))})})}}},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(21);t.exports=class{async init({discoveryEndpoint:t,requestHandler:e}){this.openIdConfig=await e(t);const r={"x-filter-type":"spa:v"+i.version};this.publicKeys=e(this.getJwksEndpoint(),{headers:r})}getAuthorizationEndpoint(){return this.openIdConfig.authorization_endpoint}getUserInfoEndpoint(){return this.openIdConfig.userinfo_endpoint}getJwksEndpoint(){return this.openIdConfig.jwks_uri}getTokenEndpoint(){return this.openIdConfig.token_endpoint}getIssuer(){return this.openIdConfig.issuer}async getPublicKeys(){return await this.publicKeys}}},function(t){t.exports=JSON.parse('{"name":"ibmcloud-appid-js","version":"0.4.2","description":"IBM Cloud App ID SDK for Single Page Applications","keywords":["SPA","SDK","angular","react","javascript","js","ibmcloud","appid","App ID","authentication","authorization","access control","ACL","openid","jwt","PKCE","oauth","single page application"],"scripts":{"build":"webpack","test":"mocha","coverage":"nyc --reporter=lcov mocha","docs":"jsdoc src/index.js src/errors -t node_modules/docdash --readme README.md --destination docs -c jsdoc.json"},"repository":{"type":"git","url":"git+https://github.com/ibm-cloud-security/appid-clientsdk-js.git"},"main":"dist/appid.umd.min.js","license":"Apache-2.0","nyc":{"all":true,"include":["src/*.js"],"exclude":["**/PopupController.js","**/IFrameController.js","**/OpenIDConfigurationResource.js","**/constants.js"]},"dependencies":{"jsrsasign":"^10.2.0"},"devDependencies":{"@babel/cli":"^7.10.4","@babel/core":"^7.10.4","@babel/plugin-transform-runtime":"^7.10.4","@babel/preset-env":"^7.10.4","gulp-babel":"^8.0.0","chai":"^4.2.0","coveralls":"^3.1.0","docdash":"^1.2.0","jsdoc":"^3.6.4","mocha":"^7.2.0","node-fetch":"^2.6.0","nyc":"^15.1.0","webpack":"^4.43.0","webpack-cli":"^3.3.12"}}')}]); \ No newline at end of file +e.read=function(t,e,r,i,n){var s,a,o=8*n-i-1,h=(1<>1,c=-7,l=r?n-1:0,f=r?-1:1,g=t[e+l];for(l+=f,s=g&(1<<-c)-1,g>>=-c,c+=o;c>0;s=256*s+t[e+l],l+=f,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=i;c>0;a=256*a+t[e+l],l+=f,c-=8);if(0===s)s=1-u;else{if(s===h)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,i),s-=u}return(g?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var a,o,h,u=8*s-n-1,c=(1<>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,g=i?0:s-1,d=i?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+l>=1?f/h:f*Math.pow(2,1-l))*h>=2&&(a++,h/=2),a+l>=c?(o=0,a=c):a+l>=1?(o=(e*h-1)*Math.pow(2,n),a+=l):(o=e*Math.pow(2,l-1)*Math.pow(2,n),a=0));n>=8;t[r+g]=255&o,g+=d,o/=256,n-=8);for(a=a<0;t[r+g]=255&a,g+=d,a/=256,u-=8);t[r+g-d]|=128*p}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){class r extends Error{constructor({error:t,description:e}){super(e||t),this.error=t,this.description=e}}t.exports=r},function(t,e,r){"use strict";var i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i)return i;throw new Error("unable to locate global object")}();t.exports=e=i.fetch,i.fetch&&(e.default=i.fetch.bind(i)),e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response},function(t,e){class r extends Error{constructor(t,e,r){super(t),this.status=e,this.originError=r}}t.exports=r},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(17);t.exports=class{constructor({w:t=window}={}){this.window=t}init(t){this.popupConfig=t}open(){const t=this.popupConfig.height,e=this.popupConfig.width,r=(window.screen.width-e)/2,n=(window.screen.height-t)/2;if(this.popup=this.window.open("","popup",`left=${r},top=${n},width=${e},height=${t},resizable,scrollbars=yes,status=1`),!this.popup)throw new i("Unable to open popup")}navigate(t){this.popup.location.href=t}close(){this.popup.close()}async waitForMessage({messageType:t}){return new Promise((e,r)=>{const n=setInterval(()=>{this.popup.closed&&(clearInterval(n),r(new i("Popup closed")))},1e3);window.addEventListener("message",r=>{r.data&&r.data.type===t&&e(r)})})}}},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(19);t.exports=class{constructor({w:t=window}={}){this.window=t}open(t){this.iFrame=this.window.document.createElement("iframe"),this.iFrame.src=t,this.iFrame.width=0,this.iFrame.height=0,this.window.document.body.appendChild(this.iFrame)}remove(){window.document.body.removeChild(this.iFrame)}async waitForMessage({messageType:t}){return new Promise((e,r)=>{const n=setInterval(()=>{r(new i("Silent sign-in timed out"))},5e3);window.addEventListener("message",r=>{r.data&&r.data.type===t&&(clearInterval(n),e(r))})})}}},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(21);t.exports=class{async init({discoveryEndpoint:t,requestHandler:e}){this.openIdConfig=await e(t);const r={"x-filter-type":"spa:v"+i.version};this.publicKeys=e(this.getJwksEndpoint(),{headers:r})}getAuthorizationEndpoint(){return this.openIdConfig.authorization_endpoint}getUserInfoEndpoint(){return this.openIdConfig.userinfo_endpoint}getJwksEndpoint(){return this.openIdConfig.jwks_uri}getTokenEndpoint(){return this.openIdConfig.token_endpoint}getIssuer(){return this.openIdConfig.issuer}async getPublicKeys(){return await this.publicKeys}}},function(t){t.exports=JSON.parse('{"name":"ibmcloud-appid-js","version":"0.4.3","description":"IBM Cloud App ID SDK for Single Page Applications","keywords":["SPA","SDK","angular","react","javascript","js","ibmcloud","appid","App ID","authentication","authorization","access control","ACL","openid","jwt","PKCE","oauth","single page application"],"scripts":{"build":"webpack","test":"mocha","coverage":"nyc --reporter=lcov mocha","docs":"jsdoc src/index.js src/errors -t node_modules/docdash --readme README.md --destination docs -c jsdoc.json"},"repository":{"type":"git","url":"git+https://github.com/ibm-cloud-security/appid-clientsdk-js.git"},"main":"dist/appid.umd.min.js","license":"Apache-2.0","nyc":{"all":true,"include":["src/*.js"],"exclude":["**/PopupController.js","**/IFrameController.js","**/OpenIDConfigurationResource.js","**/constants.js"]},"dependencies":{"jsrsasign":"^10.2.0"},"devDependencies":{"@babel/cli":"^7.10.4","@babel/core":"^7.10.4","@babel/plugin-transform-runtime":"^7.10.4","@babel/preset-env":"^7.10.4","gulp-babel":"^8.0.0","chai":"^4.2.0","coveralls":"^3.1.0","docdash":"^1.2.0","jsdoc":"^3.6.4","mocha":"^7.2.0","node-fetch":"^2.6.0","nyc":"^15.1.0","webpack":"^4.43.0","webpack-cli":"^3.3.12"}}')}]); \ No newline at end of file diff --git a/dist/appid.umd.min.js b/dist/appid.umd.min.js index 9120e94..965d017 100644 --- a/dist/appid.umd.min.js +++ b/dist/appid.umd.min.js @@ -33,4 +33,4 @@ var ot=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(? */ var i=r(9),n=r(10),s=r(11);function a(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(t).length;default:if(i)return K(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function v(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:m(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,i,n){var s,a=1,o=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;a=2,o/=2,h/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var c=-1;for(s=r;so&&(r=o-h),s=r;s>=0;s--){for(var l=!0,f=0;fn&&(i=n):i=n;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var a=0;a>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(c=u);break;case 2:128==(192&(s=t[n+1]))&&(h=(31&u)<<6|63&s)>127&&(c=h);break;case 3:s=t[n+1],a=t[n+2],128==(192&s)&&128==(192&a)&&(h=(15&u)<<12|(63&s)<<6|63&a)>2047&&(h<55296||h>57343)&&(c=h);break;case 4:s=t[n+1],a=t[n+2],o=t[n+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(h=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&h<1114112&&(c=h)}null===c?(c=65533,l=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",i=0;for(;i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(e>>>=0),o=Math.min(s,a),u=this.slice(i,n),c=t.slice(e,r),l=0;ln)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":return x(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,i,n,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function B(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function H(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function O(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,i,s){return s||O(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function V(t,e,r,i,s){return s||O(t,0,r,8),n.write(t,e,r,i,52,8),r+8}h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},h.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||N(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+n]=t/s&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):H(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}var s=0,a=1,o=0;for(this[e]=255&t;++s>0)-o&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}var s=r-1,a=1,o=0;for(this[e+s]=255&t;--s>=0&&(a*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):H(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(s<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function k(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(8))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),a=i[0],o=i[1],h=new s(function(t,e,r){return 3*(e+r)/4-r}(0,a,o)),c=0,l=o>0?a-4:a;for(r=0;r>16&255,h[c++]=e>>8&255,h[c++]=255&e;2===o&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[c++]=255&e);1===o&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[c++]=e>>8&255,h[c++]=255&e);return h},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,s=[],a=0,o=r-n;ao?o:a+16383));1===n?(e=t[r-1],s.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],s.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return s.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,h=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var n,s,a=[],o=e;o>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -e.read=function(t,e,r,i,n){var s,a,o=8*n-i-1,h=(1<>1,c=-7,l=r?n-1:0,f=r?-1:1,g=t[e+l];for(l+=f,s=g&(1<<-c)-1,g>>=-c,c+=o;c>0;s=256*s+t[e+l],l+=f,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=i;c>0;a=256*a+t[e+l],l+=f,c-=8);if(0===s)s=1-u;else{if(s===h)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,i),s-=u}return(g?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var a,o,h,u=8*s-n-1,c=(1<>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,g=i?0:s-1,d=i?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+l>=1?f/h:f*Math.pow(2,1-l))*h>=2&&(a++,h/=2),a+l>=c?(o=0,a=c):a+l>=1?(o=(e*h-1)*Math.pow(2,n),a+=l):(o=e*Math.pow(2,l-1)*Math.pow(2,n),a=0));n>=8;t[r+g]=255&o,g+=d,o/=256,n-=8);for(a=a<0;t[r+g]=255&a,g+=d,a/=256,u-=8);t[r+g-d]|=128*p}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){class r extends Error{constructor({error:t,description:e}){super(e||t),this.error=t,this.description=e}}t.exports=r},function(t,e,r){"use strict";var i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i)return i;throw new Error("unable to locate global object")}();t.exports=e=i.fetch,i.fetch&&(e.default=i.fetch.bind(i)),e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response},function(t,e){class r extends Error{constructor(t,e,r){super(t),this.status=e,this.originError=r}}t.exports=r},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(17);t.exports=class{constructor({w:t=window}={}){this.window=t}init(t){this.popupConfig=t}open(){const t=this.popupConfig.height,e=this.popupConfig.width,r=(window.screen.width-e)/2,n=(window.screen.height-t)/2;if(this.popup=this.window.open("","popup",`left=${r},top=${n},width=${e},height=${t},resizable,scrollbars=yes,status=1`),!this.popup)throw new i("Unable to open popup")}navigate(t){this.popup.location.href=t}close(){this.popup.close()}async waitForMessage({messageType:t}){return new Promise((e,r)=>{const n=setInterval(()=>{this.popup.closed&&(clearInterval(n),r(new i("Popup closed")))},1e3);window.addEventListener("message",r=>{r.data&&r.data.type===t&&e(r)})})}}},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(19);t.exports=class{constructor({w:t=window}={}){this.window=t}open(t){this.iFrame=this.window.document.createElement("iframe"),this.iFrame.src=t,this.iFrame.width=0,this.iFrame.height=0,this.window.document.body.appendChild(this.iFrame)}remove(){window.document.body.removeChild(this.iFrame)}async waitForMessage({messageType:t}){return new Promise((e,r)=>{const n=setInterval(()=>{r(new i("Silent sign-in timed out"))},5e3);window.addEventListener("message",r=>{r.data&&r.data.type===t&&(clearInterval(n),e(r))})})}}},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(21);t.exports=class{async init({discoveryEndpoint:t,requestHandler:e}){this.openIdConfig=await e(t);const r={"x-filter-type":"spa:v"+i.version};this.publicKeys=e(this.getJwksEndpoint(),{headers:r})}getAuthorizationEndpoint(){return this.openIdConfig.authorization_endpoint}getUserInfoEndpoint(){return this.openIdConfig.userinfo_endpoint}getJwksEndpoint(){return this.openIdConfig.jwks_uri}getTokenEndpoint(){return this.openIdConfig.token_endpoint}getIssuer(){return this.openIdConfig.issuer}async getPublicKeys(){return await this.publicKeys}}},function(t){t.exports=JSON.parse('{"name":"ibmcloud-appid-js","version":"0.4.2","description":"IBM Cloud App ID SDK for Single Page Applications","keywords":["SPA","SDK","angular","react","javascript","js","ibmcloud","appid","App ID","authentication","authorization","access control","ACL","openid","jwt","PKCE","oauth","single page application"],"scripts":{"build":"webpack","test":"mocha","coverage":"nyc --reporter=lcov mocha","docs":"jsdoc src/index.js src/errors -t node_modules/docdash --readme README.md --destination docs -c jsdoc.json"},"repository":{"type":"git","url":"git+https://github.com/ibm-cloud-security/appid-clientsdk-js.git"},"main":"dist/appid.umd.min.js","license":"Apache-2.0","nyc":{"all":true,"include":["src/*.js"],"exclude":["**/PopupController.js","**/IFrameController.js","**/OpenIDConfigurationResource.js","**/constants.js"]},"dependencies":{"jsrsasign":"^10.2.0"},"devDependencies":{"@babel/cli":"^7.10.4","@babel/core":"^7.10.4","@babel/plugin-transform-runtime":"^7.10.4","@babel/preset-env":"^7.10.4","gulp-babel":"^8.0.0","chai":"^4.2.0","coveralls":"^3.1.0","docdash":"^1.2.0","jsdoc":"^3.6.4","mocha":"^7.2.0","node-fetch":"^2.6.0","nyc":"^15.1.0","webpack":"^4.43.0","webpack-cli":"^3.3.12"}}')}])})); \ No newline at end of file +e.read=function(t,e,r,i,n){var s,a,o=8*n-i-1,h=(1<>1,c=-7,l=r?n-1:0,f=r?-1:1,g=t[e+l];for(l+=f,s=g&(1<<-c)-1,g>>=-c,c+=o;c>0;s=256*s+t[e+l],l+=f,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=i;c>0;a=256*a+t[e+l],l+=f,c-=8);if(0===s)s=1-u;else{if(s===h)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,i),s-=u}return(g?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var a,o,h,u=8*s-n-1,c=(1<>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,g=i?0:s-1,d=i?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+l>=1?f/h:f*Math.pow(2,1-l))*h>=2&&(a++,h/=2),a+l>=c?(o=0,a=c):a+l>=1?(o=(e*h-1)*Math.pow(2,n),a+=l):(o=e*Math.pow(2,l-1)*Math.pow(2,n),a=0));n>=8;t[r+g]=255&o,g+=d,o/=256,n-=8);for(a=a<0;t[r+g]=255&a,g+=d,a/=256,u-=8);t[r+g-d]|=128*p}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){class r extends Error{constructor({error:t,description:e}){super(e||t),this.error=t,this.description=e}}t.exports=r},function(t,e,r){"use strict";var i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i)return i;throw new Error("unable to locate global object")}();t.exports=e=i.fetch,i.fetch&&(e.default=i.fetch.bind(i)),e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response},function(t,e){class r extends Error{constructor(t,e,r){super(t),this.status=e,this.originError=r}}t.exports=r},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(17);t.exports=class{constructor({w:t=window}={}){this.window=t}init(t){this.popupConfig=t}open(){const t=this.popupConfig.height,e=this.popupConfig.width,r=(window.screen.width-e)/2,n=(window.screen.height-t)/2;if(this.popup=this.window.open("","popup",`left=${r},top=${n},width=${e},height=${t},resizable,scrollbars=yes,status=1`),!this.popup)throw new i("Unable to open popup")}navigate(t){this.popup.location.href=t}close(){this.popup.close()}async waitForMessage({messageType:t}){return new Promise((e,r)=>{const n=setInterval(()=>{this.popup.closed&&(clearInterval(n),r(new i("Popup closed")))},1e3);window.addEventListener("message",r=>{r.data&&r.data.type===t&&e(r)})})}}},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(19);t.exports=class{constructor({w:t=window}={}){this.window=t}open(t){this.iFrame=this.window.document.createElement("iframe"),this.iFrame.src=t,this.iFrame.width=0,this.iFrame.height=0,this.window.document.body.appendChild(this.iFrame)}remove(){window.document.body.removeChild(this.iFrame)}async waitForMessage({messageType:t}){return new Promise((e,r)=>{const n=setInterval(()=>{r(new i("Silent sign-in timed out"))},5e3);window.addEventListener("message",r=>{r.data&&r.data.type===t&&(clearInterval(n),e(r))})})}}},function(t,e){class r extends Error{}t.exports=r},function(t,e,r){const i=r(21);t.exports=class{async init({discoveryEndpoint:t,requestHandler:e}){this.openIdConfig=await e(t);const r={"x-filter-type":"spa:v"+i.version};this.publicKeys=e(this.getJwksEndpoint(),{headers:r})}getAuthorizationEndpoint(){return this.openIdConfig.authorization_endpoint}getUserInfoEndpoint(){return this.openIdConfig.userinfo_endpoint}getJwksEndpoint(){return this.openIdConfig.jwks_uri}getTokenEndpoint(){return this.openIdConfig.token_endpoint}getIssuer(){return this.openIdConfig.issuer}async getPublicKeys(){return await this.publicKeys}}},function(t){t.exports=JSON.parse('{"name":"ibmcloud-appid-js","version":"0.4.3","description":"IBM Cloud App ID SDK for Single Page Applications","keywords":["SPA","SDK","angular","react","javascript","js","ibmcloud","appid","App ID","authentication","authorization","access control","ACL","openid","jwt","PKCE","oauth","single page application"],"scripts":{"build":"webpack","test":"mocha","coverage":"nyc --reporter=lcov mocha","docs":"jsdoc src/index.js src/errors -t node_modules/docdash --readme README.md --destination docs -c jsdoc.json"},"repository":{"type":"git","url":"git+https://github.com/ibm-cloud-security/appid-clientsdk-js.git"},"main":"dist/appid.umd.min.js","license":"Apache-2.0","nyc":{"all":true,"include":["src/*.js"],"exclude":["**/PopupController.js","**/IFrameController.js","**/OpenIDConfigurationResource.js","**/constants.js"]},"dependencies":{"jsrsasign":"^10.2.0"},"devDependencies":{"@babel/cli":"^7.10.4","@babel/core":"^7.10.4","@babel/plugin-transform-runtime":"^7.10.4","@babel/preset-env":"^7.10.4","gulp-babel":"^8.0.0","chai":"^4.2.0","coveralls":"^3.1.0","docdash":"^1.2.0","jsdoc":"^3.6.4","mocha":"^7.2.0","node-fetch":"^2.6.0","nyc":"^15.1.0","webpack":"^4.43.0","webpack-cli":"^3.3.12"}}')}])})); \ No newline at end of file diff --git a/docs/AppID.html b/docs/AppID.html index 6131844..f72aa91 100644 --- a/docs/AppID.html +++ b/docs/AppID.html @@ -1761,7 +1761,7 @@
Returns:

- Documentation generated by JSDoc 3.6.6 on Wed Jun 16 2021 12:38:45 GMT+0100 (Irish Standard Time) using the docdash theme. + Documentation generated by JSDoc 3.6.7 on Fri Jul 09 2021 17:10:13 GMT+0100 (Irish Standard Time) using the docdash theme.
diff --git a/docs/global.html b/docs/global.html index e7d9123..4c2d5e2 100644 --- a/docs/global.html +++ b/docs/global.html @@ -329,7 +329,7 @@
Type:

- Documentation generated by JSDoc 3.6.6 on Wed Jun 16 2021 12:38:45 GMT+0100 (Irish Standard Time) using the docdash theme. + Documentation generated by JSDoc 3.6.7 on Fri Jul 09 2021 17:10:13 GMT+0100 (Irish Standard Time) using the docdash theme.
diff --git a/docs/index.html b/docs/index.html index 51f60d5..b79fe8b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -81,7 +81,7 @@

Installation

import AppID from 'ibmcloud-appid-js';
 

From the CDN:

-
<script src="https://cdn.appid.cloud.ibm.com/appid-0.4.2.min.js"></script>
+
<script src="https://cdn.appid.cloud.ibm.com/appid-0.4.3.min.js"></script>
 

Or for development purposes use the minified file in this repo:

<script type='text/javascript' src="dist/appid.min.js"></script>
@@ -124,7 +124,7 @@ 

API Reference


- Documentation generated by JSDoc 3.6.6 on Wed Jun 16 2021 12:38:45 GMT+0100 (Irish Standard Time) using the docdash theme. + Documentation generated by JSDoc 3.6.7 on Fri Jul 09 2021 17:10:13 GMT+0100 (Irish Standard Time) using the docdash theme.
diff --git a/docs/index.js.html b/docs/index.js.html index 5eae665..0c1697e 100644 --- a/docs/index.js.html +++ b/docs/index.js.html @@ -333,7 +333,7 @@

index.js


- Documentation generated by JSDoc 3.6.6 on Wed Jun 16 2021 12:38:45 GMT+0100 (Irish Standard Time) using the docdash theme. + Documentation generated by JSDoc 3.6.7 on Fri Jul 09 2021 17:10:13 GMT+0100 (Irish Standard Time) using the docdash theme.
diff --git a/package-lock.json b/package-lock.json index d38e4b0..74503b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ibmcloud-appid-js", - "version": "0.4.2", + "version": "0.4.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fdc1f7c..ffb2028 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ibmcloud-appid-js", - "version": "0.4.2", + "version": "0.4.3", "description": "IBM Cloud App ID SDK for Single Page Applications", "keywords": [ "SPA",