Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nestjs-opensearch

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-opensearch - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

6

decorators/index.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

2

decorators/InjectOpensearchClient.d.ts

@@ -1,1 +0,1 @@

export declare const InjectOpensearchClient: (clientName?: string | symbol | undefined) => (target: object, key: string | symbol, index?: number | undefined) => void;
export declare const InjectOpensearchClient: (clientName?: string | symbol) => (target: object, key: string | symbol, index?: number | undefined) => void;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

{
"name": "nestjs-opensearch",
"version": "0.0.1",
"version": "0.1.0",
"author": "neoatlan",

@@ -25,15 +25,15 @@ "license": "MIT",

"peerDependencies": {
"@nestjs/common": "^8.0.0",
"@opensearch-project/opensearch": "^1.0.0"
"@nestjs/common": "^8.0.0 || ^9.0.0",
"@opensearch-project/opensearch": "^1.0.0 || ^2.0.0"
},
"devDependencies": {
"@nestjs/common": "^8.2.2",
"@opensearch-project/opensearch": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"eslint": "^8.3.0",
"@nestjs/common": "^9.0.3",
"@opensearch-project/opensearch": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6",
"eslint": "^8.20.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.4.0",
"typescript": "^4.5.2"
"rxjs": "^7.5.6",
"typescript": "^4.7.4"
}
}
# nestjs-opensearch
OpenSearch (alternative to Elasticsearch) module for NestJS framework
OpenSearch module for NestJS framework

@@ -15,3 +15,3 @@ ## Installation

## Usage
Module for only one connection:
Module for single connection:
```typescript

@@ -31,3 +31,3 @@ import { OpensearchModule } from 'nestjs-opensearch';

Module for multiple connection:
Module for multiple connections:
```typescript

@@ -54,2 +54,23 @@ import { OpensearchModule } from 'nestjs-opensearch';

Module for async configuration:
```typescript
import { OpensearchModule } from 'nestjs-opensearch';
@Module({
imports: [
// See also: https://docs.nestjs.com/techniques/configuration
ConfigModule,
OpensearchModule.forRootAsync({
clientName: 'baz',
inject: [ ConfigService ],
useFactory: (configService) => ({
node: configService.get<string>('opensearch.node'),
}),
}),
],
providers: (...),
})
export class SearchModule { }
```
Client injection:

@@ -62,13 +83,14 @@ ```typescript

public constructor(
// For default
// Inject the default client
private readonly searchClient: OpensearchClient,
// Also for default
@InjectOpensearchClient() private readonly searchClient: OpensearchClient,
// Also inject the default client
@InjectOpensearchClient()
private readonly alsoSearchClient: OpensearchClient,
// For 'foo' client
@InjectOpensearchClient('foo') private readonly searchClient: OpensearchClient,
// Inject the 'foo' named client
@InjectOpensearchClient('foo')
private readonly fooSearchClient: OpensearchClient,
) { }
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc