@messagebird/n8n-nodes-bird 0.15.0 → 0.16.1
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.
|
@@ -64,6 +64,9 @@ class BirdTrigger {
|
|
|
64
64
|
method: "GET",
|
|
65
65
|
path: `/v1/webhooks/${entry.id}`,
|
|
66
66
|
});
|
|
67
|
+
if (this.getMode() === "manual") {
|
|
68
|
+
this.getWorkflowStaticData("node").testWebhookUrl = url;
|
|
69
|
+
}
|
|
67
70
|
return true;
|
|
68
71
|
}
|
|
69
72
|
catch (error) {
|
|
@@ -89,6 +92,9 @@ class BirdTrigger {
|
|
|
89
92
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Bird did not return a webhook id and signing secret.");
|
|
90
93
|
}
|
|
91
94
|
endpoints(this)[url] = { id, secret };
|
|
95
|
+
if (this.getMode() === "manual") {
|
|
96
|
+
this.getWorkflowStaticData("node").testWebhookUrl = url;
|
|
97
|
+
}
|
|
92
98
|
return true;
|
|
93
99
|
},
|
|
94
100
|
async delete() {
|
|
@@ -109,13 +115,20 @@ class BirdTrigger {
|
|
|
109
115
|
}
|
|
110
116
|
}
|
|
111
117
|
delete store[url];
|
|
118
|
+
const data = this.getWorkflowStaticData("node");
|
|
119
|
+
if (data.testWebhookUrl === url)
|
|
120
|
+
delete data.testWebhookUrl;
|
|
112
121
|
return true;
|
|
113
122
|
},
|
|
114
123
|
},
|
|
115
124
|
};
|
|
116
125
|
async webhook() {
|
|
117
|
-
const
|
|
118
|
-
|
|
126
|
+
const data = this.getWorkflowStaticData("node");
|
|
127
|
+
// n8n's webhook context returns the production URL even for test deliveries.
|
|
128
|
+
const url = this.getMode() === "manual"
|
|
129
|
+
? data.testWebhookUrl
|
|
130
|
+
: this.getNodeWebhookUrl("default");
|
|
131
|
+
const entry = typeof url === "string" ? endpoints(this)[url] : undefined;
|
|
119
132
|
const headers = this.getHeaderData();
|
|
120
133
|
const request = this.getRequestObject();
|
|
121
134
|
const rawBody = request.rawBody;
|
|
@@ -138,10 +151,7 @@ class BirdTrigger {
|
|
|
138
151
|
});
|
|
139
152
|
return { noWebhookResponse: true };
|
|
140
153
|
}
|
|
141
|
-
//
|
|
142
|
-
// redelivery is ACKED — an unanswered request would hang until timeout
|
|
143
|
-
// and Bird would retry the same id forever.
|
|
144
|
-
const data = this.getWorkflowStaticData("node");
|
|
154
|
+
// TODO: Persist seenIds across live-webhook executions; n8n 2.22.6 drops these updates.
|
|
145
155
|
const seen = Array.isArray(data.seenIds) ? data.seenIds : [];
|
|
146
156
|
if (seen.includes(id)) {
|
|
147
157
|
this.getResponseObject().status(200).json({ received: true });
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.birdEvents = void 0;
|
|
4
4
|
// Code generated by surface-gen; DO NOT EDIT.
|
|
5
5
|
exports.birdEvents = [
|
|
6
|
-
{ name: "amb.accepted", value: "amb.accepted", description: "
|
|
6
|
+
{ name: "amb.accepted", value: "amb.accepted", description: "An outbound message was accepted for processing after confirming billing coverage. This does not confirm receipt by Apple." },
|
|
7
7
|
{ name: "amb.conversation_closed", value: "amb.conversation_closed", description: "A customer conversation closed. Closing a conversation is not a message." },
|
|
8
8
|
{ name: "amb.conversation_reopened", value: "amb.conversation_reopened", description: "An existing customer conversation reopened after it had closed" },
|
|
9
9
|
{ name: "amb.conversation_started", value: "amb.conversation_started", description: "A customer conversation opened for the first time" },
|
|
@@ -7594,7 +7594,7 @@ exports.birdProperties = [
|
|
|
7594
7594
|
typeOptions: { multipleValues: true },
|
|
7595
7595
|
placeholder: "Add Pair",
|
|
7596
7596
|
default: {},
|
|
7597
|
-
description: "Custom property values
|
|
7597
|
+
description: "Custom contact property values. Keys must be registered and active; values must match their declared type. Strings can contain up to 500 characters and the serialized map is limited to 2 KB. Invalid values fail this contact. Null values remove keys when updating and are ignored when creating.",
|
|
7598
7598
|
options: [
|
|
7599
7599
|
{
|
|
7600
7600
|
displayName: "Pair",
|
|
@@ -7622,35 +7622,35 @@ exports.birdProperties = [
|
|
|
7622
7622
|
type: "string",
|
|
7623
7623
|
placeholder: "name@email.com",
|
|
7624
7624
|
default: "",
|
|
7625
|
-
description: "
|
|
7625
|
+
description: "Email address, up to 254 characters. Trimmed and lowercased before matching. Invalid addresses fail this contact.",
|
|
7626
7626
|
},
|
|
7627
7627
|
{
|
|
7628
7628
|
displayName: "External ID",
|
|
7629
7629
|
name: "external_id",
|
|
7630
7630
|
type: "string",
|
|
7631
7631
|
default: "",
|
|
7632
|
-
description: "Your
|
|
7632
|
+
description: "Your identifier for the contact, up to 254 characters. Unique within the workspace when set.",
|
|
7633
7633
|
},
|
|
7634
7634
|
{
|
|
7635
7635
|
displayName: "First Name",
|
|
7636
7636
|
name: "first_name",
|
|
7637
7637
|
type: "string",
|
|
7638
7638
|
default: "",
|
|
7639
|
-
description: "
|
|
7639
|
+
description: "First name, up to 100 characters",
|
|
7640
7640
|
},
|
|
7641
7641
|
{
|
|
7642
7642
|
displayName: "Last Name",
|
|
7643
7643
|
name: "last_name",
|
|
7644
7644
|
type: "string",
|
|
7645
7645
|
default: "",
|
|
7646
|
-
description: "
|
|
7646
|
+
description: "Last name, up to 100 characters",
|
|
7647
7647
|
},
|
|
7648
7648
|
{
|
|
7649
7649
|
displayName: "Phone Number",
|
|
7650
7650
|
name: "phone_number",
|
|
7651
7651
|
type: "string",
|
|
7652
7652
|
default: "",
|
|
7653
|
-
description: "
|
|
7653
|
+
description: "Phone number with a country code, up to 32 characters. Spaces and punctuation are accepted. An empty string is treated as omitted.",
|
|
7654
7654
|
},
|
|
7655
7655
|
],
|
|
7656
7656
|
},
|
package/package.json
CHANGED