@tekcify/auth-backend 2.2.3 → 2.2.4
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/user-profile.d.ts +0 -48
- package/dist/user-profile.d.ts.map +1 -1
- package/dist/user-profile.js +0 -41
- package/package.json +1 -1
package/dist/user-profile.d.ts
CHANGED
|
@@ -15,52 +15,4 @@ export interface UploadResponse {
|
|
|
15
15
|
export declare function getUserProfile(accessToken: string): Promise<UserProfile>;
|
|
16
16
|
export declare function updateUserProfile(accessToken: string, data: UpdateProfileDto): Promise<UserProfile>;
|
|
17
17
|
export declare function uploadProfilePicture(accessToken: string, file: Blob | File, fileName?: string): Promise<UploadResponse>;
|
|
18
|
-
export interface ExportedUserData {
|
|
19
|
-
profile: {
|
|
20
|
-
email: string;
|
|
21
|
-
firstName: string | null;
|
|
22
|
-
lastName: string | null;
|
|
23
|
-
avatarUrl: string | null;
|
|
24
|
-
mfaEnabled: boolean;
|
|
25
|
-
role: string;
|
|
26
|
-
emailVerifiedAt: string | null;
|
|
27
|
-
lastLoginAt: string | null;
|
|
28
|
-
createdAt: string;
|
|
29
|
-
};
|
|
30
|
-
connectedApps: Array<{
|
|
31
|
-
applicationName: string;
|
|
32
|
-
scopes: string[];
|
|
33
|
-
consentedAt: string;
|
|
34
|
-
}>;
|
|
35
|
-
socialProviders: Array<{
|
|
36
|
-
provider: string;
|
|
37
|
-
email: string;
|
|
38
|
-
connectedAt: string;
|
|
39
|
-
}>;
|
|
40
|
-
passkeys: Array<{
|
|
41
|
-
name: string | null;
|
|
42
|
-
deviceType: string | null;
|
|
43
|
-
createdAt: string;
|
|
44
|
-
lastUsedAt: string | null;
|
|
45
|
-
}>;
|
|
46
|
-
securityActivity: Array<{
|
|
47
|
-
activityType: string;
|
|
48
|
-
ipAddress: string | null;
|
|
49
|
-
location: string | null;
|
|
50
|
-
deviceType: string | null;
|
|
51
|
-
success: boolean | null;
|
|
52
|
-
createdAt: string;
|
|
53
|
-
}>;
|
|
54
|
-
exportedAt: string;
|
|
55
|
-
}
|
|
56
|
-
export interface DeleteAccountDto {
|
|
57
|
-
password: string;
|
|
58
|
-
mfaCode?: string;
|
|
59
|
-
confirmDelete: true;
|
|
60
|
-
}
|
|
61
|
-
export interface DeleteAccountResponse {
|
|
62
|
-
message: string;
|
|
63
|
-
}
|
|
64
|
-
export declare function exportUserData(accessToken: string): Promise<ExportedUserData>;
|
|
65
|
-
export declare function deleteUserAccount(accessToken: string, data: DeleteAccountDto): Promise<DeleteAccountResponse>;
|
|
66
18
|
//# sourceMappingURL=user-profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../src/user-profile.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,WAAW,CAAC,CAqBtB;AAED,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,WAAW,CAAC,CAsBtB;AAED,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,CAAC,CA6BzB
|
|
1
|
+
{"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../src/user-profile.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,WAAW,CAAC,CAqBtB;AAED,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,WAAW,CAAC,CAsBtB;AAED,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,CAAC,CA6BzB"}
|
package/dist/user-profile.js
CHANGED
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getUserProfile = getUserProfile;
|
|
4
4
|
exports.updateUserProfile = updateUserProfile;
|
|
5
5
|
exports.uploadProfilePicture = uploadProfilePicture;
|
|
6
|
-
exports.exportUserData = exportUserData;
|
|
7
|
-
exports.deleteUserAccount = deleteUserAccount;
|
|
8
6
|
const AUTH_SERVER_URL = 'https://auth-api.tekcify.com';
|
|
9
7
|
async function getUserProfile(accessToken) {
|
|
10
8
|
const response = await fetch(`${AUTH_SERVER_URL}/api/user/profile`, {
|
|
@@ -71,42 +69,3 @@ async function uploadProfilePicture(accessToken, file, fileName) {
|
|
|
71
69
|
}
|
|
72
70
|
return response.json();
|
|
73
71
|
}
|
|
74
|
-
async function exportUserData(accessToken) {
|
|
75
|
-
const response = await fetch(`${AUTH_SERVER_URL}/api/user/export-data`, {
|
|
76
|
-
method: 'GET',
|
|
77
|
-
headers: {
|
|
78
|
-
Authorization: `Bearer ${accessToken}`,
|
|
79
|
-
'Content-Type': 'application/json',
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
if (!response.ok) {
|
|
83
|
-
const error = (await response
|
|
84
|
-
.json()
|
|
85
|
-
.catch(() => ({ message: response.statusText })));
|
|
86
|
-
const errorMessage = error?.message && typeof error.message === 'string' && error.message.trim()
|
|
87
|
-
? error.message
|
|
88
|
-
: `Failed to export user data: ${response.statusText} (Status: ${response.status})`;
|
|
89
|
-
throw new Error(errorMessage);
|
|
90
|
-
}
|
|
91
|
-
return response.json();
|
|
92
|
-
}
|
|
93
|
-
async function deleteUserAccount(accessToken, data) {
|
|
94
|
-
const response = await fetch(`${AUTH_SERVER_URL}/api/user/account`, {
|
|
95
|
-
method: 'DELETE',
|
|
96
|
-
headers: {
|
|
97
|
-
Authorization: `Bearer ${accessToken}`,
|
|
98
|
-
'Content-Type': 'application/json',
|
|
99
|
-
},
|
|
100
|
-
body: JSON.stringify(data),
|
|
101
|
-
});
|
|
102
|
-
if (!response.ok) {
|
|
103
|
-
const error = (await response
|
|
104
|
-
.json()
|
|
105
|
-
.catch(() => ({ message: response.statusText })));
|
|
106
|
-
const errorMessage = error?.message && typeof error.message === 'string' && error.message.trim()
|
|
107
|
-
? error.message
|
|
108
|
-
: `Failed to delete account: ${response.statusText} (Status: ${response.status})`;
|
|
109
|
-
throw new Error(errorMessage);
|
|
110
|
-
}
|
|
111
|
-
return response.json();
|
|
112
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tekcify/auth-backend",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "Backend authentication helpers for Tekcify Auth. Provides middleware, guards, and utilities for validating JWT tokens and protecting API routes in NestJS and Express applications.",
|
|
5
5
|
"author": "Tekcify",
|
|
6
6
|
"main": "./dist/index.js",
|