
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@elastic/enterprise-search-node
Advanced tools

A first-party Node.js client for Elastic Enterprise Search.
With npm:
npm install @elastic/enterprise-search-node
or clone locally:
git clone git@github.com:elastic/enterprise-search-node.git
cd enterprise-search-node
npm install
Create a new instance of the Elastic Enterprise Search Client with your access token:
const EnterpriseSearchClient = require('@elastic/enterprise-search-node')
const accessToken = '' // your access token
const client = new EnterpriseSearchClient(accessToken)
const client = new EnterpriseSearchClient(
accessToken,
'https://your-server.example.com/api/v1/ent'
)
This example shows how to use the indexDocuments method:
const contentSourceKey = '' // your content source key
const documents = [
{
id: 1234,
title: '5 Tips On Finding A Mentor',
body:
'The difference between a budding entrepreneur who merely shows promise and one who is already enjoying some success often comes down to mentoring.',
url: 'https://www.shopify.com/content/5-tips-on-finding-a-mentor'
},
{
id: 1235,
title: 'How to Profit from Your Passions',
body:
'Want to know the secret to starting a successful business? Find a void and fill it.',
url: 'https://www.shopify.com/content/how-to-profit-from-your-passions'
}
]
client
.indexDocuments(contentSourceKey, documents)
.then(results => {
// handle results
})
.catch(error => {
// handle error
})
const contentSourceKey = '' // your content source key
const documentIds = [1234, 1235]
client
.destroyDocuments(contentSourceKey, documentIds)
.then(destroyDocumentsResults => {
// handle destroy documents results
})
.catch(error => {
// handle error
})
const contentSourceKey = '' // your content source key
const pageParams = { currentPage: 2, pageSize: 20 } // optional argument
client
.listAllPermissions(contentSourceKey, pageParams)
.then(response => {
// handle response
})
.catch(error => {
// handle error
})
const contentSourceKey = '' // your content source key
const user = 'enterprise_search' // username
client
.getUserPermissions(contentSourceKey, user)
.then(response => {
// handle response
})
.catch(error => {
// handle error
})
const contentSourceKey = '' // your content source key
const user = 'enterprise_search' // username
const permissions = { permissions: ['permission1', 'permission2'] } // permissions to assign to the user
client
.updateUserPermissions(contentSourceKey, user, permissions)
.then(response => {
// handle response
})
.catch(error => {
// handle error
})
const contentSourceKey = '' // your content source key
const user = 'enterprise_search' // username
const permissions = { permissions: ['permission2'] } // permissions to add to the user
client
.addUserPermissions(contentSourceKey, user, permissions)
.then(response => {
// handle response
})
.catch(error => {
// handle error
})
const contentSourceKey = '' // your content source key
const user = 'enterprise_search' // username
const permissions = { permissions: ['permission2'] } //permissions to remove from the user
client
.removeUserPermissions(contentSourceKey, user, permissions)
.then(response => {
// handle response
})
.catch(error => {
// handle error
})
Run tests via npm:
$ npm test
If something is not working as expected, please open an issue.
We welcome contributors to the project. Before you begin, a couple notes...
Thank you to all the contributors!
FAQs
Elastic Enterprise Search client for Node.js
The npm package @elastic/enterprise-search-node receives a total of 201 weekly downloads. As such, @elastic/enterprise-search-node popularity was classified as not popular.
We found that @elastic/enterprise-search-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 62 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.