@authsignal/browser 0.4.0 → 0.4.2

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.
@@ -1,4 +1,4 @@
1
- import { AddAuthenticatorRequest, AddAuthenticatorResponse, AuthenticationOptsRequest, AuthenticationOptsResponse, PasskeyAuthenticatorResponse, RegistrationOptsRequest, RegistrationOptsResponse, VerifyRequest, VerifyResponse } from "./types";
1
+ import { AddAuthenticatorRequest, AddAuthenticatorResponse, AuthenticationOptsRequest, AuthenticationOptsResponse, ChallengeResponse, PasskeyAuthenticatorResponse, RegistrationOptsRequest, RegistrationOptsResponse, VerifyRequest, VerifyResponse } from "./types";
2
2
  declare type PasskeyApiClientOptions = {
3
3
  baseUrl: string;
4
4
  tenantId: string;
@@ -7,11 +7,20 @@ export declare class PasskeyApiClient {
7
7
  tenantId: string;
8
8
  baseUrl: string;
9
9
  constructor({ baseUrl, tenantId }: PasskeyApiClientOptions);
10
- registrationOptions({ token, userName, authenticatorAttachment, }: RegistrationOptsRequest): Promise<RegistrationOptsResponse>;
11
- authenticationOptions({ token }: AuthenticationOptsRequest): Promise<AuthenticationOptsResponse>;
12
- addAuthenticator({ token, ...rest }: AddAuthenticatorRequest): Promise<AddAuthenticatorResponse>;
13
- verify({ token, ...rest }: VerifyRequest): Promise<VerifyResponse>;
10
+ registrationOptions({ token, username, authenticatorAttachment, }: {
11
+ token: string;
12
+ } & RegistrationOptsRequest): Promise<RegistrationOptsResponse>;
13
+ authenticationOptions({ token, challengeId, }: {
14
+ token?: string;
15
+ } & AuthenticationOptsRequest): Promise<AuthenticationOptsResponse>;
16
+ addAuthenticator({ token, challengeId, registrationCredential, }: {
17
+ token: string;
18
+ } & AddAuthenticatorRequest): Promise<AddAuthenticatorResponse>;
19
+ verify({ token, challengeId, authenticationCredential, deviceId, }: {
20
+ token?: string;
21
+ } & VerifyRequest): Promise<VerifyResponse>;
14
22
  getPasskeyAuthenticator(credentialId: string): Promise<PasskeyAuthenticatorResponse>;
23
+ challenge(action: string): Promise<ChallengeResponse>;
15
24
  private buildHeaders;
16
25
  }
17
26
  export {};
@@ -1,7 +1,6 @@
1
1
  import { AuthenticationResponseJSON, AuthenticatorAttachment, PublicKeyCredentialCreationOptionsJSON, RegistrationResponseJSON } from "@simplewebauthn/types";
2
2
  export declare type RegistrationOptsRequest = {
3
- userName?: string;
4
- token: string;
3
+ username?: string;
5
4
  authenticatorAttachment?: AuthenticatorAttachment | null;
6
5
  };
7
6
  export declare type RegistrationOptsResponse = {
@@ -9,14 +8,13 @@ export declare type RegistrationOptsResponse = {
9
8
  options: PublicKeyCredentialCreationOptionsJSON;
10
9
  };
11
10
  export declare type AuthenticationOptsRequest = {
12
- token?: string;
11
+ challengeId?: string;
13
12
  };
14
13
  export declare type AuthenticationOptsResponse = {
15
14
  challengeId: string;
16
15
  options: PublicKeyCredentialCreationOptionsJSON;
17
16
  };
18
17
  export declare type AddAuthenticatorRequest = {
19
- token: string;
20
18
  challengeId: string;
21
19
  registrationCredential: RegistrationResponseJSON;
22
20
  };
@@ -26,9 +24,9 @@ export declare type AddAuthenticatorResponse = {
26
24
  userAuthenticatorId?: string;
27
25
  };
28
26
  export declare type VerifyRequest = {
29
- token?: string;
30
27
  challengeId: string;
31
28
  authenticationCredential: AuthenticationResponseJSON;
29
+ deviceId?: string;
32
30
  };
33
31
  export declare type VerifyResponse = {
34
32
  isVerified: boolean;
@@ -38,3 +36,6 @@ export declare type PasskeyAuthenticatorResponse = {
38
36
  credentialId: string;
39
37
  verifiedAt: string;
40
38
  };
39
+ export declare type ChallengeResponse = {
40
+ challengeId: string;
41
+ };
@@ -1,18 +1,18 @@
1
+ import { A11yDialogEvent } from "a11y-dialog";
1
2
  declare type PopupShowInput = {
2
3
  url: string;
3
4
  };
4
- declare type EventType = "show" | "hide" | "destroy" | "create";
5
- declare type EventHandler = (node: Element, event?: Event) => void;
6
5
  declare type PopupHandlerOptions = {
7
6
  width?: string;
7
+ isClosable?: boolean;
8
8
  };
9
9
  export declare class PopupHandler {
10
10
  private popup;
11
- constructor({ width }: PopupHandlerOptions);
12
- create({ width }: PopupHandlerOptions): void;
11
+ constructor({ width, isClosable }: PopupHandlerOptions);
12
+ create({ width, isClosable }: PopupHandlerOptions): void;
13
13
  destroy(): void;
14
14
  show({ url }: PopupShowInput): void;
15
15
  close(): void;
16
- on(event: EventType, handler: EventHandler): void;
16
+ on(event: A11yDialogEvent, listener: EventListener): void;
17
17
  }
18
18
  export {};