remove compiler output from git
This commit is contained in:
@@ -171,3 +171,8 @@ dist
|
||||
worker.capnp
|
||||
docker-compose.yml
|
||||
Dockerfile
|
||||
|
||||
# typescript output
|
||||
|
||||
static/*.js
|
||||
static/*.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,3 +0,0 @@
|
||||
var d=i=>{throw TypeError(i)};var o=(i,t,h)=>t.has(i)||d("Cannot "+h);var n=(i,t,h)=>(o(i,t,"read from private field"),h?h.call(i):t.get(i)),c=(i,t,h)=>t.has(i)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,h),u=(i,t,h,e)=>(o(i,t,"write to private field"),e?e.call(i,h):t.set(i,h),h);var l,r,a,s,w=class{constructor(t,h=(e,f)=>globalThis.fetch(e,f)){c(this,l,new URL(import.meta.url).origin);c(this,r,null);c(this,a,null);c(this,s,null);u(this,s,h),u(this,r,t),t.getAccessTokenForUser(void 0).then(e=>caches.open(e.userId+"/"+t.clientId)).then(e=>u(this,a,e))}async fetch(t,h={}){if(t=new URL(t,n(this,l)),t.origin==n(this,l)){let e=await n(this,r).getAccessTokenForUser(void 0);h.headers||(h.headers={}),h.headers.authorization="OAuth "+e.accessToken}if("method"in h)switch(h.method){case"PUT":case"POST":{let e=await n(this,s).call(this,t,h);if(!e.ok)return e;let f=await new Request(t,h).blob();return n(this,a).put(t,new Response(f)),e}case"DELETE":{let e=await n(this,s).call(this,t,h);return e.ok&&n(this,a).delete(t),e}}return n(this,s).call(this,t,h).then(async e=>{if(e.status>=500)throw new Error(e.statusText+`
|
||||
`+await e.text());return n(this,a).put(t,e.clone()),e}).catch(e=>(console.warn(e),n(this,a).match(t)))}};l=new WeakMap,r=new WeakMap,a=new WeakMap,s=new WeakMap;export{w as default};
|
||||
//# sourceMappingURL=WebStorage.js.map
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../static_src/WebStorage.ts"],
|
||||
"sourcesContent": ["/**\n * @callback fetch\n * @param {RequestInfo} resource\n * @param {RequestInit} options\n * @returns {Promise<Response>}\n */\n\nexport default class WebStorage {\n\n #origin = new URL(import.meta.url).origin\n #auth_provider: import('@twurple/auth').AuthProvider = null;\n #cache: Cache = null\n #fetch: typeof globalThis.fetch = null\n\n /**\n * Creates a fetch request wrapper that returns cached responses when the server can't be reached.\n * When only a path is provided, the origin defaults to the same origin this module was loaded from.\n * When the origin matches this script, authorization headers are added automatically.\n * You can also use this for GET requests to any orgigin, but other methods may have unknown behavior.\n * @param {import('@twurple/auth').AuthProvider} auth_provider used to add the authentication header to requests for web storage\n * @param {fetch} fetch defaults to `globalThis.fetch`, allows you to further customize fetch behavior via chaining, for example with `fetch-retry`\n */\n constructor(auth_provider: import('@twurple/auth').AuthProvider, fetch: typeof globalThis.fetch = (resource,options)=>{return globalThis.fetch(resource,options)}) {\n this.#fetch = fetch\n this.#auth_provider = auth_provider\n auth_provider.getAccessTokenForUser(undefined)\n .then(token => caches.open(token.userId + '/' + auth_provider.clientId))\n .then(cache => this.#cache = cache)\n }\n\n /**\n * \n * @param {String | URL} resource \n * @param {RequestInit} options \n */\n async fetch(resource: string | URL, options: RequestInit={}) {\n resource = new URL(resource, this.#origin)\n if (resource.origin == this.#origin) {\n const token = await this.#auth_provider.getAccessTokenForUser(undefined)\n if (!options.headers) {\n options.headers = {}\n }\n options.headers['authorization'] = 'OAuth ' + token.accessToken\n }\n if ('method' in options) {\n switch (options.method) {\n case 'PUT':\n case 'POST': {\n const response = await this.#fetch(resource, options)\n if (!response.ok) {\n return response\n }\n const blob = await new Request(resource, options).blob()\n this.#cache.put(resource, new Response(blob))\n return response\n }\n case 'DELETE': {\n const response = await this.#fetch(resource, options)\n if (!response.ok) {\n return response\n }\n this.#cache.delete(resource)\n return response\n }\n }\n }\n return this.#fetch(resource, options)\n .then(async response => {\n if (response.status >= 500) {\n throw new Error(response.statusText + '\\n' + await response.text())\n }\n this.#cache.put(resource, response.clone())\n return response\n }).catch(error => {\n console.warn(error)\n return this.#cache.match(resource)\n }\n )\n }\n}"],
|
||||
"mappings": "2UAAA,IAAAA,EAAAC,EAAAC,EAAAC,EAOqBC,EAArB,KAAgC,CAe5B,YAAYC,EAAqDC,EAAiC,CAACC,EAASC,IAAkB,WAAW,MAAMD,EAASC,CAAO,EAAI,CAbnKC,EAAA,KAAAT,EAAU,IAAI,IAAI,YAAY,GAAG,EAAE,QACnCS,EAAA,KAAAR,EAAuD,MACvDQ,EAAA,KAAAP,EAAgB,MAChBO,EAAA,KAAAN,EAAkC,MAW9BO,EAAA,KAAKP,EAASG,GACdI,EAAA,KAAKT,EAAiBI,GACtBA,EAAc,sBAAsB,MAAS,EACxC,KAAKM,GAAS,OAAO,KAAKA,EAAM,OAAS,IAAMN,EAAc,QAAQ,CAAC,EACtE,KAAKO,GAASF,EAAA,KAAKR,EAASU,EAAK,CAC1C,CAOA,MAAM,MAAML,EAAwBC,EAAqB,CAAC,EAAG,CAEzD,GADAD,EAAW,IAAI,IAAIA,EAAUM,EAAA,KAAKb,EAAO,EACrCO,EAAS,QAAUM,EAAA,KAAKb,GAAS,CACjC,IAAMW,EAAQ,MAAME,EAAA,KAAKZ,GAAe,sBAAsB,MAAS,EAClEO,EAAQ,UACTA,EAAQ,QAAU,CAAC,GAEvBA,EAAQ,QAAQ,cAAmB,SAAWG,EAAM,WACxD,CACA,GAAI,WAAYH,EACZ,OAAQA,EAAQ,OAAQ,CACpB,IAAK,MACL,IAAK,OAAQ,CACT,IAAMM,EAAW,MAAMD,EAAA,KAAKV,GAAL,UAAYI,EAAUC,GAC7C,GAAI,CAACM,EAAS,GACV,OAAOA,EAEX,IAAMC,EAAO,MAAM,IAAI,QAAQR,EAAUC,CAAO,EAAE,KAAK,EACvD,OAAAK,EAAA,KAAKX,GAAO,IAAIK,EAAU,IAAI,SAASQ,CAAI,CAAC,EACrCD,CACX,CACA,IAAK,SAAU,CACX,IAAMA,EAAW,MAAMD,EAAA,KAAKV,GAAL,UAAYI,EAAUC,GAC7C,OAAKM,EAAS,IAGdD,EAAA,KAAKX,GAAO,OAAOK,CAAQ,EACpBO,CACX,CACJ,CAEJ,OAAOD,EAAA,KAAKV,GAAL,UAAYI,EAAUC,GACxB,KAAK,MAAMM,GAAY,CACpB,GAAIA,EAAS,QAAU,IACnB,MAAM,IAAI,MAAMA,EAAS,WAAa;AAAA,EAAO,MAAMA,EAAS,KAAK,CAAC,EAEtE,OAAAD,EAAA,KAAKX,GAAO,IAAIK,EAAUO,EAAS,MAAM,CAAC,EACnCA,CACX,CAAC,EAAE,MAAME,IACL,QAAQ,KAAKA,CAAK,EACXH,EAAA,KAAKX,GAAO,MAAMK,CAAQ,EAEzC,CACJ,CACJ,EAtEIP,EAAA,YACAC,EAAA,YACAC,EAAA,YACAC,EAAA",
|
||||
"names": ["_origin", "_auth_provider", "_cache", "_fetch", "WebStorage", "auth_provider", "fetch", "resource", "options", "__privateAdd", "__privateSet", "token", "cache", "__privateGet", "response", "blob", "error"]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user