@axium/storage 0.3.8 → 0.3.10

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/plugin.js CHANGED
@@ -41,9 +41,8 @@ async function db_init(opt) {
41
41
  }
42
42
  async function db_wipe(opt) {
43
43
  start('Removing data from user storage');
44
- await database.deleteFrom('storage').execute();
44
+ await database.deleteFrom('storage').execute().then(done);
45
45
  await acl.wipeTable('storage');
46
- done();
47
46
  }
48
47
  async function remove(opt) {
49
48
  start('Dropping table storage');
@@ -56,7 +55,7 @@ async function clean(opt) {
56
55
  const nDaysAgo = new Date(Date.now() - 86400000 * config.storage.trash_duration);
57
56
  await database
58
57
  .deleteFrom('storage')
59
- .where('trashedAt', 'is not', null)
58
+ .where('trashedAt', '!=', null)
60
59
  .where('trashedAt', '<', nDaysAgo)
61
60
  .executeTakeFirstOrThrow()
62
61
  .then(done);
package/dist/server.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Permission } from '@axium/core/access';
2
2
  import { checkAuthForItem, checkAuthForUser, getSessionAndUser } from '@axium/server/auth';
3
3
  import { addConfigDefaults, config } from '@axium/server/config';
4
- import { connect, database, expectedTypes } from '@axium/server/database';
4
+ import { database, expectedTypes } from '@axium/server/database';
5
5
  import { dirs } from '@axium/server/io';
6
6
  import { getToken, parseBody, withError } from '@axium/server/requests';
7
7
  import { addRoute } from '@axium/server/routes';
@@ -57,7 +57,6 @@ export function parseItem(item) {
57
57
  * Returns the current usage of the storage for a user in bytes.
58
58
  */
59
59
  export async function currentUsage(userId) {
60
- connect();
61
60
  const result = await database
62
61
  .selectFrom('storage')
63
62
  .where('userId', '=', userId)
@@ -67,7 +66,6 @@ export async function currentUsage(userId) {
67
66
  return result;
68
67
  }
69
68
  export async function get(itemId) {
70
- connect();
71
69
  const result = await database
72
70
  .selectFrom('storage')
73
71
  .where('id', '=', itemId)
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
2
  import { getDirectoryMetadata, type _Sidebar } from '@axium/storage/client';
3
3
  import type { StorageItemMetadata } from '@axium/storage/common';
4
+ import { ItemSelection } from '@axium/storage/selection';
4
5
  import { setContext } from 'svelte';
5
- import { ItemSelection } from '../src/selection.js';
6
6
  import StorageSidebarItem from './StorageSidebarItem.svelte';
7
7
 
8
8
  const { root }: { root: string } = $props();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/storage",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "description": "User file storage for Axium",
6
6
  "funding": {