@learncard/email-templates 1.2.1 → 1.3.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/dist/components/Layout.d.ts +1 -0
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/components/Layout.js +2 -2
- package/dist/components/Layout.js.map +1 -1
- package/dist/i18n.d.ts +15 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +31 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/dist/previews/account-secured-scenarios.d.ts +6 -0
- package/dist/previews/account-secured-scenarios.d.ts.map +1 -0
- package/dist/previews/account-secured-scenarios.js +7 -0
- package/dist/previews/account-secured-scenarios.js.map +1 -0
- package/dist/previews/escrow-pin-sign-in-scenarios.d.ts +6 -0
- package/dist/previews/escrow-pin-sign-in-scenarios.d.ts.map +1 -0
- package/dist/previews/escrow-pin-sign-in-scenarios.js +7 -0
- package/dist/previews/escrow-pin-sign-in-scenarios.js.map +1 -0
- package/dist/render.d.ts +20 -9
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +39 -1
- package/dist/render.js.map +1 -1
- package/dist/templates/account-secured.d.ts +27 -0
- package/dist/templates/account-secured.d.ts.map +1 -0
- package/dist/templates/account-secured.js +118 -0
- package/dist/templates/account-secured.js.map +1 -0
- package/dist/templates/announcement.d.ts +13 -0
- package/dist/templates/announcement.d.ts.map +1 -0
- package/dist/templates/announcement.js +34 -0
- package/dist/templates/announcement.js.map +1 -0
- package/dist/templates/escrow-pin-sign-in.d.ts +24 -0
- package/dist/templates/escrow-pin-sign-in.d.ts.map +1 -0
- package/dist/templates/escrow-pin-sign-in.js +96 -0
- package/dist/templates/escrow-pin-sign-in.js.map +1 -0
- package/dist/templates/index.d.ts +22 -38
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +21 -14
- package/dist/templates/index.js.map +1 -1
- package/dist/tenant-registry.d.ts +2 -2
- package/dist/tenant-registry.d.ts.map +1 -1
- package/dist/tenant-registry.js +2 -3
- package/dist/tenant-registry.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/i18n.test.ts +39 -1
- package/src/__tests__/render.test.ts +154 -0
- package/src/__tests__/tenant-registry.test.ts +2 -2
- package/src/components/Layout.tsx +4 -1
- package/src/i18n.ts +33 -0
- package/src/index.ts +4 -0
- package/src/previews/account-secured-scenarios.tsx +41 -0
- package/src/previews/escrow-pin-sign-in-scenarios.tsx +52 -0
- package/src/render.ts +73 -0
- package/src/templates/account-secured.tsx +236 -0
- package/src/templates/announcement.tsx +100 -0
- package/src/templates/escrow-pin-sign-in.tsx +197 -0
- package/src/templates/index.ts +97 -35
- package/src/tenant-registry.ts +3 -4
package/src/templates/index.ts
CHANGED
|
@@ -1,64 +1,126 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
// One export declaration per template module. Projects that resolve this package
|
|
2
|
+
// through its `development` condition (source) typecheck without `jsx`, and TypeScript
|
|
3
|
+
// reports TS6142 once per declaration that imports a .tsx module from this .ts file;
|
|
4
|
+
// a separate `export type` line for the same module would add a second report.
|
|
3
5
|
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
+
export {
|
|
7
|
+
VerificationCode,
|
|
8
|
+
getVerificationCodeSubject,
|
|
9
|
+
type VerificationCodeProps,
|
|
10
|
+
type VerificationCodeVariant,
|
|
11
|
+
} from './verification-code';
|
|
12
|
+
|
|
13
|
+
export { InboxClaim, getInboxClaimSubject, type InboxClaimProps } from './inbox-claim';
|
|
6
14
|
|
|
7
|
-
export {
|
|
8
|
-
|
|
15
|
+
export {
|
|
16
|
+
GuardianApproval,
|
|
17
|
+
getGuardianApprovalSubject,
|
|
18
|
+
type GuardianApprovalProps,
|
|
19
|
+
} from './guardian-approval';
|
|
9
20
|
|
|
10
|
-
export {
|
|
11
|
-
|
|
21
|
+
export {
|
|
22
|
+
AccountApproved,
|
|
23
|
+
getAccountApprovedSubject,
|
|
24
|
+
type AccountApprovedProps,
|
|
25
|
+
} from './account-approved';
|
|
12
26
|
|
|
13
|
-
export { RecoveryKey, getRecoveryKeySubject } from './recovery-key';
|
|
14
|
-
export type { RecoveryKeyProps } from './recovery-key';
|
|
27
|
+
export { RecoveryKey, getRecoveryKeySubject, type RecoveryKeyProps } from './recovery-key';
|
|
15
28
|
|
|
16
|
-
export {
|
|
17
|
-
|
|
29
|
+
export {
|
|
30
|
+
EndorsementRequest,
|
|
31
|
+
getEndorsementRequestSubject,
|
|
32
|
+
type EndorsementRequestProps,
|
|
33
|
+
} from './endorsement-request';
|
|
18
34
|
|
|
19
35
|
export {
|
|
20
36
|
CredentialAwaitingGuardian,
|
|
21
37
|
getCredentialAwaitingGuardianSubject,
|
|
38
|
+
type CredentialAwaitingGuardianProps,
|
|
22
39
|
} from './credential-awaiting-guardian';
|
|
23
|
-
export type { CredentialAwaitingGuardianProps } from './credential-awaiting-guardian';
|
|
24
40
|
|
|
25
|
-
export {
|
|
26
|
-
|
|
41
|
+
export {
|
|
42
|
+
GuardianApprovedClaim,
|
|
43
|
+
getGuardianApprovedClaimSubject,
|
|
44
|
+
type GuardianApprovedClaimProps,
|
|
45
|
+
} from './guardian-approved-claim';
|
|
27
46
|
|
|
28
47
|
export {
|
|
29
48
|
GuardianCredentialApproval,
|
|
30
49
|
getGuardianCredentialApprovalSubject,
|
|
50
|
+
type GuardianCredentialApprovalProps,
|
|
31
51
|
} from './guardian-credential-approval';
|
|
32
|
-
export type { GuardianCredentialApprovalProps } from './guardian-credential-approval';
|
|
33
52
|
|
|
34
|
-
export {
|
|
35
|
-
|
|
53
|
+
export {
|
|
54
|
+
GuardianEmailOtp,
|
|
55
|
+
getGuardianEmailOtpSubject,
|
|
56
|
+
type GuardianEmailOtpProps,
|
|
57
|
+
} from './guardian-email-otp';
|
|
36
58
|
|
|
37
59
|
export {
|
|
38
60
|
GuardianRejectedCredential,
|
|
39
61
|
getGuardianRejectedCredentialSubject,
|
|
62
|
+
type GuardianRejectedCredentialProps,
|
|
40
63
|
} from './guardian-rejected-credential';
|
|
41
|
-
export type { GuardianRejectedCredentialProps } from './guardian-rejected-credential';
|
|
42
64
|
|
|
43
|
-
export {
|
|
44
|
-
|
|
65
|
+
export {
|
|
66
|
+
EmailVerification,
|
|
67
|
+
getEmailVerificationSubject,
|
|
68
|
+
type EmailVerificationProps,
|
|
69
|
+
} from './email-verification';
|
|
45
70
|
|
|
46
|
-
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
71
|
+
export {
|
|
72
|
+
CredentialUpdated,
|
|
73
|
+
getCredentialUpdatedSubject,
|
|
74
|
+
type CredentialUpdatedProps,
|
|
75
|
+
} from './credential-updated';
|
|
50
76
|
|
|
51
|
-
export {
|
|
52
|
-
|
|
77
|
+
export {
|
|
78
|
+
AccountSignInChanged,
|
|
79
|
+
getAccountSignInChangedSubject,
|
|
80
|
+
type AccountSignInChangedProps,
|
|
81
|
+
} from './account-sign-in-changed';
|
|
53
82
|
|
|
54
|
-
export {
|
|
55
|
-
|
|
83
|
+
export {
|
|
84
|
+
EscrowHoldStarted,
|
|
85
|
+
getEscrowHoldStartedSubject,
|
|
86
|
+
type EscrowHoldStartedProps,
|
|
87
|
+
} from './escrow-hold-started';
|
|
56
88
|
|
|
57
|
-
export {
|
|
58
|
-
|
|
89
|
+
export {
|
|
90
|
+
EscrowHoldReminder,
|
|
91
|
+
getEscrowHoldReminderSubject,
|
|
92
|
+
type EscrowHoldReminderProps,
|
|
93
|
+
} from './escrow-hold-reminder';
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
EscrowHoldReleased,
|
|
97
|
+
getEscrowHoldReleasedSubject,
|
|
98
|
+
type EscrowHoldReleasedProps,
|
|
99
|
+
} from './escrow-hold-released';
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
EscrowHoldCancelled,
|
|
103
|
+
getEscrowHoldCancelledSubject,
|
|
104
|
+
type EscrowHoldCancelledProps,
|
|
105
|
+
type EscrowHoldCancelledReason,
|
|
106
|
+
} from './escrow-hold-cancelled';
|
|
59
107
|
|
|
60
|
-
export {
|
|
61
|
-
|
|
108
|
+
export {
|
|
109
|
+
EscrowPinLocked,
|
|
110
|
+
getEscrowPinLockedSubject,
|
|
111
|
+
type EscrowPinLockedProps,
|
|
112
|
+
} from './escrow-pin-locked';
|
|
113
|
+
|
|
114
|
+
export {
|
|
115
|
+
EscrowPinSignIn,
|
|
116
|
+
getEscrowPinSignInSubject,
|
|
117
|
+
type EscrowPinSignInProps,
|
|
118
|
+
} from './escrow-pin-sign-in';
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
AccountSecured,
|
|
122
|
+
getAccountSecuredSubject,
|
|
123
|
+
type AccountSecuredProps,
|
|
124
|
+
} from './account-secured';
|
|
62
125
|
|
|
63
|
-
export {
|
|
64
|
-
export type { EscrowPinLockedProps } from './escrow-pin-locked';
|
|
126
|
+
export { Announcement, getAnnouncementSubject, type AnnouncementProps } from './announcement';
|
package/src/tenant-registry.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Resolution order (first match wins):
|
|
5
5
|
* 1. Explicit `X-Tenant-Id` header — native apps, any client that knows its tenant
|
|
6
|
-
* 2. `Origin` / `Referer` header hostname — web apps (e.g.
|
|
6
|
+
* 2. `Origin` / `Referer` header hostname — web apps (e.g. staging.vetpass.app → vetpass)
|
|
7
7
|
* 3. `DEFAULT_TENANT_ID` env var — per-tenant deploys, cron jobs, server-to-server
|
|
8
8
|
* 4. Fallback to 'learncard'
|
|
9
9
|
*
|
|
@@ -32,7 +32,7 @@ export interface RequestHeaders {
|
|
|
32
32
|
/** Value of the X-Tenant-Id header. */
|
|
33
33
|
'x-tenant-id'?: string | undefined;
|
|
34
34
|
|
|
35
|
-
/** Origin header (e.g. "https://
|
|
35
|
+
/** Origin header (e.g. "https://staging.vetpass.app"). */
|
|
36
36
|
origin?: string | undefined;
|
|
37
37
|
|
|
38
38
|
/** Referer header (fallback for Origin). */
|
|
@@ -51,7 +51,6 @@ export interface RequestHeaders {
|
|
|
51
51
|
const ORIGIN_MAP: Record<string, string> = {
|
|
52
52
|
// VetPass
|
|
53
53
|
'vetpass.app': 'vetpass',
|
|
54
|
-
'alpha.vetpass.app': 'vetpass',
|
|
55
54
|
'staging.vetpass.app': 'vetpass',
|
|
56
55
|
|
|
57
56
|
// ScoutPass
|
|
@@ -128,7 +127,7 @@ const extractHostname = (urlString: string): string | undefined => {
|
|
|
128
127
|
const tenantIdFromHostname = (hostname: string): string | undefined => {
|
|
129
128
|
if (ORIGIN_MAP[hostname]) return ORIGIN_MAP[hostname];
|
|
130
129
|
|
|
131
|
-
// Strip subdomains: "
|
|
130
|
+
// Strip subdomains: "preview.vetpass.app" → "vetpass.app"
|
|
132
131
|
const parts = hostname.split('.');
|
|
133
132
|
|
|
134
133
|
for (let i = 1; i < parts.length - 1; i++) {
|