@plainkey/types 0.16.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.ts +143 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +0 -0
- package/package.json +31 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
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
|
|
4
|
+
type UserIdentifier = {
|
|
5
|
+
userId?: string;
|
|
6
|
+
userName?: string;
|
|
7
|
+
};
|
|
8
|
+
type UserInfo = {
|
|
9
|
+
id: string;
|
|
10
|
+
userName?: string;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/browser/requests.d.ts
|
|
14
|
+
type UserRegisterBeginRequest = {
|
|
15
|
+
userName?: string;
|
|
16
|
+
};
|
|
17
|
+
type UserRegisterCompleteRequest = {
|
|
18
|
+
userId: string;
|
|
19
|
+
credential: RegistrationResponseJSON$1;
|
|
20
|
+
};
|
|
21
|
+
type UserCredentialBeginRequest = {
|
|
22
|
+
authenticationToken: string;
|
|
23
|
+
userName?: string;
|
|
24
|
+
};
|
|
25
|
+
type UserCredentialCompleteRequest = {
|
|
26
|
+
authenticationToken: string;
|
|
27
|
+
credential: RegistrationResponseJSON$1;
|
|
28
|
+
};
|
|
29
|
+
type CredentialLabelUpdateRequest = {
|
|
30
|
+
authenticationToken: string;
|
|
31
|
+
label: string;
|
|
32
|
+
};
|
|
33
|
+
type LoginBeginRequest = {
|
|
34
|
+
userIdentifier?: UserIdentifier;
|
|
35
|
+
};
|
|
36
|
+
type LoginCompleteRequest = {
|
|
37
|
+
loginSessionId: string;
|
|
38
|
+
authenticationResponse: AuthenticationResponseJSON$1;
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/browser/responses.d.ts
|
|
42
|
+
type ErrorResponse = {
|
|
43
|
+
error: string;
|
|
44
|
+
};
|
|
45
|
+
type AuthenticationToken = {
|
|
46
|
+
token: string;
|
|
47
|
+
expiresAt: number;
|
|
48
|
+
};
|
|
49
|
+
type UserRegisterBeginResponse = {
|
|
50
|
+
userId: string;
|
|
51
|
+
options: PublicKeyCredentialCreationOptionsJSON$1;
|
|
52
|
+
};
|
|
53
|
+
type UserRegisterCompleteResponse = {
|
|
54
|
+
success: boolean;
|
|
55
|
+
userId: string;
|
|
56
|
+
authenticationToken: AuthenticationToken;
|
|
57
|
+
credentialId: string;
|
|
58
|
+
};
|
|
59
|
+
type UserCredentialBeginResponse = {
|
|
60
|
+
options: PublicKeyCredentialCreationOptionsJSON$1;
|
|
61
|
+
};
|
|
62
|
+
type UserCredentialCompleteResponse = {
|
|
63
|
+
success: boolean;
|
|
64
|
+
authenticationToken: AuthenticationToken;
|
|
65
|
+
credentialId: string;
|
|
66
|
+
};
|
|
67
|
+
type AuthenticationBeginResponse = {
|
|
68
|
+
projectId: string;
|
|
69
|
+
options: PublicKeyCredentialRequestOptionsJSON$1;
|
|
70
|
+
loginSession: {
|
|
71
|
+
id: string;
|
|
72
|
+
expiresAt: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
type AuthenticationCompleteResponse = {
|
|
76
|
+
authenticationToken: AuthenticationToken;
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/browser/result.d.ts
|
|
80
|
+
interface AuthenticateResult {
|
|
81
|
+
success: boolean;
|
|
82
|
+
data?: {
|
|
83
|
+
authenticationToken: AuthenticationToken;
|
|
84
|
+
};
|
|
85
|
+
error?: {
|
|
86
|
+
message: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
interface CreateUserWithPasskeyResult {
|
|
90
|
+
success: boolean;
|
|
91
|
+
data?: {
|
|
92
|
+
userId: string;
|
|
93
|
+
credentialId: string;
|
|
94
|
+
authenticationToken: AuthenticationToken;
|
|
95
|
+
};
|
|
96
|
+
error?: {
|
|
97
|
+
message: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
interface AddPasskeyResult {
|
|
101
|
+
success: boolean;
|
|
102
|
+
data?: {
|
|
103
|
+
credentialId: string;
|
|
104
|
+
authenticationToken: AuthenticationToken;
|
|
105
|
+
};
|
|
106
|
+
error?: {
|
|
107
|
+
message: string;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
interface UpdatePasskeyLabelResult {
|
|
111
|
+
success: boolean;
|
|
112
|
+
error?: {
|
|
113
|
+
message: string;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/server/requests.d.ts
|
|
118
|
+
type VerifyAuthTokenRequest = {
|
|
119
|
+
token: string;
|
|
120
|
+
};
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/server/responses.d.ts
|
|
123
|
+
type AccessTokenResponse = {
|
|
124
|
+
access_token: string;
|
|
125
|
+
token_type: string;
|
|
126
|
+
expires_in: number;
|
|
127
|
+
};
|
|
128
|
+
type VerifyAuthenticationTokenResponse = {
|
|
129
|
+
valid: boolean;
|
|
130
|
+
error: string;
|
|
131
|
+
expiresAt: string;
|
|
132
|
+
projectId: string;
|
|
133
|
+
userId: string;
|
|
134
|
+
payload: Record<string, unknown>;
|
|
135
|
+
};
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/server/result.d.ts
|
|
138
|
+
type VerifyAuthenticationTokenResult = {
|
|
139
|
+
userId: string;
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
export { AccessTokenResponse, AddPasskeyResult, AuthenticateResult, AuthenticationBeginResponse, AuthenticationCompleteResponse, type AuthenticationResponseJSON, AuthenticationToken, CreateUserWithPasskeyResult, CredentialLabelUpdateRequest, ErrorResponse, LoginBeginRequest, LoginCompleteRequest, type PublicKeyCredentialCreationOptionsJSON, type PublicKeyCredentialRequestOptionsJSON, type RegistrationResponseJSON, UpdatePasskeyLabelResult, UserCredentialBeginRequest, UserCredentialBeginResponse, UserCredentialCompleteRequest, UserCredentialCompleteResponse, UserIdentifier, UserInfo, UserRegisterBeginRequest, UserRegisterBeginResponse, UserRegisterCompleteRequest, UserRegisterCompleteResponse, VerifyAuthTokenRequest, VerifyAuthenticationTokenResponse, VerifyAuthenticationTokenResult };
|
|
143
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/common.ts","../src/browser/requests.ts","../src/browser/responses.ts","../src/browser/result.ts","../src/server/requests.ts","../src/server/responses.ts","../src/server/result.ts"],"sourcesContent":[],"mappings":";;;KAAY,cAAA;;;AAAZ,CAAA;AAKY,KAAA,QAAA,GAAQ;;;;;;KCDR,wBAAA;EDJA,QAAA,CAAA,EAAA,MAAc;AAK1B,CAAA;KCGY,2BAAA;;cAEE;AANd,CAAA;AAIY,KAMA,0BAAA,GAN2B;EAM3B,mBAAA,EAAA,MAAA;EAKA,QAAA,CAAA,EAAA,MAAA;AAMZ,CAAA;AAMY,KAZA,6BAAA,GAaO;EAGP,mBAAA,EAAA,MAAoB;cAdlB;;KAIF,4BAAA;ECnBA,mBAAa,EAAA,MAAA;EAKb,KAAA,EAAA,MAAA;AAMZ,CAAA;AAKY,KDSA,iBAAA,GCTA;EAQA,cAAA,CAAA,EDEO,cCFoB;AAIvC,CAAA;AAOY,KDNA,oBAAA,GCM2B;EAS3B,cAAA,EAAA,MAAA;0BDbc;;;;KC/Bd,aAAA;;AFNZ,CAAA;AAKY,KEMA,mBAAA,GFNQ;;;;ACDR,KCaA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|
package/dist/index.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plainkey/types",
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"description": "Shared TypeScript definitions and interfaces for PlainKey SDKs",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./dist/index.js",
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsdown --clean --config tsdown.config.ts",
|
|
19
|
+
"prepare": "npm run build",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@simplewebauthn/browser": "^13.2.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"tsdown": "^0.15.5"
|
|
30
|
+
}
|
|
31
|
+
}
|