@elastic/elasticsearch 8.16.3 → 8.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog-info.yaml +4 -1
- package/lib/api/api/async_search.d.ts +4 -4
- package/lib/api/api/async_search.js.map +1 -1
- package/lib/api/api/autoscaling.d.ts +4 -4
- package/lib/api/api/autoscaling.js.map +1 -1
- package/lib/api/api/bulk.d.ts +1 -1
- package/lib/api/api/bulk.js +1 -1
- package/lib/api/api/bulk.js.map +1 -1
- package/lib/api/api/capabilities.js +1 -1
- package/lib/api/api/capabilities.js.map +1 -1
- package/lib/api/api/cat.d.ts +26 -26
- package/lib/api/api/cat.js.map +1 -1
- package/lib/api/api/ccr.d.ts +13 -13
- package/lib/api/api/ccr.js.map +1 -1
- package/lib/api/api/clear_scroll.d.ts +1 -1
- package/lib/api/api/clear_scroll.js +1 -1
- package/lib/api/api/clear_scroll.js.map +1 -1
- package/lib/api/api/close_point_in_time.d.ts +1 -1
- package/lib/api/api/close_point_in_time.js +1 -1
- package/lib/api/api/close_point_in_time.js.map +1 -1
- package/lib/api/api/cluster.d.ts +16 -16
- package/lib/api/api/cluster.js.map +1 -1
- package/lib/api/api/connector.d.ts +30 -30
- package/lib/api/api/connector.js.map +1 -1
- package/lib/api/api/count.d.ts +1 -1
- package/lib/api/api/count.js +1 -1
- package/lib/api/api/count.js.map +1 -1
- package/lib/api/api/create.d.ts +1 -1
- package/lib/api/api/create.js +1 -1
- package/lib/api/api/create.js.map +1 -1
- package/lib/api/api/dangling_indices.d.ts +3 -3
- package/lib/api/api/dangling_indices.js.map +1 -1
- package/lib/api/api/delete.d.ts +1 -1
- package/lib/api/api/delete.js +1 -1
- package/lib/api/api/delete.js.map +1 -1
- package/lib/api/api/delete_by_query.d.ts +1 -1
- package/lib/api/api/delete_by_query.js +1 -1
- package/lib/api/api/delete_by_query.js.map +1 -1
- package/lib/api/api/delete_by_query_rethrottle.d.ts +1 -1
- package/lib/api/api/delete_by_query_rethrottle.js +1 -1
- package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/delete_script.d.ts +1 -1
- package/lib/api/api/delete_script.js +1 -1
- package/lib/api/api/delete_script.js.map +1 -1
- package/lib/api/api/enrich.d.ts +5 -5
- package/lib/api/api/enrich.js.map +1 -1
- package/lib/api/api/eql.d.ts +4 -4
- package/lib/api/api/eql.js.map +1 -1
- package/lib/api/api/esql.d.ts +3 -3
- package/lib/api/api/esql.js.map +1 -1
- package/lib/api/api/exists.d.ts +1 -1
- package/lib/api/api/exists.js +1 -1
- package/lib/api/api/exists.js.map +1 -1
- package/lib/api/api/exists_source.d.ts +1 -1
- package/lib/api/api/exists_source.js +1 -1
- package/lib/api/api/exists_source.js.map +1 -1
- package/lib/api/api/explain.d.ts +1 -1
- package/lib/api/api/explain.js +1 -1
- package/lib/api/api/explain.js.map +1 -1
- package/lib/api/api/features.d.ts +2 -2
- package/lib/api/api/features.js.map +1 -1
- package/lib/api/api/field_caps.d.ts +1 -1
- package/lib/api/api/field_caps.js +1 -1
- package/lib/api/api/field_caps.js.map +1 -1
- package/lib/api/api/fleet.d.ts +1 -1
- package/lib/api/api/fleet.js.map +1 -1
- package/lib/api/api/get.d.ts +1 -1
- package/lib/api/api/get.js +1 -1
- package/lib/api/api/get.js.map +1 -1
- package/lib/api/api/get_script.d.ts +1 -1
- package/lib/api/api/get_script.js +1 -1
- package/lib/api/api/get_script.js.map +1 -1
- package/lib/api/api/get_script_context.d.ts +1 -1
- package/lib/api/api/get_script_context.js +1 -1
- package/lib/api/api/get_script_context.js.map +1 -1
- package/lib/api/api/get_script_languages.d.ts +1 -1
- package/lib/api/api/get_script_languages.js +1 -1
- package/lib/api/api/get_script_languages.js.map +1 -1
- package/lib/api/api/get_source.d.ts +1 -1
- package/lib/api/api/get_source.js +1 -1
- package/lib/api/api/get_source.js.map +1 -1
- package/lib/api/api/graph.d.ts +1 -1
- package/lib/api/api/graph.js.map +1 -1
- package/lib/api/api/health_report.d.ts +1 -1
- package/lib/api/api/health_report.js +1 -1
- package/lib/api/api/health_report.js.map +1 -1
- package/lib/api/api/ilm.d.ts +11 -11
- package/lib/api/api/ilm.js.map +1 -1
- package/lib/api/api/index.d.ts +1 -1
- package/lib/api/api/index.js +1 -1
- package/lib/api/api/index.js.map +1 -1
- package/lib/api/api/indices.d.ts +59 -59
- package/lib/api/api/indices.js.map +1 -1
- package/lib/api/api/inference.d.ts +5 -5
- package/lib/api/api/inference.js.map +1 -1
- package/lib/api/api/info.d.ts +1 -1
- package/lib/api/api/info.js +1 -1
- package/lib/api/api/info.js.map +1 -1
- package/lib/api/api/ingest.d.ts +12 -12
- package/lib/api/api/ingest.js.map +1 -1
- package/lib/api/api/knn_search.d.ts +1 -1
- package/lib/api/api/knn_search.js +1 -1
- package/lib/api/api/knn_search.js.map +1 -1
- package/lib/api/api/license.d.ts +7 -7
- package/lib/api/api/license.js.map +1 -1
- package/lib/api/api/logstash.d.ts +3 -3
- package/lib/api/api/logstash.js.map +1 -1
- package/lib/api/api/mget.d.ts +1 -1
- package/lib/api/api/mget.js +1 -1
- package/lib/api/api/mget.js.map +1 -1
- package/lib/api/api/migration.d.ts +3 -3
- package/lib/api/api/migration.js.map +1 -1
- package/lib/api/api/ml.d.ts +73 -73
- package/lib/api/api/ml.js.map +1 -1
- package/lib/api/api/monitoring.d.ts +1 -1
- package/lib/api/api/monitoring.js.map +1 -1
- package/lib/api/api/msearch.d.ts +1 -1
- package/lib/api/api/msearch.js +1 -1
- package/lib/api/api/msearch.js.map +1 -1
- package/lib/api/api/msearch_template.d.ts +1 -1
- package/lib/api/api/msearch_template.js +1 -1
- package/lib/api/api/msearch_template.js.map +1 -1
- package/lib/api/api/mtermvectors.d.ts +1 -1
- package/lib/api/api/mtermvectors.js +1 -1
- package/lib/api/api/mtermvectors.js.map +1 -1
- package/lib/api/api/nodes.d.ts +7 -7
- package/lib/api/api/nodes.js.map +1 -1
- package/lib/api/api/open_point_in_time.d.ts +1 -1
- package/lib/api/api/open_point_in_time.js +1 -1
- package/lib/api/api/open_point_in_time.js.map +1 -1
- package/lib/api/api/ping.d.ts +1 -1
- package/lib/api/api/ping.js +1 -1
- package/lib/api/api/ping.js.map +1 -1
- package/lib/api/api/profiling.d.ts +4 -4
- package/lib/api/api/profiling.js.map +1 -1
- package/lib/api/api/put_script.d.ts +1 -1
- package/lib/api/api/put_script.js +1 -1
- package/lib/api/api/put_script.js.map +1 -1
- package/lib/api/api/query_rules.d.ts +8 -8
- package/lib/api/api/query_rules.js.map +1 -1
- package/lib/api/api/rank_eval.d.ts +1 -1
- package/lib/api/api/rank_eval.js +1 -1
- package/lib/api/api/rank_eval.js.map +1 -1
- package/lib/api/api/reindex.d.ts +1 -1
- package/lib/api/api/reindex.js +1 -1
- package/lib/api/api/reindex.js.map +1 -1
- package/lib/api/api/reindex_rethrottle.d.ts +1 -1
- package/lib/api/api/reindex_rethrottle.js +1 -1
- package/lib/api/api/reindex_rethrottle.js.map +1 -1
- package/lib/api/api/render_search_template.d.ts +1 -1
- package/lib/api/api/render_search_template.js +1 -1
- package/lib/api/api/render_search_template.js.map +1 -1
- package/lib/api/api/rollup.d.ts +8 -8
- package/lib/api/api/rollup.js.map +1 -1
- package/lib/api/api/scripts_painless_execute.d.ts +1 -1
- package/lib/api/api/scripts_painless_execute.js +1 -1
- package/lib/api/api/scripts_painless_execute.js.map +1 -1
- package/lib/api/api/scroll.d.ts +1 -1
- package/lib/api/api/scroll.js +1 -1
- package/lib/api/api/scroll.js.map +1 -1
- package/lib/api/api/search.d.ts +1 -1
- package/lib/api/api/search.js +1 -1
- package/lib/api/api/search.js.map +1 -1
- package/lib/api/api/search_application.d.ts +9 -9
- package/lib/api/api/search_application.js.map +1 -1
- package/lib/api/api/search_mvt.d.ts +1 -1
- package/lib/api/api/search_mvt.js +1 -1
- package/lib/api/api/search_mvt.js.map +1 -1
- package/lib/api/api/search_shards.d.ts +1 -1
- package/lib/api/api/search_shards.js +1 -1
- package/lib/api/api/search_shards.js.map +1 -1
- package/lib/api/api/search_template.d.ts +1 -1
- package/lib/api/api/search_template.js +1 -1
- package/lib/api/api/search_template.js.map +1 -1
- package/lib/api/api/searchable_snapshots.d.ts +4 -4
- package/lib/api/api/searchable_snapshots.js.map +1 -1
- package/lib/api/api/security.d.ts +63 -63
- package/lib/api/api/security.js +1 -1
- package/lib/api/api/security.js.map +1 -1
- package/lib/api/api/shutdown.js.map +1 -1
- package/lib/api/api/simulate.d.ts +1 -1
- package/lib/api/api/simulate.js.map +1 -1
- package/lib/api/api/slm.d.ts +9 -9
- package/lib/api/api/slm.js.map +1 -1
- package/lib/api/api/snapshot.d.ts +13 -13
- package/lib/api/api/snapshot.js.map +1 -1
- package/lib/api/api/sql.d.ts +6 -6
- package/lib/api/api/sql.js.map +1 -1
- package/lib/api/api/ssl.d.ts +1 -1
- package/lib/api/api/ssl.js.map +1 -1
- package/lib/api/api/synonyms.d.ts +7 -7
- package/lib/api/api/synonyms.js.map +1 -1
- package/lib/api/api/tasks.d.ts +3 -3
- package/lib/api/api/tasks.js.map +1 -1
- package/lib/api/api/terms_enum.d.ts +1 -1
- package/lib/api/api/terms_enum.js +1 -1
- package/lib/api/api/terms_enum.js.map +1 -1
- package/lib/api/api/termvectors.d.ts +1 -1
- package/lib/api/api/termvectors.js +1 -1
- package/lib/api/api/termvectors.js.map +1 -1
- package/lib/api/api/text_structure.d.ts +4 -4
- package/lib/api/api/text_structure.js.map +1 -1
- package/lib/api/api/transform.d.ts +12 -12
- package/lib/api/api/transform.js.map +1 -1
- package/lib/api/api/update.d.ts +1 -1
- package/lib/api/api/update.js +1 -1
- package/lib/api/api/update.js.map +1 -1
- package/lib/api/api/update_by_query.d.ts +1 -1
- package/lib/api/api/update_by_query.js +1 -1
- package/lib/api/api/update_by_query.js.map +1 -1
- package/lib/api/api/update_by_query_rethrottle.d.ts +1 -1
- package/lib/api/api/update_by_query_rethrottle.js +1 -1
- package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/watcher.d.ts +13 -13
- package/lib/api/api/watcher.js.map +1 -1
- package/lib/api/api/xpack.d.ts +2 -2
- package/lib/api/api/xpack.js.map +1 -1
- package/lib/api/index.js +1 -1
- package/lib/api/index.js.map +1 -1
- package/lib/api/types.d.ts +37 -12
- package/lib/api/typesWithBodyKey.d.ts +37 -12
- package/lib/client.d.ts +82 -2
- package/lib/client.js +8 -1
- package/lib/client.js.map +1 -1
- package/lib/helpers.d.ts +0 -3
- package/lib/helpers.js +7 -6
- package/lib/helpers.js.map +1 -1
- package/package.json +33 -33
package/lib/api/types.d.ts
CHANGED
|
@@ -2225,12 +2225,19 @@ export interface RetrieverContainer {
|
|
|
2225
2225
|
knn?: KnnRetriever;
|
|
2226
2226
|
rrf?: RRFRetriever;
|
|
2227
2227
|
text_similarity_reranker?: TextSimilarityReranker;
|
|
2228
|
+
rule?: RuleRetriever;
|
|
2228
2229
|
}
|
|
2229
2230
|
export type Routing = string;
|
|
2230
2231
|
export interface RrfRank {
|
|
2231
2232
|
rank_constant?: long;
|
|
2232
2233
|
rank_window_size?: long;
|
|
2233
2234
|
}
|
|
2235
|
+
export interface RuleRetriever extends RetrieverBase {
|
|
2236
|
+
ruleset_ids: Id[];
|
|
2237
|
+
match_criteria: any;
|
|
2238
|
+
retriever: RetrieverContainer;
|
|
2239
|
+
rank_window_size?: integer;
|
|
2240
|
+
}
|
|
2234
2241
|
export type ScalarValue = long | double | string | boolean | null;
|
|
2235
2242
|
export interface ScoreSort {
|
|
2236
2243
|
order?: SortOrder;
|
|
@@ -5596,7 +5603,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase {
|
|
|
5596
5603
|
index?: Indices;
|
|
5597
5604
|
wait_for_completion_timeout?: Duration;
|
|
5598
5605
|
keep_on_completion?: boolean;
|
|
5599
|
-
keep_alive?: Duration;
|
|
5600
5606
|
allow_no_indices?: boolean;
|
|
5601
5607
|
allow_partial_search_results?: boolean;
|
|
5602
5608
|
analyzer?: string;
|
|
@@ -5612,7 +5618,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase {
|
|
|
5612
5618
|
max_concurrent_shard_requests?: long;
|
|
5613
5619
|
min_compatible_shard_node?: VersionString;
|
|
5614
5620
|
preference?: string;
|
|
5615
|
-
pre_filter_shard_size?: long;
|
|
5616
5621
|
request_cache?: boolean;
|
|
5617
5622
|
routing?: Routing;
|
|
5618
5623
|
search_type?: SearchType;
|
|
@@ -9466,8 +9471,8 @@ export interface IndicesMappingLimitSettingsNestedObjects {
|
|
|
9466
9471
|
limit?: long;
|
|
9467
9472
|
}
|
|
9468
9473
|
export interface IndicesMappingLimitSettingsTotalFields {
|
|
9469
|
-
limit?: long;
|
|
9470
|
-
ignore_dynamic_beyond_limit?: boolean;
|
|
9474
|
+
limit?: long | string;
|
|
9475
|
+
ignore_dynamic_beyond_limit?: boolean | string;
|
|
9471
9476
|
}
|
|
9472
9477
|
export interface IndicesMerge {
|
|
9473
9478
|
scheduler?: IndicesMergeScheduler;
|
|
@@ -11433,6 +11438,7 @@ export interface MigrationDeprecationsRequest extends RequestBase {
|
|
|
11433
11438
|
export interface MigrationDeprecationsResponse {
|
|
11434
11439
|
cluster_settings: MigrationDeprecationsDeprecation[];
|
|
11435
11440
|
index_settings: Record<string, MigrationDeprecationsDeprecation[]>;
|
|
11441
|
+
data_streams: Record<string, MigrationDeprecationsDeprecation[]>;
|
|
11436
11442
|
node_settings: MigrationDeprecationsDeprecation[];
|
|
11437
11443
|
ml_settings: MigrationDeprecationsDeprecation[];
|
|
11438
11444
|
}
|
|
@@ -14796,7 +14802,7 @@ export interface SecurityBulkError {
|
|
|
14796
14802
|
export interface SecurityClusterNode {
|
|
14797
14803
|
name: Name;
|
|
14798
14804
|
}
|
|
14799
|
-
export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string;
|
|
14805
|
+
export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_stats' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string;
|
|
14800
14806
|
export interface SecurityCreatedStatus {
|
|
14801
14807
|
created: boolean;
|
|
14802
14808
|
}
|
|
@@ -14816,7 +14822,7 @@ export type SecurityGrantType = 'password' | 'access_token';
|
|
|
14816
14822
|
export type SecurityIndexPrivilege = 'all' | 'auto_configure' | 'create' | 'create_doc' | 'create_index' | 'cross_cluster_replication' | 'cross_cluster_replication_internal' | 'delete' | 'delete_index' | 'index' | 'maintenance' | 'manage' | 'manage_data_stream_lifecycle' | 'manage_follow_index' | 'manage_ilm' | 'manage_leader_index' | 'monitor' | 'none' | 'read' | 'read_cross_cluster' | 'view_index_metadata' | 'write' | string;
|
|
14817
14823
|
export interface SecurityIndicesPrivileges {
|
|
14818
14824
|
field_security?: SecurityFieldSecurity;
|
|
14819
|
-
names:
|
|
14825
|
+
names: IndexName | IndexName[];
|
|
14820
14826
|
privileges: SecurityIndexPrivilege[];
|
|
14821
14827
|
query?: SecurityIndicesPrivilegesQuery;
|
|
14822
14828
|
allow_restricted_indices?: boolean;
|
|
@@ -14829,38 +14835,53 @@ export interface SecurityRealmInfo {
|
|
|
14829
14835
|
name: Name;
|
|
14830
14836
|
type: string;
|
|
14831
14837
|
}
|
|
14838
|
+
export type SecurityRemoteClusterPrivilege = 'monitor_enrich' | 'monitor_stats';
|
|
14839
|
+
export interface SecurityRemoteClusterPrivileges {
|
|
14840
|
+
clusters: Names;
|
|
14841
|
+
privileges: SecurityRemoteClusterPrivilege[];
|
|
14842
|
+
}
|
|
14832
14843
|
export interface SecurityRemoteIndicesPrivileges {
|
|
14833
14844
|
clusters: Names;
|
|
14834
14845
|
field_security?: SecurityFieldSecurity;
|
|
14835
|
-
names:
|
|
14846
|
+
names: IndexName | IndexName[];
|
|
14836
14847
|
privileges: SecurityIndexPrivilege[];
|
|
14837
14848
|
query?: SecurityIndicesPrivilegesQuery;
|
|
14838
14849
|
allow_restricted_indices?: boolean;
|
|
14839
14850
|
}
|
|
14840
14851
|
export interface SecurityReplicationAccess {
|
|
14841
|
-
names: IndexName[];
|
|
14852
|
+
names: IndexName | IndexName[];
|
|
14842
14853
|
allow_restricted_indices?: boolean;
|
|
14843
14854
|
}
|
|
14855
|
+
export interface SecurityRestriction {
|
|
14856
|
+
workflows: SecurityRestrictionWorkflow[];
|
|
14857
|
+
}
|
|
14858
|
+
export type SecurityRestrictionWorkflow = 'search_application_query' | string;
|
|
14844
14859
|
export interface SecurityRoleDescriptor {
|
|
14845
14860
|
cluster?: SecurityClusterPrivilege[];
|
|
14846
14861
|
indices?: SecurityIndicesPrivileges[];
|
|
14847
14862
|
index?: SecurityIndicesPrivileges[];
|
|
14863
|
+
remote_indices?: SecurityRemoteIndicesPrivileges[];
|
|
14864
|
+
remote_cluster?: SecurityRemoteClusterPrivileges[];
|
|
14848
14865
|
global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege;
|
|
14849
14866
|
applications?: SecurityApplicationPrivileges[];
|
|
14850
14867
|
metadata?: Metadata;
|
|
14851
14868
|
run_as?: string[];
|
|
14852
14869
|
description?: string;
|
|
14870
|
+
restriction?: SecurityRestriction;
|
|
14853
14871
|
transient_metadata?: Record<string, any>;
|
|
14854
14872
|
}
|
|
14855
14873
|
export interface SecurityRoleDescriptorRead {
|
|
14856
14874
|
cluster: SecurityClusterPrivilege[];
|
|
14857
14875
|
indices: SecurityIndicesPrivileges[];
|
|
14858
14876
|
index: SecurityIndicesPrivileges[];
|
|
14877
|
+
remote_indices?: SecurityRemoteIndicesPrivileges[];
|
|
14878
|
+
remote_cluster?: SecurityRemoteClusterPrivileges[];
|
|
14859
14879
|
global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege;
|
|
14860
14880
|
applications?: SecurityApplicationPrivileges[];
|
|
14861
14881
|
metadata?: Metadata;
|
|
14862
14882
|
run_as?: string[];
|
|
14863
14883
|
description?: string;
|
|
14884
|
+
restriction?: SecurityRestriction;
|
|
14864
14885
|
transient_metadata?: Record<string, any>;
|
|
14865
14886
|
}
|
|
14866
14887
|
export interface SecurityRoleMapping {
|
|
@@ -14893,7 +14914,7 @@ export interface SecurityRoleTemplateScript {
|
|
|
14893
14914
|
}
|
|
14894
14915
|
export interface SecuritySearchAccess {
|
|
14895
14916
|
field_security?: SecurityFieldSecurity;
|
|
14896
|
-
names: IndexName[];
|
|
14917
|
+
names: IndexName | IndexName[];
|
|
14897
14918
|
query?: SecurityIndicesPrivilegesQuery;
|
|
14898
14919
|
allow_restricted_indices?: boolean;
|
|
14899
14920
|
}
|
|
@@ -14909,7 +14930,7 @@ export interface SecurityUser {
|
|
|
14909
14930
|
}
|
|
14910
14931
|
export interface SecurityUserIndicesPrivileges {
|
|
14911
14932
|
field_security?: SecurityFieldSecurity[];
|
|
14912
|
-
names:
|
|
14933
|
+
names: IndexName | IndexName[];
|
|
14913
14934
|
privileges: SecurityIndexPrivilege[];
|
|
14914
14935
|
query?: SecurityIndicesPrivilegesQuery[];
|
|
14915
14936
|
allow_restricted_indices: boolean;
|
|
@@ -15176,8 +15197,9 @@ export interface SecurityGetApiKeyResponse {
|
|
|
15176
15197
|
export interface SecurityGetBuiltinPrivilegesRequest extends RequestBase {
|
|
15177
15198
|
}
|
|
15178
15199
|
export interface SecurityGetBuiltinPrivilegesResponse {
|
|
15179
|
-
cluster:
|
|
15200
|
+
cluster: SecurityClusterPrivilege[];
|
|
15180
15201
|
index: Indices;
|
|
15202
|
+
remote_cluster: SecurityRemoteClusterPrivilege[];
|
|
15181
15203
|
}
|
|
15182
15204
|
export interface SecurityGetPrivilegesRequest extends RequestBase {
|
|
15183
15205
|
application?: Name;
|
|
@@ -15189,8 +15211,10 @@ export interface SecurityGetRoleRequest extends RequestBase {
|
|
|
15189
15211
|
}
|
|
15190
15212
|
export type SecurityGetRoleResponse = Record<string, SecurityGetRoleRole>;
|
|
15191
15213
|
export interface SecurityGetRoleRole {
|
|
15192
|
-
cluster:
|
|
15214
|
+
cluster: SecurityClusterPrivilege[];
|
|
15193
15215
|
indices: SecurityIndicesPrivileges[];
|
|
15216
|
+
remote_indices?: SecurityRemoteIndicesPrivileges[];
|
|
15217
|
+
remote_cluster?: SecurityRemoteClusterPrivileges[];
|
|
15194
15218
|
metadata: Metadata;
|
|
15195
15219
|
run_as: string[];
|
|
15196
15220
|
transient_metadata?: Record<string, any>;
|
|
@@ -15398,6 +15422,7 @@ export interface SecurityPutRoleRequest extends RequestBase {
|
|
|
15398
15422
|
global?: Record<string, any>;
|
|
15399
15423
|
indices?: SecurityIndicesPrivileges[];
|
|
15400
15424
|
remote_indices?: SecurityRemoteIndicesPrivileges[];
|
|
15425
|
+
remote_cluster?: SecurityRemoteClusterPrivileges[];
|
|
15401
15426
|
metadata?: Metadata;
|
|
15402
15427
|
run_as?: string[];
|
|
15403
15428
|
description?: string;
|
|
@@ -2301,12 +2301,19 @@ export interface RetrieverContainer {
|
|
|
2301
2301
|
knn?: KnnRetriever;
|
|
2302
2302
|
rrf?: RRFRetriever;
|
|
2303
2303
|
text_similarity_reranker?: TextSimilarityReranker;
|
|
2304
|
+
rule?: RuleRetriever;
|
|
2304
2305
|
}
|
|
2305
2306
|
export type Routing = string;
|
|
2306
2307
|
export interface RrfRank {
|
|
2307
2308
|
rank_constant?: long;
|
|
2308
2309
|
rank_window_size?: long;
|
|
2309
2310
|
}
|
|
2311
|
+
export interface RuleRetriever extends RetrieverBase {
|
|
2312
|
+
ruleset_ids: Id[];
|
|
2313
|
+
match_criteria: any;
|
|
2314
|
+
retriever: RetrieverContainer;
|
|
2315
|
+
rank_window_size?: integer;
|
|
2316
|
+
}
|
|
2310
2317
|
export type ScalarValue = long | double | string | boolean | null;
|
|
2311
2318
|
export interface ScoreSort {
|
|
2312
2319
|
order?: SortOrder;
|
|
@@ -5672,7 +5679,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase {
|
|
|
5672
5679
|
index?: Indices;
|
|
5673
5680
|
wait_for_completion_timeout?: Duration;
|
|
5674
5681
|
keep_on_completion?: boolean;
|
|
5675
|
-
keep_alive?: Duration;
|
|
5676
5682
|
allow_no_indices?: boolean;
|
|
5677
5683
|
allow_partial_search_results?: boolean;
|
|
5678
5684
|
analyzer?: string;
|
|
@@ -5688,7 +5694,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase {
|
|
|
5688
5694
|
max_concurrent_shard_requests?: long;
|
|
5689
5695
|
min_compatible_shard_node?: VersionString;
|
|
5690
5696
|
preference?: string;
|
|
5691
|
-
pre_filter_shard_size?: long;
|
|
5692
5697
|
request_cache?: boolean;
|
|
5693
5698
|
routing?: Routing;
|
|
5694
5699
|
search_type?: SearchType;
|
|
@@ -9643,8 +9648,8 @@ export interface IndicesMappingLimitSettingsNestedObjects {
|
|
|
9643
9648
|
limit?: long;
|
|
9644
9649
|
}
|
|
9645
9650
|
export interface IndicesMappingLimitSettingsTotalFields {
|
|
9646
|
-
limit?: long;
|
|
9647
|
-
ignore_dynamic_beyond_limit?: boolean;
|
|
9651
|
+
limit?: long | string;
|
|
9652
|
+
ignore_dynamic_beyond_limit?: boolean | string;
|
|
9648
9653
|
}
|
|
9649
9654
|
export interface IndicesMerge {
|
|
9650
9655
|
scheduler?: IndicesMergeScheduler;
|
|
@@ -11674,6 +11679,7 @@ export interface MigrationDeprecationsRequest extends RequestBase {
|
|
|
11674
11679
|
export interface MigrationDeprecationsResponse {
|
|
11675
11680
|
cluster_settings: MigrationDeprecationsDeprecation[];
|
|
11676
11681
|
index_settings: Record<string, MigrationDeprecationsDeprecation[]>;
|
|
11682
|
+
data_streams: Record<string, MigrationDeprecationsDeprecation[]>;
|
|
11677
11683
|
node_settings: MigrationDeprecationsDeprecation[];
|
|
11678
11684
|
ml_settings: MigrationDeprecationsDeprecation[];
|
|
11679
11685
|
}
|
|
@@ -15176,7 +15182,7 @@ export interface SecurityBulkError {
|
|
|
15176
15182
|
export interface SecurityClusterNode {
|
|
15177
15183
|
name: Name;
|
|
15178
15184
|
}
|
|
15179
|
-
export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string;
|
|
15185
|
+
export type SecurityClusterPrivilege = 'all' | 'cancel_task' | 'create_snapshot' | 'cross_cluster_replication' | 'cross_cluster_search' | 'delegate_pki' | 'grant_api_key' | 'manage' | 'manage_api_key' | 'manage_autoscaling' | 'manage_behavioral_analytics' | 'manage_ccr' | 'manage_data_frame_transforms' | 'manage_data_stream_global_retention' | 'manage_enrich' | 'manage_ilm' | 'manage_index_templates' | 'manage_inference' | 'manage_ingest_pipelines' | 'manage_logstash_pipelines' | 'manage_ml' | 'manage_oidc' | 'manage_own_api_key' | 'manage_pipeline' | 'manage_rollup' | 'manage_saml' | 'manage_search_application' | 'manage_search_query_rules' | 'manage_search_synonyms' | 'manage_security' | 'manage_service_account' | 'manage_slm' | 'manage_token' | 'manage_transform' | 'manage_user_profile' | 'manage_watcher' | 'monitor' | 'monitor_data_frame_transforms' | 'monitor_data_stream_global_retention' | 'monitor_enrich' | 'monitor_inference' | 'monitor_ml' | 'monitor_rollup' | 'monitor_snapshot' | 'monitor_stats' | 'monitor_text_structure' | 'monitor_transform' | 'monitor_watcher' | 'none' | 'post_behavioral_analytics_event' | 'read_ccr' | 'read_fleet_secrets' | 'read_ilm' | 'read_pipeline' | 'read_security' | 'read_slm' | 'transport_client' | 'write_connector_secrets' | 'write_fleet_secrets' | string;
|
|
15180
15186
|
export interface SecurityCreatedStatus {
|
|
15181
15187
|
created: boolean;
|
|
15182
15188
|
}
|
|
@@ -15196,7 +15202,7 @@ export type SecurityGrantType = 'password' | 'access_token';
|
|
|
15196
15202
|
export type SecurityIndexPrivilege = 'all' | 'auto_configure' | 'create' | 'create_doc' | 'create_index' | 'cross_cluster_replication' | 'cross_cluster_replication_internal' | 'delete' | 'delete_index' | 'index' | 'maintenance' | 'manage' | 'manage_data_stream_lifecycle' | 'manage_follow_index' | 'manage_ilm' | 'manage_leader_index' | 'monitor' | 'none' | 'read' | 'read_cross_cluster' | 'view_index_metadata' | 'write' | string;
|
|
15197
15203
|
export interface SecurityIndicesPrivileges {
|
|
15198
15204
|
field_security?: SecurityFieldSecurity;
|
|
15199
|
-
names:
|
|
15205
|
+
names: IndexName | IndexName[];
|
|
15200
15206
|
privileges: SecurityIndexPrivilege[];
|
|
15201
15207
|
query?: SecurityIndicesPrivilegesQuery;
|
|
15202
15208
|
allow_restricted_indices?: boolean;
|
|
@@ -15209,38 +15215,53 @@ export interface SecurityRealmInfo {
|
|
|
15209
15215
|
name: Name;
|
|
15210
15216
|
type: string;
|
|
15211
15217
|
}
|
|
15218
|
+
export type SecurityRemoteClusterPrivilege = 'monitor_enrich' | 'monitor_stats';
|
|
15219
|
+
export interface SecurityRemoteClusterPrivileges {
|
|
15220
|
+
clusters: Names;
|
|
15221
|
+
privileges: SecurityRemoteClusterPrivilege[];
|
|
15222
|
+
}
|
|
15212
15223
|
export interface SecurityRemoteIndicesPrivileges {
|
|
15213
15224
|
clusters: Names;
|
|
15214
15225
|
field_security?: SecurityFieldSecurity;
|
|
15215
|
-
names:
|
|
15226
|
+
names: IndexName | IndexName[];
|
|
15216
15227
|
privileges: SecurityIndexPrivilege[];
|
|
15217
15228
|
query?: SecurityIndicesPrivilegesQuery;
|
|
15218
15229
|
allow_restricted_indices?: boolean;
|
|
15219
15230
|
}
|
|
15220
15231
|
export interface SecurityReplicationAccess {
|
|
15221
|
-
names: IndexName[];
|
|
15232
|
+
names: IndexName | IndexName[];
|
|
15222
15233
|
allow_restricted_indices?: boolean;
|
|
15223
15234
|
}
|
|
15235
|
+
export interface SecurityRestriction {
|
|
15236
|
+
workflows: SecurityRestrictionWorkflow[];
|
|
15237
|
+
}
|
|
15238
|
+
export type SecurityRestrictionWorkflow = 'search_application_query' | string;
|
|
15224
15239
|
export interface SecurityRoleDescriptor {
|
|
15225
15240
|
cluster?: SecurityClusterPrivilege[];
|
|
15226
15241
|
indices?: SecurityIndicesPrivileges[];
|
|
15227
15242
|
index?: SecurityIndicesPrivileges[];
|
|
15243
|
+
remote_indices?: SecurityRemoteIndicesPrivileges[];
|
|
15244
|
+
remote_cluster?: SecurityRemoteClusterPrivileges[];
|
|
15228
15245
|
global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege;
|
|
15229
15246
|
applications?: SecurityApplicationPrivileges[];
|
|
15230
15247
|
metadata?: Metadata;
|
|
15231
15248
|
run_as?: string[];
|
|
15232
15249
|
description?: string;
|
|
15250
|
+
restriction?: SecurityRestriction;
|
|
15233
15251
|
transient_metadata?: Record<string, any>;
|
|
15234
15252
|
}
|
|
15235
15253
|
export interface SecurityRoleDescriptorRead {
|
|
15236
15254
|
cluster: SecurityClusterPrivilege[];
|
|
15237
15255
|
indices: SecurityIndicesPrivileges[];
|
|
15238
15256
|
index: SecurityIndicesPrivileges[];
|
|
15257
|
+
remote_indices?: SecurityRemoteIndicesPrivileges[];
|
|
15258
|
+
remote_cluster?: SecurityRemoteClusterPrivileges[];
|
|
15239
15259
|
global?: SecurityGlobalPrivilege[] | SecurityGlobalPrivilege;
|
|
15240
15260
|
applications?: SecurityApplicationPrivileges[];
|
|
15241
15261
|
metadata?: Metadata;
|
|
15242
15262
|
run_as?: string[];
|
|
15243
15263
|
description?: string;
|
|
15264
|
+
restriction?: SecurityRestriction;
|
|
15244
15265
|
transient_metadata?: Record<string, any>;
|
|
15245
15266
|
}
|
|
15246
15267
|
export interface SecurityRoleMapping {
|
|
@@ -15273,7 +15294,7 @@ export interface SecurityRoleTemplateScript {
|
|
|
15273
15294
|
}
|
|
15274
15295
|
export interface SecuritySearchAccess {
|
|
15275
15296
|
field_security?: SecurityFieldSecurity;
|
|
15276
|
-
names: IndexName[];
|
|
15297
|
+
names: IndexName | IndexName[];
|
|
15277
15298
|
query?: SecurityIndicesPrivilegesQuery;
|
|
15278
15299
|
allow_restricted_indices?: boolean;
|
|
15279
15300
|
}
|
|
@@ -15289,7 +15310,7 @@ export interface SecurityUser {
|
|
|
15289
15310
|
}
|
|
15290
15311
|
export interface SecurityUserIndicesPrivileges {
|
|
15291
15312
|
field_security?: SecurityFieldSecurity[];
|
|
15292
|
-
names:
|
|
15313
|
+
names: IndexName | IndexName[];
|
|
15293
15314
|
privileges: SecurityIndexPrivilege[];
|
|
15294
15315
|
query?: SecurityIndicesPrivilegesQuery[];
|
|
15295
15316
|
allow_restricted_indices: boolean;
|
|
@@ -15574,8 +15595,9 @@ export interface SecurityGetApiKeyResponse {
|
|
|
15574
15595
|
export interface SecurityGetBuiltinPrivilegesRequest extends RequestBase {
|
|
15575
15596
|
}
|
|
15576
15597
|
export interface SecurityGetBuiltinPrivilegesResponse {
|
|
15577
|
-
cluster:
|
|
15598
|
+
cluster: SecurityClusterPrivilege[];
|
|
15578
15599
|
index: Indices;
|
|
15600
|
+
remote_cluster: SecurityRemoteClusterPrivilege[];
|
|
15579
15601
|
}
|
|
15580
15602
|
export interface SecurityGetPrivilegesRequest extends RequestBase {
|
|
15581
15603
|
application?: Name;
|
|
@@ -15587,8 +15609,10 @@ export interface SecurityGetRoleRequest extends RequestBase {
|
|
|
15587
15609
|
}
|
|
15588
15610
|
export type SecurityGetRoleResponse = Record<string, SecurityGetRoleRole>;
|
|
15589
15611
|
export interface SecurityGetRoleRole {
|
|
15590
|
-
cluster:
|
|
15612
|
+
cluster: SecurityClusterPrivilege[];
|
|
15591
15613
|
indices: SecurityIndicesPrivileges[];
|
|
15614
|
+
remote_indices?: SecurityRemoteIndicesPrivileges[];
|
|
15615
|
+
remote_cluster?: SecurityRemoteClusterPrivileges[];
|
|
15592
15616
|
metadata: Metadata;
|
|
15593
15617
|
run_as: string[];
|
|
15594
15618
|
transient_metadata?: Record<string, any>;
|
|
@@ -15817,6 +15841,7 @@ export interface SecurityPutRoleRequest extends RequestBase {
|
|
|
15817
15841
|
global?: Record<string, any>;
|
|
15818
15842
|
indices?: SecurityIndicesPrivileges[];
|
|
15819
15843
|
remote_indices?: SecurityRemoteIndicesPrivileges[];
|
|
15844
|
+
remote_cluster?: SecurityRemoteClusterPrivileges[];
|
|
15820
15845
|
metadata?: Metadata;
|
|
15821
15846
|
run_as?: string[];
|
|
15822
15847
|
description?: string;
|
package/lib/client.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { ConnectionOptions as TlsConnectionOptions } from 'node:tls';
|
|
4
2
|
import { URL } from 'node:url';
|
|
5
3
|
import { Transport, Serializer, Diagnostic, BaseConnectionPool } from '@elastic/transport';
|
|
@@ -10,11 +8,16 @@ import SniffingTransport from './sniffingTransport';
|
|
|
10
8
|
import Helpers from './helpers';
|
|
11
9
|
import API from './api';
|
|
12
10
|
export interface NodeOptions {
|
|
11
|
+
/** @property url Elasticsearch node's location */
|
|
13
12
|
url: URL;
|
|
14
13
|
id?: string;
|
|
14
|
+
/** @property agent Custom HTTP agent options */
|
|
15
15
|
agent?: HttpAgentOptions | UndiciAgentOptions;
|
|
16
|
+
/** @property ssl Overrides default TLS connection settings */
|
|
16
17
|
ssl?: TlsConnectionOptions;
|
|
18
|
+
/** @property headers Custom HTTP headers that should be sent with each request */
|
|
17
19
|
headers?: Record<string, any>;
|
|
20
|
+
/** @property roles Common Elasticsearch roles that can be assigned to this node. Can be helpful when writing custom nodeFilter or nodeSelector functions. */
|
|
18
21
|
roles?: {
|
|
19
22
|
master: boolean;
|
|
20
23
|
data: boolean;
|
|
@@ -23,40 +26,110 @@ export interface NodeOptions {
|
|
|
23
26
|
};
|
|
24
27
|
}
|
|
25
28
|
export interface ClientOptions {
|
|
29
|
+
/** @property node Elasticsearch node settings, if there is only one node. Required if `nodes` or `cloud` is not set. */
|
|
26
30
|
node?: string | string[] | NodeOptions | NodeOptions[];
|
|
31
|
+
/** @property nodes Elasticsearch node settings, if there are multiple nodes. Required if `node` or `cloud` is not set. */
|
|
27
32
|
nodes?: string | string[] | NodeOptions | NodeOptions[];
|
|
33
|
+
/** @property Connection HTTP connection class to use
|
|
34
|
+
* @defaultValue `UndiciConnection` */
|
|
28
35
|
Connection?: typeof BaseConnection;
|
|
36
|
+
/** @property ConnectionPool HTTP connection pool class to use
|
|
37
|
+
* @defaultValue `CloudConnectionPool`, if connecting to Elastic Cloud, otherwise `WeightedConnectionPool` */
|
|
29
38
|
ConnectionPool?: typeof BaseConnectionPool;
|
|
39
|
+
/** @property Transport Elastic transport class to use
|
|
40
|
+
* @defaultValue `Transport` */
|
|
30
41
|
Transport?: typeof Transport;
|
|
42
|
+
/** @property Serializer Serialization class to use
|
|
43
|
+
* @defaultValue `Serializer` */
|
|
31
44
|
Serializer?: typeof Serializer;
|
|
45
|
+
/** @property maxRetries Max number of retries for each request
|
|
46
|
+
* @defaultValue 3 */
|
|
32
47
|
maxRetries?: number;
|
|
48
|
+
/** @property requestTimeout Max request timeout in milliseconds for each request
|
|
49
|
+
* @defaultValue 30000 */
|
|
33
50
|
requestTimeout?: number;
|
|
51
|
+
/** @property pingTimeout Max number of milliseconds a `ClusterConnectionPool` will wait when pinging nodes before marking them dead
|
|
52
|
+
* @defaultValue 3000 */
|
|
34
53
|
pingTimeout?: number;
|
|
54
|
+
/** @property sniffInterval Perform a sniff operation every `n` milliseconds
|
|
55
|
+
* @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.
|
|
56
|
+
* @defaultValue */
|
|
35
57
|
sniffInterval?: number | boolean;
|
|
58
|
+
/** @property sniffOnStart Perform a sniff once the client is started
|
|
59
|
+
* @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.
|
|
60
|
+
* @defaultValue false */
|
|
36
61
|
sniffOnStart?: boolean;
|
|
62
|
+
/** @property sniffEndpoint Endpoint to ping during a sniff
|
|
63
|
+
* @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.
|
|
64
|
+
* @defaultValue "_nodes/_all/http" */
|
|
37
65
|
sniffEndpoint?: string;
|
|
66
|
+
/** @property sniffOnConnectionFault Perform a sniff on connection fault
|
|
67
|
+
* @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.
|
|
68
|
+
* @defaultValue false */
|
|
38
69
|
sniffOnConnectionFault?: boolean;
|
|
70
|
+
/** @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.
|
|
71
|
+
* @defaultValue 'ping' */
|
|
39
72
|
resurrectStrategy?: 'ping' | 'optimistic' | 'none';
|
|
73
|
+
/** @property compression Enables gzip request body compression
|
|
74
|
+
* @defaultValue `true` if connecting to Elastic Cloud, otherwise `false`. */
|
|
40
75
|
compression?: boolean;
|
|
76
|
+
/** @property tls [TLS configuraton](https://nodejs.org/api/tls.html)
|
|
77
|
+
* @defaultValue null */
|
|
41
78
|
tls?: TlsConnectionOptions;
|
|
79
|
+
/** @property agent Custom HTTP agent options
|
|
80
|
+
* @defaultValue null */
|
|
42
81
|
agent?: HttpAgentOptions | UndiciAgentOptions | agentFn | false;
|
|
82
|
+
/** @property nodeFilter A custom function used by the connection pool to determine which nodes are qualified to receive a request
|
|
83
|
+
* @defaultValue () => true */
|
|
43
84
|
nodeFilter?: nodeFilterFn;
|
|
85
|
+
/** @property nodeSelector A custom function used by the connection pool to determine which node should receive the next request
|
|
86
|
+
* @defaultValue A "round robin" function that loops sequentially through each node in the pool. */
|
|
44
87
|
nodeSelector?: nodeSelectorFn;
|
|
88
|
+
/** @property headers Custom HTTP headers that should be sent with each request
|
|
89
|
+
* @defaultValue An object with a custom `user-agent` header */
|
|
45
90
|
headers?: Record<string, any>;
|
|
91
|
+
/** @property opaqueIdPrefix A string prefix to apply to every generated X-Opaque-Id header
|
|
92
|
+
* @defaultValue null */
|
|
46
93
|
opaqueIdPrefix?: string;
|
|
94
|
+
/** @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
|
|
95
|
+
* @defaultValue A function that increments a number counter starting from 1 */
|
|
47
96
|
generateRequestId?: generateRequestIdFn;
|
|
97
|
+
/** @property name A name for this client
|
|
98
|
+
* @defaultValue 'elasticsearch-js' */
|
|
48
99
|
name?: string | symbol;
|
|
100
|
+
/** @property auth Authentication options for this Elasticsearch cluster
|
|
101
|
+
* @defaultValue null */
|
|
49
102
|
auth?: BasicAuth | ApiKeyAuth | BearerAuth;
|
|
103
|
+
/** @property context A custom object attached to each request that can be used to pass data to client events
|
|
104
|
+
* @defaultValue null */
|
|
50
105
|
context?: Context;
|
|
106
|
+
/** @property proxy A proxy URL that, when provided, the client will automatically send all requests through
|
|
107
|
+
* @defaultValue null */
|
|
51
108
|
proxy?: string | URL;
|
|
109
|
+
/** @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
|
|
110
|
+
* @defaultValue true */
|
|
52
111
|
enableMetaHeader?: boolean;
|
|
112
|
+
/** @property cloud Custom configuration for connecting to Elastic Cloud, in lieu of a `node` or `nodes` configuration
|
|
113
|
+
* @remarks Read https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#client-usage for more details
|
|
114
|
+
* @defaultValue null */
|
|
53
115
|
cloud?: {
|
|
54
116
|
id: string;
|
|
55
117
|
};
|
|
118
|
+
/** @property disablePrototypePoisoningProtection Disables safe JSON parsing that protects execution of prototype poisoning attacks; disabled by default, as it can introduce a performance penalty
|
|
119
|
+
* @defaultValue true */
|
|
56
120
|
disablePrototypePoisoningProtection?: boolean | 'proto' | 'constructor';
|
|
121
|
+
/** @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
|
|
122
|
+
* @defaultValue null */
|
|
57
123
|
caFingerprint?: string;
|
|
124
|
+
/** @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`
|
|
125
|
+
* @defaultValue null */
|
|
58
126
|
maxResponseSize?: number;
|
|
127
|
+
/** @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`
|
|
128
|
+
* @defaultValue null */
|
|
59
129
|
maxCompressedResponseSize?: number;
|
|
130
|
+
/** @property redaction Options for how to redact potentially sensitive data from metadata attached to `Error` objects
|
|
131
|
+
* @remarks Read https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/advanced-config.html#redaction for more details
|
|
132
|
+
* @defaultValue Configuration that will replace known sources of sensitive data */
|
|
60
133
|
redaction?: RedactionOptions;
|
|
61
134
|
}
|
|
62
135
|
export default class Client extends API {
|
|
@@ -67,6 +140,13 @@ export default class Client extends API {
|
|
|
67
140
|
serializer: Serializer;
|
|
68
141
|
helpers: Helpers;
|
|
69
142
|
constructor(opts: ClientOptions);
|
|
143
|
+
/**
|
|
144
|
+
* Creates a child client instance that shared its connection pool with the parent client
|
|
145
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/child.html}
|
|
146
|
+
*/
|
|
70
147
|
child(opts: ClientOptions): Client;
|
|
148
|
+
/**
|
|
149
|
+
* Closes all connections in the connection pool. Connections shared with any parent or child instances will also be closed.
|
|
150
|
+
*/
|
|
71
151
|
close(): Promise<void>;
|
|
72
152
|
}
|
package/lib/client.js
CHANGED
|
@@ -93,7 +93,7 @@ class Client extends api_1.default {
|
|
|
93
93
|
// the second the elasticsearch instance, the third the kibana instance
|
|
94
94
|
const cloudUrls = Buffer.from(id.split(':')[1], 'base64').toString().split('$');
|
|
95
95
|
opts.node = `https://${cloudUrls[1]}.${cloudUrls[0]}`;
|
|
96
|
-
// Cloud has better
|
|
96
|
+
// Cloud has better performance with compression enabled
|
|
97
97
|
// see https://github.com/elastic/elasticsearch-py/pull/704.
|
|
98
98
|
// So unless the user specifies otherwise, we enable compression.
|
|
99
99
|
if (opts.compression == null)
|
|
@@ -263,6 +263,10 @@ class Client extends api_1.default {
|
|
|
263
263
|
maxRetries: options.maxRetries
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* Creates a child client instance that shared its connection pool with the parent client
|
|
268
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/child.html}
|
|
269
|
+
*/
|
|
266
270
|
child(opts) {
|
|
267
271
|
// Merge the new options with the initial ones
|
|
268
272
|
// @ts-expect-error kChild symbol is for internal use only
|
|
@@ -281,6 +285,9 @@ class Client extends api_1.default {
|
|
|
281
285
|
}
|
|
282
286
|
return new Client(options);
|
|
283
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Closes all connections in the connection pool. Connections shared with any parent or child instances will also be closed.
|
|
290
|
+
*/
|
|
284
291
|
async close() {
|
|
285
292
|
return await this.connectionPool.empty();
|
|
286
293
|
}
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,wEAAkC;AAElC,uCAA8B;AAC9B,sEAAgC;AAChC,8DAAwB;AACxB,kDAS2B;AAc3B,qFAAoH;AACpH,oFAAmD;AACnD,gEAA+B;AAC/B,wDAAuB;AACvB,2EAAyC;AACzC,2FAAkE;AAElE,MAAM,MAAM,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAA;AAC9C,MAAM,eAAe,GAAG,MAAM,CAAC,iCAAiC,CAAC,CAAA;AACjE,IAAI,aAAa,GAAW,sBAAW,CAAC,OAAO,CAAA;AAC/C,0BAA0B;AAC1B,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,wEAAkC;AAElC,uCAA8B;AAC9B,sEAAgC;AAChC,8DAAwB;AACxB,kDAS2B;AAc3B,qFAAoH;AACpH,oFAAmD;AACnD,gEAA+B;AAC/B,wDAAuB;AACvB,2EAAyC;AACzC,2FAAkE;AAElE,MAAM,MAAM,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAA;AAC9C,MAAM,eAAe,GAAG,MAAM,CAAC,iCAAiC,CAAC,CAAA;AACjE,IAAI,aAAa,GAAW,sBAAW,CAAC,OAAO,CAAA;AAC/C,0BAA0B;AAC1B,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,C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OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,EAAE,CAAC;YACjE,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,SAAS,sBAAsB,CAAE,IAA2B;QAC1D,0BAA0B;QAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,cAAG,CAAC,IAAI,CAAC,CAAA;YAC5C,OAAO;gBACL,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC;gBACtC,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC;aACvC,CAAA;QACH,CAAC;aAAM,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,YAAY,cAAG,EAAE,CAAC;YACnD,OAAO;gBACL,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAC/C,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;aAChD,CAAA;QACH,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/lib/helpers.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
1
|
import { Readable } from 'node:stream';
|
|
5
2
|
import { TransportResult, TransportRequestOptions } from '@elastic/transport';
|
|
6
3
|
import { Table, TypeMap, RecordBatchStreamReader } from 'apache-arrow/Arrow.node';
|
package/lib/helpers.js
CHANGED
|
@@ -798,11 +798,6 @@ class Helpers {
|
|
|
798
798
|
* @returns {object} EsqlHelper instance
|
|
799
799
|
*/
|
|
800
800
|
esql(params, reqOptions = {}) {
|
|
801
|
-
var _d;
|
|
802
|
-
if (this[kMetaHeader] !== null) {
|
|
803
|
-
reqOptions.headers = (_d = reqOptions.headers) !== null && _d !== void 0 ? _d : {};
|
|
804
|
-
reqOptions.headers['x-elastic-client-meta'] = `${this[kMetaHeader]},h=qo`;
|
|
805
|
-
}
|
|
806
801
|
const client = this[kClient];
|
|
807
802
|
function toRecords(response) {
|
|
808
803
|
const { columns, values } = response;
|
|
@@ -822,7 +817,13 @@ class Helpers {
|
|
|
822
817
|
* Pivots ES|QL query results into an array of row objects, rather than the default format where each row is an array of values.
|
|
823
818
|
*/
|
|
824
819
|
async toRecords() {
|
|
820
|
+
var _d;
|
|
821
|
+
if (metaHeader !== null) {
|
|
822
|
+
reqOptions.headers = (_d = reqOptions.headers) !== null && _d !== void 0 ? _d : {};
|
|
823
|
+
reqOptions.headers['x-elastic-client-meta'] = `${metaHeader},h=qo`;
|
|
824
|
+
}
|
|
825
825
|
params.format = 'json';
|
|
826
|
+
params.columnar = false;
|
|
826
827
|
// @ts-expect-error it's typed as ArrayBuffer but we know it will be JSON
|
|
827
828
|
const response = await client.esql.query(params, reqOptions);
|
|
828
829
|
const records = toRecords(response);
|
|
@@ -854,8 +855,8 @@ class Helpers {
|
|
|
854
855
|
return helper;
|
|
855
856
|
}
|
|
856
857
|
}
|
|
857
|
-
exports.default = Helpers;
|
|
858
858
|
_a = kClient, _b = kMetaHeader, _c = kMaxRetries;
|
|
859
|
+
exports.default = Helpers;
|
|
859
860
|
// Using a getter will improve the overall performances of the code,
|
|
860
861
|
// as we will reed the documents only if needed.
|
|
861
862
|
function addDocumentsGetter(result) {
|