@limetech/n8n-nodes-lime 3.5.2 → 3.6.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/nodes/common.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { createHmac } from 'node:crypto';
1
+ import { createHmac, createHash } from 'node:crypto';
2
2
  import { IAllExecuteFunctions, NodeOperationError } from 'n8n-workflow';
3
+ import { handleWorkflowError } from './errorHandling';
3
4
 
4
5
  /**
5
6
  * Generate an HMAC SHA-256 hash for the given data using the provided key.
@@ -77,10 +78,18 @@ export const verifyRequest = (
77
78
  );
78
79
  }
79
80
 
80
- if (!verifyHmac(webhookSecret, data, limeSignature)) {
81
- throw new NodeOperationError(
82
- nodeContext.getNode(),
83
- 'Webhook authentication failed, secret keys do not match!'
84
- );
81
+ const expectedHmac = generateHmac(webhookSecret, data);
82
+ if (expectedHmac !== limeSignature) {
83
+ const secretFingerprint = createHash('sha256')
84
+ .update(webhookSecret)
85
+ .digest('hex')
86
+ .slice(0, 16);
87
+ handleWorkflowError(nodeContext, {
88
+ message: 'Webhook authentication failed, signature does not match!',
89
+ receivedSignature: limeSignature,
90
+ expectedSignature: expectedHmac,
91
+ bodyLength: data.length,
92
+ secretFingerprint,
93
+ });
85
94
  }
86
95
  };
@@ -92,12 +92,12 @@ export function getBulkImportProperties(
92
92
  },
93
93
  },
94
94
  {
95
- displayName: 'Input Method',
95
+ displayName: 'Input',
96
96
  name: 'inputMethod',
97
97
  type: 'options',
98
98
  options: [
99
99
  {
100
- name: 'Form Fields',
100
+ name: 'Form',
101
101
  value: 'fields',
102
102
  description: 'Define fields using the UI',
103
103
  },
@@ -117,7 +117,7 @@ export function getBulkImportProperties(
117
117
  },
118
118
  },
119
119
  {
120
- displayName: 'Data',
120
+ displayName: 'Input (JSON)',
121
121
  name: 'objectJson',
122
122
  type: 'json',
123
123
  default: '{\n "name": "Company Name",\n "phone": "+987654321"\n}',
@@ -135,7 +135,7 @@ export function getBulkImportProperties(
135
135
  },
136
136
  },
137
137
  {
138
- displayName: 'Properties',
138
+ displayName: 'Input (Form)',
139
139
  name: 'properties',
140
140
  type: 'resourceMapper',
141
141
  placeholder: 'Add Property',
@@ -51,17 +51,19 @@ export const properties: INodeProperties[] = [
51
51
  },
52
52
  },
53
53
  {
54
- displayName: 'Input Method',
54
+ displayName: 'Input',
55
55
  name: 'inputMethod',
56
56
  type: 'options',
57
57
  options: [
58
58
  {
59
- name: 'Form Fields',
59
+ name: 'Form',
60
60
  value: 'fields',
61
+ description: 'Define fields using the UI',
61
62
  },
62
63
  {
63
64
  name: 'JSON Object',
64
65
  value: 'json',
66
+ description: 'Define fields using JSON',
65
67
  },
66
68
  ],
67
69
  default: 'fields',
@@ -74,7 +76,7 @@ export const properties: INodeProperties[] = [
74
76
  },
75
77
  },
76
78
  {
77
- displayName: 'Properties',
79
+ displayName: 'Input (Form)',
78
80
  name: 'properties',
79
81
  type: 'resourceMapper',
80
82
  placeholder: 'Add Property',
@@ -99,7 +101,7 @@ export const properties: INodeProperties[] = [
99
101
  },
100
102
  },
101
103
  {
102
- displayName: 'Data',
104
+ displayName: 'Input (JSON)',
103
105
  name: 'objectJson',
104
106
  type: 'json',
105
107
  default: '{\n "name": "New Company",\n "phone": "123-456-7890"\n}',
@@ -119,17 +119,19 @@ export const properties: INodeProperties[] = [
119
119
  },
120
120
  options: [
121
121
  {
122
- name: 'Properties',
122
+ name: 'Form',
123
123
  value: 'fields',
124
+ description: 'Define fields using the UI',
124
125
  },
125
126
  {
126
127
  name: 'JSON Object',
127
128
  value: 'json',
129
+ description: 'Define fields using JSON',
128
130
  },
129
131
  ],
130
132
  },
131
133
  {
132
- displayName: 'Response Format (Form Fields)',
134
+ displayName: 'Response Format (Form)',
133
135
  name: 'responseFormatProperties',
134
136
  type: 'fixedCollection',
135
137
  placeholder: 'Add Property',
@@ -166,7 +168,7 @@ export const properties: INodeProperties[] = [
166
168
  ],
167
169
  },
168
170
  {
169
- displayName: 'Data',
171
+ displayName: 'Response Format (JSON)',
170
172
  name: 'responseFormatJson',
171
173
  type: 'json',
172
174
  required: true,
@@ -224,17 +226,19 @@ export const properties: INodeProperties[] = [
224
226
  },
225
227
  options: [
226
228
  {
227
- name: 'Form Fields',
229
+ name: 'Form',
228
230
  value: 'fields',
231
+ description: 'Define fields using the UI',
229
232
  },
230
233
  {
231
234
  name: 'JSON Object',
232
235
  value: 'json',
236
+ description: 'Define fields using JSON',
233
237
  },
234
238
  ],
235
239
  },
236
240
  {
237
- displayName: 'Order By (Form Fields)',
241
+ displayName: 'Order By (Form)',
238
242
  name: 'orderByProperties',
239
243
  type: 'fixedCollection',
240
244
  placeholder: 'Add Property',
@@ -285,7 +289,7 @@ export const properties: INodeProperties[] = [
285
289
  ],
286
290
  },
287
291
  {
288
- displayName: 'Data',
292
+ displayName: 'Order By (JSON)',
289
293
  name: 'orderByJson',
290
294
  type: 'json',
291
295
  required: true,
@@ -65,12 +65,12 @@ export const properties: INodeProperties[] = [
65
65
  },
66
66
  },
67
67
  {
68
- displayName: 'Input Type',
68
+ displayName: 'Input',
69
69
  name: 'inputType',
70
70
  type: 'options',
71
71
  options: [
72
72
  {
73
- name: 'Simple Fields',
73
+ name: 'Form',
74
74
  value: 'fields',
75
75
  description: 'Define fields using the UI',
76
76
  },
@@ -90,7 +90,7 @@ export const properties: INodeProperties[] = [
90
90
  },
91
91
  },
92
92
  {
93
- displayName: 'Data',
93
+ displayName: 'Input (JSON)',
94
94
  name: 'jsonData',
95
95
  type: 'json',
96
96
  default:
@@ -109,7 +109,7 @@ export const properties: INodeProperties[] = [
109
109
  },
110
110
  },
111
111
  {
112
- displayName: 'Properties',
112
+ displayName: 'Input (Form)',
113
113
  name: 'properties',
114
114
  type: 'resourceMapper',
115
115
  placeholder: 'Add Property',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/n8n-nodes-lime",
3
- "version": "3.5.2",
3
+ "version": "3.6.1",
4
4
  "description": "n8n node to connect to Lime CRM",
5
5
  "license": "Apache-2.0",
6
6
  "main": "nodes/index.ts",