@lenne.tech/nest-server 8.6.21 → 8.6.22

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": "8.6.21",
3
+ "version": "8.6.22",
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.1",
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.3.9",
84
+ "mongoose": "6.4.1",
85
85
  "mongoose-gridfs": "1.3.0",
86
- "multer": "1.4.4",
87
- "node-mailjet": "3.4.1",
88
- "nodemailer": "6.7.5",
89
- "nodemon": "2.0.16",
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,16 @@
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.3",
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",
104
+ "@types/node-mailjet": "^3.3.9",
105
105
  "@types/nodemailer": "6.4.4",
106
106
  "@types/passport": "1.0.9",
107
107
  "@types/supertest": "2.0.12",
108
- "@typescript-eslint/eslint-plugin": "5.29.0",
109
- "@typescript-eslint/parser": "5.29.0",
108
+ "@typescript-eslint/eslint-plugin": "5.30.0",
109
+ "@typescript-eslint/parser": "5.30.0",
110
110
  "coffeescript": "2.7.0",
111
111
  "eslint": "8.18.0",
112
112
  "eslint-config-prettier": "8.5.0",
@@ -117,7 +117,7 @@
117
117
  "grunt-contrib-watch": "1.1.0",
118
118
  "grunt-sync": "0.8.2",
119
119
  "husky": "8.0.1",
120
- "jest": "28.1.1",
120
+ "jest": "28.1.2",
121
121
  "pm2": "5.2.0",
122
122
  "prettier": "2.7.1",
123
123
  "pretty-quick": "3.1.3",
@@ -597,7 +597,7 @@ function getStringId(element: any): string {
597
597
  return element;
598
598
  }
599
599
 
600
- // Sring handling
600
+ // String handling
601
601
  if (typeof element === 'string') {
602
602
  return element;
603
603
  }
@@ -1,6 +1,6 @@
1
1
  import { Injectable } from '@nestjs/common';
2
2
  import { ConfigService } from './config.service';
3
- import mailjet from 'node-mailjet';
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?: mailjet.Email.Attachment[];
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
- ): Promise<mailjet.Email.PostResponse> {
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: mailjet.Email.SendParams = {
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: mailjet.Email.Client;
75
+ let connection;
71
76
  try {
72
77
  // Connect to mailjet
73
- connection = await mailjet.connect(
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
  }