ztechno_core 0.0.55 → 0.0.57

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/lib/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export {
11
11
  MailOptionsHtml,
12
12
  MailOptionsText,
13
13
  MailServiceOptions,
14
+ MailResponse,
14
15
  } from './typings/mail_types';
15
16
  export { TranslateData, ZDom, ZNode, ZNodeText, dbTranslationRow } from './typings/translate_types';
16
17
  export { ZRequiredUserColumns, ZUser, ZUserCredentials, ZUserSession } from './typings/user_types';
@@ -1,7 +1,6 @@
1
- import SMTPTransport from 'nodemailer/lib/smtp-transport';
2
- import { MailOptionsHtml, MailOptionsText, MailServiceOptions } from './typings/mail_types';
1
+ import { MailOptionsHtml, MailOptionsText, MailResponse, MailServiceOptions } from './typings/mail_types';
3
2
  export declare class ZMailService {
4
3
  private opt;
5
4
  constructor(opt: MailServiceOptions);
6
- send(mailOpts: MailOptionsText | MailOptionsHtml): Promise<SMTPTransport.SentMessageInfo>;
5
+ send(mailOpts: MailOptionsText | MailOptionsHtml): Promise<MailResponse>;
7
6
  }
@@ -1,16 +1,46 @@
1
- import nodemailer from 'nodemailer';
1
+ import SMTPTransport from 'nodemailer/lib/smtp-transport';
2
+ interface OptionalOptions {
3
+ cacheDir?:
4
+ | string
5
+ | false
6
+ | undefined /** optional location for cached messages. If not set then caching is not used. */;
7
+ cacheTreshold?:
8
+ | number
9
+ | undefined /** optional size in bytes, if message is larger than this treshold it gets cached to disk (assuming cacheDir is set and writable). Defaults to 131072 (128 kB). */;
10
+ hashAlgo?: string | undefined /** optional algorithm for the body hash, defaults to ‘sha256’ */;
11
+ headerFieldNames?:
12
+ | string
13
+ | undefined /** an optional colon separated list of header keys to sign (eg. message-id:date:from:to...') */;
14
+ skipFields?:
15
+ | string
16
+ | undefined /** optional colon separated list of header keys not to sign. This is useful if you want to sign all the relevant keys but your provider changes some values, ie Message-ID and Date. In this case you should use 'message-id:date' to prevent signing these values. */;
17
+ }
18
+ interface SingleDKIMKeyOptions extends OptionalOptions {
19
+ domainName: string /** is the domain name to use in the signature */;
20
+ keySelector: string /** is the DKIM key selector */;
21
+ privateKey:
22
+ | string
23
+ | {
24
+ key: string;
25
+ passphrase: string;
26
+ } /** is the private key for the selector in PEM format */;
27
+ }
28
+ export type MailResponse = SMTPTransport.SentMessageInfo;
2
29
  export type MailServiceOptions = {
3
30
  auth: {
4
31
  user: string;
5
32
  pass: string;
6
33
  };
7
34
  mailSender: string;
8
- } & Partial<Pick<nodemailer.SendMailOptions, 'dkim'>>;
35
+ dkim?: SingleDKIMKeyOptions;
36
+ };
9
37
  export type MailOptionsBase = {
10
38
  recipient: string;
11
39
  subject: string;
12
40
  from?: string;
13
- } & Partial<Pick<nodemailer.SendMailOptions, 'dkim' | 'priority'>>;
41
+ priority?: 'high' | 'normal' | 'low';
42
+ dkim?: SingleDKIMKeyOptions;
43
+ };
14
44
  export type MailOptionsText = MailOptionsBase & {
15
45
  body: string;
16
46
  };
@@ -21,3 +51,4 @@ export type MailOptions = MailOptionsBase & {
21
51
  body?: string;
22
52
  html?: string;
23
53
  };
54
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztechno_core",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "description": "Core files for ztechno framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",