n8n-nodes-dataforb2b 1.0.4 → 1.0.5
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.
|
@@ -5,22 +5,36 @@ const n8n_workflow_1 = require("n8n-workflow");
|
|
|
5
5
|
const DATAFORB2B_API_BASE_URL = "https://api.dataforb2b.ai";
|
|
6
6
|
// Operators disponibles par type
|
|
7
7
|
const textOperators = [
|
|
8
|
-
{ name: "Equals", value: "
|
|
9
|
-
{ name: "Not Equals", value: "
|
|
8
|
+
{ name: "Equals", value: "eq" },
|
|
9
|
+
{ name: "Not Equals", value: "neq" },
|
|
10
10
|
{ name: "Contains", value: "like" },
|
|
11
11
|
{ name: "Not Contains", value: "not_like" },
|
|
12
12
|
{ name: "In List", value: "in" },
|
|
13
13
|
{ name: "Not In List", value: "not_in" },
|
|
14
14
|
];
|
|
15
15
|
const numericOperators = [
|
|
16
|
-
{ name: "Equals", value: "
|
|
17
|
-
{ name: "Not Equals", value: "
|
|
18
|
-
{ name: "Greater Than", value: "
|
|
19
|
-
{ name: "Greater Than or Equal", value: "
|
|
20
|
-
{ name: "Less Than", value: "
|
|
21
|
-
{ name: "Less Than or Equal", value: "
|
|
16
|
+
{ name: "Equals", value: "eq" },
|
|
17
|
+
{ name: "Not Equals", value: "neq" },
|
|
18
|
+
{ name: "Greater Than", value: "gt" },
|
|
19
|
+
{ name: "Greater Than or Equal", value: "gte" },
|
|
20
|
+
{ name: "Less Than", value: "lt" },
|
|
21
|
+
{ name: "Less Than or Equal", value: "lte" },
|
|
22
22
|
{ name: "Between", value: "between" },
|
|
23
23
|
];
|
|
24
|
+
// Map UI operator values to API operator values
|
|
25
|
+
const operatorMap = {
|
|
26
|
+
eq: "=",
|
|
27
|
+
neq: "!=",
|
|
28
|
+
gt: ">",
|
|
29
|
+
gte: ">=",
|
|
30
|
+
lt: "<",
|
|
31
|
+
lte: "<=",
|
|
32
|
+
like: "like",
|
|
33
|
+
not_like: "not_like",
|
|
34
|
+
in: "in",
|
|
35
|
+
not_in: "not_in",
|
|
36
|
+
between: "between",
|
|
37
|
+
};
|
|
24
38
|
// People filter fields
|
|
25
39
|
const peopleFilterFields = [
|
|
26
40
|
// Profile
|
|
@@ -431,10 +445,11 @@ class DataForB2B {
|
|
|
431
445
|
const filterLogic = this.getNodeParameter("filterLogic", i);
|
|
432
446
|
const peopleFilters = this.getNodeParameter("peopleFilters", i);
|
|
433
447
|
const conditions = (peopleFilters.conditions || []).map((cond) => {
|
|
448
|
+
const apiOperator = operatorMap[cond.operator] || cond.operator;
|
|
434
449
|
const condition = {
|
|
435
450
|
field: cond.field,
|
|
436
|
-
op:
|
|
437
|
-
value:
|
|
451
|
+
op: apiOperator,
|
|
452
|
+
value: apiOperator === "in" || apiOperator === "not_in"
|
|
438
453
|
? cond.value.split(",").map((v) => v.trim())
|
|
439
454
|
: cond.value,
|
|
440
455
|
};
|
|
@@ -455,10 +470,11 @@ class DataForB2B {
|
|
|
455
470
|
const filterLogic = this.getNodeParameter("filterLogic", i);
|
|
456
471
|
const companyFilters = this.getNodeParameter("companyFilters", i);
|
|
457
472
|
const conditions = (companyFilters.conditions || []).map((cond) => {
|
|
473
|
+
const apiOperator = operatorMap[cond.operator] || cond.operator;
|
|
458
474
|
const condition = {
|
|
459
475
|
field: cond.field,
|
|
460
|
-
op:
|
|
461
|
-
value:
|
|
476
|
+
op: apiOperator,
|
|
477
|
+
value: apiOperator === "in" || apiOperator === "not_in"
|
|
462
478
|
? cond.value.split(",").map((v) => v.trim())
|
|
463
479
|
: cond.value,
|
|
464
480
|
};
|