@corbado/observe 1.1.4 → 1.1.6
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/cdn/script.global.js +1 -1
- package/dist/index.d.mts +41 -8
- package/dist/index.d.ts +41 -8
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -16,6 +16,7 @@ type SetFlowTagsOptions = {
|
|
|
16
16
|
/** Whether following sibling flows inherit the tags (default `true`). */
|
|
17
17
|
expandToFollowing?: boolean;
|
|
18
18
|
};
|
|
19
|
+
type ProvideIdentifierSpecType = "email" | "phone" | "username";
|
|
19
20
|
type SocialLoginProviderType = "google" | "apple" | "facebook" | "github" | "microsoft" | "line" | "kakao" | "singpass" | "other";
|
|
20
21
|
declare enum AuthEventName {
|
|
21
22
|
FlowStarted = "flow_started",
|
|
@@ -190,6 +191,20 @@ type StepOptions = {
|
|
|
190
191
|
explicitTimestamp?: number;
|
|
191
192
|
/** Per-call experiment override (experiment key → variant), merged over the persistent assignments. */
|
|
192
193
|
experiments?: Record<string, string>;
|
|
194
|
+
/**
|
|
195
|
+
* Identifier the user submitted with this step (e.g. on `pi-post-response`). Sent by step start,
|
|
196
|
+
* finished and error only. Makes the attempt searchable by identifier, including failed attempts;
|
|
197
|
+
* unlike `setUser`, it never identifies the user of the flow.
|
|
198
|
+
*/
|
|
199
|
+
identifier?: StepIdentifier;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Sent exactly as given: apply your normalization (e.g. trim and lowercase an email) and, if your data
|
|
203
|
+
* policy requires it, hash the value before passing it. Search must use the same representation.
|
|
204
|
+
*/
|
|
205
|
+
type StepIdentifier = {
|
|
206
|
+
value: string;
|
|
207
|
+
type?: ProvideIdentifierSpecType;
|
|
193
208
|
};
|
|
194
209
|
type SubflowTrigger = {
|
|
195
210
|
actor: "system" | "user";
|
|
@@ -1241,7 +1256,6 @@ type PasskeyLoginCUITypedError = {
|
|
|
1241
1256
|
code: PasskeyLoginCUITypedErrorCode;
|
|
1242
1257
|
};
|
|
1243
1258
|
type PasskeyLoginCUITypedErrorCode = "cancel_detected";
|
|
1244
|
-
type ProvideIdentifierSpecType = "email" | "phone" | "username";
|
|
1245
1259
|
type ProvideIdentifierPostResponseStart = {
|
|
1246
1260
|
explicitSpecType?: ProvideIdentifierSpecType;
|
|
1247
1261
|
};
|
|
@@ -2573,11 +2587,28 @@ declare class EventStore<T = Event> {
|
|
|
2573
2587
|
size(): number;
|
|
2574
2588
|
}
|
|
2575
2589
|
|
|
2590
|
+
/**
|
|
2591
|
+
* Synchronous WebAuthn telemetry projection. Binary identifiers arrive as base64url strings;
|
|
2592
|
+
* JSON strings arrive as supplied. Return a string to replace the identifier, null to retain an
|
|
2593
|
+
* explicit null, or undefined to omit it. Exceptions and unsupported return values omit it too.
|
|
2594
|
+
* Never returns a Promise. The original authentication objects are not changed.
|
|
2595
|
+
*/
|
|
2596
|
+
type WebAuthnIdentifierProjector = (value: string) => string | null | undefined;
|
|
2597
|
+
/**
|
|
2598
|
+
* Optional user identifier projection shared by native WebAuthn capture and network serializers.
|
|
2599
|
+
* A missing callback preserves user identifiers. Callbacks should be deterministic across payloads.
|
|
2600
|
+
* Credential IDs and encoded attestation/authenticator data are retained unchanged.
|
|
2601
|
+
*/
|
|
2602
|
+
type WebAuthnIdentifierProjectors = {
|
|
2603
|
+
/** Projects creation user.id and credential response.userHandle. Missing/null inputs are not passed to the callback. */
|
|
2604
|
+
userId?: WebAuthnIdentifierProjector;
|
|
2605
|
+
};
|
|
2576
2606
|
/**
|
|
2577
2607
|
* Serializes WebAuthn creation options, removing `user.name` and `user.displayName`.
|
|
2578
|
-
* Binary values become base64url strings.
|
|
2608
|
+
* Binary values become base64url strings. User IDs are retained unless a projector is supplied.
|
|
2579
2609
|
*
|
|
2580
2610
|
* @param value - Native publicKey options, a JSON object, or JSON text; not an application envelope.
|
|
2611
|
+
* @param projectors - Optional synchronous user identifier projection; default identity.
|
|
2581
2612
|
* @returns JSON text, or undefined for malformed or unserializable input.
|
|
2582
2613
|
* @remarks Does not mutate input, read blacklisted getters, or call toJSON. No tracker initialization is required.
|
|
2583
2614
|
* @example
|
|
@@ -2586,16 +2617,17 @@ declare class EventStore<T = Event> {
|
|
|
2586
2617
|
* const optionsJson = sanitizeCreationOptions({ user: { id: "user-id", name: "private" } });
|
|
2587
2618
|
* ```
|
|
2588
2619
|
*/
|
|
2589
|
-
declare function sanitizeCreationOptions(value: unknown): string | undefined;
|
|
2620
|
+
declare function sanitizeCreationOptions(value: unknown, projectors?: WebAuthnIdentifierProjectors): string | undefined;
|
|
2590
2621
|
/**
|
|
2591
2622
|
* Serializes a registration credential, removing `clientExtensionResults.prf.results`.
|
|
2592
|
-
*
|
|
2623
|
+
* By default other fields remain, including attestation material and credential IDs. Binary values become base64url strings.
|
|
2593
2624
|
*
|
|
2594
2625
|
* @param value - A native registration credential, JSON object, or JSON text; not an application envelope.
|
|
2626
|
+
* @param projectors - Optional synchronous user identifier projection; default identity.
|
|
2595
2627
|
* @returns JSON text, or undefined for malformed or unserializable input.
|
|
2596
2628
|
* @remarks Does not mutate input, read blacklisted getters, or call toJSON. Encoded attestation and client-data blobs are not decoded or redacted.
|
|
2597
2629
|
*/
|
|
2598
|
-
declare function sanitizeCreationResponse(value: unknown): string | undefined;
|
|
2630
|
+
declare function sanitizeCreationResponse(value: unknown, projectors?: WebAuthnIdentifierProjectors): string | undefined;
|
|
2599
2631
|
/**
|
|
2600
2632
|
* Serializes WebAuthn authentication options. No fields are currently blacklisted;
|
|
2601
2633
|
* challenges, credential IDs, and extension inputs remain. Binary values become base64url strings.
|
|
@@ -2607,13 +2639,14 @@ declare function sanitizeCreationResponse(value: unknown): string | undefined;
|
|
|
2607
2639
|
declare function sanitizeRequestOptions(value: unknown): string | undefined;
|
|
2608
2640
|
/**
|
|
2609
2641
|
* Serializes an authentication credential, removing `response.signature` and `clientExtensionResults.prf.results`.
|
|
2610
|
-
*
|
|
2642
|
+
* By default other fields remain, including credential IDs and user handles. Binary values become base64url strings.
|
|
2611
2643
|
*
|
|
2612
2644
|
* @param value - A native authentication credential, JSON object, or JSON text; not an application envelope.
|
|
2645
|
+
* @param projectors - Optional synchronous user identifier projection; default identity.
|
|
2613
2646
|
* @returns JSON text, or undefined for malformed or unserializable input.
|
|
2614
2647
|
* @remarks Does not mutate input, read blacklisted getters, or call toJSON. This is a path blacklist, not general-purpose secret detection; encoded client-data blobs are not decoded or redacted.
|
|
2615
2648
|
*/
|
|
2616
|
-
declare function sanitizeAssertionResponse(value: unknown): string | undefined;
|
|
2649
|
+
declare function sanitizeAssertionResponse(value: unknown, projectors?: WebAuthnIdentifierProjectors): string | undefined;
|
|
2617
2650
|
|
|
2618
2651
|
/**
|
|
2619
2652
|
* Create a tracker and make it the default for all package-level helpers.
|
|
@@ -2650,4 +2683,4 @@ declare function logInfo(message: string): void;
|
|
|
2650
2683
|
declare function logError(message: string): void;
|
|
2651
2684
|
declare function destroy(): Promise<void>;
|
|
2652
2685
|
|
|
2653
|
-
export { type AppConfirmationOperationCeremonyTypedError, type AppConfirmationOperationConfig, AppConfirmationOperationFull, type AppConfirmationOperationRetryReason, type AppConfirmationOperationSpecType, type AppConfirmationOperationStart, type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, CEREMONY_LOW_EVENT_TAIL_MS, CONFIG_BOUNDS, CONFIG_REQUEST_HEADER, CONFIG_STORAGE_KEY, type CaptchaOperationConfig, CaptchaOperationFull, type CaptchaOperationSpecType, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, type Conversion, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CustomEvent, DEFAULT_DEVICE_INFO_COLLECTOR_TIMEOUT_MS, DEFAULT_FLUSH_INTERVAL_MS, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_SERIALIZED_LENGTH, DEFAULT_RELIABILITY_CONFIG, DEFAULT_SEQ_LOCK_TIMEOUT_MS, DEFAULT_SESSION_INACTIVITY_MS, type DeviceInfo, type DeviceInfoCollectionError, type DeviceInfoDataWeb, type DeviceType, type EmailLinkContinuationConfig, EmailLinkContinuationOperation, type EmailLinkOperationConfig, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationConfig, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type ErrorStepOptions, type Event, type EventBatch, type EventBatchMeta, type EventMeta, EventStore, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, type JavaScriptHighEntropy, type KeyOperationConfig, KeyRegistrationOperationFull, KeySigningOperationFull, LocalStorage, type Logger, type LowEvent, type LowEventFieldRole, type LowEventInitiator, type LowEventInputEffect, type LowEventSourceKind, type MultiFlowReset, type MultiFlowStarted, NamespacedStorage, type NormalizedError, OUTBOX_LOCK_NAME, OUTBOX_STORAGE_KEY, type ObserveSdkConfigSnapshot, OperationFull, OperationFullProvideIdentifierWithCUI, type OperationFullProvideIdentifierWithCUIConfig, type OutboxEntry, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, type PasskeyEnrollmentOperationConfig, PasskeyEnrollmentOperationFull, type PasskeyEnrollmentPostResponseStart, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, type PasskeyLoginOperationConfig, PasskeyLoginOperationFull, type PasskeyLoginPostResponseStart, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginCUICeremonyStart, type PasswordLoginCUIGetOptionsFinished, type PasswordLoginCUIGetOptionsStart, type PasswordLoginCUISpecType, type PasswordLoginCUITypedError, type PasswordLoginConfig, type PasswordLoginExplicitSpecType, PasswordLoginOperationFull, type PasswordLoginTypedError, type PredefinedEvent, type ProvideDataOperationConfig, ProvideDataOperationFull, type ProvideDataOperationPostResponseStart, type ProvideDataOperationSpecType, type ProvideDataOperationStart, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RAW_ERROR_BOUNDS, type RawErrorEnvelope, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SerializeRawErrorOptions, SessionStorage, type SetFlowTagsOptions, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type SourcePathQueryMode, type SsoLoginExchangeCodeFinished, type SsoLoginExchangeCodeStart, type SsoLoginGetRedirectUrlFinished, type SsoLoginGetRedirectUrlStart, type SsoLoginOperationConfig, SsoLoginOperationFull, type SsoLoginSpecType, type StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, type TotpOperationConfig, TotpOperationFull, type TotpOperationPostResponseStart, type TotpOperationSpecType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type TrustedDeviceBindingMetadata, type TrustedDeviceCheckConfig, TrustedDeviceCheckOperationFull, type TrustedDeviceCheckResult, type TrustedDeviceCheckStepResult, type TrustedDeviceCheckTypedError, TrustedDeviceEnrollmentOperationFull, type TrustedDeviceEnrollmentResult, type TrustedDeviceOperationConfig, type TrustedDevicePurpose, type TrustedDeviceStorage, type UserReference, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setFlowTags, setUser, telemetry };
|
|
2686
|
+
export { type AppConfirmationOperationCeremonyTypedError, type AppConfirmationOperationConfig, AppConfirmationOperationFull, type AppConfirmationOperationRetryReason, type AppConfirmationOperationSpecType, type AppConfirmationOperationStart, type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, CEREMONY_LOW_EVENT_TAIL_MS, CONFIG_BOUNDS, CONFIG_REQUEST_HEADER, CONFIG_STORAGE_KEY, type CaptchaOperationConfig, CaptchaOperationFull, type CaptchaOperationSpecType, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, type Conversion, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CustomEvent, DEFAULT_DEVICE_INFO_COLLECTOR_TIMEOUT_MS, DEFAULT_FLUSH_INTERVAL_MS, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_SERIALIZED_LENGTH, DEFAULT_RELIABILITY_CONFIG, DEFAULT_SEQ_LOCK_TIMEOUT_MS, DEFAULT_SESSION_INACTIVITY_MS, type DeviceInfo, type DeviceInfoCollectionError, type DeviceInfoDataWeb, type DeviceType, type EmailLinkContinuationConfig, EmailLinkContinuationOperation, type EmailLinkOperationConfig, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationConfig, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type ErrorStepOptions, type Event, type EventBatch, type EventBatchMeta, type EventMeta, EventStore, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, type JavaScriptHighEntropy, type KeyOperationConfig, KeyRegistrationOperationFull, KeySigningOperationFull, LocalStorage, type Logger, type LowEvent, type LowEventFieldRole, type LowEventInitiator, type LowEventInputEffect, type LowEventSourceKind, type MultiFlowReset, type MultiFlowStarted, NamespacedStorage, type NormalizedError, OUTBOX_LOCK_NAME, OUTBOX_STORAGE_KEY, type ObserveSdkConfigSnapshot, OperationFull, OperationFullProvideIdentifierWithCUI, type OperationFullProvideIdentifierWithCUIConfig, type OutboxEntry, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, type PasskeyEnrollmentOperationConfig, PasskeyEnrollmentOperationFull, type PasskeyEnrollmentPostResponseStart, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, type PasskeyLoginOperationConfig, PasskeyLoginOperationFull, type PasskeyLoginPostResponseStart, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginCUICeremonyStart, type PasswordLoginCUIGetOptionsFinished, type PasswordLoginCUIGetOptionsStart, type PasswordLoginCUISpecType, type PasswordLoginCUITypedError, type PasswordLoginConfig, type PasswordLoginExplicitSpecType, PasswordLoginOperationFull, type PasswordLoginTypedError, type PredefinedEvent, type ProvideDataOperationConfig, ProvideDataOperationFull, type ProvideDataOperationPostResponseStart, type ProvideDataOperationSpecType, type ProvideDataOperationStart, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RAW_ERROR_BOUNDS, type RawErrorEnvelope, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SerializeRawErrorOptions, SessionStorage, type SetFlowTagsOptions, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type SourcePathQueryMode, type SsoLoginExchangeCodeFinished, type SsoLoginExchangeCodeStart, type SsoLoginGetRedirectUrlFinished, type SsoLoginGetRedirectUrlStart, type SsoLoginOperationConfig, SsoLoginOperationFull, type SsoLoginSpecType, type StepHelper, type StepIdentifier, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, type TotpOperationConfig, TotpOperationFull, type TotpOperationPostResponseStart, type TotpOperationSpecType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type TrustedDeviceBindingMetadata, type TrustedDeviceCheckConfig, TrustedDeviceCheckOperationFull, type TrustedDeviceCheckResult, type TrustedDeviceCheckStepResult, type TrustedDeviceCheckTypedError, TrustedDeviceEnrollmentOperationFull, type TrustedDeviceEnrollmentResult, type TrustedDeviceOperationConfig, type TrustedDevicePurpose, type TrustedDeviceStorage, type UserReference, type WebAuthnIdentifierProjector, type WebAuthnIdentifierProjectors, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setFlowTags, setUser, telemetry };
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ type SetFlowTagsOptions = {
|
|
|
16
16
|
/** Whether following sibling flows inherit the tags (default `true`). */
|
|
17
17
|
expandToFollowing?: boolean;
|
|
18
18
|
};
|
|
19
|
+
type ProvideIdentifierSpecType = "email" | "phone" | "username";
|
|
19
20
|
type SocialLoginProviderType = "google" | "apple" | "facebook" | "github" | "microsoft" | "line" | "kakao" | "singpass" | "other";
|
|
20
21
|
declare enum AuthEventName {
|
|
21
22
|
FlowStarted = "flow_started",
|
|
@@ -190,6 +191,20 @@ type StepOptions = {
|
|
|
190
191
|
explicitTimestamp?: number;
|
|
191
192
|
/** Per-call experiment override (experiment key → variant), merged over the persistent assignments. */
|
|
192
193
|
experiments?: Record<string, string>;
|
|
194
|
+
/**
|
|
195
|
+
* Identifier the user submitted with this step (e.g. on `pi-post-response`). Sent by step start,
|
|
196
|
+
* finished and error only. Makes the attempt searchable by identifier, including failed attempts;
|
|
197
|
+
* unlike `setUser`, it never identifies the user of the flow.
|
|
198
|
+
*/
|
|
199
|
+
identifier?: StepIdentifier;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Sent exactly as given: apply your normalization (e.g. trim and lowercase an email) and, if your data
|
|
203
|
+
* policy requires it, hash the value before passing it. Search must use the same representation.
|
|
204
|
+
*/
|
|
205
|
+
type StepIdentifier = {
|
|
206
|
+
value: string;
|
|
207
|
+
type?: ProvideIdentifierSpecType;
|
|
193
208
|
};
|
|
194
209
|
type SubflowTrigger = {
|
|
195
210
|
actor: "system" | "user";
|
|
@@ -1241,7 +1256,6 @@ type PasskeyLoginCUITypedError = {
|
|
|
1241
1256
|
code: PasskeyLoginCUITypedErrorCode;
|
|
1242
1257
|
};
|
|
1243
1258
|
type PasskeyLoginCUITypedErrorCode = "cancel_detected";
|
|
1244
|
-
type ProvideIdentifierSpecType = "email" | "phone" | "username";
|
|
1245
1259
|
type ProvideIdentifierPostResponseStart = {
|
|
1246
1260
|
explicitSpecType?: ProvideIdentifierSpecType;
|
|
1247
1261
|
};
|
|
@@ -2573,11 +2587,28 @@ declare class EventStore<T = Event> {
|
|
|
2573
2587
|
size(): number;
|
|
2574
2588
|
}
|
|
2575
2589
|
|
|
2590
|
+
/**
|
|
2591
|
+
* Synchronous WebAuthn telemetry projection. Binary identifiers arrive as base64url strings;
|
|
2592
|
+
* JSON strings arrive as supplied. Return a string to replace the identifier, null to retain an
|
|
2593
|
+
* explicit null, or undefined to omit it. Exceptions and unsupported return values omit it too.
|
|
2594
|
+
* Never returns a Promise. The original authentication objects are not changed.
|
|
2595
|
+
*/
|
|
2596
|
+
type WebAuthnIdentifierProjector = (value: string) => string | null | undefined;
|
|
2597
|
+
/**
|
|
2598
|
+
* Optional user identifier projection shared by native WebAuthn capture and network serializers.
|
|
2599
|
+
* A missing callback preserves user identifiers. Callbacks should be deterministic across payloads.
|
|
2600
|
+
* Credential IDs and encoded attestation/authenticator data are retained unchanged.
|
|
2601
|
+
*/
|
|
2602
|
+
type WebAuthnIdentifierProjectors = {
|
|
2603
|
+
/** Projects creation user.id and credential response.userHandle. Missing/null inputs are not passed to the callback. */
|
|
2604
|
+
userId?: WebAuthnIdentifierProjector;
|
|
2605
|
+
};
|
|
2576
2606
|
/**
|
|
2577
2607
|
* Serializes WebAuthn creation options, removing `user.name` and `user.displayName`.
|
|
2578
|
-
* Binary values become base64url strings.
|
|
2608
|
+
* Binary values become base64url strings. User IDs are retained unless a projector is supplied.
|
|
2579
2609
|
*
|
|
2580
2610
|
* @param value - Native publicKey options, a JSON object, or JSON text; not an application envelope.
|
|
2611
|
+
* @param projectors - Optional synchronous user identifier projection; default identity.
|
|
2581
2612
|
* @returns JSON text, or undefined for malformed or unserializable input.
|
|
2582
2613
|
* @remarks Does not mutate input, read blacklisted getters, or call toJSON. No tracker initialization is required.
|
|
2583
2614
|
* @example
|
|
@@ -2586,16 +2617,17 @@ declare class EventStore<T = Event> {
|
|
|
2586
2617
|
* const optionsJson = sanitizeCreationOptions({ user: { id: "user-id", name: "private" } });
|
|
2587
2618
|
* ```
|
|
2588
2619
|
*/
|
|
2589
|
-
declare function sanitizeCreationOptions(value: unknown): string | undefined;
|
|
2620
|
+
declare function sanitizeCreationOptions(value: unknown, projectors?: WebAuthnIdentifierProjectors): string | undefined;
|
|
2590
2621
|
/**
|
|
2591
2622
|
* Serializes a registration credential, removing `clientExtensionResults.prf.results`.
|
|
2592
|
-
*
|
|
2623
|
+
* By default other fields remain, including attestation material and credential IDs. Binary values become base64url strings.
|
|
2593
2624
|
*
|
|
2594
2625
|
* @param value - A native registration credential, JSON object, or JSON text; not an application envelope.
|
|
2626
|
+
* @param projectors - Optional synchronous user identifier projection; default identity.
|
|
2595
2627
|
* @returns JSON text, or undefined for malformed or unserializable input.
|
|
2596
2628
|
* @remarks Does not mutate input, read blacklisted getters, or call toJSON. Encoded attestation and client-data blobs are not decoded or redacted.
|
|
2597
2629
|
*/
|
|
2598
|
-
declare function sanitizeCreationResponse(value: unknown): string | undefined;
|
|
2630
|
+
declare function sanitizeCreationResponse(value: unknown, projectors?: WebAuthnIdentifierProjectors): string | undefined;
|
|
2599
2631
|
/**
|
|
2600
2632
|
* Serializes WebAuthn authentication options. No fields are currently blacklisted;
|
|
2601
2633
|
* challenges, credential IDs, and extension inputs remain. Binary values become base64url strings.
|
|
@@ -2607,13 +2639,14 @@ declare function sanitizeCreationResponse(value: unknown): string | undefined;
|
|
|
2607
2639
|
declare function sanitizeRequestOptions(value: unknown): string | undefined;
|
|
2608
2640
|
/**
|
|
2609
2641
|
* Serializes an authentication credential, removing `response.signature` and `clientExtensionResults.prf.results`.
|
|
2610
|
-
*
|
|
2642
|
+
* By default other fields remain, including credential IDs and user handles. Binary values become base64url strings.
|
|
2611
2643
|
*
|
|
2612
2644
|
* @param value - A native authentication credential, JSON object, or JSON text; not an application envelope.
|
|
2645
|
+
* @param projectors - Optional synchronous user identifier projection; default identity.
|
|
2613
2646
|
* @returns JSON text, or undefined for malformed or unserializable input.
|
|
2614
2647
|
* @remarks Does not mutate input, read blacklisted getters, or call toJSON. This is a path blacklist, not general-purpose secret detection; encoded client-data blobs are not decoded or redacted.
|
|
2615
2648
|
*/
|
|
2616
|
-
declare function sanitizeAssertionResponse(value: unknown): string | undefined;
|
|
2649
|
+
declare function sanitizeAssertionResponse(value: unknown, projectors?: WebAuthnIdentifierProjectors): string | undefined;
|
|
2617
2650
|
|
|
2618
2651
|
/**
|
|
2619
2652
|
* Create a tracker and make it the default for all package-level helpers.
|
|
@@ -2650,4 +2683,4 @@ declare function logInfo(message: string): void;
|
|
|
2650
2683
|
declare function logError(message: string): void;
|
|
2651
2684
|
declare function destroy(): Promise<void>;
|
|
2652
2685
|
|
|
2653
|
-
export { type AppConfirmationOperationCeremonyTypedError, type AppConfirmationOperationConfig, AppConfirmationOperationFull, type AppConfirmationOperationRetryReason, type AppConfirmationOperationSpecType, type AppConfirmationOperationStart, type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, CEREMONY_LOW_EVENT_TAIL_MS, CONFIG_BOUNDS, CONFIG_REQUEST_HEADER, CONFIG_STORAGE_KEY, type CaptchaOperationConfig, CaptchaOperationFull, type CaptchaOperationSpecType, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, type Conversion, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CustomEvent, DEFAULT_DEVICE_INFO_COLLECTOR_TIMEOUT_MS, DEFAULT_FLUSH_INTERVAL_MS, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_SERIALIZED_LENGTH, DEFAULT_RELIABILITY_CONFIG, DEFAULT_SEQ_LOCK_TIMEOUT_MS, DEFAULT_SESSION_INACTIVITY_MS, type DeviceInfo, type DeviceInfoCollectionError, type DeviceInfoDataWeb, type DeviceType, type EmailLinkContinuationConfig, EmailLinkContinuationOperation, type EmailLinkOperationConfig, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationConfig, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type ErrorStepOptions, type Event, type EventBatch, type EventBatchMeta, type EventMeta, EventStore, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, type JavaScriptHighEntropy, type KeyOperationConfig, KeyRegistrationOperationFull, KeySigningOperationFull, LocalStorage, type Logger, type LowEvent, type LowEventFieldRole, type LowEventInitiator, type LowEventInputEffect, type LowEventSourceKind, type MultiFlowReset, type MultiFlowStarted, NamespacedStorage, type NormalizedError, OUTBOX_LOCK_NAME, OUTBOX_STORAGE_KEY, type ObserveSdkConfigSnapshot, OperationFull, OperationFullProvideIdentifierWithCUI, type OperationFullProvideIdentifierWithCUIConfig, type OutboxEntry, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, type PasskeyEnrollmentOperationConfig, PasskeyEnrollmentOperationFull, type PasskeyEnrollmentPostResponseStart, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, type PasskeyLoginOperationConfig, PasskeyLoginOperationFull, type PasskeyLoginPostResponseStart, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginCUICeremonyStart, type PasswordLoginCUIGetOptionsFinished, type PasswordLoginCUIGetOptionsStart, type PasswordLoginCUISpecType, type PasswordLoginCUITypedError, type PasswordLoginConfig, type PasswordLoginExplicitSpecType, PasswordLoginOperationFull, type PasswordLoginTypedError, type PredefinedEvent, type ProvideDataOperationConfig, ProvideDataOperationFull, type ProvideDataOperationPostResponseStart, type ProvideDataOperationSpecType, type ProvideDataOperationStart, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RAW_ERROR_BOUNDS, type RawErrorEnvelope, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SerializeRawErrorOptions, SessionStorage, type SetFlowTagsOptions, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type SourcePathQueryMode, type SsoLoginExchangeCodeFinished, type SsoLoginExchangeCodeStart, type SsoLoginGetRedirectUrlFinished, type SsoLoginGetRedirectUrlStart, type SsoLoginOperationConfig, SsoLoginOperationFull, type SsoLoginSpecType, type StepHelper, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, type TotpOperationConfig, TotpOperationFull, type TotpOperationPostResponseStart, type TotpOperationSpecType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type TrustedDeviceBindingMetadata, type TrustedDeviceCheckConfig, TrustedDeviceCheckOperationFull, type TrustedDeviceCheckResult, type TrustedDeviceCheckStepResult, type TrustedDeviceCheckTypedError, TrustedDeviceEnrollmentOperationFull, type TrustedDeviceEnrollmentResult, type TrustedDeviceOperationConfig, type TrustedDevicePurpose, type TrustedDeviceStorage, type UserReference, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setFlowTags, setUser, telemetry };
|
|
2686
|
+
export { type AppConfirmationOperationCeremonyTypedError, type AppConfirmationOperationConfig, AppConfirmationOperationFull, type AppConfirmationOperationRetryReason, type AppConfirmationOperationSpecType, type AppConfirmationOperationStart, type AuthDecisionFinished, type AuthDecisionStarted, AuthEventName, type AuthMethodDecisionFinished, type AuthMethodDecisionStarted, type AuthMethodType, type BaseEvent, CEREMONY_LOW_EVENT_TAIL_MS, CONFIG_BOUNDS, CONFIG_REQUEST_HEADER, CONFIG_STORAGE_KEY, type CaptchaOperationConfig, CaptchaOperationFull, type CaptchaOperationSpecType, type ClientCapabilities, type ClientEnvHandleMeta, type ClientEnvHandleMetaSource, type Conversion, CookieStorage, CorbadoTracker, type CreateLoggerOptions, type CustomEvent, DEFAULT_DEVICE_INFO_COLLECTOR_TIMEOUT_MS, DEFAULT_FLUSH_INTERVAL_MS, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_SERIALIZED_LENGTH, DEFAULT_RELIABILITY_CONFIG, DEFAULT_SEQ_LOCK_TIMEOUT_MS, DEFAULT_SESSION_INACTIVITY_MS, type DeviceInfo, type DeviceInfoCollectionError, type DeviceInfoDataWeb, type DeviceType, type EmailLinkContinuationConfig, EmailLinkContinuationOperation, type EmailLinkOperationConfig, EmailLinkOperationFull, type EmailLinkOperationPostResponseStart, type EmailLinkOperationSendStart, type EmailLinkOperationSpecType, type EmailOTPOperationConfig, type EmailOTPOperationPostResponseStart, type EmailOTPOperationSendOTPStart, type EmailOTPOperationSpecType, EmailOtpOperationFull, type ErrorStepOptions, type Event, type EventBatch, type EventBatchMeta, type EventMeta, EventStore, type EventType, type FlowAutoFinished, type FlowDecided, type FlowFinished, type FlowHandle, type FlowReset, type FlowStarted, type FlowType, type FlushReason, type JavaScriptHighEntropy, type KeyOperationConfig, KeyRegistrationOperationFull, KeySigningOperationFull, LocalStorage, type Logger, type LowEvent, type LowEventFieldRole, type LowEventInitiator, type LowEventInputEffect, type LowEventSourceKind, type MultiFlowReset, type MultiFlowStarted, NamespacedStorage, type NormalizedError, OUTBOX_LOCK_NAME, OUTBOX_STORAGE_KEY, type ObserveSdkConfigSnapshot, OperationFull, OperationFullProvideIdentifierWithCUI, type OperationFullProvideIdentifierWithCUIConfig, type OutboxEntry, type PasskeyEnrollmentCeremonyFinished, type PasskeyEnrollmentCeremonyStart, type PasskeyEnrollmentGetOptionsFinished, type PasskeyEnrollmentGetOptionsStart, type PasskeyEnrollmentOperationConfig, PasskeyEnrollmentOperationFull, type PasskeyEnrollmentPostResponseStart, type PasskeyLoginCUIGetOptionsFinished, type PasskeyLoginCUIGetOptionsStart, type PasskeyLoginCUISpecType, type PasskeyLoginCeremonyFinished, type PasskeyLoginCeremonyStart, type PasskeyLoginClientError, type PasskeyLoginFinish, type PasskeyLoginGetOptionsFinished, type PasskeyLoginGetOptionsStart, type PasskeyLoginOperationConfig, PasskeyLoginOperationFull, type PasskeyLoginPostResponseStart, type PasskeyLoginStartable, type PasskeyLoginSubmitted, type PasskeyOperationEnrollmentExplicitSpecType, type PasskeyOperationLoginExplicitSpecType, type PasswordEnrollmentConfig, PasswordEnrollmentOperationFull, type PasswordEnrollmentTypedError, type PasswordLoginCUICeremonyStart, type PasswordLoginCUIGetOptionsFinished, type PasswordLoginCUIGetOptionsStart, type PasswordLoginCUISpecType, type PasswordLoginCUITypedError, type PasswordLoginConfig, type PasswordLoginExplicitSpecType, PasswordLoginOperationFull, type PasswordLoginTypedError, type PredefinedEvent, type ProvideDataOperationConfig, ProvideDataOperationFull, type ProvideDataOperationPostResponseStart, type ProvideDataOperationSpecType, type ProvideDataOperationStart, type ProvideIdentifierError, type ProvideIdentifierFinish, type ProvideIdentifierPostResponseStart, type ProvideIdentifierSpecType, type ProvideIdentifierStart, type QueueOptions, RAW_ERROR_BOUNDS, type RawErrorEnvelope, RequestQueue, SDK_NAME, SDK_VERSION, type SdkInfo, type SdkReliabilityConfig, type SdkReliabilityConfigOverrides, type SdkRetryConfig, type SerializeRawErrorOptions, SessionStorage, type SetFlowTagsOptions, type SmsOTPOperationConfig, type SmsOTPOperationPostResponseStart, type SmsOTPOperationSpecType, SmsOtpOperationFull, type SocialLoginExchangeCodeFinished, type SocialLoginExchangeCodeStart, type SocialLoginGetRedirectUrlFinished, type SocialLoginGetRedirectUrlStart, type SocialLoginOperationConfig, SocialLoginOperationFull, type SocialLoginProviderType, type SocialLoginSpecType, type SourcePathQueryMode, type SsoLoginExchangeCodeFinished, type SsoLoginExchangeCodeStart, type SsoLoginGetRedirectUrlFinished, type SsoLoginGetRedirectUrlStart, type SsoLoginOperationConfig, SsoLoginOperationFull, type SsoLoginSpecType, type StepHelper, type StepIdentifier, type StepOptions, type StorageEngine, type SubflowTrigger, type SubflowType, type TelemetryEntry, type TelemetryLevel, type TelemetrySink, type TotpOperationConfig, TotpOperationFull, type TotpOperationPostResponseStart, type TotpOperationSpecType, type TrackerOptions, type Transport, type TransportMakeRequestResponse, type TransportOptions, type TrustedDeviceBindingMetadata, type TrustedDeviceCheckConfig, TrustedDeviceCheckOperationFull, type TrustedDeviceCheckResult, type TrustedDeviceCheckStepResult, type TrustedDeviceCheckTypedError, TrustedDeviceEnrollmentOperationFull, type TrustedDeviceEnrollmentResult, type TrustedDeviceOperationConfig, type TrustedDevicePurpose, type TrustedDeviceStorage, type UserReference, type WebAuthnIdentifierProjector, type WebAuthnIdentifierProjectors, cacheConfig, clearExperiment, clearExperiments, createLogger, destroy, getExperiments, getSessionId, getTracker, init, loadCachedConfig, logError, logInfo, namespacedKey, parseReliabilityConfig, resetSession, resolveRawErrorLimits, resolveReliabilityConfig, sanitizeAssertionResponse, sanitizeCreationOptions, sanitizeCreationResponse, sanitizeRequestOptions, serializeRawError, setExperiment, setExperiments, setFlowTags, setUser, telemetry };
|