@duplicati/ngclient 0.0.35 → 0.0.36
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-DE2AAZUP.js → chunk-3WCWZJYH.js} +1 -1
- package/{chunk-X25RPH22.js → chunk-4VPUEZIU.js} +1 -1
- package/{chunk-L6DT3BQG.js → chunk-4XJFGB4E.js} +1 -1
- package/{chunk-XM4XOJPS.js → chunk-6SKCAZOP.js} +1 -1
- package/{chunk-QGSX2XOM.js → chunk-73OFEMRU.js} +1 -1
- package/{chunk-LVYTERRJ.js → chunk-7KKPI5E4.js} +1 -1
- package/{chunk-UPHEPMGX.js → chunk-A27JK2VW.js} +1 -1
- package/chunk-AUUCT7OA.js +1 -0
- package/{chunk-UAKB5CAQ.js → chunk-BIE2BC6X.js} +1 -1
- package/{chunk-2X2NVYPD.js → chunk-DAXEWTI7.js} +1 -1
- package/chunk-DFKPVTYK.js +1 -0
- package/{chunk-VOINBIWD.js → chunk-DFT2UYO6.js} +1 -1
- package/{chunk-NWRHNRPB.js → chunk-EV37MCYP.js} +1 -1
- package/{chunk-BT2JRS3A.js → chunk-GL2OCAVZ.js} +1 -1
- package/{chunk-GTXQM7B6.js → chunk-HGQLQ733.js} +1 -1
- package/{chunk-RU7EY7FN.js → chunk-IO5IBATB.js} +1 -1
- package/chunk-JAY2DGID.js +1 -0
- package/chunk-KMNTAMUY.js +1 -0
- package/{chunk-EWJCAT5A.js → chunk-LSBOVSYF.js} +1 -1
- package/{chunk-ZRCOVLAQ.js → chunk-M4CEGBQO.js} +1 -1
- package/{chunk-HLOYWLHV.js → chunk-M76F7EZP.js} +1 -1
- package/{chunk-LQUKRKUH.js → chunk-OZQD3PLH.js} +1 -1
- package/{chunk-B3MIBKC5.js → chunk-RDUEFPJ3.js} +1 -1
- package/{chunk-YCOOYSZG.js → chunk-SAKG3775.js} +1 -1
- package/{chunk-SZ4NLIO2.js → chunk-TW4633HQ.js} +1 -1
- package/chunk-WKYWPXQ6.js +1 -0
- package/{chunk-BJAZPKHX.js → chunk-XYNM2UME.js} +1 -1
- package/{chunk-IOH6RL5H.js → chunk-YXIGPDXN.js} +1 -1
- package/{chunk-QLPXITCK.js → chunk-Z4XFPOPE.js} +1 -1
- package/index.html +2 -2
- package/main-QY7RIEAP.js +1 -0
- package/package.json +1 -1
- package/{styles-CLP6NP2M.css → styles-DO5TEHSB.css} +1 -1
- package/chunk-E4CUHBCT.js +0 -1
- package/chunk-EHV3OZDB.js +0 -1
- package/chunk-NKPGP6QP.js +0 -1
- package/chunk-W76PK3CU.js +0 -1
- package/main-WGR4ZD6A.js +0 -1
package/main-WGR4ZD6A.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as se,c as ie}from"./chunk-N35HGIXN.js";import{a as oe}from"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import{a as I}from"./chunk-SSYD4I7W.js";import{a as b}from"./chunk-6M3MNJ52.js";import{d as te}from"./chunk-PIDBEXSZ.js";import{c as ne}from"./chunk-EHV3OZDB.js";import{H as Z,L as Q,X as S,ca as Y,ma as ee}from"./chunk-J3H4BCHI.js";import{a as X}from"./chunk-P6LV5I2K.js";import{a as $,b as z,d as B,e as q,f as _}from"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import{b as re}from"./chunk-OVIL3KMN.js";import{Bc as J,Cc as G,E as w,Gb as D,J as P,L as R,Mc as K,N as W,R as y,U as H,X as r,Za as l,d as x,fb as F,g as V,ja as U,m as E,x as j,y as O}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 V: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 M=class o{#o=r(b);#n=r(Z);#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&&D(0,"router-outlet")},dependencies:[Q],encapsulation:2})};var ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var u=new H("ENVIRONMENT");var T=class o{#o=r(te);isLoaded=l(!1);webmodules=l(null);preload(e=!1){let t=this.#o.getApiV1Webmodules().pipe(W(n=>this.webmodules.set(n)),w(()=>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 ue=()=>{let o=r(d),e=r(U);return o.configLoaded===null&&console.log("preload"),o.configLoaded?.pipe(R(()=>j(e.get(oe).preload(!0),e.get(T).preload(!0))))},pe=[{path:"",children:[{path:"login",canActivate:[()=>r(I).token()!==null?r(S).navigate(["/"]):!0],loadComponent:()=>import("./chunk-EWJCAT5A.js")},{path:"logout",loadComponent:()=>import("./chunk-LVYTERRJ.js")},{path:"",canActivate:[ue],loadComponent:()=>import("./chunk-2X2NVYPD.js"),children:[{path:"",loadComponent:()=>import("./chunk-E4CUHBCT.js")},{path:"add-backup",loadComponent:()=>import("./chunk-BJAZPKHX.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-B3MIBKC5.js")},{path:"backup/import",loadComponent:()=>import("./chunk-NWRHNRPB.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-XM4XOJPS.js"),loadChildren:()=>import("./chunk-NKPGP6QP.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-XM4XOJPS.js"),loadChildren:()=>import("./chunk-NKPGP6QP.js")},{path:"restore",loadComponent:()=>import("./chunk-HLOYWLHV.js")},{path:"restore-flow/:id",loadComponent:()=>import("./chunk-LQUKRKUH.js"),children:[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"select-files",loadComponent:()=>import("./chunk-ZRCOVLAQ.js")},{path:"options",loadComponent:()=>import("./chunk-RU7EY7FN.js")}]},{path:"settings",loadComponent:()=>import("./chunk-UAKB5CAQ.js")},{path:"about",loadComponent:()=>import("./chunk-QGSX2XOM.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-UPHEPMGX.js")},{path:"changelog",loadComponent:()=>import("./chunk-ZI3FISVO.js")},{path:"libraries",loadComponent:()=>import("./chunk-VOINBIWD.js")},{path:"system-info",loadComponent:()=>import("./chunk-443IB2NN.js")},{path:"logs",loadComponent:()=>import("./chunk-X25RPH22.js")}]}]}]}];var A=null,ce=(o,e)=>{let t=r(I),n=r(S),c=r(b),i=r(u),f=r(ne),s=c.getItem("locale"),p=se(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(O(a=>{if(f.error(a.message),a.status===401&&!A&&(A=t.refreshToken().pipe(P())),a.status===401)return A.pipe(R(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))),O(g=>(n.navigate(["/logout"]),E(()=>g))),w(()=>A=null));let m=`Error Code: ${a.status}, Message: ${a.message}`;return E(()=>({error:a,message:m}))}))};var fe="1.0.0",le="portal-proxy-client",he=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=K(()=>{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:fe,protocolVersion:he},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:le,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:le,to:t,type:"command",messageId:a,payload:JSON.stringify({method:n,path:c,body:i,headers:f})},v={resolve:p,reject:h,timer:window.setTimeout(()=>{let C=this.#s[a];C&&(delete this.#s[a],C.reject("Timeout"))},s)};this.#s[a]=v,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 ge(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}var me=(o,e)=>{let n=r(d).config(),c=r(u);if(n===null)return e(o);let i=r(k),f=ge(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 x(m=>{a.then(g=>{let v=new $;s!=null&&Object.keys(s).forEach(L=>{v.set(L,s[L])});let C=new z({body:g.body,status:g.code,statusText:"OK",headers:v});m.next(C),m.complete()})})};var de={providers:[J(),Y(pe,ee()),B(_(),q([me,ce])),b,{provide:u,useValue:ae},{provide:G,useValue:ie()},re]};X(M,de);
|