@plainkey/types 0.1.0 → 0.3.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/index.d.mts CHANGED
@@ -1,4 +1,6 @@
1
- //#region src/index.d.ts
1
+ import { AuthenticationResponseJSON, AuthenticationResponseJSON as AuthenticationResponseJSON$1, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialCreationOptionsJSON as PublicKeyCredentialCreationOptionsJSON$1, PublicKeyCredentialRequestOptionsJSON, PublicKeyCredentialRequestOptionsJSON as PublicKeyCredentialRequestOptionsJSON$1, RegistrationResponseJSON, RegistrationResponseJSON as RegistrationResponseJSON$1 } from "@simplewebauthn/browser";
2
+
3
+ //#region src/common.d.ts
2
4
  type UserIdentifier = {
3
5
  userId?: string;
4
6
  userName?: string;
@@ -6,8 +8,77 @@ type UserIdentifier = {
6
8
  type PublicUser = {
7
9
  id: string;
8
10
  userName?: string;
9
- metadata?: Record<string, unknown>;
10
11
  };
11
12
  //#endregion
12
- export { PublicUser, UserIdentifier };
13
+ //#region src/browser/requests.d.ts
14
+ type RegistrationBeginRequest = {
15
+ userName?: string;
16
+ };
17
+ type RegistrationCompleteRequest = {
18
+ userIdentifier: UserIdentifier;
19
+ credential: RegistrationResponseJSON$1;
20
+ };
21
+ type UserCredentialBeginRequest = {
22
+ userIdentifier: UserIdentifier;
23
+ };
24
+ type UserCredentialCompleteRequest = {
25
+ userIdentifier: UserIdentifier;
26
+ credential: RegistrationResponseJSON$1;
27
+ };
28
+ type LoginBeginRequest = {
29
+ userIdentifier?: UserIdentifier;
30
+ };
31
+ type LoginCompleteRequest = {
32
+ authenticationResponse: AuthenticationResponseJSON$1;
33
+ };
34
+ //#endregion
35
+ //#region src/browser/responses.d.ts
36
+ type ErrorResponse = {
37
+ error: string;
38
+ };
39
+ type RegistrationBeginResponse = {
40
+ user: PublicUser;
41
+ options: PublicKeyCredentialCreationOptionsJSON$1;
42
+ };
43
+ type IssuedSession = {
44
+ sessionId: string;
45
+ token: string;
46
+ expiresInSeconds: number;
47
+ tokenType: string;
48
+ refreshToken: string;
49
+ };
50
+ type RegistrationCompleteResponse = {
51
+ success: boolean;
52
+ user: PublicUser;
53
+ token: IssuedSession;
54
+ credential: {
55
+ id: string;
56
+ webAuthnId: string;
57
+ };
58
+ };
59
+ type UserCredentialBeginResponse = {
60
+ user: PublicUser;
61
+ options: PublicKeyCredentialCreationOptionsJSON$1;
62
+ };
63
+ type UserCredentialCompleteResponse = {
64
+ success: boolean;
65
+ user: PublicUser;
66
+ token: IssuedSession;
67
+ credential: {
68
+ id: string;
69
+ webAuthnId: string;
70
+ };
71
+ };
72
+ type LoginBeginResponse = {
73
+ projectId: string;
74
+ userId?: string;
75
+ options: PublicKeyCredentialRequestOptionsJSON$1;
76
+ };
77
+ type LoginCompleteResponse = {
78
+ verified: boolean;
79
+ user: PublicUser;
80
+ token: IssuedSession;
81
+ };
82
+ //#endregion
83
+ export { AuthenticationResponseJSON, ErrorResponse, IssuedSession, LoginBeginRequest, LoginBeginResponse, LoginCompleteRequest, LoginCompleteResponse, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, PublicUser, RegistrationBeginRequest, RegistrationBeginResponse, RegistrationCompleteRequest, RegistrationCompleteResponse, RegistrationResponseJSON, UserCredentialBeginRequest, UserCredentialBeginResponse, UserCredentialCompleteRequest, UserCredentialCompleteResponse, UserIdentifier };
13
84
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";KAAY,cAAA;EAAA,MAAA,CAAA,EAAA,MAAA;EAKA,QAAA,CAAA,EAAA,MAAU;;KAAV,UAAA;;;aAGC"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/common.ts","../src/browser/requests.ts","../src/browser/responses.ts"],"sourcesContent":[],"mappings":";;;KAAY,cAAA;;;AAAZ,CAAA;AAKY,KA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,UAhBC;EAAa,KAAA,EAiBb,aAjBa;AAQtB,CAAA"}
package/dist/index.mjs CHANGED
@@ -1 +1,3 @@
1
- export { };
1
+ import { AuthenticationResponseJSON, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON } from "@simplewebauthn/browser";
2
+
3
+ export { AuthenticationResponseJSON, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON };
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
- {
2
- "name": "@plainkey/types",
3
- "version": "0.1.0",
4
- "main": "dist/index.js",
5
- "module": "dist/index.mjs",
6
- "types": "dist/index.d.mts",
7
- "files": [
8
- "dist"
9
- ],
10
- "scripts": {
11
- "build": "tsdown src/index.ts --format esm --dts --clean",
12
- "prepare": "npm run build"
13
- },
14
- "publishConfig": {
15
- "access": "public"
16
- },
17
- "dependencies": {
18
- "@simplewebauthn/browser": "^13.2.0"
19
- },
20
- "devDependencies": {
21
- "tsdown": "^0.15.5"
22
- }
23
- }
1
+ {
2
+ "name": "@plainkey/types",
3
+ "version": "0.3.0",
4
+ "main": "dist/index.js",
5
+ "module": "dist/index.mjs",
6
+ "types": "dist/index.d.mts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsdown src/index.ts --format esm --dts --clean",
12
+ "prepare": "npm run build"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "dependencies": {
18
+ "@simplewebauthn/browser": "^13.2.0"
19
+ },
20
+ "devDependencies": {
21
+ "tsdown": "^0.15.5"
22
+ }
23
+ }