homebridge-config-ui-x 4.62.1-beta.9 → 5.0.0-beta.0
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 +43 -6
- package/README.md +4 -58
- package/config.schema.json +1 -0
- package/dist/bin/platforms/darwin.js +2 -0
- package/dist/bin/platforms/darwin.js.map +1 -1
- package/dist/modules/server/server.service.d.ts +1 -0
- package/dist/modules/server/server.service.js +1 -0
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/status/status.gateway.d.ts +3 -5
- package/dist/modules/status/status.gateway.js +2 -28
- package/dist/modules/status/status.gateway.js.map +1 -1
- package/dist/modules/status/status.service.d.ts +2 -0
- package/dist/modules/status/status.service.js +8 -7
- package/dist/modules/status/status.service.js.map +1 -1
- package/package.json +19 -24
- package/public/3rdpartylicenses.txt +9 -1
- package/public/assets/hap-icons/smokesensor.svg +1 -1
- package/public/{chunk-TOPONS2G.js → chunk-2PWJQ3JG.js} +1 -1
- package/public/{chunk-SDRXNK54.js → chunk-2XSSTW65.js} +1 -1
- package/public/chunk-3MMTBP3D.js +1 -0
- package/public/{chunk-3TR6KNS2.js → chunk-3PUISAM4.js} +1 -1
- package/public/{chunk-3OURKZJE.js → chunk-3SUL4N2K.js} +1 -1
- package/public/{chunk-3DLNWL2R.js → chunk-47MGIKRX.js} +1 -1
- package/public/{chunk-BUGNOBXC.js → chunk-4R6MSI5I.js} +1 -1
- package/public/{chunk-YAU2KWBZ.js → chunk-6QEO3BTW.js} +1 -1
- package/public/chunk-6SZTMLNK.js +1 -0
- package/public/{chunk-IIFIWJYC.js → chunk-6T267MJT.js} +1 -1
- package/public/{chunk-D6UUGEUB.js → chunk-B6C32ZRK.js} +1 -1
- package/public/{chunk-RPL6HWN2.js → chunk-BROUJ7PT.js} +1 -1
- package/public/{chunk-S5FRWQPT.js → chunk-C4VKSYGU.js} +1 -1
- package/public/chunk-CKS7IGEQ.js +1 -0
- package/public/chunk-CTWXFHBK.js +20 -0
- package/public/{chunk-CU3OXDK7.js → chunk-DLVT4K74.js} +1 -1
- package/public/{chunk-KO2RPNXD.js → chunk-DPQR4EUP.js} +1 -1
- package/public/chunk-F22FMU37.js +1 -0
- package/public/{chunk-RF5R32OJ.js → chunk-GNQUXZMN.js} +1 -1
- package/public/{chunk-VNQPH3K2.js → chunk-GUXB6V7U.js} +1 -1
- package/public/{chunk-ZRQZU5HN.js → chunk-HPRZRVV7.js} +1 -1
- package/public/{chunk-RTI2NE3Q.js → chunk-HXKR7RPF.js} +1 -1
- package/public/chunk-IGUSDGD6.js +8 -0
- package/public/{chunk-EX6EQLNK.js → chunk-JM7QCDMZ.js} +1 -1
- package/public/{chunk-UEPF2U5Q.js → chunk-JQO6VAZ5.js} +1 -1
- package/public/{chunk-BGBOW4TZ.js → chunk-K5UREZLG.js} +4 -4
- package/public/{chunk-W7JQ7WHZ.js → chunk-LM3J4EYP.js} +1 -1
- package/public/chunk-NTTD35IF.js +1 -0
- package/public/chunk-PSLVYKAC.js +1 -0
- package/public/{chunk-BROJRIZL.js → chunk-Q7MYZYMQ.js} +1 -1
- package/public/{chunk-AM3VWXMR.js → chunk-SI3MSSTT.js} +1 -1
- package/public/{chunk-WOJ7C5HX.js → chunk-SJTXTMYT.js} +1 -1
- package/public/{chunk-VZFXQGAN.js → chunk-TBJQ2Y3M.js} +1 -1
- package/public/{chunk-VYUN5WLM.js → chunk-THFLPY67.js} +1 -1
- package/public/{chunk-QOPI77FO.js → chunk-TTLBPD7L.js} +1 -1
- package/public/{chunk-RDIMXMJ5.js → chunk-UEBRERJ6.js} +1 -1
- package/public/{chunk-FBJAWKJ3.js → chunk-WCDFKYP6.js} +1 -1
- package/public/{chunk-WD7T2C7Z.js → chunk-XLAWLJES.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-DTWXJAMM.js +6 -0
- package/public/{styles-RKZUK2BG.css → styles-7ETWN6DQ.css} +1 -1
- package/public/chunk-4GFUJV7Q.js +0 -1
- package/public/chunk-7SIWB246.js +0 -1
- package/public/chunk-ATNSCCKX.js +0 -1
- package/public/chunk-BZRYP3UV.js +0 -1
- package/public/chunk-FJK4IAO5.js +0 -1
- package/public/chunk-IKFLHM2X.js +0 -8
- package/public/chunk-J6XB3JBO.js +0 -1
- package/public/chunk-LKWF73XA.js +0 -20
- package/public/main-VFMNBLEO.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as H,b as h,c as $,m as S}from"./chunk-
|
|
1
|
+
import{a as H,b as h,c as $,m as S}from"./chunk-PSLVYKAC.js";import{Lb as I,W as p,X as j,Y as E,Z as a,aa as y,g as O,h as l,i as d,ic as x,p as f,t as u,u as T,v as w,x as v}from"./chunk-IGUSDGD6.js";var k=O(H(),1);var g=new E("JWT_OPTIONS"),m=(()=>{class o{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+/=",r="";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,c,s,b=0;s=e.charAt(b++);~s&&(c=i%4?c*64+s:s,i++%4)?r+=String.fromCharCode(255&c>>(-2*i&6)):0)s=t.indexOf(s);return r}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 r=this.urlBase64Decode(t[1]);if(!r)throw new Error("Cannot decode the token.");return JSON.parse(r)}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 r=new Date(0);return r.setUTCSeconds(t.exp),r}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(r=>this._isTokenExpired(r,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let r=this.getTokenExpirationDate(e);return t=t||0,r===null?!1:!(r.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return o.\u0275fac=function(e){return new(e||o)(a(g))},o.\u0275prov=p({token:o,factory:o.\u0275fac}),o})(),D=o=>o instanceof Promise?v(()=>o):f(o),J=(()=>{class o{constructor(e,t,r){this.jwtHelper=t,this.document=r,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 r=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===r:i instanceof RegExp?i.test(r):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(r=>{if(typeof r=="string"){let i=new URL(r,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return r instanceof RegExp?r.test(e.url):!1})>-1}handleInterception(e,t,r){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let c=f(!1);return this.skipWhenExpired&&(c=e?D(this.jwtHelper.isTokenExpired(e)):f(!0)),e?c.pipe(T(s=>s&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(s=>r.handle(s))):r.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let r=this.tokenGetter(e);return D(r).pipe(w(i=>this.handleInterception(i,e,t)))}}return o.\u0275fac=function(e){return new(e||o)(a(g),a(m),a(I))},o.\u0275prov=p({token:o,factory:o.\u0275fac}),o})(),K=(()=>{class o{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:o,providers:[{provide:x,useClass:J,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return o.\u0275fac=function(e){return new(e||o)(a(o,12))},o.\u0275mod=y({type:o}),o.\u0275inj=j({}),o})();var X=(()=>{let n=class n{constructor(t,r,i){l(this,"$api");l(this,"$jwtHelper");l(this,"$settings");l(this,"token");l(this,"user",{});l(this,"logoutTimer");this.$api=t,this.$jwtHelper=r,this.$settings=i,this.loadToken()}login(t){return d(this,null,function*(){let r=yield u(this.$api.post("/auth/login",t));if(!this.validateToken(r.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(h.jwt.tokenKey,r.access_token),yield this.$settings.getAppSettings()})}noauth(){return d(this,null,function*(){let t=yield u(this.$api.post("/auth/noauth",{}));if(this.validateToken(t.access_token))window.localStorage.setItem(h.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(h.jwt.tokenKey),window.location.reload()}loadToken(){return d(this,null,function*(){this.$settings.settingsLoaded||(yield u(this.$settings.onSettingsLoaded));let t=window.localStorage.getItem(h.jwt.tokenKey);t&&this.validateToken(t)})}validateToken(t){try{return this.$jwtHelper.isTokenExpired(t,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(t),this.token=t,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(h.jwt.tokenKey),this.token=null,!1}}checkToken(){return d(this,null,function*(){try{return yield u(this.$api.get("/auth/check"))}catch(t){t.status===401&&(console.error("Current token is not valid"),this.logout())}})}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let r=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");r<=2147483647&&(this.logoutTimer=setTimeout(()=>d(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),r))}}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)}};l(n,"\u0275fac",function(r){return new(r||n)(a($),a(m),a(S))}),l(n,"\u0275prov",p({token:n,factory:n.\u0275fac}));let o=n;return o})();export{m as a,K as b,X as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as J,f as T}from"./chunk-
|
|
1
|
+
import{e as J,f as T}from"./chunk-HPRZRVV7.js";import{c as V,d as q}from"./chunk-CTWXFHBK.js";import{c as G}from"./chunk-SJTXTMYT.js";import{b as F}from"./chunk-6QEO3BTW.js";import{G as L,M as B,Q as C,y as E,z as N}from"./chunk-WCDFKYP6.js";import{b as w,c as P}from"./chunk-F22FMU37.js";import{$ as x,$b as k,Ab as D,Ga as I,Ka as b,La as u,Pb as H,Qb as R,Rb as U,Ua as n,Va as a,Wa as c,X as _,aa as h,ab as g,bb as A,h as o,jb as m,kb as f,lb as v,mb as z,ua as O,ub as S,wa as i,xa as M,yb as l,zb as s}from"./chunk-IGUSDGD6.js";var K=(()=>{let e=class e{};o(e,"\u0275fac",function(d){return new(d||e)}),o(e,"\u0275mod",h({type:e})),o(e,"\u0275inj",_({providers:[V],imports:[k,C,E,N,P.forChild(),J,F,T]}));let t=e;return t})();var Y=t=>({pluginName:t});function Z(t,e){t&1&&(n(0,"ul",16)(1,"li"),m(2),l(3,"translate"),a(),n(4,"li",17),m(5),l(6,"translate"),a()()),t&2&&(i(2),f(s(3,2,"plugins.manage.confirm_disable_accessory_1")),i(3),f(s(6,4,"plugins.manage.confirm_disable_accessory_2")))}function ee(t,e){t&1&&(n(0,"ul",16)(1,"li"),m(2),l(3,"translate"),a(),n(4,"li",17),m(5),l(6,"translate"),a()()),t&2&&(i(2),f(s(3,2,"plugins.manage.confirm_disable_platform_1")),i(3),f(s(6,4,"plugins.manage.confirm_disable_platform_2")))}var xe=(()=>{let e=class e{constructor(r){o(this,"$activeModal");o(this,"pluginName");o(this,"isConfigured",!1);o(this,"isConfiguredDynamicPlatform",!1);this.$activeModal=r}};o(e,"\u0275fac",function(d){return new(d||e)(M(B))}),o(e,"\u0275cmp",x({type:e,selectors:[["ng-component"]],inputs:{pluginName:"pluginName",isConfigured:"isConfigured",isConfiguredDynamicPlatform:"isConfiguredDynamicPlatform"},decls:28,vars:25,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body","w-100","text-center"],[1,"fas","fa-fw","fa-circle-pause","primary-text","mb-4",2,"font-size","75px"],["type","warning",3,"dismissible"],[1,"w-100","text-center","mb-0"],["class","mb-0 text-left",4,"ngIf"],[1,"modal-footer","justify-content-between"],[1,"text-left"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-right"],["type","button","data-dismiss","modal",1,"btn","btn-danger",3,"click"],[1,"mb-0","text-left"],[1,"mb-0"]],template:function(d,p){d&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),m(3),l(4,"translate"),a(),n(5,"button",3),l(6,"translate"),g("click",function(){return p.$activeModal.dismiss("Dismiss")}),n(7,"span",4),m(8,"\xD7"),a()()(),n(9,"div",5),c(10,"i",6),n(11,"ngb-alert",7)(12,"p",8),m(13),l(14,"translate"),a()(),I(15,Z,7,6,"ul",9)(16,ee,7,6,"ul",9),a(),n(17,"div",10)(18,"div",11)(19,"button",12),l(20,"translate"),g("click",function(){return p.$activeModal.dismiss("Dismiss")}),m(21),l(22,"translate"),a()(),c(23,"div",13),n(24,"div",14)(25,"button",15),g("click",function(){return p.$activeModal.close()}),m(26),l(27,"translate"),a()()()()),d&2&&(i(3),z("",s(4,10,"plugins.manage.disable"),": ",p.pluginName,""),i(2),b("aria-label",s(6,12,"form.button_close")),i(6),u("dismissible",!1),i(2),f(D(14,14,"plugins.manage.confirm_disable",S(23,Y,p.pluginName))),i(2),u("ngIf",p.isConfigured&&!p.isConfiguredDynamicPlatform),i(),u("ngIf",p.isConfigured&&p.isConfiguredDynamicPlatform),i(3),b("aria-label",s(20,17,"form.button_close")),i(2),v(" ",s(22,19,"form.button_close")," "),i(5),v(" ",s(27,21,"plugins.manage.disable")," "))},dependencies:[U,L,w],encapsulation:2}));let t=e;return t})();var te=t=>({author:t});function ie(t,e){if(t&1&&(n(0,"li",16),c(1,"i",17),n(2,"a",18),m(3),a()()),t&2){let $=e.$implicit,r=A();i(),u("ngClass",r.getIconClass($.type)),i(),u("href",$.url,O),i(),f($.url)}}var Ie=(()=>{let e=class e{constructor(r){o(this,"$activeModal");o(this,"plugin");o(this,"fundingOptions");this.$activeModal=r}ngOnInit(){this.plugin.funding||this.$activeModal.close(),this.plugin.name==="homebridge-config-ui-x"&&(this.plugin.author="oznu"),Array.isArray(this.plugin.funding)?this.fundingOptions=this.plugin.funding.map(r=>{if(typeof r=="string")return{type:"other",url:r};if(typeof r=="object")return{type:r.type||"other",url:r.url}}):typeof this.plugin.funding=="string"?this.fundingOptions=[{type:"other",url:this.plugin.funding}]:typeof this.plugin.funding=="object"&&(this.fundingOptions=[{type:this.plugin.funding.type||"other",url:this.plugin.funding.url}])}getIconClass(r){switch(r.toLowerCase()){case"paypal":return"fab fa-fw fa-paypal";case"github":return"fab fa-fw fa-github";case"patreon":return"fab fa-fw fa-patreon";case"kofi":case"ko-fi":return"fas fa-fw fa-coffee";default:return"fas fa-fw fa-link"}}};o(e,"\u0275fac",function(d){return new(d||e)(M(B))}),o(e,"\u0275cmp",x({type:e,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:28,vars:22,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"w-100","text-center","pink-text","mb-4"],[1,"fas","fa-fw","fa-heart",2,"font-size","75px"],[1,"w-100","text-center"],[1,"list-group"],["class","list-group-item",4,"ngFor","ngForOf"],[1,"modal-footer","justify-content-between"],[1,"text-left"],[1,"text-center"],["type","button","data-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-right"],[1,"list-group-item"],[1,"mr-2","primary-text","fa-fw",3,"ngClass"],["target","_blank","rel","noopener noreferrer",1,"text-break-all","grey-text",3,"href"]],template:function(d,p){d&1&&(n(0,"div",0)(1,"div",1)(2,"h5",2),m(3),l(4,"translate"),a(),n(5,"button",3),l(6,"translate"),g("click",function(){return p.$activeModal.dismiss("Dismiss")}),n(7,"span",4),m(8,"\xD7"),a()()(),n(9,"div",5)(10,"div",6),c(11,"i",7),a(),n(12,"p",8),m(13),l(14,"translate"),a(),n(15,"p",8),m(16),l(17,"translate"),a(),n(18,"ul",9),I(19,ie,4,3,"li",10),a()(),n(20,"div",11),c(21,"div",12),n(22,"div",13)(23,"button",14),l(24,"translate"),g("click",function(){return p.$activeModal.dismiss("Dismiss")}),m(25),l(26,"translate"),a()(),c(27,"div",15),a()()),d&2&&(i(3),v(" ",D(4,7,"plugins.donate.tile_donate_to",S(20,te,p.plugin.author?"@"+p.plugin.author:p.plugin.name))," "),i(2),b("aria-label",s(6,10,"form.button_close")),i(8),f(s(14,12,"plugins.donate.message_1")),i(3),f(s(17,14,"plugins.donate.message_2")),i(3),u("ngForOf",p.fundingOptions),i(4),b("aria-label",s(24,16,"form.button_close")),i(2),v(" ",s(26,18,"form.button_close")," "))},dependencies:[H,R,w],styles:[".text-break-all[_ngcontent-%COMP%]{word-break:break-all}"]}));let t=e;return t})();var st=(()=>{let e=class e{};o(e,"\u0275fac",function(d){return new(d||e)}),o(e,"\u0275mod",h({type:e})),o(e,"\u0275inj",_({providers:[q],imports:[k,E,N,P.forChild(),C,F,G,C,T,K]}));let t=e;return t})();export{xe as a,Ie as b,st as c};
|