@axium/server 0.28.6 → 0.29.0
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/api/admin.js +10 -4
- package/dist/api/metadata.js +2 -4
- package/dist/io.d.ts +2 -0
- package/dist/io.js +10 -0
- package/package.json +2 -2
- package/routes/admin/+page.svelte +5 -1
package/dist/api/admin.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AuditFilter, Severity } from '@axium/core';
|
|
2
|
-
import { getVersionInfo
|
|
2
|
+
import { getVersionInfo } from '@axium/core/packages';
|
|
3
|
+
import { plugins } from '@axium/core/plugins';
|
|
3
4
|
import { jsonArrayFrom, jsonObjectFrom } from 'kysely/helpers/postgres';
|
|
4
5
|
import { omit } from 'utilium';
|
|
5
6
|
import * as z from 'zod';
|
|
6
|
-
import pkg from '../../package.json' with { type: 'json' };
|
|
7
7
|
import { audit, events, getEvents } from '../audit.js';
|
|
8
8
|
import { requireSession } from '../auth.js';
|
|
9
9
|
import { config } from '../config.js';
|
|
@@ -30,7 +30,11 @@ addRoute({
|
|
|
30
30
|
auditEvents,
|
|
31
31
|
configFiles: config.files.size,
|
|
32
32
|
plugins: plugins.size,
|
|
33
|
-
|
|
33
|
+
versions: {
|
|
34
|
+
server: await getVersionInfo('@axium/server'),
|
|
35
|
+
core: await getVersionInfo('@axium/core'),
|
|
36
|
+
client: await getVersionInfo('@axium/client'),
|
|
37
|
+
},
|
|
34
38
|
};
|
|
35
39
|
},
|
|
36
40
|
});
|
|
@@ -38,7 +42,9 @@ addRoute({
|
|
|
38
42
|
path: '/api/admin/plugins',
|
|
39
43
|
async GET(req) {
|
|
40
44
|
await assertAdmin(this, req);
|
|
41
|
-
return await Array.fromAsync(plugins
|
|
45
|
+
return await Array.fromAsync(plugins
|
|
46
|
+
.values()
|
|
47
|
+
.map(async (p) => Object.assign(omit(p, '_hooks', '_client'), p.update_checks ? await getVersionInfo(p.specifier, p.loadedBy) : { latest: null })));
|
|
42
48
|
},
|
|
43
49
|
});
|
|
44
50
|
addRoute({
|
package/dist/api/metadata.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { apps } from '@axium/core';
|
|
2
|
-
import { plugins } from '@axium/core/plugins';
|
|
3
2
|
import { requestMethods } from '@axium/core/requests';
|
|
4
|
-
import pkg from '../../package.json' with { type: 'json' };
|
|
5
3
|
import { requireSession } from '../auth.js';
|
|
6
4
|
import { config } from '../config.js';
|
|
5
|
+
import { getAllVersions } from '../io.js';
|
|
7
6
|
import { error } from '../requests.js';
|
|
8
7
|
import { addRoute, routes } from '../routes.js';
|
|
9
8
|
addRoute({
|
|
@@ -15,7 +14,7 @@ addRoute({
|
|
|
15
14
|
error(403, 'User is not an administrator');
|
|
16
15
|
}
|
|
17
16
|
return {
|
|
18
|
-
|
|
17
|
+
versions: await getAllVersions(),
|
|
19
18
|
routes: Object.fromEntries(routes
|
|
20
19
|
.entries()
|
|
21
20
|
.filter(([path]) => path.startsWith('/api/'))
|
|
@@ -26,7 +25,6 @@ addRoute({
|
|
|
26
25
|
methods: requestMethods.filter(m => m in route),
|
|
27
26
|
},
|
|
28
27
|
])),
|
|
29
|
-
plugins: Object.fromEntries(plugins.values().map(plugin => [plugin.name, plugin.version])),
|
|
30
28
|
};
|
|
31
29
|
},
|
|
32
30
|
});
|
package/dist/io.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PackageVersionInfo } from '@axium/core/packages';
|
|
1
2
|
import { Logger } from 'logzen';
|
|
2
3
|
export declare const systemDir = "/etc/axium";
|
|
3
4
|
export declare const dirs: string[];
|
|
@@ -23,3 +24,4 @@ export interface PortOptions {
|
|
|
23
24
|
* If the origin has a port, passkeys do not work correctly with some password managers.
|
|
24
25
|
*/
|
|
25
26
|
export declare function restrictedPorts(opt: PortOptions): Promise<void>;
|
|
27
|
+
export declare function getAllVersions(): Promise<PackageVersionInfo[]>;
|
package/dist/io.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as io from '@axium/core/node/io';
|
|
2
|
+
import { getVersionInfo } from '@axium/core/packages';
|
|
3
|
+
import { plugins } from '@axium/core/plugins';
|
|
2
4
|
import { Logger } from 'logzen';
|
|
3
5
|
import * as fs from 'node:fs';
|
|
4
6
|
import { dirname, join, resolve } from 'node:path/posix';
|
|
@@ -77,3 +79,11 @@ export async function restrictedPorts(opt) {
|
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
}
|
|
82
|
+
export async function getAllVersions() {
|
|
83
|
+
return await Array.fromAsync([
|
|
84
|
+
...plugins.values().map(p => getVersionInfo(p.specifier, p.loadedBy)),
|
|
85
|
+
getVersionInfo('@axium/server'),
|
|
86
|
+
getVersionInfo('@axium/core'),
|
|
87
|
+
getVersionInfo('@axium/client'),
|
|
88
|
+
]);
|
|
89
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev>",
|
|
5
5
|
"funding": {
|
|
6
6
|
"type": "individual",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@axium/client": ">=0.9.5",
|
|
51
|
-
"@axium/core": ">=0.
|
|
51
|
+
"@axium/core": ">=0.14.0",
|
|
52
52
|
"kysely": "^0.28.0",
|
|
53
53
|
"utilium": "^2.3.8",
|
|
54
54
|
"zod": "^4.0.5"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { Version } from '@axium/client/components';
|
|
3
3
|
import { Severity } from '@axium/core';
|
|
4
|
+
import { capitalize } from 'utilium';
|
|
4
5
|
|
|
5
6
|
const { data } = $props();
|
|
6
7
|
</script>
|
|
@@ -11,7 +12,10 @@
|
|
|
11
12
|
|
|
12
13
|
<h2>Administration</h2>
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
{#each ['server', 'core', 'client'] as name}
|
|
16
|
+
{@const info = data.versions[name]}
|
|
17
|
+
<p>Axium {capitalize(name)} <Version v={info.version} latest={info.latest} /></p>
|
|
18
|
+
{/each}
|
|
15
19
|
|
|
16
20
|
<h3><a href="/admin/users">Users</a></h3>
|
|
17
21
|
|