@opensearch-project/opensearch 2.11.0 → 3.0.0-beta.2

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 (768) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/api/_core/bulk.js +58 -0
  3. package/api/_core/clear_scroll.js +48 -0
  4. package/api/_core/count.js +62 -0
  5. package/api/_core/create.js +61 -0
  6. package/api/_core/create_pit.js +53 -0
  7. package/api/_core/delete.js +59 -0
  8. package/api/_core/delete_all_pits.js +44 -0
  9. package/api/_core/delete_by_query.js +82 -0
  10. package/api/_core/delete_by_query_rethrottle.js +49 -0
  11. package/api/_core/delete_pit.js +46 -0
  12. package/api/_core/delete_script.js +51 -0
  13. package/api/_core/exists.js +61 -0
  14. package/api/_core/exists_source.js +60 -0
  15. package/api/_core/explain.js +64 -0
  16. package/api/_core/field_caps.js +53 -0
  17. package/api/_core/get.js +61 -0
  18. package/api/_core/get_all_pits.js +44 -0
  19. package/api/_core/get_script.js +50 -0
  20. package/api/_core/get_script_context.js +44 -0
  21. package/api/_core/get_script_languages.js +44 -0
  22. package/api/_core/get_source.js +60 -0
  23. package/api/_core/index.js +62 -0
  24. package/api/_core/info.js +44 -0
  25. package/api/_core/mget.js +56 -0
  26. package/api/_core/msearch.js +55 -0
  27. package/api/_core/msearch_template.js +53 -0
  28. package/api/_core/mtermvectors.js +60 -0
  29. package/api/_core/ping.js +44 -0
  30. package/api/_core/put_script.js +54 -0
  31. package/api/_core/rank_eval.js +52 -0
  32. package/api/_core/reindex.js +56 -0
  33. package/api/_core/reindex_rethrottle.js +49 -0
  34. package/api/_core/render_search_template.js +48 -0
  35. package/api/_core/scripts_painless_execute.js +46 -0
  36. package/api/_core/scroll.js +50 -0
  37. package/api/_core/search.js +94 -0
  38. package/api/_core/search_shards.js +53 -0
  39. package/api/_core/search_template.js +61 -0
  40. package/api/_core/termvectors.js +62 -0
  41. package/api/_core/update.js +64 -0
  42. package/api/_core/update_by_query.js +84 -0
  43. package/api/_core/update_by_query_rethrottle.js +49 -0
  44. package/api/cat/_api.js +50 -0
  45. package/api/cat/aliases.js +54 -0
  46. package/api/cat/all_pit_segments.js +51 -0
  47. package/api/cat/allocation.js +56 -0
  48. package/api/cat/cluster_manager.js +53 -0
  49. package/api/cat/count.js +52 -0
  50. package/api/cat/fielddata.js +53 -0
  51. package/api/cat/health.js +52 -0
  52. package/api/cat/help.js +44 -0
  53. package/api/cat/indices.js +61 -0
  54. package/api/cat/master.js +53 -0
  55. package/api/cat/nodeattrs.js +53 -0
  56. package/api/cat/nodes.js +56 -0
  57. package/api/cat/pending_tasks.js +54 -0
  58. package/api/cat/pit_segments.js +52 -0
  59. package/api/cat/plugins.js +53 -0
  60. package/api/cat/recovery.js +56 -0
  61. package/api/cat/repositories.js +53 -0
  62. package/api/cat/segment_replication.js +63 -0
  63. package/api/cat/segments.js +55 -0
  64. package/api/cat/shards.js +57 -0
  65. package/api/cat/snapshots.js +56 -0
  66. package/api/cat/tasks.js +55 -0
  67. package/api/cat/templates.js +55 -0
  68. package/api/cat/thread_pool.js +57 -0
  69. package/api/cluster/_api.js +47 -0
  70. package/api/cluster/allocation_explain.js +48 -0
  71. package/api/cluster/delete_component_template.js +51 -0
  72. package/api/cluster/delete_decommission_awareness.js +44 -0
  73. package/api/cluster/delete_voting_config_exclusions.js +46 -0
  74. package/api/cluster/delete_weighted_routing.js +44 -0
  75. package/api/cluster/exists_component_template.js +51 -0
  76. package/api/cluster/get_component_template.js +50 -0
  77. package/api/cluster/get_decommission_awareness.js +48 -0
  78. package/api/cluster/get_settings.js +50 -0
  79. package/api/cluster/get_weighted_routing.js +48 -0
  80. package/api/cluster/health.js +60 -0
  81. package/api/cluster/pending_tasks.js +49 -0
  82. package/api/cluster/post_voting_config_exclusions.js +48 -0
  83. package/api/cluster/put_component_template.js +53 -0
  84. package/api/cluster/put_decommission_awareness.js +51 -0
  85. package/api/cluster/put_settings.js +50 -0
  86. package/api/cluster/put_weighted_routing.js +48 -0
  87. package/api/cluster/remote_info.js +44 -0
  88. package/api/cluster/reroute.js +53 -0
  89. package/api/cluster/state.js +58 -0
  90. package/api/cluster/stats.js +49 -0
  91. package/api/dangling_indices/_api.js +29 -0
  92. package/api/dangling_indices/delete_dangling_index.js +53 -0
  93. package/api/dangling_indices/import_dangling_index.js +53 -0
  94. package/api/dangling_indices/list_dangling_indices.js +44 -0
  95. package/api/http/_api.js +35 -0
  96. package/api/http/connect.js +48 -0
  97. package/api/http/delete.js +48 -0
  98. package/api/http/get.js +48 -0
  99. package/api/http/head.js +48 -0
  100. package/api/http/options.js +48 -0
  101. package/api/http/patch.js +48 -0
  102. package/api/http/post.js +48 -0
  103. package/api/http/put.js +48 -0
  104. package/api/http/trace.js +48 -0
  105. package/api/index.js +83 -393
  106. package/api/indices/_api.js +74 -0
  107. package/api/indices/add_block.js +57 -0
  108. package/api/indices/analyze.js +48 -0
  109. package/api/indices/clear_cache.js +55 -0
  110. package/api/indices/clone.js +58 -0
  111. package/api/indices/close.js +55 -0
  112. package/api/indices/create.js +53 -0
  113. package/api/indices/create_data_stream.js +49 -0
  114. package/api/indices/data_streams_stats.js +47 -0
  115. package/api/indices/delete.js +54 -0
  116. package/api/indices/delete_alias.js +54 -0
  117. package/api/indices/delete_data_stream.js +48 -0
  118. package/api/indices/delete_index_template.js +51 -0
  119. package/api/indices/delete_template.js +51 -0
  120. package/api/indices/exists.js +55 -0
  121. package/api/indices/exists_alias.js +54 -0
  122. package/api/indices/exists_index_template.js +52 -0
  123. package/api/indices/exists_template.js +52 -0
  124. package/api/indices/flush.js +52 -0
  125. package/api/indices/forcemerge.js +55 -0
  126. package/api/indices/get.js +56 -0
  127. package/api/indices/get_alias.js +53 -0
  128. package/api/indices/get_data_stream.js +47 -0
  129. package/api/indices/get_field_mapping.js +55 -0
  130. package/api/indices/get_index_template.js +51 -0
  131. package/api/indices/get_mapping.js +53 -0
  132. package/api/indices/get_settings.js +57 -0
  133. package/api/indices/get_template.js +51 -0
  134. package/api/indices/get_upgrade.js +50 -0
  135. package/api/indices/open.js +57 -0
  136. package/api/indices/put_alias.js +53 -0
  137. package/api/indices/put_index_template.js +53 -0
  138. package/api/indices/put_mapping.js +56 -0
  139. package/api/indices/put_settings.js +56 -0
  140. package/api/indices/put_template.js +53 -0
  141. package/api/indices/recovery.js +49 -0
  142. package/api/indices/refresh.js +50 -0
  143. package/api/indices/resolve_index.js +49 -0
  144. package/api/indices/rollover.js +57 -0
  145. package/api/indices/segments.js +51 -0
  146. package/api/indices/shard_stores.js +51 -0
  147. package/api/indices/shrink.js +59 -0
  148. package/api/indices/simulate_index_template.js +53 -0
  149. package/api/indices/simulate_template.js +52 -0
  150. package/api/indices/split.js +59 -0
  151. package/api/indices/stats.js +58 -0
  152. package/api/indices/update_aliases.js +49 -0
  153. package/api/indices/upgrade.js +52 -0
  154. package/api/indices/validate_query.js +60 -0
  155. package/api/ingest/_api.js +31 -0
  156. package/api/ingest/delete_pipeline.js +51 -0
  157. package/api/ingest/get_pipeline.js +49 -0
  158. package/api/ingest/processor_grok.js +44 -0
  159. package/api/ingest/put_pipeline.js +52 -0
  160. package/api/ingest/simulate.js +49 -0
  161. package/api/knn/_api.js +32 -0
  162. package/api/knn/delete_model.js +48 -0
  163. package/api/knn/get_model.js +48 -0
  164. package/api/knn/search_models.js +88 -0
  165. package/api/knn/stats.js +50 -0
  166. package/api/knn/train_model.js +49 -0
  167. package/api/knn/warmup.js +48 -0
  168. package/api/ml/_api.js +33 -0
  169. package/api/ml/delete_model.js +48 -0
  170. package/api/ml/delete_model_group.js +48 -0
  171. package/api/ml/get_model_group.js +48 -0
  172. package/api/ml/get_task.js +48 -0
  173. package/api/ml/register_model.js +46 -0
  174. package/api/ml/register_model_group.js +46 -0
  175. package/api/ml/search_models.js +46 -0
  176. package/api/nodes/_api.js +31 -0
  177. package/api/nodes/hot_threads.js +53 -0
  178. package/api/nodes/info.js +51 -0
  179. package/api/nodes/reload_secure_settings.js +49 -0
  180. package/api/nodes/stats.js +59 -0
  181. package/api/nodes/usage.js +50 -0
  182. package/api/notifications/_api.js +35 -0
  183. package/api/notifications/create_config.js +46 -0
  184. package/api/notifications/delete_config.js +48 -0
  185. package/api/notifications/delete_configs.js +48 -0
  186. package/api/notifications/get_config.js +48 -0
  187. package/api/notifications/get_configs.js +84 -0
  188. package/api/notifications/list_channels.js +44 -0
  189. package/api/notifications/list_features.js +44 -0
  190. package/api/notifications/send_test.js +48 -0
  191. package/api/notifications/update_config.js +49 -0
  192. package/api/ppl/_api.js +30 -0
  193. package/api/ppl/explain.js +48 -0
  194. package/api/ppl/get_stats.js +47 -0
  195. package/api/ppl/post_stats.js +48 -0
  196. package/api/ppl/query.js +48 -0
  197. package/api/remote_store/_api.js +27 -0
  198. package/api/remote_store/restore.js +48 -0
  199. package/api/rollups/_api.js +32 -0
  200. package/api/rollups/delete.js +48 -0
  201. package/api/rollups/explain.js +48 -0
  202. package/api/rollups/get.js +48 -0
  203. package/api/rollups/put.js +51 -0
  204. package/api/rollups/start.js +48 -0
  205. package/api/rollups/stop.js +48 -0
  206. package/api/search_pipeline/_api.js +29 -0
  207. package/api/search_pipeline/delete.js +50 -0
  208. package/api/search_pipeline/get.js +48 -0
  209. package/api/search_pipeline/put.js +51 -0
  210. package/api/security/_api.js +100 -0
  211. package/api/security/authinfo.js +47 -0
  212. package/api/security/authtoken.js +44 -0
  213. package/api/security/change_password.js +46 -0
  214. package/api/security/config_upgrade_check.js +44 -0
  215. package/api/security/config_upgrade_perform.js +46 -0
  216. package/api/security/create_action_group.js +49 -0
  217. package/api/security/create_allowlist.js +46 -0
  218. package/api/security/create_role.js +49 -0
  219. package/api/security/create_role_mapping.js +49 -0
  220. package/api/security/create_tenant.js +49 -0
  221. package/api/security/create_update_tenancy_config.js +46 -0
  222. package/api/security/create_user.js +49 -0
  223. package/api/security/create_user_legacy.js +49 -0
  224. package/api/security/delete_action_group.js +48 -0
  225. package/api/security/delete_distinguished_name.js +48 -0
  226. package/api/security/delete_role.js +48 -0
  227. package/api/security/delete_role_mapping.js +48 -0
  228. package/api/security/delete_tenant.js +48 -0
  229. package/api/security/delete_user.js +48 -0
  230. package/api/security/delete_user_legacy.js +48 -0
  231. package/api/security/flush_cache.js +44 -0
  232. package/api/security/generate_obo_token.js +46 -0
  233. package/api/security/generate_user_token.js +48 -0
  234. package/api/security/generate_user_token_legacy.js +48 -0
  235. package/api/security/get_account_details.js +44 -0
  236. package/api/security/get_action_group.js +48 -0
  237. package/api/security/get_action_groups.js +44 -0
  238. package/api/security/get_allowlist.js +44 -0
  239. package/api/security/get_audit_configuration.js +44 -0
  240. package/api/security/get_certificates.js +44 -0
  241. package/api/security/get_configuration.js +44 -0
  242. package/api/security/get_dashboards_info.js +44 -0
  243. package/api/security/get_distinguished_name.js +49 -0
  244. package/api/security/get_distinguished_names.js +46 -0
  245. package/api/security/get_permissions_info.js +44 -0
  246. package/api/security/get_role.js +48 -0
  247. package/api/security/get_role_mapping.js +48 -0
  248. package/api/security/get_role_mappings.js +44 -0
  249. package/api/security/get_roles.js +44 -0
  250. package/api/security/get_sslinfo.js +46 -0
  251. package/api/security/get_tenancy_config.js +44 -0
  252. package/api/security/get_tenant.js +48 -0
  253. package/api/security/get_tenants.js +44 -0
  254. package/api/security/get_user.js +48 -0
  255. package/api/security/get_user_legacy.js +48 -0
  256. package/api/security/get_users.js +44 -0
  257. package/api/security/get_users_legacy.js +44 -0
  258. package/api/security/health.js +46 -0
  259. package/api/security/migrate.js +44 -0
  260. package/api/security/patch_action_group.js +49 -0
  261. package/api/security/patch_action_groups.js +46 -0
  262. package/api/security/patch_allowlist.js +46 -0
  263. package/api/security/patch_audit_configuration.js +46 -0
  264. package/api/security/patch_configuration.js +46 -0
  265. package/api/security/patch_distinguished_name.js +49 -0
  266. package/api/security/patch_distinguished_names.js +46 -0
  267. package/api/security/patch_role.js +49 -0
  268. package/api/security/patch_role_mapping.js +49 -0
  269. package/api/security/patch_role_mappings.js +46 -0
  270. package/api/security/patch_roles.js +46 -0
  271. package/api/security/patch_tenant.js +49 -0
  272. package/api/security/patch_tenants.js +46 -0
  273. package/api/security/patch_user.js +49 -0
  274. package/api/security/patch_users.js +46 -0
  275. package/api/security/post_dashboards_info.js +46 -0
  276. package/api/security/reload_http_certificates.js +44 -0
  277. package/api/security/reload_transport_certificates.js +44 -0
  278. package/api/security/tenant_info.js +44 -0
  279. package/api/security/update_audit_configuration.js +46 -0
  280. package/api/security/update_configuration.js +46 -0
  281. package/api/security/update_distinguished_name.js +49 -0
  282. package/api/security/validate.js +46 -0
  283. package/api/security/who_am_i.js +44 -0
  284. package/api/security/who_am_i_protected.js +44 -0
  285. package/api/snapshot/_api.js +37 -0
  286. package/api/snapshot/cleanup_repository.js +51 -0
  287. package/api/snapshot/clone.js +57 -0
  288. package/api/snapshot/create.js +55 -0
  289. package/api/snapshot/create_repository.js +53 -0
  290. package/api/snapshot/delete.js +53 -0
  291. package/api/snapshot/delete_repository.js +51 -0
  292. package/api/snapshot/get.js +55 -0
  293. package/api/snapshot/get_repository.js +50 -0
  294. package/api/snapshot/restore.js +55 -0
  295. package/api/snapshot/status.js +52 -0
  296. package/api/snapshot/verify_repository.js +51 -0
  297. package/api/sql/_api.js +32 -0
  298. package/api/sql/close.js +48 -0
  299. package/api/sql/explain.js +48 -0
  300. package/api/sql/get_stats.js +47 -0
  301. package/api/sql/post_stats.js +48 -0
  302. package/api/sql/query.js +48 -0
  303. package/api/sql/settings.js +47 -0
  304. package/api/tasks/_api.js +29 -0
  305. package/api/tasks/cancel.js +51 -0
  306. package/api/tasks/get.js +50 -0
  307. package/api/tasks/list.js +52 -0
  308. package/api/transforms/_api.js +34 -0
  309. package/api/transforms/delete.js +48 -0
  310. package/api/transforms/explain.js +48 -0
  311. package/api/transforms/get.js +48 -0
  312. package/api/transforms/preview.js +44 -0
  313. package/api/transforms/put.js +51 -0
  314. package/api/transforms/search.js +50 -0
  315. package/api/transforms/start.js +48 -0
  316. package/api/transforms/stop.js +48 -0
  317. package/api/utils.js +31 -24
  318. package/index.d.ts +3 -5789
  319. package/lib/Helpers.d.ts +23 -25
  320. package/lib/Transport.d.ts +4 -11
  321. package/lib/errors.d.ts +13 -31
  322. package/package.json +3 -9
  323. package/types/Client.d.ts +1717 -0
  324. package/types/client_options.d.ts +102 -0
  325. package/types/components/_common.aggregations.d.ts +1456 -0
  326. package/types/components/_common.analysis.d.ts +643 -0
  327. package/types/components/_common.d.ts +871 -0
  328. package/types/components/_common.mapping.d.ts +519 -0
  329. package/types/components/_common.query_dsl.d.ts +727 -0
  330. package/types/components/_core._common.d.ts +39 -0
  331. package/types/components/_core.bulk.d.ts +77 -0
  332. package/types/components/_core.explain.d.ts +28 -0
  333. package/types/components/_core.field_caps.d.ts +33 -0
  334. package/types/components/_core.get.d.ts +30 -0
  335. package/types/components/_core.get_script_context.d.ts +33 -0
  336. package/types/components/_core.get_script_languages.d.ts +22 -0
  337. package/types/components/_core.mget.d.ts +37 -0
  338. package/types/components/_core.msearch.d.ts +82 -0
  339. package/types/components/_core.msearch_template.d.ts +28 -0
  340. package/types/components/_core.mtermvectors.d.ts +44 -0
  341. package/types/components/_core.rank_eval.d.ts +92 -0
  342. package/types/components/_core.reindex.d.ts +47 -0
  343. package/types/components/_core.reindex_rethrottle.d.ts +50 -0
  344. package/types/components/_core.scripts_painless_execute.d.ts +24 -0
  345. package/types/components/_core.search.d.ts +382 -0
  346. package/types/components/_core.search_shards.d.ts +23 -0
  347. package/types/components/_core.termvectors.d.ts +52 -0
  348. package/types/components/_core.update.d.ts +21 -0
  349. package/types/components/_core.update_by_query_rethrottle.d.ts +22 -0
  350. package/types/components/_global.d.ts +24 -0
  351. package/types/components/cat._common.d.ts +61 -0
  352. package/types/components/cat.aliases.d.ts +26 -0
  353. package/types/components/cat.allocation.d.ts +29 -0
  354. package/types/components/cat.cluster_manager.d.ts +23 -0
  355. package/types/components/cat.count.d.ts +23 -0
  356. package/types/components/cat.fielddata.d.ts +25 -0
  357. package/types/components/cat.health.d.ts +36 -0
  358. package/types/components/cat.indices.d.ts +160 -0
  359. package/types/components/cat.master.d.ts +23 -0
  360. package/types/components/cat.nodeattrs.d.ts +27 -0
  361. package/types/components/cat.nodes.d.ts +118 -0
  362. package/types/components/cat.pending_tasks.d.ts +23 -0
  363. package/types/components/cat.plugins.d.ts +26 -0
  364. package/types/components/cat.recovery.d.ts +46 -0
  365. package/types/components/cat.repositories.d.ts +21 -0
  366. package/types/components/cat.segments.d.ts +35 -0
  367. package/types/components/cat.shards.d.ts +95 -0
  368. package/types/components/cat.snapshots.d.ts +33 -0
  369. package/types/components/cat.tasks.d.ts +36 -0
  370. package/types/components/cat.templates.d.ts +25 -0
  371. package/types/components/cat.thread_pool.d.ts +40 -0
  372. package/types/components/cluster._common.d.ts +39 -0
  373. package/types/components/cluster.allocation_explain.d.ts +97 -0
  374. package/types/components/cluster.health.d.ts +60 -0
  375. package/types/components/cluster.pending_tasks.d.ts +26 -0
  376. package/types/components/cluster.remote_info.d.ts +40 -0
  377. package/types/components/cluster.reroute.d.ts +73 -0
  378. package/types/components/cluster.state.d.ts +18 -0
  379. package/types/components/cluster.stats.d.ts +267 -0
  380. package/types/components/dangling_indices.list_dangling_indices.d.ts +25 -0
  381. package/types/components/indices._common.d.ts +499 -0
  382. package/types/components/indices.add_block.d.ts +24 -0
  383. package/types/components/indices.analyze.d.ts +62 -0
  384. package/types/components/indices.close.d.ts +26 -0
  385. package/types/components/indices.data_streams_stats.d.ts +25 -0
  386. package/types/components/indices.get_alias.d.ts +21 -0
  387. package/types/components/indices.get_field_mapping.d.ts +21 -0
  388. package/types/components/indices.get_index_template.d.ts +23 -0
  389. package/types/components/indices.get_mapping.d.ts +22 -0
  390. package/types/components/indices.put_index_template.d.ts +25 -0
  391. package/types/components/indices.recovery.d.ts +116 -0
  392. package/types/components/indices.resolve_index.d.ts +35 -0
  393. package/types/components/indices.rollover.d.ts +35 -0
  394. package/types/components/indices.segments.d.ts +46 -0
  395. package/types/components/indices.shard_stores.d.ts +40 -0
  396. package/types/components/indices.simulate_template.d.ts +30 -0
  397. package/types/components/indices.stats.d.ts +149 -0
  398. package/types/components/indices.update_aliases.d.ts +52 -0
  399. package/types/components/indices.validate_query.d.ts +24 -0
  400. package/types/components/ingest._common.d.ts +338 -0
  401. package/types/components/ingest.simulate.d.ts +46 -0
  402. package/types/components/knn._common.d.ts +22 -0
  403. package/types/components/ml._common.d.ts +67 -0
  404. package/types/components/nodes._common.d.ts +611 -0
  405. package/types/components/nodes.info.d.ts +338 -0
  406. package/types/components/nodes.reload_secure_settings.d.ts +23 -0
  407. package/types/components/nodes.stats.d.ts +27 -0
  408. package/types/components/nodes.usage.d.ts +32 -0
  409. package/types/components/notifications._common.d.ts +156 -0
  410. package/types/components/remote_store._common.d.ts +28 -0
  411. package/types/components/rollups._common.d.ts +124 -0
  412. package/types/components/search_pipeline._common.d.ts +151 -0
  413. package/types/components/security._common.d.ts +334 -0
  414. package/types/components/snapshot._common.d.ts +134 -0
  415. package/types/components/snapshot.cleanup_repository.d.ts +21 -0
  416. package/types/components/snapshot.get.d.ts +24 -0
  417. package/types/components/snapshot.restore.d.ts +23 -0
  418. package/types/components/snapshot.verify_repository.d.ts +21 -0
  419. package/types/components/sql._common.d.ts +117 -0
  420. package/types/components/tasks._common.d.ts +58 -0
  421. package/types/components/transforms._common.d.ts +130 -0
  422. package/types/functions/bulk.d.ts +48 -0
  423. package/types/functions/cat.aliases.d.ts +36 -0
  424. package/types/functions/cat.all_pit_segments.d.ts +34 -0
  425. package/types/functions/cat.allocation.d.ts +38 -0
  426. package/types/functions/cat.cluster_manager.d.ts +36 -0
  427. package/types/functions/cat.count.d.ts +34 -0
  428. package/types/functions/cat.fielddata.d.ts +35 -0
  429. package/types/functions/cat.health.d.ts +35 -0
  430. package/types/functions/cat.help.d.ts +25 -0
  431. package/types/functions/cat.indices.d.ts +43 -0
  432. package/types/functions/cat.master.d.ts +36 -0
  433. package/types/functions/cat.nodeattrs.d.ts +36 -0
  434. package/types/functions/cat.nodes.d.ts +39 -0
  435. package/types/functions/cat.pending_tasks.d.ts +37 -0
  436. package/types/functions/cat.pit_segments.d.ts +39 -0
  437. package/types/functions/cat.plugins.d.ts +36 -0
  438. package/types/functions/cat.recovery.d.ts +38 -0
  439. package/types/functions/cat.repositories.d.ts +36 -0
  440. package/types/functions/cat.segment_replication.d.ts +45 -0
  441. package/types/functions/cat.segments.d.ts +37 -0
  442. package/types/functions/cat.shards.d.ts +39 -0
  443. package/types/functions/cat.snapshots.d.ts +38 -0
  444. package/types/functions/cat.tasks.d.ts +38 -0
  445. package/types/functions/cat.templates.d.ts +37 -0
  446. package/types/functions/cat.thread_pool.d.ts +38 -0
  447. package/types/functions/clear_scroll.d.ts +36 -0
  448. package/types/functions/cluster.allocation_explain.d.ts +64 -0
  449. package/types/functions/cluster.delete_component_template.d.ts +31 -0
  450. package/types/functions/cluster.delete_decommission_awareness.d.ts +25 -0
  451. package/types/functions/cluster.delete_voting_config_exclusions.d.ts +27 -0
  452. package/types/functions/cluster.delete_weighted_routing.d.ts +25 -0
  453. package/types/functions/cluster.exists_component_template.d.ts +31 -0
  454. package/types/functions/cluster.get_component_template.d.ts +34 -0
  455. package/types/functions/cluster.get_decommission_awareness.d.ts +27 -0
  456. package/types/functions/cluster.get_settings.d.ts +36 -0
  457. package/types/functions/cluster.get_weighted_routing.d.ts +27 -0
  458. package/types/functions/cluster.health.d.ts +42 -0
  459. package/types/functions/cluster.pending_tasks.d.ts +33 -0
  460. package/types/functions/cluster.post_voting_config_exclusions.d.ts +30 -0
  461. package/types/functions/cluster.put_component_template.d.ts +41 -0
  462. package/types/functions/cluster.put_decommission_awareness.d.ts +28 -0
  463. package/types/functions/cluster.put_settings.d.ts +45 -0
  464. package/types/functions/cluster.put_weighted_routing.d.ts +27 -0
  465. package/types/functions/cluster.remote_info.d.ts +26 -0
  466. package/types/functions/cluster.reroute.d.ts +44 -0
  467. package/types/functions/cluster.state.d.ts +39 -0
  468. package/types/functions/cluster.stats.d.ts +31 -0
  469. package/types/functions/count.d.ts +51 -0
  470. package/types/functions/create.d.ts +39 -0
  471. package/types/functions/create_pit.d.ts +38 -0
  472. package/types/functions/dangling_indices.delete_dangling_index.d.ts +32 -0
  473. package/types/functions/dangling_indices.import_dangling_index.d.ts +32 -0
  474. package/types/functions/dangling_indices.list_dangling_indices.d.ts +31 -0
  475. package/types/functions/delete.d.ts +37 -0
  476. package/types/functions/delete_all_pits.d.ts +28 -0
  477. package/types/functions/delete_by_query.d.ts +86 -0
  478. package/types/functions/delete_by_query_rethrottle.d.ts +30 -0
  479. package/types/functions/delete_pit.d.ts +34 -0
  480. package/types/functions/delete_script.d.ts +31 -0
  481. package/types/functions/exists.d.ts +40 -0
  482. package/types/functions/exists_source.d.ts +39 -0
  483. package/types/functions/explain.d.ts +55 -0
  484. package/types/functions/field_caps.d.ts +46 -0
  485. package/types/functions/get.d.ts +41 -0
  486. package/types/functions/get_all_pits.d.ts +28 -0
  487. package/types/functions/get_script.d.ts +34 -0
  488. package/types/functions/get_script_context.d.ts +28 -0
  489. package/types/functions/get_script_languages.d.ts +29 -0
  490. package/types/functions/get_source.d.ts +39 -0
  491. package/types/functions/index.d.ts +43 -0
  492. package/types/functions/indices.add_block.d.ts +40 -0
  493. package/types/functions/indices.analyze.d.ts +46 -0
  494. package/types/functions/indices.clear_cache.d.ts +36 -0
  495. package/types/functions/indices.clone.d.ts +46 -0
  496. package/types/functions/indices.close.d.ts +40 -0
  497. package/types/functions/indices.create.d.ts +45 -0
  498. package/types/functions/indices.create_data_stream.d.ts +31 -0
  499. package/types/functions/indices.data_streams_stats.d.ts +36 -0
  500. package/types/functions/indices.delete.d.ts +34 -0
  501. package/types/functions/indices.delete_alias.d.ts +32 -0
  502. package/types/functions/indices.delete_data_stream.d.ts +28 -0
  503. package/types/functions/indices.delete_index_template.d.ts +31 -0
  504. package/types/functions/indices.delete_template.d.ts +31 -0
  505. package/types/functions/indices.exists.d.ts +35 -0
  506. package/types/functions/indices.exists_alias.d.ts +33 -0
  507. package/types/functions/indices.exists_index_template.d.ts +32 -0
  508. package/types/functions/indices.exists_template.d.ts +32 -0
  509. package/types/functions/indices.flush.d.ts +33 -0
  510. package/types/functions/indices.forcemerge.d.ts +38 -0
  511. package/types/functions/indices.get.d.ts +37 -0
  512. package/types/functions/indices.get_alias.d.ts +34 -0
  513. package/types/functions/indices.get_data_stream.d.ts +31 -0
  514. package/types/functions/indices.get_field_mapping.d.ts +35 -0
  515. package/types/functions/indices.get_index_template.d.ts +35 -0
  516. package/types/functions/indices.get_mapping.d.ts +35 -0
  517. package/types/functions/indices.get_settings.d.ts +38 -0
  518. package/types/functions/indices.get_template.d.ts +33 -0
  519. package/types/functions/indices.get_upgrade.d.ts +31 -0
  520. package/types/functions/indices.open.d.ts +42 -0
  521. package/types/functions/indices.put_alias.d.ts +45 -0
  522. package/types/functions/indices.put_index_template.d.ts +45 -0
  523. package/types/functions/indices.put_mapping.d.ts +51 -0
  524. package/types/functions/indices.put_settings.d.ts +38 -0
  525. package/types/functions/indices.put_template.d.ts +44 -0
  526. package/types/functions/indices.recovery.d.ts +31 -0
  527. package/types/functions/indices.refresh.d.ts +31 -0
  528. package/types/functions/indices.resolve_index.d.ts +34 -0
  529. package/types/functions/indices.rollover.d.ts +53 -0
  530. package/types/functions/indices.segments.d.ts +36 -0
  531. package/types/functions/indices.shard_stores.d.ts +35 -0
  532. package/types/functions/indices.shrink.d.ts +47 -0
  533. package/types/functions/indices.simulate_index_template.d.ts +46 -0
  534. package/types/functions/indices.simulate_template.d.ts +38 -0
  535. package/types/functions/indices.split.d.ts +48 -0
  536. package/types/functions/indices.stats.d.ts +43 -0
  537. package/types/functions/indices.update_aliases.d.ts +36 -0
  538. package/types/functions/indices.upgrade.d.ts +33 -0
  539. package/types/functions/indices.validate_query.d.ts +52 -0
  540. package/types/functions/info.d.ts +32 -0
  541. package/types/functions/ingest.delete_pipeline.d.ts +31 -0
  542. package/types/functions/ingest.get_pipeline.d.ts +31 -0
  543. package/types/functions/ingest.processor_grok.d.ts +27 -0
  544. package/types/functions/ingest.put_pipeline.d.ts +41 -0
  545. package/types/functions/ingest.simulate.d.ts +39 -0
  546. package/types/functions/knn.delete_model.d.ts +27 -0
  547. package/types/functions/knn.get_model.d.ts +27 -0
  548. package/types/functions/knn.search_models.d.ts +73 -0
  549. package/types/functions/knn.stats.d.ts +30 -0
  550. package/types/functions/knn.train_model.d.ts +39 -0
  551. package/types/functions/knn.warmup.d.ts +27 -0
  552. package/types/functions/mget.d.ts +46 -0
  553. package/types/functions/ml.delete_model.d.ts +28 -0
  554. package/types/functions/ml.delete_model_group.d.ts +28 -0
  555. package/types/functions/ml.get_model_group.d.ts +28 -0
  556. package/types/functions/ml.get_task.d.ts +28 -0
  557. package/types/functions/ml.register_model.d.ts +36 -0
  558. package/types/functions/ml.register_model_group.d.ts +36 -0
  559. package/types/functions/ml.search_models.d.ts +28 -0
  560. package/types/functions/msearch.d.ts +39 -0
  561. package/types/functions/msearch_template.d.ts +38 -0
  562. package/types/functions/mtermvectors.d.ts +49 -0
  563. package/types/functions/nodes.hot_threads.d.ts +35 -0
  564. package/types/functions/nodes.info.d.ts +32 -0
  565. package/types/functions/nodes.reload_secure_settings.d.ts +35 -0
  566. package/types/functions/nodes.stats.d.ts +39 -0
  567. package/types/functions/nodes.usage.d.ts +31 -0
  568. package/types/functions/notifications.create_config.d.ts +30 -0
  569. package/types/functions/notifications.delete_config.d.ts +28 -0
  570. package/types/functions/notifications.delete_configs.d.ts +29 -0
  571. package/types/functions/notifications.get_config.d.ts +28 -0
  572. package/types/functions/notifications.get_configs.d.ts +74 -0
  573. package/types/functions/notifications.list_channels.d.ts +31 -0
  574. package/types/functions/notifications.list_features.d.ts +29 -0
  575. package/types/functions/notifications.send_test.d.ts +31 -0
  576. package/types/functions/notifications.update_config.d.ts +31 -0
  577. package/types/functions/ping.d.ts +25 -0
  578. package/types/functions/ppl.explain.d.ts +30 -0
  579. package/types/functions/ppl.get_stats.d.ts +28 -0
  580. package/types/functions/ppl.post_stats.d.ts +30 -0
  581. package/types/functions/ppl.query.d.ts +30 -0
  582. package/types/functions/put_script.d.ts +37 -0
  583. package/types/functions/rank_eval.d.ts +43 -0
  584. package/types/functions/reindex.d.ts +63 -0
  585. package/types/functions/reindex_rethrottle.d.ts +32 -0
  586. package/types/functions/remote_store.restore.d.ts +38 -0
  587. package/types/functions/render_search_template.d.ts +37 -0
  588. package/types/functions/rollups.delete.d.ts +28 -0
  589. package/types/functions/rollups.explain.d.ts +29 -0
  590. package/types/functions/rollups.get.d.ts +29 -0
  591. package/types/functions/rollups.put.d.ts +32 -0
  592. package/types/functions/rollups.start.d.ts +28 -0
  593. package/types/functions/rollups.stop.d.ts +28 -0
  594. package/types/functions/scripts_painless_execute.d.ts +37 -0
  595. package/types/functions/scroll.d.ts +37 -0
  596. package/types/functions/search.d.ts +115 -0
  597. package/types/functions/search_pipeline.delete.d.ts +32 -0
  598. package/types/functions/search_pipeline.get.d.ts +30 -0
  599. package/types/functions/search_pipeline.put.d.ts +34 -0
  600. package/types/functions/search_shards.d.ts +39 -0
  601. package/types/functions/search_template.d.ts +67 -0
  602. package/types/functions/security.authinfo.d.ts +29 -0
  603. package/types/functions/security.authtoken.d.ts +26 -0
  604. package/types/functions/security.change_password.d.ts +28 -0
  605. package/types/functions/security.config_upgrade_check.d.ts +26 -0
  606. package/types/functions/security.config_upgrade_perform.d.ts +28 -0
  607. package/types/functions/security.create_action_group.d.ts +29 -0
  608. package/types/functions/security.create_allowlist.d.ts +28 -0
  609. package/types/functions/security.create_role.d.ts +29 -0
  610. package/types/functions/security.create_role_mapping.d.ts +29 -0
  611. package/types/functions/security.create_tenant.d.ts +29 -0
  612. package/types/functions/security.create_update_tenancy_config.d.ts +30 -0
  613. package/types/functions/security.create_user.d.ts +29 -0
  614. package/types/functions/security.create_user_legacy.d.ts +29 -0
  615. package/types/functions/security.delete_action_group.d.ts +28 -0
  616. package/types/functions/security.delete_distinguished_name.d.ts +28 -0
  617. package/types/functions/security.delete_role.d.ts +28 -0
  618. package/types/functions/security.delete_role_mapping.d.ts +28 -0
  619. package/types/functions/security.delete_tenant.d.ts +28 -0
  620. package/types/functions/security.delete_user.d.ts +28 -0
  621. package/types/functions/security.delete_user_legacy.d.ts +28 -0
  622. package/types/functions/security.flush_cache.d.ts +26 -0
  623. package/types/functions/security.generate_obo_token.d.ts +28 -0
  624. package/types/functions/security.generate_user_token.d.ts +28 -0
  625. package/types/functions/security.generate_user_token_legacy.d.ts +28 -0
  626. package/types/functions/security.get_account_details.d.ts +26 -0
  627. package/types/functions/security.get_action_group.d.ts +28 -0
  628. package/types/functions/security.get_action_groups.d.ts +26 -0
  629. package/types/functions/security.get_allowlist.d.ts +26 -0
  630. package/types/functions/security.get_audit_configuration.d.ts +26 -0
  631. package/types/functions/security.get_certificates.d.ts +26 -0
  632. package/types/functions/security.get_configuration.d.ts +26 -0
  633. package/types/functions/security.get_dashboards_info.d.ts +26 -0
  634. package/types/functions/security.get_distinguished_name.d.ts +29 -0
  635. package/types/functions/security.get_distinguished_names.d.ts +28 -0
  636. package/types/functions/security.get_permissions_info.d.ts +26 -0
  637. package/types/functions/security.get_role.d.ts +28 -0
  638. package/types/functions/security.get_role_mapping.d.ts +28 -0
  639. package/types/functions/security.get_role_mappings.d.ts +26 -0
  640. package/types/functions/security.get_roles.d.ts +26 -0
  641. package/types/functions/security.get_sslinfo.d.ts +28 -0
  642. package/types/functions/security.get_tenancy_config.d.ts +26 -0
  643. package/types/functions/security.get_tenant.d.ts +28 -0
  644. package/types/functions/security.get_tenants.d.ts +26 -0
  645. package/types/functions/security.get_user.d.ts +28 -0
  646. package/types/functions/security.get_user_legacy.d.ts +28 -0
  647. package/types/functions/security.get_users.d.ts +26 -0
  648. package/types/functions/security.get_users_legacy.d.ts +26 -0
  649. package/types/functions/security.health.d.ts +28 -0
  650. package/types/functions/security.migrate.d.ts +26 -0
  651. package/types/functions/security.patch_action_group.d.ts +31 -0
  652. package/types/functions/security.patch_action_groups.d.ts +30 -0
  653. package/types/functions/security.patch_allowlist.d.ts +30 -0
  654. package/types/functions/security.patch_audit_configuration.d.ts +30 -0
  655. package/types/functions/security.patch_configuration.d.ts +30 -0
  656. package/types/functions/security.patch_distinguished_name.d.ts +29 -0
  657. package/types/functions/security.patch_distinguished_names.d.ts +30 -0
  658. package/types/functions/security.patch_role.d.ts +31 -0
  659. package/types/functions/security.patch_role_mapping.d.ts +31 -0
  660. package/types/functions/security.patch_role_mappings.d.ts +30 -0
  661. package/types/functions/security.patch_roles.d.ts +30 -0
  662. package/types/functions/security.patch_tenant.d.ts +31 -0
  663. package/types/functions/security.patch_tenants.d.ts +30 -0
  664. package/types/functions/security.patch_user.d.ts +31 -0
  665. package/types/functions/security.patch_users.d.ts +30 -0
  666. package/types/functions/security.post_dashboards_info.d.ts +28 -0
  667. package/types/functions/security.reload_http_certificates.d.ts +26 -0
  668. package/types/functions/security.reload_transport_certificates.d.ts +26 -0
  669. package/types/functions/security.tenant_info.d.ts +26 -0
  670. package/types/functions/security.update_audit_configuration.d.ts +28 -0
  671. package/types/functions/security.update_configuration.d.ts +28 -0
  672. package/types/functions/security.update_distinguished_name.d.ts +29 -0
  673. package/types/functions/security.validate.d.ts +28 -0
  674. package/types/functions/security.who_am_i.d.ts +26 -0
  675. package/types/functions/security.who_am_i_protected.d.ts +26 -0
  676. package/types/functions/snapshot.cleanup_repository.d.ts +34 -0
  677. package/types/functions/snapshot.clone.d.ts +37 -0
  678. package/types/functions/snapshot.create.d.ts +46 -0
  679. package/types/functions/snapshot.create_repository.d.ts +40 -0
  680. package/types/functions/snapshot.delete.d.ts +31 -0
  681. package/types/functions/snapshot.delete_repository.d.ts +31 -0
  682. package/types/functions/snapshot.get.d.ts +40 -0
  683. package/types/functions/snapshot.get_repository.d.ts +32 -0
  684. package/types/functions/snapshot.restore.d.ts +50 -0
  685. package/types/functions/snapshot.status.d.ts +35 -0
  686. package/types/functions/snapshot.verify_repository.d.ts +34 -0
  687. package/types/functions/sql.close.d.ts +30 -0
  688. package/types/functions/sql.explain.d.ts +30 -0
  689. package/types/functions/sql.get_stats.d.ts +28 -0
  690. package/types/functions/sql.post_stats.d.ts +30 -0
  691. package/types/functions/sql.query.d.ts +30 -0
  692. package/types/functions/sql.settings.d.ts +31 -0
  693. package/types/functions/tasks.cancel.d.ts +33 -0
  694. package/types/functions/tasks.get.d.ts +36 -0
  695. package/types/functions/tasks.list.d.ts +35 -0
  696. package/types/functions/termvectors.d.ts +55 -0
  697. package/types/functions/transforms.delete.d.ts +28 -0
  698. package/types/functions/transforms.explain.d.ts +29 -0
  699. package/types/functions/transforms.get.d.ts +29 -0
  700. package/types/functions/transforms.preview.d.ts +26 -0
  701. package/types/functions/transforms.put.d.ts +32 -0
  702. package/types/functions/transforms.search.d.ts +32 -0
  703. package/types/functions/transforms.start.d.ts +28 -0
  704. package/types/functions/transforms.stop.d.ts +28 -0
  705. package/types/functions/update.d.ts +54 -0
  706. package/types/functions/update_by_query.d.ts +89 -0
  707. package/types/functions/update_by_query_rethrottle.d.ts +32 -0
  708. package/api/api/bulk.js +0 -130
  709. package/api/api/cat.js +0 -933
  710. package/api/api/clear_scroll.js +0 -79
  711. package/api/api/cluster.js +0 -814
  712. package/api/api/count.js +0 -133
  713. package/api/api/create.js +0 -131
  714. package/api/api/create_pit.js +0 -88
  715. package/api/api/dangling_indices.js +0 -214
  716. package/api/api/delete.js +0 -125
  717. package/api/api/delete_all_pits.js +0 -53
  718. package/api/api/delete_by_query.js +0 -192
  719. package/api/api/delete_by_query_rethrottle.js +0 -98
  720. package/api/api/delete_pit.js +0 -61
  721. package/api/api/delete_script.js +0 -94
  722. package/api/api/exists.js +0 -133
  723. package/api/api/exists_source.js +0 -142
  724. package/api/api/explain.js +0 -140
  725. package/api/api/features.js +0 -136
  726. package/api/api/field_caps.js +0 -102
  727. package/api/api/get.js +0 -133
  728. package/api/api/get_all_pits.js +0 -53
  729. package/api/api/get_script.js +0 -95
  730. package/api/api/get_script_context.js +0 -71
  731. package/api/api/get_script_languages.js +0 -71
  732. package/api/api/get_source.js +0 -133
  733. package/api/api/http.js +0 -213
  734. package/api/api/index.js +0 -142
  735. package/api/api/indices.js +0 -2541
  736. package/api/api/info.js +0 -71
  737. package/api/api/ingest.js +0 -335
  738. package/api/api/mget.js +0 -128
  739. package/api/api/msearch.js +0 -125
  740. package/api/api/msearch_template.js +0 -126
  741. package/api/api/mtermvectors.js +0 -98
  742. package/api/api/nodes.js +0 -496
  743. package/api/api/ping.js +0 -71
  744. package/api/api/put_script.js +0 -113
  745. package/api/api/rank_eval.js +0 -107
  746. package/api/api/reindex.js +0 -109
  747. package/api/api/reindex_rethrottle.js +0 -97
  748. package/api/api/render_search_template.js +0 -79
  749. package/api/api/rollups.js +0 -249
  750. package/api/api/scripts_painless_execute.js +0 -73
  751. package/api/api/scroll.js +0 -96
  752. package/api/api/search.js +0 -221
  753. package/api/api/search_shards.js +0 -102
  754. package/api/api/search_template.js +0 -145
  755. package/api/api/security.js +0 -1954
  756. package/api/api/shutdown.js +0 -149
  757. package/api/api/snapshot.js +0 -782
  758. package/api/api/tasks.js +0 -193
  759. package/api/api/terms_enum.js +0 -67
  760. package/api/api/termvectors.js +0 -134
  761. package/api/api/transforms.js +0 -304
  762. package/api/api/update.js +0 -147
  763. package/api/api/update_by_query.js +0 -193
  764. package/api/api/update_by_query_rethrottle.js +0 -98
  765. package/api/new.d.ts +0 -3194
  766. package/api/opensearch_dashboards.d.ts +0 -278
  767. package/api/requestParams.d.ts +0 -1838
  768. package/api/types.d.ts +0 -10014
@@ -1,73 +0,0 @@
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
- 'use strict';
31
-
32
- /* eslint camelcase: 0 */
33
- /* eslint no-unused-vars: 0 */
34
-
35
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
36
- const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
37
- const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
38
-
39
- /**
40
- * Execute Painless script
41
- * <br/> See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/ OpenSearch - Execute Painless script}
42
- * @memberOf API-Script
43
- *
44
- * @param {Object} params
45
- * @param {string} params.body - The painless script
46
- *
47
- * @param {Object} [options] - Options for {@link Transport#request}
48
- * @param {function} [callback] - Callback that handles errors and response
49
- *
50
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
51
- */
52
- function scriptsPainlessExecuteApi(params, options, callback) {
53
- [params, options, callback] = normalizeArguments(params, options, callback);
54
-
55
- let { method, body, ...querystring } = params;
56
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
57
-
58
- let path = '';
59
- if (method == null) method = body == null ? 'GET' : 'POST';
60
- path = '/' + '_scripts' + '/' + 'painless' + '/' + '_execute';
61
-
62
- // build request object
63
- const request = {
64
- method,
65
- path,
66
- body: body || '',
67
- querystring,
68
- };
69
-
70
- return this.transport.request(request, options, callback);
71
- }
72
-
73
- module.exports = scriptsPainlessExecuteApi;
package/api/api/scroll.js DELETED
@@ -1,96 +0,0 @@
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
- 'use strict';
31
-
32
- /* eslint camelcase: 0 */
33
- /* eslint no-unused-vars: 0 */
34
-
35
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
36
- const acceptedQuerystring = [
37
- 'scroll',
38
- 'scroll_id',
39
- 'rest_total_hits_as_int',
40
- 'pretty',
41
- 'human',
42
- 'error_trace',
43
- 'source',
44
- 'filter_path',
45
- ];
46
- const snakeCase = {
47
- scrollId: 'scroll_id',
48
- restTotalHitsAsInt: 'rest_total_hits_as_int',
49
- errorTrace: 'error_trace',
50
- filterPath: 'filter_path',
51
- };
52
-
53
- /**
54
- * Allows to retrieve a large numbers of results from a single search request.
55
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ OpenSearch - Scroll }
56
- *
57
- * @memberOf API-Search
58
- *
59
- * @param {Object} params
60
- * @param {string} [params.scroll_id] - The scroll ID *Deprecated*
61
- * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
62
- * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
63
- * @param {Object} [params.body] - The scroll ID if not passed by URL or query parameter.
64
- *
65
- * @param {Object} [options] - Options for {@link Transport#request}
66
- * @param {function} [callback] - Callback that handles errors and response
67
- *
68
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
69
- */
70
- function scrollApi(params, options, callback) {
71
- [params, options, callback] = normalizeArguments(params, options, callback);
72
-
73
- let { method, body, scrollId, scroll_id, ...querystring } = params;
74
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
75
-
76
- let path = '';
77
- if ((scroll_id || scrollId) != null) {
78
- if (method == null) method = body == null ? 'GET' : 'POST';
79
- path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId);
80
- } else {
81
- if (method == null) method = body == null ? 'GET' : 'POST';
82
- path = '/' + '_search' + '/' + 'scroll';
83
- }
84
-
85
- // build request object
86
- const request = {
87
- method,
88
- path,
89
- body: body || '',
90
- querystring,
91
- };
92
-
93
- return this.transport.request(request, options, callback);
94
- }
95
-
96
- module.exports = scrollApi;
package/api/api/search.js DELETED
@@ -1,221 +0,0 @@
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
- 'use strict';
31
-
32
- /* eslint camelcase: 0 */
33
- /* eslint no-unused-vars: 0 */
34
-
35
- /** @namespace API-Search */
36
-
37
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
38
- const acceptedQuerystring = [
39
- 'analyzer',
40
- 'analyze_wildcard',
41
- 'ccs_minimize_roundtrips',
42
- 'default_operator',
43
- 'df',
44
- 'explain',
45
- 'stored_fields',
46
- 'docvalue_fields',
47
- 'from',
48
- 'ignore_unavailable',
49
- 'ignore_throttled',
50
- 'allow_no_indices',
51
- 'expand_wildcards',
52
- 'lenient',
53
- 'preference',
54
- 'q',
55
- 'routing',
56
- 'scroll',
57
- 'search_pipeline',
58
- 'search_type',
59
- 'size',
60
- 'sort',
61
- '_source',
62
- '_source_excludes',
63
- '_source_exclude',
64
- '_source_includes',
65
- '_source_include',
66
- 'terminate_after',
67
- 'stats',
68
- 'suggest_field',
69
- 'suggest_mode',
70
- 'suggest_size',
71
- 'suggest_text',
72
- 'timeout',
73
- 'track_scores',
74
- 'track_total_hits',
75
- 'allow_partial_search_results',
76
- 'typed_keys',
77
- 'version',
78
- 'seq_no_primary_term',
79
- 'request_cache',
80
- 'batched_reduce_size',
81
- 'max_concurrent_shard_requests',
82
- 'pre_filter_shard_size',
83
- 'rest_total_hits_as_int',
84
- 'min_compatible_shard_node',
85
- 'pretty',
86
- 'human',
87
- 'error_trace',
88
- 'source',
89
- 'filter_path',
90
- ];
91
- const snakeCase = {
92
- analyzeWildcard: 'analyze_wildcard',
93
- ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
94
- defaultOperator: 'default_operator',
95
- storedFields: 'stored_fields',
96
- docvalueFields: 'docvalue_fields',
97
- ignoreUnavailable: 'ignore_unavailable',
98
- ignoreThrottled: 'ignore_throttled',
99
- allowNoIndices: 'allow_no_indices',
100
- expandWildcards: 'expand_wildcards',
101
- searchPipeline: 'search_pipeline',
102
- searchType: 'search_type',
103
- _sourceExcludes: '_source_excludes',
104
- _sourceExclude: '_source_exclude',
105
- _sourceIncludes: '_source_includes',
106
- _sourceInclude: '_source_include',
107
- terminateAfter: 'terminate_after',
108
- suggestField: 'suggest_field',
109
- suggestMode: 'suggest_mode',
110
- suggestSize: 'suggest_size',
111
- suggestText: 'suggest_text',
112
- trackScores: 'track_scores',
113
- trackTotalHits: 'track_total_hits',
114
- allowPartialSearchResults: 'allow_partial_search_results',
115
- typedKeys: 'typed_keys',
116
- seqNoPrimaryTerm: 'seq_no_primary_term',
117
- requestCache: 'request_cache',
118
- batchedReduceSize: 'batched_reduce_size',
119
- maxConcurrentShardRequests: 'max_concurrent_shard_requests',
120
- preFilterShardSize: 'pre_filter_shard_size',
121
- restTotalHitsAsInt: 'rest_total_hits_as_int',
122
- minCompatibleShardNode: 'min_compatible_shard_node',
123
- errorTrace: 'error_trace',
124
- filterPath: 'filter_path',
125
- };
126
-
127
- /**
128
- * Allows to execute several search operations in one request.
129
- * <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/search/ OpenSearch - Search}
130
- *
131
- * @memberOf API-Search
132
- *
133
- * @param {Object} params
134
- * @param {string} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
135
- * @param {string} [params.analyzer] - The analyzer to use for the query string
136
- * @param {boolean} [params.analyze_wildcard] - Specify whether wildcard and prefix queries should be analyzed (default: false)
137
- * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
138
- * @param {string} [params.default_operator] - The default operator for query string query (AND or OR) (options: AND, OR)
139
- * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string
140
- * @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit
141
- * @param {string} [params.stored_fields] - A comma-separated list of stored fields to return as part of a hit
142
- * @param {string} [params.docvalue_fields] - A comma-separated list of fields to return as the docvalue representation of a field for each hit
143
- * @param {number} [params.from] - Starting offset (default: 0)
144
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
145
- * @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled
146
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
147
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
148
- * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
149
- * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
150
- * @param {string} [params.q] - Query in the Lucene query string syntax
151
- * @param {string} [params.routing] - A comma-separated list of specific routing values
152
- * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
153
- * @param {string} [params.search_pipeline] - Customizable sequence of processing stages applied to search queries.
154
- * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
155
- * @param {number} [params.size] - Number of hits to return (default: 10)
156
- * @param {string} [params.sort] - A comma-separated list of <field>:<direction> pairs
157
- * @param {string} [params._source] - True or false to return the _source field or not, or a list of fields to return
158
- * @param {string} [params._source_excludes] - A list of fields to exclude from the returned _source field
159
- * @param {string} [params._source_includes] - A list of fields to extract and return from the _source field
160
- * @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
161
- * @param {string} [params.stats] - Specific 'tag' of the request for logging and statistical purposes
162
- * @param {string} [params.suggest_field] - Specify which field to use for suggestions
163
- * @param {string} [params.suggest_mode] - Specify suggest mode (options: missing, popular, always)
164
- * @param {number} [params.suggest_size] - How many suggestions to return in response
165
- * @param {string} [params.suggest_text] - The source text for which the suggestions should be returned
166
- * @param {string} [params.timeout] - Explicit operation timeout
167
- * @param {boolean} [params.track_scores] - Whether to calculate and return scores even if they are not used for sorting
168
- * @param {boolean} [params.track_total_hits] - Indicate if the number of documents that match the query should be tracked
169
- * @param {boolean} [params.allow_partial_search_results] - Indicate if an error should be returned if there is a partial search failure or timeout
170
- * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
171
- * @param {boolean} [params.version] - Specify whether to return document version as part of a hit
172
- * @param {boolean} [params.seq_no_primary_term] - Specify whether to return sequence number and primary term of the last modification of each hit
173
- * @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting
174
- * @param {number} [params.batched_reduce_size] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
175
- * @param {number} [params.max_concurrent_shard_requests] - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
176
- * @param {number} [params.pre_filter_shard_size] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
177
- * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
178
- * @param {string} [params.min_compatible_shard_node] - The minimum compatible version that all shards involved in search should have for this request to be successful
179
- * @param {Object} [params.body] - The search definition using the Query DSL
180
- *
181
- * @param {Object} options - Options for {@link Transport#request}
182
- * @param {function} callback - Callback that handles errors and response
183
- *
184
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/search/#response-body Search Response}
185
- */
186
- function searchApi(params, options, callback) {
187
- [params, options, callback] = normalizeArguments(params, options, callback);
188
-
189
- // check required url components
190
- if (params.type != null && params.index == null) {
191
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
192
- return handleError(err, callback);
193
- }
194
-
195
- let { method, body, index, type, ...querystring } = params;
196
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
197
-
198
- let path = '';
199
- if (index != null && type != null) {
200
- if (method == null) method = body == null ? 'GET' : 'POST';
201
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search';
202
- } else if (index != null) {
203
- if (method == null) method = body == null ? 'GET' : 'POST';
204
- path = '/' + encodeURIComponent(index) + '/' + '_search';
205
- } else {
206
- if (method == null) method = body == null ? 'GET' : 'POST';
207
- path = '/' + '_search';
208
- }
209
-
210
- // build request object
211
- const request = {
212
- method,
213
- path,
214
- body: body || '',
215
- querystring,
216
- };
217
-
218
- return this.transport.request(request, options, callback);
219
- }
220
-
221
- module.exports = searchApi;
@@ -1,102 +0,0 @@
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
- 'use strict';
31
-
32
- /* eslint camelcase: 0 */
33
- /* eslint no-unused-vars: 0 */
34
-
35
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
36
- const acceptedQuerystring = [
37
- 'preference',
38
- 'routing',
39
- 'local',
40
- 'ignore_unavailable',
41
- 'allow_no_indices',
42
- 'expand_wildcards',
43
- 'pretty',
44
- 'human',
45
- 'error_trace',
46
- 'source',
47
- 'filter_path',
48
- ];
49
- const snakeCase = {
50
- ignoreUnavailable: 'ignore_unavailable',
51
- allowNoIndices: 'allow_no_indices',
52
- expandWildcards: 'expand_wildcards',
53
- errorTrace: 'error_trace',
54
- filterPath: 'filter_path',
55
- };
56
-
57
- /**
58
- * Returns information about the indices and shards that a search request would be executed against.
59
- *
60
- * @memberOf API-Search
61
- *
62
- * @param {Object} params
63
- * @param {string} [params.index] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
64
- * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
65
- * @param {string} [params.routing] - Specific routing value
66
- * @param {boolean} [params.local] - Return local information, do not retrieve the state from cluster_manager node (default: false)
67
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
68
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
69
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
70
- *
71
- * @param {Object} options - Options for {@link Transport#request}
72
- * @param {function} callback - Callback that handles errors and response
73
- *
74
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
75
- */
76
- function searchShardsApi(params, options, callback) {
77
- [params, options, callback] = normalizeArguments(params, options, callback);
78
-
79
- let { method, body, index, ...querystring } = params;
80
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
81
-
82
- let path = '';
83
- if (index != null) {
84
- if (method == null) method = body == null ? 'GET' : 'POST';
85
- path = '/' + encodeURIComponent(index) + '/' + '_search_shards';
86
- } else {
87
- if (method == null) method = body == null ? 'GET' : 'POST';
88
- path = '/' + '_search_shards';
89
- }
90
-
91
- // build request object
92
- const request = {
93
- method,
94
- path,
95
- body: body || '',
96
- querystring,
97
- };
98
-
99
- return this.transport.request(request, options, callback);
100
- }
101
-
102
- module.exports = searchShardsApi;
@@ -1,145 +0,0 @@
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
- 'use strict';
31
-
32
- /* eslint camelcase: 0 */
33
- /* eslint no-unused-vars: 0 */
34
-
35
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
36
- const acceptedQuerystring = [
37
- 'ignore_unavailable',
38
- 'ignore_throttled',
39
- 'allow_no_indices',
40
- 'expand_wildcards',
41
- 'preference',
42
- 'routing',
43
- 'scroll',
44
- 'search_type',
45
- 'explain',
46
- 'profile',
47
- 'typed_keys',
48
- 'rest_total_hits_as_int',
49
- 'ccs_minimize_roundtrips',
50
- 'pretty',
51
- 'human',
52
- 'error_trace',
53
- 'source',
54
- 'filter_path',
55
- ];
56
- const snakeCase = {
57
- ignoreUnavailable: 'ignore_unavailable',
58
- ignoreThrottled: 'ignore_throttled',
59
- allowNoIndices: 'allow_no_indices',
60
- expandWildcards: 'expand_wildcards',
61
- searchType: 'search_type',
62
- typedKeys: 'typed_keys',
63
- restTotalHitsAsInt: 'rest_total_hits_as_int',
64
- ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
65
- errorTrace: 'error_trace',
66
- filterPath: 'filter_path',
67
- };
68
-
69
- /**
70
- * Allows to use the Mustache language to pre-render a search definition.
71
- *
72
- * @memberOf API-Search
73
- *
74
- * @param {Object} params
75
- * @param {string} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
76
- * @param {Object} params.body - The search definition template and its params
77
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
78
- * @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled
79
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
80
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
81
- * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
82
- * @param {string} [params.routing] - A comma-separated list of specific routing values
83
- * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
84
- * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
85
- * @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit
86
- * @param {boolean} [params.profile] - Specify whether to profile the query execution
87
- * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
88
- * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
89
- * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
90
- *
91
- * @param {Object} options - Options for {@link Transport#request}
92
- * @param {function} callback - Callback that handles errors and response
93
- *
94
- * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
95
- */
96
- function searchTemplateApi(params, options, callback) {
97
- [params, options, callback] = normalizeArguments(params, options, callback);
98
-
99
- // check required parameters
100
- if (params.body == null) {
101
- const err = new this[kConfigurationError]('Missing required parameter: body');
102
- return handleError(err, callback);
103
- }
104
-
105
- // check required url components
106
- if (params.type != null && params.index == null) {
107
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
108
- return handleError(err, callback);
109
- }
110
-
111
- let { method, body, index, type, ...querystring } = params;
112
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
113
-
114
- let path = '';
115
- if (index != null && type != null) {
116
- if (method == null) method = body == null ? 'GET' : 'POST';
117
- path =
118
- '/' +
119
- encodeURIComponent(index) +
120
- '/' +
121
- encodeURIComponent(type) +
122
- '/' +
123
- '_search' +
124
- '/' +
125
- 'template';
126
- } else if (index != null) {
127
- if (method == null) method = body == null ? 'GET' : 'POST';
128
- path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template';
129
- } else {
130
- if (method == null) method = body == null ? 'GET' : 'POST';
131
- path = '/' + '_search' + '/' + 'template';
132
- }
133
-
134
- // build request object
135
- const request = {
136
- method,
137
- path,
138
- body: body || '',
139
- querystring,
140
- };
141
-
142
- return this.transport.request(request, options, callback);
143
- }
144
-
145
- module.exports = searchTemplateApi;