@elastic/elasticsearch 8.0.0-alpha.0 → 8.0.0
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 +13 -62
- package/free-report-junit.xml +13 -0
- package/index.d.ts +4 -3
- package/index.js +31 -3
- package/lib/api/api/async_search.js +28 -40
- package/lib/api/api/async_search.js.map +1 -1
- package/lib/api/api/autoscaling.js +13 -37
- package/lib/api/api/autoscaling.js.map +1 -1
- package/lib/api/api/bulk.d.ts +3 -3
- package/lib/api/api/bulk.js +6 -10
- package/lib/api/api/bulk.js.map +1 -1
- package/lib/api/api/cat.js +75 -275
- package/lib/api/api/cat.js.map +1 -1
- package/lib/api/api/ccr.js +79 -127
- package/lib/api/api/ccr.js.map +1 -1
- package/lib/api/api/clear_scroll.js +13 -7
- package/lib/api/api/clear_scroll.js.map +1 -1
- package/lib/api/api/close_point_in_time.js +13 -7
- package/lib/api/api/close_point_in_time.js.map +1 -1
- package/lib/api/api/cluster.js +85 -149
- package/lib/api/api/cluster.js.map +1 -1
- package/lib/api/api/count.js +13 -7
- package/lib/api/api/count.js.map +1 -1
- package/lib/api/api/create.js +5 -5
- package/lib/api/api/create.js.map +1 -1
- package/lib/api/api/dangling_indices.js +9 -33
- package/lib/api/api/dangling_indices.js.map +1 -1
- package/lib/api/api/delete.js +4 -12
- package/lib/api/api/delete.js.map +1 -1
- package/lib/api/api/delete_by_query.js +13 -7
- package/lib/api/api/delete_by_query.js.map +1 -1
- package/lib/api/api/delete_by_query_rethrottle.js +3 -11
- package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/delete_script.js +3 -11
- package/lib/api/api/delete_script.js.map +1 -1
- package/lib/api/api/enrich.js +25 -51
- package/lib/api/api/enrich.js.map +1 -1
- package/lib/api/api/eql.js +22 -40
- package/lib/api/api/eql.js.map +1 -1
- package/lib/api/api/exists.js +3 -11
- package/lib/api/api/exists.js.map +1 -1
- package/lib/api/api/exists_source.js +4 -12
- package/lib/api/api/exists_source.js.map +1 -1
- package/lib/api/api/explain.js +13 -7
- package/lib/api/api/explain.js.map +1 -1
- package/lib/api/api/features.js +6 -22
- package/lib/api/api/features.js.map +1 -1
- package/lib/api/api/field_caps.js +13 -7
- package/lib/api/api/field_caps.js.map +1 -1
- package/lib/api/api/fleet.d.ts +9 -3
- package/lib/api/api/fleet.js +64 -7
- package/lib/api/api/fleet.js.map +1 -1
- package/lib/api/api/get.js +3 -11
- package/lib/api/api/get.js.map +1 -1
- package/lib/api/api/get_script.js +3 -11
- package/lib/api/api/get_script.js.map +1 -1
- package/lib/api/api/get_script_context.js +3 -11
- package/lib/api/api/get_script_context.js.map +1 -1
- package/lib/api/api/get_script_languages.js +3 -11
- package/lib/api/api/get_script_languages.js.map +1 -1
- package/lib/api/api/get_source.js +3 -11
- package/lib/api/api/get_source.js.map +1 -1
- package/lib/api/api/graph.js +13 -7
- package/lib/api/api/graph.js.map +1 -1
- package/lib/api/api/ilm.d.ts +3 -3
- package/lib/api/api/ilm.js +73 -116
- package/lib/api/api/ilm.js.map +1 -1
- package/lib/api/api/index.js +4 -4
- package/lib/api/api/index.js.map +1 -1
- package/lib/api/api/indices.d.ts +9 -6
- package/lib/api/api/indices.js +320 -519
- package/lib/api/api/indices.js.map +1 -1
- package/lib/api/api/info.js +3 -11
- package/lib/api/api/info.js.map +1 -1
- package/lib/api/api/ingest.js +38 -58
- package/lib/api/api/ingest.js.map +1 -1
- package/lib/api/api/knn_search.d.ts +10 -0
- package/lib/api/api/knn_search.js +53 -0
- package/lib/api/api/knn_search.js.map +1 -0
- package/lib/api/api/license.d.ts +3 -3
- package/lib/api/api/license.js +31 -74
- package/lib/api/api/license.js.map +1 -1
- package/lib/api/api/logstash.js +10 -26
- package/lib/api/api/logstash.js.map +1 -1
- package/lib/api/api/mget.js +13 -7
- package/lib/api/api/mget.js.map +1 -1
- package/lib/api/api/migration.d.ts +6 -0
- package/lib/api/api/migration.js +39 -11
- package/lib/api/api/migration.js.map +1 -1
- package/lib/api/api/ml.d.ts +24 -24
- package/lib/api/api/ml.js +601 -626
- package/lib/api/api/ml.js.map +1 -1
- package/lib/api/api/monitoring.d.ts +3 -3
- package/lib/api/api/monitoring.js +4 -4
- package/lib/api/api/monitoring.js.map +1 -1
- package/lib/api/api/msearch.d.ts +3 -3
- package/lib/api/api/msearch.js +4 -4
- package/lib/api/api/msearch.js.map +1 -1
- package/lib/api/api/msearch_template.d.ts +3 -3
- package/lib/api/api/msearch_template.js +4 -4
- package/lib/api/api/msearch_template.js.map +1 -1
- package/lib/api/api/mtermvectors.js +13 -7
- package/lib/api/api/mtermvectors.js.map +1 -1
- package/lib/api/api/nodes.d.ts +6 -6
- package/lib/api/api/nodes.js +33 -71
- package/lib/api/api/nodes.js.map +1 -1
- package/lib/api/api/open_point_in_time.js +3 -11
- package/lib/api/api/open_point_in_time.js.map +1 -1
- package/lib/api/api/ping.js +3 -11
- package/lib/api/api/ping.js.map +1 -1
- package/lib/api/api/put_script.js +13 -7
- package/lib/api/api/put_script.js.map +1 -1
- package/lib/api/api/rank_eval.js +13 -7
- package/lib/api/api/rank_eval.js.map +1 -1
- package/lib/api/api/reindex.js +13 -7
- package/lib/api/api/reindex.js.map +1 -1
- package/lib/api/api/reindex_rethrottle.js +3 -11
- package/lib/api/api/reindex_rethrottle.js.map +1 -1
- package/lib/api/api/render_search_template.js +13 -7
- package/lib/api/api/render_search_template.js.map +1 -1
- package/lib/api/api/rollup.d.ts +3 -3
- package/lib/api/api/rollup.js +49 -85
- package/lib/api/api/rollup.js.map +1 -1
- package/lib/api/api/scripts_painless_execute.js +13 -7
- package/lib/api/api/scripts_painless_execute.js.map +1 -1
- package/lib/api/api/scroll.d.ts +3 -3
- package/lib/api/api/scroll.js +13 -7
- package/lib/api/api/scroll.js.map +1 -1
- package/lib/api/api/search.d.ts +3 -3
- package/lib/api/api/search.js +19 -7
- package/lib/api/api/search.js.map +1 -1
- package/lib/api/api/search_mvt.js +13 -7
- package/lib/api/api/search_mvt.js.map +1 -1
- package/lib/api/api/search_shards.js +3 -11
- package/lib/api/api/search_shards.js.map +1 -1
- package/lib/api/api/search_template.js +13 -7
- package/lib/api/api/search_template.js.map +1 -1
- package/lib/api/api/searchable_snapshots.d.ts +3 -3
- package/lib/api/api/searchable_snapshots.js +23 -38
- package/lib/api/api/searchable_snapshots.js.map +1 -1
- package/lib/api/api/security.d.ts +27 -27
- package/lib/api/api/security.js +311 -401
- package/lib/api/api/security.js.map +1 -1
- package/lib/api/api/shutdown.js +9 -33
- package/lib/api/api/shutdown.js.map +1 -1
- package/lib/api/api/slm.js +37 -95
- package/lib/api/api/slm.js.map +1 -1
- package/lib/api/api/snapshot.js +87 -125
- package/lib/api/api/snapshot.js.map +1 -1
- package/lib/api/api/sql.d.ts +9 -9
- package/lib/api/api/sql.js +51 -51
- package/lib/api/api/sql.js.map +1 -1
- package/lib/api/api/ssl.js +3 -11
- package/lib/api/api/ssl.js.map +1 -1
- package/lib/api/api/tasks.js +9 -33
- package/lib/api/api/tasks.js.map +1 -1
- package/lib/api/api/terms_enum.js +13 -7
- package/lib/api/api/terms_enum.js.map +1 -1
- package/lib/api/api/termvectors.js +13 -7
- package/lib/api/api/termvectors.js.map +1 -1
- package/lib/api/api/text_structure.js +4 -4
- package/lib/api/api/text_structure.js.map +1 -1
- package/lib/api/api/transform.d.ts +3 -0
- package/lib/api/api/transform.js +74 -78
- package/lib/api/api/transform.js.map +1 -1
- package/lib/api/api/update.js +14 -8
- package/lib/api/api/update.js.map +1 -1
- package/lib/api/api/update_by_query.js +13 -7
- package/lib/api/api/update_by_query.js.map +1 -1
- package/lib/api/api/update_by_query_rethrottle.js +3 -11
- package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/watcher.js +63 -109
- package/lib/api/api/watcher.js.map +1 -1
- package/lib/api/api/xpack.js +6 -22
- package/lib/api/api/xpack.js.map +1 -1
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +2 -0
- package/lib/api/index.js.map +1 -1
- package/lib/api/types.d.ts +2945 -1413
- package/lib/api/typesWithBodyKey.d.ts +3076 -1437
- package/lib/{Client.d.ts → client.d.ts} +3 -4
- package/lib/{Client.js → client.js} +11 -6
- package/lib/{Client.js.map → client.js.map} +1 -1
- package/lib/{Helpers.d.ts → helpers.d.ts} +2 -2
- package/lib/{Helpers.js → helpers.js} +2 -4
- package/lib/helpers.js.map +1 -0
- package/lib/{SniffingTransport.d.ts → sniffingTransport.d.ts} +0 -0
- package/lib/{SniffingTransport.js → sniffingTransport.js} +1 -1
- package/lib/{SniffingTransport.js.map → sniffingTransport.js.map} +1 -1
- package/package.json +3 -3
- package/platinum-report-junit.xml +13 -0
- package/tsconfig.json +1 -1
- package/lib/Helpers.js.map +0 -1
package/lib/api/api/indices.js
CHANGED
|
@@ -29,24 +29,16 @@ class Indices {
|
|
|
29
29
|
this.transport = transport;
|
|
30
30
|
}
|
|
31
31
|
async addBlock(params, options) {
|
|
32
|
-
var _a;
|
|
33
32
|
const acceptedPath = ['index', 'block'];
|
|
34
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'master_timeout', 'timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
35
33
|
const querystring = {};
|
|
36
|
-
|
|
37
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
34
|
+
const body = undefined;
|
|
38
35
|
for (const key in params) {
|
|
39
|
-
if (
|
|
40
|
-
// @ts-expect-error
|
|
41
|
-
querystring[key] = params[key];
|
|
42
|
-
}
|
|
43
|
-
else if (acceptedPath.includes(key)) {
|
|
36
|
+
if (acceptedPath.includes(key)) {
|
|
44
37
|
continue;
|
|
45
38
|
}
|
|
46
39
|
else if (key !== 'body') {
|
|
47
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
48
40
|
// @ts-expect-error
|
|
49
|
-
|
|
41
|
+
querystring[key] = params[key];
|
|
50
42
|
}
|
|
51
43
|
}
|
|
52
44
|
const method = 'PUT';
|
|
@@ -54,25 +46,31 @@ class Indices {
|
|
|
54
46
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
55
47
|
}
|
|
56
48
|
async analyze(params, options) {
|
|
57
|
-
var _a;
|
|
58
49
|
const acceptedPath = ['index'];
|
|
59
|
-
const
|
|
50
|
+
const acceptedBody = ['analyzer', 'attributes', 'char_filter', 'explain', 'field', 'filter', 'normalizer', 'text', 'tokenizer'];
|
|
60
51
|
const querystring = {};
|
|
61
52
|
// @ts-expect-error
|
|
62
|
-
|
|
53
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
54
|
+
let body;
|
|
55
|
+
if (typeof userBody === 'string') {
|
|
56
|
+
body = userBody;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
60
|
+
}
|
|
63
61
|
params = params !== null && params !== void 0 ? params : {};
|
|
64
62
|
for (const key in params) {
|
|
65
|
-
if (
|
|
63
|
+
if (acceptedBody.includes(key)) {
|
|
64
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
66
65
|
// @ts-expect-error
|
|
67
|
-
|
|
66
|
+
body[key] = params[key];
|
|
68
67
|
}
|
|
69
68
|
else if (acceptedPath.includes(key)) {
|
|
70
69
|
continue;
|
|
71
70
|
}
|
|
72
71
|
else if (key !== 'body') {
|
|
73
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
74
72
|
// @ts-expect-error
|
|
75
|
-
|
|
73
|
+
querystring[key] = params[key];
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
76
|
let method = '';
|
|
@@ -88,25 +86,17 @@ class Indices {
|
|
|
88
86
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
89
87
|
}
|
|
90
88
|
async clearCache(params, options) {
|
|
91
|
-
var _a;
|
|
92
89
|
const acceptedPath = ['index'];
|
|
93
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'fielddata', 'fields', 'ignore_unavailable', 'query', 'request', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
94
90
|
const querystring = {};
|
|
95
|
-
|
|
96
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
91
|
+
const body = undefined;
|
|
97
92
|
params = params !== null && params !== void 0 ? params : {};
|
|
98
93
|
for (const key in params) {
|
|
99
|
-
if (
|
|
100
|
-
// @ts-expect-error
|
|
101
|
-
querystring[key] = params[key];
|
|
102
|
-
}
|
|
103
|
-
else if (acceptedPath.includes(key)) {
|
|
94
|
+
if (acceptedPath.includes(key)) {
|
|
104
95
|
continue;
|
|
105
96
|
}
|
|
106
97
|
else if (key !== 'body') {
|
|
107
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
108
98
|
// @ts-expect-error
|
|
109
|
-
|
|
99
|
+
querystring[key] = params[key];
|
|
110
100
|
}
|
|
111
101
|
}
|
|
112
102
|
let method = '';
|
|
@@ -122,24 +112,30 @@ class Indices {
|
|
|
122
112
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
123
113
|
}
|
|
124
114
|
async clone(params, options) {
|
|
125
|
-
var _a;
|
|
126
115
|
const acceptedPath = ['index', 'target'];
|
|
127
|
-
const
|
|
116
|
+
const acceptedBody = ['aliases', 'settings'];
|
|
128
117
|
const querystring = {};
|
|
129
118
|
// @ts-expect-error
|
|
130
|
-
|
|
119
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
120
|
+
let body;
|
|
121
|
+
if (typeof userBody === 'string') {
|
|
122
|
+
body = userBody;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
126
|
+
}
|
|
131
127
|
for (const key in params) {
|
|
132
|
-
if (
|
|
128
|
+
if (acceptedBody.includes(key)) {
|
|
129
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
133
130
|
// @ts-expect-error
|
|
134
|
-
|
|
131
|
+
body[key] = params[key];
|
|
135
132
|
}
|
|
136
133
|
else if (acceptedPath.includes(key)) {
|
|
137
134
|
continue;
|
|
138
135
|
}
|
|
139
136
|
else if (key !== 'body') {
|
|
140
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
141
137
|
// @ts-expect-error
|
|
142
|
-
|
|
138
|
+
querystring[key] = params[key];
|
|
143
139
|
}
|
|
144
140
|
}
|
|
145
141
|
const method = 'PUT';
|
|
@@ -147,24 +143,16 @@ class Indices {
|
|
|
147
143
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
148
144
|
}
|
|
149
145
|
async close(params, options) {
|
|
150
|
-
var _a;
|
|
151
146
|
const acceptedPath = ['index'];
|
|
152
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'master_timeout', 'timeout', 'wait_for_active_shards', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
153
147
|
const querystring = {};
|
|
154
|
-
|
|
155
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
148
|
+
const body = undefined;
|
|
156
149
|
for (const key in params) {
|
|
157
|
-
if (
|
|
158
|
-
// @ts-expect-error
|
|
159
|
-
querystring[key] = params[key];
|
|
160
|
-
}
|
|
161
|
-
else if (acceptedPath.includes(key)) {
|
|
150
|
+
if (acceptedPath.includes(key)) {
|
|
162
151
|
continue;
|
|
163
152
|
}
|
|
164
153
|
else if (key !== 'body') {
|
|
165
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
166
154
|
// @ts-expect-error
|
|
167
|
-
|
|
155
|
+
querystring[key] = params[key];
|
|
168
156
|
}
|
|
169
157
|
}
|
|
170
158
|
const method = 'POST';
|
|
@@ -172,24 +160,30 @@ class Indices {
|
|
|
172
160
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
173
161
|
}
|
|
174
162
|
async create(params, options) {
|
|
175
|
-
var _a;
|
|
176
163
|
const acceptedPath = ['index'];
|
|
177
|
-
const
|
|
164
|
+
const acceptedBody = ['aliases', 'mappings', 'settings'];
|
|
178
165
|
const querystring = {};
|
|
179
166
|
// @ts-expect-error
|
|
180
|
-
|
|
167
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
168
|
+
let body;
|
|
169
|
+
if (typeof userBody === 'string') {
|
|
170
|
+
body = userBody;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
174
|
+
}
|
|
181
175
|
for (const key in params) {
|
|
182
|
-
if (
|
|
176
|
+
if (acceptedBody.includes(key)) {
|
|
177
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
183
178
|
// @ts-expect-error
|
|
184
|
-
|
|
179
|
+
body[key] = params[key];
|
|
185
180
|
}
|
|
186
181
|
else if (acceptedPath.includes(key)) {
|
|
187
182
|
continue;
|
|
188
183
|
}
|
|
189
184
|
else if (key !== 'body') {
|
|
190
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
191
185
|
// @ts-expect-error
|
|
192
|
-
|
|
186
|
+
querystring[key] = params[key];
|
|
193
187
|
}
|
|
194
188
|
}
|
|
195
189
|
const method = 'PUT';
|
|
@@ -197,24 +191,16 @@ class Indices {
|
|
|
197
191
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
198
192
|
}
|
|
199
193
|
async createDataStream(params, options) {
|
|
200
|
-
var _a;
|
|
201
194
|
const acceptedPath = ['name'];
|
|
202
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
203
195
|
const querystring = {};
|
|
204
|
-
|
|
205
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
196
|
+
const body = undefined;
|
|
206
197
|
for (const key in params) {
|
|
207
|
-
if (
|
|
208
|
-
// @ts-expect-error
|
|
209
|
-
querystring[key] = params[key];
|
|
210
|
-
}
|
|
211
|
-
else if (acceptedPath.includes(key)) {
|
|
198
|
+
if (acceptedPath.includes(key)) {
|
|
212
199
|
continue;
|
|
213
200
|
}
|
|
214
201
|
else if (key !== 'body') {
|
|
215
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
216
202
|
// @ts-expect-error
|
|
217
|
-
|
|
203
|
+
querystring[key] = params[key];
|
|
218
204
|
}
|
|
219
205
|
}
|
|
220
206
|
const method = 'PUT';
|
|
@@ -222,25 +208,17 @@ class Indices {
|
|
|
222
208
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
223
209
|
}
|
|
224
210
|
async dataStreamsStats(params, options) {
|
|
225
|
-
var _a;
|
|
226
211
|
const acceptedPath = ['name'];
|
|
227
|
-
const acceptedQuery = ['expand_wildcards', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
228
212
|
const querystring = {};
|
|
229
|
-
|
|
230
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
213
|
+
const body = undefined;
|
|
231
214
|
params = params !== null && params !== void 0 ? params : {};
|
|
232
215
|
for (const key in params) {
|
|
233
|
-
if (
|
|
234
|
-
// @ts-expect-error
|
|
235
|
-
querystring[key] = params[key];
|
|
236
|
-
}
|
|
237
|
-
else if (acceptedPath.includes(key)) {
|
|
216
|
+
if (acceptedPath.includes(key)) {
|
|
238
217
|
continue;
|
|
239
218
|
}
|
|
240
219
|
else if (key !== 'body') {
|
|
241
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
242
220
|
// @ts-expect-error
|
|
243
|
-
|
|
221
|
+
querystring[key] = params[key];
|
|
244
222
|
}
|
|
245
223
|
}
|
|
246
224
|
let method = '';
|
|
@@ -256,24 +234,16 @@ class Indices {
|
|
|
256
234
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
257
235
|
}
|
|
258
236
|
async delete(params, options) {
|
|
259
|
-
var _a;
|
|
260
237
|
const acceptedPath = ['index'];
|
|
261
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'master_timeout', 'timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
262
238
|
const querystring = {};
|
|
263
|
-
|
|
264
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
239
|
+
const body = undefined;
|
|
265
240
|
for (const key in params) {
|
|
266
|
-
if (
|
|
267
|
-
// @ts-expect-error
|
|
268
|
-
querystring[key] = params[key];
|
|
269
|
-
}
|
|
270
|
-
else if (acceptedPath.includes(key)) {
|
|
241
|
+
if (acceptedPath.includes(key)) {
|
|
271
242
|
continue;
|
|
272
243
|
}
|
|
273
244
|
else if (key !== 'body') {
|
|
274
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
275
245
|
// @ts-expect-error
|
|
276
|
-
|
|
246
|
+
querystring[key] = params[key];
|
|
277
247
|
}
|
|
278
248
|
}
|
|
279
249
|
const method = 'DELETE';
|
|
@@ -281,24 +251,16 @@ class Indices {
|
|
|
281
251
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
282
252
|
}
|
|
283
253
|
async deleteAlias(params, options) {
|
|
284
|
-
var _a;
|
|
285
254
|
const acceptedPath = ['index', 'name'];
|
|
286
|
-
const acceptedQuery = ['master_timeout', 'timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
287
255
|
const querystring = {};
|
|
288
|
-
|
|
289
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
256
|
+
const body = undefined;
|
|
290
257
|
for (const key in params) {
|
|
291
|
-
if (
|
|
292
|
-
// @ts-expect-error
|
|
293
|
-
querystring[key] = params[key];
|
|
294
|
-
}
|
|
295
|
-
else if (acceptedPath.includes(key)) {
|
|
258
|
+
if (acceptedPath.includes(key)) {
|
|
296
259
|
continue;
|
|
297
260
|
}
|
|
298
261
|
else if (key !== 'body') {
|
|
299
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
300
262
|
// @ts-expect-error
|
|
301
|
-
|
|
263
|
+
querystring[key] = params[key];
|
|
302
264
|
}
|
|
303
265
|
}
|
|
304
266
|
let method = '';
|
|
@@ -314,24 +276,16 @@ class Indices {
|
|
|
314
276
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
315
277
|
}
|
|
316
278
|
async deleteDataStream(params, options) {
|
|
317
|
-
var _a;
|
|
318
279
|
const acceptedPath = ['name'];
|
|
319
|
-
const acceptedQuery = ['expand_wildcards', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
320
280
|
const querystring = {};
|
|
321
|
-
|
|
322
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
281
|
+
const body = undefined;
|
|
323
282
|
for (const key in params) {
|
|
324
|
-
if (
|
|
325
|
-
// @ts-expect-error
|
|
326
|
-
querystring[key] = params[key];
|
|
327
|
-
}
|
|
328
|
-
else if (acceptedPath.includes(key)) {
|
|
283
|
+
if (acceptedPath.includes(key)) {
|
|
329
284
|
continue;
|
|
330
285
|
}
|
|
331
286
|
else if (key !== 'body') {
|
|
332
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
333
287
|
// @ts-expect-error
|
|
334
|
-
|
|
288
|
+
querystring[key] = params[key];
|
|
335
289
|
}
|
|
336
290
|
}
|
|
337
291
|
const method = 'DELETE';
|
|
@@ -339,24 +293,16 @@ class Indices {
|
|
|
339
293
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
340
294
|
}
|
|
341
295
|
async deleteIndexTemplate(params, options) {
|
|
342
|
-
var _a;
|
|
343
296
|
const acceptedPath = ['name'];
|
|
344
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
345
297
|
const querystring = {};
|
|
346
|
-
|
|
347
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
298
|
+
const body = undefined;
|
|
348
299
|
for (const key in params) {
|
|
349
|
-
if (
|
|
350
|
-
// @ts-expect-error
|
|
351
|
-
querystring[key] = params[key];
|
|
352
|
-
}
|
|
353
|
-
else if (acceptedPath.includes(key)) {
|
|
300
|
+
if (acceptedPath.includes(key)) {
|
|
354
301
|
continue;
|
|
355
302
|
}
|
|
356
303
|
else if (key !== 'body') {
|
|
357
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
358
304
|
// @ts-expect-error
|
|
359
|
-
|
|
305
|
+
querystring[key] = params[key];
|
|
360
306
|
}
|
|
361
307
|
}
|
|
362
308
|
const method = 'DELETE';
|
|
@@ -364,24 +310,16 @@ class Indices {
|
|
|
364
310
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
365
311
|
}
|
|
366
312
|
async deleteTemplate(params, options) {
|
|
367
|
-
var _a;
|
|
368
313
|
const acceptedPath = ['name'];
|
|
369
|
-
const acceptedQuery = ['master_timeout', 'timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
370
314
|
const querystring = {};
|
|
371
|
-
|
|
372
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
315
|
+
const body = undefined;
|
|
373
316
|
for (const key in params) {
|
|
374
|
-
if (
|
|
375
|
-
// @ts-expect-error
|
|
376
|
-
querystring[key] = params[key];
|
|
377
|
-
}
|
|
378
|
-
else if (acceptedPath.includes(key)) {
|
|
317
|
+
if (acceptedPath.includes(key)) {
|
|
379
318
|
continue;
|
|
380
319
|
}
|
|
381
320
|
else if (key !== 'body') {
|
|
382
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
383
321
|
// @ts-expect-error
|
|
384
|
-
|
|
322
|
+
querystring[key] = params[key];
|
|
385
323
|
}
|
|
386
324
|
}
|
|
387
325
|
const method = 'DELETE';
|
|
@@ -389,24 +327,16 @@ class Indices {
|
|
|
389
327
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
390
328
|
}
|
|
391
329
|
async diskUsage(params, options) {
|
|
392
|
-
var _a;
|
|
393
330
|
const acceptedPath = ['index'];
|
|
394
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'flush', 'ignore_unavailable', 'master_timeout', 'timeout', 'run_expensive_tasks', 'wait_for_active_shards', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
395
331
|
const querystring = {};
|
|
396
|
-
|
|
397
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
332
|
+
const body = undefined;
|
|
398
333
|
for (const key in params) {
|
|
399
|
-
if (
|
|
400
|
-
// @ts-expect-error
|
|
401
|
-
querystring[key] = params[key];
|
|
402
|
-
}
|
|
403
|
-
else if (acceptedPath.includes(key)) {
|
|
334
|
+
if (acceptedPath.includes(key)) {
|
|
404
335
|
continue;
|
|
405
336
|
}
|
|
406
337
|
else if (key !== 'body') {
|
|
407
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
408
338
|
// @ts-expect-error
|
|
409
|
-
|
|
339
|
+
querystring[key] = params[key];
|
|
410
340
|
}
|
|
411
341
|
}
|
|
412
342
|
const method = 'POST';
|
|
@@ -414,24 +344,16 @@ class Indices {
|
|
|
414
344
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
415
345
|
}
|
|
416
346
|
async exists(params, options) {
|
|
417
|
-
var _a;
|
|
418
347
|
const acceptedPath = ['index'];
|
|
419
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'flat_settings', 'ignore_unavailable', 'include_defaults', 'local', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
420
348
|
const querystring = {};
|
|
421
|
-
|
|
422
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
349
|
+
const body = undefined;
|
|
423
350
|
for (const key in params) {
|
|
424
|
-
if (
|
|
425
|
-
// @ts-expect-error
|
|
426
|
-
querystring[key] = params[key];
|
|
427
|
-
}
|
|
428
|
-
else if (acceptedPath.includes(key)) {
|
|
351
|
+
if (acceptedPath.includes(key)) {
|
|
429
352
|
continue;
|
|
430
353
|
}
|
|
431
354
|
else if (key !== 'body') {
|
|
432
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
433
355
|
// @ts-expect-error
|
|
434
|
-
|
|
356
|
+
querystring[key] = params[key];
|
|
435
357
|
}
|
|
436
358
|
}
|
|
437
359
|
const method = 'HEAD';
|
|
@@ -439,24 +361,16 @@ class Indices {
|
|
|
439
361
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
440
362
|
}
|
|
441
363
|
async existsAlias(params, options) {
|
|
442
|
-
var _a;
|
|
443
364
|
const acceptedPath = ['name', 'index'];
|
|
444
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'local', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
445
365
|
const querystring = {};
|
|
446
|
-
|
|
447
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
366
|
+
const body = undefined;
|
|
448
367
|
for (const key in params) {
|
|
449
|
-
if (
|
|
450
|
-
// @ts-expect-error
|
|
451
|
-
querystring[key] = params[key];
|
|
452
|
-
}
|
|
453
|
-
else if (acceptedPath.includes(key)) {
|
|
368
|
+
if (acceptedPath.includes(key)) {
|
|
454
369
|
continue;
|
|
455
370
|
}
|
|
456
371
|
else if (key !== 'body') {
|
|
457
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
458
372
|
// @ts-expect-error
|
|
459
|
-
|
|
373
|
+
querystring[key] = params[key];
|
|
460
374
|
}
|
|
461
375
|
}
|
|
462
376
|
let method = '';
|
|
@@ -472,24 +386,16 @@ class Indices {
|
|
|
472
386
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
473
387
|
}
|
|
474
388
|
async existsIndexTemplate(params, options) {
|
|
475
|
-
var _a;
|
|
476
389
|
const acceptedPath = ['name'];
|
|
477
|
-
const acceptedQuery = ['master_timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
478
390
|
const querystring = {};
|
|
479
|
-
|
|
480
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
391
|
+
const body = undefined;
|
|
481
392
|
for (const key in params) {
|
|
482
|
-
if (
|
|
483
|
-
// @ts-expect-error
|
|
484
|
-
querystring[key] = params[key];
|
|
485
|
-
}
|
|
486
|
-
else if (acceptedPath.includes(key)) {
|
|
393
|
+
if (acceptedPath.includes(key)) {
|
|
487
394
|
continue;
|
|
488
395
|
}
|
|
489
396
|
else if (key !== 'body') {
|
|
490
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
491
397
|
// @ts-expect-error
|
|
492
|
-
|
|
398
|
+
querystring[key] = params[key];
|
|
493
399
|
}
|
|
494
400
|
}
|
|
495
401
|
const method = 'HEAD';
|
|
@@ -497,72 +403,33 @@ class Indices {
|
|
|
497
403
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
498
404
|
}
|
|
499
405
|
async existsTemplate(params, options) {
|
|
500
|
-
var _a;
|
|
501
406
|
const acceptedPath = ['name'];
|
|
502
|
-
const acceptedQuery = ['flat_settings', 'local', 'master_timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
503
407
|
const querystring = {};
|
|
504
|
-
|
|
505
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
408
|
+
const body = undefined;
|
|
506
409
|
for (const key in params) {
|
|
507
|
-
if (
|
|
508
|
-
// @ts-expect-error
|
|
509
|
-
querystring[key] = params[key];
|
|
510
|
-
}
|
|
511
|
-
else if (acceptedPath.includes(key)) {
|
|
410
|
+
if (acceptedPath.includes(key)) {
|
|
512
411
|
continue;
|
|
513
412
|
}
|
|
514
413
|
else if (key !== 'body') {
|
|
515
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
516
|
-
// @ts-expect-error
|
|
517
|
-
body[key] = params[key];
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
const method = 'HEAD';
|
|
521
|
-
const path = `/_template/${encodeURIComponent(params.name.toString())}`;
|
|
522
|
-
return await this.transport.request({ path, method, querystring, body }, options);
|
|
523
|
-
}
|
|
524
|
-
async existsType(params, options) {
|
|
525
|
-
var _a;
|
|
526
|
-
const acceptedPath = ['index', 'type'];
|
|
527
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'local', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
528
|
-
const querystring = {};
|
|
529
|
-
// @ts-expect-error
|
|
530
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
531
|
-
for (const key in params) {
|
|
532
|
-
if (acceptedQuery.includes(key)) {
|
|
533
414
|
// @ts-expect-error
|
|
534
415
|
querystring[key] = params[key];
|
|
535
416
|
}
|
|
536
|
-
else if (acceptedPath.includes(key)) {
|
|
537
|
-
continue;
|
|
538
|
-
}
|
|
539
|
-
else if (key !== 'body') {
|
|
540
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
541
|
-
// @ts-expect-error
|
|
542
|
-
body[key] = params[key];
|
|
543
|
-
}
|
|
544
417
|
}
|
|
545
418
|
const method = 'HEAD';
|
|
546
|
-
const path =
|
|
419
|
+
const path = `/_template/${encodeURIComponent(params.name.toString())}`;
|
|
547
420
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
548
421
|
}
|
|
549
422
|
async fieldUsageStats(params, options) {
|
|
550
|
-
var _a;
|
|
551
423
|
const acceptedPath = ['index'];
|
|
552
|
-
const acceptedQuery = ['fields', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards'];
|
|
553
424
|
const querystring = {};
|
|
554
|
-
|
|
555
|
-
params = params !== null && params !== void 0 ? params : {};
|
|
425
|
+
const body = undefined;
|
|
556
426
|
for (const key in params) {
|
|
557
|
-
if (
|
|
558
|
-
querystring[key] = params[key];
|
|
559
|
-
}
|
|
560
|
-
else if (acceptedPath.includes(key)) {
|
|
427
|
+
if (acceptedPath.includes(key)) {
|
|
561
428
|
continue;
|
|
562
429
|
}
|
|
563
430
|
else if (key !== 'body') {
|
|
564
|
-
|
|
565
|
-
|
|
431
|
+
// @ts-expect-error
|
|
432
|
+
querystring[key] = params[key];
|
|
566
433
|
}
|
|
567
434
|
}
|
|
568
435
|
const method = 'GET';
|
|
@@ -570,25 +437,17 @@ class Indices {
|
|
|
570
437
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
571
438
|
}
|
|
572
439
|
async flush(params, options) {
|
|
573
|
-
var _a;
|
|
574
440
|
const acceptedPath = ['index'];
|
|
575
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'force', 'ignore_unavailable', 'wait_if_ongoing', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
576
441
|
const querystring = {};
|
|
577
|
-
|
|
578
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
442
|
+
const body = undefined;
|
|
579
443
|
params = params !== null && params !== void 0 ? params : {};
|
|
580
444
|
for (const key in params) {
|
|
581
|
-
if (
|
|
582
|
-
// @ts-expect-error
|
|
583
|
-
querystring[key] = params[key];
|
|
584
|
-
}
|
|
585
|
-
else if (acceptedPath.includes(key)) {
|
|
445
|
+
if (acceptedPath.includes(key)) {
|
|
586
446
|
continue;
|
|
587
447
|
}
|
|
588
448
|
else if (key !== 'body') {
|
|
589
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
590
449
|
// @ts-expect-error
|
|
591
|
-
|
|
450
|
+
querystring[key] = params[key];
|
|
592
451
|
}
|
|
593
452
|
}
|
|
594
453
|
let method = '';
|
|
@@ -604,25 +463,17 @@ class Indices {
|
|
|
604
463
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
605
464
|
}
|
|
606
465
|
async forcemerge(params, options) {
|
|
607
|
-
var _a;
|
|
608
466
|
const acceptedPath = ['index'];
|
|
609
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'flush', 'ignore_unavailable', 'max_num_segments', 'only_expunge_deletes', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
610
467
|
const querystring = {};
|
|
611
|
-
|
|
612
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
468
|
+
const body = undefined;
|
|
613
469
|
params = params !== null && params !== void 0 ? params : {};
|
|
614
470
|
for (const key in params) {
|
|
615
|
-
if (
|
|
616
|
-
// @ts-expect-error
|
|
617
|
-
querystring[key] = params[key];
|
|
618
|
-
}
|
|
619
|
-
else if (acceptedPath.includes(key)) {
|
|
471
|
+
if (acceptedPath.includes(key)) {
|
|
620
472
|
continue;
|
|
621
473
|
}
|
|
622
474
|
else if (key !== 'body') {
|
|
623
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
624
475
|
// @ts-expect-error
|
|
625
|
-
|
|
476
|
+
querystring[key] = params[key];
|
|
626
477
|
}
|
|
627
478
|
}
|
|
628
479
|
let method = '';
|
|
@@ -638,24 +489,16 @@ class Indices {
|
|
|
638
489
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
639
490
|
}
|
|
640
491
|
async get(params, options) {
|
|
641
|
-
var _a;
|
|
642
492
|
const acceptedPath = ['index'];
|
|
643
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'flat_settings', 'ignore_unavailable', 'include_defaults', 'include_type_name', 'local', 'master_timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
644
493
|
const querystring = {};
|
|
645
|
-
|
|
646
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
494
|
+
const body = undefined;
|
|
647
495
|
for (const key in params) {
|
|
648
|
-
if (
|
|
649
|
-
// @ts-expect-error
|
|
650
|
-
querystring[key] = params[key];
|
|
651
|
-
}
|
|
652
|
-
else if (acceptedPath.includes(key)) {
|
|
496
|
+
if (acceptedPath.includes(key)) {
|
|
653
497
|
continue;
|
|
654
498
|
}
|
|
655
499
|
else if (key !== 'body') {
|
|
656
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
657
500
|
// @ts-expect-error
|
|
658
|
-
|
|
501
|
+
querystring[key] = params[key];
|
|
659
502
|
}
|
|
660
503
|
}
|
|
661
504
|
const method = 'GET';
|
|
@@ -663,25 +506,17 @@ class Indices {
|
|
|
663
506
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
664
507
|
}
|
|
665
508
|
async getAlias(params, options) {
|
|
666
|
-
var _a;
|
|
667
509
|
const acceptedPath = ['name', 'index'];
|
|
668
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'local', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
669
510
|
const querystring = {};
|
|
670
|
-
|
|
671
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
511
|
+
const body = undefined;
|
|
672
512
|
params = params !== null && params !== void 0 ? params : {};
|
|
673
513
|
for (const key in params) {
|
|
674
|
-
if (
|
|
675
|
-
// @ts-expect-error
|
|
676
|
-
querystring[key] = params[key];
|
|
677
|
-
}
|
|
678
|
-
else if (acceptedPath.includes(key)) {
|
|
514
|
+
if (acceptedPath.includes(key)) {
|
|
679
515
|
continue;
|
|
680
516
|
}
|
|
681
517
|
else if (key !== 'body') {
|
|
682
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
683
518
|
// @ts-expect-error
|
|
684
|
-
|
|
519
|
+
querystring[key] = params[key];
|
|
685
520
|
}
|
|
686
521
|
}
|
|
687
522
|
let method = '';
|
|
@@ -705,25 +540,17 @@ class Indices {
|
|
|
705
540
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
706
541
|
}
|
|
707
542
|
async getDataStream(params, options) {
|
|
708
|
-
var _a;
|
|
709
543
|
const acceptedPath = ['name'];
|
|
710
|
-
const acceptedQuery = ['expand_wildcards', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
711
544
|
const querystring = {};
|
|
712
|
-
|
|
713
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
545
|
+
const body = undefined;
|
|
714
546
|
params = params !== null && params !== void 0 ? params : {};
|
|
715
547
|
for (const key in params) {
|
|
716
|
-
if (
|
|
717
|
-
// @ts-expect-error
|
|
718
|
-
querystring[key] = params[key];
|
|
719
|
-
}
|
|
720
|
-
else if (acceptedPath.includes(key)) {
|
|
548
|
+
if (acceptedPath.includes(key)) {
|
|
721
549
|
continue;
|
|
722
550
|
}
|
|
723
551
|
else if (key !== 'body') {
|
|
724
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
725
552
|
// @ts-expect-error
|
|
726
|
-
|
|
553
|
+
querystring[key] = params[key];
|
|
727
554
|
}
|
|
728
555
|
}
|
|
729
556
|
let method = '';
|
|
@@ -739,24 +566,16 @@ class Indices {
|
|
|
739
566
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
740
567
|
}
|
|
741
568
|
async getFieldMapping(params, options) {
|
|
742
|
-
var _a;
|
|
743
569
|
const acceptedPath = ['fields', 'index'];
|
|
744
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'include_defaults', 'include_type_name', 'local', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
745
570
|
const querystring = {};
|
|
746
|
-
|
|
747
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
571
|
+
const body = undefined;
|
|
748
572
|
for (const key in params) {
|
|
749
|
-
if (
|
|
750
|
-
// @ts-expect-error
|
|
751
|
-
querystring[key] = params[key];
|
|
752
|
-
}
|
|
753
|
-
else if (acceptedPath.includes(key)) {
|
|
573
|
+
if (acceptedPath.includes(key)) {
|
|
754
574
|
continue;
|
|
755
575
|
}
|
|
756
576
|
else if (key !== 'body') {
|
|
757
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
758
577
|
// @ts-expect-error
|
|
759
|
-
|
|
578
|
+
querystring[key] = params[key];
|
|
760
579
|
}
|
|
761
580
|
}
|
|
762
581
|
let method = '';
|
|
@@ -772,25 +591,17 @@ class Indices {
|
|
|
772
591
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
773
592
|
}
|
|
774
593
|
async getIndexTemplate(params, options) {
|
|
775
|
-
var _a;
|
|
776
594
|
const acceptedPath = ['name'];
|
|
777
|
-
const acceptedQuery = ['local', 'flat_settings', 'include_type_name', 'master_timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
778
595
|
const querystring = {};
|
|
779
|
-
|
|
780
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
596
|
+
const body = undefined;
|
|
781
597
|
params = params !== null && params !== void 0 ? params : {};
|
|
782
598
|
for (const key in params) {
|
|
783
|
-
if (
|
|
784
|
-
// @ts-expect-error
|
|
785
|
-
querystring[key] = params[key];
|
|
786
|
-
}
|
|
787
|
-
else if (acceptedPath.includes(key)) {
|
|
599
|
+
if (acceptedPath.includes(key)) {
|
|
788
600
|
continue;
|
|
789
601
|
}
|
|
790
602
|
else if (key !== 'body') {
|
|
791
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
792
603
|
// @ts-expect-error
|
|
793
|
-
|
|
604
|
+
querystring[key] = params[key];
|
|
794
605
|
}
|
|
795
606
|
}
|
|
796
607
|
let method = '';
|
|
@@ -806,25 +617,17 @@ class Indices {
|
|
|
806
617
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
807
618
|
}
|
|
808
619
|
async getMapping(params, options) {
|
|
809
|
-
var _a;
|
|
810
620
|
const acceptedPath = ['index'];
|
|
811
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'include_type_name', 'local', 'master_timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
812
621
|
const querystring = {};
|
|
813
|
-
|
|
814
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
622
|
+
const body = undefined;
|
|
815
623
|
params = params !== null && params !== void 0 ? params : {};
|
|
816
624
|
for (const key in params) {
|
|
817
|
-
if (
|
|
818
|
-
// @ts-expect-error
|
|
819
|
-
querystring[key] = params[key];
|
|
820
|
-
}
|
|
821
|
-
else if (acceptedPath.includes(key)) {
|
|
625
|
+
if (acceptedPath.includes(key)) {
|
|
822
626
|
continue;
|
|
823
627
|
}
|
|
824
628
|
else if (key !== 'body') {
|
|
825
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
826
629
|
// @ts-expect-error
|
|
827
|
-
|
|
630
|
+
querystring[key] = params[key];
|
|
828
631
|
}
|
|
829
632
|
}
|
|
830
633
|
let method = '';
|
|
@@ -840,25 +643,17 @@ class Indices {
|
|
|
840
643
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
841
644
|
}
|
|
842
645
|
async getSettings(params, options) {
|
|
843
|
-
var _a;
|
|
844
646
|
const acceptedPath = ['index', 'name'];
|
|
845
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'flat_settings', 'ignore_unavailable', 'include_defaults', 'local', 'master_timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
846
647
|
const querystring = {};
|
|
847
|
-
|
|
848
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
648
|
+
const body = undefined;
|
|
849
649
|
params = params !== null && params !== void 0 ? params : {};
|
|
850
650
|
for (const key in params) {
|
|
851
|
-
if (
|
|
852
|
-
// @ts-expect-error
|
|
853
|
-
querystring[key] = params[key];
|
|
854
|
-
}
|
|
855
|
-
else if (acceptedPath.includes(key)) {
|
|
651
|
+
if (acceptedPath.includes(key)) {
|
|
856
652
|
continue;
|
|
857
653
|
}
|
|
858
654
|
else if (key !== 'body') {
|
|
859
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
860
655
|
// @ts-expect-error
|
|
861
|
-
|
|
656
|
+
querystring[key] = params[key];
|
|
862
657
|
}
|
|
863
658
|
}
|
|
864
659
|
let method = '';
|
|
@@ -882,25 +677,17 @@ class Indices {
|
|
|
882
677
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
883
678
|
}
|
|
884
679
|
async getTemplate(params, options) {
|
|
885
|
-
var _a;
|
|
886
680
|
const acceptedPath = ['name'];
|
|
887
|
-
const acceptedQuery = ['flat_settings', 'include_type_name', 'local', 'master_timeout', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
888
681
|
const querystring = {};
|
|
889
|
-
|
|
890
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
682
|
+
const body = undefined;
|
|
891
683
|
params = params !== null && params !== void 0 ? params : {};
|
|
892
684
|
for (const key in params) {
|
|
893
|
-
if (
|
|
894
|
-
// @ts-expect-error
|
|
895
|
-
querystring[key] = params[key];
|
|
896
|
-
}
|
|
897
|
-
else if (acceptedPath.includes(key)) {
|
|
685
|
+
if (acceptedPath.includes(key)) {
|
|
898
686
|
continue;
|
|
899
687
|
}
|
|
900
688
|
else if (key !== 'body') {
|
|
901
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
902
689
|
// @ts-expect-error
|
|
903
|
-
|
|
690
|
+
querystring[key] = params[key];
|
|
904
691
|
}
|
|
905
692
|
}
|
|
906
693
|
let method = '';
|
|
@@ -916,49 +703,50 @@ class Indices {
|
|
|
916
703
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
917
704
|
}
|
|
918
705
|
async migrateToDataStream(params, options) {
|
|
919
|
-
var _a;
|
|
920
706
|
const acceptedPath = ['name'];
|
|
921
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
922
707
|
const querystring = {};
|
|
923
|
-
|
|
924
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
708
|
+
const body = undefined;
|
|
925
709
|
for (const key in params) {
|
|
926
|
-
if (
|
|
710
|
+
if (acceptedPath.includes(key)) {
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
713
|
+
else if (key !== 'body') {
|
|
927
714
|
// @ts-expect-error
|
|
928
715
|
querystring[key] = params[key];
|
|
929
716
|
}
|
|
930
|
-
|
|
717
|
+
}
|
|
718
|
+
const method = 'POST';
|
|
719
|
+
const path = `/_data_stream/_migrate/${encodeURIComponent(params.name.toString())}`;
|
|
720
|
+
return await this.transport.request({ path, method, querystring, body }, options);
|
|
721
|
+
}
|
|
722
|
+
async modifyDataStream(params, options) {
|
|
723
|
+
const acceptedPath = [];
|
|
724
|
+
const querystring = {};
|
|
725
|
+
const body = undefined;
|
|
726
|
+
params = params !== null && params !== void 0 ? params : {};
|
|
727
|
+
for (const key in params) {
|
|
728
|
+
if (acceptedPath.includes(key)) {
|
|
931
729
|
continue;
|
|
932
730
|
}
|
|
933
731
|
else if (key !== 'body') {
|
|
934
|
-
|
|
935
|
-
// @ts-expect-error
|
|
936
|
-
body[key] = params[key];
|
|
732
|
+
querystring[key] = params[key];
|
|
937
733
|
}
|
|
938
734
|
}
|
|
939
735
|
const method = 'POST';
|
|
940
|
-
const path =
|
|
736
|
+
const path = '/_data_stream/_modify';
|
|
941
737
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
942
738
|
}
|
|
943
739
|
async open(params, options) {
|
|
944
|
-
var _a;
|
|
945
740
|
const acceptedPath = ['index'];
|
|
946
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'master_timeout', 'timeout', 'wait_for_active_shards', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
947
741
|
const querystring = {};
|
|
948
|
-
|
|
949
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
742
|
+
const body = undefined;
|
|
950
743
|
for (const key in params) {
|
|
951
|
-
if (
|
|
952
|
-
// @ts-expect-error
|
|
953
|
-
querystring[key] = params[key];
|
|
954
|
-
}
|
|
955
|
-
else if (acceptedPath.includes(key)) {
|
|
744
|
+
if (acceptedPath.includes(key)) {
|
|
956
745
|
continue;
|
|
957
746
|
}
|
|
958
747
|
else if (key !== 'body') {
|
|
959
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
960
748
|
// @ts-expect-error
|
|
961
|
-
|
|
749
|
+
querystring[key] = params[key];
|
|
962
750
|
}
|
|
963
751
|
}
|
|
964
752
|
const method = 'POST';
|
|
@@ -966,24 +754,16 @@ class Indices {
|
|
|
966
754
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
967
755
|
}
|
|
968
756
|
async promoteDataStream(params, options) {
|
|
969
|
-
var _a;
|
|
970
757
|
const acceptedPath = ['name'];
|
|
971
|
-
const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
972
758
|
const querystring = {};
|
|
973
|
-
|
|
974
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
759
|
+
const body = undefined;
|
|
975
760
|
for (const key in params) {
|
|
976
|
-
if (
|
|
977
|
-
// @ts-expect-error
|
|
978
|
-
querystring[key] = params[key];
|
|
979
|
-
}
|
|
980
|
-
else if (acceptedPath.includes(key)) {
|
|
761
|
+
if (acceptedPath.includes(key)) {
|
|
981
762
|
continue;
|
|
982
763
|
}
|
|
983
764
|
else if (key !== 'body') {
|
|
984
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
985
765
|
// @ts-expect-error
|
|
986
|
-
|
|
766
|
+
querystring[key] = params[key];
|
|
987
767
|
}
|
|
988
768
|
}
|
|
989
769
|
const method = 'POST';
|
|
@@ -991,24 +771,30 @@ class Indices {
|
|
|
991
771
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
992
772
|
}
|
|
993
773
|
async putAlias(params, options) {
|
|
994
|
-
var _a;
|
|
995
774
|
const acceptedPath = ['index', 'name'];
|
|
996
|
-
const
|
|
775
|
+
const acceptedBody = ['filter', 'index_routing', 'is_write_index', 'routing', 'search_routing'];
|
|
997
776
|
const querystring = {};
|
|
998
777
|
// @ts-expect-error
|
|
999
|
-
|
|
778
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
779
|
+
let body;
|
|
780
|
+
if (typeof userBody === 'string') {
|
|
781
|
+
body = userBody;
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
785
|
+
}
|
|
1000
786
|
for (const key in params) {
|
|
1001
|
-
if (
|
|
787
|
+
if (acceptedBody.includes(key)) {
|
|
788
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1002
789
|
// @ts-expect-error
|
|
1003
|
-
|
|
790
|
+
body[key] = params[key];
|
|
1004
791
|
}
|
|
1005
792
|
else if (acceptedPath.includes(key)) {
|
|
1006
793
|
continue;
|
|
1007
794
|
}
|
|
1008
795
|
else if (key !== 'body') {
|
|
1009
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1010
796
|
// @ts-expect-error
|
|
1011
|
-
|
|
797
|
+
querystring[key] = params[key];
|
|
1012
798
|
}
|
|
1013
799
|
}
|
|
1014
800
|
let method = '';
|
|
@@ -1024,24 +810,30 @@ class Indices {
|
|
|
1024
810
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1025
811
|
}
|
|
1026
812
|
async putIndexTemplate(params, options) {
|
|
1027
|
-
var _a;
|
|
1028
813
|
const acceptedPath = ['name'];
|
|
1029
|
-
const
|
|
814
|
+
const acceptedBody = ['index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta'];
|
|
1030
815
|
const querystring = {};
|
|
1031
816
|
// @ts-expect-error
|
|
1032
|
-
|
|
817
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
818
|
+
let body;
|
|
819
|
+
if (typeof userBody === 'string') {
|
|
820
|
+
body = userBody;
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
824
|
+
}
|
|
1033
825
|
for (const key in params) {
|
|
1034
|
-
if (
|
|
826
|
+
if (acceptedBody.includes(key)) {
|
|
827
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1035
828
|
// @ts-expect-error
|
|
1036
|
-
|
|
829
|
+
body[key] = params[key];
|
|
1037
830
|
}
|
|
1038
831
|
else if (acceptedPath.includes(key)) {
|
|
1039
832
|
continue;
|
|
1040
833
|
}
|
|
1041
834
|
else if (key !== 'body') {
|
|
1042
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1043
835
|
// @ts-expect-error
|
|
1044
|
-
|
|
836
|
+
querystring[key] = params[key];
|
|
1045
837
|
}
|
|
1046
838
|
}
|
|
1047
839
|
const method = 'PUT';
|
|
@@ -1049,24 +841,30 @@ class Indices {
|
|
|
1049
841
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1050
842
|
}
|
|
1051
843
|
async putMapping(params, options) {
|
|
1052
|
-
var _a;
|
|
1053
844
|
const acceptedPath = ['index'];
|
|
1054
|
-
const
|
|
845
|
+
const acceptedBody = ['date_detection', 'dynamic', 'dynamic_date_formats', 'dynamic_templates', '_field_names', '_meta', 'numeric_detection', 'properties', '_routing', '_source', 'runtime'];
|
|
1055
846
|
const querystring = {};
|
|
1056
847
|
// @ts-expect-error
|
|
1057
|
-
|
|
848
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
849
|
+
let body;
|
|
850
|
+
if (typeof userBody === 'string') {
|
|
851
|
+
body = userBody;
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
855
|
+
}
|
|
1058
856
|
for (const key in params) {
|
|
1059
|
-
if (
|
|
857
|
+
if (acceptedBody.includes(key)) {
|
|
858
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1060
859
|
// @ts-expect-error
|
|
1061
|
-
|
|
860
|
+
body[key] = params[key];
|
|
1062
861
|
}
|
|
1063
862
|
else if (acceptedPath.includes(key)) {
|
|
1064
863
|
continue;
|
|
1065
864
|
}
|
|
1066
865
|
else if (key !== 'body') {
|
|
1067
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1068
866
|
// @ts-expect-error
|
|
1069
|
-
|
|
867
|
+
querystring[key] = params[key];
|
|
1070
868
|
}
|
|
1071
869
|
}
|
|
1072
870
|
const method = 'PUT';
|
|
@@ -1076,21 +874,21 @@ class Indices {
|
|
|
1076
874
|
async putSettings(params, options) {
|
|
1077
875
|
var _a;
|
|
1078
876
|
const acceptedPath = ['index'];
|
|
1079
|
-
const
|
|
877
|
+
const acceptedBody = ['settings'];
|
|
1080
878
|
const querystring = {};
|
|
1081
879
|
// @ts-expect-error
|
|
1082
880
|
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
1083
881
|
for (const key in params) {
|
|
1084
|
-
if (
|
|
882
|
+
if (acceptedBody.includes(key)) {
|
|
1085
883
|
// @ts-expect-error
|
|
1086
|
-
|
|
884
|
+
body = params[key];
|
|
1087
885
|
}
|
|
1088
886
|
else if (acceptedPath.includes(key)) {
|
|
1089
887
|
continue;
|
|
1090
888
|
}
|
|
1091
889
|
else if (key !== 'body') {
|
|
1092
890
|
// @ts-expect-error
|
|
1093
|
-
|
|
891
|
+
querystring[key] = params[key];
|
|
1094
892
|
}
|
|
1095
893
|
}
|
|
1096
894
|
let method = '';
|
|
@@ -1106,24 +904,30 @@ class Indices {
|
|
|
1106
904
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1107
905
|
}
|
|
1108
906
|
async putTemplate(params, options) {
|
|
1109
|
-
var _a;
|
|
1110
907
|
const acceptedPath = ['name'];
|
|
1111
|
-
const
|
|
908
|
+
const acceptedBody = ['aliases', 'index_patterns', 'mappings', 'order', 'settings', 'version'];
|
|
1112
909
|
const querystring = {};
|
|
1113
910
|
// @ts-expect-error
|
|
1114
|
-
|
|
911
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
912
|
+
let body;
|
|
913
|
+
if (typeof userBody === 'string') {
|
|
914
|
+
body = userBody;
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
918
|
+
}
|
|
1115
919
|
for (const key in params) {
|
|
1116
|
-
if (
|
|
920
|
+
if (acceptedBody.includes(key)) {
|
|
921
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1117
922
|
// @ts-expect-error
|
|
1118
|
-
|
|
923
|
+
body[key] = params[key];
|
|
1119
924
|
}
|
|
1120
925
|
else if (acceptedPath.includes(key)) {
|
|
1121
926
|
continue;
|
|
1122
927
|
}
|
|
1123
928
|
else if (key !== 'body') {
|
|
1124
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1125
929
|
// @ts-expect-error
|
|
1126
|
-
|
|
930
|
+
querystring[key] = params[key];
|
|
1127
931
|
}
|
|
1128
932
|
}
|
|
1129
933
|
const method = 'PUT';
|
|
@@ -1131,25 +935,17 @@ class Indices {
|
|
|
1131
935
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1132
936
|
}
|
|
1133
937
|
async recovery(params, options) {
|
|
1134
|
-
var _a;
|
|
1135
938
|
const acceptedPath = ['index'];
|
|
1136
|
-
const acceptedQuery = ['active_only', 'detailed', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
1137
939
|
const querystring = {};
|
|
1138
|
-
|
|
1139
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
940
|
+
const body = undefined;
|
|
1140
941
|
params = params !== null && params !== void 0 ? params : {};
|
|
1141
942
|
for (const key in params) {
|
|
1142
|
-
if (
|
|
1143
|
-
// @ts-expect-error
|
|
1144
|
-
querystring[key] = params[key];
|
|
1145
|
-
}
|
|
1146
|
-
else if (acceptedPath.includes(key)) {
|
|
943
|
+
if (acceptedPath.includes(key)) {
|
|
1147
944
|
continue;
|
|
1148
945
|
}
|
|
1149
946
|
else if (key !== 'body') {
|
|
1150
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1151
947
|
// @ts-expect-error
|
|
1152
|
-
|
|
948
|
+
querystring[key] = params[key];
|
|
1153
949
|
}
|
|
1154
950
|
}
|
|
1155
951
|
let method = '';
|
|
@@ -1165,25 +961,17 @@ class Indices {
|
|
|
1165
961
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1166
962
|
}
|
|
1167
963
|
async refresh(params, options) {
|
|
1168
|
-
var _a;
|
|
1169
964
|
const acceptedPath = ['index'];
|
|
1170
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
1171
965
|
const querystring = {};
|
|
1172
|
-
|
|
1173
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
966
|
+
const body = undefined;
|
|
1174
967
|
params = params !== null && params !== void 0 ? params : {};
|
|
1175
968
|
for (const key in params) {
|
|
1176
|
-
if (
|
|
1177
|
-
// @ts-expect-error
|
|
1178
|
-
querystring[key] = params[key];
|
|
1179
|
-
}
|
|
1180
|
-
else if (acceptedPath.includes(key)) {
|
|
969
|
+
if (acceptedPath.includes(key)) {
|
|
1181
970
|
continue;
|
|
1182
971
|
}
|
|
1183
972
|
else if (key !== 'body') {
|
|
1184
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1185
973
|
// @ts-expect-error
|
|
1186
|
-
|
|
974
|
+
querystring[key] = params[key];
|
|
1187
975
|
}
|
|
1188
976
|
}
|
|
1189
977
|
let method = '';
|
|
@@ -1199,24 +987,16 @@ class Indices {
|
|
|
1199
987
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1200
988
|
}
|
|
1201
989
|
async reloadSearchAnalyzers(params, options) {
|
|
1202
|
-
var _a;
|
|
1203
990
|
const acceptedPath = ['index'];
|
|
1204
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
1205
991
|
const querystring = {};
|
|
1206
|
-
|
|
1207
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
992
|
+
const body = undefined;
|
|
1208
993
|
for (const key in params) {
|
|
1209
|
-
if (
|
|
1210
|
-
// @ts-expect-error
|
|
1211
|
-
querystring[key] = params[key];
|
|
1212
|
-
}
|
|
1213
|
-
else if (acceptedPath.includes(key)) {
|
|
994
|
+
if (acceptedPath.includes(key)) {
|
|
1214
995
|
continue;
|
|
1215
996
|
}
|
|
1216
997
|
else if (key !== 'body') {
|
|
1217
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1218
998
|
// @ts-expect-error
|
|
1219
|
-
|
|
999
|
+
querystring[key] = params[key];
|
|
1220
1000
|
}
|
|
1221
1001
|
}
|
|
1222
1002
|
const method = body != null ? 'POST' : 'GET';
|
|
@@ -1224,24 +1004,16 @@ class Indices {
|
|
|
1224
1004
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1225
1005
|
}
|
|
1226
1006
|
async resolveIndex(params, options) {
|
|
1227
|
-
var _a;
|
|
1228
1007
|
const acceptedPath = ['name'];
|
|
1229
|
-
const acceptedQuery = ['expand_wildcards', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
1230
1008
|
const querystring = {};
|
|
1231
|
-
|
|
1232
|
-
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
1009
|
+
const body = undefined;
|
|
1233
1010
|
for (const key in params) {
|
|
1234
|
-
if (
|
|
1235
|
-
// @ts-expect-error
|
|
1236
|
-
querystring[key] = params[key];
|
|
1237
|
-
}
|
|
1238
|
-
else if (acceptedPath.includes(key)) {
|
|
1011
|
+
if (acceptedPath.includes(key)) {
|
|
1239
1012
|
continue;
|
|
1240
1013
|
}
|
|
1241
1014
|
else if (key !== 'body') {
|
|
1242
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1243
1015
|
// @ts-expect-error
|
|
1244
|
-
|
|
1016
|
+
querystring[key] = params[key];
|
|
1245
1017
|
}
|
|
1246
1018
|
}
|
|
1247
1019
|
const method = 'GET';
|
|
@@ -1249,24 +1021,30 @@ class Indices {
|
|
|
1249
1021
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1250
1022
|
}
|
|
1251
1023
|
async rollover(params, options) {
|
|
1252
|
-
var _a;
|
|
1253
1024
|
const acceptedPath = ['alias', 'new_index'];
|
|
1254
|
-
const
|
|
1025
|
+
const acceptedBody = ['aliases', 'conditions', 'mappings', 'settings'];
|
|
1255
1026
|
const querystring = {};
|
|
1256
1027
|
// @ts-expect-error
|
|
1257
|
-
|
|
1028
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
1029
|
+
let body;
|
|
1030
|
+
if (typeof userBody === 'string') {
|
|
1031
|
+
body = userBody;
|
|
1032
|
+
}
|
|
1033
|
+
else {
|
|
1034
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
1035
|
+
}
|
|
1258
1036
|
for (const key in params) {
|
|
1259
|
-
if (
|
|
1037
|
+
if (acceptedBody.includes(key)) {
|
|
1038
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1260
1039
|
// @ts-expect-error
|
|
1261
|
-
|
|
1040
|
+
body[key] = params[key];
|
|
1262
1041
|
}
|
|
1263
1042
|
else if (acceptedPath.includes(key)) {
|
|
1264
1043
|
continue;
|
|
1265
1044
|
}
|
|
1266
1045
|
else if (key !== 'body') {
|
|
1267
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1268
1046
|
// @ts-expect-error
|
|
1269
|
-
|
|
1047
|
+
querystring[key] = params[key];
|
|
1270
1048
|
}
|
|
1271
1049
|
}
|
|
1272
1050
|
let method = '';
|
|
@@ -1282,25 +1060,17 @@ class Indices {
|
|
|
1282
1060
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1283
1061
|
}
|
|
1284
1062
|
async segments(params, options) {
|
|
1285
|
-
var _a;
|
|
1286
1063
|
const acceptedPath = ['index'];
|
|
1287
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'verbose', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
1288
1064
|
const querystring = {};
|
|
1289
|
-
|
|
1290
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
1065
|
+
const body = undefined;
|
|
1291
1066
|
params = params !== null && params !== void 0 ? params : {};
|
|
1292
1067
|
for (const key in params) {
|
|
1293
|
-
if (
|
|
1294
|
-
// @ts-expect-error
|
|
1295
|
-
querystring[key] = params[key];
|
|
1296
|
-
}
|
|
1297
|
-
else if (acceptedPath.includes(key)) {
|
|
1068
|
+
if (acceptedPath.includes(key)) {
|
|
1298
1069
|
continue;
|
|
1299
1070
|
}
|
|
1300
1071
|
else if (key !== 'body') {
|
|
1301
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1302
1072
|
// @ts-expect-error
|
|
1303
|
-
|
|
1073
|
+
querystring[key] = params[key];
|
|
1304
1074
|
}
|
|
1305
1075
|
}
|
|
1306
1076
|
let method = '';
|
|
@@ -1316,25 +1086,17 @@ class Indices {
|
|
|
1316
1086
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1317
1087
|
}
|
|
1318
1088
|
async shardStores(params, options) {
|
|
1319
|
-
var _a;
|
|
1320
1089
|
const acceptedPath = ['index'];
|
|
1321
|
-
const acceptedQuery = ['allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'status', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
1322
1090
|
const querystring = {};
|
|
1323
|
-
|
|
1324
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
1091
|
+
const body = undefined;
|
|
1325
1092
|
params = params !== null && params !== void 0 ? params : {};
|
|
1326
1093
|
for (const key in params) {
|
|
1327
|
-
if (
|
|
1328
|
-
// @ts-expect-error
|
|
1329
|
-
querystring[key] = params[key];
|
|
1330
|
-
}
|
|
1331
|
-
else if (acceptedPath.includes(key)) {
|
|
1094
|
+
if (acceptedPath.includes(key)) {
|
|
1332
1095
|
continue;
|
|
1333
1096
|
}
|
|
1334
1097
|
else if (key !== 'body') {
|
|
1335
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1336
1098
|
// @ts-expect-error
|
|
1337
|
-
|
|
1099
|
+
querystring[key] = params[key];
|
|
1338
1100
|
}
|
|
1339
1101
|
}
|
|
1340
1102
|
let method = '';
|
|
@@ -1350,24 +1112,30 @@ class Indices {
|
|
|
1350
1112
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1351
1113
|
}
|
|
1352
1114
|
async shrink(params, options) {
|
|
1353
|
-
var _a;
|
|
1354
1115
|
const acceptedPath = ['index', 'target'];
|
|
1355
|
-
const
|
|
1116
|
+
const acceptedBody = ['aliases', 'settings'];
|
|
1356
1117
|
const querystring = {};
|
|
1357
1118
|
// @ts-expect-error
|
|
1358
|
-
|
|
1119
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
1120
|
+
let body;
|
|
1121
|
+
if (typeof userBody === 'string') {
|
|
1122
|
+
body = userBody;
|
|
1123
|
+
}
|
|
1124
|
+
else {
|
|
1125
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
1126
|
+
}
|
|
1359
1127
|
for (const key in params) {
|
|
1360
|
-
if (
|
|
1128
|
+
if (acceptedBody.includes(key)) {
|
|
1129
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1361
1130
|
// @ts-expect-error
|
|
1362
|
-
|
|
1131
|
+
body[key] = params[key];
|
|
1363
1132
|
}
|
|
1364
1133
|
else if (acceptedPath.includes(key)) {
|
|
1365
1134
|
continue;
|
|
1366
1135
|
}
|
|
1367
1136
|
else if (key !== 'body') {
|
|
1368
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1369
1137
|
// @ts-expect-error
|
|
1370
|
-
|
|
1138
|
+
querystring[key] = params[key];
|
|
1371
1139
|
}
|
|
1372
1140
|
}
|
|
1373
1141
|
const method = 'PUT';
|
|
@@ -1375,24 +1143,30 @@ class Indices {
|
|
|
1375
1143
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1376
1144
|
}
|
|
1377
1145
|
async simulateIndexTemplate(params, options) {
|
|
1378
|
-
var _a;
|
|
1379
1146
|
const acceptedPath = ['name'];
|
|
1380
|
-
const
|
|
1147
|
+
const acceptedBody = ['allow_auto_create', 'index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta'];
|
|
1381
1148
|
const querystring = {};
|
|
1382
1149
|
// @ts-expect-error
|
|
1383
|
-
|
|
1150
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
1151
|
+
let body;
|
|
1152
|
+
if (typeof userBody === 'string') {
|
|
1153
|
+
body = userBody;
|
|
1154
|
+
}
|
|
1155
|
+
else {
|
|
1156
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
1157
|
+
}
|
|
1384
1158
|
for (const key in params) {
|
|
1385
|
-
if (
|
|
1159
|
+
if (acceptedBody.includes(key)) {
|
|
1160
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1386
1161
|
// @ts-expect-error
|
|
1387
|
-
|
|
1162
|
+
body[key] = params[key];
|
|
1388
1163
|
}
|
|
1389
1164
|
else if (acceptedPath.includes(key)) {
|
|
1390
1165
|
continue;
|
|
1391
1166
|
}
|
|
1392
1167
|
else if (key !== 'body') {
|
|
1393
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1394
1168
|
// @ts-expect-error
|
|
1395
|
-
|
|
1169
|
+
querystring[key] = params[key];
|
|
1396
1170
|
}
|
|
1397
1171
|
}
|
|
1398
1172
|
const method = 'POST';
|
|
@@ -1402,21 +1176,21 @@ class Indices {
|
|
|
1402
1176
|
async simulateTemplate(params, options) {
|
|
1403
1177
|
var _a;
|
|
1404
1178
|
const acceptedPath = ['name'];
|
|
1405
|
-
const
|
|
1179
|
+
const acceptedBody = ['template'];
|
|
1406
1180
|
const querystring = {};
|
|
1407
1181
|
// @ts-expect-error
|
|
1408
1182
|
let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
1409
1183
|
for (const key in params) {
|
|
1410
|
-
if (
|
|
1184
|
+
if (acceptedBody.includes(key)) {
|
|
1411
1185
|
// @ts-expect-error
|
|
1412
|
-
|
|
1186
|
+
body = params[key];
|
|
1413
1187
|
}
|
|
1414
1188
|
else if (acceptedPath.includes(key)) {
|
|
1415
1189
|
continue;
|
|
1416
1190
|
}
|
|
1417
1191
|
else if (key !== 'body') {
|
|
1418
1192
|
// @ts-expect-error
|
|
1419
|
-
|
|
1193
|
+
querystring[key] = params[key];
|
|
1420
1194
|
}
|
|
1421
1195
|
}
|
|
1422
1196
|
let method = '';
|
|
@@ -1432,24 +1206,30 @@ class Indices {
|
|
|
1432
1206
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1433
1207
|
}
|
|
1434
1208
|
async split(params, options) {
|
|
1435
|
-
var _a;
|
|
1436
1209
|
const acceptedPath = ['index', 'target'];
|
|
1437
|
-
const
|
|
1210
|
+
const acceptedBody = ['aliases', 'settings'];
|
|
1438
1211
|
const querystring = {};
|
|
1439
1212
|
// @ts-expect-error
|
|
1440
|
-
|
|
1213
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
1214
|
+
let body;
|
|
1215
|
+
if (typeof userBody === 'string') {
|
|
1216
|
+
body = userBody;
|
|
1217
|
+
}
|
|
1218
|
+
else {
|
|
1219
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
1220
|
+
}
|
|
1441
1221
|
for (const key in params) {
|
|
1442
|
-
if (
|
|
1222
|
+
if (acceptedBody.includes(key)) {
|
|
1223
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1443
1224
|
// @ts-expect-error
|
|
1444
|
-
|
|
1225
|
+
body[key] = params[key];
|
|
1445
1226
|
}
|
|
1446
1227
|
else if (acceptedPath.includes(key)) {
|
|
1447
1228
|
continue;
|
|
1448
1229
|
}
|
|
1449
1230
|
else if (key !== 'body') {
|
|
1450
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1451
1231
|
// @ts-expect-error
|
|
1452
|
-
|
|
1232
|
+
querystring[key] = params[key];
|
|
1453
1233
|
}
|
|
1454
1234
|
}
|
|
1455
1235
|
const method = 'PUT';
|
|
@@ -1457,25 +1237,17 @@ class Indices {
|
|
|
1457
1237
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1458
1238
|
}
|
|
1459
1239
|
async stats(params, options) {
|
|
1460
|
-
var _a;
|
|
1461
1240
|
const acceptedPath = ['metric', 'index'];
|
|
1462
|
-
const acceptedQuery = ['completion_fields', 'expand_wildcards', 'fielddata_fields', 'fields', 'forbid_closed_indices', 'groups', 'include_segment_file_sizes', 'include_unloaded_segments', 'level', 'types', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
1463
1241
|
const querystring = {};
|
|
1464
|
-
|
|
1465
|
-
let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
|
|
1242
|
+
const body = undefined;
|
|
1466
1243
|
params = params !== null && params !== void 0 ? params : {};
|
|
1467
1244
|
for (const key in params) {
|
|
1468
|
-
if (
|
|
1469
|
-
// @ts-expect-error
|
|
1470
|
-
querystring[key] = params[key];
|
|
1471
|
-
}
|
|
1472
|
-
else if (acceptedPath.includes(key)) {
|
|
1245
|
+
if (acceptedPath.includes(key)) {
|
|
1473
1246
|
continue;
|
|
1474
1247
|
}
|
|
1475
1248
|
else if (key !== 'body') {
|
|
1476
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1477
1249
|
// @ts-expect-error
|
|
1478
|
-
|
|
1250
|
+
querystring[key] = params[key];
|
|
1479
1251
|
}
|
|
1480
1252
|
}
|
|
1481
1253
|
let method = '';
|
|
@@ -1498,26 +1270,49 @@ class Indices {
|
|
|
1498
1270
|
}
|
|
1499
1271
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1500
1272
|
}
|
|
1273
|
+
async unfreeze(params, options) {
|
|
1274
|
+
const acceptedPath = ['index'];
|
|
1275
|
+
const querystring = {};
|
|
1276
|
+
const body = undefined;
|
|
1277
|
+
for (const key in params) {
|
|
1278
|
+
if (acceptedPath.includes(key)) {
|
|
1279
|
+
continue;
|
|
1280
|
+
}
|
|
1281
|
+
else if (key !== 'body') {
|
|
1282
|
+
// @ts-expect-error
|
|
1283
|
+
querystring[key] = params[key];
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
const method = 'POST';
|
|
1287
|
+
const path = `/${encodeURIComponent(params.index.toString())}/_unfreeze`;
|
|
1288
|
+
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1289
|
+
}
|
|
1501
1290
|
async updateAliases(params, options) {
|
|
1502
|
-
var _a;
|
|
1503
1291
|
const acceptedPath = [];
|
|
1504
|
-
const
|
|
1292
|
+
const acceptedBody = ['actions'];
|
|
1505
1293
|
const querystring = {};
|
|
1506
1294
|
// @ts-expect-error
|
|
1507
|
-
|
|
1295
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
1296
|
+
let body;
|
|
1297
|
+
if (typeof userBody === 'string') {
|
|
1298
|
+
body = userBody;
|
|
1299
|
+
}
|
|
1300
|
+
else {
|
|
1301
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
1302
|
+
}
|
|
1508
1303
|
params = params !== null && params !== void 0 ? params : {};
|
|
1509
1304
|
for (const key in params) {
|
|
1510
|
-
if (
|
|
1305
|
+
if (acceptedBody.includes(key)) {
|
|
1306
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1511
1307
|
// @ts-expect-error
|
|
1512
|
-
|
|
1308
|
+
body[key] = params[key];
|
|
1513
1309
|
}
|
|
1514
1310
|
else if (acceptedPath.includes(key)) {
|
|
1515
1311
|
continue;
|
|
1516
1312
|
}
|
|
1517
1313
|
else if (key !== 'body') {
|
|
1518
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1519
1314
|
// @ts-expect-error
|
|
1520
|
-
|
|
1315
|
+
querystring[key] = params[key];
|
|
1521
1316
|
}
|
|
1522
1317
|
}
|
|
1523
1318
|
const method = 'POST';
|
|
@@ -1525,25 +1320,31 @@ class Indices {
|
|
|
1525
1320
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
1526
1321
|
}
|
|
1527
1322
|
async validateQuery(params, options) {
|
|
1528
|
-
|
|
1529
|
-
const
|
|
1530
|
-
const acceptedQuery = ['allow_no_indices', 'all_shards', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'expand_wildcards', 'explain', 'ignore_unavailable', 'lenient', 'rewrite', 'q', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
|
|
1323
|
+
const acceptedPath = ['index'];
|
|
1324
|
+
const acceptedBody = ['query'];
|
|
1531
1325
|
const querystring = {};
|
|
1532
1326
|
// @ts-expect-error
|
|
1533
|
-
|
|
1327
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
1328
|
+
let body;
|
|
1329
|
+
if (typeof userBody === 'string') {
|
|
1330
|
+
body = userBody;
|
|
1331
|
+
}
|
|
1332
|
+
else {
|
|
1333
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
1334
|
+
}
|
|
1534
1335
|
params = params !== null && params !== void 0 ? params : {};
|
|
1535
1336
|
for (const key in params) {
|
|
1536
|
-
if (
|
|
1337
|
+
if (acceptedBody.includes(key)) {
|
|
1338
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
1537
1339
|
// @ts-expect-error
|
|
1538
|
-
|
|
1340
|
+
body[key] = params[key];
|
|
1539
1341
|
}
|
|
1540
1342
|
else if (acceptedPath.includes(key)) {
|
|
1541
1343
|
continue;
|
|
1542
1344
|
}
|
|
1543
1345
|
else if (key !== 'body') {
|
|
1544
|
-
body = body !== null && body !== void 0 ? body : {};
|
|
1545
1346
|
// @ts-expect-error
|
|
1546
|
-
|
|
1347
|
+
querystring[key] = params[key];
|
|
1547
1348
|
}
|
|
1548
1349
|
}
|
|
1549
1350
|
let method = '';
|