homebridge-config-ui-x 5.2.1-beta.6 → 5.2.1-beta.8
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/CHANGELOG.md +5 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +1 -0
- package/dist/modules/config-editor/config-editor.controller.js +13 -0
- package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
- package/dist/modules/config-editor/config-editor.service.d.ts +1 -0
- package/dist/modules/config-editor/config-editor.service.js +7 -0
- package/dist/modules/config-editor/config-editor.service.js.map +1 -1
- package/package.json +2 -2
- package/public/3rdpartylicenses.txt +24 -24
- package/public/{chunk-3WSNVOIX.js → chunk-2LSH3KMC.js} +1 -1
- package/public/{chunk-OYH5M6P2.js → chunk-2PP2VDL6.js} +1 -1
- package/public/{chunk-YJDZC3X3.js → chunk-42RLCU53.js} +1 -1
- package/public/chunk-5MLTGVMM.js +1 -0
- package/public/{chunk-L7SKQHJB.js → chunk-6BFSUFRQ.js} +1 -1
- package/public/{chunk-LNOENQHV.js → chunk-6BLWRML2.js} +1 -1
- package/public/{chunk-S6JCPVMC.js → chunk-6LWEFB5T.js} +1 -1
- package/public/{chunk-3RBJMR2C.js → chunk-7TWHYDPQ.js} +1 -1
- package/public/{chunk-XU6URLCY.js → chunk-A2NEEDZO.js} +1 -1
- package/public/{chunk-DTCAZU55.js → chunk-A5MWQCGQ.js} +1 -1
- package/public/{chunk-7LKAZJLI.js → chunk-A7SXZCLG.js} +1 -1
- package/public/chunk-BSZ6MHFZ.js +9 -0
- package/public/{chunk-ROLHL6HW.js → chunk-CQAWPDW3.js} +1 -1
- package/public/{chunk-GEBXCYRI.js → chunk-D7PVXFSB.js} +1 -1
- package/public/{chunk-XPOM5GS4.js → chunk-DUY46UE5.js} +1 -1
- package/public/{chunk-SNMFTZGU.js → chunk-EBQHWKQC.js} +2 -2
- package/public/{chunk-FA5WDZUY.js → chunk-EXI6FL7A.js} +1 -1
- package/public/{chunk-JC4MK5CR.js → chunk-GBJM2RI4.js} +1 -1
- package/public/{chunk-NEOF7IDY.js → chunk-GPMC6ZMO.js} +1 -1
- package/public/chunk-GRCWZ7OU.js +12 -0
- package/public/{chunk-XIWOJ72I.js → chunk-HHU6FT77.js} +1 -1
- package/public/{chunk-HZZEPY33.js → chunk-IKNF2DEX.js} +1 -1
- package/public/{chunk-VTFS626J.js → chunk-IU5EKYXQ.js} +1 -1
- package/public/{chunk-J66U6NNP.js → chunk-IZBB7SRV.js} +1 -1
- package/public/{chunk-Q5QGEORA.js → chunk-JBKS3BI7.js} +8 -8
- package/public/{chunk-MIUGSJFM.js → chunk-LGEE7SWW.js} +1 -1
- package/public/{chunk-S4NXS63I.js → chunk-LKEDVYVC.js} +1 -1
- package/public/{chunk-XVUZXOZJ.js → chunk-NCB3IL32.js} +1 -1
- package/public/{chunk-EQXTGFHJ.js → chunk-NEMQW5FW.js} +1 -1
- package/public/chunk-NGBI2CLV.js +20 -0
- package/public/{chunk-3JJZ6QQL.js → chunk-NSTN7R3D.js} +1 -1
- package/public/chunk-P2X74Q5E.js +1 -0
- package/public/chunk-PKUXB6QF.js +1 -0
- package/public/{chunk-DDHA6TIL.js → chunk-Q2SY7ITC.js} +1 -1
- package/public/{chunk-WEB6J2BW.js → chunk-QJZIEGHX.js} +1 -1
- package/public/{chunk-XGID6EOR.js → chunk-RABTAB22.js} +1 -1
- package/public/{chunk-WPEQOABL.js → chunk-RZG4H7FG.js} +1 -1
- package/public/{chunk-OM5RO73A.js → chunk-S3TEEEYY.js} +1 -1
- package/public/chunk-SH42QPYC.js +1 -0
- package/public/{chunk-IVYKLQQ6.js → chunk-SUJJIFP4.js} +1 -1
- package/public/{chunk-XEB3TWDU.js → chunk-TFTVFLPX.js} +1 -1
- package/public/{chunk-HTVAIF5H.js → chunk-UCRZ7BF5.js} +1 -1
- package/public/{chunk-FO55QKB4.js → chunk-VCWRZM6U.js} +1 -1
- package/public/{chunk-CJMOVRVH.js → chunk-XTDDD6WY.js} +1 -1
- package/public/{chunk-MWYTIOLE.js → chunk-XWQ7NZSB.js} +1 -1
- package/public/{chunk-3CZYTU6H.js → chunk-YFZSQHUV.js} +1 -1
- package/public/{chunk-C7JD6G6I.js → chunk-Z43SQI6H.js} +1 -1
- package/public/{chunk-S4PTOZSW.js → chunk-ZXXBIF5D.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-76WAOLPU.js +1 -0
- package/public/styles-IOQZHT3N.css +1 -0
- package/public/chunk-27UZT7QO.js +0 -1
- package/public/chunk-3E7VFMCX.js +0 -1
- package/public/chunk-5RUM7CEH.js +0 -20
- package/public/chunk-BYZJWNCS.js +0 -1
- package/public/chunk-D6ZBL5RI.js +0 -12
- package/public/chunk-QMG5LBOF.js +0 -1
- package/public/chunk-SVVKLOZB.js +0 -7
- package/public/main-WEOOYKNT.js +0 -1
- package/public/styles-Y3F34BOG.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,g as s}from"./chunk-QRQBCPWO.js";import{k as l,n as d}from"./chunk-
|
|
1
|
+
import{d as u,g as s}from"./chunk-QRQBCPWO.js";import{k as l,n as d}from"./chunk-P2X74Q5E.js";import{a as p}from"./chunk-ZG3HINDJ.js";import"./chunk-K7QEGT3E.js";import{ga as c,h as f,ha as i,la as e,nb as n,w as m}from"./chunk-V7SOQAC5.js";var a=(()=>{class t{$api=e(d);$router=e(u);$toastr=e(l);$translate=e(p);resolve(){return f(this,null,function*(){try{let o=yield m(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(r){return new(r||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var y=[{path:"",loadComponent:()=>import("./chunk-NGBI2CLV.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],v=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(y),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[v]})}return t})();export{T as ConfigEditorModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _,b as D}from"./chunk-
|
|
1
|
+
import{a as _,b as D}from"./chunk-GBJM2RI4.js";import{m as c,n as S}from"./chunk-P2X74Q5E.js";import{f as x}from"./chunk-K7QEGT3E.js";import{C as v,g as O,ga as h,h as a,ha as E,ja as y,ka as l,la as f,nb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-V7SOQAC5.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as r}from"./chunk-QRQBCPWO.js";import"./chunk-K7QEGT3E.js";import{ha as t,nb as e}from"./chunk-V7SOQAC5.js";var m=[{path:"",loadComponent:()=>import("./chunk-
|
|
1
|
+
import{g as r}from"./chunk-QRQBCPWO.js";import"./chunk-K7QEGT3E.js";import{ha as t,nb as e}from"./chunk-V7SOQAC5.js";var m=[{path:"",loadComponent:()=>import("./chunk-42RLCU53.js").then(o=>o.PowerOptionsComponent)}],n=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[r.forChild(m),r]})}return o})();var d=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[n]})}return o})();export{d as PowerOptionsModule};
|