@opensearch-project/opensearch 1.0.0 → 2.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.
Files changed (86) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.json +26 -0
  3. package/.prettierrc.json +5 -0
  4. package/.whitesource +15 -0
  5. package/ADMINS.md +18 -11
  6. package/COMPATIBILITY.md +24 -0
  7. package/DEVELOPER_GUIDE.md +22 -5
  8. package/MAINTAINERS.md +23 -18
  9. package/README.md +102 -106
  10. package/RELEASING.md +3 -3
  11. package/SECURITY.md +1 -1
  12. package/api/api/bulk.js +53 -26
  13. package/api/api/cat.js +354 -264
  14. package/api/api/clear_scroll.js +17 -17
  15. package/api/api/cluster.js +366 -219
  16. package/api/api/count.js +55 -24
  17. package/api/api/create.js +50 -24
  18. package/api/api/dangling_indices.js +95 -51
  19. package/api/api/delete.js +49 -22
  20. package/api/api/delete_by_query.js +88 -25
  21. package/api/api/delete_by_query_rethrottle.js +33 -19
  22. package/api/api/delete_script.js +31 -17
  23. package/api/api/exists.js +55 -22
  24. package/api/api/exists_source.js +60 -27
  25. package/api/api/explain.js +60 -22
  26. package/api/api/features.js +56 -35
  27. package/api/api/field_caps.js +36 -18
  28. package/api/api/get.js +55 -22
  29. package/api/api/get_script.js +30 -17
  30. package/api/api/get_script_context.js +15 -15
  31. package/api/api/get_script_languages.js +15 -15
  32. package/api/api/get_source.js +55 -22
  33. package/api/api/index.js +60 -28
  34. package/api/api/indices.js +1068 -857
  35. package/api/api/info.js +15 -15
  36. package/api/api/ingest.js +132 -96
  37. package/api/api/mget.js +50 -26
  38. package/api/api/msearch.js +49 -26
  39. package/api/api/msearch_template.js +53 -26
  40. package/api/api/mtermvectors.js +48 -24
  41. package/api/api/nodes.js +281 -154
  42. package/api/api/ping.js +15 -15
  43. package/api/api/put_script.js +40 -25
  44. package/api/api/rank_eval.js +37 -20
  45. package/api/api/reindex.js +38 -17
  46. package/api/api/reindex_rethrottle.js +32 -19
  47. package/api/api/render_search_template.js +18 -18
  48. package/api/api/scripts_painless_execute.js +15 -15
  49. package/api/api/scroll.js +31 -17
  50. package/api/api/search.js +108 -24
  51. package/api/api/search_shards.js +36 -18
  52. package/api/api/search_template.js +64 -26
  53. package/api/api/shutdown.js +66 -54
  54. package/api/api/snapshot.js +347 -224
  55. package/api/api/tasks.js +65 -46
  56. package/api/api/terms_enum.js +17 -17
  57. package/api/api/termvectors.js +57 -26
  58. package/api/api/update.js +64 -24
  59. package/api/api/update_by_query.js +89 -23
  60. package/api/api/update_by_query_rethrottle.js +33 -19
  61. package/api/index.js +267 -179
  62. package/api/new.d.ts +2042 -529
  63. package/api/opensearch_dashboards.d.ts +275 -0
  64. package/api/requestParams.d.ts +301 -69
  65. package/api/types.d.ts +6204 -5719
  66. package/api/utils.js +22 -22
  67. package/codecov.yml +2 -2
  68. package/index.d.ts +4779 -934
  69. package/index.js +153 -140
  70. package/index.mjs +9 -9
  71. package/lib/Connection.d.ts +37 -26
  72. package/lib/Connection.js +163 -168
  73. package/lib/Helpers.d.ts +103 -63
  74. package/lib/Helpers.js +398 -371
  75. package/lib/Serializer.d.ts +2 -2
  76. package/lib/Serializer.js +39 -39
  77. package/lib/Transport.d.ts +30 -12
  78. package/lib/Transport.js +383 -324
  79. package/lib/errors.d.ts +25 -7
  80. package/lib/errors.js +75 -71
  81. package/lib/pool/BaseConnectionPool.js +100 -97
  82. package/lib/pool/CloudConnectionPool.js +16 -16
  83. package/lib/pool/ConnectionPool.js +105 -105
  84. package/lib/pool/index.d.ts +8 -6
  85. package/lib/pool/index.js +6 -6
  86. package/package.json +13 -8
@@ -28,277 +28,352 @@
28
28
  * under the License.
29
29
  */
30
30
 
31
- 'use strict'
31
+ 'use strict';
32
32
 
33
33
  /* eslint camelcase: 0 */
34
34
  /* eslint no-unused-vars: 0 */
35
35
 
36
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
37
- const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'include_repository', 'verbose', 'local', 'blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'detailed', 'rarely_abort_writes']
38
- const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details', includeRepository: 'include_repository', blobCount: 'blob_count', readNodeCount: 'read_node_count', earlyReadNodeCount: 'early_read_node_count', rareActionProbability: 'rare_action_probability', maxBlobSize: 'max_blob_size', maxTotalDataSize: 'max_total_data_size', rarelyAbortWrites: 'rarely_abort_writes' }
39
-
40
- function SnapshotApi (transport, ConfigurationError) {
41
- this.transport = transport
42
- this[kConfigurationError] = ConfigurationError
36
+ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
37
+ const acceptedQuerystring = [
38
+ 'cluster_manager_timeout',
39
+ 'master_timeout',
40
+ 'timeout',
41
+ 'pretty',
42
+ 'human',
43
+ 'error_trace',
44
+ 'source',
45
+ 'filter_path',
46
+ 'wait_for_completion',
47
+ 'verify',
48
+ 'ignore_unavailable',
49
+ 'index_details',
50
+ 'include_repository',
51
+ 'verbose',
52
+ 'local',
53
+ 'blob_count',
54
+ 'concurrency',
55
+ 'read_node_count',
56
+ 'early_read_node_count',
57
+ 'seed',
58
+ 'rare_action_probability',
59
+ 'max_blob_size',
60
+ 'max_total_data_size',
61
+ 'detailed',
62
+ 'rarely_abort_writes',
63
+ ];
64
+ const snakeCase = {
65
+ clusterManagerTimeout: 'cluster_manager_timeout',
66
+ masterTimeout: 'master_timeout',
67
+ errorTrace: 'error_trace',
68
+ filterPath: 'filter_path',
69
+ waitForCompletion: 'wait_for_completion',
70
+ ignoreUnavailable: 'ignore_unavailable',
71
+ indexDetails: 'index_details',
72
+ includeRepository: 'include_repository',
73
+ blobCount: 'blob_count',
74
+ readNodeCount: 'read_node_count',
75
+ earlyReadNodeCount: 'early_read_node_count',
76
+ rareActionProbability: 'rare_action_probability',
77
+ maxBlobSize: 'max_blob_size',
78
+ maxTotalDataSize: 'max_total_data_size',
79
+ rarelyAbortWrites: 'rarely_abort_writes',
80
+ };
81
+
82
+ function SnapshotApi(transport, ConfigurationError) {
83
+ this.transport = transport;
84
+ this[kConfigurationError] = ConfigurationError;
43
85
  }
44
86
 
45
- SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi (params, options, callback) {
46
- ;[params, options, callback] = normalizeArguments(params, options, callback)
87
+ SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi(
88
+ params,
89
+ options,
90
+ callback
91
+ ) {
92
+ [params, options, callback] = normalizeArguments(params, options, callback);
47
93
 
48
94
  // check required parameters
49
95
  if (params.repository == null) {
50
- const err = new this[kConfigurationError]('Missing required parameter: repository')
51
- return handleError(err, callback)
96
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
97
+ return handleError(err, callback);
52
98
  }
53
99
 
54
- let { method, body, repository, ...querystring } = params
55
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
100
+ let { method, body, repository, ...querystring } = params;
101
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
56
102
 
57
- let path = ''
58
- if (method == null) method = 'POST'
59
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_cleanup'
103
+ let path = '';
104
+ if (method == null) method = 'POST';
105
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_cleanup';
60
106
 
61
107
  // build request object
62
108
  const request = {
63
109
  method,
64
110
  path,
65
111
  body: body || '',
66
- querystring
67
- }
112
+ querystring,
113
+ };
68
114
 
69
- return this.transport.request(request, options, callback)
70
- }
115
+ return this.transport.request(request, options, callback);
116
+ };
71
117
 
72
- SnapshotApi.prototype.clone = function snapshotCloneApi (params, options, callback) {
73
- ;[params, options, callback] = normalizeArguments(params, options, callback)
118
+ SnapshotApi.prototype.clone = function snapshotCloneApi(params, options, callback) {
119
+ [params, options, callback] = normalizeArguments(params, options, callback);
74
120
 
75
121
  // check required parameters
76
122
  if (params.repository == null) {
77
- const err = new this[kConfigurationError]('Missing required parameter: repository')
78
- return handleError(err, callback)
123
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
124
+ return handleError(err, callback);
79
125
  }
80
126
  if (params.snapshot == null) {
81
- const err = new this[kConfigurationError]('Missing required parameter: snapshot')
82
- return handleError(err, callback)
127
+ const err = new this[kConfigurationError]('Missing required parameter: snapshot');
128
+ return handleError(err, callback);
83
129
  }
84
130
  if (params.target_snapshot == null && params.targetSnapshot == null) {
85
- const err = new this[kConfigurationError]('Missing required parameter: target_snapshot or targetSnapshot')
86
- return handleError(err, callback)
131
+ const err = new this[kConfigurationError](
132
+ 'Missing required parameter: target_snapshot or targetSnapshot'
133
+ );
134
+ return handleError(err, callback);
87
135
  }
88
136
  if (params.body == null) {
89
- const err = new this[kConfigurationError]('Missing required parameter: body')
90
- return handleError(err, callback)
137
+ const err = new this[kConfigurationError]('Missing required parameter: body');
138
+ return handleError(err, callback);
91
139
  }
92
140
 
93
141
  // check required url components
94
- if ((params.target_snapshot != null || params.targetSnapshot != null) && (params.snapshot == null || params.repository == null)) {
95
- const err = new this[kConfigurationError]('Missing required parameter of the url: snapshot, repository')
96
- return handleError(err, callback)
97
- } else if (params.snapshot != null && (params.repository == null)) {
98
- const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
99
- return handleError(err, callback)
100
- }
101
-
102
- let { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } = params
103
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
104
-
105
- let path = ''
106
- if (method == null) method = 'PUT'
107
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_clone' + '/' + encodeURIComponent(target_snapshot || targetSnapshot)
142
+ if (
143
+ (params.target_snapshot != null || params.targetSnapshot != null) &&
144
+ (params.snapshot == null || params.repository == null)
145
+ ) {
146
+ const err = new this[kConfigurationError](
147
+ 'Missing required parameter of the url: snapshot, repository'
148
+ );
149
+ return handleError(err, callback);
150
+ } else if (params.snapshot != null && params.repository == null) {
151
+ const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
152
+ return handleError(err, callback);
153
+ }
154
+
155
+ let { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } =
156
+ params;
157
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
158
+
159
+ let path = '';
160
+ if (method == null) method = 'PUT';
161
+ path =
162
+ '/' +
163
+ '_snapshot' +
164
+ '/' +
165
+ encodeURIComponent(repository) +
166
+ '/' +
167
+ encodeURIComponent(snapshot) +
168
+ '/' +
169
+ '_clone' +
170
+ '/' +
171
+ encodeURIComponent(target_snapshot || targetSnapshot);
108
172
 
109
173
  // build request object
110
174
  const request = {
111
175
  method,
112
176
  path,
113
177
  body: body || '',
114
- querystring
115
- }
178
+ querystring,
179
+ };
116
180
 
117
- return this.transport.request(request, options, callback)
118
- }
181
+ return this.transport.request(request, options, callback);
182
+ };
119
183
 
120
- SnapshotApi.prototype.create = function snapshotCreateApi (params, options, callback) {
121
- ;[params, options, callback] = normalizeArguments(params, options, callback)
184
+ SnapshotApi.prototype.create = function snapshotCreateApi(params, options, callback) {
185
+ [params, options, callback] = normalizeArguments(params, options, callback);
122
186
 
123
187
  // check required parameters
124
188
  if (params.repository == null) {
125
- const err = new this[kConfigurationError]('Missing required parameter: repository')
126
- return handleError(err, callback)
189
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
190
+ return handleError(err, callback);
127
191
  }
128
192
  if (params.snapshot == null) {
129
- const err = new this[kConfigurationError]('Missing required parameter: snapshot')
130
- return handleError(err, callback)
193
+ const err = new this[kConfigurationError]('Missing required parameter: snapshot');
194
+ return handleError(err, callback);
131
195
  }
132
196
 
133
197
  // check required url components
134
- if (params.snapshot != null && (params.repository == null)) {
135
- const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
136
- return handleError(err, callback)
198
+ if (params.snapshot != null && params.repository == null) {
199
+ const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
200
+ return handleError(err, callback);
137
201
  }
138
202
 
139
- let { method, body, repository, snapshot, ...querystring } = params
140
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
203
+ let { method, body, repository, snapshot, ...querystring } = params;
204
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
141
205
 
142
- let path = ''
143
- if (method == null) method = 'PUT'
144
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
206
+ let path = '';
207
+ if (method == null) method = 'PUT';
208
+ path =
209
+ '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot);
145
210
 
146
211
  // build request object
147
212
  const request = {
148
213
  method,
149
214
  path,
150
215
  body: body || '',
151
- querystring
152
- }
216
+ querystring,
217
+ };
153
218
 
154
- return this.transport.request(request, options, callback)
155
- }
219
+ return this.transport.request(request, options, callback);
220
+ };
156
221
 
157
- SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi (params, options, callback) {
158
- ;[params, options, callback] = normalizeArguments(params, options, callback)
222
+ SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi(
223
+ params,
224
+ options,
225
+ callback
226
+ ) {
227
+ [params, options, callback] = normalizeArguments(params, options, callback);
159
228
 
160
229
  // check required parameters
161
230
  if (params.repository == null) {
162
- const err = new this[kConfigurationError]('Missing required parameter: repository')
163
- return handleError(err, callback)
231
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
232
+ return handleError(err, callback);
164
233
  }
165
234
  if (params.body == null) {
166
- const err = new this[kConfigurationError]('Missing required parameter: body')
167
- return handleError(err, callback)
235
+ const err = new this[kConfigurationError]('Missing required parameter: body');
236
+ return handleError(err, callback);
168
237
  }
169
238
 
170
- let { method, body, repository, ...querystring } = params
171
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
239
+ let { method, body, repository, ...querystring } = params;
240
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
172
241
 
173
- let path = ''
174
- if (method == null) method = 'PUT'
175
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
242
+ let path = '';
243
+ if (method == null) method = 'PUT';
244
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository);
176
245
 
177
246
  // build request object
178
247
  const request = {
179
248
  method,
180
249
  path,
181
250
  body: body || '',
182
- querystring
183
- }
251
+ querystring,
252
+ };
184
253
 
185
- return this.transport.request(request, options, callback)
186
- }
254
+ return this.transport.request(request, options, callback);
255
+ };
187
256
 
188
- SnapshotApi.prototype.delete = function snapshotDeleteApi (params, options, callback) {
189
- ;[params, options, callback] = normalizeArguments(params, options, callback)
257
+ SnapshotApi.prototype.delete = function snapshotDeleteApi(params, options, callback) {
258
+ [params, options, callback] = normalizeArguments(params, options, callback);
190
259
 
191
260
  // check required parameters
192
261
  if (params.repository == null) {
193
- const err = new this[kConfigurationError]('Missing required parameter: repository')
194
- return handleError(err, callback)
262
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
263
+ return handleError(err, callback);
195
264
  }
196
265
  if (params.snapshot == null) {
197
- const err = new this[kConfigurationError]('Missing required parameter: snapshot')
198
- return handleError(err, callback)
266
+ const err = new this[kConfigurationError]('Missing required parameter: snapshot');
267
+ return handleError(err, callback);
199
268
  }
200
269
 
201
270
  // check required url components
202
- if (params.snapshot != null && (params.repository == null)) {
203
- const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
204
- return handleError(err, callback)
271
+ if (params.snapshot != null && params.repository == null) {
272
+ const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
273
+ return handleError(err, callback);
205
274
  }
206
275
 
207
- let { method, body, repository, snapshot, ...querystring } = params
208
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
276
+ let { method, body, repository, snapshot, ...querystring } = params;
277
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
209
278
 
210
- let path = ''
211
- if (method == null) method = 'DELETE'
212
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
279
+ let path = '';
280
+ if (method == null) method = 'DELETE';
281
+ path =
282
+ '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot);
213
283
 
214
284
  // build request object
215
285
  const request = {
216
286
  method,
217
287
  path,
218
288
  body: body || '',
219
- querystring
220
- }
289
+ querystring,
290
+ };
221
291
 
222
- return this.transport.request(request, options, callback)
223
- }
292
+ return this.transport.request(request, options, callback);
293
+ };
224
294
 
225
- SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi (params, options, callback) {
226
- ;[params, options, callback] = normalizeArguments(params, options, callback)
295
+ SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi(
296
+ params,
297
+ options,
298
+ callback
299
+ ) {
300
+ [params, options, callback] = normalizeArguments(params, options, callback);
227
301
 
228
302
  // check required parameters
229
303
  if (params.repository == null) {
230
- const err = new this[kConfigurationError]('Missing required parameter: repository')
231
- return handleError(err, callback)
304
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
305
+ return handleError(err, callback);
232
306
  }
233
307
 
234
- let { method, body, repository, ...querystring } = params
235
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
308
+ let { method, body, repository, ...querystring } = params;
309
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
236
310
 
237
- let path = ''
238
- if (method == null) method = 'DELETE'
239
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
311
+ let path = '';
312
+ if (method == null) method = 'DELETE';
313
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository);
240
314
 
241
315
  // build request object
242
316
  const request = {
243
317
  method,
244
318
  path,
245
319
  body: body || '',
246
- querystring
247
- }
320
+ querystring,
321
+ };
248
322
 
249
- return this.transport.request(request, options, callback)
250
- }
323
+ return this.transport.request(request, options, callback);
324
+ };
251
325
 
252
- SnapshotApi.prototype.get = function snapshotGetApi (params, options, callback) {
253
- ;[params, options, callback] = normalizeArguments(params, options, callback)
326
+ SnapshotApi.prototype.get = function snapshotGetApi(params, options, callback) {
327
+ [params, options, callback] = normalizeArguments(params, options, callback);
254
328
 
255
329
  // check required parameters
256
330
  if (params.repository == null) {
257
- const err = new this[kConfigurationError]('Missing required parameter: repository')
258
- return handleError(err, callback)
331
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
332
+ return handleError(err, callback);
259
333
  }
260
334
  if (params.snapshot == null) {
261
- const err = new this[kConfigurationError]('Missing required parameter: snapshot')
262
- return handleError(err, callback)
335
+ const err = new this[kConfigurationError]('Missing required parameter: snapshot');
336
+ return handleError(err, callback);
263
337
  }
264
338
 
265
339
  // check required url components
266
- if (params.snapshot != null && (params.repository == null)) {
267
- const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
268
- return handleError(err, callback)
340
+ if (params.snapshot != null && params.repository == null) {
341
+ const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
342
+ return handleError(err, callback);
269
343
  }
270
344
 
271
- let { method, body, repository, snapshot, ...querystring } = params
272
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
345
+ let { method, body, repository, snapshot, ...querystring } = params;
346
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
273
347
 
274
- let path = ''
275
- if (method == null) method = 'GET'
276
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
348
+ let path = '';
349
+ if (method == null) method = 'GET';
350
+ path =
351
+ '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot);
277
352
 
278
353
  // build request object
279
354
  const request = {
280
355
  method,
281
356
  path,
282
357
  body: null,
283
- querystring
284
- }
358
+ querystring,
359
+ };
285
360
 
286
- return this.transport.request(request, options, callback)
287
- }
361
+ return this.transport.request(request, options, callback);
362
+ };
288
363
 
289
- SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi (params, options, callback) {
290
- ;[params, options, callback] = normalizeArguments(params, options, callback)
364
+ SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi(params, options, callback) {
365
+ [params, options, callback] = normalizeArguments(params, options, callback);
291
366
 
292
- let { method, body, repository, ...querystring } = params
293
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
367
+ let { method, body, repository, ...querystring } = params;
368
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
294
369
 
295
- let path = ''
296
- if ((repository) != null) {
297
- if (method == null) method = 'GET'
298
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
370
+ let path = '';
371
+ if (repository != null) {
372
+ if (method == null) method = 'GET';
373
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository);
299
374
  } else {
300
- if (method == null) method = 'GET'
301
- path = '/' + '_snapshot'
375
+ if (method == null) method = 'GET';
376
+ path = '/' + '_snapshot';
302
377
  }
303
378
 
304
379
  // build request object
@@ -306,98 +381,118 @@ SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi (params,
306
381
  method,
307
382
  path,
308
383
  body: null,
309
- querystring
310
- }
384
+ querystring,
385
+ };
311
386
 
312
- return this.transport.request(request, options, callback)
313
- }
387
+ return this.transport.request(request, options, callback);
388
+ };
314
389
 
315
- SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi (params, options, callback) {
316
- ;[params, options, callback] = normalizeArguments(params, options, callback)
390
+ SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi(
391
+ params,
392
+ options,
393
+ callback
394
+ ) {
395
+ [params, options, callback] = normalizeArguments(params, options, callback);
317
396
 
318
397
  // check required parameters
319
398
  if (params.repository == null) {
320
- const err = new this[kConfigurationError]('Missing required parameter: repository')
321
- return handleError(err, callback)
399
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
400
+ return handleError(err, callback);
322
401
  }
323
402
 
324
- let { method, body, repository, ...querystring } = params
325
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
403
+ let { method, body, repository, ...querystring } = params;
404
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
326
405
 
327
- let path = ''
328
- if (method == null) method = 'POST'
329
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_analyze'
406
+ let path = '';
407
+ if (method == null) method = 'POST';
408
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_analyze';
330
409
 
331
410
  // build request object
332
411
  const request = {
333
412
  method,
334
413
  path,
335
414
  body: body || '',
336
- querystring
337
- }
415
+ querystring,
416
+ };
338
417
 
339
- return this.transport.request(request, options, callback)
340
- }
418
+ return this.transport.request(request, options, callback);
419
+ };
341
420
 
342
- SnapshotApi.prototype.restore = function snapshotRestoreApi (params, options, callback) {
343
- ;[params, options, callback] = normalizeArguments(params, options, callback)
421
+ SnapshotApi.prototype.restore = function snapshotRestoreApi(params, options, callback) {
422
+ [params, options, callback] = normalizeArguments(params, options, callback);
344
423
 
345
424
  // check required parameters
346
425
  if (params.repository == null) {
347
- const err = new this[kConfigurationError]('Missing required parameter: repository')
348
- return handleError(err, callback)
426
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
427
+ return handleError(err, callback);
349
428
  }
350
429
  if (params.snapshot == null) {
351
- const err = new this[kConfigurationError]('Missing required parameter: snapshot')
352
- return handleError(err, callback)
430
+ const err = new this[kConfigurationError]('Missing required parameter: snapshot');
431
+ return handleError(err, callback);
353
432
  }
354
433
 
355
434
  // check required url components
356
- if (params.snapshot != null && (params.repository == null)) {
357
- const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
358
- return handleError(err, callback)
359
- }
360
-
361
- let { method, body, repository, snapshot, ...querystring } = params
362
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
363
-
364
- let path = ''
365
- if (method == null) method = 'POST'
366
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_restore'
435
+ if (params.snapshot != null && params.repository == null) {
436
+ const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
437
+ return handleError(err, callback);
438
+ }
439
+
440
+ let { method, body, repository, snapshot, ...querystring } = params;
441
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
442
+
443
+ let path = '';
444
+ if (method == null) method = 'POST';
445
+ path =
446
+ '/' +
447
+ '_snapshot' +
448
+ '/' +
449
+ encodeURIComponent(repository) +
450
+ '/' +
451
+ encodeURIComponent(snapshot) +
452
+ '/' +
453
+ '_restore';
367
454
 
368
455
  // build request object
369
456
  const request = {
370
457
  method,
371
458
  path,
372
459
  body: body || '',
373
- querystring
374
- }
460
+ querystring,
461
+ };
375
462
 
376
- return this.transport.request(request, options, callback)
377
- }
463
+ return this.transport.request(request, options, callback);
464
+ };
378
465
 
379
- SnapshotApi.prototype.status = function snapshotStatusApi (params, options, callback) {
380
- ;[params, options, callback] = normalizeArguments(params, options, callback)
466
+ SnapshotApi.prototype.status = function snapshotStatusApi(params, options, callback) {
467
+ [params, options, callback] = normalizeArguments(params, options, callback);
381
468
 
382
469
  // check required url components
383
- if (params.snapshot != null && (params.repository == null)) {
384
- const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
385
- return handleError(err, callback)
386
- }
387
-
388
- let { method, body, repository, snapshot, ...querystring } = params
389
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
390
-
391
- let path = ''
392
- if ((repository) != null && (snapshot) != null) {
393
- if (method == null) method = 'GET'
394
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_status'
395
- } else if ((repository) != null) {
396
- if (method == null) method = 'GET'
397
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_status'
470
+ if (params.snapshot != null && params.repository == null) {
471
+ const err = new this[kConfigurationError]('Missing required parameter of the url: repository');
472
+ return handleError(err, callback);
473
+ }
474
+
475
+ let { method, body, repository, snapshot, ...querystring } = params;
476
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
477
+
478
+ let path = '';
479
+ if (repository != null && snapshot != null) {
480
+ if (method == null) method = 'GET';
481
+ path =
482
+ '/' +
483
+ '_snapshot' +
484
+ '/' +
485
+ encodeURIComponent(repository) +
486
+ '/' +
487
+ encodeURIComponent(snapshot) +
488
+ '/' +
489
+ '_status';
490
+ } else if (repository != null) {
491
+ if (method == null) method = 'GET';
492
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_status';
398
493
  } else {
399
- if (method == null) method = 'GET'
400
- path = '/' + '_snapshot' + '/' + '_status'
494
+ if (method == null) method = 'GET';
495
+ path = '/' + '_snapshot' + '/' + '_status';
401
496
  }
402
497
 
403
498
  // build request object
@@ -405,46 +500,74 @@ SnapshotApi.prototype.status = function snapshotStatusApi (params, options, call
405
500
  method,
406
501
  path,
407
502
  body: null,
408
- querystring
409
- }
503
+ querystring,
504
+ };
410
505
 
411
- return this.transport.request(request, options, callback)
412
- }
506
+ return this.transport.request(request, options, callback);
507
+ };
413
508
 
414
- SnapshotApi.prototype.verifyRepository = function snapshotVerifyRepositoryApi (params, options, callback) {
415
- ;[params, options, callback] = normalizeArguments(params, options, callback)
509
+ SnapshotApi.prototype.verifyRepository = function snapshotVerifyRepositoryApi(
510
+ params,
511
+ options,
512
+ callback
513
+ ) {
514
+ [params, options, callback] = normalizeArguments(params, options, callback);
416
515
 
417
516
  // check required parameters
418
517
  if (params.repository == null) {
419
- const err = new this[kConfigurationError]('Missing required parameter: repository')
420
- return handleError(err, callback)
518
+ const err = new this[kConfigurationError]('Missing required parameter: repository');
519
+ return handleError(err, callback);
421
520
  }
422
521
 
423
- let { method, body, repository, ...querystring } = params
424
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
522
+ let { method, body, repository, ...querystring } = params;
523
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
425
524
 
426
- let path = ''
427
- if (method == null) method = 'POST'
428
- path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_verify'
525
+ let path = '';
526
+ if (method == null) method = 'POST';
527
+ path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_verify';
429
528
 
430
529
  // build request object
431
530
  const request = {
432
531
  method,
433
532
  path,
434
533
  body: body || '',
435
- querystring
436
- }
534
+ querystring,
535
+ };
437
536
 
438
- return this.transport.request(request, options, callback)
439
- }
537
+ return this.transport.request(request, options, callback);
538
+ };
440
539
 
441
540
  Object.defineProperties(SnapshotApi.prototype, {
442
- cleanup_repository: { get () { return this.cleanupRepository } },
443
- create_repository: { get () { return this.createRepository } },
444
- delete_repository: { get () { return this.deleteRepository } },
445
- get_repository: { get () { return this.getRepository } },
446
- repository_analyze: { get () { return this.repositoryAnalyze } },
447
- verify_repository: { get () { return this.verifyRepository } }
448
- })
449
-
450
- module.exports = SnapshotApi
541
+ cleanup_repository: {
542
+ get() {
543
+ return this.cleanupRepository;
544
+ },
545
+ },
546
+ create_repository: {
547
+ get() {
548
+ return this.createRepository;
549
+ },
550
+ },
551
+ delete_repository: {
552
+ get() {
553
+ return this.deleteRepository;
554
+ },
555
+ },
556
+ get_repository: {
557
+ get() {
558
+ return this.getRepository;
559
+ },
560
+ },
561
+ repository_analyze: {
562
+ get() {
563
+ return this.repositoryAnalyze;
564
+ },
565
+ },
566
+ verify_repository: {
567
+ get() {
568
+ return this.verifyRepository;
569
+ },
570
+ },
571
+ });
572
+
573
+ module.exports = SnapshotApi;