@axium/storage 0.5.3 → 0.5.5
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/server.js +5 -5
- package/package.json +3 -2
- package/styles/list.css +49 -0
package/dist/server.js
CHANGED
|
@@ -157,7 +157,7 @@ addRoute({
|
|
|
157
157
|
const items = await database
|
|
158
158
|
.selectFrom('storage')
|
|
159
159
|
.where('parentId', '=', itemId)
|
|
160
|
-
.where('trashedAt', 'is
|
|
160
|
+
.where('trashedAt', 'is', null)
|
|
161
161
|
.selectAll()
|
|
162
162
|
.execute();
|
|
163
163
|
return items.map(parseItem);
|
|
@@ -326,7 +326,7 @@ addRoute({
|
|
|
326
326
|
const userId = event.params.id;
|
|
327
327
|
await checkAuthForUser(event, userId);
|
|
328
328
|
const [items, usage, limits] = await Promise.all([
|
|
329
|
-
database.selectFrom('storage').where('userId', '=', userId).where('trashedAt', 'is
|
|
329
|
+
database.selectFrom('storage').where('userId', '=', userId).where('trashedAt', 'is', null).selectAll().execute(),
|
|
330
330
|
currentUsage(userId),
|
|
331
331
|
getLimits(userId),
|
|
332
332
|
]).catch(withError('Could not fetch data'));
|
|
@@ -344,8 +344,8 @@ addRoute({
|
|
|
344
344
|
const items = await database
|
|
345
345
|
.selectFrom('storage')
|
|
346
346
|
.where('userId', '=', userId)
|
|
347
|
-
.where('trashedAt', 'is
|
|
348
|
-
.where('parentId', '
|
|
347
|
+
.where('trashedAt', 'is', null)
|
|
348
|
+
.where('parentId', 'is', null)
|
|
349
349
|
.selectAll()
|
|
350
350
|
.execute()
|
|
351
351
|
.catch(withError('Could not get storage items'));
|
|
@@ -370,7 +370,7 @@ addRoute({
|
|
|
370
370
|
const items = await database
|
|
371
371
|
.selectFrom('storage as item')
|
|
372
372
|
.selectAll('item')
|
|
373
|
-
.where('trashedAt', 'is
|
|
373
|
+
.where('trashedAt', 'is', null)
|
|
374
374
|
.where(existsInACL('id', userId))
|
|
375
375
|
.where(eb => eb.not(existsInACL('parentId', userId)))
|
|
376
376
|
.execute()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/storage",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
|
|
5
5
|
"description": "User file storage for Axium",
|
|
6
6
|
"funding": {
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
33
|
"lib",
|
|
34
|
-
"routes"
|
|
34
|
+
"routes",
|
|
35
|
+
"styles"
|
|
35
36
|
],
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "tsc"
|
package/styles/list.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.list {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
padding: 0.5em;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.list-item.list-header {
|
|
8
|
+
font-weight: bold;
|
|
9
|
+
border-bottom: 1px solid #bbc;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.list-item-container {
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
color: inherit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.list-item {
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template-columns: 1em 4fr 15em 5em repeat(3, 1em);
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 0.5em;
|
|
22
|
+
padding: 0.5em 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.list-item:not(:last-child) {
|
|
26
|
+
border-bottom: 1px solid #bbc;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.list-item:not(.list-header):hover {
|
|
30
|
+
background-color: #7777;
|
|
31
|
+
}
|
|
32
|
+
p.list-empty {
|
|
33
|
+
text-align: center;
|
|
34
|
+
color: #888;
|
|
35
|
+
margin-top: 1em;
|
|
36
|
+
font-style: italic;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.action {
|
|
40
|
+
visibility: hidden;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.item:hover .action {
|
|
44
|
+
visibility: visible;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.action:hover {
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|