@formio/appserver 2.3.1 → 2.4.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.
@@ -1,4 +1,4 @@
1
- import { Collection, Document, Db, FindOptions, MongoClient } from 'mongodb';
1
+ import { Collection, Document, Db, MongoClient, FindOneOptions } from 'mongodb';
2
2
  import { Component, Submission } from '@formio/core';
3
3
  import { ServerDB, DBConfig, AppServerForm, DatabaseIndexResponse } from '@formio/appserver-core';
4
4
  export declare class Database implements ServerDB {
@@ -92,7 +92,7 @@ export declare class Database implements ServerDB {
92
92
  /**
93
93
  * Find a record for a provided query.
94
94
  */
95
- findOne(form: AppServerForm, dbQuery?: any, options?: FindOptions<Document>): Promise<Submission | null>;
95
+ findOne(form: AppServerForm, dbQuery?: any, options?: FindOneOptions | undefined): Promise<Submission | null>;
96
96
  /**
97
97
  * Read a single submission from a form
98
98
  *
@@ -592,14 +592,14 @@ class Database {
592
592
  * Find a record for a provided query.
593
593
  */
594
594
  findOne(form_1) {
595
- return __awaiter(this, arguments, void 0, function* (form, dbQuery = {}, options = {}) {
595
+ return __awaiter(this, arguments, void 0, function* (form, dbQuery = {}, options) {
596
596
  try {
597
597
  debug('db.findOne()', dbQuery);
598
598
  const collection = yield this.formCollection(form);
599
599
  if (!collection) {
600
600
  return null;
601
601
  }
602
- const doc = yield collection.findOne(this.query(form, dbQuery));
602
+ const doc = yield collection.findOne(this.query(form, dbQuery), options);
603
603
  if (!doc) {
604
604
  return null;
605
605
  }
package/lib/server.js CHANGED
@@ -56,6 +56,7 @@ class Server extends appserver_core_1.Server {
56
56
  }
57
57
  },
58
58
  project: (0, lodash_1.get)(process.env, 'PROJECT', ''),
59
+ ttl: parseInt((0, lodash_1.get)(process.env, 'PROJECT_TTL', 900).toString(), 10),
59
60
  submissionProxy: (0, lodash_1.get)(process.env, 'SUBMISSION_PROXY', '').toString(),
60
61
  projects: (0, lodash_1.get)(process.env, 'PROJECTS', '').split(',').filter((p) => !!p),
61
62
  maxBodySize: (0, lodash_1.get)(process.env, 'MAX_BODY_SIZE', '100mb')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/appserver",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
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",
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "homepage": "https://github.com/formio/appserver#readme",
32
32
  "dependencies": {
33
- "@formio/appserver-core": "^2.3.1",
33
+ "@formio/appserver-core": "^2.4.0",
34
34
  "@formio/core": "2.5.1-dev.291.6557e4e",
35
35
  "async": "^3.2.6",
36
36
  "bcryptjs": "^3.0.3",
@@ -39,7 +39,7 @@
39
39
  "express": "^5.1.0",
40
40
  "jsonwebtoken": "^9.0.2",
41
41
  "lodash": "^4.17.21",
42
- "mongodb": "^6.19.0"
42
+ "mongodb": "^7.0.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/async": "^3.2.25",
@@ -49,10 +49,10 @@
49
49
  "@types/jsonwebtoken": "^9.0.10",
50
50
  "@types/lodash": "^4.17.20",
51
51
  "@types/mocha": "^10.0.10",
52
- "@types/node": "^24.10.0",
53
- "chai": "^6.0.1",
52
+ "@types/node": "^24.10.1",
53
+ "chai": "^6.2.1",
54
54
  "cross-env": "^10.1.0",
55
- "mocha": "^11.7.4",
55
+ "mocha": "^11.7.5",
56
56
  "mongodb-memory-server": "^10.3.0",
57
57
  "ts-node": "^10.9.2",
58
58
  "tsconfig-paths": "^4.2.0",