@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 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
- } & Record<string, any>;
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.from(plugins.values()).map(p => omit(p, '_hooks'));
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/server",
3
- "version": "0.28.5",
3
+ "version": "0.28.6",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -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 <span class="version">{data.version}</span></p>
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}<span class="version">{plugin.version}</span></h3>
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._loadedBy}
23
+ {#if plugin.loadedBy}
22
24
  by
23
- <a class="path" href="/admin/config#{plugin._loadedBy}">{plugin._loadedBy}</a>
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>