@messagebird/n8n-nodes-bird 0.16.0 → 0.16.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.
@@ -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 url = this.getNodeWebhookUrl("default");
118
- const entry = endpoints(this)[url];
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
- // Bird delivers at-least-once; the signed webhook-id deduplicates. The
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 });
@@ -738,7 +738,7 @@ exports.birdProperties = [
738
738
  typeOptions: { multipleValues: true },
739
739
  placeholder: "Add Pair",
740
740
  default: {},
741
- description: "Values for the template's variables, keyed by the variable name. A variable name is a single word. Every variable in the template's `variables` list needs a value. A send that omits one is rejected. Languages can use different variables, and a value unused by the selected language is ignored. The API supplies values under the reserved `bird` key, so a send that sets it is rejected. `parameters` is capped at 16 KB once serialized.",
741
+ description: "Values for caller parameters, keyed by name. A parameter name is a single word. Caller parameters have `system` set to false or absent in the template's `variables` list. Supply each required caller parameter used by the resolved send language; omitting one returns `422`. A version's list covers all its languages, and values unused by the resolved language are ignored. The `bird` namespace is reserved for values filled by Bird, so a send that sets it is rejected. `parameters` is capped at 16 KB once serialized.",
742
742
  options: [
743
743
  {
744
744
  displayName: "Pair",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messagebird/n8n-nodes-bird",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "description": "The official Bird node for n8n: email, SMS, WhatsApp, and verification, plus a webhook trigger for Bird events.",
5
5
  "license": "MIT",
6
6
  "author": {