Skip to content

Commit ea0ef05

Browse files
support array params
1 parent b99a028 commit ea0ef05

20 files changed

+51
-49
lines changed

credentials/HasDataApi.credentials.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
21
import {
32
IAuthenticateGeneric,
4-
Icon,
53
ICredentialType,
64
INodeProperties,
75
} from 'n8n-workflow';
86

97
export class HasDataApi implements ICredentialType {
108
name = 'hasDataApi';
11-
icon = 'fa:hasdata.svg';
129
displayName = 'HasData API';
1310
documentationUrl = 'https://docs.hasdata.com';
1411
properties: INodeProperties[] = [

nodes/HasData/HasData.node.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class HasData implements INodeType {
163163
...yelpFields,
164164
...zillowFields,
165165
],
166-
usableAsTool: true,
166+
usableAsTool: true,
167167
};
168168

169169
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
@@ -227,7 +227,8 @@ export class HasData implements INodeType {
227227
try {
228228
const value = this.getNodeParameter(fieldName, i);
229229
if (value !== '' && value !== undefined && value !== null) {
230-
qs[fieldName] = value;
230+
const originalName = fieldName.replace(/__opt__/g, '[').replace(/__clt__/g, ']');
231+
qs[originalName] = value;
231232
}
232233
} catch (e) {
233234
// Param not displayed/found
@@ -238,7 +239,10 @@ export class HasData implements INodeType {
238239
try {
239240
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
240241
if (additionalFields && Object.keys(additionalFields).length > 0) {
241-
Object.assign(qs, additionalFields);
242+
for (const key of Object.keys(additionalFields)) {
243+
const originalKey = key.replace(/__opt__/g, '[').replace(/__clt__/g, ']');
244+
qs[originalKey] = additionalFields[key];
245+
}
242246
}
243247
} catch (e) {
244248
// additionalFields not found

nodes/HasData/descriptions/AirbnbDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const airbnbOperations: INodeProperties[] = [
2525
"action": "Get Airbnb Property Details"
2626
}
2727
],
28-
default: undefined,
28+
default: 'listing',
2929
},
3030
];
3131

nodes/HasData/descriptions/AmazonDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const amazonOperations: INodeProperties[] = [
2525
"action": "Get Amazon Search Results"
2626
}
2727
],
28-
default: undefined,
28+
default: 'product',
2929
},
3030
];
3131

nodes/HasData/descriptions/BingDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const bingOperations: INodeProperties[] = [
1919
"action": "Get Bing Search Results"
2020
}
2121
],
22-
default: undefined,
22+
default: 'serp',
2323
},
2424
];
2525

nodes/HasData/descriptions/GlassdoorDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const glassdoorOperations: INodeProperties[] = [
2525
"action": "Get GlassDoor Job Listings"
2626
}
2727
],
28-
default: undefined,
28+
default: 'job',
2929
},
3030
];
3131

nodes/HasData/descriptions/GoogleImagesDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const googleImagesOperations: INodeProperties[] = [
1919
"action": "Get Image Search Results"
2020
}
2121
],
22-
default: undefined,
22+
default: 'images',
2323
},
2424
];
2525

nodes/HasData/descriptions/GoogleMapsDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const googleMapsOperations: INodeProperties[] = [
4343
"action": "Get Map Contributor Reviews"
4444
}
4545
],
46-
default: undefined,
46+
default: 'search',
4747
},
4848
];
4949

nodes/HasData/descriptions/GoogleSerpDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const googleSerpOperations: INodeProperties[] = [
6767
"action": "Get Immersive Product Information"
6868
}
6969
],
70-
default: undefined,
70+
default: 'serp',
7171
},
7272
];
7373

nodes/HasData/descriptions/GoogleTravelDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const googleTravelOperations: INodeProperties[] = [
1919
"action": "Get Google Flights Results"
2020
}
2121
],
22-
default: undefined,
22+
default: 'flights',
2323
},
2424
];
2525

0 commit comments

Comments
 (0)