@tmlmobilidade/emails 20251103.1255.55 → 20251202.1817.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.
- package/dist/{src/components → components}/email-wrapper.js +1 -1
- package/dist/{src/components → components}/styles.d.ts +2525 -2301
- package/dist/{src/emails → emails}/plan-approval-request.js +2 -2
- package/dist/{src/emails → emails}/plan-aproved.js +13 -7
- package/dist/{src/emails → emails}/sucessful-gtfs-validation.js +1 -1
- package/dist/{src/emails → emails}/unsucessful-gtfs-validation.js +1 -1
- package/dist/{src/emails → emails}/welcome.js +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -3
- package/package.json +24 -24
- /package/dist/{src/components → components}/email-wrapper.d.ts +0 -0
- /package/dist/{src/components → components}/footer.d.ts +0 -0
- /package/dist/{src/components → components}/footer.js +0 -0
- /package/dist/{src/components → components}/highlight-text.d.ts +0 -0
- /package/dist/{src/components → components}/highlight-text.js +0 -0
- /package/dist/{src/components → components}/index.d.ts +0 -0
- /package/dist/{src/components → components}/index.js +0 -0
- /package/dist/{src/components → components}/info-box.d.ts +0 -0
- /package/dist/{src/components → components}/info-box.js +0 -0
- /package/dist/{src/components → components}/styles.js +0 -0
- /package/dist/{src/components → components}/validation-summary.d.ts +0 -0
- /package/dist/{src/components → components}/validation-summary.js +0 -0
- /package/dist/{src/email.provider.d.ts → email.provider.d.ts} +0 -0
- /package/dist/{src/email.provider.js → email.provider.js} +0 -0
- /package/dist/{src/emails → emails}/failed-backup.d.ts +0 -0
- /package/dist/{src/emails → emails}/failed-backup.js +0 -0
- /package/dist/{src/emails → emails}/notification-email.d.ts +0 -0
- /package/dist/{src/emails → emails}/notification-email.js +0 -0
- /package/dist/{src/emails → emails}/plan-approval-request.d.ts +0 -0
- /package/dist/{src/emails → emails}/plan-aproved.d.ts +0 -0
- /package/dist/{src/emails → emails}/reset-password.d.ts +0 -0
- /package/dist/{src/emails → emails}/reset-password.js +0 -0
- /package/dist/{src/emails → emails}/sucessful-gtfs-validation.d.ts +0 -0
- /package/dist/{src/emails → emails}/unsucessful-gtfs-validation.d.ts +0 -0
- /package/dist/{src/emails → emails}/welcome.d.ts +0 -0
- /package/dist/{src/renderer.d.ts → renderer.d.ts} +0 -0
- /package/dist/{src/renderer.js → renderer.js} +0 -0
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
/* * */
|
|
3
3
|
import { EmailWrapper, InfoBox, styles } from '../components/index.js';
|
|
4
4
|
import { Button, Hr, Section, Text } from '@react-email/components';
|
|
5
|
-
import { getAppConfig } from '@tmlmobilidade/
|
|
6
|
-
import { Dates } from '@tmlmobilidade/
|
|
5
|
+
import { getAppConfig } from '@tmlmobilidade/consts';
|
|
6
|
+
import { Dates } from '@tmlmobilidade/dates';
|
|
7
7
|
export function PlanApprovalRequestEmail({ solicited_by, validation, }) {
|
|
8
8
|
const validation_url = getAppConfig('plans', 'frontend_url') + '/validations/' + validation._id;
|
|
9
9
|
return (_jsx(EmailWrapper, { preview: "Pedido de aprova\u00E7\u00E3o de plano", children: _jsxs(Section, { children: [_jsx(Text, { style: styles.text, children: "\uD83D\uDC4B Ol\u00E1," }), _jsx(Text, { style: styles.text, children: "Foi solicitada a aprova\u00E7\u00E3o para o seguinte plano" }), _jsx(Hr, { style: { margin: '24px 0' } }), _jsxs(InfoBox, { variant: "info", children: [_jsx(Text, { style: { ...styles.text, margin: '0 0 12px 0' }, children: _jsx("strong", { children: "\uD83D\uDCCB Detalhes do Plano" }) }), _jsxs(Text, { style: { ...styles.text, margin: '8px 0' }, children: [_jsx("strong", { children: "ID da valida\u00E7\u00E3o:" }), ' ', validation._id, _jsx("br", {}), _jsx("strong", { children: "Ag\u00EAncia:" }), validation.gtfs_agency?.agency_name || 'Não especificada', _jsx("br", {}), _jsx("strong", { children: "Data de Cria\u00E7\u00E3o:" }), ' ', Dates.fromUnixTimestamp(validation.created_at).setZone('Europe/Lisbon', 'offset_only').toLocaleString(Dates.FORMATS.DATETIME_SHORT, 'pt-PT')] })] }), _jsx(Button, { href: validation_url, style: styles.button, children: "Ver plano" }), _jsx(Hr, { style: { margin: '24px 0' } }), _jsxs(Text, { style: styles.textStyles.muted, children: [_jsx("strong", { children: "Solicitado por:" }), ' ', solicited_by, _jsx("br", {}), _jsx("strong", { children: "Data do pedido:" }), ' ', new Date().toLocaleDateString('pt-PT')] })] }) }));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { EmailWrapper, InfoBox, styles } from '../components/index.js';
|
|
3
3
|
import { Button, Hr, Section, Text } from '@react-email/components';
|
|
4
|
-
import { getAppConfig } from '@tmlmobilidade/
|
|
5
|
-
import { Dates } from '@tmlmobilidade/
|
|
4
|
+
import { getAppConfig } from '@tmlmobilidade/consts';
|
|
5
|
+
import { Dates } from '@tmlmobilidade/dates';
|
|
6
6
|
export function PlanApprovedEmail({ first_name, plan }) {
|
|
7
7
|
const go_link = getAppConfig('plans', 'frontend_url') + '/plans/' + plan._id;
|
|
8
8
|
return (_jsx(EmailWrapper, { preview: "Plano aprovado com sucesso", children: _jsxs(Section, { children: [_jsxs(Text, { style: styles.text, children: ["\uD83D\uDC4B Ol\u00E1", ' ', first_name, ","] }), _jsx(Text, { style: styles.text, children: "Excelentes not\u00EDcias! O seu plano foi aprovado e est\u00E1 agora dispon\u00EDvel para publica\u00E7\u00E3o." }), _jsx(Hr, { style: { margin: '24px 0' } }), _jsxs(InfoBox, { variant: "success", children: [_jsx(Text, { style: { ...styles.text, fontWeight: '600', margin: '0 0 12px 0' }, children: "\u2705 Plano Aprovado" }), _jsxs(Text, { style: { ...styles.text, margin: '8px 0' }, children: [_jsx("strong", { children: "ID do Plano:" }), ' ', plan._id, _jsx("br", {}), _jsx("strong", { children: "Ag\u00EAncia:" }), ' ', plan.gtfs_agency?.agency_name || 'Não especificada', _jsx("br", {}), _jsx("strong", { children: "Data de Aprova\u00E7\u00E3o:" }), ' ', new Date().toLocaleDateString('pt-PT')] })] }), _jsxs(InfoBox, { variant: "info", children: [_jsx(Text, { style: { ...styles.text, fontWeight: '600', margin: '0 0 12px 0' }, children: "\uD83D\uDCC5 Data de publica\u00E7\u00E3o" }), _jsxs(Text, { style: { ...styles.text, margin: '8px 0' }, children: [_jsx("strong", { children: "Data de in\u00EDcio:" }), ' ', Dates.fromOperationalDate(plan.gtfs_feed_info?.feed_start_date, 'Europe/Lisbon').toLocaleString(Dates.FORMATS.DATE_FULL_WITH_YEAR, 'pt-PT')] }), _jsxs(Text, { style: { ...styles.text, margin: '8px 0' }, children: [_jsx("strong", { children: "Data de fim:" }), ' ', Dates.fromOperationalDate(plan.gtfs_feed_info?.feed_end_date, 'Europe/Lisbon').toLocaleString(Dates.FORMATS.DATE_FULL_WITH_YEAR, 'pt-PT')] })] }), _jsx(Hr, { style: { margin: '24px 0' } }), _jsx(Text, { style: styles.text, children: _jsx("strong", { children: "O que isto significa:" }) }), _jsxs(Text, { style: styles.text, children: ["\u2022 O plano passou por todas as valida\u00E7\u00F5es necess\u00E1rias", _jsx("br", {}), "\u2022 Os dados ser\u00E3o automaticamente publicados para os sistemas de informa\u00E7\u00E3o"] }), _jsx(Text, { style: styles.text, children: "Para ver os detalhes completos do seu plano aprovado, clique no bot\u00E3o abaixo:" }), _jsx(Button, { href: go_link, style: styles.button, children: "Ver Plano Aprovado" })] }) }));
|
|
@@ -10,10 +10,17 @@ export function PlanApprovedEmail({ first_name, plan }) {
|
|
|
10
10
|
;
|
|
11
11
|
const mockPlan = {
|
|
12
12
|
_id: '64f8b2a3c1d2e3f4a5b6c7d8',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
apps: {
|
|
14
|
+
controller: {
|
|
15
|
+
last_hash: 'abcdef1234567890',
|
|
16
|
+
status: 'complete',
|
|
17
|
+
timestamp: 1715328000,
|
|
18
|
+
},
|
|
19
|
+
merger: {
|
|
20
|
+
last_hash: 'abcdef1234567890',
|
|
21
|
+
status: 'complete',
|
|
22
|
+
timestamp: 1715328000,
|
|
23
|
+
},
|
|
17
24
|
},
|
|
18
25
|
created_at: 1715328000,
|
|
19
26
|
created_by: '',
|
|
@@ -33,7 +40,6 @@ const mockPlan = {
|
|
|
33
40
|
pcgi_legacy: {
|
|
34
41
|
operation_plan_id: '123',
|
|
35
42
|
},
|
|
36
|
-
status_merger: 'complete',
|
|
37
43
|
updated_at: 1715328000,
|
|
38
44
|
updated_by: '',
|
|
39
45
|
};
|
|
@@ -2,7 +2,7 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
/* * */
|
|
3
3
|
import { EmailWrapper, styles, ValidationSummary } from '../components/index.js';
|
|
4
4
|
import { Button, Hr, Section, Text } from '@react-email/components';
|
|
5
|
-
import { getAppConfig } from '@tmlmobilidade/
|
|
5
|
+
import { getAppConfig } from '@tmlmobilidade/consts';
|
|
6
6
|
export function SucessfulGtfsValidationEmail({ first_name, validation }) {
|
|
7
7
|
const go_link = getAppConfig('plans', 'frontend_url') + '/validations/' + validation._id;
|
|
8
8
|
const totalWarnings = validation.summary?.total_warnings ?? 0;
|
|
@@ -2,7 +2,7 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
/* * */
|
|
3
3
|
import { EmailWrapper, styles, ValidationSummary } from '../components/index.js';
|
|
4
4
|
import { Button, Hr, Section, Text } from '@react-email/components';
|
|
5
|
-
import { getAppConfig } from '@tmlmobilidade/
|
|
5
|
+
import { getAppConfig } from '@tmlmobilidade/consts';
|
|
6
6
|
export function UnsuccessfulGtfsValidationEmail({ first_name, validation }) {
|
|
7
7
|
const go_link = getAppConfig('plans', 'frontend_url') + '/validations/' + validation._id;
|
|
8
8
|
// Safe access to validation summary with fallbacks
|
|
@@ -2,7 +2,7 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
/* * */
|
|
3
3
|
import { EmailWrapper, styles } from '../components/index.js';
|
|
4
4
|
import { Button, Hr, Link, Section, Text } from '@react-email/components';
|
|
5
|
-
import { getAppConfig } from '@tmlmobilidade/
|
|
5
|
+
import { getAppConfig } from '@tmlmobilidade/consts';
|
|
6
6
|
export function WelcomeEmail({ first_name, setup_password_link }) {
|
|
7
7
|
const go_link = getAppConfig('auth', 'frontend_url', 'production');
|
|
8
8
|
return (_jsx(EmailWrapper, { preview: "Bem-vindo ao GO - Gestor de Oferta", children: _jsxs(Section, { children: [_jsxs(Text, { style: styles.text, children: ["\uD83D\uDC4B Ol\u00E1", ' ', first_name, ","] }), _jsxs(Text, { style: styles.text, children: ["\u00C9 um prazer dar-lhe as boas-vindas \u00E0 plataforma", ' ', _jsx("strong", { children: "GO (Gestor de Oferta)" }), ' ', "da Transportes Metropolitanos de Lisboa!"] }), _jsx(Text, { style: styles.text, children: "Para come\u00E7ar a usar o GO, por favor defina uma palavra-passe para a sua conta:" }), _jsx(Button, { href: setup_password_link, style: styles.button, children: "Definir Palavra-passe" }), _jsx(Hr, { style: { margin: '24px 0' } }), _jsx(Text, { style: styles.textStyles.small, children: _jsx("strong", { children: "J\u00E1 tem uma conta configurada?" }) }), _jsxs(Text, { style: styles.textStyles.small, children: ["Pode aceder diretamente ao GO atrav\u00E9s do seguinte", ' ', _jsx(Link, { href: go_link, style: { color: '#0369A1', textDecoration: 'underline' }, children: "link." })] }), _jsx(Hr, { style: { margin: '24px 0' } }), _jsx(Text, { style: styles.textStyles.muted, children: "Se tiver alguma d\u00FAvida sobre como utilizar a plataforma ou encontrar qualquer dificuldade durante o processo de configura\u00E7\u00E3o, n\u00E3o hesite em contactar a nossa equipa de suporte. Estamos aqui para ajudar!" })] }) }));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FailedBackupEmailProps } from './
|
|
2
|
-
import { NotificationEmailProps } from './
|
|
3
|
-
import { PlanApprovalRequestEmailProps } from './
|
|
4
|
-
import { ResetPasswordEmailProps } from './
|
|
5
|
-
import { SucessfulGtfsValidationEmailProps } from './
|
|
6
|
-
import { UnsuccessfulGtfsValidationEmailProps } from './
|
|
7
|
-
import { WelcomeEmailProps } from './
|
|
1
|
+
import { FailedBackupEmailProps } from './emails/failed-backup.js';
|
|
2
|
+
import { NotificationEmailProps } from './emails/notification-email.js';
|
|
3
|
+
import { PlanApprovalRequestEmailProps } from './emails/plan-approval-request.js';
|
|
4
|
+
import { ResetPasswordEmailProps } from './emails/reset-password.js';
|
|
5
|
+
import { SucessfulGtfsValidationEmailProps } from './emails/sucessful-gtfs-validation.js';
|
|
6
|
+
import { UnsuccessfulGtfsValidationEmailProps } from './emails/unsucessful-gtfs-validation.js';
|
|
7
|
+
import { WelcomeEmailProps } from './emails/welcome.js';
|
|
8
8
|
export type { FailedBackupEmailProps, NotificationEmailProps, PlanApprovalRequestEmailProps, ResetPasswordEmailProps, SucessfulGtfsValidationEmailProps, UnsuccessfulGtfsValidationEmailProps, WelcomeEmailProps, };
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './renderer.js';
|
|
10
10
|
export interface SendEmailProps<T> {
|
|
11
11
|
props: T;
|
|
12
12
|
to: string | string[];
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* * */
|
|
2
|
-
import { emailProvider } from './
|
|
3
|
-
import { RenderEmailNotificationEmail, RenderFailedBackupEmail, RenderPlanApprovalRequestEmail, RenderResetPasswordEmail, RenderSucessfulGtfsValidationEmail, RenderUnsuccessfulGtfsValidationEmail, RenderWelcomeEmail } from './
|
|
4
|
-
export * from './
|
|
2
|
+
import { emailProvider } from './email.provider.js';
|
|
3
|
+
import { RenderEmailNotificationEmail, RenderFailedBackupEmail, RenderPlanApprovalRequestEmail, RenderResetPasswordEmail, RenderSucessfulGtfsValidationEmail, RenderUnsuccessfulGtfsValidationEmail, RenderWelcomeEmail } from './renderer.js';
|
|
4
|
+
export * from './renderer.js';
|
|
5
5
|
export async function sendFailedBackupEmail(props) {
|
|
6
6
|
const emailHtml = await RenderFailedBackupEmail(props.props);
|
|
7
7
|
await emailProvider.send({
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmlmobilidade/emails",
|
|
3
|
-
"version": "
|
|
4
|
-
"author":
|
|
3
|
+
"version": "20251202.1817.5",
|
|
4
|
+
"author": {
|
|
5
|
+
"email": "iso@tmlmobilidade.pt",
|
|
6
|
+
"name": "TML-ISO"
|
|
7
|
+
},
|
|
5
8
|
"license": "AGPL-3.0-or-later",
|
|
6
9
|
"homepage": "https://github.com/tmlmobilidade/services#readme",
|
|
7
10
|
"bugs": {
|
|
@@ -22,38 +25,35 @@
|
|
|
22
25
|
},
|
|
23
26
|
"type": "module",
|
|
24
27
|
"files": [
|
|
25
|
-
"dist
|
|
28
|
+
"dist"
|
|
26
29
|
],
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
|
-
"default": "./dist/index.js"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
33
32
|
"scripts": {
|
|
34
|
-
"build": "
|
|
35
|
-
"
|
|
33
|
+
"build": "tsc && resolve-tspaths",
|
|
34
|
+
"dev2": "email dev -p 3001 --dir ./src/emails",
|
|
36
35
|
"export": "email export --dir ./src/emails",
|
|
37
|
-
"lint": "eslint ./src/ && tsc --noEmit"
|
|
36
|
+
"lint": "eslint ./src/ && tsc --noEmit",
|
|
37
|
+
"watch": "tsc-watch --onSuccess 'resolve-tspaths'"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@react-email/components": "0.
|
|
40
|
+
"@react-email/components": "1.0.1",
|
|
41
|
+
"@tmlmobilidade/consts": "*",
|
|
42
|
+
"@tmlmobilidade/dates": "*",
|
|
43
|
+
"@tmlmobilidade/types": "*",
|
|
41
44
|
"@tmlmobilidade/utils": "*",
|
|
42
|
-
"@types/nodemailer": "7.0.
|
|
43
|
-
"browserslist": "4.
|
|
44
|
-
"nodemailer": "7.0.
|
|
45
|
-
"react": "19.
|
|
46
|
-
"react-email": "
|
|
45
|
+
"@types/nodemailer": "7.0.4",
|
|
46
|
+
"browserslist": "4.28.0",
|
|
47
|
+
"nodemailer": "7.0.11",
|
|
48
|
+
"react": "19.2.0",
|
|
49
|
+
"react-email": "5.0.5"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@react-email/preview-server": "4.3.1",
|
|
51
|
-
"@tmlmobilidade/lib": "*",
|
|
52
|
+
"@react-email/preview-server": "5.0.5",
|
|
52
53
|
"@tmlmobilidade/tsconfig": "*",
|
|
53
|
-
"@
|
|
54
|
-
"@types/node": "24.9.1",
|
|
54
|
+
"@types/node": "24.10.1",
|
|
55
55
|
"resolve-tspaths": "0.8.23",
|
|
56
|
-
"
|
|
56
|
+
"tsc-watch": "7.2.0",
|
|
57
57
|
"typescript": "5.9.3"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|