@upyo/sendgrid 0.6.0-dev.318 → 0.6.0-dev.319
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/index.cjs +5 -1
- package/dist/index.js +6 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -237,6 +237,7 @@ function createAbortError(signal) {
|
|
|
237
237
|
* @param message - The Upyo message to convert
|
|
238
238
|
* @param config - The resolved SendGrid configuration
|
|
239
239
|
* @returns Promise that resolves to a SendGrid mail object
|
|
240
|
+
* @throws {TypeError} If the message carries an invalid message identifier.
|
|
240
241
|
*
|
|
241
242
|
* @example
|
|
242
243
|
* ```typescript
|
|
@@ -294,7 +295,10 @@ async function convertMessage(message, config, signal) {
|
|
|
294
295
|
}
|
|
295
296
|
if (message.tags.length > 0) sendGridMail.categories = [...message.tags];
|
|
296
297
|
const customHeaders = {};
|
|
297
|
-
|
|
298
|
+
const threading = (0, __upyo_core.resolveThreadingHeaders)(message);
|
|
299
|
+
const ownedHeaders = new Set([...threading.keys()].map((name) => name.toLowerCase()));
|
|
300
|
+
for (const [key, value] of message.headers.entries()) if (!isStandardHeader(key) && !ownedHeaders.has(key.toLowerCase())) customHeaders[key] = value;
|
|
301
|
+
for (const [name, value] of threading) if (value != null) customHeaders[name] = value;
|
|
298
302
|
if (Object.keys(customHeaders).length > 0) sendGridMail.headers = {
|
|
299
303
|
...sendGridMail.headers,
|
|
300
304
|
...customHeaders
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { combineSignals, createFailedReceipt, parseRetryAfter, readAttachmentContent } from "@upyo/core";
|
|
1
|
+
import { combineSignals, createFailedReceipt, parseRetryAfter, readAttachmentContent, resolveThreadingHeaders } from "@upyo/core";
|
|
2
2
|
|
|
3
3
|
//#region src/config.ts
|
|
4
4
|
/**
|
|
@@ -214,6 +214,7 @@ function createAbortError(signal) {
|
|
|
214
214
|
* @param message - The Upyo message to convert
|
|
215
215
|
* @param config - The resolved SendGrid configuration
|
|
216
216
|
* @returns Promise that resolves to a SendGrid mail object
|
|
217
|
+
* @throws {TypeError} If the message carries an invalid message identifier.
|
|
217
218
|
*
|
|
218
219
|
* @example
|
|
219
220
|
* ```typescript
|
|
@@ -271,7 +272,10 @@ async function convertMessage(message, config, signal) {
|
|
|
271
272
|
}
|
|
272
273
|
if (message.tags.length > 0) sendGridMail.categories = [...message.tags];
|
|
273
274
|
const customHeaders = {};
|
|
274
|
-
|
|
275
|
+
const threading = resolveThreadingHeaders(message);
|
|
276
|
+
const ownedHeaders = new Set([...threading.keys()].map((name) => name.toLowerCase()));
|
|
277
|
+
for (const [key, value] of message.headers.entries()) if (!isStandardHeader(key) && !ownedHeaders.has(key.toLowerCase())) customHeaders[key] = value;
|
|
278
|
+
for (const [name, value] of threading) if (value != null) customHeaders[name] = value;
|
|
275
279
|
if (Object.keys(customHeaders).length > 0) sendGridMail.headers = {
|
|
276
280
|
...sendGridMail.headers,
|
|
277
281
|
...customHeaders
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upyo/sendgrid",
|
|
3
|
-
"version": "0.6.0-dev.
|
|
3
|
+
"version": "0.6.0-dev.319",
|
|
4
4
|
"description": "SendGrid transport for Upyo email library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@upyo/core": "0.6.0-dev.
|
|
56
|
+
"@upyo/core": "0.6.0-dev.319+2324fa8c"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"tsdown": "^0.12.7",
|