@touchque/device-risk 0.0.0-stage → 3.1.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 +51 -0
- package/LICENSE +21 -0
- package/README.md +269 -2
- package/dist/device-sri.json +5 -0
- package/dist/index.d.mts +395 -0
- package/dist/index.d.ts +395 -0
- package/dist/index.js +1600 -0
- package/dist/index.mjs +1579 -0
- package/dist/touchque-device.global.js +9 -0
- package/package.json +34 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(function(){'use strict';var be="tq_device_id";function He(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256);return Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}function we(){try{let e=window.localStorage.getItem(be);if(e&&/^tq2_[0-9a-f]{32}$/.test(e))return e;let t=`tq2_${He()}`;return window.localStorage.setItem(be,t),t}catch{return null}}function Se(){try{let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return null;let n=t.getExtension("WEBGL_debug_renderer_info");return n?`${t.getParameter(n.UNMASKED_VENDOR_WEBGL)}|${t.getParameter(n.UNMASKED_RENDERER_WEBGL)}`:t.getParameter(t.RENDERER)}catch{return null}}function te(){try{let e=document.createElement("canvas");e.width=240,e.height=60;let t=e.getContext("2d");return t?(t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.font="14px 'Arial'",t.fillText("TouchQue device \u{1F512} \xE7\u011F\u0131\xF6\u015F\xFC",2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.font="18px serif",t.fillText("TouchQue device \u{1F512} \xE7\u011F\u0131\xF6\u015F\xFC",4,40),t.globalCompositeOperation="multiply",t.fillStyle="rgb(255,0,255)",t.beginPath(),t.arc(50,30,20,0,Math.PI*2,!0),t.fill(),e.toDataURL()):null}catch{return null}}async function _e(){try{let e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return null;let n=new t(1,5e3,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;let i=n.createDynamicsCompressor();r.connect(i),i.connect(n.destination),r.start(0);let o=await Promise.race([n.startRendering(),new Promise(d=>setTimeout(()=>d(null),1500))]);if(!o)return null;let a=o.getChannelData(0),s=0;for(let d=4500;d<5e3;d++)s+=Math.abs(a[d]);return s.toFixed(6)}catch{return null}}var Ve=["Arial","Helvetica","Times New Roman","Courier New","Verdana","Georgia","Palatino","Garamond","Comic Sans MS","Trebuchet MS","Impact","Tahoma","Segoe UI","Calibri","Cambria","Consolas","Menlo","Monaco","Roboto","Ubuntu","Noto Sans","Lucida Grande","Helvetica Neue","SF Pro Text","Apple Color Emoji"];function Ee(){try{let e=document.createElement("span");e.style.cssText="position:absolute;left:-9999px;top:-9999px;font-size:72px;visibility:hidden",e.textContent="mmmmmmmmmmlliWWW",document.body.appendChild(e);let t=i=>(e.style.fontFamily=i,`${e.offsetWidth}x${e.offsetHeight}`),n=["monospace","sans-serif","serif"].map(t),r=[];for(let i of Ve)["monospace","sans-serif","serif"].some((a,s)=>t(`'${i}',${a}`)!==n[s])&&r.push(i);return document.body.removeChild(e),r}catch{return null}}function Ge(e,t){let n=3735928559^t,r=1103547991^t;for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);n=Math.imul(n^o,2654435761),r=Math.imul(r^o,1597334677);}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16).padStart(14,"0")}async function ne(e){try{if(typeof crypto<"u"&&crypto.subtle){let t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return {hex:Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join(""),weak:!1}}}catch{}return {hex:[1,2,3,4,5].map(t=>Ge(e,t)).join("").slice(0,64),weak:true}}var We="touchque",X="keys",z="browser-key-v1";function je(e,t,n){return `touchque-browser:v1
|
|
2
|
+
${e}
|
|
3
|
+
${t}
|
|
4
|
+
${n}`}function Xe(e,t,n,r){return `touchque-device:v1
|
|
5
|
+
${e}
|
|
6
|
+
${t}
|
|
7
|
+
${n}
|
|
8
|
+
${r}`}function ze(e){return JSON.stringify({crv:e.crv,kty:e.kty,x:e.x,y:e.y})}async function Je(e,t=globalThis.crypto.subtle){let n=await t.digest("SHA-256",V(ze(e)));return K(new Uint8Array(n))}function V(e){return new TextEncoder().encode(e)}function K(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function G(e){let t=e;return !!t&&typeof t=="object"&&!!t.privateKey&&t.privateKey.type==="private"&&!!t.publicKey&&t.publicKey.type==="public"}function Ye(e){let t=()=>new Promise((r,i)=>{let o=e.open(We,1);o.onupgradeneeded=()=>{o.result.objectStoreNames.contains(X)||o.result.createObjectStore(X);};let a=false;o.onsuccess=()=>{a?o.result.close():r(o.result);},o.onerror=()=>{a=true,i(o.error);},o.onblocked=()=>{a=true,i(new Error("IndexedDB open blocked"));};});async function n(r,i){let o=await t();try{return await new Promise((a,s)=>{let d=o.transaction(X,r),m;i(d.objectStore(X),l=>{m=l;}),d.oncomplete=()=>a(m),d.onerror=()=>s(d.error),d.onabort=()=>s(d.error??new Error("IndexedDB transaction aborted"));})}finally{o.close();}}return {load:()=>n("readonly",(r,i)=>{let o=r.get(z);o.onsuccess=()=>i(G(o.result)?o.result:void 0);}),save:r=>n("readwrite",(i,o)=>{let a=i.get(z);a.onsuccess=()=>{if(G(a.result))return o(a.result);i.put({privateKey:r.privateKey,publicKey:r.publicKey},z),o(r);};}),remove:()=>n("readwrite",(r,i)=>{r.delete(z),i(void 0);})}}function U(e,t){return new Promise(n=>{let r=setTimeout(()=>n(null),t);e().then(i=>{clearTimeout(r),n(i);},()=>{clearTimeout(r),n(null);});})}var Ze=300,Qe=8,et=64,tt=2048,H=e=>typeof e=="string"?e.trim().slice(0,et):"";function nt(e,t){if(!e||typeof e!="object")return null;let n=e,r=Array.isArray(n.fullVersionList)?n.fullVersionList:[],i=[];for(let o of r){if(i.length>=Qe)break;let a=o&&typeof o=="object"?o:{},s=H(a.brand);s&&i.push({brand:s,version:H(a.version)});}return {platform:H(n.platform),platformVersion:H(n.platformVersion),fullVersionList:i,mobile:(typeof n.mobile=="boolean"?n.mobile:t)===true,model:H(n.model)}}function rt(){try{let e=typeof navigator<"u"?navigator.userAgentData:void 0;return e&&typeof e.getHighEntropyValues=="function"?e:null}catch{return null}}function ot(){try{return typeof indexedDB<"u"&&indexedDB?Ye(indexedDB):null}catch{return null}}function it(e={}){let t,n=()=>(t===void 0&&(t=e.store!==void 0?e.store:ot()),t),r=()=>{try{let l=e.crypto??globalThis.crypto;return l&&l.subtle&&typeof l.getRandomValues=="function"?l:null}catch{return null}},i=()=>{let l=e.origin;if(l===void 0)try{l=typeof location<"u"?location.origin:void 0;}catch{l=void 0;}return typeof l=="string"&&l!==""&&l!=="null"?l:null},o,a=(l,p)=>{if(!o){let b=(async()=>{let v=await p.load();if(!G(v)){let D=await l.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},false,["sign"]);if(v=await p.save(D),!G(v))throw new Error("browser key not stored")}let _=await l.subtle.exportKey("jwk",v.publicKey);if(_.kty!=="EC"||_.crv!=="P-256"||typeof _.x!="string"||typeof _.y!="string")throw new Error("browser key is not P-256");return {pair:v,jwk:{kty:"EC",crv:"P-256",x:_.x,y:_.y}}})();o=b,b.catch(()=>{o===b&&(o=void 0);});}return o},s,d=()=>(s||(s=(async()=>{try{let l=e.userAgentData!==void 0?e.userAgentData:rt();if(!l||typeof l.getHighEntropyValues!="function")return null;let p=await l.getHighEntropyValues(["platformVersion","fullVersionList","model"]);return nt(p,l.mobile)}catch{return null}})()),s),m=e.timeoutMs??2e3;return {proof:()=>U(async()=>{let l=r(),p=n(),b=i();if(!l||!p||!b)return null;let{pair:v,jwk:_}=await a(l,p),D=Math.floor((e.now??Date.now)()/1e3),w=K(l.getRandomValues(new Uint8Array(16))),S=new Uint8Array(await l.subtle.sign({name:"ECDSA",hash:"SHA-256"},v.privateKey,V(je(b,D,w))));if(S.length!==64)return null;let P={v:1,jwk:_,aud:b,iat:D,nonce:w,sig:K(S)},E=await U(d,Ze);if(E){let x=K(V(JSON.stringify({...P,hints:E})));if(x.length<=tt)return x}return K(V(JSON.stringify(P)))},m),sealDevice:l=>U(async()=>{let p=r(),b=n(),v=i();if(!p||!b||!v||!/^[A-Za-z0-9_-]{43}$/.test(l))return null;let{pair:_,jwk:D}=await a(p,b),w=Math.floor((e.now??Date.now)()/1e3),S=K(p.getRandomValues(new Uint8Array(16))),P=new Uint8Array(await p.subtle.sign({name:"ECDSA",hash:"SHA-256"},_.privateKey,V(Xe(v,w,S,l))));return P.length!==64?null:{jwk:D,aud:v,iat:w,nonce:S,sig:K(P)}},m),thumbprint:()=>U(async()=>{let l=r(),p=n();if(!l||!p)return null;if(!o){let v=await p.load();if(!G(v))return null}let{jwk:b}=await a(l,p);return Je(b,l.subtle)},m),async forget(){o=void 0,await U(async()=>(await n()?.remove(),null),m);}}}var xe=it();var De=null;function ke(e){De=e;}function B(e){try{De?.warn(e);}catch{}}function J(e){return e instanceof Error?e.message:typeof e=="string"?e:"unknown error"}var Pe={kid:"9d8a2f55",jwk:{kty:"EC",crv:"P-256",x:"QXrbInfJL8yPadD1kbcSDFajSop7_-DoK7oTbEO5sGU",y:"LqIO9D9uliBoFiR1kLk_1hT3eKvoFQqqkhydzFAkM5Y"}};var Re="tqe1",st=new TextEncoder().encode("touchque-device-report:v1");function re(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Te(e,t=Pe,n=globalThis.crypto?.subtle){if(!n||!t)return null;try{let r=await n.importKey("jwk",{...t.jwk,ext:!0},{name:"ECDH",namedCurve:"P-256"},!1,[]),i=await n.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveBits"]),o=new Uint8Array(await n.exportKey("raw",i.publicKey)),a=await n.deriveBits({name:"ECDH",public:r},i.privateKey,256),s=await n.importKey("raw",a,"HKDF",!1,["deriveKey"]),d=await n.deriveKey({name:"HKDF",hash:"SHA-256",salt:o,info:st},s,{name:"AES-GCM",length:256},!1,["encrypt"]),m=new Uint8Array(12);globalThis.crypto.getRandomValues(m);let l=new Uint8Array(await n.encrypt({name:"AES-GCM",iv:m,additionalData:new TextEncoder().encode(`${Re}.${t.kid}`)},d,new TextEncoder().encode(e)));return [Re,t.kid,re(o),re(m),re(l)].join(".")}catch{return null}}var ae=["sign_in","sign_up","password_reset","approval"];var at=6144;function ce(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function oe(e){return ce(new TextEncoder().encode(JSON.stringify(e)))}function ct(){let e=new Uint8Array(16);try{crypto.getRandomValues(e);}catch{for(let t=0;t<16;t+=1)e[t]=Math.floor(Math.random()*256);}return ce(e)}var ie=(e,t)=>typeof e=="string"?e.slice(0,t):"",W=async e=>e===null?null:(await ne(e)).hex.slice(0,16);function se(e,t,n){return new Promise(r=>{let i=setTimeout(()=>r(n),t);e.then(o=>{clearTimeout(i),r(o);},()=>{clearTimeout(i),r(n);});})}function Me(e,t){return /CrOS/.test(e)?"ChromeOS":/Android/i.test(e)?"Android":/iPhone|iPad|iPod/.test(e)||/Macintosh/.test(e)&&/Mobile\//.test(e)?"iOS":/Windows/.test(e)||/^Win/.test(t)?"Windows":/Mac OS X|Macintosh/.test(e)||/^Mac/.test(t)?"macOS":/Linux|X11/.test(e)||/Linux/.test(t)?"Linux":"Other"}function Y(e){let t=n=>{let r=n.exec(e);return r&&Number(r[1])||0};return /Edg(e|A|iOS)?\//.test(e)?{br:"Edge",bv:t(/Edg(?:e|A|iOS)?\/(\d+)/)}:/OPR\/|Opera/.test(e)?{br:"Opera",bv:t(/OPR\/(\d+)/)}:/SamsungBrowser\//.test(e)?{br:"Samsung",bv:t(/SamsungBrowser\/(\d+)/)}:/Firefox\/|FxiOS\//.test(e)?{br:"Firefox",bv:t(/(?:Firefox|FxiOS)\/(\d+)/)}:/Chrome\/|CriOS\//.test(e)?{br:"Chrome",bv:t(/(?:Chrome|CriOS)\/(\d+)/)}:/Safari\//.test(e)&&/Version\//.test(e)?{br:"Safari",bv:t(/Version\/(\d+)/)}:{br:"Other",bv:0}}function ut(){let e=Math;return [e.acos(.12312423423423424),e.acosh(1e308),e.asinh(1),e.atanh(.5),e.expm1(1),e.sinh(1),e.cosh(1),e.tan(-1e300),e.log1p(10),e.cbrt(Math.PI),e.exp(1)**10].map(String).join(",")}function lt(){try{let e=document.createElement("canvas").getContext("webgl");if(!e)return null;let n=[e.MAX_TEXTURE_SIZE,e.MAX_RENDERBUFFER_SIZE,e.MAX_VERTEX_ATTRIBS,e.MAX_VERTEX_UNIFORM_VECTORS,e.MAX_FRAGMENT_UNIFORM_VECTORS,e.MAX_VARYING_VECTORS,e.MAX_COMBINED_TEXTURE_IMAGE_UNITS,e.MAX_VIEWPORT_DIMS,e.ALIASED_LINE_WIDTH_RANGE,e.ALIASED_POINT_SIZE_RANGE].map(i=>{let o=e.getParameter(i);return o&&typeof o=="object"?Array.from(o).join("x"):String(o)}),r=(e.getSupportedExtensions()||[]).slice().sort().join(",");return `${n.join("|")}#${r}`}catch{return null}}async function dt(e){let t=e.navigator,n=t.userAgent||"",r=ie(t.platform,32),{br:i,bv:o}=Y(n),a="";try{a=Intl.DateTimeFormat().resolvedOptions().timeZone||"";}catch{}let s=e.screen?.width||0,d=e.screen?.height||0,m=te(),l=Se(),p=Ee();return {traits:{os:Me(n,r),br:i,bv:o,pf:r,tz:ie(a,64),tzo:new Date().getTimezoneOffset(),lang:(Array.isArray(t.languages)&&t.languages.length?t.languages:[t.language||""]).slice(0,3).map(v=>ie(v,16)),scr:`${Math.max(s,d)}x${Math.min(s,d)}`,cd:e.screen?.colorDepth||0,dpr:Math.round((e.devicePixelRatio||1)*100)/100,hc:t.hardwareConcurrency||0,dm:typeof t.deviceMemory=="number"?t.deviceMemory:null,tp:t.maxTouchPoints||0,gpu:l?l.slice(0,128):null,cv:await W(m),au:null,fn:p?await W(p.join(",")):null,mt:await W(ut()),wg:await W(lt())},canvasRaw:m,gpuRaw:l,fonts:p}}var ft=/\{\s*\[native code\]\s*\}\s*$/,mt=[["nav_user_agent",()=>Navigator.prototype,"userAgent","get"],["nav_platform",()=>Navigator.prototype,"platform","get"],["nav_languages",()=>Navigator.prototype,"languages","get"],["nav_cores",()=>Navigator.prototype,"hardwareConcurrency","get"],["nav_webdriver",()=>Navigator.prototype,"webdriver","get"],["nav_touch",()=>Navigator.prototype,"maxTouchPoints","get"],["screen_width",()=>Screen.prototype,"width","get"],["screen_height",()=>Screen.prototype,"height","get"],["canvas_data_url",()=>HTMLCanvasElement.prototype,"toDataURL","value"],["canvas_context",()=>HTMLCanvasElement.prototype,"getContext","value"],["canvas_image_data",()=>typeof CanvasRenderingContext2D<"u"?CanvasRenderingContext2D.prototype:void 0,"getImageData","value"],["webgl_parameter",()=>typeof WebGLRenderingContext<"u"?WebGLRenderingContext.prototype:void 0,"getParameter","value"],["tz_resolved",()=>Intl.DateTimeFormat.prototype,"resolvedOptions","value"],["tz_offset",()=>Date.prototype,"getTimezoneOffset","value"],["audio_channel",()=>typeof AudioBuffer<"u"?AudioBuffer.prototype:void 0,"getChannelData","value"]],pt=[["nav_own_property",()=>navigator,"userAgent"],["nav_own_property",()=>navigator,"platform"],["nav_own_property",()=>navigator,"webdriver"],["nav_own_property",()=>navigator,"hardwareConcurrency"],["nav_own_property",()=>navigator,"languages"],["screen_own_property",()=>screen,"width"]];function gt(e){try{return typeof e!="function"?!0:ft.test(Function.prototype.toString.call(e))?!Object.prototype.hasOwnProperty.call(e,"prototype"):!1}catch{return false}}function yt(e,t=gt){let n=new Set;t(Function.prototype.toString)||n.add("fn_to_string");for(let[s,d,m,l]of mt)try{let p=d();if(!p)continue;let b=Object.getOwnPropertyDescriptor(p,m);if(!b)continue;t(l==="get"?b.get:b.value)||n.add(s);}catch{}for(let[s,d,m]of pt)try{let l=d();l&&Object.prototype.hasOwnProperty.call(l,m)&&n.add(s);}catch{}let r=e.navigator,i=r.userAgent||"",o=Me(i,""),a=r.platform||"";try{let s=/^Win/.test(a)?"Windows":/^Mac/.test(a)?"macOS":/^(iPhone|iPad|iPod)/.test(a)?"iOS":/Linux|Android/.test(a)?"Linux":"",d=o==="Android"||o==="ChromeOS"?"Linux":o;s&&d!=="Other"&&s!==d&&!(d==="iOS"&&s==="macOS")&&!(d==="macOS"&&s==="iOS")&&n.add("ua_platform_mismatch");}catch{}try{let s=r.userAgentData?.platform;if(s){let d={Windows:"Windows",macOS:"macOS",Linux:"Linux",Android:"Android","Chrome OS":"ChromeOS",ChromeOS:"ChromeOS",iOS:"iOS"};d[s]&&o!=="Other"&&d[s]!==o&&n.add("uach_platform_mismatch");}}catch{}try{let s=typeof e.mozInnerScreenX=="number",{br:d}=Y(i);d==="Firefox"&&!/FxiOS/.test(i)&&!s&&n.add("ua_engine_mismatch"),(d==="Chrome"||d==="Edge"||d==="Opera")&&!/CriOS|EdgiOS|OPT\//.test(i)&&s&&n.add("ua_engine_mismatch");}catch{}try{let s=r.languages;Array.isArray(s)&&s.length&&r.language&&s[0]!==r.language&&n.add("language_mismatch");}catch{}try{let s=Intl.DateTimeFormat().resolvedOptions().timeZone;if(s){let d=new Date,m=new Date(d.toLocaleString("en-US",{timeZone:s})),l=new Date(d.toLocaleString("en-US",{timeZone:"UTC"})),p=Math.round((l.getTime()-m.getTime())/6e4);Math.abs(p-d.getTimezoneOffset())>1&&n.add("timezone_mismatch");}}catch{}try{let s=r.hardwareConcurrency;typeof s=="number"&&(s<1||s>256||!Number.isInteger(s))&&n.add("impossible_cores");}catch{}return [...n].sort()}function ht(){try{return null.x===void 0,null}catch(e){let t=String(e?.message||"");return /Cannot read propert/.test(t)?"v8":/is not an object/.test(t)?"jsc":/has no properties|can't access property/.test(t)?"gecko":null}}var vt=/NVIDIA|GeForce|Quadro|Radeon|Intel\(R\)|Intel Iris|Intel UHD|Intel HD|Direct3D|D3D11|Apple M\d|Metal Renderer/i,bt=/Mali-|PowerVR|Xclipse|Immortalis|Adreno/i;function wt(e,t,n,r=ht()){let i=new Set;if(r){let a=t.os==="iOS"||t.br==="Safari"?"jsc":t.br==="Firefox"?"gecko":["Chrome","Edge","Opera","Samsung"].includes(t.br)?"v8":null;a&&r!==a&&i.add("ua_engine_mismatch");}let o=t.gpu||"";if(o&&(t.os==="iOS"&&!/Apple GPU/i.test(o)&&i.add("gpu_os_mismatch"),t.os==="Android"&&vt.test(o)&&i.add("gpu_os_mismatch"),t.os==="Windows"&&/Apple GPU|Apple M\d|Mali-|PowerVR|Xclipse|Immortalis/i.test(o)&&i.add("gpu_os_mismatch"),t.os==="macOS"&&(/Direct3D|D3D11/i.test(o)||bt.test(o)&&!/Apple/i.test(o))&&i.add("gpu_os_mismatch")),n){let a=s=>n.includes(s);(t.os==="macOS"||t.os==="iOS"||t.os==="Android")&&a("Segoe UI")&&i.add("fonts_os_mismatch"),(t.os==="Windows"||t.os==="Android")&&a("Apple Color Emoji")&&a("Menlo")&&i.add("fonts_os_mismatch");}if(t.os==="iOS"&&/^Mac/.test(t.pf||"")&&i.add("ua_platform_mismatch"),t.os==="iOS"||t.os==="Android"){let a=false;try{a=!!e.matchMedia&&e.matchMedia("(any-pointer: fine)").matches&&!e.matchMedia("(any-pointer: coarse)").matches;}catch{}(t.tp===0||a)&&i.add("mobile_desktop_mismatch");let s=Number(String(t.scr||"").split("x")[0])||0;t.os==="iOS"&&!/^iPad/.test(t.pf||"")&&(s>1e3||t.dpr&&t.dpr<2)&&i.add("mobile_desktop_mismatch");}return [...i].sort()}function St(e,t){let n=new Set,r=e.navigator;t&&/SwiftShader|llvmpipe|softpipe|Software Rasterizer|Microsoft Basic Render|Mesa OffScreen/i.test(t)&&n.add("soft_gpu"),t&&/VMware|VirtualBox|Parallels|QXL|Red Hat|virgl|Hyper-V|Citrix|bochs|UTM|Apple Paravirtual/i.test(t)&&n.add("vm_gpu"),t&&/Android Emulator|Emulator OpenGL|Genymotion|BlueStacks|\bNox\b|LDPlayer|MuMu/i.test(t)&&n.add("emulator");try{/HeadlessChrome|PhantomJS|SlimerJS/.test(r.userAgent||"")&&n.add("headless");}catch{}try{(r.userAgentData?.brands||[]).some(i=>/Headless/i.test(i.brand))&&n.add("headless");}catch{}try{r.webdriver===!0&&n.add("webdriver");}catch{}try{e.outerWidth===0&&e.outerHeight===0&&n.add("zero_window");}catch{}try{r.hardwareConcurrency===1&&n.add("one_core");}catch{}try{let i=e.screen,o=!(r.maxTouchPoints>0),a=["Chrome","Edge","Opera","Samsung"].includes(Y(r.userAgent||"").br)&&!r.brave;o&&a&&i&&i.width===800&&i.height===600&&e.outerHeight===e.innerHeight&&e.outerWidth===e.innerWidth&&n.add("headless_window");}catch{}return [...n].sort()}function _t(e){let t=new Set,n=e,r=e.document,i=(o,a)=>{try{return a in o}catch{return false}};try{for(let o of Object.getOwnPropertyNames(e))(/^cdc_[A-Za-z0-9]{10,}/.test(o)||/^\$?wdc_/.test(o))&&t.add("selenium");for(let o of Object.keys(e.document))/^\$?cdc_|^\$wdc_/.test(o)&&t.add("selenium");}catch{}for(let o of ["__selenium_unwrapped","__selenium_evaluate","__webdriver_evaluate","__driver_evaluate","__webdriver_unwrapped","__driver_unwrapped","__fxdriver_evaluate","__fxdriver_unwrapped","__webdriver_script_fn","__webdriver_script_func","_Selenium_IDE_Recorder","callSelenium","_selenium","__webdriverFunc"])(i(n,o)||i(r,o))&&t.add("selenium");try{e.document.documentElement?.getAttribute("webdriver")!==null&&t.add("selenium");}catch{}for(let o of ["__playwright__binding__","__pwInitScripts","__playwright_evaluation_script__","__playwright"])i(n,o)&&t.add("playwright");for(let o of ["callPhantom","_phantom"])i(n,o)&&t.add("phantomjs");i(n,"__nightmare")&&t.add("nightmare");try{/HeadlessChrome/.test(e.navigator.userAgent||"")&&t.add("headless_chrome");}catch{}try{let o=!1,a=new Error("");Object.defineProperty(a,"stack",{configurable:!0,get(){return o=!0,""}}),e.console?.debug?.(a),o&&t.add("cdp");}catch{}return [...t].sort()}async function Et(e){let t=e.navigator,n=t.userAgent||"",{br:r}=Y(n);try{if(r==="Firefox"&&e.isSecureContext&&!("serviceWorker"in t))return "firefox_no_sw";if(r==="Safari"&&t.storage&&typeof t.storage.getDirectory=="function"){try{await t.storage.getDirectory();}catch(i){if(String(i?.message||"").includes("unknown transient reason"))return "safari_opfs"}return null}if((r==="Chrome"||r==="Edge"||r==="Opera"||r==="Samsung")&&t.storage?.estimate){let{quota:i}=await t.storage.estimate(),o=e.performance?.memory?.jsHeapSizeLimit||1073741824;if(typeof i=="number"&&i>0&&i<o*2)return "chromium_quota"}}catch{}return null}function xt(e){let t={ls:false,idb:false,cookie:false};try{let n="__tq_dr";e.localStorage.setItem(n,"1"),e.localStorage.removeItem(n),t.ls=!0;}catch{}try{t.idb=typeof e.indexedDB<"u"&&!!e.indexedDB;}catch{}try{t.cookie=e.navigator.cookieEnabled===!0;}catch{}return t}function Dt(e){try{let t=e.location.origin;return t&&t!=="null"?t:""}catch{return ""}}async function Ae(e,t=window){let n=Date.now(),r=e.timeoutMs??1500,i=ae.includes(e.purpose)?e.purpose:"sign_in",{traits:o,canvasRaw:a,gpuRaw:s,fonts:d}=await dt(t),[m,l]=await Promise.all([se(_e(),r,null),se(Et(t),r,null)]);o.au=await W(m);let p=false;try{let S=te();p=!!a&&!!S&&S!==a;}catch{}t.navigator;let v={v:1,p:i,aud:Dt(t),iat:Math.floor(Date.now()/1e3),nonce:ct(),sid:we(),...typeof e.challenge=="string"&&e.challenge&&{ch:e.challenge},tv:ue,t:o,s:{tamper:[...new Set([...yt(t),...wt(t,o,d)])].sort(),vm:St(t,s),auto:_t(t),priv:l,brave:kt(t),cvNoise:p,storage:xt(t)},ms:Date.now()-n},_=JSON.stringify(v),D={v:1,body:_},w=e.browserKey===void 0?xe:e.browserKey;if(w&&typeof w.sealDevice=="function")try{let S=await ne(_);if(!S.weak){let P=new Uint8Array(S.hex.match(/../g).map(x=>parseInt(x,16))),E=await w.sealDevice(ce(P));E&&(D.seal=E);}}catch{}return D}var ue="3.1.0";function kt(e){let t=e.navigator;if(typeof t.brave!="object"||t.brave===null)return false;let n=t.userAgentData?.brands;return !Array.isArray(n)||n.length===0||n.some(r=>/Brave/i.test(r.brand))}var Pt=/^tqpk_[A-Za-z0-9_-]{32}$/,Rt="https://api.touchque.com";function le(e){let t=()=>e??window,n={report:r=>Ae(r,t()),async identify(r){if(!r||typeof r.siteKey!="string"||!Pt.test(r.siteKey))throw new Error("deviceRisk.identify: siteKey must be your workspace's Device risk site key (tqpk_\u2026)");let i=(r.apiBaseUrl||Rt).replace(/\/+$/,"");if(!/^https?:\/\/[^/]/i.test(i))throw new Error("deviceRisk.identify: apiBaseUrl must be an absolute URL, e.g. https://api.touchque.com");let o=r.fetch??(typeof fetch<"u"?fetch:void 0);if(!o)throw new Error("deviceRisk.identify: no `fetch` available, pass `fetch` in the options.");try{let a=await se((async()=>{let l=await o.call(globalThis,`${i}/device-risk/identify`,{method:"POST",headers:{"Content-Type":"text/plain"},credentials:"same-origin",body:JSON.stringify({siteKey:r.siteKey,challenge:!0})}),p=l.ok?await l.json().catch(()=>null):null;return p&&typeof p.challenge=="string"?p.challenge:null})().catch(()=>null),r.timeoutMs??1500,null),s=await n.collect({...r,challenge:a}),d=await o.call(globalThis,`${i}/device-risk/identify`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify({siteKey:r.siteKey,report:s,...r.pageView&&{view:!0}}),credentials:"same-origin"}),m=await d.json().catch(()=>null);return !d.ok||!m||typeof m.visitorId!="string"||typeof m.requestId!="string"?(B(`Touchque deviceRisk.identify: ${m?.code||d.status}`),null):{visitorId:m.visitorId,requestId:m.requestId,confidence:typeof m.confidence=="number"?m.confidence:0}}catch(a){return B(`Touchque deviceRisk.identify: Touchque could not be reached (${J(a)})`),null}},async collect(r){try{let i=await Ae(r,t()),o=i,a=oe(o);if(a.length>at){let s=JSON.parse(i.body);s.t.gpu=s.t.gpu?s.t.gpu.slice(0,48):null,o={v:1,body:JSON.stringify(s)},a=oe(o);}return r.encrypt===!1?a:await Te(JSON.stringify(o))||a}catch{return oe({v:1,body:JSON.stringify({v:1,p:r.purpose,error:true})})}}};return n}var Tt=Math.tan(3*Math.PI/180),de=64,Oe=2e3;function Ie(e){if(e.length<2)return {length:0,deviation:0,dx:0,dy:0};let t=e[0],n=e[e.length-1],r=n.x-t.x,i=n.y-t.y,o=Math.hypot(r,i),a=0,s=0;for(let d=1;d<e.length;d+=1){let m=e[d];a+=Math.hypot(m.x-e[d-1].x,m.y-e[d-1].y);let l=o>0?Math.abs(i*(m.x-t.x)-r*(m.y-t.y))/o:Math.hypot(m.x-t.x,m.y-t.y);l>s&&(s=l);}return {length:a,deviation:s,dx:r,dy:i}}var At=(e,t)=>Math.min(Math.abs(e),Math.abs(t))<=Tt*Math.max(Math.abs(e),Math.abs(t)),Z=e=>e===null?null:Math.round(e*10)/10,fe=(e,t)=>e===null?t:Math.min(e,t),Ce=(e,t)=>e===null?t:Math.max(e,t);function Mt(e){try{if(!e)return !0;let t=e.now(),n=t;for(let r=0;r<1e5&&n===t;r+=1)n=e.now();return n===t||n-t>=5}catch{return true}}function Le(e=document,t={}){let n=e instanceof Document?e:e.ownerDocument,r=t.trusted??(f=>f.isTrusted),i=n.defaultView?.performance,o=Mt(i),a=0,s=0,d=0,m=0,l=0,p=null,b=0,v=null,_=0,D=null,w=[],S=[],P=-1/0,E=[],x=null,M=f=>{if(f.length<10)return null;let h=Ie(f);return h.length>=300&&!At(h.dx,h.dy)?h.deviation:null},I=()=>{let f=M(w);f!==null&&(l+=1,p=fe(p,f)),w=[];},A=f=>r(f)&&(f.pointerType==="mouse"||f.pointerType==="pen"),C=f=>{if(!A(f))return;let h=typeof f.getCoalescedEvents=="function"?f.getCoalescedEvents():[];for(let k of h.length?h:[f]){let T={x:k.clientX,y:k.clientY,t:k.timeStamp},L=w[w.length-1];(L&&T.t-L.t>150||w.length>=Oe)&&I(),w.push(T),S.push(T),S.length>de&&S.shift(),a+=1;}},N=f=>{if(!A(f)||f.button!==0)return;I(),d+=1;let h=f.timeStamp,k=Math.max(h-500,P),T=S.filter(F=>F.t>k),L=null;for(let F=S.length-1;F>=0;F-=1)if(S[F].t<=k){L=S[F];break}P=h,S.push({x:f.clientX,y:f.clientY,t:h}),S.length>de&&S.shift(),T.length<=1&&(!L||Math.hypot(f.clientX-L.x,f.clientY-L.y)>=30)&&(m+=1,E.push({id:f.pointerId,down:h,up:null}),E.length>de&&E.shift());},g=f=>{if(A(f)){for(let h=E.length-1;h>=0;h-=1)if(E[h].id===f.pointerId&&E[h].up===null){E[h].up=f.timeStamp;break}}},u=f=>{if(!r(f))return;let h=f.changedTouches[0];x=f.touches.length===1&&h?{id:h.identifier,start:f.timeStamp,samples:[{x:h.clientX,y:h.clientY,t:f.timeStamp}],far:0}:null;},c=f=>{if(!x)return null;let h=Array.from(f.changedTouches).find(T=>T.identifier===x.id);if(!h)return null;let k=x.samples[0];return x.samples.length<Oe&&x.samples.push({x:h.clientX,y:h.clientY,t:f.timeStamp}),x.far=Math.max(x.far,Math.hypot(h.clientX-k.x,h.clientY-k.y)),x},y=f=>{r(f)&&(s+=1,c(f));},R=f=>{if(!r(f))return;let h=c(f);if(h){if(x=null,h.far<10){b+=1,v=Ce(v,f.timeStamp-h.start);return}if(h.samples.length>=10){let k=Ie(h.samples);k.length>=300&&(_+=1,D=fe(D,k.deviation));}}},j=()=>{x=null;},ye={capture:true,passive:true},he=[["pointermove",C],["pointerdown",N],["pointerup",g],["touchstart",u],["touchmove",y],["touchend",R],["touchcancel",j]];for(let[f,h]of he)e.addEventListener(f,h,ye);let ve=()=>{let f=i?i.now():0,h=null;for(let T of E)h=Ce(h,(T.up??f)-T.down);let k=M(w);return {v:1,p:d,pt:m,pth:o?null:Z(h),ls:l+(k===null?0:1),lsd:Z(k===null?p:fe(p,k)),t:b,th:o?null:Z(v),sw:_,swd:Z(D),mv:a,tm:s}};return {summary:ve,encode:()=>Ot(ve()),stop(){for(let[f,h]of he)e.removeEventListener(f,h,ye);}}}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",Ne=4095,$=e=>me[Math.max(0,Math.min(63,Math.floor(e)))],q=e=>{let t=e===null?Ne:Math.max(0,Math.min(Ne-1,Math.round(e)));return me[t>>6]+me[t&63]};function Ot(e){let t=e.pt>=e.p?$(e.p):$(Math.min(e.pt,62));return `1${$(e.p)}${t}${q(e.pth)}${$(e.ls)}${q(e.lsd===null?null:e.lsd*10)}${$(e.t)}${q(e.th)}${$(e.sw)}${q(e.swd===null?null:e.swd*10)}${q(e.mv)}${q(e.tm)}`}function It(e){try{if(!e)return !0;let t=e.now(),n=t;for(let r=0;r<1e5&&n===t;r+=1)n=e.now();return n===t||n-t>=5}catch{return true}}var pe=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null;function Ct(e){let t=pe(e);return t===null?null:Math.sqrt(e.reduce((n,r)=>n+(r-t)**2,0)/e.length)}function Nt(e){if(!e.length)return null;let t=[...e].sort((r,i)=>r-i),n=t.length>>1;return t.length%2?t[n]:(t[n-1]+t[n])/2}function Fe(e=document,t={}){let n=e instanceof Document?e:e.ownerDocument,r=t.trusted??(g=>g.isTrusted),i=n.defaultView?.performance,o=It(i),a=0,s=0,d=0,m=0,l=0,p=-1/0,b=-1/0,v=[],_=[],D=new Map,w=[],S=g=>{w.push(g),w.length>200&&w.shift(),b=g;},P=g=>{if(!r(g)||g.repeat||typeof g.key!="string"||g.key.length!==1)return;let u=g.timeStamp;a+=1,u-p<1500?(v.push(u-p),v.length>200&&v.shift()):(u-b>=1500||b===-1/0)&&S(u),p=u,D.set(g.code||g.key,u);},E=g=>{if(!r(g))return;let u=g.code||g.key,c=D.get(u);c!==void 0&&(D.delete(u),_.push(g.timeStamp-c),_.length>200&&_.shift());},x=g=>{if(!r(g))return;let u=g,c=typeof u.inputType=="string"?u.inputType:"";if(c==="insertFromPaste"||c==="insertFromDrop"){d+=1;return}if(c!=="insertText"||u.isComposing)return;let y=g.timeStamp;y-p>150&&(s+=1,y-b>=1500&&S(y));},M=g=>{r(g)&&!(g.target instanceof Element&&g.target.closest("input,textarea,[contenteditable]"))&&(d+=1);},I=g=>{if(!r(g)||g.button!==0||(S(g.timeStamp),g.pointerType!=="mouse"&&g.pointerType!=="pen"))return;let u=g.target instanceof Element?g.target:null;if(u)try{let c=u.getBoundingClientRect();if(c.width<8||c.height<8)return;m+=1,Math.abs(g.clientX-(c.left+c.width/2))<=1&&Math.abs(g.clientY-(c.top+c.height/2))<=1&&(l+=1);}catch{}},A={capture:true,passive:true},C=[["keydown",P],["keyup",E],["input",x],["paste",M],["pointerdown",I]];for(let[g,u]of C)e.addEventListener(g,u,A);let N=()=>{let g=[];for(let y=1;y<w.length;y+=1)g.push(w[y]-w[y-1]);let u=g.filter(y=>y>=1500&&y<=2e4).length,c=y=>y===null?null:Math.round(y);return {v:1,kd:a,nk:s,pa:d,kn:v.length,km:o?null:c(pe(v)),ks:o?null:c(Ct(v)),hm:o?null:c(pe(_)),cp:m,cc:l,ac:w.length,lg:u,gm:o?null:c(Nt(g))}};return {summary:N,encode:()=>Lt(N()),stop(){for(let[g,u]of C)e.removeEventListener(g,u,A);}}}var ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",Ke=4095,O=e=>ge[Math.max(0,Math.min(63,Math.floor(e)))],Q=e=>{let t=e===null?Ke:Math.max(0,Math.min(Ke-1,Math.round(e)));return ge[t>>6]+ge[t&63]};function Lt(e){let t=Math.min(e.cp,63),n=Math.min(e.ac,63);return `1${O(e.kd)}${O(e.nk)}${O(e.pa)}${O(e.kn)}${Q(e.km)}${Q(e.ks)}${Q(e.hm)}${O(t)}${O(Math.min(e.cc,t))}${O(n)}${O(Math.min(e.lg,n))}${Q(e.gm===null?null:e.gm/100)}`}var Be="touchque_request_id",Kt="data-touchque-purpose",Ft="touchque:device",$e=600*1e3,Bt=1e3,qe=ue,ee=e=>ae.includes(e);function $t(e,t={}){let n=t.win??window,r=n.document,i=t.now??(()=>Date.now()),o=t.deviceRisk??le(n),a=ee(e.purpose)?e.purpose:"sign_in",s=new Map,d=new Set([r]),m=false,l=null;try{l=t.pointer!==void 0?t.pointer:e.pointer===!1?null:Le(r);}catch{}let p=null;try{p=l?t.input!==void 0?t.input:Fe(r):null;}catch{}let b=u=>{let c=s.get(u)?.current?.requestId;if(!c)return null;let y=c;try{l&&(y=`${c}.${l.encode()}`);}catch{return c}try{l&&p&&(y=`${y}.${p.encode()}`);}catch{}return y},v=u=>{let c=s.get(u);return c||(c={current:null,at:0,pending:null,timer:null,stale:false},s.set(u,c)),c},_=u=>{let c=u.getAttribute(Kt);return ee(c)?c:a},D=u=>{let c=[];return u.tagName==="FORM"&&c.push(u),typeof u.querySelectorAll=="function"&&c.push(...Array.from(u.querySelectorAll("form"))),c},w=u=>{let c=Array.from(u.querySelectorAll("input")).find(R=>R.name===Be);if(c)return c;let y=r.createElement("input");return y.type="hidden",y.name=Be,u.appendChild(y),y},S=u=>{let c=s.get(u)?.current?.requestId??"";for(let y of d)for(let R of D(y))_(R)===u&&(w(R).value=c);},P=u=>{let c=v(u);c.timer&&clearTimeout(c.timer),c.stale=false,c.timer=setTimeout(()=>{c.timer=null,r.visibilityState==="hidden"?c.stale=true:E(u);},$e);},E=u=>{let c=v(u);return c.pending?c.pending:m?Promise.resolve(c.current):(c.pending=o.identify({siteKey:e.siteKey,purpose:u,apiBaseUrl:e.apiBaseUrl,pageView:true}).catch(y=>(B(`Touchque device.js: ${J(y)}`),null)).then(y=>{if(c.pending=null,m)return y;c.current=y,c.at=i(),S(u),y&&P(u);try{r.dispatchEvent(new CustomEvent(Ft,{detail:{purpose:u,requestId:y?.requestId??null,visitorId:y?.visitorId??null,confidence:y?.confidence??null}}));}catch{}return y}),c.pending)},x=u=>{for(let c of D(u)){let y=_(c),R=w(c),j=s.get(y);j?.current?R.value=j.current.requestId:E(y);}},M=()=>{for(let[u,c]of s)(c.stale||c.at&&i()-c.at>=$e)&&E(u);},I=()=>{r.visibilityState!=="hidden"&&M();},A=u=>{let c=u.target;if(!c||c.tagName!=="FORM")return;let y=_(c),R=b(y);R&&(w(c).value=R),setTimeout(()=>{m||E(y);},Bt);},C=n.MutationObserver,N=typeof C=="function"?new C(u=>{for(let c of u)for(let y of Array.from(c.addedNodes))y.nodeType===1&&x(y);}):null,g=E(a);try{N?.observe(r.documentElement,{childList:!0,subtree:!0}),r.addEventListener("submit",A,!0),r.addEventListener("visibilitychange",I),r.addEventListener("focusin",M),x(r),r.readyState==="loading"&&r.addEventListener("DOMContentLoaded",()=>x(r),{once:!0});}catch{}return {ready:g,get requestId(){return s.get(a)?.current?.requestId??null},get visitorId(){return s.get(a)?.current?.visitorId??null},value:u=>b(ee(u)?u:a),refresh:u=>E(ee(u)?u:a),attach(u){d.add(u),x(u);},stop(){m=true,N?.disconnect(),r.removeEventListener("submit",A,true),r.removeEventListener("visibilitychange",I),r.removeEventListener("focusin",M);for(let u of s.values())u.timer&&clearTimeout(u.timer);l?.stop(),p?.stop();},version:qe}}function Ue(e,t=window){let n=t;if(n.TouchqueDevice)return n.TouchqueDevice;let r=e??t.document.querySelector("script[data-site-key]"),i=r?.getAttribute("data-site-key")||"",o=r?.getAttribute("data-purpose")||void 0,a=r?.getAttribute("data-api")||void 0,s=r?.getAttribute("data-pointer")!=="off";r?.hasAttribute("data-debug")&&typeof console<"u"&&ke(console);let d=i?$t({siteKey:i,purpose:o,apiBaseUrl:a,pointer:s},{win:t}):qt();return n.TouchqueDevice=d,d}function qt(){return B("Touchque device.js: data-site-key is missing on the script tag (dashboard \u2192 Device risk \u2192 Settings)."),{ready:Promise.resolve(null),requestId:null,visitorId:null,value:()=>null,refresh:()=>Promise.resolve(null),attach:()=>{},stop:()=>{},version:qe}}Ue(typeof document<"u"?document.currentScript:null);
|
|
9
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@touchque/device-risk",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "Touchque Device Risk for the browser: recognise browsers on sign-in, sign-up and payment pages, tell bots, emulators and spoofed browsers apart; the script tag served at cdn.touchque.com/device",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Touchque/touchque-device-risk-web.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://touchque.com",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": "Touchque",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": { "types": "./dist/index.d.mts", "default": "./dist/index.mjs" },
|
|
18
|
+
"require": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": ["dist", "CHANGELOG.md"],
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"engines": { "node": ">=18" },
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"prepublishOnly": "npm run build && npm test"
|
|
28
|
+
},
|
|
29
|
+
"keywords": ["touchque", "device-risk", "device-fingerprint", "bot-detection", "fraud", "browser"],
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"jsdom": "^25.0.1",
|
|
32
|
+
"tsup": "^8.0.2",
|
|
33
|
+
"typescript": "^5.4.5",
|
|
34
|
+
"vitest": "^2.1.4"
|
|
35
|
+
}
|
|
36
|
+
}
|