@retter/elasticsearch 8.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.dockerignore +5 -0
- package/CHANGELOG.md +3 -0
- package/LICENSE +202 -0
- package/NOTICE.txt +2 -0
- package/README.md +186 -0
- package/codecov.yml +14 -0
- package/index.d.ts +27 -0
- package/index.js +55 -0
- package/lib/api/api/async_search.d.ts +23 -0
- package/lib/api/api/async_search.js +131 -0
- package/lib/api/api/async_search.js.map +1 -0
- package/lib/api/api/autoscaling.d.ts +23 -0
- package/lib/api/api/autoscaling.js +109 -0
- package/lib/api/api/autoscaling.js.map +1 -0
- package/lib/api/api/bulk.d.ts +10 -0
- package/lib/api/api/bulk.js +54 -0
- package/lib/api/api/bulk.js.map +1 -0
- package/lib/api/api/cat.d.ts +89 -0
- package/lib/api/api/cat.js +637 -0
- package/lib/api/api/cat.js.map +1 -0
- package/lib/api/api/ccr.d.ts +50 -0
- package/lib/api/api/ccr.js +320 -0
- package/lib/api/api/ccr.js.map +1 -0
- package/lib/api/api/clear_scroll.d.ts +10 -0
- package/lib/api/api/clear_scroll.js +54 -0
- package/lib/api/api/clear_scroll.js.map +1 -0
- package/lib/api/api/close_point_in_time.d.ts +10 -0
- package/lib/api/api/close_point_in_time.js +53 -0
- package/lib/api/api/close_point_in_time.js.map +1 -0
- package/lib/api/api/cluster.d.ts +56 -0
- package/lib/api/api/cluster.js +392 -0
- package/lib/api/api/cluster.js.map +1 -0
- package/lib/api/api/count.d.ts +10 -0
- package/lib/api/api/count.js +62 -0
- package/lib/api/api/count.js.map +1 -0
- package/lib/api/api/create.d.ts +10 -0
- package/lib/api/api/create.js +46 -0
- package/lib/api/api/create.js.map +1 -0
- package/lib/api/api/dangling_indices.d.ts +20 -0
- package/lib/api/api/dangling_indices.js +85 -0
- package/lib/api/api/dangling_indices.js.map +1 -0
- package/lib/api/api/delete.d.ts +10 -0
- package/lib/api/api/delete.js +39 -0
- package/lib/api/api/delete.js.map +1 -0
- package/lib/api/api/delete_by_query.d.ts +10 -0
- package/lib/api/api/delete_by_query.js +53 -0
- package/lib/api/api/delete_by_query.js.map +1 -0
- package/lib/api/api/delete_by_query_rethrottle.d.ts +10 -0
- package/lib/api/api/delete_by_query_rethrottle.js +39 -0
- package/lib/api/api/delete_by_query_rethrottle.js.map +1 -0
- package/lib/api/api/delete_script.d.ts +10 -0
- package/lib/api/api/delete_script.js +39 -0
- package/lib/api/api/delete_script.js.map +1 -0
- package/lib/api/api/enrich.d.ts +26 -0
- package/lib/api/api/enrich.js +142 -0
- package/lib/api/api/enrich.js.map +1 -0
- package/lib/api/api/eql.d.ts +23 -0
- package/lib/api/api/eql.js +115 -0
- package/lib/api/api/eql.js.map +1 -0
- package/lib/api/api/exists.d.ts +10 -0
- package/lib/api/api/exists.js +39 -0
- package/lib/api/api/exists.js.map +1 -0
- package/lib/api/api/exists_source.d.ts +10 -0
- package/lib/api/api/exists_source.js +39 -0
- package/lib/api/api/exists_source.js.map +1 -0
- package/lib/api/api/explain.d.ts +10 -0
- package/lib/api/api/explain.js +53 -0
- package/lib/api/api/explain.js.map +1 -0
- package/lib/api/api/features.d.ts +17 -0
- package/lib/api/api/features.js +69 -0
- package/lib/api/api/features.js.map +1 -0
- package/lib/api/api/field_caps.d.ts +10 -0
- package/lib/api/api/field_caps.js +61 -0
- package/lib/api/api/field_caps.js.map +1 -0
- package/lib/api/api/fleet.d.ts +20 -0
- package/lib/api/api/fleet.js +113 -0
- package/lib/api/api/fleet.js.map +1 -0
- package/lib/api/api/get.d.ts +10 -0
- package/lib/api/api/get.js +39 -0
- package/lib/api/api/get.js.map +1 -0
- package/lib/api/api/get_script.d.ts +10 -0
- package/lib/api/api/get_script.js +39 -0
- package/lib/api/api/get_script.js.map +1 -0
- package/lib/api/api/get_script_context.d.ts +10 -0
- package/lib/api/api/get_script_context.js +40 -0
- package/lib/api/api/get_script_context.js.map +1 -0
- package/lib/api/api/get_script_languages.d.ts +10 -0
- package/lib/api/api/get_script_languages.js +40 -0
- package/lib/api/api/get_script_languages.js.map +1 -0
- package/lib/api/api/get_source.d.ts +10 -0
- package/lib/api/api/get_source.js +39 -0
- package/lib/api/api/get_source.js.map +1 -0
- package/lib/api/api/graph.d.ts +14 -0
- package/lib/api/api/graph.js +64 -0
- package/lib/api/api/graph.js.map +1 -0
- package/lib/api/api/ilm.d.ts +44 -0
- package/lib/api/api/ilm.js +275 -0
- package/lib/api/api/ilm.js.map +1 -0
- package/lib/api/api/index.d.ts +10 -0
- package/lib/api/api/index.js +54 -0
- package/lib/api/api/index.js.map +1 -0
- package/lib/api/api/indices.d.ts +170 -0
- package/lib/api/api/indices.js +1378 -0
- package/lib/api/api/indices.js.map +1 -0
- package/lib/api/api/info.d.ts +10 -0
- package/lib/api/api/info.js +40 -0
- package/lib/api/api/info.js.map +1 -0
- package/lib/api/api/ingest.d.ts +29 -0
- package/lib/api/api/ingest.js +183 -0
- package/lib/api/api/ingest.js.map +1 -0
- package/lib/api/api/knn_search.d.ts +10 -0
- package/lib/api/api/knn_search.js +53 -0
- package/lib/api/api/knn_search.js.map +1 -0
- package/lib/api/api/license.d.ts +32 -0
- package/lib/api/api/license.js +172 -0
- package/lib/api/api/license.js.map +1 -0
- package/lib/api/api/logstash.d.ts +20 -0
- package/lib/api/api/logstash.js +91 -0
- package/lib/api/api/logstash.js.map +1 -0
- package/lib/api/api/mget.d.ts +10 -0
- package/lib/api/api/mget.js +62 -0
- package/lib/api/api/mget.js.map +1 -0
- package/lib/api/api/migration.d.ts +20 -0
- package/lib/api/api/migration.js +95 -0
- package/lib/api/api/migration.js.map +1 -0
- package/lib/api/api/ml.d.ts +224 -0
- package/lib/api/api/ml.js +1929 -0
- package/lib/api/api/ml.js.map +1 -0
- package/lib/api/api/monitoring.d.ts +14 -0
- package/lib/api/api/monitoring.js +57 -0
- package/lib/api/api/monitoring.js.map +1 -0
- package/lib/api/api/msearch.d.ts +10 -0
- package/lib/api/api/msearch.js +54 -0
- package/lib/api/api/msearch.js.map +1 -0
- package/lib/api/api/msearch_template.d.ts +10 -0
- package/lib/api/api/msearch_template.js +54 -0
- package/lib/api/api/msearch_template.js.map +1 -0
- package/lib/api/api/mtermvectors.d.ts +10 -0
- package/lib/api/api/mtermvectors.js +62 -0
- package/lib/api/api/mtermvectors.js.map +1 -0
- package/lib/api/api/nodes.d.ts +32 -0
- package/lib/api/api/nodes.js +243 -0
- package/lib/api/api/nodes.js.map +1 -0
- package/lib/api/api/open_point_in_time.d.ts +10 -0
- package/lib/api/api/open_point_in_time.js +39 -0
- package/lib/api/api/open_point_in_time.js.map +1 -0
- package/lib/api/api/ping.d.ts +10 -0
- package/lib/api/api/ping.js +40 -0
- package/lib/api/api/ping.js.map +1 -0
- package/lib/api/api/put_script.d.ts +10 -0
- package/lib/api/api/put_script.js +61 -0
- package/lib/api/api/put_script.js.map +1 -0
- package/lib/api/api/rank_eval.d.ts +10 -0
- package/lib/api/api/rank_eval.js +61 -0
- package/lib/api/api/rank_eval.js.map +1 -0
- package/lib/api/api/reindex.d.ts +10 -0
- package/lib/api/api/reindex.js +53 -0
- package/lib/api/api/reindex.js.map +1 -0
- package/lib/api/api/reindex_rethrottle.d.ts +10 -0
- package/lib/api/api/reindex_rethrottle.js +39 -0
- package/lib/api/api/reindex_rethrottle.js.map +1 -0
- package/lib/api/api/render_search_template.d.ts +10 -0
- package/lib/api/api/render_search_template.js +62 -0
- package/lib/api/api/render_search_template.js.map +1 -0
- package/lib/api/api/rollup.d.ts +38 -0
- package/lib/api/api/rollup.js +239 -0
- package/lib/api/api/rollup.js.map +1 -0
- package/lib/api/api/scripts_painless_execute.d.ts +10 -0
- package/lib/api/api/scripts_painless_execute.js +54 -0
- package/lib/api/api/scripts_painless_execute.js.map +1 -0
- package/lib/api/api/scroll.d.ts +10 -0
- package/lib/api/api/scroll.js +53 -0
- package/lib/api/api/scroll.js.map +1 -0
- package/lib/api/api/search.d.ts +10 -0
- package/lib/api/api/search.js +69 -0
- package/lib/api/api/search.js.map +1 -0
- package/lib/api/api/search_mvt.d.ts +10 -0
- package/lib/api/api/search_mvt.js +53 -0
- package/lib/api/api/search_mvt.js.map +1 -0
- package/lib/api/api/search_shards.d.ts +10 -0
- package/lib/api/api/search_shards.js +48 -0
- package/lib/api/api/search_shards.js.map +1 -0
- package/lib/api/api/search_template.d.ts +10 -0
- package/lib/api/api/search_template.js +62 -0
- package/lib/api/api/search_template.js.map +1 -0
- package/lib/api/api/searchable_snapshots.d.ts +23 -0
- package/lib/api/api/searchable_snapshots.js +142 -0
- package/lib/api/api/searchable_snapshots.js.map +1 -0
- package/lib/api/api/security.d.ts +173 -0
- package/lib/api/api/security.js +1344 -0
- package/lib/api/api/security.js.map +1 -0
- package/lib/api/api/shutdown.d.ts +20 -0
- package/lib/api/api/shutdown.js +107 -0
- package/lib/api/api/shutdown.js.map +1 -0
- package/lib/api/api/slm.d.ts +38 -0
- package/lib/api/api/slm.js +214 -0
- package/lib/api/api/slm.js.map +1 -0
- package/lib/api/api/snapshot.d.ts +47 -0
- package/lib/api/api/snapshot.js +315 -0
- package/lib/api/api/snapshot.js.map +1 -0
- package/lib/api/api/sql.d.ts +29 -0
- package/lib/api/api/sql.js +178 -0
- package/lib/api/api/sql.js.map +1 -0
- package/lib/api/api/ssl.d.ts +14 -0
- package/lib/api/api/ssl.js +51 -0
- package/lib/api/api/ssl.js.map +1 -0
- package/lib/api/api/tasks.d.ts +20 -0
- package/lib/api/api/tasks.js +94 -0
- package/lib/api/api/tasks.js.map +1 -0
- package/lib/api/api/terms_enum.d.ts +10 -0
- package/lib/api/api/terms_enum.js +53 -0
- package/lib/api/api/terms_enum.js.map +1 -0
- package/lib/api/api/termvectors.d.ts +10 -0
- package/lib/api/api/termvectors.js +61 -0
- package/lib/api/api/termvectors.js.map +1 -0
- package/lib/api/api/text_structure.d.ts +14 -0
- package/lib/api/api/text_structure.js +57 -0
- package/lib/api/api/text_structure.js.map +1 -0
- package/lib/api/api/transform.d.ts +41 -0
- package/lib/api/api/transform.js +264 -0
- package/lib/api/api/transform.js.map +1 -0
- package/lib/api/api/update.d.ts +10 -0
- package/lib/api/api/update.js +53 -0
- package/lib/api/api/update.js.map +1 -0
- package/lib/api/api/update_by_query.d.ts +10 -0
- package/lib/api/api/update_by_query.js +53 -0
- package/lib/api/api/update_by_query.js.map +1 -0
- package/lib/api/api/update_by_query_rethrottle.d.ts +10 -0
- package/lib/api/api/update_by_query_rethrottle.js +39 -0
- package/lib/api/api/update_by_query_rethrottle.js.map +1 -0
- package/lib/api/api/watcher.d.ts +44 -0
- package/lib/api/api/watcher.js +291 -0
- package/lib/api/api/watcher.js.map +1 -0
- package/lib/api/api/xpack.d.ts +17 -0
- package/lib/api/api/xpack.js +69 -0
- package/lib/api/api/xpack.js.map +1 -0
- package/lib/api/index.d.ts +225 -0
- package/lib/api/index.js +520 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/types.d.ts +15306 -0
- package/lib/api/types.js +21 -0
- package/lib/api/types.js.map +1 -0
- package/lib/api/typesWithBodyKey.d.ts +15718 -0
- package/lib/api/typesWithBodyKey.js +21 -0
- package/lib/api/typesWithBodyKey.js.map +1 -0
- package/lib/client.d.ts +70 -0
- package/lib/client.js +287 -0
- package/lib/client.js.map +1 -0
- package/lib/helpers.d.ts +149 -0
- package/lib/helpers.js +776 -0
- package/lib/helpers.js.map +1 -0
- package/lib/sniffingTransport.d.ts +4 -0
- package/lib/sniffingTransport.js +56 -0
- package/lib/sniffingTransport.js.map +1 -0
- package/package.json +93 -0
- package/tsconfig.json +37 -0
package/.dockerignore
ADDED
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright 2020 Elastic and contributors
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
package/NOTICE.txt
ADDED
package/README.md
ADDED
@@ -0,0 +1,186 @@
|
|
1
|
+
<img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png">
|
2
|
+
|
3
|
+
# Elasticsearch Node.js client
|
4
|
+
|
5
|
+
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://clients-ci.elastic.co/buildStatus/icon?job=elastic%2Belasticsearch-js%2Bmain)](https://clients-ci.elastic.co/view/JavaScript/job/elastic+elasticsearch-js+main/) [![Node CI](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [![codecov](https://codecov.io/gh/elastic/elasticsearch-js/branch/master/graph/badge.svg)](https://codecov.io/gh/elastic/elasticsearch-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/elasticsearch.svg?style=flat)](https://www.npmjs.com/package/@elastic/elasticsearch)
|
6
|
+
|
7
|
+
The official Node.js client for Elasticsearch.
|
8
|
+
|
9
|
+
## Features
|
10
|
+
- One-to-one mapping with REST API.
|
11
|
+
- Generalized, pluggable architecture.
|
12
|
+
- Configurable, automatic discovery of cluster nodes.
|
13
|
+
- Persistent, Keep-Alive connections.
|
14
|
+
- Load balancing across all available nodes.
|
15
|
+
- Child client support.
|
16
|
+
- TypeScript support out of the box.
|
17
|
+
|
18
|
+
## Install
|
19
|
+
```
|
20
|
+
npm install @elastic/elasticsearch
|
21
|
+
```
|
22
|
+
|
23
|
+
### Node.js support
|
24
|
+
|
25
|
+
NOTE: The minimum supported version of Node.js is `v14`.
|
26
|
+
|
27
|
+
The client versioning follows the Elastic Stack versioning, this means that
|
28
|
+
major, minor, and patch releases are done following a precise schedule that
|
29
|
+
often does not coincide with the [Node.js release](https://nodejs.org/en/about/releases/) times.
|
30
|
+
|
31
|
+
To avoid support insecure and unsupported versions of Node.js, the
|
32
|
+
client **will drop the support of EOL versions of Node.js between minor releases**.
|
33
|
+
Typically, as soon as a Node.js version goes into EOL, the client will continue
|
34
|
+
to support that version for at least another minor release. If you are using the client
|
35
|
+
with a version of Node.js that will be unsupported soon, you will see a warning
|
36
|
+
in your logs (the client will start logging the warning with two minors in advance).
|
37
|
+
|
38
|
+
Unless you are **always** using a supported version of Node.js,
|
39
|
+
we recommend defining the client dependency in your
|
40
|
+
`package.json` with the `~` instead of `^`. In this way, you will lock the
|
41
|
+
dependency on the minor release and not the major. (for example, `~7.10.0` instead
|
42
|
+
of `^7.10.0`).
|
43
|
+
|
44
|
+
| Node.js Version | Node.js EOL date | End of support |
|
45
|
+
| --------------- |------------------| ---------------------- |
|
46
|
+
| `8.x` | `December 2019` | `7.11` (early 2021) |
|
47
|
+
| `10.x` | `April 2021` | `7.12` (mid 2021) |
|
48
|
+
| `12.x` | `April 2022` | `8.2` (early 2022) |
|
49
|
+
| `14.x` | `April 2023` | `8.8` (early 2023) |
|
50
|
+
|
51
|
+
### Compatibility
|
52
|
+
|
53
|
+
Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch.
|
54
|
+
Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
|
55
|
+
|
56
|
+
| Elasticsearch Version | Client Version |
|
57
|
+
| --------------------- |----------------|
|
58
|
+
| `8.x` | `8.x` |
|
59
|
+
| `7.x` | `7.x` |
|
60
|
+
| `6.x` | `6.x` |
|
61
|
+
| `5.x` | `5.x` |
|
62
|
+
|
63
|
+
To install a specific major of the client, run the following command:
|
64
|
+
```
|
65
|
+
npm install @elastic/elasticsearch@<major>
|
66
|
+
```
|
67
|
+
|
68
|
+
#### Browser
|
69
|
+
|
70
|
+
WARNING: There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues.
|
71
|
+
We recommend that you write a lightweight proxy that uses this client instead, you can see a proxy example [here](./docs/examples/proxy).
|
72
|
+
|
73
|
+
## Documentation
|
74
|
+
|
75
|
+
- [Introduction](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html)
|
76
|
+
- [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#client-usage)
|
77
|
+
- [Client configuration](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html)
|
78
|
+
- [API reference](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)
|
79
|
+
- [Authentication](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#authentication)
|
80
|
+
- [Observability](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html)
|
81
|
+
- [Creating a child client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/child.html)
|
82
|
+
- [Client helpers](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html)
|
83
|
+
- [Typescript support](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/typescript.html)
|
84
|
+
- [Testing](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-testing.html)
|
85
|
+
- [Examples](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/examples.html)
|
86
|
+
|
87
|
+
## Quick start
|
88
|
+
|
89
|
+
```js
|
90
|
+
'use strict'
|
91
|
+
|
92
|
+
const { Client } = require('@elastic/elasticsearch')
|
93
|
+
const client = new Client({
|
94
|
+
cloud: { id: '<cloud-id>' },
|
95
|
+
auth: { apiKey: 'base64EncodedKey' }
|
96
|
+
})
|
97
|
+
|
98
|
+
async function run () {
|
99
|
+
// Let's start by indexing some data
|
100
|
+
await client.index({
|
101
|
+
index: 'game-of-thrones',
|
102
|
+
document: {
|
103
|
+
character: 'Ned Stark',
|
104
|
+
quote: 'Winter is coming.'
|
105
|
+
}
|
106
|
+
})
|
107
|
+
|
108
|
+
await client.index({
|
109
|
+
index: 'game-of-thrones',
|
110
|
+
document: {
|
111
|
+
character: 'Daenerys Targaryen',
|
112
|
+
quote: 'I am the blood of the dragon.'
|
113
|
+
}
|
114
|
+
})
|
115
|
+
|
116
|
+
await client.index({
|
117
|
+
index: 'game-of-thrones',
|
118
|
+
document: {
|
119
|
+
character: 'Tyrion Lannister',
|
120
|
+
quote: 'A mind needs books like a sword needs a whetstone.'
|
121
|
+
}
|
122
|
+
})
|
123
|
+
|
124
|
+
// here we are forcing an index refresh, otherwise we will not
|
125
|
+
// get any result in the consequent search
|
126
|
+
await client.indices.refresh({ index: 'game-of-thrones' })
|
127
|
+
|
128
|
+
// Let's search!
|
129
|
+
const result= await client.search({
|
130
|
+
index: 'game-of-thrones',
|
131
|
+
query: {
|
132
|
+
match: { quote: 'winter' }
|
133
|
+
}
|
134
|
+
})
|
135
|
+
|
136
|
+
console.log(result.hits.hits)
|
137
|
+
}
|
138
|
+
|
139
|
+
run().catch(console.log)
|
140
|
+
```
|
141
|
+
|
142
|
+
## Install multiple versions
|
143
|
+
If you are using multiple versions of Elasticsearch, you need to use multiple versions of the client. In the past, install multiple versions of the same package was not possible, but with `npm v6.9`, you can do that via aliasing.
|
144
|
+
|
145
|
+
The command you must run to install different version of the client is:
|
146
|
+
```sh
|
147
|
+
npm install <alias>@npm:@elastic/elasticsearch@<version>
|
148
|
+
```
|
149
|
+
So for example if you need to install `7.x` and `6.x`, you will run
|
150
|
+
```sh
|
151
|
+
npm install es6@npm:@elastic/elasticsearch@6
|
152
|
+
npm install es7@npm:@elastic/elasticsearch@7
|
153
|
+
```
|
154
|
+
And your `package.json` will look like the following:
|
155
|
+
```json
|
156
|
+
"dependencies": {
|
157
|
+
"es6": "npm:@elastic/elasticsearch@^6.7.0",
|
158
|
+
"es7": "npm:@elastic/elasticsearch@^7.0.0"
|
159
|
+
}
|
160
|
+
```
|
161
|
+
You will require the packages from your code by using the alias you have defined.
|
162
|
+
```js
|
163
|
+
const { Client: Client6 } = require('es6')
|
164
|
+
const { Client: Client7 } = require('es7')
|
165
|
+
|
166
|
+
const client6 = new Client6({
|
167
|
+
cloud: { id: '<cloud-id>' },
|
168
|
+
auth: { apiKey: 'base64EncodedKey' }
|
169
|
+
})
|
170
|
+
const client7 = new Client7({
|
171
|
+
cloud: { id: '<cloud-id>' },
|
172
|
+
auth: { apiKey: 'base64EncodedKey' }
|
173
|
+
})
|
174
|
+
|
175
|
+
client6.info().then(console.log, console.log)
|
176
|
+
client7.info().then(console.log, console.log)
|
177
|
+
```
|
178
|
+
|
179
|
+
Finally, if you want to install the client for the next version of Elasticsearch *(the one that lives in Elasticsearch’s main branch)*, you can use the following command:
|
180
|
+
```sh
|
181
|
+
npm install esmain@github:elastic/elasticsearch-js
|
182
|
+
```
|
183
|
+
|
184
|
+
## License
|
185
|
+
|
186
|
+
This software is licensed under the [Apache License 2.0](./LICENSE).
|
package/codecov.yml
ADDED
package/index.d.ts
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
/*
|
2
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
3
|
+
* license agreements. See the NOTICE file distributed with
|
4
|
+
* this work for additional information regarding copyright
|
5
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
6
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
13
|
+
* software distributed under the License is distributed on an
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
* KIND, either express or implied. See the License for the
|
16
|
+
* specific language governing permissions and limitations
|
17
|
+
* under the License.
|
18
|
+
*/
|
19
|
+
|
20
|
+
import Client from './lib/client'
|
21
|
+
import SniffingTransport from './lib/sniffingTransport'
|
22
|
+
|
23
|
+
export * from '@elastic/transport'
|
24
|
+
export * as estypes from './lib/api/types'
|
25
|
+
export * as estypesWithBody from './lib/api/types'
|
26
|
+
export { Client, SniffingTransport }
|
27
|
+
export type { ClientOptions, NodeOptions } from './lib/client'
|
package/index.js
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
/*
|
2
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
3
|
+
* license agreements. See the NOTICE file distributed with
|
4
|
+
* this work for additional information regarding copyright
|
5
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
6
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
13
|
+
* software distributed under the License is distributed on an
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
* KIND, either express or implied. See the License for the
|
16
|
+
* specific language governing permissions and limitations
|
17
|
+
* under the License.
|
18
|
+
*/
|
19
|
+
|
20
|
+
'use strict'
|
21
|
+
|
22
|
+
const {
|
23
|
+
Diagnostic,
|
24
|
+
Transport,
|
25
|
+
WeightedConnectionPool,
|
26
|
+
ClusterConnectionPool,
|
27
|
+
BaseConnectionPool,
|
28
|
+
CloudConnectionPool,
|
29
|
+
BaseConnection,
|
30
|
+
HttpConnection,
|
31
|
+
UndiciConnection,
|
32
|
+
Serializer,
|
33
|
+
errors,
|
34
|
+
events
|
35
|
+
} = require('@elastic/transport')
|
36
|
+
|
37
|
+
const { default: Client } = require('./lib/client')
|
38
|
+
const { default: SniffingTransport } = require('./lib/sniffingTransport')
|
39
|
+
|
40
|
+
module.exports = {
|
41
|
+
Client,
|
42
|
+
SniffingTransport,
|
43
|
+
Diagnostic,
|
44
|
+
Transport,
|
45
|
+
WeightedConnectionPool,
|
46
|
+
ClusterConnectionPool,
|
47
|
+
BaseConnectionPool,
|
48
|
+
CloudConnectionPool,
|
49
|
+
BaseConnection,
|
50
|
+
HttpConnection,
|
51
|
+
UndiciConnection,
|
52
|
+
Serializer,
|
53
|
+
errors,
|
54
|
+
events
|
55
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
2
|
+
import * as T from '../types';
|
3
|
+
import * as TB from '../typesWithBodyKey';
|
4
|
+
interface That {
|
5
|
+
transport: Transport;
|
6
|
+
}
|
7
|
+
export default class AsyncSearch {
|
8
|
+
transport: Transport;
|
9
|
+
constructor(transport: Transport);
|
10
|
+
delete(this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchDeleteResponse>;
|
11
|
+
delete(this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchDeleteResponse, unknown>>;
|
12
|
+
delete(this: That, params: T.AsyncSearchDeleteRequest | TB.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchDeleteResponse>;
|
13
|
+
get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchGetResponse<TDocument, TAggregations>>;
|
14
|
+
get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchGetResponse<TDocument, TAggregations>, unknown>>;
|
15
|
+
get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchGetResponse<TDocument, TAggregations>>;
|
16
|
+
status(this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchStatusResponse>;
|
17
|
+
status(this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchStatusResponse, unknown>>;
|
18
|
+
status(this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchStatusResponse>;
|
19
|
+
submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>;
|
20
|
+
submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchSubmitResponse<TDocument, TAggregations>, unknown>>;
|
21
|
+
submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>;
|
22
|
+
}
|
23
|
+
export {};
|
@@ -0,0 +1,131 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
4
|
+
* license agreements. See the NOTICE file distributed with
|
5
|
+
* this work for additional information regarding copyright
|
6
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
7
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
8
|
+
* not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
14
|
+
* software distributed under the License is distributed on an
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
* KIND, either express or implied. See the License for the
|
17
|
+
* specific language governing permissions and limitations
|
18
|
+
* under the License.
|
19
|
+
*/
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
21
|
+
class AsyncSearch {
|
22
|
+
constructor(transport) {
|
23
|
+
Object.defineProperty(this, "transport", {
|
24
|
+
enumerable: true,
|
25
|
+
configurable: true,
|
26
|
+
writable: true,
|
27
|
+
value: void 0
|
28
|
+
});
|
29
|
+
this.transport = transport;
|
30
|
+
}
|
31
|
+
async delete(params, options) {
|
32
|
+
const acceptedPath = ['id'];
|
33
|
+
const querystring = {};
|
34
|
+
const body = undefined;
|
35
|
+
for (const key in params) {
|
36
|
+
if (acceptedPath.includes(key)) {
|
37
|
+
continue;
|
38
|
+
}
|
39
|
+
else if (key !== 'body') {
|
40
|
+
// @ts-expect-error
|
41
|
+
querystring[key] = params[key];
|
42
|
+
}
|
43
|
+
}
|
44
|
+
const method = 'DELETE';
|
45
|
+
const path = `/_async_search/${encodeURIComponent(params.id.toString())}`;
|
46
|
+
return await this.transport.request({ path, method, querystring, body }, options);
|
47
|
+
}
|
48
|
+
async get(params, options) {
|
49
|
+
const acceptedPath = ['id'];
|
50
|
+
const querystring = {};
|
51
|
+
const body = undefined;
|
52
|
+
for (const key in params) {
|
53
|
+
if (acceptedPath.includes(key)) {
|
54
|
+
continue;
|
55
|
+
}
|
56
|
+
else if (key !== 'body') {
|
57
|
+
// @ts-expect-error
|
58
|
+
querystring[key] = params[key];
|
59
|
+
}
|
60
|
+
}
|
61
|
+
const method = 'GET';
|
62
|
+
const path = `/_async_search/${encodeURIComponent(params.id.toString())}`;
|
63
|
+
return await this.transport.request({ path, method, querystring, body }, options);
|
64
|
+
}
|
65
|
+
async status(params, options) {
|
66
|
+
const acceptedPath = ['id'];
|
67
|
+
const querystring = {};
|
68
|
+
const body = undefined;
|
69
|
+
for (const key in params) {
|
70
|
+
if (acceptedPath.includes(key)) {
|
71
|
+
continue;
|
72
|
+
}
|
73
|
+
else if (key !== 'body') {
|
74
|
+
// @ts-expect-error
|
75
|
+
querystring[key] = params[key];
|
76
|
+
}
|
77
|
+
}
|
78
|
+
const method = 'GET';
|
79
|
+
const path = `/_async_search/status/${encodeURIComponent(params.id.toString())}`;
|
80
|
+
return await this.transport.request({ path, method, querystring, body }, options);
|
81
|
+
}
|
82
|
+
async submit(params, options) {
|
83
|
+
const acceptedPath = ['index'];
|
84
|
+
const acceptedBody = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats'];
|
85
|
+
const querystring = {};
|
86
|
+
// @ts-expect-error
|
87
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
88
|
+
let body;
|
89
|
+
if (typeof userBody === 'string') {
|
90
|
+
body = userBody;
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
body = userBody != null ? { ...userBody } : undefined;
|
94
|
+
}
|
95
|
+
params = params !== null && params !== void 0 ? params : {};
|
96
|
+
for (const key in params) {
|
97
|
+
if (acceptedBody.includes(key)) {
|
98
|
+
body = body !== null && body !== void 0 ? body : {};
|
99
|
+
// @ts-expect-error
|
100
|
+
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) { // eslint-disable-line
|
101
|
+
// @ts-expect-error
|
102
|
+
querystring[key] = params[key];
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
// @ts-expect-error
|
106
|
+
body[key] = params[key];
|
107
|
+
}
|
108
|
+
}
|
109
|
+
else if (acceptedPath.includes(key)) {
|
110
|
+
continue;
|
111
|
+
}
|
112
|
+
else if (key !== 'body') {
|
113
|
+
// @ts-expect-error
|
114
|
+
querystring[key] = params[key];
|
115
|
+
}
|
116
|
+
}
|
117
|
+
let method = '';
|
118
|
+
let path = '';
|
119
|
+
if (params.index != null) {
|
120
|
+
method = 'POST';
|
121
|
+
path = `/${encodeURIComponent(params.index.toString())}/_async_search`;
|
122
|
+
}
|
123
|
+
else {
|
124
|
+
method = 'POST';
|
125
|
+
path = '/_async_search';
|
126
|
+
}
|
127
|
+
return await this.transport.request({ path, method, querystring, body }, options);
|
128
|
+
}
|
129
|
+
}
|
130
|
+
exports.default = AsyncSearch;
|
131
|
+
//# sourceMappingURL=async_search.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"async_search.js","sourceRoot":"","sources":["../../../src/api/api/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