@things-factory/integration-email 6.2.136

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 (38) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +0 -0
  3. package/dist-server/engine/connector/email.js +76 -0
  4. package/dist-server/engine/connector/email.js.map +1 -0
  5. package/dist-server/engine/connector/index.js +4 -0
  6. package/dist-server/engine/connector/index.js.map +1 -0
  7. package/dist-server/engine/index.js +5 -0
  8. package/dist-server/engine/index.js.map +1 -0
  9. package/dist-server/engine/task/email-send.js +74 -0
  10. package/dist-server/engine/task/email-send.js.map +1 -0
  11. package/dist-server/engine/task/index.js +4 -0
  12. package/dist-server/engine/task/index.js.map +1 -0
  13. package/dist-server/index.js +4 -0
  14. package/dist-server/index.js.map +1 -0
  15. package/dist-server/tsconfig.tsbuildinfo +1 -0
  16. package/helps/integration/connector/email-connector.ja.md +18 -0
  17. package/helps/integration/connector/email-connector.ko.md +18 -0
  18. package/helps/integration/connector/email-connector.md +18 -0
  19. package/helps/integration/connector/email-connector.ms.md +18 -0
  20. package/helps/integration/connector/email-connector.zh.md +17 -0
  21. package/helps/integration/task/email-send.ja.md +31 -0
  22. package/helps/integration/task/email-send.ko.md +31 -0
  23. package/helps/integration/task/email-send.md +31 -0
  24. package/helps/integration/task/email-send.ms.md +31 -0
  25. package/helps/integration/task/email-send.zh.md +31 -0
  26. package/package.json +33 -0
  27. package/server/engine/connector/email.ts +88 -0
  28. package/server/engine/connector/index.ts +1 -0
  29. package/server/engine/index.ts +2 -0
  30. package/server/engine/task/email-send.ts +85 -0
  31. package/server/engine/task/index.ts +1 -0
  32. package/server/index.ts +1 -0
  33. package/things-factory.config.js +1 -0
  34. package/translations/en.json +9 -0
  35. package/translations/ja.json +9 -0
  36. package/translations/ko.json +9 -0
  37. package/translations/ms.json +9 -0
  38. package/translations/zh.json +9 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ <!-- ## [Unreleased] -->
package/README.md ADDED
File without changes
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailConnector = void 0;
4
+ const integration_base_1 = require("@things-factory/integration-base");
5
+ class EmailConnector {
6
+ async ready(connectionConfigs) {
7
+ await Promise.all(connectionConfigs.map(this.connect.bind(this)));
8
+ integration_base_1.ConnectionManager.logger.info('email connections are ready');
9
+ }
10
+ checkConnectionInstance(domain, connectionName) {
11
+ var _a;
12
+ try {
13
+ const connection = integration_base_1.ConnectionManager.getConnectionInstanceByName(domain, connectionName);
14
+ return !!(((_a = connection === null || connection === void 0 ? void 0 : connection.client) === null || _a === void 0 ? void 0 : _a.connectionState) !== 'online');
15
+ }
16
+ catch (e) {
17
+ return false;
18
+ }
19
+ }
20
+ async connect(connection) {
21
+ var { endpoint, params: { user, pass } } = connection;
22
+ try {
23
+ const parsed = new URL(endpoint);
24
+ const protocol = parsed.protocol.replace(':', '').toLowerCase();
25
+ const host = parsed.hostname;
26
+ const port = parsed.port || protocol == 'smtp' ? 587 : protocol == 'smtps' ? 465 : undefined;
27
+ if (protocol !== 'smtp' && protocol !== 'smtps') {
28
+ throw 'protocol should be "smtp" or "smtps" in the endpoint';
29
+ }
30
+ if (!host) {
31
+ throw 'hostname should be provided in the endpoint';
32
+ }
33
+ integration_base_1.ConnectionManager.addConnectionInstance(connection, {
34
+ secure: protocol == 'smtps',
35
+ host,
36
+ port,
37
+ user,
38
+ pass,
39
+ close: () => { }
40
+ });
41
+ integration_base_1.ConnectionManager.logger.info(`Email(SMTP) connection(${connection.name}:${connection.endpoint}) is connected`);
42
+ }
43
+ catch (ex) {
44
+ integration_base_1.ConnectionManager.logger.info(`Email(SMTP) connection(${connection.name}:${connection.endpoint}) failed to connect`);
45
+ throw ex;
46
+ }
47
+ }
48
+ async disconnect(connection) {
49
+ var client = integration_base_1.ConnectionManager.removeConnectionInstance(connection);
50
+ client.close();
51
+ integration_base_1.ConnectionManager.logger.info(`email connection(${connection.name}) is disconnected`);
52
+ }
53
+ get parameterSpec() {
54
+ return [
55
+ {
56
+ type: 'string',
57
+ name: 'user',
58
+ label: 'email.user'
59
+ },
60
+ {
61
+ type: 'string',
62
+ name: 'pass',
63
+ label: 'email.pass'
64
+ }
65
+ ];
66
+ }
67
+ get taskPrefixes() {
68
+ return ['email'];
69
+ }
70
+ get help() {
71
+ return 'integration/connector/email-connector';
72
+ }
73
+ }
74
+ exports.EmailConnector = EmailConnector;
75
+ integration_base_1.ConnectionManager.registerConnector('email-connector', new EmailConnector());
76
+ //# sourceMappingURL=email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../server/engine/connector/email.ts"],"names":[],"mappings":";;;AAAA,uEAA2F;AAE3F,MAAa,cAAc;IACzB,KAAK,CAAC,KAAK,CAAC,iBAAiB;QAC3B,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAEjE,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAA;IAC9D,CAAC;IAED,uBAAuB,CAAC,MAAM,EAAE,cAAc;;QAC5C,IAAI;YACF,MAAM,UAAU,GAAG,oCAAiB,CAAC,2BAA2B,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;YAExF,OAAO,CAAC,CAAC,CAAC,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,0CAAE,eAAe,MAAK,QAAQ,CAAC,CAAA;SAC5D;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,KAAK,CAAA;SACb;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,UAAU;QACtB,IAAI,EACF,QAAQ,EACR,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EACvB,GAAG,UAAU,CAAA;QAEd,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;YAEhC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;YAC/D,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAA;YAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAA;YAE5F,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,OAAO,EAAE;gBAC/C,MAAM,sDAAsD,CAAA;aAC7D;YAED,IAAI,CAAC,IAAI,EAAE;gBACT,MAAM,6CAA6C,CAAA;aACpD;YAED,oCAAiB,CAAC,qBAAqB,CAAC,UAAU,EAAE;gBAClD,MAAM,EAAE,QAAQ,IAAI,OAAO;gBAC3B,IAAI;gBACJ,IAAI;gBACJ,IAAI;gBACJ,IAAI;gBACJ,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;aAChB,CAAC,CAAA;YAEF,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,QAAQ,gBAAgB,CAAC,CAAA;SAChH;QAAC,OAAO,EAAE,EAAE;YACX,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,QAAQ,qBAAqB,CAAC,CAAA;YACpH,MAAM,EAAE,CAAA;SACT;IACH,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,UAAsB;QACrC,IAAI,MAAM,GAAG,oCAAiB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAA;QACnE,MAAM,CAAC,KAAK,EAAE,CAAA;QAEd,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,UAAU,CAAC,IAAI,mBAAmB,CAAC,CAAA;IACvF,CAAC;IAED,IAAI,aAAa;QACf,OAAO;YACL;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,YAAY;aACpB;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,YAAY;aACpB;SACF,CAAA;IACH,CAAC;IAED,IAAI,YAAY;QACd,OAAO,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,uCAAuC,CAAA;IAChD,CAAC;CACF;AAnFD,wCAmFC;AAED,oCAAiB,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,IAAI,cAAc,EAAE,CAAC,CAAA","sourcesContent":["import { Connection, ConnectionManager, Connector } from '@things-factory/integration-base'\n\nexport class EmailConnector implements Connector {\n async ready(connectionConfigs) {\n await Promise.all(connectionConfigs.map(this.connect.bind(this)))\n\n ConnectionManager.logger.info('email connections are ready')\n }\n\n checkConnectionInstance(domain, connectionName): boolean {\n try {\n const connection = ConnectionManager.getConnectionInstanceByName(domain, connectionName)\n\n return !!(connection?.client?.connectionState !== 'online')\n } catch (e) {\n return false\n }\n }\n\n async connect(connection) {\n var {\n endpoint,\n params: { user, pass }\n } = connection\n\n try {\n const parsed = new URL(endpoint)\n\n const protocol = parsed.protocol.replace(':', '').toLowerCase()\n const host = parsed.hostname\n const port = parsed.port || protocol == 'smtp' ? 587 : protocol == 'smtps' ? 465 : undefined\n\n if (protocol !== 'smtp' && protocol !== 'smtps') {\n throw 'protocol should be \"smtp\" or \"smtps\" in the endpoint'\n }\n\n if (!host) {\n throw 'hostname should be provided in the endpoint'\n }\n\n ConnectionManager.addConnectionInstance(connection, {\n secure: protocol == 'smtps',\n host,\n port,\n user,\n pass,\n close: () => {}\n })\n\n ConnectionManager.logger.info(`Email(SMTP) connection(${connection.name}:${connection.endpoint}) is connected`)\n } catch (ex) {\n ConnectionManager.logger.info(`Email(SMTP) connection(${connection.name}:${connection.endpoint}) failed to connect`)\n throw ex\n }\n }\n\n async disconnect(connection: Connection) {\n var client = ConnectionManager.removeConnectionInstance(connection)\n client.close()\n\n ConnectionManager.logger.info(`email connection(${connection.name}) is disconnected`)\n }\n\n get parameterSpec() {\n return [\n {\n type: 'string',\n name: 'user',\n label: 'email.user'\n },\n {\n type: 'string',\n name: 'pass',\n label: 'email.pass'\n }\n ]\n }\n\n get taskPrefixes() {\n return ['email']\n }\n\n get help() {\n return 'integration/connector/email-connector'\n }\n}\n\nConnectionManager.registerConnector('email-connector', new EmailConnector())\n"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./email");
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/connector/index.ts"],"names":[],"mappings":";;AAAA,mBAAgB","sourcesContent":["import './email'\n"]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./connector");
4
+ require("./task");
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/engine/index.ts"],"names":[],"mappings":";;AAAA,uBAAoB;AACpB,kBAAe","sourcesContent":["import './connector'\nimport './task'\n"]}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const nodemailer = tslib_1.__importStar(require("nodemailer"));
5
+ const vm2_1 = require("vm2");
6
+ const integration_base_1 = require("@things-factory/integration-base");
7
+ const debug = require('debug')('things-factory:email-send');
8
+ async function emailSend(step, { logger, domain, data, lng, variables }) {
9
+ const { connection, params: { from, to, subject, contents, html } } = step;
10
+ const client = integration_base_1.ConnectionManager.getConnectionInstanceByName(domain, connection);
11
+ if (!client) {
12
+ debug(`no connection : ${connection}`);
13
+ throw new Error(`no connection : ${connection}`);
14
+ }
15
+ const { host, port = 587 /* SSL은 465 TLS는 587 */, secure = false /* SSL은 true TLS는 false */, user, pass } = client;
16
+ const transporter = nodemailer.createTransport({
17
+ host,
18
+ port,
19
+ secure,
20
+ auth: {
21
+ user,
22
+ pass
23
+ }
24
+ });
25
+ const vm = new vm2_1.VM({
26
+ sandbox: {
27
+ domain,
28
+ user,
29
+ lng,
30
+ data,
31
+ variables
32
+ }
33
+ });
34
+ const info = await transporter.sendMail({
35
+ from: vm.run('`' + from + '`'),
36
+ to: vm.run('`' + to + '`'),
37
+ subject: vm.run('`' + subject + '`'),
38
+ text: vm.run('`' + contents + '`'),
39
+ html: vm.run('`' + html + '`')
40
+ });
41
+ return {
42
+ data: info
43
+ };
44
+ }
45
+ emailSend.parameterSpec = [
46
+ {
47
+ type: 'string',
48
+ name: 'from',
49
+ label: 'email.from'
50
+ },
51
+ {
52
+ type: 'string',
53
+ name: 'to',
54
+ label: 'email.to'
55
+ },
56
+ {
57
+ type: 'string',
58
+ name: 'subject',
59
+ label: 'email.subject'
60
+ },
61
+ {
62
+ type: 'textarea',
63
+ name: 'contents',
64
+ label: 'email.contents'
65
+ },
66
+ {
67
+ type: 'textarea',
68
+ name: 'html',
69
+ label: 'email.html'
70
+ }
71
+ ];
72
+ emailSend.help = 'integration/task/email-send';
73
+ integration_base_1.TaskRegistry.registerTaskHandler('email-send', emailSend);
74
+ //# sourceMappingURL=email-send.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-send.js","sourceRoot":"","sources":["../../../server/engine/task/email-send.ts"],"names":[],"mappings":";;;AAAA,+DAAwC;AACxC,6BAAwB;AAExB,uEAAkF;AAElF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,2BAA2B,CAAC,CAAA;AAE3D,KAAK,UAAU,SAAS,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE;IACrE,MAAM,EACJ,UAAU,EACV,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAC9C,GAAG,IAAI,CAAA;IAER,MAAM,MAAM,GAAG,oCAAiB,CAAC,2BAA2B,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAChF,IAAI,CAAC,MAAM,EAAE;QACX,KAAK,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAA;QACtC,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAA;KACjD;IAED,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,CAAC,uBAAuB,EAAE,MAAM,GAAG,KAAK,CAAC,0BAA0B,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;IAElH,MAAM,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC;QAC7C,IAAI;QACJ,IAAI;QACJ,MAAM;QACN,IAAI,EAAE;YACJ,IAAI;YACJ,IAAI;SACL;KACF,CAAC,CAAA;IAEF,MAAM,EAAE,GAAG,IAAI,QAAE,CAAC;QAChB,OAAO,EAAE;YACP,MAAM;YACN,IAAI;YACJ,GAAG;YACH,IAAI;YACJ,SAAS;SACV;KACF,CAAC,CAAA;IAEF,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,QAAQ,CAAC;QACtC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;QAC9B,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC;QAC1B,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,CAAC;QACpC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,QAAQ,GAAG,GAAG,CAAC;QAClC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;KAC/B,CAAC,CAAA;IAEF,OAAO;QACL,IAAI,EAAE,IAAI;KACX,CAAA;AACH,CAAC;AAED,SAAS,CAAC,aAAa,GAAG;IACxB;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,YAAY;KACpB;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,UAAU;KAClB;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,eAAe;KACvB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,gBAAgB;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,YAAY;KACpB;CACF,CAAA;AAED,SAAS,CAAC,IAAI,GAAG,6BAA6B,CAAA;AAE9C,+BAAY,CAAC,mBAAmB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA","sourcesContent":["import * as nodemailer from 'nodemailer'\nimport { VM } from 'vm2'\n\nimport { ConnectionManager, TaskRegistry } from '@things-factory/integration-base'\n\nconst debug = require('debug')('things-factory:email-send')\n\nasync function emailSend(step, { logger, domain, data, lng, variables }) {\n const {\n connection,\n params: { from, to, subject, contents, html }\n } = step\n\n const client = ConnectionManager.getConnectionInstanceByName(domain, connection)\n if (!client) {\n debug(`no connection : ${connection}`)\n throw new Error(`no connection : ${connection}`)\n }\n\n const { host, port = 587 /* SSL은 465 TLS는 587 */, secure = false /* SSL은 true TLS는 false */, user, pass } = client\n\n const transporter = nodemailer.createTransport({\n host,\n port,\n secure,\n auth: {\n user,\n pass\n }\n })\n\n const vm = new VM({\n sandbox: {\n domain,\n user,\n lng,\n data,\n variables\n }\n })\n\n const info = await transporter.sendMail({\n from: vm.run('`' + from + '`'),\n to: vm.run('`' + to + '`'),\n subject: vm.run('`' + subject + '`'),\n text: vm.run('`' + contents + '`'),\n html: vm.run('`' + html + '`')\n })\n\n return {\n data: info\n }\n}\n\nemailSend.parameterSpec = [\n {\n type: 'string',\n name: 'from',\n label: 'email.from'\n },\n {\n type: 'string',\n name: 'to',\n label: 'email.to'\n },\n {\n type: 'string',\n name: 'subject',\n label: 'email.subject'\n },\n {\n type: 'textarea',\n name: 'contents',\n label: 'email.contents'\n },\n {\n type: 'textarea',\n name: 'html',\n label: 'email.html'\n }\n]\n\nemailSend.help = 'integration/task/email-send'\n\nTaskRegistry.registerTaskHandler('email-send', emailSend)\n"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./email-send");
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/task/index.ts"],"names":[],"mappings":";;AAAA,wBAAqB","sourcesContent":["import './email-send'\n"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./engine");
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;AAAA,oBAAiB","sourcesContent":["import './engine'\n"]}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/lerna/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../server/engine/connector/email.ts","../server/engine/connector/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/nodemailer/lib/dkim/index.d.ts","../../../node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts","../../../node_modules/@types/nodemailer/lib/xoauth2/index.d.ts","../../../node_modules/@types/nodemailer/lib/mailer/index.d.ts","../../../node_modules/@types/nodemailer/lib/mime-node/index.d.ts","../../../node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts","../../../node_modules/@types/nodemailer/lib/shared/index.d.ts","../../../node_modules/@types/nodemailer/lib/json-transport/index.d.ts","../../../node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts","../../../node_modules/@types/nodemailer/lib/ses-transport/index.d.ts","../../../node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts","../../../node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts","../../../node_modules/@types/nodemailer/lib/stream-transport/index.d.ts","../../../node_modules/@types/nodemailer/index.d.ts","../node_modules/vm2/index.d.ts","../server/engine/task/email-send.ts","../server/engine/task/index.ts","../server/engine/index.ts","../server/index.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"7a1971efcba559ea9002ada4c4e3c925004fb67a755300d53b5edf9399354900","8daa8e0d43f4c61657baf221659732c2c9b1ee8f7c3a960c2d2217b2d45ced0f","5568ef2168efb3fc047d345aa8c00296a8e41fa71c9b3692b4f1529e711e7360","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"7fd7fcbf021a5845bdd9397d4649fcf2fe17152d2098140fc723099a215d19ad","affectsGlobalScope":true},"df3389f71a71a38bc931aaf1ef97a65fada98f0a27f19dd12f8b8de2b0f4e461","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"8b809082dfeffc8cc4f3b9c59f55c0ff52ba12f5ae0766cb5c35deee83b8552e","affectsGlobalScope":true},"bd3f5d05b6b5e4bfcea7739a45f3ffb4a7f4a3442ba7baf93e0200799285b8f1","4c775c2fccabf49483c03cd5e3673f87c1ffb6079d98e7b81089c3def79e29c6","d4f9d3ae2fe1ae199e1c832cca2c44f45e0b305dfa2808afdd51249b6f4a5163","7525257b4aa35efc7a1bbc00f205a9a96c4e4ab791da90db41b77938c4e0c18e","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"674168aa3db414ea0a19b2a31d901b2d49705c7a495e43ffdc96928543010f8c","affectsGlobalScope":true},"fe1fd6afdfe77976d4c702f3746c05fb05a7e566845c890e0e970fe9376d6a90","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","afb1701fd4be413a8a5a88df6befdd4510c30a31372c07a4138facf61594c66d","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"c07146dbbbd8b347241b5df250a51e48f2d7bef19b1e187b1a3f20c849988ff1","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"ae5507fc333d637dec9f37c6b3f4d423105421ea2820a64818de55db85214d66","affectsGlobalScope":true},{"version":"0666f4c99b8688c7be5956df8fecf5d1779d3b22f8f2a88258ae7072c7b6026f","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","54e854615c4eafbdd3fd7688bd02a3aafd0ccf0e87c98f79d3e9109f047ce6b8","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","8221b00f271cf7f535a8eeec03b0f80f0929c7a16116e2d2df089b41066de69b","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","7fa32887f8a97909fca35ebba3740f8caf8df146618d8fff957a3f89f67a2f6a","9a9634296cca836c3308923ba7aa094fa6ed76bb1e366d8ddcf5c65888ab1024",{"version":"bddce945d552a963c9733db106b17a25474eefcab7fc990157a2134ef55d4954","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","4b55240c2a03b2c71e98a7fc528b16136faa762211c92e781a01c37821915ea6","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"94c086dff8dbc5998749326bc69b520e8e4273fb5b7b58b50e0210e0885dfcde","affectsGlobalScope":true},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true},"ebe5facd12fd7745cda5f4bc3319f91fb29dc1f96e57e9c6f8b260a7cc5b67ee","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","21c56c6e8eeacef15f63f373a29fab6a2b36e4705be7a528aae8c51469e2737b",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","6825eb4d1c8beb77e9ed6681c830326a15ebf52b171f83ffbca1b1574c90a3b0","1741975791f9be7f803a826457273094096e8bba7a50f8fa960d5ed2328cdbcc","6ec0d1c15d14d63d08ccb10d09d839bf8a724f6b4b9ed134a3ab5042c54a7721","75dabc9afdb451a85e6d46e9ca65ec82ead2256476c0686f671f3421923667a7","ddfc215bfbddf5854d80ab8fb0256bd802f2a8acb6be62f9e630041266d56cd5","2c3bcb8a4ea2fcb4208a06672af7540dd65bf08298d742f041ffa6cbe487cf80","1cce0460d75645fc40044c729da9a16c2e0dabe11a58b5e4bfd62ac840a1835d","c784a9f75a6f27cf8c43cc9a12c66d68d3beb2e7376e1babfae5ae4998ffbc4a","feb4c51948d875fdbbaa402dad77ee40cf1752b179574094b613d8ad98921ce1","a6d3984b706cefe5f4a83c1d3f0918ff603475a2a3afa9d247e4114f18b1f1ef","b457d606cabde6ea3b0bc32c23dc0de1c84bb5cb06d9e101f7076440fc244727","9d59919309a2d462b249abdefba8ca36b06e8e480a77b36c0d657f83a63af465","9faa2661daa32d2369ec31e583df91fd556f74bcbd036dab54184303dee4f311","b08de5693ec0119e033ced692f3ad0c0449c7331fd1d84033ea9b4b22e7f269c","47f99be907d29eb34194d881a0b2d302a09cca1d60c0569b06ec6d6c3cf84049","015052aa6ca562c22b8362cc5530d409b1ed39e45f691e9068e4c7fefc5b7313","4c076dcfe122f37c169c83eb4d5f3aaf9236fff538ad4adb202a3b1476195189","8547694bbf35e324d5bb64215ae218ab372807c759be08f9ce27a8adfc9af9fb","336b6d64b4cff6c2e09100b496e9870743d9c8005e718c18e6200bce7ec2975c","cdcc132f207d097d7d3aa75615ab9a2e71d6a478162dde8b67f88ea19f3e54de","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","d96cc6598148bf1a98fb2e8dcf01c63a4b3558bdaec6ef35e087fd0562eb40ec",{"version":"5ab630d466ac55baa6d32820378098404fc18ba9da6f7bc5df30c5dbb1cffae8","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":false,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":1,"noEmitOnError":true,"noImplicitAny":false,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":false,"target":4,"useDefineForClassFields":false},"fileIdsList":[[155],[157,160],[47],[83],[84,89,117],[85,96,97,104,114,125],[85,86,96,104],[87,126],[88,89,97,105],[89,114,122],[90,92,96,104],[83,91],[92,93],[96],[94,96],[83,96],[96,97,98,114,125],[96,97,98,111,114,117],[81,84,130],[92,96,99,104,114,125],[96,97,99,100,104,114,122,125],[99,101,114,122,125],[47,48,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132],[96,102],[103,125,130],[92,96,104,114],[105],[106],[83,107],[108,124,130],[109],[110],[96,111,112],[111,113,126,128],[84,96,114,115,116,117],[84,114,116],[114,115],[117],[118],[83,114],[96,120,121],[120,121],[89,104,114,122],[123],[104,124],[84,99,110,125],[89,126],[114,127],[103,128],[129],[84,89,96,98,107,114,125,128,130],[114,131],[133,135,137,141,142,143,144,145,146],[114,133],[96,133,135,137,138,140,147],[96,104,114,125,133,134,135,136,138,139,140,147],[114,133,137,138],[114,133,137,139],[133,135,137,138,140,147],[114,133,139],[96,104,114,122,133,136,138,140],[96,133,135,137,138,139,140,147],[96,114,133,135,136,137,138,139,140,147],[96,114,133,135,137,138,140,147],[99,114,133,140],[153,159],[157],[154,158],[156],[58,62,125],[58,114,125],[53],[55,58,122,125],[104,122],[133],[53,133],[55,58,104,125],[50,51,54,57,84,96,114,125],[50,56],[54,58,84,117,125,133],[84,133],[74,84,133],[52,53,133],[58],[52,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70,71,72,73,75,76,77,78,79,80],[58,65,66],[56,58,66,67],[57],[50,53,58],[58,62,66,67],[62],[56,58,61,125],[50,55,56,58,62,65],[84,114],[53,58,74,84,130,133],[96,97,106],[44],[44,45],[44,46,150],[44,147,148],[44,149],[44,151]],"referencedMap":[[156,1],[161,2],[47,3],[48,3],[83,4],[84,5],[85,6],[86,7],[87,8],[88,9],[89,10],[90,11],[91,12],[92,13],[93,13],[95,14],[94,15],[96,16],[97,17],[98,18],[82,19],[99,20],[100,21],[101,22],[133,23],[102,24],[103,25],[104,26],[105,27],[106,28],[107,29],[108,30],[109,31],[110,32],[111,33],[112,33],[113,34],[114,35],[116,36],[115,37],[117,38],[118,39],[119,40],[120,41],[121,42],[122,43],[123,44],[124,45],[125,46],[126,47],[127,48],[128,49],[129,50],[130,51],[131,52],[147,53],[134,54],[141,55],[137,56],[135,57],[138,58],[142,59],[143,55],[140,60],[139,61],[144,62],[145,63],[146,64],[136,65],[160,66],[158,67],[159,68],[157,69],[65,70],[72,71],[64,70],[79,72],[56,73],[55,74],[78,75],[73,76],[76,77],[58,78],[57,79],[53,80],[52,81],[75,82],[54,83],[59,84],[63,84],[81,85],[80,84],[67,86],[68,87],[70,88],[66,89],[69,90],[74,75],[61,91],[62,92],[71,93],[51,94],[77,95],[148,96],[45,97],[46,98],[151,99],[149,100],[150,101],[152,102]],"exportedModulesMap":[[156,1],[161,2],[47,3],[48,3],[83,4],[84,5],[85,6],[86,7],[87,8],[88,9],[89,10],[90,11],[91,12],[92,13],[93,13],[95,14],[94,15],[96,16],[97,17],[98,18],[82,19],[99,20],[100,21],[101,22],[133,23],[102,24],[103,25],[104,26],[105,27],[106,28],[107,29],[108,30],[109,31],[110,32],[111,33],[112,33],[113,34],[114,35],[116,36],[115,37],[117,38],[118,39],[119,40],[120,41],[121,42],[122,43],[123,44],[124,45],[125,46],[126,47],[127,48],[128,49],[129,50],[130,51],[131,52],[147,53],[134,54],[141,55],[137,56],[135,57],[138,58],[142,59],[143,55],[140,60],[139,61],[144,62],[145,63],[146,64],[136,65],[160,66],[158,67],[159,68],[157,69],[65,70],[72,71],[64,70],[79,72],[56,73],[55,74],[78,75],[73,76],[76,77],[58,78],[57,79],[53,80],[52,81],[75,82],[54,83],[59,84],[63,84],[81,85],[80,84],[67,86],[68,87],[70,88],[66,89],[69,90],[74,75],[61,91],[62,92],[71,93],[51,94],[77,95],[148,96],[45,97],[46,98],[151,99],[149,100],[150,101],[152,102]],"semanticDiagnosticsPerFile":[153,156,155,161,47,48,83,84,85,86,87,88,89,90,91,92,93,95,94,96,97,98,82,132,99,100,101,133,102,103,104,105,106,107,108,109,110,111,112,113,114,116,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,147,134,141,137,135,138,142,143,140,139,144,145,146,136,49,154,160,158,159,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,34,31,32,33,35,7,36,41,42,37,38,39,40,1,43,157,44,65,72,64,79,56,55,78,73,76,58,57,53,52,75,54,59,60,63,50,81,80,67,68,70,66,69,74,61,62,71,51,77,148,45,46,151,149,150,152]},"version":"4.9.5"}
@@ -0,0 +1,18 @@
1
+ # メールコネクター
2
+
3
+ ## 説明
4
+
5
+ メールコネクターは、メールサーバーに接続して電子メールを送受信するために使用されます。SMTP および SMTPS プロトコルをサポートしています。
6
+
7
+ ## 構成
8
+
9
+ ### エンドポイント
10
+
11
+ メールサーバーのエンドポイントを指定します。エンドポイントは `smtp://` または `smtps://` で始まる必要があります。
12
+
13
+ 例:_smtp://smtp.example.com:587_
14
+
15
+ ### パラメーター
16
+
17
+ - ユーザー:メールサーバーにログインするユーザー名を入力します。
18
+ - パスワード:メールサーバーにログインするパスワードを入力します。
@@ -0,0 +1,18 @@
1
+ # 이메일 커넥터
2
+
3
+ ## 설명
4
+
5
+ 이메일 커넥터는 이메일 서버에 연결하여 이메일을 송수신하는 데 사용됩니다. SMTP 및 SMTPS 프로토콜을 지원합니다.
6
+
7
+ ## 설정
8
+
9
+ ### 엔드포인트
10
+
11
+ 이메일 서버의 엔드포인트를 지정합니다. 엔드포인트는 `smtp://` 또는 `smtps://`로 시작해야 합니다.
12
+
13
+ 예: _smtp://smtp.example.com:587_
14
+
15
+ ### 매개변수
16
+
17
+ - 사용자: 이메일 서버에 로그인할 때 사용할 사용자 이름을 입력합니다.
18
+ - 비밀번호: 이메일 서버에 로그인할 때 사용할 비밀번호를 입력합니다.
@@ -0,0 +1,18 @@
1
+ # Email Connector
2
+
3
+ ## Description
4
+
5
+ The Email Connector is used to connect to an email server and send/receive emails. It supports SMTP and SMTPS protocols.
6
+
7
+ ## Configuration
8
+
9
+ ### Endpoint
10
+
11
+ Specify the endpoint of the email server. The endpoint should start with `smtp://` or `smtps://`.
12
+
13
+ Example: _smtp://smtp.example.com:587_
14
+
15
+ ### Parameters
16
+
17
+ - User: Enter the username to login to the email server.
18
+ - Password: Enter the password to login to the email server.
@@ -0,0 +1,18 @@
1
+ # Pemacu E-mel
2
+
3
+ ## Penerangan
4
+
5
+ Pemacu E-mel digunakan untuk menyambung ke pelayan e-mel dan menghantar/menerima e-mel. Ia menyokong protokol SMTP dan SMTPS.
6
+
7
+ ## Konfigurasi
8
+
9
+ ### Titik Akhir
10
+
11
+ Nyatakan titik akhir pelayan e-mel. Titik akhir harus bermula dengan `smtp://` atau `smtps://`.
12
+
13
+ Contoh: _smtp://smtp.example.com:587_
14
+
15
+ ### Parameter
16
+
17
+ - Pengguna: Masukkan nama pengguna untuk log masuk ke pelayan e-mel.
18
+ - Kata Laluan: Masukkan kata laluan untuk log masuk ke pelayan e-mel.
@@ -0,0 +1,17 @@
1
+ # InfluxDB Connector
2
+
3
+ ## 描述
4
+
5
+ InfluxDB 连接器使用 InfluxDB 客户端用于连接 InfluxDB 并执行操作。
6
+
7
+ ## 配置
8
+
9
+ ### 端点
10
+
11
+ 指定 InfluxDB 服务器的端点。
12
+
13
+ 例如:_http://localhost:8086_
14
+
15
+ ### 参数
16
+
17
+ - 令牌:输入连接到 InfluxDB 时使用的认证令牌。
@@ -0,0 +1,31 @@
1
+ # メール送信タスク
2
+
3
+ ## 説明
4
+
5
+ このタスクは、設定済みのメール接続を使用してメールを送信します。テキストおよび HTML 形式のメールに対応しています。
6
+
7
+ ## 設定
8
+
9
+ ### パラメータ
10
+
11
+ すべての項目はテンプレートリテラルが適用されているため、data、variables、domain などの変数を使用できます。
12
+
13
+ - **差出人(From)**: メールの差出人アドレスです。
14
+ - **宛先(To)**: メールの宛先アドレスです。複数のアドレスをコンマで区切って入力できます。
15
+ - **件名(Subject)**: メールの件名です。
16
+ - **内容(Contents)**: メールのテキスト内容です。
17
+ - **HTML**: メールの HTML 形式の内容です。
18
+
19
+ ## 使用法
20
+
21
+ 1. 接続設定でメール接続を構成します。
22
+ 2. 「メール送信」タイプのタスクインスタンスを作成します。
23
+ 3. 「差出人(From)」、「宛先(To)」、「件名(Subject)」、「内容(Contents)」、「HTML」といった必要なパラメータを提供します。
24
+ 4. タスクを実行してメールを送信します。
25
+
26
+ ## 注意事項
27
+
28
+ - メール接続が正しく設定され、正しい SMTP サーバー情報と認証資格情報を持っていることを確認します。
29
+ - 提供されたメールアドレスが有効で正しい形式であることを確認します。
30
+ - HTML 内容はオプションです。HTML 内容を提供する場合、メールは HTML 形式で送信されます。
31
+ - 「内容(Contents)」および「HTML」の両方が提供された場合、メールは複数/代替形式で送信され、受信者のメールクライアントが好みの形式を選択できます。
@@ -0,0 +1,31 @@
1
+ # 이메일 전송 작업
2
+
3
+ ## 설명
4
+
5
+ 이 작업은 구성된 이메일 연결을 사용하여 이메일을 전송합니다. 이 작업은 텍스트 및 HTML 형식의 이메일을 지원합니다.
6
+
7
+ ## 설정
8
+
9
+ ### 매개변수
10
+
11
+ 모든 항목은 [템플릿 리터럴](../concept/template-literal.md)이 적용되므로, data, variables, domain 등의 변수를 활용할 수 있다.
12
+
13
+ - **보내는 사람 (From)**: 이메일의 발신자 주소입니다.
14
+ - **받는 사람 (To)**: 이메일의 수신자 주소입니다. 여러 주소를 쉼표로 구분하여 입력할 수 있습니다.
15
+ - **제목 (Subject)**: 이메일의 제목입니다.
16
+ - **내용 (Contents)**: 이메일의 텍스트 내용입니다.
17
+ - **HTML**: 이메일의 HTML 형식 내용입니다.
18
+
19
+ ## 사용법
20
+
21
+ 1. 연결 설정에서 이메일 연결을 구성합니다.
22
+ 2. "이메일 전송" 유형의 작업 인스턴스를 만듭니다.
23
+ 3. "보내는 사람 (From)", "받는 사람 (To)", "제목 (Subject)", "내용 (Contents)", "HTML"과 같은 필요한 매개변수를 제공합니다.
24
+ 4. 작업을 실행하여 이메일을 전송합니다.
25
+
26
+ ## 주의사항
27
+
28
+ - 이메일 연결이 올바르게 구성되었고 올바른 SMTP 서버 정보와 인증 자격 증명을 갖고 있는지 확인합니다.
29
+ - 제공된 이메일 주소가 유효하고 올바른 형식인지 확인합니다.
30
+ - HTML 내용은 선택적입니다. HTML 내용을 제공하는 경우 이메일이 HTML 형식으로 전송됩니다.
31
+ - "내용 (Contents)" 및 "HTML" 모두 제공된 경우, 이메일은 다중/대체 형식으로 전송되어 수신자의 이메일 클라이언트가 선호하는 형식을 선택할 수 있습니다.
@@ -0,0 +1,31 @@
1
+ # Send Email Task
2
+
3
+ ## Description
4
+
5
+ This task sends an email using a configured email connection. It supports emails in both text and HTML formats.
6
+
7
+ ## Settings
8
+
9
+ ### Parameters
10
+
11
+ All items are applied with template literals, therefore, it's possible to utilize data, variables, domain, and other variables.
12
+
13
+ - **From**: The sender's address of the email.
14
+ - **To**: The recipient's address of the email. Multiple addresses can be separated by commas.
15
+ - **Subject**: The subject of the email.
16
+ - **Contents**: The text content of the email.
17
+ - **HTML**: The HTML format content of the email.
18
+
19
+ ## Usage
20
+
21
+ 1. Configure the email connection in the connection settings.
22
+ 2. Create an instance of the task type "Send Email".
23
+ 3. Provide the necessary parameters such as "From", "To", "Subject", "Contents", and "HTML".
24
+ 4. Execute the task to send the email.
25
+
26
+ ## Cautions
27
+
28
+ - Ensure the email connection is correctly configured with the right SMTP server information and authentication credentials.
29
+ - Ensure the provided email addresses are valid and in the correct format.
30
+ - The HTML content is optional. If HTML content is provided, the email will be sent in HTML format.
31
+ - If both "Contents" and "HTML" are provided, the email will be sent in multi/alternative format, allowing the recipient's email client to choose the preferred format.
@@ -0,0 +1,31 @@
1
+ # Tugas Mengirim Email
2
+
3
+ ## Deskripsi
4
+
5
+ Tugas ini mengirim email menggunakan koneksi email yang telah dikonfigurasi. Mendukung email dalam format teks dan HTML.
6
+
7
+ ## Pengaturan
8
+
9
+ ### Parameter
10
+
11
+ Semua item adalah aplikasi template literal, jadi, boleh guna data, variables, domain dan lain-lain variable.
12
+
13
+ - **Dari (From)**: Alamat pengirim email.
14
+ - **Kepada (To)**: Alamat penerima email. Beberapa alamat dapat dipisahkan dengan koma.
15
+ - **Subjek (Subject)**: Subjek email.
16
+ - **Konten (Contents)**: Konten teks email.
17
+ - **HTML**: Konten format HTML dari email.
18
+
19
+ ## Penggunaan
20
+
21
+ 1. Konfigurasikan koneksi email dalam pengaturan koneksi.
22
+ 2. Buat instance tugas dengan tipe "Send Email".
23
+ 3. Sediakan parameter yang diperlukan seperti "Dari (From)", "Kepada (To)", "Subjek (Subject)", "Konten (Contents)", dan "HTML".
24
+ 4. Jalankan tugas untuk mengirim email.
25
+
26
+ ## Perhatian
27
+
28
+ - Pastikan koneksi email dikonfigurasi dengan benar dengan informasi server SMTP yang tepat dan kredensial otentikasi.
29
+ - Pastikan alamat email yang diberikan valid dan dalam format yang benar.
30
+ - Konten HTML adalah opsional. Jika konten HTML disediakan, email akan dikirim dalam format HTML.
31
+ - Jika kedua "Konten (Contents)" dan "HTML" disediakan, email akan dikirim dalam format multi/alternatif, memungkinkan klien email penerima untuk memilih format yang disukai.
@@ -0,0 +1,31 @@
1
+ # 发送电子邮件任务
2
+
3
+ ## 描述
4
+
5
+ 此任务通过配置好的电子邮件连接发送电子邮件。支持文本和 HTML 格式的电子邮件。
6
+
7
+ ## 设置
8
+
9
+ ### 参数
10
+
11
+ 所有项目都应用了模板字面量,因此,可以使用 data、variables、domain 等变量。
12
+
13
+ - **发件人(From)**: 电子邮件的发件人地址。
14
+ - **收件人(To)**: 电子邮件的收件人地址。可以用逗号分隔多个地址。
15
+ - **主题(Subject)**: 电子邮件的主题。
16
+ - **内容(Contents)**: 电子邮件的文本内容。
17
+ - **HTML**: 电子邮件的 HTML 格式内容。
18
+
19
+ ## 使用方法
20
+
21
+ 1. 在连接设置中配置电子邮件连接。
22
+ 2. 创建“发送电子邮件”类型的任务实例。
23
+ 3. 提供所需的参数,如“发件人(From)”,“收件人(To)”,“主题(Subject)”,“内容(Contents)”和“HTML”。
24
+ 4. 执行任务发送电子邮件。
25
+
26
+ ## 注意事项
27
+
28
+ - 确保电子邮件连接正确配置了正确的 SMTP 服务器信息和认证凭据。
29
+ - 确保提供的电子邮件地址有效并且格式正确。
30
+ - HTML 内容是可选的。如果提供了 HTML 内容,电子邮件将以 HTML 格式发送。
31
+ - 如果同时提供了“内容(Contents)”和“HTML”,电子邮件将以多种/备选格式发送,允许收件人的电子邮件客户端选择首选格式。
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@things-factory/integration-email",
3
+ "version": "6.2.136",
4
+ "main": "dist-server/index.js",
5
+ "things-factory": true,
6
+ "author": "heartyoh <heartyoh@hatiolab.com>",
7
+ "description": "Module to provide email connection on integration engine",
8
+ "license": "MIT",
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "@things-factory:registry": "https://registry.npmjs.org"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/hatiolab/things-factory.git",
16
+ "directory": "packages/integration-email"
17
+ },
18
+ "scripts": {
19
+ "build": "npm run build:server",
20
+ "build:server": "npx tsc --p ./server/tsconfig.json",
21
+ "clean:server": "npx rimraf dist-server",
22
+ "clean": "npm run clean:server"
23
+ },
24
+ "dependencies": {
25
+ "@things-factory/integration-base": "^7.0.0-alpha.21",
26
+ "nodemailer": "^6.9.13",
27
+ "vm2": "^3.9.11"
28
+ },
29
+ "devDependencies": {
30
+ "@types/nodemailer": "^6.4.14"
31
+ },
32
+ "gitHead": "2277e4cdf0b11c839152f5bb08d529f6558423ed"
33
+ }
@@ -0,0 +1,88 @@
1
+ import { Connection, ConnectionManager, Connector } from '@things-factory/integration-base'
2
+
3
+ export class EmailConnector implements Connector {
4
+ async ready(connectionConfigs) {
5
+ await Promise.all(connectionConfigs.map(this.connect.bind(this)))
6
+
7
+ ConnectionManager.logger.info('email connections are ready')
8
+ }
9
+
10
+ checkConnectionInstance(domain, connectionName): boolean {
11
+ try {
12
+ const connection = ConnectionManager.getConnectionInstanceByName(domain, connectionName)
13
+
14
+ return !!(connection?.client?.connectionState !== 'online')
15
+ } catch (e) {
16
+ return false
17
+ }
18
+ }
19
+
20
+ async connect(connection) {
21
+ var {
22
+ endpoint,
23
+ params: { user, pass }
24
+ } = connection
25
+
26
+ try {
27
+ const parsed = new URL(endpoint)
28
+
29
+ const protocol = parsed.protocol.replace(':', '').toLowerCase()
30
+ const host = parsed.hostname
31
+ const port = parsed.port || protocol == 'smtp' ? 587 : protocol == 'smtps' ? 465 : undefined
32
+
33
+ if (protocol !== 'smtp' && protocol !== 'smtps') {
34
+ throw 'protocol should be "smtp" or "smtps" in the endpoint'
35
+ }
36
+
37
+ if (!host) {
38
+ throw 'hostname should be provided in the endpoint'
39
+ }
40
+
41
+ ConnectionManager.addConnectionInstance(connection, {
42
+ secure: protocol == 'smtps',
43
+ host,
44
+ port,
45
+ user,
46
+ pass,
47
+ close: () => {}
48
+ })
49
+
50
+ ConnectionManager.logger.info(`Email(SMTP) connection(${connection.name}:${connection.endpoint}) is connected`)
51
+ } catch (ex) {
52
+ ConnectionManager.logger.info(`Email(SMTP) connection(${connection.name}:${connection.endpoint}) failed to connect`)
53
+ throw ex
54
+ }
55
+ }
56
+
57
+ async disconnect(connection: Connection) {
58
+ var client = ConnectionManager.removeConnectionInstance(connection)
59
+ client.close()
60
+
61
+ ConnectionManager.logger.info(`email connection(${connection.name}) is disconnected`)
62
+ }
63
+
64
+ get parameterSpec() {
65
+ return [
66
+ {
67
+ type: 'string',
68
+ name: 'user',
69
+ label: 'email.user'
70
+ },
71
+ {
72
+ type: 'string',
73
+ name: 'pass',
74
+ label: 'email.pass'
75
+ }
76
+ ]
77
+ }
78
+
79
+ get taskPrefixes() {
80
+ return ['email']
81
+ }
82
+
83
+ get help() {
84
+ return 'integration/connector/email-connector'
85
+ }
86
+ }
87
+
88
+ ConnectionManager.registerConnector('email-connector', new EmailConnector())
@@ -0,0 +1 @@
1
+ import './email'
@@ -0,0 +1,2 @@
1
+ import './connector'
2
+ import './task'
@@ -0,0 +1,85 @@
1
+ import * as nodemailer from 'nodemailer'
2
+ import { VM } from 'vm2'
3
+
4
+ import { ConnectionManager, TaskRegistry } from '@things-factory/integration-base'
5
+
6
+ const debug = require('debug')('things-factory:email-send')
7
+
8
+ async function emailSend(step, { logger, domain, data, lng, variables }) {
9
+ const {
10
+ connection,
11
+ params: { from, to, subject, contents, html }
12
+ } = step
13
+
14
+ const client = ConnectionManager.getConnectionInstanceByName(domain, connection)
15
+ if (!client) {
16
+ debug(`no connection : ${connection}`)
17
+ throw new Error(`no connection : ${connection}`)
18
+ }
19
+
20
+ const { host, port = 587 /* SSL은 465 TLS는 587 */, secure = false /* SSL은 true TLS는 false */, user, pass } = client
21
+
22
+ const transporter = nodemailer.createTransport({
23
+ host,
24
+ port,
25
+ secure,
26
+ auth: {
27
+ user,
28
+ pass
29
+ }
30
+ })
31
+
32
+ const vm = new VM({
33
+ sandbox: {
34
+ domain,
35
+ user,
36
+ lng,
37
+ data,
38
+ variables
39
+ }
40
+ })
41
+
42
+ const info = await transporter.sendMail({
43
+ from: vm.run('`' + from + '`'),
44
+ to: vm.run('`' + to + '`'),
45
+ subject: vm.run('`' + subject + '`'),
46
+ text: vm.run('`' + contents + '`'),
47
+ html: vm.run('`' + html + '`')
48
+ })
49
+
50
+ return {
51
+ data: info
52
+ }
53
+ }
54
+
55
+ emailSend.parameterSpec = [
56
+ {
57
+ type: 'string',
58
+ name: 'from',
59
+ label: 'email.from'
60
+ },
61
+ {
62
+ type: 'string',
63
+ name: 'to',
64
+ label: 'email.to'
65
+ },
66
+ {
67
+ type: 'string',
68
+ name: 'subject',
69
+ label: 'email.subject'
70
+ },
71
+ {
72
+ type: 'textarea',
73
+ name: 'contents',
74
+ label: 'email.contents'
75
+ },
76
+ {
77
+ type: 'textarea',
78
+ name: 'html',
79
+ label: 'email.html'
80
+ }
81
+ ]
82
+
83
+ emailSend.help = 'integration/task/email-send'
84
+
85
+ TaskRegistry.registerTaskHandler('email-send', emailSend)
@@ -0,0 +1 @@
1
+ import './email-send'
@@ -0,0 +1 @@
1
+ import './engine'
@@ -0,0 +1 @@
1
+ export default {}
@@ -0,0 +1,9 @@
1
+ {
2
+ "label.email.from": "from",
3
+ "label.email.to": "to",
4
+ "label.email.subject": "subject",
5
+ "label.email.contents": "contents",
6
+ "label.email.html": "HTML",
7
+ "label.email.user": "user",
8
+ "label.email.pass": "pass"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "label.email.from": "from",
3
+ "label.email.to": "to",
4
+ "label.email.subject": "subject",
5
+ "label.email.contents": "contents",
6
+ "label.email.html": "HTML",
7
+ "label.email.user": "user",
8
+ "label.email.pass": "pass"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "label.email.from": "보내는 사람",
3
+ "label.email.to": "받는 사람",
4
+ "label.email.subject": "제목",
5
+ "label.email.contents": "내용",
6
+ "label.email.html": "HTML",
7
+ "label.email.user": "사용자",
8
+ "label.email.pass": "패스워드"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "label.email.from": "from",
3
+ "label.email.to": "to",
4
+ "label.email.subject": "subject",
5
+ "label.email.contents": "contents",
6
+ "label.email.html": "HTML",
7
+ "label.email.user": "user",
8
+ "label.email.pass": "pass"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "label.email.from": "from",
3
+ "label.email.to": "to",
4
+ "label.email.subject": "subject",
5
+ "label.email.contents": "contents",
6
+ "label.email.html": "HTML",
7
+ "label.email.user": "user",
8
+ "label.email.pass": "pass"
9
+ }