n8n-nodes-novinmarketing 0.5.1 → 0.5.3
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.
- package/dist/nodes/ABTest/ABTest.node.json +20 -0
- package/dist/nodes/ABTest/ABTest.svg +4 -0
- package/dist/nodes/ABTest/AbTest.node.d.ts +5 -0
- package/dist/nodes/ABTest/AbTest.node.js +54 -0
- package/dist/nodes/ABTest/AbTest.node.js.map +1 -0
- package/dist/nodes/CallCenter/CallCenter.node.js +23 -71
- package/dist/nodes/CallCenter/CallCenter.node.js.map +1 -1
- package/dist/nodes/CallCenter/CallCenter.node.json +1 -1
- package/dist/nodes/CheckTag/CheckTag.node.d.ts +5 -0
- package/dist/nodes/CheckTag/CheckTag.node.js +116 -0
- package/dist/nodes/CheckTag/CheckTag.node.js.map +1 -0
- package/dist/nodes/CheckTag/CheckTag.node.json +20 -0
- package/dist/nodes/CheckTag/CheckTag.svg +2 -0
- package/dist/nodes/Events/Events.node.d.ts +9 -1
- package/dist/nodes/Events/Events.node.js +39 -121
- package/dist/nodes/Events/Events.node.js.map +1 -1
- package/dist/nodes/Events/Events.node.json +1 -1
- package/dist/nodes/GetSegmentUsers/GetSegmentUsers.node.js +11 -26
- package/dist/nodes/GetSegmentUsers/GetSegmentUsers.node.js.map +1 -1
- package/dist/nodes/GetSegmentUsers/GetSegmentUsers.node.json +2 -2
- package/dist/nodes/HasConditions/HasConditions.node.js +20 -48
- package/dist/nodes/HasConditions/HasConditions.node.js.map +1 -1
- package/dist/nodes/HasConditions/HasConditions.node.json +1 -1
- package/dist/nodes/LinkClickCheck/LinkClickCheck.node.js +8 -82
- package/dist/nodes/LinkClickCheck/LinkClickCheck.node.js.map +1 -1
- package/dist/nodes/LinkClickCheck/LinkClickCheck.node.json +1 -1
- package/dist/nodes/SendEmail/SendEmail.node.js +4 -11
- package/dist/nodes/SendEmail/SendEmail.node.js.map +1 -1
- package/dist/nodes/SendEmail/SendEmail.node.json +1 -1
- package/dist/nodes/SendSms/SendSms.node.js +6 -13
- package/dist/nodes/SendSms/SendSms.node.js.map +1 -1
- package/dist/nodes/SendSms/SendSms.node.json +1 -1
- package/dist/nodes/SendWebPush/SendWebPush.node.js +4 -52
- package/dist/nodes/SendWebPush/SendWebPush.node.js.map +1 -1
- package/dist/nodes/SendWhatsApp/SendWhatsApp.node.js +4 -11
- package/dist/nodes/SendWhatsApp/SendWhatsApp.node.js.map +1 -1
- package/dist/nodes/SendWhatsApp/SendWhatsApp.node.json +1 -1
- package/dist/nodes/TagOperations/TagOperations.node.js +10 -25
- package/dist/nodes/TagOperations/TagOperations.node.js.map +1 -1
- package/dist/nodes/TagOperations/TagOperations.node.json +1 -1
- package/dist/nodes/UserNameFormatter/UserNameFormatter.node.d.ts +5 -0
- package/dist/nodes/UserNameFormatter/UserNameFormatter.node.js +87 -0
- package/dist/nodes/UserNameFormatter/UserNameFormatter.node.js.map +1 -0
- package/dist/nodes/UserNameFormatter/UserNameFormatter.node.json +20 -0
- package/dist/nodes/UserNameFormatter/UserNameFormatter.svg +2 -0
- package/dist/nodes/UserUpdate/UserUpdate.node.js +4 -12
- package/dist/nodes/UserUpdate/UserUpdate.node.js.map +1 -1
- package/dist/nodes/UserUpdate/UserUpdate.node.json +1 -1
- package/dist/nodes/Voucher/Voucher.node.d.ts +9 -1
- package/dist/nodes/Voucher/Voucher.node.js +24 -59
- package/dist/nodes/Voucher/Voucher.node.js.map +1 -1
- package/dist/nodes/Voucher/Voucher.node.json +1 -1
- package/dist/package.json +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.ABTest",
|
|
3
|
+
"nodeVersion": "1",
|
|
4
|
+
"codexVersion": "1",
|
|
5
|
+
"categories": [
|
|
6
|
+
"Miscellaneous"
|
|
7
|
+
],
|
|
8
|
+
"resources": {
|
|
9
|
+
"credentialDocumentation": [
|
|
10
|
+
{
|
|
11
|
+
"url": ""
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"primaryDocumentation": [
|
|
15
|
+
{
|
|
16
|
+
"url": ""
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M14.5,16 C14.2238576,16 14,15.7761424 14,15.5 L14,9.5 C14,9.22385763 14.2238576,9 14.5,9 L16,9 C17.1045695,9 18,9.8954305 18,11 C18,11.4116588 17.8756286,11.7942691 17.6624114,12.1123052 C18.4414283,12.3856578 19,13.1275982 19,14 C19,15.1045695 18.1045695,16 17,16 L14.5,16 Z M15,15 L17,15 C17.5522847,15 18,14.5522847 18,14 C18,13.4477153 17.5522847,13 17,13 L15,13 L15,15 Z M15,12 L16,12 C16.5522847,12 17,11.5522847 17,11 C17,10.4477153 16.5522847,10 16,10 L15,10 L15,12 Z M12.9499909,4 L19.5,4 C20.8807119,4 22,5.11928813 22,6.5 L22,19.5 C22,20.8807119 20.8807119,22 19.5,22 L13.5,22 C12.2700325,22 11.2475211,21.1117749 11.0389093,19.9417682 C10.8653433,19.9799013 10.6850188,20 10.5,20 L4.5,20 C3.11928813,20 2,18.8807119 2,17.5 L2,4.5 C2,3.11928813 3.11928813,2 4.5,2 L10.5,2 C11.709479,2 12.7183558,2.85887984 12.9499909,4 Z M13,5 L13,17.5 C13,18.3179089 12.6072234,19.0440799 12,19.5001831 C12.0000989,20.3285261 12.6716339,21 13.5,21 L19.5,21 C20.3284271,21 21,20.3284271 21,19.5 L21,6.5 C21,5.67157288 20.3284271,5 19.5,5 L13,5 Z M8.56005566,11.4964303 C8.54036595,11.4987873 8.52032459,11.5 8.5,11.5 L6.5,11.5 C6.47967541,11.5 6.45963405,11.4987873 6.43994434,11.4964303 L5.96423835,12.6856953 C5.86168164,12.9420871 5.57069642,13.066795 5.31430466,12.9642383 C5.0579129,12.8616816 4.93320495,12.5706964 5.03576165,12.3143047 L7.03576165,7.31430466 C7.20339081,6.89523178 7.79660919,6.89523178 7.96423835,7.31430466 L9.96423835,12.3143047 C10.066795,12.5706964 9.9420871,12.8616816 9.68569534,12.9642383 C9.42930358,13.066795 9.13831836,12.9420871 9.03576165,12.6856953 L8.56005566,11.4964303 L8.56005566,11.4964303 Z M8.16148352,10.5 L7.5,8.8462912 L6.83851648,10.5 L8.16148352,10.5 Z M10.5,3 L4.5,3 C3.67157288,3 3,3.67157288 3,4.5 L3,17.5 C3,18.3284271 3.67157288,19 4.5,19 L10.5,19 C11.3284271,19 12,18.3284271 12,17.5 L12,4.5 C12,3.67157288 11.3284271,3 10.5,3 Z M6.5,18 C6.22385763,18 6,17.7761424 6,17.5 C6,17.2238576 6.22385763,17 6.5,17 L8.5,17 C8.77614237,17 9,17.2238576 9,17.5 C9,17.7761424 8.77614237,18 8.5,18 L6.5,18 Z M15.5,20 C15.2238576,20 15,19.7761424 15,19.5 C15,19.2238576 15.2238576,19 15.5,19 L17.5,19 C17.7761424,19 18,19.2238576 18,19.5 C18,19.7761424 17.7761424,20 17.5,20 L15.5,20 Z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbTest = void 0;
|
|
4
|
+
class AbTest {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'Novin AB Test',
|
|
8
|
+
name: 'abTest',
|
|
9
|
+
icon: 'file:ABTest.svg',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: [1],
|
|
12
|
+
description: 'Splits Users Into Two Branches',
|
|
13
|
+
defaults: {
|
|
14
|
+
name: 'Novin AB Test Node',
|
|
15
|
+
},
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main', 'main'],
|
|
18
|
+
outputNames: ['true', 'false'],
|
|
19
|
+
properties: [],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
async execute() {
|
|
23
|
+
const users = this.getInputData();
|
|
24
|
+
const usersTrue = [];
|
|
25
|
+
const usersFalse = [];
|
|
26
|
+
let i = 1;
|
|
27
|
+
for (const user of users) {
|
|
28
|
+
if (!user.json.outputResult)
|
|
29
|
+
user.json.outputResult = {};
|
|
30
|
+
if (user.json.novinAB && user.json.novinAB.value == "A") {
|
|
31
|
+
user.json.outputResult.abTest = 'A';
|
|
32
|
+
usersTrue.push(user);
|
|
33
|
+
}
|
|
34
|
+
else if (user.json.novinAB && user.json.novinAB.value == "B") {
|
|
35
|
+
user.json.outputResult.abTest = 'B';
|
|
36
|
+
usersFalse.push(user);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (i % 2 == 0) {
|
|
40
|
+
user.json.outputResult.abTest = 'A';
|
|
41
|
+
usersTrue.push(user);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
user.json.outputResult.abTest = 'B';
|
|
45
|
+
usersFalse.push(user);
|
|
46
|
+
}
|
|
47
|
+
i++;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return [usersTrue, usersFalse];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.AbTest = AbTest;
|
|
54
|
+
//# sourceMappingURL=AbTest.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbTest.node.js","sourceRoot":"","sources":["../../../nodes/ABTest/AbTest.node.ts"],"names":[],"mappings":";;;AAOA,MAAa,MAAM;IAAnB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,eAAe;YAC5B,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,iBAAiB;YACvB,KA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M,GAAG,GAAG,CAAC;oBACpC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACrB;qBACI;oBACJ,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,GAAG,CAAC;oBACpC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACtB;gBACD,CAAC,EAAE,CAAC;aACJ;SAED;QAED,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAChC,CAAC;CACD;AApED,wBAoEC"}
|
|
@@ -8,8 +8,8 @@ class CallCenter {
|
|
|
8
8
|
name: 'callCenter',
|
|
9
9
|
icon: 'file:CallCenter.svg',
|
|
10
10
|
group: ['transform'],
|
|
11
|
-
version: [1, 2],
|
|
12
|
-
subtitle: '={{$parameter["
|
|
11
|
+
version: [1, 2, 3],
|
|
12
|
+
subtitle: '={{$parameter["resource"]}}',
|
|
13
13
|
description: 'Call Center Node',
|
|
14
14
|
defaults: {
|
|
15
15
|
name: 'Novin Call Center',
|
|
@@ -22,16 +22,9 @@ class CallCenter {
|
|
|
22
22
|
required: true,
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
|
-
requestDefaults: {
|
|
26
|
-
baseURL: 'https://cdp.novin.marketing/api',
|
|
27
|
-
headers: {
|
|
28
|
-
Accept: 'application/json',
|
|
29
|
-
'Content-Type': 'application/json',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
25
|
properties: [
|
|
33
26
|
{
|
|
34
|
-
displayName: '
|
|
27
|
+
displayName: 'Action',
|
|
35
28
|
name: 'resource',
|
|
36
29
|
type: 'options',
|
|
37
30
|
noDataExpression: true,
|
|
@@ -47,62 +40,6 @@ class CallCenter {
|
|
|
47
40
|
],
|
|
48
41
|
default: 'NovinSendToCallCenter',
|
|
49
42
|
},
|
|
50
|
-
{
|
|
51
|
-
displayName: 'Operation',
|
|
52
|
-
name: 'operation',
|
|
53
|
-
type: 'options',
|
|
54
|
-
noDataExpression: true,
|
|
55
|
-
displayOptions: {
|
|
56
|
-
show: {
|
|
57
|
-
resource: [
|
|
58
|
-
'NovinSendToCallCenter',
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
options: [
|
|
63
|
-
{
|
|
64
|
-
name: 'Post',
|
|
65
|
-
value: 'post',
|
|
66
|
-
action: 'Send to call center',
|
|
67
|
-
routing: {
|
|
68
|
-
request: {
|
|
69
|
-
method: 'POST',
|
|
70
|
-
url: '/users/sendToCallCenter',
|
|
71
|
-
body: '={{ { userIds: $json["userIds"], callCenterCategory: $json["callCenterCategory"], cart: $json["sendCartItems"] } }}',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
default: 'post',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
displayName: 'Operation',
|
|
80
|
-
name: 'operation',
|
|
81
|
-
type: 'options',
|
|
82
|
-
noDataExpression: true,
|
|
83
|
-
displayOptions: {
|
|
84
|
-
show: {
|
|
85
|
-
resource: [
|
|
86
|
-
'NovinDeleteFromCallCenter',
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
options: [
|
|
91
|
-
{
|
|
92
|
-
name: 'Post',
|
|
93
|
-
value: 'post',
|
|
94
|
-
action: 'Delete from call center',
|
|
95
|
-
routing: {
|
|
96
|
-
request: {
|
|
97
|
-
method: 'POST',
|
|
98
|
-
url: '/users/deleteFromCallCenter',
|
|
99
|
-
body: '={{ { userIds: $json["userIds"] } }}',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
default: 'post',
|
|
105
|
-
},
|
|
106
43
|
{
|
|
107
44
|
displayName: 'Users',
|
|
108
45
|
name: 'users',
|
|
@@ -129,6 +66,11 @@ class CallCenter {
|
|
|
129
66
|
type: 'body',
|
|
130
67
|
},
|
|
131
68
|
},
|
|
69
|
+
displayOptions: {
|
|
70
|
+
show: {
|
|
71
|
+
resource: ['NovinSendToCallCenter'],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
132
74
|
},
|
|
133
75
|
{
|
|
134
76
|
displayName: 'Send Cart Items',
|
|
@@ -142,6 +84,11 @@ class CallCenter {
|
|
|
142
84
|
value: '={{$value}}',
|
|
143
85
|
},
|
|
144
86
|
},
|
|
87
|
+
displayOptions: {
|
|
88
|
+
show: {
|
|
89
|
+
resource: ['NovinSendToCallCenter'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
145
92
|
},
|
|
146
93
|
{
|
|
147
94
|
displayName: 'Batch Size',
|
|
@@ -154,6 +101,7 @@ class CallCenter {
|
|
|
154
101
|
};
|
|
155
102
|
}
|
|
156
103
|
async execute() {
|
|
104
|
+
var _a, _b;
|
|
157
105
|
let users;
|
|
158
106
|
if (this.getNodeParameter('users', 0)) {
|
|
159
107
|
users = this.getNodeParameter('users', 0);
|
|
@@ -161,20 +109,24 @@ class CallCenter {
|
|
|
161
109
|
else {
|
|
162
110
|
users = this.getInputData();
|
|
163
111
|
}
|
|
164
|
-
const callCenterCategory = this.getNodeParameter('callCenterCategory', 0);
|
|
165
|
-
const batchSize = this.getNodeParameter('batchSize', 0);
|
|
166
|
-
const sendCartItems = this.getNodeParameter('sendCartItems', 0);
|
|
167
112
|
const resource = this.getNodeParameter('resource', 0);
|
|
113
|
+
const batchSize = this.getNodeParameter('batchSize', 0);
|
|
114
|
+
let callCenterCategory = '';
|
|
115
|
+
let sendCartItems = false;
|
|
116
|
+
if (resource === 'NovinSendToCallCenter') {
|
|
117
|
+
callCenterCategory = this.getNodeParameter('callCenterCategory', 0, '');
|
|
118
|
+
sendCartItems = this.getNodeParameter('sendCartItems', 0, false);
|
|
119
|
+
}
|
|
168
120
|
const responseData = [];
|
|
169
121
|
let usersId = [];
|
|
170
122
|
for (let i = 0; i < users.length; i += batchSize) {
|
|
171
123
|
const batchUsers = users.slice(i, i + batchSize);
|
|
172
124
|
for (const user of batchUsers) {
|
|
173
125
|
if ('_id' in user.json) {
|
|
174
|
-
usersId.push({ userId: user.json._id });
|
|
126
|
+
usersId.push({ userId: user.json._id, "outputResult": (_a = user.json.outputResult) !== null && _a !== void 0 ? _a : {} });
|
|
175
127
|
}
|
|
176
128
|
else if ('body' in user.json && '_id' in user.json.body) {
|
|
177
|
-
usersId.push({ userId: user.json.body._id });
|
|
129
|
+
usersId.push({ userId: user.json.body._id, "outputResult": (_b = user.json.body.outputResult) !== null && _b !== void 0 ? _b : {} });
|
|
178
130
|
}
|
|
179
131
|
else {
|
|
180
132
|
console.log('Invalid user format');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallCenter.node.js","sourceRoot":"","sources":["../../../nodes/CallCenter/CallCenter.node.ts"],"names":[],"mappings":";;;AASA,MAAa,UAAU;IAAvB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"CallCenter.node.js","sourceRoot":"","sources":["../../../nodes/CallCenter/CallCenter.node.ts"],"names":[],"mappings":";;;AASA,MAAa,UAAU;IAAvB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAClB,QAAQ,EAAE,6BAA6B;YACvC,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE;gBACT,IAAI,EAAE,mBAAmB;aACzB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,mBAAmB;oBACzB,QAAQ,EAAE,IAAI;iB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IAAI,EACJ,mBAAmB,EACnB,OAAO,CACP,CAAC;YACF,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAC5B,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;aAC/B;iBAAM;gBACN,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC5B;SACD;QACD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;IACrD,CAAC;CACD;AA7KD,gCA6KC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckTag = void 0;
|
|
4
|
+
class CheckTag {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'Novin Check Tag',
|
|
8
|
+
name: 'checkTag',
|
|
9
|
+
icon: 'file:CheckTag.svg',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: [1],
|
|
12
|
+
description: 'Node for Tag Checking',
|
|
13
|
+
defaults: {
|
|
14
|
+
name: 'Novin Check Tag',
|
|
15
|
+
},
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main', 'main'],
|
|
18
|
+
outputNames: ['true', 'false'],
|
|
19
|
+
credentials: [
|
|
20
|
+
{
|
|
21
|
+
name: 'novinMarketingApi',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
properties: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Users',
|
|
28
|
+
name: 'users',
|
|
29
|
+
type: 'string',
|
|
30
|
+
default: '',
|
|
31
|
+
placeholder: 'Leave blank to get previous node users',
|
|
32
|
+
routing: {
|
|
33
|
+
send: {
|
|
34
|
+
property: 'users',
|
|
35
|
+
type: 'body',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'Tag Name',
|
|
41
|
+
name: 'name',
|
|
42
|
+
type: 'string',
|
|
43
|
+
default: '',
|
|
44
|
+
placeholder: 'Enter Tag Name',
|
|
45
|
+
routing: {
|
|
46
|
+
send: {
|
|
47
|
+
property: 'name',
|
|
48
|
+
type: 'body',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
async execute() {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
let users;
|
|
58
|
+
if (this.getNodeParameter('users', 0)) {
|
|
59
|
+
users = this.getNodeParameter('users', 0);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
users = this.getInputData();
|
|
63
|
+
}
|
|
64
|
+
const name = this.getNodeParameter('name', 0);
|
|
65
|
+
const responseData = [];
|
|
66
|
+
let usersId = [];
|
|
67
|
+
for (const user of users) {
|
|
68
|
+
if ('_id' in user.json) {
|
|
69
|
+
usersId.push({ userId: user.json._id, "outputResult": (_a = user.json.outputResult) !== null && _a !== void 0 ? _a : {} });
|
|
70
|
+
}
|
|
71
|
+
else if ('body' in user.json && '_id' in user.json.body) {
|
|
72
|
+
usersId.push({ userId: user.json.body._id, "outputResult": (_b = user.json.body.outputResult) !== null && _b !== void 0 ? _b : {} });
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
console.log('Invalid user format');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
let body = {
|
|
79
|
+
usersId,
|
|
80
|
+
name,
|
|
81
|
+
};
|
|
82
|
+
let url = '';
|
|
83
|
+
url = 'https://cdp.novin.marketing/api/tags/hasTagUsers';
|
|
84
|
+
const options = {
|
|
85
|
+
method: 'POST',
|
|
86
|
+
url,
|
|
87
|
+
body,
|
|
88
|
+
headers: {
|
|
89
|
+
'Accept': 'application/json',
|
|
90
|
+
'Content-Type': 'application/json',
|
|
91
|
+
},
|
|
92
|
+
json: true,
|
|
93
|
+
};
|
|
94
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'novinMarketingApi', options);
|
|
95
|
+
if (Array.isArray(response)) {
|
|
96
|
+
responseData.push(...response);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
responseData.push(response);
|
|
100
|
+
}
|
|
101
|
+
const usersTrue = [];
|
|
102
|
+
const usersFalse = [];
|
|
103
|
+
for (const user of responseData) {
|
|
104
|
+
const outputResult = user.outputResult;
|
|
105
|
+
if (outputResult === null || outputResult === void 0 ? void 0 : outputResult.hasTag) {
|
|
106
|
+
usersTrue.push({ json: user });
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
usersFalse.push({ json: user });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return [usersTrue, usersFalse];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.CheckTag = CheckTag;
|
|
116
|
+
//# sourceMappingURL=CheckTag.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckTag.node.js","sourceRoot":"","sources":["../../../nodes/CheckTag/CheckTag.node.ts"],"names":[],"mappings":";;;AASA,MAAa,QAAQ;IAArB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,CAAC;YACZ,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE;gBACT,IAAI,EAAE,iBAAiB;aACvB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAEhB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;YACzB,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;YAC9B,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,mBAAmB;oBACzB,QAAQ,EAAE,IAAI;iBACd;aACD;YAED,UAAU,EAAE;gBACX;oBACC,WAAW,EA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;iBAAM;gBACN,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;aAChC;SACD;QACD,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAChC,CAAC;CACD;AA1HD,4BA0HC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.CheckTag",
|
|
3
|
+
"nodeVersion": "1",
|
|
4
|
+
"codexVersion": "1",
|
|
5
|
+
"categories": [
|
|
6
|
+
"Miscellaneous"
|
|
7
|
+
],
|
|
8
|
+
"resources": {
|
|
9
|
+
"credentialDocumentation": [
|
|
10
|
+
{
|
|
11
|
+
"url": ""
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"primaryDocumentation": [
|
|
15
|
+
{
|
|
16
|
+
"url": ""
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" id="tag-check" xmlns="http://www.w3.org/2000/svg" class="icon multi-color"><title style="stroke-width: 2;">tag check</title><path id="tertiary-fill" d="M9,6V21H7a1,1,0,0,1-1-1V9Z" style="fill: #b7b7b7; stroke-width: 2;"></path><path id="primary-stroke" d="M11,21H7a1,1,0,0,1-1-1V9l6-6,6,6v4" style="fill: none; stroke: rgb(0, 0, 0); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></path><polyline id="secondary-stroke" points="15 19 17 21 21 17" style="fill: none; stroke: rgb(44, 169, 188); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></polyline></svg>
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
1
|
+
import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
2
2
|
export declare class Events implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {
|
|
6
|
+
getEventsNameBack(this: ILoadOptionsFunctions): Promise<{
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[]>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
4
12
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
13
|
}
|