@basis-theory/web-elements 1.14.1 → 1.15.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.15.0] - 2025-06-09
2
+
3
+ ### Features
4
+
5
+ - 6569baf 2025-06-06 feat(eng-8603): export types from /common (#436) by 62716969+washluis-alencar@users.noreply.github.com
6
+
1
7
  ## [1.14.1] - 2025-06-04
2
8
 
3
9
  ### Bug Fixes
@@ -1 +1 @@
1
- !function(){function e(e,r,n,t,o,i,l){try{var s=e[i](l),c=s.value}catch(e){n(e);return}s.done?r(c):Promise.resolve(c).then(t,o)}function r(r){return function(){var n=this,t=arguments;return new Promise(function(o,i){var l=r.apply(n,t);function s(r){e(l,o,i,s,c,"next",r)}function c(r){e(l,o,i,s,c,"throw",r)}s(void 0)})}}function n(e,r){var n,t,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){var c=[i,s];if(n)throw TypeError("Generator is already executing.");for(;l;)try{if(n=1,t&&(o=2&c[0]?t.return:c[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,c[1])).done)return o;switch(t=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,t=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=r.call(e,l)}catch(e){c=[6,e],t=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var t,o,i,l,s,c,a,u=(l=r(function(e,r){var t,l,s,c,a,u,d,f=arguments;return n(this,function(n){switch(n.label){case 0:if(t=f.length>2&&void 0!==f[2]?f[2]:{},o)return[2];d=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},t=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.forEach(function(r){var t;t=n[r],r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t})}return e}({level:r,message:e,service:"web-elements-loader",env:u=!i||(null==i?void 0:i.includes("localhost"))?"local":i.includes("dev")?"dev":"prod",referrer:null===(l=document)||void 0===l?void 0:l.referrer,origin:null===(s=window)||void 0===s?void 0:s.location.origin,url:null===(c=window)||void 0===c?void 0:c.location.href,userAgent:null===(a=navigator)||void 0===a?void 0:a.userAgent},t),["local","dev"].includes(u)&&console.log(d),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,fetch("https://http-intake.logs.datadoghq.com/v1/input/".concat("pubb96b84a13912504f4354f2d794ea4fab"),{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json"}})];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("There was an error sending telemetry."),[3,4];case 4:return[2]}})}),s=function(e,r){return l.apply(this,arguments)},{disableTelemetry:function(e){o=e},setBaseUrl:function(e){i=e},log:{error:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(e,"error",r)},info:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(e,"info",r)},warn:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(e,"warn",r)}}}),d=function(e){var r=document.querySelector('script[src^="'.concat(e,'"]'));if(r)return r;var n=document.head||document.body;if(!n)throw Error("No <head> or <body> elements found in the document.");var t=Object.assign(document.createElement("script"),{src:e});return n.append(t),t},f="Tried to load BasisTheoryElements in a non-DOM environment.",h="Unable to load the Elements script. This may be due to network restrictions or browser extensions like ad blockers interfering with script loading. Check browser settings or network connection and try again.",p=function(e,t){return new Promise(function(o,i){var l,s=d(e),c=!1;s.addEventListener("load",function(){window.BasisTheoryElements?o(window.BasisTheoryElements):(r(function(){return n(this,function(e){switch(e.label){case 0:return[4,u.log.error("Elements not found on window on load",{logType:"elementsNotFoundOnWindow",logOrigin:"loadScript",retryCount:t})];case 1:return e.sent(),[2]}})})(),i(Error("Basis Theory Elements did not load properly. Check network tab for more details.")))}),s.addEventListener("error",(l=r(function(r){var l,a,d;return n(this,function(n){switch(n.label){case 0:if(c)return[2];return c=!0,[4,u.log.error("Elements script onError event",{logType:"elementsScriptOnError",logOrigin:"loadScript",retryCount:t,event:{message:null==r?void 0:r.message,source:null==r?void 0:r.filename,lineno:null==r?void 0:r.lineno,colno:null==r?void 0:r.colno,error:null==r?void 0:r.error,target:null==r?void 0:r.target}})];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,3,,5]),null==s||s.remove(),[3,5];case 3:return l=n.sent(),[4,u.log.error("Error removing script from DOM on retry attempt ".concat(t),{logType:"scriptRemovalError",logOrigin:"loadScript",retryCount:t,removalError:l})];case 4:return n.sent(),[3,5];case 5:if(0===t)return p(e,t+1).then(o).catch(i),[2];n.label=6;case 6:return n.trys.push([6,12,,14]),[4,fetch(e)];case 7:if((a=n.sent()).ok)return[3,9];return[4,u.log.error("Second attempt to load elements script failed, fetch failed with status: ".concat(a.status,"."),{logType:"elementsScriptFetchFailure",logOrigin:"loadScript",retryCount:t,fetchResult:"error",fetchResponse:a})];case 8:return n.sent(),i(Error(f)),[3,11];case 9:return[4,u.log.error("Second attempt to load elements script failed, fetch success",{logType:"elementsScriptFetchFailure",logOrigin:"loadScript",retryCount:t,fetchResult:"success",fetchResponse:a})];case 10:n.sent(),i(Error(h)),n.label=11;case 11:return[3,14];case 12:return d=n.sent(),[4,u.log.error("Second attempt failed to load elements script failed, fetch network error.",{logType:"elementsScriptFetchError",logOrigin:"loadScript",retryCount:t,fetchResult:"error",fetchError:d})];case 13:return n.sent(),i(Error(h)),[3,14];case 14:return i((null==r?void 0:r.error)||(null==r?void 0:r.message)||Error(h)),[2]}})}),function(e){return l.apply(this,arguments)}))})},v={};v={version:"1.14.1"};var m=(c=r(function(e,o){var i,l,s,c;return n(this,function(a){switch(a.label){case 0:var d;if(!e||0===e.length)throw Error("API key is required");return i=(null==o?void 0:o._devMode)?"js.flock-dev.com":"js.basistheory.com",u.setBaseUrl(i),u.disableTelemetry(!!(null==o?void 0:o.disableTelemetry)),[4,(d="https://".concat(i,"/web-elements/").concat(v.version,"/client/index.js"),t||(t=new Promise(function(e,t){var o;if(("undefined"==typeof window?"undefined":(o=window)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)!="object"){r(function(){return n(this,function(e){switch(e.label){case 0:return[4,u.log.warn(f,{logType:"elementsNonDomError",logOrigin:"loadElements"})];case 1:return e.sent(),t(Error(f)),[2]}})})();return}if(window.BasisTheoryElements){e(window.BasisTheoryElements);return}p(new URL(d).toString().replace(RegExp("\\/$","u"),""),0).then(e).catch(function(e){t(e)})})),t)];case 1:return[2,a.sent().init(e,"https://".concat(i,"/web-elements/").concat(v.version,"/hosted-elements/"),!1,null===(l=null==o?void 0:o.useSameOriginApi)||void 0===l||l,null!==(s=null==o?void 0:o.disableTelemetry)&&void 0!==s&&s,null!==(c=null==o?void 0:o.debug)&&void 0!==c&&c)]}})}),function(e,r){return c.apply(this,arguments)}),y=((a=y||{}).DECIMAL="decimal",a.EMAIL="email",a.NONE="none",a.NUMERIC="numeric",a.SEARCH="search",a.TEL="tel",a.TEXT="text",a.URL="url",a);"undefined"!=typeof window&&document.currentScript&&!window.basistheory&&(window.basistheory=m)}();
1
+ !function(){function e(e,r,t,n,o,i,l){try{var c=e[i](l),s=c.value}catch(e){t(e);return}c.done?r(s):Promise.resolve(s).then(n,o)}function r(r){return function(){var t=this,n=arguments;return new Promise(function(o,i){var l=r.apply(t,n);function c(r){e(l,o,i,c,s,"next",r)}function s(r){e(l,o,i,c,s,"throw",r)}c(void 0)})}}function t(e,r){var t,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){var s=[i,c];if(t)throw TypeError("Generator is already executing.");for(;l;)try{if(t=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,n=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){l=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){l.label=s[1];break}if(6===s[0]&&l.label<o[1]){l.label=o[1],o=s;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(s);break}o[2]&&l.ops.pop(),l.trys.pop();continue}s=r.call(e,l)}catch(e){s=[6,e],n=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var n,o,i,l,c,s,u,a=(l=r(function(e,r){var n,l,c,s,u,a,d,f=arguments;return t(this,function(t){switch(t.label){case 0:if(n=f.length>2&&void 0!==f[2]?f[2]:{},o)return[2];d=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({level:r,message:e,service:"web-elements-loader",env:a=!i||(null==i?void 0:i.includes("localhost"))?"local":i.includes("dev")?"dev":"prod",referrer:null===(l=document)||void 0===l?void 0:l.referrer,origin:null===(c=window)||void 0===c?void 0:c.location.origin,url:null===(s=window)||void 0===s?void 0:s.location.href,userAgent:null===(u=navigator)||void 0===u?void 0:u.userAgent},n),["local","dev"].includes(a)&&console.log(d),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch("https://http-intake.logs.datadoghq.com/v1/input/".concat("pubb96b84a13912504f4354f2d794ea4fab"),{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json"}})];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("There was an error sending telemetry."),[3,4];case 4:return[2]}})}),c=function(e,r){return l.apply(this,arguments)},{disableTelemetry:function(e){o=e},setBaseUrl:function(e){i=e},log:{error:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"error",r)},info:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"info",r)},warn:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"warn",r)}}}),d=function(e){var r=document.querySelector('script[src^="'.concat(e,'"]'));if(r)return r;var t=document.head||document.body;if(!t)throw Error("No <head> or <body> elements found in the document.");var n=Object.assign(document.createElement("script"),{src:e});return t.append(n),n},f="Tried to load BasisTheoryElements in a non-DOM environment.",p="Unable to load the Elements script. This may be due to network restrictions or browser extensions like ad blockers interfering with script loading. Check browser settings or network connection and try again.",h=function(e,n){return new Promise(function(o,i){var l,c=d(e),s=!1;c.addEventListener("load",function(){window.BasisTheoryElements?o(window.BasisTheoryElements):(r(function(){return t(this,function(e){switch(e.label){case 0:return[4,a.log.error("Elements not found on window on load",{logType:"elementsNotFoundOnWindow",logOrigin:"loadScript",retryCount:n})];case 1:return e.sent(),[2]}})})(),i(Error("Basis Theory Elements did not load properly. Check network tab for more details.")))}),c.addEventListener("error",(l=r(function(r){var l,u,d;return t(this,function(t){switch(t.label){case 0:if(s)return[2];return s=!0,[4,a.log.error("Elements script onError event",{logType:"elementsScriptOnError",logOrigin:"loadScript",retryCount:n,event:{message:null==r?void 0:r.message,source:null==r?void 0:r.filename,lineno:null==r?void 0:r.lineno,colno:null==r?void 0:r.colno,error:null==r?void 0:r.error,target:null==r?void 0:r.target}})];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,3,,5]),null==c||c.remove(),[3,5];case 3:return l=t.sent(),[4,a.log.error("Error removing script from DOM on retry attempt ".concat(n),{logType:"scriptRemovalError",logOrigin:"loadScript",retryCount:n,removalError:l})];case 4:return t.sent(),[3,5];case 5:if(0===n)return h(e,n+1).then(o).catch(i),[2];t.label=6;case 6:return t.trys.push([6,12,,14]),[4,fetch(e)];case 7:if((u=t.sent()).ok)return[3,9];return[4,a.log.error("Second attempt to load elements script failed, fetch failed with status: ".concat(u.status,"."),{logType:"elementsScriptFetchFailure",logOrigin:"loadScript",retryCount:n,fetchResult:"error",fetchResponse:u})];case 8:return t.sent(),i(Error(f)),[3,11];case 9:return[4,a.log.error("Second attempt to load elements script failed, fetch success",{logType:"elementsScriptFetchFailure",logOrigin:"loadScript",retryCount:n,fetchResult:"success",fetchResponse:u})];case 10:t.sent(),i(Error(p)),t.label=11;case 11:return[3,14];case 12:return d=t.sent(),[4,a.log.error("Second attempt failed to load elements script failed, fetch network error.",{logType:"elementsScriptFetchError",logOrigin:"loadScript",retryCount:n,fetchResult:"error",fetchError:d})];case 13:return t.sent(),i(Error(p)),[3,14];case 14:return i((null==r?void 0:r.error)||(null==r?void 0:r.message)||Error(p)),[2]}})}),function(e){return l.apply(this,arguments)}))})},v={};v={version:"1.15.0"};var y=(s=r(function(e,o){var i,l,c,s;return t(this,function(u){switch(u.label){case 0:var d;if(!e||0===e.length)throw Error("API key is required");return i=(null==o?void 0:o._devMode)?"js.flock-dev.com":"js.basistheory.com",a.setBaseUrl(i),a.disableTelemetry(!!(null==o?void 0:o.disableTelemetry)),[4,(d="https://".concat(i,"/web-elements/").concat(v.version,"/client/index.js"),n||(n=new Promise(function(e,n){var o;if(("undefined"==typeof window?"undefined":(o=window)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)!="object"){r(function(){return t(this,function(e){switch(e.label){case 0:return[4,a.log.warn(f,{logType:"elementsNonDomError",logOrigin:"loadElements"})];case 1:return e.sent(),n(Error(f)),[2]}})})();return}if(window.BasisTheoryElements){e(window.BasisTheoryElements);return}h(new URL(d).toString().replace(RegExp("\\/$","u"),""),0).then(e).catch(function(e){n(e)})})),n)];case 1:return[2,u.sent().init(e,"https://".concat(i,"/web-elements/").concat(v.version,"/hosted-elements/"),!1,null===(l=null==o?void 0:o.useSameOriginApi)||void 0===l||l,null!==(c=null==o?void 0:o.disableTelemetry)&&void 0!==c&&c,null!==(s=null==o?void 0:o.debug)&&void 0!==s&&s)]}})}),function(e,r){return s.apply(this,arguments)}),m=((u=m||{}).DECIMAL="decimal",u.EMAIL="email",u.NONE="none",u.NUMERIC="numeric",u.SEARCH="search",u.TEL="tel",u.TEXT="text",u.URL="url",u);function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function w(e,r){return(w=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function E(e,r,t){return(E=g()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&w(o,t.prototype),o}).apply(null,arguments)}function O(e){var r="function"==typeof Map?new Map:void 0;return(O=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return E(e,arguments,b(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),w(t,e)})(e)}O(Error),O(Error),O(Error),"undefined"!=typeof window&&document.currentScript&&!window.basistheory&&(window.basistheory=y)}();
@@ -304,7 +304,7 @@ const $6477b722f43d24f2$export$2b0a6e5a1c78018f = (elementsUrl)=>{
304
304
 
305
305
 
306
306
  var $eef42ce81412d9ae$exports = {};
307
- const $eef42ce81412d9ae$var$version = '1.14.1';
307
+ const $eef42ce81412d9ae$var$version = '1.15.0';
308
308
  $eef42ce81412d9ae$exports = {
309
309
  version: $eef42ce81412d9ae$var$version
310
310
  };
@@ -976,10 +976,50 @@ $parcel$exportWildcard($001f46d7c9d998c1$exports, $e14e406f86e7100a$exports);
976
976
  $parcel$exportWildcard($001f46d7c9d998c1$exports, $2c376b28511e5ece$exports);
977
977
 
978
978
 
979
+ var $1eef531dfb8479cf$exports = {};
980
+
981
+ $parcel$export($1eef531dfb8479cf$exports, "BasisTheoryApiError", () => $d4608c0b4e5d8cb4$export$5a9a4feb38dee587);
982
+ $parcel$export($1eef531dfb8479cf$exports, "BasisTheoryValidationError", () => $3c527b4ad66b1eeb$export$925a29a6f046f0b5);
983
+ $parcel$export($1eef531dfb8479cf$exports, "HttpClientError", () => $815b13df3d182116$export$83d862a6bd4a93c5);
984
+ class $d4608c0b4e5d8cb4$export$5a9a4feb38dee587 extends Error {
985
+ constructor(message, status, data){
986
+ super(message), this.status = status, this.data = data;
987
+ this.name = 'BasisTheoryApiError';
988
+ Object.setPrototypeOf(this, $d4608c0b4e5d8cb4$export$5a9a4feb38dee587.prototype);
989
+ }
990
+ }
991
+
992
+
993
+ class $3c527b4ad66b1eeb$export$925a29a6f046f0b5 extends Error {
994
+ constructor(message, details, /**
995
+ * @deprecated use {@link details}
996
+ */ validation){
997
+ super(message), this.details = details, this.validation = validation;
998
+ this.name = 'BasisTheoryValidationError';
999
+ Object.setPrototypeOf(this, $3c527b4ad66b1eeb$export$925a29a6f046f0b5.prototype);
1000
+ }
1001
+ }
1002
+
1003
+
1004
+ class $815b13df3d182116$export$83d862a6bd4a93c5 extends Error {
1005
+ constructor(message, status, data, headers){
1006
+ super(message);
1007
+ this.name = 'HttpClientError';
1008
+ this.status = status;
1009
+ this.data = data;
1010
+ this.headers = headers;
1011
+ Object.setPrototypeOf(this, $815b13df3d182116$export$83d862a6bd4a93c5.prototype);
1012
+ }
1013
+ }
1014
+
1015
+
1016
+
1017
+
979
1018
  /**
980
1019
  * Attaches to window when importing via `<script>` tags.
981
1020
  */ if (typeof window !== 'undefined' && document.currentScript && !window.basistheory) window.basistheory = (0, $316c9c8f85cead13$export$cbe2892587230861);
982
1021
  $parcel$exportWildcard(module.exports, $316c9c8f85cead13$exports);
983
1022
  $parcel$exportWildcard(module.exports, $001f46d7c9d998c1$exports);
1023
+ $parcel$exportWildcard(module.exports, $1eef531dfb8479cf$exports);
984
1024
 
985
1025
 
@@ -304,7 +304,7 @@ const $2cc07a9862fd14af$export$2b0a6e5a1c78018f = (elementsUrl)=>{
304
304
 
305
305
 
306
306
  var $6a2f0bfcc5905f21$exports = {};
307
- const $6a2f0bfcc5905f21$var$version = '1.14.1';
307
+ const $6a2f0bfcc5905f21$var$version = '1.15.0';
308
308
  $6a2f0bfcc5905f21$exports = {
309
309
  version: $6a2f0bfcc5905f21$var$version
310
310
  };
@@ -976,9 +976,48 @@ $parcel$exportWildcard($e8df50a6ced49e58$exports, $cf9609817e6b4989$exports);
976
976
  $parcel$exportWildcard($e8df50a6ced49e58$exports, $85d50d0af47c606f$exports);
977
977
 
978
978
 
979
+ var $fc55d9777ef735a2$exports = {};
980
+
981
+ $parcel$export($fc55d9777ef735a2$exports, "BasisTheoryApiError", () => $cc8dceaa5ea02f81$export$5a9a4feb38dee587);
982
+ $parcel$export($fc55d9777ef735a2$exports, "BasisTheoryValidationError", () => $16b549d313b97bf4$export$925a29a6f046f0b5);
983
+ $parcel$export($fc55d9777ef735a2$exports, "HttpClientError", () => $3753a300b9392464$export$83d862a6bd4a93c5);
984
+ class $cc8dceaa5ea02f81$export$5a9a4feb38dee587 extends Error {
985
+ constructor(message, status, data){
986
+ super(message), this.status = status, this.data = data;
987
+ this.name = 'BasisTheoryApiError';
988
+ Object.setPrototypeOf(this, $cc8dceaa5ea02f81$export$5a9a4feb38dee587.prototype);
989
+ }
990
+ }
991
+
992
+
993
+ class $16b549d313b97bf4$export$925a29a6f046f0b5 extends Error {
994
+ constructor(message, details, /**
995
+ * @deprecated use {@link details}
996
+ */ validation){
997
+ super(message), this.details = details, this.validation = validation;
998
+ this.name = 'BasisTheoryValidationError';
999
+ Object.setPrototypeOf(this, $16b549d313b97bf4$export$925a29a6f046f0b5.prototype);
1000
+ }
1001
+ }
1002
+
1003
+
1004
+ class $3753a300b9392464$export$83d862a6bd4a93c5 extends Error {
1005
+ constructor(message, status, data, headers){
1006
+ super(message);
1007
+ this.name = 'HttpClientError';
1008
+ this.status = status;
1009
+ this.data = data;
1010
+ this.headers = headers;
1011
+ Object.setPrototypeOf(this, $3753a300b9392464$export$83d862a6bd4a93c5.prototype);
1012
+ }
1013
+ }
1014
+
1015
+
1016
+
1017
+
979
1018
  /**
980
1019
  * Attaches to window when importing via `<script>` tags.
981
1020
  */ if (typeof window !== 'undefined' && document.currentScript && !window.basistheory) window.basistheory = (0, $65168f0452925da7$export$cbe2892587230861);
982
1021
 
983
1022
 
984
- export {$65168f0452925da7$export$cbe2892587230861 as basistheory, $2e9038c0999bba06$export$51be6d94c4fcf45 as CARD_BRANDS, $6011935a2a75da1d$export$1748c2651c2c6e25 as VISA, $6011935a2a75da1d$export$1c604828de4cf9cf as MASTERCARD, $6011935a2a75da1d$export$67c5e4e99638ee87 as AMERICAN_EXPRESS, $6011935a2a75da1d$export$fcf88132c9601d5d as DINERS_CLUB, $6011935a2a75da1d$export$27b2e48e28163360 as DISCOVER, $6011935a2a75da1d$export$bf30f1ca7b266454 as JCB, $6011935a2a75da1d$export$8ed8e9ea6bbca19f as UNION_PAY, $6011935a2a75da1d$export$f08651c87c943e8 as MAESTRO, $6011935a2a75da1d$export$c4b8f606caaecf2c as ELO, $6011935a2a75da1d$export$58f9d4150439d06e as MIR, $6011935a2a75da1d$export$8f50e2757841117b as HIPER, $6011935a2a75da1d$export$adb072c9761d9e59 as HIPERCARD, $6011935a2a75da1d$export$35b475386df8059d as DEFAULT_CARD_TYPES, $0b7f2ce91f71c8fb$export$8141e4f9a897abe6 as ELEMENTS_TYPES, $ce70703c3ce2f3a0$export$e2bf52fc7723ec89 as SAFE_CSS_PROPERTIES, $ce70703c3ce2f3a0$export$e22a44f86989e3f4 as SAFE_CSS_PROPERTIES_ALTERNATES, $ce70703c3ce2f3a0$export$b5b27feb4cf29129 as SAFE_CSS_PROPERTIES_WITH_ALTERNATES, $ce70703c3ce2f3a0$export$fc323aec0bf844b as CARD_ELEMENT_STYLE_VARIANT_SELECTORS, $ce70703c3ce2f3a0$export$a15fff7fac404fd9 as CARD_ELEMENT_STYLE_VARIANTS, $ce70703c3ce2f3a0$export$c3a88e1ff160bfd6 as CARD_ELEMENT_STYLE_FONTS_ATTR, $88bdfff2114854bc$export$f9a8af5874660c13 as DATA_CLASSIFICATIONS, $88bdfff2114854bc$export$7ea51ced9080f153 as DATA_IMPACT_LEVELS, $88bdfff2114854bc$export$23716d8c8b579500 as DATA_RESTRICTION_POLICIES};
1023
+ export {$65168f0452925da7$export$cbe2892587230861 as basistheory, $2e9038c0999bba06$export$51be6d94c4fcf45 as CARD_BRANDS, $6011935a2a75da1d$export$1748c2651c2c6e25 as VISA, $6011935a2a75da1d$export$1c604828de4cf9cf as MASTERCARD, $6011935a2a75da1d$export$67c5e4e99638ee87 as AMERICAN_EXPRESS, $6011935a2a75da1d$export$fcf88132c9601d5d as DINERS_CLUB, $6011935a2a75da1d$export$27b2e48e28163360 as DISCOVER, $6011935a2a75da1d$export$bf30f1ca7b266454 as JCB, $6011935a2a75da1d$export$8ed8e9ea6bbca19f as UNION_PAY, $6011935a2a75da1d$export$f08651c87c943e8 as MAESTRO, $6011935a2a75da1d$export$c4b8f606caaecf2c as ELO, $6011935a2a75da1d$export$58f9d4150439d06e as MIR, $6011935a2a75da1d$export$8f50e2757841117b as HIPER, $6011935a2a75da1d$export$adb072c9761d9e59 as HIPERCARD, $6011935a2a75da1d$export$35b475386df8059d as DEFAULT_CARD_TYPES, $0b7f2ce91f71c8fb$export$8141e4f9a897abe6 as ELEMENTS_TYPES, $ce70703c3ce2f3a0$export$e2bf52fc7723ec89 as SAFE_CSS_PROPERTIES, $ce70703c3ce2f3a0$export$e22a44f86989e3f4 as SAFE_CSS_PROPERTIES_ALTERNATES, $ce70703c3ce2f3a0$export$b5b27feb4cf29129 as SAFE_CSS_PROPERTIES_WITH_ALTERNATES, $ce70703c3ce2f3a0$export$fc323aec0bf844b as CARD_ELEMENT_STYLE_VARIANT_SELECTORS, $ce70703c3ce2f3a0$export$a15fff7fac404fd9 as CARD_ELEMENT_STYLE_VARIANTS, $ce70703c3ce2f3a0$export$c3a88e1ff160bfd6 as CARD_ELEMENT_STYLE_FONTS_ATTR, $88bdfff2114854bc$export$f9a8af5874660c13 as DATA_CLASSIFICATIONS, $88bdfff2114854bc$export$7ea51ced9080f153 as DATA_IMPACT_LEVELS, $88bdfff2114854bc$export$23716d8c8b579500 as DATA_RESTRICTION_POLICIES, $cc8dceaa5ea02f81$export$5a9a4feb38dee587 as BasisTheoryApiError, $16b549d313b97bf4$export$925a29a6f046f0b5 as BasisTheoryValidationError, $3753a300b9392464$export$83d862a6bd4a93c5 as HttpClientError};
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/web-elements",
3
- "version": "1.14.1",
3
+ "version": "1.15.0",
4
4
  "repository": "https://github.com/basis-theory/web-elements",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -551,6 +551,29 @@ export interface BasisTheoryInitOptions {
551
551
  debug?: boolean;
552
552
  }
553
553
  export const basistheory: (apiKey: string, options?: BasisTheoryInitOptions) => Promise<BasisTheoryElements | undefined>;
554
+ export class BasisTheoryApiError extends Error {
555
+ readonly status: number;
556
+ readonly data?: unknown | undefined;
557
+ constructor(message: string, status: number, data?: unknown | undefined);
558
+ }
559
+ export class BasisTheoryValidationError<Details = Record<string, unknown>> extends Error {
560
+ readonly details: Details;
561
+ /**
562
+ * @deprecated use {@link details}
563
+ */
564
+ readonly validation?: FieldError[] | undefined;
565
+ constructor(message: string, details: Details,
566
+ /**
567
+ * @deprecated use {@link details}
568
+ */
569
+ validation?: FieldError[] | undefined);
570
+ }
571
+ export class HttpClientError extends Error {
572
+ readonly status: number;
573
+ readonly data?: unknown;
574
+ readonly headers?: unknown;
575
+ constructor(message: string, status: number, data?: unknown, headers?: unknown);
576
+ }
554
577
  declare global {
555
578
  interface Window {
556
579
  basistheory?: typeof basistheory;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/web-elements",
3
- "version": "1.14.1",
3
+ "version": "1.15.0",
4
4
  "repository": "https://github.com/basis-theory/web-elements",
5
5
  "license": "Apache-2.0",
6
6
  "author": {