n8n-nodes-pilot-status 1.0.8 → 1.0.9
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.
|
@@ -38,40 +38,28 @@ class PilotStatus {
|
|
|
38
38
|
return Array.isArray(vars) ? vars.map((v) => ({ name: v, value: v })) : [];
|
|
39
39
|
},
|
|
40
40
|
async getGroups() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
value: g.id,
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
41
|
+
const response = (await this.helpers.requestWithAuthentication.call(this, 'pilotStatusApi', {
|
|
42
|
+
method: 'GET',
|
|
43
|
+
url: '/groups',
|
|
44
|
+
json: true,
|
|
45
|
+
}));
|
|
46
|
+
const groups = Array.isArray(response === null || response === void 0 ? void 0 : response.groups) ? response.groups : [];
|
|
47
|
+
return groups.map((g) => ({
|
|
48
|
+
name: g.name ? `${g.name} (${g.id})` : g.id,
|
|
49
|
+
value: g.id,
|
|
50
|
+
}));
|
|
57
51
|
},
|
|
58
52
|
async getNewsletters() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
value: n.id,
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
return [];
|
|
74
|
-
}
|
|
53
|
+
const response = (await this.helpers.requestWithAuthentication.call(this, 'pilotStatusApi', {
|
|
54
|
+
method: 'GET',
|
|
55
|
+
url: '/newsletters',
|
|
56
|
+
json: true,
|
|
57
|
+
}));
|
|
58
|
+
const newsletters = Array.isArray(response === null || response === void 0 ? void 0 : response.newsletters) ? response.newsletters : [];
|
|
59
|
+
return newsletters.map((n) => ({
|
|
60
|
+
name: n.name ? `${n.name} (${n.id})` : n.id,
|
|
61
|
+
value: n.id,
|
|
62
|
+
}));
|
|
75
63
|
},
|
|
76
64
|
},
|
|
77
65
|
};
|
|
@@ -260,16 +248,28 @@ class PilotStatus {
|
|
|
260
248
|
type: 'string',
|
|
261
249
|
description: 'E.164 format (e.g. +5511999999999)',
|
|
262
250
|
displayOptions: {
|
|
263
|
-
show: {
|
|
264
|
-
|
|
251
|
+
show: {
|
|
252
|
+
resource: ['message'],
|
|
265
253
|
operation: ['send'],
|
|
266
|
-
sendDestinationType: ['
|
|
254
|
+
sendDestinationType: ['phone'],
|
|
267
255
|
},
|
|
268
256
|
},
|
|
269
257
|
default: '',
|
|
270
258
|
required: true,
|
|
271
259
|
routing: { send: { type: 'body', property: 'destinationNumber' } },
|
|
272
260
|
},
|
|
261
|
+
{
|
|
262
|
+
displayName: 'Destination Number',
|
|
263
|
+
name: 'destinationNumber',
|
|
264
|
+
type: 'string',
|
|
265
|
+
description: 'E.164 format (e.g. +5511999999999)',
|
|
266
|
+
displayOptions: {
|
|
267
|
+
show: { resource: ['message'], operation: ['checkOptIn'] },
|
|
268
|
+
},
|
|
269
|
+
default: '',
|
|
270
|
+
required: true,
|
|
271
|
+
routing: { send: { type: 'query', property: 'destinationNumber' } },
|
|
272
|
+
},
|
|
273
273
|
{
|
|
274
274
|
displayName: 'Group ID',
|
|
275
275
|
name: 'groupId',
|