@descope/web-component 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/descope-wc/BaseDescopeWc.js +1 -1
- package/dist/cjs/descope-wc/DescopeWc.js +1 -1
- package/dist/cjs/descope-wc/DescopeWc.js.map +1 -1
- package/dist/cjs/mixins/passwordManagerMixin.js +1 -1
- package/dist/cjs/mixins/passwordManagerMixin.js.map +1 -1
- package/dist/esm/descope-wc/BaseDescopeWc.js +1 -1
- package/dist/esm/descope-wc/DescopeWc.js +1 -1
- package/dist/esm/descope-wc/DescopeWc.js.map +1 -1
- package/dist/esm/mixins/passwordManagerMixin.js +1 -1
- package/dist/esm/mixins/passwordManagerMixin.js.map +1 -1
- package/dist/index.d.ts +73 -72
- package/dist/index.js +2 -2
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__classPrivateFieldSet as e,__classPrivateFieldGet as t}from"tslib";import{createSingletonMixin as o,compose as r}from"@descope/sdk-helpers";import{loggerMixin as n}from"@descope/sdk-mixins";import{DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY as i,DESCOPE_ATTRIBUTE_EXCLUDE_FIELD as s}from"../constants/index.js";import{getFirstNonEmptyValue as a}from"../helpers/helpers.js";import"../helpers/state.js";import"@descope/escape-markdown";import"../helpers/webauthn.js";const
|
|
1
|
+
import{__classPrivateFieldSet as e,__classPrivateFieldGet as t}from"tslib";import{createSingletonMixin as o,compose as r}from"@descope/sdk-helpers";import{loggerMixin as n}from"@descope/sdk-mixins";import{DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY as i,DESCOPE_ATTRIBUTE_EXCLUDE_FIELD as s}from"../constants/index.js";import{getFirstNonEmptyValue as a}from"../helpers/helpers.js";import"../helpers/state.js";import"@descope/escape-markdown";import"../helpers/webauthn.js";const l=["externalId","email","phone"],d=["newPassword","password"],u="data-username-anchor",c=e=>{var t;if(!e)return"";try{const o=null===(t=window.sessionStorage)||void 0===t?void 0:t.getItem(i);if(!o)return"";const r=JSON.parse(o);return r.executionId===e&&r.loginId||""}catch(e){return""}},v=(e,t,o,r)=>{var n;const i=(null==o?void 0:o.email)||(null===(n=null==o?void 0:o.loginIds)||void 0===n?void 0:n[0]);(e=>e.querySelector("descope-new-password")||e.querySelector("descope-password"))(t)?i?(e=>{const t=['input[autocomplete="username"]',...l.map((e=>`[name="${e}"]`))].join(", ");return e.some((e=>e.querySelector(t)))})([e,t])?r.debug("Username anchor: screen already has an identifier field"):(r.debug("Username anchor: injecting hidden username input"),e.appendChild((e=>{const t=document.createElement("input");return t.setAttribute("autocomplete","username"),t.setAttribute("name","username"),t.setAttribute("type","email"),t.setAttribute("readonly","true"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),t.setAttribute(s,"true"),t.setAttribute(u,"true"),t.setAttribute("value",e),t.value=e,Object.assign(t.style,{position:"absolute",opacity:"0",pointerEvents:"none",height:"0",border:"0"}),t})(i))):r.debug("Username anchor: no user identifier available"):r.debug("Username anchor: no password component on screen")},m=o((o=>{var s,m,p,h,g;const b=r(n)(o);return g=class extends b{constructor(){super(...arguments),s.add(this),m.set(this,void 0)}updateScreenUser(o){var r,n,i;e(this,m,{email:null==o?void 0:o.email,loginIds:(null===(r=null==o?void 0:o.loginIds)||void 0===r?void 0:r.length)?o.loginIds:[c(t(this,s,"a",h))||(null===(i=null===(n=t(this,s,"a",p).sdk)||void 0===n?void 0:n.getLastUserLoginId)||void 0===i?void 0:i.call(n))].filter(Boolean)},"f")}updateUsernameAnchor(){document.querySelectorAll(`[${u}="true"]`).forEach((e=>e.remove())),v(this,t(this,s,"a",p).contentRootElement,t(this,m,"f"),this.logger)}captureLastSubmittedLoginId(e={},o){const r=a(e,l);r&&((e,t)=>{var o;if(e&&t)try{null===(o=window.sessionStorage)||void 0===o||o.setItem(i,JSON.stringify({executionId:t,loginId:e}))}catch(e){}})(r,o||t(this,s,"a",h))}storeCredentials(e={}){var o,r,n,i,s,u;const c=a(e,l)||(null===(o=t(this,m,"f"))||void 0===o?void 0:o.email)||(null===(n=null===(r=t(this,m,"f"))||void 0===r?void 0:r.loginIds)||void 0===n?void 0:n[0]),v=a(e,d);if(c&&v)try{if(!globalThis.PasswordCredential)return;const e=new globalThis.PasswordCredential({id:c,password:v});null===(u=null===(s=null===(i=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===i?void 0:i.store)||void 0===s?void 0:s.call(i,e))||void 0===u||u.catch((e=>{this.logger.error("Could not store credentials",null==e?void 0:e.message)}))}catch(e){this.logger.error("Could not store credentials",e.message)}}},m=new WeakMap,s=new WeakSet,p=function(){return this},h=function(){var e,o;return(null===(o=null===(e=t(this,s,"a",p).flowState)||void 0===e?void 0:e.current)||void 0===o?void 0:o.executionId)||""},g}));export{m as passwordManagerMixin};
|
|
2
2
|
//# sourceMappingURL=passwordManagerMixin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passwordManagerMixin.js","sources":["../../../src/lib/mixins/passwordManagerMixin.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport { compose, createSingletonMixin } from '@descope/sdk-helpers';\nimport { loggerMixin } from '@descope/sdk-mixins';\nimport {\n DESCOPE_ATTRIBUTE_EXCLUDE_FIELD,\n DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY,\n} from '../constants';\nimport { getFirstNonEmptyValue } from '../helpers';\nimport type { ScreenStateUser } from '../types';\n\nconst LOGIN_ID_FIELDS = ['externalId', 'email', 'phone'];\nconst PASSWORD_FIELDS = ['newPassword', 'password'];\n\nconst USERNAME_ANCHOR_ATTRIBUTE = 'data-username-anchor';\n\n// What the mixin needs from its host. Defined as an interface (not imported)\n// to avoid a circular dependency on DescopeWc. Exported so declaration emit\n// can name it from BaseDescopeWc's composed base class.\nexport interface PasswordManagerHost {\n contentRootElement?: HTMLElement;\n flowState?: { current?: { executionId?: string } };\n sdk?: { getLastUserLoginId?: () => string };\n}\n\n// the last identifier the user submitted on a previous screen in this flow\n// (e.g. the email entered before a magic link was sent), used when neither\n// the flow state nor a previous authentication provides one.\n// kept in sessionStorage (tab scoped, cleared when the tab closes) so it\n// survives page reloads during the flow, and scoped to the flow execution so\n// a stale identifier is never carried into another flow (or another user)\n// running in the same tab\nconst getLastSubmittedLoginId = (executionId: string): string => {\n // a missing execution id must never match anything, otherwise two flows\n // without one would share the stored identifier\n if (!executionId) {\n return '';\n }\n try {\n const raw = window.sessionStorage?.getItem(\n DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY,\n );\n if (!raw) {\n return '';\n }\n const stored = JSON.parse(raw);\n return stored.executionId === executionId ? stored.loginId || '' : '';\n } catch (e) {\n return '';\n }\n};\n\nconst setLastSubmittedLoginId = (loginId: string, executionId: string) => {\n if (!loginId || !executionId) {\n return;\n }\n try {\n window.sessionStorage?.setItem(\n DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY,\n JSON.stringify({ executionId, loginId }),\n );\n } catch (e) {\n // sessionStorage unavailable, losing reload persistence is acceptable\n }\n};\n\nconst clearUsernameAnchorIfExists = () => {\n document\n .querySelectorAll(`[${USERNAME_ANCHOR_ATTRIBUTE}=\"true\"]`)\n .forEach((ele) => ele.remove());\n};\n\nconst findPasswordComponent = (contentRootEle: Element) =>\n contentRootEle.querySelector('descope-new-password') ||\n contentRootEle.querySelector('descope-password');\n\n// an identifier is already on screen when there is an autocomplete=\"username\"\n// input, or a component collecting one of the login id fields (e.g.\n// descope-email-field renders its input inside a closed shadow root, so only\n// its name attribute is visible from here)\nconst hasLoginIdField = (roots: Element[]) => {\n const selector = [\n 'input[autocomplete=\"username\"]',\n ...LOGIN_ID_FIELDS.map((field) => `[name=\"${field}\"]`),\n ].join(', ');\n return roots.some((root) => root.querySelector(selector));\n};\n\nconst createUsernameAnchor = (loginId: string) => {\n const input = document.createElement('input');\n input.setAttribute('autocomplete', 'username');\n input.setAttribute('name', 'username');\n input.setAttribute('type', 'email');\n input.setAttribute('readonly', 'true');\n input.setAttribute('tabindex', '-1');\n input.setAttribute('aria-hidden', 'true');\n // never collect the anchor's value into the submitted form data\n input.setAttribute(DESCOPE_ATTRIBUTE_EXCLUDE_FIELD, 'true');\n // cleaned up by clearUsernameAnchorIfExists between screens\n input.setAttribute(USERNAME_ANCHOR_ATTRIBUTE, 'true');\n // some password managers read the markup value rather than the property\n input.setAttribute('value', loginId);\n input.value = loginId;\n // real input hidden via CSSOM: managers ignore type=\"hidden\", and strict\n // CSP style-src blocks style attributes\n Object.assign(input.style, {\n position: 'absolute',\n opacity: '0',\n pointerEvents: 'none',\n height: '0',\n border: '0',\n });\n return input;\n};\n\n// Anchors a hidden autocomplete=\"username\" input on password screens that\n// have no identifier input, so password managers can associate the credential\n// with a user (descope/etc#16712). Appended to the host light DOM — password\n// manager save heuristics (verified on WebKit) do not scan shadow trees\nconst injectUsernameAnchorIfNeeded = (\n hostEle: HTMLElement,\n contentRootEle: Element,\n user: ScreenStateUser | undefined,\n logger: { debug: (...args: string[]) => void },\n) => {\n const loginId = user?.email || user?.loginIds?.[0];\n\n if (!findPasswordComponent(contentRootEle)) {\n logger.debug('Username anchor: no password component on screen');\n return;\n }\n if (!loginId) {\n logger.debug('Username anchor: no user identifier available');\n return;\n }\n if (hasLoginIdField([hostEle, contentRootEle])) {\n logger.debug('Username anchor: screen already has an identifier field');\n return;\n }\n\n logger.debug('Username anchor: injecting hidden username input');\n hostEle.appendChild(createUsernameAnchor(loginId));\n};\n\n/**\n * Password manager integrations: keeps track of the current screen's user\n * identifier, anchors a hidden username input on password screens that have\n * no identifier input, and stores submitted credentials via the Credential\n * Management API.\n */\nexport const passwordManagerMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) => {\n const BaseClass = compose(loggerMixin)(superclass);\n\n return class PasswordManagerMixinClass extends BaseClass {\n // the authenticated user of the current screen (if any), used as a\n // fallback identifier for password manager integrations on screens that\n // have no identifier input (e.g. step-up password change)\n #screenUser?: ScreenStateUser;\n\n get #host() {\n return this as unknown as PasswordManagerHost;\n }\n\n get #executionId() {\n return this.#host.flowState?.current?.executionId || '';\n }\n\n // called on every screen render. flow state does not always carry the\n // user (e.g. after magic link auth), so fall back to the login id\n // submitted earlier in this flow, then to the last authenticated user\n updateScreenUser(stateUser?: ScreenStateUser) {\n this.#screenUser = {\n email: stateUser?.email,\n loginIds: stateUser?.loginIds?.length\n ? stateUser.loginIds\n : [\n getLastSubmittedLoginId(this.#executionId) ||\n this.#host.sdk?.getLastUserLoginId?.(),\n ].filter(Boolean),\n };\n }\n\n updateUsernameAnchor() {\n // clear the previous screen's anchor, so each screen gets an anchor\n // only if it needs one\n clearUsernameAnchorIfExists();\n\n injectUsernameAnchorIfNeeded(\n this,\n this.#host.contentRootElement,\n this.#screenUser,\n this.logger,\n );\n }\n\n // called after a successful next(): on flows that render their first\n // screen before the flow starts, the execution id only exists on the\n // response, so prefer it over the current flow state\n captureLastSubmittedLoginId(formData = {}, responseExecutionId?: string) {\n const loginId = getFirstNonEmptyValue(formData, LOGIN_ID_FIELDS);\n if (loginId) {\n setLastSubmittedLoginId(\n loginId,\n responseExecutionId || this.#executionId,\n );\n }\n }\n\n // handle storing passwords in password managers\n storeCredentials(formData = {}) {\n const id =\n getFirstNonEmptyValue(formData, LOGIN_ID_FIELDS) ||\n this.#screenUser?.email ||\n this.#screenUser?.loginIds?.[0];\n const password = getFirstNonEmptyValue(formData, PASSWORD_FIELDS);\n\n // PasswordCredential not supported in Firefox\n if (id && password) {\n try {\n if (!globalThis.PasswordCredential) {\n return;\n }\n const cred = new globalThis.PasswordCredential({ id, password });\n\n navigator?.credentials?.store?.(cred);\n } catch (e) {\n this.logger.error('Could not store credentials', e.message);\n }\n }\n }\n };\n },\n);\n"],"names":["LOGIN_ID_FIELDS","PASSWORD_FIELDS","USERNAME_ANCHOR_ATTRIBUTE","getLastSubmittedLoginId","executionId","raw","_a","window","sessionStorage","getItem","DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY","stored","JSON","parse","loginId","e","injectUsernameAnchorIfNeeded","hostEle","contentRootEle","user","logger","email","loginIds","querySelector","findPasswordComponent","roots","selector","map","field","join","some","root","hasLoginIdField","debug","appendChild","input","document","createElement","setAttribute","DESCOPE_ATTRIBUTE_EXCLUDE_FIELD","value","Object","assign","style","position","opacity","pointerEvents","height","border","createUsernameAnchor","passwordManagerMixin","createSingletonMixin","superclass","BaseClass","compose","loggerMixin","constructor","_PasswordManagerMixinClass_screenUser","set","this","updateScreenUser","stateUser","__classPrivateFieldSet","_b","length","__classPrivateFieldGet","_PasswordManagerMixinClass_instances","_PasswordManagerMixinClass_executionId_get","_d","_c","_PasswordManagerMixinClass_host_get","sdk","getLastUserLoginId","call","filter","Boolean","updateUsernameAnchor","querySelectorAll","forEach","ele","remove","contentRootElement","captureLastSubmittedLoginId","formData","responseExecutionId","getFirstNonEmptyValue","setItem","stringify","setLastSubmittedLoginId","storeCredentials","id","password","globalThis","PasswordCredential","cred","_f","_e","navigator","credentials","store","error","message","flowState","current"],"mappings":"ieAUA,MAAMA,EAAkB,CAAC,aAAc,QAAS,SAC1CC,EAAkB,CAAC,cAAe,YAElCC,EAA4B,uBAkB5BC,EAA2BC,UAG/B,IAAKA,EACH,MAAO,GAET,IACE,MAAMC,EAA2B,QAArBC,EAAAC,OAAOC,sBAAc,IAAAF,OAAA,EAAAA,EAAEG,QACjCC,GAEF,IAAKL,EACH,MAAO,GAET,MAAMM,EAASC,KAAKC,MAAMR,GAC1B,OAAOM,EAAOP,cAAgBA,GAAcO,EAAOG,SAAgB,EACpE,CAAC,MAAOC,GACP,MAAO,EACR,GAsEGC,EAA+B,CACnCC,EACAC,EACAC,EACAC,WAEA,MAAMN,GAAUK,aAAI,EAAJA,EAAME,SAA0B,UAAjBF,aAAI,EAAJA,EAAMG,gBAAW,IAAAhB,OAAA,EAAAA,EAAA,IArDpB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EACjC,CAAC,MAAO/E,GACP4C,KAAKvC,OAAOgF,MAAM,8BAA+BrF,EAAEsF,QACpD,CAEJ,4CArEC,OAAO1C,IACR,uBAGC,OAAoC,QAA7BU,EAAoB,QAApBN,EAAAE,EAAAN,KAAUO,EAAA,IAAAI,GAACgC,iBAAS,IAAAvC,OAAA,EAAAA,EAAEwC,eAAO,IAAAlC,OAAA,EAAAA,EAAEjE,cAAe,EACtD,EAiEDE,CAAA"}
|
|
1
|
+
{"version":3,"file":"passwordManagerMixin.js","sources":["../../../src/lib/mixins/passwordManagerMixin.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport { compose, createSingletonMixin } from '@descope/sdk-helpers';\nimport { loggerMixin } from '@descope/sdk-mixins';\nimport {\n DESCOPE_ATTRIBUTE_EXCLUDE_FIELD,\n DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY,\n} from '../constants';\nimport { getFirstNonEmptyValue } from '../helpers';\nimport type { ScreenStateUser } from '../types';\n\nconst LOGIN_ID_FIELDS = ['externalId', 'email', 'phone'];\nconst PASSWORD_FIELDS = ['newPassword', 'password'];\n\nconst USERNAME_ANCHOR_ATTRIBUTE = 'data-username-anchor';\n\n// What the mixin needs from its host. Defined as an interface (not imported)\n// to avoid a circular dependency on DescopeWc. Exported so declaration emit\n// can name it from BaseDescopeWc's composed base class.\nexport interface PasswordManagerHost {\n contentRootElement?: HTMLElement;\n flowState?: { current?: { executionId?: string } };\n sdk?: { getLastUserLoginId?: () => string };\n}\n\n// the last identifier the user submitted on a previous screen in this flow\n// (e.g. the email entered before a magic link was sent), used when neither\n// the flow state nor a previous authentication provides one.\n// kept in sessionStorage (tab scoped, cleared when the tab closes) so it\n// survives page reloads during the flow, and scoped to the flow execution so\n// a stale identifier is never carried into another flow (or another user)\n// running in the same tab\nconst getLastSubmittedLoginId = (executionId: string): string => {\n // a missing execution id must never match anything, otherwise two flows\n // without one would share the stored identifier\n if (!executionId) {\n return '';\n }\n try {\n const raw = window.sessionStorage?.getItem(\n DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY,\n );\n if (!raw) {\n return '';\n }\n const stored = JSON.parse(raw);\n return stored.executionId === executionId ? stored.loginId || '' : '';\n } catch (e) {\n return '';\n }\n};\n\nconst setLastSubmittedLoginId = (loginId: string, executionId: string) => {\n if (!loginId || !executionId) {\n return;\n }\n try {\n window.sessionStorage?.setItem(\n DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY,\n JSON.stringify({ executionId, loginId }),\n );\n } catch (e) {\n // sessionStorage unavailable, losing reload persistence is acceptable\n }\n};\n\nconst clearUsernameAnchorIfExists = () => {\n document\n .querySelectorAll(`[${USERNAME_ANCHOR_ATTRIBUTE}=\"true\"]`)\n .forEach((ele) => ele.remove());\n};\n\nconst findPasswordComponent = (contentRootEle: Element) =>\n contentRootEle.querySelector('descope-new-password') ||\n contentRootEle.querySelector('descope-password');\n\n// an identifier is already on screen when there is an autocomplete=\"username\"\n// input, or a component collecting one of the login id fields (e.g.\n// descope-email-field renders its input inside a closed shadow root, so only\n// its name attribute is visible from here)\nconst hasLoginIdField = (roots: Element[]) => {\n const selector = [\n 'input[autocomplete=\"username\"]',\n ...LOGIN_ID_FIELDS.map((field) => `[name=\"${field}\"]`),\n ].join(', ');\n return roots.some((root) => root.querySelector(selector));\n};\n\nconst createUsernameAnchor = (loginId: string) => {\n const input = document.createElement('input');\n input.setAttribute('autocomplete', 'username');\n input.setAttribute('name', 'username');\n input.setAttribute('type', 'email');\n input.setAttribute('readonly', 'true');\n input.setAttribute('tabindex', '-1');\n input.setAttribute('aria-hidden', 'true');\n // never collect the anchor's value into the submitted form data\n input.setAttribute(DESCOPE_ATTRIBUTE_EXCLUDE_FIELD, 'true');\n // cleaned up by clearUsernameAnchorIfExists between screens\n input.setAttribute(USERNAME_ANCHOR_ATTRIBUTE, 'true');\n // some password managers read the markup value rather than the property\n input.setAttribute('value', loginId);\n input.value = loginId;\n // real input hidden via CSSOM: managers ignore type=\"hidden\", and strict\n // CSP style-src blocks style attributes\n Object.assign(input.style, {\n position: 'absolute',\n opacity: '0',\n pointerEvents: 'none',\n height: '0',\n border: '0',\n });\n return input;\n};\n\n// Anchors a hidden autocomplete=\"username\" input on password screens that\n// have no identifier input, so password managers can associate the credential\n// with a user (descope/etc#16712). Appended to the host light DOM — password\n// manager save heuristics (verified on WebKit) do not scan shadow trees\nconst injectUsernameAnchorIfNeeded = (\n hostEle: HTMLElement,\n contentRootEle: Element,\n user: ScreenStateUser | undefined,\n logger: { debug: (...args: string[]) => void },\n) => {\n const loginId = user?.email || user?.loginIds?.[0];\n\n if (!findPasswordComponent(contentRootEle)) {\n logger.debug('Username anchor: no password component on screen');\n return;\n }\n if (!loginId) {\n logger.debug('Username anchor: no user identifier available');\n return;\n }\n if (hasLoginIdField([hostEle, contentRootEle])) {\n logger.debug('Username anchor: screen already has an identifier field');\n return;\n }\n\n logger.debug('Username anchor: injecting hidden username input');\n hostEle.appendChild(createUsernameAnchor(loginId));\n};\n\n/**\n * Password manager integrations: keeps track of the current screen's user\n * identifier, anchors a hidden username input on password screens that have\n * no identifier input, and stores submitted credentials via the Credential\n * Management API.\n */\nexport const passwordManagerMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) => {\n const BaseClass = compose(loggerMixin)(superclass);\n\n return class PasswordManagerMixinClass extends BaseClass {\n // the authenticated user of the current screen (if any), used as a\n // fallback identifier for password manager integrations on screens that\n // have no identifier input (e.g. step-up password change)\n #screenUser?: ScreenStateUser;\n\n get #host() {\n return this as unknown as PasswordManagerHost;\n }\n\n get #executionId() {\n return this.#host.flowState?.current?.executionId || '';\n }\n\n // called on every screen render. flow state does not always carry the\n // user (e.g. after magic link auth), so fall back to the login id\n // submitted earlier in this flow, then to the last authenticated user\n updateScreenUser(stateUser?: ScreenStateUser) {\n this.#screenUser = {\n email: stateUser?.email,\n loginIds: stateUser?.loginIds?.length\n ? stateUser.loginIds\n : [\n getLastSubmittedLoginId(this.#executionId) ||\n this.#host.sdk?.getLastUserLoginId?.(),\n ].filter(Boolean),\n };\n }\n\n updateUsernameAnchor() {\n // clear the previous screen's anchor, so each screen gets an anchor\n // only if it needs one\n clearUsernameAnchorIfExists();\n\n injectUsernameAnchorIfNeeded(\n this,\n this.#host.contentRootElement,\n this.#screenUser,\n this.logger,\n );\n }\n\n // called after a successful next(): on flows that render their first\n // screen before the flow starts, the execution id only exists on the\n // response, so prefer it over the current flow state\n captureLastSubmittedLoginId(formData = {}, responseExecutionId?: string) {\n const loginId = getFirstNonEmptyValue(formData, LOGIN_ID_FIELDS);\n if (loginId) {\n setLastSubmittedLoginId(\n loginId,\n responseExecutionId || this.#executionId,\n );\n }\n }\n\n // handle storing passwords in password managers\n storeCredentials(formData = {}) {\n const id =\n getFirstNonEmptyValue(formData, LOGIN_ID_FIELDS) ||\n this.#screenUser?.email ||\n this.#screenUser?.loginIds?.[0];\n const password = getFirstNonEmptyValue(formData, PASSWORD_FIELDS);\n\n // PasswordCredential not supported in Firefox\n if (id && password) {\n try {\n if (!globalThis.PasswordCredential) {\n return;\n }\n const cred = new globalThis.PasswordCredential({ id, password });\n\n navigator?.credentials?.store?.(cred)?.catch((e) => {\n this.logger.error('Could not store credentials', e?.message);\n });\n } catch (e) {\n this.logger.error('Could not store credentials', e.message);\n }\n }\n }\n };\n },\n);\n"],"names":["LOGIN_ID_FIELDS","PASSWORD_FIELDS","USERNAME_ANCHOR_ATTRIBUTE","getLastSubmittedLoginId","executionId","raw","_a","window","sessionStorage","getItem","DESCOPE_LAST_SUBMITTED_LOGIN_ID_SESSION_STORAGE_KEY","stored","JSON","parse","loginId","e","injectUsernameAnchorIfNeeded","hostEle","contentRootEle","user","logger","email","loginIds","querySelector","findPasswordComponent","roots","selector","map","field","join","some","root","hasLoginIdField","debug","appendChild","input","document","createElement","setAttribute","DESCOPE_ATTRIBUTE_EXCLUDE_FIELD","value","Object","assign","style","position","opacity","pointerEvents","height","border","createUsernameAnchor","passwordManagerMixin","createSingletonMixin","superclass","BaseClass","compose","loggerMixin","constructor","_PasswordManagerMixinClass_screenUser","set","this","updateScreenUser","stateUser","__classPrivateFieldSet","_b","length","__classPrivateFieldGet","_PasswordManagerMixinClass_instances","_PasswordManagerMixinClass_executionId_get","_d","_c","_PasswordManagerMixinClass_host_get","sdk","getLastUserLoginId","call","filter","Boolean","updateUsernameAnchor","querySelectorAll","forEach","ele","remove","contentRootElement","captureLastSubmittedLoginId","formData","responseExecutionId","getFirstNonEmptyValue","setItem","stringify","setLastSubmittedLoginId","storeCredentials","id","password","globalThis","PasswordCredential","cred","_g","_f","navigator","credentials","_e","store","catch","error","message","flowState","current"],"mappings":"ieAUA,MAAMA,EAAkB,CAAC,aAAc,QAAS,SAC1CC,EAAkB,CAAC,cAAe,YAElCC,EAA4B,uBAkB5BC,EAA2BC,UAG/B,IAAKA,EACH,MAAO,GAET,IACE,MAAMC,EAA2B,QAArBC,EAAAC,OAAOC,sBAAc,IAAAF,OAAA,EAAAA,EAAEG,QACjCC,GAEF,IAAKL,EACH,MAAO,GAET,MAAMM,EAASC,KAAKC,MAAMR,GAC1B,OAAOM,EAAOP,cAAgBA,GAAcO,EAAOG,SAAgB,EACpE,CAAC,MAAOC,GACP,MAAO,EACR,GAsEGC,EAA+B,CACnCC,EACAC,EACAC,EACAC,WAEA,MAAMN,GAAUK,aAAI,EAAJA,EAAME,SAA0B,UAAjBF,aAAI,EAAJA,EAAMG,gBAAW,IAAAhB,OAAA,EAAAA,EAAA,IArDpB,CAACY,GAC7BA,EAAeK,cAAc,yBAC7BL,EAAeK,cAAc,oBAqDxBC,CAAsBN,GAItBJ,EAnDiB,CAACW,IACvB,MAAMC,EAAW,CACf,oCACG1B,EAAgB2B,KAAKC,GAAU,UAAUA,SAC5CC,KAAK,MACP,OAAOJ,EAAMK,MAAMC,GAASA,EAAKR,cAAcG,IAAU,EAkDrDM,CAAgB,CAACf,EAASC,IAC5BE,EAAOa,MAAM,4DAIfb,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,EAAA,IAAAI,GAACkC,iBAAS,IAAAzC,OAAA,EAAAA,EAAE0C,eAAO,IAAApC,OAAA,EAAAA,EAAEjE,cAAe,EACtD,EAmEDE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -441,12 +441,12 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
441
441
|
readonly cssRules: CSSRuleList;
|
|
442
442
|
} | CSSStyleSheet;
|
|
443
443
|
nonce: string;
|
|
444
|
-
"__#
|
|
444
|
+
"__#39155@#setNonce"(): void;
|
|
445
445
|
init(): Promise<void>;
|
|
446
|
-
"__#
|
|
446
|
+
"__#39150@#observeMappings": {};
|
|
447
447
|
observeAttribute(attrName: string, onAttrChange: (attrName: string, value: string) => void): () => any;
|
|
448
448
|
observeAttributes(attrs: string[], cb: (attrName: string, value: string) => void): () => void;
|
|
449
|
-
"__#
|
|
449
|
+
"__#39149@#isInit": boolean;
|
|
450
450
|
connectedCallback: (() => void) & (() => void) & (() => void);
|
|
451
451
|
accessKey: string;
|
|
452
452
|
readonly accessKeyLabel: string;
|
|
@@ -772,22 +772,22 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
772
772
|
tabIndex: number;
|
|
773
773
|
blur(): void;
|
|
774
774
|
focus(options?: FocusOptions): void;
|
|
775
|
-
"__#
|
|
776
|
-
"__#
|
|
775
|
+
"__#39148@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
776
|
+
"__#39148@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
777
777
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
778
778
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
779
779
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
780
780
|
}) & {
|
|
781
781
|
new (...params: any[]): {
|
|
782
|
-
"__#
|
|
783
|
-
readonly "__#
|
|
784
|
-
readonly "__#
|
|
782
|
+
"__#11@#screenUser"?: ScreenStateUser;
|
|
783
|
+
readonly "__#11@#host": PasswordManagerHost;
|
|
784
|
+
readonly "__#11@#executionId": string;
|
|
785
785
|
updateScreenUser(stateUser?: ScreenStateUser): void;
|
|
786
786
|
updateUsernameAnchor(): void;
|
|
787
787
|
captureLastSubmittedLoginId(formData?: {}, responseExecutionId?: string): void;
|
|
788
788
|
storeCredentials(formData?: {}): void;
|
|
789
|
-
"__#
|
|
790
|
-
"__#
|
|
789
|
+
"__#39148@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
790
|
+
"__#39148@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
791
791
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
792
792
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
793
793
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
@@ -1183,12 +1183,12 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
1183
1183
|
};
|
|
1184
1184
|
} & {
|
|
1185
1185
|
new (...params: any[]): {
|
|
1186
|
-
"__#
|
|
1187
|
-
"__#
|
|
1186
|
+
"__#10@#warnedForKey"?: string;
|
|
1187
|
+
"__#10@#scheduleDuplicateFlowCheck"(): void;
|
|
1188
1188
|
connectedCallback(): void;
|
|
1189
1189
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
1190
|
-
"__#
|
|
1191
|
-
"__#
|
|
1190
|
+
"__#39148@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1191
|
+
"__#39148@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1192
1192
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1193
1193
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
1194
1194
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
@@ -1582,15 +1582,15 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
1582
1582
|
};
|
|
1583
1583
|
} & {
|
|
1584
1584
|
new (...params: any[]): {
|
|
1585
|
-
"__#
|
|
1585
|
+
"__#9@#rtRuntime": RealtimeRuntime;
|
|
1586
1586
|
applyComponentsState(root: ParentNode, componentsState: Record<string, string>): void;
|
|
1587
1587
|
initRealtimeConditions(rootElement: HTMLElement, screenState: ScreenState): void;
|
|
1588
|
-
"__#
|
|
1589
|
-
"__#
|
|
1588
|
+
"__#9@#handleRealtimeInput"(e: InputEvent): void;
|
|
1589
|
+
"__#9@#reEvaluateRealtime"(): void;
|
|
1590
1590
|
disconnectedCallback(): void;
|
|
1591
|
-
"__#
|
|
1592
|
-
"__#
|
|
1593
|
-
"__#
|
|
1591
|
+
"__#9@#teardownRealtimeRuntime"(): void;
|
|
1592
|
+
"__#39148@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1593
|
+
"__#39148@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1594
1594
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1595
1595
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
1596
1596
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
@@ -1986,8 +1986,8 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
1986
1986
|
};
|
|
1987
1987
|
} & {
|
|
1988
1988
|
new (...params: any[]): {
|
|
1989
|
-
"__#
|
|
1990
|
-
"__#
|
|
1989
|
+
"__#8@#shouldMountInFormEle"(): boolean;
|
|
1990
|
+
"__#8@#handleOuterForm"(): void;
|
|
1991
1991
|
connectedCallback(): void;
|
|
1992
1992
|
accessKey: string;
|
|
1993
1993
|
readonly accessKeyLabel: string;
|
|
@@ -2316,15 +2316,15 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
2316
2316
|
focus(options?: FocusOptions): void;
|
|
2317
2317
|
};
|
|
2318
2318
|
} & (new (...params: any[]) => {
|
|
2319
|
-
"__#
|
|
2320
|
-
"__#
|
|
2321
|
-
"__#
|
|
2322
|
-
"__#
|
|
2319
|
+
"__#39152@#lastBaseUrl"?: string;
|
|
2320
|
+
"__#39152@#workingBaseUrl"?: string;
|
|
2321
|
+
"__#39152@#failedUrls": Set<string>;
|
|
2322
|
+
"__#39152@#getResourceUrls"(filename: string): (URL & {
|
|
2323
2323
|
baseUrl: string;
|
|
2324
2324
|
}) | (URL & {
|
|
2325
2325
|
baseUrl: string;
|
|
2326
2326
|
})[];
|
|
2327
|
-
"__#
|
|
2327
|
+
"__#39152@#createResourceUrl"(filename: string, baseUrl: string): URL & {
|
|
2328
2328
|
baseUrl: string;
|
|
2329
2329
|
};
|
|
2330
2330
|
fetchStaticResource<F extends "text" | "json">(filename: string, format: F): Promise<{
|
|
@@ -2660,43 +2660,43 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
2660
2660
|
blur(): void;
|
|
2661
2661
|
focus(options?: FocusOptions): void;
|
|
2662
2662
|
readonly projectId: string;
|
|
2663
|
-
"__#
|
|
2663
|
+
"__#39151@#handleError"(attrName: string, newValue: string): void;
|
|
2664
2664
|
init(): Promise<void>;
|
|
2665
|
-
"__#
|
|
2665
|
+
"__#39150@#observeMappings": {};
|
|
2666
2666
|
observeAttribute(attrName: string, onAttrChange: (attrName: string, value: string) => void): () => any;
|
|
2667
2667
|
observeAttributes(attrs: string[], cb: (attrName: string, value: string) => void): () => void;
|
|
2668
|
-
"__#
|
|
2669
|
-
"__#
|
|
2670
|
-
"__#
|
|
2668
|
+
"__#39149@#isInit": boolean;
|
|
2669
|
+
"__#39148@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
2670
|
+
"__#39148@#wrapLogger": ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger);
|
|
2671
2671
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
2672
2672
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
2673
2673
|
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);
|
|
2674
2674
|
}) & (new (...params: any[]) => {
|
|
2675
|
-
"__#
|
|
2676
|
-
"__#
|
|
2677
|
-
"__#
|
|
2675
|
+
"__#39165@#globalStyle": _descope_sdk_mixins_static_resources_mixin.InjectedStyle;
|
|
2676
|
+
"__#39165@#tenantStyle": _descope_sdk_mixins_static_resources_mixin.InjectedStyle;
|
|
2677
|
+
"__#39165@#customStyle": _descope_sdk_mixins_static_resources_mixin.InjectedStyle;
|
|
2678
2678
|
readonly theme: _descope_sdk_mixins_static_resources_mixin.ThemeOptions;
|
|
2679
2679
|
readonly styleId: string;
|
|
2680
2680
|
readonly themeOverride: Record<string, any>;
|
|
2681
|
-
"__#
|
|
2682
|
-
"__#
|
|
2683
|
-
"__#
|
|
2684
|
-
"__#
|
|
2685
|
-
readonly "__#
|
|
2686
|
-
"__#
|
|
2687
|
-
"__#
|
|
2688
|
-
readonly "__#
|
|
2689
|
-
"__#
|
|
2690
|
-
"__#
|
|
2691
|
-
"__#
|
|
2692
|
-
"__#
|
|
2681
|
+
"__#39165@#getThemeOverrideString"(): string;
|
|
2682
|
+
"__#39165@#_themeResource": Promise<void | Record<string, any>>;
|
|
2683
|
+
"__#39165@#_tenantThemeResource": Promise<Record<string, any>>;
|
|
2684
|
+
"__#39165@#fetchTheme"(): Promise<Record<string, any>>;
|
|
2685
|
+
readonly "__#39165@#themeResource": Promise<void | Record<string, any>>;
|
|
2686
|
+
"__#39165@#loadGlobalStyle"(): Promise<void>;
|
|
2687
|
+
"__#39165@#fetchTenantTheme"(): Promise<Record<string, any>>;
|
|
2688
|
+
readonly "__#39165@#tenantThemeResource": Promise<Record<string, any>>;
|
|
2689
|
+
"__#39165@#loadTenantStyle"(): Promise<void>;
|
|
2690
|
+
"__#39165@#loadCustomStyle"(): Promise<void>;
|
|
2691
|
+
"__#39165@#loadComponentsStyle"(): Promise<void>;
|
|
2692
|
+
"__#39165@#getFontsConfig"(): Promise<Record<string, {
|
|
2693
2693
|
url?: string;
|
|
2694
2694
|
}>>;
|
|
2695
|
-
"__#
|
|
2696
|
-
"__#
|
|
2697
|
-
"__#
|
|
2698
|
-
"__#
|
|
2699
|
-
"__#
|
|
2695
|
+
"__#39165@#loadFonts"(): Promise<void>;
|
|
2696
|
+
"__#39165@#applyTheme"(): Promise<void>;
|
|
2697
|
+
"__#39165@#onThemeChange": () => void;
|
|
2698
|
+
"__#39165@#loadTheme"(): void;
|
|
2699
|
+
"__#39165@#toggleOsThemeChangeListener": (listen: boolean) => void;
|
|
2700
2700
|
init(): Promise<void>;
|
|
2701
2701
|
injectStyle: ((cssString: string, { prepend }?: {
|
|
2702
2702
|
prepend?: boolean;
|
|
@@ -2714,11 +2714,11 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
2714
2714
|
readonly cssRules: CSSRuleList;
|
|
2715
2715
|
});
|
|
2716
2716
|
nonce: string;
|
|
2717
|
-
"__#
|
|
2718
|
-
"__#
|
|
2717
|
+
"__#39155@#setNonce": (() => void) & (() => void);
|
|
2718
|
+
"__#39150@#observeMappings": {};
|
|
2719
2719
|
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);
|
|
2720
2720
|
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);
|
|
2721
|
-
"__#
|
|
2721
|
+
"__#39149@#isInit": boolean;
|
|
2722
2722
|
connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
2723
2723
|
accessKey: string;
|
|
2724
2724
|
readonly accessKeyLabel: string;
|
|
@@ -3044,25 +3044,25 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
3044
3044
|
tabIndex: number;
|
|
3045
3045
|
blur(): void;
|
|
3046
3046
|
focus(options?: FocusOptions): void;
|
|
3047
|
-
"__#
|
|
3048
|
-
"__#
|
|
3047
|
+
"__#39148@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
3048
|
+
"__#39148@#wrapLogger": ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger) & ((logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>) => _descope_sdk_mixins_static_resources_mixin.Logger);
|
|
3049
3049
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
3050
3050
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
3051
3051
|
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);
|
|
3052
3052
|
contentRootElement: HTMLElement;
|
|
3053
3053
|
rootElement: HTMLElement;
|
|
3054
3054
|
readonly config: Promise<_descope_sdk_mixins_static_resources_mixin.Config>;
|
|
3055
|
-
"__#
|
|
3056
|
-
"__#
|
|
3057
|
-
"__#
|
|
3058
|
-
"__#
|
|
3055
|
+
"__#39154@#configCacheClear": (() => void) & (() => void);
|
|
3056
|
+
"__#39154@#_configResource": Promise<_descope_sdk_mixins_static_resources_mixin.Config>;
|
|
3057
|
+
"__#39154@#fetchConfig": (() => Promise<_descope_sdk_mixins_static_resources_mixin.Config>) & (() => Promise<_descope_sdk_mixins_static_resources_mixin.Config>);
|
|
3058
|
+
"__#39153@#callbacks": Map<string, () => void> & Map<string, () => void>;
|
|
3059
3059
|
onReset: ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void);
|
|
3060
3060
|
reset: ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>);
|
|
3061
|
-
"__#
|
|
3062
|
-
"__#
|
|
3063
|
-
"__#
|
|
3064
|
-
"__#
|
|
3065
|
-
"__#
|
|
3061
|
+
"__#39151@#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);
|
|
3062
|
+
"__#39152@#lastBaseUrl"?: string;
|
|
3063
|
+
"__#39152@#workingBaseUrl"?: string;
|
|
3064
|
+
"__#39152@#failedUrls": Set<string>;
|
|
3065
|
+
"__#39152@#getResourceUrls": ((filename: string) => (URL & {
|
|
3066
3066
|
baseUrl: string;
|
|
3067
3067
|
}) | (URL & {
|
|
3068
3068
|
baseUrl: string;
|
|
@@ -3075,7 +3075,7 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
3075
3075
|
}) | (URL & {
|
|
3076
3076
|
baseUrl: string;
|
|
3077
3077
|
})[]);
|
|
3078
|
-
"__#
|
|
3078
|
+
"__#39152@#createResourceUrl": ((filename: string, baseUrl: string) => URL & {
|
|
3079
3079
|
baseUrl: string;
|
|
3080
3080
|
}) & ((filename: string, baseUrl: string) => URL & {
|
|
3081
3081
|
baseUrl: string;
|
|
@@ -3095,12 +3095,12 @@ declare const BaseClass: (new (...params: any[]) => {
|
|
|
3095
3095
|
readonly baseStaticUrl: string;
|
|
3096
3096
|
readonly baseUrl: string;
|
|
3097
3097
|
readonly projectId: string;
|
|
3098
|
-
"__#
|
|
3099
|
-
"__#
|
|
3100
|
-
"__#
|
|
3098
|
+
"__#39158@#getComponentsVersion"(): Promise<string>;
|
|
3099
|
+
"__#39158@#getComponentsVersionSri"(): Promise<string>;
|
|
3100
|
+
"__#39158@#descopeUi": Promise<any>;
|
|
3101
3101
|
readonly descopeUi: Promise<any>;
|
|
3102
|
-
"__#
|
|
3103
|
-
"__#
|
|
3102
|
+
"__#39158@#loadDescopeUiComponent"(componentName: string): Promise<any>;
|
|
3103
|
+
"__#39158@#getDescopeUi"(): Promise<any>;
|
|
3104
3104
|
loadDescopeUiComponents(templateOrComponentNames: string[] | HTMLTemplateElement): Promise<any[]>;
|
|
3105
3105
|
readonly baseCdnUrl: string;
|
|
3106
3106
|
injectNpmLib(libName: string, version: string, filePath?: string, overrides?: string[], integrity?: string): Promise<{
|
|
@@ -3187,6 +3187,7 @@ declare class DescopeWc extends BaseDescopeWc {
|
|
|
3187
3187
|
stepState: State<StepState>;
|
|
3188
3188
|
onScreenUpdate?: (screenName: string, context: CustomScreenState, next: StepState['next'], ref: typeof this) => boolean | Promise<boolean>;
|
|
3189
3189
|
constructor();
|
|
3190
|
+
static readonly bridgeVersion = 3;
|
|
3190
3191
|
bridgeVersion: number;
|
|
3191
3192
|
nativeCallbacks: {
|
|
3192
3193
|
complete?: (input: Record<string, any>) => Promise<void>;
|