@duplicati/ngclient 0.0.39 → 0.0.41
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/chunk-2AULXET4.js +1 -0
- package/{chunk-V7APGUBT.js → chunk-3NZI2UZ4.js} +1 -1
- package/{chunk-U6BEBH6T.js → chunk-4237W7DB.js} +1 -1
- package/{chunk-RBJW3AZS.js → chunk-4EQGEU5E.js} +1 -1
- package/{chunk-LB7YC2O6.js → chunk-57XJ32TF.js} +1 -1
- package/{chunk-6A5PS6I6.js → chunk-5PPKS4ML.js} +3 -3
- package/{chunk-ZI3FISVO.js → chunk-66TOS62R.js} +1 -1
- package/{chunk-2HBUGBA5.js → chunk-6CG2PO47.js} +1 -1
- package/{chunk-PIDBEXSZ.js → chunk-AKLJ23OZ.js} +1 -1
- package/{chunk-443IB2NN.js → chunk-ARZ3SWC2.js} +1 -1
- package/{chunk-5554FPJD.js → chunk-AYQ7K4DG.js} +1 -1
- package/{chunk-FN7XSDHO.js → chunk-BOB7BIYQ.js} +1 -1
- package/{chunk-JAXQGUIS.js → chunk-CMOQLINJ.js} +1 -1
- package/{chunk-QZCTOSPE.js → chunk-EUZXGGH4.js} +1 -1
- package/{chunk-UWT5CUW4.js → chunk-FCHQLLN2.js} +1 -1
- package/{chunk-VU5DK3QN.js → chunk-G6GQ2MDC.js} +1 -1
- package/{chunk-QN6FTJWE.js → chunk-J32PX2MH.js} +1 -1
- package/{chunk-SSYD4I7W.js → chunk-KL64745B.js} +1 -1
- package/{chunk-C7X2VVRU.js → chunk-LTYC3AYW.js} +1 -1
- package/{chunk-URDSNDPP.js → chunk-MTJ4JC4K.js} +1 -1
- package/chunk-MXEBWT5C.js +1 -0
- package/{chunk-RQVSGVED.js → chunk-NWUO2EUU.js} +1 -1
- package/{chunk-ZOIP6MPW.js → chunk-O6D3UT7U.js} +1 -1
- package/chunk-OJ2CS6D3.js +1 -0
- package/{chunk-MRR352S2.js → chunk-QLN75PFG.js} +1 -1
- package/{chunk-E44GSPZB.js → chunk-TCGNOPWE.js} +1 -1
- package/{chunk-I3CYX5BU.js → chunk-UMG632SX.js} +1 -1
- package/{chunk-SHTDZDEX.js → chunk-UYK4G7KS.js} +1 -1
- package/{chunk-7PTK4MN5.js → chunk-X53QKTFJ.js} +1 -1
- package/{chunk-UNTMRP6X.js → chunk-XGN4FDKH.js} +1 -1
- package/{chunk-KKAMLP6E.js → chunk-XVJY4Y25.js} +1 -1
- package/chunk-ZF4CSRRV.js +1 -0
- package/index.html +1 -1
- package/main-6DRXXXV2.js +1 -0
- package/package.json +1 -1
- package/chunk-7A5XJPT7.js +0 -1
- package/chunk-FF6U3HJW.js +0 -1
- package/chunk-O2AA7G55.js +0 -1
- package/chunk-VED3WGNF.js +0 -1
- package/main-FIK2YK65.js +0 -1
package/main-FIK2YK65.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as ie,c as ae}from"./chunk-N35HGIXN.js";import{a as L}from"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import{a as M}from"./chunk-SSYD4I7W.js";import{a as b}from"./chunk-6M3MNJ52.js";import{c as re}from"./chunk-ED3PEZLO.js";import{d as ne}from"./chunk-PIDBEXSZ.js";import{H as Y,L as ee,X as I,ca as te,ma as oe}from"./chunk-J3H4BCHI.js";import{a as Q}from"./chunk-P6LV5I2K.js";import{a as B,b as q,d as _,e as X,f as Z}from"./chunk-5XX7BU4I.js";import{b as se}from"./chunk-OVIL3KMN.js";import{ua as z}from"./chunk-5ZK3D2RS.js";import{Bc as G,Cc as K,E as R,Gb as J,J as W,L as S,Mc as $,N as H,R as y,U,X as r,Za as l,d as j,fb as F,g as P,ja as D,m as E,x as O,y as N}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var d=class o{#o=l(null);#n=window.self!==window.top;config=this.#o.asReadonly();configLoaded=this.#n?new P:null;parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#i(),this.#n&&(this.parentIframeListner=new AbortController,this.#e("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),n=JSON.parse(t);if(!n?.accessToken||!n?.clientId){this.#e("error:invalid-config");return}if(typeof n.clientId!="string"){this.#e("error:invalid-config");return}if(typeof n.accessToken!="string"){this.#e("error:invalid-config");return}console.info("postMessage config set"),this.#o.set(n),this.configLoaded?.next(!0)}},{signal:this.parentIframeListner.signal}))}#e(e){window.parent.postMessage(e,"*")}#i(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})};var T=class o{#o=r(b);#n=r(Y);#e=r(d);sub=null;ngOnInit(){this.#e.fetchConfig(),this.sub=this.#n.queryParams.subscribe(({accessToken:e,clientId:t})=>{e?.length&&t?.length&&this.#e.setConfig({accessToken:e,clientId:t})}),this.#o.clearAllNotCurrentVersion()}ngOnDestroy(){this.sub?.unsubscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=F({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&J(0,"router-outlet")},dependencies:[ee],encapsulation:2})};var pe={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var u=new U("ENVIRONMENT");var v=class o{#o=r(ne);isLoaded=l(!1);webmodules=l(null);preload(e=!1){let t=this.#o.getApiV1Webmodules().pipe(H(n=>this.webmodules.set(n)),R(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})};var fe=()=>{let o=r(d),e=r(D);return o.configLoaded===null?O([e.get(L).preload(!0),e.get(v).preload(!0)]):o.configLoaded?.pipe(S(()=>O([e.get(L).preload(!0),e.get(v).preload(!0)])))},ce=[{path:"",children:[{path:"login",canActivate:[()=>r(M).token()!==null?r(I).navigate(["/"]):!0],loadComponent:()=>import("./chunk-UWT5CUW4.js")},{path:"logout",loadComponent:()=>import("./chunk-UNTMRP6X.js")},{path:"",canActivate:[fe],loadComponent:()=>import("./chunk-O2AA7G55.js"),children:[{path:"",loadComponent:()=>import("./chunk-QN6FTJWE.js")},{path:"add-backup",loadComponent:()=>import("./chunk-ZOIP6MPW.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-U6BEBH6T.js")},{path:"backup/import",loadComponent:()=>import("./chunk-URDSNDPP.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-5554FPJD.js"),loadChildren:()=>import("./chunk-VED3WGNF.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-5554FPJD.js"),loadChildren:()=>import("./chunk-VED3WGNF.js")},{path:"restore",loadComponent:()=>import("./chunk-7PTK4MN5.js")},{path:"restore-flow/:id",loadComponent:()=>import("./chunk-E44GSPZB.js"),children:[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"select-files",loadComponent:()=>import("./chunk-LB7YC2O6.js")},{path:"options",loadComponent:()=>import("./chunk-MRR352S2.js")}]},{path:"settings",loadComponent:()=>import("./chunk-RQVSGVED.js")},{path:"about",loadComponent:()=>import("./chunk-ZVU4LS6E.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-2HBUGBA5.js")},{path:"changelog",loadComponent:()=>import("./chunk-ZI3FISVO.js")},{path:"libraries",loadComponent:()=>import("./chunk-SHTDZDEX.js")},{path:"system-info",loadComponent:()=>import("./chunk-443IB2NN.js")},{path:"logs",loadComponent:()=>import("./chunk-C7X2VVRU.js")}]}]}]}];var A=null,le=(o,e)=>{let t=r(M),n=r(I),c=r(b),i=r(u),f=r(re),s=c.getItem("locale"),p=ie(s),h=o;if(t.token()&&o.url.startsWith(i.baseUrl)){let a=o.headers.set("Authorization",`Bearer ${t.token()}`);s&&s!=="en-US"&&(a=a.set("X-Ui-Language",p)),h=o.clone({headers:a})}return e(h).pipe(N(a=>{if(f.error(a.message),a.status===401&&!A&&(A=t.refreshToken().pipe(W())),a.status===401)return A.pipe(S(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))),N(g=>(n.navigate(["/logout"]),E(()=>g))),R(()=>A=null));let m=`Error Code: ${a.status}, Message: ${a.message}`;return E(()=>({error:a,message:m}))}))};var he="1.0.0",me="portal-proxy-client",ge=1,k=class o{#o=1e3;#n=r(u);#e=l("disconnected");#i=l(this.#o);#a=l(!1);#r=l(!1);#p=l(null);isConnectedToMachineServer=this.#r.asReadonly();wsState=this.#e.asReadonly();#c=[];#s={};#t=null;#m=new TextDecoder("utf-8");#l=null;#d=$(()=>{let e=this.#a(),t=this.#i(),n=this.#p();if(!n||!e||!t||t<this.#o){this.#l&&window.clearInterval(this.#l);return}this.#l=window.setInterval(()=>{this.connectToMachineServer(n)},t)});utf8Atob(e){let t=Uint8Array.from(atob(e),c=>c.charCodeAt(0)),n=this.#m.decode(t);return n?JSON.parse(n):null}connectToMachineServer(e,t){let n=t?.reconnect??!1;this.#t&&this.wsState()==="authenticated"&&!n||(this.#t&&this.wsState()!=="authenticated"&&this.#t.close(),this.#t=new WebSocket(this.#n.machineServerUrl),this.#t.onopen=()=>{this.#e.set("connect"),this.#r.set(!0),this.#a.set(!1),this.#p.set(null)},this.#t.onclose=()=>{this.#e.set("disconnected"),this.#r.set(!1),this.#p.set(e),this.#a.set(!0)},this.#t.onerror=()=>{this.#e.set("error")},this.#t.onmessage=c=>{let i=JSON.parse(c.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let s={token:e,publicKey:"",clientVersion:he,protocolVersion:ge},p=this.createResponse(i,"authportal",s);this.#e.set("welcome"),this.#t?.send(p)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var f=JSON.parse(i.payload??"");if(f.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#e.set("authenticated"),this.#r.set(!0);this.#c.length>0;){let s=this.#c.pop();s&&this.#s[s.messageId]&&this.activateCommand(s)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let s=this.#s[i.messageId];if(s){if(i.errorMessage){s.reject(i.errorMessage);return}else{let p=JSON.parse(i.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),s.resolve(p)}delete this.#s[i.messageId],window.clearTimeout(s.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#t?.close(),this.#t=null,this.#e.set("disconnected"),this.#r.set(!1)}createResponse(e,t,n){let c={from:me,to:e.from,type:t,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(c)}sendCommand(e,t,n,c,i,f,s=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((p,h)=>{let a=crypto.randomUUID(),g={from:me,to:t,type:"command",messageId:a,payload:JSON.stringify({method:n,path:c,body:i,headers:f})},C={resolve:p,reject:h,timer:window.setTimeout(()=>{let w=this.#s[a];w&&(delete this.#s[a],w.reject("Timeout"))},s)};this.#s[a]=C,this.#r()?this.activateCommand(g):this.#c.push(g)})}activateCommand(e){this.#t?.send(JSON.stringify(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})};function ye(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}var de=(o,e)=>{let n=r(d).config(),c=r(u);if(n===null)return e(o);let i=r(k),f=ye(o.body),s={};o.headers.keys().forEach(m=>{s[m]=o.headers.get(m)??""});let p=o.headers.get("timeout"),h=p!==null?parseInt(p):c.defaultTimeout,a=i.sendCommand(n.accessToken,n.clientId,o.method,o.url,f,s,h);return new j(m=>{a.then(g=>{let C=new B;s!=null&&Object.keys(s).forEach(V=>{C.set(V,s[V])});let w=new q({body:g.body,status:g.code,statusText:"OK",headers:C});m.next(w),m.complete()})})};var ue={providers:[G(),te(ce,oe()),_(Z(),X([de,le])),b,{provide:u,useValue:pe},{provide:K,useValue:ae()},se,z]};Q(T,ue);
|