@ccci/micro-server 1.0.49 → 1.0.51
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/index.js +15 -8
- package/dist/types/ApplicationOptionType.d.ts +4 -0
- package/dist/utils/Mailer.d.ts +25 -0
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -103691,14 +103691,21 @@ class Uploader {
|
|
|
103691
103691
|
constructor() {
|
|
103692
103692
|
}
|
|
103693
103693
|
static async init(options) {
|
|
103694
|
-
|
|
103695
|
-
Uploader.client
|
|
103696
|
-
|
|
103697
|
-
|
|
103698
|
-
|
|
103699
|
-
|
|
103700
|
-
|
|
103701
|
-
|
|
103694
|
+
try {
|
|
103695
|
+
if (!Uploader.client && Uploader.hasValidConfig(options)) {
|
|
103696
|
+
Logger.info("Connecting to minIO server...");
|
|
103697
|
+
Uploader.client = new Client({
|
|
103698
|
+
endPoint: options.minioHost,
|
|
103699
|
+
port: options.minioPort,
|
|
103700
|
+
useSSL: options.minioUseSSL,
|
|
103701
|
+
accessKey: options.minioAccessKey,
|
|
103702
|
+
secretKey: options.minioSecretKey
|
|
103703
|
+
});
|
|
103704
|
+
Logger.info("Connecting to minIO server... SUCCESS!");
|
|
103705
|
+
}
|
|
103706
|
+
} catch (error) {
|
|
103707
|
+
Logger.error(new Error("Connecting to minIO server... ERROR!"));
|
|
103708
|
+
throw error;
|
|
103702
103709
|
}
|
|
103703
103710
|
}
|
|
103704
103711
|
static hasValidConfig(options) {
|
|
@@ -15,5 +15,9 @@ export type ApplicationOptionType = {
|
|
|
15
15
|
minioAccessKey?: string;
|
|
16
16
|
minioSecretKey?: string;
|
|
17
17
|
minioUseSSL?: boolean;
|
|
18
|
+
smtpService?: string;
|
|
19
|
+
smtpHost?: string;
|
|
20
|
+
smtpUser?: string;
|
|
21
|
+
smtpPassword?: string;
|
|
18
22
|
};
|
|
19
23
|
//# sourceMappingURL=ApplicationOptionType.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApplicationOptionType } from '..';
|
|
2
|
+
interface MailInterface {
|
|
3
|
+
from?: string;
|
|
4
|
+
to: string | string[];
|
|
5
|
+
cc?: string | string[];
|
|
6
|
+
bcc?: string | string[];
|
|
7
|
+
subject: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
html: string;
|
|
10
|
+
}
|
|
11
|
+
export default class Mailer {
|
|
12
|
+
private static instance;
|
|
13
|
+
private transporter;
|
|
14
|
+
private sender;
|
|
15
|
+
private LOCAL_DIR;
|
|
16
|
+
static getInstance(): Mailer;
|
|
17
|
+
connect(options: ApplicationOptionType): Promise<void>;
|
|
18
|
+
sendMail(options: MailInterface, template?: string, values?: any): Promise<{
|
|
19
|
+
info: any;
|
|
20
|
+
emailLink: string | false;
|
|
21
|
+
}>;
|
|
22
|
+
findTemplate(name: string): Promise<unknown>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=Mailer.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccci/micro-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.51",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@types/express": "^4.17.21",
|
|
19
19
|
"@types/express-fileupload": "^1.5.0",
|
|
20
20
|
"@types/jsonwebtoken": "^9.0.6",
|
|
21
|
+
"@types/nodemailer": "^6.4.15",
|
|
21
22
|
"prettier": "^3.0.3",
|
|
22
23
|
"rimraf": "^5.0.5",
|
|
23
24
|
"typescript": "^5.2.2"
|
|
@@ -38,9 +39,11 @@
|
|
|
38
39
|
"cors": "^2.8.5",
|
|
39
40
|
"express": "^4.19.2",
|
|
40
41
|
"express-fileupload": "^1.5.0",
|
|
42
|
+
"handlebars": "^4.7.8",
|
|
41
43
|
"helmet": "^7.1.0",
|
|
42
44
|
"jsonwebtoken": "^9.0.2",
|
|
43
45
|
"minio": "^8.0.0",
|
|
46
|
+
"nodemailer": "^6.9.13",
|
|
44
47
|
"pg": "^8.11.5",
|
|
45
48
|
"pg-hstore": "^2.3.4",
|
|
46
49
|
"sequelize": "^6.37.3",
|