@authsignal/browser 1.11.0-alpha3 → 1.12.0-alpha.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/api/digital-credential-api-client.d.ts +12 -0
- package/dist/api/passkey-api-client.d.ts +7 -7
- package/dist/api/types/digital-credential.d.ts +22 -0
- package/dist/api/types/passkey.d.ts +15 -2
- package/dist/authsignal.d.ts +2 -0
- package/dist/digital-credential.d.ts +25 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25709 -34
- package/dist/index.min.js +62 -1
- package/dist/passkey.d.ts +3 -2
- package/dist/utils.d.ts +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ErrorResponse } from "./types/passkey";
|
|
2
|
+
import { ApiClientOptions, ChallengeResponse } from "./types/shared";
|
|
3
|
+
import { PresentationOptionsRequest, PresentationOptionsResponse, VerifyPresentationRequest, VerifyPresentationResponse } from "./types/digital-credential";
|
|
4
|
+
export declare class DigitalCredentialApiClient {
|
|
5
|
+
tenantId: string;
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
onTokenExpired?: () => void;
|
|
8
|
+
constructor({ baseUrl, tenantId, onTokenExpired }: ApiClientOptions);
|
|
9
|
+
presentationOptions({ challengeId, token, mode, }: PresentationOptionsRequest): Promise<PresentationOptionsResponse | ErrorResponse>;
|
|
10
|
+
verifyPresentation({ token, data, nonce, challengeId, mode, }: VerifyPresentationRequest): Promise<VerifyPresentationResponse | ErrorResponse>;
|
|
11
|
+
challenge(action: string): Promise<ChallengeResponse | ErrorResponse>;
|
|
12
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { AddAuthenticatorRequest, AddAuthenticatorResponse, AuthenticationOptsResponse, ChallengeResponse, ErrorResponse, PasskeyAuthenticatorResponse, RegistrationOptsRequest, RegistrationOptsResponse, VerifyRequest, VerifyResponse } from "./types/passkey";
|
|
1
|
+
import { AddAuthenticatorRequest, AddAuthenticatorResponse, AuthenticationOptsRequest, AuthenticationOptsResponse, ChallengeRequest, ChallengeResponse, ErrorResponse, PasskeyAuthenticatorResponse, RegistrationOptsRequest, RegistrationOptsResponse, VerifyRequest, VerifyResponse } from "./types/passkey";
|
|
2
2
|
import { ApiClientOptions } from "./types/shared";
|
|
3
3
|
export declare class PasskeyApiClient {
|
|
4
4
|
tenantId: string;
|
|
5
5
|
baseUrl: string;
|
|
6
6
|
onTokenExpired?: () => void;
|
|
7
7
|
constructor({ baseUrl, tenantId, onTokenExpired }: ApiClientOptions);
|
|
8
|
-
registrationOptions({ token, username, authenticatorAttachment, }: {
|
|
8
|
+
registrationOptions({ token, username, authenticatorAttachment, useCookies, }: {
|
|
9
9
|
token: string;
|
|
10
10
|
} & RegistrationOptsRequest): Promise<RegistrationOptsResponse | ErrorResponse>;
|
|
11
|
-
authenticationOptions({ token }: {
|
|
11
|
+
authenticationOptions({ token, challengeId, useCookies, }: {
|
|
12
12
|
token?: string;
|
|
13
|
-
}): Promise<AuthenticationOptsResponse | ErrorResponse>;
|
|
13
|
+
} & AuthenticationOptsRequest): Promise<AuthenticationOptsResponse | ErrorResponse>;
|
|
14
14
|
authenticationOptionsWeb({ token }: {
|
|
15
15
|
token?: string;
|
|
16
16
|
}): Promise<AuthenticationOptsResponse | ErrorResponse>;
|
|
17
|
-
addAuthenticator({ token, registrationCredential, conditionalCreate, }: {
|
|
17
|
+
addAuthenticator({ token, registrationCredential, conditionalCreate, challengeId, useCookies, }: {
|
|
18
18
|
token: string;
|
|
19
19
|
} & AddAuthenticatorRequest): Promise<AddAuthenticatorResponse | ErrorResponse>;
|
|
20
|
-
verify({ authenticationCredential, token, deviceId, }: {
|
|
20
|
+
verify({ authenticationCredential, token, deviceId, challengeId, useCookies, }: {
|
|
21
21
|
token?: string;
|
|
22
22
|
} & VerifyRequest): Promise<VerifyResponse | ErrorResponse>;
|
|
23
23
|
getPasskeyAuthenticator({ credentialIds, }: {
|
|
24
24
|
credentialIds: string[];
|
|
25
25
|
}): Promise<PasskeyAuthenticatorResponse | ErrorResponse>;
|
|
26
|
-
challenge(action:
|
|
26
|
+
challenge({ action, useCookies }: ChallengeRequest): Promise<ChallengeResponse | ErrorResponse>;
|
|
27
27
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type PresentationOptionsRequest = {
|
|
2
|
+
token?: string;
|
|
3
|
+
challengeId?: string;
|
|
4
|
+
mode?: "sdc" | "idv";
|
|
5
|
+
};
|
|
6
|
+
export type PresentationOptionsResponse = {
|
|
7
|
+
challengeId: string;
|
|
8
|
+
dcapiOptions: any;
|
|
9
|
+
};
|
|
10
|
+
export type VerifyPresentationRequest = {
|
|
11
|
+
token?: string;
|
|
12
|
+
data: any;
|
|
13
|
+
nonce: string;
|
|
14
|
+
challengeId: string;
|
|
15
|
+
mode?: "sdc" | "idv";
|
|
16
|
+
};
|
|
17
|
+
export type VerifyPresentationResponse = {
|
|
18
|
+
isVerified: boolean;
|
|
19
|
+
accessToken?: string;
|
|
20
|
+
username?: string;
|
|
21
|
+
userId?: string;
|
|
22
|
+
};
|
|
@@ -3,17 +3,25 @@ import { Authenticator } from "./shared";
|
|
|
3
3
|
export type RegistrationOptsRequest = {
|
|
4
4
|
username?: string;
|
|
5
5
|
authenticatorAttachment?: AuthenticatorAttachment | null;
|
|
6
|
+
useCookies?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export type RegistrationOptsResponse = {
|
|
8
|
-
challengeId
|
|
9
|
+
challengeId?: string;
|
|
9
10
|
options: PublicKeyCredentialCreationOptionsJSON;
|
|
10
11
|
};
|
|
12
|
+
export type AuthenticationOptsRequest = {
|
|
13
|
+
challengeId?: string;
|
|
14
|
+
useCookies?: boolean;
|
|
15
|
+
};
|
|
11
16
|
export type AuthenticationOptsResponse = {
|
|
12
17
|
options: PublicKeyCredentialCreationOptionsJSON;
|
|
18
|
+
challengeId?: string;
|
|
13
19
|
};
|
|
14
20
|
export type AddAuthenticatorRequest = {
|
|
15
21
|
registrationCredential: RegistrationResponseJSON;
|
|
16
22
|
conditionalCreate?: boolean;
|
|
23
|
+
challengeId?: string;
|
|
24
|
+
useCookies?: boolean;
|
|
17
25
|
};
|
|
18
26
|
export type AddAuthenticatorResponse = {
|
|
19
27
|
isVerified: boolean;
|
|
@@ -25,7 +33,8 @@ export type AddAuthenticatorResponse = {
|
|
|
25
33
|
export type VerifyRequest = {
|
|
26
34
|
authenticationCredential: AuthenticationResponseJSON;
|
|
27
35
|
deviceId?: string;
|
|
28
|
-
|
|
36
|
+
challengeId?: string;
|
|
37
|
+
useCookies?: boolean;
|
|
29
38
|
};
|
|
30
39
|
export type VerifyResponse = {
|
|
31
40
|
isVerified: boolean;
|
|
@@ -39,6 +48,10 @@ export type PasskeyAuthenticatorResponse = {
|
|
|
39
48
|
credentialId: string;
|
|
40
49
|
verifiedAt: string;
|
|
41
50
|
};
|
|
51
|
+
export type ChallengeRequest = {
|
|
52
|
+
action?: string;
|
|
53
|
+
useCookies?: boolean;
|
|
54
|
+
};
|
|
42
55
|
export type ChallengeResponse = {
|
|
43
56
|
challengeId: string;
|
|
44
57
|
};
|
package/dist/authsignal.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { SecurityKey } from "./security-key";
|
|
|
8
8
|
import { QrCode } from "./qr-code";
|
|
9
9
|
import { Push } from "./push";
|
|
10
10
|
import { Whatsapp } from "./whatsapp";
|
|
11
|
+
import { DigitalCredential } from "./digital-credential";
|
|
11
12
|
export declare class Authsignal {
|
|
12
13
|
anonymousId: string;
|
|
13
14
|
profilingId: string;
|
|
@@ -22,6 +23,7 @@ export declare class Authsignal {
|
|
|
22
23
|
qrCode: QrCode;
|
|
23
24
|
push: Push;
|
|
24
25
|
whatsapp: Whatsapp;
|
|
26
|
+
digitalCredential: DigitalCredential;
|
|
25
27
|
constructor({ cookieDomain, cookieName, baseUrl, tenantId, onTokenExpired, }: AuthsignalOptions);
|
|
26
28
|
setToken(token: string): void;
|
|
27
29
|
launch(url: string, options?: {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DigitalCredentialApiClient } from "./api/digital-credential-api-client";
|
|
2
|
+
import { AuthsignalResponse } from "./types";
|
|
3
|
+
type DigitalCredentialOptions = {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
onTokenExpired?: () => void;
|
|
7
|
+
};
|
|
8
|
+
type RequestCredentialParams = {
|
|
9
|
+
action?: string;
|
|
10
|
+
token?: string;
|
|
11
|
+
mode?: "sdc" | "idv";
|
|
12
|
+
};
|
|
13
|
+
type RequestCredentialResponse = {
|
|
14
|
+
isVerified: boolean;
|
|
15
|
+
token?: string;
|
|
16
|
+
username?: string;
|
|
17
|
+
userId?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare class DigitalCredential {
|
|
20
|
+
api: DigitalCredentialApiClient;
|
|
21
|
+
private cache;
|
|
22
|
+
constructor({ baseUrl, tenantId, onTokenExpired }: DigitalCredentialOptions);
|
|
23
|
+
requestCredential(params?: RequestCredentialParams): Promise<AuthsignalResponse<RequestCredentialResponse>>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export * from "./authsignal";
|
|
2
2
|
export * from "./types";
|
|
3
|
+
export { DigitalCredential } from "./digital-credential";
|
|
3
4
|
export type { Authenticator, VerificationMethod, EnrollResponse, ChallengeResponse } from "./api/types/shared";
|
|
4
5
|
export type { EnrollTotpResponse } from "./api/types/totp";
|
|
5
6
|
export type { QrCodeChallengeResponse, QrCodeVerifyResponse } from "./api/types/qr-code";
|
|
6
7
|
export type { PushChallengeResponse, PushVerifyResponse } from "./api/types/push";
|
|
7
8
|
export type { WebSocketQrCodeOptions, WebSocketQrCodeResponse, ChallengeState } from "./api/types/websocket";
|
|
8
9
|
export { Whatsapp } from "./whatsapp";
|
|
10
|
+
export type { PresentationOptionsRequest, PresentationOptionsResponse, VerifyPresentationRequest, VerifyPresentationResponse, } from "./api/types/digital-credential";
|
|
11
|
+
export { browserSupportsDigitalCredential } from "./utils";
|