@plainkey/types 0.1.0 → 0.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/dist/index.d.mts +75 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -1
- package/package.json +23 -23
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
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;
|
|
@@ -9,5 +11,76 @@ type PublicUser = {
|
|
|
9
11
|
metadata?: Record<string, unknown>;
|
|
10
12
|
};
|
|
11
13
|
//#endregion
|
|
12
|
-
|
|
14
|
+
//#region src/browser/requests.d.ts
|
|
15
|
+
type RegistrationBeginRequest = {
|
|
16
|
+
userName?: string;
|
|
17
|
+
userMetadata?: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
type RegistrationCompleteRequest = {
|
|
20
|
+
userIdentifier: UserIdentifier;
|
|
21
|
+
credential: RegistrationResponseJSON$1;
|
|
22
|
+
};
|
|
23
|
+
type UserCredentialBeginRequest = {
|
|
24
|
+
userIdentifier: UserIdentifier;
|
|
25
|
+
};
|
|
26
|
+
type UserCredentialCompleteRequest = {
|
|
27
|
+
userIdentifier: UserIdentifier;
|
|
28
|
+
credential: RegistrationResponseJSON$1;
|
|
29
|
+
};
|
|
30
|
+
type LoginBeginRequest = {
|
|
31
|
+
userIdentifier?: UserIdentifier;
|
|
32
|
+
};
|
|
33
|
+
type LoginCompleteRequest = {
|
|
34
|
+
authenticationResponse: AuthenticationResponseJSON$1;
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/browser/responses.d.ts
|
|
38
|
+
type ErrorResponse = {
|
|
39
|
+
error: string;
|
|
40
|
+
};
|
|
41
|
+
type RegistrationBeginResponse = {
|
|
42
|
+
user: PublicUser;
|
|
43
|
+
options: PublicKeyCredentialCreationOptionsJSON$1;
|
|
44
|
+
};
|
|
45
|
+
type IssuedSession = {
|
|
46
|
+
sessionId: string;
|
|
47
|
+
token: string;
|
|
48
|
+
expiresInSeconds: number;
|
|
49
|
+
tokenType: string;
|
|
50
|
+
refreshToken: string;
|
|
51
|
+
};
|
|
52
|
+
type RegistrationCompleteResponse = {
|
|
53
|
+
success: boolean;
|
|
54
|
+
user: PublicUser;
|
|
55
|
+
token: IssuedSession;
|
|
56
|
+
credential: {
|
|
57
|
+
id: string;
|
|
58
|
+
webAuthnId: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
type UserCredentialBeginResponse = {
|
|
62
|
+
user: PublicUser;
|
|
63
|
+
options: PublicKeyCredentialCreationOptionsJSON$1;
|
|
64
|
+
};
|
|
65
|
+
type UserCredentialCompleteResponse = {
|
|
66
|
+
success: boolean;
|
|
67
|
+
user: PublicUser;
|
|
68
|
+
token: IssuedSession;
|
|
69
|
+
credential: {
|
|
70
|
+
id: string;
|
|
71
|
+
webAuthnId: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
type LoginBeginResponse = {
|
|
75
|
+
projectId: string;
|
|
76
|
+
userId?: string;
|
|
77
|
+
options: PublicKeyCredentialRequestOptionsJSON$1;
|
|
78
|
+
};
|
|
79
|
+
type LoginCompleteResponse = {
|
|
80
|
+
verified: boolean;
|
|
81
|
+
user: PublicUser;
|
|
82
|
+
token: IssuedSession;
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
export { AuthenticationResponseJSON, ErrorResponse, IssuedSession, LoginBeginRequest, LoginBeginResponse, LoginCompleteRequest, LoginCompleteResponse, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, PublicUser, RegistrationBeginRequest, RegistrationBeginResponse, RegistrationCompleteRequest, RegistrationCompleteResponse, RegistrationResponseJSON, UserCredentialBeginRequest, UserCredentialBeginResponse, UserCredentialCompleteRequest, UserCredentialCompleteResponse, UserIdentifier };
|
|
13
86
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/
|
|
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,KAAA,UAAA,GAAU;;;aAGT;ACJb,CAAA;;;KAAY,wBAAA;EDJA,QAAA,CAAA,EAAA,MAAc;EAKd,YAAA,CAAU,ECCL,MDDK,CAAA,MAGT,EAAM,OAAA,CAAA;;KCCP,2BAAA;kBACM;EANN,UAAA,EAOE,0BAPsB;AAKpC,CAAA;AAAuC,KAM3B,0BAAA,GAN2B;gBACrB,EAMA,cANA;;AACoB,KAQ1B,6BAAA,GAR0B;EAI1B,cAAA,EAKM,cALoB;EAI1B,UAAA,EAEE,0BAF2B;CAAA;AACvB,KAKN,iBAAA,GALM;gBACJ,CAAA,EAKK,cALL;CAAwB;AAI1B,KAIA,oBAAA,GAHO;EAGP,sBAAA,EACc,4BAAA;;;;KCvBd,aAAA;EFPA,KAAA,EAAA,MAAA;AAKZ,CAAA;KEOY,yBAAA;QACJ;WACG;ADVX,CAAA;AAKY,KCQA,aAAA,GDRA;EAA2B,SAAA,EAAA,MAAA;OACrB,EAAA,MAAA;kBACJ,EAAA,MAAA;EAAwB,SAAA,EAAA,MAAA;EAI1B,YAAA,EAAA,MAAA;AAIZ,CAAA;AAAyC,KCM7B,4BAAA,GDN6B;SACvB,EAAA,OAAA;MACJ,ECMN,UDNM;EAAwB,KAAA,ECO7B,aDP6B;EAI1B,UAAA,EAAA;IAIA,EAAA,EAAA,MAAA;;;;ACtBA,KA6BA,2BAAA,GA7Ba;EAKb,IAAA,EAyBJ,UAzBI;EAAyB,OAAA,EA0B1B,wCA1B0B;;AAE1B,KA2BC,8BAAA,GA3BD;EAAsC,OAAA,EAAA,OAAA;EAGrC,IAAA,EA0BJ,UA1BiB;EAQb,KAAA,EAmBH,aAnBG;EAA4B,UAAA,EAAA;IAEhC,EAAA,EAAA,MAAA;IACC,UAAA,EAAA,MAAA;EAAa,CAAA;AAQtB,CAAA;AAAuC,KAgB3B,kBAAA,GAhB2B;WAC/B,EAAA,MAAA;QACG,CAAA,EAAA,MAAA;EAAsC,OAAA,EAiBtC,uCAjBsC;AAGjD,CAAA;AAA0C,KAiB9B,qBAAA,GAjB8B;UAElC,EAAA,OAAA;MACC,EAgBD,UAhBC;EAAa,KAAA,EAiBb,aAjBa;AAQtB,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@plainkey/types",
|
|
3
|
+
"version": "0.2.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
|
+
}
|