@lenne.tech/nest-server 8.6.21 → 8.6.24
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/dist/core/common/helpers/service.helper.js +3 -1
- package/dist/core/common/helpers/service.helper.js.map +1 -1
- package/dist/core/common/services/mailjet.service.d.ts +7 -3
- package/dist/core/common/services/mailjet.service.js +4 -1
- package/dist/core/common/services/mailjet.service.js.map +1 -1
- package/dist/server/modules/file/file-info.model.d.ts +4 -2
- package/dist/server/modules/user/user.model.d.ts +4 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -12
- package/src/core/common/helpers/db.helper.ts +1 -1
- package/src/core/common/helpers/service.helper.ts +3 -1
- package/src/core/common/services/mailjet.service.ts +14 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.24",
|
|
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",
|
|
@@ -76,17 +76,17 @@
|
|
|
76
76
|
"ejs": "3.1.8",
|
|
77
77
|
"graphql": "16.5.0",
|
|
78
78
|
"graphql-subscriptions": "2.0.0",
|
|
79
|
-
"graphql-upload": "15.0.
|
|
79
|
+
"graphql-upload": "15.0.2",
|
|
80
80
|
"json-to-graphql-query": "2.2.4",
|
|
81
81
|
"light-my-request": "5.0.0",
|
|
82
82
|
"lodash": "4.17.21",
|
|
83
83
|
"mongodb": "4.7.0",
|
|
84
|
-
"mongoose": "6.
|
|
84
|
+
"mongoose": "6.4.1",
|
|
85
85
|
"mongoose-gridfs": "1.3.0",
|
|
86
|
-
"multer": "1.4.
|
|
87
|
-
"node-mailjet": "
|
|
88
|
-
"nodemailer": "6.7.
|
|
89
|
-
"nodemon": "2.0.
|
|
86
|
+
"multer": "1.4.5-lts.1",
|
|
87
|
+
"node-mailjet": "5.0.1",
|
|
88
|
+
"nodemailer": "6.7.6",
|
|
89
|
+
"nodemon": "2.0.18",
|
|
90
90
|
"passport": "0.6.0",
|
|
91
91
|
"passport-jwt": "4.0.0",
|
|
92
92
|
"reflect-metadata": "0.1.13",
|
|
@@ -97,16 +97,15 @@
|
|
|
97
97
|
"@nestjs/testing": "8.4.7",
|
|
98
98
|
"@types/cron": "2.0.0",
|
|
99
99
|
"@types/ejs": "3.1.1",
|
|
100
|
-
"@types/jest": "28.1.
|
|
100
|
+
"@types/jest": "28.1.4",
|
|
101
101
|
"@types/lodash": "4.14.182",
|
|
102
102
|
"@types/multer": "1.4.7",
|
|
103
103
|
"@types/node": "18.0.0",
|
|
104
|
-
"@types/node-mailjet": "3.3.9",
|
|
105
104
|
"@types/nodemailer": "6.4.4",
|
|
106
105
|
"@types/passport": "1.0.9",
|
|
107
106
|
"@types/supertest": "2.0.12",
|
|
108
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
109
|
-
"@typescript-eslint/parser": "5.
|
|
107
|
+
"@typescript-eslint/eslint-plugin": "5.30.0",
|
|
108
|
+
"@typescript-eslint/parser": "5.30.0",
|
|
110
109
|
"coffeescript": "2.7.0",
|
|
111
110
|
"eslint": "8.18.0",
|
|
112
111
|
"eslint-config-prettier": "8.5.0",
|
|
@@ -117,7 +116,7 @@
|
|
|
117
116
|
"grunt-contrib-watch": "1.1.0",
|
|
118
117
|
"grunt-sync": "0.8.2",
|
|
119
118
|
"husky": "8.0.1",
|
|
120
|
-
"jest": "28.1.
|
|
119
|
+
"jest": "28.1.2",
|
|
121
120
|
"pm2": "5.2.0",
|
|
122
121
|
"prettier": "2.7.1",
|
|
123
122
|
"pretty-quick": "3.1.3",
|
|
@@ -171,7 +171,9 @@ export async function prepareOutput<T = { [key: string]: any; map: (...args: any
|
|
|
171
171
|
|
|
172
172
|
// Process array
|
|
173
173
|
if (Array.isArray(output)) {
|
|
174
|
-
const processedArray = output.map(async (item
|
|
174
|
+
const processedArray = output.map(async (item, index) => {
|
|
175
|
+
output[index] = await prepareOutput(item, options);
|
|
176
|
+
}) as any;
|
|
175
177
|
return config.getNewArray ? processedArray : output;
|
|
176
178
|
}
|
|
177
179
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { ConfigService } from './config.service';
|
|
3
|
-
import
|
|
3
|
+
import Mailjet from 'node-mailjet';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Mailjet service
|
|
@@ -22,11 +22,16 @@ export class MailjetService {
|
|
|
22
22
|
config: {
|
|
23
23
|
senderEmail?: string;
|
|
24
24
|
senderName?: string;
|
|
25
|
-
attachments?:
|
|
25
|
+
attachments?: {
|
|
26
|
+
ContentID?: string;
|
|
27
|
+
ContentType: string;
|
|
28
|
+
Filename: string;
|
|
29
|
+
Base64Content: string;
|
|
30
|
+
}[];
|
|
26
31
|
templateData?: { [key: string]: any };
|
|
27
32
|
sandbox?: boolean;
|
|
28
33
|
}
|
|
29
|
-
)
|
|
34
|
+
) {
|
|
30
35
|
// Process config
|
|
31
36
|
const { senderName, senderEmail, templateData, attachments, sandbox } = {
|
|
32
37
|
senderEmail: this.configService.get('email.defaultSender.email'),
|
|
@@ -49,7 +54,7 @@ export class MailjetService {
|
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
// Parse body for mailjet request
|
|
52
|
-
const body
|
|
57
|
+
const body = {
|
|
53
58
|
Messages: [
|
|
54
59
|
{
|
|
55
60
|
From: {
|
|
@@ -67,13 +72,13 @@ export class MailjetService {
|
|
|
67
72
|
SandboxMode: sandbox,
|
|
68
73
|
};
|
|
69
74
|
|
|
70
|
-
let connection
|
|
75
|
+
let connection;
|
|
71
76
|
try {
|
|
72
77
|
// Connect to mailjet
|
|
73
|
-
connection =
|
|
74
|
-
this.configService.get('email.mailjet.api_key_public'),
|
|
75
|
-
this.configService.get('email.mailjet.api_key_private')
|
|
76
|
-
);
|
|
78
|
+
connection = new Mailjet({
|
|
79
|
+
apiKey: this.configService.get('email.mailjet.api_key_public'),
|
|
80
|
+
apiSecret: this.configService.get('email.mailjet.api_key_private'),
|
|
81
|
+
});
|
|
77
82
|
} catch (e) {
|
|
78
83
|
throw new Error('Cannot connect to mailjet.');
|
|
79
84
|
}
|