@descope/role-management-widget 0.9.10 → 0.9.12
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 +84 -83
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* @descope/role-management-widget v0.9.
|
|
3
|
+
* @descope/role-management-widget v0.9.12
|
|
4
4
|
*/
|
|
5
|
-
import{pluralize as e,createSingletonMixin as t,compose as i,createTemplate as o,withMemCache as s,debounce as n}from"@descope/sdk-helpers";import{__awaiter as l,__classPrivateFieldGet as a,__classPrivateFieldSet as r,__rest as d}from"tslib";import{projectIdMixin as c,observeAttributesMixin as u,loggerMixin as h,baseUrlMixin as g,cookieConfigMixin as v,createValidateAttributesMixin as m,createStateManagementMixin as p,initLifecycleMixin as f,descopeUiMixin as R,initElementMixin as y,createFetchWidgetPagesMixin as w,modalMixin as b,formMixin as M,notificationsMixin as C,debuggerMixin as W,themeMixin as k}from"@descope/sdk-mixins";import{ButtonDriver as x,MultiSelectDriver as S,TextDriver as j,TextFieldDriver as F,GridDriver as P}from"@descope/sdk-component-drivers";import{createSelector as O}from"reselect";import{createAsyncThunk as L}from"@reduxjs/toolkit";import N from"@descope/web-js-sdk";const I=e=>e.selectedRolesIds,B=e=>e.notifications,$=e=>e.tenantPermissions.data||[],q=O((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"})})))),D=O(I,q,((e,t)=>t.filter((t=>e.includes(t.name))))),T=O(I,(e=>!!e.length)),E=O(I,(e=>1===e.length)),H=O(D,E,((e,t)=>t&&"yes"===e[0].editable)),A=O(D,(e=>1===e.length?e[0].name:`${e.length} roles`)),Z=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)}))}))},V=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}}),U=({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)})}}),z=L("roles/create",((e,{extra:{api:t}})=>t.role.create(e))),J=Z(z)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},V((e=>e.createRole)),U({getSuccessMsg:()=>"Role created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create role</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),G={action:z,reducer:J},K=L("roles/delete",((e,{extra:{api:t}})=>t.role.deleteBatch(e))),Q=Z(K)({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=[]}},V((e=>e.deleteRole)),U({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["R","r"]}ole${["","s"]} deleted successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to delete role${["","s"]}`})),X={action:K,reducer:Q},Y=L("roles/duplicate",((e,{extra:{api:t}})=>t.role.create(e))),_=Z(Y)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},V((e=>e.duplicateRole)),U({getSuccessMsg:()=>"Role duplicated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to duplicate role</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),ee={action:Y,reducer:_},te=L("roles/search",((e,{extra:{api:t},getState:i})=>{const o=i().searchParams;return t.role.search(Object.assign(Object.assign({},o),e))})),ie=Z(te)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.rolesList.data=t.payload}},V((e=>e.rolesList))),oe={action:te,reducer:ie},se=L("roles/update",((e,{extra:{api:t}})=>t.role.update(e))),ne=Z(se)({onFulfilled:(e,t)=>{const i=e.rolesList.data.findIndex((e=>e.name===t.payload.oldName));-1!==i&&(e.rolesList.data[i]=t.payload)}},V((e=>e.updateRole)),U({getSuccessMsg:()=>"Role updated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to update role</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),le={action:se,reducer:ne},ae=L("tenant/getTenantPermissions",((e,{extra:{api:t}})=>t.tenant.getTenantPermissions())),re={action:ae,reducer:Z(ae)({onFulfilled:(e,t)=>{e.tenantPermissions.data=t.payload.permissions}},V((e=>e.tenantPermissions)))},de={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:[]},ce={search:"/v1/mgmt/role/search",deleteBatch:"/v1/mgmt/role/delete/batch",create:"/v1/mgmt/role/create",update:"/v1/mgmt/role/update"},ue={permissions:"/v1/mgmt/permission/all"},he=e=>l(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)})),ge=(e,t)=>l(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()))))}))})),ve=(e,t)=>l(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})}))})),me=(e,t)=>l(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})}))})),pe=()=>l(void 0,void 0,void 0,(function*(){})),fe=()=>new Promise((e=>{const t=[];for(let e=1;e<5;e+=1)t.push({name:`Permission ${e}`});e({permissions:t})})),Re=({httpClient:e,tenant:t,mock:i})=>({search:(...o)=>l(void 0,[...o],void 0,(function*({page:o,limit:s=1e4,text:n,sort:l}={}){if(i)return ge({page:o,limit:s,text:n,sort:l},t);const a=yield e.post(ce.search,{limit:s,page:o,text:n,sort:l},{queryParams:{tenant:t}});yield he(a);return(yield a.json()).roles})),deleteBatch:o=>l(void 0,void 0,void 0,(function*(){if(i)return pe();const s=yield e.post(ce.deleteBatch,{roleNames:o},{queryParams:{tenant:t}});return yield he(s),s.json()})),create:o=>l(void 0,[o],void 0,(function*({name:o,description:s,permissionNames:n}){if(i)return ve({name:o,description:s,permissionNames:n},t);const l=yield e.post(ce.create,{name:o,description:s,permissionNames:n,tenantId:t},{queryParams:{tenant:t}});yield he(l);return yield l.json()})),update:o=>l(void 0,[o],void 0,(function*({name:o,newName:s,description:n,permissionNames:l}){if(i)return me({name:o,newName:s,description:n,permissionNames:l},t);const a=yield e.post(ce.update,{name:o,newName:s,description:n,permissionNames:l,tenantId:t},{queryParams:{tenant:t}});yield he(a);const r=yield a.json();return r.oldName=o,r}))}),ye=({httpClient:e,tenant:t,mock:i})=>({getTenantPermissions:()=>l(void 0,void 0,void 0,(function*(){if(i)return fe();const o=yield e.get(ue.permissions,{queryParams:{tenant:t}});return yield he(o),o.json()}))}),we=t((e=>{var t,o,s,n;const d=i(c,u,h,g,v,m({tenant:m.missingAttrValidator}))(e);return n=class extends d{constructor(){super(...arguments),t.add(this),o.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 a(this,o,"f")||a(this,t,"m",s).call(this),a(this,o,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.init)||void 0===i?void 0:i.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{a(this,o,"f")&&a(this,t,"m",s).call(this)}))}))}},o=new WeakMap,t=new WeakSet,s=function(){this.logger.debug("creating an sdk instance"),r(this,o,((e,t,i,o)=>{const s=N(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.9.10"}}));return{role:Re({httpClient:s.httpClient,tenant:t,mock:i}),tenant:ye({httpClient:s.httpClient,tenant:t,mock:i})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},n})),be=t((e=>{const t=i(p({name:"widget",initialState:de,reducers:{setSelectedRolesIds:(e,{payload:t})=>{e.selectedRolesIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{G.reducer(e),ee.reducer(e),le.reducer(e),X.reducer(e),oe.reducer(e),re.reducer(e)},asyncActions:{searchRoles:oe.action,createRole:G.action,duplicateRole:ee.action,updateRole:le.action,deleteRoles:X.action,getTenantPermissions:re.action}}),f,h,we)(e);return class extends t{constructor(...e){super(...e),this.state=de,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),Me=t((e=>{var t,s,n;return n=class extends(i(h,f,R,y,w("role-management-widget"),be)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return l(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.init)||void 0===i?void 0:i.call(this),yield Promise.all([a(this,t,"m",s).call(this),this.actions.searchRoles(),this.actions.getTenantPermissions()]),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},t=new WeakSet,s=function(){return l(this,void 0,void 0,(function*(){const e=o(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},n})),Ce=t((e=>{var t,s,n,d,c,u,g;return g=class extends(i(be,b,M,h,Me)(e)){constructor(){super(...arguments),t.add(this),s.set(this,void 0),n.set(this,"create"),d.set(this,null),u.set(this,(()=>l(this,void 0,void 0,(function*(){var e;yield a(this,s,"f").setData(null===(e=$(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))}))))}openRoleModal(e="create",t){r(this,n,e,"f"),r(this,d,null!=t?t:null,"f"),this.roleFormModal.open()}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",c).call(this)}))}},s=new WeakMap,n=new WeakMap,d=new WeakMap,u=new WeakMap,t=new WeakSet,c=function(){return l(this,void 0,void 0,(function*(){this.roleFormModal=this.createModal(),this.roleFormModal.setContent(o(yield this.fetchWidgetPage("create-role-modal.html")));new x((()=>{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 x((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>l(this,void 0,void 0,(function*(){if(this.validateForm(this.roleFormModal.ele)){const e=this.getFormData(this.roleFormModal.ele);"duplicate"===a(this,n,"f")?this.actions.duplicateRole(Object.assign({},e)):this.actions.createRole(Object.assign({},e)),this.roleFormModal.close(),this.resetFormData(this.roleFormModal.ele)}})))),r(this,s,new S((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="permissions-multiselect"]')}),{logger:this.logger}),"f"),a(this,u,"f").call(this),this.roleFormModal.beforeOpen=()=>l(this,void 0,void 0,(function*(){yield a(this,u,"f").call(this),a(this,d,"f")&&(this.setFormData(this.roleFormModal.ele,a(this,d,"f")),r(this,d,null,"f"))}))}))},g})),We=t((e=>{var t,o,s;return s=class extends(i(h,Ce,Me)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){var e;this.createButton=new x(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-role"]'),{logger:this.logger}),this.createButton.onClick((()=>this.openRoleModal()))},s})),ke=t((e=>{var t,s,n;return n=class extends(i(be,b,h,Me)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield a(this,t,"m",s).call(this)}))}},t=new WeakSet,s=function(){return l(this,void 0,void 0,(function*(){var e;this.deleteRolesModal=this.createModal(),this.deleteRolesModal.setContent(o(yield this.fetchWidgetPage("delete-roles-modal.html")));const t=new x((()=>{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 x((()=>{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=D(this.state);this.actions.deleteRoles(null==e?void 0:e.map((e=>e.name))),this.deleteRolesModal.close()}));const s=new j(null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteRolesModal.beforeOpen=()=>{const e=A(this.state);s.text=`Delete ${e}?`}}))},n})),xe=t((e=>{var t,o,n,r;return r=class extends(i(h,Me,be,ke)(e)){constructor(){super(...arguments),t.add(this),n.set(this,s((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this),this.subscribe(a(this,n,"f").bind(this),T)}))}},n=new WeakMap,t=new WeakSet,o=function(){var e;this.deleteButton=new x(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()}))},r})),Se=t((e=>{var t,o,n,r;return r=class extends(i(h,Me,be,Ce)(e)){constructor(){super(...arguments),t.add(this),n.set(this,s((e=>{e?this.duplicateButton.enable():this.duplicateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this),this.subscribe(a(this,n,"f").bind(this),E)}))}},n=new WeakMap,t=new WeakSet,o=function(){var e;this.duplicateButton=new x(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=D(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:[]})}))},r})),je=t((e=>{var t,s,n,c,u,g,v,m;return m=class extends(i(be,b,h,M,Me)(e)){constructor(){super(...arguments),t.add(this),s.set(this,void 0),u.set(this,(()=>l(this,void 0,void 0,(function*(){var e;yield a(this,s,"f").setData(null===(e=$(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))})))),g.set(this,(()=>{var e;const t=null===(e=D(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 l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield a(this,t,"m",v).call(this)}))}},s=new WeakMap,u=new WeakMap,g=new WeakMap,t=new WeakSet,n=function(){new x((()=>{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()))},c=function(){new x((()=>{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=d(t,["name"]),s=null===(e=D(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 l(this,void 0,void 0,(function*(){this.editRoleModal=this.createModal(),this.editRoleModal.setContent(o(yield this.fetchWidgetPage("edit-role-modal.html"))),a(this,t,"m",n).call(this),a(this,t,"m",c).call(this),r(this,s,new S((()=>{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=()=>l(this,void 0,void 0,(function*(){yield a(this,u,"f").call(this),a(this,g,"f").call(this)}))}))},m})),Fe=t((e=>{var t,o,n,r;return r=class extends(i(h,Me,be,je,M)(e)){constructor(){super(...arguments),t.add(this),n.set(this,s((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this),this.subscribe(a(this,n,"f").bind(this),H)}))}},n=new WeakMap,t=new WeakSet,o=function(){var e;this.editButton=new x(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()}))},r})),Pe=t((e=>{var t,o,s,r;return r=class extends(i(h,Me,be)(e)){constructor(){super(...arguments),t.add(this),o.set(this,n((()=>{this.actions.searchRoles({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",s).call(this)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.searchInput=new F(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(a(this,o,"f"))},r}));const Oe={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},Le=t((e=>{var t,o,n,r,d;return d=class extends(i(h,be,C,f)(e)){constructor(){super(...arguments),t.add(this),r.set(this,s((e=>{e.length&&(e.forEach((({type:e,msg:i})=>{const s=a(this,t,"m",n).call(this,e);s.setContent(a(this,t,"m",o).call(this,{type:e,msg:i})),s.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return l(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(a(this,r,"f").bind(this),B)}))}},r=new WeakMap,t=new WeakSet,o=function({type:e,msg:t}){const i=Oe[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}`},n=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},d})),Ne=t((e=>{var t,o,r,d,c;return c=class extends(i(be,h,Me)(e)){constructor(){super(...arguments),t.add(this),r.set(this,s((e=>{this.rolesTable.data=e}))),d.set(this,n(((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 l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this),this.rolesTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{a(this,d,"f").call(this,e.target,e.detail)}))})),a(this,r,"f").call(this,q(this.state)),this.subscribe(a(this,r,"f").bind(this),q)}))}},r=new WeakMap,d=new WeakMap,t=new WeakSet,o=function(){var e;this.rolesTable=new P(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})),Ie=t((e=>class extends(i(W,k,Ne,We,xe,Se,Fe,Pe,Le)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return l(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),Be=i((e=>class extends(Ie(e)){}))(HTMLElement);customElements.define("descope-role-management-widget",Be);export{Be as default};
|
|
5
|
+
import{pluralize as e,createSingletonMixin as t,compose as i,createTemplate as o,withMemCache as s,debounce as n}from"@descope/sdk-helpers";import{__awaiter as l,__classPrivateFieldGet as a,__classPrivateFieldSet as r,__rest as d}from"tslib";import{projectIdMixin as c,observeAttributesMixin as u,loggerMixin as h,baseUrlMixin as g,cookieConfigMixin as v,createValidateAttributesMixin as m,createStateManagementMixin as p,initLifecycleMixin as f,descopeUiMixin as R,initElementMixin as y,createFetchWidgetPagesMixin as w,modalMixin as b,formMixin as M,notificationsMixin as C,debuggerMixin as W,themeMixin as k}from"@descope/sdk-mixins";import{ButtonDriver as x,MultiSelectDriver as S,TextDriver as j,TextFieldDriver as F,GridDriver as P}from"@descope/sdk-component-drivers";import{createSelector as O}from"reselect";import{createAsyncThunk as L}from"@reduxjs/toolkit";import N from"@descope/web-js-sdk";const I=e=>e.selectedRolesIds,B=e=>e.notifications,$=e=>e.tenantPermissions.data||[],q=O((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"})})))),D=O(I,q,((e,t)=>t.filter((t=>e.includes(t.name))))),T=O(I,(e=>!!e.length)),E=O(I,(e=>1===e.length)),H=O(D,E,((e,t)=>t&&"yes"===e[0].editable)),A=O(D,(e=>1===e.length?e[0].name:`${e.length} roles`)),Z=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)}))}))},V=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}}),U=({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)})}}),z=L("roles/create",((e,{extra:{api:t}})=>t.role.create(e))),J=Z(z)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},V((e=>e.createRole)),U({getSuccessMsg:()=>"Role created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create role</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),G={action:z,reducer:J},K=L("roles/delete",((e,{extra:{api:t}})=>t.role.deleteBatch(e))),Q=Z(K)({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=[]}},V((e=>e.deleteRole)),U({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["R","r"]}ole${["","s"]} deleted successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to delete role${["","s"]}`})),X={action:K,reducer:Q},Y=L("roles/duplicate",((e,{extra:{api:t}})=>t.role.create(e))),_=Z(Y)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},V((e=>e.duplicateRole)),U({getSuccessMsg:()=>"Role duplicated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to duplicate role</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),ee={action:Y,reducer:_},te=L("roles/search",((e,{extra:{api:t},getState:i})=>{const o=i().searchParams;return t.role.search(Object.assign(Object.assign({},o),e))})),ie=Z(te)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.rolesList.data=t.payload}},V((e=>e.rolesList))),oe={action:te,reducer:ie},se=L("roles/update",((e,{extra:{api:t}})=>t.role.update(e))),ne=Z(se)({onFulfilled:(e,t)=>{const i=e.rolesList.data.findIndex((e=>e.name===t.payload.oldName));-1!==i&&(e.rolesList.data[i]=t.payload)}},V((e=>e.updateRole)),U({getSuccessMsg:()=>"Role updated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to update role</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),le={action:se,reducer:ne},ae=L("tenant/getTenantPermissions",((e,{extra:{api:t}})=>t.tenant.getTenantPermissions())),re={action:ae,reducer:Z(ae)({onFulfilled:(e,t)=>{e.tenantPermissions.data=t.payload.permissions}},V((e=>e.tenantPermissions)))},de={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:[]},ce={search:"/v1/mgmt/role/search",deleteBatch:"/v1/mgmt/role/delete/batch",create:"/v1/mgmt/role/create",update:"/v1/mgmt/role/update"},ue={permissions:"/v1/mgmt/permission/all"},he=e=>l(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)})),ge=(e,t)=>l(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()))))}))})),ve=(e,t)=>l(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})}))})),me=(e,t)=>l(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})}))})),pe=()=>l(void 0,void 0,void 0,(function*(){})),fe=()=>new Promise((e=>{const t=[];for(let e=1;e<5;e+=1)t.push({name:`Permission ${e}`});e({permissions:t})})),Re=({httpClient:e,tenant:t,mock:i})=>({search:(...o)=>l(void 0,[...o],void 0,(function*({page:o,limit:s=1e4,text:n,sort:l}={}){if(i)return ge({page:o,limit:s,text:n,sort:l},t);const a=yield e.post(ce.search,{limit:s,page:o,text:n,sort:l},{queryParams:{tenant:t}});yield he(a);return(yield a.json()).roles})),deleteBatch:o=>l(void 0,void 0,void 0,(function*(){if(i)return pe();const s=yield e.post(ce.deleteBatch,{roleNames:o},{queryParams:{tenant:t}});return yield he(s),s.json()})),create:o=>l(void 0,[o],void 0,(function*({name:o,description:s,permissionNames:n}){if(i)return ve({name:o,description:s,permissionNames:n},t);const l=yield e.post(ce.create,{name:o,description:s,permissionNames:n,tenantId:t},{queryParams:{tenant:t}});yield he(l);return yield l.json()})),update:o=>l(void 0,[o],void 0,(function*({name:o,newName:s,description:n,permissionNames:l}){if(i)return me({name:o,newName:s,description:n,permissionNames:l},t);const a=yield e.post(ce.update,{name:o,newName:s,description:n,permissionNames:l,tenantId:t},{queryParams:{tenant:t}});yield he(a);const r=yield a.json();return r.oldName=o,r}))}),ye=({httpClient:e,tenant:t,mock:i})=>({getTenantPermissions:()=>l(void 0,void 0,void 0,(function*(){if(i)return fe();const o=yield e.get(ue.permissions,{queryParams:{tenant:t}});return yield he(o),o.json()}))}),we=t((e=>{var t,o,s,n;const d=i(c,u,h,g,v,m({tenant:m.missingAttrValidator}))(e);return n=class extends d{constructor(){super(...arguments),t.add(this),o.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 a(this,o,"f")||a(this,t,"m",s).call(this),a(this,o,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.init)||void 0===i?void 0:i.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{a(this,o,"f")&&a(this,t,"m",s).call(this)}))}))}},o=new WeakMap,t=new WeakSet,s=function(){this.logger.debug("creating an sdk instance"),r(this,o,((e,t,i,o)=>{const s=N(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.9.12"}}));return{role:Re({httpClient:s.httpClient,tenant:t,mock:i}),tenant:ye({httpClient:s.httpClient,tenant:t,mock:i})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},n})),be=t((e=>{const t=i(p({name:"widget",initialState:de,reducers:{setSelectedRolesIds:(e,{payload:t})=>{e.selectedRolesIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{G.reducer(e),ee.reducer(e),le.reducer(e),X.reducer(e),oe.reducer(e),re.reducer(e)},asyncActions:{searchRoles:oe.action,createRole:G.action,duplicateRole:ee.action,updateRole:le.action,deleteRoles:X.action,getTenantPermissions:re.action}}),f,h,we)(e);return class extends t{constructor(...e){super(...e),this.state=de,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),Me=t((e=>{var t,s,n;return n=class extends(i(h,f,R,y,w("role-management-widget"),be)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return l(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.init)||void 0===i?void 0:i.call(this),yield Promise.all([a(this,t,"m",s).call(this),this.actions.searchRoles(),this.actions.getTenantPermissions()]),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},t=new WeakSet,s=function(){return l(this,void 0,void 0,(function*(){const e=o(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},n})),Ce=t((e=>{var t,s,n,d,c,u,g;return g=class extends(i(be,b,M,h,Me)(e)){constructor(){super(...arguments),t.add(this),s.set(this,void 0),n.set(this,"create"),d.set(this,null),u.set(this,(()=>l(this,void 0,void 0,(function*(){var e;yield a(this,s,"f").setData(null===(e=$(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))}))))}openRoleModal(e="create",t){r(this,n,e,"f"),r(this,d,null!=t?t:null,"f"),this.roleFormModal.open()}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",c).call(this)}))}},s=new WeakMap,n=new WeakMap,d=new WeakMap,u=new WeakMap,t=new WeakSet,c=function(){return l(this,void 0,void 0,(function*(){this.roleFormModal=this.createModal(),this.roleFormModal.setContent(o(yield this.fetchWidgetPage("create-role-modal.html")));new x((()=>{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 x((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>l(this,void 0,void 0,(function*(){if(this.validateForm(this.roleFormModal.ele)){const e=this.getFormData(this.roleFormModal.ele);"duplicate"===a(this,n,"f")?this.actions.duplicateRole(Object.assign({},e)):this.actions.createRole(Object.assign({},e)),this.roleFormModal.close(),this.resetFormData(this.roleFormModal.ele)}})))),r(this,s,new S((()=>{var e;return null===(e=this.roleFormModal.ele)||void 0===e?void 0:e.querySelector('[data-id="permissions-multiselect"]')}),{logger:this.logger}),"f"),a(this,u,"f").call(this),this.roleFormModal.beforeOpen=()=>l(this,void 0,void 0,(function*(){yield a(this,u,"f").call(this),a(this,d,"f")&&(this.setFormData(this.roleFormModal.ele,a(this,d,"f")),r(this,d,null,"f"))}))}))},g})),We=t((e=>{var t,o,s;return s=class extends(i(h,Ce,Me)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){var e;this.createButton=new x(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-role"]'),{logger:this.logger}),this.createButton.onClick((()=>this.openRoleModal()))},s})),ke=t((e=>{var t,s,n;return n=class extends(i(be,b,h,Me)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield a(this,t,"m",s).call(this)}))}},t=new WeakSet,s=function(){return l(this,void 0,void 0,(function*(){var e;this.deleteRolesModal=this.createModal(),this.deleteRolesModal.setContent(o(yield this.fetchWidgetPage("delete-roles-modal.html")));const t=new x((()=>{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 x((()=>{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=D(this.state);this.actions.deleteRoles(null==e?void 0:e.map((e=>e.name))),this.deleteRolesModal.close()}));const s=new j(null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteRolesModal.beforeOpen=()=>{const e=A(this.state);s.text=`Delete ${e}?`}}))},n})),xe=t((e=>{var t,o,n,r;return r=class extends(i(h,Me,be,ke)(e)){constructor(){super(...arguments),t.add(this),n.set(this,s((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this),this.subscribe(a(this,n,"f").bind(this),T)}))}},n=new WeakMap,t=new WeakSet,o=function(){var e;this.deleteButton=new x(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()}))},r})),Se=t((e=>{var t,o,n,r;return r=class extends(i(h,Me,be,Ce)(e)){constructor(){super(...arguments),t.add(this),n.set(this,s((e=>{e?this.duplicateButton.enable():this.duplicateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this),this.subscribe(a(this,n,"f").bind(this),E)}))}},n=new WeakMap,t=new WeakSet,o=function(){var e;this.duplicateButton=new x(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=D(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:[]})}))},r})),je=t((e=>{var t,s,n,c,u,g,v,m;return m=class extends(i(be,b,h,M,Me)(e)){constructor(){super(...arguments),t.add(this),s.set(this,void 0),u.set(this,(()=>l(this,void 0,void 0,(function*(){var e;yield a(this,s,"f").setData(null===(e=$(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))})))),g.set(this,(()=>{var e;const t=null===(e=D(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 l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield a(this,t,"m",v).call(this)}))}},s=new WeakMap,u=new WeakMap,g=new WeakMap,t=new WeakSet,n=function(){new x((()=>{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()))},c=function(){new x((()=>{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=d(t,["name"]),s=null===(e=D(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 l(this,void 0,void 0,(function*(){this.editRoleModal=this.createModal(),this.editRoleModal.setContent(o(yield this.fetchWidgetPage("edit-role-modal.html"))),a(this,t,"m",n).call(this),a(this,t,"m",c).call(this),r(this,s,new S((()=>{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=()=>l(this,void 0,void 0,(function*(){yield a(this,u,"f").call(this),a(this,g,"f").call(this)}))}))},m})),Fe=t((e=>{var t,o,n,r;return r=class extends(i(h,Me,be,je,M)(e)){constructor(){super(...arguments),t.add(this),n.set(this,s((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this),this.subscribe(a(this,n,"f").bind(this),H)}))}},n=new WeakMap,t=new WeakSet,o=function(){var e;this.editButton=new x(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()}))},r})),Pe=t((e=>{var t,o,s,r;return r=class extends(i(h,Me,be)(e)){constructor(){super(...arguments),t.add(this),o.set(this,n((()=>{this.actions.searchRoles({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",s).call(this)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.searchInput=new F(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(a(this,o,"f"))},r}));const Oe={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},Le=t((e=>{var t,o,n,r,d;return d=class extends(i(h,be,C,f)(e)){constructor(){super(...arguments),t.add(this),r.set(this,s((e=>{e.length&&(e.forEach((({type:e,msg:i})=>{const s=a(this,t,"m",n).call(this,e);s.setContent(a(this,t,"m",o).call(this,{type:e,msg:i})),s.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return l(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(a(this,r,"f").bind(this),B)}))}},r=new WeakMap,t=new WeakSet,o=function({type:e,msg:t}){const i=Oe[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}`},n=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},d})),Ne=t((e=>{var t,o,r,d,c;return c=class extends(i(be,h,Me)(e)){constructor(){super(...arguments),t.add(this),r.set(this,s((e=>{this.rolesTable.data=e}))),d.set(this,n(((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 l(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),a(this,t,"m",o).call(this),this.rolesTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{a(this,d,"f").call(this,e.target,e.detail)}))})),a(this,r,"f").call(this,q(this.state)),this.subscribe(a(this,r,"f").bind(this),q)}))}},r=new WeakMap,d=new WeakMap,t=new WeakSet,o=function(){var e;this.rolesTable=new P(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})),Ie=t((e=>class extends(i(W,k,Ne,We,xe,Se,Fe,Pe,Le)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return l(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),Be=i((e=>class extends(Ie(e)){}))(HTMLElement);customElements.define("descope-role-management-widget",Be);export{Be as default};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -83,17 +83,17 @@ type RoleFormData = {
|
|
|
83
83
|
declare const RoleManagementWidget: {
|
|
84
84
|
new (...params: any[]): {
|
|
85
85
|
init(): Promise<void>;
|
|
86
|
-
"__#
|
|
86
|
+
"__#16@#createNotificationContent"({ type, msg }: {
|
|
87
87
|
type: "success" | "error";
|
|
88
88
|
msg: string;
|
|
89
89
|
}): string;
|
|
90
|
-
"__#
|
|
90
|
+
"__#16@#createNotification"(type: "success" | "error"): {
|
|
91
91
|
setContent(templateOrString: string | HTMLTemplateElement): void;
|
|
92
92
|
nodeName: string;
|
|
93
93
|
close(): void;
|
|
94
94
|
show(): void;
|
|
95
95
|
remove(): void;
|
|
96
|
-
"__#
|
|
96
|
+
"__#41282@#private": any;
|
|
97
97
|
logger: {
|
|
98
98
|
error(...data: any[]): void;
|
|
99
99
|
warn(...data: any[]): void;
|
|
@@ -104,11 +104,11 @@ declare const RoleManagementWidget: {
|
|
|
104
104
|
readonly ele: Element;
|
|
105
105
|
readonly isExists: boolean;
|
|
106
106
|
};
|
|
107
|
-
"__#
|
|
107
|
+
"__#16@#onNotificationsUpdate": (notifications: {
|
|
108
108
|
type: "success" | "error";
|
|
109
109
|
msg: string;
|
|
110
110
|
}[]) => void;
|
|
111
|
-
"__#
|
|
111
|
+
"__#41272@#isInit": boolean;
|
|
112
112
|
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);
|
|
113
113
|
accessKey: string;
|
|
114
114
|
readonly accessKeyLabel: string;
|
|
@@ -239,6 +239,7 @@ declare const RoleManagementWidget: {
|
|
|
239
239
|
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
240
240
|
};
|
|
241
241
|
attributeChangedCallback: ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void);
|
|
242
|
+
disconnectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
242
243
|
readonly attributes: NamedNodeMap;
|
|
243
244
|
readonly classList: DOMTokenList;
|
|
244
245
|
className: string;
|
|
@@ -1143,7 +1144,7 @@ declare const RoleManagementWidget: {
|
|
|
1143
1144
|
tabIndex: number;
|
|
1144
1145
|
blur: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1145
1146
|
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);
|
|
1146
|
-
"__#
|
|
1147
|
+
"__#41287@#NotificationDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
|
|
1147
1148
|
logger: {
|
|
1148
1149
|
error(...data: any[]): void;
|
|
1149
1150
|
warn(...data: any[]): void;
|
|
@@ -1156,7 +1157,7 @@ declare const RoleManagementWidget: {
|
|
|
1156
1157
|
close(): void;
|
|
1157
1158
|
show(): void;
|
|
1158
1159
|
remove(): void;
|
|
1159
|
-
"__#
|
|
1160
|
+
"__#41282@#private": any;
|
|
1160
1161
|
logger: {
|
|
1161
1162
|
error(...data: any[]): void;
|
|
1162
1163
|
warn(...data: any[]): void;
|
|
@@ -1182,7 +1183,7 @@ declare const RoleManagementWidget: {
|
|
|
1182
1183
|
close(): void;
|
|
1183
1184
|
show(): void;
|
|
1184
1185
|
remove(): void;
|
|
1185
|
-
"__#
|
|
1186
|
+
"__#41282@#private": any;
|
|
1186
1187
|
logger: {
|
|
1187
1188
|
error(...data: any[]): void;
|
|
1188
1189
|
warn(...data: any[]): void;
|
|
@@ -1193,12 +1194,12 @@ declare const RoleManagementWidget: {
|
|
|
1193
1194
|
readonly ele: Element;
|
|
1194
1195
|
readonly isExists: boolean;
|
|
1195
1196
|
};
|
|
1196
|
-
"__#
|
|
1197
|
-
"__#
|
|
1198
|
-
"__#
|
|
1197
|
+
"__#41281@#getComponentsVersion": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
|
|
1198
|
+
"__#41281@#getComponentsVersionSri": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
|
|
1199
|
+
"__#41281@#descopeUi": Promise<any>;
|
|
1199
1200
|
readonly descopeUi: Promise<any>;
|
|
1200
|
-
"__#
|
|
1201
|
-
"__#
|
|
1201
|
+
"__#41281@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
|
|
1202
|
+
"__#41281@#getDescopeUi": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
|
|
1202
1203
|
loadDescopeUiComponents: ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>);
|
|
1203
1204
|
readonly baseCdnUrl: string;
|
|
1204
1205
|
injectNpmLib: ((libName: string, version: string, filePath?: string, overrides?: string[], integrity?: string) => Promise<{
|
|
@@ -1218,25 +1219,25 @@ declare const RoleManagementWidget: {
|
|
|
1218
1219
|
url: URL;
|
|
1219
1220
|
integrity?: string;
|
|
1220
1221
|
}>);
|
|
1221
|
-
"__#
|
|
1222
|
-
"__#
|
|
1222
|
+
"__#41271@#logger": _descope_sdk_mixins.Logger;
|
|
1223
|
+
"__#41271@#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);
|
|
1223
1224
|
logger: _descope_sdk_mixins.Logger;
|
|
1224
1225
|
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", args: any[]) => void);
|
|
1225
1226
|
readonly config: Promise<_descope_sdk_mixins.Config>;
|
|
1226
|
-
"__#
|
|
1227
|
-
"__#
|
|
1228
|
-
"__#
|
|
1229
|
-
"__#
|
|
1227
|
+
"__#41277@#configCacheClear": (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1228
|
+
"__#41277@#_configResource": Promise<_descope_sdk_mixins.Config>;
|
|
1229
|
+
"__#41277@#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>);
|
|
1230
|
+
"__#41276@#callbacks": Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void>;
|
|
1230
1231
|
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);
|
|
1231
1232
|
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>);
|
|
1232
|
-
"__#
|
|
1233
|
-
"__#
|
|
1233
|
+
"__#41274@#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);
|
|
1234
|
+
"__#41273@#observeMappings": {};
|
|
1234
1235
|
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);
|
|
1235
1236
|
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);
|
|
1236
|
-
"__#
|
|
1237
|
-
"__#
|
|
1238
|
-
"__#
|
|
1239
|
-
"__#
|
|
1237
|
+
"__#41275@#lastBaseUrl"?: string;
|
|
1238
|
+
"__#41275@#workingBaseUrl"?: string;
|
|
1239
|
+
"__#41275@#failedUrls": Set<string>;
|
|
1240
|
+
"__#41275@#getResourceUrls": ((filename: string) => (URL & {
|
|
1240
1241
|
baseUrl: string;
|
|
1241
1242
|
}) | (URL & {
|
|
1242
1243
|
baseUrl: string;
|
|
@@ -1269,7 +1270,7 @@ declare const RoleManagementWidget: {
|
|
|
1269
1270
|
}) | (URL & {
|
|
1270
1271
|
baseUrl: string;
|
|
1271
1272
|
})[]);
|
|
1272
|
-
"__#
|
|
1273
|
+
"__#41275@#createResourceUrl": ((filename: string, baseUrl: string) => URL & {
|
|
1273
1274
|
baseUrl: string;
|
|
1274
1275
|
}) & ((filename: string, baseUrl: string) => URL & {
|
|
1275
1276
|
baseUrl: string;
|
|
@@ -1352,9 +1353,9 @@ declare const RoleManagementWidget: {
|
|
|
1352
1353
|
replaceSync(cssString: string): void;
|
|
1353
1354
|
readonly cssRules: CSSRuleList;
|
|
1354
1355
|
});
|
|
1355
|
-
"__#
|
|
1356
|
+
"__#41278@#setNonce": (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1356
1357
|
state: State;
|
|
1357
|
-
"__#
|
|
1358
|
+
"__#6@#api": {
|
|
1358
1359
|
role: {
|
|
1359
1360
|
search: (config: SearchRolesConfig) => Promise<Role[]>;
|
|
1360
1361
|
deleteBatch: (roleNames: string[]) => Promise<any>;
|
|
@@ -1367,7 +1368,7 @@ declare const RoleManagementWidget: {
|
|
|
1367
1368
|
}>;
|
|
1368
1369
|
};
|
|
1369
1370
|
};
|
|
1370
|
-
"__#
|
|
1371
|
+
"__#6@#createSdk": (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1371
1372
|
readonly tenantId: string;
|
|
1372
1373
|
readonly widgetId: string;
|
|
1373
1374
|
readonly mock: string;
|
|
@@ -6335,19 +6336,19 @@ declare const RoleManagementWidget: {
|
|
|
6335
6336
|
}[];
|
|
6336
6337
|
}) => SelectorR) => redux.Unsubscribe;
|
|
6337
6338
|
searchInput: _descope_sdk_component_drivers.TextFieldDriver;
|
|
6338
|
-
"__#
|
|
6339
|
-
"__#
|
|
6339
|
+
"__#15@#onInput": (this: any, ...args: any[]) => void;
|
|
6340
|
+
"__#15@#initSearchInput"(): void;
|
|
6340
6341
|
onWidgetRootReady: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
6341
|
-
"__#
|
|
6342
|
+
"__#7@#initWidgetRoot": (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
6342
6343
|
fetchWidgetPage(filename: string): Promise<string>;
|
|
6343
|
-
"__#
|
|
6344
|
+
"__#41289@#tryFetchLocalized"(filename: string): Promise<string>;
|
|
6344
6345
|
readonly locale: string;
|
|
6345
6346
|
readonly localeCandidates: string[];
|
|
6346
6347
|
firstAvailableLocale(availableLocales: string[]): string;
|
|
6347
6348
|
getWidgetConfig(): Promise<_descope_sdk_mixins.WidgetConfig>;
|
|
6348
6349
|
editButton: _descope_sdk_component_drivers.ButtonDriver;
|
|
6349
|
-
"__#
|
|
6350
|
-
"__#
|
|
6350
|
+
"__#14@#initEditButton"(): void;
|
|
6351
|
+
"__#14@#onIsRoleSelectedUpdate": (isEditable: boolean) => void;
|
|
6351
6352
|
validateForm(rootEle: Element): boolean;
|
|
6352
6353
|
getFormInputs(rootEle: Element): HTMLInputElement[];
|
|
6353
6354
|
getFormData(rootEle: Element): any;
|
|
@@ -6357,13 +6358,13 @@ declare const RoleManagementWidget: {
|
|
|
6357
6358
|
disableFormField(rootEle: Element, name: string): void;
|
|
6358
6359
|
removeFormField(rootEle: Element, name: string): void;
|
|
6359
6360
|
editRoleModal: _descope_sdk_component_drivers.ModalDriver;
|
|
6360
|
-
"__#
|
|
6361
|
-
"__#
|
|
6362
|
-
"__#
|
|
6363
|
-
"__#
|
|
6364
|
-
"__#
|
|
6365
|
-
"__#
|
|
6366
|
-
"__#
|
|
6361
|
+
"__#13@#permissionsMultiSelect": _descope_sdk_component_drivers.MultiSelectDriver;
|
|
6362
|
+
"__#13@#initCancelButton"(): void;
|
|
6363
|
+
"__#13@#initSubmitButton"(): void;
|
|
6364
|
+
"__#13@#updatePermissionsMultiSelect": () => Promise<void>;
|
|
6365
|
+
"__#13@#updateModalData": () => void;
|
|
6366
|
+
"__#13@#initEditRoleModal"(): Promise<void>;
|
|
6367
|
+
"__#41286@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
|
|
6367
6368
|
logger: {
|
|
6368
6369
|
error(...data: any[]): void;
|
|
6369
6370
|
warn(...data: any[]): void;
|
|
@@ -6372,7 +6373,7 @@ declare const RoleManagementWidget: {
|
|
|
6372
6373
|
};
|
|
6373
6374
|
}) => {
|
|
6374
6375
|
setContent(template: HTMLTemplateElement): void;
|
|
6375
|
-
"__#
|
|
6376
|
+
"__#41285@#private": any;
|
|
6376
6377
|
beforeOpen: () => void | Promise<void>;
|
|
6377
6378
|
afterClose: () => void;
|
|
6378
6379
|
nodeName: string;
|
|
@@ -6382,7 +6383,7 @@ declare const RoleManagementWidget: {
|
|
|
6382
6383
|
open(): Promise<void>;
|
|
6383
6384
|
reset(): void;
|
|
6384
6385
|
remove(): void;
|
|
6385
|
-
"__#
|
|
6386
|
+
"__#41282@#private": any;
|
|
6386
6387
|
logger: {
|
|
6387
6388
|
error(...data: any[]): void;
|
|
6388
6389
|
warn(...data: any[]): void;
|
|
@@ -6395,25 +6396,25 @@ declare const RoleManagementWidget: {
|
|
|
6395
6396
|
};
|
|
6396
6397
|
createModal(config?: Record<string, string>): _descope_sdk_component_drivers.ModalDriver;
|
|
6397
6398
|
duplicateButton: _descope_sdk_component_drivers.ButtonDriver;
|
|
6398
|
-
"__#
|
|
6399
|
-
"__#
|
|
6399
|
+
"__#12@#initDuplicateButton"(): void;
|
|
6400
|
+
"__#12@#onIsSingleRoleSelectedUpdate": (isSingleSelected: boolean) => void;
|
|
6400
6401
|
roleFormModal: _descope_sdk_component_drivers.ModalDriver;
|
|
6401
|
-
"__#
|
|
6402
|
-
"__#
|
|
6403
|
-
"__#
|
|
6402
|
+
"__#8@#permissionsMultiSelect": _descope_sdk_component_drivers.MultiSelectDriver;
|
|
6403
|
+
"__#8@#submitMode": "create" | "duplicate";
|
|
6404
|
+
"__#8@#pendingPrefill": RoleFormData;
|
|
6404
6405
|
openRoleModal: ((mode?: "create" | "duplicate", prefill?: RoleFormData) => void) & ((mode?: "create" | "duplicate", prefill?: RoleFormData) => void);
|
|
6405
|
-
"__#
|
|
6406
|
-
"__#
|
|
6406
|
+
"__#8@#initRoleFormModal": (() => Promise<void>) & (() => Promise<void>);
|
|
6407
|
+
"__#8@#updatePermissionsMultiSelect": (() => Promise<void>) & (() => Promise<void>);
|
|
6407
6408
|
deleteButton: _descope_sdk_component_drivers.ButtonDriver;
|
|
6408
|
-
"__#
|
|
6409
|
-
"__#
|
|
6409
|
+
"__#11@#initDeleteButton"(): void;
|
|
6410
|
+
"__#11@#onIsRoleSelectedUpdate": (isSelected: boolean) => void;
|
|
6410
6411
|
deleteRolesModal: _descope_sdk_component_drivers.ModalDriver;
|
|
6411
|
-
"__#
|
|
6412
|
+
"__#10@#initDeleteRoleModal"(): Promise<void>;
|
|
6412
6413
|
createButton: _descope_sdk_component_drivers.ButtonDriver;
|
|
6413
|
-
"__#
|
|
6414
|
+
"__#9@#initCreateButton"(): void;
|
|
6414
6415
|
rolesTable: _descope_sdk_component_drivers.GridDriver<Role>;
|
|
6415
|
-
"__#
|
|
6416
|
-
"__#
|
|
6416
|
+
"__#17@#initRolesTable"(): void;
|
|
6417
|
+
"__#17@#onRolesListUpdate": (rolesList: {
|
|
6417
6418
|
editable: string;
|
|
6418
6419
|
name: string;
|
|
6419
6420
|
description: string;
|
|
@@ -6421,33 +6422,33 @@ declare const RoleManagementWidget: {
|
|
|
6421
6422
|
createdTime: Date;
|
|
6422
6423
|
tenantId: string;
|
|
6423
6424
|
}[]) => void;
|
|
6424
|
-
"__#
|
|
6425
|
-
"__#
|
|
6426
|
-
"__#
|
|
6427
|
-
"__#
|
|
6425
|
+
"__#17@#onColumnSortChange": (this: any, ...args: any[]) => void;
|
|
6426
|
+
"__#41288@#globalStyle": _descope_sdk_mixins.InjectedStyle;
|
|
6427
|
+
"__#41288@#tenantStyle": _descope_sdk_mixins.InjectedStyle;
|
|
6428
|
+
"__#41288@#customStyle": _descope_sdk_mixins.InjectedStyle;
|
|
6428
6429
|
readonly theme: _descope_sdk_mixins.ThemeOptions;
|
|
6429
6430
|
readonly styleId: string;
|
|
6430
6431
|
readonly themeOverride: Record<string, any>;
|
|
6431
|
-
"__#
|
|
6432
|
-
"__#
|
|
6433
|
-
"__#
|
|
6434
|
-
"__#
|
|
6435
|
-
readonly "__#
|
|
6436
|
-
"__#
|
|
6437
|
-
"__#
|
|
6438
|
-
readonly "__#
|
|
6439
|
-
"__#
|
|
6440
|
-
"__#
|
|
6441
|
-
"__#
|
|
6442
|
-
"__#
|
|
6432
|
+
"__#41288@#getThemeOverrideString"(): string;
|
|
6433
|
+
"__#41288@#_themeResource": Promise<void | Record<string, any>>;
|
|
6434
|
+
"__#41288@#_tenantThemeResource": Promise<Record<string, any>>;
|
|
6435
|
+
"__#41288@#fetchTheme"(): Promise<Record<string, any>>;
|
|
6436
|
+
readonly "__#41288@#themeResource": Promise<void | Record<string, any>>;
|
|
6437
|
+
"__#41288@#loadGlobalStyle"(): Promise<void>;
|
|
6438
|
+
"__#41288@#fetchTenantTheme"(): Promise<Record<string, any>>;
|
|
6439
|
+
readonly "__#41288@#tenantThemeResource": Promise<Record<string, any>>;
|
|
6440
|
+
"__#41288@#loadTenantStyle"(): Promise<void>;
|
|
6441
|
+
"__#41288@#loadCustomStyle"(): Promise<void>;
|
|
6442
|
+
"__#41288@#loadComponentsStyle"(): Promise<void>;
|
|
6443
|
+
"__#41288@#getFontsConfig"(): Promise<Record<string, {
|
|
6443
6444
|
url?: string;
|
|
6444
6445
|
}>>;
|
|
6445
|
-
"__#
|
|
6446
|
-
"__#
|
|
6447
|
-
"__#
|
|
6448
|
-
"__#
|
|
6449
|
-
"__#
|
|
6450
|
-
"__#
|
|
6446
|
+
"__#41288@#loadFonts"(): Promise<void>;
|
|
6447
|
+
"__#41288@#applyTheme"(): Promise<void>;
|
|
6448
|
+
"__#41288@#onThemeChange": () => void;
|
|
6449
|
+
"__#41288@#loadTheme"(): void;
|
|
6450
|
+
"__#41288@#toggleOsThemeChangeListener": (listen: boolean) => void;
|
|
6451
|
+
"__#41280@#debuggerEle": HTMLElement & {
|
|
6451
6452
|
updateData: (data: {
|
|
6452
6453
|
title: string;
|
|
6453
6454
|
description?: string;
|
|
@@ -6456,11 +6457,11 @@ declare const RoleManagementWidget: {
|
|
|
6456
6457
|
description?: string;
|
|
6457
6458
|
}[]) => void;
|
|
6458
6459
|
};
|
|
6459
|
-
"__#
|
|
6460
|
-
"__#
|
|
6460
|
+
"__#41280@#disableDebugger"(): void;
|
|
6461
|
+
"__#41280@#enableDebugger"(): Promise<void>;
|
|
6461
6462
|
readonly debug: boolean;
|
|
6462
|
-
"__#
|
|
6463
|
-
"__#
|
|
6463
|
+
"__#41280@#handleDebugMode"(): void;
|
|
6464
|
+
"__#41280@#updateDebuggerMessages"(title: string, description: string): void;
|
|
6464
6465
|
};
|
|
6465
6466
|
};
|
|
6466
6467
|
|