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