@axium/client 0.9.1 → 0.9.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/assets/styles.css +11 -1
- package/dist/cli/config.js +11 -2
- package/dist/user.js +3 -1
- package/package.json +1 -1
package/assets/styles.css
CHANGED
|
@@ -172,7 +172,17 @@ a:has(button, div) {
|
|
|
172
172
|
font-family: monospace;
|
|
173
173
|
font-size: 0.9em;
|
|
174
174
|
color: #aaa;
|
|
175
|
-
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
h1,
|
|
178
|
+
h2,
|
|
179
|
+
h3,
|
|
180
|
+
h4,
|
|
181
|
+
h5,
|
|
182
|
+
h6 {
|
|
183
|
+
.version {
|
|
184
|
+
margin-left: 1em;
|
|
185
|
+
}
|
|
176
186
|
}
|
|
177
187
|
|
|
178
188
|
.version::before {
|
package/dist/cli/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as io from '@axium/core/node/io';
|
|
2
2
|
import { loadPlugin } from '@axium/core/node/plugins';
|
|
3
|
-
import { mkdirSync } from 'node:fs';
|
|
3
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { join } from 'node:path/posix';
|
|
6
6
|
import * as z from 'zod';
|
|
@@ -10,6 +10,8 @@ import { getCurrentSession } from '../user.js';
|
|
|
10
10
|
export const configDir = join(process.env.XDG_CONFIG_HOME || join(homedir(), '.config'), 'axium');
|
|
11
11
|
mkdirSync(configDir, { recursive: true });
|
|
12
12
|
const axcConfig = join(configDir, 'config.json');
|
|
13
|
+
if (!existsSync(axcConfig))
|
|
14
|
+
writeFileSync(axcConfig, '{}');
|
|
13
15
|
export const cacheDir = join(process.env.XDG_CACHE_HOME || join(homedir(), '.cache'), 'axium');
|
|
14
16
|
mkdirSync(cacheDir, { recursive: true });
|
|
15
17
|
export function session() {
|
|
@@ -30,7 +32,14 @@ export async function loadConfig(safe) {
|
|
|
30
32
|
await loadPlugin('client', plugin, axcConfig, safe);
|
|
31
33
|
}
|
|
32
34
|
catch (e) {
|
|
33
|
-
io.warn('Failed to load config: ' +
|
|
35
|
+
io.warn('Failed to load config: ' +
|
|
36
|
+
(e instanceof z.core.$ZodError
|
|
37
|
+
? z.prettifyError(e)
|
|
38
|
+
: e instanceof Error
|
|
39
|
+
? io._debugOutput
|
|
40
|
+
? e.stack
|
|
41
|
+
: e.message
|
|
42
|
+
: String(e)));
|
|
34
43
|
}
|
|
35
44
|
}
|
|
36
45
|
export function saveConfig() {
|
package/dist/user.js
CHANGED
|
@@ -141,7 +141,9 @@ export async function createPasskey(userId) {
|
|
|
141
141
|
_checkId(userId);
|
|
142
142
|
const options = await fetchAPI('OPTIONS', 'users/:id/passkeys', {}, userId);
|
|
143
143
|
const response = await startRegistration({ optionsJSON: options });
|
|
144
|
-
|
|
144
|
+
const passkey = await fetchAPI('PUT', 'users/:id/passkeys', response, userId);
|
|
145
|
+
passkey.createdAt = new Date(passkey.createdAt);
|
|
146
|
+
return passkey;
|
|
145
147
|
}
|
|
146
148
|
export async function updatePasskey(passkeyId, data) {
|
|
147
149
|
return await fetchAPI('PATCH', 'passkeys/:id', data, passkeyId);
|