@axium/client 0.1.1 → 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.
Files changed (2) hide show
  1. package/dist/user.js +7 -1
  2. package/package.json +3 -3
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
- return await fetchAPI('GET', 'users/:id', {}, userId);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/client",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "author": "James Prevett <jp@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -30,10 +30,10 @@
30
30
  "peerDependencies": {
31
31
  "@axium/core": ">=0.3.0",
32
32
  "utilium": "^2.3.8",
33
- "zod": "^3.25.61"
33
+ "zod": "^3.25.76"
34
34
  },
35
35
  "dependencies": {
36
36
  "@simplewebauthn/browser": "^13.1.0",
37
- "commander": "^13.1.0"
37
+ "commander": "^14.0.0"
38
38
  }
39
39
  }