@axium/server 0.28.5 → 0.28.6
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/acl.d.ts +1 -1
- package/dist/api/admin.js +2 -2
- package/dist/auth.js +1 -0
- package/package.json +1 -1
- package/routes/admin/+page.svelte +2 -1
- package/routes/admin/plugins/+page.svelte +5 -3
package/dist/acl.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type Result<TB extends TableName> = AccessControlInternal & PermissionsFo
|
|
|
21
21
|
export type WithACL<TB extends TargetName> = kysely.Selectable<db.Schema[TB]> & {
|
|
22
22
|
userId: string;
|
|
23
23
|
acl: Result<`acl.${TB}`>[];
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
25
|
export interface ACLSelectionOptions {
|
|
26
26
|
/** If specified, files by user UUID */
|
|
27
27
|
user?: Pick<UserInternal, 'id' | 'roles' | 'tags'>;
|
package/dist/api/admin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuditFilter, Severity } from '@axium/core';
|
|
2
|
-
import { plugins } from '@axium/core/plugins';
|
|
2
|
+
import { getVersionInfo, plugins } from '@axium/core/plugins';
|
|
3
3
|
import { jsonArrayFrom, jsonObjectFrom } from 'kysely/helpers/postgres';
|
|
4
4
|
import { omit } from 'utilium';
|
|
5
5
|
import * as z from 'zod';
|
|
@@ -38,7 +38,7 @@ addRoute({
|
|
|
38
38
|
path: '/api/admin/plugins',
|
|
39
39
|
async GET(req) {
|
|
40
40
|
await assertAdmin(this, req);
|
|
41
|
-
return Array.
|
|
41
|
+
return await Array.fromAsync(plugins.values().map(async (p) => Object.assign(omit(p, '_hooks', '_client'), await getVersionInfo(p))));
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
44
|
addRoute({
|
package/dist/auth.js
CHANGED
|
@@ -120,6 +120,7 @@ export async function checkAuthForItem(request, itemType, itemId, permissions) {
|
|
|
120
120
|
error(401, 'Missing token');
|
|
121
121
|
const session = await getSessionAndUser(token).catch(() => null);
|
|
122
122
|
const { userId, user } = session ?? {};
|
|
123
|
+
// Note: we need to do casting because of TS limitations with generics
|
|
123
124
|
const item = await db
|
|
124
125
|
.selectFrom(itemType)
|
|
125
126
|
.selectAll()
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { Version } from '@axium/client/components';
|
|
2
3
|
import { Severity } from '@axium/core';
|
|
3
4
|
|
|
4
5
|
const { data } = $props();
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
|
|
11
12
|
<h2>Administration</h2>
|
|
12
13
|
|
|
13
|
-
<p>Axium Server <
|
|
14
|
+
<p>Axium Server <Version v={data.version} latest={data.latest} /></p>
|
|
14
15
|
|
|
15
16
|
<h3><a href="/admin/users">Users</a></h3>
|
|
16
17
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { Version } from '@axium/client/components';
|
|
3
|
+
|
|
2
4
|
const { data } = $props();
|
|
3
5
|
</script>
|
|
4
6
|
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
|
|
11
13
|
{#each data.plugins as plugin}
|
|
12
14
|
<div class="plugin">
|
|
13
|
-
<h3>{plugin.name}<
|
|
15
|
+
<h3>{plugin.name}<Version v={plugin.version} latest={plugin.latest} /></h3>
|
|
14
16
|
<p>
|
|
15
17
|
<strong>Loaded from</strong>
|
|
16
18
|
{#if plugin.path.endsWith('/package.json')}
|
|
@@ -18,9 +20,9 @@
|
|
|
18
20
|
{:else}
|
|
19
21
|
<span class="path">{plugin.path}</span>
|
|
20
22
|
{/if}
|
|
21
|
-
{#if plugin.
|
|
23
|
+
{#if plugin.loadedBy}
|
|
22
24
|
by
|
|
23
|
-
<a class="path" href="/admin/config#{plugin.
|
|
25
|
+
<a class="path" href="/admin/config#{plugin.loadedBy}">{plugin.loadedBy}</a>
|
|
24
26
|
{/if}
|
|
25
27
|
</p>
|
|
26
28
|
<p><strong>Author:</strong> {plugin.author}</p>
|