File tree Expand file tree Collapse file tree 31 files changed +232
-42
lines changed Expand file tree Collapse file tree 31 files changed +232
-42
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,11 @@ function buildClearScroll (opts) {
78
78
79
79
var path = ''
80
80
81
- path = '/' + '_search' + '/' + 'scroll'
81
+ if ( ( scroll_id || scrollId ) != null ) {
82
+ path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent ( scroll_id || scrollId )
83
+ } else {
84
+ path = '/' + '_search' + '/' + 'scroll'
85
+ }
82
86
83
87
// build request object
84
88
const request = {
Original file line number Diff line number Diff line change @@ -94,6 +94,12 @@ function buildCount (opts) {
94
94
options = { }
95
95
}
96
96
97
+ // check required url components
98
+ if ( params [ 'type' ] != null && ( params [ 'index' ] == null ) ) {
99
+ const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
100
+ return handleError ( err , callback )
101
+ }
102
+
97
103
// validate headers object
98
104
if ( options . headers != null && typeof options . headers !== 'object' ) {
99
105
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -115,7 +121,9 @@ function buildCount (opts) {
115
121
116
122
var path = ''
117
123
118
- if ( ( index ) != null ) {
124
+ if ( ( index ) != null && ( type ) != null ) {
125
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_count'
126
+ } else if ( ( index ) != null ) {
119
127
path = '/' + encodeURIComponent ( index ) + '/' + '_count'
120
128
} else {
121
129
path = '/' + '_count'
Original file line number Diff line number Diff line change @@ -112,7 +112,11 @@ function buildCreate (opts) {
112
112
113
113
var path = ''
114
114
115
- path = '/' + encodeURIComponent ( index ) + '/' + '_create' + '/' + encodeURIComponent ( id )
115
+ if ( ( index ) != null && ( type ) != null && ( id ) != null ) {
116
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + encodeURIComponent ( id ) + '/' + '_create'
117
+ } else {
118
+ path = '/' + encodeURIComponent ( index ) + '/' + '_create' + '/' + encodeURIComponent ( id )
119
+ }
116
120
117
121
// build request object
118
122
const request = {
Original file line number Diff line number Diff line change @@ -94,12 +94,6 @@ function buildDelete (opts) {
94
94
return handleError ( err , callback )
95
95
}
96
96
97
- // check required url components
98
- if ( params [ 'id' ] != null && ( params [ 'index' ] == null ) ) {
99
- const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
100
- return handleError ( err , callback )
101
- }
102
-
103
97
// validate headers object
104
98
if ( options . headers != null && typeof options . headers !== 'object' ) {
105
99
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -121,7 +115,11 @@ function buildDelete (opts) {
121
115
122
116
var path = ''
123
117
124
- path = '/' + encodeURIComponent ( index ) + '/' + '_doc' + '/' + encodeURIComponent ( id )
118
+ if ( ( index ) != null && ( type ) != null && ( id ) != null ) {
119
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + encodeURIComponent ( id )
120
+ } else {
121
+ path = '/' + encodeURIComponent ( index ) + '/' + '_doc' + '/' + encodeURIComponent ( id )
122
+ }
125
123
126
124
// build request object
127
125
const request = {
Original file line number Diff line number Diff line change @@ -147,6 +147,12 @@ function buildDeleteByQuery (opts) {
147
147
return handleError ( err , callback )
148
148
}
149
149
150
+ // check required url components
151
+ if ( params [ 'type' ] != null && ( params [ 'index' ] == null ) ) {
152
+ const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
153
+ return handleError ( err , callback )
154
+ }
155
+
150
156
// validate headers object
151
157
if ( options . headers != null && typeof options . headers !== 'object' ) {
152
158
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -168,7 +174,11 @@ function buildDeleteByQuery (opts) {
168
174
169
175
var path = ''
170
176
171
- path = '/' + encodeURIComponent ( index ) + '/' + '_delete_by_query'
177
+ if ( ( index ) != null && ( type ) != null ) {
178
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_delete_by_query'
179
+ } else {
180
+ path = '/' + encodeURIComponent ( index ) + '/' + '_delete_by_query'
181
+ }
172
182
173
183
// build request object
174
184
const request = {
Original file line number Diff line number Diff line change @@ -119,7 +119,11 @@ function buildExists (opts) {
119
119
120
120
var path = ''
121
121
122
- path = '/' + encodeURIComponent ( index ) + '/' + '_doc' + '/' + encodeURIComponent ( id )
122
+ if ( ( index ) != null && ( type ) != null && ( id ) != null ) {
123
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + encodeURIComponent ( id )
124
+ } else {
125
+ path = '/' + encodeURIComponent ( index ) + '/' + '_doc' + '/' + encodeURIComponent ( id )
126
+ }
123
127
124
128
// build request object
125
129
const request = {
Original file line number Diff line number Diff line change @@ -96,7 +96,10 @@ function buildExistsSource (opts) {
96
96
}
97
97
98
98
// check required url components
99
- if ( params [ 'id' ] != null && ( params [ 'index' ] == null ) ) {
99
+ if ( params [ 'id' ] != null && ( params [ 'type' ] == null || params [ 'index' ] == null ) ) {
100
+ const err = new ConfigurationError ( 'Missing required parameter of the url: type, index' )
101
+ return handleError ( err , callback )
102
+ } else if ( params [ 'type' ] != null && ( params [ 'index' ] == null ) ) {
100
103
const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
101
104
return handleError ( err , callback )
102
105
}
@@ -122,7 +125,11 @@ function buildExistsSource (opts) {
122
125
123
126
var path = ''
124
127
125
- path = '/' + encodeURIComponent ( index ) + '/' + '_source' + '/' + encodeURIComponent ( id )
128
+ if ( ( index ) != null && ( type ) != null && ( id ) != null ) {
129
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + encodeURIComponent ( id ) + '/' + '_source'
130
+ } else {
131
+ path = '/' + encodeURIComponent ( index ) + '/' + '_source' + '/' + encodeURIComponent ( id )
132
+ }
126
133
127
134
// build request object
128
135
const request = {
Original file line number Diff line number Diff line change @@ -121,7 +121,11 @@ function buildExplain (opts) {
121
121
122
122
var path = ''
123
123
124
- path = '/' + encodeURIComponent ( index ) + '/' + '_explain' + '/' + encodeURIComponent ( id )
124
+ if ( ( index ) != null && ( type ) != null && ( id ) != null ) {
125
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + encodeURIComponent ( id ) + '/' + '_explain'
126
+ } else {
127
+ path = '/' + encodeURIComponent ( index ) + '/' + '_explain' + '/' + encodeURIComponent ( id )
128
+ }
125
129
126
130
// build request object
127
131
const request = {
Original file line number Diff line number Diff line change @@ -119,7 +119,11 @@ function buildGet (opts) {
119
119
120
120
var path = ''
121
121
122
- path = '/' + encodeURIComponent ( index ) + '/' + '_doc' + '/' + encodeURIComponent ( id )
122
+ if ( ( index ) != null && ( type ) != null && ( id ) != null ) {
123
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + encodeURIComponent ( id )
124
+ } else {
125
+ path = '/' + encodeURIComponent ( index ) + '/' + '_doc' + '/' + encodeURIComponent ( id )
126
+ }
123
127
124
128
// build request object
125
129
const request = {
Original file line number Diff line number Diff line change @@ -116,7 +116,11 @@ function buildGetSource (opts) {
116
116
117
117
var path = ''
118
118
119
- path = '/' + encodeURIComponent ( index ) + '/' + '_source' + '/' + encodeURIComponent ( id )
119
+ if ( ( index ) != null && ( type ) != null && ( id ) != null ) {
120
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + encodeURIComponent ( id ) + '/' + '_source'
121
+ } else {
122
+ path = '/' + encodeURIComponent ( index ) + '/' + '_source' + '/' + encodeURIComponent ( id )
123
+ }
120
124
121
125
// build request object
122
126
const request = {
Original file line number Diff line number Diff line change @@ -56,6 +56,12 @@ function buildGraphExplore (opts) {
56
56
options = { }
57
57
}
58
58
59
+ // check required url components
60
+ if ( params [ 'type' ] != null && ( params [ 'index' ] == null ) ) {
61
+ const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
62
+ return handleError ( err , callback )
63
+ }
64
+
59
65
// validate headers object
60
66
if ( options . headers != null && typeof options . headers !== 'object' ) {
61
67
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -77,7 +83,11 @@ function buildGraphExplore (opts) {
77
83
78
84
var path = ''
79
85
80
- path = '/' + encodeURIComponent ( index ) + '/' + '_graph' + '/' + 'explore'
86
+ if ( ( index ) != null && ( type ) != null ) {
87
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_graph' + '/' + 'explore'
88
+ } else {
89
+ path = '/' + encodeURIComponent ( index ) + '/' + '_graph' + '/' + 'explore'
90
+ }
81
91
82
92
// build request object
83
93
const request = {
Original file line number Diff line number Diff line change @@ -96,12 +96,6 @@ function buildIndex (opts) {
96
96
return handleError ( err , callback )
97
97
}
98
98
99
- // check required url components
100
- if ( params [ 'id' ] != null && ( params [ 'index' ] == null ) ) {
101
- const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
102
- return handleError ( err , callback )
103
- }
104
-
105
99
// validate headers object
106
100
if ( options . headers != null && typeof options . headers !== 'object' ) {
107
101
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -123,8 +117,12 @@ function buildIndex (opts) {
123
117
124
118
var path = ''
125
119
126
- if ( ( index ) != null && ( id ) != null ) {
120
+ if ( ( index ) != null && ( type ) != null && ( id ) != null ) {
121
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + encodeURIComponent ( id )
122
+ } else if ( ( index ) != null && ( id ) != null ) {
127
123
path = '/' + encodeURIComponent ( index ) + '/' + '_doc' + '/' + encodeURIComponent ( id )
124
+ } else if ( ( index ) != null && ( type ) != null ) {
125
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type )
128
126
} else {
129
127
path = '/' + encodeURIComponent ( index ) + '/' + '_doc'
130
128
}
Original file line number Diff line number Diff line change @@ -106,8 +106,12 @@ function buildIndicesGetFieldMapping (opts) {
106
106
107
107
var path = ''
108
108
109
- if ( ( index ) != null && ( fields ) != null ) {
109
+ if ( ( index ) != null && ( type ) != null && ( fields ) != null ) {
110
+ path = '/' + encodeURIComponent ( index ) + '/' + '_mapping' + '/' + encodeURIComponent ( type ) + '/' + 'field' + '/' + encodeURIComponent ( fields )
111
+ } else if ( ( index ) != null && ( fields ) != null ) {
110
112
path = '/' + encodeURIComponent ( index ) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent ( fields )
113
+ } else if ( ( type ) != null && ( fields ) != null ) {
114
+ path = '/' + '_mapping' + '/' + encodeURIComponent ( type ) + '/' + 'field' + '/' + encodeURIComponent ( fields )
111
115
} else {
112
116
path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent ( fields )
113
117
}
Original file line number Diff line number Diff line change @@ -101,8 +101,12 @@ function buildIndicesGetMapping (opts) {
101
101
102
102
var path = ''
103
103
104
- if ( ( index ) != null ) {
104
+ if ( ( index ) != null && ( type ) != null ) {
105
+ path = '/' + encodeURIComponent ( index ) + '/' + '_mapping' + '/' + encodeURIComponent ( type )
106
+ } else if ( ( index ) != null ) {
105
107
path = '/' + encodeURIComponent ( index ) + '/' + '_mapping'
108
+ } else if ( ( type ) != null ) {
109
+ path = '/' + '_mapping' + '/' + encodeURIComponent ( type )
106
110
} else {
107
111
path = '/' + '_mapping'
108
112
}
Original file line number Diff line number Diff line change @@ -102,7 +102,23 @@ function buildIndicesPutMapping (opts) {
102
102
103
103
var path = ''
104
104
105
- path = '/' + encodeURIComponent ( index ) + '/' + '_mapping'
105
+ if ( ( index ) != null && ( type ) != null ) {
106
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_mapping'
107
+ } else if ( ( index ) != null && ( type ) != null ) {
108
+ path = '/' + encodeURIComponent ( index ) + '/' + '_mapping' + '/' + encodeURIComponent ( type )
109
+ } else if ( ( index ) != null && ( type ) != null ) {
110
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_mappings'
111
+ } else if ( ( index ) != null && ( type ) != null ) {
112
+ path = '/' + encodeURIComponent ( index ) + '/' + '_mappings' + '/' + encodeURIComponent ( type )
113
+ } else if ( ( type ) != null ) {
114
+ path = '/' + '_mappings' + '/' + encodeURIComponent ( type )
115
+ } else if ( ( type ) != null ) {
116
+ path = '/' + '_mapping' + '/' + encodeURIComponent ( type )
117
+ } else if ( ( index ) != null ) {
118
+ path = '/' + encodeURIComponent ( index ) + '/' + '_mapping'
119
+ } else {
120
+ path = '/' + encodeURIComponent ( index ) + '/' + '_mappings'
121
+ }
106
122
107
123
// build request object
108
124
const request = {
Original file line number Diff line number Diff line change @@ -88,6 +88,12 @@ function buildIndicesValidateQuery (opts) {
88
88
options = { }
89
89
}
90
90
91
+ // check required url components
92
+ if ( params [ 'type' ] != null && ( params [ 'index' ] == null ) ) {
93
+ const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
94
+ return handleError ( err , callback )
95
+ }
96
+
91
97
// validate headers object
92
98
if ( options . headers != null && typeof options . headers !== 'object' ) {
93
99
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -109,7 +115,9 @@ function buildIndicesValidateQuery (opts) {
109
115
110
116
var path = ''
111
117
112
- if ( ( index ) != null ) {
118
+ if ( ( index ) != null && ( type ) != null ) {
119
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_validate' + '/' + 'query'
120
+ } else if ( ( index ) != null ) {
113
121
path = '/' + encodeURIComponent ( index ) + '/' + '_validate' + '/' + 'query'
114
122
} else {
115
123
path = '/' + '_validate' + '/' + 'query'
Original file line number Diff line number Diff line change @@ -83,6 +83,12 @@ function buildMget (opts) {
83
83
return handleError ( err , callback )
84
84
}
85
85
86
+ // check required url components
87
+ if ( params [ 'type' ] != null && ( params [ 'index' ] == null ) ) {
88
+ const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
89
+ return handleError ( err , callback )
90
+ }
91
+
86
92
// validate headers object
87
93
if ( options . headers != null && typeof options . headers !== 'object' ) {
88
94
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -104,7 +110,9 @@ function buildMget (opts) {
104
110
105
111
var path = ''
106
112
107
- if ( ( index ) != null ) {
113
+ if ( ( index ) != null && ( type ) != null ) {
114
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_mget'
115
+ } else if ( ( index ) != null ) {
108
116
path = '/' + encodeURIComponent ( index ) + '/' + '_mget'
109
117
} else {
110
118
path = '/' + '_mget'
Original file line number Diff line number Diff line change @@ -86,7 +86,11 @@ function buildMonitoringBulk (opts) {
86
86
87
87
var path = ''
88
88
89
- path = '/' + '_monitoring' + '/' + 'bulk'
89
+ if ( ( type ) != null ) {
90
+ path = '/' + '_monitoring' + '/' + encodeURIComponent ( type ) + '/' + 'bulk'
91
+ } else {
92
+ path = '/' + '_monitoring' + '/' + 'bulk'
93
+ }
90
94
91
95
// build request object
92
96
const request = {
Original file line number Diff line number Diff line change @@ -85,6 +85,12 @@ function buildMsearch (opts) {
85
85
return handleError ( err , callback )
86
86
}
87
87
88
+ // check required url components
89
+ if ( params [ 'type' ] != null && ( params [ 'index' ] == null ) ) {
90
+ const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
91
+ return handleError ( err , callback )
92
+ }
93
+
88
94
// validate headers object
89
95
if ( options . headers != null && typeof options . headers !== 'object' ) {
90
96
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -106,7 +112,9 @@ function buildMsearch (opts) {
106
112
107
113
var path = ''
108
114
109
- if ( ( index ) != null ) {
115
+ if ( ( index ) != null && ( type ) != null ) {
116
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_msearch'
117
+ } else if ( ( index ) != null ) {
110
118
path = '/' + encodeURIComponent ( index ) + '/' + '_msearch'
111
119
} else {
112
120
path = '/' + '_msearch'
Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ function buildMsearchTemplate (opts) {
79
79
return handleError ( err , callback )
80
80
}
81
81
82
+ // check required url components
83
+ if ( params [ 'type' ] != null && ( params [ 'index' ] == null ) ) {
84
+ const err = new ConfigurationError ( 'Missing required parameter of the url: index' )
85
+ return handleError ( err , callback )
86
+ }
87
+
82
88
// validate headers object
83
89
if ( options . headers != null && typeof options . headers !== 'object' ) {
84
90
const err = new ConfigurationError ( `Headers should be an object, instead got: ${ typeof options . headers } ` )
@@ -100,7 +106,9 @@ function buildMsearchTemplate (opts) {
100
106
101
107
var path = ''
102
108
103
- if ( ( index ) != null ) {
109
+ if ( ( index ) != null && ( type ) != null ) {
110
+ path = '/' + encodeURIComponent ( index ) + '/' + encodeURIComponent ( type ) + '/' + '_msearch' + '/' + 'template'
111
+ } else if ( ( index ) != null ) {
104
112
path = '/' + encodeURIComponent ( index ) + '/' + '_msearch' + '/' + 'template'
105
113
} else {
106
114
path = '/' + '_msearch' + '/' + 'template'
You can’t perform that action at this time.
0 commit comments