my-typescript-library-rahul52us 1.4.3 → 1.4.5

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.
@@ -0,0 +1,22 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section>
4
+ <mj-column>
5
+ <mj-image
6
+ width="250px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ ></mj-image>
9
+ </mj-column>
10
+ </mj-section>
11
+ <mj-section background-color="#fff">
12
+ <mj-column>
13
+ <mj-text font-size="30px" align="center">
14
+ Please find attachment.
15
+ </mj-text>
16
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
17
+ <mj-text font-size="18px" align="left" color="#555" line-height="30px">
18
+ </mj-text>
19
+ </mj-column>
20
+ </mj-section>
21
+ </mj-body>
22
+ </mjml>
@@ -0,0 +1,24 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section>
4
+ <mj-column>
5
+ <mj-image
6
+ width="250px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ ></mj-image>
9
+ </mj-column>
10
+ </mj-section>
11
+ <mj-section background-color="#fff">
12
+ <mj-column>
13
+ <mj-text font-size="30px" align="center">
14
+ Your password has been changed
15
+ </mj-text>
16
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
17
+ <mj-text font-size="18px" align="left" color="#555" line-height="30px">
18
+ Hi {{name}}! Your password on Avionics has been changed on {{date}}.
19
+ If you didn't initialize this change, please check your account on Avionics again.
20
+ </mj-text>
21
+ </mj-column>
22
+ </mj-section>
23
+ </mj-body>
24
+ </mjml>
@@ -0,0 +1,35 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section>
4
+ <mj-column>
5
+ <mj-image
6
+ width="250px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ ></mj-image>
9
+ </mj-column>
10
+ </mj-section>
11
+ <mj-section background-color="#fff">
12
+ <mj-column>
13
+ <mj-text font-size="30px" align="center">
14
+ You have requested to reset your password
15
+ </mj-text>
16
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
17
+ <mj-text font-size="18px" align="center" color="#555" line-height="30px"
18
+ >Hi {{name}}! A unique
19
+ link to reset your password has been generated for you. To reset your
20
+ password, click the following link and follow the
21
+ instructions</mj-text
22
+ >
23
+ <mj-button
24
+ background-color="#06adef"
25
+ border-radius="50px"
26
+ color="white"
27
+ font-size="15px"
28
+ href="{{url}}"
29
+ >
30
+ Reset password
31
+ </mj-button>
32
+ </mj-column>
33
+ </mj-section>
34
+ </mj-body>
35
+ </mjml>
@@ -0,0 +1,46 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section background-color="#fff">
4
+ <mj-column>
5
+ <mj-image
6
+ width="250px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ ></mj-image>
9
+ </mj-column>
10
+ </mj-section>
11
+ <mj-section background-color="#fff">
12
+ <mj-column>
13
+ <mj-text font-size="30px" align="center">
14
+ Team Invitation
15
+ </mj-text>
16
+ <mj-text font-size="18px" align="center" color="#555" line-height="30px"
17
+ >
18
+ You have been invited to join team "{{teamName}}"
19
+ </mj-text
20
+ >
21
+ <mj-button
22
+ background-color="#06adef"
23
+ border-radius="50px"
24
+ color="white"
25
+ font-size="15px"
26
+ href="{{url}}"
27
+ >
28
+ Join
29
+ </mj-button>
30
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
31
+ <mj-social icon-size="30px" mode="horizontal">
32
+ <mj-social-element name="facebook" href="https://jslancer.com/">
33
+ </mj-social-element>
34
+ <mj-social-element
35
+ name="google"
36
+ href="https://jslancer.com/"
37
+ padding="0 20px"
38
+ >
39
+ </mj-social-element>
40
+ <mj-social-element name="twitter" href="https://jslancer.com/">
41
+ </mj-social-element>
42
+ </mj-social>
43
+ </mj-column>
44
+ </mj-section>
45
+ </mj-body>
46
+ </mjml>
@@ -0,0 +1,26 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section>
4
+ <mj-column>
5
+ <mj-image
6
+ width="250px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ ></mj-image>
9
+ </mj-column>
10
+ </mj-section>
11
+ <mj-section background-color="#fff">
12
+ <mj-column>
13
+ <mj-text font-size="30px" align="center">
14
+ Invoice payment failed
15
+ </mj-text>
16
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
17
+ <mj-text font-size="18px" align="left" color="#555" line-height="30px">
18
+ Hi {{name}}! Your invoice payment failed. Your plan expire on {{date}}.
19
+ </mj-text>
20
+ <mj-text font-size="18px" align="left" color="#555" line-height="30px">
21
+ Please check your card and payment again to extend your plan.
22
+ </mj-text>
23
+ </mj-column>
24
+ </mj-section>
25
+ </mj-body>
26
+ </mjml>
@@ -0,0 +1,26 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section>
4
+ <mj-column>
5
+ <mj-image
6
+ width="250px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ ></mj-image>
9
+ </mj-column>
10
+ </mj-section>
11
+ <mj-section background-color="#fff">
12
+ <mj-column>
13
+ <mj-text font-size="30px" align="center">
14
+ Invoice payment successfully
15
+ </mj-text>
16
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
17
+ <mj-text font-size="18px" align="left" color="#555" line-height="30px">
18
+ Hi {{name}}! Your invoice payment successfully. Your plan expire on {{date}}.
19
+ </mj-text>
20
+ <mj-text font-size="18px" align="left" color="#555" line-height="30px">
21
+ You can check your invoice at this <a href="{{link}}">link</a>.
22
+ </mj-text>
23
+ </mj-column>
24
+ </mj-section>
25
+ </mj-body>
26
+ </mjml>
@@ -0,0 +1,26 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section>
4
+ <mj-column>
5
+ <mj-image
6
+ width="250px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ ></mj-image>
9
+ </mj-column>
10
+ </mj-section>
11
+ <mj-section background-color="#fff">
12
+ <mj-column>
13
+ <mj-text font-size="30px" align="center">
14
+ Trial will end
15
+ </mj-text>
16
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
17
+ <mj-text font-size="18px" align="left" color="#555" line-height="30px">
18
+ Hi {{name}}! Your trial will expire on {{date}}. We will automatically charge your money when the trial ends.
19
+ </mj-text>
20
+ <mj-text font-size="18px" align="left" color="#555" line-height="30px">
21
+ Please go to your plan detail if you want to change or unsubscribe subscription.
22
+ </mj-text>
23
+ </mj-column>
24
+ </mj-section>
25
+ </mj-body>
26
+ </mjml>
@@ -0,0 +1,33 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section background-color="#fff">
4
+ <mj-column>
5
+ <mj-image
6
+ width="250px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ ></mj-image>
9
+ </mj-column>
10
+ </mj-section>
11
+ <mj-section background-color="#fff">
12
+ <mj-column>
13
+ <mj-text font-size="30px" align="center">
14
+ Verify your email address
15
+ </mj-text>
16
+ <mj-text font-size="18px" align="center" color="#555" line-height="30px"
17
+ >Hi {{name}}! Please confirm that you want to use this as your
18
+ SequelString Console account email address.</mj-text
19
+ >
20
+ <mj-button
21
+ background-color="#06adef"
22
+ border-radius="50px"
23
+ color="white"
24
+ font-size="15px"
25
+ href="{{url}}"
26
+ >
27
+ Verify my email
28
+ </mj-button>
29
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
30
+ </mj-column>
31
+ </mj-section>
32
+ </mj-body>
33
+ </mjml>
@@ -0,0 +1,78 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1" padding="30px 20px">
3
+
4
+ <mj-section background-color="#fff" padding="30px 20px">
5
+ <mj-column>
6
+ <mj-image
7
+ width="200px"
8
+ src="https://sequelweb123.blob.core.windows.net/sequelweb/home/white-logo.png?sp=r&st=2024-08-07T04:37:52Z&se=2080-08-07T12:37:52Z&sv=2022-11-02&sr=b&sig=CgNEtfVu7BiQ0kXVjfLYK56F%2Fhxecc%2BfrfPXoU0WZMc%3D"
9
+ alt="Company Logo"
10
+ ></mj-image>
11
+ </mj-column>
12
+ </mj-section>
13
+ <mj-section background-color="#fff" padding="20px 20px">
14
+ <mj-column>
15
+ <mj-text
16
+ font-size="24px"
17
+ align="center"
18
+ color="#333"
19
+ font-family="Arial, sans-serif"
20
+ padding-bottom="20px"
21
+ font-weight="bold"
22
+ >
23
+ {{workflow}} Approval Notification
24
+ </mj-text>
25
+ <mj-divider border-color="#06adef" width="50px" border-width="2px"></mj-divider>
26
+ <mj-text
27
+ font-size="16px"
28
+ align="center"
29
+ color="#555"
30
+ line-height="24px"
31
+ font-family="Arial, sans-serif"
32
+ padding-top="20px"
33
+ padding-bottom="10px"
34
+ >
35
+ Hi {{approver}},<mj-raw><br /><br /></mj-raw>
36
+ {{comments}}.<mj-raw><br /><br /></mj-raw>
37
+ Here are the details:<mj-raw><br /></mj-raw>
38
+ To view the document and further details, click the button below:<mj-raw><br /><br /></mj-raw>
39
+ </mj-text>
40
+ <mj-button
41
+ background-color="#06adef"
42
+ border-radius="50px"
43
+ color="white"
44
+ font-size="15px"
45
+ href="{{documentUrl}}"
46
+ font-family="Arial, sans-serif"
47
+ padding="15px 30px"
48
+ align="center"
49
+ >
50
+ View Document
51
+ </mj-button>
52
+ </mj-column>
53
+ </mj-section>
54
+ <mj-section background-color="#f1f1f1" padding="20px 20px">
55
+ <mj-column>
56
+ <mj-text
57
+ font-size="14px"
58
+ align="center"
59
+ color="#888"
60
+ line-height="20px"
61
+ font-family="Arial, sans-serif"
62
+ >
63
+ If you have any questions, please contact us at <a href="mailto:support@sequelstring.com" style="color:#06adef;">support@sequelstring.com</a>.
64
+ </mj-text>
65
+ <mj-text
66
+ font-size="12px"
67
+ align="center"
68
+ color="#888"
69
+ line-height="20px"
70
+ font-family="Arial, sans-serif"
71
+ padding-top="10px"
72
+ >
73
+ &copy; 2024 SequelString. All rights reserved.
74
+ </mj-text>
75
+ </mj-column>
76
+ </mj-section>
77
+ </mj-body>
78
+ </mjml>
@@ -0,0 +1,113 @@
1
+ <mjml>
2
+ <mj-body background-color="#f1f1f1">
3
+ <mj-section>
4
+ <mj-column>
5
+ <mj-image
6
+ width="200px"
7
+ src="https://www.sequelstring.com/_next/image?url=%2Fimages%2Flogo.webp&w=256&q=100"
8
+ alt="Company Logo"
9
+ ></mj-image>
10
+ </mj-column>
11
+ </mj-section>
12
+ <mj-section background-color="#fff">
13
+ <mj-column>
14
+ <mj-text
15
+ font-size="30px"
16
+ align="center"
17
+ color="#333"
18
+ font-family="Arial, sans-serif"
19
+ padding-bottom="20px"
20
+ >
21
+ Welcome to the Sequel Flow Platform!
22
+ </mj-text>
23
+ <mj-divider border-color="#06adef" width="100px"></mj-divider>
24
+ <mj-text
25
+ font-size="18px"
26
+ align="center"
27
+ color="#555"
28
+ line-height="24px"
29
+ font-family="Arial, sans-serif"
30
+ padding-top="20px"
31
+ >
32
+ Hi {{name}},<mj-raw><br /><br /></mj-raw> You've been granted access
33
+ to the <strong>{{workflow_name}}</strong> on our
34
+ platform!<mj-raw><br /><br /></mj-raw> Your assigned level for this
35
+ workflow: <strong>{{level}}</strong>
36
+ <mj-raw><br /></mj-raw>
37
+ Your assigned role for this workflow: <strong>{{role}}</strong>
38
+ <mj-raw><br /></mj-raw>
39
+ Your assigned designation for this workflow:
40
+ <strong>{{designation}}</strong>
41
+ <mj-raw><br /><br /></mj-raw>
42
+
43
+ Your login credentials:<mj-raw><br /></mj-raw>
44
+ <strong>Username:</strong> {{username}}
45
+ <mj-raw><br /></mj-raw>
46
+ {{#if password}}
47
+ <strong>Password:</strong> {{password}}
48
+ <mj-raw><br /><br /></mj-raw>
49
+ {{/if}} To get started with the Sequel Flow, simply click the button
50
+ below:<mj-raw><br /><br /></mj-raw>
51
+ </mj-text>
52
+
53
+ <mj-text
54
+ font-size="18px"
55
+ align="center"
56
+ color="#555"
57
+ line-height="24px"
58
+ font-family="Arial, sans-serif"
59
+ padding-top="20px"
60
+ >
61
+ {{#if verifyTokenUrl}}
62
+ <strong>Note :- </strong>"Your account is currently inactive. Click
63
+ here to activate it." {{/if}}
64
+ <mj-raw><br /></mj-raw>
65
+ </mj-text>
66
+ {{#if verifyTokenUrl}}
67
+ <mj-button
68
+ background-color="#06adef"
69
+ border-radius="50px"
70
+ color="white"
71
+ font-size="15px"
72
+ href="{{verifyTokenUrl}}"
73
+ font-family="Arial, sans-serif"
74
+ padding="15px 30px"
75
+ >
76
+ Active Account
77
+ </mj-button>
78
+ {{/if}}
79
+ <mj-raw><br /><br /></mj-raw>
80
+
81
+ <mj-button
82
+ background-color="#06adef"
83
+ border-radius="50px"
84
+ color="white"
85
+ font-size="15px"
86
+ href="{{url}}"
87
+ font-family="Arial, sans-serif"
88
+ padding="15px 30px"
89
+ >
90
+ Access Workflow
91
+ </mj-button>
92
+ </mj-column>
93
+ </mj-section>
94
+ <mj-section padding="20px 0">
95
+ <mj-column>
96
+ <mj-text
97
+ font-size="14px"
98
+ align="center"
99
+ color="#999"
100
+ font-family="Arial, sans-serif"
101
+ >
102
+ If you didn't request access or need further assistance, please
103
+ contact our support team at
104
+ <a
105
+ href="mailto:support@example.com"
106
+ style="color: #06adef; text-decoration: none"
107
+ >support@example.com</a
108
+ >
109
+ </mj-text>
110
+ </mj-column>
111
+ </mj-section>
112
+ </mj-body>
113
+ </mjml>
@@ -16,15 +16,20 @@ const handlebars_1 = __importDefault(require("handlebars"));
16
16
  const mjml_1 = __importDefault(require("mjml"));
17
17
  const fs_1 = __importDefault(require("fs"));
18
18
  const path_1 = __importDefault(require("path"));
19
+ // Ensure __dirname works (CommonJS)
20
+ const templatesDir = path_1.default.join(__dirname, '../email-templates');
19
21
  function compileEmailTemplate({ fileName, data }) {
20
22
  return __awaiter(this, void 0, void 0, function* () {
21
- const templatePath = path_1.default.resolve('src/email-templates', fileName);
22
- // Read the MJML template
23
- const mjMail = yield fs_1.default.promises.readFile(templatePath, 'utf8');
24
- // Compile with Handlebars
25
- const template = handlebars_1.default.compile(mjMail)(data);
26
- // Convert MJML to HTML
27
- return (0, mjml_1.default)(template).html.toString();
23
+ try {
24
+ const templatePath = path_1.default.join(templatesDir, fileName);
25
+ const mjMail = yield fs_1.default.promises.readFile(templatePath, 'utf8');
26
+ const template = handlebars_1.default.compile(mjMail)(data);
27
+ return (0, mjml_1.default)(template).html.toString();
28
+ }
29
+ catch (error) {
30
+ console.error(`Error reading template: ${error.message}`);
31
+ throw new Error(`Template file "${fileName}" not found in ${templatesDir}`);
32
+ }
28
33
  });
29
34
  }
30
35
  exports.default = compileEmailTemplate;
@@ -1 +1 @@
1
- {"version":3,"file":"compile-email-template.js","sourceRoot":"","sources":["../../src/helpers/compile-email-template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,4DAAoC;AACpC,gDAA6B;AAC7B,4CAAoB;AACpB,gDAAwB;AAoBxB,SAA8B,oBAAoB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAS;;QAC1E,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;QAEnE,yBAAyB;QACzB,MAAM,MAAM,GAAG,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAEhE,0BAA0B;QAC1B,MAAM,QAAQ,GAAG,oBAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;QAElD,uBAAuB;QACvB,OAAO,IAAA,cAAS,EAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC7C,CAAC;CAAA;AAXD,uCAWC"}
1
+ {"version":3,"file":"compile-email-template.js","sourceRoot":"","sources":["../../src/helpers/compile-email-template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,4DAAoC;AACpC,gDAA6B;AAC7B,4CAAoB;AACpB,gDAAwB;AAExB,oCAAoC;AACpC,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAoBhE,SAA8B,oBAAoB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAS;;QAC1E,IAAI;YACF,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YACvD,MAAM,MAAM,GAAG,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YAChE,MAAM,QAAQ,GAAG,oBAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;YAClD,OAAO,IAAA,cAAS,EAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;SAC5C;QAAC,OAAO,KAAU,EAAE;YACnB,OAAO,CAAC,KAAK,CAAC,2BAA2B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,kBAAkB,QAAQ,kBAAkB,YAAY,EAAE,CAAC,CAAC;SAC7E;IACH,CAAC;CAAA;AAVD,uCAUC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-typescript-library-rahul52us",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "A reusable TypeScript utility library.",
5
5
  "main": "dist/server.js",
6
6
  "types": "dist/types/server.d.ts",
@@ -9,6 +9,7 @@
9
9
  "build": "tsc",
10
10
  "start": "node dist/server.js",
11
11
  "lint": "eslint .",
12
+ "postbuild": "xcopy src\\email-templates dist\\email-templates /E /I /Y",
12
13
  "lint:fix": "eslint . --fix"
13
14
  },
14
15
  "keywords": [
@@ -3,6 +3,9 @@ import mjml2html from 'mjml';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
5
 
6
+ // Ensure __dirname works (CommonJS)
7
+ const templatesDir = path.join(__dirname, '../email-templates');
8
+
6
9
  type Props = {
7
10
  fileName: string;
8
11
  data: {
@@ -22,14 +25,13 @@ type Props = {
22
25
  };
23
26
 
24
27
  export default async function compileEmailTemplate({ fileName, data }: Props): Promise<string> {
25
- const templatePath = path.resolve('src/email-templates', fileName);
26
-
27
- // Read the MJML template
28
- const mjMail = await fs.promises.readFile(templatePath, 'utf8');
29
-
30
- // Compile with Handlebars
31
- const template = handlebars.compile(mjMail)(data);
32
-
33
- // Convert MJML to HTML
34
- return mjml2html(template).html.toString();
28
+ try {
29
+ const templatePath = path.join(templatesDir, fileName);
30
+ const mjMail = await fs.promises.readFile(templatePath, 'utf8');
31
+ const template = handlebars.compile(mjMail)(data);
32
+ return mjml2html(template).html.toString();
33
+ } catch (error: any) {
34
+ console.error(`Error reading template: ${error.message}`);
35
+ throw new Error(`Template file "${fileName}" not found in ${templatesDir}`);
36
+ }
35
37
  }