Socket
Socket
Sign inDemoInstall

blizzapi

Package Overview
Dependencies
9
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.6.0 to 2.6.1

2

dist/blizzapi.js

@@ -1,1 +0,1 @@

"use strict";var le=require("axios"),g=(e=>(e.REGIONS="REGIONS",e.LOCALES="LOCALES",e.DEFAULT_LOCALES="DEFAULT_LOCALES",e.REGION_API_HOSTS="REGION_API_HOSTS",e.SC2_REALMS="SC2_REALMS",e.OAUTH_AUTHORIZE_URIS="OAUTH_AUTHORIZE_URIS",e.OAUTH_TOKEN_URIS="OAUTH_TOKEN_URIS",e.OAUTH_CHECK_TOKEN_URIS="OAUTH_CHECK_TOKEN_URIS",e))(g||{}),R=(e=>(e.us="us",e.eu="eu",e.kr="kr",e.tw="tw",e.cn="cn",e))(R||{}),a=(e=>(e[e.us=1]="us",e[e.eu=2]="eu",e[e.kr=3]="kr",e[e.tw=3]="tw",e[e.cn=5]="cn",e))(a||{}),B=(e=>(e.us="1",e.eu="2",e.kr="3",e.tw="3",e.cn="5",e))(B||{}),h=(e=>(e.en_US="en_US",e.es_MX="es_MX",e.pt_BR="pt_BR",e.en_GB="en_GB",e.es_ES="es_ES",e.fr_FR="fr_FR",e.ru_RU="ru_RU",e.de_DE="de_DE",e.pt_PT="pt_PT",e.it_IT="it_IT",e.ko_KR="ko_KR",e.zh_TW="zh_TW",e.zh_CN="zh_CN",e))(h||{}),A=(e=>(e[e.us=0]="us",e[e.eu=0]="eu",e[e.kr=0]="kr",e[e.tw=0]="tw",e[e.cn=0]="cn",e))(A||{}),m=(e=>(e[e.US=1]="US",e[e.LatAm=2]="LatAm",e[e.Europe=1]="Europe",e[e.Russia=2]="Russia",e[e.Korea=1]="Korea",e[e.Taiwan=2]="Taiwan",e[e.China=1]="China",e))(m||{}),H=(e=>(e.US="1",e.LatAm="2",e.Europe="1",e.Russia="2",e.Korea="1",e.Taiwan="2",e.China="1",e))(H||{}),E=(e=>(e.GET="GET",e.POST="POST",e))(E||{}),k=(e=>(e.us="https://us.battle.net",e.eu="https://eu.battle.net",e.kr="https://apac.battle.net",e.tw="https://apac.battle.net",e.cn="https://www.battlenet.com.cn",e))(k||{}),O=(e=>(e.us="https://us.api.blizzard.com",e.eu="https://eu.api.blizzard.com",e.kr="https://kr.api.blizzard.com",e.tw="https://tw.api.blizzard.com",e.cn="https://gateway.battlenet.com.cn",e))(O||{}),T=(e=>(e.authorize="/oauth/authorize",e.token="/oauth/token",e.checkToken="/oauth/check_token?token=",e))(T||{}),b=(e=>(e.LastModified="last-modified",e))(b||{}),L=(e=>(e[e.NotAuthorized=401]="NotAuthorized",e))(L||{}),_=(e=>(e.InvalidToken="invalid_token",e.AccessTokenInvalid="access_token_invalid",e.AccessTokenExpired="access_token_invalid",e))(_||{});const ue=e=>e[0]==="/",de=e=>e.length>3,ge=[ue,de],he=e=>ge.every(t=>t(e)),Re=e=>/(?:http[s]?:\/\/)[^\s(["<,>]*\.[^\s[",><]*/gm.test(e),me=Object.freeze({[a.us]:A.us,[a.eu]:A.eu,[a.kr]:A.kr,[a.cn]:A.cn}),pe=Object.freeze({[a.us]:Object.freeze([h.en_US,h.es_MX,h.pt_BR]),[a.eu]:Object.freeze([h.en_GB,h.es_ES,h.fr_FR,h.ru_RU,h.de_DE,h.pt_PT,h.it_IT]),[a.kr]:Object.freeze([h.ko_KR,h.zh_TW]),[a.cn]:Object.freeze([h.zh_CN])}),Oe=Object.freeze({[a.us]:Object.freeze([R.us]),[a.eu]:Object.freeze([R.eu]),[a.kr]:Object.freeze([R.kr,R.tw]),[a.cn]:Object.freeze([R.cn])}),fe=Object.freeze({[a.us]:Object.freeze([m.US,m.LatAm]),[a.eu]:Object.freeze([m.Europe,m.Russia]),[a.kr]:Object.freeze([m.Korea,m.Taiwan]),[a.cn]:Object.freeze([m.China])}),Ae=Object.freeze({[a.us]:O.us,[a.eu]:O.eu,[a.kr]:[O.kr,O.tw],[a.cn]:O.cn}),y=Object.freeze({[a.us]:k.us,[a.eu]:k.eu,[a.kr]:k.kr,[a.cn]:k.cn}),j=e=>Object.freeze({[a.us]:`${y[a.us]}${e}`,[a.eu]:`${y[a.eu]}${e}`,[a.kr]:`${y[a.kr]}${e}`,[a.cn]:`${y[a.cn]}${e}`}),ke=j(T.authorize),ve=j(T.token),Se=j(T.checkToken),p={[g.REGIONS]:Oe,[g.LOCALES]:pe,[g.DEFAULT_LOCALES]:me,[g.SC2_REALMS]:fe,[g.REGION_API_HOSTS]:Ae,[g.OAUTH_AUTHORIZE_URIS]:ke,[g.OAUTH_TOKEN_URIS]:ve,[g.OAUTH_CHECK_TOKEN_URIS]:Se},f=p[g.REGIONS],Ee=()=>f,Te=()=>Object.keys(f).map(e=>parseInt(e,10)),_e=()=>{const e=Object.values(f);return[].concat(...e).map(t=>t.toString())},x=e=>{const t=Object.keys(f),n=e.toString();if(!t.includes(n))throw new RangeError(`${n} is not a valid parameter for getRegionNameById()`);return f[n]},v=e=>{try{return!!x(e)}catch{return!1}},C=e=>{const t=e.toLowerCase(),n=Object.keys(f).filter(s=>f[s].includes(t)),r=Number(n[0])||!1;if(!r)throw new RangeError(`"${e}" is not a valid parameter for getRegionIdByName()`);return r},F=e=>{try{return!!C(e)}catch{return!1}},N=(e,t)=>{const n=typeof e=="string"?e:e.toString();if(!v(n))throw new RangeError(`${n} is not a valid parameter for getConstantByRegionId(${e}, '${t}')`);return p[t][e]},Ie=(e,t)=>{if(!F(e))throw new RangeError(`${e} is not a valid parameter for getConstantByRegionName(${e}, '${t}')`);const n=C(e);return p[t][n]},U=(e,t)=>v(e)?N(e,t):Ie(e.toString(),t),be=p[g.LOCALES],K=()=>be,M=()=>Object.keys(h).filter(e=>Number.isNaN(Number(e))).map(e=>e.toString()),G=e=>N(e,g.LOCALES),D=e=>/^(?:[a-z]{2}_[a-z]{2})$/gi.test(e),V=e=>{if(!D(e))throw new RangeError(`${e} is not a valid parameter for validateLocale()`);const t=M().map(r=>r.toLowerCase()),n=e.toLowerCase();return t.includes(n)},ye=(e,t)=>{const n=e.toLowerCase(),r=V(n)||!1,s=t.toString(),u=v(s);if(!r)throw new RangeError(`${e} is not a valid locale parameter for isLocaleValidForRegionId()`);if(!u)throw new RangeError(`${t} is not a valid regionId parameter for isLocaleValidForRegionId()`);return G(t).map(i=>i.toLowerCase()).includes(n)},we=p[g.DEFAULT_LOCALES],Le=p[g.LOCALES],q=e=>{const t=e.toString();if(!v(t))throw new RangeError(`${t} is not a valid parameter for getDefaultLocaleNameForRegionId()`);const n=we[t];return Le[e][n]},je=()=>{const e=K(),t=Object.keys(e);return Object.assign({},...t.map(n=>({[n]:q(n)})))},Ce=()=>p.SC2_REALMS,Q=()=>{const e=Object.values(p.SC2_REALMS);return[].concat(...e).filter((t,n,r)=>n===r.indexOf(t))},W=e=>N(e,g.SC2_REALMS),z=e=>{const t=e.toString();return/^([1-9]{1})$/gi.test(t)},Ne=e=>{if(!z(e))throw new RangeError(`${e} is not a valid parameter for validateSc2Realm()`);const t=Q(),n=typeof e=="number"?e:parseInt(e,10);return t.includes(n)},Ue=(e,t)=>{const n=z(e),r=t.toString(),s=v(r);if(!n)throw new RangeError(`${e} is not a valid sc2Realm parameter for isSc2RealmValidForRegionId()`);if(!s)throw new RangeError(`${t} is not a valid regionId parameter for isSc2RealmValidForRegionId()`);const u=W(t),i=typeof e=="number"?e:parseInt(e,10);return u.includes(i)},ze=e=>{const t=U(e,g.REGION_API_HOSTS);return typeof e=="string"&&e.toLowerCase()===R.kr?t[0]:typeof e=="string"&&e.toLowerCase()===R.tw?t[1]:t},$e=e=>U(e,g.OAUTH_CHECK_TOKEN_URIS),Pe=e=>U(e,g.OAUTH_TOKEN_URIS);var Be=Object.defineProperty,X=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable,Z=(e,t,n)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S=(e,t)=>{for(var n in t||(t={}))He.call(t,n)&&Z(e,n,t[n]);if(X)for(var n of X(t))xe.call(t,n)&&Z(e,n,t[n]);return e},Fe=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});const $=e=>Fe(void 0,null,function*(){const{uri:t,timeout:n,headers:r,params:s,data:u,auth:i}=e,c=e.method||E.GET;if(!Re(t))throw new RangeError(`'${t}' is not a valid parameter for fetchFromUri()`);const o=S(S(S(S({method:c,url:encodeURI(t),timeout:n||1e4},r&&{headers:r}),s&&{params:s}),i&&{auth:i}),u&&{data:u}),l=yield le.request(o),I=l.headers[b.LastModified]?l.headers[b.LastModified]:null;return S(S({},l.data),I&&{lastModified:I})}),J=e=>{const{region:t,clientId:n,clientSecret:r}=e;if(!n)throw new Error("Cannot get access token because no Battle.net client id was provided");if(!r)throw new Error("Cannot get access token because no Battle.net client secret was provided");const s="grant_type=client_credentials",u={username:n,password:r},i=Pe(t);return $({data:s,auth:u,uri:i,method:E.POST})};var Ke=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});const Y=(e,t)=>Ke(void 0,null,function*(){try{const n=`${$e(e)}${t}`;return(yield $({uri:n})).error!==_.InvalidToken}catch{return!1}});var Me=Object.defineProperty,ee=Object.getOwnPropertySymbols,Ge=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,te=(e,t,n)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t)=>{for(var n in t||(t={}))Ge.call(t,n)&&te(e,n,t[n]);if(ee)for(var n of ee(t))De.call(t,n)&&te(e,n,t[n]);return e},ne=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});const oe=(e,t)=>{const{region:n,endpoint:r,options:s}=e,{headers:u,params:i,timeout:c}=s;if(!he(r))throw new RangeError(`${r} is not a valid endpoint.`);const o=`${ze(n)}${r}`,l={Authorization:`Bearer ${t}`},I=w(w({},u),l);return $(w(w({uri:o,method:E.GET,headers:I},i&&{params:i}),c&&{timeout:c}))},re=e=>ne(void 0,null,function*(){const{onAccessTokenRefresh:t}=e.options,n=(yield J(e)).access_token;return t?.(n),oe(e,n)}),Ve=e=>ne(void 0,null,function*(){var t;const{region:n,accessToken:r}=e,{validateAccessTokenOnEachQuery:s,refreshExpiredAccessToken:u,onAccessTokenExpired:i}=e.options;if(s&&!(yield Y(n,r)))return i?.(),u?re(e):{error:_.AccessTokenInvalid};try{return yield oe(e,r)}catch(c){if(((t=c.response)==null?void 0:t.status)===L.NotAuthorized)return i?.(),u?re(e):Promise.resolve({error:_.AccessTokenExpired});throw c}});class qe{constructor(t,n){this.clientId=t,this.clientSecret=n}}var P=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});class ae extends qe{constructor(t){super(t.clientId,t.clientSecret),this.getAccessToken=()=>P(this,null,function*(){return(yield this.getAccessTokenObject()).access_token}),this.getAccessTokenObject=()=>this.accessTokenObject?Promise.resolve(this.accessTokenObject):this.setAccessTokenObject(),this.getAccessTokenObjectFromBnet=()=>P(this,null,function*(){return J({region:this.region,clientId:this.clientId,clientSecret:this.clientSecret})}),this.region=t.region,this.accessTokenObject=t.accessToken?{access_token:t.accessToken}:void 0}setAccessToken(){return this.setAccessTokenObject()}setAccessTokenObject(){return P(this,null,function*(){return this.accessTokenObject=yield this.getAccessTokenObjectFromBnet(),this.accessTokenObject})}}ae.validateAccessToken=(e,t)=>Y(e,t);var Qe=Object.defineProperty,se=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,ce=(e,t,n)=>t in e?Qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ie=(e,t)=>{for(var n in t||(t={}))We.call(t,n)&&ce(e,n,t[n]);if(se)for(var n of se(t))Xe.call(t,n)&&ce(e,n,t[n]);return e},Ze=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});class d extends ae{constructor(t){super({region:t.region,clientId:t.clientId,clientSecret:t.clientSecret,accessToken:t.accessToken}),this.query=(n,r)=>Ze(this,null,function*(){return Ve({endpoint:n,region:r?.region||this.region,clientId:this.clientId,clientSecret:this.clientSecret,accessToken:yield this.getAccessToken(),options:ie(ie({},this.options),r)})}),this.options={validateAccessTokenOnEachQuery:t.validateAccessTokenOnEachQuery||!1,refreshExpiredAccessToken:t.refreshExpiredAccessToken||!1,onAccessTokenExpired:t.onAccessTokenExpired||void 0,onAccessTokenRefresh:t.onAccessTokenRefresh||void 0}}setRegion(t){this.region=t}}d.getAllRegions=Ee,d.getAllRegionIds=Te,d.getAllRegionNames=_e,d.getRegionNameById=x,d.validateRegionId=v,d.getRegionIdByName=C,d.validateRegionName=F,d.getAllLocales=K,d.getAllLocaleNames=M,d.getLocalesByRegionId=G,d.checkIfLocaleLooksValid=D,d.validateLocale=V,d.isLocaleValidForRegionId=ye,d.getAllSc2Realms=Ce,d.getAllAvailableSc2Realms=Q,d.getSc2RealmsByRegionId=W,d.checkIfSc2RealmLooksValid=z,d.validateSc2Realm=Ne,d.isSc2RealmValidForRegionId=Ue,d.getDefaultLocaleNameForRegionId=q,d.getAllDefaultLocaleNames=je,exports.ApiHeaders=b,exports.BlizzAPI=d,exports.ConstantKey=g,exports.DefaultLocaleIndex=A,exports.ErrorCode=L,exports.ErrorResponseMessage=_,exports.HttpMethod=E,exports.Locale=h,exports.OAuthEndpoint=T,exports.OAuthHost=k,exports.RegionHost=O,exports.RegionIdAsStringEnum=B,exports.RegionIdEnum=a,exports.RegionNameEnum=R,exports.Sc2Realm=m,exports.Sc2RealmAsString=H;
"use strict";var ge=require("axios"),h=(e=>(e.REGIONS="REGIONS",e.LOCALES="LOCALES",e.DEFAULT_LOCALES="DEFAULT_LOCALES",e.REGION_API_HOSTS="REGION_API_HOSTS",e.SC2_REALMS="SC2_REALMS",e.OAUTH_AUTHORIZE_URIS="OAUTH_AUTHORIZE_URIS",e.OAUTH_TOKEN_URIS="OAUTH_TOKEN_URIS",e.OAUTH_CHECK_TOKEN_URIS="OAUTH_CHECK_TOKEN_URIS",e))(h||{}),m=(e=>(e.us="us",e.eu="eu",e.kr="kr",e.tw="tw",e.cn="cn",e))(m||{}),a=(e=>(e[e.us=1]="us",e[e.eu=2]="eu",e[e.kr=3]="kr",e[e.tw=3]="tw",e[e.cn=5]="cn",e))(a||{}),F=(e=>(e.us="1",e.eu="2",e.kr="3",e.tw="3",e.cn="5",e))(F||{}),R=(e=>(e.en_US="en_US",e.es_MX="es_MX",e.pt_BR="pt_BR",e.en_GB="en_GB",e.es_ES="es_ES",e.fr_FR="fr_FR",e.ru_RU="ru_RU",e.de_DE="de_DE",e.pt_PT="pt_PT",e.it_IT="it_IT",e.ko_KR="ko_KR",e.zh_TW="zh_TW",e.zh_CN="zh_CN",e))(R||{}),v=(e=>(e[e.us=0]="us",e[e.eu=0]="eu",e[e.kr=0]="kr",e[e.tw=0]="tw",e[e.cn=0]="cn",e))(v||{}),p=(e=>(e[e.US=1]="US",e[e.LatAm=2]="LatAm",e[e.Europe=1]="Europe",e[e.Russia=2]="Russia",e[e.Korea=1]="Korea",e[e.Taiwan=2]="Taiwan",e[e.China=1]="China",e))(p||{}),K=(e=>(e.US="1",e.LatAm="2",e.Europe="1",e.Russia="2",e.Korea="1",e.Taiwan="2",e.China="1",e))(K||{}),T=(e=>(e.GET="GET",e.POST="POST",e))(T||{}),k=(e=>(e.us="https://us.battle.net",e.eu="https://eu.battle.net",e.kr="https://apac.battle.net",e.tw="https://apac.battle.net",e.cn="https://www.battlenet.com.cn",e))(k||{}),O=(e=>(e.us="https://us.api.blizzard.com",e.eu="https://eu.api.blizzard.com",e.kr="https://kr.api.blizzard.com",e.tw="https://tw.api.blizzard.com",e.cn="https://gateway.battlenet.com.cn",e))(O||{}),_=(e=>(e.authorize="/oauth/authorize",e.token="/oauth/token",e.checkToken="/oauth/check_token?token=",e))(_||{}),w=(e=>(e.LastModified="last-modified",e))(w||{}),C=(e=>(e[e.NotAuthorized=401]="NotAuthorized",e))(C||{}),y=(e=>(e.InvalidToken="invalid_token",e.AccessTokenInvalid="access_token_invalid",e.AccessTokenExpired="access_token_invalid",e))(y||{});const he=e=>e[0]==="/",Re=e=>e.length>3,me=[he,Re],pe=e=>me.every(t=>t(e)),fe=e=>/(?:http[s]?:\/\/)[^\s(["<,>]*\.[^\s[",><]*/gm.test(e),Oe=Object.freeze({[a.us]:v.us,[a.eu]:v.eu,[a.kr]:v.kr,[a.cn]:v.cn}),Ae=Object.freeze({[a.us]:Object.freeze([R.en_US,R.es_MX,R.pt_BR]),[a.eu]:Object.freeze([R.en_GB,R.es_ES,R.fr_FR,R.ru_RU,R.de_DE,R.pt_PT,R.it_IT]),[a.kr]:Object.freeze([R.ko_KR,R.zh_TW]),[a.cn]:Object.freeze([R.zh_CN])}),ve=Object.freeze({[a.us]:Object.freeze([m.us]),[a.eu]:Object.freeze([m.eu]),[a.kr]:Object.freeze([m.kr,m.tw]),[a.cn]:Object.freeze([m.cn])}),ke=Object.freeze({[a.us]:Object.freeze([p.US,p.LatAm]),[a.eu]:Object.freeze([p.Europe,p.Russia]),[a.kr]:Object.freeze([p.Korea,p.Taiwan]),[a.cn]:Object.freeze([p.China])}),Se=Object.freeze({[a.us]:O.us,[a.eu]:O.eu,[a.kr]:[O.kr,O.tw],[a.cn]:O.cn}),L=Object.freeze({[a.us]:k.us,[a.eu]:k.eu,[a.kr]:k.kr,[a.cn]:k.cn}),N=e=>Object.freeze({[a.us]:`${L[a.us]}${e}`,[a.eu]:`${L[a.eu]}${e}`,[a.kr]:`${L[a.kr]}${e}`,[a.cn]:`${L[a.cn]}${e}`}),be=N(_.authorize),Ee=N(_.token),Te=N(_.checkToken),f={[h.REGIONS]:ve,[h.LOCALES]:Ae,[h.DEFAULT_LOCALES]:Oe,[h.SC2_REALMS]:ke,[h.REGION_API_HOSTS]:Se,[h.OAUTH_AUTHORIZE_URIS]:be,[h.OAUTH_TOKEN_URIS]:Ee,[h.OAUTH_CHECK_TOKEN_URIS]:Te},A=f[h.REGIONS],_e=()=>A,ye=()=>Object.keys(A).map(e=>parseInt(e,10)),Ie=()=>{const e=Object.values(A);return[].concat(...e).map(t=>t.toString())},M=e=>{const t=Object.keys(A),n=e.toString();if(!t.includes(n))throw new RangeError(`${n} is not a valid parameter for getRegionNameById()`);return A[n]},S=e=>{try{return!!M(e)}catch{return!1}},U=e=>{const t=e.toLowerCase(),n=Object.keys(A).filter(s=>A[s].includes(t)),r=Number(n[0])||!1;if(!r)throw new RangeError(`"${e}" is not a valid parameter for getRegionIdByName()`);return r},G=e=>{try{return!!U(e)}catch{return!1}},z=(e,t)=>{const n=typeof e=="string"?e:e.toString();if(!S(n))throw new RangeError(`${n} is not a valid parameter for getConstantByRegionId(${e}, '${t}')`);return f[t][e]},we=(e,t)=>{if(!G(e))throw new RangeError(`${e} is not a valid parameter for getConstantByRegionName(${e}, '${t}')`);const n=U(e);return f[t][n]},$=(e,t)=>S(e)?z(e,t):we(e.toString(),t),Le=f[h.LOCALES],D=()=>Le,V=()=>Object.keys(R).filter(e=>Number.isNaN(Number(e))).map(e=>e.toString()),q=e=>z(e,h.LOCALES),Q=e=>/^(?:[a-z]{2}_[a-z]{2})$/gi.test(e),W=e=>{if(!Q(e))throw new RangeError(`${e} is not a valid parameter for validateLocale()`);const t=V().map(r=>r.toLowerCase()),n=e.toLowerCase();return t.includes(n)},je=(e,t)=>{const n=e.toLowerCase(),r=W(n)||!1,s=t.toString(),u=S(s);if(!r)throw new RangeError(`${e} is not a valid locale parameter for isLocaleValidForRegionId()`);if(!u)throw new RangeError(`${t} is not a valid regionId parameter for isLocaleValidForRegionId()`);return q(t).map(c=>c.toLowerCase()).includes(n)},Ce=f[h.DEFAULT_LOCALES],Ne=f[h.LOCALES],X=e=>{const t=e.toString();if(!S(t))throw new RangeError(`${t} is not a valid parameter for getDefaultLocaleNameForRegionId()`);const n=Ce[t];return Ne[e][n]},Ue=()=>{const e=D(),t=Object.keys(e);return Object.assign({},...t.map(n=>({[n]:X(n)})))},ze=()=>f.SC2_REALMS,Z=()=>{const e=Object.values(f.SC2_REALMS);return[].concat(...e).filter((t,n,r)=>n===r.indexOf(t))},J=e=>z(e,h.SC2_REALMS),P=e=>{const t=e.toString();return/^([1-9]{1})$/gi.test(t)},$e=e=>{if(!P(e))throw new RangeError(`${e} is not a valid parameter for validateSc2Realm()`);const t=Z(),n=typeof e=="number"?e:parseInt(e,10);return t.includes(n)},Pe=(e,t)=>{const n=P(e),r=t.toString(),s=S(r);if(!n)throw new RangeError(`${e} is not a valid sc2Realm parameter for isSc2RealmValidForRegionId()`);if(!s)throw new RangeError(`${t} is not a valid regionId parameter for isSc2RealmValidForRegionId()`);const u=J(t),c=typeof e=="number"?e:parseInt(e,10);return u.includes(c)},Be=e=>{const t=$(e,h.REGION_API_HOSTS);return typeof e=="string"&&e.toLowerCase()===m.kr?t[0]:typeof e=="string"&&e.toLowerCase()===m.tw?t[1]:t},He=e=>$(e,h.OAUTH_CHECK_TOKEN_URIS),xe=e=>$(e,h.OAUTH_TOKEN_URIS);var Fe=Object.defineProperty,Y=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,ee=(e,t,n)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))Ke.call(t,n)&&ee(e,n,t[n]);if(Y)for(var n of Y(t))Me.call(t,n)&&ee(e,n,t[n]);return e},Ge=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,c);i((n=n.apply(e,t)).next())});const B=e=>Ge(void 0,null,function*(){const{uri:t,timeout:n,headers:r,params:s,data:u,auth:c}=e,i=e.method||T.GET;if(!fe(t))throw new RangeError(`'${t}' is not a valid parameter for fetchFromUri()`);const o=b(b(b(b({method:i,url:encodeURI(t),timeout:n||1e4},r&&{headers:r}),s&&{params:s}),c&&{auth:c}),u&&{data:u}),l=yield ge.request(o),I=l.headers[w.LastModified]?l.headers[w.LastModified]:null;return b(b({},l.data),I&&{lastModified:I})}),te=e=>{const{region:t,clientId:n,clientSecret:r}=e;if(!n)throw new Error("Cannot get access token because no Battle.net client id was provided");if(!r)throw new Error("Cannot get access token because no Battle.net client secret was provided");const s="grant_type=client_credentials",u={username:n,password:r},c=xe(t);return B({data:s,auth:u,uri:c,method:T.POST})};var De=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,c);i((n=n.apply(e,t)).next())});const ne=(e,t)=>De(void 0,null,function*(){try{const n=`${He(e)}${t}`;return(yield B({uri:n})).error!==y.InvalidToken}catch{return!1}});var Ve=Object.defineProperty,oe=Object.getOwnPropertySymbols,qe=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,re=(e,t,n)=>t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j=(e,t)=>{for(var n in t||(t={}))qe.call(t,n)&&re(e,n,t[n]);if(oe)for(var n of oe(t))Qe.call(t,n)&&re(e,n,t[n]);return e},ae=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,c);i((n=n.apply(e,t)).next())});const se=(e,t)=>{const{region:n,endpoint:r,options:s}=e,{headers:u,params:c,timeout:i}=s;if(!pe(r))throw new RangeError(`${r} is not a valid endpoint.`);const o=`${Be(n)}${r}`,l={Authorization:`Bearer ${t}`},I=j(j({},u),l);return B(j(j({uri:o,method:T.GET,headers:I},c&&{params:c}),i&&{timeout:i}))},ie=e=>ae(void 0,null,function*(){const{onAccessTokenRefresh:t}=e.options,n=(yield te(e)).access_token;return t?.(n),se(e,n)}),We=e=>ae(void 0,null,function*(){var t;const{region:n,accessToken:r}=e,{validateAccessTokenOnEachQuery:s,refreshExpiredAccessToken:u,onAccessTokenExpired:c}=e.options;if(s&&!(yield ne(n,r)))return c?.(),u?ie(e):{error:y.AccessTokenInvalid};try{return yield se(e,r)}catch(i){if(((t=i.response)==null?void 0:t.status)===C.NotAuthorized)return c?.(),u?ie(e):Promise.resolve({error:y.AccessTokenExpired});throw i}});var Xe=Object.defineProperty,Ze=(e,t,n)=>t in e?Xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ce=(e,t,n)=>(Ze(e,typeof t!="symbol"?t+"":t,n),n);class Je{constructor(t,n){ce(this,"clientId"),ce(this,"clientSecret"),this.clientId=t,this.clientSecret=n}}var Ye=Object.defineProperty,et=(e,t,n)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>(et(e,typeof t!="symbol"?t+"":t,n),n),H=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,c);i((n=n.apply(e,t)).next())});class le extends Je{constructor(t){super(t.clientId,t.clientSecret),E(this,"region"),E(this,"accessTokenObject"),E(this,"getAccessToken",()=>H(this,null,function*(){return(yield this.getAccessTokenObject()).access_token})),E(this,"getAccessTokenObject",()=>this.accessTokenObject?Promise.resolve(this.accessTokenObject):this.setAccessTokenObject()),E(this,"getAccessTokenObjectFromBnet",()=>H(this,null,function*(){return te({region:this.region,clientId:this.clientId,clientSecret:this.clientSecret})})),this.region=t.region,this.accessTokenObject=t.accessToken?{access_token:t.accessToken}:void 0}setAccessToken(){return this.setAccessTokenObject()}setAccessTokenObject(){return H(this,null,function*(){return this.accessTokenObject=yield this.getAccessTokenObjectFromBnet(),this.accessTokenObject})}}E(le,"validateAccessToken",(e,t)=>ne(e,t));var tt=Object.defineProperty,ue=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,x=(e,t,n)=>t in e?tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,de=(e,t)=>{for(var n in t||(t={}))nt.call(t,n)&&x(e,n,t[n]);if(ue)for(var n of ue(t))ot.call(t,n)&&x(e,n,t[n]);return e},d=(e,t,n)=>(x(e,typeof t!="symbol"?t+"":t,n),n),rt=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,c);i((n=n.apply(e,t)).next())});class g extends le{constructor(t){super({region:t.region,clientId:t.clientId,clientSecret:t.clientSecret,accessToken:t.accessToken}),d(this,"options"),d(this,"query",(n,r)=>rt(this,null,function*(){return We({endpoint:n,region:r?.region||this.region,clientId:this.clientId,clientSecret:this.clientSecret,accessToken:yield this.getAccessToken(),options:de(de({},this.options),r)})})),this.options={validateAccessTokenOnEachQuery:t.validateAccessTokenOnEachQuery||!1,refreshExpiredAccessToken:t.refreshExpiredAccessToken||!1,onAccessTokenExpired:t.onAccessTokenExpired||void 0,onAccessTokenRefresh:t.onAccessTokenRefresh||void 0}}setRegion(t){this.region=t}}d(g,"getAllRegions",_e),d(g,"getAllRegionIds",ye),d(g,"getAllRegionNames",Ie),d(g,"getRegionNameById",M),d(g,"validateRegionId",S),d(g,"getRegionIdByName",U),d(g,"validateRegionName",G),d(g,"getAllLocales",D),d(g,"getAllLocaleNames",V),d(g,"getLocalesByRegionId",q),d(g,"checkIfLocaleLooksValid",Q),d(g,"validateLocale",W),d(g,"isLocaleValidForRegionId",je),d(g,"getAllSc2Realms",ze),d(g,"getAllAvailableSc2Realms",Z),d(g,"getSc2RealmsByRegionId",J),d(g,"checkIfSc2RealmLooksValid",P),d(g,"validateSc2Realm",$e),d(g,"isSc2RealmValidForRegionId",Pe),d(g,"getDefaultLocaleNameForRegionId",X),d(g,"getAllDefaultLocaleNames",Ue),exports.ApiHeaders=w,exports.BlizzAPI=g,exports.ConstantKey=h,exports.DefaultLocaleIndex=v,exports.ErrorCode=C,exports.ErrorResponseMessage=y,exports.HttpMethod=T,exports.Locale=R,exports.OAuthEndpoint=_,exports.OAuthHost=k,exports.RegionHost=O,exports.RegionIdAsStringEnum=F,exports.RegionIdEnum=a,exports.RegionNameEnum=m,exports.Sc2Realm=p,exports.Sc2RealmAsString=K;

@@ -1,1 +0,1 @@

(function(g,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("axios")):typeof define=="function"&&define.amd?define(["exports","axios"],E):(g=typeof globalThis<"u"?globalThis:g||self,E(g.BlizzAPI={},g.axios))})(this,function(g,E){"use strict";var h=(e=>(e.REGIONS="REGIONS",e.LOCALES="LOCALES",e.DEFAULT_LOCALES="DEFAULT_LOCALES",e.REGION_API_HOSTS="REGION_API_HOSTS",e.SC2_REALMS="SC2_REALMS",e.OAUTH_AUTHORIZE_URIS="OAUTH_AUTHORIZE_URIS",e.OAUTH_TOKEN_URIS="OAUTH_TOKEN_URIS",e.OAUTH_CHECK_TOKEN_URIS="OAUTH_CHECK_TOKEN_URIS",e))(h||{}),m=(e=>(e.us="us",e.eu="eu",e.kr="kr",e.tw="tw",e.cn="cn",e))(m||{}),a=(e=>(e[e.us=1]="us",e[e.eu=2]="eu",e[e.kr=3]="kr",e[e.tw=3]="tw",e[e.cn=5]="cn",e))(a||{}),F=(e=>(e.us="1",e.eu="2",e.kr="3",e.tw="3",e.cn="5",e))(F||{}),R=(e=>(e.en_US="en_US",e.es_MX="es_MX",e.pt_BR="pt_BR",e.en_GB="en_GB",e.es_ES="es_ES",e.fr_FR="fr_FR",e.ru_RU="ru_RU",e.de_DE="de_DE",e.pt_PT="pt_PT",e.it_IT="it_IT",e.ko_KR="ko_KR",e.zh_TW="zh_TW",e.zh_CN="zh_CN",e))(R||{}),k=(e=>(e[e.us=0]="us",e[e.eu=0]="eu",e[e.kr=0]="kr",e[e.tw=0]="tw",e[e.cn=0]="cn",e))(k||{}),f=(e=>(e[e.US=1]="US",e[e.LatAm=2]="LatAm",e[e.Europe=1]="Europe",e[e.Russia=2]="Russia",e[e.Korea=1]="Korea",e[e.Taiwan=2]="Taiwan",e[e.China=1]="China",e))(f||{}),K=(e=>(e.US="1",e.LatAm="2",e.Europe="1",e.Russia="2",e.Korea="1",e.Taiwan="2",e.China="1",e))(K||{}),_=(e=>(e.GET="GET",e.POST="POST",e))(_||{}),v=(e=>(e.us="https://us.battle.net",e.eu="https://eu.battle.net",e.kr="https://apac.battle.net",e.tw="https://apac.battle.net",e.cn="https://www.battlenet.com.cn",e))(v||{}),O=(e=>(e.us="https://us.api.blizzard.com",e.eu="https://eu.api.blizzard.com",e.kr="https://kr.api.blizzard.com",e.tw="https://tw.api.blizzard.com",e.cn="https://gateway.battlenet.com.cn",e))(O||{}),I=(e=>(e.authorize="/oauth/authorize",e.token="/oauth/token",e.checkToken="/oauth/check_token?token=",e))(I||{}),b=(e=>(e.LastModified="last-modified",e))(b||{}),C=(e=>(e[e.NotAuthorized=401]="NotAuthorized",e))(C||{}),y=(e=>(e.InvalidToken="invalid_token",e.AccessTokenInvalid="access_token_invalid",e.AccessTokenExpired="access_token_invalid",e))(y||{});const de=e=>e[0]==="/",ge=e=>e.length>3,he=[de,ge],Re=e=>he.every(t=>t(e)),me=e=>/(?:http[s]?:\/\/)[^\s(["<,>]*\.[^\s[",><]*/gm.test(e),fe=Object.freeze({[a.us]:k.us,[a.eu]:k.eu,[a.kr]:k.kr,[a.cn]:k.cn}),pe=Object.freeze({[a.us]:Object.freeze([R.en_US,R.es_MX,R.pt_BR]),[a.eu]:Object.freeze([R.en_GB,R.es_ES,R.fr_FR,R.ru_RU,R.de_DE,R.pt_PT,R.it_IT]),[a.kr]:Object.freeze([R.ko_KR,R.zh_TW]),[a.cn]:Object.freeze([R.zh_CN])}),Oe=Object.freeze({[a.us]:Object.freeze([m.us]),[a.eu]:Object.freeze([m.eu]),[a.kr]:Object.freeze([m.kr,m.tw]),[a.cn]:Object.freeze([m.cn])}),Ae=Object.freeze({[a.us]:Object.freeze([f.US,f.LatAm]),[a.eu]:Object.freeze([f.Europe,f.Russia]),[a.kr]:Object.freeze([f.Korea,f.Taiwan]),[a.cn]:Object.freeze([f.China])}),ke=Object.freeze({[a.us]:O.us,[a.eu]:O.eu,[a.kr]:[O.kr,O.tw],[a.cn]:O.cn}),w=Object.freeze({[a.us]:v.us,[a.eu]:v.eu,[a.kr]:v.kr,[a.cn]:v.cn}),z=e=>Object.freeze({[a.us]:`${w[a.us]}${e}`,[a.eu]:`${w[a.eu]}${e}`,[a.kr]:`${w[a.kr]}${e}`,[a.cn]:`${w[a.cn]}${e}`}),ve=z(I.authorize),Se=z(I.token),Te=z(I.checkToken),p={[h.REGIONS]:Oe,[h.LOCALES]:pe,[h.DEFAULT_LOCALES]:fe,[h.SC2_REALMS]:Ae,[h.REGION_API_HOSTS]:ke,[h.OAUTH_AUTHORIZE_URIS]:ve,[h.OAUTH_TOKEN_URIS]:Se,[h.OAUTH_CHECK_TOKEN_URIS]:Te},A=p[h.REGIONS],Ee=()=>A,_e=()=>Object.keys(A).map(e=>parseInt(e,10)),Ie=()=>{const e=Object.values(A);return[].concat(...e).map(t=>t.toString())},M=e=>{const t=Object.keys(A),n=e.toString();if(!t.includes(n))throw new RangeError(`${n} is not a valid parameter for getRegionNameById()`);return A[n]},S=e=>{try{return!!M(e)}catch{return!1}},N=e=>{const t=e.toLowerCase(),n=Object.keys(A).filter(s=>A[s].includes(t)),r=Number(n[0])||!1;if(!r)throw new RangeError(`"${e}" is not a valid parameter for getRegionIdByName()`);return r},x=e=>{try{return!!N(e)}catch{return!1}},U=(e,t)=>{const n=typeof e=="string"?e:e.toString();if(!S(n))throw new RangeError(`${n} is not a valid parameter for getConstantByRegionId(${e}, '${t}')`);return p[t][e]},ye=(e,t)=>{if(!x(e))throw new RangeError(`${e} is not a valid parameter for getConstantByRegionName(${e}, '${t}')`);const n=N(e);return p[t][n]},$=(e,t)=>S(e)?U(e,t):ye(e.toString(),t),be=p[h.LOCALES],G=()=>be,D=()=>Object.keys(R).filter(e=>Number.isNaN(Number(e))).map(e=>e.toString()),V=e=>U(e,h.LOCALES),q=e=>/^(?:[a-z]{2}_[a-z]{2})$/gi.test(e),Q=e=>{if(!q(e))throw new RangeError(`${e} is not a valid parameter for validateLocale()`);const t=D().map(r=>r.toLowerCase()),n=e.toLowerCase();return t.includes(n)},we=(e,t)=>{const n=e.toLowerCase(),r=Q(n)||!1,s=t.toString(),u=S(s);if(!r)throw new RangeError(`${e} is not a valid locale parameter for isLocaleValidForRegionId()`);if(!u)throw new RangeError(`${t} is not a valid regionId parameter for isLocaleValidForRegionId()`);return V(t).map(i=>i.toLowerCase()).includes(n)},Le=p[h.DEFAULT_LOCALES],je=p[h.LOCALES],W=e=>{const t=e.toString();if(!S(t))throw new RangeError(`${t} is not a valid parameter for getDefaultLocaleNameForRegionId()`);const n=Le[t];return je[e][n]},Ce=()=>{const e=G(),t=Object.keys(e);return Object.assign({},...t.map(n=>({[n]:W(n)})))},ze=()=>p.SC2_REALMS,X=()=>{const e=Object.values(p.SC2_REALMS);return[].concat(...e).filter((t,n,r)=>n===r.indexOf(t))},Z=e=>U(e,h.SC2_REALMS),P=e=>{const t=e.toString();return/^([1-9]{1})$/gi.test(t)},Ne=e=>{if(!P(e))throw new RangeError(`${e} is not a valid parameter for validateSc2Realm()`);const t=X(),n=typeof e=="number"?e:parseInt(e,10);return t.includes(n)},Ue=(e,t)=>{const n=P(e),r=t.toString(),s=S(r);if(!n)throw new RangeError(`${e} is not a valid sc2Realm parameter for isSc2RealmValidForRegionId()`);if(!s)throw new RangeError(`${t} is not a valid regionId parameter for isSc2RealmValidForRegionId()`);const u=Z(t),i=typeof e=="number"?e:parseInt(e,10);return u.includes(i)},$e=e=>{const t=$(e,h.REGION_API_HOSTS);return typeof e=="string"&&e.toLowerCase()===m.kr?t[0]:typeof e=="string"&&e.toLowerCase()===m.tw?t[1]:t},Pe=e=>$(e,h.OAUTH_CHECK_TOKEN_URIS),Be=e=>$(e,h.OAUTH_TOKEN_URIS);var He=Object.defineProperty,J=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Ke=Object.prototype.propertyIsEnumerable,Y=(e,t,n)=>t in e?He(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))Fe.call(t,n)&&Y(e,n,t[n]);if(J)for(var n of J(t))Ke.call(t,n)&&Y(e,n,t[n]);return e},Me=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});const B=e=>Me(void 0,null,function*(){const{uri:t,timeout:n,headers:r,params:s,data:u,auth:i}=e,c=e.method||_.GET;if(!me(t))throw new RangeError(`'${t}' is not a valid parameter for fetchFromUri()`);const o=T(T(T(T({method:c,url:encodeURI(t),timeout:n||1e4},r&&{headers:r}),s&&{params:s}),i&&{auth:i}),u&&{data:u}),l=yield E.request(o),j=l.headers[b.LastModified]?l.headers[b.LastModified]:null;return T(T({},l.data),j&&{lastModified:j})}),ee=e=>{const{region:t,clientId:n,clientSecret:r}=e;if(!n)throw new Error("Cannot get access token because no Battle.net client id was provided");if(!r)throw new Error("Cannot get access token because no Battle.net client secret was provided");const s="grant_type=client_credentials",u={username:n,password:r},i=Be(t);return B({data:s,auth:u,uri:i,method:_.POST})};var xe=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});const te=(e,t)=>xe(void 0,null,function*(){try{const n=`${Pe(e)}${t}`;return(yield B({uri:n})).error!==y.InvalidToken}catch{return!1}});var Ge=Object.defineProperty,ne=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable,oe=(e,t,n)=>t in e?Ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&oe(e,n,t[n]);if(ne)for(var n of ne(t))Ve.call(t,n)&&oe(e,n,t[n]);return e},re=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});const ae=(e,t)=>{const{region:n,endpoint:r,options:s}=e,{headers:u,params:i,timeout:c}=s;if(!Re(r))throw new RangeError(`${r} is not a valid endpoint.`);const o=`${$e(n)}${r}`,l={Authorization:`Bearer ${t}`},j=L(L({},u),l);return B(L(L({uri:o,method:_.GET,headers:j},i&&{params:i}),c&&{timeout:c}))},se=e=>re(void 0,null,function*(){const{onAccessTokenRefresh:t}=e.options,n=(yield ee(e)).access_token;return t?.(n),ae(e,n)}),qe=e=>re(void 0,null,function*(){var t;const{region:n,accessToken:r}=e,{validateAccessTokenOnEachQuery:s,refreshExpiredAccessToken:u,onAccessTokenExpired:i}=e.options;if(s&&!(yield te(n,r)))return i?.(),u?se(e):{error:y.AccessTokenInvalid};try{return yield ae(e,r)}catch(c){if(((t=c.response)==null?void 0:t.status)===C.NotAuthorized)return i?.(),u?se(e):Promise.resolve({error:y.AccessTokenExpired});throw c}});class Qe{constructor(t,n){this.clientId=t,this.clientSecret=n}}var H=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});class ce extends Qe{constructor(t){super(t.clientId,t.clientSecret),this.getAccessToken=()=>H(this,null,function*(){return(yield this.getAccessTokenObject()).access_token}),this.getAccessTokenObject=()=>this.accessTokenObject?Promise.resolve(this.accessTokenObject):this.setAccessTokenObject(),this.getAccessTokenObjectFromBnet=()=>H(this,null,function*(){return ee({region:this.region,clientId:this.clientId,clientSecret:this.clientSecret})}),this.region=t.region,this.accessTokenObject=t.accessToken?{access_token:t.accessToken}:void 0}setAccessToken(){return this.setAccessTokenObject()}setAccessTokenObject(){return H(this,null,function*(){return this.accessTokenObject=yield this.getAccessTokenObjectFromBnet(),this.accessTokenObject})}}ce.validateAccessToken=(e,t)=>te(e,t);var We=Object.defineProperty,ie=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,le=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ue=(e,t)=>{for(var n in t||(t={}))Xe.call(t,n)&&le(e,n,t[n]);if(ie)for(var n of ie(t))Ze.call(t,n)&&le(e,n,t[n]);return e},Je=(e,t,n)=>new Promise((r,s)=>{var u=o=>{try{c(n.next(o))}catch(l){s(l)}},i=o=>{try{c(n.throw(o))}catch(l){s(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(u,i);c((n=n.apply(e,t)).next())});class d extends ce{constructor(t){super({region:t.region,clientId:t.clientId,clientSecret:t.clientSecret,accessToken:t.accessToken}),this.query=(n,r)=>Je(this,null,function*(){return qe({endpoint:n,region:r?.region||this.region,clientId:this.clientId,clientSecret:this.clientSecret,accessToken:yield this.getAccessToken(),options:ue(ue({},this.options),r)})}),this.options={validateAccessTokenOnEachQuery:t.validateAccessTokenOnEachQuery||!1,refreshExpiredAccessToken:t.refreshExpiredAccessToken||!1,onAccessTokenExpired:t.onAccessTokenExpired||void 0,onAccessTokenRefresh:t.onAccessTokenRefresh||void 0}}setRegion(t){this.region=t}}d.getAllRegions=Ee,d.getAllRegionIds=_e,d.getAllRegionNames=Ie,d.getRegionNameById=M,d.validateRegionId=S,d.getRegionIdByName=N,d.validateRegionName=x,d.getAllLocales=G,d.getAllLocaleNames=D,d.getLocalesByRegionId=V,d.checkIfLocaleLooksValid=q,d.validateLocale=Q,d.isLocaleValidForRegionId=we,d.getAllSc2Realms=ze,d.getAllAvailableSc2Realms=X,d.getSc2RealmsByRegionId=Z,d.checkIfSc2RealmLooksValid=P,d.validateSc2Realm=Ne,d.isSc2RealmValidForRegionId=Ue,d.getDefaultLocaleNameForRegionId=W,d.getAllDefaultLocaleNames=Ce,g.ApiHeaders=b,g.BlizzAPI=d,g.ConstantKey=h,g.DefaultLocaleIndex=k,g.ErrorCode=C,g.ErrorResponseMessage=y,g.HttpMethod=_,g.Locale=R,g.OAuthEndpoint=I,g.OAuthHost=v,g.RegionHost=O,g.RegionIdAsStringEnum=F,g.RegionIdEnum=a,g.RegionNameEnum=m,g.Sc2Realm=f,g.Sc2RealmAsString=K});
(function(h,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("axios")):typeof define=="function"&&define.amd?define(["exports","axios"],y):(h=typeof globalThis<"u"?globalThis:h||self,y(h.BlizzAPI={},h.axios))})(this,function(h,y){"use strict";var R=(e=>(e.REGIONS="REGIONS",e.LOCALES="LOCALES",e.DEFAULT_LOCALES="DEFAULT_LOCALES",e.REGION_API_HOSTS="REGION_API_HOSTS",e.SC2_REALMS="SC2_REALMS",e.OAUTH_AUTHORIZE_URIS="OAUTH_AUTHORIZE_URIS",e.OAUTH_TOKEN_URIS="OAUTH_TOKEN_URIS",e.OAUTH_CHECK_TOKEN_URIS="OAUTH_CHECK_TOKEN_URIS",e))(R||{}),m=(e=>(e.us="us",e.eu="eu",e.kr="kr",e.tw="tw",e.cn="cn",e))(m||{}),a=(e=>(e[e.us=1]="us",e[e.eu=2]="eu",e[e.kr=3]="kr",e[e.tw=3]="tw",e[e.cn=5]="cn",e))(a||{}),x=(e=>(e.us="1",e.eu="2",e.kr="3",e.tw="3",e.cn="5",e))(x||{}),f=(e=>(e.en_US="en_US",e.es_MX="es_MX",e.pt_BR="pt_BR",e.en_GB="en_GB",e.es_ES="es_ES",e.fr_FR="fr_FR",e.ru_RU="ru_RU",e.de_DE="de_DE",e.pt_PT="pt_PT",e.it_IT="it_IT",e.ko_KR="ko_KR",e.zh_TW="zh_TW",e.zh_CN="zh_CN",e))(f||{}),k=(e=>(e[e.us=0]="us",e[e.eu=0]="eu",e[e.kr=0]="kr",e[e.tw=0]="tw",e[e.cn=0]="cn",e))(k||{}),p=(e=>(e[e.US=1]="US",e[e.LatAm=2]="LatAm",e[e.Europe=1]="Europe",e[e.Russia=2]="Russia",e[e.Korea=1]="Korea",e[e.Taiwan=2]="Taiwan",e[e.China=1]="China",e))(p||{}),G=(e=>(e.US="1",e.LatAm="2",e.Europe="1",e.Russia="2",e.Korea="1",e.Taiwan="2",e.China="1",e))(G||{}),_=(e=>(e.GET="GET",e.POST="POST",e))(_||{}),S=(e=>(e.us="https://us.battle.net",e.eu="https://eu.battle.net",e.kr="https://apac.battle.net",e.tw="https://apac.battle.net",e.cn="https://www.battlenet.com.cn",e))(S||{}),A=(e=>(e.us="https://us.api.blizzard.com",e.eu="https://eu.api.blizzard.com",e.kr="https://kr.api.blizzard.com",e.tw="https://tw.api.blizzard.com",e.cn="https://gateway.battlenet.com.cn",e))(A||{}),I=(e=>(e.authorize="/oauth/authorize",e.token="/oauth/token",e.checkToken="/oauth/check_token?token=",e))(I||{}),L=(e=>(e.LastModified="last-modified",e))(L||{}),z=(e=>(e[e.NotAuthorized=401]="NotAuthorized",e))(z||{}),w=(e=>(e.InvalidToken="invalid_token",e.AccessTokenInvalid="access_token_invalid",e.AccessTokenExpired="access_token_invalid",e))(w||{});const Re=e=>e[0]==="/",fe=e=>e.length>3,me=[Re,fe],pe=e=>me.every(t=>t(e)),Oe=e=>/(?:http[s]?:\/\/)[^\s(["<,>]*\.[^\s[",><]*/gm.test(e),Ae=Object.freeze({[a.us]:k.us,[a.eu]:k.eu,[a.kr]:k.kr,[a.cn]:k.cn}),ve=Object.freeze({[a.us]:Object.freeze([f.en_US,f.es_MX,f.pt_BR]),[a.eu]:Object.freeze([f.en_GB,f.es_ES,f.fr_FR,f.ru_RU,f.de_DE,f.pt_PT,f.it_IT]),[a.kr]:Object.freeze([f.ko_KR,f.zh_TW]),[a.cn]:Object.freeze([f.zh_CN])}),ke=Object.freeze({[a.us]:Object.freeze([m.us]),[a.eu]:Object.freeze([m.eu]),[a.kr]:Object.freeze([m.kr,m.tw]),[a.cn]:Object.freeze([m.cn])}),Se=Object.freeze({[a.us]:Object.freeze([p.US,p.LatAm]),[a.eu]:Object.freeze([p.Europe,p.Russia]),[a.kr]:Object.freeze([p.Korea,p.Taiwan]),[a.cn]:Object.freeze([p.China])}),Te=Object.freeze({[a.us]:A.us,[a.eu]:A.eu,[a.kr]:[A.kr,A.tw],[a.cn]:A.cn}),j=Object.freeze({[a.us]:S.us,[a.eu]:S.eu,[a.kr]:S.kr,[a.cn]:S.cn}),U=e=>Object.freeze({[a.us]:`${j[a.us]}${e}`,[a.eu]:`${j[a.eu]}${e}`,[a.kr]:`${j[a.kr]}${e}`,[a.cn]:`${j[a.cn]}${e}`}),be=U(I.authorize),Ee=U(I.token),ye=U(I.checkToken),O={[R.REGIONS]:ke,[R.LOCALES]:ve,[R.DEFAULT_LOCALES]:Ae,[R.SC2_REALMS]:Se,[R.REGION_API_HOSTS]:Te,[R.OAUTH_AUTHORIZE_URIS]:be,[R.OAUTH_TOKEN_URIS]:Ee,[R.OAUTH_CHECK_TOKEN_URIS]:ye},v=O[R.REGIONS],_e=()=>v,Ie=()=>Object.keys(v).map(e=>parseInt(e,10)),we=()=>{const e=Object.values(v);return[].concat(...e).map(t=>t.toString())},D=e=>{const t=Object.keys(v),n=e.toString();if(!t.includes(n))throw new RangeError(`${n} is not a valid parameter for getRegionNameById()`);return v[n]},T=e=>{try{return!!D(e)}catch{return!1}},$=e=>{const t=e.toLowerCase(),n=Object.keys(v).filter(s=>v[s].includes(t)),r=Number(n[0])||!1;if(!r)throw new RangeError(`"${e}" is not a valid parameter for getRegionIdByName()`);return r},V=e=>{try{return!!$(e)}catch{return!1}},P=(e,t)=>{const n=typeof e=="string"?e:e.toString();if(!T(n))throw new RangeError(`${n} is not a valid parameter for getConstantByRegionId(${e}, '${t}')`);return O[t][e]},Le=(e,t)=>{if(!V(e))throw new RangeError(`${e} is not a valid parameter for getConstantByRegionName(${e}, '${t}')`);const n=$(e);return O[t][n]},B=(e,t)=>T(e)?P(e,t):Le(e.toString(),t),je=O[R.LOCALES],q=()=>je,Q=()=>Object.keys(f).filter(e=>Number.isNaN(Number(e))).map(e=>e.toString()),W=e=>P(e,R.LOCALES),X=e=>/^(?:[a-z]{2}_[a-z]{2})$/gi.test(e),Z=e=>{if(!X(e))throw new RangeError(`${e} is not a valid parameter for validateLocale()`);const t=Q().map(r=>r.toLowerCase()),n=e.toLowerCase();return t.includes(n)},Ce=(e,t)=>{const n=e.toLowerCase(),r=Z(n)||!1,s=t.toString(),d=T(s);if(!r)throw new RangeError(`${e} is not a valid locale parameter for isLocaleValidForRegionId()`);if(!d)throw new RangeError(`${t} is not a valid regionId parameter for isLocaleValidForRegionId()`);return W(t).map(c=>c.toLowerCase()).includes(n)},Ne=O[R.DEFAULT_LOCALES],ze=O[R.LOCALES],J=e=>{const t=e.toString();if(!T(t))throw new RangeError(`${t} is not a valid parameter for getDefaultLocaleNameForRegionId()`);const n=Ne[t];return ze[e][n]},Ue=()=>{const e=q(),t=Object.keys(e);return Object.assign({},...t.map(n=>({[n]:J(n)})))},$e=()=>O.SC2_REALMS,Y=()=>{const e=Object.values(O.SC2_REALMS);return[].concat(...e).filter((t,n,r)=>n===r.indexOf(t))},ee=e=>P(e,R.SC2_REALMS),H=e=>{const t=e.toString();return/^([1-9]{1})$/gi.test(t)},Pe=e=>{if(!H(e))throw new RangeError(`${e} is not a valid parameter for validateSc2Realm()`);const t=Y(),n=typeof e=="number"?e:parseInt(e,10);return t.includes(n)},Be=(e,t)=>{const n=H(e),r=t.toString(),s=T(r);if(!n)throw new RangeError(`${e} is not a valid sc2Realm parameter for isSc2RealmValidForRegionId()`);if(!s)throw new RangeError(`${t} is not a valid regionId parameter for isSc2RealmValidForRegionId()`);const d=ee(t),c=typeof e=="number"?e:parseInt(e,10);return d.includes(c)},He=e=>{const t=B(e,R.REGION_API_HOSTS);return typeof e=="string"&&e.toLowerCase()===m.kr?t[0]:typeof e=="string"&&e.toLowerCase()===m.tw?t[1]:t},Fe=e=>B(e,R.OAUTH_CHECK_TOKEN_URIS),Ke=e=>B(e,R.OAUTH_TOKEN_URIS);var Me=Object.defineProperty,te=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable,ne=(e,t,n)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))xe.call(t,n)&&ne(e,n,t[n]);if(te)for(var n of te(t))Ge.call(t,n)&&ne(e,n,t[n]);return e},De=(e,t,n)=>new Promise((r,s)=>{var d=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(d,c);i((n=n.apply(e,t)).next())});const F=e=>De(void 0,null,function*(){const{uri:t,timeout:n,headers:r,params:s,data:d,auth:c}=e,i=e.method||_.GET;if(!Oe(t))throw new RangeError(`'${t}' is not a valid parameter for fetchFromUri()`);const o=b(b(b(b({method:i,url:encodeURI(t),timeout:n||1e4},r&&{headers:r}),s&&{params:s}),c&&{auth:c}),d&&{data:d}),l=yield y.request(o),N=l.headers[L.LastModified]?l.headers[L.LastModified]:null;return b(b({},l.data),N&&{lastModified:N})}),oe=e=>{const{region:t,clientId:n,clientSecret:r}=e;if(!n)throw new Error("Cannot get access token because no Battle.net client id was provided");if(!r)throw new Error("Cannot get access token because no Battle.net client secret was provided");const s="grant_type=client_credentials",d={username:n,password:r},c=Ke(t);return F({data:s,auth:d,uri:c,method:_.POST})};var Ve=(e,t,n)=>new Promise((r,s)=>{var d=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(d,c);i((n=n.apply(e,t)).next())});const re=(e,t)=>Ve(void 0,null,function*(){try{const n=`${Fe(e)}${t}`;return(yield F({uri:n})).error!==w.InvalidToken}catch{return!1}});var qe=Object.defineProperty,ae=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,se=(e,t,n)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))Qe.call(t,n)&&se(e,n,t[n]);if(ae)for(var n of ae(t))We.call(t,n)&&se(e,n,t[n]);return e},ie=(e,t,n)=>new Promise((r,s)=>{var d=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(d,c);i((n=n.apply(e,t)).next())});const ce=(e,t)=>{const{region:n,endpoint:r,options:s}=e,{headers:d,params:c,timeout:i}=s;if(!pe(r))throw new RangeError(`${r} is not a valid endpoint.`);const o=`${He(n)}${r}`,l={Authorization:`Bearer ${t}`},N=C(C({},d),l);return F(C(C({uri:o,method:_.GET,headers:N},c&&{params:c}),i&&{timeout:i}))},le=e=>ie(void 0,null,function*(){const{onAccessTokenRefresh:t}=e.options,n=(yield oe(e)).access_token;return t?.(n),ce(e,n)}),Xe=e=>ie(void 0,null,function*(){var t;const{region:n,accessToken:r}=e,{validateAccessTokenOnEachQuery:s,refreshExpiredAccessToken:d,onAccessTokenExpired:c}=e.options;if(s&&!(yield re(n,r)))return c?.(),d?le(e):{error:w.AccessTokenInvalid};try{return yield ce(e,r)}catch(i){if(((t=i.response)==null?void 0:t.status)===z.NotAuthorized)return c?.(),d?le(e):Promise.resolve({error:w.AccessTokenExpired});throw i}});var Ze=Object.defineProperty,Je=(e,t,n)=>t in e?Ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ue=(e,t,n)=>(Je(e,typeof t!="symbol"?t+"":t,n),n);class Ye{constructor(t,n){ue(this,"clientId"),ue(this,"clientSecret"),this.clientId=t,this.clientSecret=n}}var et=Object.defineProperty,tt=(e,t,n)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>(tt(e,typeof t!="symbol"?t+"":t,n),n),K=(e,t,n)=>new Promise((r,s)=>{var d=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(d,c);i((n=n.apply(e,t)).next())});class de extends Ye{constructor(t){super(t.clientId,t.clientSecret),E(this,"region"),E(this,"accessTokenObject"),E(this,"getAccessToken",()=>K(this,null,function*(){return(yield this.getAccessTokenObject()).access_token})),E(this,"getAccessTokenObject",()=>this.accessTokenObject?Promise.resolve(this.accessTokenObject):this.setAccessTokenObject()),E(this,"getAccessTokenObjectFromBnet",()=>K(this,null,function*(){return oe({region:this.region,clientId:this.clientId,clientSecret:this.clientSecret})})),this.region=t.region,this.accessTokenObject=t.accessToken?{access_token:t.accessToken}:void 0}setAccessToken(){return this.setAccessTokenObject()}setAccessTokenObject(){return K(this,null,function*(){return this.accessTokenObject=yield this.getAccessTokenObjectFromBnet(),this.accessTokenObject})}}E(de,"validateAccessToken",(e,t)=>re(e,t));var nt=Object.defineProperty,ge=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,he=(e,t)=>{for(var n in t||(t={}))ot.call(t,n)&&M(e,n,t[n]);if(ge)for(var n of ge(t))rt.call(t,n)&&M(e,n,t[n]);return e},u=(e,t,n)=>(M(e,typeof t!="symbol"?t+"":t,n),n),at=(e,t,n)=>new Promise((r,s)=>{var d=o=>{try{i(n.next(o))}catch(l){s(l)}},c=o=>{try{i(n.throw(o))}catch(l){s(l)}},i=o=>o.done?r(o.value):Promise.resolve(o.value).then(d,c);i((n=n.apply(e,t)).next())});class g extends de{constructor(t){super({region:t.region,clientId:t.clientId,clientSecret:t.clientSecret,accessToken:t.accessToken}),u(this,"options"),u(this,"query",(n,r)=>at(this,null,function*(){return Xe({endpoint:n,region:r?.region||this.region,clientId:this.clientId,clientSecret:this.clientSecret,accessToken:yield this.getAccessToken(),options:he(he({},this.options),r)})})),this.options={validateAccessTokenOnEachQuery:t.validateAccessTokenOnEachQuery||!1,refreshExpiredAccessToken:t.refreshExpiredAccessToken||!1,onAccessTokenExpired:t.onAccessTokenExpired||void 0,onAccessTokenRefresh:t.onAccessTokenRefresh||void 0}}setRegion(t){this.region=t}}u(g,"getAllRegions",_e),u(g,"getAllRegionIds",Ie),u(g,"getAllRegionNames",we),u(g,"getRegionNameById",D),u(g,"validateRegionId",T),u(g,"getRegionIdByName",$),u(g,"validateRegionName",V),u(g,"getAllLocales",q),u(g,"getAllLocaleNames",Q),u(g,"getLocalesByRegionId",W),u(g,"checkIfLocaleLooksValid",X),u(g,"validateLocale",Z),u(g,"isLocaleValidForRegionId",Ce),u(g,"getAllSc2Realms",$e),u(g,"getAllAvailableSc2Realms",Y),u(g,"getSc2RealmsByRegionId",ee),u(g,"checkIfSc2RealmLooksValid",H),u(g,"validateSc2Realm",Pe),u(g,"isSc2RealmValidForRegionId",Be),u(g,"getDefaultLocaleNameForRegionId",J),u(g,"getAllDefaultLocaleNames",Ue),h.ApiHeaders=L,h.BlizzAPI=g,h.ConstantKey=R,h.DefaultLocaleIndex=k,h.ErrorCode=z,h.ErrorResponseMessage=w,h.HttpMethod=_,h.Locale=f,h.OAuthEndpoint=I,h.OAuthHost=S,h.RegionHost=A,h.RegionIdAsStringEnum=x,h.RegionIdEnum=a,h.RegionNameEnum=m,h.Sc2Realm=p,h.Sc2RealmAsString=G});
{
"name": "blizzapi",
"version": "2.6.0",
"version": "2.6.1",
"description": "Flexible and feature-rich library for easy access to Blizzard Battle.net APIs",

@@ -59,21 +59,32 @@ "keywords": [

"dependencies": {
"axios": "^1.3.4"
"axios": "^1.4.0"
},
"devDependencies": {
"@types/jest": "^29.5.0",
"@types/node": "^18.15.6",
"esbuild": "^0.17.12",
"eslint": "^8.36.0",
"eslint-config-lukemnet": "^1.0.3",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.5",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"esbuild": "^0.18.17",
"eslint": "^8.45.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^8.9.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^48.0.1",
"husky": "^8.0.3",
"jest": "^29.5.0",
"lint-staged": "^13.2.0",
"prettier": "^2.8.6",
"rimraf": "^4.4.1",
"rollup": "^3.20.1",
"jest": "^29.6.2",
"lint-staged": "^13.2.3",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"rollup": "^3.26.3",
"rollup-plugin-dts": "^5.3.0",
"rollup-plugin-esbuild": "^5.0.0",
"sort-package-json": "^2.4.1",
"ts-jest": "^29.0.5",
"typescript": "^5.0.2"
"sort-package-json": "^2.5.1",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
},

@@ -80,0 +91,0 @@ "licenses": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc