@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.
Files changed (59) hide show
  1. package/dist/components/Layout.d.ts +1 -0
  2. package/dist/components/Layout.d.ts.map +1 -1
  3. package/dist/components/Layout.js +2 -2
  4. package/dist/components/Layout.js.map +1 -1
  5. package/dist/i18n.d.ts +15 -0
  6. package/dist/i18n.d.ts.map +1 -1
  7. package/dist/i18n.js +31 -0
  8. package/dist/i18n.js.map +1 -1
  9. package/dist/index.d.ts +2 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +0 -5
  12. package/dist/index.js.map +1 -1
  13. package/dist/previews/account-secured-scenarios.d.ts +6 -0
  14. package/dist/previews/account-secured-scenarios.d.ts.map +1 -0
  15. package/dist/previews/account-secured-scenarios.js +7 -0
  16. package/dist/previews/account-secured-scenarios.js.map +1 -0
  17. package/dist/previews/escrow-pin-sign-in-scenarios.d.ts +6 -0
  18. package/dist/previews/escrow-pin-sign-in-scenarios.d.ts.map +1 -0
  19. package/dist/previews/escrow-pin-sign-in-scenarios.js +7 -0
  20. package/dist/previews/escrow-pin-sign-in-scenarios.js.map +1 -0
  21. package/dist/render.d.ts +20 -9
  22. package/dist/render.d.ts.map +1 -1
  23. package/dist/render.js +39 -1
  24. package/dist/render.js.map +1 -1
  25. package/dist/templates/account-secured.d.ts +27 -0
  26. package/dist/templates/account-secured.d.ts.map +1 -0
  27. package/dist/templates/account-secured.js +118 -0
  28. package/dist/templates/account-secured.js.map +1 -0
  29. package/dist/templates/announcement.d.ts +13 -0
  30. package/dist/templates/announcement.d.ts.map +1 -0
  31. package/dist/templates/announcement.js +34 -0
  32. package/dist/templates/announcement.js.map +1 -0
  33. package/dist/templates/escrow-pin-sign-in.d.ts +24 -0
  34. package/dist/templates/escrow-pin-sign-in.d.ts.map +1 -0
  35. package/dist/templates/escrow-pin-sign-in.js +96 -0
  36. package/dist/templates/escrow-pin-sign-in.js.map +1 -0
  37. package/dist/templates/index.d.ts +22 -38
  38. package/dist/templates/index.d.ts.map +1 -1
  39. package/dist/templates/index.js +21 -14
  40. package/dist/templates/index.js.map +1 -1
  41. package/dist/tenant-registry.d.ts +2 -2
  42. package/dist/tenant-registry.d.ts.map +1 -1
  43. package/dist/tenant-registry.js +2 -3
  44. package/dist/tenant-registry.js.map +1 -1
  45. package/package.json +2 -2
  46. package/src/__tests__/i18n.test.ts +39 -1
  47. package/src/__tests__/render.test.ts +154 -0
  48. package/src/__tests__/tenant-registry.test.ts +2 -2
  49. package/src/components/Layout.tsx +4 -1
  50. package/src/i18n.ts +33 -0
  51. package/src/index.ts +4 -0
  52. package/src/previews/account-secured-scenarios.tsx +41 -0
  53. package/src/previews/escrow-pin-sign-in-scenarios.tsx +52 -0
  54. package/src/render.ts +73 -0
  55. package/src/templates/account-secured.tsx +236 -0
  56. package/src/templates/announcement.tsx +100 -0
  57. package/src/templates/escrow-pin-sign-in.tsx +197 -0
  58. package/src/templates/index.ts +97 -35
  59. package/src/tenant-registry.ts +3 -4
@@ -1,64 +1,126 @@
1
- export { VerificationCode, getVerificationCodeSubject } from './verification-code';
2
- export type { VerificationCodeProps, VerificationCodeVariant } from './verification-code';
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 { InboxClaim, getInboxClaimSubject } from './inbox-claim';
5
- export type { InboxClaimProps } from './inbox-claim';
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 { GuardianApproval, getGuardianApprovalSubject } from './guardian-approval';
8
- export type { GuardianApprovalProps } from './guardian-approval';
15
+ export {
16
+ GuardianApproval,
17
+ getGuardianApprovalSubject,
18
+ type GuardianApprovalProps,
19
+ } from './guardian-approval';
9
20
 
10
- export { AccountApproved, getAccountApprovedSubject } from './account-approved';
11
- export type { AccountApprovedProps } from './account-approved';
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 { EndorsementRequest, getEndorsementRequestSubject } from './endorsement-request';
17
- export type { EndorsementRequestProps } from './endorsement-request';
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 { GuardianApprovedClaim, getGuardianApprovedClaimSubject } from './guardian-approved-claim';
26
- export type { GuardianApprovedClaimProps } from './guardian-approved-claim';
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 { GuardianEmailOtp, getGuardianEmailOtpSubject } from './guardian-email-otp';
35
- export type { GuardianEmailOtpProps } from './guardian-email-otp';
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 { EmailVerification, getEmailVerificationSubject } from './email-verification';
44
- export type { EmailVerificationProps } from './email-verification';
65
+ export {
66
+ EmailVerification,
67
+ getEmailVerificationSubject,
68
+ type EmailVerificationProps,
69
+ } from './email-verification';
45
70
 
46
- export { CredentialUpdated, getCredentialUpdatedSubject } from './credential-updated';
47
- export type { CredentialUpdatedProps } from './credential-updated';
48
- export { AccountSignInChanged, getAccountSignInChangedSubject } from './account-sign-in-changed';
49
- export type { AccountSignInChangedProps } from './account-sign-in-changed';
71
+ export {
72
+ CredentialUpdated,
73
+ getCredentialUpdatedSubject,
74
+ type CredentialUpdatedProps,
75
+ } from './credential-updated';
50
76
 
51
- export { EscrowHoldStarted, getEscrowHoldStartedSubject } from './escrow-hold-started';
52
- export type { EscrowHoldStartedProps } from './escrow-hold-started';
77
+ export {
78
+ AccountSignInChanged,
79
+ getAccountSignInChangedSubject,
80
+ type AccountSignInChangedProps,
81
+ } from './account-sign-in-changed';
53
82
 
54
- export { EscrowHoldReminder, getEscrowHoldReminderSubject } from './escrow-hold-reminder';
55
- export type { EscrowHoldReminderProps } from './escrow-hold-reminder';
83
+ export {
84
+ EscrowHoldStarted,
85
+ getEscrowHoldStartedSubject,
86
+ type EscrowHoldStartedProps,
87
+ } from './escrow-hold-started';
56
88
 
57
- export { EscrowHoldReleased, getEscrowHoldReleasedSubject } from './escrow-hold-released';
58
- export type { EscrowHoldReleasedProps } from './escrow-hold-released';
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 { EscrowHoldCancelled, getEscrowHoldCancelledSubject } from './escrow-hold-cancelled';
61
- export type { EscrowHoldCancelledProps, EscrowHoldCancelledReason } from './escrow-hold-cancelled';
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 { EscrowPinLocked, getEscrowPinLockedSubject } from './escrow-pin-locked';
64
- export type { EscrowPinLockedProps } from './escrow-pin-locked';
126
+ export { Announcement, getAnnouncementSubject, type AnnouncementProps } from './announcement';
@@ -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. alpha.vetpass.app → vetpass)
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://alpha.vetpass.app"). */
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: "alpha.vetpass.app" → "vetpass.app"
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++) {