startx 0.0.1 → 0.1.0
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/.prettierignore +0 -13
- package/.prettierrc.js +52 -52
- package/.vscode/launch.json +32 -0
- package/.vscode/settings.json +9 -3
- package/apps/core-server/.env.example +18 -24
- package/apps/core-server/Dockerfile +35 -61
- package/apps/core-server/eslint.config.ts +7 -0
- package/apps/core-server/package.json +41 -52
- package/apps/core-server/src/config/custom-type.ts +2 -40
- package/apps/core-server/src/events/index.ts +37 -37
- package/apps/core-server/src/index.ts +4 -13
- package/apps/core-server/src/middlewares/auth-middleware.ts +24 -7
- package/apps/core-server/src/middlewares/cors-middleware.ts +7 -6
- package/apps/core-server/src/middlewares/error-middleware.ts +7 -4
- package/apps/core-server/src/middlewares/logger-middleware.ts +81 -21
- package/apps/core-server/src/middlewares/notfound-middleware.ts +6 -14
- package/apps/core-server/src/middlewares/serve-static.ts +30 -24
- package/apps/core-server/src/routes/files/router.ts +9 -7
- package/apps/core-server/src/routes/server.ts +30 -36
- package/apps/core-server/tsdown.config.ts +4 -3
- package/biome.json +58 -60
- package/configs/eslint-config/package.json +16 -19
- package/configs/eslint-config/src/configs/base.ts +185 -225
- package/configs/eslint-config/src/configs/extend.ts +3 -0
- package/configs/eslint-config/src/configs/frontend.ts +81 -56
- package/configs/eslint-config/src/configs/node.ts +6 -6
- package/configs/eslint-config/src/plugin.ts +1 -0
- package/configs/eslint-config/src/rules/index.ts +8 -12
- package/configs/eslint-config/src/rules/no-json-parse-json-stringify.test.ts +30 -17
- package/configs/eslint-config/src/rules/no-json-parse-json-stringify.ts +52 -49
- package/configs/eslint-config/src/rules/no-uncaught-json-parse.ts +43 -45
- package/configs/tsdown-config/package.json +10 -3
- package/configs/typescript-config/package.json +10 -1
- package/configs/typescript-config/tsconfig.common.json +3 -3
- package/configs/vitest-config/dist/base.mjs +1 -0
- package/configs/vitest-config/dist/frontend.mjs +1 -0
- package/configs/vitest-config/dist/node.mjs +1 -0
- package/configs/vitest-config/package.json +12 -0
- package/configs/vitest-config/src/base.ts +17 -29
- package/configs/vitest-config/src/index.ts +1 -0
- package/package.json +21 -13
- package/packages/@repo/constants/eslint.config.ts +4 -0
- package/packages/@repo/constants/package.json +16 -0
- package/packages/@repo/constants/src/index.ts +8 -8
- package/packages/@repo/db/eslint.config.ts +4 -0
- package/packages/@repo/db/package.json +16 -8
- package/packages/@repo/db/src/index.ts +26 -20
- package/packages/@repo/db/src/schema/common.ts +45 -49
- package/packages/@repo/env/eslint.config.ts +4 -0
- package/packages/@repo/env/package.json +39 -0
- package/packages/@repo/env/src/default-env.ts +12 -0
- package/packages/@repo/env/src/define-env.ts +70 -0
- package/packages/@repo/env/src/index.ts +2 -0
- package/packages/@repo/env/src/utils.ts +52 -0
- package/packages/@repo/env/tsconfig.json +7 -0
- package/packages/@repo/lib/eslint.config.ts +4 -0
- package/packages/@repo/lib/package.json +34 -34
- package/packages/@repo/lib/src/bucket-module/file-storage.ts +50 -49
- package/packages/@repo/lib/src/bucket-module/index.ts +3 -0
- package/packages/@repo/lib/src/bucket-module/s3-storage.ts +120 -114
- package/packages/@repo/lib/src/bucket-module/utils.ts +10 -11
- package/packages/@repo/lib/src/{cookie-module.ts → cookie-module/cookie-module.ts} +48 -42
- package/packages/@repo/lib/src/cookie-module/index.ts +1 -0
- package/packages/@repo/lib/src/extra/index.ts +1 -0
- package/packages/@repo/lib/src/extra/pagination-module.ts +35 -0
- package/packages/@repo/lib/src/{token-module.ts → extra/token-module.ts} +12 -5
- package/packages/@repo/lib/src/file-system-module/index.ts +170 -0
- package/packages/@repo/lib/src/{hashing-module.ts → hashing-module/index.ts} +9 -9
- package/packages/@repo/lib/src/index.ts +0 -26
- package/packages/@repo/lib/src/mail-module/index.ts +2 -0
- package/packages/@repo/lib/src/mail-module/mock.ts +8 -8
- package/packages/@repo/lib/src/mail-module/nodemailer.ts +17 -7
- package/packages/@repo/lib/src/notification-module/index.ts +1 -172
- package/packages/@repo/lib/src/notification-module/push-notification.ts +97 -90
- package/packages/@repo/lib/src/{oauth2-client.ts → oauth2-module/index.ts} +107 -109
- package/packages/@repo/lib/src/otp-module/index.ts +91 -0
- package/packages/@repo/lib/src/session-module/index.ts +113 -0
- package/packages/@repo/lib/src/utils.ts +43 -42
- package/packages/@repo/lib/src/validation-module/index.ts +242 -0
- package/packages/@repo/logger/eslint.config.ts +4 -0
- package/packages/@repo/logger/package.json +40 -0
- package/packages/@repo/logger/src/index.ts +2 -0
- package/packages/@repo/logger/src/logger.ts +72 -0
- package/packages/@repo/{lib/src/logger-module → logger/src}/memory-profiler.ts +64 -65
- package/packages/@repo/logger/tsconfig.json +7 -0
- package/packages/@repo/mail/eslint.config.ts +4 -0
- package/packages/@repo/mail/package.json +10 -3
- package/packages/@repo/mail/src/emails/admin/OtpEmail.tsx +169 -168
- package/packages/@repo/mail/src/index.ts +1 -2
- package/packages/@repo/mail/tsconfig.json +3 -3
- package/packages/@repo/redis/dist/index.d.mts +3 -0
- package/packages/@repo/redis/dist/index.mjs +5 -0
- package/packages/@repo/redis/dist/lib/redis-client.d.mts +7 -0
- package/packages/@repo/redis/dist/lib/redis-client.mjs +25 -0
- package/packages/@repo/redis/dist/lib/redis-client.mjs.map +1 -0
- package/packages/@repo/redis/dist/lib/redis-module.d.mts +5 -0
- package/packages/@repo/redis/dist/lib/redis-module.mjs +6 -0
- package/packages/@repo/redis/dist/lib/redis-module.mjs.map +1 -0
- package/packages/@repo/redis/eslint.config.ts +4 -0
- package/packages/@repo/redis/package.json +13 -10
- package/packages/@repo/redis/src/index.ts +2 -2
- package/packages/@repo/redis/src/lib/redis-client.ts +36 -23
- package/packages/@repo/redis/src/lib/redis-module.ts +69 -3
- package/packages/cli/dist/index.mjs +203 -0
- package/packages/cli/eslint.config.ts +4 -0
- package/packages/cli/package.json +44 -0
- package/packages/cli/tsconfig.json +12 -0
- package/packages/cli/tsdown.config.ts +17 -0
- package/packages/ui/components.json +0 -1
- package/packages/ui/eslint.config.ts +4 -0
- package/packages/ui/package.json +16 -3
- package/packages/ui/postcss.config.mjs +9 -9
- package/packages/ui/src/components/lib/utils.ts +53 -53
- package/packages/ui/src/components/ui/alert-dialog.tsx +118 -116
- package/packages/ui/src/components/ui/avatar.tsx +52 -53
- package/packages/ui/src/components/ui/badge.tsx +45 -46
- package/packages/ui/src/components/ui/breadcrumb.tsx +108 -109
- package/packages/ui/src/components/ui/card.tsx +91 -92
- package/packages/ui/src/components/ui/carousel.tsx +243 -243
- package/packages/ui/src/components/ui/checkbox.tsx +32 -32
- package/packages/ui/src/components/ui/command.tsx +144 -155
- package/packages/ui/src/components/ui/dialog.tsx +124 -127
- package/packages/ui/src/components/ui/form.tsx +166 -165
- package/packages/ui/src/components/ui/input-otp.tsx +74 -76
- package/packages/ui/src/components/ui/input.tsx +19 -21
- package/packages/ui/src/components/ui/multiple-select.tsx +4 -4
- package/packages/ui/src/{components/lucide.tsx → lucide.ts} +3 -3
- package/packages/ui/tailwind.config.ts +94 -94
- package/packages/ui/tsconfig.json +7 -1
- package/pnpm-workspace.yaml +41 -1
- package/turbo.json +20 -27
- package/apps/core-server/eslint.config.mjs +0 -47
- package/configs/eslint-config/src/rules/no-dynamic-import-template.ts +0 -32
- package/configs/eslint-config/src/rules/no-plain-errors.ts +0 -50
- package/configs/eslint-config/tsdown.config.ts +0 -11
- package/packages/@repo/constants/eslint.config.mjs +0 -21
- package/packages/@repo/db/eslint.config.mjs +0 -21
- package/packages/@repo/lib/eslint.config.mjs +0 -49
- package/packages/@repo/lib/src/command-module.ts +0 -77
- package/packages/@repo/lib/src/constants.ts +0 -3
- package/packages/@repo/lib/src/custom-type.ts +0 -54
- package/packages/@repo/lib/src/env.ts +0 -13
- package/packages/@repo/lib/src/file-system/index.ts +0 -90
- package/packages/@repo/lib/src/logger-module/log-config.ts +0 -16
- package/packages/@repo/lib/src/logger-module/logger.ts +0 -78
- package/packages/@repo/lib/src/mail-module/api.ts +0 -0
- package/packages/@repo/lib/src/otp-module.ts +0 -98
- package/packages/@repo/lib/src/pagination-module.ts +0 -49
- package/packages/@repo/lib/src/user-session.ts +0 -117
- package/packages/@repo/lib/src/validation-module.ts +0 -187
- package/packages/@repo/mail/tsconfig.build.json +0 -14
- package/packages/@repo/mail/tsdown.config.ts +0 -9
- package/packages/@repo/redis/eslint.config.mjs +0 -8
- package/packages/ui/eslint.config.mjs +0 -18
|
@@ -1,65 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
private
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.state = state;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
start(): void {
|
|
15
|
-
const usage = process.memoryUsage().heapUsed;
|
|
16
|
-
const now = Date.now();
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
|
|
23
|
-
if (this.state === "off") return;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
1
|
+
import { logger } from "./logger.js";
|
|
2
|
+
|
|
3
|
+
export class MemoryProfiler {
|
|
4
|
+
private startUsage: number | null = null;
|
|
5
|
+
private lastUsage: number | null = null;
|
|
6
|
+
private startTime: number | null = null;
|
|
7
|
+
private lastTime: number | null = null;
|
|
8
|
+
private state: "off" | "on" = "on";
|
|
9
|
+
|
|
10
|
+
setState(state: "on" | "off") {
|
|
11
|
+
this.state = state;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
start(): void {
|
|
15
|
+
const usage = process.memoryUsage().heapUsed;
|
|
16
|
+
const now = Date.now();
|
|
17
|
+
|
|
18
|
+
this.startUsage = usage;
|
|
19
|
+
this.lastUsage = usage;
|
|
20
|
+
this.startTime = now;
|
|
21
|
+
this.lastTime = now;
|
|
22
|
+
|
|
23
|
+
if (this.state === "off") return;
|
|
24
|
+
|
|
25
|
+
logger.info("Profiler started", {
|
|
26
|
+
logType: "steps",
|
|
27
|
+
heap: this.formatMB(usage),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
at(label = ""): void {
|
|
32
|
+
if (!this.startUsage || !this.startTime) {
|
|
33
|
+
throw new Error("Profiler not started. Call .start() first.");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const usage = process.memoryUsage().heapUsed;
|
|
37
|
+
const now = Date.now();
|
|
38
|
+
|
|
39
|
+
const deltaFromStart = usage - this.startUsage;
|
|
40
|
+
const deltaFromLast = usage - (this.lastUsage ?? usage);
|
|
41
|
+
|
|
42
|
+
const timeFromStart = now - this.startTime;
|
|
43
|
+
const timeFromLast = now - (this.lastTime ?? now);
|
|
44
|
+
|
|
45
|
+
if (this.state === "on") {
|
|
46
|
+
logger.info("Profiler checkpoint", {
|
|
47
|
+
logType: "steps",
|
|
48
|
+
label,
|
|
49
|
+
sinceStartMB: this.formatMB(deltaFromStart),
|
|
50
|
+
sinceLastMB: this.formatMB(deltaFromLast),
|
|
51
|
+
sinceStartMS: timeFromStart,
|
|
52
|
+
sinceLastMS: timeFromLast,
|
|
53
|
+
currentHeap: this.formatMB(usage),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
this.lastUsage = usage;
|
|
58
|
+
this.lastTime = now;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private formatMB(bytes: number): number {
|
|
62
|
+
return Number((bytes / 1024 / 1024).toFixed(2));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@repo/
|
|
2
|
+
"name": "@repo/mail",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"description": "",
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"@react-email/preview-server": "catalog:",
|
|
15
15
|
"@types/react": "catalog:",
|
|
16
16
|
"@types/react-dom": "catalog:",
|
|
17
|
-
"react-email": "catalog:"
|
|
18
|
-
"tsdown-config": "workspace:*"
|
|
17
|
+
"react-email": "catalog:"
|
|
19
18
|
},
|
|
20
19
|
"dependencies": {
|
|
21
20
|
"@react-email/components": "catalog:",
|
|
@@ -25,5 +24,13 @@
|
|
|
25
24
|
"react": "catalog:",
|
|
26
25
|
"react-dom": "catalog:",
|
|
27
26
|
"typescript-config": "workspace:*"
|
|
27
|
+
},
|
|
28
|
+
"startx": {
|
|
29
|
+
"tags": [
|
|
30
|
+
"node"
|
|
31
|
+
],
|
|
32
|
+
"requiredDevDeps": [
|
|
33
|
+
"typescript-config"
|
|
34
|
+
]
|
|
28
35
|
}
|
|
29
36
|
}
|
|
@@ -1,168 +1,169 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Body,
|
|
3
|
-
Container,
|
|
4
|
-
Font,
|
|
5
|
-
Head,
|
|
6
|
-
Heading,
|
|
7
|
-
Hr,
|
|
8
|
-
Html,
|
|
9
|
-
Img,
|
|
10
|
-
Link,
|
|
11
|
-
Preview,
|
|
12
|
-
Section,
|
|
13
|
-
Text,
|
|
14
|
-
} from "@react-email/components";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Container,
|
|
4
|
+
Font,
|
|
5
|
+
Head,
|
|
6
|
+
Heading,
|
|
7
|
+
Hr,
|
|
8
|
+
Html,
|
|
9
|
+
Img,
|
|
10
|
+
Link,
|
|
11
|
+
Preview,
|
|
12
|
+
Section,
|
|
13
|
+
Text,
|
|
14
|
+
} from "@react-email/components";
|
|
15
|
+
import React from "react";
|
|
16
|
+
|
|
17
|
+
export default function VerifyEmailOtp({
|
|
18
|
+
verificationCode = "596853",
|
|
19
|
+
}: {
|
|
20
|
+
verificationCode: string;
|
|
21
|
+
}) {
|
|
22
|
+
return (
|
|
23
|
+
<Html>
|
|
24
|
+
<Head>
|
|
25
|
+
<Font
|
|
26
|
+
fontFamily="Public Sans"
|
|
27
|
+
fallbackFontFamily="Helvetica"
|
|
28
|
+
webFont={{
|
|
29
|
+
url: "https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600&display=swap",
|
|
30
|
+
format: "woff2",
|
|
31
|
+
}}
|
|
32
|
+
fontWeight={400}
|
|
33
|
+
fontStyle="normal"
|
|
34
|
+
/>
|
|
35
|
+
</Head>{" "}
|
|
36
|
+
<Body style={main}>
|
|
37
|
+
<Preview>App verification</Preview>
|
|
38
|
+
<Container style={container}>
|
|
39
|
+
<Section style={coverSection}>
|
|
40
|
+
<Section style={{ paddingInline: "35px", paddingTop: "12px" }}>
|
|
41
|
+
<Img
|
|
42
|
+
src={`${"https://app.com"}/logo/app-logo.png`}
|
|
43
|
+
alt="App"
|
|
44
|
+
// width="64"
|
|
45
|
+
height="24px"
|
|
46
|
+
/>
|
|
47
|
+
</Section>
|
|
48
|
+
<Section style={upperSection}>
|
|
49
|
+
<Heading style={h1}>Verify your email address</Heading>
|
|
50
|
+
<Text style={mainText}>Your One-Time Password (OTP) for logging into App is:</Text>
|
|
51
|
+
<Section style={verificationSection}>
|
|
52
|
+
<Text style={verifyText}>Verification code</Text>
|
|
53
|
+
|
|
54
|
+
<Text style={codeText}>{verificationCode}</Text>
|
|
55
|
+
</Section>
|
|
56
|
+
</Section>
|
|
57
|
+
<Hr />
|
|
58
|
+
<Section style={lowerSection}>
|
|
59
|
+
<Text style={cautionText}>
|
|
60
|
+
This OTP is valid for 10 minutes. Please do not share this code with anyone for
|
|
61
|
+
security reasons. If you did not request this, please ignore this email or contact
|
|
62
|
+
our support team immediately.
|
|
63
|
+
</Text>
|
|
64
|
+
</Section>
|
|
65
|
+
</Section>
|
|
66
|
+
<Text style={footerText}>
|
|
67
|
+
This message was produced and distributed by App, Ltd.{" "}
|
|
68
|
+
<Link href="https://app.com" target="_blank" style={link}>
|
|
69
|
+
App.com
|
|
70
|
+
</Link>
|
|
71
|
+
<br />
|
|
72
|
+
View our{" "}
|
|
73
|
+
<Link href="https://app.com/privacy-policy" target="_blank" style={link}>
|
|
74
|
+
privacy policy
|
|
75
|
+
</Link>
|
|
76
|
+
.
|
|
77
|
+
</Text>
|
|
78
|
+
</Container>
|
|
79
|
+
</Body>
|
|
80
|
+
</Html>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const main = {
|
|
85
|
+
backgroundColor: "#fff",
|
|
86
|
+
color: "#212121",
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const container = {
|
|
90
|
+
padding: "20px",
|
|
91
|
+
margin: "0 auto",
|
|
92
|
+
backgroundColor: "#eee",
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const h1 = {
|
|
96
|
+
color: "#333",
|
|
97
|
+
fontFamily:
|
|
98
|
+
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
|
|
99
|
+
fontSize: "20px",
|
|
100
|
+
fontWeight: "bold",
|
|
101
|
+
marginBottom: "15px",
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const link = {
|
|
105
|
+
color: "#2754C5",
|
|
106
|
+
fontFamily:
|
|
107
|
+
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
|
|
108
|
+
fontSize: "14px",
|
|
109
|
+
textDecoration: "underline",
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const text = {
|
|
113
|
+
color: "#333",
|
|
114
|
+
fontFamily:
|
|
115
|
+
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
|
|
116
|
+
fontSize: "14px",
|
|
117
|
+
margin: "24px 0",
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const imageSection = {
|
|
121
|
+
backgroundColor: "#fff",
|
|
122
|
+
display: "flex",
|
|
123
|
+
padding: "20px 0",
|
|
124
|
+
alignItems: "center",
|
|
125
|
+
justifyContent: "center",
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const coverSection = { backgroundColor: "#fff" };
|
|
129
|
+
|
|
130
|
+
const upperSection = { padding: "12px 35px" };
|
|
131
|
+
|
|
132
|
+
const lowerSection = { padding: "25px 35px" };
|
|
133
|
+
|
|
134
|
+
const footerText = {
|
|
135
|
+
...text,
|
|
136
|
+
fontSize: "12px",
|
|
137
|
+
padding: "0 20px",
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const verifyText = {
|
|
141
|
+
...text,
|
|
142
|
+
margin: 0,
|
|
143
|
+
fontWeight: "bold",
|
|
144
|
+
textAlign: "center" as const,
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const codeText = {
|
|
148
|
+
...text,
|
|
149
|
+
fontWeight: "bold",
|
|
150
|
+
fontSize: "36px",
|
|
151
|
+
margin: "10px 0",
|
|
152
|
+
textAlign: "center" as const,
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const validityText = {
|
|
156
|
+
...text,
|
|
157
|
+
margin: "0px",
|
|
158
|
+
textAlign: "center" as const,
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const verificationSection = {
|
|
162
|
+
display: "flex",
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
justifyContent: "center",
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const mainText = { ...text, marginBottom: "14px" };
|
|
168
|
+
|
|
169
|
+
const cautionText = { ...text, margin: "0px" };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { render } from "@react-email/render";
|
|
2
2
|
|
|
3
3
|
import VerifyEmailOtp from "./emails/admin/OtpEmail.js";
|
|
4
|
-
|
|
5
4
|
export class AdminEmailTemplate {
|
|
6
5
|
static getOtpEmail = async (props: { otp: string }) => {
|
|
7
6
|
return await render(
|
|
8
7
|
VerifyEmailOtp({
|
|
9
8
|
verificationCode: props.otp,
|
|
10
|
-
})
|
|
9
|
+
})
|
|
11
10
|
);
|
|
12
11
|
};
|
|
13
12
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "typescript-config/tsconfig.
|
|
2
|
+
"extends": "typescript-config/tsconfig.frontend.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"rootDir": ".",
|
|
5
5
|
"types": ["node"],
|
|
6
6
|
"baseUrl": "src",
|
|
7
|
-
"jsx": "react
|
|
7
|
+
"jsx": "react",
|
|
8
8
|
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
|
|
9
9
|
"experimentalDecorators": true,
|
|
10
10
|
"emitDecoratorMetadata": true
|
|
11
11
|
},
|
|
12
|
-
"include": ["src/**/*.ts"]
|
|
12
|
+
"include": ["src/**/*.ts", "src/**/*.tsx"]
|
|
13
13
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Redis } from "ioredis";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/redis-client.ts
|
|
4
|
+
const redisClient = new Redis({
|
|
5
|
+
host: process.env.REDIS_HOST,
|
|
6
|
+
port: Number(process.env.REDIS_PORT),
|
|
7
|
+
username: process.env.REDIS_USERNAME,
|
|
8
|
+
password: process.env.REDIS_PASSWORD
|
|
9
|
+
});
|
|
10
|
+
function setEventListeners() {
|
|
11
|
+
redisClient.on("error", (error) => {
|
|
12
|
+
console.log("Could not establish a connection with redis. " + error);
|
|
13
|
+
});
|
|
14
|
+
redisClient.on("connect", (error) => {
|
|
15
|
+
if (error) {
|
|
16
|
+
console.log("Could not establish a connection with redis. " + error);
|
|
17
|
+
}
|
|
18
|
+
console.log("Connected to redis successfully");
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
setEventListeners();
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { redisClient };
|
|
25
|
+
//# sourceMappingURL=redis-client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-client.mjs","names":[],"sources":["../../src/lib/redis-client.ts"],"sourcesContent":["import { Redis } from \"ioredis\";\r\n\r\nexport const redisClient = new Redis({\r\n host: process.env.REDIS_HOST,\r\n port: Number(process.env.REDIS_PORT),\r\n username: process.env.REDIS_USERNAME,\r\n password: process.env.REDIS_PASSWORD,\r\n});\r\n\r\nfunction setEventListeners() {\r\n redisClient.on(\"error\", (error: string) => {\r\n console.log(\"Could not establish a connection with redis. \" + error);\r\n });\r\n redisClient.on(\"connect\", (error: string) => {\r\n if (error) {\r\n console.log(\"Could not establish a connection with redis. \" + error);\r\n }\r\n console.log(\"Connected to redis successfully\");\r\n });\r\n}\r\n\r\nsetEventListeners();\r\n\r\n"],"mappings":";;;AAEA,MAAa,cAAc,IAAI,MAAM;CACnC,MAAM,QAAQ,IAAI;CAClB,MAAM,OAAO,QAAQ,IAAI,WAAW;CACpC,UAAU,QAAQ,IAAI;CACtB,UAAU,QAAQ,IAAI;CACvB,CAAC;AAEF,SAAS,oBAAoB;AAC3B,aAAY,GAAG,UAAU,UAAkB;AACzC,UAAQ,IAAI,kDAAkD,MAAM;GACpE;AACF,aAAY,GAAG,YAAY,UAAkB;AAC3C,MAAI,OAAO;AACT,WAAQ,IAAI,kDAAkD,MAAM;;AAEtE,UAAQ,IAAI,kCAAkC;GAC9C;;AAGJ,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-module.mjs","names":[],"sources":["../../src/lib/redis-module.ts"],"sourcesContent":["export class RedisModule {\r\n //\r\n}\r\n"],"mappings":";AAAA,IAAa,cAAb,MAAyB"}
|