ztechno_core 0.0.92 → 0.0.95

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.
@@ -3,7 +3,8 @@ export declare class ZCryptoService {
3
3
  static encrypt(text: string): HashStruct;
4
4
  static decrypt(data: HashStruct): string;
5
5
  static decrypt(encrypted: string): string;
6
- static decryptJSON(data: HashStruct): any;
6
+ static decryptJSON<T = any>(data: HashStruct): T;
7
+ static decryptJSON<T = any>(data: string): T;
7
8
  static hash(
8
9
  hashAlgorithm: 'sha256' | 'sha512' | 'md5',
9
10
  data: string,
@@ -73,8 +73,9 @@ class ZMailService {
73
73
  subject: mailOpts.subject,
74
74
  text: mailOpts.body || undefined,
75
75
  html: mailOpts.html || undefined,
76
- dkim: this.opt.dkim ?? mailOpts.dkim,
76
+ dkim: mailOpts.dkim ?? this.opt.dkim,
77
77
  priority: mailOpts.priority,
78
+ attachments: mailOpts.attachments,
78
79
  };
79
80
  return await new Promise((resolve, reject) => {
80
81
  mailTransporter.sendMail(mailDetails, function (err, data) {
@@ -1,5 +1,7 @@
1
1
  import SMTPTransport from 'nodemailer/lib/smtp-transport';
2
+ import { Attachment } from 'nodemailer/lib/mailer';
2
3
  import { ZSQLService } from '../sql_service';
4
+ export type MailAttachment = Attachment;
3
5
  interface OptionalOptions {
4
6
  cacheDir?:
5
7
  | string
@@ -44,6 +46,7 @@ export type MailOptionsBase = {
44
46
  from?: string;
45
47
  priority?: 'high' | 'normal' | 'low';
46
48
  dkim?: SingleDKIMKeyOptions;
49
+ attachments?: MailAttachment[];
47
50
  };
48
51
  export type MailOptionsText = MailOptionsBase & {
49
52
  body: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztechno_core",
3
- "version": "0.0.92",
3
+ "version": "0.0.95",
4
4
  "description": "Core files for ztechno framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",