n8n-nodes-base 1.35.0 → 1.36.0
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/build.tsbuildinfo +1 -1
- package/dist/credentials/icons/jwt.svg +112 -0
- package/dist/credentials/jwtAuth.credentials.d.ts +8 -0
- package/dist/credentials/jwtAuth.credentials.js +135 -0
- package/dist/credentials/jwtAuth.credentials.js.map +1 -0
- package/dist/known/credentials.json +14 -2
- package/dist/known/nodes.json +8 -0
- package/dist/methods/defined.json +3 -0
- package/dist/methods/referenced.json +3 -0
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +76 -3
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
- package/dist/nodes/Salesforce/GenericFunctions.d.ts +3 -3
- package/dist/nodes/Salesforce/GenericFunctions.js.map +1 -1
- package/dist/nodes/Salesforce/SalesforceTrigger.node.d.ts +10 -0
- package/dist/nodes/Salesforce/SalesforceTrigger.node.js +258 -0
- package/dist/nodes/Salesforce/SalesforceTrigger.node.js.map +1 -0
- package/dist/nodes/Twilio/GenericFunctions.d.ts +2 -1
- package/dist/nodes/Twilio/GenericFunctions.js +14 -1
- package/dist/nodes/Twilio/GenericFunctions.js.map +1 -1
- package/dist/nodes/Twilio/TwilioTrigger.node.d.ts +12 -0
- package/dist/nodes/Twilio/TwilioTrigger.node.js +148 -0
- package/dist/nodes/Twilio/TwilioTrigger.node.js.map +1 -0
- package/dist/nodes/Twilio/TwilioTrigger.node.json +19 -0
- package/dist/nodes/Webhook/Webhook.node.js +83 -17
- package/dist/nodes/Webhook/Webhook.node.js.map +1 -1
- package/dist/nodes/Webhook/description.d.ts +2 -0
- package/dist/nodes/Webhook/description.js +100 -3
- package/dist/nodes/Webhook/description.js.map +1 -1
- package/dist/nodes/Webhook/utils.d.ts +29 -0
- package/dist/nodes/Webhook/utils.js +95 -0
- package/dist/nodes/Webhook/utils.js.map +1 -0
- package/dist/types/credentials.json +1 -0
- package/dist/types/nodes.json +7 -5
- package/package.json +6 -3
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SalesforceTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const luxon_1 = require("luxon");
|
|
6
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
7
|
+
class SalesforceTrigger {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.description = {
|
|
10
|
+
displayName: 'Salesforce Trigger',
|
|
11
|
+
name: 'salesforceTrigger',
|
|
12
|
+
icon: 'file:salesforce.svg',
|
|
13
|
+
group: ['trigger'],
|
|
14
|
+
version: 1,
|
|
15
|
+
description: 'Fetches data from Salesforce and starts the workflow on specified polling intervals.',
|
|
16
|
+
subtitle: '={{($parameter["triggerOn"])}}',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'Salesforce Trigger',
|
|
19
|
+
},
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: 'salesforceOAuth2Api',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
polling: true,
|
|
27
|
+
inputs: [],
|
|
28
|
+
outputs: ['main'],
|
|
29
|
+
properties: [
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Trigger On',
|
|
32
|
+
name: 'triggerOn',
|
|
33
|
+
description: 'Which Salesforce event should trigger the node',
|
|
34
|
+
type: 'options',
|
|
35
|
+
default: '',
|
|
36
|
+
options: [
|
|
37
|
+
{
|
|
38
|
+
name: 'Account Created',
|
|
39
|
+
value: 'accountCreated',
|
|
40
|
+
description: 'When a new account is created',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Account Updated',
|
|
44
|
+
value: 'accountUpdated',
|
|
45
|
+
description: 'When an existing account is modified',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Attachment Created',
|
|
49
|
+
value: 'attachmentCreated',
|
|
50
|
+
description: 'When a file is uploaded and attached to an object',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Attachment Updated',
|
|
54
|
+
value: 'attachmentUpdated',
|
|
55
|
+
description: 'When an existing file is modified',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Case Created',
|
|
59
|
+
value: 'caseCreated',
|
|
60
|
+
description: 'When a new case is created',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Case Updated',
|
|
64
|
+
value: 'caseUpdated',
|
|
65
|
+
description: 'When an existing case is modified',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'Contact Created',
|
|
69
|
+
value: 'contactCreated',
|
|
70
|
+
description: 'When a new contact is created',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Contact Updated',
|
|
74
|
+
value: 'contactUpdated',
|
|
75
|
+
description: 'When an existing contact is modified',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Custom Object Created',
|
|
79
|
+
value: 'customObjectCreated',
|
|
80
|
+
description: 'When a new object of a given type is created',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Custom Object Updated',
|
|
84
|
+
value: 'customObjectUpdated',
|
|
85
|
+
description: 'When an object of a given type is modified',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Lead Created',
|
|
89
|
+
value: 'leadCreated',
|
|
90
|
+
description: 'When a new lead is created',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'Lead Updated',
|
|
94
|
+
value: 'leadUpdated',
|
|
95
|
+
description: 'When an existing lead is modified',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'Opportunity Created',
|
|
99
|
+
value: 'opportunityCreated',
|
|
100
|
+
description: 'When a new opportunity is created',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'Opportunity Updated',
|
|
104
|
+
value: 'opportunityUpdated',
|
|
105
|
+
description: 'When an existing opportunity is created',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'Task Created',
|
|
109
|
+
value: 'taskCreated',
|
|
110
|
+
description: 'When a new task is created',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'Task Updated',
|
|
114
|
+
value: 'taskUpdated',
|
|
115
|
+
description: 'When an existing task is modified',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'User Created',
|
|
119
|
+
value: 'userCreated',
|
|
120
|
+
description: 'When a new user is created',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'User Updated',
|
|
124
|
+
value: 'userUpdated',
|
|
125
|
+
description: 'When an existing user is modified',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
displayName: 'Custom Object Name or ID',
|
|
131
|
+
name: 'customObject',
|
|
132
|
+
type: 'options',
|
|
133
|
+
typeOptions: {
|
|
134
|
+
loadOptionsMethod: 'getCustomObjects',
|
|
135
|
+
},
|
|
136
|
+
required: true,
|
|
137
|
+
default: '',
|
|
138
|
+
displayOptions: {
|
|
139
|
+
show: {
|
|
140
|
+
triggerOn: ['customObjectUpdated', 'customObjectCreated'],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
description: 'Name of the custom object. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
this.methods = {
|
|
148
|
+
loadOptions: {
|
|
149
|
+
async getCustomObjects() {
|
|
150
|
+
const returnData = [];
|
|
151
|
+
const { sobjects: objects } = await GenericFunctions_1.salesforceApiRequest.call(this, 'GET', '/sobjects');
|
|
152
|
+
for (const object of objects) {
|
|
153
|
+
if (object.custom === true) {
|
|
154
|
+
const objectName = object.label;
|
|
155
|
+
const objectId = object.name;
|
|
156
|
+
returnData.push({
|
|
157
|
+
name: objectName,
|
|
158
|
+
value: objectId,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
(0, GenericFunctions_1.sortOptions)(returnData);
|
|
163
|
+
return returnData;
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
async poll() {
|
|
169
|
+
const workflowData = this.getWorkflowStaticData('node');
|
|
170
|
+
let responseData;
|
|
171
|
+
const qs = {};
|
|
172
|
+
const triggerOn = this.getNodeParameter('triggerOn');
|
|
173
|
+
let triggerResource = triggerOn.slice(0, 1).toUpperCase() + triggerOn.slice(1, -7);
|
|
174
|
+
const changeType = triggerOn.slice(-7);
|
|
175
|
+
if (triggerResource === 'CustomObject') {
|
|
176
|
+
triggerResource = this.getNodeParameter('customObject');
|
|
177
|
+
}
|
|
178
|
+
const now = luxon_1.DateTime.now().toISO();
|
|
179
|
+
const startDate = workflowData.lastTimeChecked || now;
|
|
180
|
+
const endDate = now;
|
|
181
|
+
try {
|
|
182
|
+
const pollStartDate = startDate;
|
|
183
|
+
const pollEndDate = endDate;
|
|
184
|
+
const options = {
|
|
185
|
+
conditionsUi: {
|
|
186
|
+
conditionValues: [],
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
if (this.getMode() !== 'manual') {
|
|
190
|
+
if (changeType === 'Created') {
|
|
191
|
+
options.conditionsUi.conditionValues.push({
|
|
192
|
+
field: 'CreatedDate',
|
|
193
|
+
operation: '>=',
|
|
194
|
+
value: pollStartDate,
|
|
195
|
+
});
|
|
196
|
+
options.conditionsUi.conditionValues.push({
|
|
197
|
+
field: 'CreatedDate',
|
|
198
|
+
operation: '<',
|
|
199
|
+
value: pollEndDate,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
options.conditionsUi.conditionValues.push({
|
|
204
|
+
field: 'LastModifiedDate',
|
|
205
|
+
operation: '>=',
|
|
206
|
+
value: pollStartDate,
|
|
207
|
+
});
|
|
208
|
+
options.conditionsUi.conditionValues.push({
|
|
209
|
+
field: 'LastModifiedDate',
|
|
210
|
+
operation: '<',
|
|
211
|
+
value: pollEndDate,
|
|
212
|
+
});
|
|
213
|
+
options.conditionsUi.conditionValues.push({
|
|
214
|
+
field: 'CreatedDate',
|
|
215
|
+
operation: '<',
|
|
216
|
+
value: pollStartDate,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
if (this.getMode() === 'manual') {
|
|
222
|
+
qs.q = (0, GenericFunctions_1.getQuery)(options, triggerResource, false, 1);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
qs.q = (0, GenericFunctions_1.getQuery)(options, triggerResource, true);
|
|
226
|
+
}
|
|
227
|
+
responseData = await GenericFunctions_1.salesforceApiRequestAllItems.call(this, 'records', 'GET', '/query', {}, qs);
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
231
|
+
}
|
|
232
|
+
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.length)) {
|
|
233
|
+
workflowData.lastTimeChecked = endDate;
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
if (this.getMode() === 'manual' || !workflowData.lastTimeChecked) {
|
|
239
|
+
throw error;
|
|
240
|
+
}
|
|
241
|
+
const workflow = this.getWorkflow();
|
|
242
|
+
const node = this.getNode();
|
|
243
|
+
this.logger.error(`There was a problem in '${node.name}' node in workflow '${workflow.id}': '${error.description}'`, {
|
|
244
|
+
node: node.name,
|
|
245
|
+
workflowId: workflow.id,
|
|
246
|
+
error,
|
|
247
|
+
});
|
|
248
|
+
throw error;
|
|
249
|
+
}
|
|
250
|
+
workflowData.lastTimeChecked = endDate;
|
|
251
|
+
if (Array.isArray(responseData) && responseData.length) {
|
|
252
|
+
return [this.helpers.returnJsonArray(responseData)];
|
|
253
|
+
}
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
exports.SalesforceTrigger = SalesforceTrigger;
|
|
258
|
+
//# sourceMappingURL=SalesforceTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SalesforceTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Salesforce/SalesforceTrigger.node.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAa5C,iCAAiC;AACjC,yDAK4B;AAE5B,MAAa,iBAAiB;IAA9B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,WAAW,EACV,sFAAsF;YACvF,QAAQ,EAAE,gCAAgC;YAC1C,QAAQ,EAAE;gBACT,IAAI,EAAE,oBAAoB;aAC1B;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,qBAAqB;oBAC3B,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,WAAW;oBACjB,WAAW,EAAE,gDAAgD;oBAC7D,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,iBAAiB;4BACvB,KAAK,EAAE,gBAAgB;4BACvB,WAAW,EAAE,+BAA+B;yBAC5C;wBACD;4BACC,IAAI,EAAE,iBAAiB;4BACvB,KAAK,EAAE,gBAAgB;4BACvB,WAAW,EAAE,sCAAsC;yBACnD;wBACD;4BACC,IAAI,EAAE,oBAAoB;4BAC1B,KAAK,EAAE,mBAAmB;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M,CAAA,EAAE,CAAC;gBAC3B,YAAY,CAAC,eAAe,GAAG,OAAO,CAAC;gBACvC,OAAO,IAAI,CAAC;YACb,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;gBAClE,MAAM,KAAK,CAAC;YACb,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAChB,2BAA2B,IAAI,CAAC,IAAI,uBAAuB,QAAQ,CAAC,EAAE,OAAO,KAAK,CAAC,WAAW,GAAG,EACjG;gBACC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU,EAAE,QAAQ,CAAC,EAAE;gBACvB,KAAK;aACL,CACD,CAAC;YACF,MAAM,KAAK,CAAC;QACb,CAAC;QACD,YAAY,CAAC,eAAe,GAAG,OAAO,CAAC;QAEvC,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;YACxD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAA6B,CAAC,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA5QD,8CA4QC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { IExecuteFunctions, IHookFunctions, IDataObject, IHttpRequestMethods } from 'n8n-workflow';
|
|
1
|
+
import type { IExecuteFunctions, IHookFunctions, IDataObject, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
2
2
|
export declare function twilioApiRequest(this: IHookFunctions | IExecuteFunctions, method: IHttpRequestMethods, endpoint: string, body: IDataObject, query?: IDataObject): Promise<any>;
|
|
3
|
+
export declare function twilioTriggerApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, endpoint: string, body?: FormData | IDataObject): Promise<any>;
|
|
3
4
|
export declare function escapeXml(str: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escapeXml = exports.twilioApiRequest = void 0;
|
|
3
|
+
exports.escapeXml = exports.twilioTriggerApiRequest = exports.twilioApiRequest = void 0;
|
|
4
4
|
async function twilioApiRequest(method, endpoint, body, query) {
|
|
5
5
|
const credentials = (await this.getCredentials('twilioApi'));
|
|
6
6
|
if (query === undefined) {
|
|
@@ -16,6 +16,19 @@ async function twilioApiRequest(method, endpoint, body, query) {
|
|
|
16
16
|
return await this.helpers.requestWithAuthentication.call(this, 'twilioApi', options);
|
|
17
17
|
}
|
|
18
18
|
exports.twilioApiRequest = twilioApiRequest;
|
|
19
|
+
async function twilioTriggerApiRequest(method, endpoint, body = {}) {
|
|
20
|
+
const options = {
|
|
21
|
+
method,
|
|
22
|
+
body,
|
|
23
|
+
headers: {
|
|
24
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
25
|
+
},
|
|
26
|
+
url: `https://events.twilio.com/v1/${endpoint}`,
|
|
27
|
+
json: true,
|
|
28
|
+
};
|
|
29
|
+
return await this.helpers.requestWithAuthentication.call(this, 'twilioApi', options);
|
|
30
|
+
}
|
|
31
|
+
exports.twilioTriggerApiRequest = twilioTriggerApiRequest;
|
|
19
32
|
const XML_CHAR_MAP = {
|
|
20
33
|
'<': '<',
|
|
21
34
|
'>': '>',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Twilio/GenericFunctions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Twilio/GenericFunctions.ts"],"names":[],"mapp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YAAY,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACJ,CAAC;AAJD,8BAIC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IHookFunctions, IWebhookFunctions, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
|
|
2
|
+
export declare class TwilioTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
webhookMethods: {
|
|
5
|
+
default: {
|
|
6
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
7
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
8
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TwilioTrigger = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
5
|
+
class TwilioTrigger {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Twilio Trigger',
|
|
9
|
+
name: 'twilioTrigger',
|
|
10
|
+
icon: 'file:twilio.svg',
|
|
11
|
+
group: ['trigger'],
|
|
12
|
+
version: [1],
|
|
13
|
+
defaultVersion: 1,
|
|
14
|
+
subtitle: '=Updates: {{$parameter["updates"].join(", ")}}',
|
|
15
|
+
description: 'Starts the workflow on a Twilio update',
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'Twilio Trigger',
|
|
18
|
+
},
|
|
19
|
+
inputs: [],
|
|
20
|
+
outputs: ['main'],
|
|
21
|
+
credentials: [
|
|
22
|
+
{
|
|
23
|
+
name: 'twilioApi',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
webhooks: [
|
|
28
|
+
{
|
|
29
|
+
name: 'default',
|
|
30
|
+
httpMethod: 'POST',
|
|
31
|
+
responseMode: 'onReceived',
|
|
32
|
+
path: 'webhook',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
properties: [
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Trigger On',
|
|
38
|
+
name: 'updates',
|
|
39
|
+
type: 'multiOptions',
|
|
40
|
+
options: [
|
|
41
|
+
{
|
|
42
|
+
name: 'New SMS',
|
|
43
|
+
value: 'com.twilio.messaging.inbound-message.received',
|
|
44
|
+
description: 'When an SMS message is received',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'New Call',
|
|
48
|
+
value: 'com.twilio.voice.insights.call-summary.complete',
|
|
49
|
+
description: 'When a call is received',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
required: true,
|
|
53
|
+
default: [],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
displayName: "The 'New Call' event may take up to thirty minutes to be triggered",
|
|
57
|
+
name: 'callTriggerNotice',
|
|
58
|
+
type: 'notice',
|
|
59
|
+
default: '',
|
|
60
|
+
displayOptions: {
|
|
61
|
+
show: {
|
|
62
|
+
updates: ['com.twilio.voice.insights.call-summary.complete'],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
this.webhookMethods = {
|
|
69
|
+
default: {
|
|
70
|
+
async checkExists() {
|
|
71
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
72
|
+
const { sinks } = (await GenericFunctions_1.twilioTriggerApiRequest.call(this, 'GET', 'Sinks')) || {};
|
|
73
|
+
const sink = sinks.find((entry) => entry.sink_configuration.destination === webhookUrl);
|
|
74
|
+
if (sink) {
|
|
75
|
+
const { subscriptions } = (await GenericFunctions_1.twilioTriggerApiRequest.call(this, 'GET', 'Subscriptions')) || {};
|
|
76
|
+
const subscription = subscriptions.find((entry) => entry.sink_sid === sink.sid);
|
|
77
|
+
if (subscription) {
|
|
78
|
+
const { types } = (await GenericFunctions_1.twilioTriggerApiRequest.call(this, 'GET', `Subscriptions/${subscription.sid}/SubscribedEvents`)) || {};
|
|
79
|
+
const typesFound = types.map((type) => type.type);
|
|
80
|
+
const allowedUpdates = this.getNodeParameter('updates');
|
|
81
|
+
if (typesFound.sort().join(',') === allowedUpdates.sort().join(',')) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
},
|
|
91
|
+
async create() {
|
|
92
|
+
const workflowData = this.getWorkflowStaticData('node');
|
|
93
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
94
|
+
const allowedUpdates = this.getNodeParameter('updates');
|
|
95
|
+
const bodySink = {
|
|
96
|
+
Description: 'Sink created by n8n Twilio Trigger Node.',
|
|
97
|
+
SinkConfiguration: `{ "destination": "${webhookUrl}", "method": "POST" }`,
|
|
98
|
+
SinkType: 'webhook',
|
|
99
|
+
};
|
|
100
|
+
const sink = await GenericFunctions_1.twilioTriggerApiRequest.call(this, 'POST', 'Sinks', bodySink);
|
|
101
|
+
workflowData.sinkId = sink.sid;
|
|
102
|
+
const body = {
|
|
103
|
+
Description: 'Subscription created by n8n Twilio Trigger Node.',
|
|
104
|
+
Types: `{ "type": "${allowedUpdates[0]}" }`,
|
|
105
|
+
SinkSid: sink.sid,
|
|
106
|
+
};
|
|
107
|
+
const subscription = await GenericFunctions_1.twilioTriggerApiRequest.call(this, 'POST', 'Subscriptions', body);
|
|
108
|
+
workflowData.subscriptionId = subscription.sid;
|
|
109
|
+
if (allowedUpdates.length > 1) {
|
|
110
|
+
for (let index = 1; index < allowedUpdates.length; index++) {
|
|
111
|
+
await GenericFunctions_1.twilioTriggerApiRequest.call(this, 'POST', `Subscriptions/${workflowData.subscriptionId}/SubscribedEvents`, {
|
|
112
|
+
Type: allowedUpdates[index],
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
},
|
|
118
|
+
async delete() {
|
|
119
|
+
const workflowData = this.getWorkflowStaticData('node');
|
|
120
|
+
const sinkId = workflowData.sinkId;
|
|
121
|
+
const subscriptionId = workflowData.subscriptionId;
|
|
122
|
+
try {
|
|
123
|
+
if (sinkId) {
|
|
124
|
+
await GenericFunctions_1.twilioTriggerApiRequest.call(this, 'DELETE', `Sinks/${sinkId}`, {});
|
|
125
|
+
workflowData.sinkId = '';
|
|
126
|
+
}
|
|
127
|
+
if (subscriptionId) {
|
|
128
|
+
await GenericFunctions_1.twilioTriggerApiRequest.call(this, 'DELETE', `Subscriptions/${subscriptionId}`, {});
|
|
129
|
+
workflowData.subscriptionId = '';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
async webhook() {
|
|
141
|
+
const bodyData = this.getBodyData();
|
|
142
|
+
return {
|
|
143
|
+
workflowData: [this.helpers.returnJsonArray(bodyData)],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
exports.TwilioTrigger = TwilioTrigger;
|
|
148
|
+
//# sourceMappingURL=TwilioTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwilioTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Twilio/TwilioTrigger.node.ts"],"names":[],"mappings":";;;AAQA,yDAA6D;AAE7D,MAAa,aAAa;IAA1B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC,CAAC,CAAC;YACZ,cAAc,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CAAC;oBACxD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;oBACnC,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;oBAEnD,IAAI,CAAC;wBACJ,IAAI,MAAM,EAAE,CAAC;4BACZ,MAAM,0CAAuB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;4BAC1E,YAAY,CAAC,MAAM,GAAG,EAAE,CAAC;wBAC1B,CAAC;wBACD,IAAI,cAAc,EAAE,CAAC;4BACpB,MAAM,0CAAuB,CAAC,IAAI,CACjC,IAAI,EACJ,QAAQ,EACR,iBAAiB,cAAc,EAAE,EACjC,EAAE,CACF,CAAC;4BACF,YAAY,CAAC,cAAc,GAAG,EAAE,CAAC;wBAClC,CAAC;oBACF,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBAChB,OAAO,KAAK,CAAC;oBACd,CAAC;oBACD,OAAO,IAAI,CAAC;gBACb,CAAC;aACD;SACD,CAAC;IASH,CAAC;IAPA,KAAK,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEpC,OAAO;YACN,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;SACtD,CAAC;IACH,CAAC;CACD;AAzLD,sCAyLC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.twilioTrigger",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Communication", "Development"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://docs.n8n.io/credentials/twilio"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.twilio-trigger/"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"alias": ["SMS", "Phone", "Voice"]
|
|
19
|
+
}
|