@elastic/elasticsearch 8.0.0-beta.1 → 8.2.0-patch.1

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 (98) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/NOTICE.txt +2 -0
  3. package/README.md +30 -75
  4. package/free-report-junit.xml +17 -0
  5. package/index.d.ts +4 -1
  6. package/index.js +2 -0
  7. package/lib/api/api/_internal.d.ts +23 -0
  8. package/lib/api/api/_internal.js +101 -0
  9. package/lib/api/api/_internal.js.map +1 -0
  10. package/lib/api/api/async_search.d.ts +9 -9
  11. package/lib/api/api/async_search.js +1 -1
  12. package/lib/api/api/async_search.js.map +1 -1
  13. package/lib/api/api/bulk.d.ts +3 -3
  14. package/lib/api/api/bulk.js +2 -6
  15. package/lib/api/api/bulk.js.map +1 -1
  16. package/lib/api/api/cat.d.ts +3 -0
  17. package/lib/api/api/cat.js +25 -0
  18. package/lib/api/api/cat.js.map +1 -1
  19. package/lib/api/api/create.js +1 -1
  20. package/lib/api/api/create.js.map +1 -1
  21. package/lib/api/api/delete.js +1 -1
  22. package/lib/api/api/delete.js.map +1 -1
  23. package/lib/api/api/eql.js +1 -1
  24. package/lib/api/api/eql.js.map +1 -1
  25. package/lib/api/api/exists_source.js +1 -1
  26. package/lib/api/api/exists_source.js.map +1 -1
  27. package/lib/api/api/field_caps.d.ts +3 -3
  28. package/lib/api/api/field_caps.js +0 -1
  29. package/lib/api/api/field_caps.js.map +1 -1
  30. package/lib/api/api/fleet.d.ts +9 -9
  31. package/lib/api/api/fleet.js +28 -7
  32. package/lib/api/api/fleet.js.map +1 -1
  33. package/lib/api/api/ilm.d.ts +3 -3
  34. package/lib/api/api/ilm.js +17 -2
  35. package/lib/api/api/ilm.js.map +1 -1
  36. package/lib/api/api/indices.d.ts +6 -9
  37. package/lib/api/api/indices.js +20 -23
  38. package/lib/api/api/indices.js.map +1 -1
  39. package/lib/api/api/knn_search.js +1 -1
  40. package/lib/api/api/knn_search.js.map +1 -1
  41. package/lib/api/api/license.d.ts +3 -3
  42. package/lib/api/api/license.js +0 -1
  43. package/lib/api/api/license.js.map +1 -1
  44. package/lib/api/api/migration.d.ts +6 -6
  45. package/lib/api/api/migration.js +2 -0
  46. package/lib/api/api/migration.js.map +1 -1
  47. package/lib/api/api/ml.d.ts +27 -24
  48. package/lib/api/api/ml.js +156 -45
  49. package/lib/api/api/ml.js.map +1 -1
  50. package/lib/api/api/monitoring.d.ts +3 -3
  51. package/lib/api/api/monitoring.js.map +1 -1
  52. package/lib/api/api/msearch.d.ts +3 -3
  53. package/lib/api/api/msearch.js.map +1 -1
  54. package/lib/api/api/msearch_template.d.ts +3 -3
  55. package/lib/api/api/msearch_template.js.map +1 -1
  56. package/lib/api/api/nodes.d.ts +6 -6
  57. package/lib/api/api/nodes.js +2 -2
  58. package/lib/api/api/nodes.js.map +1 -1
  59. package/lib/api/api/reindex.d.ts +3 -3
  60. package/lib/api/api/reindex.js +0 -1
  61. package/lib/api/api/reindex.js.map +1 -1
  62. package/lib/api/api/rollup.d.ts +3 -3
  63. package/lib/api/api/rollup.js +3 -3
  64. package/lib/api/api/rollup.js.map +1 -1
  65. package/lib/api/api/scroll.d.ts +3 -3
  66. package/lib/api/api/scroll.js.map +1 -1
  67. package/lib/api/api/search.d.ts +3 -3
  68. package/lib/api/api/search.js +1 -1
  69. package/lib/api/api/search.js.map +1 -1
  70. package/lib/api/api/search_mvt.js +1 -1
  71. package/lib/api/api/search_mvt.js.map +1 -1
  72. package/lib/api/api/searchable_snapshots.d.ts +3 -3
  73. package/lib/api/api/searchable_snapshots.js +1 -0
  74. package/lib/api/api/searchable_snapshots.js.map +1 -1
  75. package/lib/api/api/security.d.ts +54 -27
  76. package/lib/api/api/security.js +302 -18
  77. package/lib/api/api/security.js.map +1 -1
  78. package/lib/api/api/sql.d.ts +9 -9
  79. package/lib/api/api/sql.js +4 -4
  80. package/lib/api/api/sql.js.map +1 -1
  81. package/lib/api/api/transform.d.ts +6 -3
  82. package/lib/api/api/transform.js +20 -2
  83. package/lib/api/api/transform.js.map +1 -1
  84. package/lib/api/api/update.js +1 -1
  85. package/lib/api/api/update.js.map +1 -1
  86. package/lib/api/index.d.ts +4 -0
  87. package/lib/api/index.js +90 -78
  88. package/lib/api/index.js.map +1 -1
  89. package/lib/api/types.d.ts +3026 -1481
  90. package/lib/api/typesWithBodyKey.d.ts +3176 -1530
  91. package/lib/client.js +13 -8
  92. package/lib/client.js.map +1 -1
  93. package/lib/helpers.d.ts +4 -4
  94. package/lib/helpers.js +20 -13
  95. package/lib/helpers.js.map +1 -1
  96. package/lib/sniffingTransport.js +1 -1
  97. package/lib/sniffingTransport.js.map +1 -1
  98. package/package.json +19 -20
package/lib/api/api/ml.js CHANGED
@@ -30,10 +30,24 @@ class Ml {
30
30
  }
31
31
  async closeJob(params, options) {
32
32
  const acceptedPath = ['job_id'];
33
+ const acceptedBody = ['allow_no_match', 'force', 'timeout'];
33
34
  const querystring = {};
34
- const body = undefined;
35
+ // @ts-expect-error
36
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
37
+ let body;
38
+ if (typeof userBody === 'string') {
39
+ body = userBody;
40
+ }
41
+ else {
42
+ body = userBody != null ? { ...userBody } : undefined;
43
+ }
35
44
  for (const key in params) {
36
- if (acceptedPath.includes(key)) {
45
+ if (acceptedBody.includes(key)) {
46
+ body = body !== null && body !== void 0 ? body : {};
47
+ // @ts-expect-error
48
+ body[key] = params[key];
49
+ }
50
+ else if (acceptedPath.includes(key)) {
37
51
  continue;
38
52
  }
39
53
  else if (key !== 'body') {
@@ -356,6 +370,7 @@ class Ml {
356
370
  else {
357
371
  body = userBody != null ? { ...userBody } : undefined;
358
372
  }
373
+ params = params !== null && params !== void 0 ? params : {};
359
374
  for (const key in params) {
360
375
  if (acceptedBody.includes(key)) {
361
376
  body = body !== null && body !== void 0 ? body : {};
@@ -384,7 +399,7 @@ class Ml {
384
399
  }
385
400
  async flushJob(params, options) {
386
401
  const acceptedPath = ['job_id'];
387
- const acceptedBody = ['advance_time', 'calc_interim', 'end', 'start'];
402
+ const acceptedBody = ['advance_time', 'calc_interim', 'end', 'skip_time', 'start'];
388
403
  const querystring = {};
389
404
  // @ts-expect-error
390
405
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -446,7 +461,7 @@ class Ml {
446
461
  }
447
462
  async getBuckets(params, options) {
448
463
  const acceptedPath = ['job_id', 'timestamp'];
449
- const acceptedBody = ['anomaly_score', 'desc', 'exclude_interim', 'expand', 'sort', 'start', 'end'];
464
+ const acceptedBody = ['anomaly_score', 'desc', 'end', 'exclude_interim', 'expand', 'page', 'sort', 'start'];
450
465
  const querystring = {};
451
466
  // @ts-expect-error
452
467
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -792,9 +807,52 @@ class Ml {
792
807
  }
793
808
  return await this.transport.request({ path, method, querystring, body }, options);
794
809
  }
810
+ async getMemoryStats(params, options) {
811
+ const acceptedPath = ['node_id'];
812
+ const querystring = {};
813
+ const body = undefined;
814
+ params = params !== null && params !== void 0 ? params : {};
815
+ for (const key in params) {
816
+ if (acceptedPath.includes(key)) {
817
+ continue;
818
+ }
819
+ else if (key !== 'body') {
820
+ // @ts-expect-error
821
+ querystring[key] = params[key];
822
+ }
823
+ }
824
+ let method = '';
825
+ let path = '';
826
+ if (params.node_id != null) {
827
+ method = 'GET';
828
+ path = `/_ml/memory/${encodeURIComponent(params.node_id.toString())}/_stats`;
829
+ }
830
+ else {
831
+ method = 'GET';
832
+ path = '/_ml/memory/_stats';
833
+ }
834
+ return await this.transport.request({ path, method, querystring, body }, options);
835
+ }
836
+ async getModelSnapshotUpgradeStats(params, options) {
837
+ const acceptedPath = ['job_id', 'snapshot_id'];
838
+ const querystring = {};
839
+ const body = undefined;
840
+ params = params !== null && params !== void 0 ? params : {};
841
+ for (const key in params) {
842
+ if (acceptedPath.includes(key)) {
843
+ continue;
844
+ }
845
+ else if (key !== 'body') {
846
+ querystring[key] = params[key];
847
+ }
848
+ }
849
+ const method = 'GET';
850
+ const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_upgrade/_stats`;
851
+ return await this.transport.request({ path, method, querystring, body }, options);
852
+ }
795
853
  async getModelSnapshots(params, options) {
796
854
  const acceptedPath = ['job_id', 'snapshot_id'];
797
- const acceptedBody = ['start', 'end'];
855
+ const acceptedBody = ['desc', 'end', 'page', 'sort', 'start'];
798
856
  const querystring = {};
799
857
  // @ts-expect-error
800
858
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -833,10 +891,24 @@ class Ml {
833
891
  }
834
892
  async getOverallBuckets(params, options) {
835
893
  const acceptedPath = ['job_id'];
894
+ const acceptedBody = ['allow_no_match', 'bucket_span', 'end', 'exclude_interim', 'overall_score', 'start', 'top_n'];
836
895
  const querystring = {};
837
- const body = undefined;
896
+ // @ts-expect-error
897
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
898
+ let body;
899
+ if (typeof userBody === 'string') {
900
+ body = userBody;
901
+ }
902
+ else {
903
+ body = userBody != null ? { ...userBody } : undefined;
904
+ }
838
905
  for (const key in params) {
839
- if (acceptedPath.includes(key)) {
906
+ if (acceptedBody.includes(key)) {
907
+ body = body !== null && body !== void 0 ? body : {};
908
+ // @ts-expect-error
909
+ body[key] = params[key];
910
+ }
911
+ else if (acceptedPath.includes(key)) {
840
912
  continue;
841
913
  }
842
914
  else if (key !== 'body') {
@@ -850,7 +922,7 @@ class Ml {
850
922
  }
851
923
  async getRecords(params, options) {
852
924
  const acceptedPath = ['job_id'];
853
- const acceptedBody = ['desc', 'exclude_interim', 'page', 'record_score', 'sort', 'start', 'end'];
925
+ const acceptedBody = ['desc', 'end', 'exclude_interim', 'page', 'record_score', 'sort', 'start'];
854
926
  const querystring = {};
855
927
  // @ts-expect-error
856
928
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -879,23 +951,6 @@ class Ml {
879
951
  const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/records`;
880
952
  return await this.transport.request({ path, method, querystring, body }, options);
881
953
  }
882
- async getTrainedModelDeploymentStats(params, options) {
883
- const acceptedPath = ['model_id'];
884
- const querystring = {};
885
- const body = undefined;
886
- params = params !== null && params !== void 0 ? params : {};
887
- for (const key in params) {
888
- if (acceptedPath.includes(key)) {
889
- continue;
890
- }
891
- else if (key !== 'body') {
892
- querystring[key] = params[key];
893
- }
894
- }
895
- const method = 'GET';
896
- const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_stats`;
897
- return await this.transport.request({ path, method, querystring, body }, options);
898
- }
899
954
  async getTrainedModels(params, options) {
900
955
  const acceptedPath = ['model_id'];
901
956
  const querystring = {};
@@ -950,14 +1005,28 @@ class Ml {
950
1005
  }
951
1006
  async inferTrainedModelDeployment(params, options) {
952
1007
  const acceptedPath = ['model_id'];
1008
+ const acceptedBody = ['docs', 'inference_config'];
953
1009
  const querystring = {};
954
- const body = undefined;
955
- params = params !== null && params !== void 0 ? params : {};
1010
+ // @ts-expect-error
1011
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1012
+ let body;
1013
+ if (typeof userBody === 'string') {
1014
+ body = userBody;
1015
+ }
1016
+ else {
1017
+ body = userBody != null ? { ...userBody } : undefined;
1018
+ }
956
1019
  for (const key in params) {
957
- if (acceptedPath.includes(key)) {
1020
+ if (acceptedBody.includes(key)) {
1021
+ body = body !== null && body !== void 0 ? body : {};
1022
+ // @ts-expect-error
1023
+ body[key] = params[key];
1024
+ }
1025
+ else if (acceptedPath.includes(key)) {
958
1026
  continue;
959
1027
  }
960
1028
  else if (key !== 'body') {
1029
+ // @ts-expect-error
961
1030
  querystring[key] = params[key];
962
1031
  }
963
1032
  }
@@ -1151,7 +1220,7 @@ class Ml {
1151
1220
  }
1152
1221
  async putCalendar(params, options) {
1153
1222
  const acceptedPath = ['calendar_id'];
1154
- const acceptedBody = ['description'];
1223
+ const acceptedBody = ['job_ids', 'description'];
1155
1224
  const querystring = {};
1156
1225
  // @ts-expect-error
1157
1226
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -1199,7 +1268,7 @@ class Ml {
1199
1268
  }
1200
1269
  async putDataFrameAnalytics(params, options) {
1201
1270
  const acceptedPath = ['id'];
1202
- const acceptedBody = ['allow_lazy_start', 'analysis', 'analyzed_fields', 'description', 'dest', 'max_num_threads', 'model_memory_limit', 'source'];
1271
+ const acceptedBody = ['allow_lazy_start', 'analysis', 'analyzed_fields', 'description', 'dest', 'max_num_threads', 'model_memory_limit', 'source', 'headers', 'version'];
1203
1272
  const querystring = {};
1204
1273
  // @ts-expect-error
1205
1274
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -1230,7 +1299,7 @@ class Ml {
1230
1299
  }
1231
1300
  async putDatafeed(params, options) {
1232
1301
  const acceptedPath = ['datafeed_id'];
1233
- const acceptedBody = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size'];
1302
+ const acceptedBody = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size', 'headers'];
1234
1303
  const querystring = {};
1235
1304
  // @ts-expect-error
1236
1305
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -1323,7 +1392,7 @@ class Ml {
1323
1392
  }
1324
1393
  async putTrainedModel(params, options) {
1325
1394
  const acceptedPath = ['model_id'];
1326
- const acceptedBody = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'tags'];
1395
+ const acceptedBody = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'model_type', 'model_size_bytes', 'tags'];
1327
1396
  const querystring = {};
1328
1397
  // @ts-expect-error
1329
1398
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -1371,14 +1440,28 @@ class Ml {
1371
1440
  }
1372
1441
  async putTrainedModelDefinitionPart(params, options) {
1373
1442
  const acceptedPath = ['model_id', 'part'];
1443
+ const acceptedBody = ['definition', 'total_definition_length', 'total_parts'];
1374
1444
  const querystring = {};
1375
- const body = undefined;
1376
- params = params !== null && params !== void 0 ? params : {};
1445
+ // @ts-expect-error
1446
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1447
+ let body;
1448
+ if (typeof userBody === 'string') {
1449
+ body = userBody;
1450
+ }
1451
+ else {
1452
+ body = userBody != null ? { ...userBody } : undefined;
1453
+ }
1377
1454
  for (const key in params) {
1378
- if (acceptedPath.includes(key)) {
1455
+ if (acceptedBody.includes(key)) {
1456
+ body = body !== null && body !== void 0 ? body : {};
1457
+ // @ts-expect-error
1458
+ body[key] = params[key];
1459
+ }
1460
+ else if (acceptedPath.includes(key)) {
1379
1461
  continue;
1380
1462
  }
1381
1463
  else if (key !== 'body') {
1464
+ // @ts-expect-error
1382
1465
  querystring[key] = params[key];
1383
1466
  }
1384
1467
  }
@@ -1388,14 +1471,28 @@ class Ml {
1388
1471
  }
1389
1472
  async putTrainedModelVocabulary(params, options) {
1390
1473
  const acceptedPath = ['model_id'];
1474
+ const acceptedBody = ['vocabulary', 'merges'];
1391
1475
  const querystring = {};
1392
- const body = undefined;
1393
- params = params !== null && params !== void 0 ? params : {};
1476
+ // @ts-expect-error
1477
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1478
+ let body;
1479
+ if (typeof userBody === 'string') {
1480
+ body = userBody;
1481
+ }
1482
+ else {
1483
+ body = userBody != null ? { ...userBody } : undefined;
1484
+ }
1394
1485
  for (const key in params) {
1395
- if (acceptedPath.includes(key)) {
1486
+ if (acceptedBody.includes(key)) {
1487
+ body = body !== null && body !== void 0 ? body : {};
1488
+ // @ts-expect-error
1489
+ body[key] = params[key];
1490
+ }
1491
+ else if (acceptedPath.includes(key)) {
1396
1492
  continue;
1397
1493
  }
1398
1494
  else if (key !== 'body') {
1495
+ // @ts-expect-error
1399
1496
  querystring[key] = params[key];
1400
1497
  }
1401
1498
  }
@@ -1521,12 +1618,12 @@ class Ml {
1521
1618
  const acceptedPath = ['model_id'];
1522
1619
  const querystring = {};
1523
1620
  const body = undefined;
1524
- params = params !== null && params !== void 0 ? params : {};
1525
1621
  for (const key in params) {
1526
1622
  if (acceptedPath.includes(key)) {
1527
1623
  continue;
1528
1624
  }
1529
1625
  else if (key !== 'body') {
1626
+ // @ts-expect-error
1530
1627
  querystring[key] = params[key];
1531
1628
  }
1532
1629
  }
@@ -1553,7 +1650,7 @@ class Ml {
1553
1650
  }
1554
1651
  async stopDatafeed(params, options) {
1555
1652
  const acceptedPath = ['datafeed_id'];
1556
- const acceptedBody = ['force', 'timeout'];
1653
+ const acceptedBody = ['allow_no_match', 'force', 'timeout'];
1557
1654
  const querystring = {};
1558
1655
  // @ts-expect-error
1559
1656
  const userBody = params === null || params === void 0 ? void 0 : params.body;
@@ -1586,12 +1683,12 @@ class Ml {
1586
1683
  const acceptedPath = ['model_id'];
1587
1684
  const querystring = {};
1588
1685
  const body = undefined;
1589
- params = params !== null && params !== void 0 ? params : {};
1590
1686
  for (const key in params) {
1591
1687
  if (acceptedPath.includes(key)) {
1592
1688
  continue;
1593
1689
  }
1594
1690
  else if (key !== 'body') {
1691
+ // @ts-expect-error
1595
1692
  querystring[key] = params[key];
1596
1693
  }
1597
1694
  }
@@ -1632,14 +1729,28 @@ class Ml {
1632
1729
  }
1633
1730
  async updateDatafeed(params, options) {
1634
1731
  const acceptedPath = ['datafeed_id'];
1732
+ const acceptedBody = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size'];
1635
1733
  const querystring = {};
1636
- const body = undefined;
1637
- params = params !== null && params !== void 0 ? params : {};
1734
+ // @ts-expect-error
1735
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1736
+ let body;
1737
+ if (typeof userBody === 'string') {
1738
+ body = userBody;
1739
+ }
1740
+ else {
1741
+ body = userBody != null ? { ...userBody } : undefined;
1742
+ }
1638
1743
  for (const key in params) {
1639
- if (acceptedPath.includes(key)) {
1744
+ if (acceptedBody.includes(key)) {
1745
+ body = body !== null && body !== void 0 ? body : {};
1746
+ // @ts-expect-error
1747
+ body[key] = params[key];
1748
+ }
1749
+ else if (acceptedPath.includes(key)) {
1640
1750
  continue;
1641
1751
  }
1642
1752
  else if (key !== 'body') {
1753
+ // @ts-expect-error
1643
1754
  querystring[key] = params[key];
1644
1755
  }
1645
1756
  }
@@ -1759,7 +1870,7 @@ class Ml {
1759
1870
  }
1760
1871
  async validate(params, options) {
1761
1872
  const acceptedPath = [];
1762
- const acceptedBody = ['job_id', 'analysis_config', 'analysis_limits', 'data_description', 'description', 'model_plot', 'model_snapshot_retention_days', 'results_index_name'];
1873
+ const acceptedBody = ['job_id', 'analysis_config', 'analysis_limits', 'data_description', 'description', 'model_plot', 'model_snapshot_id', 'model_snapshot_retention_days', 'results_index_name'];
1763
1874
  const querystring = {};
1764
1875
  // @ts-expect-error
1765
1876
  const userBody = params === null || params === void 0 ? void 0 : params.body;