@descope/user-profile-widget 0.0.103 → 0.0.105
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 +34 -34
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* @descope/user-profile-widget v0.0.
|
|
3
|
+
* @descope/user-profile-widget v0.0.105
|
|
4
4
|
*/
|
|
5
|
-
import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createSingletonMixin as s,compose as o,createTemplate as r,kebabCase as n,withMemCache as a}from"@descope/sdk-helpers";import d from"@descope/web-component";import{projectIdMixin as l,observeAttributesMixin as h,loggerMixin as c,baseUrlMixin as u,createStateManagementMixin as f,initLifecycleMixin as v,staticResourcesMixin as g,createValidateAttributesMixin as p,descopeUiMixin as w,initElementMixin as m,modalMixin as b,baseStaticUrlMixin as y,debuggerMixin as U,themeMixin as R}from"@descope/sdk-mixins";import{FlowDriver as k,AvatarDriver as S,UserAttributeDriver as W,UserAuthMethodDriver as M,ButtonDriver as I}from"@descope/sdk-component-drivers";import{createSelector as j}from"reselect";import{createAsyncThunk as A}from"@reduxjs/toolkit";import C from"@descope/web-js-sdk";import"@descope/core-js-sdk";const x=t=>t.me.data,O=j(x,(t=>t.picture)),q=j(x,(t=>t.email)),E=j(x,(t=>t.verifiedEmail)),F=j(x,(t=>t.name)),P=j(x,(t=>t.phone)),T=j(x,(t=>t.verifiedPhone)),L=j(x,(t=>t.webauthn));j(x,(t=>t.password));const N=t=>(...e)=>i=>{i.addCase(t.pending,((t,i)=>{e.forEach((({onPending:e})=>{null==e||e(t,i)}))})),i.addCase(t.fulfilled,((t,i)=>{e.forEach((({onFulfilled:e})=>{null==e||e(t,i)}))})),i.addCase(t.rejected,((t,i)=>{e.forEach((({onRejected:e})=>{null==e||e(t,i)}))}))},$=A("users/me",((t,{extra:{api:e}})=>e.user.me())),D=N($)({onFulfilled:(t,e)=>{t.me.data=e.payload}},(H=t=>t.me,{onFulfilled:t=>{H(t).loading=!1},onPending:t=>{H(t).loading=!0,H(t).error=null},onRejected:(t,e)=>{H(t).loading=!1,H(t).error=e.error}}));var H;const B={action:$,reducer:D},J=A("users/logout",((t,{extra:{api:e}})=>e.user.logout())),V={action:J,reducer:N(J)({})},z={me:{loading:!1,error:null,data:{}}},G={me:"/v1/auth/me"},K=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),Q=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return K();const s=yield e.get(G.me);return yield(e=>t(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})))(s),s.json()}))}),X=s((s=>{var r,n,a,d;const f=o(l,h,c,u)(s);return d=class extends f{constructor(){super(...arguments),r.add(this),n.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e(this,n,"f")||e(this,r,"m",a).call(this),e(this,n,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e(this,n,"f")&&e(this,r,"m",a).call(this)}))}))}},n=new WeakMap,r=new WeakSet,a=function(){this.logger.debug("creating an sdk instance"),i(this,n,((e,i,s)=>{const o=C(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.0.103"}}));return{user:Object.assign(Object.assign({},Q({httpClient:o.httpClient,mock:i})),{logout:i?()=>t(void 0,void 0,void 0,(function*(){})):o.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl},"true"===this.mock,this.widgetId),"f")},d})),Y=s((t=>{const e=o(f({name:"widget",initialState:z,reducers:{},extraReducers:t=>{B.reducer(t),V.reducer(t)},asyncActions:{getMe:B.action,logout:V.action}}),v,c,X)(t);return class extends e{constructor(...t){super(...t),this.state=z,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),Z=s((e=>{const i=o(g,p({"widget-id":p.missingAttrValidator}))(e);return class extends i{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return t(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${e}`,"text")).body}))}}})),_=s((i=>{var s,n,a;return a=class extends(o(c,v,w,m,Z,Y)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),yield Promise.all([this.actions.getMe(),e(this,s,"m",n).call(this)]),this.onWidgetRootReady()}))}},s=new WeakSet,n=function(){return t(this,void 0,void 0,(function*(){const t=r(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},a})),tt=(t={})=>{const e=r("<descope-wc></descope-wc>");return Object.entries(t).forEach((([t,i])=>{e.content.querySelector("descope-wc").setAttribute(n(t),i)})),e};function et(t){return new URLSearchParams(window.location.search).get(t)}const it=s((s=>{var r,n,d,l,h,u,f,v,g;return g=class extends(o(Y,c,_,b,y)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),f.set(this,a((t=>{this.avatar.image=t}))),v.set(this,a((t=>{this.avatar.displayName=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,O(this.state)),e(this,v,"f").call(this,F(this.state)),this.subscribe(e(this,f,"f").bind(this),O),this.subscribe(e(this,v,"f").bind(this),F)}))}},n=new WeakMap,d=new WeakMap,f=new WeakMap,v=new WeakMap,r=new WeakSet,l=function(){this.avatar.flowId&&(i(this,n,this.createModal({"data-id":"update-pic"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this))},h=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.avatar=new S((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()}))},g})),st=s((s=>{var r,n,d,l,h,u,f,v,g,p,w,m,y;return y=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,a((t=>{this.emailUserAttr.value=t}))),m.set(this,a((t=>{this.emailUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",v).call(this),e(this,w,"f").call(this,q(this.state)),e(this,m,"f").call(this,E(this.state)),this.subscribe(e(this,w,"f").bind(this),q),this.subscribe(e(this,m,"f").bind(this),E)}))}},n=new WeakMap,d=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,m=new WeakMap,r=new WeakSet,u=function(){this.emailUserAttr.editFlowId&&(i(this,n,this.createModal({"data-id":"edit-email"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this))},f=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},v=function(){this.emailUserAttr.deleteFlowId&&(i(this,l,this.createModal({"data-id":"delete-email"}),"f"),i(this,h,new k((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",g).bind(this),e(this,r,"m",g).call(this))},g=function(){e(this,l,"f").setContent(tt({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.emailUserAttr=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()})),this.emailUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,l,"f"))||void 0===t||t.open()}))},y})),ot=s((s=>{var r,n,d,l,h,u,f,v,g,p,w,m;return m=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,a((t=>{this.nameUserAttr.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",v).call(this),e(this,w,"f").call(this,F(this.state)),this.subscribe(e(this,w,"f").bind(this),F)}))}},n=new WeakMap,d=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,r=new WeakSet,u=function(){this.nameUserAttr.editFlowId&&(i(this,n,this.createModal({"data-id":"edit-name"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this))},f=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},v=function(){this.nameUserAttr.deleteFlowId&&(i(this,l,this.createModal({"data-id":"delete-name"}),"f"),i(this,h,new k((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",g).bind(this),e(this,r,"m",g).call(this))},g=function(){e(this,l,"f").setContent(tt({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.nameUserAttr=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()})),this.nameUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,l,"f"))||void 0===t||t.open()}))},m})),rt=s((s=>{var r,n,d,l,h,u,f,v,g,p,w,m,y;return y=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,a((t=>{this.phoneUserAttr.value=t}))),m.set(this,a((t=>{this.phoneUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",v).call(this),e(this,w,"f").call(this,P(this.state)),e(this,m,"f").call(this,T(this.state)),this.subscribe(e(this,w,"f").bind(this),P),this.subscribe(e(this,m,"f").bind(this),T)}))}},n=new WeakMap,d=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,m=new WeakMap,r=new WeakSet,u=function(){this.phoneUserAttr.editFlowId&&(i(this,n,this.createModal({"data-id":"edit-phone"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this))},f=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},v=function(){this.phoneUserAttr.deleteFlowId&&(i(this,l,this.createModal({"data-id":"delete-phone"}),"f"),i(this,h,new k((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",g).bind(this),e(this,r,"m",g).call(this))},g=function(){e(this,l,"f").setContent(tt({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.phoneUserAttr=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()})),this.phoneUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,l,"f"))||void 0===t||t.open()}))},y})),nt=s((s=>{var r,n,d,l,h,u,f,v;return v=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),f.set(this,a((t=>{this.passkeyUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,L(this.state)),this.subscribe(e(this,f,"f").bind(this),L)}))}},n=new WeakMap,d=new WeakMap,f=new WeakMap,r=new WeakSet,l=function(){this.passkeyUserAuthMethod.flowId&&(i(this,n,this.createModal({"data-id":"passkey"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this))},h=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.passkeyUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()}))},v})),at=s((s=>{var r,n,a,d,l,h,u;return u=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",h).call(this),e(this,r,"m",d).call(this)}))}},n=new WeakMap,a=new WeakMap,r=new WeakSet,d=function(){this.passwordUserAuthMethod.flowId&&(i(this,n,this.createModal({"data-id":"password"}),"f"),i(this,a,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",l).bind(this),e(this,r,"m",l).call(this))},l=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close()}))},h=function(){this.passwordUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()}))},u})),dt=s((i=>{var s,r,n;return n=class extends(o(Y,c,_,b)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,s,"m",r).call(this)}))}},s=new WeakSet,r=function(){this.logout=new I((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>t(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},n})),lt="widget-flow",ht=s((i=>{var s,r,n;return n=class extends(o(v,b,Y,c)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this);const o=et(lt);o&&(!function(t){if(window.history.replaceState&&et(t)){const e=new URL(window.location.href),i=new URLSearchParams(e.search);i.delete(t),e.search=i.toString(),window.history.replaceState({},"",e.toString())}}(lt),e(this,s,"m",r).call(this,o))}))}},s=new WeakSet,r=function(t){const e=this.createModal({"data-id":"redirect-flow"});e.setContent(tt({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl}));new k((()=>{var t;return null===(t=e.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>{e.close(),this.actions.getMe()})),e.afterClose=()=>{e.remove()},e.open()},n})),ct=s((e=>class extends(o(U,R,ht,st,it,ot,rt,nt,at,dt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),ut=o((e=>class extends(ct(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),d.sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.0.103"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",ut);export{ut as default};
|
|
5
|
+
import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createSingletonMixin as s,compose as o,createTemplate as r,kebabCase as n,withMemCache as a}from"@descope/sdk-helpers";import d from"@descope/web-component";import{projectIdMixin as l,observeAttributesMixin as h,loggerMixin as c,baseUrlMixin as u,createStateManagementMixin as f,initLifecycleMixin as v,staticResourcesMixin as g,createValidateAttributesMixin as p,descopeUiMixin as w,initElementMixin as m,modalMixin as b,baseStaticUrlMixin as y,debuggerMixin as U,themeMixin as R}from"@descope/sdk-mixins";import{FlowDriver as k,AvatarDriver as S,UserAttributeDriver as W,UserAuthMethodDriver as M,ButtonDriver as I}from"@descope/sdk-component-drivers";import{createSelector as j}from"reselect";import{createAsyncThunk as A}from"@reduxjs/toolkit";import C from"@descope/web-js-sdk";import"@descope/core-js-sdk";const x=t=>t.me.data,O=j(x,(t=>t.picture)),q=j(x,(t=>t.email)),E=j(x,(t=>t.verifiedEmail)),F=j(x,(t=>t.name)),P=j(x,(t=>t.phone)),T=j(x,(t=>t.verifiedPhone)),L=j(x,(t=>t.webauthn));j(x,(t=>t.password));const N=t=>(...e)=>i=>{i.addCase(t.pending,((t,i)=>{e.forEach((({onPending:e})=>{null==e||e(t,i)}))})),i.addCase(t.fulfilled,((t,i)=>{e.forEach((({onFulfilled:e})=>{null==e||e(t,i)}))})),i.addCase(t.rejected,((t,i)=>{e.forEach((({onRejected:e})=>{null==e||e(t,i)}))}))},$=A("users/me",((t,{extra:{api:e}})=>e.user.me())),D=N($)({onFulfilled:(t,e)=>{t.me.data=e.payload}},(H=t=>t.me,{onFulfilled:t=>{H(t).loading=!1},onPending:t=>{H(t).loading=!0,H(t).error=null},onRejected:(t,e)=>{H(t).loading=!1,H(t).error=e.error}}));var H;const B={action:$,reducer:D},J=A("users/logout",((t,{extra:{api:e}})=>e.user.logout())),V={action:J,reducer:N(J)({})},z={me:{loading:!1,error:null,data:{}}},G={me:"/v1/auth/me"},K=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),Q=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return K();const s=yield e.get(G.me);return yield(e=>t(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})))(s),s.json()}))}),X=s((s=>{var r,n,a,d;const f=o(l,h,c,u)(s);return d=class extends f{constructor(){super(...arguments),r.add(this),n.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e(this,n,"f")||e(this,r,"m",a).call(this),e(this,n,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e(this,n,"f")&&e(this,r,"m",a).call(this)}))}))}},n=new WeakMap,r=new WeakSet,a=function(){this.logger.debug("creating an sdk instance"),i(this,n,((e,i,s)=>{const o=C(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.0.105"}}));return{user:Object.assign(Object.assign({},Q({httpClient:o.httpClient,mock:i})),{logout:i?()=>t(void 0,void 0,void 0,(function*(){})):o.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl},"true"===this.mock,this.widgetId),"f")},d})),Y=s((t=>{const e=o(f({name:"widget",initialState:z,reducers:{},extraReducers:t=>{B.reducer(t),V.reducer(t)},asyncActions:{getMe:B.action,logout:V.action}}),v,c,X)(t);return class extends e{constructor(...t){super(...t),this.state=z,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),Z=s((e=>{const i=o(g,p({"widget-id":p.missingAttrValidator}))(e);return class extends i{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return t(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${e}`,"text")).body}))}}})),_=s((i=>{var s,n,a;return a=class extends(o(c,v,w,m,Z,Y)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),yield Promise.all([this.actions.getMe(),e(this,s,"m",n).call(this)]),this.onWidgetRootReady()}))}},s=new WeakSet,n=function(){return t(this,void 0,void 0,(function*(){const t=r(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},a})),tt=(t={})=>{const e=r("<descope-wc></descope-wc>");return Object.entries(t).forEach((([t,i])=>{e.content.querySelector("descope-wc").setAttribute(n(t),i)})),e};function et(t){return new URLSearchParams(window.location.search).get(t)}const it=s((s=>{var r,n,d,l,h,u,f,v,g;return g=class extends(o(Y,c,_,b,y)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),f.set(this,a((t=>{this.avatar.image=t}))),v.set(this,a((t=>{this.avatar.displayName=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,O(this.state)),e(this,v,"f").call(this,F(this.state)),this.subscribe(e(this,f,"f").bind(this),O),this.subscribe(e(this,v,"f").bind(this),F)}))}},n=new WeakMap,d=new WeakMap,f=new WeakMap,v=new WeakMap,r=new WeakSet,l=function(){this.avatar.flowId&&(i(this,n,this.createModal({"data-id":"update-pic"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this))},h=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.avatar=new S((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()}))},g})),st=s((s=>{var r,n,d,l,h,u,f,v,g,p,w,m,y;return y=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,a((t=>{this.emailUserAttr.value=t}))),m.set(this,a((t=>{this.emailUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",v).call(this),e(this,w,"f").call(this,q(this.state)),e(this,m,"f").call(this,E(this.state)),this.subscribe(e(this,w,"f").bind(this),q),this.subscribe(e(this,m,"f").bind(this),E)}))}},n=new WeakMap,d=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,m=new WeakMap,r=new WeakSet,u=function(){this.emailUserAttr.editFlowId&&(i(this,n,this.createModal({"data-id":"edit-email"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this))},f=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},v=function(){this.emailUserAttr.deleteFlowId&&(i(this,l,this.createModal({"data-id":"delete-email"}),"f"),i(this,h,new k((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",g).bind(this),e(this,r,"m",g).call(this))},g=function(){e(this,l,"f").setContent(tt({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.emailUserAttr=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()})),this.emailUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,l,"f"))||void 0===t||t.open()}))},y})),ot=s((s=>{var r,n,d,l,h,u,f,v,g,p,w,m;return m=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,a((t=>{this.nameUserAttr.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",v).call(this),e(this,w,"f").call(this,F(this.state)),this.subscribe(e(this,w,"f").bind(this),F)}))}},n=new WeakMap,d=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,r=new WeakSet,u=function(){this.nameUserAttr.editFlowId&&(i(this,n,this.createModal({"data-id":"edit-name"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this))},f=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},v=function(){this.nameUserAttr.deleteFlowId&&(i(this,l,this.createModal({"data-id":"delete-name"}),"f"),i(this,h,new k((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",g).bind(this),e(this,r,"m",g).call(this))},g=function(){e(this,l,"f").setContent(tt({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.nameUserAttr=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()})),this.nameUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,l,"f"))||void 0===t||t.open()}))},m})),rt=s((s=>{var r,n,d,l,h,u,f,v,g,p,w,m,y;return y=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,a((t=>{this.phoneUserAttr.value=t}))),m.set(this,a((t=>{this.phoneUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",v).call(this),e(this,w,"f").call(this,P(this.state)),e(this,m,"f").call(this,T(this.state)),this.subscribe(e(this,w,"f").bind(this),P),this.subscribe(e(this,m,"f").bind(this),T)}))}},n=new WeakMap,d=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,m=new WeakMap,r=new WeakSet,u=function(){this.phoneUserAttr.editFlowId&&(i(this,n,this.createModal({"data-id":"edit-phone"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this))},f=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},v=function(){this.phoneUserAttr.deleteFlowId&&(i(this,l,this.createModal({"data-id":"delete-phone"}),"f"),i(this,h,new k((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",g).bind(this),e(this,r,"m",g).call(this))},g=function(){e(this,l,"f").setContent(tt({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.phoneUserAttr=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()})),this.phoneUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,l,"f"))||void 0===t||t.open()}))},y})),nt=s((s=>{var r,n,d,l,h,u,f,v;return v=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0),f.set(this,a((t=>{this.passkeyUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,L(this.state)),this.subscribe(e(this,f,"f").bind(this),L)}))}},n=new WeakMap,d=new WeakMap,f=new WeakMap,r=new WeakSet,l=function(){this.passkeyUserAuthMethod.flowId&&(i(this,n,this.createModal({"data-id":"passkey"}),"f"),i(this,d,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this))},h=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.passkeyUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()}))},v})),at=s((s=>{var r,n,a,d,l,h,u;return u=class extends(o(Y,c,_,b)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,r,"m",h).call(this),e(this,r,"m",d).call(this)}))}},n=new WeakMap,a=new WeakMap,r=new WeakSet,d=function(){this.passwordUserAuthMethod.flowId&&(i(this,n,this.createModal({"data-id":"password"}),"f"),i(this,a,new k((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",l).bind(this),e(this,r,"m",l).call(this))},l=function(){e(this,n,"f").setContent(tt({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close()}))},h=function(){this.passwordUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,n,"f"))||void 0===t||t.open()}))},u})),dt=s((i=>{var s,r,n;return n=class extends(o(Y,c,_,b)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,s,"m",r).call(this)}))}},s=new WeakSet,r=function(){this.logout=new I((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>t(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},n})),lt="widget-flow",ht=s((i=>{var s,r,n;return n=class extends(o(v,b,Y,c)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this);const o=et(lt);o&&(!function(t){if(window.history.replaceState&&et(t)){const e=new URL(window.location.href),i=new URLSearchParams(e.search);i.delete(t),e.search=i.toString(),window.history.replaceState({},"",e.toString())}}(lt),e(this,s,"m",r).call(this,o))}))}},s=new WeakSet,r=function(t){const e=this.createModal({"data-id":"redirect-flow"});e.setContent(tt({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl}));new k((()=>{var t;return null===(t=e.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>{e.close(),this.actions.getMe()})),e.afterClose=()=>{e.remove()},e.open()},n})),ct=s((e=>class extends(o(U,R,ht,st,it,ot,rt,nt,at,dt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),ut=o((e=>class extends(ct(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),d.sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.0.105"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",ut);export{ut as default};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ declare const UserProfileWidget: {
|
|
|
18
18
|
logout: _descope_sdk_component_drivers.ButtonDriver;
|
|
19
19
|
"__#16@#initLogout"(): void;
|
|
20
20
|
onWidgetRootReady: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
|
|
21
|
-
"__#
|
|
21
|
+
"__#12335@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
|
|
22
22
|
logger: {
|
|
23
23
|
error(...data: any[]): void;
|
|
24
24
|
warn(...data: any[]): void;
|
|
@@ -27,7 +27,7 @@ declare const UserProfileWidget: {
|
|
|
27
27
|
};
|
|
28
28
|
}) => {
|
|
29
29
|
setContent(template: HTMLTemplateElement): void;
|
|
30
|
-
"__#
|
|
30
|
+
"__#12334@#private": any;
|
|
31
31
|
beforeOpen: () => void | Promise<void>;
|
|
32
32
|
afterClose: () => void;
|
|
33
33
|
nodeName: string;
|
|
@@ -35,7 +35,7 @@ declare const UserProfileWidget: {
|
|
|
35
35
|
open(): Promise<void>;
|
|
36
36
|
reset(): void;
|
|
37
37
|
remove(): void;
|
|
38
|
-
"__#
|
|
38
|
+
"__#12332@#private": any;
|
|
39
39
|
logger: {
|
|
40
40
|
error(...data: any[]): void;
|
|
41
41
|
warn(...data: any[]): void;
|
|
@@ -46,21 +46,21 @@ declare const UserProfileWidget: {
|
|
|
46
46
|
readonly ele: Element;
|
|
47
47
|
};
|
|
48
48
|
createModal(config?: Record<string, string>): _descope_sdk_component_drivers.ModalDriver;
|
|
49
|
-
"__#
|
|
50
|
-
"__#
|
|
51
|
-
"__#
|
|
52
|
-
"__#
|
|
53
|
-
"__#
|
|
54
|
-
"__#
|
|
55
|
-
"__#
|
|
56
|
-
"__#
|
|
49
|
+
"__#12331@#errorCbsSym": symbol;
|
|
50
|
+
"__#12331@#loadCbsSym": symbol;
|
|
51
|
+
"__#12331@#getComponentsVersion": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
|
|
52
|
+
"__#12331@#exposeAlternateEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
|
|
53
|
+
"__#12331@#handleFallbackScript": ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>);
|
|
54
|
+
"__#12331@#registerEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
|
|
55
|
+
"__#12331@#getDescopeUiLoadingScript": (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>);
|
|
56
|
+
"__#12331@#descopeUi": Promise<any>;
|
|
57
57
|
readonly descopeUi: Promise<any>;
|
|
58
|
-
"__#
|
|
58
|
+
"__#12331@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
|
|
59
59
|
loadDescopeUiComponents: ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>);
|
|
60
|
-
"__#
|
|
60
|
+
"__#12331@#getDescopeUi": (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>);
|
|
61
61
|
readonly config: any;
|
|
62
|
-
"__#
|
|
63
|
-
"__#
|
|
62
|
+
"__#12328@#_configResource": any;
|
|
63
|
+
"__#12328@#fetchConfig": (() => Promise<{
|
|
64
64
|
projectConfig: _descope_sdk_mixins.ProjectConfiguration;
|
|
65
65
|
executionContext: {
|
|
66
66
|
geo: string;
|
|
@@ -1057,18 +1057,18 @@ declare const UserProfileWidget: {
|
|
|
1057
1057
|
blur: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
1058
1058
|
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);
|
|
1059
1059
|
readonly projectId: string;
|
|
1060
|
-
"__#
|
|
1061
|
-
"__#
|
|
1060
|
+
"__#12327@#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);
|
|
1061
|
+
"__#12326@#observeMappings": {};
|
|
1062
1062
|
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);
|
|
1063
1063
|
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);
|
|
1064
|
-
"__#
|
|
1065
|
-
"__#
|
|
1064
|
+
"__#12325@#isInit": boolean;
|
|
1065
|
+
"__#12324@#logger": {
|
|
1066
1066
|
error(...data: any[]): void;
|
|
1067
1067
|
warn(...data: any[]): void;
|
|
1068
1068
|
info(...data: any[]): void;
|
|
1069
1069
|
debug(...data: any[]): void;
|
|
1070
1070
|
};
|
|
1071
|
-
"__#
|
|
1071
|
+
"__#12324@#wrapLogger": ((logger: Partial<{
|
|
1072
1072
|
error(...data: any[]): void;
|
|
1073
1073
|
warn(...data: any[]): void;
|
|
1074
1074
|
info(...data: any[]): void;
|
|
@@ -2000,20 +2000,20 @@ declare const UserProfileWidget: {
|
|
|
2000
2000
|
"__#11@#onValueUpdate": (email: any) => void;
|
|
2001
2001
|
"__#11@#onValueBadgeLabelUpdate": (isEmailVerified: any) => void;
|
|
2002
2002
|
"__#17@#createFlowRedirectModal"(widgetFlow: string): void;
|
|
2003
|
-
"__#
|
|
2003
|
+
"__#12337@#globalStyleTag": HTMLStyleElement;
|
|
2004
2004
|
readonly theme: _descope_sdk_mixins.ThemeOptions;
|
|
2005
2005
|
readonly styleId: string;
|
|
2006
|
-
"__#
|
|
2007
|
-
"__#
|
|
2008
|
-
readonly "__#
|
|
2009
|
-
"__#
|
|
2010
|
-
"__#
|
|
2011
|
-
"__#
|
|
2006
|
+
"__#12337@#_themeResource": Promise<void | Record<string, any>>;
|
|
2007
|
+
"__#12337@#fetchTheme"(): Promise<Record<string, any>>;
|
|
2008
|
+
readonly "__#12337@#themeResource": Promise<void | Record<string, any>>;
|
|
2009
|
+
"__#12337@#loadGlobalStyle"(): Promise<void>;
|
|
2010
|
+
"__#12337@#loadComponentsStyle"(): Promise<void>;
|
|
2011
|
+
"__#12337@#getFontsConfig"(): Promise<Record<string, {
|
|
2012
2012
|
url?: string;
|
|
2013
2013
|
}>>;
|
|
2014
|
-
"__#
|
|
2015
|
-
"__#
|
|
2016
|
-
"__#
|
|
2014
|
+
"__#12337@#loadFonts"(): Promise<void>;
|
|
2015
|
+
"__#12337@#applyTheme"(): Promise<void>;
|
|
2016
|
+
"__#12330@#debuggerEle": HTMLElement & {
|
|
2017
2017
|
updateData: (data: {
|
|
2018
2018
|
title: string;
|
|
2019
2019
|
description?: string;
|
|
@@ -2022,11 +2022,11 @@ declare const UserProfileWidget: {
|
|
|
2022
2022
|
description?: string;
|
|
2023
2023
|
}[]) => void;
|
|
2024
2024
|
};
|
|
2025
|
-
"__#
|
|
2026
|
-
"__#
|
|
2025
|
+
"__#12330@#disableDebugger"(): void;
|
|
2026
|
+
"__#12330@#enableDebugger"(): Promise<void>;
|
|
2027
2027
|
readonly debug: boolean;
|
|
2028
|
-
"__#
|
|
2029
|
-
"__#
|
|
2028
|
+
"__#12330@#handleDebugMode"(): void;
|
|
2029
|
+
"__#12330@#updateDebuggerMessages"(title: string, description: string): void;
|
|
2030
2030
|
};
|
|
2031
2031
|
};
|
|
2032
2032
|
|