You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
baseURL: 'http://localhost:3000/api/v1',// TODO: Change to https://www.searchapi.io/api/v1
21
22
method: 'GET',
22
23
url: '/search',
23
24
headers: {Accept: 'application/json'},
@@ -34,65 +35,40 @@ export class SearchApi implements INodeType {
34
35
},
35
36
],
36
37
properties: [
37
-
{
38
-
displayName: 'Engine (Engine)',
39
-
name: 'engine',
40
-
type: 'string',
41
-
default: 'google',
42
-
required: true,
43
-
44
-
description: 'Search engine to use for the query',
45
-
hint: 'Check https://www.searchapi.io/docs/google for the available engines',
46
-
routing: {
47
-
request: {
48
-
qs: {
49
-
engine: '={{ $value }}',
50
-
},
51
-
},
52
-
},
38
+
{
39
+
displayName: 'Resource',
40
+
name: 'resource',
41
+
type: 'options',
42
+
description: 'The search engine to use',
43
+
noDataExpression: true,
44
+
options: [
45
+
google.resource
46
+
],
47
+
default: '',
53
48
},
54
49
{
55
-
displayName: 'Parameters',
56
-
name: 'parameters',
57
-
type: 'fixedCollection',
58
-
typeOptions: {multipleValues: true},
59
-
default: {},
60
-
description: 'Add the parameters you want to use for the search, refer to the SearchAPI.io documentation for the available parameters for the selected engine',
50
+
displayName: 'Operation Name',
51
+
name: 'operation',
52
+
type: 'options',
53
+
noDataExpression: true,
61
54
options: [
62
55
{
63
-
displayName: 'Parameter',
64
-
name: 'parameter',
65
-
values: [
66
-
{
67
-
displayName: 'Name',
68
-
name: 'name',
69
-
type: 'string',
70
-
default: '',
71
-
placeholder: 'q',
72
-
},
73
-
{
74
-
displayName: 'Value',
75
-
name: 'value',
76
-
type: 'string',
77
-
default: '',
78
-
placeholder: 'pizza near me',
79
-
},
80
-
],
56
+
name: 'Search',
57
+
value: 'search',
58
+
action: 'Search the web',
59
+
description: 'Search using the engine specified in the resource',
60
+
routing: {
61
+
request: {
62
+
qs: {
63
+
engine: '={{ $parameter["resource"] }}'
64
+
}
65
+
}
66
+
}
81
67
},
82
68
],
83
-
/**
84
-
* Build an object like { hl: 'en', gl: 'us' } out of
85
-
* the collection entries and merge it into qs.
86
-
*/
87
-
routing: {
88
-
request: {
89
-
// We are doing this cast here because we need to
90
-
// build an object out of the collection entries
91
-
// and merge it into qs, but qs expects an object.
0 commit comments