@mercuryworkshop/scramjet 2.0.0-alpha → 2.0.1-alpha

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.
Files changed (57) hide show
  1. package/dist/c34a4f083a11eae2.wasm +0 -0
  2. package/dist/scramjet.js +33 -0
  3. package/dist/scramjet.js.map +1 -0
  4. package/dist/scramjet.mjs +33 -0
  5. package/dist/scramjet.mjs.map +1 -0
  6. package/dist/scramjet.wasm.wasm +0 -0
  7. package/dist/scramjet_bundled.js +33 -0
  8. package/dist/scramjet_bundled.js.map +1 -0
  9. package/dist/scramjet_bundled.mjs +33 -0
  10. package/dist/scramjet_bundled.mjs.map +1 -0
  11. package/dist/types/client/client.d.ts +91 -0
  12. package/dist/types/client/entry.d.ts +5 -0
  13. package/dist/types/client/events.d.ts +38 -0
  14. package/dist/types/client/helpers.d.ts +1 -0
  15. package/dist/types/client/index.d.ts +7 -0
  16. package/dist/types/client/location.d.ts +2 -0
  17. package/dist/types/client/shared/eval.d.ts +3 -0
  18. package/dist/types/client/shared/sourcemaps.d.ts +19 -0
  19. package/dist/types/client/shared/wrap.d.ts +4 -0
  20. package/dist/types/client/singletonbox.d.ts +14 -0
  21. package/dist/types/fetch/index.d.ts +80 -0
  22. package/dist/types/index.d.ts +9 -0
  23. package/dist/types/shared/cookie.d.ts +18 -0
  24. package/dist/types/shared/headers.d.ts +13 -0
  25. package/dist/types/shared/htmlRules.d.ts +6 -0
  26. package/dist/types/shared/index.d.ts +23 -0
  27. package/dist/types/shared/rewriters/css.d.ts +4 -0
  28. package/dist/types/shared/rewriters/html.d.ts +6 -0
  29. package/dist/types/shared/rewriters/index.d.ts +6 -0
  30. package/dist/types/shared/rewriters/js.d.ts +11 -0
  31. package/dist/types/shared/rewriters/url.d.ts +11 -0
  32. package/dist/types/shared/rewriters/wasm.d.ts +8 -0
  33. package/dist/types/shared/rewriters/worker.d.ts +3 -0
  34. package/dist/types/shared/security/index.d.ts +1 -0
  35. package/dist/types/shared/security/siteTests.d.ts +1 -0
  36. package/dist/types/symbols.d.ts +7 -0
  37. package/dist/types/types.d.ts +114 -0
  38. package/lib/index.d.ts +5 -0
  39. package/package.json +98 -84
  40. package/LICENSE +0 -661
  41. package/README.md +0 -65
  42. package/dist/06813b79f94926ac.wasm +0 -0
  43. package/dist/09d5a95846afcaf1.wasm +0 -0
  44. package/dist/507621c43f70fc86.wasm +0 -0
  45. package/dist/63d477311eb50f38.wasm +0 -0
  46. package/dist/70102b41994b76de.wasm +0 -0
  47. package/dist/a31cde01c0b49ef3.wasm +0 -0
  48. package/dist/b4f3c1c0e4a92823.wasm +0 -0
  49. package/dist/d864ec42994880cb.wasm +0 -0
  50. package/dist/dbbe994629c3010c.wasm +0 -0
  51. package/dist/scramjet.all.js +0 -194
  52. package/dist/scramjet.all.js.map +0 -1
  53. package/dist/scramjet.bundle.js +0 -194
  54. package/dist/scramjet.bundle.js.map +0 -1
  55. package/dist/scramjet.sync.js +0 -2
  56. package/dist/scramjet.sync.js.map +0 -1
  57. package/lib/noop.js +0 -0
@@ -1,2 +0,0 @@
1
- addEventListener("message",({data:{sab:e,args:[t,n,s,r,o],body:a,headers:g}})=>{let i=new DataView(e),l=new Uint8Array(e),d=new XMLHttpRequest;if(d.responseType="arraybuffer",d.open(t,n,!0,r,o),g)for(let[e,t]of Object.entries(g))d.setRequestHeader(e,t);d.send(a),d.onload=()=>{let t=1;i.setUint16(t,d.status),t+=2;let n=d.getAllResponseHeaders();i.setUint32(t,n.length),t+=4,e.byteLength<t+n.length&&e.grow(t+n.length),l.set(new TextEncoder().encode(n),t),t+=n.length,i.setUint32(t,d.response.byteLength),t+=4,e.byteLength<t+d.response.byteLength&&e.grow(t+d.response.byteLength),l.set(new Uint8Array(d.response),t),i.setUint8(0,1)},d.ontimeout=d.onerror=d.onabort=()=>{console.error("xhr failed"),i.setUint8(0,1)}});
2
- //# sourceMappingURL=scramjet.sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scramjet.sync.js","sources":["webpack://@mercuryworkshop/scramjet/./src/sync.ts"],"sourcesContent":["addEventListener(\n\t\"message\",\n\t({\n\t\tdata: {\n\t\t\tsab,\n\t\t\targs: [method, url, _, username, password],\n\t\t\tbody,\n\t\t\theaders,\n\t\t},\n\t}) => {\n\t\tconst view = new DataView(sab);\n\t\tconst u8view = new Uint8Array(sab);\n\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.responseType = \"arraybuffer\";\n\n\t\t// force async since we need it to resolve to the sw\n\t\txhr.open(method, url, true, username, password);\n\n\t\tif (headers)\n\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\txhr.setRequestHeader(k, v as string);\n\t\t\t}\n\n\t\txhr.send(body);\n\n\t\txhr.onload = () => {\n\t\t\tlet cursor = 1; // first byte is the lock\n\n\t\t\tview.setUint16(cursor, xhr.status);\n\t\t\tcursor += 2;\n\n\t\t\t// next write the header string\n\t\t\tconst headers = xhr.getAllResponseHeaders();\n\t\t\tview.setUint32(cursor, headers.length);\n\t\t\tcursor += 4;\n\n\t\t\tif (sab.byteLength < cursor + headers.length)\n\t\t\t\tsab.grow(cursor + headers.length);\n\t\t\tu8view.set(new TextEncoder().encode(headers), cursor);\n\t\t\tcursor += headers.length;\n\n\t\t\tview.setUint32(cursor, xhr.response.byteLength);\n\t\t\tcursor += 4;\n\n\t\t\tif (sab.byteLength < cursor + xhr.response.byteLength)\n\t\t\t\tsab.grow(cursor + xhr.response.byteLength);\n\t\t\tu8view.set(new Uint8Array(xhr.response), cursor);\n\n\t\t\t// release the lock, main thread will stop spinning now\n\t\t\tview.setUint8(0, 1);\n\t\t};\n\t\txhr.ontimeout =\n\t\t\txhr.onerror =\n\t\t\txhr.onabort =\n\t\t\t\t() => {\n\t\t\t\t\tconsole.error(\"xhr failed\");\n\t\t\t\t\tview.setUint8(0, 1);\n\t\t\t\t};\n\t}\n);\n"],"names":["addEventListener","sab","method","url","_","username","password","body","headers","view","DataView","u8view","Uint8Array","x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