@ditojs/server 1.4.0 → 1.4.1
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/package.json +8 -8
- package/src/query/QueryBuilder.js +8 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/server",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dito.js Server – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js",
|
|
6
6
|
"repository": "https://github.com/ditojs/dito/tree/master/packages/server",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"node >= 16"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ditojs/admin": "^1.4.
|
|
25
|
-
"@ditojs/router": "^1.4.
|
|
26
|
-
"@ditojs/utils": "^1.4.
|
|
24
|
+
"@ditojs/admin": "^1.4.1",
|
|
25
|
+
"@ditojs/router": "^1.4.1",
|
|
26
|
+
"@ditojs/utils": "^1.4.1",
|
|
27
27
|
"@koa/cors": "^3.2.0",
|
|
28
28
|
"@koa/multer": "^3.0.0",
|
|
29
29
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
30
|
-
"ajv": "^8.
|
|
30
|
+
"ajv": "^8.11.0",
|
|
31
31
|
"ajv-formats": "^2.1.1",
|
|
32
|
-
"aws-sdk": "^2.
|
|
32
|
+
"aws-sdk": "^2.1098.0",
|
|
33
33
|
"axios": "^0.26.1",
|
|
34
34
|
"bcryptjs": "^2.4.3",
|
|
35
35
|
"bytes": "^3.1.2",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"passthrough-counter": "^1.0.0",
|
|
62
62
|
"picocolors": "^1.0.0",
|
|
63
63
|
"picomatch": "^2.3.1",
|
|
64
|
-
"pino": "^7.9.
|
|
64
|
+
"pino": "^7.9.2",
|
|
65
65
|
"pino-pretty": "^7.5.4",
|
|
66
66
|
"pluralize": "^8.0.0",
|
|
67
67
|
"repl": "^0.1.3",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"pg": "^8.7.3",
|
|
82
82
|
"sqlite3": "^5.0.2"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "0e8a22ea0cb68eec3df1b6236cf77a85f5a2c836"
|
|
85
85
|
}
|
|
@@ -216,7 +216,7 @@ export class QueryBuilder extends objection.QueryBuilder {
|
|
|
216
216
|
this._allowScopes = query._allowScopes ? { ...query._allowScopes } : null
|
|
217
217
|
this._ignoreScopes = { ...query._ignoreScopes }
|
|
218
218
|
}
|
|
219
|
-
// If
|
|
219
|
+
// If the target is a child query of a graph query, copy all scopes, graph
|
|
220
220
|
// and non-graph. If it is a child query of a related or eager query,
|
|
221
221
|
// copy only the graph scopes.
|
|
222
222
|
const copyAllScopes =
|
|
@@ -226,15 +226,9 @@ export class QueryBuilder extends objection.QueryBuilder {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
_filterScopes(scopes, callback) {
|
|
229
|
-
return Object.entries(scopes).
|
|
230
|
-
(
|
|
231
|
-
|
|
232
|
-
scopes[scope] = graph
|
|
233
|
-
}
|
|
234
|
-
return scopes
|
|
235
|
-
},
|
|
236
|
-
{}
|
|
237
|
-
)
|
|
229
|
+
return Object.fromEntries(Object.entries(scopes).filter(
|
|
230
|
+
([scope, graph]) => callback(scope, graph)
|
|
231
|
+
))
|
|
238
232
|
}
|
|
239
233
|
|
|
240
234
|
_applyScope(scope, graph) {
|
|
@@ -255,12 +249,12 @@ export class QueryBuilder extends objection.QueryBuilder {
|
|
|
255
249
|
const expr = this.graphExpressionObject()
|
|
256
250
|
if (expr) {
|
|
257
251
|
// Add a new modifier to the existing graph expression that
|
|
258
|
-
// recursively
|
|
259
|
-
//
|
|
260
|
-
//
|
|
252
|
+
// recursively adds the graph-scope to the resulting queries. This
|
|
253
|
+
// even works if nested scopes expand the graph expression, because it
|
|
254
|
+
// re-applies itself to the result.
|
|
261
255
|
const name = `^${scope}`
|
|
262
256
|
const modifiers = {
|
|
263
|
-
[name]: query => query.
|
|
257
|
+
[name]: query => query.withScope(name)
|
|
264
258
|
}
|
|
265
259
|
this.withGraph(
|
|
266
260
|
addGraphScope(this.modelClass(), expr, [name], modifiers, true)
|