n8n-nodes-base 1.53.2 → 1.54.1
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/README.md +1 -5
- package/dist/build.tsbuildinfo +1 -1
- package/dist/credentials/WebflowOAuth2Api.credentials.js +8 -1
- package/dist/credentials/WebflowOAuth2Api.credentials.js.map +1 -1
- package/dist/nodes/Aws/AwsLambda.node.js +5 -3
- package/dist/nodes/Aws/AwsLambda.node.js.map +1 -1
- package/dist/nodes/Calendly/CalendlyTrigger.node.js +2 -2
- package/dist/nodes/Calendly/CalendlyTrigger.node.js.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/Elasticsearch.node.js +97 -10
- package/dist/nodes/Elastic/Elasticsearch/Elasticsearch.node.js.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/GenericFunctions.d.ts +1 -0
- package/dist/nodes/Elastic/Elasticsearch/GenericFunctions.js +34 -2
- package/dist/nodes/Elastic/Elasticsearch/GenericFunctions.js.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.js +36 -0
- package/dist/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.js.map +1 -1
- package/dist/nodes/Form/FormTrigger.node.json +1 -1
- package/dist/nodes/Form/common.descriptions.js +5 -4
- package/dist/nodes/Form/common.descriptions.js.map +1 -1
- package/dist/nodes/Form/utils.js +3 -1
- package/dist/nodes/Form/utils.js.map +1 -1
- package/dist/nodes/InvoiceNinja/ExpenseDescription.js +206 -0
- package/dist/nodes/InvoiceNinja/ExpenseDescription.js.map +1 -1
- package/dist/nodes/InvoiceNinja/PaymentDescription.js +206 -0
- package/dist/nodes/InvoiceNinja/PaymentDescription.js.map +1 -1
- package/dist/nodes/Lemlist/GenericFunctions.js +43 -6
- package/dist/nodes/Lemlist/GenericFunctions.js.map +1 -1
- package/dist/nodes/Lemlist/LemlistTrigger.node.js +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.js +4 -0
- package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
- package/dist/nodes/MongoDb/MongoDbProperties.js +12 -1
- package/dist/nodes/MongoDb/MongoDbProperties.js.map +1 -1
- package/dist/nodes/Postgres/v2/helpers/utils.d.ts +1 -0
- package/dist/nodes/Slack/V2/UserDescription.js +1 -1
- package/dist/nodes/Slack/V2/UserDescription.js.map +1 -1
- package/dist/nodes/Stripe/StripeTrigger.node.js +2 -0
- package/dist/nodes/Stripe/StripeTrigger.node.js.map +1 -1
- package/dist/nodes/Webflow/GenericFunctions.d.ts +4 -1
- package/dist/nodes/Webflow/GenericFunctions.js +58 -11
- package/dist/nodes/Webflow/GenericFunctions.js.map +1 -1
- package/dist/nodes/Webflow/V1/ItemDescription.js.map +1 -0
- package/dist/nodes/Webflow/V1/WebflowTriggerV1.node.d.ts +19 -0
- package/dist/nodes/Webflow/V1/WebflowTriggerV1.node.js +189 -0
- package/dist/nodes/Webflow/V1/WebflowTriggerV1.node.js.map +1 -0
- package/dist/nodes/Webflow/V1/WebflowV1.node.d.ts +14 -0
- package/dist/nodes/Webflow/V1/WebflowV1.node.js +152 -0
- package/dist/nodes/Webflow/V1/WebflowV1.node.js.map +1 -0
- package/dist/nodes/Webflow/V2/WebflowTriggerV2.node.d.ts +19 -0
- package/dist/nodes/Webflow/V2/WebflowTriggerV2.node.js +159 -0
- package/dist/nodes/Webflow/V2/WebflowTriggerV2.node.js.map +1 -0
- package/dist/nodes/Webflow/V2/WebflowV2.node.d.ts +14 -0
- package/dist/nodes/Webflow/V2/WebflowV2.node.js +26 -0
- package/dist/nodes/Webflow/V2/WebflowV2.node.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/Item/Item.resource.d.ts +8 -0
- package/dist/nodes/Webflow/V2/actions/Item/Item.resource.js +83 -0
- package/dist/nodes/Webflow/V2/actions/Item/Item.resource.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/Item/create.operation.d.ts +25 -0
- package/dist/nodes/Webflow/V2/actions/Item/create.operation.js +110 -0
- package/dist/nodes/Webflow/V2/actions/Item/create.operation.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/Item/delete.operation.d.ts +25 -0
- package/dist/nodes/Webflow/V2/actions/Item/delete.operation.js +73 -0
- package/dist/nodes/Webflow/V2/actions/Item/delete.operation.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/Item/get.operation.d.ts +25 -0
- package/dist/nodes/Webflow/V2/actions/Item/get.operation.js +68 -0
- package/dist/nodes/Webflow/V2/actions/Item/get.operation.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/Item/getAll.operation.d.ts +25 -0
- package/dist/nodes/Webflow/V2/actions/Item/getAll.operation.js +91 -0
- package/dist/nodes/Webflow/V2/actions/Item/getAll.operation.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/Item/update.operation.d.ts +25 -0
- package/dist/nodes/Webflow/V2/actions/Item/update.operation.js +119 -0
- package/dist/nodes/Webflow/V2/actions/Item/update.operation.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/node.type.d.ts +6 -0
- package/dist/nodes/Webflow/V2/actions/node.type.js +3 -0
- package/dist/nodes/Webflow/V2/actions/node.type.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/router.d.ts +2 -0
- package/dist/nodes/Webflow/V2/actions/router.js +52 -0
- package/dist/nodes/Webflow/V2/actions/router.js.map +1 -0
- package/dist/nodes/Webflow/V2/actions/versionDescription.d.ts +2 -0
- package/dist/nodes/Webflow/V2/actions/versionDescription.js +64 -0
- package/dist/nodes/Webflow/V2/actions/versionDescription.js.map +1 -0
- package/dist/nodes/Webflow/Webflow.node.d.ts +3 -11
- package/dist/nodes/Webflow/Webflow.node.js +10 -171
- package/dist/nodes/Webflow/Webflow.node.js.map +1 -1
- package/dist/nodes/Webflow/WebflowTrigger.node.d.ts +3 -16
- package/dist/nodes/Webflow/WebflowTrigger.node.js +10 -179
- package/dist/nodes/Webflow/WebflowTrigger.node.js.map +1 -1
- package/dist/types/credentials.json +1 -1
- package/dist/types/nodes.json +15 -13
- package/package.json +5 -5
- package/dist/nodes/Webflow/ItemDescription.js.map +0 -1
- /package/dist/nodes/Webflow/{ItemDescription.d.ts → V1/ItemDescription.d.ts} +0 -0
- /package/dist/nodes/Webflow/{ItemDescription.js → V1/ItemDescription.js} +0 -0
|
@@ -1,186 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Webflow = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const WebflowV1_node_1 = require("./V1/WebflowV1.node");
|
|
6
|
+
const WebflowV2_node_1 = require("./V2/WebflowV2.node");
|
|
7
|
+
class Webflow extends n8n_workflow_1.VersionedNodeType {
|
|
7
8
|
constructor() {
|
|
8
|
-
|
|
9
|
+
const baseDescription = {
|
|
9
10
|
displayName: 'Webflow',
|
|
10
11
|
name: 'webflow',
|
|
11
12
|
icon: 'file:webflow.svg',
|
|
12
13
|
group: ['transform'],
|
|
13
|
-
version: 1,
|
|
14
14
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
15
15
|
description: 'Consume the Webflow API',
|
|
16
|
-
|
|
17
|
-
name: 'Webflow',
|
|
18
|
-
},
|
|
19
|
-
inputs: ['main'],
|
|
20
|
-
outputs: ['main'],
|
|
21
|
-
credentials: [
|
|
22
|
-
{
|
|
23
|
-
name: 'webflowApi',
|
|
24
|
-
required: true,
|
|
25
|
-
displayOptions: {
|
|
26
|
-
show: {
|
|
27
|
-
authentication: ['accessToken'],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: 'webflowOAuth2Api',
|
|
33
|
-
required: true,
|
|
34
|
-
displayOptions: {
|
|
35
|
-
show: {
|
|
36
|
-
authentication: ['oAuth2'],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
properties: [
|
|
42
|
-
{
|
|
43
|
-
displayName: 'Authentication',
|
|
44
|
-
name: 'authentication',
|
|
45
|
-
type: 'options',
|
|
46
|
-
options: [
|
|
47
|
-
{
|
|
48
|
-
name: 'Access Token',
|
|
49
|
-
value: 'accessToken',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'OAuth2',
|
|
53
|
-
value: 'oAuth2',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
default: 'accessToken',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
displayName: 'Resource',
|
|
60
|
-
name: 'resource',
|
|
61
|
-
type: 'options',
|
|
62
|
-
noDataExpression: true,
|
|
63
|
-
options: [
|
|
64
|
-
{
|
|
65
|
-
name: 'Item',
|
|
66
|
-
value: 'item',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
default: 'item',
|
|
70
|
-
},
|
|
71
|
-
...ItemDescription_1.itemOperations,
|
|
72
|
-
...ItemDescription_1.itemFields,
|
|
73
|
-
],
|
|
16
|
+
defaultVersion: 2,
|
|
74
17
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const returnData = [];
|
|
79
|
-
const sites = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', '/sites');
|
|
80
|
-
for (const site of sites) {
|
|
81
|
-
returnData.push({
|
|
82
|
-
name: site.name,
|
|
83
|
-
value: site._id,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
return returnData;
|
|
87
|
-
},
|
|
88
|
-
async getCollections() {
|
|
89
|
-
const returnData = [];
|
|
90
|
-
const siteId = this.getCurrentNodeParameter('siteId');
|
|
91
|
-
const collections = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/sites/${siteId}/collections`);
|
|
92
|
-
for (const collection of collections) {
|
|
93
|
-
returnData.push({
|
|
94
|
-
name: collection.name,
|
|
95
|
-
value: collection._id,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
return returnData;
|
|
99
|
-
},
|
|
100
|
-
async getFields() {
|
|
101
|
-
const returnData = [];
|
|
102
|
-
const collectionId = this.getCurrentNodeParameter('collectionId');
|
|
103
|
-
const { fields } = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/collections/${collectionId}`);
|
|
104
|
-
for (const field of fields) {
|
|
105
|
-
returnData.push({
|
|
106
|
-
name: `${field.name} (${field.type}) ${field.required ? ' (required)' : ''}`,
|
|
107
|
-
value: field.slug,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
return returnData;
|
|
111
|
-
},
|
|
112
|
-
},
|
|
18
|
+
const nodeVersions = {
|
|
19
|
+
1: new WebflowV1_node_1.WebflowV1(baseDescription),
|
|
20
|
+
2: new WebflowV2_node_1.WebflowV2(baseDescription),
|
|
113
21
|
};
|
|
114
|
-
|
|
115
|
-
async execute() {
|
|
116
|
-
const items = this.getInputData();
|
|
117
|
-
const resource = this.getNodeParameter('resource', 0);
|
|
118
|
-
const operation = this.getNodeParameter('operation', 0);
|
|
119
|
-
let responseData;
|
|
120
|
-
const returnData = [];
|
|
121
|
-
for (let i = 0; i < items.length; i++) {
|
|
122
|
-
try {
|
|
123
|
-
if (resource === 'item') {
|
|
124
|
-
if (operation === 'create') {
|
|
125
|
-
const collectionId = this.getNodeParameter('collectionId', i);
|
|
126
|
-
const properties = this.getNodeParameter('fieldsUi.fieldValues', i, []);
|
|
127
|
-
const live = this.getNodeParameter('live', i);
|
|
128
|
-
const fields = {};
|
|
129
|
-
properties.forEach((data) => (fields[data.fieldId] = data.fieldValue));
|
|
130
|
-
const body = {
|
|
131
|
-
fields,
|
|
132
|
-
};
|
|
133
|
-
responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'POST', `/collections/${collectionId}/items`, body, { live });
|
|
134
|
-
}
|
|
135
|
-
else if (operation === 'delete') {
|
|
136
|
-
const collectionId = this.getNodeParameter('collectionId', i);
|
|
137
|
-
const itemId = this.getNodeParameter('itemId', i);
|
|
138
|
-
responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'DELETE', `/collections/${collectionId}/items/${itemId}`);
|
|
139
|
-
}
|
|
140
|
-
else if (operation === 'get') {
|
|
141
|
-
const collectionId = this.getNodeParameter('collectionId', i);
|
|
142
|
-
const itemId = this.getNodeParameter('itemId', i);
|
|
143
|
-
responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/collections/${collectionId}/items/${itemId}`);
|
|
144
|
-
responseData = responseData.items;
|
|
145
|
-
}
|
|
146
|
-
else if (operation === 'getAll') {
|
|
147
|
-
const returnAll = this.getNodeParameter('returnAll', 0);
|
|
148
|
-
const collectionId = this.getNodeParameter('collectionId', i);
|
|
149
|
-
const qs = {};
|
|
150
|
-
if (returnAll) {
|
|
151
|
-
responseData = await GenericFunctions_1.webflowApiRequestAllItems.call(this, 'GET', `/collections/${collectionId}/items`, {}, qs);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
qs.limit = this.getNodeParameter('limit', 0);
|
|
155
|
-
responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/collections/${collectionId}/items`, {}, qs);
|
|
156
|
-
responseData = responseData.items;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
else if (operation === 'update') {
|
|
160
|
-
const collectionId = this.getNodeParameter('collectionId', i);
|
|
161
|
-
const itemId = this.getNodeParameter('itemId', i);
|
|
162
|
-
const properties = this.getNodeParameter('fieldsUi.fieldValues', i, []);
|
|
163
|
-
const live = this.getNodeParameter('live', i);
|
|
164
|
-
const fields = {};
|
|
165
|
-
properties.forEach((data) => (fields[data.fieldId] = data.fieldValue));
|
|
166
|
-
const body = {
|
|
167
|
-
fields,
|
|
168
|
-
};
|
|
169
|
-
responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'PUT', `/collections/${collectionId}/items/${itemId}`, body, { live });
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
173
|
-
returnData.push(...executionData);
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
if (this.continueOnFail(error)) {
|
|
177
|
-
returnData.push({ json: { error: error.message } });
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
180
|
-
throw error;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return [returnData];
|
|
22
|
+
super(nodeVersions, baseDescription);
|
|
184
23
|
}
|
|
185
24
|
}
|
|
186
25
|
exports.Webflow = Webflow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Webflow.node.js","sourceRoot":"","sources":["../../../nodes/Webflow/Webflow.node.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Webflow.node.js","sourceRoot":"","sources":["../../../nodes/Webflow/Webflow.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AAEjD,wDAAgD;AAChD,wDAAgD;AAEhD,MAAa,OAAQ,SAAQ,gCAAiB;IAC7C;QACC,MAAM,eAAe,GAA6B;YACjD,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,yBAAyB;YACtC,cAAc,EAAE,CAAC;SACjB,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,CAAC,EAAE,IAAI,0BAAS,CAAC,eAAe,CAAC;YACjC,CAAC,EAAE,IAAI,0BAAS,CAAC,eAAe,CAAC;SACjC,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AAnBD,0BAmBC"}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare class WebflowTrigger
|
|
3
|
-
|
|
4
|
-
methods: {
|
|
5
|
-
loadOptions: {
|
|
6
|
-
getSites(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
webhookMethods: {
|
|
10
|
-
default: {
|
|
11
|
-
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
12
|
-
create(this: IHookFunctions): Promise<boolean>;
|
|
13
|
-
delete(this: IHookFunctions): Promise<boolean>;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
1
|
+
import { VersionedNodeType } from 'n8n-workflow';
|
|
2
|
+
export declare class WebflowTrigger extends VersionedNodeType {
|
|
3
|
+
constructor();
|
|
17
4
|
}
|
|
@@ -1,193 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebflowTrigger = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const WebflowTriggerV1_node_1 = require("./V1/WebflowTriggerV1.node");
|
|
6
|
+
const WebflowTriggerV2_node_1 = require("./V2/WebflowTriggerV2.node");
|
|
7
|
+
class WebflowTrigger extends n8n_workflow_1.VersionedNodeType {
|
|
6
8
|
constructor() {
|
|
7
|
-
|
|
9
|
+
const baseDescription = {
|
|
8
10
|
displayName: 'Webflow Trigger',
|
|
9
11
|
name: 'webflowTrigger',
|
|
10
12
|
icon: 'file:webflow.svg',
|
|
11
13
|
group: ['trigger'],
|
|
12
|
-
version: 1,
|
|
13
14
|
description: 'Handle Webflow events via webhooks',
|
|
14
|
-
|
|
15
|
-
name: 'Webflow Trigger',
|
|
16
|
-
},
|
|
17
|
-
inputs: [],
|
|
18
|
-
outputs: ['main'],
|
|
19
|
-
credentials: [
|
|
20
|
-
{
|
|
21
|
-
name: 'webflowApi',
|
|
22
|
-
required: true,
|
|
23
|
-
displayOptions: {
|
|
24
|
-
show: {
|
|
25
|
-
authentication: ['accessToken'],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'webflowOAuth2Api',
|
|
31
|
-
required: true,
|
|
32
|
-
displayOptions: {
|
|
33
|
-
show: {
|
|
34
|
-
authentication: ['oAuth2'],
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
webhooks: [
|
|
40
|
-
{
|
|
41
|
-
name: 'default',
|
|
42
|
-
httpMethod: 'POST',
|
|
43
|
-
responseMode: 'onReceived',
|
|
44
|
-
path: 'webhook',
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
properties: [
|
|
48
|
-
{
|
|
49
|
-
displayName: 'Authentication',
|
|
50
|
-
name: 'authentication',
|
|
51
|
-
type: 'options',
|
|
52
|
-
options: [
|
|
53
|
-
{
|
|
54
|
-
name: 'Access Token',
|
|
55
|
-
value: 'accessToken',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'OAuth2',
|
|
59
|
-
value: 'oAuth2',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
default: 'accessToken',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
displayName: 'Site Name or ID',
|
|
66
|
-
name: 'site',
|
|
67
|
-
type: 'options',
|
|
68
|
-
required: true,
|
|
69
|
-
default: '',
|
|
70
|
-
typeOptions: {
|
|
71
|
-
loadOptionsMethod: 'getSites',
|
|
72
|
-
},
|
|
73
|
-
description: 'Site that will trigger the events. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
displayName: 'Event',
|
|
77
|
-
name: 'event',
|
|
78
|
-
type: 'options',
|
|
79
|
-
required: true,
|
|
80
|
-
options: [
|
|
81
|
-
{
|
|
82
|
-
name: 'Collection Item Created',
|
|
83
|
-
value: 'collection_item_created',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'Collection Item Deleted',
|
|
87
|
-
value: 'collection_item_deleted',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'Collection Item Updated',
|
|
91
|
-
value: 'collection_item_changed',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'Ecomm Inventory Changed',
|
|
95
|
-
value: 'ecomm_inventory_changed',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: 'Ecomm New Order',
|
|
99
|
-
value: 'ecomm_new_order',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: 'Ecomm Order Changed',
|
|
103
|
-
value: 'ecomm_order_changed',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: 'Form Submission',
|
|
107
|
-
value: 'form_submission',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'Site Publish',
|
|
111
|
-
value: 'site_publish',
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
default: 'form_submission',
|
|
115
|
-
},
|
|
116
|
-
],
|
|
15
|
+
defaultVersion: 2,
|
|
117
16
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const returnData = [];
|
|
122
|
-
const sites = await GenericFunctions_1.webflowApiRequest.call(this, 'GET', '/sites');
|
|
123
|
-
for (const site of sites) {
|
|
124
|
-
const siteName = site.name;
|
|
125
|
-
const siteId = site._id;
|
|
126
|
-
returnData.push({
|
|
127
|
-
name: siteName,
|
|
128
|
-
value: siteId,
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return returnData;
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
this.webhookMethods = {
|
|
136
|
-
default: {
|
|
137
|
-
async checkExists() {
|
|
138
|
-
const webhookData = this.getWorkflowStaticData('node');
|
|
139
|
-
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
140
|
-
const siteId = this.getNodeParameter('site');
|
|
141
|
-
const event = this.getNodeParameter('event');
|
|
142
|
-
const registeredWebhooks = (await GenericFunctions_1.webflowApiRequest.call(this, 'GET', `/sites/${siteId}/webhooks`));
|
|
143
|
-
for (const webhook of registeredWebhooks) {
|
|
144
|
-
if (webhook.url === webhookUrl && webhook.triggerType === event) {
|
|
145
|
-
webhookData.webhookId = webhook._id;
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return false;
|
|
150
|
-
},
|
|
151
|
-
async create() {
|
|
152
|
-
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
153
|
-
const webhookData = this.getWorkflowStaticData('node');
|
|
154
|
-
const siteId = this.getNodeParameter('site');
|
|
155
|
-
const event = this.getNodeParameter('event');
|
|
156
|
-
const endpoint = `/sites/${siteId}/webhooks`;
|
|
157
|
-
const body = {
|
|
158
|
-
site_id: siteId,
|
|
159
|
-
triggerType: event,
|
|
160
|
-
url: webhookUrl,
|
|
161
|
-
};
|
|
162
|
-
const { _id } = await GenericFunctions_1.webflowApiRequest.call(this, 'POST', endpoint, body);
|
|
163
|
-
webhookData.webhookId = _id;
|
|
164
|
-
return true;
|
|
165
|
-
},
|
|
166
|
-
async delete() {
|
|
167
|
-
let responseData;
|
|
168
|
-
const webhookData = this.getWorkflowStaticData('node');
|
|
169
|
-
const siteId = this.getNodeParameter('site');
|
|
170
|
-
const endpoint = `/sites/${siteId}/webhooks/${webhookData.webhookId}`;
|
|
171
|
-
try {
|
|
172
|
-
responseData = await GenericFunctions_1.webflowApiRequest.call(this, 'DELETE', endpoint);
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
if (!responseData.deleted) {
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
delete webhookData.webhookId;
|
|
181
|
-
return true;
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
async webhook() {
|
|
187
|
-
const req = this.getRequestObject();
|
|
188
|
-
return {
|
|
189
|
-
workflowData: [this.helpers.returnJsonArray(req.body)],
|
|
17
|
+
const nodeVersions = {
|
|
18
|
+
1: new WebflowTriggerV1_node_1.WebflowTriggerV1(baseDescription),
|
|
19
|
+
2: new WebflowTriggerV2_node_1.WebflowTriggerV2(baseDescription),
|
|
190
20
|
};
|
|
21
|
+
super(nodeVersions, baseDescription);
|
|
191
22
|
}
|
|
192
23
|
}
|
|
193
24
|
exports.WebflowTrigger = WebflowTrigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebflowTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Webflow/WebflowTrigger.node.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"WebflowTrigger.node.js","sourceRoot":"","sources":["../../../nodes/Webflow/WebflowTrigger.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AACjD,sEAA8D;AAC9D,sEAA8D;AAE9D,MAAa,cAAe,SAAQ,gCAAiB;IACpD;QACC,MAAM,eAAe,GAA6B;YACjD,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,WAAW,EAAE,oCAAoC;YACjD,cAAc,EAAE,CAAC;SACjB,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,CAAC,EAAE,IAAI,wCAAgB,CAAC,eAAe,CAAC;YACxC,CAAC,EAAE,IAAI,wCAAgB,CAAC,eAAe,CAAC;SACxC,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AAlBD,wCAkBC"}
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
{"name":"venafiTlsProtectCloudApi","displayName":"Venafi TLS Protect Cloud","documentationUrl":"venafitlsprotectcloud","properties":[{"displayName":"Region","name":"region","type":"options","options":[{"name":"US","value":"cloud"},{"name":"EU","value":"eu"}],"default":"cloud"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"tppl-api-key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"=https://api.venafi.{{$credentials.region ?? \"cloud\"}}","url":"/v1/preferences"}}},
|
|
336
336
|
{"name":"venafiTlsProtectDatacenterApi","displayName":"Venafi TLS Protect Datacenter API","documentationUrl":"venafitlsprotectdatacenter","properties":[{"displayName":"Domain","name":"domain","type":"string","default":"","placeholder":"https://example.com"},{"displayName":"Client ID","name":"clientId","type":"string","default":""},{"displayName":"Username","name":"username","type":"string","default":""},{"displayName":"Password","name":"password","type":"string","typeOptions":{"password":true},"default":""},{"displayName":"Allow Self-Signed Certificates","name":"allowUnauthorizedCerts","type":"boolean","default":true},{"displayName":"Access Token","name":"token","type":"hidden","typeOptions":{"expirable":true},"default":""},{"displayName":"Scope","name":"scope","type":"hidden","default":"certificate:manage"}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.token}}"}}}},
|
|
337
337
|
{"name":"webflowApi","displayName":"Webflow API","documentationUrl":"webflow","properties":[{"displayName":"Access Token","name":"accessToken","type":"string","typeOptions":{"password":true},"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.accessToken}}"}}},"test":{"request":{"baseURL":"https://api.webflow.com","url":"/sites"}}},
|
|
338
|
-
{"name":"webflowOAuth2Api","extends":["oAuth2Api"],"displayName":"Webflow OAuth2 API","documentationUrl":"webflow","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"https://webflow.com/oauth/authorize","required":true},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"https://api.webflow.com/oauth/access_token","required":true},{"displayName":"Scope","name":"scope","type":"hidden","default":""},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":"","description":"For some services additional query parameters have to be set which can be defined here","placeholder":""},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"body"}]},
|
|
338
|
+
{"name":"webflowOAuth2Api","extends":["oAuth2Api"],"displayName":"Webflow OAuth2 API","documentationUrl":"webflow","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Legacy","name":"legacy","type":"boolean","default":true,"description":"If the legacy API should be used"},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"https://webflow.com/oauth/authorize","required":true},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"https://api.webflow.com/oauth/access_token","required":true},{"displayName":"Scope","name":"scope","type":"hidden","default":"={{$self[\"legacy\"] ? \"\" : \"cms:read cms:write sites:read\"}}"},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":"","description":"For some services additional query parameters have to be set which can be defined here","placeholder":""},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"body"}]},
|
|
339
339
|
{"name":"wekanApi","displayName":"Wekan API","documentationUrl":"wekan","properties":[{"displayName":"Username","name":"username","type":"string","default":""},{"displayName":"Password","name":"password","type":"string","typeOptions":{"password":true},"default":""},{"displayName":"URL","name":"url","type":"string","default":"","placeholder":"https://wekan.yourdomain.com"},{"displayName":"Session Token","name":"token","type":"hidden","typeOptions":{"expirable":true},"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.token}}"}}},"test":{"request":{"baseURL":"={{$credentials.url.replace(new RegExp(\"/$\"), \"\")}}","url":"/api/user"}}},
|
|
340
340
|
{"name":"whatsAppApi","displayName":"WhatsApp API","documentationUrl":"whatsApp","properties":[{"displayName":"Access Token","type":"string","typeOptions":{"password":true},"name":"accessToken","default":"","required":true},{"displayName":"Bussiness Account ID","type":"string","name":"businessAccountId","default":"","required":true}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.accessToken}}"}}},"test":{"request":{"baseURL":"https://graph.facebook.com/v13.0","url":"/","ignoreHttpStatusErrors":true},"rules":[{"type":"responseSuccessBody","properties":{"key":"error.type","value":"OAuthException","message":"Invalid access token"}}]}},
|
|
341
341
|
{"name":"whatsAppTriggerApi","displayName":"WhatsApp API","documentationUrl":"whatsApp","properties":[{"displayName":"Client ID","name":"clientId","type":"string","default":"","required":true},{"displayName":"Client Secret","name":"clientSecret","type":"string","typeOptions":{"password":true},"default":"","required":true}],"test":{"request":{"method":"POST","baseURL":"https://graph.facebook.com/v19.0/oauth/access_token","body":{"client_id":"={{$credentials.clientId}}","client_secret":"={{$credentials.clientSecret}}","grant_type":"client_credentials"}}}},
|