@descope/role-management-widget 0.10.16 → 0.10.17
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/dist/esm/index.js +2 -2
- package/dist/index.d.ts +91 -90
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* @descope/role-management-widget v0.10.
|
|
3
|
+
* @descope/role-management-widget v0.10.17
|
|
4
4
|
*/
|
|
5
|
-
import{escapeHtml as e,pluralize as t,createSingletonMixin as i,compose as o,createTemplate as s,withMemCache as n,debounce as l}from"@descope/sdk-helpers";import{__awaiter as a,__classPrivateFieldGet as r,__classPrivateFieldSet as d,__rest as c}from"tslib";import{projectIdMixin as u,observeAttributesMixin as h,loggerMixin as g,baseUrlMixin as v,cookieConfigMixin as m,createValidateAttributesMixin as p,createStateManagementMixin as f,initLifecycleMixin as R,descopeUiMixin as y,initElementMixin as w,createFetchWidgetPagesMixin as b,modalMixin as M,formMixin as C,notificationsMixin as W,debuggerMixin as k,themeMixin as x,componentsConditionsMixin as S}from"@descope/sdk-mixins";import{ButtonDriver as j,MultiSelectDriver as F,TextDriver as P,TextFieldDriver as O,GridDriver as L}from"@descope/sdk-component-drivers";import{createSelector as N}from"reselect";import{createAsyncThunk as I}from"@reduxjs/toolkit";import B from"@descope/web-js-sdk";const $=e=>e.selectedRolesIds,q=e=>e.notifications,D=e=>e.tenantPermissions.data||[],T=N((e=>e.rolesList.data),(e=>e.map((e=>{var t;return Object.assign(Object.assign({},e),{editable:0===(null===(t=null==e?void 0:e.tenantId)||void 0===t?void 0:t.length)?"no":"yes"})})))),E=N($,T,((e,t)=>t.filter((t=>e.includes(t.name))))),H=N($,(e=>!!e.length)),A=N($,(e=>1===e.length)),Z=N(E,A,((e,t)=>t&&"yes"===e[0].editable)),V=N(E,(e=>1===e.length?e[0].name:`${e.length} roles`)),U=e=>(...t)=>i=>{i.addCase(e.pending,((e,i)=>{t.forEach((({onPending:t})=>{null==t||t(e,i)}))})),i.addCase(e.fulfilled,((e,i)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,i)}))})),i.addCase(e.rejected,((e,i)=>{t.forEach((({onRejected:t})=>{null==t||t(e,i)}))}))},z=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,i)=>{e(t).loading=!1,e(t).error=i.error}}),J=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,i)=>{t&&e.notifications.push({type:"success",msg:t(i)})},onRejected:(t,i)=>{e&&t.notifications.push({type:"error",msg:e(i)})}}),G=I("roles/create",((e,{extra:{api:t}})=>t.role.create(e))),K=U(G)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},z((e=>e.createRole)),J({getSuccessMsg:()=>"Role created successfully",getErrorMsg:t=>{var i;const o=null===(i=t.error)||void 0===i?void 0:i.message;return`\n <div>\n <div>Failed to create role</div>\n ${e(o)}\n </div>`}})),Q={action:G,reducer:K},X=I("roles/delete",((e,{extra:{api:t}})=>t.role.deleteBatch(e))),Y=U(X)({onFulfilled:(e,t)=>{e.rolesList.data=e.rolesList.data.filter((e=>{var i;return 0===(null===(i=null==e?void 0:e.tenantId)||void 0===i?void 0:i.length)||!t.meta.arg.includes(e.name)})),e.selectedRolesIds=[]}},z((e=>e.deleteRole)),J({getSuccessMsg:e=>t(e.meta.arg.length)`${["",e.meta.arg.length]} ${["R","r"]}ole${["","s"]} deleted successfully`,getErrorMsg:e=>t(e.meta.arg.length)`Failed to delete role${["","s"]}`})),_={action:X,reducer:Y},ee=I("roles/duplicate",((e,{extra:{api:t}})=>t.role.create(e))),te=U(ee)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},z((e=>e.duplicateRole)),J({getSuccessMsg:()=>"Role duplicated successfully",getErrorMsg:t=>{var i;const o=null===(i=t.error)||void 0===i?void 0:i.message;return`\n <div>\n <div>Failed to duplicate role</div>\n ${e(o)}\n </div>`}})),ie={action:ee,reducer:te},oe=I("roles/search",((e,{extra:{api:t},getState:i})=>{const o=i().searchParams;return t.role.search(Object.assign(Object.assign({},o),e))})),se=U(oe)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.rolesList.data=t.payload}},z((e=>e.rolesList))),ne={action:oe,reducer:se},le=I("roles/update",((e,{extra:{api:t}})=>t.role.update(e))),ae=U(le)({onFulfilled:(e,t)=>{const i=e.rolesList.data.findIndex((e=>e.name===t.payload.oldName));-1!==i&&(e.rolesList.data[i]=t.payload)}},z((e=>e.updateRole)),J({getSuccessMsg:()=>"Role updated successfully",getErrorMsg:t=>{var i;const o=null===(i=t.error)||void 0===i?void 0:i.message;return`\n <div>\n <div>Failed to update role</div>\n ${e(o)}\n </div>`}})),re={action:le,reducer:ae},de=I("tenant/getTenantPermissions",((e,{extra:{api:t}})=>t.tenant.getTenantPermissions())),ce={action:de,reducer:U(de)({onFulfilled:(e,t)=>{e.tenantPermissions.data=t.payload.permissions}},z((e=>e.tenantPermissions)))},ue={rolesList:{data:[],loading:!1,error:null},createRole:{loading:!1,error:null},duplicateRole:{loading:!1,error:null},updateRole:{loading:!1,error:null},deleteRole:{loading:!1,error:null},tenantPermissions:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedRolesIds:[],notifications:[]},he={search:"/v1/mgmt/role/search",deleteBatch:"/v1/mgmt/role/delete/batch",create:"/v1/mgmt/role/create",update:"/v1/mgmt/role/update"},ge={permissions:"/v1/mgmt/permission/all"},ve=e=>a(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})),me=(e,t)=>a(void 0,[e,t],void 0,(function*({text:e,sort:t},i){return new Promise((o=>{const s=[];for(let e=1;e<10;e+=1)s.push({name:`Role ${e}`,description:`Role description ${e}`,permissionNames:[`Permission ${e}`],createdTime:new Date,tenantId:i});t.forEach((e=>{s.sort(((t,i)=>{var o,s;return e.desc?null===(s=i[e.field])||void 0===s?void 0:s.localeCompare(t[e.field]):null===(o=t[e.field])||void 0===o?void 0:o.localeCompare(i[e.field])}))})),o(s.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.description.toLowerCase().includes(e.toLowerCase()))))}))})),pe=(e,t)=>a(void 0,[e,t],void 0,(function*({name:e,description:t,permissionNames:i},o){return new Promise((s=>{s({name:e,description:t,permissionNames:i,createdTime:new Date,tenantId:o})}))})),fe=(e,t)=>a(void 0,[e,t],void 0,(function*({name:e,newName:t,description:i,permissionNames:o},s){return new Promise((n=>{n({name:t,description:i,permissionNames:o,createdTime:new Date,oldName:e,tenantId:s})}))})),Re=()=>a(void 0,void 0,void 0,(function*(){})),ye=()=>new Promise((e=>{const t=[];for(let e=1;e<5;e+=1)t.push({name:`Permission ${e}`});e({permissions:t})})),we=({httpClient:e,tenant:t,mock:i})=>({search:(...o)=>a(void 0,[...o],void 0,(function*({page:o,limit:s=1e4,text:n,sort:l}={}){if(i)return me({page:o,limit:s,text:n,sort:l},t);const a=yield e.post(he.search,{limit:s,page:o,text:n,sort:l},{queryParams:{tenant:t}});yield ve(a);return(yield a.json()).roles})),deleteBatch:o=>a(void 0,void 0,void 0,(function*(){if(i)return Re();const s=yield e.post(he.deleteBatch,{roleNames:o},{queryParams:{tenant:t}});return yield ve(s),s.json()})),create:o=>a(void 0,[o],void 0,(function*({name:o,description:s,permissionNames:n}){if(i)return pe({name:o,description:s,permissionNames:n},t);const l=yield e.post(he.create,{name:o,description:s,permissionNames:n,tenantId:t},{queryParams:{tenant:t}});yield ve(l);return yield l.json()})),update:o=>a(void 0,[o],void 0,(function*({name:o,newName:s,description:n,permissionNames:l}){if(i)return fe({name:o,newName:s,description:n,permissionNames:l},t);const a=yield e.post(he.update,{name:o,newName:s,description:n,permissionNames:l,tenantId:t},{queryParams:{tenant:t}});yield ve(a);const r=yield a.json();return r.oldName=o,r}))}),be=({httpClient:e,tenant:t,mock:i})=>({getTenantPermissions:()=>a(void 0,void 0,void 0,(function*(){if(i)return ye();const o=yield e.get(ge.permissions,{queryParams:{tenant:t}});return yield ve(o),o.json()}))}),Me=i((e=>{var t,i,s,n;const l=o(u,h,g,v,m,p({tenant:p.missingAttrValidator}))(e);return n=class extends l{constructor(){super(...arguments),t.add(this),i.set(this,void 0)}get tenantId(){return this.getAttribute("tenant")}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return r(this,i,"f")||r(this,t,"m",s).call(this),r(this,i,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.init)||void 0===o?void 0:o.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{r(this,i,"f")&&r(this,t,"m",s).call(this)}))}))}},i=new WeakMap,t=new WeakSet,s=function(){this.logger.debug("creating an sdk instance"),d(this,i,((e,t,i,o)=>{const s=B(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"role-management-widget","x-descope-widget-id":o,"x-descope-widget-version":"0.10.16"}}));return{role:we({httpClient:s.httpClient,tenant:t,mock:i}),tenant:be({httpClient:s.httpClient,tenant:t,mock:i}),httpClient:s.httpClient}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},n})),Ce=i((e=>{const t=o(f({name:"widget",initialState:ue,reducers:{setSelectedRolesIds:(e,{payload:t})=>{e.selectedRolesIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{Q.reducer(e),ie.reducer(e),re.reducer(e),_.reducer(e),ne.reducer(e),ce.reducer(e)},asyncActions:{searchRoles:ne.action,createRole:Q.action,duplicateRole:ie.action,updateRole:re.action,deleteRoles:_.action,getTenantPermissions:ce.action}}),R,g,Me)(e);return class extends t{constructor(...e){super(...e),this.state=ue,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),We=i((e=>{var t,i,n;return n=class extends(o(g,R,y,w,b("role-management-widget"),Ce)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return a(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.init)||void 0===o?void 0:o.call(this),yield Promise.all([r(this,t,"m",i).call(this),this.actions.searchRoles(),this.actions.getTenantPermissions()]),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},t=new WeakSet,i=function(){return a(this,void 0,void 0,(function*(){const e=s(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},n})),ke=i((e=>{var t,i,n,l,c,u,h;return h=class extends(o(Ce,M,C,g,We)(e)){constructor(){super(...arguments),t.add(this),i.set(this,void 0),n.set(this,"create"),l.set(this,null),u.set(this,(()=>a(this,void 0,void 0,(function*(){var e;yield r(this,i,"f").setData(null===(e=D(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))}))))}openRoleModal(e="create",t){d(this,n,e,"f"),d(this,l,null!=t?t:null,"f"),this.roleFormModal.open()}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),r(this,t,"m",c).call(this)}))}},i=new WeakMap,n=new WeakMap,l=new WeakMap,u=new WeakMap,t=new WeakSet,c=function(){return a(this,void 0,void 0,(function*(){this.roleFormModal=this.createModal(),this.roleFormModal.setContent(s(yield this.fetchWidgetPage("create-role-modal.html")));new j((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>{this.roleFormModal.close(),this.resetFormData(this.roleFormModal.ele)}));new j((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>a(this,void 0,void 0,(function*(){if(this.validateForm(this.roleFormModal.ele)){const e=this.getFormData(this.roleFormModal.ele);"duplicate"===r(this,n,"f")?this.actions.duplicateRole(Object.assign({},e)):this.actions.createRole(Object.assign({},e)),this.roleFormModal.close(),this.resetFormData(this.roleFormModal.ele)}})))),d(this,i,new F((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="permissions-multiselect"]')}),{logger:this.logger}),"f"),r(this,u,"f").call(this),this.roleFormModal.beforeOpen=()=>a(this,void 0,void 0,(function*(){yield r(this,u,"f").call(this),r(this,l,"f")&&(this.setFormData(this.roleFormModal.ele,r(this,l,"f")),d(this,l,null,"f"))}))}))},h})),xe=i((e=>{var t,i,s;return s=class extends(o(g,ke,We)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this)}))}},t=new WeakSet,i=function(){var e;this.createButton=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-role"]'),{logger:this.logger}),this.createButton.onClick((()=>this.openRoleModal()))},s})),Se=i((e=>{var t,i,n;return n=class extends(o(Ce,M,g,We)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),yield r(this,t,"m",i).call(this)}))}},t=new WeakSet,i=function(){return a(this,void 0,void 0,(function*(){var e;this.deleteRolesModal=this.createModal(),this.deleteRolesModal.setContent(s(yield this.fetchWidgetPage("delete-roles-modal.html")));const t=new j((()=>{var e;return null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteRolesModal.close()));const i=new j((()=>{var e;return null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});i.onClick((()=>{const e=E(this.state);this.actions.deleteRoles(null==e?void 0:e.map((e=>e.name))),this.deleteRolesModal.close()}));const o=new P(null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteRolesModal.beforeOpen=()=>{const e=V(this.state);o.text=`Delete ${e}?`}}))},n})),je=i((e=>{var t,i,s,l;return l=class extends(o(g,We,Ce,Se)(e)){constructor(){super(...arguments),t.add(this),s.set(this,n((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this),this.subscribe(r(this,s,"f").bind(this),H)}))}},s=new WeakMap,t=new WeakSet,i=function(){var e;this.deleteButton=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-roles"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteRolesModal.open()}))},l})),Fe=i((e=>{var t,i,s,l;return l=class extends(o(g,We,Ce,ke)(e)){constructor(){super(...arguments),t.add(this),s.set(this,n((e=>{e?this.duplicateButton.enable():this.duplicateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this),this.subscribe(r(this,s,"f").bind(this),A)}))}},s=new WeakMap,t=new WeakSet,i=function(){var e;this.duplicateButton=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="duplicate-role"]'),{logger:this.logger}),this.duplicateButton.disable(),this.duplicateButton.onClick((()=>{var e,t,i;const o=null===(e=E(this.state))||void 0===e?void 0:e[0];o&&this.openRoleModal("duplicate",{name:`${o.name} Copy`,description:null!==(t=o.description)&&void 0!==t?t:"",permissionNames:null!==(i=o.permissionNames)&&void 0!==i?i:[]})}))},l})),Pe=i((e=>{var t,i,n,l,u,h,v,m;return m=class extends(o(Ce,M,g,C,We)(e)){constructor(){super(...arguments),t.add(this),i.set(this,void 0),u.set(this,(()=>a(this,void 0,void 0,(function*(){var e;yield r(this,i,"f").setData(null===(e=D(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))})))),h.set(this,(()=>{var e;const t=null===(e=E(this.state))||void 0===e?void 0:e[0],i={name:null==t?void 0:t.name,description:null==t?void 0:t.description,permissionNames:null==t?void 0:t.permissionNames};this.setFormData(this.editRoleModal.ele,i)}))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield r(this,t,"m",v).call(this)}))}},i=new WeakMap,u=new WeakMap,h=new WeakMap,t=new WeakSet,n=function(){new j((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.editRoleModal.close()))},l=function(){new j((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{var e;if(this.validateForm(this.editRoleModal.ele)){const t=this.getFormData(this.editRoleModal.ele),{name:i}=t,o=c(t,["name"]),s=null===(e=E(this.state))||void 0===e?void 0:e[0];this.actions.updateRole(Object.assign({newName:i,name:s.name},o)),this.editRoleModal.close(),this.resetFormData(this.editRoleModal.ele)}}))},v=function(){return a(this,void 0,void 0,(function*(){this.editRoleModal=this.createModal(),this.editRoleModal.setContent(s(yield this.fetchWidgetPage("edit-role-modal.html"))),r(this,t,"m",n).call(this),r(this,t,"m",l).call(this),d(this,i,new F((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="permissions-multiselect"]')}),{logger:this.logger}),"f"),this.editRoleModal.beforeOpen=()=>a(this,void 0,void 0,(function*(){yield r(this,u,"f").call(this),r(this,h,"f").call(this)}))}))},m})),Oe=i((e=>{var t,i,s,l;return l=class extends(o(g,We,Ce,Pe,C)(e)){constructor(){super(...arguments),t.add(this),s.set(this,n((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this),this.subscribe(r(this,s,"f").bind(this),Z)}))}},s=new WeakMap,t=new WeakSet,i=function(){var e;this.editButton=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="edit-role"]'),{logger:this.logger}),this.editButton.disable(),this.editButton.onClick((()=>{this.editRoleModal.open()}))},l})),Le=i((e=>{var t,i,s,n;return n=class extends(o(g,We,Ce)(e)){constructor(){super(...arguments),t.add(this),i.set(this,l((()=>{this.actions.searchRoles({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),r(this,t,"m",s).call(this)}))}},i=new WeakMap,t=new WeakSet,s=function(){var e;this.searchInput=new O(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(r(this,i,"f"))},n}));const Ne={success:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Checkmark">\n<path id="Shape" d="M10.0485 15.6396C9.5799 15.171 8.8201 15.171 8.35147 15.6396C7.88284 16.1082 7.88284 16.868 8.35147 17.3367L12.7072 21.6924C13.1759 22.1611 13.9357 22.1611 14.4043 21.6924L24.7152 11.3815C25.1838 10.9129 25.1838 10.1531 24.7152 9.68448C24.2466 9.21585 23.4868 9.21585 23.0181 9.68448L13.5558 19.1469L10.0485 15.6396Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,error:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Vector" d="M15.9998 26.6558C10.1118 26.6558 5.34375 21.8878 5.34375 15.9998C5.34375 10.1118 10.1118 5.34375 15.9998 5.34375C21.8878 5.34375 26.6558 10.1118 26.6558 15.9998C26.6558 21.8878 21.8878 26.6558 15.9998 26.6558ZM15.9998 24.4798C20.6718 24.4798 24.4798 20.7038 24.4798 15.9998C24.4798 11.3278 20.7038 7.51975 15.9998 7.51975C11.3278 7.51975 7.51975 11.2958 7.51975 15.9998C7.51975 20.6718 11.2958 24.4798 15.9998 24.4798ZM15.3278 9.34375H16.6718C17.0558 9.34375 17.3438 9.63175 17.3118 9.98375L16.9598 16.9278C16.9598 17.1838 16.7678 17.3438 16.5438 17.3438H15.4558C15.2318 17.3438 15.0398 17.1518 15.0398 16.9278L14.6878 9.98375C14.6878 9.63175 14.9758 9.34375 15.3278 9.34375ZM15.4558 19.4558H16.5438C16.9278 19.4558 17.2158 19.7438 17.1838 20.1278V21.1838C17.1838 21.5678 16.8958 21.8558 16.5438 21.8558H15.4558C15.0718 21.8558 14.7838 21.5678 14.7838 21.1838V20.1278C14.7838 19.7438 15.0718 19.4558 15.4558 19.4558Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild},Ie=i((e=>{var t,i,s,l,d;return d=class extends(o(g,Ce,W,R)(e)){constructor(){super(...arguments),t.add(this),l.set(this,n((e=>{e.length&&(e.forEach((({type:e,msg:o})=>{const n=r(this,t,"m",s).call(this,e);n.setContent(r(this,t,"m",i).call(this,{type:e,msg:o})),n.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return a(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(r(this,l,"f").bind(this),q)}))}},l=new WeakMap,t=new WeakSet,i=function({type:e,msg:t}){const i=Ne[e],o=Object.assign((new DOMParser).parseFromString('<svg width="2em" height="2em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Shape" d="M10.6712 12L7.27521 8.60406C6.90826 8.23711 6.90826 7.64216 7.27521 7.27521C7.64216 6.90826 8.23711 6.90826 8.60406 7.27521L12 10.6712L15.3959 7.27521C15.7629 6.90826 16.3578 6.90826 16.7248 7.27521C17.0917 7.64216 17.0917 8.23711 16.7248 8.60406L13.3288 12L16.7248 15.3959C17.0917 15.7629 17.0917 16.3578 16.7248 16.7248C16.3578 17.0917 15.7629 17.0917 15.3959 16.7248L12 13.3288L8.60406 16.7248C8.23711 17.0917 7.64216 17.0917 7.27521 16.7248C6.90826 16.3578 6.90826 15.7629 7.27521 15.3959L10.6712 12Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,{slot:"close"});return`${(null==i?void 0:i.outerHTML)||""}${t}${o.outerHTML}`},s=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},d})),Be=i((e=>{var t,i,s,d,c;return c=class extends(o(Ce,g,We)(e)){constructor(){super(...arguments),t.add(this),s.set(this,n((e=>{this.rolesTable.data=e}))),d.set(this,l(((e,t)=>{const i=[],{value:o}=t;if(o){const t=e.path;i.push({field:t,desc:"desc"===o})}this.actions.searchRoles({sort:i})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this),this.rolesTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{r(this,d,"f").call(this,e.target,e.detail)}))})),r(this,s,"f").call(this,T(this.state)),this.subscribe(r(this,s,"f").bind(this),T)}))}},s=new WeakMap,d=new WeakMap,t=new WeakSet,i=function(){var e;this.rolesTable=new L(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="roles-table"]'),{logger:this.logger}),this.rolesTable.onSelectedItemsChange((e=>{this.actions.setSelectedRolesIds(e.detail.value.map((({name:e})=>e)))}))},c})),$e=i((e=>class extends(o(k,x,Be,xe,je,Fe,Oe,Le,Ie,S)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return a(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),qe=o((e=>class extends($e(e)){}))(HTMLElement);customElements.define("descope-role-management-widget",qe);export{qe as default};
|
|
5
|
+
import{escapeHtml as e,pluralize as t,createSingletonMixin as i,compose as o,createTemplate as s,withMemCache as n,debounce as l}from"@descope/sdk-helpers";import{__awaiter as a,__classPrivateFieldGet as r,__classPrivateFieldSet as d,__rest as c}from"tslib";import{projectIdMixin as u,observeAttributesMixin as h,loggerMixin as g,baseUrlMixin as v,cookieConfigMixin as m,createValidateAttributesMixin as p,createStateManagementMixin as f,initLifecycleMixin as R,descopeUiMixin as y,initElementMixin as w,createFetchWidgetPagesMixin as b,modalMixin as M,formMixin as C,notificationsMixin as W,debuggerMixin as k,themeMixin as x,componentsConditionsMixin as S}from"@descope/sdk-mixins";import{ButtonDriver as j,MultiSelectDriver as F,TextDriver as P,TextFieldDriver as O,GridDriver as L}from"@descope/sdk-component-drivers";import{createSelector as N}from"reselect";import{createAsyncThunk as I}from"@reduxjs/toolkit";import B from"@descope/web-js-sdk";const $=e=>e.selectedRolesIds,q=e=>e.notifications,D=e=>e.tenantPermissions.data||[],T=N((e=>e.rolesList.data),(e=>e.map((e=>{var t;return Object.assign(Object.assign({},e),{editable:0===(null===(t=null==e?void 0:e.tenantId)||void 0===t?void 0:t.length)?"no":"yes"})})))),E=N($,T,((e,t)=>t.filter((t=>e.includes(t.name))))),H=N($,(e=>!!e.length)),A=N($,(e=>1===e.length)),Z=N(E,A,((e,t)=>t&&"yes"===e[0].editable)),V=N(E,(e=>1===e.length?e[0].name:`${e.length} roles`)),U=e=>(...t)=>i=>{i.addCase(e.pending,((e,i)=>{t.forEach((({onPending:t})=>{null==t||t(e,i)}))})),i.addCase(e.fulfilled,((e,i)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,i)}))})),i.addCase(e.rejected,((e,i)=>{t.forEach((({onRejected:t})=>{null==t||t(e,i)}))}))},z=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,i)=>{e(t).loading=!1,e(t).error=i.error}}),J=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,i)=>{t&&e.notifications.push({type:"success",msg:t(i)})},onRejected:(t,i)=>{e&&t.notifications.push({type:"error",msg:e(i)})}}),G=I("roles/create",((e,{extra:{api:t}})=>t.role.create(e))),K=U(G)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},z((e=>e.createRole)),J({getSuccessMsg:()=>"Role created successfully",getErrorMsg:t=>{var i;const o=null===(i=t.error)||void 0===i?void 0:i.message;return`\n <div>\n <div>Failed to create role</div>\n ${e(o)}\n </div>`}})),Q={action:G,reducer:K},X=I("roles/delete",((e,{extra:{api:t}})=>t.role.deleteBatch(e))),Y=U(X)({onFulfilled:(e,t)=>{e.rolesList.data=e.rolesList.data.filter((e=>{var i;return 0===(null===(i=null==e?void 0:e.tenantId)||void 0===i?void 0:i.length)||!t.meta.arg.includes(e.name)})),e.selectedRolesIds=[]}},z((e=>e.deleteRole)),J({getSuccessMsg:e=>t(e.meta.arg.length)`${["",e.meta.arg.length]} ${["R","r"]}ole${["","s"]} deleted successfully`,getErrorMsg:e=>t(e.meta.arg.length)`Failed to delete role${["","s"]}`})),_={action:X,reducer:Y},ee=I("roles/duplicate",((e,{extra:{api:t}})=>t.role.create(e))),te=U(ee)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},z((e=>e.duplicateRole)),J({getSuccessMsg:()=>"Role duplicated successfully",getErrorMsg:t=>{var i;const o=null===(i=t.error)||void 0===i?void 0:i.message;return`\n <div>\n <div>Failed to duplicate role</div>\n ${e(o)}\n </div>`}})),ie={action:ee,reducer:te},oe=I("roles/search",((e,{extra:{api:t},getState:i})=>{const o=i().searchParams;return t.role.search(Object.assign(Object.assign({},o),e))})),se=U(oe)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.rolesList.data=t.payload}},z((e=>e.rolesList))),ne={action:oe,reducer:se},le=I("roles/update",((e,{extra:{api:t}})=>t.role.update(e))),ae=U(le)({onFulfilled:(e,t)=>{const i=e.rolesList.data.findIndex((e=>e.name===t.payload.oldName));-1!==i&&(e.rolesList.data[i]=t.payload)}},z((e=>e.updateRole)),J({getSuccessMsg:()=>"Role updated successfully",getErrorMsg:t=>{var i;const o=null===(i=t.error)||void 0===i?void 0:i.message;return`\n <div>\n <div>Failed to update role</div>\n ${e(o)}\n </div>`}})),re={action:le,reducer:ae},de=I("tenant/getTenantPermissions",((e,{extra:{api:t}})=>t.tenant.getTenantPermissions())),ce={action:de,reducer:U(de)({onFulfilled:(e,t)=>{e.tenantPermissions.data=t.payload.permissions}},z((e=>e.tenantPermissions)))},ue={rolesList:{data:[],loading:!1,error:null},createRole:{loading:!1,error:null},duplicateRole:{loading:!1,error:null},updateRole:{loading:!1,error:null},deleteRole:{loading:!1,error:null},tenantPermissions:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedRolesIds:[],notifications:[]},he={search:"/v1/mgmt/role/search",deleteBatch:"/v1/mgmt/role/delete/batch",create:"/v1/mgmt/role/create",update:"/v1/mgmt/role/update"},ge={permissions:"/v1/mgmt/permission/all"},ve=e=>a(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})),me=(e,t)=>a(void 0,[e,t],void 0,(function*({text:e,sort:t},i){return new Promise((o=>{const s=[];for(let e=1;e<10;e+=1)s.push({name:`Role ${e}`,description:`Role description ${e}`,permissionNames:[`Permission ${e}`],createdTime:new Date,tenantId:i});t.forEach((e=>{s.sort(((t,i)=>{var o,s;return e.desc?null===(s=i[e.field])||void 0===s?void 0:s.localeCompare(t[e.field]):null===(o=t[e.field])||void 0===o?void 0:o.localeCompare(i[e.field])}))})),o(s.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.description.toLowerCase().includes(e.toLowerCase()))))}))})),pe=(e,t)=>a(void 0,[e,t],void 0,(function*({name:e,description:t,permissionNames:i},o){return new Promise((s=>{s({name:e,description:t,permissionNames:i,createdTime:new Date,tenantId:o})}))})),fe=(e,t)=>a(void 0,[e,t],void 0,(function*({name:e,newName:t,description:i,permissionNames:o},s){return new Promise((n=>{n({name:t,description:i,permissionNames:o,createdTime:new Date,oldName:e,tenantId:s})}))})),Re=()=>a(void 0,void 0,void 0,(function*(){})),ye=()=>new Promise((e=>{const t=[];for(let e=1;e<5;e+=1)t.push({name:`Permission ${e}`});e({permissions:t})})),we=({httpClient:e,tenant:t,mock:i})=>({search:(...o)=>a(void 0,[...o],void 0,(function*({page:o,limit:s=1e4,text:n,sort:l}={}){if(i)return me({page:o,limit:s,text:n,sort:l},t);const a=yield e.post(he.search,{limit:s,page:o,text:n,sort:l},{queryParams:{tenant:t}});yield ve(a);return(yield a.json()).roles})),deleteBatch:o=>a(void 0,void 0,void 0,(function*(){if(i)return Re();const s=yield e.post(he.deleteBatch,{roleNames:o},{queryParams:{tenant:t}});return yield ve(s),s.json()})),create:o=>a(void 0,[o],void 0,(function*({name:o,description:s,permissionNames:n}){if(i)return pe({name:o,description:s,permissionNames:n},t);const l=yield e.post(he.create,{name:o,description:s,permissionNames:n,tenantId:t},{queryParams:{tenant:t}});yield ve(l);return yield l.json()})),update:o=>a(void 0,[o],void 0,(function*({name:o,newName:s,description:n,permissionNames:l}){if(i)return fe({name:o,newName:s,description:n,permissionNames:l},t);const a=yield e.post(he.update,{name:o,newName:s,description:n,permissionNames:l,tenantId:t},{queryParams:{tenant:t}});yield ve(a);const r=yield a.json();return r.oldName=o,r}))}),be=({httpClient:e,tenant:t,mock:i})=>({getTenantPermissions:()=>a(void 0,void 0,void 0,(function*(){if(i)return ye();const o=yield e.get(ge.permissions,{queryParams:{tenant:t}});return yield ve(o),o.json()}))}),Me=i((e=>{var t,i,s,n;const l=o(u,h,g,v,m,p({tenant:p.missingAttrValidator}))(e);return n=class extends l{constructor(){super(...arguments),t.add(this),i.set(this,void 0)}get tenantId(){return this.getAttribute("tenant")}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return r(this,i,"f")||r(this,t,"m",s).call(this),r(this,i,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.init)||void 0===o?void 0:o.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{r(this,i,"f")&&r(this,t,"m",s).call(this)}))}))}},i=new WeakMap,t=new WeakSet,s=function(){this.logger.debug("creating an sdk instance"),d(this,i,((e,t,i,o)=>{const s=B(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"role-management-widget","x-descope-widget-id":o,"x-descope-widget-version":"0.10.17"}}));return{role:we({httpClient:s.httpClient,tenant:t,mock:i}),tenant:be({httpClient:s.httpClient,tenant:t,mock:i}),httpClient:s.httpClient}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},n})),Ce=i((e=>{const t=o(f({name:"widget",initialState:ue,reducers:{setSelectedRolesIds:(e,{payload:t})=>{e.selectedRolesIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{Q.reducer(e),ie.reducer(e),re.reducer(e),_.reducer(e),ne.reducer(e),ce.reducer(e)},asyncActions:{searchRoles:ne.action,createRole:Q.action,duplicateRole:ie.action,updateRole:re.action,deleteRoles:_.action,getTenantPermissions:ce.action}}),R,g,Me)(e);return class extends t{constructor(...e){super(...e),this.state=ue,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),We=i((e=>{var t,i,n;return n=class extends(o(g,R,y,w,b("role-management-widget"),Ce)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return a(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.init)||void 0===o?void 0:o.call(this),yield Promise.all([r(this,t,"m",i).call(this),this.actions.searchRoles(),this.actions.getTenantPermissions()]),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},t=new WeakSet,i=function(){return a(this,void 0,void 0,(function*(){const e=s(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},n})),ke=i((e=>{var t,i,n,l,c,u,h;return h=class extends(o(Ce,M,C,g,We)(e)){constructor(){super(...arguments),t.add(this),i.set(this,void 0),n.set(this,"create"),l.set(this,null),u.set(this,(()=>a(this,void 0,void 0,(function*(){var e;yield r(this,i,"f").setData(null===(e=D(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))}))))}openRoleModal(e="create",t){d(this,n,e,"f"),d(this,l,null!=t?t:null,"f"),this.roleFormModal.open()}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),r(this,t,"m",c).call(this)}))}},i=new WeakMap,n=new WeakMap,l=new WeakMap,u=new WeakMap,t=new WeakSet,c=function(){return a(this,void 0,void 0,(function*(){this.roleFormModal=this.createModal(),this.roleFormModal.setContent(s(yield this.fetchWidgetPage("create-role-modal.html")));new j((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>{this.roleFormModal.close(),this.resetFormData(this.roleFormModal.ele)}));new j((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>a(this,void 0,void 0,(function*(){if(this.validateForm(this.roleFormModal.ele)){const e=this.getFormData(this.roleFormModal.ele);"duplicate"===r(this,n,"f")?this.actions.duplicateRole(Object.assign({},e)):this.actions.createRole(Object.assign({},e)),this.roleFormModal.close(),this.resetFormData(this.roleFormModal.ele)}})))),d(this,i,new F((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="permissions-multiselect"]')}),{logger:this.logger}),"f"),r(this,u,"f").call(this),this.roleFormModal.beforeOpen=()=>a(this,void 0,void 0,(function*(){yield r(this,u,"f").call(this),r(this,l,"f")&&(this.setFormData(this.roleFormModal.ele,r(this,l,"f")),d(this,l,null,"f"))}))}))},h})),xe=i((e=>{var t,i,s;return s=class extends(o(g,ke,We)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this)}))}},t=new WeakSet,i=function(){var e;this.createButton=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-role"]'),{logger:this.logger}),this.createButton.onClick((()=>this.openRoleModal()))},s})),Se=i((e=>{var t,i,n;return n=class extends(o(Ce,M,g,We)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),yield r(this,t,"m",i).call(this)}))}},t=new WeakSet,i=function(){return a(this,void 0,void 0,(function*(){var e;this.deleteRolesModal=this.createModal(),this.deleteRolesModal.setContent(s(yield this.fetchWidgetPage("delete-roles-modal.html")));const t=new j((()=>{var e;return null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteRolesModal.close()));const i=new j((()=>{var e;return null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});i.onClick((()=>{const e=E(this.state);this.actions.deleteRoles(null==e?void 0:e.map((e=>e.name))),this.deleteRolesModal.close()}));const o=new P(null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteRolesModal.beforeOpen=()=>{const e=V(this.state);o.text=`Delete ${e}?`}}))},n})),je=i((e=>{var t,i,s,l;return l=class extends(o(g,We,Ce,Se)(e)){constructor(){super(...arguments),t.add(this),s.set(this,n((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this),this.subscribe(r(this,s,"f").bind(this),H)}))}},s=new WeakMap,t=new WeakSet,i=function(){var e;this.deleteButton=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-roles"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteRolesModal.open()}))},l})),Fe=i((e=>{var t,i,s,l;return l=class extends(o(g,We,Ce,ke)(e)){constructor(){super(...arguments),t.add(this),s.set(this,n((e=>{e?this.duplicateButton.enable():this.duplicateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this),this.subscribe(r(this,s,"f").bind(this),A)}))}},s=new WeakMap,t=new WeakSet,i=function(){var e;this.duplicateButton=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="duplicate-role"]'),{logger:this.logger}),this.duplicateButton.disable(),this.duplicateButton.onClick((()=>{var e,t,i;const o=null===(e=E(this.state))||void 0===e?void 0:e[0];o&&this.openRoleModal("duplicate",{name:`${o.name} Copy`,description:null!==(t=o.description)&&void 0!==t?t:"",permissionNames:null!==(i=o.permissionNames)&&void 0!==i?i:[]})}))},l})),Pe=i((e=>{var t,i,n,l,u,h,v,m;return m=class extends(o(Ce,M,g,C,We)(e)){constructor(){super(...arguments),t.add(this),i.set(this,void 0),u.set(this,(()=>a(this,void 0,void 0,(function*(){var e;yield r(this,i,"f").setData(null===(e=D(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))})))),h.set(this,(()=>{var e;const t=null===(e=E(this.state))||void 0===e?void 0:e[0],i={name:null==t?void 0:t.name,description:null==t?void 0:t.description,permissionNames:null==t?void 0:t.permissionNames};this.setFormData(this.editRoleModal.ele,i)}))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield r(this,t,"m",v).call(this)}))}},i=new WeakMap,u=new WeakMap,h=new WeakMap,t=new WeakSet,n=function(){new j((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.editRoleModal.close()))},l=function(){new j((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{var e;if(this.validateForm(this.editRoleModal.ele)){const t=this.getFormData(this.editRoleModal.ele),{name:i}=t,o=c(t,["name"]),s=null===(e=E(this.state))||void 0===e?void 0:e[0];this.actions.updateRole(Object.assign({newName:i,name:s.name},o)),this.editRoleModal.close(),this.resetFormData(this.editRoleModal.ele)}}))},v=function(){return a(this,void 0,void 0,(function*(){this.editRoleModal=this.createModal(),this.editRoleModal.setContent(s(yield this.fetchWidgetPage("edit-role-modal.html"))),r(this,t,"m",n).call(this),r(this,t,"m",l).call(this),d(this,i,new F((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="permissions-multiselect"]')}),{logger:this.logger}),"f"),this.editRoleModal.beforeOpen=()=>a(this,void 0,void 0,(function*(){yield r(this,u,"f").call(this),r(this,h,"f").call(this)}))}))},m})),Oe=i((e=>{var t,i,s,l;return l=class extends(o(g,We,Ce,Pe,C)(e)){constructor(){super(...arguments),t.add(this),s.set(this,n((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this),this.subscribe(r(this,s,"f").bind(this),Z)}))}},s=new WeakMap,t=new WeakSet,i=function(){var e;this.editButton=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="edit-role"]'),{logger:this.logger}),this.editButton.disable(),this.editButton.onClick((()=>{this.editRoleModal.open()}))},l})),Le=i((e=>{var t,i,s,n;return n=class extends(o(g,We,Ce)(e)){constructor(){super(...arguments),t.add(this),i.set(this,l((()=>{this.actions.searchRoles({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),r(this,t,"m",s).call(this)}))}},i=new WeakMap,t=new WeakSet,s=function(){var e;this.searchInput=new O(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(r(this,i,"f"))},n}));const Ne={success:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Checkmark">\n<path id="Shape" d="M10.0485 15.6396C9.5799 15.171 8.8201 15.171 8.35147 15.6396C7.88284 16.1082 7.88284 16.868 8.35147 17.3367L12.7072 21.6924C13.1759 22.1611 13.9357 22.1611 14.4043 21.6924L24.7152 11.3815C25.1838 10.9129 25.1838 10.1531 24.7152 9.68448C24.2466 9.21585 23.4868 9.21585 23.0181 9.68448L13.5558 19.1469L10.0485 15.6396Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,error:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Vector" d="M15.9998 26.6558C10.1118 26.6558 5.34375 21.8878 5.34375 15.9998C5.34375 10.1118 10.1118 5.34375 15.9998 5.34375C21.8878 5.34375 26.6558 10.1118 26.6558 15.9998C26.6558 21.8878 21.8878 26.6558 15.9998 26.6558ZM15.9998 24.4798C20.6718 24.4798 24.4798 20.7038 24.4798 15.9998C24.4798 11.3278 20.7038 7.51975 15.9998 7.51975C11.3278 7.51975 7.51975 11.2958 7.51975 15.9998C7.51975 20.6718 11.2958 24.4798 15.9998 24.4798ZM15.3278 9.34375H16.6718C17.0558 9.34375 17.3438 9.63175 17.3118 9.98375L16.9598 16.9278C16.9598 17.1838 16.7678 17.3438 16.5438 17.3438H15.4558C15.2318 17.3438 15.0398 17.1518 15.0398 16.9278L14.6878 9.98375C14.6878 9.63175 14.9758 9.34375 15.3278 9.34375ZM15.4558 19.4558H16.5438C16.9278 19.4558 17.2158 19.7438 17.1838 20.1278V21.1838C17.1838 21.5678 16.8958 21.8558 16.5438 21.8558H15.4558C15.0718 21.8558 14.7838 21.5678 14.7838 21.1838V20.1278C14.7838 19.7438 15.0718 19.4558 15.4558 19.4558Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild},Ie=i((e=>{var t,i,s,l,d;return d=class extends(o(g,Ce,W,R)(e)){constructor(){super(...arguments),t.add(this),l.set(this,n((e=>{e.length&&(e.forEach((({type:e,msg:o})=>{const n=r(this,t,"m",s).call(this,e);n.setContent(r(this,t,"m",i).call(this,{type:e,msg:o})),n.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return a(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(r(this,l,"f").bind(this),q)}))}},l=new WeakMap,t=new WeakSet,i=function({type:e,msg:t}){const i=Ne[e],o=Object.assign((new DOMParser).parseFromString('<svg width="2em" height="2em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Shape" d="M10.6712 12L7.27521 8.60406C6.90826 8.23711 6.90826 7.64216 7.27521 7.27521C7.64216 6.90826 8.23711 6.90826 8.60406 7.27521L12 10.6712L15.3959 7.27521C15.7629 6.90826 16.3578 6.90826 16.7248 7.27521C17.0917 7.64216 17.0917 8.23711 16.7248 8.60406L13.3288 12L16.7248 15.3959C17.0917 15.7629 17.0917 16.3578 16.7248 16.7248C16.3578 17.0917 15.7629 17.0917 15.3959 16.7248L12 13.3288L8.60406 16.7248C8.23711 17.0917 7.64216 17.0917 7.27521 16.7248C6.90826 16.3578 6.90826 15.7629 7.27521 15.3959L10.6712 12Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,{slot:"close"});return`${(null==i?void 0:i.outerHTML)||""}${t}${o.outerHTML}`},s=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},d})),Be=i((e=>{var t,i,s,d,c;return c=class extends(o(Ce,g,We)(e)){constructor(){super(...arguments),t.add(this),s.set(this,n((e=>{this.rolesTable.data=e}))),d.set(this,l(((e,t)=>{const i=[],{value:o}=t;if(o){const t=e.path;i.push({field:t,desc:"desc"===o})}this.actions.searchRoles({sort:i})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return a(this,void 0,void 0,(function*(){var o;yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),r(this,t,"m",i).call(this),this.rolesTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{r(this,d,"f").call(this,e.target,e.detail)}))})),r(this,s,"f").call(this,T(this.state)),this.subscribe(r(this,s,"f").bind(this),T)}))}},s=new WeakMap,d=new WeakMap,t=new WeakSet,i=function(){var e;this.rolesTable=new L(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="roles-table"]'),{logger:this.logger}),this.rolesTable.onSelectedItemsChange((e=>{this.actions.setSelectedRolesIds(e.detail.value.map((({name:e})=>e)))}))},c})),$e=i((e=>class extends(o(k,x,Be,xe,je,Fe,Oe,Le,Ie,S)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return a(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),qe=o((e=>class extends($e(e)){}))(HTMLElement);customElements.define("descope-role-management-widget",qe);export{qe as default};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -83,14 +83,14 @@ type RoleFormData = {
|
|
|
83
83
|
declare const RoleManagementWidget: {
|
|
84
84
|
new (...rest: any[]): {
|
|
85
85
|
init(): Promise<void>;
|
|
86
|
-
"__#
|
|
86
|
+
"__#43324@#statePromise"?: Promise<{
|
|
87
87
|
[x: string]: string;
|
|
88
88
|
}>;
|
|
89
|
-
"__#
|
|
89
|
+
"__#43324@#appliedState": {
|
|
90
90
|
[x: string]: string;
|
|
91
91
|
};
|
|
92
|
-
"__#
|
|
93
|
-
"__#
|
|
92
|
+
"__#43324@#requireHttpClient"(): _descope_sdk_mixins.ConditionsHttpClient;
|
|
93
|
+
"__#43324@#fetchComponentsState"(httpClient: _descope_sdk_mixins.ConditionsHttpClient): Promise<{
|
|
94
94
|
[x: string]: string;
|
|
95
95
|
}>;
|
|
96
96
|
onWidgetRootReady: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
@@ -141,11 +141,11 @@ declare const RoleManagementWidget: {
|
|
|
141
141
|
readonly cssRules: CSSRuleList;
|
|
142
142
|
});
|
|
143
143
|
nonce: string;
|
|
144
|
-
"__#
|
|
145
|
-
"__#
|
|
144
|
+
"__#43309@#setNonce": (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
145
|
+
"__#43304@#observeMappings": {};
|
|
146
146
|
observeAttribute: ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any);
|
|
147
147
|
observeAttributes: ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void);
|
|
148
|
-
"__#
|
|
148
|
+
"__#43303@#isInit": boolean;
|
|
149
149
|
connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
150
150
|
accessKey: string;
|
|
151
151
|
readonly accessKeyLabel: string;
|
|
@@ -1223,21 +1223,21 @@ declare const RoleManagementWidget: {
|
|
|
1223
1223
|
tabIndex: number;
|
|
1224
1224
|
blur: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1225
1225
|
focus: ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void);
|
|
1226
|
-
"__#
|
|
1227
|
-
"__#
|
|
1226
|
+
"__#43302@#logger": _descope_sdk_mixins.Logger;
|
|
1227
|
+
"__#43302@#wrapLogger": ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger);
|
|
1228
1228
|
logger: _descope_sdk_mixins.Logger;
|
|
1229
1229
|
onLogEvent: ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", args: any[]) => void);
|
|
1230
|
-
"__#
|
|
1230
|
+
"__#17@#createNotificationContent"({ type, msg }: {
|
|
1231
1231
|
type: "success" | "error";
|
|
1232
1232
|
msg: string;
|
|
1233
1233
|
}): string;
|
|
1234
|
-
"__#
|
|
1234
|
+
"__#17@#createNotification"(type: "success" | "error"): {
|
|
1235
1235
|
setContent(templateOrString: string | HTMLTemplateElement): void;
|
|
1236
1236
|
nodeName: string;
|
|
1237
1237
|
close(): void;
|
|
1238
1238
|
show(): void;
|
|
1239
1239
|
remove(): void;
|
|
1240
|
-
"__#
|
|
1240
|
+
"__#43313@#private": any;
|
|
1241
1241
|
logger: {
|
|
1242
1242
|
error(...data: any[]): void;
|
|
1243
1243
|
warn(...data: any[]): void;
|
|
@@ -1248,11 +1248,11 @@ declare const RoleManagementWidget: {
|
|
|
1248
1248
|
readonly ele: Element;
|
|
1249
1249
|
readonly isExists: boolean;
|
|
1250
1250
|
};
|
|
1251
|
-
"__#
|
|
1251
|
+
"__#17@#onNotificationsUpdate": (notifications: {
|
|
1252
1252
|
type: "success" | "error";
|
|
1253
1253
|
msg: string;
|
|
1254
1254
|
}[]) => void;
|
|
1255
|
-
"__#
|
|
1255
|
+
"__#43319@#NotificationDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
|
|
1256
1256
|
logger: {
|
|
1257
1257
|
error(...data: any[]): void;
|
|
1258
1258
|
warn(...data: any[]): void;
|
|
@@ -1265,7 +1265,7 @@ declare const RoleManagementWidget: {
|
|
|
1265
1265
|
close(): void;
|
|
1266
1266
|
show(): void;
|
|
1267
1267
|
remove(): void;
|
|
1268
|
-
"__#
|
|
1268
|
+
"__#43313@#private": any;
|
|
1269
1269
|
logger: {
|
|
1270
1270
|
error(...data: any[]): void;
|
|
1271
1271
|
warn(...data: any[]): void;
|
|
@@ -1291,7 +1291,7 @@ declare const RoleManagementWidget: {
|
|
|
1291
1291
|
close(): void;
|
|
1292
1292
|
show(): void;
|
|
1293
1293
|
remove(): void;
|
|
1294
|
-
"__#
|
|
1294
|
+
"__#43313@#private": any;
|
|
1295
1295
|
logger: {
|
|
1296
1296
|
error(...data: any[]): void;
|
|
1297
1297
|
warn(...data: any[]): void;
|
|
@@ -1302,12 +1302,12 @@ declare const RoleManagementWidget: {
|
|
|
1302
1302
|
readonly ele: Element;
|
|
1303
1303
|
readonly isExists: boolean;
|
|
1304
1304
|
};
|
|
1305
|
-
"__#
|
|
1306
|
-
"__#
|
|
1307
|
-
"__#
|
|
1305
|
+
"__#43312@#getComponentsVersion": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
|
|
1306
|
+
"__#43312@#getComponentsVersionSri": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
|
|
1307
|
+
"__#43312@#descopeUi": Promise<any>;
|
|
1308
1308
|
readonly descopeUi: Promise<any>;
|
|
1309
|
-
"__#
|
|
1310
|
-
"__#
|
|
1309
|
+
"__#43312@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
|
|
1310
|
+
"__#43312@#getDescopeUi": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
|
|
1311
1311
|
loadDescopeUiComponents: ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>);
|
|
1312
1312
|
readonly baseCdnUrl: string;
|
|
1313
1313
|
injectNpmLib: ((libName: string, version: string, filePath?: string, overrides?: string[], integrity?: string) => Promise<{
|
|
@@ -1328,17 +1328,17 @@ declare const RoleManagementWidget: {
|
|
|
1328
1328
|
integrity?: string;
|
|
1329
1329
|
}>);
|
|
1330
1330
|
readonly config: Promise<_descope_sdk_mixins.Config>;
|
|
1331
|
-
"__#
|
|
1332
|
-
"__#
|
|
1333
|
-
"__#
|
|
1334
|
-
"__#
|
|
1331
|
+
"__#43308@#configCacheClear": (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1332
|
+
"__#43308@#_configResource": Promise<_descope_sdk_mixins.Config>;
|
|
1333
|
+
"__#43308@#fetchConfig": (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>);
|
|
1334
|
+
"__#43307@#callbacks": Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void>;
|
|
1335
1335
|
onReset: ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void);
|
|
1336
1336
|
reset: ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>);
|
|
1337
|
-
"__#
|
|
1338
|
-
"__#
|
|
1339
|
-
"__#
|
|
1340
|
-
"__#
|
|
1341
|
-
"__#
|
|
1337
|
+
"__#43305@#handleError": ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
|
|
1338
|
+
"__#43306@#lastBaseUrl"?: string;
|
|
1339
|
+
"__#43306@#workingBaseUrl"?: string;
|
|
1340
|
+
"__#43306@#failedUrls": Set<string>;
|
|
1341
|
+
"__#43306@#getResourceUrls": ((filename: string) => (URL & {
|
|
1342
1342
|
baseUrl: string;
|
|
1343
1343
|
}) | (URL & {
|
|
1344
1344
|
baseUrl: string;
|
|
@@ -1371,7 +1371,7 @@ declare const RoleManagementWidget: {
|
|
|
1371
1371
|
}) | (URL & {
|
|
1372
1372
|
baseUrl: string;
|
|
1373
1373
|
})[]);
|
|
1374
|
-
"__#
|
|
1374
|
+
"__#43306@#createResourceUrl": ((filename: string, baseUrl: string) => URL & {
|
|
1375
1375
|
baseUrl: string;
|
|
1376
1376
|
}) & ((filename: string, baseUrl: string) => URL & {
|
|
1377
1377
|
baseUrl: string;
|
|
@@ -1417,7 +1417,7 @@ declare const RoleManagementWidget: {
|
|
|
1417
1417
|
readonly baseUrl: string;
|
|
1418
1418
|
readonly projectId: string;
|
|
1419
1419
|
state: State;
|
|
1420
|
-
"__#
|
|
1420
|
+
"__#7@#api": {
|
|
1421
1421
|
role: {
|
|
1422
1422
|
search: (config: SearchRolesConfig) => Promise<Role[]>;
|
|
1423
1423
|
deleteBatch: (roleNames: string[]) => Promise<any>;
|
|
@@ -1431,7 +1431,7 @@ declare const RoleManagementWidget: {
|
|
|
1431
1431
|
};
|
|
1432
1432
|
httpClient: _descope_sdk_mixins.ConditionsHttpClient;
|
|
1433
1433
|
};
|
|
1434
|
-
"__#
|
|
1434
|
+
"__#7@#createSdk": (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1435
1435
|
readonly tenantId: string;
|
|
1436
1436
|
readonly widgetId: string;
|
|
1437
1437
|
readonly mock: string;
|
|
@@ -6520,18 +6520,19 @@ declare const RoleManagementWidget: {
|
|
|
6520
6520
|
}[];
|
|
6521
6521
|
}) => SelectorR) => redux.Unsubscribe;
|
|
6522
6522
|
searchInput: _descope_sdk_component_drivers.TextFieldDriver;
|
|
6523
|
-
"__#
|
|
6524
|
-
"__#
|
|
6525
|
-
"__#
|
|
6523
|
+
"__#16@#onInput": (this: any, ...args: any[]) => void;
|
|
6524
|
+
"__#16@#initSearchInput"(): void;
|
|
6525
|
+
"__#8@#initWidgetRoot": (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
6526
6526
|
fetchWidgetPage(filename: string): Promise<string>;
|
|
6527
|
-
"__#
|
|
6527
|
+
"__#43321@#tryFetchLocalized"(filename: string): Promise<string>;
|
|
6528
6528
|
readonly locale: string;
|
|
6529
6529
|
readonly localeCandidates: string[];
|
|
6530
6530
|
firstAvailableLocale(availableLocales: string[]): string;
|
|
6531
6531
|
getWidgetConfig(): Promise<_descope_sdk_mixins.WidgetConfig>;
|
|
6532
|
+
getHostedPageBaseUrl(): Promise<string>;
|
|
6532
6533
|
editButton: _descope_sdk_component_drivers.ButtonDriver;
|
|
6533
|
-
"__#
|
|
6534
|
-
"__#
|
|
6534
|
+
"__#15@#initEditButton"(): void;
|
|
6535
|
+
"__#15@#onIsRoleSelectedUpdate": (isEditable: boolean) => void;
|
|
6535
6536
|
validateForm(rootEle: Element): boolean;
|
|
6536
6537
|
getFormInputs(rootEle: Element): HTMLInputElement[];
|
|
6537
6538
|
getFormData(rootEle: Element): any;
|
|
@@ -6541,13 +6542,13 @@ declare const RoleManagementWidget: {
|
|
|
6541
6542
|
disableFormField(rootEle: Element, name: string): void;
|
|
6542
6543
|
removeFormField(rootEle: Element, name: string): void;
|
|
6543
6544
|
editRoleModal: _descope_sdk_component_drivers.ModalDriver;
|
|
6544
|
-
"__#
|
|
6545
|
-
"__#
|
|
6546
|
-
"__#
|
|
6547
|
-
"__#
|
|
6548
|
-
"__#
|
|
6549
|
-
"__#
|
|
6550
|
-
"__#
|
|
6545
|
+
"__#14@#permissionsMultiSelect": _descope_sdk_component_drivers.MultiSelectDriver;
|
|
6546
|
+
"__#14@#initCancelButton"(): void;
|
|
6547
|
+
"__#14@#initSubmitButton"(): void;
|
|
6548
|
+
"__#14@#updatePermissionsMultiSelect": () => Promise<void>;
|
|
6549
|
+
"__#14@#updateModalData": () => void;
|
|
6550
|
+
"__#14@#initEditRoleModal"(): Promise<void>;
|
|
6551
|
+
"__#43318@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
|
|
6551
6552
|
logger: {
|
|
6552
6553
|
error(...data: any[]): void;
|
|
6553
6554
|
warn(...data: any[]): void;
|
|
@@ -6556,7 +6557,7 @@ declare const RoleManagementWidget: {
|
|
|
6556
6557
|
};
|
|
6557
6558
|
}) => {
|
|
6558
6559
|
setContent(template: HTMLTemplateElement): void;
|
|
6559
|
-
"__#
|
|
6560
|
+
"__#43316@#private": any;
|
|
6560
6561
|
beforeOpen: () => void | Promise<void>;
|
|
6561
6562
|
afterClose: () => void;
|
|
6562
6563
|
nodeName: string;
|
|
@@ -6566,7 +6567,7 @@ declare const RoleManagementWidget: {
|
|
|
6566
6567
|
open(): Promise<void>;
|
|
6567
6568
|
reset(): void;
|
|
6568
6569
|
remove(): void;
|
|
6569
|
-
"__#
|
|
6570
|
+
"__#43313@#private": any;
|
|
6570
6571
|
logger: {
|
|
6571
6572
|
error(...data: any[]): void;
|
|
6572
6573
|
warn(...data: any[]): void;
|
|
@@ -6586,7 +6587,7 @@ declare const RoleManagementWidget: {
|
|
|
6586
6587
|
};
|
|
6587
6588
|
}) => {
|
|
6588
6589
|
setContent(template: HTMLTemplateElement): void;
|
|
6589
|
-
"__#
|
|
6590
|
+
"__#43316@#private": any;
|
|
6590
6591
|
beforeOpen: () => void | Promise<void>;
|
|
6591
6592
|
afterClose: () => void;
|
|
6592
6593
|
nodeName: string;
|
|
@@ -6596,7 +6597,7 @@ declare const RoleManagementWidget: {
|
|
|
6596
6597
|
open(): Promise<void>;
|
|
6597
6598
|
reset(): void;
|
|
6598
6599
|
remove(): void;
|
|
6599
|
-
"__#
|
|
6600
|
+
"__#43313@#private": any;
|
|
6600
6601
|
logger: {
|
|
6601
6602
|
error(...data: any[]): void;
|
|
6602
6603
|
warn(...data: any[]): void;
|
|
@@ -6609,25 +6610,25 @@ declare const RoleManagementWidget: {
|
|
|
6609
6610
|
};
|
|
6610
6611
|
createModal(config?: Record<string, string>, DriverClass?: typeof _descope_sdk_component_drivers.ModalDriver): _descope_sdk_component_drivers.ModalDriver;
|
|
6611
6612
|
duplicateButton: _descope_sdk_component_drivers.ButtonDriver;
|
|
6612
|
-
"__#
|
|
6613
|
-
"__#
|
|
6613
|
+
"__#13@#initDuplicateButton"(): void;
|
|
6614
|
+
"__#13@#onIsSingleRoleSelectedUpdate": (isSingleSelected: boolean) => void;
|
|
6614
6615
|
roleFormModal: _descope_sdk_component_drivers.ModalDriver;
|
|
6615
|
-
"__#
|
|
6616
|
-
"__#
|
|
6617
|
-
"__#
|
|
6616
|
+
"__#9@#permissionsMultiSelect": _descope_sdk_component_drivers.MultiSelectDriver;
|
|
6617
|
+
"__#9@#submitMode": "create" | "duplicate";
|
|
6618
|
+
"__#9@#pendingPrefill": RoleFormData;
|
|
6618
6619
|
openRoleModal: ((mode?: "create" | "duplicate", prefill?: RoleFormData) => void) & ((mode?: "create" | "duplicate", prefill?: RoleFormData) => void);
|
|
6619
|
-
"__#
|
|
6620
|
-
"__#
|
|
6620
|
+
"__#9@#initRoleFormModal": (() => Promise<void>) & (() => Promise<void>);
|
|
6621
|
+
"__#9@#updatePermissionsMultiSelect": (() => Promise<void>) & (() => Promise<void>);
|
|
6621
6622
|
deleteButton: _descope_sdk_component_drivers.ButtonDriver;
|
|
6622
|
-
"__#
|
|
6623
|
-
"__#
|
|
6623
|
+
"__#12@#initDeleteButton"(): void;
|
|
6624
|
+
"__#12@#onIsRoleSelectedUpdate": (isSelected: boolean) => void;
|
|
6624
6625
|
deleteRolesModal: _descope_sdk_component_drivers.ModalDriver;
|
|
6625
|
-
"__#
|
|
6626
|
+
"__#11@#initDeleteRoleModal"(): Promise<void>;
|
|
6626
6627
|
createButton: _descope_sdk_component_drivers.ButtonDriver;
|
|
6627
|
-
"__#
|
|
6628
|
+
"__#10@#initCreateButton"(): void;
|
|
6628
6629
|
rolesTable: _descope_sdk_component_drivers.GridDriver<Role>;
|
|
6629
|
-
"__#
|
|
6630
|
-
"__#
|
|
6630
|
+
"__#18@#initRolesTable"(): void;
|
|
6631
|
+
"__#18@#onRolesListUpdate": (rolesList: {
|
|
6631
6632
|
editable: string;
|
|
6632
6633
|
name: string;
|
|
6633
6634
|
description: string;
|
|
@@ -6635,34 +6636,34 @@ declare const RoleManagementWidget: {
|
|
|
6635
6636
|
createdTime: Date;
|
|
6636
6637
|
tenantId: string;
|
|
6637
6638
|
}[]) => void;
|
|
6638
|
-
"__#
|
|
6639
|
-
"__#
|
|
6640
|
-
"__#
|
|
6641
|
-
"__#
|
|
6639
|
+
"__#18@#onColumnSortChange": (this: any, ...args: any[]) => void;
|
|
6640
|
+
"__#43320@#globalStyle": _descope_sdk_mixins.InjectedStyle;
|
|
6641
|
+
"__#43320@#tenantStyle": _descope_sdk_mixins.InjectedStyle;
|
|
6642
|
+
"__#43320@#customStyle": _descope_sdk_mixins.InjectedStyle;
|
|
6642
6643
|
readonly theme: _descope_sdk_mixins.ThemeOptions;
|
|
6643
6644
|
readonly styleId: string;
|
|
6644
6645
|
readonly themeOverride: Record<string, any>;
|
|
6645
|
-
"__#
|
|
6646
|
-
"__#
|
|
6647
|
-
"__#
|
|
6648
|
-
"__#
|
|
6649
|
-
readonly "__#
|
|
6650
|
-
"__#
|
|
6651
|
-
"__#
|
|
6652
|
-
readonly "__#
|
|
6653
|
-
"__#
|
|
6654
|
-
"__#
|
|
6655
|
-
"__#
|
|
6656
|
-
"__#
|
|
6646
|
+
"__#43320@#getThemeOverrideString"(): string;
|
|
6647
|
+
"__#43320@#_themeResource": Promise<void | Record<string, any>>;
|
|
6648
|
+
"__#43320@#_tenantThemeResource": Promise<Record<string, any>>;
|
|
6649
|
+
"__#43320@#fetchTheme"(): Promise<Record<string, any>>;
|
|
6650
|
+
readonly "__#43320@#themeResource": Promise<void | Record<string, any>>;
|
|
6651
|
+
"__#43320@#loadGlobalStyle"(): Promise<void>;
|
|
6652
|
+
"__#43320@#fetchTenantTheme"(): Promise<Record<string, any>>;
|
|
6653
|
+
readonly "__#43320@#tenantThemeResource": Promise<Record<string, any>>;
|
|
6654
|
+
"__#43320@#loadTenantStyle"(): Promise<void>;
|
|
6655
|
+
"__#43320@#loadCustomStyle"(): Promise<void>;
|
|
6656
|
+
"__#43320@#loadComponentsStyle"(): Promise<void>;
|
|
6657
|
+
"__#43320@#getFontsConfig"(): Promise<Record<string, {
|
|
6657
6658
|
url?: string;
|
|
6658
6659
|
}>>;
|
|
6659
|
-
"__#
|
|
6660
|
-
"__#
|
|
6661
|
-
"__#
|
|
6662
|
-
"__#
|
|
6663
|
-
"__#
|
|
6664
|
-
"__#
|
|
6665
|
-
"__#
|
|
6660
|
+
"__#43320@#loadFonts"(): Promise<void>;
|
|
6661
|
+
"__#43320@#loadTenantFonts"(): Promise<void>;
|
|
6662
|
+
"__#43320@#applyTheme"(): Promise<void>;
|
|
6663
|
+
"__#43320@#onThemeChange": () => void;
|
|
6664
|
+
"__#43320@#loadTheme"(): void;
|
|
6665
|
+
"__#43320@#toggleOsThemeChangeListener": (listen: boolean) => void;
|
|
6666
|
+
"__#43311@#debuggerEle": HTMLElement & {
|
|
6666
6667
|
updateData: (data: {
|
|
6667
6668
|
title: string;
|
|
6668
6669
|
description?: string;
|
|
@@ -6671,11 +6672,11 @@ declare const RoleManagementWidget: {
|
|
|
6671
6672
|
description?: string;
|
|
6672
6673
|
}[]) => void;
|
|
6673
6674
|
};
|
|
6674
|
-
"__#
|
|
6675
|
-
"__#
|
|
6675
|
+
"__#43311@#disableDebugger"(): void;
|
|
6676
|
+
"__#43311@#enableDebugger"(): Promise<void>;
|
|
6676
6677
|
readonly debug: boolean;
|
|
6677
|
-
"__#
|
|
6678
|
-
"__#
|
|
6678
|
+
"__#43311@#handleDebugMode"(): void;
|
|
6679
|
+
"__#43311@#updateDebuggerMessages"(title: string, description: string): void;
|
|
6679
6680
|
};
|
|
6680
6681
|
};
|
|
6681
6682
|
|