@bernierllc/email-sendgrid-plugin 1.8.1 → 1.8.2
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/package.json +2 -2
- package/dist/api/errors.d.ts +0 -20
- package/dist/api/errors.js +0 -55
- package/dist/api/rate-limiter.d.ts +0 -17
- package/dist/api/rate-limiter.js +0 -60
- package/dist/api/sendgrid-client.d.ts +0 -21
- package/dist/api/sendgrid-client.js +0 -70
- package/dist/converters/sender-converter.d.ts +0 -30
- package/dist/converters/sender-converter.js +0 -114
- package/dist/converters/template-converter.d.ts +0 -11
- package/dist/converters/template-converter.js +0 -77
- package/dist/errors.d.ts +0 -11
- package/dist/errors.js +0 -24
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -45
- package/dist/plugin/sender-manager.d.ts +0 -20
- package/dist/plugin/sender-manager.js +0 -129
- package/dist/plugin/sendgrid-plugin.d.ts +0 -60
- package/dist/plugin/sendgrid-plugin.js +0 -215
- package/dist/plugin/sync-manager.d.ts +0 -19
- package/dist/plugin/sync-manager.js +0 -98
- package/dist/plugin/template-manager.d.ts +0 -25
- package/dist/plugin/template-manager.js +0 -157
- package/dist/safety/ownership-validator.d.ts +0 -15
- package/dist/safety/ownership-validator.js +0 -44
- package/dist/safety/prefix-enforcer.d.ts +0 -8
- package/dist/safety/prefix-enforcer.js +0 -35
- package/dist/types/config-types.d.ts +0 -24
- package/dist/types/config-types.js +0 -9
- package/dist/types/plugin-types.d.ts +0 -79
- package/dist/types/plugin-types.js +0 -9
- package/dist/types/sendgrid-types.d.ts +0 -82
- package/dist/types/sendgrid-types.js +0 -9
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright (c) 2025 Bernier LLC
|
|
4
|
-
|
|
5
|
-
This file is licensed to the client under a limited-use license.
|
|
6
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TemplateManager = void 0;
|
|
11
|
-
const errors_1 = require("../api/errors");
|
|
12
|
-
class TemplateManager {
|
|
13
|
-
client;
|
|
14
|
-
ownershipValidator;
|
|
15
|
-
prefixEnforcer;
|
|
16
|
-
converter;
|
|
17
|
-
logger;
|
|
18
|
-
constructor(client, ownershipValidator, prefixEnforcer, converter, logger) {
|
|
19
|
-
this.client = client;
|
|
20
|
-
this.ownershipValidator = ownershipValidator;
|
|
21
|
-
this.prefixEnforcer = prefixEnforcer;
|
|
22
|
-
this.converter = converter;
|
|
23
|
-
this.logger = logger;
|
|
24
|
-
}
|
|
25
|
-
async createTemplate(template) {
|
|
26
|
-
// Apply template naming convention
|
|
27
|
-
const templateName = this.prefixEnforcer.applyPrefix(template.name);
|
|
28
|
-
// Create base template in SendGrid
|
|
29
|
-
const createRequest = {
|
|
30
|
-
name: templateName,
|
|
31
|
-
generation: 'dynamic'
|
|
32
|
-
};
|
|
33
|
-
const response = await this.client.request('/templates', {
|
|
34
|
-
method: 'POST',
|
|
35
|
-
body: JSON.stringify(createRequest)
|
|
36
|
-
});
|
|
37
|
-
if (!this.client.isSuccessResponse(response)) {
|
|
38
|
-
throw new errors_1.SendGridApiError(`Failed to create template: ${response.statusCode}`, response.statusCode, response.body);
|
|
39
|
-
}
|
|
40
|
-
const templateData = this.client.parseResponseBody(response);
|
|
41
|
-
const templateId = templateData.id;
|
|
42
|
-
// Register as app-managed
|
|
43
|
-
this.ownershipValidator.registerTemplate(templateId);
|
|
44
|
-
// Create initial version with content
|
|
45
|
-
await this.createTemplateVersion(templateId, {
|
|
46
|
-
name: 'v1.0.0',
|
|
47
|
-
subject: template.subject,
|
|
48
|
-
htmlContent: template.htmlContent,
|
|
49
|
-
textContent: template.textContent,
|
|
50
|
-
active: true
|
|
51
|
-
});
|
|
52
|
-
// Log operation
|
|
53
|
-
this.logger?.info(`Created SendGrid template: ${templateName} (ID: ${templateId})`);
|
|
54
|
-
return templateId;
|
|
55
|
-
}
|
|
56
|
-
async updateTemplate(providerTemplateId, template) {
|
|
57
|
-
// Validate template ownership
|
|
58
|
-
this.ownershipValidator.validateOwnership(providerTemplateId);
|
|
59
|
-
// Get current template state
|
|
60
|
-
const currentTemplate = await this.getTemplate(providerTemplateId);
|
|
61
|
-
// Check for conflicts
|
|
62
|
-
if (this.hasConflicts(currentTemplate, template)) {
|
|
63
|
-
throw new errors_1.TemplateConflictError(providerTemplateId, this.detectConflicts(currentTemplate, template));
|
|
64
|
-
}
|
|
65
|
-
// Create new version with updated content
|
|
66
|
-
await this.createTemplateVersion(providerTemplateId, {
|
|
67
|
-
name: `v${template.version}`,
|
|
68
|
-
subject: template.subject,
|
|
69
|
-
htmlContent: template.htmlContent,
|
|
70
|
-
textContent: template.textContent,
|
|
71
|
-
active: template.isActive
|
|
72
|
-
});
|
|
73
|
-
this.logger?.info(`Updated SendGrid template: ${providerTemplateId}`);
|
|
74
|
-
}
|
|
75
|
-
async deleteTemplate(providerTemplateId) {
|
|
76
|
-
this.ownershipValidator.validateOwnership(providerTemplateId);
|
|
77
|
-
const response = await this.client.request(`/templates/${providerTemplateId}`, {
|
|
78
|
-
method: 'DELETE'
|
|
79
|
-
});
|
|
80
|
-
if (!this.client.isSuccessResponse(response)) {
|
|
81
|
-
throw new errors_1.SendGridApiError(`Failed to delete template: ${response.statusCode}`, response.statusCode, response.body);
|
|
82
|
-
}
|
|
83
|
-
this.ownershipValidator.unregisterTemplate(providerTemplateId);
|
|
84
|
-
this.logger?.info(`Deleted SendGrid template: ${providerTemplateId}`);
|
|
85
|
-
}
|
|
86
|
-
async getTemplate(providerTemplateId) {
|
|
87
|
-
this.ownershipValidator.validateOwnership(providerTemplateId);
|
|
88
|
-
const response = await this.client.request(`/templates/${providerTemplateId}`, {
|
|
89
|
-
method: 'GET'
|
|
90
|
-
});
|
|
91
|
-
if (response.statusCode === 404) {
|
|
92
|
-
throw new errors_1.TemplateNotFoundError(providerTemplateId);
|
|
93
|
-
}
|
|
94
|
-
if (!this.client.isSuccessResponse(response)) {
|
|
95
|
-
throw new errors_1.SendGridApiError(`Failed to get template: ${response.statusCode}`, response.statusCode, response.body);
|
|
96
|
-
}
|
|
97
|
-
const templateData = this.client.parseResponseBody(response);
|
|
98
|
-
return this.converter.convertToProviderTemplate(templateData);
|
|
99
|
-
}
|
|
100
|
-
async listTemplates() {
|
|
101
|
-
const response = await this.client.request('/templates?generations=dynamic', {
|
|
102
|
-
method: 'GET'
|
|
103
|
-
});
|
|
104
|
-
if (!this.client.isSuccessResponse(response)) {
|
|
105
|
-
throw new errors_1.SendGridApiError(`Failed to list templates: ${response.statusCode}`, response.statusCode, response.body);
|
|
106
|
-
}
|
|
107
|
-
const data = this.client.parseResponseBody(response);
|
|
108
|
-
// Filter to only app-managed templates
|
|
109
|
-
const appTemplates = data.result.filter(template => this.prefixEnforcer.hasPrefix(template.name));
|
|
110
|
-
// Register all app templates
|
|
111
|
-
appTemplates.forEach(template => {
|
|
112
|
-
this.ownershipValidator.registerTemplate(template.id);
|
|
113
|
-
});
|
|
114
|
-
return appTemplates.map(template => this.converter.convertToProviderTemplate(template));
|
|
115
|
-
}
|
|
116
|
-
async createTemplateVersion(templateId, version) {
|
|
117
|
-
const versionRequest = {
|
|
118
|
-
template_id: templateId,
|
|
119
|
-
name: version.name,
|
|
120
|
-
subject: version.subject,
|
|
121
|
-
html_content: version.htmlContent,
|
|
122
|
-
plain_content: version.textContent || '',
|
|
123
|
-
active: version.active ? 1 : 0
|
|
124
|
-
};
|
|
125
|
-
const response = await this.client.request(`/templates/${templateId}/versions`, {
|
|
126
|
-
method: 'POST',
|
|
127
|
-
body: JSON.stringify(versionRequest)
|
|
128
|
-
});
|
|
129
|
-
if (!this.client.isSuccessResponse(response)) {
|
|
130
|
-
throw new errors_1.SendGridApiError(`Failed to create template version: ${response.statusCode}`, response.statusCode, response.body);
|
|
131
|
-
}
|
|
132
|
-
const versionData = this.client.parseResponseBody(response);
|
|
133
|
-
return versionData.id;
|
|
134
|
-
}
|
|
135
|
-
async activateTemplateVersion(templateId, versionId) {
|
|
136
|
-
const response = await this.client.request(`/templates/${templateId}/versions/${versionId}/activate`, { method: 'POST' });
|
|
137
|
-
if (!this.client.isSuccessResponse(response)) {
|
|
138
|
-
throw new errors_1.SendGridApiError(`Failed to activate template version: ${response.statusCode}`, response.statusCode, response.body);
|
|
139
|
-
}
|
|
140
|
-
this.logger?.info(`Activated template version: ${templateId}/${versionId}`);
|
|
141
|
-
}
|
|
142
|
-
hasConflicts(current, updated) {
|
|
143
|
-
// Simple conflict detection - can be enhanced
|
|
144
|
-
return current.updatedAt > updated.updatedAt;
|
|
145
|
-
}
|
|
146
|
-
detectConflicts(current, updated) {
|
|
147
|
-
const conflicts = [];
|
|
148
|
-
if (current.subject !== updated.subject) {
|
|
149
|
-
conflicts.push('subject modified');
|
|
150
|
-
}
|
|
151
|
-
if (current.htmlContent !== updated.htmlContent) {
|
|
152
|
-
conflicts.push('HTML content modified');
|
|
153
|
-
}
|
|
154
|
-
return conflicts;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.TemplateManager = TemplateManager;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type SafetyMode = 'strict' | 'permissive';
|
|
2
|
-
export declare class OwnershipValidator {
|
|
3
|
-
private appTemplateIds;
|
|
4
|
-
private readonly safetyMode;
|
|
5
|
-
private readonly logger?;
|
|
6
|
-
constructor(safetyMode: SafetyMode, logger?: {
|
|
7
|
-
debug: (message: string) => void;
|
|
8
|
-
});
|
|
9
|
-
registerTemplate(templateId: string): void;
|
|
10
|
-
unregisterTemplate(templateId: string): void;
|
|
11
|
-
validateOwnership(templateId: string): void;
|
|
12
|
-
isOwnedTemplate(templateId: string): boolean;
|
|
13
|
-
getOwnedTemplates(): string[];
|
|
14
|
-
clearRegistrations(): void;
|
|
15
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright (c) 2025 Bernier LLC
|
|
4
|
-
|
|
5
|
-
This file is licensed to the client under a limited-use license.
|
|
6
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.OwnershipValidator = void 0;
|
|
11
|
-
const errors_1 = require("../api/errors");
|
|
12
|
-
class OwnershipValidator {
|
|
13
|
-
appTemplateIds = new Set();
|
|
14
|
-
safetyMode;
|
|
15
|
-
logger;
|
|
16
|
-
constructor(safetyMode, logger) {
|
|
17
|
-
this.safetyMode = safetyMode;
|
|
18
|
-
this.logger = logger;
|
|
19
|
-
}
|
|
20
|
-
registerTemplate(templateId) {
|
|
21
|
-
this.appTemplateIds.add(templateId);
|
|
22
|
-
this.logger?.debug(`Registered app template: ${templateId}`);
|
|
23
|
-
}
|
|
24
|
-
unregisterTemplate(templateId) {
|
|
25
|
-
this.appTemplateIds.delete(templateId);
|
|
26
|
-
this.logger?.debug(`Unregistered app template: ${templateId}`);
|
|
27
|
-
}
|
|
28
|
-
validateOwnership(templateId) {
|
|
29
|
-
if (this.safetyMode === 'strict' && !this.appTemplateIds.has(templateId)) {
|
|
30
|
-
throw new errors_1.UnauthorizedTemplateAccessError(`Template ${templateId} is not managed by this application`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
isOwnedTemplate(templateId) {
|
|
34
|
-
return this.appTemplateIds.has(templateId);
|
|
35
|
-
}
|
|
36
|
-
getOwnedTemplates() {
|
|
37
|
-
return Array.from(this.appTemplateIds);
|
|
38
|
-
}
|
|
39
|
-
clearRegistrations() {
|
|
40
|
-
this.appTemplateIds.clear();
|
|
41
|
-
this.logger?.debug('Cleared all template registrations');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.OwnershipValidator = OwnershipValidator;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright (c) 2025 Bernier LLC
|
|
4
|
-
|
|
5
|
-
This file is licensed to the client under a limited-use license.
|
|
6
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.PrefixEnforcer = void 0;
|
|
11
|
-
class PrefixEnforcer {
|
|
12
|
-
prefix;
|
|
13
|
-
constructor(prefix) {
|
|
14
|
-
this.prefix = prefix;
|
|
15
|
-
}
|
|
16
|
-
applyPrefix(name) {
|
|
17
|
-
if (name.startsWith(this.prefix)) {
|
|
18
|
-
return name;
|
|
19
|
-
}
|
|
20
|
-
return `${this.prefix}${name}`;
|
|
21
|
-
}
|
|
22
|
-
stripPrefix(name) {
|
|
23
|
-
if (name.startsWith(this.prefix)) {
|
|
24
|
-
return name.substring(this.prefix.length);
|
|
25
|
-
}
|
|
26
|
-
return name;
|
|
27
|
-
}
|
|
28
|
-
hasPrefix(name) {
|
|
29
|
-
return name.startsWith(this.prefix);
|
|
30
|
-
}
|
|
31
|
-
getPrefix() {
|
|
32
|
-
return this.prefix;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.PrefixEnforcer = PrefixEnforcer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface SendGridPluginConfig {
|
|
2
|
-
apiKey: string;
|
|
3
|
-
templatePrefix: string;
|
|
4
|
-
sharedAccount?: boolean;
|
|
5
|
-
safetyMode: 'strict' | 'permissive';
|
|
6
|
-
rateLimits?: {
|
|
7
|
-
templatesPerMinute: number;
|
|
8
|
-
apiCallsPerSecond: number;
|
|
9
|
-
};
|
|
10
|
-
webhookConfig?: {
|
|
11
|
-
secret: string;
|
|
12
|
-
eventTypes: string[];
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface ApiRequestOptions {
|
|
16
|
-
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
17
|
-
headers?: Record<string, string>;
|
|
18
|
-
body?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface ApiResponse {
|
|
21
|
-
statusCode: number;
|
|
22
|
-
headers: Record<string, string>;
|
|
23
|
-
body: string;
|
|
24
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright (c) 2025 Bernier LLC
|
|
4
|
-
|
|
5
|
-
This file is licensed to the client under a limited-use license.
|
|
6
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export interface PluginConfig {
|
|
2
|
-
[key: string]: unknown;
|
|
3
|
-
}
|
|
4
|
-
export interface ProviderCapability {
|
|
5
|
-
feature: string;
|
|
6
|
-
description: string;
|
|
7
|
-
methods: string[];
|
|
8
|
-
config: Record<string, unknown>;
|
|
9
|
-
}
|
|
10
|
-
export interface Template {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
subject: string;
|
|
15
|
-
htmlContent: string;
|
|
16
|
-
textContent?: string;
|
|
17
|
-
category: string;
|
|
18
|
-
tags: string[];
|
|
19
|
-
version: string;
|
|
20
|
-
isActive: boolean;
|
|
21
|
-
context?: string;
|
|
22
|
-
variables?: Record<string, unknown>;
|
|
23
|
-
requiredVariables: string[];
|
|
24
|
-
providerTemplateIds?: Record<string, string>;
|
|
25
|
-
lastSyncedAt?: Record<string, Date>;
|
|
26
|
-
syncStatus?: Record<string, string>;
|
|
27
|
-
createdAt: Date;
|
|
28
|
-
updatedAt: Date;
|
|
29
|
-
createdBy: string;
|
|
30
|
-
lastModifiedBy: string;
|
|
31
|
-
}
|
|
32
|
-
export interface ProviderTemplate {
|
|
33
|
-
id: string;
|
|
34
|
-
name: string;
|
|
35
|
-
description?: string;
|
|
36
|
-
subject: string;
|
|
37
|
-
htmlContent: string;
|
|
38
|
-
textContent?: string;
|
|
39
|
-
version: string;
|
|
40
|
-
active: boolean;
|
|
41
|
-
createdAt: Date;
|
|
42
|
-
updatedAt: Date;
|
|
43
|
-
}
|
|
44
|
-
export interface TemplateVersion {
|
|
45
|
-
name: string;
|
|
46
|
-
subject: string;
|
|
47
|
-
htmlContent: string;
|
|
48
|
-
textContent?: string;
|
|
49
|
-
active: boolean;
|
|
50
|
-
}
|
|
51
|
-
export interface SyncResult {
|
|
52
|
-
success: boolean;
|
|
53
|
-
action: 'created' | 'updated' | 'deleted' | 'failed';
|
|
54
|
-
providerTemplateId?: string;
|
|
55
|
-
localTemplateId?: string;
|
|
56
|
-
error?: string;
|
|
57
|
-
metadata: Record<string, unknown>;
|
|
58
|
-
}
|
|
59
|
-
export interface ValidationResult {
|
|
60
|
-
isValid: boolean;
|
|
61
|
-
errors: string[];
|
|
62
|
-
}
|
|
63
|
-
export interface RouteConflict {
|
|
64
|
-
templateId: string;
|
|
65
|
-
conflicts: string[];
|
|
66
|
-
}
|
|
67
|
-
export interface DateRange {
|
|
68
|
-
start: Date;
|
|
69
|
-
end: Date;
|
|
70
|
-
}
|
|
71
|
-
export interface TemplateAnalytics {
|
|
72
|
-
templateId: string;
|
|
73
|
-
opens: number;
|
|
74
|
-
clicks: number;
|
|
75
|
-
bounces: number;
|
|
76
|
-
deliveries: number;
|
|
77
|
-
dateRange: DateRange;
|
|
78
|
-
}
|
|
79
|
-
export type FeatureConfig = Record<string, unknown>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright (c) 2025 Bernier LLC
|
|
4
|
-
|
|
5
|
-
This file is licensed to the client under a limited-use license.
|
|
6
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
export interface VerifiedSender {
|
|
2
|
-
id: string;
|
|
3
|
-
email: string;
|
|
4
|
-
name: string;
|
|
5
|
-
isVerified: boolean;
|
|
6
|
-
domain: string;
|
|
7
|
-
verificationStatus: 'pending' | 'verified' | 'failed';
|
|
8
|
-
createdAt: Date;
|
|
9
|
-
lastVerifiedAt?: Date;
|
|
10
|
-
}
|
|
11
|
-
export interface SenderValidationResult {
|
|
12
|
-
isValid: boolean;
|
|
13
|
-
verifiedSender?: VerifiedSender;
|
|
14
|
-
domain: string;
|
|
15
|
-
domainMatches: VerifiedSender[];
|
|
16
|
-
errors: string[];
|
|
17
|
-
suggestions: string[];
|
|
18
|
-
}
|
|
19
|
-
export interface SendGridTemplateData {
|
|
20
|
-
id: string;
|
|
21
|
-
name: string;
|
|
22
|
-
generation: 'legacy' | 'dynamic';
|
|
23
|
-
updated_at: string;
|
|
24
|
-
versions?: SendGridTemplateVersion[];
|
|
25
|
-
}
|
|
26
|
-
export interface SendGridTemplateVersion {
|
|
27
|
-
id: string;
|
|
28
|
-
template_id: string;
|
|
29
|
-
active: number;
|
|
30
|
-
name: string;
|
|
31
|
-
html_content: string;
|
|
32
|
-
plain_content?: string;
|
|
33
|
-
subject: string;
|
|
34
|
-
updated_at: string;
|
|
35
|
-
editor: string;
|
|
36
|
-
}
|
|
37
|
-
export interface SendGridVerifiedSenderData {
|
|
38
|
-
id: number;
|
|
39
|
-
nickname: string;
|
|
40
|
-
from_email: string;
|
|
41
|
-
from_name: string;
|
|
42
|
-
reply_to: string;
|
|
43
|
-
reply_to_name: string;
|
|
44
|
-
address: string;
|
|
45
|
-
address2: string;
|
|
46
|
-
city: string;
|
|
47
|
-
state: string;
|
|
48
|
-
zip: string;
|
|
49
|
-
country: string;
|
|
50
|
-
verified: boolean;
|
|
51
|
-
locked: boolean;
|
|
52
|
-
}
|
|
53
|
-
export interface SendGridApiError extends Error {
|
|
54
|
-
statusCode?: number;
|
|
55
|
-
response?: unknown;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Email attachment in the canonical format (matches @bernierllc/email-sender EmailAttachment).
|
|
59
|
-
*/
|
|
60
|
-
export interface EmailAttachment {
|
|
61
|
-
filename: string;
|
|
62
|
-
content: string;
|
|
63
|
-
contentType?: string;
|
|
64
|
-
disposition?: 'attachment' | 'inline';
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* SendGrid's attachment format for the v3 mail send API.
|
|
68
|
-
*/
|
|
69
|
-
export interface SendGridAttachment {
|
|
70
|
-
content: string;
|
|
71
|
-
filename: string;
|
|
72
|
-
type?: string;
|
|
73
|
-
disposition?: string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* SendGrid mail personalization/message payload fields related to
|
|
77
|
-
* attachments and custom headers.
|
|
78
|
-
*/
|
|
79
|
-
export interface SendGridMailPayload {
|
|
80
|
-
attachments?: SendGridAttachment[];
|
|
81
|
-
headers?: Record<string, string>;
|
|
82
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright (c) 2025 Bernier LLC
|
|
4
|
-
|
|
5
|
-
This file is licensed to the client under a limited-use license.
|
|
6
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|