@nocobase/plugin-workflow-mailer 1.2.12-alpha → 1.3.0-alpha.20240710084543

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.
Files changed (57) hide show
  1. package/package.json +2 -2
  2. package/dist/client/MailerInstruction.d.ts +0 -352
  3. package/dist/client/index.d.ts +0 -14
  4. package/dist/client/index.js +0 -16
  5. package/dist/externalVersion.js +0 -16
  6. package/dist/index.d.ts +0 -10
  7. package/dist/index.js +0 -48
  8. package/dist/locale/en-US.json +0 -19
  9. package/dist/locale/index.d.ts +0 -11
  10. package/dist/locale/index.js +0 -48
  11. package/dist/locale/zh-CN.json +0 -19
  12. package/dist/node_modules/nodemailer/.gitattributes +0 -6
  13. package/dist/node_modules/nodemailer/.ncurc.js +0 -7
  14. package/dist/node_modules/nodemailer/.prettierrc.js +0 -8
  15. package/dist/node_modules/nodemailer/LICENSE +0 -16
  16. package/dist/node_modules/nodemailer/SECURITY.txt +0 -22
  17. package/dist/node_modules/nodemailer/lib/addressparser/index.js +0 -313
  18. package/dist/node_modules/nodemailer/lib/base64/index.js +0 -142
  19. package/dist/node_modules/nodemailer/lib/dkim/index.js +0 -251
  20. package/dist/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
  21. package/dist/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
  22. package/dist/node_modules/nodemailer/lib/dkim/sign.js +0 -117
  23. package/dist/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
  24. package/dist/node_modules/nodemailer/lib/fetch/index.js +0 -274
  25. package/dist/node_modules/nodemailer/lib/json-transport/index.js +0 -82
  26. package/dist/node_modules/nodemailer/lib/mail-composer/index.js +0 -565
  27. package/dist/node_modules/nodemailer/lib/mailer/index.js +0 -429
  28. package/dist/node_modules/nodemailer/lib/mailer/mail-message.js +0 -315
  29. package/dist/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
  30. package/dist/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2102
  31. package/dist/node_modules/nodemailer/lib/mime-node/index.js +0 -1314
  32. package/dist/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
  33. package/dist/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
  34. package/dist/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
  35. package/dist/node_modules/nodemailer/lib/nodemailer.js +0 -1
  36. package/dist/node_modules/nodemailer/lib/punycode/index.js +0 -460
  37. package/dist/node_modules/nodemailer/lib/qp/index.js +0 -219
  38. package/dist/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
  39. package/dist/node_modules/nodemailer/lib/ses-transport/index.js +0 -349
  40. package/dist/node_modules/nodemailer/lib/shared/index.js +0 -688
  41. package/dist/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
  42. package/dist/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
  43. package/dist/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1825
  44. package/dist/node_modules/nodemailer/lib/smtp-pool/index.js +0 -648
  45. package/dist/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -253
  46. package/dist/node_modules/nodemailer/lib/smtp-transport/index.js +0 -416
  47. package/dist/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
  48. package/dist/node_modules/nodemailer/lib/well-known/index.js +0 -47
  49. package/dist/node_modules/nodemailer/lib/well-known/services.json +0 -343
  50. package/dist/node_modules/nodemailer/lib/xoauth2/index.js +0 -376
  51. package/dist/node_modules/nodemailer/package.json +0 -1
  52. package/dist/server/MailerInstruction.d.ts +0 -13
  53. package/dist/server/MailerInstruction.js +0 -119
  54. package/dist/server/Plugin.d.ts +0 -12
  55. package/dist/server/Plugin.js +0 -50
  56. package/dist/server/index.d.ts +0 -9
  57. package/dist/server/index.js +0 -42
@@ -1,108 +0,0 @@
1
- 'use strict';
2
-
3
- const stream = require('stream');
4
- const Transform = stream.Transform;
5
-
6
- /**
7
- * Escapes dots in the beginning of lines. Ends the stream with <CR><LF>.<CR><LF>
8
- * Also makes sure that only <CR><LF> sequences are used for linebreaks
9
- *
10
- * @param {Object} options Stream options
11
- */
12
- class DataStream extends Transform {
13
- constructor(options) {
14
- super(options);
15
- // init Transform
16
- this.options = options || {};
17
- this._curLine = '';
18
-
19
- this.inByteCount = 0;
20
- this.outByteCount = 0;
21
- this.lastByte = false;
22
- }
23
-
24
- /**
25
- * Escapes dots
26
- */
27
- _transform(chunk, encoding, done) {
28
- let chunks = [];
29
- let chunklen = 0;
30
- let i,
31
- len,
32
- lastPos = 0;
33
- let buf;
34
-
35
- if (!chunk || !chunk.length) {
36
- return done();
37
- }
38
-
39
- if (typeof chunk === 'string') {
40
- chunk = Buffer.from(chunk);
41
- }
42
-
43
- this.inByteCount += chunk.length;
44
-
45
- for (i = 0, len = chunk.length; i < len; i++) {
46
- if (chunk[i] === 0x2e) {
47
- // .
48
- if ((i && chunk[i - 1] === 0x0a) || (!i && (!this.lastByte || this.lastByte === 0x0a))) {
49
- buf = chunk.slice(lastPos, i + 1);
50
- chunks.push(buf);
51
- chunks.push(Buffer.from('.'));
52
- chunklen += buf.length + 1;
53
- lastPos = i + 1;
54
- }
55
- } else if (chunk[i] === 0x0a) {
56
- // .
57
- if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {
58
- if (i > lastPos) {
59
- buf = chunk.slice(lastPos, i);
60
- chunks.push(buf);
61
- chunklen += buf.length + 2;
62
- } else {
63
- chunklen += 2;
64
- }
65
- chunks.push(Buffer.from('\r\n'));
66
- lastPos = i + 1;
67
- }
68
- }
69
- }
70
-
71
- if (chunklen) {
72
- // add last piece
73
- if (lastPos < chunk.length) {
74
- buf = chunk.slice(lastPos);
75
- chunks.push(buf);
76
- chunklen += buf.length;
77
- }
78
-
79
- this.outByteCount += chunklen;
80
- this.push(Buffer.concat(chunks, chunklen));
81
- } else {
82
- this.outByteCount += chunk.length;
83
- this.push(chunk);
84
- }
85
-
86
- this.lastByte = chunk[chunk.length - 1];
87
- done();
88
- }
89
-
90
- /**
91
- * Finalizes the stream with a dot on a single line
92
- */
93
- _flush(done) {
94
- let buf;
95
- if (this.lastByte === 0x0a) {
96
- buf = Buffer.from('.\r\n');
97
- } else if (this.lastByte === 0x0d) {
98
- buf = Buffer.from('\n.\r\n');
99
- } else {
100
- buf = Buffer.from('\r\n.\r\n');
101
- }
102
- this.outByteCount += buf.length;
103
- this.push(buf);
104
- done();
105
- }
106
- }
107
-
108
- module.exports = DataStream;
@@ -1,143 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Minimal HTTP/S proxy client
5
- */
6
-
7
- const net = require('net');
8
- const tls = require('tls');
9
- const urllib = require('url');
10
-
11
- /**
12
- * Establishes proxied connection to destinationPort
13
- *
14
- * httpProxyClient("http://localhost:3128/", 80, "google.com", function(err, socket){
15
- * socket.write("GET / HTTP/1.0\r\n\r\n");
16
- * });
17
- *
18
- * @param {String} proxyUrl proxy configuration, etg "http://proxy.host:3128/"
19
- * @param {Number} destinationPort Port to open in destination host
20
- * @param {String} destinationHost Destination hostname
21
- * @param {Function} callback Callback to run with the rocket object once connection is established
22
- */
23
- function httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {
24
- let proxy = urllib.parse(proxyUrl);
25
-
26
- // create a socket connection to the proxy server
27
- let options;
28
- let connect;
29
- let socket;
30
-
31
- options = {
32
- host: proxy.hostname,
33
- port: Number(proxy.port) ? Number(proxy.port) : proxy.protocol === 'https:' ? 443 : 80
34
- };
35
-
36
- if (proxy.protocol === 'https:') {
37
- // we can use untrusted proxies as long as we verify actual SMTP certificates
38
- options.rejectUnauthorized = false;
39
- connect = tls.connect.bind(tls);
40
- } else {
41
- connect = net.connect.bind(net);
42
- }
43
-
44
- // Error harness for initial connection. Once connection is established, the responsibility
45
- // to handle errors is passed to whoever uses this socket
46
- let finished = false;
47
- let tempSocketErr = err => {
48
- if (finished) {
49
- return;
50
- }
51
- finished = true;
52
- try {
53
- socket.destroy();
54
- } catch (E) {
55
- // ignore
56
- }
57
- callback(err);
58
- };
59
-
60
- let timeoutErr = () => {
61
- let err = new Error('Proxy socket timed out');
62
- err.code = 'ETIMEDOUT';
63
- tempSocketErr(err);
64
- };
65
-
66
- socket = connect(options, () => {
67
- if (finished) {
68
- return;
69
- }
70
-
71
- let reqHeaders = {
72
- Host: destinationHost + ':' + destinationPort,
73
- Connection: 'close'
74
- };
75
- if (proxy.auth) {
76
- reqHeaders['Proxy-Authorization'] = 'Basic ' + Buffer.from(proxy.auth).toString('base64');
77
- }
78
-
79
- socket.write(
80
- // HTTP method
81
- 'CONNECT ' +
82
- destinationHost +
83
- ':' +
84
- destinationPort +
85
- ' HTTP/1.1\r\n' +
86
- // HTTP request headers
87
- Object.keys(reqHeaders)
88
- .map(key => key + ': ' + reqHeaders[key])
89
- .join('\r\n') +
90
- // End request
91
- '\r\n\r\n'
92
- );
93
-
94
- let headers = '';
95
- let onSocketData = chunk => {
96
- let match;
97
- let remainder;
98
-
99
- if (finished) {
100
- return;
101
- }
102
-
103
- headers += chunk.toString('binary');
104
- if ((match = headers.match(/\r\n\r\n/))) {
105
- socket.removeListener('data', onSocketData);
106
-
107
- remainder = headers.substr(match.index + match[0].length);
108
- headers = headers.substr(0, match.index);
109
- if (remainder) {
110
- socket.unshift(Buffer.from(remainder, 'binary'));
111
- }
112
-
113
- // proxy connection is now established
114
- finished = true;
115
-
116
- // check response code
117
- match = headers.match(/^HTTP\/\d+\.\d+ (\d+)/i);
118
- if (!match || (match[1] || '').charAt(0) !== '2') {
119
- try {
120
- socket.destroy();
121
- } catch (E) {
122
- // ignore
123
- }
124
- return callback(new Error('Invalid response from proxy' + ((match && ': ' + match[1]) || '')));
125
- }
126
-
127
- socket.removeListener('error', tempSocketErr);
128
- socket.removeListener('timeout', timeoutErr);
129
- socket.setTimeout(0);
130
-
131
- return callback(null, socket);
132
- }
133
- };
134
- socket.on('data', onSocketData);
135
- });
136
-
137
- socket.setTimeout(httpProxyClient.timeout || 30 * 1000);
138
- socket.on('timeout', timeoutErr);
139
-
140
- socket.once('error', tempSocketErr);
141
- }
142
-
143
- module.exports = httpProxyClient;