@formio/appserver 2.12.2 → 2.13.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.
|
@@ -171,7 +171,7 @@ exports.LoginAction = {
|
|
|
171
171
|
}
|
|
172
172
|
return (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
173
173
|
debug('Login Action');
|
|
174
|
-
const result = yield
|
|
174
|
+
const result = yield loginProvider === null || loginProvider === void 0 ? void 0 : loginProvider.login(req.auth, req.body, actionForm);
|
|
175
175
|
if (!result) {
|
|
176
176
|
return next('Unable to login');
|
|
177
177
|
}
|
|
@@ -20,7 +20,7 @@ export declare class Database implements ServerDB {
|
|
|
20
20
|
close(): Promise<void>;
|
|
21
21
|
collection(name: string): Collection<Document> | null;
|
|
22
22
|
save(collectionName: string, item: any): Promise<any | null>;
|
|
23
|
-
saveOne(collectionName: string, item:
|
|
23
|
+
saveOne<T>(collectionName: string, item: T): Promise<T | null>;
|
|
24
24
|
load(collectionName: string, dbQuery?: {}): Promise<any | null>;
|
|
25
25
|
getQueryValue(name: string, value: string, selector: string): string | boolean | Date | null;
|
|
26
26
|
/**
|
|
@@ -130,17 +130,18 @@ class Database {
|
|
|
130
130
|
if (!collection) {
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
try {
|
|
134
|
+
debug('db.saveOne()', collectionName);
|
|
135
|
+
// Use an atomic findOneAndReplace with upsert to ensure only a single record exists.
|
|
136
|
+
// Find any existing record and replace it, or insert if none exists.
|
|
137
|
+
const filter = item._id ? { _id: this.ObjectId(item._id) } : {};
|
|
138
|
+
const result = yield collection.findOneAndReplace(filter, (0, lodash_1.omit)(item, '_id'), { upsert: true, returnDocument: 'after' });
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
error(err.message);
|
|
142
143
|
}
|
|
143
|
-
return
|
|
144
|
+
return null;
|
|
144
145
|
});
|
|
145
146
|
}
|
|
146
147
|
// Generic load record method.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formio/appserver",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.1",
|
|
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,16 +33,16 @@
|
|
|
33
33
|
],
|
|
34
34
|
"homepage": "https://github.com/formio/appserver#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@formio/appserver-core": "^2.
|
|
37
|
-
"@formio/core": "2.
|
|
36
|
+
"@formio/appserver-core": "^2.13.1",
|
|
37
|
+
"@formio/core": "2.8.0",
|
|
38
38
|
"async": "^3.2.6",
|
|
39
39
|
"bcryptjs": "^3.0.3",
|
|
40
40
|
"debug": "^4.4.3",
|
|
41
|
-
"dotenv": "^17.
|
|
41
|
+
"dotenv": "^17.4.2",
|
|
42
42
|
"express": "^5.2.1",
|
|
43
43
|
"jsonwebtoken": "^9.0.3",
|
|
44
|
-
"lodash": "^4.
|
|
45
|
-
"mongodb": "^7.
|
|
44
|
+
"lodash": "^4.18.1",
|
|
45
|
+
"mongodb": "^7.5.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/async": "^3.2.25",
|
|
@@ -52,13 +52,14 @@
|
|
|
52
52
|
"@types/jsonwebtoken": "^9.0.10",
|
|
53
53
|
"@types/lodash": "^4.17.24",
|
|
54
54
|
"@types/mocha": "^10.0.10",
|
|
55
|
-
"@types/node": "^
|
|
55
|
+
"@types/node": "^26.1.2",
|
|
56
56
|
"chai": "^6.2.2",
|
|
57
57
|
"cross-env": "^10.1.0",
|
|
58
|
-
"mocha": "^11.7.
|
|
59
|
-
"mongodb-memory-server": "^11.0
|
|
58
|
+
"mocha": "^11.7.6",
|
|
59
|
+
"mongodb-memory-server": "^11.2.0",
|
|
60
60
|
"ts-node": "^10.9.2",
|
|
61
61
|
"tsconfig-paths": "^4.2.0",
|
|
62
|
-
"
|
|
62
|
+
"tsx": "^4.23.1",
|
|
63
|
+
"typescript": "^7.0.2"
|
|
63
64
|
}
|
|
64
65
|
}
|