@axium/client 0.1.2 → 0.1.3
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.js +7 -1
- package/package.json +1 -1
package/dist/user.js
CHANGED
|
@@ -80,7 +80,10 @@ function _checkId(userId) {
|
|
|
80
80
|
}
|
|
81
81
|
export async function userInfo(userId) {
|
|
82
82
|
_checkId(userId);
|
|
83
|
-
|
|
83
|
+
const user = await fetchAPI('GET', 'users/:id', {}, userId);
|
|
84
|
+
user.registeredAt = new Date(user.registeredAt);
|
|
85
|
+
user.emailVerified = user.emailVerified ? new Date(user.emailVerified) : null;
|
|
86
|
+
return user;
|
|
84
87
|
}
|
|
85
88
|
export async function updateUser(userId, data) {
|
|
86
89
|
_checkId(userId);
|
|
@@ -88,6 +91,7 @@ export async function updateUser(userId, data) {
|
|
|
88
91
|
throw z.prettifyError(e);
|
|
89
92
|
});
|
|
90
93
|
const result = await fetchAPI('PATCH', 'users/:id', body, userId);
|
|
94
|
+
result.registeredAt = new Date(result.registeredAt);
|
|
91
95
|
if (result.emailVerified)
|
|
92
96
|
result.emailVerified = new Date(result.emailVerified);
|
|
93
97
|
return result;
|
|
@@ -95,6 +99,7 @@ export async function updateUser(userId, data) {
|
|
|
95
99
|
export async function fullUserInfo(userId) {
|
|
96
100
|
_checkId(userId);
|
|
97
101
|
const result = await fetchAPI('GET', 'users/:id/full', {}, userId);
|
|
102
|
+
result.registeredAt = new Date(result.registeredAt);
|
|
98
103
|
result.emailVerified = new Date(result.emailVerified);
|
|
99
104
|
return result;
|
|
100
105
|
}
|
|
@@ -104,6 +109,7 @@ export async function deleteUser(userId) {
|
|
|
104
109
|
const response = await startAuthentication({ optionsJSON: options });
|
|
105
110
|
await fetchAPI('POST', 'users/:id/auth', response, userId);
|
|
106
111
|
const result = await fetchAPI('DELETE', 'users/:id', response, userId);
|
|
112
|
+
result.registeredAt = new Date(result.registeredAt);
|
|
107
113
|
result.emailVerified = new Date(result.emailVerified);
|
|
108
114
|
return result;
|
|
109
115
|
}
|