@duplicati/ngclient 0.0.183 → 0.0.185

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 (55) hide show
  1. package/{chunk-ZCSLL22M.js → chunk-27ICL4CS.js} +1 -1
  2. package/{chunk-OQ3SKNS2.js → chunk-42L3D2F7.js} +1 -1
  3. package/{chunk-XZ35H3QB.js → chunk-43HR5ZDT.js} +1 -1
  4. package/chunk-4RKO4YFU.js +1 -0
  5. package/{chunk-BNQSW4G5.js → chunk-4YC2YMYH.js} +1 -1
  6. package/{chunk-MLTHWDBE.js → chunk-5G4V55RS.js} +1 -1
  7. package/{chunk-ZTXNJMNP.js → chunk-5LYRKTAV.js} +1 -1
  8. package/{chunk-GG3FXQPK.js → chunk-67L5H6HO.js} +1 -1
  9. package/{chunk-YFWXKCXL.js → chunk-67Q6QMQY.js} +1 -1
  10. package/chunk-A4RSARWN.js +1 -0
  11. package/{chunk-XFKT7HQ4.js → chunk-AV5KKRMA.js} +1 -1
  12. package/chunk-B2VS7Z6E.js +1 -0
  13. package/{chunk-VLHMURFN.js → chunk-BBRK364M.js} +1 -1
  14. package/chunk-CGQ2WKCU.js +1 -0
  15. package/{chunk-AEVJZNUY.js → chunk-DUIZM4ZO.js} +1 -1
  16. package/{chunk-XFTFZ5UD.js → chunk-EBSK6KZQ.js} +1 -1
  17. package/{chunk-TAFKX5F2.js → chunk-EXFIQK72.js} +1 -1
  18. package/{chunk-DH6M7Y7C.js → chunk-H5XAYRQ6.js} +1 -1
  19. package/{chunk-D3VVL4NK.js → chunk-HO5WBGKU.js} +1 -1
  20. package/{chunk-FVZOIWTT.js → chunk-HRCZ5SXI.js} +1 -1
  21. package/{chunk-APZXLYUU.js → chunk-I3GPRGH5.js} +1 -1
  22. package/{chunk-NJ2XZSM6.js → chunk-IQ3RNWGH.js} +1 -1
  23. package/{chunk-QGD6TGTI.js → chunk-JNMQJO3U.js} +1 -1
  24. package/{chunk-U7ABTEOS.js → chunk-JRJXFRW7.js} +1 -1
  25. package/{chunk-CR3C6XYB.js → chunk-JU5OZOO2.js} +1 -1
  26. package/{chunk-QQOFLIJG.js → chunk-LJ2P7K2Z.js} +1 -1
  27. package/{chunk-ODTXKOWN.js → chunk-LVX3DTQM.js} +1 -1
  28. package/{chunk-FPKRDCQ6.js → chunk-MM36XELZ.js} +1 -1
  29. package/{chunk-BXWAVFI6.js → chunk-MNHB4VKJ.js} +1 -1
  30. package/{chunk-Z6QCNSVI.js → chunk-NF4VR5PI.js} +1 -1
  31. package/{chunk-FNIOBDFO.js → chunk-OITOOW5H.js} +1 -1
  32. package/{chunk-WUK4ABE5.js → chunk-P3AUEHHI.js} +1 -1
  33. package/{chunk-AESH2EML.js → chunk-QEE2RRQ4.js} +1 -1
  34. package/{chunk-KTLT4LKY.js → chunk-QIUMBQM5.js} +1 -1
  35. package/{chunk-DNHCL3D4.js → chunk-QKYDZL4G.js} +1 -1
  36. package/{chunk-5Y3YA4IZ.js → chunk-QT7EG3ZF.js} +1 -1
  37. package/{chunk-GCL5YZGN.js → chunk-RD5JFFHQ.js} +1 -1
  38. package/{chunk-CU5GQUSX.js → chunk-SJTXV6AC.js} +1 -1
  39. package/{chunk-GXYICCA6.js → chunk-UAMORY54.js} +1 -1
  40. package/{chunk-LWJ6FCGJ.js → chunk-UFTPS2J6.js} +1 -1
  41. package/{chunk-G4PJG5YL.js → chunk-V42KLXW4.js} +1 -1
  42. package/{chunk-EYIHDNRT.js → chunk-VGYWG5A3.js} +1 -1
  43. package/{chunk-G4BVOKDI.js → chunk-WA53HHVH.js} +1 -1
  44. package/{chunk-QZRRXR3V.js → chunk-WVF3GRDZ.js} +1 -1
  45. package/{chunk-4GDXGM4L.js → chunk-XUPDFNDB.js} +1 -1
  46. package/{chunk-WHT6WK7V.js → chunk-YYSJESAX.js} +1 -1
  47. package/{chunk-CRIAZIHV.js → chunk-ZTDAMLNP.js} +1 -1
  48. package/index.html +1 -1
  49. package/main-BV7ROS25.js +1 -0
  50. package/package.json +1 -1
  51. package/chunk-5QZIKR6A.js +0 -1
  52. package/chunk-6K3PRIYO.js +0 -1
  53. package/chunk-FRN7G2XC.js +0 -1
  54. package/chunk-UGATCU55.js +0 -1
  55. package/main-DLNJU5L6.js +0 -1
package/chunk-FRN7G2XC.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-GCL5YZGN.js")},{path:"destination",loadComponent:()=>import("./chunk-5Y3YA4IZ.js")},{path:"source-data",loadComponent:()=>import("./chunk-XFTFZ5UD.js")},{path:"schedule",loadComponent:()=>import("./chunk-4GDXGM4L.js")},{path:"options",loadComponent:()=>import("./chunk-XFKT7HQ4.js")}];export{o as default};
package/chunk-UGATCU55.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-ZCSLL22M.js")},{path:"encryption",loadComponent:()=>import("./chunk-VLHMURFN.js")},{path:"select-files",loadComponent:()=>import("./chunk-BXWAVFI6.js")},{path:"options",loadComponent:()=>import("./chunk-MLTHWDBE.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-OQ3SKNS2.js")}],t=o;export{t as default};
package/main-DLNJU5L6.js DELETED
@@ -1 +0,0 @@
1
- import{b as Me,c as Ie}from"./chunk-VEWX3KXN.js";import{a as Re}from"./chunk-TAFKX5F2.js";import{a as Ee}from"./chunk-KRXQDBGB.js";import{a as k}from"./chunk-LWJ6FCGJ.js";import{a as Te}from"./chunk-FOQJA6X2.js";import{b as we}from"./chunk-VHOAXFIJ.js";import"./chunk-FVZOIWTT.js";import{a as D}from"./chunk-6Q6SSTBK.js";import{a as ve}from"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-QZRRXR3V.js";import"./chunk-6K3PRIYO.js";import{a as H}from"./chunk-TELPJYLN.js";import{a as h,b as S,c as Se,d as I}from"./chunk-5QZIKR6A.js";import{v as ye,x as be}from"./chunk-HPNLQHW6.js";import{a as T,d as Ce}from"./chunk-BGTK25UG.js";import{c as me,d as de,g as ue,h as he,i as fe,j as ge}from"./chunk-A4LPGPDU.js";import{a as re}from"./chunk-PKPBSTZA.js";import{a as se,b as ie,c as ae,e as pe,f as ce,g as le}from"./chunk-QPTSKQZ2.js";import{fa as oe,ka as ne}from"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Bb as Z,E as M,I as K,Ic as ee,Jc as te,K as w,M as q,R as v,U as z,W as s,cb as Y,da as _,ea as X,f as F,g as $,l as B,la as d,m as G,na as Q,p as R,y as L,z as J}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";function Ue(){try{let t=document.querySelector('meta[name="duplicati-proxy-config"]');if(t){let e=(t.getAttribute("content")||"").trim();if(e&&e.startsWith("/"))return e}}catch(t){console.warn("Failed to read proxy configuration from meta tag:",t)}return null}function ke(){let t=Ue();if(t&&t.length>0){let e=t;e.startsWith("/")||(e=`/${e}`),e.endsWith("/")&&(e=e.slice(0,-1)),T.BASE=e}else T.BASE=""}var A=class t{#e=s(h);#a=s(S);ngOnInit(){ke(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=Y({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Z(0,"router-outlet")},dependencies:[me],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new z("ENVIRONMENT");var O=class t{#e=s(Ce);isLoaded=d(!1);webmodules=d(null);preload(e=!1){let o=this.#e.getApiV1Webmodules().pipe(q(n=>this.webmodules.set(n)),M(()=>this.isLoaded.set(!0)));if(e)return o;o.subscribe()}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};var We=()=>{let t=s(I);return t.token()?!0:t.checkProxyAuthed().pipe(w(e=>e?B(!0):t.refreshToken().pipe(R(()=>!0))))},je=()=>{let t=s(S),e=s(k),o=s(_),n=t.relayIsEnabled()?"longpoll":"websocket",a=[o.get(H).preload(!0),o.get(H).preloadFilterGroups(!0),o.get(O).preload(!0)];return t.configLoaded===null?L(a).pipe(R(()=>n)):t.configLoaded?.pipe(w(()=>L(a)))},Fe=()=>!0,Oe={path:"connect/:typeParam",loadComponent:()=>import("./chunk-CRIAZIHV.js")},$e=()=>{let t=s(h);return!t.getItem("locale")&&navigator.language&&t.setItem("locale",navigator.language),!0},Ne=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-XZ35H3QB.js")},{path:"logout",loadComponent:()=>import("./chunk-NJ2XZSM6.js")},{path:"",canActivate:[We],children:[{path:"",canActivate:[je,Fe,$e],children:[{path:"welcome",loadComponent:()=>import("./chunk-ZXVCNNR6.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-WHT6WK7V.js")},Oe]},{path:"",loadComponent:()=>import("./chunk-FNIOBDFO.js"),children:[{path:"",loadComponent:()=>import("./chunk-Z6QCNSVI.js")},Oe,{path:"add-backup",loadComponent:()=>import("./chunk-D3VVL4NK.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-AEVJZNUY.js")},{path:"backup/import",loadComponent:()=>import("./chunk-DH6M7Y7C.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-BNQSW4G5.js"),loadChildren:()=>import("./chunk-FRN7G2XC.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-BNQSW4G5.js"),loadChildren:()=>import("./chunk-FRN7G2XC.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-AESH2EML.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-WUK4ABE5.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-FPKRDCQ6.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-QGD6TGTI.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-YFWXKCXL.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-GXYICCA6.js")},{path:"from-config",loadComponent:()=>import("./chunk-FQZFKTPW.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-ZTXNJMNP.js"),loadChildren:()=>import("./chunk-UGATCU55.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-ZTXNJMNP.js"),loadChildren:()=>import("./chunk-UGATCU55.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-ZTXNJMNP.js"),loadChildren:()=>import("./chunk-UGATCU55.js")},{path:"settings",loadComponent:()=>import("./chunk-DNHCL3D4.js")},{path:"about",loadComponent:()=>import("./chunk-GG3FXQPK.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-G4BVOKDI.js")},{path:"changelog",loadComponent:()=>import("./chunk-T7WSF7RL.js")},{path:"libraries",loadComponent:()=>import("./chunk-B2Y54P3R.js")},{path:"system-info",loadComponent:()=>import("./chunk-SFR3XMV4.js")},{path:"server-settings",loadComponent:()=>import("./chunk-G4PJG5YL.js")},{path:"logs",loadChildren:()=>import("./chunk-MRAKGZE6.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-7XS6T6TX.js")}]}]}]}]}]}];var U=null,xe=(t,e)=>{let o=s(I),n=s(de),a=s(h),p=s(f),i=a.getItem("locale"),u=s(be),c=Me(i),r=T.BASE||"",m=t.url===`${r}/api/v1/auth/login`,y=t.url===`${r}/api/v1/auth/refresh`,b=t.url===`${r}/api/v1/progressstate`,C=t.url===`${r}/api/v1/remoteoperation/test`,E=t.url===`${r}/api/v1/filesystem/validate`,Ve=t.url.startsWith(`${r}/api/v2/`),P=o.token(),W=t,j=t.headers.has("custom-proxy-check")||P===Se;if(P&&t.url.startsWith(r+p.baseUrl)&&!j){let l=t.headers.set("Authorization",`Bearer ${P}`);i&&i!=="en-US"&&(l=l.set("X-Ui-Language",c)),W=t.clone({headers:l})}return e(W).pipe(R(l=>{if(l.type===4&&l.status===200&&Ve){let g=l.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return l}),J(l=>{let g=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;return!j&&(b&&l.status===404||C||E||u.error(g),y&&l.status===401&&(o.logout(),n.navigate(["/logout"])),!m&&!y&&l.status===401)?(U??=o.refreshToken().pipe(K()),U.pipe(w(()=>e(t.clone({headers:t.headers.set("Authorization",`Bearer ${o.token()}`)}))),M(()=>U=null))):G(()=>({error:l,message:g}))}))};var N=class t{#e=s(X);showError(e){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=e||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};var Be="1.0.0",Pe=`portal-proxy-client-${D()}`,Ge=1,x=class t{#e=1e3;#a=s(f);#d=s(N);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=Q(()=>{let e=this.#p(),o=this.#u(),n=this.#c();if(!n||!e||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(e){this.#s||(this.#s=!0,this.#d.showError(e||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(e){let o=Uint8Array.from(atob(e),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(e,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#c.set(e),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let c={token:e,publicKey:"",clientVersion:Be,protocolVersion:Ge},r=this.createResponse(i,"authportal",c);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let c=this.#l.pop();c&&this.#r[c.messageId]&&this.activateCommand(c)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let c=this.#r[i.messageId];if(c){if(i.errorMessage)this.#i(i.errorMessage),c.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),c.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(c.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(e,o,n){let a={from:Pe,to:e.from,type:o,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(e,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((c,r)=>{let m=D(),b={from:Pe,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},C={resolve:c,reject:r,timer:window.setTimeout(()=>{let E=this.#r[m];E&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),E.reject("Timeout"))},u)};this.#r[m]=C,this.#n()?this.activateCommand(b):this.#l.push(b)})}activateCommand(e){this.#t?.send(JSON.stringify(e))}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};function Je(t){if(typeof t!="string")return null;let o=new TextEncoder().encode(t);return window.btoa(String.fromCharCode(...o))}function Le(t,e,o){let n=t.relayconfigState.config();if(n===null)return o(e);let a=Je(e.body),p={};e.headers.keys().forEach(r=>{p[r]=e.headers.get(r)??""});let i=e.headers.get("timeout"),u=i!==null?parseInt(i):t.defaultTimeout;e.url.startsWith("/api/v1/serverstate")&&e.url.includes("longpoll=true")&&(u=1e3*99);let c=t.relayWebsocket.sendCommand(n.accessToken,n.clientId,e.method,e.url,a,p,u);return new F(r=>{c.then(m=>{let y=new se;p!=null&&Object.keys(p).forEach(C=>{y.set(C,p[C])});let b=new ie({body:m.body,status:m.statusCode,statusText:"OK",headers:y});r.next(b),r.complete()}).catch(m=>{r.error(new ae({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var He=(t,e)=>{let o={relayconfigState:s(S),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(x)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new $;return o.relayconfigState.configLoaded.subscribe(p=>{p&&Le(o,t,e).subscribe(a)}),a}return Le(o,t,e)};var De={providers:[ee(),he(Ne,ge(),fe(ue)),pe(le(),ce([He,xe])),h,{provide:f,useValue:Ae},{provide:te,useValue:Ie()},{provide:ye,useValue:{alertVariant:"simple"}},Re,k,we,ne,ve,oe,Te,Ee]};re(A,De);