yolkbot 1.0.7 → 1.0.9

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/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable */
2
2
 
3
- import i from"./globals.js";import d from"./socket.js";import{FirebaseKey as a,UserAgent as u}from"./constants/index.js";const c={origin:"https://shellshock.io","user-agent":u,"x-client-version":"Chrome/JsCore/9.17.2/FirebaseCore-web","x-firebase-locale":"en"};class y{constructor(e={}){this.instance=e.instance||"shellshock.io",this.protocol=e.protocol||"wss",this.httpProxy=e.httpProxy||e.proxy?.replace(/socks([4|5|4a|5h]+):\/\//g,"https")||"",this.socksProxy=e.proxy,this.maxRetries=e.maxRetries||5}queryServices=async e=>{let t,n=0;const s=async()=>{try{t=new d(`${this.protocol}://${this.instance}/services/`,this.socksProxy),t.onerror=async o=>(n++,console.error(o),await new Promise(r=>setTimeout(r,100)),await s())}catch{if(n>this.maxRetries)return"max_retries_exceeded";await new Promise(o=>setTimeout(o,100)),await s()}};return await s(),new Promise(o=>{t.onopen=()=>{t.onerror=null,t.send(JSON.stringify(e))};let r=!1;t.onmessage=l=>{r=!0;try{const h=JSON.parse(l.data);o(h)}catch{console.error("queryServices: Bad API JSON response with call: "+e.cmd+" and data:",JSON.stringify(e)),console.error("queryServices: Full data sent: ",JSON.stringify(e)),o("bad_json")}t.close()},t.onerror=()=>!r&&o("unknown_socket_error"),t.onclose=()=>!r&&o("services_closed_early")})};#e=async(e,t,n)=>{if(!e||!t)return"firebase_no_credentials";let s,o;try{s=await(await i.fetch(`https://identitytoolkit.googleapis.com/v1/accounts:${n}?key=${a}`,{method:"POST",body:JSON.stringify({email:e,password:t,returnSecureToken:!0}),headers:{...c,"content-type":"application/json"},dispatcher:this.httpProxy?new i.ProxyAgent(this.httpProxy):void 0})).json(),o=s.idToken}catch(r){return r.code==="auth/network-request-failed"?(console.error("loginWithCredentials: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):r.code==="auth/missing-email"?"firebase_no_credentials":r.code==="ERR_BAD_REQUEST"?(console.error("loginWithCredentials: Error:",e,t),console.error("loginWithCredentials: Error:",r.response?.data||r),"firebase_bad_request"):(console.error("loginWithCredentials: Error:",e,t),"firebase_unknown_error")}return o?await this.queryServices({cmd:"auth",firebaseToken:o}):(console.error("loginWithCredentials: the game sent no idToken",s),"firebase_no_token")};createAccount=async(e,t)=>await this.#e(e,t,"signUp");loginWithCredentials=async(e,t)=>await this.#e(e,t,"signInWithPassword");loginWithRefreshToken=async e=>{if(!e)return"firebase_no_credentials";const t=new URLSearchParams;t.append("grant_type","refresh_token"),t.append("refresh_token",e);let n,s;try{n=await(await i.fetch(`https://securetoken.googleapis.com/v1/token?key=${a}`,{method:"POST",body:t,headers:{...c,"content-type":"application/x-www-form-urlencoded"},dispatcher:this.httpProxy?new i.ProxyAgent(this.httpProxy):void 0})).json(),s=n.id_token}catch(r){return r.code==="auth/network-request-failed"?(console.error("loginWithRefreshToken: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):r.code==="auth/missing-email"?"firebase_no_credentials":(console.error("loginWithRefreshToken: Error:",r,e),"firebase_unknown_error")}return s?await this.queryServices({cmd:"auth",firebaseToken:s}):(console.error("loginWithRefreshToken: the game sent no idToken",n),"firebase_no_token")};loginAnonymously=async()=>{const t=await(await i.fetch("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key="+a,{method:"POST",body:JSON.stringify({returnSecureToken:!0}),headers:{...c,"content-type":"application/json"},dispatcher:this.httpProxy?new i.ProxyAgent(this.httpProxy):void 0})).json(),n=t.idToken;return n?await this.queryServices({cmd:"auth",firebaseToken:n}):(console.error("loginAnonymously: the game sent no idToken",t),"firebase_no_token")}}var w=y;export{y as API,w as default};
3
+ import i from"./globals.js";import d from"./socket.js";import{FirebaseKey as a,UserAgent as u}from"./constants/index.js";const c={origin:"https://shellshock.io","user-agent":u,"x-client-version":"Chrome/JsCore/9.17.2/FirebaseCore-web","x-firebase-locale":"en"};class y{constructor(e={}){this.instance=e.instance||"shellshock.io",this.protocol=e.protocol||"wss",this.httpProxy=e.httpProxy||e.proxy?.replace(/socks([4|5|4a|5h]+):\/\//g,"https://")||"",this.socksProxy=e.proxy,this.maxRetries=e.maxRetries||5}queryServices=async e=>{let t,n=0;const s=async()=>{try{t=new d(`${this.protocol}://${this.instance}/services/`,this.socksProxy),t.onerror=async o=>(n++,console.error(o),await new Promise(r=>setTimeout(r,100)),await s())}catch{if(n>this.maxRetries)return"max_retries_exceeded";await new Promise(o=>setTimeout(o,100)),await s()}};return await s(),new Promise(o=>{t.onopen=()=>{t.onerror=null,t.send(JSON.stringify(e))};let r=!1;t.onmessage=l=>{r=!0;try{const h=JSON.parse(l.data);o(h)}catch{console.error("queryServices: Bad API JSON response with call: "+e.cmd+" and data:",JSON.stringify(e)),console.error("queryServices: Full data sent: ",JSON.stringify(e)),o("bad_json")}t.close()},t.onerror=()=>!r&&o("unknown_socket_error"),t.onclose=()=>!r&&o("services_closed_early")})};#e=async(e,t,n)=>{if(!e||!t)return"firebase_no_credentials";let s,o;try{s=await(await i.fetch(`https://identitytoolkit.googleapis.com/v1/accounts:${n}?key=${a}`,{method:"POST",body:JSON.stringify({email:e,password:t,returnSecureToken:!0}),headers:{...c,"content-type":"application/json"},dispatcher:this.httpProxy?new i.ProxyAgent(this.httpProxy):void 0})).json(),o=s.idToken}catch(r){return r.code==="auth/network-request-failed"?(console.error("loginWithCredentials: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):r.code==="auth/missing-email"?"firebase_no_credentials":r.code==="ERR_BAD_REQUEST"?(console.error("loginWithCredentials: Error:",e,t),console.error("loginWithCredentials: Error:",r.response?.data||r),"firebase_bad_request"):(console.error("loginWithCredentials: Error:",e,t,r),"firebase_unknown_error")}return o?await this.queryServices({cmd:"auth",firebaseToken:o}):(console.error("loginWithCredentials: the game sent no idToken",s),"firebase_no_token")};createAccount=async(e,t)=>await this.#e(e,t,"signUp");loginWithCredentials=async(e,t)=>await this.#e(e,t,"signInWithPassword");loginWithRefreshToken=async e=>{if(!e)return"firebase_no_credentials";const t=new URLSearchParams;t.append("grant_type","refresh_token"),t.append("refresh_token",e);let n,s;try{n=await(await i.fetch(`https://securetoken.googleapis.com/v1/token?key=${a}`,{method:"POST",body:t,headers:{...c,"content-type":"application/x-www-form-urlencoded"},dispatcher:this.httpProxy?new i.ProxyAgent(this.httpProxy):void 0})).json(),s=n.id_token}catch(r){return r.code==="auth/network-request-failed"?(console.error("loginWithRefreshToken: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):r.code==="auth/missing-email"?"firebase_no_credentials":(console.error("loginWithRefreshToken: Error:",r,e),"firebase_unknown_error")}return s?await this.queryServices({cmd:"auth",firebaseToken:s}):(console.error("loginWithRefreshToken: the game sent no idToken",n),"firebase_no_token")};loginAnonymously=async()=>{const t=await(await i.fetch("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key="+a,{method:"POST",body:JSON.stringify({returnSecureToken:!0}),headers:{...c,"content-type":"application/json"},dispatcher:this.httpProxy?new i.ProxyAgent(this.httpProxy):void 0})).json(),n=t.idToken;return n?await this.queryServices({cmd:"auth",firebaseToken:n}):(console.error("loginAnonymously: the game sent no idToken",t),"firebase_no_token")}}var w=y;export{y as API,w as default};
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable */
2
2
 
3
- import{getWasm as d}from"./wrapper.js";import{addToExternrefTable as r,passStringToWasm as c,getStringFromWasm as o}from"./utils.js";const n={queueMicrotask:e=>{},document:{body:{},currentScript:{}}},s={textContent:""},i={wbg:{__wbg_appendChild_8204974b7328bf98:()=>{},__wbg_body_942ea927546a04ba:(...e)=>r(e[0].body),__wbg_call_672a4d21634d4a24:()=>{},__wbg_createElement_8c9931a732ee2fea:()=>s,__wbg_currentScript_696dfba63dbe2fbe:(...e)=>r(e[0].currentScript),__wbg_document_d249400bd7bd996d:()=>r(n.document),__wbg_get_e27dfaeb6f46bd45:()=>new Proxy({},{get:(e,_)=>{if(_.toString().includes("toPrim"))return t=>{if(t==="number")return 1}},set:(e,_,t)=>(e[_]=t,!0)}),__wbg_instanceof_Element_0af65443936d5154:()=>!0,__wbg_instanceof_HtmlScriptElement_2e62e6b65dda86a4:(...e)=>e[0]===n.document.currentScript,__wbg_instanceof_Window_def73ea0955fc569:()=>!0,__wbg_length_49b2ba67f0897e97:(...e)=>1,__wbg_newnoargs_105ed471475aaf50:()=>{},__wbg_now_807e54c39636c349:()=>Date.now(),__wbg_querySelectorAll_40998fd748f057ef:(...e)=>{const _=o(e[1],e[2]);return[{}]},__wbg_settextContent_d29397f7b994d314:async()=>{},__wbg_static_accessor_GLOBAL_88a902d13a557d07:()=>{},__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0:()=>{},__wbg_static_accessor_SELF_37c5d418e4bf5819:()=>r(n),__wbg_static_accessor_WINDOW_5de37043a91a9c40:()=>{},__wbg_textContent_215d0f87d539368a:(e,_)=>{const[t,b]=c("Shell Shockers and our partners"),a=new DataView(d().memory.buffer);a.setInt32(e+4*1,b,!0),a.setInt32(e+4*0,t,!0)},__wbindgen_debug_string:()=>{},__wbindgen_init_externref_table:()=>{},__wbindgen_is_undefined:(...e)=>e[0]===void 0,__wbindgen_throw:()=>{}}};export{i as imports};
3
+ import{getWasm as o,jsResolve as c}from"./wrapper.js";import{addToExternrefTable as r,getStringFromWasm as s,passStringToWasm as u}from"./utils.js";const a={queueMicrotask:()=>{},document:{body:{},currentScript:{}}},n={textContent:""},w={wbg:{__wbg_appendChild_8204974b7328bf98:()=>{},__wbg_body_942ea927546a04ba:(...e)=>r(e[0].body),__wbg_call_672a4d21634d4a24:()=>{},__wbg_createElement_8c9931a732ee2fea:()=>n,__wbg_currentScript_696dfba63dbe2fbe:(...e)=>r(e[0].currentScript),__wbg_document_d249400bd7bd996d:()=>r(a.document),__wbg_get_e27dfaeb6f46bd45:()=>new Proxy({},{get:(e,t)=>{if(t.toString().includes("toPrim"))return _=>{if(_==="number")return 1}},set:(e,t,_)=>(e[t]=_,!0)}),__wbg_instanceof_Element_0af65443936d5154:()=>!0,__wbg_instanceof_HtmlScriptElement_2e62e6b65dda86a4:(...e)=>e[0]===a.document.currentScript,__wbg_instanceof_Window_def73ea0955fc569:()=>!0,__wbg_length_49b2ba67f0897e97:()=>1,__wbg_newnoargs_105ed471475aaf50:()=>{},__wbg_now_807e54c39636c349:()=>Date.now(),__wbg_querySelectorAll_40998fd748f057ef:()=>[{}],__wbg_settextContent_d29397f7b994d314:async(...e)=>{n.textContent=s(e[1],e[2]),c?.(n.textContent)},__wbg_static_accessor_GLOBAL_88a902d13a557d07:()=>{},__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0:()=>{},__wbg_static_accessor_SELF_37c5d418e4bf5819:()=>r(a),__wbg_static_accessor_WINDOW_5de37043a91a9c40:()=>{},__wbg_textContent_215d0f87d539368a:(e,t)=>{const[_,d]=u(t===n?n.textContent:"Shell Shockers and our partners"),b=new DataView(o().memory.buffer);b.setInt32(e+4*1,d,!0),b.setInt32(e+4*0,_,!0)},__wbindgen_debug_string:()=>{},__wbindgen_init_externref_table:()=>{},__wbindgen_is_undefined:(...e)=>e[0]===void 0,__wbindgen_throw:()=>{}}};export{w as imports};
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable */
2
2
 
3
- import{imports as i}from"./imports.js";import{getStringFromWasm as m,passStringToWasm as p}from"./utils.js";import{wasmBytes as l}from"./bytes.js";const c=await WebAssembly.instantiate(l,i),r=c.instance.exports,y=()=>r,f=o=>{let t,e;try{const[n,a]=p(o),s=r.validate(n,a);return t=s[0],e=s[1],m(t,e)}finally{r.__wbindgen_free(t,e,1)}};export{y as getWasm,f as validate};
3
+ import{imports as m}from"./imports.js";import{getStringFromWasm as p,passStringToWasm as i}from"./utils.js";import{wasmBytes as c}from"./bytes.js";const l=await WebAssembly.instantiate(c,m),s=l.instance.exports,b=()=>s;let f;const g=async r=>{const t=new Promise(n=>{f=n}),[e,o]=i(r);return s.process(e,o),t},w=r=>{let t,e;try{const[o,n]=i(r),a=s.validate(o,n);return t=a[0],e=a[1],p(t,e)}finally{s.__wbindgen_free(t,e,1)}};export{b as getWasm,f as jsResolve,g as process,w as validate};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yolkbot",
3
3
  "description": "create a shell shockers bot in under 10 lines.",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",