elasticsearch-store 0.63.2 → 0.64.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/dist/src/elasticsearch-client/client.d.ts +233 -0
- package/dist/src/elasticsearch-client/client.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/client.js +446 -0
- package/dist/src/elasticsearch-client/client.js.map +1 -0
- package/dist/src/elasticsearch-client/create-client.d.ts +5 -119
- package/dist/src/elasticsearch-client/create-client.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/create-client.js +35 -45
- package/dist/src/elasticsearch-client/create-client.js.map +1 -1
- package/dist/src/elasticsearch-client/index.d.ts +1 -0
- package/dist/src/elasticsearch-client/index.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/index.js +1 -0
- package/dist/src/elasticsearch-client/index.js.map +1 -1
- package/dist/src/elasticsearch-client/interfaces.d.ts +7 -0
- package/dist/src/elasticsearch-client/interfaces.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/log-wrapper.d.ts +1 -28
- package/dist/src/elasticsearch-client/log-wrapper.d.ts.map +1 -1
- package/dist/src/elasticsearch-client/log-wrapper.js.map +1 -1
- package/dist/src/elasticsearch-client/method-helpers/bulk.d.ts +14 -0
- package/dist/src/elasticsearch-client/method-helpers/bulk.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/bulk.js +30 -0
- package/dist/src/elasticsearch-client/method-helpers/bulk.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/catIndices.d.ts +16 -0
- package/dist/src/elasticsearch-client/method-helpers/catIndices.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/catIndices.js +29 -0
- package/dist/src/elasticsearch-client/method-helpers/catIndices.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/clusterGetSettings.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/clusterGetSettings.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/clusterGetSettings.js +20 -0
- package/dist/src/elasticsearch-client/method-helpers/clusterGetSettings.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/clusterHealth.d.ts +14 -0
- package/dist/src/elasticsearch-client/method-helpers/clusterHealth.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/clusterHealth.js +35 -0
- package/dist/src/elasticsearch-client/method-helpers/clusterHealth.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/count.d.ts +17 -0
- package/dist/src/elasticsearch-client/method-helpers/count.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/count.js +30 -0
- package/dist/src/elasticsearch-client/method-helpers/count.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/create.d.ts +34 -0
- package/dist/src/elasticsearch-client/method-helpers/create.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/create.js +36 -0
- package/dist/src/elasticsearch-client/method-helpers/create.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/delete.d.ts +26 -0
- package/dist/src/elasticsearch-client/method-helpers/delete.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/delete.js +27 -0
- package/dist/src/elasticsearch-client/method-helpers/delete.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/deleteByQuery.d.ts +66 -0
- package/dist/src/elasticsearch-client/method-helpers/deleteByQuery.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/deleteByQuery.js +36 -0
- package/dist/src/elasticsearch-client/method-helpers/deleteByQuery.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/exists.d.ts +18 -0
- package/dist/src/elasticsearch-client/method-helpers/exists.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/exists.js +25 -0
- package/dist/src/elasticsearch-client/method-helpers/exists.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/get.d.ts +18 -0
- package/dist/src/elasticsearch-client/method-helpers/get.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/get.js +26 -0
- package/dist/src/elasticsearch-client/method-helpers/get.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/helper-utils.d.ts +7 -0
- package/dist/src/elasticsearch-client/method-helpers/helper-utils.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/helper-utils.js +38 -0
- package/dist/src/elasticsearch-client/method-helpers/helper-utils.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/index-method.d.ts +43 -0
- package/dist/src/elasticsearch-client/method-helpers/index-method.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/index-method.js +38 -0
- package/dist/src/elasticsearch-client/method-helpers/index-method.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/index.d.ts +41 -0
- package/dist/src/elasticsearch-client/method-helpers/index.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/index.js +57 -0
- package/dist/src/elasticsearch-client/method-helpers/index.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesCreate.d.ts +15 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesCreate.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesCreate.js +39 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesCreate.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesDelete.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesDelete.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesDelete.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesDelete.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesDeleteTemplate.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesDeleteTemplate.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesDeleteTemplate.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesDeleteTemplate.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesExists.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesExists.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesExists.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesExists.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesExistsTemplate.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesExistsTemplate.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesExistsTemplate.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesExistsTemplate.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGet.d.ts +12 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGet.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGet.js +22 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGet.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetFieldMapping.d.ts +20 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetFieldMapping.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetFieldMapping.js +27 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetFieldMapping.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetIndexTemplate.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetIndexTemplate.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetIndexTemplate.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetIndexTemplate.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetMapping.d.ts +9 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetMapping.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetMapping.js +33 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetMapping.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetSettings.d.ts +12 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetSettings.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetSettings.js +24 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetSettings.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetTemplate.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetTemplate.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetTemplate.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesGetTemplate.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutMapping.d.ts +51 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutMapping.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutMapping.js +32 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutMapping.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutSettings.d.ts +24 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutSettings.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutSettings.js +32 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutSettings.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutTemplate.d.ts +23 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutTemplate.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutTemplate.js +39 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesPutTemplate.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesRecovery.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesRecovery.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesRecovery.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesRecovery.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesRefresh.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesRefresh.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesRefresh.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesRefresh.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesStats.d.ts +15 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesStats.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesStats.js +22 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesStats.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesValidateQuery.d.ts +36 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesValidateQuery.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesValidateQuery.js +25 -0
- package/dist/src/elasticsearch-client/method-helpers/indicesValidateQuery.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/mget.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/mget.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/mget.js +45 -0
- package/dist/src/elasticsearch-client/method-helpers/mget.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/msearch.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/msearch.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/msearch.js +43 -0
- package/dist/src/elasticsearch-client/method-helpers/msearch.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/nodesInfo.d.ts +8 -0
- package/dist/src/elasticsearch-client/method-helpers/nodesInfo.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/nodesInfo.js +33 -0
- package/dist/src/elasticsearch-client/method-helpers/nodesInfo.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/nodesStats.d.ts +15 -0
- package/dist/src/elasticsearch-client/method-helpers/nodesStats.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/nodesStats.js +33 -0
- package/dist/src/elasticsearch-client/method-helpers/nodesStats.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/reindex.d.ts +37 -0
- package/dist/src/elasticsearch-client/method-helpers/reindex.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/reindex.js +36 -0
- package/dist/src/elasticsearch-client/method-helpers/reindex.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/search.d.ts +50 -0
- package/dist/src/elasticsearch-client/method-helpers/search.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/search.js +42 -0
- package/dist/src/elasticsearch-client/method-helpers/search.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksCancel.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksCancel.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksCancel.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksCancel.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksGet.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksGet.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksGet.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksGet.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksList.d.ts +3 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksList.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksList.js +19 -0
- package/dist/src/elasticsearch-client/method-helpers/tasksList.js.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/update.d.ts +79 -0
- package/dist/src/elasticsearch-client/method-helpers/update.d.ts.map +1 -0
- package/dist/src/elasticsearch-client/method-helpers/update.js +36 -0
- package/dist/src/elasticsearch-client/method-helpers/update.js.map +1 -0
- package/dist/src/index-manager.d.ts +10 -12
- package/dist/src/index-manager.d.ts.map +1 -1
- package/dist/src/index-manager.js +24 -34
- package/dist/src/index-manager.js.map +1 -1
- package/dist/src/index-model.d.ts +2 -2
- package/dist/src/index-model.d.ts.map +1 -1
- package/dist/src/index-model.js.map +1 -1
- package/dist/src/index-store.d.ts +20 -38
- package/dist/src/index-store.d.ts.map +1 -1
- package/dist/src/index-store.js +23 -55
- package/dist/src/index-store.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/test-helpers/config.d.ts +3 -0
- package/dist/src/test-helpers/config.d.ts.map +1 -0
- package/dist/src/test-helpers/config.js +12 -0
- package/dist/src/test-helpers/config.js.map +1 -0
- package/dist/src/test-helpers/elasticsearch.d.ts +20 -0
- package/dist/src/test-helpers/elasticsearch.d.ts.map +1 -0
- package/dist/src/test-helpers/elasticsearch.js +177 -0
- package/dist/src/test-helpers/elasticsearch.js.map +1 -0
- package/dist/src/test-helpers/fixtures/even-date-data.d.ts +9 -0
- package/dist/src/test-helpers/fixtures/even-date-data.d.ts.map +1 -0
- package/dist/src/test-helpers/fixtures/even-date-data.js +10021 -0
- package/dist/src/test-helpers/fixtures/even-date-data.js.map +1 -0
- package/dist/src/test-helpers/fixtures/index.d.ts +3 -0
- package/dist/src/test-helpers/fixtures/index.d.ts.map +1 -0
- package/dist/src/test-helpers/fixtures/index.js +29 -0
- package/dist/src/test-helpers/fixtures/index.js.map +1 -0
- package/dist/src/test-helpers/fixtures/interfaces.d.ts +11 -0
- package/dist/src/test-helpers/fixtures/interfaces.d.ts.map +1 -0
- package/dist/src/test-helpers/fixtures/interfaces.js +3 -0
- package/dist/src/test-helpers/fixtures/interfaces.js.map +1 -0
- package/dist/src/test-helpers/fixtures/uneven-date-data.d.ts +9 -0
- package/dist/src/test-helpers/fixtures/uneven-date-data.d.ts.map +1 -0
- package/dist/src/test-helpers/fixtures/uneven-date-data.js +3035 -0
- package/dist/src/test-helpers/fixtures/uneven-date-data.js.map +1 -0
- package/dist/src/test-helpers/index.d.ts +4 -0
- package/dist/src/test-helpers/index.d.ts.map +1 -0
- package/dist/src/test-helpers/index.js +20 -0
- package/dist/src/test-helpers/index.js.map +1 -0
- package/dist/src/utils/elasticsearch.d.ts +1 -1
- package/dist/src/utils/elasticsearch.d.ts.map +1 -1
- package/dist/src/utils/elasticsearch.js +8 -4
- package/dist/src/utils/elasticsearch.js.map +1 -1
- package/dist/src/utils/validation.d.ts +2 -2
- package/dist/src/utils/validation.d.ts.map +1 -1
- package/dist/src/utils/validation.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { ClientParams, ClientResponse, ClientMetadata } from '@terascope/types';
|
|
2
|
+
export declare class Client {
|
|
3
|
+
private client;
|
|
4
|
+
private distributionMeta;
|
|
5
|
+
constructor(client: any, distributionMeta: ClientMetadata);
|
|
6
|
+
get __meta(): ClientMetadata;
|
|
7
|
+
bulk(params: ClientParams.BulkParams): Promise<ClientResponse.BulkResponse>;
|
|
8
|
+
/**
|
|
9
|
+
* creates a new record, can throw if record already exists
|
|
10
|
+
* @param CountParams
|
|
11
|
+
*/
|
|
12
|
+
create(params: ClientParams.CreateParams): Promise<ClientResponse.CreateResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* indexes a new record
|
|
15
|
+
* @param CountParams
|
|
16
|
+
*/
|
|
17
|
+
index(params: ClientParams.IndexParams): Promise<ClientResponse.IndexResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* updates a record, or can upsert a record
|
|
20
|
+
* @param CountParams
|
|
21
|
+
*/
|
|
22
|
+
update(params: ClientParams.UpdateParams): Promise<ClientResponse.UpdateResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the number of matches for a search query or
|
|
25
|
+
* if no query provided the count for docs in an index
|
|
26
|
+
* @param CountParams
|
|
27
|
+
*/
|
|
28
|
+
count(params: ClientParams.CountParams): Promise<ClientResponse.CountResponse>;
|
|
29
|
+
get cluster(): {
|
|
30
|
+
getSettings(params?: ClientParams.ClusterGetSettingsParams): Promise<ClientResponse.ClusterGetSettingsResponse>;
|
|
31
|
+
health(params?: ClientParams.ClusterHealthParams): Promise<ClientResponse.ClusterHealthResponse>;
|
|
32
|
+
};
|
|
33
|
+
get cat(): {
|
|
34
|
+
indices(params?: ClientParams.CatIndicesParams): Promise<ClientResponse.CatIndicesResponse>;
|
|
35
|
+
};
|
|
36
|
+
get nodes(): {
|
|
37
|
+
stats(params?: ClientParams.NodesStatsParams): Promise<ClientResponse.NodesStatsResponse>;
|
|
38
|
+
info(params?: ClientParams.NodesInfoParams): Promise<ClientResponse.NodesInfoResponse>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Deletes a specific record, requires an index and id.
|
|
42
|
+
* @param RequestParams.delete
|
|
43
|
+
*/
|
|
44
|
+
delete(params: ClientParams.DeleteParams): Promise<ClientResponse.DeleteResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Deletes documents that match the specified query.
|
|
47
|
+
* @param RequestParams.DeleteByQuery
|
|
48
|
+
* @returns count or Elasticsearch task_id
|
|
49
|
+
*/
|
|
50
|
+
deleteByQuery(params: ClientParams.DeleteByQueryParams): Promise<ClientResponse.DeleteByQueryResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Check that the document id exists in the specified index.
|
|
53
|
+
* @param ExistsParams
|
|
54
|
+
* @returns boolean
|
|
55
|
+
*/
|
|
56
|
+
exists(params: ClientParams.ExistsParams): Promise<ClientResponse.ExistsResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves the specified JSON document from an index or an empty doc if no doc id is found
|
|
59
|
+
* @param ClientParams.GetParams
|
|
60
|
+
* @returns Object
|
|
61
|
+
*/
|
|
62
|
+
get<T = Record<string, unknown>>(params: ClientParams.GetParams): Promise<ClientResponse.GetResponse<T>>;
|
|
63
|
+
/**
|
|
64
|
+
* Returns info about the cluster the client is connected to
|
|
65
|
+
* @returns object with cluster info
|
|
66
|
+
*/
|
|
67
|
+
info(): Promise<ClientResponse.InfoResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Returns true or false based on whether the cluster is running.
|
|
70
|
+
* @returns Boolean
|
|
71
|
+
*/
|
|
72
|
+
ping(): Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* Returns search hits that match the query defined in the request.
|
|
75
|
+
* @param SearchParams
|
|
76
|
+
* @returns Array of Record<string, any>
|
|
77
|
+
*/
|
|
78
|
+
search<T = Record<string, unknown>>(params: ClientParams.SearchParams): Promise<ClientResponse.SearchResponse<T>>;
|
|
79
|
+
/**
|
|
80
|
+
* The multi search execution of several searches within the same API request
|
|
81
|
+
* @param MSearchParams
|
|
82
|
+
* @returns Array of Record<string, any>
|
|
83
|
+
*/
|
|
84
|
+
msearch(params: ClientParams.MSearchParams): Promise<ClientResponse.MSearchResponse>;
|
|
85
|
+
/**
|
|
86
|
+
* The multi get execution of multiple-get searches from a single API request
|
|
87
|
+
* @param MGetParams
|
|
88
|
+
* @returns Array of Record<string, any>
|
|
89
|
+
*/
|
|
90
|
+
mget(params: ClientParams.MGetParams): Promise<ClientResponse.MGetResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* Re-Index data to a new index
|
|
93
|
+
* @param ReIndexParams
|
|
94
|
+
* @returns Report of re-indexing task or task id if wait_for_completion is false
|
|
95
|
+
*/
|
|
96
|
+
reindex(params: ClientParams.ReindexParams): Promise<ClientResponse.ReindexResponse>;
|
|
97
|
+
get indices(): {
|
|
98
|
+
/**
|
|
99
|
+
* Creates a new index.
|
|
100
|
+
* @param IndicesCreateParams
|
|
101
|
+
* @returns IndicesCreateResponse
|
|
102
|
+
*/
|
|
103
|
+
create(params: ClientParams.IndicesCreateParams): Promise<ClientResponse.IndicesCreateResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Deletes one or more indices.
|
|
106
|
+
* @param IndicesDeleteParams
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
delete(params: ClientParams.IndicesDeleteParams): Promise<ClientResponse.IndicesDeleteResponse>;
|
|
110
|
+
/**
|
|
111
|
+
* Checks if a data stream, index, or alias exists.
|
|
112
|
+
* @param IndicesExistsParams
|
|
113
|
+
* @returns boolean
|
|
114
|
+
*/
|
|
115
|
+
exists(params: ClientParams.IndicesExistsParams): Promise<ClientResponse.IndicesExistsResponse>;
|
|
116
|
+
/**
|
|
117
|
+
* Returns information about one or more indices
|
|
118
|
+
* @param IndicesGetParams
|
|
119
|
+
* @returns
|
|
120
|
+
*/
|
|
121
|
+
get(params: ClientParams.IndicesGetParams): Promise<ClientResponse.IndicesGetResponse>;
|
|
122
|
+
/**
|
|
123
|
+
* Uploads index mapping template
|
|
124
|
+
* @param IndicesPutTemplateParams
|
|
125
|
+
* @returns IndicesPutTemplateResponse
|
|
126
|
+
*/
|
|
127
|
+
putTemplate(params: ClientParams.IndicesPutTemplateParams): Promise<ClientResponse.IndicesPutTemplateResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Deletes index templates
|
|
130
|
+
* @param IndicesDeleteTemplateParams
|
|
131
|
+
* @returns IndicesDeleteTemplateResponse
|
|
132
|
+
*/
|
|
133
|
+
deleteTemplate(params: ClientParams.IndicesDeleteTemplateParams): Promise<ClientResponse.IndicesDeleteTemplateResponse>;
|
|
134
|
+
/**
|
|
135
|
+
* Returns true if template exists
|
|
136
|
+
* @param IndicesExistsTemplateParams
|
|
137
|
+
* @returns boolean
|
|
138
|
+
*/
|
|
139
|
+
existsTemplate(params: ClientParams.IndicesExistsTemplateParams): Promise<ClientResponse.IndicesExistsTemplateResponse>;
|
|
140
|
+
/**
|
|
141
|
+
* Returns template
|
|
142
|
+
* @param IndicesGetTemplateParams
|
|
143
|
+
* @returns template
|
|
144
|
+
*/
|
|
145
|
+
getTemplate(params: ClientParams.IndicesGetTemplateParams): Promise<ClientResponse.IndicesGetTemplateResponse>;
|
|
146
|
+
/**
|
|
147
|
+
* Returns index template
|
|
148
|
+
* @param IndicesGetIndexTemplateParams
|
|
149
|
+
* @returns IndicesGetIndexTemplateResponse
|
|
150
|
+
* not supported by elasticsearch version 6
|
|
151
|
+
* same params as IndicesGetTemplateParams
|
|
152
|
+
*/
|
|
153
|
+
getIndexTemplate(params: ClientParams.IndicesGetIndexTemplateParams): Promise<ClientResponse.IndicesGetIndexTemplateResponse>;
|
|
154
|
+
/**
|
|
155
|
+
* Retrieves mapping definitions for one or more indices
|
|
156
|
+
* @param IndicesGetMappingParams
|
|
157
|
+
* @returns IndicesGetMappingResponse
|
|
158
|
+
*/
|
|
159
|
+
getMapping(params: ClientParams.IndicesGetMappingParams): Promise<ClientResponse.IndicesGetMappingResponse>;
|
|
160
|
+
/**
|
|
161
|
+
* Adds new fields to an existing index or edit the search settings of existing fields.
|
|
162
|
+
* @param IndicesPutMappingParams
|
|
163
|
+
* @returns IndicesPutMappingResponse
|
|
164
|
+
*/
|
|
165
|
+
putMapping(params: ClientParams.IndicesPutMappingParams): Promise<ClientResponse.IndicesPutMappingResponse>;
|
|
166
|
+
/**
|
|
167
|
+
* Retrieves mapping definitions for one or more fields.
|
|
168
|
+
* @param IndicesGetFieldMappingParams
|
|
169
|
+
* @response IndicesGetFieldMappingResponse
|
|
170
|
+
*/
|
|
171
|
+
getFieldMapping(params: ClientParams.IndicesGetFieldMappingParams): Promise<ClientResponse.IndicesGetFieldMappingResponse>;
|
|
172
|
+
/**
|
|
173
|
+
* Returns setting information for one or more indices
|
|
174
|
+
* @param IndicesGetSettingsParams
|
|
175
|
+
* @returns IndicesGetSettingsResponse
|
|
176
|
+
*/
|
|
177
|
+
getSettings(params: ClientParams.IndicesGetSettingsParams): Promise<ClientResponse.IndicesGetSettingsResponse>;
|
|
178
|
+
/**
|
|
179
|
+
* Changes a dynamic index setting in real time.
|
|
180
|
+
* @param IndicesPutSettingsParams
|
|
181
|
+
* @returns IndicesPutSettingsResponse
|
|
182
|
+
*/
|
|
183
|
+
putSettings(params: ClientParams.IndicesPutSettingsParams): Promise<ClientResponse.IndicesPutSettingsResponse>;
|
|
184
|
+
/**
|
|
185
|
+
* Makes a recent operation performed on one or more indices available for search.
|
|
186
|
+
* @param IndicesRefreshParams
|
|
187
|
+
* @returns IndicesRefreshResponse
|
|
188
|
+
* can be an empty query
|
|
189
|
+
*/
|
|
190
|
+
refresh(params: ClientParams.IndicesRefreshParams): Promise<ClientResponse.IndicesRefreshResponse>;
|
|
191
|
+
/**
|
|
192
|
+
* Returns information about shard recoveries for one or more indices
|
|
193
|
+
* @param IndicesRecoveryParams
|
|
194
|
+
* @returns IndicesRecoveryResponse
|
|
195
|
+
* can be an empty query
|
|
196
|
+
*/
|
|
197
|
+
recovery(params: ClientParams.IndicesRecoveryParams): Promise<ClientResponse.IndicesRecoveryResponse>;
|
|
198
|
+
/**
|
|
199
|
+
* Validates a query without executing it.
|
|
200
|
+
* @param IndicesValidateQueryParams
|
|
201
|
+
* @returns IndicesValidateQueryResponse
|
|
202
|
+
*/
|
|
203
|
+
validateQuery(params: ClientParams.IndicesValidateQueryParams): Promise<ClientResponse.IndicesValidateQueryResponse>;
|
|
204
|
+
/**
|
|
205
|
+
* Returns statistics for one or more indices
|
|
206
|
+
* @param IndicesStatsParams
|
|
207
|
+
* @returns IndicesStatsResponse
|
|
208
|
+
*/
|
|
209
|
+
stats(params: ClientParams.IndicesStats): Promise<ClientResponse.IndicesStatsResponse>;
|
|
210
|
+
};
|
|
211
|
+
get tasks(): {
|
|
212
|
+
/**
|
|
213
|
+
* Cancels a currently running task
|
|
214
|
+
* @param TasksCancelParams
|
|
215
|
+
* @returns TasksCancelResponse
|
|
216
|
+
*/
|
|
217
|
+
cancel(params: ClientParams.TasksCancelParams): Promise<ClientResponse.TasksCancelResponse>;
|
|
218
|
+
/**
|
|
219
|
+
* Gets information about a running task
|
|
220
|
+
* @param TasksGetParams
|
|
221
|
+
* @returns TasksGetResponse
|
|
222
|
+
*/
|
|
223
|
+
get(params: ClientParams.TasksGetParams): Promise<ClientResponse.TasksGetResponse>;
|
|
224
|
+
/**
|
|
225
|
+
* Returns information about the tasks currently executing in the cluster.
|
|
226
|
+
* @param TasksListParams
|
|
227
|
+
* @returns TasksListResponse
|
|
228
|
+
*/
|
|
229
|
+
list(params: ClientParams.TasksListParams): Promise<ClientResponse.TasksListResponse>;
|
|
230
|
+
};
|
|
231
|
+
private _removeBody;
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/elasticsearch-client/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Client = void 0;
|
|
27
|
+
const methods = __importStar(require("./method-helpers"));
|
|
28
|
+
class Client {
|
|
29
|
+
constructor(client, distributionMeta) {
|
|
30
|
+
this.client = client;
|
|
31
|
+
this.distributionMeta = distributionMeta;
|
|
32
|
+
}
|
|
33
|
+
get __meta() {
|
|
34
|
+
return this.distributionMeta;
|
|
35
|
+
}
|
|
36
|
+
async bulk(params) {
|
|
37
|
+
const parsedParams = methods.convertBulkParams(params, this.distributionMeta);
|
|
38
|
+
const resp = await this.client.bulk(parsedParams);
|
|
39
|
+
return this._removeBody(resp);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* creates a new record, can throw if record already exists
|
|
43
|
+
* @param CountParams
|
|
44
|
+
*/
|
|
45
|
+
async create(params) {
|
|
46
|
+
const parsedParams = methods.convertCreateParams(params, this.distributionMeta);
|
|
47
|
+
const resp = await this.client.create(parsedParams);
|
|
48
|
+
return this._removeBody(resp);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* indexes a new record
|
|
52
|
+
* @param CountParams
|
|
53
|
+
*/
|
|
54
|
+
async index(params) {
|
|
55
|
+
const parsedParams = methods.convertIndexParams(params, this.distributionMeta);
|
|
56
|
+
const resp = await this.client.index(parsedParams);
|
|
57
|
+
return this._removeBody(resp);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* updates a record, or can upsert a record
|
|
61
|
+
* @param CountParams
|
|
62
|
+
*/
|
|
63
|
+
async update(params) {
|
|
64
|
+
const parsedParams = methods.convertUpdateParams(params, this.distributionMeta);
|
|
65
|
+
const resp = await this.client.update(parsedParams);
|
|
66
|
+
return this._removeBody(resp);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Gets the number of matches for a search query or
|
|
70
|
+
* if no query provided the count for docs in an index
|
|
71
|
+
* @param CountParams
|
|
72
|
+
*/
|
|
73
|
+
async count(params) {
|
|
74
|
+
const parsedParams = methods.convertCountParams(params, this.distributionMeta);
|
|
75
|
+
const resp = await this.client.count(parsedParams);
|
|
76
|
+
return this._removeBody(resp);
|
|
77
|
+
}
|
|
78
|
+
get cluster() {
|
|
79
|
+
const { distributionMeta, client, _removeBody } = this;
|
|
80
|
+
return {
|
|
81
|
+
async getSettings(params = {}) {
|
|
82
|
+
const parsedParams = methods.convertClusterSettingsParams(params, distributionMeta);
|
|
83
|
+
const resp = await client.cluster.getSettings(parsedParams);
|
|
84
|
+
return _removeBody(resp);
|
|
85
|
+
},
|
|
86
|
+
async health(params = {}) {
|
|
87
|
+
const parsedParams = methods.convertClusterSettingsParams(params, distributionMeta);
|
|
88
|
+
const resp = await client.cluster.health(parsedParams);
|
|
89
|
+
return _removeBody(resp);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
get cat() {
|
|
94
|
+
const { distributionMeta, client, _removeBody } = this;
|
|
95
|
+
return {
|
|
96
|
+
async indices(params = {}) {
|
|
97
|
+
const parsedParams = methods.convertCatIndicesParams(params, distributionMeta);
|
|
98
|
+
const resp = await client.cat.indices(parsedParams);
|
|
99
|
+
return _removeBody(resp);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
get nodes() {
|
|
104
|
+
const { distributionMeta, client, _removeBody } = this;
|
|
105
|
+
return {
|
|
106
|
+
async stats(params = {}) {
|
|
107
|
+
const parsedParams = methods.convertNodesStatsParams(params, distributionMeta);
|
|
108
|
+
const resp = await client.nodes.stats(parsedParams);
|
|
109
|
+
return _removeBody(resp);
|
|
110
|
+
},
|
|
111
|
+
async info(params = {}) {
|
|
112
|
+
const parsedParams = methods.convertNodeInfoParams(params, distributionMeta);
|
|
113
|
+
const resp = await client.nodes.info(parsedParams);
|
|
114
|
+
return _removeBody(resp);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Deletes a specific record, requires an index and id.
|
|
120
|
+
* @param RequestParams.delete
|
|
121
|
+
*/
|
|
122
|
+
async delete(params) {
|
|
123
|
+
const parsedParams = methods.convertDeleteParams(params, this.distributionMeta);
|
|
124
|
+
const resp = await this.client.delete(parsedParams);
|
|
125
|
+
return this._removeBody(resp);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Deletes documents that match the specified query.
|
|
129
|
+
* @param RequestParams.DeleteByQuery
|
|
130
|
+
* @returns count or Elasticsearch task_id
|
|
131
|
+
*/
|
|
132
|
+
async deleteByQuery(params) {
|
|
133
|
+
const parsedParams = methods.convertDeleteByQueryParams(params, this.distributionMeta);
|
|
134
|
+
const resp = await this.client.deleteByQuery(parsedParams);
|
|
135
|
+
return this._removeBody(resp);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Check that the document id exists in the specified index.
|
|
139
|
+
* @param ExistsParams
|
|
140
|
+
* @returns boolean
|
|
141
|
+
*/
|
|
142
|
+
async exists(params) {
|
|
143
|
+
const convertedParams = methods.convertExistsParams(params, this.distributionMeta);
|
|
144
|
+
const resp = await this.client.exists(convertedParams);
|
|
145
|
+
return this._removeBody(resp);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Retrieves the specified JSON document from an index or an empty doc if no doc id is found
|
|
149
|
+
* @param ClientParams.GetParams
|
|
150
|
+
* @returns Object
|
|
151
|
+
*/
|
|
152
|
+
async get(params) {
|
|
153
|
+
const parsedParams = methods.convertGetParams(params, this.distributionMeta);
|
|
154
|
+
const response = await this.client.get(parsedParams);
|
|
155
|
+
return this._removeBody(response);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Returns info about the cluster the client is connected to
|
|
159
|
+
* @returns object with cluster info
|
|
160
|
+
*/
|
|
161
|
+
async info() {
|
|
162
|
+
methods.validateDistribution(this.distributionMeta);
|
|
163
|
+
const resp = await this.client.info();
|
|
164
|
+
return this._removeBody(resp);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Returns true or false based on whether the cluster is running.
|
|
168
|
+
* @returns Boolean
|
|
169
|
+
*/
|
|
170
|
+
async ping() {
|
|
171
|
+
methods.validateDistribution(this.distributionMeta);
|
|
172
|
+
const resp = await this.client.ping();
|
|
173
|
+
return this._removeBody(resp);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Returns search hits that match the query defined in the request.
|
|
177
|
+
* @param SearchParams
|
|
178
|
+
* @returns Array of Record<string, any>
|
|
179
|
+
*/
|
|
180
|
+
async search(params) {
|
|
181
|
+
const parsedParams = methods.convertSearchParams(params, this.distributionMeta);
|
|
182
|
+
const resp = await this.client.search(parsedParams);
|
|
183
|
+
return this._removeBody(resp);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* The multi search execution of several searches within the same API request
|
|
187
|
+
* @param MSearchParams
|
|
188
|
+
* @returns Array of Record<string, any>
|
|
189
|
+
*/
|
|
190
|
+
async msearch(params) {
|
|
191
|
+
const parsedParams = methods.convertMSearchParams(params, this.distributionMeta);
|
|
192
|
+
const resp = await this.client.msearch(parsedParams);
|
|
193
|
+
return this._removeBody(resp);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* The multi get execution of multiple-get searches from a single API request
|
|
197
|
+
* @param MGetParams
|
|
198
|
+
* @returns Array of Record<string, any>
|
|
199
|
+
*/
|
|
200
|
+
async mget(params) {
|
|
201
|
+
const parsedParams = methods.convertMGetParams(params, this.distributionMeta);
|
|
202
|
+
const resp = await this.client.mget(parsedParams);
|
|
203
|
+
return this._removeBody(resp);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Re-Index data to a new index
|
|
207
|
+
* @param ReIndexParams
|
|
208
|
+
* @returns Report of re-indexing task or task id if wait_for_completion is false
|
|
209
|
+
*/
|
|
210
|
+
async reindex(params) {
|
|
211
|
+
const parsedParams = methods.convertReIndexParams(params, this.distributionMeta);
|
|
212
|
+
const resp = await this.client.reindex(parsedParams);
|
|
213
|
+
return this._removeBody(resp);
|
|
214
|
+
}
|
|
215
|
+
get indices() {
|
|
216
|
+
const { distributionMeta, client, _removeBody } = this;
|
|
217
|
+
return {
|
|
218
|
+
/**
|
|
219
|
+
* Creates a new index.
|
|
220
|
+
* @param IndicesCreateParams
|
|
221
|
+
* @returns IndicesCreateResponse
|
|
222
|
+
*/
|
|
223
|
+
async create(params) {
|
|
224
|
+
const parsedParams = methods.convertIndicesCreateParams(params, distributionMeta);
|
|
225
|
+
const resp = await client.indices.create(parsedParams);
|
|
226
|
+
return _removeBody(resp);
|
|
227
|
+
},
|
|
228
|
+
/**
|
|
229
|
+
* Deletes one or more indices.
|
|
230
|
+
* @param IndicesDeleteParams
|
|
231
|
+
* @returns
|
|
232
|
+
*/
|
|
233
|
+
async delete(params) {
|
|
234
|
+
const parsedParams = methods.convertIndicesDeleteParams(params, distributionMeta);
|
|
235
|
+
const resp = await client.indices.delete(parsedParams);
|
|
236
|
+
return _removeBody(resp);
|
|
237
|
+
},
|
|
238
|
+
/**
|
|
239
|
+
* Checks if a data stream, index, or alias exists.
|
|
240
|
+
* @param IndicesExistsParams
|
|
241
|
+
* @returns boolean
|
|
242
|
+
*/
|
|
243
|
+
async exists(params) {
|
|
244
|
+
const parsedParams = methods.convertIndicesExistsParams(params, distributionMeta);
|
|
245
|
+
const resp = await client.indices.exists(parsedParams);
|
|
246
|
+
return _removeBody(resp);
|
|
247
|
+
},
|
|
248
|
+
/**
|
|
249
|
+
* Returns information about one or more indices
|
|
250
|
+
* @param IndicesGetParams
|
|
251
|
+
* @returns
|
|
252
|
+
*/
|
|
253
|
+
async get(params) {
|
|
254
|
+
const parsedParams = methods.convertIndicesGetParams(params, distributionMeta);
|
|
255
|
+
const resp = await client.indices.get(parsedParams);
|
|
256
|
+
return _removeBody(resp);
|
|
257
|
+
},
|
|
258
|
+
/**
|
|
259
|
+
* Uploads index mapping template
|
|
260
|
+
* @param IndicesPutTemplateParams
|
|
261
|
+
* @returns IndicesPutTemplateResponse
|
|
262
|
+
*/
|
|
263
|
+
async putTemplate(params) {
|
|
264
|
+
const parsedParams = methods.convertIndicesPutTemplateParams(params, distributionMeta);
|
|
265
|
+
const resp = await client.indices.putTemplate(parsedParams);
|
|
266
|
+
return _removeBody(resp);
|
|
267
|
+
},
|
|
268
|
+
/**
|
|
269
|
+
* Deletes index templates
|
|
270
|
+
* @param IndicesDeleteTemplateParams
|
|
271
|
+
* @returns IndicesDeleteTemplateResponse
|
|
272
|
+
*/
|
|
273
|
+
async deleteTemplate(params) {
|
|
274
|
+
const parsedParams = methods.convertIndicesDeleteTemplateParams(params, distributionMeta);
|
|
275
|
+
const resp = await client.indices.deleteTemplate(parsedParams);
|
|
276
|
+
return _removeBody(resp);
|
|
277
|
+
},
|
|
278
|
+
/**
|
|
279
|
+
* Returns true if template exists
|
|
280
|
+
* @param IndicesExistsTemplateParams
|
|
281
|
+
* @returns boolean
|
|
282
|
+
*/
|
|
283
|
+
async existsTemplate(params) {
|
|
284
|
+
const parsedParams = methods.convertIndicesExistsTemplateParams(params, distributionMeta);
|
|
285
|
+
const resp = await client.indices.existsTemplate(parsedParams);
|
|
286
|
+
return _removeBody(resp);
|
|
287
|
+
},
|
|
288
|
+
/**
|
|
289
|
+
* Returns template
|
|
290
|
+
* @param IndicesGetTemplateParams
|
|
291
|
+
* @returns template
|
|
292
|
+
*/
|
|
293
|
+
async getTemplate(params) {
|
|
294
|
+
const parsedParams = methods.convertIndicesGetTemplateParams(params, distributionMeta);
|
|
295
|
+
const resp = await client.indices.getTemplate(parsedParams);
|
|
296
|
+
return _removeBody(resp);
|
|
297
|
+
},
|
|
298
|
+
/**
|
|
299
|
+
* Returns index template
|
|
300
|
+
* @param IndicesGetIndexTemplateParams
|
|
301
|
+
* @returns IndicesGetIndexTemplateResponse
|
|
302
|
+
* not supported by elasticsearch version 6
|
|
303
|
+
* same params as IndicesGetTemplateParams
|
|
304
|
+
*/
|
|
305
|
+
async getIndexTemplate(params) {
|
|
306
|
+
const parsedParams = methods.convertIndicesGetIndexTemplateParams(params, distributionMeta);
|
|
307
|
+
const resp = await client.indices.getIndexTemplate(parsedParams);
|
|
308
|
+
return _removeBody(resp);
|
|
309
|
+
},
|
|
310
|
+
/**
|
|
311
|
+
* Retrieves mapping definitions for one or more indices
|
|
312
|
+
* @param IndicesGetMappingParams
|
|
313
|
+
* @returns IndicesGetMappingResponse
|
|
314
|
+
*/
|
|
315
|
+
async getMapping(params) {
|
|
316
|
+
const parsedParams = methods.convertIndicesGetMappingParams(params, distributionMeta);
|
|
317
|
+
const resp = await client.indices.getMapping(parsedParams);
|
|
318
|
+
return _removeBody(resp);
|
|
319
|
+
},
|
|
320
|
+
/**
|
|
321
|
+
* Adds new fields to an existing index or edit the search settings of existing fields.
|
|
322
|
+
* @param IndicesPutMappingParams
|
|
323
|
+
* @returns IndicesPutMappingResponse
|
|
324
|
+
*/
|
|
325
|
+
async putMapping(params) {
|
|
326
|
+
const parsedParams = methods.convertIndicesPutMappingParams(params, distributionMeta);
|
|
327
|
+
const resp = await client.indices.putMapping(parsedParams);
|
|
328
|
+
return _removeBody(resp);
|
|
329
|
+
},
|
|
330
|
+
/**
|
|
331
|
+
* Retrieves mapping definitions for one or more fields.
|
|
332
|
+
* @param IndicesGetFieldMappingParams
|
|
333
|
+
* @response IndicesGetFieldMappingResponse
|
|
334
|
+
*/
|
|
335
|
+
async getFieldMapping(params) {
|
|
336
|
+
const parsedParams = methods.convertIndicesGetFieldMappingParams(params, distributionMeta);
|
|
337
|
+
const resp = await client.indices.getSettings(parsedParams);
|
|
338
|
+
return _removeBody(resp);
|
|
339
|
+
},
|
|
340
|
+
/**
|
|
341
|
+
* Returns setting information for one or more indices
|
|
342
|
+
* @param IndicesGetSettingsParams
|
|
343
|
+
* @returns IndicesGetSettingsResponse
|
|
344
|
+
*/
|
|
345
|
+
async getSettings(params) {
|
|
346
|
+
const parsedParams = methods.convertIndicesGetSettingsParams(params, distributionMeta);
|
|
347
|
+
const resp = await client.indices.getSettings(parsedParams);
|
|
348
|
+
return _removeBody(resp);
|
|
349
|
+
},
|
|
350
|
+
/**
|
|
351
|
+
* Changes a dynamic index setting in real time.
|
|
352
|
+
* @param IndicesPutSettingsParams
|
|
353
|
+
* @returns IndicesPutSettingsResponse
|
|
354
|
+
*/
|
|
355
|
+
async putSettings(params) {
|
|
356
|
+
const parsedParams = methods.convertIndicesPutSettingsParams(params, distributionMeta);
|
|
357
|
+
const resp = await client.indices.putSettings(parsedParams);
|
|
358
|
+
return _removeBody(resp);
|
|
359
|
+
},
|
|
360
|
+
/**
|
|
361
|
+
* Makes a recent operation performed on one or more indices available for search.
|
|
362
|
+
* @param IndicesRefreshParams
|
|
363
|
+
* @returns IndicesRefreshResponse
|
|
364
|
+
* can be an empty query
|
|
365
|
+
*/
|
|
366
|
+
async refresh(params) {
|
|
367
|
+
const parsedParams = methods.convertIndicesRefreshParams(params, distributionMeta);
|
|
368
|
+
const resp = await client.indices.refresh(parsedParams);
|
|
369
|
+
return _removeBody(resp);
|
|
370
|
+
},
|
|
371
|
+
/**
|
|
372
|
+
* Returns information about shard recoveries for one or more indices
|
|
373
|
+
* @param IndicesRecoveryParams
|
|
374
|
+
* @returns IndicesRecoveryResponse
|
|
375
|
+
* can be an empty query
|
|
376
|
+
*/
|
|
377
|
+
async recovery(params) {
|
|
378
|
+
const parsedParams = methods.convertIndicesRecoveryParams(params, distributionMeta);
|
|
379
|
+
const resp = await client.indices.recovery(parsedParams);
|
|
380
|
+
return _removeBody(resp);
|
|
381
|
+
},
|
|
382
|
+
/**
|
|
383
|
+
* Validates a query without executing it.
|
|
384
|
+
* @param IndicesValidateQueryParams
|
|
385
|
+
* @returns IndicesValidateQueryResponse
|
|
386
|
+
*/
|
|
387
|
+
async validateQuery(params) {
|
|
388
|
+
const parsedParams = methods.convertIndicesValidateQueryParams(params, distributionMeta);
|
|
389
|
+
const resp = await client.indices.validateQuery(parsedParams);
|
|
390
|
+
return _removeBody(resp);
|
|
391
|
+
},
|
|
392
|
+
/**
|
|
393
|
+
* Returns statistics for one or more indices
|
|
394
|
+
* @param IndicesStatsParams
|
|
395
|
+
* @returns IndicesStatsResponse
|
|
396
|
+
*/
|
|
397
|
+
async stats(params) {
|
|
398
|
+
const parsedParams = methods.convertIndicesStatsParams(params, distributionMeta);
|
|
399
|
+
const resp = await client.indices.stats(parsedParams);
|
|
400
|
+
return _removeBody(resp);
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
get tasks() {
|
|
405
|
+
const { distributionMeta, client, _removeBody, } = this;
|
|
406
|
+
return {
|
|
407
|
+
/**
|
|
408
|
+
* Cancels a currently running task
|
|
409
|
+
* @param TasksCancelParams
|
|
410
|
+
* @returns TasksCancelResponse
|
|
411
|
+
*/
|
|
412
|
+
async cancel(params) {
|
|
413
|
+
const parsedParams = methods.convertTasksCancelParams(params, distributionMeta);
|
|
414
|
+
const resp = await client.tasks.cancel(parsedParams);
|
|
415
|
+
return _removeBody(resp);
|
|
416
|
+
},
|
|
417
|
+
/**
|
|
418
|
+
* Gets information about a running task
|
|
419
|
+
* @param TasksGetParams
|
|
420
|
+
* @returns TasksGetResponse
|
|
421
|
+
*/
|
|
422
|
+
async get(params) {
|
|
423
|
+
const parsedParams = methods.convertTasksGetParams(params, distributionMeta);
|
|
424
|
+
const resp = await client.tasks.get(parsedParams);
|
|
425
|
+
return _removeBody(resp);
|
|
426
|
+
},
|
|
427
|
+
/**
|
|
428
|
+
* Returns information about the tasks currently executing in the cluster.
|
|
429
|
+
* @param TasksListParams
|
|
430
|
+
* @returns TasksListResponse
|
|
431
|
+
*/
|
|
432
|
+
async list(params) {
|
|
433
|
+
const parsedParams = methods.convertTasksListParams(params, distributionMeta);
|
|
434
|
+
const resp = await client.tasks.list(parsedParams);
|
|
435
|
+
return _removeBody(resp);
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
_removeBody(input) {
|
|
440
|
+
if (input.body == null)
|
|
441
|
+
return input;
|
|
442
|
+
return input.body;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
exports.Client = Client;
|
|
446
|
+
//# sourceMappingURL=client.js.map
|