@corbado/autocapture 1.1.0 → 1.2.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/README.md +26 -5
- package/dist/{chunk-7E5QDUX5.mjs → chunk-GWLL2VST.mjs} +1 -1
- package/dist/{guards-C1SJi1-7.d.mts → guards-BmrxoYBR.d.mts} +1 -1
- package/dist/{guards-wCMqiGRi.d.ts → guards-Bwsr1zMi.d.ts} +1 -1
- package/dist/index.d.mts +27 -4
- package/dist/index.d.ts +27 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/probe/fixtures.d.mts +3 -3
- package/dist/probe/fixtures.d.ts +3 -3
- package/dist/probe.d.mts +3 -3
- package/dist/probe.d.ts +3 -3
- package/dist/probe.js +1 -1
- package/dist/probe.mjs +1 -1
- package/dist/{types-CXJAj2DU.d.ts → types-lamU1Fd3.d.mts} +72 -2
- package/dist/{types-CXJAj2DU.d.mts → types-lamU1Fd3.d.ts} +72 -2
- package/package.json +1 -1
|
@@ -18,7 +18,9 @@ type CaptureHandle = {
|
|
|
18
18
|
disconnect(): void;
|
|
19
19
|
};
|
|
20
20
|
/** Normalized Credential Management mediation. Missing mediation defaults to `optional`. */
|
|
21
|
-
type
|
|
21
|
+
type CredentialMediation = "silent" | "optional" | "conditional" | "required" | "unknown";
|
|
22
|
+
/** Normalized Credential Management mediation of a WebAuthn ceremony. */
|
|
23
|
+
type WebAuthnMediation = CredentialMediation;
|
|
22
24
|
/** Normalized Credential Management UI mode for authentication ceremonies. */
|
|
23
25
|
type WebAuthnUiMode = "default" | "immediate" | "unknown";
|
|
24
26
|
/** Browser-native facts that remain stable for one ceremony. */
|
|
@@ -107,6 +109,74 @@ type WebAuthnCaptureHandle = CaptureHandle & {
|
|
|
107
109
|
/** Surface this capture attached to; `"none"` when `mode` is `"unavailable"`. */
|
|
108
110
|
readonly surface: WebAuthnAttachSurface | "none";
|
|
109
111
|
};
|
|
112
|
+
/** FedCM request context. Missing context defaults to `signin`. */
|
|
113
|
+
type FederatedIdentityContext = "signin" | "signup" | "use" | "continue" | "unknown";
|
|
114
|
+
/** FedCM UI mode: `passive` is a prompt the browser shows by itself, `active` follows a user gesture. Missing mode defaults to `passive`. */
|
|
115
|
+
type FederatedIdentityMode = "passive" | "active" | "unknown";
|
|
116
|
+
/** An identity provider named in a FedCM request. Nonce and parameters are never read. */
|
|
117
|
+
type FederatedIdentityProvider = {
|
|
118
|
+
/** The provider's FedCM config file URL; it names the provider. */
|
|
119
|
+
configURL: string;
|
|
120
|
+
/** The relying party's public client ID at the provider. */
|
|
121
|
+
clientId?: string;
|
|
122
|
+
};
|
|
123
|
+
type FederatedIdentityBase = {
|
|
124
|
+
/** Identifier shared by all events belonging to the same request. */
|
|
125
|
+
requestId: string;
|
|
126
|
+
};
|
|
127
|
+
type FederatedIdentityStartedEvent = FederatedIdentityBase & {
|
|
128
|
+
phase: "started";
|
|
129
|
+
/** Providers with a string `configURL`, in request order. */
|
|
130
|
+
providers: FederatedIdentityProvider[];
|
|
131
|
+
context: FederatedIdentityContext;
|
|
132
|
+
mode: FederatedIdentityMode;
|
|
133
|
+
mediation: CredentialMediation;
|
|
134
|
+
/** Whether transient user activation was active when the request started, when exposed by the browser. */
|
|
135
|
+
userActivation?: boolean;
|
|
136
|
+
};
|
|
137
|
+
type FederatedIdentityCompletedEvent = FederatedIdentityBase & {
|
|
138
|
+
phase: "completed";
|
|
139
|
+
/** Config file URL of the provider whose account was chosen, when the browser exposes it. */
|
|
140
|
+
configURL?: string;
|
|
141
|
+
/** Whether the browser chose the account without user interaction, when exposed. */
|
|
142
|
+
isAutoSelected?: boolean;
|
|
143
|
+
};
|
|
144
|
+
type FederatedIdentityFailedEvent = FederatedIdentityBase & {
|
|
145
|
+
phase: "failed";
|
|
146
|
+
/**
|
|
147
|
+
* DOM exception name, or `UnknownError`. Typical values: `NotAllowedError` (declined or blocked),
|
|
148
|
+
* `NetworkError` (no account, provider unavailable or cooldown), `AbortError`,
|
|
149
|
+
* `IdentityCredentialError` (the provider refused after an account was chosen). `NoCredential`
|
|
150
|
+
* when the request resolved without a credential.
|
|
151
|
+
*/
|
|
152
|
+
errorName: string;
|
|
153
|
+
/** Error code of an `IdentityCredentialError`, when non-empty. */
|
|
154
|
+
code?: string;
|
|
155
|
+
/** Present when the request signal was aborted before settlement. */
|
|
156
|
+
aborted?: true;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Lifecycle event of a FedCM request (`navigator.credentials.get({ identity })`). Tokens, nonces,
|
|
160
|
+
* parameters and login hints never appear in events.
|
|
161
|
+
*/
|
|
162
|
+
type FederatedIdentityEvent = FederatedIdentityStartedEvent | FederatedIdentityCompletedEvent | FederatedIdentityFailedEvent;
|
|
163
|
+
/** Options for {@link captureFederatedIdentity}. */
|
|
164
|
+
type FederatedIdentityCaptureOptions = {
|
|
165
|
+
/** Receives FedCM lifecycle events. Return values are not awaited. */
|
|
166
|
+
onEvent: (event: FederatedIdentityEvent) => void;
|
|
167
|
+
/** Optional diagnostic logger. */
|
|
168
|
+
logger?: Logger;
|
|
169
|
+
/**
|
|
170
|
+
* Highest surface capture may attach to when no other capture is attached yet; see
|
|
171
|
+
* {@link WebAuthnCaptureOptions.attach}. Defaults to `"methods"`.
|
|
172
|
+
*/
|
|
173
|
+
attach?: WebAuthnAttachSurface;
|
|
174
|
+
};
|
|
175
|
+
/** Handle returned by {@link captureFederatedIdentity}. */
|
|
176
|
+
type FederatedIdentityCaptureHandle = CaptureHandle & {
|
|
177
|
+
/** Surface the shared attachment uses; `"none"` when `mode` is `"unavailable"`. */
|
|
178
|
+
readonly surface: WebAuthnAttachSurface | "none";
|
|
179
|
+
};
|
|
110
180
|
/** Network API used for an observed exchange. */
|
|
111
181
|
type NetworkTransport = "xhr" | "fetch";
|
|
112
182
|
/** Direction of a projected body within an observed network exchange. */
|
|
@@ -244,4 +314,4 @@ type NavigationCaptureOptions = {
|
|
|
244
314
|
logger?: Logger;
|
|
245
315
|
};
|
|
246
316
|
|
|
247
|
-
export type { CaptureHandle as C, HttpExchange as H, Logger as L, NetworkCaptureOptions as N, WebAuthnCaptureOptions as W, WebAuthnCaptureHandle as a,
|
|
317
|
+
export type { CaptureHandle as C, FederatedIdentityCaptureOptions as F, HttpExchange as H, Logger as L, NetworkCaptureOptions as N, WebAuthnCaptureOptions as W, WebAuthnCaptureHandle as a, FederatedIdentityCaptureHandle as b, NavigationCaptureOptions as c, CredentialMediation as d, FederatedIdentityCompletedEvent as e, FederatedIdentityContext as f, FederatedIdentityEvent as g, FederatedIdentityFailedEvent as h, FederatedIdentityMode as i, FederatedIdentityProvider as j, FederatedIdentityStartedEvent as k, HttpRequestStarted as l, NavigationEvent as m, NavigationSource as n, NetworkBodyDirection as o, NetworkBodyProjectionContext as p, NetworkBodyProjector as q, NetworkTransport as r, WebAuthnAttachSurface as s, WebAuthnCeremonyCompletedEvent as t, WebAuthnCeremonyContext as u, WebAuthnCeremonyEvent as v, WebAuthnCeremonyFailedEvent as w, WebAuthnCeremonyStartedEvent as x, WebAuthnMediation as y, WebAuthnUiMode as z };
|
|
@@ -18,7 +18,9 @@ type CaptureHandle = {
|
|
|
18
18
|
disconnect(): void;
|
|
19
19
|
};
|
|
20
20
|
/** Normalized Credential Management mediation. Missing mediation defaults to `optional`. */
|
|
21
|
-
type
|
|
21
|
+
type CredentialMediation = "silent" | "optional" | "conditional" | "required" | "unknown";
|
|
22
|
+
/** Normalized Credential Management mediation of a WebAuthn ceremony. */
|
|
23
|
+
type WebAuthnMediation = CredentialMediation;
|
|
22
24
|
/** Normalized Credential Management UI mode for authentication ceremonies. */
|
|
23
25
|
type WebAuthnUiMode = "default" | "immediate" | "unknown";
|
|
24
26
|
/** Browser-native facts that remain stable for one ceremony. */
|
|
@@ -107,6 +109,74 @@ type WebAuthnCaptureHandle = CaptureHandle & {
|
|
|
107
109
|
/** Surface this capture attached to; `"none"` when `mode` is `"unavailable"`. */
|
|
108
110
|
readonly surface: WebAuthnAttachSurface | "none";
|
|
109
111
|
};
|
|
112
|
+
/** FedCM request context. Missing context defaults to `signin`. */
|
|
113
|
+
type FederatedIdentityContext = "signin" | "signup" | "use" | "continue" | "unknown";
|
|
114
|
+
/** FedCM UI mode: `passive` is a prompt the browser shows by itself, `active` follows a user gesture. Missing mode defaults to `passive`. */
|
|
115
|
+
type FederatedIdentityMode = "passive" | "active" | "unknown";
|
|
116
|
+
/** An identity provider named in a FedCM request. Nonce and parameters are never read. */
|
|
117
|
+
type FederatedIdentityProvider = {
|
|
118
|
+
/** The provider's FedCM config file URL; it names the provider. */
|
|
119
|
+
configURL: string;
|
|
120
|
+
/** The relying party's public client ID at the provider. */
|
|
121
|
+
clientId?: string;
|
|
122
|
+
};
|
|
123
|
+
type FederatedIdentityBase = {
|
|
124
|
+
/** Identifier shared by all events belonging to the same request. */
|
|
125
|
+
requestId: string;
|
|
126
|
+
};
|
|
127
|
+
type FederatedIdentityStartedEvent = FederatedIdentityBase & {
|
|
128
|
+
phase: "started";
|
|
129
|
+
/** Providers with a string `configURL`, in request order. */
|
|
130
|
+
providers: FederatedIdentityProvider[];
|
|
131
|
+
context: FederatedIdentityContext;
|
|
132
|
+
mode: FederatedIdentityMode;
|
|
133
|
+
mediation: CredentialMediation;
|
|
134
|
+
/** Whether transient user activation was active when the request started, when exposed by the browser. */
|
|
135
|
+
userActivation?: boolean;
|
|
136
|
+
};
|
|
137
|
+
type FederatedIdentityCompletedEvent = FederatedIdentityBase & {
|
|
138
|
+
phase: "completed";
|
|
139
|
+
/** Config file URL of the provider whose account was chosen, when the browser exposes it. */
|
|
140
|
+
configURL?: string;
|
|
141
|
+
/** Whether the browser chose the account without user interaction, when exposed. */
|
|
142
|
+
isAutoSelected?: boolean;
|
|
143
|
+
};
|
|
144
|
+
type FederatedIdentityFailedEvent = FederatedIdentityBase & {
|
|
145
|
+
phase: "failed";
|
|
146
|
+
/**
|
|
147
|
+
* DOM exception name, or `UnknownError`. Typical values: `NotAllowedError` (declined or blocked),
|
|
148
|
+
* `NetworkError` (no account, provider unavailable or cooldown), `AbortError`,
|
|
149
|
+
* `IdentityCredentialError` (the provider refused after an account was chosen). `NoCredential`
|
|
150
|
+
* when the request resolved without a credential.
|
|
151
|
+
*/
|
|
152
|
+
errorName: string;
|
|
153
|
+
/** Error code of an `IdentityCredentialError`, when non-empty. */
|
|
154
|
+
code?: string;
|
|
155
|
+
/** Present when the request signal was aborted before settlement. */
|
|
156
|
+
aborted?: true;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Lifecycle event of a FedCM request (`navigator.credentials.get({ identity })`). Tokens, nonces,
|
|
160
|
+
* parameters and login hints never appear in events.
|
|
161
|
+
*/
|
|
162
|
+
type FederatedIdentityEvent = FederatedIdentityStartedEvent | FederatedIdentityCompletedEvent | FederatedIdentityFailedEvent;
|
|
163
|
+
/** Options for {@link captureFederatedIdentity}. */
|
|
164
|
+
type FederatedIdentityCaptureOptions = {
|
|
165
|
+
/** Receives FedCM lifecycle events. Return values are not awaited. */
|
|
166
|
+
onEvent: (event: FederatedIdentityEvent) => void;
|
|
167
|
+
/** Optional diagnostic logger. */
|
|
168
|
+
logger?: Logger;
|
|
169
|
+
/**
|
|
170
|
+
* Highest surface capture may attach to when no other capture is attached yet; see
|
|
171
|
+
* {@link WebAuthnCaptureOptions.attach}. Defaults to `"methods"`.
|
|
172
|
+
*/
|
|
173
|
+
attach?: WebAuthnAttachSurface;
|
|
174
|
+
};
|
|
175
|
+
/** Handle returned by {@link captureFederatedIdentity}. */
|
|
176
|
+
type FederatedIdentityCaptureHandle = CaptureHandle & {
|
|
177
|
+
/** Surface the shared attachment uses; `"none"` when `mode` is `"unavailable"`. */
|
|
178
|
+
readonly surface: WebAuthnAttachSurface | "none";
|
|
179
|
+
};
|
|
110
180
|
/** Network API used for an observed exchange. */
|
|
111
181
|
type NetworkTransport = "xhr" | "fetch";
|
|
112
182
|
/** Direction of a projected body within an observed network exchange. */
|
|
@@ -244,4 +314,4 @@ type NavigationCaptureOptions = {
|
|
|
244
314
|
logger?: Logger;
|
|
245
315
|
};
|
|
246
316
|
|
|
247
|
-
export type { CaptureHandle as C, HttpExchange as H, Logger as L, NetworkCaptureOptions as N, WebAuthnCaptureOptions as W, WebAuthnCaptureHandle as a,
|
|
317
|
+
export type { CaptureHandle as C, FederatedIdentityCaptureOptions as F, HttpExchange as H, Logger as L, NetworkCaptureOptions as N, WebAuthnCaptureOptions as W, WebAuthnCaptureHandle as a, FederatedIdentityCaptureHandle as b, NavigationCaptureOptions as c, CredentialMediation as d, FederatedIdentityCompletedEvent as e, FederatedIdentityContext as f, FederatedIdentityEvent as g, FederatedIdentityFailedEvent as h, FederatedIdentityMode as i, FederatedIdentityProvider as j, FederatedIdentityStartedEvent as k, HttpRequestStarted as l, NavigationEvent as m, NavigationSource as n, NetworkBodyDirection as o, NetworkBodyProjectionContext as p, NetworkBodyProjector as q, NetworkTransport as r, WebAuthnAttachSurface as s, WebAuthnCeremonyCompletedEvent as t, WebAuthnCeremonyContext as u, WebAuthnCeremonyEvent as v, WebAuthnCeremonyFailedEvent as w, WebAuthnCeremonyStartedEvent as x, WebAuthnMediation as y, WebAuthnUiMode as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corbado/autocapture",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Observer-style capture helpers for WebAuthn ceremonies, selected network exchanges, in-app navigation, and composed event paths.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|