@lenne.tech/nest-server 10.4.3 → 10.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/nest-server",
3
- "version": "10.4.3",
3
+ "version": "10.5.0",
4
4
  "description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
5
5
  "keywords": [
6
6
  "node",
@@ -62,18 +62,18 @@
62
62
  "node": ">= 20"
63
63
  },
64
64
  "dependencies": {
65
- "@apollo/gateway": "2.9.2",
65
+ "@apollo/gateway": "2.9.3",
66
66
  "@getbrevo/brevo": "1.0.1",
67
67
  "@lenne.tech/mongoose-gridfs": "1.4.2",
68
68
  "@lenne.tech/multer-gridfs-storage": "5.0.6",
69
- "@nestjs/apollo": "12.2.0",
70
- "@nestjs/common": "10.4.4",
71
- "@nestjs/core": "10.4.4",
72
- "@nestjs/graphql": "12.2.0",
69
+ "@nestjs/apollo": "12.2.1",
70
+ "@nestjs/common": "10.4.6",
71
+ "@nestjs/core": "10.4.6",
72
+ "@nestjs/graphql": "12.2.1",
73
73
  "@nestjs/jwt": "10.2.0",
74
- "@nestjs/mongoose": "10.0.10",
74
+ "@nestjs/mongoose": "10.1.0",
75
75
  "@nestjs/passport": "10.0.3",
76
- "@nestjs/platform-express": "10.4.4",
76
+ "@nestjs/platform-express": "10.4.6",
77
77
  "@nestjs/schedule": "4.1.1",
78
78
  "@nestjs/terminus": "10.2.3",
79
79
  "apollo-server-core": "3.13.0",
@@ -90,9 +90,9 @@
90
90
  "graphql-upload": "15.0.2",
91
91
  "js-sha256": "0.11.0",
92
92
  "json-to-graphql-query": "2.3.0",
93
- "light-my-request": "6.1.0",
93
+ "light-my-request": "6.2.0",
94
94
  "lodash": "4.17.21",
95
- "mongodb": "6.9.0",
95
+ "mongodb": "6.10.0",
96
96
  "mongoose": "7.8.2",
97
97
  "multer": "1.4.5-lts.1",
98
98
  "node-mailjet": "6.0.6",
@@ -108,22 +108,22 @@
108
108
  },
109
109
  "devDependencies": {
110
110
  "@babel/plugin-proposal-private-methods": "7.18.6",
111
- "@compodoc/compodoc": "1.1.25",
111
+ "@compodoc/compodoc": "1.1.26",
112
112
  "@lenne.tech/eslint-config-ts": "0.0.16",
113
113
  "@nestjs/cli": "10.4.5",
114
- "@nestjs/schematics": "10.1.4",
115
- "@nestjs/testing": "10.4.4",
114
+ "@nestjs/schematics": "10.2.2",
115
+ "@nestjs/testing": "10.4.6",
116
116
  "@swc/cli": "0.4.0",
117
- "@swc/core": "1.7.35",
117
+ "@swc/core": "1.7.39",
118
118
  "@swc/jest": "0.2.36",
119
119
  "@types/compression": "1.7.5",
120
120
  "@types/cookie-parser": "1.4.7",
121
121
  "@types/ejs": "3.1.5",
122
122
  "@types/express": "4.17.21",
123
- "@types/jest": "29.5.13",
124
- "@types/lodash": "4.17.10",
123
+ "@types/jest": "29.5.14",
124
+ "@types/lodash": "4.17.12",
125
125
  "@types/multer": "1.4.12",
126
- "@types/node": "20.16.11",
126
+ "@types/node": "20.17.0",
127
127
  "@types/nodemailer": "6.4.16",
128
128
  "@types/passport": "1.0.16",
129
129
  "@types/supertest": "6.0.2",
@@ -155,6 +155,7 @@ export class TestHelper {
155
155
 
156
156
  /**
157
157
  * Download file from URL
158
+ * To compare content data via string comparison
158
159
  * @return Superagent response with additional data field containing the content of the file
159
160
  */
160
161
  download(url: string, token?: string): Promise<any> {
@@ -183,6 +184,40 @@ export class TestHelper {
183
184
  });
184
185
  }
185
186
 
187
+ /**
188
+ * Download file from URL and get buffer
189
+ * To compare content data via buffer comparison and with the possibility to save the file
190
+ */
191
+ downloadBuffer(url: string, token?: string): Promise<Buffer> {
192
+ return new Promise((resolve, reject) => {
193
+ const request = supertest(this.app.getHttpServer()).get(url);
194
+ if (token) {
195
+ request.set('Authorization', `bearer ${token}`);
196
+ }
197
+
198
+ // Array to store the data chunks
199
+ const chunks: any[] = [];
200
+
201
+ request
202
+ .buffer()
203
+ .parse((res: any, callback) => {
204
+ res.on('data', (chunk) => {
205
+ chunks.push(chunk);
206
+ });
207
+ res.on('error', reject);
208
+ res.on('end', (err) => {
209
+ err ? reject(err) : callback(null, Buffer.concat(chunks));
210
+ });
211
+ })
212
+ .end((err, res: any) => {
213
+ if (err) {
214
+ return reject(err);
215
+ }
216
+ resolve(res.body); // res.body should be a Buffer
217
+ });
218
+ });
219
+ }
220
+
186
221
  /**
187
222
  * GraphQL request
188
223
  */