|
|
@@ -5,7 +5,7 @@ import type { ClientOptions as ES9ClientOptions } from '@elastic/elasticsearch9'
|
|
|
import { type ES7ClientDelegator } from './es7-client-delegator';
|
|
|
import { type ES8ClientDelegator } from './es8-client-delegator';
|
|
|
import { type ES9ClientDelegator } from './es9-client-delegator';
|
|
|
-import type { ElasticSEarchClientDeletegator } from './interfaces';
|
|
|
+import type { ElasticsearchClientDelegator } from './interfaces';
|
|
|
|
|
|
type GetDelegatorOptions = {
|
|
|
version: 7;
|
|
|
@@ -24,16 +24,16 @@ type GetDelegatorOptions = {
|
|
|
type IsAny<T> = 'dummy' extends (T & 'dummy') ? true : false;
|
|
|
type Delegator<Opts extends GetDelegatorOptions> =
|
|
|
IsAny<Opts> extends true
|
|
|
- ? ElasticSEarchClientDeletegator
|
|
|
+ ? ElasticsearchClientDelegator
|
|
|
: Opts extends { version: 7 }
|
|
|
? ES7ClientDelegator
|
|
|
: Opts extends { version: 8 }
|
|
|
? ES8ClientDelegator
|
|
|
: Opts extends { version: 9 }
|
|
|
? ES9ClientDelegator
|
|
|
- : ElasticSEarchClientDeletegator
|
|
|
+ : ElasticsearchClientDelegator
|
|
|
|
|
|
-let instance: ElasticSEarchClientDeletegator | null = null;
|
|
|
+let instance: ElasticsearchClientDelegator | null = null;
|
|
|
export const getClient = async<Opts extends GetDelegatorOptions>(opts: Opts): Promise<Delegator<Opts>> => {
|
|
|
if (instance == null) {
|
|
|
if (opts.version === 7) {
|