n8n-nodes-idb2b 3.1.5 → 3.1.7

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.
@@ -111,9 +111,12 @@ class IDB2B {
111
111
  if (!validation.isValid) {
112
112
  throw new Error(validation.error);
113
113
  }
114
- body = (0, common_1.buildContactRequestBody)(Object.assign({ name,
115
- email,
116
- phone_number }, additionalFields));
114
+ const contactData = Object.assign({ name }, additionalFields);
115
+ if (email)
116
+ contactData.email = email;
117
+ if (phone_number)
118
+ contactData.phone_number = phone_number;
119
+ body = (0, common_1.buildContactRequestBody)(contactData);
117
120
  initialBody = body;
118
121
  }
119
122
  else if (operation === "update") {
@@ -121,7 +121,6 @@ exports.contactFields = [
121
121
  name: 'phone_number',
122
122
  type: 'string',
123
123
  default: '',
124
- required: true,
125
124
  displayOptions: {
126
125
  show: {
127
126
  resource: ['contact'],
@@ -125,6 +125,7 @@ function buildContactRequestBody(data, includesPhone = true) {
125
125
  // Include phone if provided
126
126
  if (includesPhone &&
127
127
  data.phone_number !== undefined &&
128
+ data.phone_number !== null &&
128
129
  data.phone_number !== "") {
129
130
  body.phone_number = data.phone_number;
130
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-idb2b",
3
- "version": "3.1.5",
3
+ "version": "3.1.7",
4
4
  "description": "n8n community node for IDB2B - WhatsApp AI Agents",
5
5
  "main": "index.js",
6
6
  "scripts": {