@bernierllc/sender-identity-verification 1.3.0 → 1.4.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/src/config.ts CHANGED
@@ -7,6 +7,7 @@ Redistribution or use in other products or commercial offerings is not permitted
7
7
  */
8
8
 
9
9
  import { IEmailDomainVerification } from './types.js';
10
+ import type { EmailSenderManager, SenderProviderPlugin } from '@bernierllc/email-sender-manager';
10
11
 
11
12
  /**
12
13
  * Configuration for sender identity verification service
@@ -23,6 +24,12 @@ export interface SenderIdentityConfig {
23
24
  instance?: IEmailDomainVerification;
24
25
  };
25
26
 
27
+ // Core sender manager for persistence (optional for backward compat)
28
+ senderManager?: EmailSenderManager;
29
+
30
+ // Provider plugins for API-driven sender operations (optional for backward compat)
31
+ providerPlugins?: SenderProviderPlugin[];
32
+
26
33
  // Retry configuration
27
34
  retryConfig?: {
28
35
  maxRetries?: number;
@@ -35,7 +42,7 @@ export interface SenderIdentityConfig {
35
42
  verificationFromEmail: string;
36
43
  verificationFromName: string;
37
44
 
38
- // Provider API keys
45
+ // Provider API keys (legacy — prefer providerPlugins)
39
46
  sendgridApiKey?: string;
40
47
  mailgunApiKey?: string;
41
48
  sesAccessKey?: string;
@@ -65,6 +72,8 @@ export function loadConfigFromEnv(overrides: Partial<SenderIdentityConfig> = {})
65
72
 
66
73
  emailSenderConfig: overrides.emailSenderConfig || {},
67
74
  domainVerificationConfig: overrides.domainVerificationConfig || {},
75
+ senderManager: overrides.senderManager,
76
+ providerPlugins: overrides.providerPlugins,
68
77
  retryConfig: overrides.retryConfig
69
78
  };
70
79
 
package/src/index.ts CHANGED
@@ -22,3 +22,5 @@ export {
22
22
  DomainVerificationStatus,
23
23
  IEmailDomainVerification
24
24
  } from './types.js';
25
+ export { getManualInstructions, isManualVerificationProvider } from './manual-instructions.js';
26
+ export type { ManualVerificationInstruction } from './manual-instructions.js';
@@ -0,0 +1,61 @@
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
+ import { EmailProvider } from './types.js';
10
+
11
+ export interface ManualVerificationInstruction {
12
+ provider: EmailProvider;
13
+ title: string;
14
+ steps: string[];
15
+ dashboardUrl?: string;
16
+ }
17
+
18
+ const MANUAL_INSTRUCTIONS: Record<string, ManualVerificationInstruction> = {
19
+ [EmailProvider.SMTP]: {
20
+ provider: EmailProvider.SMTP,
21
+ title: 'SMTP Sender Verification',
22
+ steps: [
23
+ 'Configure your SMTP server to allow sending from this address.',
24
+ 'Ensure SPF records include your SMTP server IP.',
25
+ 'Configure DKIM signing for the domain.',
26
+ 'Mark the sender as verified once DNS records are propagated.',
27
+ ],
28
+ },
29
+ [EmailProvider.SMTP2GO]: {
30
+ provider: EmailProvider.SMTP2GO,
31
+ title: 'SMTP2GO Sender Verification',
32
+ steps: [
33
+ 'Log in to your SMTP2GO dashboard.',
34
+ 'Navigate to Settings → Sender Domains.',
35
+ 'Add and verify the sender domain.',
36
+ 'Mark the sender as verified once domain is confirmed.',
37
+ ],
38
+ dashboardUrl: 'https://app.smtp2go.com/settings/sender_domains/',
39
+ },
40
+ [EmailProvider.MANDRILL]: {
41
+ provider: EmailProvider.MANDRILL,
42
+ title: 'Mandrill Sender Verification',
43
+ steps: [
44
+ 'Log in to your Mandrill dashboard.',
45
+ 'Navigate to Settings → Sending Domains.',
46
+ 'Add and verify the sender domain.',
47
+ 'Mark the sender as verified once domain is confirmed.',
48
+ ],
49
+ dashboardUrl: 'https://mandrillapp.com/settings/sending-domains',
50
+ },
51
+ };
52
+
53
+ export function getManualInstructions(provider: EmailProvider): ManualVerificationInstruction | null {
54
+ return MANUAL_INSTRUCTIONS[provider] || null;
55
+ }
56
+
57
+ export function isManualVerificationProvider(provider: EmailProvider): boolean {
58
+ return provider === EmailProvider.SMTP
59
+ || provider === EmailProvider.SMTP2GO
60
+ || provider === EmailProvider.MANDRILL;
61
+ }
package/src/types.ts CHANGED
@@ -81,6 +81,9 @@ export interface CreateSenderInput {
81
81
  provider: EmailProvider;
82
82
  isDefault?: boolean;
83
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>;
84
87
  }
85
88
 
86
89
  /**
@@ -92,6 +95,8 @@ export interface UpdateSenderInput {
92
95
  replyToName?: string;
93
96
  isDefault?: boolean;
94
97
  isActive?: boolean;
98
+ lastModifiedBy?: string;
99
+ providerFields?: Record<string, unknown>;
95
100
  }
96
101
 
97
102
  /**