@bernierllc/sender-identity-verification 3.0.3 → 3.0.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/src/types.ts DELETED
@@ -1,171 +0,0 @@
1
- /*
2
- Copyright (c) 2025 Bernier LLC
3
-
4
- This file is licensed to the client under a limited-use license.
5
- The client may use and modify this code *only within the scope of the project it was delivered for*.
6
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
7
- */
8
-
9
- /**
10
- * Sender identity record
11
- */
12
- export interface SenderIdentity {
13
- id: string;
14
- email: string;
15
- name: string;
16
- replyToEmail?: string;
17
- replyToName?: string;
18
- domain: string;
19
- provider: EmailProvider;
20
-
21
- // Status tracking
22
- status: SenderStatus;
23
- isDefault: boolean;
24
- isActive: boolean;
25
-
26
- // Verification
27
- verifiedAt?: Date;
28
- verificationToken?: string;
29
- verificationSentAt?: Date;
30
- verificationExpiresAt?: Date;
31
- verificationAttempts: number;
32
-
33
- // Provider-specific data
34
- providerSenderId?: string; // SendGrid verified sender ID
35
- providerMetadata?: Record<string, unknown>;
36
-
37
- // Validation
38
- lastValidated?: Date;
39
- validationErrors?: string[];
40
-
41
- // Timestamps
42
- createdAt: Date;
43
- updatedAt: Date;
44
- deletedAt?: Date;
45
- }
46
-
47
- /**
48
- * Sender status enum
49
- */
50
- export enum SenderStatus {
51
- PENDING = 'pending', // Created, awaiting verification
52
- VERIFICATION_SENT = 'verification_sent', // Verification email sent
53
- VERIFIED = 'verified', // Email verified, ready to use
54
- FAILED = 'failed', // Verification failed
55
- EXPIRED = 'expired', // Verification token expired
56
- LOCKED = 'locked', // Too many failed attempts
57
- INACTIVE = 'inactive', // Deactivated by admin
58
- }
59
-
60
- /**
61
- * Email provider enum
62
- */
63
- export enum EmailProvider {
64
- SENDGRID = 'sendgrid',
65
- MAILGUN = 'mailgun',
66
- SES = 'ses',
67
- SMTP = 'smtp',
68
- POSTMARK = 'postmark',
69
- MANDRILL = 'mandrill',
70
- SMTP2GO = 'smtp2go',
71
- }
72
-
73
- /**
74
- * Sender creation input
75
- */
76
- export interface CreateSenderInput {
77
- email: string;
78
- name: string;
79
- replyToEmail?: string;
80
- replyToName?: string;
81
- provider: EmailProvider;
82
- isDefault?: boolean;
83
- skipVerification?: boolean; // For testing/dev
84
- createdBy?: string;
85
- /** Provider-specific fields (e.g., address/city/state for SendGrid) */
86
- providerFields?: Record<string, unknown>;
87
- }
88
-
89
- /**
90
- * Sender update input
91
- */
92
- export interface UpdateSenderInput {
93
- name?: string;
94
- replyToEmail?: string;
95
- replyToName?: string;
96
- isDefault?: boolean;
97
- isActive?: boolean;
98
- lastModifiedBy?: string;
99
- providerFields?: Record<string, unknown>;
100
- }
101
-
102
- /**
103
- * Verification result
104
- */
105
- export interface VerificationResult {
106
- success: boolean;
107
- senderId: string;
108
- status: SenderStatus;
109
- message: string;
110
- verifiedAt?: Date;
111
- errors?: string[];
112
- }
113
-
114
- /**
115
- * Provider compliance check result
116
- */
117
- export interface ComplianceCheckResult {
118
- isCompliant: boolean;
119
- checks: {
120
- domainVerified: boolean;
121
- spfValid: boolean;
122
- dkimValid: boolean;
123
- emailFormat: boolean;
124
- };
125
- errors: string[];
126
- warnings: string[];
127
- }
128
-
129
- /**
130
- * Sender list options
131
- */
132
- export interface ListSendersOptions {
133
- provider?: EmailProvider;
134
- status?: SenderStatus;
135
- isActive?: boolean;
136
- domain?: string;
137
- limit?: number;
138
- offset?: number;
139
- }
140
-
141
- /**
142
- * Package result wrapper
143
- */
144
- export interface SenderIdentityResult<T = unknown> {
145
- success: boolean;
146
- data?: T;
147
- error?: string;
148
- errors?: string[];
149
- }
150
-
151
- /**
152
- * Domain verification status (interface for missing @bernierllc/email-domain-verification)
153
- * TODO: Replace with actual import when email-domain-verification package is available
154
- */
155
- export interface DomainVerificationStatus {
156
- isVerified: boolean;
157
- domain: string;
158
- verificationUrl?: string;
159
- dnsRecords?: {
160
- spf?: { isValid: boolean };
161
- dkim?: { isValid: boolean };
162
- };
163
- }
164
-
165
- /**
166
- * Email domain verification interface (stub for missing dependency)
167
- * TODO: Replace with actual @bernierllc/email-domain-verification when available
168
- */
169
- export interface IEmailDomainVerification {
170
- getDomainStatus(domain: string): Promise<DomainVerificationStatus>;
171
- }
package/tsconfig.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "commonjs",
5
- "lib": ["ES2022", "DOM"],
6
- "declaration": true,
7
- "outDir": "./dist",
8
- "rootDir": "./src",
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "moduleResolution": "node",
14
- "resolveJsonModule": true,
15
- "noUnusedLocals": true,
16
- "noUnusedParameters": true,
17
- "noImplicitReturns": true,
18
- "noFallthroughCasesInSwitch": true
19
- },
20
- "include": ["src/**/*"],
21
- "exclude": ["node_modules", "dist", "__tests__"]
22
- }