@descope/web-component 4.5.1 → 4.6.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/debugger-wc.js.map +1 -1
- package/dist/cjs/descope-wc/BaseDescopeWc.js +1 -1
- package/dist/cjs/descope-wc/BaseDescopeWc.js.map +1 -1
- package/dist/cjs/descope-wc/DescopeWc.js +1 -1
- package/dist/cjs/descope-wc/DescopeWc.js.map +1 -1
- package/dist/cjs/helpers/abTestingKey.js.map +1 -1
- package/dist/cjs/helpers/conditions.js.map +1 -1
- package/dist/cjs/helpers/flowInputs.js.map +1 -1
- package/dist/cjs/helpers/helpers.js.map +1 -1
- package/dist/cjs/helpers/lastAuth.js.map +1 -1
- package/dist/cjs/helpers/oidcSession.js.map +1 -1
- package/dist/cjs/helpers/positionHelpers.js.map +1 -1
- package/dist/cjs/helpers/realtime-conditions/applier.js.map +1 -1
- package/dist/cjs/helpers/realtime-conditions/evaluator.js.map +1 -1
- package/dist/cjs/helpers/state.js.map +1 -1
- package/dist/cjs/helpers/storage.js.map +1 -1
- package/dist/cjs/helpers/templates.js.map +1 -1
- package/dist/cjs/helpers/webauthn.js.map +1 -1
- package/dist/cjs/mixins/componentConditionsMixin.js.map +1 -1
- package/dist/cjs/mixins/duplicateFlowWarningMixin.js.map +1 -1
- package/dist/cjs/mixins/formMountMixin.js.map +1 -1
- package/dist/cjs/mixins/passwordManagerMixin.js.map +1 -1
- package/dist/cjs/mixins/validationTrackingMixin.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/constants/customScreens.js.map +1 -1
- package/dist/esm/debugger-wc.js.map +1 -1
- package/dist/esm/descope-wc/BaseDescopeWc.js +1 -1
- package/dist/esm/descope-wc/BaseDescopeWc.js.map +1 -1
- package/dist/esm/descope-wc/DescopeWc.js +1 -1
- package/dist/esm/descope-wc/DescopeWc.js.map +1 -1
- package/dist/esm/helpers/abTestingKey.js.map +1 -1
- package/dist/esm/helpers/conditions.js.map +1 -1
- package/dist/esm/helpers/flowInputs.js.map +1 -1
- package/dist/esm/helpers/helpers.js +1 -1
- package/dist/esm/helpers/helpers.js.map +1 -1
- package/dist/esm/helpers/lastAuth.js +1 -1
- package/dist/esm/helpers/lastAuth.js.map +1 -1
- package/dist/esm/helpers/oidcSession.js +1 -1
- package/dist/esm/helpers/oidcSession.js.map +1 -1
- package/dist/esm/helpers/positionHelpers.js.map +1 -1
- package/dist/esm/helpers/realtime-conditions/applier.js.map +1 -1
- package/dist/esm/helpers/realtime-conditions/evaluator.js.map +1 -1
- package/dist/esm/helpers/state.js.map +1 -1
- package/dist/esm/helpers/storage.js.map +1 -1
- package/dist/esm/helpers/templates.js.map +1 -1
- package/dist/esm/helpers/webauthn.js.map +1 -1
- package/dist/esm/mixins/componentConditionsMixin.js.map +1 -1
- package/dist/esm/mixins/duplicateFlowWarningMixin.js.map +1 -1
- package/dist/esm/mixins/formMountMixin.js.map +1 -1
- package/dist/esm/mixins/passwordManagerMixin.js.map +1 -1
- package/dist/esm/mixins/validationTrackingMixin.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/index.d.ts +88 -87
- package/dist/index.js +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validationTrackingMixin.js","sources":["../../../src/lib/mixins/validationTrackingMixin.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport { compose, createSingletonMixin } from '@descope/sdk-helpers';\nimport { loggerMixin } from '@descope/sdk-mixins';\n\n// Client-side form validation happens entirely in the browser (native\n// reportValidity/checkValidity) and produces no signal on its own - because an\n// invalid form never submits, the server never sees it. This mixin captures\n// those failures and batches them, so customers get visibility into where users\n// hit friction. Sending is the host's job - see ValidationSender below.\n//\n// Off unless the flow turns it on: the host calls setValidationTrackingEnabled\n// from the flow's config.json entry, and nothing is captured until it does.\n// It never blocks or fails the flow.\n\n/**\n * How a batch reaches the backend. The host supplies this (DescopeWc hands over\n * sdk.flow.event), so the mixin owns capture and batching and knows nothing\n * about transport, URLs or the SDK. Resolves to whether the batch was accepted\n * and whether retrying could ever help.\n */\nexport type ValidationSendResult = { ok: boolean; retryable: boolean };\nexport type ValidationBatch = {\n executionId: string;\n events: ValidationErrorEvent[];\n};\nexport type ValidationSender = (\n batch: ValidationBatch,\n options: { keepalive: boolean },\n) => Promise<ValidationSendResult>;\n\n// Flush the batch after this much inactivity, or once it reaches the cap.\nconst FLUSH_DEBOUNCE_MS = 2000;\nconst MAX_BATCH_SIZE = 20;\n\n// Bounded retry for normal (non-unload) flushes. Each event carries a stable\n// `id`, so the backend/CDP dedups a retried batch (no double-counting).\nconst MAX_SEND_RETRIES = 2;\nconst RETRY_BACKOFF_MS = 800;\n\n/** One captured validation failure, as sent to the backend. */\nexport type ValidationErrorEvent = {\n id: string;\n field: string;\n rule: string;\n message: string;\n screenId: string;\n screenName: string;\n ts: number;\n};\n\n/**\n * Where a batch belongs. Validation only ever happens on a screen, so the\n * screen is the location - there is no step in this model.\n */\ntype FlowContext = {\n executionId?: string;\n screenId?: string;\n screenName?: string;\n};\n\n// Same field failing the same way on the same screen is one signal, however\n// many times it fires (blur then submit).\nconst dedupeKey = (e: ValidationErrorEvent) =>\n `${e.screenId}|${e.field}|${e.rule}`;\n\nconst newId = (): string => {\n try {\n return crypto.randomUUID();\n } catch {\n // very old browsers: good-enough uniqueness for an idempotency key\n return `${Date.now()}-${Math.round(Math.random() * 1e9)}`;\n }\n};\n\n/**\n * Map an input's ValidityState to a machine-readable rule, one rule per native\n * failure so a customer can tell \"not a valid email\" from \"failed the pattern\n * the flow author wrote\" - different problems with different fixes. The exact\n * text the user saw is always in `message` as well. A field with a custom\n * validation message still keeps its native flag, so this stays accurate; only\n * a fully custom validator (setCustomValidity) reports `custom`.\n *\n * `inputType` is the input's `type`, needed because typeMismatch only says the\n * value is the wrong shape, not for what: it fires for `email` and `url` only.\n */\nexport const deriveValidationRule = (\n validity?: ValidityState,\n inputType?: string,\n): string => {\n if (!validity) return 'unknown';\n // Before valueMissing: a control that cannot parse what was typed reports an\n // empty value, so a required field sets BOTH flags (verified in Chromium:\n // type=\"number\" + \"5e\" -> badInput AND valueMissing). Reporting `required`\n // there would claim the user left it blank when they did type something.\n if (validity.badInput) return 'bad-input';\n if (validity.valueMissing) return 'required';\n if (validity.typeMismatch) {\n if (inputType === 'email' || inputType === 'url') return inputType;\n return 'type-mismatch';\n }\n if (validity.patternMismatch) return 'pattern';\n if (validity.tooShort) return 'too-short';\n if (validity.tooLong) return 'too-long';\n if (\n validity.rangeUnderflow ||\n validity.rangeOverflow ||\n validity.stepMismatch\n ) {\n return 'range';\n }\n if (validity.customError) return 'custom';\n return 'unknown';\n};\n\n/** Build one event from a failed input, or null if it has no name to report. */\nconst toEvent = (\n input: HTMLInputElement,\n ctx: FlowContext,\n): ValidationErrorEvent | null => {\n const field = input?.getAttribute?.('name');\n if (!field) return null;\n return {\n id: newId(),\n field,\n rule: deriveValidationRule(input.validity, input.type),\n message: input.validationMessage || '',\n screenId: ctx.screenId || '',\n screenName: ctx.screenName || '',\n ts: Date.now(),\n };\n};\n\nexport const validationTrackingMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) => {\n const BaseClass = compose(loggerMixin)(superclass);\n\n return class ValidationTrackingMixinClass extends BaseClass {\n // Captured events waiting to go out. Flushed on screen change, flow end,\n // page hide, a size cap, or a short inactivity debounce. Each event\n // carries its own screen, so a batch need not be single-screen.\n #buffer: ValidationErrorEvent[] = [];\n\n // The execution the buffer belongs to. Unset until the flow starts: the\n // start screen renders from config.json before /v1/flow/start, and the\n // endpoint only accepts a live execution, so those events wait here. If\n // the flow never starts - the user gave up on the first screen - they are\n // dropped. That is the known abandonment gap.\n #bufferExecutionId?: string;\n\n #flushTimer?: ReturnType<typeof setTimeout>;\n\n // Pending retry timers. A failed flush leaves a chain in flight, and two\n // flushes can fail at once, so this holds more than one.\n #retryTimers = new Set<ReturnType<typeof setTimeout>>();\n\n #listenersAttached = false;\n\n // Bumped whenever in-flight work stops being wanted: tracking switched\n // off, or the component torn down. A send captures the value it started\n // with, so a response that lands after either event cannot resurrect a\n // retry chain the switch/teardown was supposed to end.\n #generation = 0;\n\n // Supplied by the host. Without it nothing can be sent, which is the\n // same safe default as being switched off.\n #send?: ValidationSender;\n\n // Off until the host turns it on from the flow's config.json entry. The\n // default matters: a host that never calls the setter captures nothing,\n // so a missing or stale config can never start collecting on its own.\n #enabled = false;\n\n #boundFlushOnEnd = () => this.#flush(false);\n\n #boundFlushOnHide = () => {\n // Page unload / tab hidden - the abandonment case. Use a keepalive\n // request so it survives the page going away.\n if (document.visibilityState === 'hidden') this.#flush(true);\n };\n\n #boundFlushOnPageHide = () => this.#flush(true);\n\n /**\n * Turn capture on or off. The host calls this from the flow's config,\n * where the setting is per flow and off unless the customer enabled it.\n * Turning it off drops whatever is buffered without sending it.\n */\n setValidationTrackingEnabled(enabled: boolean) {\n if (this.#enabled === enabled) return;\n this.#enabled = enabled;\n if (!enabled) this.#discard();\n }\n\n /** The host tells the mixin how to deliver a batch. */\n setValidationTrackingSender(send: ValidationSender) {\n this.#send = send;\n }\n\n /**\n * The flow now has an execution. Anything captured before it started -\n * on the start screen - can finally be attributed and sent.\n */\n setValidationTrackingExecution(executionId: string) {\n // Nothing held means nothing to attribute. Storing the id anyway would\n // leave it behind for a later batch that belongs to a different\n // execution - see the matching guard in #flush.\n if (!this.#enabled || !executionId || !this.#buffer.length) return;\n this.#bufferExecutionId = executionId;\n this.#flush(false);\n }\n\n /**\n * Public capture entry point. Called by the web-component at the two\n * validation points it already runs (submit + blur), passing the current\n * flow context. Best-effort: any failure here is swallowed so it can\n * never affect the flow.\n */\n trackValidationErrors(inputs: HTMLInputElement[], context: FlowContext) {\n try {\n this.#collect(inputs, context);\n } catch (e) {\n this.logger?.debug?.('Failed to track validation errors', String(e));\n }\n }\n\n #collect(inputs: HTMLInputElement[], context: FlowContext) {\n // Off for this flow, or nothing to report - capture nothing and attach\n // no listeners.\n if (!this.#enabled || !inputs?.length) return;\n const ctx = context || {};\n\n // Attach flush triggers on first real capture (nothing to flush before\n // there is a buffered event, so there's no reason to attach earlier).\n this.#attachListeners();\n\n inputs.forEach((input) => {\n // Still full after the flush below tried to drain it, which means it\n // cannot be sent yet. Hold at the cap so an abandoned start screen\n // cannot grow without bound - dropping the rest is the price.\n if (this.#buffer.length >= MAX_BATCH_SIZE) return;\n const event = toEvent(input, ctx);\n if (!event) return;\n const key = dedupeKey(event);\n if (this.#buffer.some((e) => dedupeKey(e) === key)) return;\n this.#buffer.push(event);\n // Tied to the batch, so it is set only once something is actually in\n // it, and re-set after a flush below empties it. Before the flow\n // starts this stays unset and the buffer just holds.\n this.#bufferExecutionId = ctx.executionId || this.#bufferExecutionId;\n // A deliverable batch is sent as soon as it fills up, and the rest of\n // this submit keeps collecting into a fresh one. A submit with more\n // than MAX_BATCH_SIZE invalid fields then loses nothing.\n if (this.#buffer.length >= MAX_BATCH_SIZE) this.#flush(false);\n });\n\n if (this.#buffer.length >= MAX_BATCH_SIZE) {\n this.#flush(false);\n } else {\n this.#scheduleFlush();\n }\n }\n\n #scheduleFlush() {\n clearTimeout(this.#flushTimer);\n this.#flushTimer = setTimeout(\n () => this.#flush(false),\n FLUSH_DEBOUNCE_MS,\n );\n }\n\n // Drop everything buffered without sending it, and cancel anything\n // already scheduled. Used when capture is switched off. Listeners that\n // were attached while it was on are left in place - they only call\n // #flush, which does nothing on an empty buffer.\n #discard() {\n clearTimeout(this.#flushTimer);\n this.#generation += 1;\n this.#retryTimers.forEach(clearTimeout);\n this.#retryTimers.clear();\n this.#buffer = [];\n this.#bufferExecutionId = undefined;\n }\n\n #flush(isUnload: boolean) {\n clearTimeout(this.#flushTimer);\n // Nothing buffered: drop the execution too. Holding it would outlive\n // the batch it belonged to, and after a flow restart the next\n // start-screen error would be attributed to the finished execution\n // instead of being held for the new one.\n if (!this.#buffer.length) {\n this.#bufferExecutionId = undefined;\n return;\n }\n // No execution yet - hold, don't drop. The endpoint would reject it.\n if (!this.#bufferExecutionId) return;\n\n // No way to deliver yet - hold rather than drain into nothing.\n if (!this.#send) return;\n\n const events = this.#buffer;\n const executionId = this.#bufferExecutionId;\n this.#buffer = [];\n this.#bufferExecutionId = undefined;\n\n try {\n const batch = { executionId, events };\n if (isUnload) {\n // Page is going away: single keepalive shot, retry isn't possible.\n this.#send(batch, { keepalive: true }).catch(() => {});\n } else {\n this.#sendWithRetry(batch, MAX_SEND_RETRIES, this.#generation);\n }\n } catch (e) {\n this.logger?.debug?.('Failed to send validation events', String(e));\n }\n }\n\n // Best-effort send with bounded retry (non-unload flushes only). Gives up\n // quietly after the last attempt. Events carry a stable `id`, so a retried\n // batch is deduped downstream.\n #sendWithRetry(\n batch: ValidationBatch,\n retriesLeft: number,\n generation: number,\n ) {\n this.#send(batch, { keepalive: false })\n .then((res) => {\n // Only retry what can succeed later - a rejected batch will not\n // become accepted, and retrying it just multiplies the load.\n if (!res.ok && res.retryable && retriesLeft > 0) {\n this.#scheduleRetry(batch, retriesLeft, generation);\n }\n })\n .catch(() => {\n // transport failure - worth another go\n if (retriesLeft > 0) {\n this.#scheduleRetry(batch, retriesLeft, generation);\n }\n });\n }\n\n #scheduleRetry(\n batch: ValidationBatch,\n retriesLeft: number,\n generation: number,\n ) {\n // A request already in flight when tracking is switched off - or when\n // the component went away - would otherwise keep retrying past it.\n if (generation !== this.#generation) return;\n const attempt = MAX_SEND_RETRIES - retriesLeft + 1;\n const timer = setTimeout(() => {\n this.#retryTimers.delete(timer);\n if (generation !== this.#generation) return;\n this.#sendWithRetry(batch, retriesLeft - 1, generation);\n }, RETRY_BACKOFF_MS * attempt);\n this.#retryTimers.add(timer);\n }\n\n #attachListeners() {\n if (this.#listenersAttached) return;\n this.#listenersAttached = true;\n // Flush when the funnel context changes or the flow ends.\n this.addEventListener('screen-updated', this.#boundFlushOnEnd);\n this.addEventListener('success', this.#boundFlushOnEnd);\n this.addEventListener('error', this.#boundFlushOnEnd);\n // Abandonment: capture on the way out (keepalive request).\n document.addEventListener('visibilitychange', this.#boundFlushOnHide);\n window.addEventListener('pagehide', this.#boundFlushOnPageHide);\n }\n\n // Called by the host's disconnectedCallback: flush anything buffered and\n // detach listeners. This mixin intentionally does NOT override\n // connectedCallback/disconnectedCallback - several mixins in the compose\n // chain already do, and a third override trips a TS intersection typing\n // issue. Listeners are attached lazily on first capture instead.\n teardownValidationTracking() {\n // Anything still held never got an execution - #flush leaves it, and\n // the component is going away, so it is dropped with the instance.\n this.#flush(false);\n // Drop any retry still waiting out its backoff - the component is gone.\n // Bumping the generation also covers a send still in flight, whose\n // response would otherwise schedule a fresh timer after this cleanup.\n this.#generation += 1;\n this.#retryTimers.forEach(clearTimeout);\n this.#retryTimers.clear();\n if (!this.#listenersAttached) return;\n this.#listenersAttached = false;\n this.removeEventListener('screen-updated', this.#boundFlushOnEnd);\n this.removeEventListener('success', this.#boundFlushOnEnd);\n this.removeEventListener('error', this.#boundFlushOnEnd);\n document.removeEventListener(\n 'visibilitychange',\n this.#boundFlushOnHide,\n );\n window.removeEventListener('pagehide', this.#boundFlushOnPageHide);\n }\n };\n },\n);\n"],"names":["dedupeKey","e","screenId","field","rule","newId","crypto","randomUUID","_a","Date","now","Math","round","random","deriveValidationRule","validity","inputType","badInput","valueMissing","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","customError","validationTrackingMixin","createSingletonMixin","superclass","BaseClass","compose","loggerMixin","constructor","_ValidationTrackingMixinClass_buffer","set","this","_ValidationTrackingMixinClass_bufferExecutionId","_ValidationTrackingMixinClass_flushTimer","_ValidationTrackingMixinClass_retryTimers","Set","_ValidationTrackingMixinClass_listenersAttached","_ValidationTrackingMixinClass_generation","_ValidationTrackingMixinClass_send","_ValidationTrackingMixinClass_enabled","_ValidationTrackingMixinClass_boundFlushOnEnd","__classPrivateFieldGet","_ValidationTrackingMixinClass_instances","_ValidationTrackingMixinClass_flush","call","_ValidationTrackingMixinClass_boundFlushOnHide","document","visibilityState","_ValidationTrackingMixinClass_boundFlushOnPageHide","setValidationTrackingEnabled","enabled","__classPrivateFieldSet","_ValidationTrackingMixinClass_discard","setValidationTrackingSender","send","setValidationTrackingExecution","executionId","length","trackValidationErrors","inputs","context","_c","_b","logger","debug","String","teardownValidationTracking","forEach","clearTimeout","clear","removeEventListener","window","_ValidationTrackingMixinClass_collect","ctx","_ValidationTrackingMixinClass_attachListeners","input","event","getAttribute","id","type","message","validationMessage","screenName","ts","toEvent","key","some","push","_ValidationTrackingMixinClass_scheduleFlush","setTimeout","undefined","isUnload","events","batch","keepalive","catch","_ValidationTrackingMixinClass_sendWithRetry","retriesLeft","generation","then","res","ok","retryable","_ValidationTrackingMixinClass_scheduleRetry","timer","delete","add","addEventListener"],"mappings":"sMA+BA,MA+BMA,EAAaC,GACjB,GAAGA,EAAEC,YAAYD,EAAEE,SAASF,EAAEG,OAE1BC,EAAQ,KACZ,IACE,OAAOC,OAAOC,YACf,CAAC,MAAAC,GAEA,MAAO,GAAGC,KAAKC,SAASC,KAAKC,MAAsB,IAAhBD,KAAKE,WACzC,GAcUC,EAAuB,CAClCC,EACAC,IAEKD,EAKDA,EAASE,SAAiB,YAC1BF,EAASG,aAAqB,WAC9BH,EAASI,aACO,UAAdH,GAAuC,QAAdA,EAA4BA,EAClD,gBAELD,EAASK,gBAAwB,UACjCL,EAASM,SAAiB,YAC1BN,EAASO,QAAgB,WAE3BP,EAASQ,gBACTR,EAASS,eACTT,EAASU,aAEF,QAELV,EAASW,YAAoB,SAC1B,UAtBe,UA2CXC,EAA0BC,GACAC,gDACnC,MAAMC,EAAYC,EAAQC,EAARD,CAAqBF,GAEvC,OAAOrB,EAAA,cAA2CsB,EAA3C,WAAAG,mCAILC,EAAAC,IAAAC,KAAkC,IAOlCC,EAA4BF,IAAAC,UAAA,GAE5BE,EAA4CH,IAAAC,UAAA,GAI5CG,EAAeJ,IAAAC,KAAA,IAAII,KAEnBC,EAAAN,IAAAC,MAAqB,GAMrBM,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/mixins/validationTrackingMixin.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport { compose, createSingletonMixin } from '@descope/sdk-helpers';\nimport { loggerMixin } from '@descope/sdk-mixins';\n\n// Client-side form validation happens entirely in the browser (native\n// reportValidity/checkValidity) and produces no signal on its own - because an\n// invalid form never submits, the server never sees it. This mixin captures\n// those failures and batches them, so customers get visibility into where users\n// hit friction. Sending is the host's job - see ValidationSender below.\n//\n// Off unless the flow turns it on: the host calls setValidationTrackingEnabled\n// from the flow's config.json entry, and nothing is captured until it does.\n// It never blocks or fails the flow.\n\n/**\n * How a batch reaches the backend. The host supplies this (DescopeWc hands over\n * sdk.flow.event), so the mixin owns capture and batching and knows nothing\n * about transport, URLs or the SDK. Resolves to whether the batch was accepted\n * and whether retrying could ever help.\n */\nexport type ValidationSendResult = { ok: boolean; retryable: boolean };\nexport type ValidationBatch = {\n executionId: string;\n events: ValidationErrorEvent[];\n};\nexport type ValidationSender = (\n batch: ValidationBatch,\n options: { keepalive: boolean },\n) => Promise<ValidationSendResult>;\n\n// Flush the batch after this much inactivity, or once it reaches the cap.\nconst FLUSH_DEBOUNCE_MS = 2000;\nconst MAX_BATCH_SIZE = 20;\n\n// Bounded retry for normal (non-unload) flushes. Each event carries a stable\n// `id`, so the backend/CDP dedups a retried batch (no double-counting).\nconst MAX_SEND_RETRIES = 2;\nconst RETRY_BACKOFF_MS = 800;\n\n/** One captured validation failure, as sent to the backend. */\nexport type ValidationErrorEvent = {\n id: string;\n field: string;\n rule: string;\n message: string;\n screenId: string;\n screenName: string;\n ts: number;\n};\n\n/**\n * Where a batch belongs. Validation only ever happens on a screen, so the\n * screen is the location - there is no step in this model.\n */\ntype FlowContext = {\n executionId?: string;\n screenId?: string;\n screenName?: string;\n};\n\n// Same field failing the same way on the same screen is one signal, however\n// many times it fires (blur then submit).\nconst dedupeKey = (e: ValidationErrorEvent) =>\n `${e.screenId}|${e.field}|${e.rule}`;\n\nconst newId = (): string => {\n try {\n return crypto.randomUUID();\n } catch {\n // very old browsers: good-enough uniqueness for an idempotency key\n return `${Date.now()}-${Math.round(Math.random() * 1e9)}`;\n }\n};\n\n/**\n * Map an input's ValidityState to a machine-readable rule, one rule per native\n * failure so a customer can tell \"not a valid email\" from \"failed the pattern\n * the flow author wrote\" - different problems with different fixes. The exact\n * text the user saw is always in `message` as well. A field with a custom\n * validation message still keeps its native flag, so this stays accurate; only\n * a fully custom validator (setCustomValidity) reports `custom`.\n *\n * `inputType` is the input's `type`, needed because typeMismatch only says the\n * value is the wrong shape, not for what: it fires for `email` and `url` only.\n */\nexport const deriveValidationRule = (\n validity?: ValidityState,\n inputType?: string,\n): string => {\n if (!validity) return 'unknown';\n // Before valueMissing: a control that cannot parse what was typed reports an\n // empty value, so a required field sets BOTH flags (verified in Chromium:\n // type=\"number\" + \"5e\" -> badInput AND valueMissing). Reporting `required`\n // there would claim the user left it blank when they did type something.\n if (validity.badInput) return 'bad-input';\n if (validity.valueMissing) return 'required';\n if (validity.typeMismatch) {\n if (inputType === 'email' || inputType === 'url') return inputType;\n return 'type-mismatch';\n }\n if (validity.patternMismatch) return 'pattern';\n if (validity.tooShort) return 'too-short';\n if (validity.tooLong) return 'too-long';\n if (\n validity.rangeUnderflow ||\n validity.rangeOverflow ||\n validity.stepMismatch\n ) {\n return 'range';\n }\n if (validity.customError) return 'custom';\n return 'unknown';\n};\n\n/** Build one event from a failed input, or null if it has no name to report. */\nconst toEvent = (\n input: HTMLInputElement,\n ctx: FlowContext,\n): ValidationErrorEvent | null => {\n const field = input?.getAttribute?.('name');\n if (!field) return null;\n return {\n id: newId(),\n field,\n rule: deriveValidationRule(input.validity, input.type),\n message: input.validationMessage || '',\n screenId: ctx.screenId || '',\n screenName: ctx.screenName || '',\n ts: Date.now(),\n };\n};\n\nexport const validationTrackingMixin = createSingletonMixin(\n <T extends CustomElementConstructor>(superclass: T) => {\n const BaseClass = compose(loggerMixin)(superclass);\n\n return class ValidationTrackingMixinClass extends BaseClass {\n // Captured events waiting to go out. Flushed on screen change, flow end,\n // page hide, a size cap, or a short inactivity debounce. Each event\n // carries its own screen, so a batch need not be single-screen.\n #buffer: ValidationErrorEvent[] = [];\n\n // The execution the buffer belongs to. Unset until the flow starts: the\n // start screen renders from config.json before /v1/flow/start, and the\n // endpoint only accepts a live execution, so those events wait here. If\n // the flow never starts - the user gave up on the first screen - they are\n // dropped. That is the known abandonment gap.\n #bufferExecutionId?: string;\n\n #flushTimer?: ReturnType<typeof setTimeout>;\n\n // Pending retry timers. A failed flush leaves a chain in flight, and two\n // flushes can fail at once, so this holds more than one.\n #retryTimers = new Set<ReturnType<typeof setTimeout>>();\n\n #listenersAttached = false;\n\n // Bumped whenever in-flight work stops being wanted: tracking switched\n // off, or the component torn down. A send captures the value it started\n // with, so a response that lands after either event cannot resurrect a\n // retry chain the switch/teardown was supposed to end.\n #generation = 0;\n\n // Supplied by the host. Without it nothing can be sent, which is the\n // same safe default as being switched off.\n #send?: ValidationSender;\n\n // Off until the host turns it on from the flow's config.json entry. The\n // default matters: a host that never calls the setter captures nothing,\n // so a missing or stale config can never start collecting on its own.\n #enabled = false;\n\n #boundFlushOnEnd = () => this.#flush(false);\n\n #boundFlushOnHide = () => {\n // Page unload / tab hidden - the abandonment case. Use a keepalive\n // request so it survives the page going away.\n if (document.visibilityState === 'hidden') this.#flush(true);\n };\n\n #boundFlushOnPageHide = () => this.#flush(true);\n\n /**\n * Turn capture on or off. The host calls this from the flow's config,\n * where the setting is per flow and off unless the customer enabled it.\n * Turning it off drops whatever is buffered without sending it.\n */\n setValidationTrackingEnabled(enabled: boolean) {\n if (this.#enabled === enabled) return;\n this.#enabled = enabled;\n if (!enabled) this.#discard();\n }\n\n /** The host tells the mixin how to deliver a batch. */\n setValidationTrackingSender(send: ValidationSender) {\n this.#send = send;\n }\n\n /**\n * The flow now has an execution. Anything captured before it started -\n * on the start screen - can finally be attributed and sent.\n */\n setValidationTrackingExecution(executionId: string) {\n // Nothing held means nothing to attribute. Storing the id anyway would\n // leave it behind for a later batch that belongs to a different\n // execution - see the matching guard in #flush.\n if (!this.#enabled || !executionId || !this.#buffer.length) return;\n this.#bufferExecutionId = executionId;\n this.#flush(false);\n }\n\n /**\n * Public capture entry point. Called by the web-component at the two\n * validation points it already runs (submit + blur), passing the current\n * flow context. Best-effort: any failure here is swallowed so it can\n * never affect the flow.\n */\n trackValidationErrors(inputs: HTMLInputElement[], context: FlowContext) {\n try {\n this.#collect(inputs, context);\n } catch (e) {\n this.logger?.debug?.('Failed to track validation errors', String(e));\n }\n }\n\n #collect(inputs: HTMLInputElement[], context: FlowContext) {\n // Off for this flow, or nothing to report - capture nothing and attach\n // no listeners.\n if (!this.#enabled || !inputs?.length) return;\n const ctx = context || {};\n\n // Attach flush triggers on first real capture (nothing to flush before\n // there is a buffered event, so there's no reason to attach earlier).\n this.#attachListeners();\n\n inputs.forEach((input) => {\n // Still full after the flush below tried to drain it, which means it\n // cannot be sent yet. Hold at the cap so an abandoned start screen\n // cannot grow without bound - dropping the rest is the price.\n if (this.#buffer.length >= MAX_BATCH_SIZE) return;\n const event = toEvent(input, ctx);\n if (!event) return;\n const key = dedupeKey(event);\n if (this.#buffer.some((e) => dedupeKey(e) === key)) return;\n this.#buffer.push(event);\n // Tied to the batch, so it is set only once something is actually in\n // it, and re-set after a flush below empties it. Before the flow\n // starts this stays unset and the buffer just holds.\n this.#bufferExecutionId = ctx.executionId || this.#bufferExecutionId;\n // A deliverable batch is sent as soon as it fills up, and the rest of\n // this submit keeps collecting into a fresh one. A submit with more\n // than MAX_BATCH_SIZE invalid fields then loses nothing.\n if (this.#buffer.length >= MAX_BATCH_SIZE) this.#flush(false);\n });\n\n if (this.#buffer.length >= MAX_BATCH_SIZE) {\n this.#flush(false);\n } else {\n this.#scheduleFlush();\n }\n }\n\n #scheduleFlush() {\n clearTimeout(this.#flushTimer);\n this.#flushTimer = setTimeout(\n () => this.#flush(false),\n FLUSH_DEBOUNCE_MS,\n );\n }\n\n // Drop everything buffered without sending it, and cancel anything\n // already scheduled. Used when capture is switched off. Listeners that\n // were attached while it was on are left in place - they only call\n // #flush, which does nothing on an empty buffer.\n #discard() {\n clearTimeout(this.#flushTimer);\n this.#generation += 1;\n this.#retryTimers.forEach(clearTimeout);\n this.#retryTimers.clear();\n this.#buffer = [];\n this.#bufferExecutionId = undefined;\n }\n\n #flush(isUnload: boolean) {\n clearTimeout(this.#flushTimer);\n // Nothing buffered: drop the execution too. Holding it would outlive\n // the batch it belonged to, and after a flow restart the next\n // start-screen error would be attributed to the finished execution\n // instead of being held for the new one.\n if (!this.#buffer.length) {\n this.#bufferExecutionId = undefined;\n return;\n }\n // No execution yet - hold, don't drop. The endpoint would reject it.\n if (!this.#bufferExecutionId) return;\n\n // No way to deliver yet - hold rather than drain into nothing.\n if (!this.#send) return;\n\n const events = this.#buffer;\n const executionId = this.#bufferExecutionId;\n this.#buffer = [];\n this.#bufferExecutionId = undefined;\n\n try {\n const batch = { executionId, events };\n if (isUnload) {\n // Page is going away: single keepalive shot, retry isn't possible.\n this.#send(batch, { keepalive: true }).catch(() => {});\n } else {\n this.#sendWithRetry(batch, MAX_SEND_RETRIES, this.#generation);\n }\n } catch (e) {\n this.logger?.debug?.('Failed to send validation events', String(e));\n }\n }\n\n // Best-effort send with bounded retry (non-unload flushes only). Gives up\n // quietly after the last attempt. Events carry a stable `id`, so a retried\n // batch is deduped downstream.\n #sendWithRetry(\n batch: ValidationBatch,\n retriesLeft: number,\n generation: number,\n ) {\n this.#send(batch, { keepalive: false })\n .then((res) => {\n // Only retry what can succeed later - a rejected batch will not\n // become accepted, and retrying it just multiplies the load.\n if (!res.ok && res.retryable && retriesLeft > 0) {\n this.#scheduleRetry(batch, retriesLeft, generation);\n }\n })\n .catch(() => {\n // transport failure - worth another go\n if (retriesLeft > 0) {\n this.#scheduleRetry(batch, retriesLeft, generation);\n }\n });\n }\n\n #scheduleRetry(\n batch: ValidationBatch,\n retriesLeft: number,\n generation: number,\n ) {\n // A request already in flight when tracking is switched off - or when\n // the component went away - would otherwise keep retrying past it.\n if (generation !== this.#generation) return;\n const attempt = MAX_SEND_RETRIES - retriesLeft + 1;\n const timer = setTimeout(() => {\n this.#retryTimers.delete(timer);\n if (generation !== this.#generation) return;\n this.#sendWithRetry(batch, retriesLeft - 1, generation);\n }, RETRY_BACKOFF_MS * attempt);\n this.#retryTimers.add(timer);\n }\n\n #attachListeners() {\n if (this.#listenersAttached) return;\n this.#listenersAttached = true;\n // Flush when the funnel context changes or the flow ends.\n this.addEventListener('screen-updated', this.#boundFlushOnEnd);\n this.addEventListener('success', this.#boundFlushOnEnd);\n this.addEventListener('error', this.#boundFlushOnEnd);\n // Abandonment: capture on the way out (keepalive request).\n document.addEventListener('visibilitychange', this.#boundFlushOnHide);\n window.addEventListener('pagehide', this.#boundFlushOnPageHide);\n }\n\n // Called by the host's disconnectedCallback: flush anything buffered and\n // detach listeners. This mixin intentionally does NOT override\n // connectedCallback/disconnectedCallback - several mixins in the compose\n // chain already do, and a third override trips a TS intersection typing\n // issue. Listeners are attached lazily on first capture instead.\n teardownValidationTracking() {\n // Anything still held never got an execution - #flush leaves it, and\n // the component is going away, so it is dropped with the instance.\n this.#flush(false);\n // Drop any retry still waiting out its backoff - the component is gone.\n // Bumping the generation also covers a send still in flight, whose\n // response would otherwise schedule a fresh timer after this cleanup.\n this.#generation += 1;\n this.#retryTimers.forEach(clearTimeout);\n this.#retryTimers.clear();\n if (!this.#listenersAttached) return;\n this.#listenersAttached = false;\n this.removeEventListener('screen-updated', this.#boundFlushOnEnd);\n this.removeEventListener('success', this.#boundFlushOnEnd);\n this.removeEventListener('error', this.#boundFlushOnEnd);\n document.removeEventListener(\n 'visibilitychange',\n this.#boundFlushOnHide,\n );\n window.removeEventListener('pagehide', this.#boundFlushOnPageHide);\n }\n };\n },\n);\n"],"names":["dedupeKey","e","screenId","field","rule","newId","crypto","randomUUID","_a","Date","now","Math","round","random","deriveValidationRule","validity","inputType","badInput","valueMissing","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","customError","validationTrackingMixin","createSingletonMixin","superclass","BaseClass","compose","loggerMixin","constructor","_ValidationTrackingMixinClass_buffer","set","this","_ValidationTrackingMixinClass_bufferExecutionId","_ValidationTrackingMixinClass_flushTimer","_ValidationTrackingMixinClass_retryTimers","Set","_ValidationTrackingMixinClass_listenersAttached","_ValidationTrackingMixinClass_generation","_ValidationTrackingMixinClass_send","_ValidationTrackingMixinClass_enabled","_ValidationTrackingMixinClass_boundFlushOnEnd","__classPrivateFieldGet","_ValidationTrackingMixinClass_instances","_ValidationTrackingMixinClass_flush","call","_ValidationTrackingMixinClass_boundFlushOnHide","document","visibilityState","_ValidationTrackingMixinClass_boundFlushOnPageHide","setValidationTrackingEnabled","enabled","__classPrivateFieldSet","_ValidationTrackingMixinClass_discard","setValidationTrackingSender","send","setValidationTrackingExecution","executionId","length","trackValidationErrors","inputs","context","_c","_b","logger","debug","String","teardownValidationTracking","forEach","clearTimeout","clear","removeEventListener","window","_ValidationTrackingMixinClass_collect","ctx","_ValidationTrackingMixinClass_attachListeners","input","event","getAttribute","id","type","message","validationMessage","screenName","ts","toEvent","key","some","push","_ValidationTrackingMixinClass_scheduleFlush","setTimeout","undefined","isUnload","events","batch","keepalive","catch","_ValidationTrackingMixinClass_sendWithRetry","retriesLeft","generation","then","res","ok","retryable","_ValidationTrackingMixinClass_scheduleRetry","timer","delete","add","addEventListener"],"mappings":"sMA+BA,MA+BMA,EAAaC,GACjB,GAAGA,EAAEC,YAAYD,EAAEE,SAASF,EAAEG,OAE1BC,EAAQ,KACZ,IACE,OAAOC,OAAOC,YAChB,CAAE,MAAAC,GAEA,MAAO,GAAGC,KAAKC,SAASC,KAAKC,MAAsB,IAAhBD,KAAKE,WAC1C,GAcWC,EAAuB,CAClCC,EACAC,IAEKD,EAKDA,EAASE,SAAiB,YAC1BF,EAASG,aAAqB,WAC9BH,EAASI,aACO,UAAdH,GAAuC,QAAdA,EAA4BA,EAClD,gBAELD,EAASK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EAAApB,KAAIK,GAAsB,EAAI,KAE9BL,KAAK4E,iBAAiB,iBAAkBlE,EAAAV,KAAIS,EAAA,MAC5CT,KAAK4E,iBAAiB,UAAWlE,EAAAV,KAAIS,EAAA,MACrCT,KAAK4E,iBAAiB,QAASlE,EAAAV,KAAIS,EAAA,MAEnCM,SAAS6D,iBAAiB,mBAAoBlE,EAAAV,KAAIc,EAAA,MAClD0B,OAAOoC,iBAAiB,WAAYlE,EAAAV,KAAIiB,EAAA,MAC1C,EA4BA7C,CAAA"}
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../src/lib/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { JWTResponse } from '@descope/web-js-sdk';\nimport { createSdk } from '@descope/web-js-sdk';\n\nexport type SdkConfig = Parameters<typeof createSdk>[0];\nexport type Sdk = ReturnType<typeof createSdk>;\n\nexport type SdkFlowNext = Sdk['flow']['next'];\n\nexport type ComponentsDynamicAttrs = {\n attributes: Record<string, any>;\n};\n\nexport type ComponentsConfig = Record<string, any> & {\n componentsDynamicAttrs?: Record<string, ComponentsDynamicAttrs>;\n};\nexport type CssVars = Record<string, any>;\n\ntype KeepArgsByIndex<F, Indices extends readonly number[]> = F extends (\n ...args: infer A\n) => infer R\n ? (...args: PickArgsByIndex<A, Indices>) => R\n : never;\n\ntype PickArgsByIndex<\n All extends readonly any[],\n Indices extends readonly number[],\n> = {\n [K in keyof Indices]: Indices[K] extends keyof All ? All[Indices[K]] : never;\n};\n\ntype Project = {\n name: string;\n};\n\nexport enum Direction {\n backward = 'backward',\n forward = 'forward',\n}\n\nexport type LastAuthState = NonNullable<\n NextFnReturnPromiseValue['data']['lastAuth']\n> & {\n loginId?: string;\n name?: string;\n lastUsedPerScreen?: Record<string, string>;\n};\n\nexport type RealtimeOperandKind = 'value' | 'form' | 'list';\n\n// Operators the SDK is allowed to evaluate locally. The server's\n// clientSupportedRealtimeOperators must stay in sync — anything outside this\n// list is pre-evaluated server-side and shipped as a value operand.\n//\n// is-email / is-phone are intentionally absent: the server validates them\n// with dedicated libraries (contact.IsValid*); the client has no equivalent,\n// so the server keeps these CCs server-only.\nexport type RealtimeOperator =\n | 'equal'\n | 'not-equal'\n | 'contains'\n | 'doesnt-contains'\n | 'greater-than'\n | 'greater-than-or-equal'\n | 'less-than'\n | 'less-than-or-equal'\n | 'empty'\n | 'not-empty'\n | 'is-true'\n | 'is-false'\n | 'in'\n | 'not-in'\n | 'matches';\n\nexport interface RealtimeOperand {\n kind: RealtimeOperandKind;\n // Form is the context key the client looks up from the live form snapshot\n // (e.g. \"form.phone\"). Set only when kind === 'form'.\n form?: string;\n // Items is the operand list when kind === 'list'. Each element is a nested\n // operand — either a form placeholder or a resolved literal. Used when the\n // server detects an `in` / `not-in` / `contains` predicate whose array\n // contains `{{form.X}}` references; the client resolves them at eval time.\n items?: RealtimeOperand[];\n // Pre-resolved literal. Set only when kind === 'value', and may legitimately\n // be false / 0 / \"\" — do not treat absence as \"no value\" without checking\n // kind first.\n value?: unknown;\n}\n\nexport interface RealtimeAtomicCondition {\n operator: RealtimeOperator;\n target?: RealtimeOperand;\n predicate?: RealtimeOperand;\n}\n\nexport interface RealtimeRule {\n logicalOr?: boolean;\n atomicConditions: RealtimeAtomicCondition[];\n}\n\nexport interface RealtimeComponentsCondition {\n id?: string;\n componentIds: string[];\n action: string;\n rules: RealtimeRule[];\n}\n\n// the server sends the full user object; only the fields the SDK reads are\n// typed here\nexport interface ScreenStateUser {\n email?: string;\n loginIds?: string[];\n [key: string]: unknown;\n}\n\nexport interface ScreenState {\n errorText?: string;\n errorType?: string;\n componentsConfig?: ComponentsConfig;\n cssVars?: CssVars;\n form?: Record<string, string>;\n inputs?: Record<string, string>; // Backward compatibility\n lastAuth?: LastAuthState;\n project?: Project;\n totp?: { image?: string; provisionUrl?: string };\n notp?: { image?: string; redirectUrl?: string };\n selfProvisionDomains?: unknown;\n user?: ScreenStateUser;\n sso?: unknown;\n dynamicSelects?: unknown;\n keysInUse?: unknown;\n genericForm?: unknown;\n linkId?: unknown;\n sentTo?: unknown;\n clientScripts?: ClientScript[];\n // map of component IDs to their state — the FULL last-wins verdict over\n // all CCs (server-only + client-eligible) the BE evaluated at screen-init.\n // Used by `applyComponentsState` for the first DOM paint.\n componentsState?: Record<string, string>;\n // Subset of `componentsState` contributed by SERVER-ONLY CCs — those the\n // client cannot re-evaluate locally (operators on the server-only\n // allow-list like `is-email`, or rules referencing context the client\n // doesn't have). Parallels `componentsState` in structure but excludes\n // contributions from client-eligible CCs that also ship in\n // `realtimeComponentsConditions`.\n //\n // The realtime layer uses this as the fallback action to restore when a\n // realtime CC stops firing on a touched component — without it the SDK\n // can't tell whether the action in `componentsState` came from a\n // server-only CC (must persist) or from a realtime CC also re-shipped\n // (must clear).\n //\n // Absent on old backends; new SDKs fall back to a legacy heuristic that\n // infers the same information from `componentsState`, so the old-BE /\n // new-SDK combination still works correctly.\n serverOnlyComponentsState?: Record<string, string>;\n // Client-evaluable visibility conditions, populated only by new backends.\n // Absent on old backends; new SDKs ignore when absent.\n realtimeComponentsConditions?: RealtimeComponentsCondition[];\n}\n\nexport type SSOQueryParams = {\n oidcIdpStateId?: string;\n samlIdpStateId?: string;\n wsfedIdpStateId?: string;\n samlIdpUsername?: string;\n descopeIdpInitiated?: boolean;\n ssoAppId?: string;\n customAppId?: string;\n thirdPartyAppId: string;\n thirdPartyAppStateId?: string;\n applicationScopes?: string;\n} & OIDCOptions;\n\nexport type OIDCOptions = {\n oidcLoginHint?: string;\n oidcPrompt?: string;\n oidcErrorRedirectUri?: string;\n oidcResource?: string;\n};\n\nexport type FlowState = {\n flowId: string;\n projectId: string;\n baseUrl: string;\n tenant: string;\n stepId: string;\n stepName: string;\n executionId: string;\n action: string;\n redirectTo: string;\n redirectIsPopup: boolean;\n openInNewTabUrl?: string;\n redirectUrl: string;\n screenId: string;\n screenState: ScreenState;\n token: string;\n code: string;\n isPopup: boolean;\n exchangeError: string;\n webauthnTransactionId: string;\n webauthnOptions: string;\n redirectAuthCodeChallenge: string;\n redirectAuthCallbackUrl: string;\n redirectAuthBackupCallbackUri: string;\n redirectAuthInitiator: string;\n deferredRedirect: boolean;\n deferredPolling: boolean;\n locale: string;\n samlIdpResponseUrl: string;\n samlIdpResponseSamlResponse: string;\n samlIdpResponseRelayState: string;\n wsFedIdpResponseUrl: string;\n wsFedIdpResponseWresult: string;\n wsFedIdpResponseWctx: string;\n nativeResponseType: string;\n nativePayload: Record<string, any>;\n reqTimestamp: number;\n} & SSOQueryParams;\n\nexport type StepState = {\n screenState: ScreenState;\n screenId: string;\n stepName: string;\n htmlFilename: string;\n htmlLocaleFilename: string;\n next: NextFn;\n direction: Direction | undefined;\n samlIdpUsername: string;\n action?: string;\n locale?: string;\n} & OIDCOptions;\n\nexport type CustomScreenState = Omit<\n ScreenState,\n // Removed from the top level of the custom-screen context:\n // - cssVars/componentsConfig/inputs/clientScripts: internal.\n // - errorText/errorType: reshaped into `error`.\n // - the rest: server-produced screen data, relocated under `data`.\n | 'cssVars'\n | 'componentsConfig'\n | 'inputs'\n | 'errorText'\n | 'errorType'\n | 'clientScripts'\n | 'totp'\n | 'notp'\n | 'sentTo'\n | 'sso'\n | 'selfProvisionDomains'\n> & {\n error?: {\n text: ScreenState['errorText'];\n type: ScreenState['errorType'];\n };\n action?: string;\n /**\n * All server-produced screen data, in one place. Previously this data was spread\n * across the top level and a deeply-nested, selector-keyed `componentsConfig`.\n * Only known, documented fields are exposed (renamed/normalized); anything else is\n * dropped. SDK-owned/reserved — a value with this key coming from the backend is ignored.\n */\n data?: CustomScreenData;\n};\n\n/**\n * Cleaned view of the flow screen's `componentsConfig`. Every field is optional and\n * only present when the screen actually produces it.\n */\nexport type CustomScreenData = {\n /** TOTP MFA setup: QR image + provisioning URL. */\n totp?: { image?: string; provisionUrl?: string };\n /** Notification-OTP setup: image + redirect URL. */\n notp?: { image?: string; redirectUrl?: string };\n /** Where the OTP/code was sent — masked email and/or phone. */\n sentTo?: { maskedEmail?: string; maskedPhone?: string };\n /** SSO (SAML) service-provider config for SSO-setup screens. */\n sso?: { acsUrl?: string; descopeEntityId?: string; spMetadataUrl?: string };\n /** Email domains allowed to self-provision into the tenant. */\n selfProvisionDomains?: string;\n /** OAuth scopes an inbound (third-party) app is asking the user to approve. */\n inboundAppApproveScopes?: { desc: string; id: string; required: boolean }[];\n /** Password rules to show/enforce on a password screen. */\n passwordPolicy?: {\n minLength?: string;\n strength?: string;\n disallowedChars?: string;\n email?: string;\n reuse?: string;\n activePolicies?: string;\n availablePolicies?: string;\n };\n /** Security questions to set up, plus how many are required. */\n securityQuestionsSetup?: {\n questions?: { id: string; text: string }[];\n count?: number;\n };\n /** Security questions to verify the user against. */\n securityQuestionsVerify?: { questions?: { id: string; text: string }[] };\n /** Tenants the user can pick from (tenant-selection screen). */\n userTenants?: { label: string; value: string }[];\n /** SSO applications the user can pick from. */\n ssoApplications?: { label: string; value: string }[];\n /** SSO configurations the user can pick from. */\n ssoConfigurations?: { label: string; value: string }[];\n /** Roles the user can pick from. */\n userRoles?: { label: string; value: string }[];\n /** SAML attribute-mapping options (SSO-setup screens). */\n samlAttributeMappings?: { label: string; value: string }[];\n /** OIDC attribute-mapping options (SSO-setup screens). */\n oidcAttributeMappings?: { label: string; value: string }[];\n /** SAML group-mapping options (SSO-setup screens). */\n samlGroupMappings?: { label: string; value: string }[];\n /** Generated MFA recovery codes to display to the user. */\n recoveryCodes?: string[];\n /** Outbound OAuth app button info (label, icon, app id). */\n outboundApp?: { label?: string; iconSrc?: string; appId?: string };\n\n // Contract rule: every key on `data` is an SDK-owned, documented name. We never\n // place arbitrary, flow-author-controlled keys directly on `data`, so adding new\n // named fields stays backwards-compatible (no collisions, no reshape).\n //\n // Reserved for a future addition: dynamic-select options. Their keys are the\n // flow's own select field names (e.g. \"country\"), so they can't be named here —\n // when exposed, they'll go under their own sub-map to keep them collision-free:\n // selects?: Record<string, { label: string; value: string }[]>;\n // Not populated yet (see README). Adding it later is additive, not breaking.\n};\n\nexport type DebugState = {\n isDebug: boolean;\n};\n\nexport interface ScriptElement extends HTMLDivElement {\n moduleRes?: ScriptModule;\n}\n\nexport type ScriptModule = {\n /**\n * Unique identifier of the module.\n */\n id: string;\n /**\n * Notifies the module that it should start any profiling or monitoring.\n */\n start?: () => void;\n /**\n * Notifies the module that it should stop any profiling or monitoring.\n */\n stop?: () => void;\n /**\n * Presents the user with any required interaction to get a refreshed token or state,\n * e.g., a challenge or captcha.\n *\n * Modules should return a value of true if the presentation completed successfully,\n * false if it was cancelled by the user, and throw an error in case of failure.\n *\n * This is called before form submission (via a next call) after a button click.\n */\n present?: () => Promise<boolean>;\n /**\n * Refreshes any tokens or state that might be needed before form submission.\n *\n * Modules should throw an error in case of failure.\n */\n refresh?: () => Promise<void>;\n};\n\nexport type ClientScript = {\n id: string;\n initArgs: Record<string, any>;\n resultKey?: string;\n};\n\nexport type NextFn = KeepArgsByIndex<SdkFlowNext, [2, 5]> & {\n isCustomScreen?: boolean;\n};\nexport type NextFnReturnPromiseValue = Awaited<ReturnType<NextFn>>;\n\nexport type DebuggerMessage = {\n title: string;\n description?: string;\n};\n\nexport type FlowStateUpdateFn = (state: FlowState) => void;\n\ntype Operator =\n | 'equal'\n | 'not-equal'\n | 'contains'\n | 'greater-than'\n | 'greater-than-or-equal'\n | 'less-than'\n | 'less-than-or-equal'\n | 'empty'\n | 'not-empty'\n | 'is-true'\n | 'is-false'\n | 'in'\n | 'not-in'\n | 'in-range'\n | 'not-in-range'\n | 'devised-by';\n\nexport interface ClientConditionResult {\n screenId: string;\n screenName: string;\n clientScripts?: ClientScript[];\n componentsConfig?: ComponentsConfig;\n interactionId: string;\n}\n\nexport interface ClientCondition {\n operator: Operator;\n key: string;\n predicate?: string | number;\n met: ClientConditionResult;\n unmet?: ClientConditionResult;\n}\n\nexport type AutoFocusOptions = true | false | 'skipFirstScreen';\n\nexport type ThemeOptions = 'light' | 'dark' | 'os';\n\nexport type Key =\n | 'lastAuth.loginId'\n | 'idpInitiated'\n | 'externalToken'\n | 'abTestingKey';\n\ntype CheckFunction = (ctx: Context, predicate?: string | number) => boolean;\n\nexport type ConditionsMap = {\n [key in Key]: {\n [operator in Operator]?: CheckFunction;\n };\n};\n\nexport interface Context {\n loginId?: string;\n code?: string;\n token?: string;\n abTestingKey?: number;\n lastAuth?: LastAuthState;\n}\n\nexport type DescopeUI = Record<string, () => Promise<void>> & {\n componentsThemeManager: Record<string, any>;\n};\n\ntype Font = {\n family: string[];\n label: string;\n url?: string;\n};\n\ntype ThemeTemplate = {\n fonts: {\n font1: Font;\n font2: Font;\n };\n};\n\ntype ThemeColor = {\n main: string;\n dark: string;\n light: string;\n highlight: string;\n contrast: string;\n};\n\nexport type OverrideTheme = {\n globals?: {\n colors?: {\n primary?: ThemeColor;\n secondary?: ThemeColor;\n };\n };\n};\n\nexport type OverrideThemes = {\n dark?: OverrideTheme;\n light?: OverrideTheme;\n};\n\nexport type FlowConfig = {\n startScreenId?: string;\n startScreenName?: string;\n version: number;\n targetLocales?: string[];\n conditions?: ClientCondition[];\n condition?: ClientCondition;\n fingerprintEnabled?: boolean;\n fingerprintKey?: string;\n // Per-flow switch for client-side validation error tracking. Absent means off.\n clientValidationTrackingEnabled?: boolean;\n sdkScripts?: [\n {\n id: string;\n initArgs: Record<string, any>;\n resultKey?: string;\n },\n ];\n clientScripts?: ClientScript[];\n componentsConfig?: ComponentsConfig;\n};\n\nexport interface ProjectConfiguration {\n componentsVersion: string;\n cssTemplate: {\n dark: ThemeTemplate;\n light: ThemeTemplate;\n };\n flows: {\n [key: string]: FlowConfig; // dynamic key names for flows\n };\n}\n\nexport type FlowStatus = 'loading' | 'error' | 'success' | 'ready' | 'initial';\n\nexport type CustomStorage = {\n getItem: (key: string) => string | null;\n setItem: (key: string, value: string) => void;\n removeItem: (key: string) => void;\n};\n\nexport type FlowJWTResponse = JWTResponse & {\n flowOutput?: Record<string, any>;\n};\n"],"names":["Direction"],"mappings":"IAoCYA,GAAZ,SAAYA,GACVA,EAAA,SAAA,WACAA,EAAA,QAAA,SACD,CAHD,CAAYA,IAAAA,EAGX,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../src/lib/types.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport type { JWTResponse } from '@descope/web-js-sdk';\nimport { createSdk } from '@descope/web-js-sdk';\n\nexport type SdkConfig = Parameters<typeof createSdk>[0];\nexport type Sdk = ReturnType<typeof createSdk>;\n\nexport type SdkFlowNext = Sdk['flow']['next'];\n\nexport type ComponentsDynamicAttrs = {\n attributes: Record<string, any>;\n};\n\nexport type ComponentsConfig = Record<string, any> & {\n componentsDynamicAttrs?: Record<string, ComponentsDynamicAttrs>;\n};\nexport type CssVars = Record<string, any>;\n\ntype KeepArgsByIndex<F, Indices extends readonly number[]> = F extends (\n ...args: infer A\n) => infer R\n ? (...args: PickArgsByIndex<A, Indices>) => R\n : never;\n\ntype PickArgsByIndex<\n All extends readonly any[],\n Indices extends readonly number[],\n> = {\n [K in keyof Indices]: Indices[K] extends keyof All ? All[Indices[K]] : never;\n};\n\ntype Project = {\n name: string;\n};\n\nexport enum Direction {\n backward = 'backward',\n forward = 'forward',\n}\n\nexport type LastAuthState = NonNullable<\n NextFnReturnPromiseValue['data']['lastAuth']\n> & {\n loginId?: string;\n name?: string;\n lastUsedPerScreen?: Record<string, string>;\n};\n\nexport type RealtimeOperandKind = 'value' | 'form' | 'list';\n\n// Operators the SDK is allowed to evaluate locally. The server's\n// clientSupportedRealtimeOperators must stay in sync — anything outside this\n// list is pre-evaluated server-side and shipped as a value operand.\n//\n// is-email / is-phone are intentionally absent: the server validates them\n// with dedicated libraries (contact.IsValid*); the client has no equivalent,\n// so the server keeps these CCs server-only.\nexport type RealtimeOperator =\n | 'equal'\n | 'not-equal'\n | 'contains'\n | 'doesnt-contains'\n | 'greater-than'\n | 'greater-than-or-equal'\n | 'less-than'\n | 'less-than-or-equal'\n | 'empty'\n | 'not-empty'\n | 'is-true'\n | 'is-false'\n | 'in'\n | 'not-in'\n | 'matches';\n\nexport interface RealtimeOperand {\n kind: RealtimeOperandKind;\n // Form is the context key the client looks up from the live form snapshot\n // (e.g. \"form.phone\"). Set only when kind === 'form'.\n form?: string;\n // Items is the operand list when kind === 'list'. Each element is a nested\n // operand — either a form placeholder or a resolved literal. Used when the\n // server detects an `in` / `not-in` / `contains` predicate whose array\n // contains `{{form.X}}` references; the client resolves them at eval time.\n items?: RealtimeOperand[];\n // Pre-resolved literal. Set only when kind === 'value', and may legitimately\n // be false / 0 / \"\" — do not treat absence as \"no value\" without checking\n // kind first.\n value?: unknown;\n}\n\nexport interface RealtimeAtomicCondition {\n operator: RealtimeOperator;\n target?: RealtimeOperand;\n predicate?: RealtimeOperand;\n}\n\nexport interface RealtimeRule {\n logicalOr?: boolean;\n atomicConditions: RealtimeAtomicCondition[];\n}\n\nexport interface RealtimeComponentsCondition {\n id?: string;\n componentIds: string[];\n action: string;\n rules: RealtimeRule[];\n}\n\n// the server sends the full user object; only the fields the SDK reads are\n// typed here\nexport interface ScreenStateUser {\n email?: string;\n loginIds?: string[];\n [key: string]: unknown;\n}\n\nexport interface ScreenState {\n errorText?: string;\n errorType?: string;\n componentsConfig?: ComponentsConfig;\n cssVars?: CssVars;\n form?: Record<string, string>;\n inputs?: Record<string, string>; // Backward compatibility\n lastAuth?: LastAuthState;\n project?: Project;\n totp?: { image?: string; provisionUrl?: string };\n notp?: { image?: string; redirectUrl?: string };\n selfProvisionDomains?: unknown;\n user?: ScreenStateUser;\n sso?: unknown;\n dynamicSelects?: unknown;\n keysInUse?: unknown;\n genericForm?: unknown;\n linkId?: unknown;\n sentTo?: unknown;\n clientScripts?: ClientScript[];\n // map of component IDs to their state — the FULL last-wins verdict over\n // all CCs (server-only + client-eligible) the BE evaluated at screen-init.\n // Used by `applyComponentsState` for the first DOM paint.\n componentsState?: Record<string, string>;\n // Subset of `componentsState` contributed by SERVER-ONLY CCs — those the\n // client cannot re-evaluate locally (operators on the server-only\n // allow-list like `is-email`, or rules referencing context the client\n // doesn't have). Parallels `componentsState` in structure but excludes\n // contributions from client-eligible CCs that also ship in\n // `realtimeComponentsConditions`.\n //\n // The realtime layer uses this as the fallback action to restore when a\n // realtime CC stops firing on a touched component — without it the SDK\n // can't tell whether the action in `componentsState` came from a\n // server-only CC (must persist) or from a realtime CC also re-shipped\n // (must clear).\n //\n // Absent on old backends; new SDKs fall back to a legacy heuristic that\n // infers the same information from `componentsState`, so the old-BE /\n // new-SDK combination still works correctly.\n serverOnlyComponentsState?: Record<string, string>;\n // Client-evaluable visibility conditions, populated only by new backends.\n // Absent on old backends; new SDKs ignore when absent.\n realtimeComponentsConditions?: RealtimeComponentsCondition[];\n}\n\nexport type SSOQueryParams = {\n oidcIdpStateId?: string;\n samlIdpStateId?: string;\n wsfedIdpStateId?: string;\n samlIdpUsername?: string;\n descopeIdpInitiated?: boolean;\n ssoAppId?: string;\n customAppId?: string;\n thirdPartyAppId: string;\n thirdPartyAppStateId?: string;\n applicationScopes?: string;\n} & OIDCOptions;\n\nexport type OIDCOptions = {\n oidcLoginHint?: string;\n oidcPrompt?: string;\n oidcErrorRedirectUri?: string;\n oidcResource?: string;\n};\n\nexport type FlowState = {\n flowId: string;\n projectId: string;\n baseUrl: string;\n tenant: string;\n stepId: string;\n stepName: string;\n executionId: string;\n action: string;\n redirectTo: string;\n redirectIsPopup: boolean;\n openInNewTabUrl?: string;\n redirectUrl: string;\n screenId: string;\n screenState: ScreenState;\n token: string;\n code: string;\n isPopup: boolean;\n exchangeError: string;\n webauthnTransactionId: string;\n webauthnOptions: string;\n redirectAuthCodeChallenge: string;\n redirectAuthCallbackUrl: string;\n redirectAuthBackupCallbackUri: string;\n redirectAuthInitiator: string;\n deferredRedirect: boolean;\n deferredPolling: boolean;\n locale: string;\n samlIdpResponseUrl: string;\n samlIdpResponseSamlResponse: string;\n samlIdpResponseRelayState: string;\n wsFedIdpResponseUrl: string;\n wsFedIdpResponseWresult: string;\n wsFedIdpResponseWctx: string;\n nativeResponseType: string;\n nativePayload: Record<string, any>;\n reqTimestamp: number;\n} & SSOQueryParams;\n\nexport type StepState = {\n screenState: ScreenState;\n screenId: string;\n stepName: string;\n htmlFilename: string;\n htmlLocaleFilename: string;\n next: NextFn;\n direction: Direction | undefined;\n samlIdpUsername: string;\n action?: string;\n locale?: string;\n} & OIDCOptions;\n\nexport type CustomScreenState = Omit<\n ScreenState,\n // Removed from the top level of the custom-screen context:\n // - cssVars/componentsConfig/inputs/clientScripts: internal.\n // - errorText/errorType: reshaped into `error`.\n // - the rest: server-produced screen data, relocated under `data`.\n | 'cssVars'\n | 'componentsConfig'\n | 'inputs'\n | 'errorText'\n | 'errorType'\n | 'clientScripts'\n | 'totp'\n | 'notp'\n | 'sentTo'\n | 'sso'\n | 'selfProvisionDomains'\n> & {\n error?: {\n text: ScreenState['errorText'];\n type: ScreenState['errorType'];\n };\n action?: string;\n /**\n * All server-produced screen data, in one place. Previously this data was spread\n * across the top level and a deeply-nested, selector-keyed `componentsConfig`.\n * Only known, documented fields are exposed (renamed/normalized); anything else is\n * dropped. SDK-owned/reserved — a value with this key coming from the backend is ignored.\n */\n data?: CustomScreenData;\n};\n\n/**\n * Cleaned view of the flow screen's `componentsConfig`. Every field is optional and\n * only present when the screen actually produces it.\n */\nexport type CustomScreenData = {\n /** TOTP MFA setup: QR image + provisioning URL. */\n totp?: { image?: string; provisionUrl?: string };\n /** Notification-OTP setup: image + redirect URL. */\n notp?: { image?: string; redirectUrl?: string };\n /** Where the OTP/code was sent — masked email and/or phone. */\n sentTo?: { maskedEmail?: string; maskedPhone?: string };\n /** SSO (SAML) service-provider config for SSO-setup screens. */\n sso?: { acsUrl?: string; descopeEntityId?: string; spMetadataUrl?: string };\n /** Email domains allowed to self-provision into the tenant. */\n selfProvisionDomains?: string;\n /** OAuth scopes an inbound (third-party) app is asking the user to approve. */\n inboundAppApproveScopes?: { desc: string; id: string; required: boolean }[];\n /** Password rules to show/enforce on a password screen. */\n passwordPolicy?: {\n minLength?: string;\n strength?: string;\n disallowedChars?: string;\n email?: string;\n reuse?: string;\n activePolicies?: string;\n availablePolicies?: string;\n };\n /** Security questions to set up, plus how many are required. */\n securityQuestionsSetup?: {\n questions?: { id: string; text: string }[];\n count?: number;\n };\n /** Security questions to verify the user against. */\n securityQuestionsVerify?: { questions?: { id: string; text: string }[] };\n /** Tenants the user can pick from (tenant-selection screen). */\n userTenants?: { label: string; value: string }[];\n /** SSO applications the user can pick from. */\n ssoApplications?: { label: string; value: string }[];\n /** SSO configurations the user can pick from. */\n ssoConfigurations?: { label: string; value: string }[];\n /** Roles the user can pick from. */\n userRoles?: { label: string; value: string }[];\n /** SAML attribute-mapping options (SSO-setup screens). */\n samlAttributeMappings?: { label: string; value: string }[];\n /** OIDC attribute-mapping options (SSO-setup screens). */\n oidcAttributeMappings?: { label: string; value: string }[];\n /** SAML group-mapping options (SSO-setup screens). */\n samlGroupMappings?: { label: string; value: string }[];\n /** Generated MFA recovery codes to display to the user. */\n recoveryCodes?: string[];\n /** Outbound OAuth app button info (label, icon, app id). */\n outboundApp?: { label?: string; iconSrc?: string; appId?: string };\n\n // Contract rule: every key on `data` is an SDK-owned, documented name. We never\n // place arbitrary, flow-author-controlled keys directly on `data`, so adding new\n // named fields stays backwards-compatible (no collisions, no reshape).\n //\n // Reserved for a future addition: dynamic-select options. Their keys are the\n // flow's own select field names (e.g. \"country\"), so they can't be named here —\n // when exposed, they'll go under their own sub-map to keep them collision-free:\n // selects?: Record<string, { label: string; value: string }[]>;\n // Not populated yet (see README). Adding it later is additive, not breaking.\n};\n\nexport type DebugState = {\n isDebug: boolean;\n};\n\nexport interface ScriptElement extends HTMLDivElement {\n moduleRes?: ScriptModule;\n}\n\nexport type ScriptModule = {\n /**\n * Unique identifier of the module.\n */\n id: string;\n /**\n * Notifies the module that it should start any profiling or monitoring.\n */\n start?: () => void;\n /**\n * Notifies the module that it should stop any profiling or monitoring.\n */\n stop?: () => void;\n /**\n * Presents the user with any required interaction to get a refreshed token or state,\n * e.g., a challenge or captcha.\n *\n * Modules should return a value of true if the presentation completed successfully,\n * false if it was cancelled by the user, and throw an error in case of failure.\n *\n * This is called before form submission (via a next call) after a button click.\n */\n present?: () => Promise<boolean>;\n /**\n * Refreshes any tokens or state that might be needed before form submission.\n *\n * Modules should throw an error in case of failure.\n */\n refresh?: () => Promise<void>;\n};\n\nexport type ClientScript = {\n id: string;\n initArgs: Record<string, any>;\n resultKey?: string;\n};\n\nexport type NextFn = KeepArgsByIndex<SdkFlowNext, [2, 5]> & {\n isCustomScreen?: boolean;\n};\nexport type NextFnReturnPromiseValue = Awaited<ReturnType<NextFn>>;\n\nexport type DebuggerMessage = {\n title: string;\n description?: string;\n};\n\nexport type FlowStateUpdateFn = (state: FlowState) => void;\n\ntype Operator =\n | 'equal'\n | 'not-equal'\n | 'contains'\n | 'greater-than'\n | 'greater-than-or-equal'\n | 'less-than'\n | 'less-than-or-equal'\n | 'empty'\n | 'not-empty'\n | 'is-true'\n | 'is-false'\n | 'in'\n | 'not-in'\n | 'in-range'\n | 'not-in-range'\n | 'devised-by';\n\nexport interface ClientConditionResult {\n screenId: string;\n screenName: string;\n clientScripts?: ClientScript[];\n componentsConfig?: ComponentsConfig;\n interactionId: string;\n}\n\nexport interface ClientCondition {\n operator: Operator;\n key: string;\n predicate?: string | number;\n met: ClientConditionResult;\n unmet?: ClientConditionResult;\n}\n\nexport type AutoFocusOptions = true | false | 'skipFirstScreen';\n\nexport type ThemeOptions = 'light' | 'dark' | 'os';\n\nexport type Key =\n | 'lastAuth.loginId'\n | 'idpInitiated'\n | 'externalToken'\n | 'abTestingKey';\n\ntype CheckFunction = (ctx: Context, predicate?: string | number) => boolean;\n\nexport type ConditionsMap = {\n [key in Key]: {\n [operator in Operator]?: CheckFunction;\n };\n};\n\nexport interface Context {\n loginId?: string;\n code?: string;\n token?: string;\n abTestingKey?: number;\n lastAuth?: LastAuthState;\n}\n\nexport type DescopeUI = Record<string, () => Promise<void>> & {\n componentsThemeManager: Record<string, any>;\n};\n\ntype Font = {\n family: string[];\n label: string;\n url?: string;\n};\n\ntype ThemeTemplate = {\n fonts: {\n font1: Font;\n font2: Font;\n };\n};\n\ntype ThemeColor = {\n main: string;\n dark: string;\n light: string;\n highlight: string;\n contrast: string;\n};\n\nexport type OverrideTheme = {\n globals?: {\n colors?: {\n primary?: ThemeColor;\n secondary?: ThemeColor;\n };\n };\n};\n\nexport type OverrideThemes = {\n dark?: OverrideTheme;\n light?: OverrideTheme;\n};\n\nexport type FlowConfig = {\n startScreenId?: string;\n startScreenName?: string;\n version: number;\n targetLocales?: string[];\n conditions?: ClientCondition[];\n condition?: ClientCondition;\n fingerprintEnabled?: boolean;\n fingerprintKey?: string;\n // Per-flow switch for client-side validation error tracking. Absent means off.\n clientValidationTrackingEnabled?: boolean;\n sdkScripts?: [\n {\n id: string;\n initArgs: Record<string, any>;\n resultKey?: string;\n },\n ];\n clientScripts?: ClientScript[];\n componentsConfig?: ComponentsConfig;\n};\n\nexport interface ProjectConfiguration {\n componentsVersion: string;\n cssTemplate: {\n dark: ThemeTemplate;\n light: ThemeTemplate;\n };\n flows: {\n [key: string]: FlowConfig; // dynamic key names for flows\n };\n}\n\nexport type FlowStatus = 'loading' | 'error' | 'success' | 'ready' | 'initial';\n\nexport type CustomStorage = {\n getItem: (key: string) => string | null;\n setItem: (key: string, value: string) => void;\n removeItem: (key: string) => void;\n};\n\nexport type FlowJWTResponse = JWTResponse & {\n flowOutput?: Record<string, any>;\n};\n"],"names":["Direction"],"mappings":"IAoCYA,GAAZ,SAAYA,GACVA,EAAA,SAAA,WACAA,EAAA,QAAA,SACD,CAHD,CAAYA,IAAAA,EAAS,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -495,8 +495,8 @@ declare const BaseClass: {
|
|
|
495
495
|
"__#12@#scheduleRetry"(batch: ValidationBatch, retriesLeft: number, generation: number): void;
|
|
496
496
|
"__#12@#attachListeners"(): void;
|
|
497
497
|
teardownValidationTracking(): void;
|
|
498
|
-
"__#
|
|
499
|
-
"__#
|
|
498
|
+
"__#43289@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
499
|
+
"__#43289@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
500
500
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
501
501
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
502
502
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
@@ -892,18 +892,18 @@ declare const BaseClass: {
|
|
|
892
892
|
focus: ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void);
|
|
893
893
|
};
|
|
894
894
|
} & (new (...args: any) => {
|
|
895
|
-
"__#
|
|
896
|
-
"__#
|
|
897
|
-
"__#
|
|
898
|
-
"__#
|
|
895
|
+
"__#43308@#telemetryManager": any;
|
|
896
|
+
"__#43308@#telemetryInitialized": boolean;
|
|
897
|
+
"__#43308@#expirationTimeoutId": NodeJS.Timeout;
|
|
898
|
+
"__#43308@#initializeTelemetry"(config: _descope_sdk_mixins_static_resources_mixin.TelemetryConfig, context: {
|
|
899
899
|
projectId: string;
|
|
900
900
|
flowId?: string;
|
|
901
901
|
sdkVersion?: string;
|
|
902
902
|
}): Promise<void>;
|
|
903
|
-
"__#
|
|
904
|
-
"__#
|
|
903
|
+
"__#43308@#scheduleExpirationShutdown"(expirationMs: number): void;
|
|
904
|
+
"__#43308@#shutdownTelemetry"(): void;
|
|
905
905
|
readonly telemetryManager: any;
|
|
906
|
-
"__#
|
|
906
|
+
"__#43308@#isRumConfigComplete"(rumConfig?: {
|
|
907
907
|
sessionSampleRate: number;
|
|
908
908
|
applicationId: string;
|
|
909
909
|
identityPoolId: string;
|
|
@@ -911,8 +911,8 @@ declare const BaseClass: {
|
|
|
911
911
|
region: string;
|
|
912
912
|
endpoint?: string;
|
|
913
913
|
}): boolean;
|
|
914
|
-
"__#
|
|
915
|
-
"__#
|
|
914
|
+
"__#43308@#getTelemetryConfig"(): Promise<_descope_sdk_mixins_static_resources_mixin.TelemetryConfig>;
|
|
915
|
+
"__#43308@#resolveCapture"(beCapture: {
|
|
916
916
|
console?: boolean | {
|
|
917
917
|
levels?: ("error" | "warn" | "info" | "debug" | "log")[];
|
|
918
918
|
};
|
|
@@ -938,16 +938,16 @@ declare const BaseClass: {
|
|
|
938
938
|
};
|
|
939
939
|
};
|
|
940
940
|
updateTelemetryContext(context: Record<string, any>): void;
|
|
941
|
-
"__#
|
|
941
|
+
"__#43308@#telemetryReady": Promise<void>;
|
|
942
942
|
init(): Promise<void>;
|
|
943
943
|
readonly telemetryReady: Promise<void>;
|
|
944
944
|
disconnectedCallback(): void;
|
|
945
945
|
readonly flowId: string;
|
|
946
|
-
"__#
|
|
947
|
-
"__#
|
|
946
|
+
"__#43292@#handleError": ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
|
|
947
|
+
"__#43291@#observeMappings": {};
|
|
948
948
|
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);
|
|
949
949
|
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);
|
|
950
|
-
"__#
|
|
950
|
+
"__#43290@#isInit": boolean;
|
|
951
951
|
connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
952
952
|
accessKey: string;
|
|
953
953
|
readonly accessKeyLabel: string;
|
|
@@ -1274,28 +1274,28 @@ declare const BaseClass: {
|
|
|
1274
1274
|
tabIndex: number;
|
|
1275
1275
|
blur(): void;
|
|
1276
1276
|
focus(options?: FocusOptions): void;
|
|
1277
|
-
"__#
|
|
1278
|
-
"__#
|
|
1277
|
+
"__#43289@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1278
|
+
"__#43289@#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);
|
|
1279
1279
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1280
1280
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
1281
1281
|
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);
|
|
1282
1282
|
readonly projectId: string;
|
|
1283
1283
|
readonly config: Promise<_descope_sdk_mixins_static_resources_mixin.Config>;
|
|
1284
|
-
"__#
|
|
1285
|
-
"__#
|
|
1286
|
-
"__#
|
|
1287
|
-
"__#
|
|
1284
|
+
"__#43295@#configCacheClear"(): void;
|
|
1285
|
+
"__#43295@#_configResource": Promise<_descope_sdk_mixins_static_resources_mixin.Config>;
|
|
1286
|
+
"__#43295@#fetchConfig": () => Promise<_descope_sdk_mixins_static_resources_mixin.Config>;
|
|
1287
|
+
"__#43294@#callbacks": Map<string, () => void>;
|
|
1288
1288
|
onReset(sectionId: string, callback: () => void | Promise<void>): () => void;
|
|
1289
1289
|
reset(...sectionIds: string[]): Promise<void>;
|
|
1290
|
-
"__#
|
|
1291
|
-
"__#
|
|
1292
|
-
"__#
|
|
1293
|
-
"__#
|
|
1290
|
+
"__#43293@#lastBaseUrl"?: string;
|
|
1291
|
+
"__#43293@#workingBaseUrl"?: string;
|
|
1292
|
+
"__#43293@#failedUrls": Set<string>;
|
|
1293
|
+
"__#43293@#getResourceUrls"(filename: string): (URL & {
|
|
1294
1294
|
baseUrl: string;
|
|
1295
1295
|
}) | (URL & {
|
|
1296
1296
|
baseUrl: string;
|
|
1297
1297
|
})[];
|
|
1298
|
-
"__#
|
|
1298
|
+
"__#43293@#createResourceUrl"(filename: string, baseUrl: string): URL & {
|
|
1299
1299
|
baseUrl: string;
|
|
1300
1300
|
};
|
|
1301
1301
|
fetchStaticResource<F extends "text" | "json">(filename: string, format: F): Promise<{
|
|
@@ -1320,12 +1320,12 @@ declare const BaseClass: {
|
|
|
1320
1320
|
readonly cssRules: CSSRuleList;
|
|
1321
1321
|
} | CSSStyleSheet;
|
|
1322
1322
|
nonce: string;
|
|
1323
|
-
"__#
|
|
1323
|
+
"__#43296@#setNonce"(): void;
|
|
1324
1324
|
init(): Promise<void>;
|
|
1325
|
-
"__#
|
|
1325
|
+
"__#43291@#observeMappings": {};
|
|
1326
1326
|
observeAttribute(attrName: string, onAttrChange: (attrName: string, value: string) => void): () => any;
|
|
1327
1327
|
observeAttributes(attrs: string[], cb: (attrName: string, value: string) => void): () => void;
|
|
1328
|
-
"__#
|
|
1328
|
+
"__#43290@#isInit": boolean;
|
|
1329
1329
|
connectedCallback: (() => void) & (() => void) & (() => void);
|
|
1330
1330
|
accessKey: string;
|
|
1331
1331
|
readonly accessKeyLabel: string;
|
|
@@ -1652,8 +1652,8 @@ declare const BaseClass: {
|
|
|
1652
1652
|
tabIndex: number;
|
|
1653
1653
|
blur(): void;
|
|
1654
1654
|
focus(options?: FocusOptions): void;
|
|
1655
|
-
"__#
|
|
1656
|
-
"__#
|
|
1655
|
+
"__#43289@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1656
|
+
"__#43289@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1657
1657
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1658
1658
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
1659
1659
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
@@ -1666,8 +1666,8 @@ declare const BaseClass: {
|
|
|
1666
1666
|
updateUsernameAnchor(): void;
|
|
1667
1667
|
captureLastSubmittedLoginId(formData?: {}, responseExecutionId?: string): void;
|
|
1668
1668
|
storeCredentials(formData?: {}): void;
|
|
1669
|
-
"__#
|
|
1670
|
-
"__#
|
|
1669
|
+
"__#43289@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1670
|
+
"__#43289@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1671
1671
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
1672
1672
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
1673
1673
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
@@ -2068,8 +2068,8 @@ declare const BaseClass: {
|
|
|
2068
2068
|
"__#10@#scheduleDuplicateFlowCheck"(): void;
|
|
2069
2069
|
connectedCallback(): void;
|
|
2070
2070
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
2071
|
-
"__#
|
|
2072
|
-
"__#
|
|
2071
|
+
"__#43289@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
2072
|
+
"__#43289@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
2073
2073
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
2074
2074
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
2075
2075
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
@@ -2471,8 +2471,8 @@ declare const BaseClass: {
|
|
|
2471
2471
|
"__#9@#reEvaluateRealtime"(): void;
|
|
2472
2472
|
disconnectedCallback(): void;
|
|
2473
2473
|
"__#9@#teardownRealtimeRuntime"(): void;
|
|
2474
|
-
"__#
|
|
2475
|
-
"__#
|
|
2474
|
+
"__#43289@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
2475
|
+
"__#43289@#wrapLogger"(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
2476
2476
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
2477
2477
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
2478
2478
|
onLogEvent(logLevel: "error" | "warn" | "info" | "debug", data: any[]): void;
|
|
@@ -3199,15 +3199,15 @@ declare const BaseClass: {
|
|
|
3199
3199
|
focus(options?: FocusOptions): void;
|
|
3200
3200
|
};
|
|
3201
3201
|
} & (new (...params: any[]) => {
|
|
3202
|
-
"__#
|
|
3203
|
-
"__#
|
|
3204
|
-
"__#
|
|
3205
|
-
"__#
|
|
3202
|
+
"__#43293@#lastBaseUrl"?: string;
|
|
3203
|
+
"__#43293@#workingBaseUrl"?: string;
|
|
3204
|
+
"__#43293@#failedUrls": Set<string>;
|
|
3205
|
+
"__#43293@#getResourceUrls"(filename: string): (URL & {
|
|
3206
3206
|
baseUrl: string;
|
|
3207
3207
|
}) | (URL & {
|
|
3208
3208
|
baseUrl: string;
|
|
3209
3209
|
})[];
|
|
3210
|
-
"__#
|
|
3210
|
+
"__#43293@#createResourceUrl"(filename: string, baseUrl: string): URL & {
|
|
3211
3211
|
baseUrl: string;
|
|
3212
3212
|
};
|
|
3213
3213
|
fetchStaticResource<F_1 extends "text" | "json">(filename: string, format: F_1): Promise<{
|
|
@@ -3544,43 +3544,44 @@ declare const BaseClass: {
|
|
|
3544
3544
|
blur(): void;
|
|
3545
3545
|
focus(options?: FocusOptions): void;
|
|
3546
3546
|
readonly projectId: string;
|
|
3547
|
-
"__#
|
|
3547
|
+
"__#43292@#handleError"(attrName: string, newValue: string): void;
|
|
3548
3548
|
init(): Promise<void>;
|
|
3549
|
-
"__#
|
|
3549
|
+
"__#43291@#observeMappings": {};
|
|
3550
3550
|
observeAttribute(attrName: string, onAttrChange: (attrName: string, value: string) => void): () => any;
|
|
3551
3551
|
observeAttributes(attrs: string[], cb: (attrName: string, value: string) => void): () => void;
|
|
3552
|
-
"__#
|
|
3553
|
-
"__#
|
|
3554
|
-
"__#
|
|
3552
|
+
"__#43290@#isInit": boolean;
|
|
3553
|
+
"__#43289@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
3554
|
+
"__#43289@#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);
|
|
3555
3555
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
3556
3556
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
3557
3557
|
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);
|
|
3558
3558
|
}) & (new (...params: any[]) => {
|
|
3559
|
-
"__#
|
|
3560
|
-
"__#
|
|
3561
|
-
"__#
|
|
3559
|
+
"__#43306@#globalStyle": _descope_sdk_mixins_static_resources_mixin.InjectedStyle;
|
|
3560
|
+
"__#43306@#tenantStyle": _descope_sdk_mixins_static_resources_mixin.InjectedStyle;
|
|
3561
|
+
"__#43306@#customStyle": _descope_sdk_mixins_static_resources_mixin.InjectedStyle;
|
|
3562
3562
|
readonly theme: _descope_sdk_mixins_static_resources_mixin.ThemeOptions;
|
|
3563
3563
|
readonly styleId: string;
|
|
3564
3564
|
readonly themeOverride: Record<string, any>;
|
|
3565
|
-
"__#
|
|
3566
|
-
"__#
|
|
3567
|
-
"__#
|
|
3568
|
-
"__#
|
|
3569
|
-
readonly "__#
|
|
3570
|
-
"__#
|
|
3571
|
-
"__#
|
|
3572
|
-
readonly "__#
|
|
3573
|
-
"__#
|
|
3574
|
-
"__#
|
|
3575
|
-
"__#
|
|
3576
|
-
"__#
|
|
3565
|
+
"__#43306@#getThemeOverrideString"(): string;
|
|
3566
|
+
"__#43306@#_themeResource": Promise<void | Record<string, any>>;
|
|
3567
|
+
"__#43306@#_tenantThemeResource": Promise<Record<string, any>>;
|
|
3568
|
+
"__#43306@#fetchTheme"(): Promise<Record<string, any>>;
|
|
3569
|
+
readonly "__#43306@#themeResource": Promise<void | Record<string, any>>;
|
|
3570
|
+
"__#43306@#loadGlobalStyle"(): Promise<void>;
|
|
3571
|
+
"__#43306@#fetchTenantTheme"(): Promise<Record<string, any>>;
|
|
3572
|
+
readonly "__#43306@#tenantThemeResource": Promise<Record<string, any>>;
|
|
3573
|
+
"__#43306@#loadTenantStyle"(): Promise<void>;
|
|
3574
|
+
"__#43306@#loadCustomStyle"(): Promise<void>;
|
|
3575
|
+
"__#43306@#loadComponentsStyle"(): Promise<void>;
|
|
3576
|
+
"__#43306@#getFontsConfig"(): Promise<Record<string, {
|
|
3577
3577
|
url?: string;
|
|
3578
3578
|
}>>;
|
|
3579
|
-
"__#
|
|
3580
|
-
"__#
|
|
3581
|
-
"__#
|
|
3582
|
-
"__#
|
|
3583
|
-
"__#
|
|
3579
|
+
"__#43306@#loadFonts"(): Promise<void>;
|
|
3580
|
+
"__#43306@#loadTenantFonts"(): Promise<void>;
|
|
3581
|
+
"__#43306@#applyTheme"(): Promise<void>;
|
|
3582
|
+
"__#43306@#onThemeChange": () => void;
|
|
3583
|
+
"__#43306@#loadTheme"(): void;
|
|
3584
|
+
"__#43306@#toggleOsThemeChangeListener": (listen: boolean) => void;
|
|
3584
3585
|
init(): Promise<void>;
|
|
3585
3586
|
injectStyle: ((cssString: string, { prepend }?: {
|
|
3586
3587
|
prepend?: boolean;
|
|
@@ -3598,11 +3599,11 @@ declare const BaseClass: {
|
|
|
3598
3599
|
readonly cssRules: CSSRuleList;
|
|
3599
3600
|
});
|
|
3600
3601
|
nonce: string;
|
|
3601
|
-
"__#
|
|
3602
|
-
"__#
|
|
3602
|
+
"__#43296@#setNonce": (() => void) & (() => void);
|
|
3603
|
+
"__#43291@#observeMappings": {};
|
|
3603
3604
|
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);
|
|
3604
3605
|
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);
|
|
3605
|
-
"__#
|
|
3606
|
+
"__#43290@#isInit": boolean;
|
|
3606
3607
|
connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
|
|
3607
3608
|
accessKey: string;
|
|
3608
3609
|
readonly accessKeyLabel: string;
|
|
@@ -3929,25 +3930,25 @@ declare const BaseClass: {
|
|
|
3929
3930
|
tabIndex: number;
|
|
3930
3931
|
blur(): void;
|
|
3931
3932
|
focus(options?: FocusOptions): void;
|
|
3932
|
-
"__#
|
|
3933
|
-
"__#
|
|
3933
|
+
"__#43289@#logger": _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
3934
|
+
"__#43289@#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);
|
|
3934
3935
|
get logger(): _descope_sdk_mixins_static_resources_mixin.Logger;
|
|
3935
3936
|
set logger(logger: Partial<_descope_sdk_mixins_static_resources_mixin.Logger>);
|
|
3936
3937
|
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);
|
|
3937
3938
|
contentRootElement: HTMLElement;
|
|
3938
3939
|
rootElement: HTMLElement;
|
|
3939
3940
|
readonly config: Promise<_descope_sdk_mixins_static_resources_mixin.Config>;
|
|
3940
|
-
"__#
|
|
3941
|
-
"__#
|
|
3942
|
-
"__#
|
|
3943
|
-
"__#
|
|
3941
|
+
"__#43295@#configCacheClear": (() => void) & (() => void);
|
|
3942
|
+
"__#43295@#_configResource": Promise<_descope_sdk_mixins_static_resources_mixin.Config>;
|
|
3943
|
+
"__#43295@#fetchConfig": (() => Promise<_descope_sdk_mixins_static_resources_mixin.Config>) & (() => Promise<_descope_sdk_mixins_static_resources_mixin.Config>);
|
|
3944
|
+
"__#43294@#callbacks": Map<string, () => void> & Map<string, () => void>;
|
|
3944
3945
|
onReset: ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void);
|
|
3945
3946
|
reset: ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>);
|
|
3946
|
-
"__#
|
|
3947
|
-
"__#
|
|
3948
|
-
"__#
|
|
3949
|
-
"__#
|
|
3950
|
-
"__#
|
|
3947
|
+
"__#43292@#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);
|
|
3948
|
+
"__#43293@#lastBaseUrl"?: string;
|
|
3949
|
+
"__#43293@#workingBaseUrl"?: string;
|
|
3950
|
+
"__#43293@#failedUrls": Set<string>;
|
|
3951
|
+
"__#43293@#getResourceUrls": ((filename: string) => (URL & {
|
|
3951
3952
|
baseUrl: string;
|
|
3952
3953
|
}) | (URL & {
|
|
3953
3954
|
baseUrl: string;
|
|
@@ -3960,7 +3961,7 @@ declare const BaseClass: {
|
|
|
3960
3961
|
}) | (URL & {
|
|
3961
3962
|
baseUrl: string;
|
|
3962
3963
|
})[]);
|
|
3963
|
-
"__#
|
|
3964
|
+
"__#43293@#createResourceUrl": ((filename: string, baseUrl: string) => URL & {
|
|
3964
3965
|
baseUrl: string;
|
|
3965
3966
|
}) & ((filename: string, baseUrl: string) => URL & {
|
|
3966
3967
|
baseUrl: string;
|
|
@@ -3980,12 +3981,12 @@ declare const BaseClass: {
|
|
|
3980
3981
|
readonly baseStaticUrl: string;
|
|
3981
3982
|
readonly baseUrl: string;
|
|
3982
3983
|
readonly projectId: string;
|
|
3983
|
-
"__#
|
|
3984
|
-
"__#
|
|
3985
|
-
"__#
|
|
3984
|
+
"__#43299@#getComponentsVersion"(): Promise<string>;
|
|
3985
|
+
"__#43299@#getComponentsVersionSri"(): Promise<string>;
|
|
3986
|
+
"__#43299@#descopeUi": Promise<any>;
|
|
3986
3987
|
readonly descopeUi: Promise<any>;
|
|
3987
|
-
"__#
|
|
3988
|
-
"__#
|
|
3988
|
+
"__#43299@#loadDescopeUiComponent"(componentName: string): Promise<any>;
|
|
3989
|
+
"__#43299@#getDescopeUi"(): Promise<any>;
|
|
3989
3990
|
loadDescopeUiComponents(templateOrComponentNames: string[] | HTMLTemplateElement): Promise<any[]>;
|
|
3990
3991
|
readonly baseCdnUrl: string;
|
|
3991
3992
|
injectNpmLib(libName: string, version: string, filePath?: string, overrides?: string[], integrity?: string): Promise<{
|