You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** @property headers Custom HTTP headers that should be sent with each request */
76
80
headers?: Record<string,any>
81
+
/** @property roles Common Elasticsearch roles that can be assigned to this node. Can be helpful when writing custom nodeFilter or nodeSelector functions. */
/** @property node Elasticsearch node settings, if there is only one node. Required if `nodes` or `cloud` is not set. */
86
92
node?: string|string[]|NodeOptions|NodeOptions[]
93
+
/** @property nodes Elasticsearch node settings, if there are multiple nodes. Required if `node` or `cloud` is not set. */
87
94
nodes?: string|string[]|NodeOptions|NodeOptions[]
95
+
/** @property Connection HTTP connection class to use
96
+
* @defaultValue `UndiciConnection` */
88
97
Connection?: typeofBaseConnection
98
+
/** @property ConnectionPool HTTP connection pool class to use
99
+
* @defaultValue `CloudConnectionPool`, if connecting to Elastic Cloud, otherwise `WeightedConnectionPool` */
89
100
ConnectionPool?: typeofBaseConnectionPool
101
+
/** @property Transport Elastic transport class to use
102
+
* @defaultValue `Transport` */
90
103
Transport?: typeofTransport
104
+
/** @property Serializer Serialization class to use
105
+
* @defaultValue `Serializer` */
91
106
Serializer?: typeofSerializer
107
+
/** @property maxRetries Max number of retries for each request
108
+
* @defaultValue 3 */
92
109
maxRetries?: number
110
+
/** @property requestTimeout Max request timeout in milliseconds for each request
111
+
* @defaultValue 30000 */
93
112
requestTimeout?: number
113
+
/** @property pingTimeout Max number of milliseconds a `ClusterConnectionPool` will wait when pinging nodes before marking them dead
114
+
* @defaultValue 3000 */
94
115
pingTimeout?: number
116
+
/** @property sniffInterval Perform a sniff operation every `n` milliseconds
117
+
* @remarks Sniffing might not be the best solution for you. Read https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how to learn more.
118
+
* @defaultValue */
95
119
sniffInterval?: number|boolean
120
+
/** @property sniffOnStart Perform a sniff once the client is started
121
+
* @remarks Sniffing might not be the best solution for you. Read https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how to learn more.
122
+
* @defaultValue false */
96
123
sniffOnStart?: boolean
124
+
/** @property sniffEndpoint Endpoint to ping during a sniff
125
+
* @remarks Sniffing might not be the best solution for you. Read https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how to learn more.
126
+
* @defaultValue "_nodes/_all/http" */
97
127
sniffEndpoint?: string
128
+
/** @property sniffOnConnectionFault Perform a sniff on connection fault
129
+
* @remarks Sniffing might not be the best solution for you. Read https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how to learn more.
130
+
* @defaultValue false */
98
131
sniffOnConnectionFault?: boolean
132
+
/** @property resurrectStrategy Strategy for resurrecting dead nodes when using `ClusterConnectionPool`. 'ping' will issue a test request to a node and resurrect it if it responds. 'optimistic' marks a node as alive without testing it. 'none` will never attempt to revive a dead connection.
133
+
* @defaultValue 'ping' */
99
134
resurrectStrategy?: 'ping'|'optimistic'|'none'
135
+
/** @property compression Enables gzip request body compression
136
+
* @defaultValue `true` if connecting to Elastic Cloud, otherwise `false`. */
/** @property nodeFilter A custom function used by the connection pool to determine which nodes are qualified to receive a request
145
+
* @defaultValue () => true */
103
146
nodeFilter?: nodeFilterFn
147
+
/** @property nodeSelector A custom function used by the connection pool to determine which node should receive the next request
148
+
* @defaultValue A "round robin" function that loops sequentially through each node in the pool. */
104
149
nodeSelector?: nodeSelectorFn
150
+
/** @property headers Custom HTTP headers that should be sent with each request
151
+
* @defaultValue An object with a custom `user-agent` header */
105
152
headers?: Record<string,any>
153
+
/** @property opaqueIdPrefix A string prefix to apply to every generated X-Opaque-Id header
154
+
* @defaultValue null */
106
155
opaqueIdPrefix?: string
156
+
/** @property generateRequestId A custom function for generating unique IDs for each request, to make it easier to associate each API request to a single response
157
+
* @defaultValue A function that increments a number counter starting from 1 */
107
158
generateRequestId?: generateRequestIdFn
159
+
/** @property name A name for this client
160
+
* @defaultValue 'elasticsearch-js' */
108
161
name?: string|symbol
162
+
/** @property auth Authentication options for this Elasticsearch cluster
163
+
* @defaultValue null */
109
164
auth?: BasicAuth|ApiKeyAuth|BearerAuth
165
+
/** @property context A custom object attached to each request that can be used to pass data to client events
166
+
* @defaultValue null */
110
167
context?: Context
168
+
/** @property proxy A proxy URL that, when provided, the client will automatically send all requests through
169
+
* @defaultValue null */
111
170
proxy?: string|URL
171
+
/** @property enableMetaHeader If true, adds an header named `x-elastic-client-meta`, containing a small amount of high-level telemetry data, such as the client and platform version
172
+
* @defaultValue true */
112
173
enableMetaHeader?: boolean
174
+
/** @property cloud Custom configuration for connecting to Elastic Cloud, in lieu of a `node` or `nodes` configuration
175
+
* @remarks Read https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#client-usage for more details
176
+
* @defaultValue null */
113
177
cloud?: {
114
178
id: string
115
179
}
180
+
/** @property disablePrototypePoisoningProtection Disables safe JSON parsing that protects execution of prototype poisoning attacks; disabled by default, as it can introduce a performance penalty
/** @property caFingerprint If configured, verifies that the fingerprint of the CA certificate that has signed the certificate of the server matches the supplied fingerprint; only accepts SHA256 digest fingerprints
184
+
* @defaultValue null */
117
185
caFingerprint?: string
186
+
/** @property maxResponseSize When configured, verifies that the uncompressed response size is lower than the configured number. If it's higher, it will abort the request. It cannot be higher than `buffer.constants.MAX_STRING_LENGTH`
187
+
* @defaultValue null */
118
188
maxResponseSize?: number
189
+
/** @property maxCompressedResponseSize When configured, verifies that the compressed response size is lower than the configured number. If it's higher, it will abort the request. It cannot be higher than `buffer.constants.MAX_LENGTH`
190
+
* @defaultValue null */
119
191
maxCompressedResponseSize?: number
192
+
/** @property redaction Options for how to redact potentially sensitive data from metadata attached to `Error` objects
193
+
* @remarks Read https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/advanced-config.html#redaction for more details
194
+
* @defaultValue Configuration that will replace known sources of sensitive data */
120
195
redaction?: RedactionOptions
121
196
}
122
197
@@ -127,6 +202,7 @@ export default class Client extends API {
127
202
transport: SniffingTransport
128
203
serializer: Serializer
129
204
helpers: Helpers
205
+
130
206
constructor(opts: ClientOptions){
131
207
super()
132
208
// @ts-expect-error kChild symbol is for internal use only
@@ -139,7 +215,7 @@ export default class Client extends API {
0 commit comments