@proveanything/smartlinks 1.0.49 → 1.0.51
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/API_SUMMARY.md +58 -1
- package/dist/api/authKit.d.ts +8 -1
- package/dist/api/authKit.js +37 -0
- package/dist/types/authKit.d.ts +24 -0
- package/package.json +1 -1
package/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.51 | Generated: 2025-11-23T12:27:09.228Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -161,6 +161,37 @@ interface AuthKitUser {
|
|
|
161
161
|
}
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
+
**UserProfile** (interface)
|
|
165
|
+
```typescript
|
|
166
|
+
interface UserProfile {
|
|
167
|
+
uid: string
|
|
168
|
+
email?: string
|
|
169
|
+
displayName?: string | null
|
|
170
|
+
phoneNumber?: string | null
|
|
171
|
+
photoURL?: string | null
|
|
172
|
+
emailVerified?: boolean
|
|
173
|
+
accountData?: Record<string, any>
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**ProfileUpdateData** (interface)
|
|
178
|
+
```typescript
|
|
179
|
+
interface ProfileUpdateData {
|
|
180
|
+
displayName?: string
|
|
181
|
+
photoURL?: string
|
|
182
|
+
accountData?: Record<string, any>
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**SuccessResponse** (interface)
|
|
187
|
+
```typescript
|
|
188
|
+
interface SuccessResponse {
|
|
189
|
+
success: boolean
|
|
190
|
+
message?: string
|
|
191
|
+
token?: string // some flows may return a refreshed token
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
164
195
|
**AuthLoginResponse** (interface)
|
|
165
196
|
```typescript
|
|
166
197
|
interface AuthLoginResponse {
|
|
@@ -168,6 +199,9 @@ interface AuthLoginResponse {
|
|
|
168
199
|
user: AuthKitUser
|
|
169
200
|
accountData?: Record<string, any>
|
|
170
201
|
emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login'
|
|
202
|
+
requiresEmailVerification?: boolean // True if email verification is required but not yet completed
|
|
203
|
+
emailVerificationDeadline?: number // Unix timestamp - for 'immediate' mode grace period deadline
|
|
204
|
+
accountLocked?: boolean // True if account is locked due to expired verification deadline
|
|
171
205
|
}
|
|
172
206
|
```
|
|
173
207
|
|
|
@@ -236,6 +270,8 @@ interface EmailVerifyTokenResponse {
|
|
|
236
270
|
message: string
|
|
237
271
|
token?: string
|
|
238
272
|
user?: AuthKitUser
|
|
273
|
+
accountData?: Record<string, any>
|
|
274
|
+
emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login'
|
|
239
275
|
}
|
|
240
276
|
```
|
|
241
277
|
|
|
@@ -817,6 +853,27 @@ Verify phone verification code (public).
|
|
|
817
853
|
**resendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
|
|
818
854
|
Verify phone verification code (public).
|
|
819
855
|
|
|
856
|
+
**getProfile**(clientId: string) → `Promise<UserProfile>`
|
|
857
|
+
Verify phone verification code (public).
|
|
858
|
+
|
|
859
|
+
**updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UserProfile>`
|
|
860
|
+
Verify phone verification code (public).
|
|
861
|
+
|
|
862
|
+
**changePassword**(clientId: string, currentPassword: string, newPassword: string) → `Promise<SuccessResponse>`
|
|
863
|
+
Verify phone verification code (public).
|
|
864
|
+
|
|
865
|
+
**changeEmail**(clientId: string, newEmail: string, password: string, redirectUrl: string) → `Promise<SuccessResponse>`
|
|
866
|
+
Verify phone verification code (public).
|
|
867
|
+
|
|
868
|
+
**verifyEmailChange**(clientId: string, token: string) → `Promise<SuccessResponse>`
|
|
869
|
+
Verify phone verification code (public).
|
|
870
|
+
|
|
871
|
+
**updatePhone**(clientId: string, phoneNumber: string, verificationCode: string) → `Promise<SuccessResponse>`
|
|
872
|
+
Verify phone verification code (public).
|
|
873
|
+
|
|
874
|
+
**deleteAccount**(clientId: string, password: string, confirmText: string) → `Promise<SuccessResponse>`
|
|
875
|
+
Verify phone verification code (public).
|
|
876
|
+
|
|
820
877
|
**load**(authKitId: string) → `Promise<AuthKitConfig>`
|
|
821
878
|
Verify phone verification code (public).
|
|
822
879
|
|
package/dist/api/authKit.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthLoginResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig, MagicLinkSendResponse, MagicLinkVerifyResponse } from "../types/authKit";
|
|
1
|
+
import type { AuthLoginResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig, MagicLinkSendResponse, MagicLinkVerifyResponse, UserProfile, ProfileUpdateData, SuccessResponse } from "../types/authKit";
|
|
2
2
|
/**
|
|
3
3
|
* Namespace containing helper functions for the new AuthKit API.
|
|
4
4
|
* Legacy collection-based authKit helpers retained (marked as *Legacy*).
|
|
@@ -47,6 +47,13 @@ export declare namespace authKit {
|
|
|
47
47
|
redirectUrl?: string;
|
|
48
48
|
clientName?: string;
|
|
49
49
|
}): Promise<EmailVerificationActionResponse>;
|
|
50
|
+
function getProfile(clientId: string): Promise<UserProfile>;
|
|
51
|
+
function updateProfile(clientId: string, data: ProfileUpdateData): Promise<UserProfile>;
|
|
52
|
+
function changePassword(clientId: string, currentPassword: string, newPassword: string): Promise<SuccessResponse>;
|
|
53
|
+
function changeEmail(clientId: string, newEmail: string, password: string, redirectUrl: string): Promise<SuccessResponse>;
|
|
54
|
+
function verifyEmailChange(clientId: string, token: string): Promise<SuccessResponse>;
|
|
55
|
+
function updatePhone(clientId: string, phoneNumber: string, verificationCode: string): Promise<SuccessResponse>;
|
|
56
|
+
function deleteAccount(clientId: string, password: string, confirmText: string): Promise<SuccessResponse>;
|
|
50
57
|
function load(authKitId: string): Promise<AuthKitConfig>;
|
|
51
58
|
function get(collectionId: string, authKitId: string): Promise<AuthKitConfig>;
|
|
52
59
|
function list(collectionId: string, admin?: boolean): Promise<AuthKitConfig[]>;
|
package/dist/api/authKit.js
CHANGED
|
@@ -76,6 +76,43 @@ export var authKit;
|
|
|
76
76
|
return post(`/authkit/${encodeURIComponent(clientId)}/auth/resend-verification`, data);
|
|
77
77
|
}
|
|
78
78
|
authKit.resendEmailVerification = resendEmailVerification;
|
|
79
|
+
/* ===================================
|
|
80
|
+
* Account Management (Authenticated)
|
|
81
|
+
* =================================== */
|
|
82
|
+
async function getProfile(clientId) {
|
|
83
|
+
return request(`/authkit/${encodeURIComponent(clientId)}/account/profile`);
|
|
84
|
+
}
|
|
85
|
+
authKit.getProfile = getProfile;
|
|
86
|
+
async function updateProfile(clientId, data) {
|
|
87
|
+
return post(`/authkit/${encodeURIComponent(clientId)}/account/update-profile`, data);
|
|
88
|
+
}
|
|
89
|
+
authKit.updateProfile = updateProfile;
|
|
90
|
+
async function changePassword(clientId, currentPassword, newPassword) {
|
|
91
|
+
return post(`/authkit/${encodeURIComponent(clientId)}/account/change-password`, { currentPassword, newPassword });
|
|
92
|
+
}
|
|
93
|
+
authKit.changePassword = changePassword;
|
|
94
|
+
async function changeEmail(clientId, newEmail, password, redirectUrl) {
|
|
95
|
+
return post(`/authkit/${encodeURIComponent(clientId)}/account/change-email`, { newEmail, password, redirectUrl });
|
|
96
|
+
}
|
|
97
|
+
authKit.changeEmail = changeEmail;
|
|
98
|
+
async function verifyEmailChange(clientId, token) {
|
|
99
|
+
const res = await post(`/authkit/${encodeURIComponent(clientId)}/account/verify-email-change`, { token });
|
|
100
|
+
if (res.token)
|
|
101
|
+
setBearerToken(res.token);
|
|
102
|
+
return res;
|
|
103
|
+
}
|
|
104
|
+
authKit.verifyEmailChange = verifyEmailChange;
|
|
105
|
+
async function updatePhone(clientId, phoneNumber, verificationCode) {
|
|
106
|
+
return post(`/authkit/${encodeURIComponent(clientId)}/account/update-phone`, { phoneNumber, verificationCode });
|
|
107
|
+
}
|
|
108
|
+
authKit.updatePhone = updatePhone;
|
|
109
|
+
async function deleteAccount(clientId, password, confirmText) {
|
|
110
|
+
// DELETE with body using requestWithOptions since del() doesn't send body
|
|
111
|
+
const path = `/authkit/${encodeURIComponent(clientId)}/account/delete`;
|
|
112
|
+
const res = await post(path, { password, confirmText }); // If backend truly requires DELETE, switch to requestWithOptions
|
|
113
|
+
return res;
|
|
114
|
+
}
|
|
115
|
+
authKit.deleteAccount = deleteAccount;
|
|
79
116
|
/* ===================================
|
|
80
117
|
* Collection-based AuthKit
|
|
81
118
|
* =================================== */
|
package/dist/types/authKit.d.ts
CHANGED
|
@@ -7,11 +7,33 @@ export interface AuthKitUser {
|
|
|
7
7
|
emailVerified?: boolean;
|
|
8
8
|
accountData?: Record<string, any>;
|
|
9
9
|
}
|
|
10
|
+
export interface UserProfile {
|
|
11
|
+
uid: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
displayName?: string | null;
|
|
14
|
+
phoneNumber?: string | null;
|
|
15
|
+
photoURL?: string | null;
|
|
16
|
+
emailVerified?: boolean;
|
|
17
|
+
accountData?: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
export interface ProfileUpdateData {
|
|
20
|
+
displayName?: string;
|
|
21
|
+
photoURL?: string;
|
|
22
|
+
accountData?: Record<string, any>;
|
|
23
|
+
}
|
|
24
|
+
export interface SuccessResponse {
|
|
25
|
+
success: boolean;
|
|
26
|
+
message?: string;
|
|
27
|
+
token?: string;
|
|
28
|
+
}
|
|
10
29
|
export interface AuthLoginResponse {
|
|
11
30
|
token?: string;
|
|
12
31
|
user: AuthKitUser;
|
|
13
32
|
accountData?: Record<string, any>;
|
|
14
33
|
emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login';
|
|
34
|
+
requiresEmailVerification?: boolean;
|
|
35
|
+
emailVerificationDeadline?: number;
|
|
36
|
+
accountLocked?: boolean;
|
|
15
37
|
}
|
|
16
38
|
export interface MagicLinkSendResponse {
|
|
17
39
|
success: boolean;
|
|
@@ -50,6 +72,8 @@ export interface EmailVerifyTokenResponse {
|
|
|
50
72
|
message: string;
|
|
51
73
|
token?: string;
|
|
52
74
|
user?: AuthKitUser;
|
|
75
|
+
accountData?: Record<string, any>;
|
|
76
|
+
emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login';
|
|
53
77
|
}
|
|
54
78
|
export interface AuthKitBrandingConfig {
|
|
55
79
|
logoUrl?: string;
|