n8n-nodes-resend 2.6.3 → 2.6.4

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 (30) hide show
  1. package/README.md +1 -0
  2. package/dist/nodes/Resend/Resend.node.d.ts +3 -1
  3. package/dist/nodes/Resend/Resend.node.js +10 -1
  4. package/dist/nodes/Resend/actions/router.js +2 -0
  5. package/dist/nodes/Resend/actions/suppression/batchAdd.operation.d.ts +8 -0
  6. package/dist/nodes/Resend/actions/suppression/batchAdd.operation.js +41 -0
  7. package/dist/nodes/Resend/actions/suppression/batchRemove.operation.d.ts +8 -0
  8. package/dist/nodes/Resend/actions/suppression/batchRemove.operation.js +80 -0
  9. package/dist/nodes/Resend/actions/suppression/create.operation.d.ts +8 -0
  10. package/dist/nodes/Resend/actions/suppression/create.operation.js +37 -0
  11. package/dist/nodes/Resend/actions/suppression/delete.operation.d.ts +8 -0
  12. package/dist/nodes/Resend/actions/suppression/delete.operation.js +37 -0
  13. package/dist/nodes/Resend/actions/suppression/execute.d.ts +4 -0
  14. package/dist/nodes/Resend/actions/suppression/execute.js +18 -0
  15. package/dist/nodes/Resend/actions/suppression/get.operation.d.ts +8 -0
  16. package/dist/nodes/Resend/actions/suppression/get.operation.js +37 -0
  17. package/dist/nodes/Resend/actions/suppression/index.d.ts +13 -0
  18. package/dist/nodes/Resend/actions/suppression/index.js +122 -0
  19. package/dist/nodes/Resend/actions/suppression/list.operation.d.ts +8 -0
  20. package/dist/nodes/Resend/actions/suppression/list.operation.js +83 -0
  21. package/dist/nodes/Resend/methods/index.d.ts +3 -1
  22. package/dist/nodes/Resend/methods/index.js +29 -27
  23. package/dist/nodes/Resend/transport/index.js +4 -2
  24. package/dist/nodes/Resend/utils/dynamicFields.d.ts +2 -0
  25. package/dist/nodes/Resend/utils/dynamicFields.js +2 -61
  26. package/dist/nodes/Resend/utils/sendAndWait/email-templates.d.ts +1 -3
  27. package/dist/nodes/Resend/utils/sendAndWait/email-templates.js +0 -10
  28. package/dist/nodes/Resend/utils/sendAndWait/index.d.ts +2 -2
  29. package/dist/nodes/Resend/utils/sendAndWait/index.js +0 -2
  30. package/package.json +6 -4
package/README.md CHANGED
@@ -45,6 +45,7 @@ The table below shows which endpoints are currently implemented:
45
45
  | **Contacts** | `/contacts` | ✅ Full | Create, List, Get, Update, Delete, Add to Segment, List Segments, Remove from Segment, Get Topics, Update Topics |
46
46
  | **Broadcasts** | `/broadcasts` | ✅ Full | Create, List, Get, Update, Delete, Send |
47
47
  | **Segments** | `/segments` | ✅ Full | Create, List, Get, Delete |
48
+ | **Suppressions** | `/suppressions` | ✅ Full | Create, List, Get, Delete, Batch Add, Batch Remove |
48
49
  | **Topics** | `/topics` | ✅ Full | Create, List, Get, Update, Delete |
49
50
  | **Contact Properties** | `/contact-properties` | ✅ Full | Create, List, Get, Update, Delete |
50
51
  | **Webhooks** | `/webhooks` | ✅ Full | Create, List, Get, Update, Delete |
@@ -1,5 +1,5 @@
1
1
  import { router } from "./actions/router.js";
2
- import { getBroadcasts, getContactProperties, getContacts, getDomains, getEmails, getReceivedEmails, getSegments, getTemplateVariables, getTemplates, getTopics, getWebhooks } from "./methods/index.js";
2
+ import { getBroadcasts, getContactProperties, getContacts, getDomains, getEmails, getReceivedEmails, getSegments, getSuppressions, getTemplateVariables, getTemplates, getTopics, getWebhooks } from "./methods/index.js";
3
3
  import { INodeType, INodeTypeDescription, IWebhookFunctions } from "n8n-workflow";
4
4
  //#region nodes/Resend/Resend.node.d.ts
5
5
  declare class Resend implements INodeType {
@@ -13,6 +13,7 @@ declare class Resend implements INodeType {
13
13
  getEmails: typeof getEmails;
14
14
  getReceivedEmails: typeof getReceivedEmails;
15
15
  getSegments: typeof getSegments;
16
+ getSuppressions: typeof getSuppressions;
16
17
  getTemplateVariables: typeof getTemplateVariables;
17
18
  getTemplates: typeof getTemplates;
18
19
  getTopics: typeof getTopics;
@@ -26,6 +27,7 @@ declare class Resend implements INodeType {
26
27
  getEmails: (this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string) => Promise<import("n8n-workflow").INodeListSearchResult>;
27
28
  getReceivedEmails: (this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string) => Promise<import("n8n-workflow").INodeListSearchResult>;
28
29
  getSegments: (this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string) => Promise<import("n8n-workflow").INodeListSearchResult>;
30
+ getSuppressions: (this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string) => Promise<import("n8n-workflow").INodeListSearchResult>;
29
31
  getTemplates: (this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string) => Promise<import("n8n-workflow").INodeListSearchResult>;
30
32
  getTemplateVariables: (this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string) => Promise<import("n8n-workflow").INodeListSearchResult>;
31
33
  getTopics: (this: import("n8n-workflow").ILoadOptionsFunctions, filter?: string) => Promise<import("n8n-workflow").INodeListSearchResult>;
@@ -12,6 +12,7 @@ const require_nodes_Resend_actions_event_index = require("./actions/event/index.
12
12
  const require_nodes_Resend_actions_log_index = require("./actions/log/index.js");
13
13
  const require_nodes_Resend_actions_receivingEmail_index = require("./actions/receivingEmail/index.js");
14
14
  const require_nodes_Resend_actions_segment_index = require("./actions/segment/index.js");
15
+ const require_nodes_Resend_actions_suppression_index = require("./actions/suppression/index.js");
15
16
  const require_nodes_Resend_actions_template_index = require("./actions/template/index.js");
16
17
  const require_nodes_Resend_actions_topic_index = require("./actions/topic/index.js");
17
18
  const require_nodes_Resend_actions_webhook_index = require("./actions/webhook/index.js");
@@ -33,7 +34,7 @@ var Resend = class {
33
34
  version: 1,
34
35
  usableAsTool: true,
35
36
  description: "Send emails, manage contacts, create broadcasts, handle templates, domains, segments, topics, and webhooks using the Resend email platform",
36
- subtitle: "={{(() => { const resourceLabels = { broadcasts: \"broadcast\", contacts: \"contact\", contactProperties: \"contact property\", domains: \"domain\", email: \"email\", logs: \"log\", receivingEmails: \"received email\", workflows: \"workflow\", events: \"event\", segments: \"segment\", templates: \"template\", topics: \"topic\", webhooks: \"webhook\" }; const operationLabels = { retrieve: \"get\", sendBatch: \"send batch\", listAttachments: \"list attachments\", getAttachment: \"get attachment\", addToSegment: \"add to segment\", listSegments: \"list segments\", removeFromSegment: \"remove from segment\", getTopics: \"get topics\", updateTopics: \"update topics\", listRuns: \"list runs\", getRun: \"get run\", listRunSteps: \"list run steps\", getRunStep: \"get run step\" }; const resource = $parameter[\"resource\"]; const operation = $parameter[\"operation\"]; const resourceLabel = resourceLabels[resource] ?? resource; const operationLabel = operationLabels[operation] ?? operation; return operationLabel + \": \" + resourceLabel; })() }}",
37
+ subtitle: "={{(() => { const resourceLabels = { account: \"account\", broadcasts: \"broadcast\", contacts: \"contact\", contactProperties: \"contact property\", domains: \"domain\", email: \"email\", logs: \"log\", receivingEmails: \"received email\", workflows: \"workflow\", events: \"event\", segments: \"segment\", suppressions: \"suppression\", templates: \"template\", topics: \"topic\", webhooks: \"webhook\" }; const operationLabels = { retrieve: \"get\", sendBatch: \"send batch\", listAttachments: \"list attachments\", getAttachment: \"get attachment\", addToSegment: \"add to segment\", listSegments: \"list segments\", removeFromSegment: \"remove from segment\", getTopics: \"get topics\", updateTopics: \"update topics\", listRuns: \"list runs\", getRun: \"get run\", listRunSteps: \"list run steps\", getRunStep: \"get run step\", batchAdd: \"batch add\", batchRemove: \"batch remove\" }; const resource = $parameter[\"resource\"]; const operation = $parameter[\"operation\"]; const resourceLabel = resourceLabels[resource] ?? resource; const operationLabel = operationLabels[operation] ?? operation; return operationLabel + \": \" + resourceLabel; })() }}",
37
38
  defaults: { name: "Resend" },
38
39
  credentials: [{
39
40
  name: "resendOAuth2Api",
@@ -120,6 +121,11 @@ var Resend = class {
120
121
  value: "segments",
121
122
  description: "Create, update, delete, or list contact segments for grouping contacts based on criteria"
122
123
  },
124
+ {
125
+ name: "Suppression",
126
+ value: "suppressions",
127
+ description: "Add, remove, or list suppressed email addresses that Resend skips at send time to avoid hard bounces and spam complaints"
128
+ },
123
129
  {
124
130
  name: "Template",
125
131
  value: "templates",
@@ -149,6 +155,7 @@ var Resend = class {
149
155
  ...require_nodes_Resend_actions_domain_index.descriptions,
150
156
  ...require_nodes_Resend_actions_broadcast_index.descriptions,
151
157
  ...require_nodes_Resend_actions_segment_index.descriptions,
158
+ ...require_nodes_Resend_actions_suppression_index.descriptions,
152
159
  ...require_nodes_Resend_actions_topic_index.descriptions,
153
160
  ...require_nodes_Resend_actions_contact_index.descriptions,
154
161
  ...require_nodes_Resend_actions_contactProperty_index.descriptions,
@@ -168,6 +175,7 @@ var Resend = class {
168
175
  getEmails: require_nodes_Resend_methods_index.getEmails,
169
176
  getReceivedEmails: require_nodes_Resend_methods_index.getReceivedEmails,
170
177
  getSegments: require_nodes_Resend_methods_index.getSegments,
178
+ getSuppressions: require_nodes_Resend_methods_index.getSuppressions,
171
179
  getTemplateVariables: require_nodes_Resend_methods_index.getTemplateVariables,
172
180
  getTemplates: require_nodes_Resend_methods_index.getTemplates,
173
181
  getTopics: require_nodes_Resend_methods_index.getTopics,
@@ -181,6 +189,7 @@ var Resend = class {
181
189
  getEmails: require_nodes_Resend_methods_index.getEmailsListSearch,
182
190
  getReceivedEmails: require_nodes_Resend_methods_index.getReceivedEmailsListSearch,
183
191
  getSegments: require_nodes_Resend_methods_index.getSegmentsListSearch,
192
+ getSuppressions: require_nodes_Resend_methods_index.getSuppressionsListSearch,
184
193
  getTemplates: require_nodes_Resend_methods_index.getTemplatesListSearch,
185
194
  getTemplateVariables: require_nodes_Resend_methods_index.getTemplateVariablesListSearch,
186
195
  getTopics: require_nodes_Resend_methods_index.getTopicsListSearch,
@@ -10,6 +10,7 @@ const require_nodes_Resend_actions_event_index = require("./event/index.js");
10
10
  const require_nodes_Resend_actions_log_index = require("./log/index.js");
11
11
  const require_nodes_Resend_actions_receivingEmail_index = require("./receivingEmail/index.js");
12
12
  const require_nodes_Resend_actions_segment_index = require("./segment/index.js");
13
+ const require_nodes_Resend_actions_suppression_index = require("./suppression/index.js");
13
14
  const require_nodes_Resend_actions_template_index = require("./template/index.js");
14
15
  const require_nodes_Resend_actions_topic_index = require("./topic/index.js");
15
16
  const require_nodes_Resend_actions_webhook_index = require("./webhook/index.js");
@@ -23,6 +24,7 @@ const resourceModules = {
23
24
  domains: require_nodes_Resend_actions_domain_index.domain_exports,
24
25
  broadcasts: require_nodes_Resend_actions_broadcast_index.broadcast_exports,
25
26
  segments: require_nodes_Resend_actions_segment_index.segment_exports,
27
+ suppressions: require_nodes_Resend_actions_suppression_index.suppression_exports,
26
28
  topics: require_nodes_Resend_actions_topic_index.topic_exports,
27
29
  contacts: require_nodes_Resend_actions_contact_index.contact_exports,
28
30
  contactProperties: require_nodes_Resend_actions_contactProperty_index.contactProperty_exports,
@@ -0,0 +1,8 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from "n8n-workflow";
2
+ declare namespace batchAdd_operation_d_exports {
3
+ export { description, execute };
4
+ }
5
+ declare const description: INodeProperties[];
6
+ declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
7
+ //#endregion
8
+ export { batchAdd_operation_d_exports, description, execute };
@@ -0,0 +1,41 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
3
+ const require_nodes_Resend_transport_index = require("../../transport/index.js");
4
+ let n8n_workflow = require("n8n-workflow");
5
+ //#region nodes/Resend/actions/suppression/batchAdd.operation.ts
6
+ var batchAdd_operation_exports = /* @__PURE__ */ require_runtime.__exportAll({
7
+ description: () => description,
8
+ execute: () => execute
9
+ });
10
+ const description = [{
11
+ displayName: "Emails",
12
+ name: "suppressionEmails",
13
+ type: "string",
14
+ required: true,
15
+ default: "",
16
+ placeholder: "one@example.com, two@example.com",
17
+ displayOptions: { show: {
18
+ resource: ["suppressions"],
19
+ operation: ["batchAdd"]
20
+ } },
21
+ description: "Comma-separated list of email addresses to add to the suppression list. Up to 100 addresses per request."
22
+ }];
23
+ async function execute(index) {
24
+ const emails = require_nodes_Resend_transport_index.normalizeEmailList(this.getNodeParameter("suppressionEmails", index));
25
+ if (emails.length === 0) throw new n8n_workflow.NodeOperationError(this.getNode(), "Provide at least one email address to suppress", { itemIndex: index });
26
+ if (emails.length > 100) throw new n8n_workflow.NodeOperationError(this.getNode(), "A batch add supports at most 100 email addresses per request", { itemIndex: index });
27
+ const body = { emails };
28
+ return [{
29
+ json: await require_nodes_Resend_transport_index.apiRequest.call(this, "POST", "/suppressions/batch/add", body),
30
+ pairedItem: { item: index }
31
+ }];
32
+ }
33
+ //#endregion
34
+ Object.defineProperty(exports, "batchAdd_operation_exports", {
35
+ enumerable: true,
36
+ get: function() {
37
+ return batchAdd_operation_exports;
38
+ }
39
+ });
40
+ exports.description = description;
41
+ exports.execute = execute;
@@ -0,0 +1,8 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from "n8n-workflow";
2
+ declare namespace batchRemove_operation_d_exports {
3
+ export { description, execute };
4
+ }
5
+ declare const description: INodeProperties[];
6
+ declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
7
+ //#endregion
8
+ export { batchRemove_operation_d_exports, description, execute };
@@ -0,0 +1,80 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
3
+ const require_nodes_Resend_transport_index = require("../../transport/index.js");
4
+ let n8n_workflow = require("n8n-workflow");
5
+ //#region nodes/Resend/actions/suppression/batchRemove.operation.ts
6
+ var batchRemove_operation_exports = /* @__PURE__ */ require_runtime.__exportAll({
7
+ description: () => description,
8
+ execute: () => execute
9
+ });
10
+ const description = [
11
+ {
12
+ displayName: "Remove By",
13
+ name: "suppressionRemoveBy",
14
+ type: "options",
15
+ default: "emails",
16
+ displayOptions: { show: {
17
+ resource: ["suppressions"],
18
+ operation: ["batchRemove"]
19
+ } },
20
+ options: [{
21
+ name: "Emails",
22
+ value: "emails",
23
+ description: "Remove suppressions matching these email addresses"
24
+ }, {
25
+ name: "IDs",
26
+ value: "ids",
27
+ description: "Remove suppressions matching these suppression IDs"
28
+ }],
29
+ description: "Whether to remove suppressions by email address or by suppression ID. Provide one or the other, not both."
30
+ },
31
+ {
32
+ displayName: "Emails",
33
+ name: "suppressionEmails",
34
+ type: "string",
35
+ required: true,
36
+ default: "",
37
+ placeholder: "one@example.com, two@example.com",
38
+ displayOptions: { show: {
39
+ resource: ["suppressions"],
40
+ operation: ["batchRemove"],
41
+ suppressionRemoveBy: ["emails"]
42
+ } },
43
+ description: "Comma-separated list of email addresses to remove from the suppression list. Up to 100 addresses per request."
44
+ },
45
+ {
46
+ displayName: "IDs",
47
+ name: "suppressionIds",
48
+ type: "string",
49
+ required: true,
50
+ default: "",
51
+ placeholder: "e169aa45-1ecf-4183-9955-b1499d5701d3, ...",
52
+ displayOptions: { show: {
53
+ resource: ["suppressions"],
54
+ operation: ["batchRemove"],
55
+ suppressionRemoveBy: ["ids"]
56
+ } },
57
+ description: "Comma-separated list of suppression IDs to remove from the suppression list. Up to 100 IDs per request."
58
+ }
59
+ ];
60
+ async function execute(index) {
61
+ const removeBy = this.getNodeParameter("suppressionRemoveBy", index, "emails");
62
+ const field = removeBy === "ids" ? "suppressionIds" : "suppressionEmails";
63
+ const values = require_nodes_Resend_transport_index.normalizeEmailList(this.getNodeParameter(field, index));
64
+ if (values.length === 0) throw new n8n_workflow.NodeOperationError(this.getNode(), `Provide at least one ${removeBy === "ids" ? "suppression ID" : "email address"} to remove`, { itemIndex: index });
65
+ if (values.length > 100) throw new n8n_workflow.NodeOperationError(this.getNode(), "A batch remove supports at most 100 entries per request", { itemIndex: index });
66
+ const body = { [removeBy]: values };
67
+ return [{
68
+ json: await require_nodes_Resend_transport_index.apiRequest.call(this, "POST", "/suppressions/batch/remove", body),
69
+ pairedItem: { item: index }
70
+ }];
71
+ }
72
+ //#endregion
73
+ Object.defineProperty(exports, "batchRemove_operation_exports", {
74
+ enumerable: true,
75
+ get: function() {
76
+ return batchRemove_operation_exports;
77
+ }
78
+ });
79
+ exports.description = description;
80
+ exports.execute = execute;
@@ -0,0 +1,8 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from "n8n-workflow";
2
+ declare namespace create_operation_d_exports {
3
+ export { description, execute };
4
+ }
5
+ declare const description: INodeProperties[];
6
+ declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
7
+ //#endregion
8
+ export { create_operation_d_exports, description, execute };
@@ -0,0 +1,37 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
3
+ const require_nodes_Resend_transport_index = require("../../transport/index.js");
4
+ //#region nodes/Resend/actions/suppression/create.operation.ts
5
+ var create_operation_exports = /* @__PURE__ */ require_runtime.__exportAll({
6
+ description: () => description,
7
+ execute: () => execute
8
+ });
9
+ const description = [{
10
+ displayName: "Email",
11
+ name: "suppressionEmail",
12
+ type: "string",
13
+ required: true,
14
+ default: "",
15
+ placeholder: "recipient@example.com",
16
+ displayOptions: { show: {
17
+ resource: ["suppressions"],
18
+ operation: ["create"]
19
+ } },
20
+ description: "The email address to add to the suppression list. Resend will skip this address at send time to avoid new hard bounces or spam complaints."
21
+ }];
22
+ async function execute(index) {
23
+ const body = { email: this.getNodeParameter("suppressionEmail", index) };
24
+ return [{
25
+ json: await require_nodes_Resend_transport_index.apiRequest.call(this, "POST", "/suppressions", body),
26
+ pairedItem: { item: index }
27
+ }];
28
+ }
29
+ //#endregion
30
+ Object.defineProperty(exports, "create_operation_exports", {
31
+ enumerable: true,
32
+ get: function() {
33
+ return create_operation_exports;
34
+ }
35
+ });
36
+ exports.description = description;
37
+ exports.execute = execute;
@@ -0,0 +1,8 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from "n8n-workflow";
2
+ declare namespace delete_operation_d_exports {
3
+ export { description, execute };
4
+ }
5
+ declare const description: INodeProperties[];
6
+ declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
7
+ //#endregion
8
+ export { delete_operation_d_exports, description, execute };
@@ -0,0 +1,37 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
3
+ const require_nodes_Resend_transport_index = require("../../transport/index.js");
4
+ const require_nodes_Resend_utils_dynamicFields = require("../../utils/dynamicFields.js");
5
+ //#region nodes/Resend/actions/suppression/delete.operation.ts
6
+ var delete_operation_exports = /* @__PURE__ */ require_runtime.__exportAll({
7
+ description: () => description,
8
+ execute: () => execute
9
+ });
10
+ const description = [require_nodes_Resend_utils_dynamicFields.createDynamicIdField({
11
+ fieldName: "suppressionIdentifier",
12
+ resourceName: "suppression",
13
+ displayName: "Suppression",
14
+ required: true,
15
+ placeholder: "e169aa45-1ecf-4183-9955-b1499d5701d3",
16
+ description: "The suppression to remove. Select from the list, or enter a suppression ID or the suppressed email address directly. Removing it lets Resend send to this address again.",
17
+ displayOptions: { show: {
18
+ resource: ["suppressions"],
19
+ operation: ["delete"]
20
+ } }
21
+ })];
22
+ async function execute(index) {
23
+ const suppression = require_nodes_Resend_utils_dynamicFields.resolveDynamicIdValue(this, "suppressionIdentifier", index);
24
+ return [{
25
+ json: await require_nodes_Resend_transport_index.apiRequest.call(this, "DELETE", `/suppressions/${encodeURIComponent(suppression)}`),
26
+ pairedItem: { item: index }
27
+ }];
28
+ }
29
+ //#endregion
30
+ Object.defineProperty(exports, "delete_operation_exports", {
31
+ enumerable: true,
32
+ get: function() {
33
+ return delete_operation_exports;
34
+ }
35
+ });
36
+ exports.description = description;
37
+ exports.execute = execute;
@@ -0,0 +1,4 @@
1
+ //#region nodes/Resend/actions/suppression/execute.d.ts
2
+ declare const execute: (this: import("n8n-workflow").IExecuteFunctions, index: number, operation: string) => Promise<import("n8n-workflow").INodeExecutionData[]>;
3
+ //#endregion
4
+ export { execute };
@@ -0,0 +1,18 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_nodes_Resend_transport_index = require("../../transport/index.js");
3
+ const require_nodes_Resend_actions_suppression_batchAdd_operation = require("./batchAdd.operation.js");
4
+ const require_nodes_Resend_actions_suppression_batchRemove_operation = require("./batchRemove.operation.js");
5
+ const require_nodes_Resend_actions_suppression_create_operation = require("./create.operation.js");
6
+ const require_nodes_Resend_actions_suppression_delete_operation = require("./delete.operation.js");
7
+ const require_nodes_Resend_actions_suppression_get_operation = require("./get.operation.js");
8
+ const require_nodes_Resend_actions_suppression_list_operation = require("./list.operation.js");
9
+ //#region nodes/Resend/actions/suppression/execute.ts
10
+ const execute = require_nodes_Resend_transport_index.createOperationRouter({
11
+ create: require_nodes_Resend_actions_suppression_create_operation.create_operation_exports,
12
+ get: require_nodes_Resend_actions_suppression_get_operation.get_operation_exports,
13
+ delete: require_nodes_Resend_actions_suppression_delete_operation.delete_operation_exports,
14
+ batchAdd: require_nodes_Resend_actions_suppression_batchAdd_operation.batchAdd_operation_exports,
15
+ batchRemove: require_nodes_Resend_actions_suppression_batchRemove_operation.batchRemove_operation_exports
16
+ }, { list: require_nodes_Resend_actions_suppression_list_operation.list_operation_exports });
17
+ //#endregion
18
+ exports.execute = execute;
@@ -0,0 +1,8 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from "n8n-workflow";
2
+ declare namespace get_operation_d_exports {
3
+ export { description, execute };
4
+ }
5
+ declare const description: INodeProperties[];
6
+ declare function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
7
+ //#endregion
8
+ export { description, execute, get_operation_d_exports };
@@ -0,0 +1,37 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
3
+ const require_nodes_Resend_transport_index = require("../../transport/index.js");
4
+ const require_nodes_Resend_utils_dynamicFields = require("../../utils/dynamicFields.js");
5
+ //#region nodes/Resend/actions/suppression/get.operation.ts
6
+ var get_operation_exports = /* @__PURE__ */ require_runtime.__exportAll({
7
+ description: () => description,
8
+ execute: () => execute
9
+ });
10
+ const description = [require_nodes_Resend_utils_dynamicFields.createDynamicIdField({
11
+ fieldName: "suppressionIdentifier",
12
+ resourceName: "suppression",
13
+ displayName: "Suppression",
14
+ required: true,
15
+ placeholder: "e169aa45-1ecf-4183-9955-b1499d5701d3",
16
+ description: "The suppression to retrieve. Select from the list, or enter a suppression ID or the suppressed email address directly.",
17
+ displayOptions: { show: {
18
+ resource: ["suppressions"],
19
+ operation: ["get"]
20
+ } }
21
+ })];
22
+ async function execute(index) {
23
+ const suppression = require_nodes_Resend_utils_dynamicFields.resolveDynamicIdValue(this, "suppressionIdentifier", index);
24
+ return [{
25
+ json: await require_nodes_Resend_transport_index.apiRequest.call(this, "GET", `/suppressions/${encodeURIComponent(suppression)}`),
26
+ pairedItem: { item: index }
27
+ }];
28
+ }
29
+ //#endregion
30
+ exports.description = description;
31
+ exports.execute = execute;
32
+ Object.defineProperty(exports, "get_operation_exports", {
33
+ enumerable: true,
34
+ get: function() {
35
+ return get_operation_exports;
36
+ }
37
+ });
@@ -0,0 +1,13 @@
1
+ import { batchAdd_operation_d_exports } from "./batchAdd.operation.js";
2
+ import { batchRemove_operation_d_exports } from "./batchRemove.operation.js";
3
+ import { create_operation_d_exports } from "./create.operation.js";
4
+ import { delete_operation_d_exports } from "./delete.operation.js";
5
+ import { execute } from "./execute.js";
6
+ import { get_operation_d_exports } from "./get.operation.js";
7
+ import { list_operation_d_exports } from "./list.operation.js";
8
+ import { INodeProperties } from "n8n-workflow";
9
+ //#region nodes/Resend/actions/suppression/index.d.ts
10
+ declare const operations: INodeProperties[];
11
+ declare const descriptions: INodeProperties[];
12
+ //#endregion
13
+ export { batchAdd_operation_d_exports as batchAdd, batchRemove_operation_d_exports as batchRemove, create_operation_d_exports as create, delete_operation_d_exports as delete, descriptions, execute, get_operation_d_exports as get, list_operation_d_exports as list, operations };
@@ -0,0 +1,122 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
3
+ const require_nodes_Resend_actions_suppression_batchAdd_operation = require("./batchAdd.operation.js");
4
+ const require_nodes_Resend_actions_suppression_batchRemove_operation = require("./batchRemove.operation.js");
5
+ const require_nodes_Resend_actions_suppression_create_operation = require("./create.operation.js");
6
+ const require_nodes_Resend_actions_suppression_delete_operation = require("./delete.operation.js");
7
+ const require_nodes_Resend_actions_suppression_get_operation = require("./get.operation.js");
8
+ const require_nodes_Resend_actions_suppression_list_operation = require("./list.operation.js");
9
+ const require_nodes_Resend_actions_suppression_execute = require("./execute.js");
10
+ //#region nodes/Resend/actions/suppression/index.ts
11
+ var suppression_exports = /* @__PURE__ */ require_runtime.__exportAll({
12
+ batchAdd: () => require_nodes_Resend_actions_suppression_batchAdd_operation.batchAdd_operation_exports,
13
+ batchRemove: () => require_nodes_Resend_actions_suppression_batchRemove_operation.batchRemove_operation_exports,
14
+ create: () => require_nodes_Resend_actions_suppression_create_operation.create_operation_exports,
15
+ delete: () => require_nodes_Resend_actions_suppression_delete_operation.delete_operation_exports,
16
+ descriptions: () => descriptions,
17
+ execute: () => require_nodes_Resend_actions_suppression_execute.execute,
18
+ get: () => require_nodes_Resend_actions_suppression_get_operation.get_operation_exports,
19
+ list: () => require_nodes_Resend_actions_suppression_list_operation.list_operation_exports,
20
+ operations: () => operations
21
+ });
22
+ const operations = [{
23
+ displayName: "Operation",
24
+ name: "operation",
25
+ type: "options",
26
+ noDataExpression: true,
27
+ displayOptions: { show: { resource: ["suppressions"] } },
28
+ options: [
29
+ {
30
+ name: "Batch Add",
31
+ value: "batchAdd",
32
+ description: "Add up to 100 email addresses to the suppression list in a single request",
33
+ action: "Batch add suppressions"
34
+ },
35
+ {
36
+ name: "Batch Remove",
37
+ value: "batchRemove",
38
+ description: "Remove up to 100 suppressions at once by email address or by suppression ID",
39
+ action: "Batch remove suppressions"
40
+ },
41
+ {
42
+ name: "Create",
43
+ value: "create",
44
+ description: "Add a single email address to the suppression list so Resend skips it at send time",
45
+ action: "Create a suppression"
46
+ },
47
+ {
48
+ name: "Delete",
49
+ value: "delete",
50
+ description: "Remove a single suppression by ID or email so Resend can send to the address again",
51
+ action: "Delete a suppression"
52
+ },
53
+ {
54
+ name: "Get",
55
+ value: "get",
56
+ description: "Retrieve a single suppression by ID or email, including its origin and creation time",
57
+ action: "Get a suppression"
58
+ },
59
+ {
60
+ name: "List",
61
+ value: "list",
62
+ description: "List suppressed addresses, optionally filtered by origin (bounce, complaint, or manual)",
63
+ action: "List suppressions"
64
+ }
65
+ ],
66
+ default: "list"
67
+ }];
68
+ const descriptions = [
69
+ ...operations,
70
+ ...require_nodes_Resend_actions_suppression_create_operation.description,
71
+ ...require_nodes_Resend_actions_suppression_get_operation.description,
72
+ ...require_nodes_Resend_actions_suppression_list_operation.description,
73
+ ...require_nodes_Resend_actions_suppression_delete_operation.description,
74
+ ...require_nodes_Resend_actions_suppression_batchAdd_operation.description,
75
+ ...require_nodes_Resend_actions_suppression_batchRemove_operation.description
76
+ ];
77
+ //#endregion
78
+ Object.defineProperty(exports, "batchAdd", {
79
+ enumerable: true,
80
+ get: function() {
81
+ return require_nodes_Resend_actions_suppression_batchAdd_operation.batchAdd_operation_exports;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "batchRemove", {
85
+ enumerable: true,
86
+ get: function() {
87
+ return require_nodes_Resend_actions_suppression_batchRemove_operation.batchRemove_operation_exports;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "create", {
91
+ enumerable: true,
92
+ get: function() {
93
+ return require_nodes_Resend_actions_suppression_create_operation.create_operation_exports;
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "delete", {
97
+ enumerable: true,
98
+ get: function() {
99
+ return require_nodes_Resend_actions_suppression_delete_operation.delete_operation_exports;
100
+ }
101
+ });
102
+ exports.descriptions = descriptions;
103
+ exports.execute = require_nodes_Resend_actions_suppression_execute.execute;
104
+ Object.defineProperty(exports, "get", {
105
+ enumerable: true,
106
+ get: function() {
107
+ return require_nodes_Resend_actions_suppression_get_operation.get_operation_exports;
108
+ }
109
+ });
110
+ Object.defineProperty(exports, "list", {
111
+ enumerable: true,
112
+ get: function() {
113
+ return require_nodes_Resend_actions_suppression_list_operation.list_operation_exports;
114
+ }
115
+ });
116
+ exports.operations = operations;
117
+ Object.defineProperty(exports, "suppression_exports", {
118
+ enumerable: true,
119
+ get: function() {
120
+ return suppression_exports;
121
+ }
122
+ });
@@ -0,0 +1,8 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from "n8n-workflow";
2
+ declare namespace list_operation_d_exports {
3
+ export { description, execute };
4
+ }
5
+ declare const description: INodeProperties[];
6
+ declare function execute(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
7
+ //#endregion
8
+ export { description, execute, list_operation_d_exports };
@@ -0,0 +1,83 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
3
+ const require_nodes_Resend_transport_index = require("../../transport/index.js");
4
+ //#region nodes/Resend/actions/suppression/list.operation.ts
5
+ var list_operation_exports = /* @__PURE__ */ require_runtime.__exportAll({
6
+ description: () => description,
7
+ execute: () => execute
8
+ });
9
+ const description = [
10
+ {
11
+ displayName: "Return All",
12
+ name: "returnAll",
13
+ type: "boolean",
14
+ default: false,
15
+ displayOptions: { show: {
16
+ resource: ["suppressions"],
17
+ operation: ["list"]
18
+ } },
19
+ description: "Whether to return all results or only up to a given limit"
20
+ },
21
+ {
22
+ displayName: "Limit",
23
+ name: "limit",
24
+ type: "number",
25
+ default: 50,
26
+ typeOptions: { minValue: 1 },
27
+ displayOptions: { show: {
28
+ resource: ["suppressions"],
29
+ operation: ["list"],
30
+ returnAll: [false]
31
+ } },
32
+ description: "Max number of results to return"
33
+ },
34
+ {
35
+ displayName: "Origin",
36
+ name: "suppressionOrigin",
37
+ type: "options",
38
+ default: "",
39
+ displayOptions: { show: {
40
+ resource: ["suppressions"],
41
+ operation: ["list"]
42
+ } },
43
+ options: [
44
+ {
45
+ name: "Any",
46
+ value: "",
47
+ description: "Return suppressions from all origins"
48
+ },
49
+ {
50
+ name: "Bounce",
51
+ value: "bounce",
52
+ description: "Addresses suppressed because they hard bounced"
53
+ },
54
+ {
55
+ name: "Complaint",
56
+ value: "complaint",
57
+ description: "Addresses suppressed because of a spam complaint"
58
+ },
59
+ {
60
+ name: "Manual",
61
+ value: "manual",
62
+ description: "Addresses suppressed manually via the API or dashboard"
63
+ }
64
+ ],
65
+ description: "Filter suppressions by how they were added to the list"
66
+ }
67
+ ];
68
+ async function execute() {
69
+ const origin = this.getNodeParameter("suppressionOrigin", 0, "");
70
+ const extraQs = {};
71
+ if (origin) extraQs.origin = origin;
72
+ const items = await require_nodes_Resend_transport_index.requestList.call(this, "/suppressions", extraQs);
73
+ return require_nodes_Resend_transport_index.createListExecutionData.call(this, items);
74
+ }
75
+ //#endregion
76
+ exports.description = description;
77
+ exports.execute = execute;
78
+ Object.defineProperty(exports, "list_operation_exports", {
79
+ enumerable: true,
80
+ get: function() {
81
+ return list_operation_exports;
82
+ }
83
+ });
@@ -3,6 +3,7 @@ import { ILoadOptionsFunctions, INodeListSearchResult, INodePropertyOptions } fr
3
3
  declare function getTemplateVariables(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
4
4
  declare function getTemplates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
5
5
  declare function getSegments(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
6
+ declare function getSuppressions(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
6
7
  declare function getTopics(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
8
  declare function getBroadcasts(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
8
9
  declare function getContacts(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
@@ -18,9 +19,10 @@ declare const getDomainsListSearch: (this: ILoadOptionsFunctions, filter?: strin
18
19
  declare const getEmailsListSearch: (this: ILoadOptionsFunctions, filter?: string) => Promise<INodeListSearchResult>;
19
20
  declare const getReceivedEmailsListSearch: (this: ILoadOptionsFunctions, filter?: string) => Promise<INodeListSearchResult>;
20
21
  declare const getSegmentsListSearch: (this: ILoadOptionsFunctions, filter?: string) => Promise<INodeListSearchResult>;
22
+ declare const getSuppressionsListSearch: (this: ILoadOptionsFunctions, filter?: string) => Promise<INodeListSearchResult>;
21
23
  declare const getTemplatesListSearch: (this: ILoadOptionsFunctions, filter?: string) => Promise<INodeListSearchResult>;
22
24
  declare const getTopicsListSearch: (this: ILoadOptionsFunctions, filter?: string) => Promise<INodeListSearchResult>;
23
25
  declare const getWebhooksListSearch: (this: ILoadOptionsFunctions, filter?: string) => Promise<INodeListSearchResult>;
24
26
  declare const getTemplateVariablesListSearch: (this: ILoadOptionsFunctions, filter?: string) => Promise<INodeListSearchResult>;
25
27
  //#endregion
26
- export { getBroadcasts, getBroadcastsListSearch, getContactProperties, getContactPropertiesListSearch, getContacts, getContactsListSearch, getDomains, getDomainsListSearch, getEmails, getEmailsListSearch, getReceivedEmails, getReceivedEmailsListSearch, getSegments, getSegmentsListSearch, getTemplateVariables, getTemplateVariablesListSearch, getTemplates, getTemplatesListSearch, getTopics, getTopicsListSearch, getWebhooks, getWebhooksListSearch };
28
+ export { getBroadcasts, getBroadcastsListSearch, getContactProperties, getContactPropertiesListSearch, getContacts, getContactsListSearch, getDomains, getDomainsListSearch, getEmails, getEmailsListSearch, getReceivedEmails, getReceivedEmailsListSearch, getSegments, getSegmentsListSearch, getSuppressions, getSuppressionsListSearch, getTemplateVariables, getTemplateVariablesListSearch, getTemplates, getTemplatesListSearch, getTopics, getTopicsListSearch, getWebhooks, getWebhooksListSearch };
@@ -1,10 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_nodes_Resend_transport_index = require("../transport/index.js");
3
3
  //#region nodes/Resend/methods/index.ts
4
- /**
5
- * Load options for dropdown fields (max 100 items).
6
- * Used by getTemplates, getSegments, getTopics.
7
- */
8
4
  async function loadDropdownOptions(loadOptionsFunctions, endpoint) {
9
5
  var _response$data;
10
6
  let response;
@@ -72,17 +68,32 @@ async function getTemplates() {
72
68
  async function getSegments() {
73
69
  return loadDropdownOptions(this, "/segments");
74
70
  }
71
+ async function getSuppressions() {
72
+ var _response$data2;
73
+ let response;
74
+ try {
75
+ response = await this.helpers.httpRequestWithAuthentication.call(this, require_nodes_Resend_transport_index.getCredentialType(this), {
76
+ url: `${require_nodes_Resend_transport_index.RESEND_API_BASE}/suppressions`,
77
+ method: "GET",
78
+ qs: { limit: 100 },
79
+ json: true
80
+ });
81
+ } catch (error) {
82
+ require_nodes_Resend_transport_index.handleResendApiError(this.getNode(), error);
83
+ }
84
+ return ((_response$data2 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data2 !== void 0 ? _response$data2 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => ({
85
+ name: item.email ? `${item.email} (${item.id})` : item.id,
86
+ value: item.id
87
+ }));
88
+ }
75
89
  async function getTopics() {
76
90
  return loadDropdownOptions(this, "/topics");
77
91
  }
78
92
  async function getBroadcasts() {
79
93
  return loadDropdownOptions(this, "/broadcasts");
80
94
  }
81
- /**
82
- * Contacts are now fetched directly from /contacts endpoint.
83
- */
84
95
  async function getContacts() {
85
- var _response$data2;
96
+ var _response$data3;
86
97
  let response;
87
98
  try {
88
99
  response = await this.helpers.httpRequestWithAuthentication.call(this, require_nodes_Resend_transport_index.getCredentialType(this), {
@@ -94,7 +105,7 @@ async function getContacts() {
94
105
  } catch (error) {
95
106
  require_nodes_Resend_transport_index.handleResendApiError(this.getNode(), error);
96
107
  }
97
- return ((_response$data2 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data2 !== void 0 ? _response$data2 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => {
108
+ return ((_response$data3 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data3 !== void 0 ? _response$data3 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => {
98
109
  const displayParts = [];
99
110
  if (item.first_name || item.last_name) displayParts.push([item.first_name, item.last_name].filter(Boolean).join(" "));
100
111
  if (item.email) displayParts.push(item.email);
@@ -107,11 +118,8 @@ async function getContacts() {
107
118
  async function getDomains() {
108
119
  return loadDropdownOptions(this, "/domains");
109
120
  }
110
- /**
111
- * Load webhooks with endpoint URL in display name.
112
- */
113
121
  async function getWebhooks() {
114
- var _response$data3;
122
+ var _response$data4;
115
123
  let response;
116
124
  try {
117
125
  response = await this.helpers.httpRequestWithAuthentication.call(this, require_nodes_Resend_transport_index.getCredentialType(this), {
@@ -123,7 +131,7 @@ async function getWebhooks() {
123
131
  } catch (error) {
124
132
  require_nodes_Resend_transport_index.handleResendApiError(this.getNode(), error);
125
133
  }
126
- return ((_response$data3 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data3 !== void 0 ? _response$data3 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => {
134
+ return ((_response$data4 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data4 !== void 0 ? _response$data4 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => {
127
135
  let displayName = item.id;
128
136
  if (item.endpoint) displayName = `${item.endpoint.length > 50 ? `${item.endpoint.substring(0, 47)}...` : item.endpoint}${item.status ? ` [${item.status}]` : ""} (${item.id})`;
129
137
  return {
@@ -135,11 +143,8 @@ async function getWebhooks() {
135
143
  async function getContactProperties() {
136
144
  return loadDropdownOptions(this, "/contact-properties");
137
145
  }
138
- /**
139
- * Load sent emails with subject and date in display name.
140
- */
141
146
  async function getEmails() {
142
- var _response$data4;
147
+ var _response$data5;
143
148
  let response;
144
149
  try {
145
150
  response = await this.helpers.httpRequestWithAuthentication.call(this, require_nodes_Resend_transport_index.getCredentialType(this), {
@@ -151,7 +156,7 @@ async function getEmails() {
151
156
  } catch (error) {
152
157
  require_nodes_Resend_transport_index.handleResendApiError(this.getNode(), error);
153
158
  }
154
- return ((_response$data4 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data4 !== void 0 ? _response$data4 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => {
159
+ return ((_response$data5 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data5 !== void 0 ? _response$data5 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => {
155
160
  const parts = [];
156
161
  if (item.subject) parts.push(item.subject.length > 50 ? `${item.subject.substring(0, 47)}...` : item.subject);
157
162
  if (item.created_at) {
@@ -167,11 +172,8 @@ async function getEmails() {
167
172
  };
168
173
  });
169
174
  }
170
- /**
171
- * Load received emails with subject and date in display name.
172
- */
173
175
  async function getReceivedEmails() {
174
- var _response$data5;
176
+ var _response$data6;
175
177
  let response;
176
178
  try {
177
179
  response = await this.helpers.httpRequestWithAuthentication.call(this, require_nodes_Resend_transport_index.getCredentialType(this), {
@@ -183,7 +185,7 @@ async function getReceivedEmails() {
183
185
  } catch (error) {
184
186
  require_nodes_Resend_transport_index.handleResendApiError(this.getNode(), error);
185
187
  }
186
- return ((_response$data5 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data5 !== void 0 ? _response$data5 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => {
188
+ return ((_response$data6 = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data6 !== void 0 ? _response$data6 : []).filter((item) => item === null || item === void 0 ? void 0 : item.id).map((item) => {
187
189
  const parts = [];
188
190
  if (item.subject) parts.push(item.subject.length > 50 ? `${item.subject.substring(0, 47)}...` : item.subject);
189
191
  if (item.created_at) {
@@ -199,9 +201,6 @@ async function getReceivedEmails() {
199
201
  };
200
202
  });
201
203
  }
202
- /**
203
- * Generic wrapper to convert loadOptions methods to listSearch format
204
- */
205
204
  async function wrapForListSearch(loadOptionsFunctions, loadOptionsMethod, filter) {
206
205
  const options = await loadOptionsMethod.call(loadOptionsFunctions);
207
206
  let filteredOptions = options;
@@ -226,6 +225,7 @@ const getDomainsListSearch = createListSearch(getDomains);
226
225
  const getEmailsListSearch = createListSearch(getEmails);
227
226
  const getReceivedEmailsListSearch = createListSearch(getReceivedEmails);
228
227
  const getSegmentsListSearch = createListSearch(getSegments);
228
+ const getSuppressionsListSearch = createListSearch(getSuppressions);
229
229
  const getTemplatesListSearch = createListSearch(getTemplates);
230
230
  const getTopicsListSearch = createListSearch(getTopics);
231
231
  const getWebhooksListSearch = createListSearch(getWebhooks);
@@ -245,6 +245,8 @@ exports.getReceivedEmails = getReceivedEmails;
245
245
  exports.getReceivedEmailsListSearch = getReceivedEmailsListSearch;
246
246
  exports.getSegments = getSegments;
247
247
  exports.getSegmentsListSearch = getSegmentsListSearch;
248
+ exports.getSuppressions = getSuppressions;
249
+ exports.getSuppressionsListSearch = getSuppressionsListSearch;
248
250
  exports.getTemplateVariables = getTemplateVariables;
249
251
  exports.getTemplateVariablesListSearch = getTemplateVariablesListSearch;
250
252
  exports.getTemplates = getTemplates;
@@ -18,8 +18,10 @@ function extractResendError(error) {
18
18
  if (!trimmed.startsWith("{")) return void 0;
19
19
  try {
20
20
  const parsed = JSON.parse(trimmed);
21
- if (isResendShape(parsed)) return parsed;
22
- } catch {}
21
+ return isResendShape(parsed) ? parsed : void 0;
22
+ } catch {
23
+ return;
24
+ }
23
25
  };
24
26
  if (isResendShape(error)) return error;
25
27
  const err = error;
@@ -9,6 +9,7 @@ declare const RESOURCE_METHOD_MAP: {
9
9
  readonly email: "getEmails";
10
10
  readonly receivedEmail: "getReceivedEmails";
11
11
  readonly segment: "getSegments";
12
+ readonly suppression: "getSuppressions";
12
13
  readonly template: "getTemplates";
13
14
  readonly topic: "getTopics";
14
15
  };
@@ -21,6 +22,7 @@ declare const RESOURCE_DISPLAY_MAP: {
21
22
  readonly email: "Email";
22
23
  readonly receivedEmail: "Received Email";
23
24
  readonly segment: "Segment";
25
+ readonly suppression: "Suppression";
24
26
  readonly template: "Template";
25
27
  readonly topic: "Topic";
26
28
  };
@@ -1,9 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region nodes/Resend/utils/dynamicFields.ts
3
- /**
4
- * Maps resource names to their corresponding API methods for loading dropdown options.
5
- * Used to dynamically determine which method to call for each resource type.
6
- */
7
3
  const RESOURCE_METHOD_MAP = {
8
4
  broadcast: "getBroadcasts",
9
5
  contact: "getContacts",
@@ -13,13 +9,10 @@ const RESOURCE_METHOD_MAP = {
13
9
  email: "getEmails",
14
10
  receivedEmail: "getReceivedEmails",
15
11
  segment: "getSegments",
12
+ suppression: "getSuppressions",
16
13
  template: "getTemplates",
17
14
  topic: "getTopics"
18
15
  };
19
- /**
20
- * Maps resource names to their human-readable display names.
21
- * Used for generating consistent field labels across the application.
22
- */
23
16
  const RESOURCE_DISPLAY_MAP = {
24
17
  broadcast: "Broadcast",
25
18
  contact: "Contact",
@@ -29,40 +22,10 @@ const RESOURCE_DISPLAY_MAP = {
29
22
  email: "Email",
30
23
  receivedEmail: "Received Email",
31
24
  segment: "Segment",
25
+ suppression: "Suppression",
32
26
  template: "Template",
33
27
  topic: "Topic"
34
28
  };
35
- /**
36
- * Creates a single resourceLocator field that provides inline dropdown selection and manual input.
37
- *
38
- * This function generates a single field with two modes:
39
- * - 'list' mode: Shows API-populated dropdown for selecting from existing resources
40
- * - 'id' mode: Shows manual text input for entering IDs directly
41
- *
42
- * The field uses n8n's resourceLocator type for inline mode switching.
43
- *
44
- * @param options Configuration options for the resourceLocator field
45
- * @returns Single INodeProperties representing the resourceLocator field
46
- *
47
- * @example
48
- * ```typescript
49
- * // Create resourceLocator field for template selection
50
- * const templateField = createDynamicIdField({
51
- * fieldName: 'templateId',
52
- * resourceName: 'template',
53
- * displayName: 'Template',
54
- * required: true,
55
- * placeholder: '34a080c9-b17d-4187-ad80-5af20266e535',
56
- * description: 'The template to use for this operation',
57
- * displayOptions: {
58
- * show: {
59
- * resource: ['email'],
60
- * operation: ['send']
61
- * }
62
- * }
63
- * });
64
- * ```
65
- */
66
29
  function createDynamicIdField(options) {
67
30
  const { fieldName, resourceName, displayName, required = false, placeholder, description, displayOptions } = options;
68
31
  const resourceDisplayName = RESOURCE_DISPLAY_MAP[resourceName];
@@ -92,28 +55,6 @@ function createDynamicIdField(options) {
92
55
  }]
93
56
  };
94
57
  }
95
- /**
96
- * Resolves the actual ID value from a resourceLocator field during workflow execution.
97
- *
98
- * This helper function extracts the ID value from the resourceLocator structure
99
- * based on the selected mode and returns the appropriate value for use in API calls.
100
- *
101
- * @param executeFunctions The n8n execution context
102
- * @param fieldName Field name used when creating the resourceLocator field
103
- * @param index Current item index in the workflow execution
104
- * @returns The resolved ID value as a string
105
- *
106
- * @example
107
- * ```typescript
108
- * // In an operation's execute function
109
- * export async function execute(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]> {
110
- * const templateId = resolveDynamicIdValue(this, 'templateId', index);
111
- *
112
- * const response = await apiRequest.call(this, 'GET', `/templates/${templateId}`);
113
- * return [{ json: response }];
114
- * }
115
- * ```
116
- */
117
58
  function resolveDynamicIdValue(executeFunctions, fieldName, index) {
118
59
  return executeFunctions.getNodeParameter(fieldName, index).value;
119
60
  }
@@ -5,7 +5,5 @@ declare const ACTION_RECORDED_PAGE = "\n\t<html lang='en'>\n\n\t<head>\n\t\t<met
5
5
  declare function createEmailBody(message: string, buttons: string, options?: {
6
6
  instanceId?: string;
7
7
  }): string;
8
- declare function createEmailBodyWithN8nAttribution(message: string, buttons: string, instanceId?: string): string;
9
- declare function createEmailBodyWithoutN8nAttribution(message: string, buttons: string): string;
10
8
  //#endregion
11
- export { ACTION_RECORDED_PAGE, BUTTON_STYLE_PRIMARY, BUTTON_STYLE_SECONDARY, createEmailBody, createEmailBodyWithN8nAttribution, createEmailBodyWithoutN8nAttribution };
9
+ export { ACTION_RECORDED_PAGE, BUTTON_STYLE_PRIMARY, BUTTON_STYLE_SECONDARY, createEmailBody };
@@ -153,18 +153,8 @@ function createEmailBody(message, buttons, options) {
153
153
  </html>
154
154
  `;
155
155
  }
156
- /** @deprecated Use createEmailBody instead */
157
- function createEmailBodyWithN8nAttribution(message, buttons, instanceId) {
158
- return createEmailBody(message, buttons, { instanceId: instanceId !== null && instanceId !== void 0 ? instanceId : "" });
159
- }
160
- /** @deprecated Use createEmailBody instead */
161
- function createEmailBodyWithoutN8nAttribution(message, buttons) {
162
- return createEmailBody(message, buttons);
163
- }
164
156
  //#endregion
165
157
  exports.ACTION_RECORDED_PAGE = ACTION_RECORDED_PAGE;
166
158
  exports.BUTTON_STYLE_PRIMARY = BUTTON_STYLE_PRIMARY;
167
159
  exports.BUTTON_STYLE_SECONDARY = BUTTON_STYLE_SECONDARY;
168
160
  exports.createEmailBody = createEmailBody;
169
- exports.createEmailBodyWithN8nAttribution = createEmailBodyWithN8nAttribution;
170
- exports.createEmailBodyWithoutN8nAttribution = createEmailBodyWithoutN8nAttribution;
@@ -1,5 +1,5 @@
1
1
  import { limitWaitTimeOption, sendAndWaitWebhooksDescription } from "./descriptions.js";
2
- import { ACTION_RECORDED_PAGE, BUTTON_STYLE_PRIMARY, BUTTON_STYLE_SECONDARY, createEmailBody, createEmailBodyWithN8nAttribution, createEmailBodyWithoutN8nAttribution } from "./email-templates.js";
2
+ import { ACTION_RECORDED_PAGE, BUTTON_STYLE_PRIMARY, BUTTON_STYLE_SECONDARY, createEmailBody } from "./email-templates.js";
3
3
  import { FormResponseTypeOptions, IEmail, SendAndWaitConfig } from "./interfaces.js";
4
4
  import { SEND_AND_WAIT_WAITING_TOOLTIP, configureWaitTillDate, createButton, createEmail, getSendAndWaitConfig, getSendAndWaitProperties, sendAndWaitWebhook, sendResendEmail } from "./utils.js";
5
- export { ACTION_RECORDED_PAGE, BUTTON_STYLE_PRIMARY, BUTTON_STYLE_SECONDARY, type FormResponseTypeOptions, type IEmail, SEND_AND_WAIT_WAITING_TOOLTIP, type SendAndWaitConfig, configureWaitTillDate, createButton, createEmail, createEmailBody, createEmailBodyWithN8nAttribution, createEmailBodyWithoutN8nAttribution, getSendAndWaitConfig, getSendAndWaitProperties, limitWaitTimeOption, sendAndWaitWebhook, sendAndWaitWebhooksDescription, sendResendEmail };
5
+ export { ACTION_RECORDED_PAGE, BUTTON_STYLE_PRIMARY, BUTTON_STYLE_SECONDARY, type FormResponseTypeOptions, type IEmail, SEND_AND_WAIT_WAITING_TOOLTIP, type SendAndWaitConfig, configureWaitTillDate, createButton, createEmail, createEmailBody, getSendAndWaitConfig, getSendAndWaitProperties, limitWaitTimeOption, sendAndWaitWebhook, sendAndWaitWebhooksDescription, sendResendEmail };
@@ -10,8 +10,6 @@ exports.configureWaitTillDate = require_nodes_Resend_utils_sendAndWait_utils.con
10
10
  exports.createButton = require_nodes_Resend_utils_sendAndWait_utils.createButton;
11
11
  exports.createEmail = require_nodes_Resend_utils_sendAndWait_utils.createEmail;
12
12
  exports.createEmailBody = require_nodes_Resend_utils_sendAndWait_email_templates.createEmailBody;
13
- exports.createEmailBodyWithN8nAttribution = require_nodes_Resend_utils_sendAndWait_email_templates.createEmailBodyWithN8nAttribution;
14
- exports.createEmailBodyWithoutN8nAttribution = require_nodes_Resend_utils_sendAndWait_email_templates.createEmailBodyWithoutN8nAttribution;
15
13
  exports.getSendAndWaitConfig = require_nodes_Resend_utils_sendAndWait_utils.getSendAndWaitConfig;
16
14
  exports.getSendAndWaitProperties = require_nodes_Resend_utils_sendAndWait_utils.getSendAndWaitProperties;
17
15
  exports.limitWaitTimeOption = require_nodes_Resend_utils_sendAndWait_descriptions.limitWaitTimeOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-resend",
3
- "version": "2.6.3",
3
+ "version": "2.6.4",
4
4
  "description": "Resend integration for n8n: Email, Broadcasts, Templates, Domains, Contacts, Segments, Topics, Webhooks, Workflows, Events, and more",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -49,14 +49,14 @@
49
49
  "devDependencies": {
50
50
  "@biomejs/biome": "~2.5.3",
51
51
  "@n8n/node-cli": "^0.39.3",
52
- "@types/jest": "^30.0.0",
53
52
  "@types/node": "^26.1.1",
54
53
  "auto-changelog": "^2.6.0",
55
54
  "eslint": "9.29.0",
56
55
  "rimraf": "^6.1.3",
57
56
  "tsdown": "^0.22.4",
58
57
  "typescript": "~5.9.3",
59
- "unrun": "^0.3.1"
58
+ "unrun": "^0.3.1",
59
+ "vitest": "^4.1.10"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "n8n-workflow": "*"
@@ -65,10 +65,12 @@
65
65
  "clean": "rimraf dist",
66
66
  "build": "tsdown && auto-changelog",
67
67
  "dev": "tsdown --watch",
68
- "format": "biome format --write nodes credentials",
68
+ "format": "biome format --write nodes credentials tests",
69
69
  "lint": "biome check",
70
70
  "lint:fix": "biome check --write",
71
71
  "lint:n8n": "n8n-node lint",
72
+ "test": "vitest run",
73
+ "test:watch": "vitest",
72
74
  "typecheck": "tsc --noEmit"
73
75
  }
74
76
  }