@nano-app/plugins 0.9.0 → 0.10.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.
|
@@ -22,7 +22,7 @@ function list(aRecords) {
|
|
|
22
22
|
}
|
|
23
23
|
/** A list of the table, or one record by its id, with Drizzle's relational query of the body */
|
|
24
24
|
async function read(_oReq, { db, onBeforeResult }) {
|
|
25
|
-
const { model, page, answer, body } = onBeforeResult
|
|
25
|
+
const { model, page, answer, body } = onBeforeResult;
|
|
26
26
|
return answer(await db.query[model].findMany({
|
|
27
27
|
limit: DEFAULT_LIMIT,
|
|
28
28
|
...body,
|
|
@@ -63,15 +63,15 @@ var index_route_default = createRoute({
|
|
|
63
63
|
GET: read,
|
|
64
64
|
QUERY: read,
|
|
65
65
|
POST: async (_oReq, { db, onBeforeResult }) => {
|
|
66
|
-
const { table, body } = onBeforeResult
|
|
66
|
+
const { table, body } = onBeforeResult;
|
|
67
67
|
return first(await db.insert(table).values(body).returning());
|
|
68
68
|
},
|
|
69
69
|
PUT: async (_oReq, { db, onBeforeResult }) => {
|
|
70
|
-
const { table, id, body } = onBeforeResult
|
|
70
|
+
const { table, id, body } = onBeforeResult;
|
|
71
71
|
return first(await db.update(table).set(body).where(eq(table.id, id)).returning());
|
|
72
72
|
},
|
|
73
73
|
DELETE: async (_oReq, { db, onBeforeResult }) => {
|
|
74
|
-
const { table, id } = onBeforeResult
|
|
74
|
+
const { table, id } = onBeforeResult;
|
|
75
75
|
return first(await db.delete(table).where(eq(table.id, id)).returning());
|
|
76
76
|
}
|
|
77
77
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nano-app/plugins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Official plugins for @nano-app/backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
37
|
+
"node": "^22.23.4 || ^24.22.1 || >=26.12.1",
|
|
38
|
+
"bun": ">=1.4.4"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"@nano-app/backend": ">=0.15.0",
|