Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create default import for elasticsearch-api #3734

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/elasticsearch-api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terascope/elasticsearch-api",
"displayName": "Elasticsearch API",
"version": "4.0.0",
"version": "4.0.1",
"description": "Elasticsearch client api used across multiple services, handles retries and exponential backoff",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/elasticsearch-api#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/elasticsearch-api/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ClientParams, ClientResponse } from '@terascope/types';
import { Logger } from '@terascope/utils';
import { ClientMetadata } from '@terascope/types'

export = elasticsearchAPI;
export default elasticsearchAPI;

declare function elasticsearchAPI(client: Client, logger: Logger, config?: elasticsearchAPI.Config): elasticsearchAPI.Client;

Expand Down
4 changes: 2 additions & 2 deletions packages/teraslice-state-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terascope/teraslice-state-storage",
"displayName": "Teraslice State Storage",
"version": "1.0.0",
"version": "1.0.1",
"description": "State storage operation api for teraslice",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/teraslice-state-storage#readme",
"bugs": {
Expand All @@ -24,7 +24,7 @@
"test:watch": "ts-scripts test --watch . --"
},
"dependencies": {
"@terascope/elasticsearch-api": "^4.0.0",
"@terascope/elasticsearch-api": "^4.0.1",
"@terascope/utils": "^1.0.0"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
chunk, pMap
} from '@terascope/utils';
import { ClientParams, ClientResponse } from '@terascope/types';
import esApi, { Client, BulkRecord } from '@terascope/elasticsearch-api';
import esApi from '@terascope/elasticsearch-api';
import { ESStateStorageConfig, MGetCacheResponse } from '../interfaces.js';
import CachedStateStorage from '../cached-state-storage/index.js';

Expand All @@ -15,11 +15,11 @@ export default class ESCachedStateStorage {
private chunkSize: number;
private persist: boolean;
private metaKey: string;
private es: Client;
private es: esApi.Client;
private logger: Logger;
public cache: CachedStateStorage<DataEntity>;

constructor(client: Client, logger: Logger, config: ESStateStorageConfig) {
constructor(client: esApi.Client, logger: Logger, config: ESStateStorageConfig) {
this.index = config.index;
this.type = config.type;
this.concurrency = config.concurrency;
Expand Down Expand Up @@ -228,7 +228,7 @@ export default class ESCachedStateStorage {
return this.es.mget(request);
}

private _esBulkUpdatePrep(dataArray: DataEntity[]): BulkRecord[] {
private _esBulkUpdatePrep(dataArray: DataEntity[]): esApi.BulkRecord[] {
return dataArray.map((doc) => ({
action: {
index: {
Expand Down
2 changes: 1 addition & 1 deletion packages/teraslice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"dependencies": {
"@kubernetes/client-node": "^0.21.0",
"@terascope/elasticsearch-api": "^4.0.0",
"@terascope/elasticsearch-api": "^4.0.1",
"@terascope/job-components": "^1.2.0",
"@terascope/teraslice-messaging": "^1.3.0",
"@terascope/types": "^1.0.0",
Expand Down
Loading