{"_id":"@bytebitlabs/nest-opensearch","_rev":"7-109886140c9332660a942f39b91e884c","name":"@bytebitlabs/nest-opensearch","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"@bytebitlabs/nest-opensearch","version":"0.1.0","license":"MIT","_id":"@bytebitlabs/nest-opensearch@0.1.0","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"89fc9186fbbd65b0a0a56a7c88742c3de52671bc","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-opensearch/-/nest-opensearch-0.1.0.tgz","fileCount":20,"integrity":"sha512-xCEziMbY6L/SVnfOmAGjC2LVM3jmEbIOvGbYX1DVscLwZM27gja1ncxATXlNn6kqrRSB4ipUqcR+N/GrtdOcIQ==","signatures":[{"sig":"MEQCIGIfygXvoKEZFzju7bRp9ejfkExQ0Xv0qyRq8Q80yDHaAiBxMc5PDSRE2C4x2obNXyyDpvEniNenNhjhG/xylsKVNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11712},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"7ef6f8df4e9fdc0b5484ffb606791b86197af767","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-opensearch_0.1.0_1723730102694_0.5182516178742802","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@bytebitlabs/nest-opensearch","version":"0.1.1","license":"MIT","_id":"@bytebitlabs/nest-opensearch@0.1.1","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"8b4e45f24f5cef86813f8601878a4a1816518031","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-opensearch/-/nest-opensearch-0.1.1.tgz","fileCount":20,"integrity":"sha512-TAJ9tETY5h0LW4r3LrN4mrg4ZiQ9hazwltWo3DAvmQN2XARL6QAKTnmongsjbq4GOMlnzwZcfrSXd90Vs1TlGQ==","signatures":[{"sig":"MEUCIF0y7w8Zu2CG9IQ5BcADKqI7DMTHHTH1kZxE7HQzId4pAiEAzydsuY7uWEn8Kfp9E9zzgL6XuOnwU8Ej7zB+B2xQ1vk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11712},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"9ac581ff68f03d00df4a88865f2f1744a9ed2656","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-opensearch_0.1.1_1723745041217_0.19344430867647056","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@bytebitlabs/nest-opensearch","version":"0.1.3","license":"MIT","_id":"@bytebitlabs/nest-opensearch@0.1.3","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"b9eb6fcb38b3f056938cf7eb91480bd17262a1a0","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-opensearch/-/nest-opensearch-0.1.3.tgz","fileCount":20,"integrity":"sha512-WSZ9zwl+aJ0oppEu5SCn5awyqXzyveaWkTAeaSeT3laB4v8Et3OQZukYbZSNpiivNHgXLiz7XbgHaSnRQGf82A==","signatures":[{"sig":"MEQCIFT5yMVsHsXrZ0YjHjO5hVqOWj5sS7OuKyWytCBAb9N9AiBBgvCOFrtvaihgnbnK+tx0//AsQ/BExMeBNeirnRRjiA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11712},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"bd1b5bf77c1e81013bb06d56f6d802aea7440d43","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-opensearch_0.1.3_1727159146865_0.48272961559418137","host":"s3://npm-registry-packages"}},"1.0.0-0":{"name":"@bytebitlabs/nest-opensearch","version":"1.0.0-0","license":"MIT","_id":"@bytebitlabs/nest-opensearch@1.0.0-0","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"a1c0428c4b6e7831046d4047bf512b404805cec8","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-opensearch/-/nest-opensearch-1.0.0-0.tgz","fileCount":20,"integrity":"sha512-JY6Zd2MJOQEJ7j66VtQvtdSPpM9oMyiLRWDGArRd8h9e5z6mK1qDpxEAFb/qVKDOcDDD7Q2x9QtcxScbZfznvA==","signatures":[{"sig":"MEUCIDOSh5R2cuBzJvNebRQT1Fi+daQlkcuWa6HDimbhK0RaAiEA4g5mXHRlYnWai7ardJ0w6SWCuJAZzFjdg6OGJHao07k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11714},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"ba9fcdf8beb2775837215e03b516a4157388989a","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-opensearch_1.0.0-0_1731382843597_0.32236688383989875","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@bytebitlabs/nest-opensearch","version":"1.0.0","license":"MIT","_id":"@bytebitlabs/nest-opensearch@1.0.0","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"e933d18eb0820cd8298760134948605610fc7b53","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-opensearch/-/nest-opensearch-1.0.0.tgz","fileCount":20,"integrity":"sha512-3FMvsLhwy0Wn2zSi/N4vhsViylxqwHPBpa2mNGCLKZHRLbsM/CGaZPS7RPCTFI+K4gDmhZP/BbZ1i75s0WwKKw==","signatures":[{"sig":"MEUCIQDMNmjsLvBkvIjLgyTBVQnFfFK1mNgpGX/n1yzAb5V3hgIgBpUzr9Wt7AD6nfmFNcB9nu+Jfv8i2gVSS1RFJNnDwvU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11712},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"b2be2b59aa13ee02489dfa1745f08fe31fe3b14f","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-opensearch_1.0.0_1735549383346_0.7721093943792108","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bytebitlabs/nest-opensearch","version":"1.0.1","license":"MIT","_id":"@bytebitlabs/nest-opensearch@1.0.1","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"dist":{"shasum":"cd3504ac1d17a8c2ad6c8f67cd321d95d3332327","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-opensearch/-/nest-opensearch-1.0.1.tgz","fileCount":20,"integrity":"sha512-iuPfJ7ixzlQLwLByAyyluAo6abnKPYwBHWWpZvXUq7AcmlpIlLErGv17j1abYUV8O91YeB6dBTVgHeYBxbJl1Q==","signatures":[{"sig":"MEQCIBnX18dfi4p9r2zQiVbj/0MQetQQTDry3O45QxNMQa4tAiAV1+gAW07TOOrr3ee6/G3DhYUJV9m/MKRPFSErGZeWaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11712},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"e3e3e03a508e6b132b6a366cd0bd02e9d01594cb","typings":"./src/index.d.ts","_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"_npmVersion":"10.5.2","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","directories":{},"_nodeVersion":"20.13.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/nest-opensearch_1.0.1_1737347957554_0.6224695647646055","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bytebitlabs/nest-opensearch","version":"1.1.0","license":"MIT","dependencies":{"tslib":"^2.3.0"},"type":"commonjs","main":"./src/index.js","typings":"./src/index.d.ts","publishConfig":{"access":"public"},"types":"./src/index.d.ts","_id":"@bytebitlabs/nest-opensearch@1.1.0","gitHead":"e82f08bce74eb7b91dfd7fd7ffc0423f08ccaec5","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-nViuWNVJRetDGG1z/HXugc+UEG0vYI+xE1y8m3s8hZufe6cplcktPDcQbleFfzqiayP9ut5H49EgAEOWeDp59A==","shasum":"bb84892b5fe69b2047c6e061e29a62ff571e6e16","tarball":"https://registry.npmjs.org/@bytebitlabs/nest-opensearch/-/nest-opensearch-1.1.0.tgz","fileCount":20,"unpackedSize":11712,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG03HtXml2HQesV0kx9yMGVB2nd6c2fI1/MlP968gduRAiEAx2XZJqcch5z3HBXqxPKrKJFAeexOjufMK1azTZZ12W0="}]},"_npmUser":{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"},"directories":{},"maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nest-opensearch_1.1.0_1741581818130_0.6990211936464841"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-15T13:55:02.523Z","modified":"2025-03-10T04:43:38.487Z","0.1.0":"2024-08-15T13:55:02.903Z","0.1.1":"2024-08-15T18:04:01.594Z","0.1.3":"2024-09-24T06:25:47.067Z","1.0.0-0":"2024-11-12T03:40:43.778Z","1.0.0":"2024-12-30T09:03:03.522Z","1.0.1":"2025-01-20T04:39:17.695Z","1.1.0":"2025-03-10T04:43:38.316Z"},"license":"MIT","description":"<p align=\"center\">   <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a> </p>","maintainers":[{"name":"bytebitlabs","email":"0xnairb@bytebitlabs.com"}],"readme":"# nest-opensearch\n\n<p align=\"center\">\n  <a href=\"https://bytebitlabs.com/\" target=\"_blank\"><img src=\"https://gravatar.com/avatar/61c80d73dfe4c4231e77940cf80fd410?size=256\" width=\"256\" alt=\"ByteBitLabs logo\" /></a>\n</p>\n\n<p align=\"center\">OpenSearch module for nestjs</p>\n    <p align=\"center\">\n<a href=\"https://www.npmjs.com/package/@bytebitlabs/nest-opensearch\"><img src=\"https://img.shields.io/npm/v/@bytebitlabs/nest-opensearch\" alt=\"NPM Version\" /></a>\n<a href=\"https://www.npmjs.com/package/@bytebitlabs/nest-opensearch\"><img src=\"https://img.shields.io/npm/l/@bytebitlabs/nest-opensearch\" alt=\"Package License\" /></a>\n<a href=\"https://www.npmjs.com/package/@bytebitlabs/nest-opensearch\"><img src=\"https://img.shields.io/npm/dm/@bytebitlabs/nest-opensearch\" alt=\"NPM Downloads\" /></a>\n</p>\n\n## Description\n\nOpenSearch module for [Nest](https://github.com/nestjs/nest) based on the official [@opensearch-project/opensearch](https://www.npmjs.com/package/@opensearch-project/opensearch) package.\n\n## Installation\n\n```bash\n$ npm i --save @bytebitlabs/nest-opensearch @opensearch-project/opensearch\n```\n\n## Usage\n\nImport `OpenSearchModule`:\n\n```typescript\n@Module({\n  imports: [OpenSearchModule.register({\n    node: 'http://localhost:9200',\n  })],\n  providers: [...],\n})\nexport class SearchModule {}\n```\n\nInject `OpenSearchService`:\n\n```typescript\n@Injectable()\nexport class SearchService {\n  constructor(private readonly openSearchService: OpenSearchService) {}\n}\n```\n\n## Async options\n\nQuite often you might want to asynchronously pass your module options instead of passing them beforehand. In such case, use `registerAsync()` method, that provides a couple of various ways to deal with async data.\n\n**1. Use factory**\n\n```typescript\nOpenSearchModule.registerAsync({\n  useFactory: () => ({\n    node: 'http://localhost:9200'\n  })\n});\n```\n\nObviously, our factory behaves like every other one (might be `async` and is able to inject dependencies through `inject`).\n\n```typescript\nOpenSearchModule.registerAsync({\n  imports: [ConfigModule],\n  useFactory: async (configService: ConfigService) => ({\n    node: configService.get('OPENSEARCH_NODE'),\n  }),\n  inject: [ConfigService],\n}),\n```\n\n**2. Use class**\n\n```typescript\nOpenSearchModule.registerAsync({\n  useClass: OpenSearchConfigService\n});\n```\n\nAbove construction will instantiate `OpenSearchConfigService` inside `OpenSearchModule` and will leverage it to create options object.\n\n```typescript\nclass OpenSearchConfigService implements OpensearchOptionsFactory {\n  createOpensearchOptions(): OpenSearchModuleOptions {\n    return {\n      node: 'http://localhost:9200'\n    };\n  }\n}\n```\n\n**3. Use existing**\n\n```typescript\nOpenSearchModule.registerAsync({\n  imports: [ConfigModule],\n  useExisting: ConfigService,\n}),\n```\n\nIt works the same as `useClass` with one critical difference - `OpenSearchModule` will lookup imported modules to reuse already created `ConfigService`, instead of instantiating it on its own.\n\n## API Spec\n\nThe `OpenSearchService` wraps the `Client` from the official [@opensearch-project/opensearch](https://www.npmjs.com/package/@opensearch-project/opensearch) methods. The `OpenSearchModule.register()` takes `options` object as an argument, [read more](https://opensearch.org/docs/latest/clients/javascript/index).\n","readmeFilename":"README.md"}