@formio/appserver 2.12.1-rc.1 → 2.12.2
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.
|
@@ -70,7 +70,7 @@ export declare class Database implements ServerDB {
|
|
|
70
70
|
* @param {*} table
|
|
71
71
|
* @param {*} query
|
|
72
72
|
*/
|
|
73
|
-
index(form: AppServerForm, query
|
|
73
|
+
index(form: AppServerForm, query?: IndexQuery, collection?: Collection<Document> | null): Promise<DatabaseIndexResponse<Submission>>;
|
|
74
74
|
/**
|
|
75
75
|
* Perform a count of the amount of documents within a collection.
|
|
76
76
|
* @param form
|
|
@@ -429,13 +429,18 @@ class Database {
|
|
|
429
429
|
skip = parseInt(urlQuery.skip) || 0;
|
|
430
430
|
let sort = { created: -1 };
|
|
431
431
|
if (urlQuery.sort) {
|
|
432
|
-
sort
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
432
|
+
if (typeof urlQuery.sort === 'string') {
|
|
433
|
+
sort = {};
|
|
434
|
+
const sortParts = urlQuery.sort.split(',');
|
|
435
|
+
sortParts.forEach((part) => {
|
|
436
|
+
const desc = part.charAt(0) === '-';
|
|
437
|
+
const field = desc ? part.substring(1) : part;
|
|
438
|
+
sort[field] = desc ? -1 : 1;
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
sort = urlQuery.sort;
|
|
443
|
+
}
|
|
439
444
|
}
|
|
440
445
|
const includeDeleted = urlQuery.includeDeleted || false;
|
|
441
446
|
let project = {};
|
|
@@ -471,8 +476,8 @@ class Database {
|
|
|
471
476
|
* @param {*} table
|
|
472
477
|
* @param {*} query
|
|
473
478
|
*/
|
|
474
|
-
index(form_1
|
|
475
|
-
return __awaiter(this, arguments, void 0, function* (form, query, collection = null) {
|
|
479
|
+
index(form_1) {
|
|
480
|
+
return __awaiter(this, arguments, void 0, function* (form, query = { limit: 10, skip: 0, sort: { created: -1 }, includeDeleted: false, dbQuery: {} }, collection = null) {
|
|
476
481
|
let items = [], count = 0;
|
|
477
482
|
const { limit, skip, sort, includeDeleted, project, dbQuery } = query;
|
|
478
483
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formio/appserver",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.2",
|
|
4
4
|
"description": "A highly performant and extensible Application Server for Form.io Multi-Tenant Deployments.",
|
|
5
5
|
"main": "lib/server.js",
|
|
6
6
|
"types": "lib/server.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"homepage": "https://github.com/formio/appserver#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@formio/appserver-core": "^2.12.
|
|
36
|
+
"@formio/appserver-core": "^2.12.2",
|
|
37
37
|
"@formio/core": "2.5.1-dev.291.6557e4e",
|
|
38
38
|
"async": "^3.2.6",
|
|
39
39
|
"bcryptjs": "^3.0.3",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@types/chai": "^5.2.3",
|
|
51
51
|
"@types/express": "^5.0.6",
|
|
52
52
|
"@types/jsonwebtoken": "^9.0.10",
|
|
53
|
-
"@types/lodash": "^4.17.
|
|
53
|
+
"@types/lodash": "^4.17.24",
|
|
54
54
|
"@types/mocha": "^10.0.10",
|
|
55
55
|
"@types/node": "^25.3.0",
|
|
56
56
|
"chai": "^6.2.2",
|