@descope/access-key-management-widget 0.10.0 → 0.10.1
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 +57 -57
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* @descope/access-key-management-widget v0.10.
|
|
3
|
+
* @descope/access-key-management-widget v0.10.1
|
|
4
4
|
*/
|
|
5
|
-
import{pluralize as e,createSingletonMixin as t,compose as s,createTemplate as i,withMemCache as o,debounce as a}from"@descope/sdk-helpers";import{__awaiter as c,__classPrivateFieldGet as d,__classPrivateFieldSet as n}from"tslib";import{projectIdMixin as r,observeAttributesMixin as l,loggerMixin as u,baseUrlMixin as h,cookieConfigMixin as v,createValidateAttributesMixin as g,createStateManagementMixin as y,initLifecycleMixin as m,descopeUiMixin as p,initElementMixin as f,createFetchWidgetPagesMixin as R,modalMixin as K,formMixin as k,notificationsMixin as w,debuggerMixin as M,themeMixin as A,componentsConditionsMixin as b}from"@descope/sdk-mixins";import{GridDriver as W,ButtonDriver as C,TextDriver as x,MultiSelectDriver as S,TextFieldDriver as j}from"@descope/sdk-component-drivers";import{createSelector as $}from"reselect";import{createAsyncThunk as I}from"@reduxjs/toolkit";import T from"@descope/web-js-sdk";const O=e=>e.selectedAccessKeysIds,L=e=>e.notifications,B=$((e=>e.accessKeysList.data),(e=>e.map((e=>Object.assign(Object.assign({},e),{expireTimeFormatted:(null==e?void 0:e.expireTime)?new Date(1e3*((null==e?void 0:e.expireTime)||0)).toLocaleString():"Never",createdTimeFormatted:new Date(1e3*((null==e?void 0:e.createdTime)||0)).toLocaleString(),status:(null==e?void 0:e.expireTime)&&new Date(1e3*((null==e?void 0:e.expireTime)||0))<new Date?"expired":null==e?void 0:e.status}))))),D=$(O,B,((e,t)=>t.filter((t=>e.includes(t.id))))),P=$(O,(e=>!!e.length)),q=$(D,(e=>e.every((e=>e.editable)))),F=$(q,P,((e,t)=>e&&t)),E=$(D,(e=>e.some((e=>"expired"===e.status)))),N=$(F,E,((e,t)=>e&&!t)),U=$(O,(e=>1===e.length)),H=$(D,(e=>1===e.length?e[0].name:`${e.length} access keys`)),Z=$(N,U,D,((e,t,s)=>{var i;return e&&t&&"active"===(null===(i=s[0])||void 0===i?void 0:i.status)})),V=e=>(...t)=>s=>{s.addCase(e.pending,((e,s)=>{t.forEach((({onPending:t})=>{null==t||t(e,s)}))})),s.addCase(e.fulfilled,((e,s)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,s)}))})),s.addCase(e.rejected,((e,s)=>{t.forEach((({onRejected:t})=>{null==t||t(e,s)}))}))},z=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,s)=>{e(t).loading=!1,e(t).error=s.error}}),J=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,s)=>{t&&e.notifications.push({type:"success",msg:t(s)})},onRejected:(t,s)=>{e&&t.notifications.push({type:"error",msg:e(s)})}}),G=I("accessKeys/create",((e,{extra:{api:t}})=>t.accesskey.create(e))),Q=V(G)({onFulfilled:(e,t)=>{e.accessKeysList.data.unshift(t.payload.key)}},z((e=>e.createAccessKey)),J({getSuccessMsg:()=>"Access Key created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create access key</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),X={action:G,reducer:Q},Y=I("accessKeys/delete",((e,{extra:{api:t}})=>t.accesskey.deleteBatch(e))),_=V(Y)({onFulfilled:(e,t)=>{e.accessKeysList.data=e.accessKeysList.data.filter((e=>!t.meta.arg.includes(e.id))),e.selectedAccessKeysIds=[]}},z((e=>e.deleteAccessKey)),J({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} deleted successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to delete access key${["","s"]}`})),ee={action:Y,reducer:_},te=I("accessKeys/search",((e,{extra:{api:t},getState:s})=>{const i=s().searchParams;return t.accesskey.search(Object.assign(Object.assign({},i),e))})),se=V(te)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.accessKeysList.data=t.payload}},z((e=>e.accessKeysList))),ie={action:te,reducer:se},oe=I("accessKeys/activate",((e,{extra:{api:t}})=>t.accesskey.activate(e))),ae=V(oe)({onFulfilled:(e,t)=>{e.accessKeysList.data.forEach((e=>{t.meta.arg.includes(e.id)&&(e.status="active")}))}},z((e=>e.activateAccessKey)),J({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} activated successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to activate access key${["","s"]}`})),ce={action:oe,reducer:ae},de=I("accessKeys/deactivate",((e,{extra:{api:t}})=>t.accesskey.deactivate(e))),ne=V(de)({onFulfilled:(e,t)=>{e.accessKeysList.data.forEach((e=>{t.meta.arg.includes(e.id)&&(e.status="inactive")}))}},z((e=>e.deactivateAccessKey)),J({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} deactivated successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to deactivate access key${["","s"]}`})),re={action:de,reducer:ne},le=I("accessKeys/rotate",((e,{extra:{api:t}})=>t.accesskey.rotate(e))),ue=V(le)({onFulfilled:(e,t)=>{const s=e.accessKeysList.data.findIndex((e=>e.id===t.payload.key.id));s>=0&&(e.accessKeysList.data[s]=t.payload.key)}},z((e=>e.rotateAccessKey)),J({getSuccessMsg:()=>"Access key rotated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to rotate access key</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),he={action:le,reducer:ue},ve=I("tenant/getTenantRoles",((e,{extra:{api:t}})=>t.tenant.getTenantRoles())),ge={action:ve,reducer:V(ve)({onFulfilled:(e,t)=>{e.tenantRoles.data=t.payload.roles}},z((e=>e.tenantRoles)))},ye={accessKeysList:{data:[],loading:!1,error:null},createAccessKey:{loading:!1,error:null},activateAccessKey:{loading:!1,error:null},deactivateAccessKey:{loading:!1,error:null},deleteAccessKey:{loading:!1,error:null},rotateAccessKey:{loading:!1,error:null},tenantRoles:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedAccessKeysIds:[],notifications:[]},me={search:"/v1/mgmt/accesskey/search",deleteBatch:"/v1/mgmt/accesskey/delete/batch",create:"/v1/mgmt/accesskey/create",deactivate:"/v1/mgmt/accesskey/deactivate/batch",activate:"/v1/mgmt/accesskey/activate/batch",rotate:"/v1/mgmt/accesskey/rotate"},pe={roles:"/v1/mgmt/role/all"},fe=e=>c(void 0,void 0,void 0,(function*(){const t=yield e.text(),s=JSON.parse(t);if(!e.ok){const t=`${s.errorDescription}${s.errorMessage?`: ${s.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(s),e.text=()=>Promise.resolve(t)})),Re=(...e)=>c(void 0,[...e],void 0,(function*({text:e,sort:t}={}){return new Promise((s=>{const i=[],o=(new Date).getTime()/1e3+2592e3,a=new Date(o).toLocaleString();for(let e=1;e<10;e+=1)i.push({id:`access-key-id-${e}`,name:`Access Key ${e}`,createdBy:`User ${e}`,editable:!0,expireTime:o,expireTimeFormatted:a,createdTime:o,createdTimeFormatted:a,roleNames:[`Role ${e}`],permittedIps:["127.1.2.3"],status:"active",clientId:`Client ID ${e}`,boundUserId:`User ${e}`});t.forEach((e=>{i.sort(((t,s)=>{var i,o;return e.desc?null===(o=s[e.field])||void 0===o?void 0:o.localeCompare(t[e.field]):null===(i=t[e.field])||void 0===i?void 0:i.localeCompare(s[e.field])}))})),s(i.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.createdBy.toLowerCase().includes(e.toLowerCase()))))}))})),Ke=(e,t)=>c(void 0,[e,t],void 0,(function*({name:e,roleNames:t,userId:s,permittedIps:i},o){const a=Math.random().toString(10).substring(15);return new Promise((c=>{c({cleartext:Math.random().toString(20).substring(2),key:{id:`access-key-id-${a}`,name:e||`Access Key ${a}`,createdBy:s||`User ${a}`,editable:!0,expireTime:o,createdTime:(new Date).getTime()/1e3,roleNames:t,permittedIps:i,status:"active",clientId:`Client ID ${a}`,boundUserId:s||`User ${a}`}})}))})),ke=()=>c(void 0,void 0,void 0,(function*(){})),we=()=>c(void 0,void 0,void 0,(function*(){})),Me=()=>c(void 0,void 0,void 0,(function*(){})),Ae=e=>c(void 0,[e],void 0,(function*({id:e}){return new Promise((t=>{t({cleartext:Math.random().toString(20).substring(2),key:{id:e,name:`Access Key ${e}`,createdBy:"User",editable:!0,expireTime:(new Date).getTime()/1e3+2592e3,createdTime:(new Date).getTime()/1e3,roleNames:[],permittedIps:[],status:"active",clientId:`Client ID ${e}`,boundUserId:"User"}})}))})),be=e=>new Promise((t=>{const s=[];for(let t=1;t<5;t+=1)s.push({name:`Role ${t}`,description:`Role description ${t}`,createdTime:new Date,permissionNames:[`Permission ${t}`],tenantId:e});t({roles:s})})),We=({httpClient:e,tenant:t,mock:s})=>({search:(...i)=>c(void 0,[...i],void 0,(function*({page:i,limit:o=1e4,text:a,sort:c}={}){if(s)return Re({page:i,limit:o,text:a,sort:c});const d=yield e.post(me.search,{limit:o,page:i,text:a,sort:c},{queryParams:{tenant:t}});yield fe(d);return(yield d.json()).keys})),deleteBatch:i=>c(void 0,void 0,void 0,(function*(){if(s)return Me();const o=yield e.post(me.deleteBatch,{ids:i},{queryParams:{tenant:t}});return yield fe(o),o.json()})),create:i=>c(void 0,[i],void 0,(function*({name:i,expiration:o,roleNames:a,userId:c,permittedIps:d}){const n=new Date;n.setDate(n.getDate()+ +o);const r="0"===o[0]?0:Math.floor(n.getTime()/1e3);if(s)return Ke({name:i,expiration:o,roleNames:a,userId:c,permittedIps:d},r);const l=yield e.post(me.create,{name:i,expireTime:r,roleNames:a,userId:c,permittedIps:d},{queryParams:{tenant:t}});yield fe(l);return yield l.json()})),activate:i=>c(void 0,void 0,void 0,(function*(){if(s)return ke();const o=yield e.post(me.activate,{ids:i},{queryParams:{tenant:t}});yield fe(o);return yield o.json()})),deactivate:i=>c(void 0,void 0,void 0,(function*(){if(s)return we();const o=yield e.post(me.deactivate,{ids:i},{queryParams:{tenant:t}});yield fe(o);return yield o.json()})),rotate:i=>c(void 0,[i],void 0,(function*({id:i}){if(s)return Ae({id:i});const o=yield e.post(me.rotate,{id:i},{queryParams:{tenant:t}});yield fe(o);return yield o.json()}))}),Ce=({httpClient:e,tenant:t,mock:s})=>({getTenantRoles:()=>c(void 0,void 0,void 0,(function*(){if(s)return be(t);const i=yield e.get(pe.roles,{queryParams:{tenant:t}});return yield fe(i),i.json()}))}),xe=t((e=>{var t,i,o,a;const y=s(r,l,u,h,v,g({tenant:g.missingAttrValidator}))(e);return a=class extends y{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 d(this,i,"f")||d(this,t,"m",o).call(this),d(this,i,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.init)||void 0===s?void 0:s.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{d(this,i,"f")&&d(this,t,"m",o).call(this)}))}))}},i=new WeakMap,t=new WeakSet,o=function(){this.logger.debug("creating an sdk instance"),n(this,i,((e,t,s,i)=>{const o=T(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"access-key-management-widget","x-descope-widget-id":i,"x-descope-widget-version":"0.10.0"}}));return{accesskey:We({httpClient:o.httpClient,tenant:t,mock:s}),tenant:Ce({httpClient:o.httpClient,tenant:t,mock:s}),httpClient:o.httpClient}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},a})),Se=t((e=>{const t=s(y({name:"widget",initialState:ye,reducers:{setSelectedAccessKeysIds:(e,{payload:t})=>{e.selectedAccessKeysIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{X.reducer(e),ee.reducer(e),ie.reducer(e),ce.reducer(e),re.reducer(e),he.reducer(e),ge.reducer(e)},asyncActions:{searchAccessKeys:ie.action,createAccessKey:X.action,activateAccessKeys:ce.action,deactivateAccessKeys:re.action,deleteAccessKeys:ee.action,rotateAccessKey:he.action,getTenantRoles:ge.action}}),m,u,xe)(e);return class extends t{constructor(...e){super(...e),this.state=ye,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),je=t((e=>{var t,o,a;return a=class extends(s(u,m,p,f,R("access-key-management-widget"),Se)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return c(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.init)||void 0===s?void 0:s.call(this),yield Promise.all([d(this,t,"m",o).call(this),this.actions.searchAccessKeys(),this.actions.getTenantRoles()]),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){const e=i(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},a})),$e=t((e=>{var t,i,n,r,l;return l=class extends(s(Se,u,je)(e)){constructor(){super(...arguments),t.add(this),n.set(this,o((e=>{this.accessKeysTable.data=e}))),r.set(this,a(((e,t)=>{const s=[],{value:i}=t;if(i){const t=e.path;s.push({field:t,desc:"desc"===i})}this.actions.searchAccessKeys({sort:s})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.accessKeysTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{d(this,r,"f").call(this,e.target,e.detail)}))})),d(this,n,"f").call(this,B(this.state)),this.subscribe(d(this,n,"f").bind(this),B)}))}},n=new WeakMap,r=new WeakMap,t=new WeakSet,i=function(){var e;this.accessKeysTable=new W(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="access-keys-table"]'),{logger:this.logger}),this.accessKeysTable.onSelectedItemsChange((e=>{this.actions.setSelectedAccessKeysIds(e.detail.value.map((({id:e})=>e)))}))},l})),Ie=t((e=>{var t,o,a;return a=class extends(s(Se,K,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){var e;this.activateAccessKeysModal=this.createModal(),this.activateAccessKeysModal.setContent(i(yield this.fetchWidgetPage("activate-access-keys-modal.html")));const t=new C((()=>{var e;return null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.activateAccessKeysModal.close()));const s=new C((()=>{var e;return null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>{const e=D(this.state);this.actions.activateAccessKeys(null==e?void 0:e.map((e=>e.id))),this.activateAccessKeysModal.close()}));const o=new x(null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.activateAccessKeysModal.beforeOpen=()=>{const e=H(this.state);o.text=`Activate ${e}?`}}))},a})),Te=t((e=>{var t,i,a,n;return n=class extends(s(u,je,Se,Ie)(e)){constructor(){super(...arguments),t.add(this),a.set(this,o((e=>{e?this.activateButton.enable():this.activateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.subscribe(d(this,a,"f").bind(this),N)}))}},a=new WeakMap,t=new WeakSet,i=function(){var e;this.activateButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="activate-access-keys"]'),{logger:this.logger}),this.activateButton.disable(),this.activateButton.onClick((()=>{this.activateAccessKeysModal.open()}))},n})),Oe=t((e=>{var t,o,a;return a=class extends(s(Se,K,k,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){this.createdAccessKeyModal=this.createModal(),this.createdAccessKeyModal.setContent(i(yield this.fetchWidgetPage("created-access-key-modal.html")));new C((()=>{var e;return null===(e=this.createdAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-close"]')}),{logger:this.logger}).onClick((()=>{navigator.clipboard.writeText(this.getFormData(this.createdAccessKeyModal.ele)["generated-key"]),this.resetFormData(this.createdAccessKeyModal.ele),this.createdAccessKeyModal.close()}))}))},a})),Le=t((e=>{var t,o,a,r,l;return l=class extends(s(Se,K,k,u,je,Oe)(e)){constructor(){super(...arguments),t.add(this),o.set(this,void 0),r.set(this,(()=>c(this,void 0,void 0,(function*(){var e,t;yield d(this,o,"f").setData(null===(t=this.state,e=t.tenantRoles.data||[])||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))}))))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",a).call(this)}))}},o=new WeakMap,r=new WeakMap,t=new WeakSet,a=function e(){return c(this,void 0,void 0,(function*(){this.createAccessKeyModal=this.createModal(),this.createAccessKeyModal.setContent(i(yield this.fetchWidgetPage("create-access-key-modal.html")));new C((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>{this.createAccessKeyModal.close(),this.resetFormData(this.createAccessKeyModal.ele)}));new C((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>c(this,void 0,void 0,(function*(){var e,t;if(this.validateForm(this.createAccessKeyModal.ele)){const s=yield this.actions.createAccessKey(Object.assign({},this.getFormData(this.createAccessKeyModal.ele)));this.createAccessKeyModal.close(),(null===(e=null==s?void 0:s.payload)||void 0===e?void 0:e.cleartext)&&(this.setFormData(this.createdAccessKeyModal.ele,{"generated-key":null===(t=null==s?void 0:s.payload)||void 0===t?void 0:t.cleartext}),this.createdAccessKeyModal.open())}})))),n(this,o,new S((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),d(this,r,"f").call(this),this.createAccessKeyModal.afterClose=()=>{d(this,t,"m",e).call(this)}}))},l})),Be=t((e=>{var t,i,o;return o=class extends(s(u,Le,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this)}))}},t=new WeakSet,i=function(){var e;this.createButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-access-key"]'),{logger:this.logger}),this.createButton.onClick((()=>this.createAccessKeyModal.open()))},o})),De=t((e=>{var t,o,a;return a=class extends(s(Se,K,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){var e;this.deactivateAccessKeysModal=this.createModal(),this.deactivateAccessKeysModal.setContent(i(yield this.fetchWidgetPage("deactivate-access-keys-modal.html")));const t=new C((()=>{var e;return null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deactivateAccessKeysModal.close()));const s=new C((()=>{var e;return null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>{const e=D(this.state);this.actions.deactivateAccessKeys(null==e?void 0:e.map((e=>e.id))),this.deactivateAccessKeysModal.close()}));const o=new x(null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deactivateAccessKeysModal.beforeOpen=()=>{const e=H(this.state);o.text=`Deactivate ${e}?`}}))},a})),Pe=t((e=>{var t,i,a,n;return n=class extends(s(u,je,Se,De)(e)){constructor(){super(...arguments),t.add(this),a.set(this,o((e=>{e?this.deactivateButton.enable():this.deactivateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.subscribe(d(this,a,"f").bind(this),N)}))}},a=new WeakMap,t=new WeakSet,i=function(){var e;this.deactivateButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="deactivate-access-keys"]'),{logger:this.logger}),this.deactivateButton.disable(),this.deactivateButton.onClick((()=>{this.deactivateAccessKeysModal.open()}))},n})),qe=t((e=>{var t,o,a;return a=class extends(s(Se,K,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){var e;this.deleteAccessKeysModal=this.createModal(),this.deleteAccessKeysModal.setContent(i(yield this.fetchWidgetPage("delete-access-keys-modal.html")));const t=new C((()=>{var e;return null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteAccessKeysModal.close()));const s=new C((()=>{var e;return null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>{const e=D(this.state);this.actions.deleteAccessKeys(null==e?void 0:e.map((e=>e.id))),this.deleteAccessKeysModal.close()}));const o=new x(null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteAccessKeysModal.beforeOpen=()=>{const e=H(this.state);o.text=`Delete ${e}?`}}))},a})),Fe=t((e=>{var t,i,a,n;return n=class extends(s(u,je,Se,qe)(e)){constructor(){super(...arguments),t.add(this),a.set(this,o((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.subscribe(d(this,a,"f").bind(this),F)}))}},a=new WeakMap,t=new WeakSet,i=function(){var e;this.deleteButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-access-keys"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteAccessKeysModal.open()}))},n})),Ee=t((e=>{var t,i,o,n;return n=class extends(s(u,je,Se)(e)){constructor(){super(...arguments),t.add(this),i.set(this,a((()=>{this.actions.searchAccessKeys({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this)}))}},i=new WeakMap,t=new WeakSet,o=function(){var e;this.searchInput=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(d(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},Ue=t((e=>{var t,i,a,n,r;return r=class extends(s(u,Se,w,m)(e)){constructor(){super(...arguments),t.add(this),n.set(this,o((e=>{e.length&&(e.forEach((({type:e,msg:s})=>{const o=d(this,t,"m",a).call(this,e);o.setContent(d(this,t,"m",i).call(this,{type:e,msg:s})),o.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return c(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(d(this,n,"f").bind(this),L)}))}},n=new WeakMap,t=new WeakSet,i=function({type:e,msg:t}){const s=Ne[e],i=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==s?void 0:s.outerHTML)||""}${t}${i.outerHTML}`},a=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},r})),He=t((e=>{var t,o,a;return a=class extends(s(Se,K,k,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){this.rotatedAccessKeyModal=this.createModal(),this.rotatedAccessKeyModal.setContent(i(yield this.fetchWidgetPage("rotated-access-key-modal.html")));new C((()=>{var e;return null===(e=this.rotatedAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-close"]')}),{logger:this.logger}).onClick((()=>{navigator.clipboard.writeText(this.getFormData(this.rotatedAccessKeyModal.ele)["generated-key"]),this.resetFormData(this.rotatedAccessKeyModal.ele),this.rotatedAccessKeyModal.close()}))}))},a})),Ze=t((e=>{var t,o,a;return a=class extends(s(Se,K,k,u,je,He)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){var e;this.rotateAccessKeyModal=this.createModal(),this.rotateAccessKeyModal.setContent(i(yield this.fetchWidgetPage("rotate-access-key-modal.html")));const t=new C((()=>{var e;return null===(e=this.rotateAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.rotateAccessKeyModal.close()));const s=new C((()=>{var e;return null===(e=this.rotateAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>c(this,void 0,void 0,(function*(){var e,t;const s=null===(e=D(this.state))||void 0===e?void 0:e[0];if(!s)return void this.rotateAccessKeyModal.close();const i=yield this.actions.rotateAccessKey({id:s.id});this.rotateAccessKeyModal.close(),(null===(t=null==i?void 0:i.payload)||void 0===t?void 0:t.cleartext)&&(this.setFormData(this.rotatedAccessKeyModal.ele,{"generated-key":i.payload.cleartext}),this.rotatedAccessKeyModal.open())}))));const o=new x(null===(e=this.rotateAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.rotateAccessKeyModal.beforeOpen=()=>{const e=H(this.state);o.text=`Rotate ${e}?`}}))},a})),Ve=t((e=>{var t,i,a,n;return n=class extends(s(u,je,Se,Ze)(e)){constructor(){super(...arguments),t.add(this),a.set(this,o((e=>{e?this.rotateButton.enable():this.rotateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.subscribe(d(this,a,"f").bind(this),Z)}))}},a=new WeakMap,t=new WeakSet,i=function(){var e;this.rotateButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="rotate-access-keys"]'),{logger:this.logger}),this.rotateButton.disable(),this.rotateButton.onClick((()=>{this.rotateAccessKeyModal.open()}))},n})),ze=t((e=>class extends(s(M,A,$e,Be,Fe,Ee,Te,Pe,Ve,Ue,b)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return c(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),Je=s((e=>class extends(ze(e)){}))(HTMLElement);customElements.define("descope-access-key-management-widget",Je);export{Je as default};
|
|
5
|
+
import{pluralize as e,createSingletonMixin as t,compose as s,createTemplate as i,withMemCache as o,debounce as a}from"@descope/sdk-helpers";import{__awaiter as c,__classPrivateFieldGet as d,__classPrivateFieldSet as n}from"tslib";import{projectIdMixin as r,observeAttributesMixin as l,loggerMixin as u,baseUrlMixin as h,cookieConfigMixin as v,createValidateAttributesMixin as g,createStateManagementMixin as y,initLifecycleMixin as m,descopeUiMixin as p,initElementMixin as f,createFetchWidgetPagesMixin as R,modalMixin as K,formMixin as k,notificationsMixin as w,debuggerMixin as M,themeMixin as A,componentsConditionsMixin as b}from"@descope/sdk-mixins";import{GridDriver as W,ButtonDriver as C,TextDriver as x,MultiSelectDriver as S,TextFieldDriver as j}from"@descope/sdk-component-drivers";import{createSelector as $}from"reselect";import{createAsyncThunk as I}from"@reduxjs/toolkit";import T from"@descope/web-js-sdk";const O=e=>e.selectedAccessKeysIds,L=e=>e.notifications,B=$((e=>e.accessKeysList.data),(e=>e.map((e=>Object.assign(Object.assign({},e),{expireTimeFormatted:(null==e?void 0:e.expireTime)?new Date(1e3*((null==e?void 0:e.expireTime)||0)).toLocaleString():"Never",createdTimeFormatted:new Date(1e3*((null==e?void 0:e.createdTime)||0)).toLocaleString(),status:(null==e?void 0:e.expireTime)&&new Date(1e3*((null==e?void 0:e.expireTime)||0))<new Date?"expired":null==e?void 0:e.status}))))),D=$(O,B,((e,t)=>t.filter((t=>e.includes(t.id))))),P=$(O,(e=>!!e.length)),q=$(D,(e=>e.every((e=>e.editable)))),F=$(q,P,((e,t)=>e&&t)),E=$(D,(e=>e.some((e=>"expired"===e.status)))),N=$(F,E,((e,t)=>e&&!t)),U=$(O,(e=>1===e.length)),H=$(D,(e=>1===e.length?e[0].name:`${e.length} access keys`)),Z=$(N,U,D,((e,t,s)=>{var i;return e&&t&&"active"===(null===(i=s[0])||void 0===i?void 0:i.status)})),V=e=>(...t)=>s=>{s.addCase(e.pending,((e,s)=>{t.forEach((({onPending:t})=>{null==t||t(e,s)}))})),s.addCase(e.fulfilled,((e,s)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,s)}))})),s.addCase(e.rejected,((e,s)=>{t.forEach((({onRejected:t})=>{null==t||t(e,s)}))}))},z=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,s)=>{e(t).loading=!1,e(t).error=s.error}}),J=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,s)=>{t&&e.notifications.push({type:"success",msg:t(s)})},onRejected:(t,s)=>{e&&t.notifications.push({type:"error",msg:e(s)})}}),G=I("accessKeys/create",((e,{extra:{api:t}})=>t.accesskey.create(e))),Q=V(G)({onFulfilled:(e,t)=>{e.accessKeysList.data.unshift(t.payload.key)}},z((e=>e.createAccessKey)),J({getSuccessMsg:()=>"Access Key created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create access key</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),X={action:G,reducer:Q},Y=I("accessKeys/delete",((e,{extra:{api:t}})=>t.accesskey.deleteBatch(e))),_=V(Y)({onFulfilled:(e,t)=>{e.accessKeysList.data=e.accessKeysList.data.filter((e=>!t.meta.arg.includes(e.id))),e.selectedAccessKeysIds=[]}},z((e=>e.deleteAccessKey)),J({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} deleted successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to delete access key${["","s"]}`})),ee={action:Y,reducer:_},te=I("accessKeys/search",((e,{extra:{api:t},getState:s})=>{const i=s().searchParams;return t.accesskey.search(Object.assign(Object.assign({},i),e))})),se=V(te)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.accessKeysList.data=t.payload}},z((e=>e.accessKeysList))),ie={action:te,reducer:se},oe=I("accessKeys/activate",((e,{extra:{api:t}})=>t.accesskey.activate(e))),ae=V(oe)({onFulfilled:(e,t)=>{e.accessKeysList.data.forEach((e=>{t.meta.arg.includes(e.id)&&(e.status="active")}))}},z((e=>e.activateAccessKey)),J({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} activated successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to activate access key${["","s"]}`})),ce={action:oe,reducer:ae},de=I("accessKeys/deactivate",((e,{extra:{api:t}})=>t.accesskey.deactivate(e))),ne=V(de)({onFulfilled:(e,t)=>{e.accessKeysList.data.forEach((e=>{t.meta.arg.includes(e.id)&&(e.status="inactive")}))}},z((e=>e.deactivateAccessKey)),J({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} deactivated successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to deactivate access key${["","s"]}`})),re={action:de,reducer:ne},le=I("accessKeys/rotate",((e,{extra:{api:t}})=>t.accesskey.rotate(e))),ue=V(le)({onFulfilled:(e,t)=>{const s=e.accessKeysList.data.findIndex((e=>e.id===t.payload.key.id));s>=0&&(e.accessKeysList.data[s]=t.payload.key)}},z((e=>e.rotateAccessKey)),J({getSuccessMsg:()=>"Access key rotated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to rotate access key</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),he={action:le,reducer:ue},ve=I("tenant/getTenantRoles",((e,{extra:{api:t}})=>t.tenant.getTenantRoles())),ge={action:ve,reducer:V(ve)({onFulfilled:(e,t)=>{e.tenantRoles.data=t.payload.roles}},z((e=>e.tenantRoles)))},ye={accessKeysList:{data:[],loading:!1,error:null},createAccessKey:{loading:!1,error:null},activateAccessKey:{loading:!1,error:null},deactivateAccessKey:{loading:!1,error:null},deleteAccessKey:{loading:!1,error:null},rotateAccessKey:{loading:!1,error:null},tenantRoles:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedAccessKeysIds:[],notifications:[]},me={search:"/v1/mgmt/accesskey/search",deleteBatch:"/v1/mgmt/accesskey/delete/batch",create:"/v1/mgmt/accesskey/create",deactivate:"/v1/mgmt/accesskey/deactivate/batch",activate:"/v1/mgmt/accesskey/activate/batch",rotate:"/v1/mgmt/accesskey/rotate"},pe={roles:"/v1/mgmt/role/all"},fe=e=>c(void 0,void 0,void 0,(function*(){const t=yield e.text(),s=JSON.parse(t);if(!e.ok){const t=`${s.errorDescription}${s.errorMessage?`: ${s.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(s),e.text=()=>Promise.resolve(t)})),Re=(...e)=>c(void 0,[...e],void 0,(function*({text:e,sort:t}={}){return new Promise((s=>{const i=[],o=(new Date).getTime()/1e3+2592e3,a=new Date(o).toLocaleString();for(let e=1;e<10;e+=1)i.push({id:`access-key-id-${e}`,name:`Access Key ${e}`,createdBy:`User ${e}`,editable:!0,expireTime:o,expireTimeFormatted:a,createdTime:o,createdTimeFormatted:a,roleNames:[`Role ${e}`],permittedIps:["127.1.2.3"],status:"active",clientId:`Client ID ${e}`,boundUserId:`User ${e}`});t.forEach((e=>{i.sort(((t,s)=>{var i,o;return e.desc?null===(o=s[e.field])||void 0===o?void 0:o.localeCompare(t[e.field]):null===(i=t[e.field])||void 0===i?void 0:i.localeCompare(s[e.field])}))})),s(i.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.createdBy.toLowerCase().includes(e.toLowerCase()))))}))})),Ke=(e,t)=>c(void 0,[e,t],void 0,(function*({name:e,roleNames:t,userId:s,permittedIps:i},o){const a=Math.random().toString(10).substring(15);return new Promise((c=>{c({cleartext:Math.random().toString(20).substring(2),key:{id:`access-key-id-${a}`,name:e||`Access Key ${a}`,createdBy:s||`User ${a}`,editable:!0,expireTime:o,createdTime:(new Date).getTime()/1e3,roleNames:t,permittedIps:i,status:"active",clientId:`Client ID ${a}`,boundUserId:s||`User ${a}`}})}))})),ke=()=>c(void 0,void 0,void 0,(function*(){})),we=()=>c(void 0,void 0,void 0,(function*(){})),Me=()=>c(void 0,void 0,void 0,(function*(){})),Ae=e=>c(void 0,[e],void 0,(function*({id:e}){return new Promise((t=>{t({cleartext:Math.random().toString(20).substring(2),key:{id:e,name:`Access Key ${e}`,createdBy:"User",editable:!0,expireTime:(new Date).getTime()/1e3+2592e3,createdTime:(new Date).getTime()/1e3,roleNames:[],permittedIps:[],status:"active",clientId:`Client ID ${e}`,boundUserId:"User"}})}))})),be=e=>new Promise((t=>{const s=[];for(let t=1;t<5;t+=1)s.push({name:`Role ${t}`,description:`Role description ${t}`,createdTime:new Date,permissionNames:[`Permission ${t}`],tenantId:e});t({roles:s})})),We=({httpClient:e,tenant:t,mock:s})=>({search:(...i)=>c(void 0,[...i],void 0,(function*({page:i,limit:o=1e4,text:a,sort:c}={}){if(s)return Re({page:i,limit:o,text:a,sort:c});const d=yield e.post(me.search,{limit:o,page:i,text:a,sort:c},{queryParams:{tenant:t}});yield fe(d);return(yield d.json()).keys})),deleteBatch:i=>c(void 0,void 0,void 0,(function*(){if(s)return Me();const o=yield e.post(me.deleteBatch,{ids:i},{queryParams:{tenant:t}});return yield fe(o),o.json()})),create:i=>c(void 0,[i],void 0,(function*({name:i,expiration:o,roleNames:a,userId:c,permittedIps:d}){const n=new Date;n.setDate(n.getDate()+ +o);const r="0"===o[0]?0:Math.floor(n.getTime()/1e3);if(s)return Ke({name:i,expiration:o,roleNames:a,userId:c,permittedIps:d},r);const l=yield e.post(me.create,{name:i,expireTime:r,roleNames:a,userId:c,permittedIps:d},{queryParams:{tenant:t}});yield fe(l);return yield l.json()})),activate:i=>c(void 0,void 0,void 0,(function*(){if(s)return ke();const o=yield e.post(me.activate,{ids:i},{queryParams:{tenant:t}});yield fe(o);return yield o.json()})),deactivate:i=>c(void 0,void 0,void 0,(function*(){if(s)return we();const o=yield e.post(me.deactivate,{ids:i},{queryParams:{tenant:t}});yield fe(o);return yield o.json()})),rotate:i=>c(void 0,[i],void 0,(function*({id:i}){if(s)return Ae({id:i});const o=yield e.post(me.rotate,{id:i},{queryParams:{tenant:t}});yield fe(o);return yield o.json()}))}),Ce=({httpClient:e,tenant:t,mock:s})=>({getTenantRoles:()=>c(void 0,void 0,void 0,(function*(){if(s)return be(t);const i=yield e.get(pe.roles,{queryParams:{tenant:t}});return yield fe(i),i.json()}))}),xe=t((e=>{var t,i,o,a;const y=s(r,l,u,h,v,g({tenant:g.missingAttrValidator}))(e);return a=class extends y{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 d(this,i,"f")||d(this,t,"m",o).call(this),d(this,i,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.init)||void 0===s?void 0:s.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{d(this,i,"f")&&d(this,t,"m",o).call(this)}))}))}},i=new WeakMap,t=new WeakSet,o=function(){this.logger.debug("creating an sdk instance"),n(this,i,((e,t,s,i)=>{const o=T(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"access-key-management-widget","x-descope-widget-id":i,"x-descope-widget-version":"0.10.1"}}));return{accesskey:We({httpClient:o.httpClient,tenant:t,mock:s}),tenant:Ce({httpClient:o.httpClient,tenant:t,mock:s}),httpClient:o.httpClient}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},a})),Se=t((e=>{const t=s(y({name:"widget",initialState:ye,reducers:{setSelectedAccessKeysIds:(e,{payload:t})=>{e.selectedAccessKeysIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{X.reducer(e),ee.reducer(e),ie.reducer(e),ce.reducer(e),re.reducer(e),he.reducer(e),ge.reducer(e)},asyncActions:{searchAccessKeys:ie.action,createAccessKey:X.action,activateAccessKeys:ce.action,deactivateAccessKeys:re.action,deleteAccessKeys:ee.action,rotateAccessKey:he.action,getTenantRoles:ge.action}}),m,u,xe)(e);return class extends t{constructor(...e){super(...e),this.state=ye,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),je=t((e=>{var t,o,a;return a=class extends(s(u,m,p,f,R("access-key-management-widget"),Se)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return c(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.init)||void 0===s?void 0:s.call(this),yield Promise.all([d(this,t,"m",o).call(this),this.actions.searchAccessKeys(),this.actions.getTenantRoles()]),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){const e=i(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},a})),$e=t((e=>{var t,i,n,r,l;return l=class extends(s(Se,u,je)(e)){constructor(){super(...arguments),t.add(this),n.set(this,o((e=>{this.accessKeysTable.data=e}))),r.set(this,a(((e,t)=>{const s=[],{value:i}=t;if(i){const t=e.path;s.push({field:t,desc:"desc"===i})}this.actions.searchAccessKeys({sort:s})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.accessKeysTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{d(this,r,"f").call(this,e.target,e.detail)}))})),d(this,n,"f").call(this,B(this.state)),this.subscribe(d(this,n,"f").bind(this),B)}))}},n=new WeakMap,r=new WeakMap,t=new WeakSet,i=function(){var e;this.accessKeysTable=new W(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="access-keys-table"]'),{logger:this.logger}),this.accessKeysTable.onSelectedItemsChange((e=>{this.actions.setSelectedAccessKeysIds(e.detail.value.map((({id:e})=>e)))}))},l})),Ie=t((e=>{var t,o,a;return a=class extends(s(Se,K,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){var e;this.activateAccessKeysModal=this.createModal(),this.activateAccessKeysModal.setContent(i(yield this.fetchWidgetPage("activate-access-keys-modal.html")));const t=new C((()=>{var e;return null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.activateAccessKeysModal.close()));const s=new C((()=>{var e;return null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>{const e=D(this.state);this.actions.activateAccessKeys(null==e?void 0:e.map((e=>e.id))),this.activateAccessKeysModal.close()}));const o=new x(null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.activateAccessKeysModal.beforeOpen=()=>{const e=H(this.state);o.text=`Activate ${e}?`}}))},a})),Te=t((e=>{var t,i,a,n;return n=class extends(s(u,je,Se,Ie)(e)){constructor(){super(...arguments),t.add(this),a.set(this,o((e=>{e?this.activateButton.enable():this.activateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.subscribe(d(this,a,"f").bind(this),N)}))}},a=new WeakMap,t=new WeakSet,i=function(){var e;this.activateButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="activate-access-keys"]'),{logger:this.logger}),this.activateButton.disable(),this.activateButton.onClick((()=>{this.activateAccessKeysModal.open()}))},n})),Oe=t((e=>{var t,o,a;return a=class extends(s(Se,K,k,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){this.createdAccessKeyModal=this.createModal(),this.createdAccessKeyModal.setContent(i(yield this.fetchWidgetPage("created-access-key-modal.html")));new C((()=>{var e;return null===(e=this.createdAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-close"]')}),{logger:this.logger}).onClick((()=>{navigator.clipboard.writeText(this.getFormData(this.createdAccessKeyModal.ele)["generated-key"]),this.resetFormData(this.createdAccessKeyModal.ele),this.createdAccessKeyModal.close()}))}))},a})),Le=t((e=>{var t,o,a,r,l;return l=class extends(s(Se,K,k,u,je,Oe)(e)){constructor(){super(...arguments),t.add(this),o.set(this,void 0),r.set(this,(()=>c(this,void 0,void 0,(function*(){var e,t;yield d(this,o,"f").setData(null===(t=this.state,e=t.tenantRoles.data||[])||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))}))))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",a).call(this)}))}},o=new WeakMap,r=new WeakMap,t=new WeakSet,a=function e(){return c(this,void 0,void 0,(function*(){this.createAccessKeyModal=this.createModal(),this.createAccessKeyModal.setContent(i(yield this.fetchWidgetPage("create-access-key-modal.html")));new C((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>{this.createAccessKeyModal.close(),this.resetFormData(this.createAccessKeyModal.ele)}));new C((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>c(this,void 0,void 0,(function*(){var e,t;if(this.validateForm(this.createAccessKeyModal.ele)){const s=yield this.actions.createAccessKey(Object.assign({},this.getFormData(this.createAccessKeyModal.ele)));this.createAccessKeyModal.close(),(null===(e=null==s?void 0:s.payload)||void 0===e?void 0:e.cleartext)&&(this.setFormData(this.createdAccessKeyModal.ele,{"generated-key":null===(t=null==s?void 0:s.payload)||void 0===t?void 0:t.cleartext}),this.createdAccessKeyModal.open())}})))),n(this,o,new S((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),d(this,r,"f").call(this),this.createAccessKeyModal.afterClose=()=>{d(this,t,"m",e).call(this)}}))},l})),Be=t((e=>{var t,i,o;return o=class extends(s(u,Le,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this)}))}},t=new WeakSet,i=function(){var e;this.createButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-access-key"]'),{logger:this.logger}),this.createButton.onClick((()=>this.createAccessKeyModal.open()))},o})),De=t((e=>{var t,o,a;return a=class extends(s(Se,K,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){var e;this.deactivateAccessKeysModal=this.createModal(),this.deactivateAccessKeysModal.setContent(i(yield this.fetchWidgetPage("deactivate-access-keys-modal.html")));const t=new C((()=>{var e;return null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deactivateAccessKeysModal.close()));const s=new C((()=>{var e;return null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>{const e=D(this.state);this.actions.deactivateAccessKeys(null==e?void 0:e.map((e=>e.id))),this.deactivateAccessKeysModal.close()}));const o=new x(null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deactivateAccessKeysModal.beforeOpen=()=>{const e=H(this.state);o.text=`Deactivate ${e}?`}}))},a})),Pe=t((e=>{var t,i,a,n;return n=class extends(s(u,je,Se,De)(e)){constructor(){super(...arguments),t.add(this),a.set(this,o((e=>{e?this.deactivateButton.enable():this.deactivateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.subscribe(d(this,a,"f").bind(this),N)}))}},a=new WeakMap,t=new WeakSet,i=function(){var e;this.deactivateButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="deactivate-access-keys"]'),{logger:this.logger}),this.deactivateButton.disable(),this.deactivateButton.onClick((()=>{this.deactivateAccessKeysModal.open()}))},n})),qe=t((e=>{var t,o,a;return a=class extends(s(Se,K,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){var e;this.deleteAccessKeysModal=this.createModal(),this.deleteAccessKeysModal.setContent(i(yield this.fetchWidgetPage("delete-access-keys-modal.html")));const t=new C((()=>{var e;return null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteAccessKeysModal.close()));const s=new C((()=>{var e;return null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>{const e=D(this.state);this.actions.deleteAccessKeys(null==e?void 0:e.map((e=>e.id))),this.deleteAccessKeysModal.close()}));const o=new x(null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteAccessKeysModal.beforeOpen=()=>{const e=H(this.state);o.text=`Delete ${e}?`}}))},a})),Fe=t((e=>{var t,i,a,n;return n=class extends(s(u,je,Se,qe)(e)){constructor(){super(...arguments),t.add(this),a.set(this,o((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.subscribe(d(this,a,"f").bind(this),F)}))}},a=new WeakMap,t=new WeakSet,i=function(){var e;this.deleteButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-access-keys"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteAccessKeysModal.open()}))},n})),Ee=t((e=>{var t,i,o,n;return n=class extends(s(u,je,Se)(e)){constructor(){super(...arguments),t.add(this),i.set(this,a((()=>{this.actions.searchAccessKeys({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this)}))}},i=new WeakMap,t=new WeakSet,o=function(){var e;this.searchInput=new j(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(d(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},Ue=t((e=>{var t,i,a,n,r;return r=class extends(s(u,Se,w,m)(e)){constructor(){super(...arguments),t.add(this),n.set(this,o((e=>{e.length&&(e.forEach((({type:e,msg:s})=>{const o=d(this,t,"m",a).call(this,e);o.setContent(d(this,t,"m",i).call(this,{type:e,msg:s})),o.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return c(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(d(this,n,"f").bind(this),L)}))}},n=new WeakMap,t=new WeakSet,i=function({type:e,msg:t}){const s=Ne[e],i=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==s?void 0:s.outerHTML)||""}${t}${i.outerHTML}`},a=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},r})),He=t((e=>{var t,o,a;return a=class extends(s(Se,K,k,u,je)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){this.rotatedAccessKeyModal=this.createModal(),this.rotatedAccessKeyModal.setContent(i(yield this.fetchWidgetPage("rotated-access-key-modal.html")));new C((()=>{var e;return null===(e=this.rotatedAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-close"]')}),{logger:this.logger}).onClick((()=>{navigator.clipboard.writeText(this.getFormData(this.rotatedAccessKeyModal.ele)["generated-key"]),this.resetFormData(this.rotatedAccessKeyModal.ele),this.rotatedAccessKeyModal.close()}))}))},a})),Ze=t((e=>{var t,o,a;return a=class extends(s(Se,K,k,u,je,He)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",o).call(this)}))}},t=new WeakSet,o=function(){return c(this,void 0,void 0,(function*(){var e;this.rotateAccessKeyModal=this.createModal(),this.rotateAccessKeyModal.setContent(i(yield this.fetchWidgetPage("rotate-access-key-modal.html")));const t=new C((()=>{var e;return null===(e=this.rotateAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.rotateAccessKeyModal.close()));const s=new C((()=>{var e;return null===(e=this.rotateAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>c(this,void 0,void 0,(function*(){var e,t;const s=null===(e=D(this.state))||void 0===e?void 0:e[0];if(!s)return void this.rotateAccessKeyModal.close();const i=yield this.actions.rotateAccessKey({id:s.id});this.rotateAccessKeyModal.close(),(null===(t=null==i?void 0:i.payload)||void 0===t?void 0:t.cleartext)&&(this.setFormData(this.rotatedAccessKeyModal.ele,{"generated-key":i.payload.cleartext}),this.rotatedAccessKeyModal.open())}))));const o=new x(null===(e=this.rotateAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.rotateAccessKeyModal.beforeOpen=()=>{const e=H(this.state);o.text=`Rotate ${e}?`}}))},a})),Ve=t((e=>{var t,i,a,n;return n=class extends(s(u,je,Se,Ze)(e)){constructor(){super(...arguments),t.add(this),a.set(this,o((e=>{e?this.rotateButton.enable():this.rotateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return c(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",i).call(this),this.subscribe(d(this,a,"f").bind(this),Z)}))}},a=new WeakMap,t=new WeakSet,i=function(){var e;this.rotateButton=new C(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="rotate-access-keys"]'),{logger:this.logger}),this.rotateButton.disable(),this.rotateButton.onClick((()=>{this.rotateAccessKeyModal.open()}))},n})),ze=t((e=>class extends(s(M,A,$e,Be,Fe,Ee,Te,Pe,Ve,Ue,b)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return c(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),Je=s((e=>class extends(ze(e)){}))(HTMLElement);customElements.define("descope-access-key-management-widget",Je);export{Je as default};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -92,14 +92,14 @@ type Notification = {
|
|
|
92
92
|
declare const AccessKeyManagementWidget: {
|
|
93
93
|
new (...rest: any[]): {
|
|
94
94
|
init(): Promise<void>;
|
|
95
|
-
"__#
|
|
95
|
+
"__#42400@#statePromise"?: Promise<{
|
|
96
96
|
[x: string]: string;
|
|
97
97
|
}>;
|
|
98
|
-
"__#
|
|
98
|
+
"__#42400@#appliedState": {
|
|
99
99
|
[x: string]: string;
|
|
100
100
|
};
|
|
101
|
-
"__#
|
|
102
|
-
"__#
|
|
101
|
+
"__#42400@#requireHttpClient"(): _descope_sdk_mixins.ConditionsHttpClient;
|
|
102
|
+
"__#42400@#fetchComponentsState"(httpClient: _descope_sdk_mixins.ConditionsHttpClient): Promise<{
|
|
103
103
|
[x: string]: string;
|
|
104
104
|
}>;
|
|
105
105
|
onWidgetRootReady: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
@@ -150,11 +150,11 @@ declare const AccessKeyManagementWidget: {
|
|
|
150
150
|
readonly cssRules: CSSRuleList;
|
|
151
151
|
});
|
|
152
152
|
nonce: string;
|
|
153
|
-
"__#
|
|
154
|
-
"__#
|
|
153
|
+
"__#42386@#setNonce": (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
154
|
+
"__#42381@#observeMappings": {};
|
|
155
155
|
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);
|
|
156
156
|
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);
|
|
157
|
-
"__#
|
|
157
|
+
"__#42380@#isInit": boolean;
|
|
158
158
|
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) & {
|
|
159
159
|
(): void;
|
|
160
160
|
(): void;
|
|
@@ -1238,8 +1238,8 @@ declare const AccessKeyManagementWidget: {
|
|
|
1238
1238
|
tabIndex: number;
|
|
1239
1239
|
blur: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1240
1240
|
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);
|
|
1241
|
-
"__#
|
|
1242
|
-
"__#
|
|
1241
|
+
"__#42379@#logger": _descope_sdk_mixins.Logger;
|
|
1242
|
+
"__#42379@#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);
|
|
1243
1243
|
logger: _descope_sdk_mixins.Logger;
|
|
1244
1244
|
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);
|
|
1245
1245
|
"__#19@#createNotificationContent"({ type, msg }: {
|
|
@@ -1252,7 +1252,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
1252
1252
|
close(): void;
|
|
1253
1253
|
show(): void;
|
|
1254
1254
|
remove(): void;
|
|
1255
|
-
"__#
|
|
1255
|
+
"__#42390@#private": any;
|
|
1256
1256
|
logger: {
|
|
1257
1257
|
error(...data: any[]): void;
|
|
1258
1258
|
warn(...data: any[]): void;
|
|
@@ -1267,7 +1267,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
1267
1267
|
type: "success" | "error";
|
|
1268
1268
|
msg: string;
|
|
1269
1269
|
}[]) => void;
|
|
1270
|
-
"__#
|
|
1270
|
+
"__#42395@#NotificationDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
|
|
1271
1271
|
logger: {
|
|
1272
1272
|
error(...data: any[]): void;
|
|
1273
1273
|
warn(...data: any[]): void;
|
|
@@ -1280,7 +1280,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
1280
1280
|
close(): void;
|
|
1281
1281
|
show(): void;
|
|
1282
1282
|
remove(): void;
|
|
1283
|
-
"__#
|
|
1283
|
+
"__#42390@#private": any;
|
|
1284
1284
|
logger: {
|
|
1285
1285
|
error(...data: any[]): void;
|
|
1286
1286
|
warn(...data: any[]): void;
|
|
@@ -1306,7 +1306,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
1306
1306
|
close(): void;
|
|
1307
1307
|
show(): void;
|
|
1308
1308
|
remove(): void;
|
|
1309
|
-
"__#
|
|
1309
|
+
"__#42390@#private": any;
|
|
1310
1310
|
logger: {
|
|
1311
1311
|
error(...data: any[]): void;
|
|
1312
1312
|
warn(...data: any[]): void;
|
|
@@ -1317,12 +1317,12 @@ declare const AccessKeyManagementWidget: {
|
|
|
1317
1317
|
readonly ele: Element;
|
|
1318
1318
|
readonly isExists: boolean;
|
|
1319
1319
|
};
|
|
1320
|
-
"__#
|
|
1321
|
-
"__#
|
|
1322
|
-
"__#
|
|
1320
|
+
"__#42389@#getComponentsVersion": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
|
|
1321
|
+
"__#42389@#getComponentsVersionSri": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
|
|
1322
|
+
"__#42389@#descopeUi": Promise<any>;
|
|
1323
1323
|
readonly descopeUi: Promise<any>;
|
|
1324
|
-
"__#
|
|
1325
|
-
"__#
|
|
1324
|
+
"__#42389@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
|
|
1325
|
+
"__#42389@#getDescopeUi": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
|
|
1326
1326
|
loadDescopeUiComponents: ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>);
|
|
1327
1327
|
readonly baseCdnUrl: string;
|
|
1328
1328
|
injectNpmLib: ((libName: string, version: string, filePath?: string, overrides?: string[], integrity?: string) => Promise<{
|
|
@@ -1343,17 +1343,17 @@ declare const AccessKeyManagementWidget: {
|
|
|
1343
1343
|
integrity?: string;
|
|
1344
1344
|
}>);
|
|
1345
1345
|
readonly config: Promise<_descope_sdk_mixins.Config>;
|
|
1346
|
-
"__#
|
|
1347
|
-
"__#
|
|
1348
|
-
"__#
|
|
1349
|
-
"__#
|
|
1346
|
+
"__#42385@#configCacheClear": (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1347
|
+
"__#42385@#_configResource": Promise<_descope_sdk_mixins.Config>;
|
|
1348
|
+
"__#42385@#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>);
|
|
1349
|
+
"__#42384@#callbacks": Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void>;
|
|
1350
1350
|
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);
|
|
1351
1351
|
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>);
|
|
1352
|
-
"__#
|
|
1353
|
-
"__#
|
|
1354
|
-
"__#
|
|
1355
|
-
"__#
|
|
1356
|
-
"__#
|
|
1352
|
+
"__#42382@#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);
|
|
1353
|
+
"__#42383@#lastBaseUrl"?: string;
|
|
1354
|
+
"__#42383@#workingBaseUrl"?: string;
|
|
1355
|
+
"__#42383@#failedUrls": Set<string>;
|
|
1356
|
+
"__#42383@#getResourceUrls": ((filename: string) => (URL & {
|
|
1357
1357
|
baseUrl: string;
|
|
1358
1358
|
}) | (URL & {
|
|
1359
1359
|
baseUrl: string;
|
|
@@ -1386,7 +1386,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
1386
1386
|
}) | (URL & {
|
|
1387
1387
|
baseUrl: string;
|
|
1388
1388
|
})[]);
|
|
1389
|
-
"__#
|
|
1389
|
+
"__#42383@#createResourceUrl": ((filename: string, baseUrl: string) => URL & {
|
|
1390
1390
|
baseUrl: string;
|
|
1391
1391
|
}) & ((filename: string, baseUrl: string) => URL & {
|
|
1392
1392
|
baseUrl: string;
|
|
@@ -11747,7 +11747,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
11747
11747
|
"__#20@#initRotatedAccessKeyModal"(): Promise<void>;
|
|
11748
11748
|
"__#7@#initWidgetRoot": (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
11749
11749
|
fetchWidgetPage(filename: string): Promise<string>;
|
|
11750
|
-
"__#
|
|
11750
|
+
"__#42397@#tryFetchLocalized"(filename: string): Promise<string>;
|
|
11751
11751
|
readonly locale: string;
|
|
11752
11752
|
readonly localeCandidates: string[];
|
|
11753
11753
|
firstAvailableLocale(availableLocales: string[]): string;
|
|
@@ -11760,7 +11760,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
11760
11760
|
getFormFieldNames(rootEle: Element): string[];
|
|
11761
11761
|
disableFormField(rootEle: Element, name: string): void;
|
|
11762
11762
|
removeFormField(rootEle: Element, name: string): void;
|
|
11763
|
-
"__#
|
|
11763
|
+
"__#42394@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
|
|
11764
11764
|
logger: {
|
|
11765
11765
|
error(...data: any[]): void;
|
|
11766
11766
|
warn(...data: any[]): void;
|
|
@@ -11769,7 +11769,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
11769
11769
|
};
|
|
11770
11770
|
}) => {
|
|
11771
11771
|
setContent(template: HTMLTemplateElement): void;
|
|
11772
|
-
"__#
|
|
11772
|
+
"__#42393@#private": any;
|
|
11773
11773
|
beforeOpen: () => void | Promise<void>;
|
|
11774
11774
|
afterClose: () => void;
|
|
11775
11775
|
nodeName: string;
|
|
@@ -11779,7 +11779,7 @@ declare const AccessKeyManagementWidget: {
|
|
|
11779
11779
|
open(): Promise<void>;
|
|
11780
11780
|
reset(): void;
|
|
11781
11781
|
remove(): void;
|
|
11782
|
-
"__#
|
|
11782
|
+
"__#42390@#private": any;
|
|
11783
11783
|
logger: {
|
|
11784
11784
|
error(...data: any[]): void;
|
|
11785
11785
|
warn(...data: any[]): void;
|
|
@@ -11835,32 +11835,32 @@ declare const AccessKeyManagementWidget: {
|
|
|
11835
11835
|
boundUserId: string;
|
|
11836
11836
|
}[]) => void;
|
|
11837
11837
|
"__#8@#onColumnSortChange": (this: any, ...args: any[]) => void;
|
|
11838
|
-
"__#
|
|
11839
|
-
"__#
|
|
11840
|
-
"__#
|
|
11838
|
+
"__#42396@#globalStyle": _descope_sdk_mixins.InjectedStyle;
|
|
11839
|
+
"__#42396@#tenantStyle": _descope_sdk_mixins.InjectedStyle;
|
|
11840
|
+
"__#42396@#customStyle": _descope_sdk_mixins.InjectedStyle;
|
|
11841
11841
|
readonly theme: _descope_sdk_mixins.ThemeOptions;
|
|
11842
11842
|
readonly styleId: string;
|
|
11843
11843
|
readonly themeOverride: Record<string, any>;
|
|
11844
|
-
"__#
|
|
11845
|
-
"__#
|
|
11846
|
-
"__#
|
|
11847
|
-
"__#
|
|
11848
|
-
readonly "__#
|
|
11849
|
-
"__#
|
|
11850
|
-
"__#
|
|
11851
|
-
readonly "__#
|
|
11852
|
-
"__#
|
|
11853
|
-
"__#
|
|
11854
|
-
"__#
|
|
11855
|
-
"__#
|
|
11844
|
+
"__#42396@#getThemeOverrideString"(): string;
|
|
11845
|
+
"__#42396@#_themeResource": Promise<void | Record<string, any>>;
|
|
11846
|
+
"__#42396@#_tenantThemeResource": Promise<Record<string, any>>;
|
|
11847
|
+
"__#42396@#fetchTheme"(): Promise<Record<string, any>>;
|
|
11848
|
+
readonly "__#42396@#themeResource": Promise<void | Record<string, any>>;
|
|
11849
|
+
"__#42396@#loadGlobalStyle"(): Promise<void>;
|
|
11850
|
+
"__#42396@#fetchTenantTheme"(): Promise<Record<string, any>>;
|
|
11851
|
+
readonly "__#42396@#tenantThemeResource": Promise<Record<string, any>>;
|
|
11852
|
+
"__#42396@#loadTenantStyle"(): Promise<void>;
|
|
11853
|
+
"__#42396@#loadCustomStyle"(): Promise<void>;
|
|
11854
|
+
"__#42396@#loadComponentsStyle"(): Promise<void>;
|
|
11855
|
+
"__#42396@#getFontsConfig"(): Promise<Record<string, {
|
|
11856
11856
|
url?: string;
|
|
11857
11857
|
}>>;
|
|
11858
|
-
"__#
|
|
11859
|
-
"__#
|
|
11860
|
-
"__#
|
|
11861
|
-
"__#
|
|
11862
|
-
"__#
|
|
11863
|
-
"__#
|
|
11858
|
+
"__#42396@#loadFonts"(): Promise<void>;
|
|
11859
|
+
"__#42396@#applyTheme"(): Promise<void>;
|
|
11860
|
+
"__#42396@#onThemeChange": () => void;
|
|
11861
|
+
"__#42396@#loadTheme"(): void;
|
|
11862
|
+
"__#42396@#toggleOsThemeChangeListener": (listen: boolean) => void;
|
|
11863
|
+
"__#42388@#debuggerEle": HTMLElement & {
|
|
11864
11864
|
updateData: (data: {
|
|
11865
11865
|
title: string;
|
|
11866
11866
|
description?: string;
|
|
@@ -11869,11 +11869,11 @@ declare const AccessKeyManagementWidget: {
|
|
|
11869
11869
|
description?: string;
|
|
11870
11870
|
}[]) => void;
|
|
11871
11871
|
};
|
|
11872
|
-
"__#
|
|
11873
|
-
"__#
|
|
11872
|
+
"__#42388@#disableDebugger"(): void;
|
|
11873
|
+
"__#42388@#enableDebugger"(): Promise<void>;
|
|
11874
11874
|
readonly debug: boolean;
|
|
11875
|
-
"__#
|
|
11876
|
-
"__#
|
|
11875
|
+
"__#42388@#handleDebugMode"(): void;
|
|
11876
|
+
"__#42388@#updateDebuggerMessages"(title: string, description: string): void;
|
|
11877
11877
|
};
|
|
11878
11878
|
};
|
|
11879
11879
|
|