@opensearch-project/opensearch 2.8.0 → 2.10.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/CHANGELOG.md CHANGED
@@ -11,13 +11,47 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
11
11
  ### Fixed
12
12
  ### Security
13
13
 
14
+ ## [2.10.0]
15
+ ### Added
16
+ - Added Rollups API ([744](https://github.com/opensearch-project/opensearch-js/issues/744))
17
+ - Added Transforms API ([744](https://github.com/opensearch-project/opensearch-js/issues/744))
18
+ ### Dependencies
19
+ - Bumps `@types/node` from 20.14.0 to 20.14.2
20
+ - Bumps `@babel/eslint-parser` from 7.24.6 to 7.24.7
21
+ - Bumps `prettier` from 3.3.0 to 3.3.1
22
+
23
+ ## [2.9.1]
24
+ ### Dependencies
25
+ - Bumps `json11` from 1.0.4 to 1.1.2
26
+ - Bumps `graceful-fs` from 4.2.8 to 4.2.10
27
+ - Bumps `picomatch` from 2.3.0 to 2.3.1
28
+ ### Security
29
+ - [CVE-2024-4068] Bumps `braces` from 3.0.2 to 3.0.3
30
+ - [CVE-2024-4067] Bumps `micromatch` from 4.0.4 to 4.0.7
31
+
32
+ ## [2.9.0]
33
+ ### Dependencies
34
+ - Bumps `@aws-sdk/types` from 3.535.0 to 3.577.0
35
+ - Bumps `@babel/eslint-parser` from 7.24.1 to 7.24.6
36
+ - Bumps `@types/node` from 20.12.9 to 20.14.0
37
+ - Bumps `semver` from 7.6.0 to 7.6.2
38
+ - Bumps `rimraf` from 5.0.5 to 5.0.7
39
+ - Bumps `aws4` from 1.12.0 to 1.13.0
40
+ - Bumps `prettier` from 3.2.5 to 3.3.0
41
+ - Bumps `debug` from 4.3.4 to 4.3.5
42
+ ### Changed
43
+ - Upgraded the parsing and serialization of long numerals to employ JSON11 ([784](https://github.com/opensearch-project/opensearch-js/pull/784)).
44
+ ### Fixed
45
+ - Missing type definitions for `@opensearch-project/opensearch/aws-v3` ([776](https://github.com/opensearch-project/opensearch-js/pull/776)).
46
+
14
47
  ## [2.8.0]
15
48
  ### Added
16
49
  - Added `@opensearch-project/opensearch/aws-v3` import ([758](https://github.com/opensearch-project/opensearch-js/pull/758)).
17
50
  ### Dependencies
18
- - Bumps `@types/node` from 20.12.5 to 20.12.7
51
+ - Bumps `@types/node` from 20.12.5 to 20.12.9
19
52
  - Bumps `semver` from 5.7.1 to 7.6.0
20
53
  - Bumps `dedent` from 1.5.1 to 1.5.3
54
+ - Bumps `jsdoc` from 4.0.2 to 4.0.3
21
55
  ### Changed
22
56
  - Disabled fail_ci_if_error for upload coverage step in coverage workflow ([#755](https://github.com/opensearch-project/opensearch-js/issues/755)
23
57
 
@@ -0,0 +1,249 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * Licensed to Elasticsearch B.V. under one or more contributor
13
+ * license agreements. See the NOTICE file distributed with
14
+ * this work for additional information regarding copyright
15
+ * ownership. Elasticsearch B.V. licenses this file to you under
16
+ * the Apache License, Version 2.0 (the "License"); you may
17
+ * not use this file except in compliance with the License.
18
+ * You may obtain a copy of the License at
19
+ *
20
+ * http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing,
23
+ * software distributed under the License is distributed on an
24
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
25
+ * KIND, either express or implied. See the License for the
26
+ * specific language governing permissions and limitations
27
+ * under the License.
28
+ */
29
+
30
+ /*
31
+ * This file was generated from OpenSearch API Spec. Do not edit it
32
+ * manually. If you want to make changes, either update the spec or
33
+ * the API generator.
34
+ */
35
+
36
+ 'use strict';
37
+
38
+ /* eslint camelcase: 0 */
39
+ /* eslint no-unused-vars: 0 */
40
+
41
+ const {
42
+ handleError,
43
+ encodePathParam,
44
+ normalizeArguments,
45
+ kConfigurationError,
46
+ } = require('../utils');
47
+
48
+ /** @namespace API-Rollups */
49
+
50
+ function RollupsApi(transport, ConfigurationError) {
51
+ this.transport = transport;
52
+ this[kConfigurationError] = ConfigurationError;
53
+ }
54
+ /**
55
+ * Delete index rollup.
56
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#delete-an-index-rollup-job - rollups.delete}
57
+ *
58
+ * @memberOf API-Rollups
59
+ *
60
+ * @param {object} params
61
+ * @param {string} params.id - Rollup to access
62
+ *
63
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
64
+ * @param {function} [callback] - Callback that handles errors and response
65
+ *
66
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
67
+ */
68
+ RollupsApi.prototype.delete = function (params, options, callback) {
69
+ [params, options, callback] = normalizeArguments(params, options, callback);
70
+
71
+ if (params.id == null) {
72
+ const err = new this[kConfigurationError]('Missing required parameter: id');
73
+ return handleError(err, callback);
74
+ }
75
+
76
+ let { method, body, id, ...querystring } = params;
77
+ id = encodePathParam(id);
78
+
79
+ let path = ['_plugins', '_rollup', 'jobs', id].filter((c) => c != null).join('/');
80
+ method = 'DELETE';
81
+ body = body || '';
82
+
83
+ return this.transport.request({ method, path, querystring, body }, options, callback);
84
+ };
85
+
86
+ /**
87
+ * Get an index rollup.
88
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#get-an-index-rollup-job - rollups.get}
89
+ *
90
+ * @memberOf API-Rollups
91
+ *
92
+ * @param {object} params
93
+ * @param {string} params.id - Rollup to access
94
+ *
95
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
96
+ * @param {function} [callback] - Callback that handles errors and response
97
+ *
98
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
99
+ */
100
+ RollupsApi.prototype.get = function (params, options, callback) {
101
+ [params, options, callback] = normalizeArguments(params, options, callback);
102
+
103
+ if (params.id == null) {
104
+ const err = new this[kConfigurationError]('Missing required parameter: id');
105
+ return handleError(err, callback);
106
+ }
107
+
108
+ let { method, body, id, ...querystring } = params;
109
+ id = encodePathParam(id);
110
+
111
+ let path = ['_plugins', '_rollup', 'jobs', id].filter((c) => c != null).join('/');
112
+ method = 'GET';
113
+ body = body || '';
114
+
115
+ return this.transport.request({ method, path, querystring, body }, options, callback);
116
+ };
117
+
118
+ /**
119
+ * Create or update index rollup.
120
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#create-or-update-an-index-rollup-job - rollups.put}
121
+ *
122
+ * @memberOf API-Rollups
123
+ *
124
+ * @param {object} params
125
+ * @param {number} [params.if_seq_no] - Only perform the operation if the document has this sequence number.
126
+ * @param {number} [params.if_primary_term] - Only perform the operation if the document has this primary term.
127
+ * @param {string} params.id - Rollup to access
128
+ * @param {object} [params.body]
129
+ *
130
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
131
+ * @param {function} [callback] - Callback that handles errors and response
132
+ *
133
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
134
+ */
135
+ RollupsApi.prototype.put = function (params, options, callback) {
136
+ [params, options, callback] = normalizeArguments(params, options, callback);
137
+
138
+ if (params.id == null) {
139
+ const err = new this[kConfigurationError]('Missing required parameter: id');
140
+ return handleError(err, callback);
141
+ }
142
+
143
+ let { method, body, id, ...querystring } = params;
144
+ id = encodePathParam(id);
145
+
146
+ let path = ['_plugins', '_rollup', 'jobs', id].filter((c) => c != null).join('/');
147
+ method = 'PUT';
148
+ body = body || '';
149
+
150
+ return this.transport.request({ method, path, querystring, body }, options, callback);
151
+ };
152
+
153
+ /**
154
+ * Get a rollup's current status.
155
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#explain-an-index-rollup-job - rollups.explain}
156
+ *
157
+ * @memberOf API-Rollups
158
+ *
159
+ * @param {object} params
160
+ * @param {string} params.id - Rollup to access
161
+ *
162
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
163
+ * @param {function} [callback] - Callback that handles errors and response
164
+ *
165
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
166
+ */
167
+ RollupsApi.prototype.explain = function (params, options, callback) {
168
+ [params, options, callback] = normalizeArguments(params, options, callback);
169
+
170
+ if (params.id == null) {
171
+ const err = new this[kConfigurationError]('Missing required parameter: id');
172
+ return handleError(err, callback);
173
+ }
174
+
175
+ let { method, body, id, ...querystring } = params;
176
+ id = encodePathParam(id);
177
+
178
+ let path = ['_plugins', '_rollup', 'jobs', id, '_explain'].filter((c) => c != null).join('/');
179
+ method = 'GET';
180
+ body = body || '';
181
+
182
+ return this.transport.request({ method, path, querystring, body }, options, callback);
183
+ };
184
+
185
+ /**
186
+ * Start rollup.
187
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job - rollups.start}
188
+ *
189
+ * @memberOf API-Rollups
190
+ *
191
+ * @param {object} params
192
+ * @param {string} params.id - Rollup to access
193
+ *
194
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
195
+ * @param {function} [callback] - Callback that handles errors and response
196
+ *
197
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
198
+ */
199
+ RollupsApi.prototype.start = function (params, options, callback) {
200
+ [params, options, callback] = normalizeArguments(params, options, callback);
201
+
202
+ if (params.id == null) {
203
+ const err = new this[kConfigurationError]('Missing required parameter: id');
204
+ return handleError(err, callback);
205
+ }
206
+
207
+ let { method, body, id, ...querystring } = params;
208
+ id = encodePathParam(id);
209
+
210
+ let path = ['_plugins', '_rollup', 'jobs', id, '_start'].filter((c) => c != null).join('/');
211
+ method = 'POST';
212
+ body = body || '';
213
+
214
+ return this.transport.request({ method, path, querystring, body }, options, callback);
215
+ };
216
+
217
+ /**
218
+ * Stop rollup.
219
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job - rollups.stop}
220
+ *
221
+ * @memberOf API-Rollups
222
+ *
223
+ * @param {object} params
224
+ * @param {string} params.id - Rollup to access
225
+ *
226
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
227
+ * @param {function} [callback] - Callback that handles errors and response
228
+ *
229
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
230
+ */
231
+ RollupsApi.prototype.stop = function (params, options, callback) {
232
+ [params, options, callback] = normalizeArguments(params, options, callback);
233
+
234
+ if (params.id == null) {
235
+ const err = new this[kConfigurationError]('Missing required parameter: id');
236
+ return handleError(err, callback);
237
+ }
238
+
239
+ let { method, body, id, ...querystring } = params;
240
+ id = encodePathParam(id);
241
+
242
+ let path = ['_plugins', '_rollup', 'jobs', id, '_stop'].filter((c) => c != null).join('/');
243
+ method = 'POST';
244
+ body = body || '';
245
+
246
+ return this.transport.request({ method, path, querystring, body }, options, callback);
247
+ };
248
+
249
+ module.exports = RollupsApi;
@@ -0,0 +1,304 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * Licensed to Elasticsearch B.V. under one or more contributor
13
+ * license agreements. See the NOTICE file distributed with
14
+ * this work for additional information regarding copyright
15
+ * ownership. Elasticsearch B.V. licenses this file to you under
16
+ * the Apache License, Version 2.0 (the "License"); you may
17
+ * not use this file except in compliance with the License.
18
+ * You may obtain a copy of the License at
19
+ *
20
+ * http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing,
23
+ * software distributed under the License is distributed on an
24
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
25
+ * KIND, either express or implied. See the License for the
26
+ * specific language governing permissions and limitations
27
+ * under the License.
28
+ */
29
+
30
+ /*
31
+ * This file was generated from OpenSearch API Spec. Do not edit it
32
+ * manually. If you want to make changes, either update the spec or
33
+ * the API generator.
34
+ */
35
+
36
+ 'use strict';
37
+
38
+ /* eslint camelcase: 0 */
39
+ /* eslint no-unused-vars: 0 */
40
+
41
+ const {
42
+ handleError,
43
+ encodePathParam,
44
+ normalizeArguments,
45
+ kConfigurationError,
46
+ } = require('../utils');
47
+
48
+ /** @namespace API-Transforms */
49
+
50
+ function TransformsApi(transport, ConfigurationError) {
51
+ this.transport = transport;
52
+ this[kConfigurationError] = ConfigurationError;
53
+ }
54
+
55
+ /**
56
+ * Returns the details of all transform jobs.
57
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#get-a-transform-jobs-details - transforms.search}
58
+ *
59
+ * @memberOf API-Transforms
60
+ *
61
+ * @param {object} [params]
62
+ * @param {number} [params.size] - Specifies the number of transforms to return. Default is 10.
63
+ * @param {number} [params.from] - The starting transform to return. Default is 0.
64
+ * @param {string} [params.search] - The search term to use to filter results.
65
+ * @param {string} [params.sortField] - The field to sort results with.
66
+ * @param {string} [params.sortDirection] - Specifies the direction to sort results in. Can be ASC or DESC. Default is ASC.
67
+ *
68
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
69
+ * @param {function} [callback] - Callback that handles errors and response
70
+ *
71
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
72
+ */
73
+ TransformsApi.prototype.search = function (params, options, callback) {
74
+ [params, options, callback] = normalizeArguments(params, options, callback);
75
+
76
+ let { method, body, ...querystring } = params;
77
+
78
+ let path = ['_plugins', '_transform'].filter((c) => c != null).join('/');
79
+ method = 'GET';
80
+ body = body || '';
81
+
82
+ return this.transport.request({ method, path, querystring, body }, options, callback);
83
+ };
84
+
85
+ /**
86
+ * Returns a preview of what a transformed index would look like.
87
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#preview-a-transform-jobs-results - transforms.preview}
88
+ *
89
+ * @memberOf API-Transforms
90
+ *
91
+ * @param {object} [params] - (Unused)
92
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
93
+ * @param {function} [callback] - Callback that handles errors and response
94
+ *
95
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
96
+ */
97
+ TransformsApi.prototype.preview = function (params, options, callback) {
98
+ [params, options, callback] = normalizeArguments(params, options, callback);
99
+
100
+ let { method, body, ...querystring } = params;
101
+
102
+ let path = ['_plugins', '_transform', '_preview'].filter((c) => c != null).join('/');
103
+ method = 'GET';
104
+ body = body || '';
105
+
106
+ return this.transport.request({ method, path, querystring, body }, options, callback);
107
+ };
108
+
109
+ /**
110
+ * Delete an index transform.
111
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#delete-a-transform-job - transforms.delete}
112
+ *
113
+ * @memberOf API-Transforms
114
+ *
115
+ * @param {object} params
116
+ * @param {string} params.id - Transform to delete
117
+ *
118
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
119
+ * @param {function} [callback] - Callback that handles errors and response
120
+ *
121
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
122
+ */
123
+ TransformsApi.prototype.delete = function (params, options, callback) {
124
+ [params, options, callback] = normalizeArguments(params, options, callback);
125
+
126
+ if (params.id == null) {
127
+ const err = new this[kConfigurationError]('Missing required parameter: id');
128
+ return handleError(err, callback);
129
+ }
130
+
131
+ let { method, body, id, ...querystring } = params;
132
+ id = encodePathParam(id);
133
+
134
+ let path = ['_plugins', '_transform', id].filter((c) => c != null).join('/');
135
+ method = 'DELETE';
136
+ body = body || '';
137
+
138
+ return this.transport.request({ method, path, querystring, body }, options, callback);
139
+ };
140
+
141
+ /**
142
+ * Returns the status and metadata of a transform job.
143
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#get-a-transform-jobs-details - transforms.get}
144
+ *
145
+ * @memberOf API-Transforms
146
+ *
147
+ * @param {object} params
148
+ * @param {string} params.id - Transform to access
149
+ *
150
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
151
+ * @param {function} [callback] - Callback that handles errors and response
152
+ *
153
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
154
+ */
155
+ TransformsApi.prototype.get = function (params, options, callback) {
156
+ [params, options, callback] = normalizeArguments(params, options, callback);
157
+
158
+ if (params.id == null) {
159
+ const err = new this[kConfigurationError]('Missing required parameter: id');
160
+ return handleError(err, callback);
161
+ }
162
+
163
+ let { method, body, id, ...querystring } = params;
164
+ id = encodePathParam(id);
165
+
166
+ let path = ['_plugins', '_transform', id].filter((c) => c != null).join('/');
167
+ method = 'GET';
168
+ body = body || '';
169
+
170
+ return this.transport.request({ method, path, querystring, body }, options, callback);
171
+ };
172
+
173
+ /**
174
+ * Create an index transform, or update a transform if if_seq_no and if_primary_term are provided.
175
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#create-a-transform-job - transforms.put}
176
+ *
177
+ * @memberOf API-Transforms
178
+ *
179
+ * @param {object} params
180
+ * @param {number} [params.if_seq_no] - Only perform the operation if the document has this sequence number.
181
+ * @param {number} [params.if_primary_term] - Only perform the operation if the document has this primary term.
182
+ * @param {string} params.id - Transform to create/update
183
+ * @param {object} [params.body]
184
+ *
185
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
186
+ * @param {function} [callback] - Callback that handles errors and response
187
+ *
188
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
189
+ */
190
+ TransformsApi.prototype.put = function (params, options, callback) {
191
+ [params, options, callback] = normalizeArguments(params, options, callback);
192
+
193
+ if (params.id == null) {
194
+ const err = new this[kConfigurationError]('Missing required parameter: id');
195
+ return handleError(err, callback);
196
+ }
197
+
198
+ let { method, body, id, ...querystring } = params;
199
+ id = encodePathParam(id);
200
+
201
+ let path = ['_plugins', '_transform', id].filter((c) => c != null).join('/');
202
+ method = 'PUT';
203
+ body = body || '';
204
+
205
+ return this.transport.request({ method, path, querystring, body }, options, callback);
206
+ };
207
+
208
+ /**
209
+ * Returns the status and metadata of a transform job.
210
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#get-the-status-of-a-transform-job - transforms.explain}
211
+ *
212
+ * @memberOf API-Transforms
213
+ *
214
+ * @param {object} params
215
+ * @param {string} params.id - Transform to explain
216
+ *
217
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
218
+ * @param {function} [callback] - Callback that handles errors and response
219
+ *
220
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
221
+ */
222
+ TransformsApi.prototype.explain = function (params, options, callback) {
223
+ [params, options, callback] = normalizeArguments(params, options, callback);
224
+
225
+ if (params.id == null) {
226
+ const err = new this[kConfigurationError]('Missing required parameter: id');
227
+ return handleError(err, callback);
228
+ }
229
+
230
+ let { method, body, id, ...querystring } = params;
231
+ id = encodePathParam(id);
232
+
233
+ let path = ['_plugins', '_transform', id, '_explain'].filter((c) => c != null).join('/');
234
+ method = 'GET';
235
+ body = body || '';
236
+
237
+ return this.transport.request({ method, path, querystring, body }, options, callback);
238
+ };
239
+
240
+ /**
241
+ * Start transform.
242
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#start-a-transform-job - transforms.start}
243
+ *
244
+ * @memberOf API-Transforms
245
+ *
246
+ * @param {object} params
247
+ * @param {string} params.id - Transform to start
248
+ *
249
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
250
+ * @param {function} [callback] - Callback that handles errors and response
251
+ *
252
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
253
+ */
254
+ TransformsApi.prototype.start = function (params, options, callback) {
255
+ [params, options, callback] = normalizeArguments(params, options, callback);
256
+
257
+ if (params.id == null) {
258
+ const err = new this[kConfigurationError]('Missing required parameter: id');
259
+ return handleError(err, callback);
260
+ }
261
+
262
+ let { method, body, id, ...querystring } = params;
263
+ id = encodePathParam(id);
264
+
265
+ let path = ['_plugins', '_transform', id, '_start'].filter((c) => c != null).join('/');
266
+ method = 'POST';
267
+ body = body || '';
268
+
269
+ return this.transport.request({ method, path, querystring, body }, options, callback);
270
+ };
271
+
272
+ /**
273
+ * stop transform.
274
+ * <br/> See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#stop-a-transform-job - transforms.stop}
275
+ *
276
+ * @memberOf API-Transforms
277
+ *
278
+ * @param {object} params
279
+ * @param {string} params.id - Transform to stop
280
+ *
281
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
282
+ * @param {function} [callback] - Callback that handles errors and response
283
+ *
284
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
285
+ */
286
+ TransformsApi.prototype.stop = function (params, options, callback) {
287
+ [params, options, callback] = normalizeArguments(params, options, callback);
288
+
289
+ if (params.id == null) {
290
+ const err = new this[kConfigurationError]('Missing required parameter: id');
291
+ return handleError(err, callback);
292
+ }
293
+
294
+ let { method, body, id, ...querystring } = params;
295
+ id = encodePathParam(id);
296
+
297
+ let path = ['_plugins', '_transform', id, '_stop'].filter((c) => c != null).join('/');
298
+ method = 'POST';
299
+ body = body || '';
300
+
301
+ return this.transport.request({ method, path, querystring, body }, options, callback);
302
+ };
303
+
304
+ module.exports = TransformsApi;
package/api/index.js CHANGED
@@ -70,6 +70,7 @@ const rankEvalApi = require('./api/rank_eval');
70
70
  const reindexApi = require('./api/reindex');
71
71
  const reindexRethrottleApi = require('./api/reindex_rethrottle');
72
72
  const renderSearchTemplateApi = require('./api/render_search_template');
73
+ const RollupsApi = require('./api/rollups');
73
74
  const scriptsPainlessExecuteApi = require('./api/scripts_painless_execute');
74
75
  const scrollApi = require('./api/scroll');
75
76
  const SecurityApi = require('./api/security');
@@ -81,6 +82,7 @@ const SnapshotApi = require('./api/snapshot');
81
82
  const TasksApi = require('./api/tasks');
82
83
  const termsEnumApi = require('./api/terms_enum');
83
84
  const termvectorsApi = require('./api/termvectors');
85
+ const TransformsAPi = require('./api/transforms');
84
86
  const updateApi = require('./api/update');
85
87
  const updateByQueryApi = require('./api/update_by_query');
86
88
  const updateByQueryRethrottleApi = require('./api/update_by_query_rethrottle');
@@ -94,10 +96,12 @@ const kHttp = Symbol('Http');
94
96
  const kIndices = Symbol('Indices');
95
97
  const kIngest = Symbol('Ingest');
96
98
  const kNodes = Symbol('Nodes');
99
+ const kRollups = Symbol('Rollups');
97
100
  const kSecurity = Symbol('Security');
98
101
  const kShutdown = Symbol('Shutdown');
99
102
  const kSnapshot = Symbol('Snapshot');
100
103
  const kTasks = Symbol('Tasks');
104
+ const kTransforms = Symbol('Transforms');
101
105
 
102
106
  function OpenSearchAPI(opts) {
103
107
  this[kConfigurationError] = opts.ConfigurationError;
@@ -109,10 +113,12 @@ function OpenSearchAPI(opts) {
109
113
  this[kIndices] = null;
110
114
  this[kIngest] = null;
111
115
  this[kNodes] = null;
116
+ this[kRollups] = null;
112
117
  this[kSecurity] = null;
113
118
  this[kShutdown] = null;
114
119
  this[kSnapshot] = null;
115
120
  this[kTasks] = null;
121
+ this[kTransforms] = null;
116
122
  }
117
123
 
118
124
  OpenSearchAPI.prototype.bulk = bulkApi;
@@ -324,6 +330,14 @@ Object.defineProperties(OpenSearchAPI.prototype, {
324
330
  return this.renderSearchTemplate;
325
331
  },
326
332
  },
333
+ rollups: {
334
+ get() {
335
+ if (this[kRollups] === null) {
336
+ this[kRollups] = new RollupsApi(this.transport, this[kConfigurationError]);
337
+ }
338
+ return this[kRollups];
339
+ },
340
+ },
327
341
  scripts_painless_execute: {
328
342
  get() {
329
343
  return this.scriptsPainlessExecute;
@@ -376,6 +390,14 @@ Object.defineProperties(OpenSearchAPI.prototype, {
376
390
  return this.termsEnum;
377
391
  },
378
392
  },
393
+ transforms: {
394
+ get() {
395
+ if (this[kTransforms] === null) {
396
+ this[kTransforms] = new TransformsAPi(this.transport, this[kConfigurationError]);
397
+ }
398
+ return this[kTransforms];
399
+ },
400
+ },
379
401
  update_by_query: {
380
402
  get() {
381
403
  return this.updateByQuery;