Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
@elastic.io/maester-client
Advanced tools
The official Elastic.io object-storage client.
Note: All the code snippets written in Typescript
import { ObjectStorageWrapper } from '@elastic.io/maester-client/dist/ObjectStorageWrapper';
const objectStorage = new ObjectStorageWrapper(this);
The method has the following signature:
async createObject(data: object, headers?: Header[], ttl?: number)
where
{ key: string, value: string }
, current maximum - 5 items. Where key
- searchable field name (see below in Get objects by query parameters
section), must be unique for whole array, if specified - value
must be specified as well; value
- searchable field value, if specified - key
must be specified as well. Optionalconst obj = await objectStorage.createObject(data);
const obj = await objectStorage.createObject(data, [], 100000);
const obj = await objectStorage.createObject(data, [{key: 'somequeriablefieldkey', value: 'somequeriablefieldvalue'}], 60000);
const obj = await objectStorage.createObject(data, [{key: 'anotherqueriablefieldkey', value: 'anotherqueriablefieldvalue'}], 60000);
The method has the following signature:
async lookupObjectById(id: string)
where
const obj = await objectStorage.lookupObjectById(id);
As Maester is able to store any data type, the method returns a raw string. You may want to parse JSON or do any other data processing according to object's expected data type:
const parsedObject = JSON.parse(obj);
The following errors can be thrown:
The method has the following signature:
async lookupObjectsByQueryParameters(headers: Header[])
where
{ key: string, value: string }
, current maximum - 5 items. Where key
- searchable field name, must be unique for whole array, if specified - value
must be specified as well; value
- searchable field value, if specified - key
must be specified as well. RequiredIf you create an object with a queriable headers, internally it looks like this:
x-query-somequeriablefieldkey: somequeriablefieldvalue
x-query-anotherqueriablefieldkey: anotherqueriablefieldvalue
where 'x-query-' is a default prefix.
Using Maester REST API you can find this object by:
/objects?query[somequeriablefieldkey]=somequeriablefieldvalue&query[anotherqueriablefieldkey]=anotherqueriablefieldvalue
Using the library:
const obj = await objectStorage.lookupObjectsByQueryParameters([
{ key: 'somequeriablefieldkey', value: 'somequeriablefieldvalue' },
{ key: 'anotherqueriablefieldkey', value: 'anotherqueriablefieldvalue' }
]);
The method returns an array of items. It either is empty in case no objects found or contains objects
The method has the following signature:
async updateObject(id: string, data: object)
where
const obj = await objectStorage.updateObject(id, data);
The method has the following signature:
async deleteObjectById(id: string)
where
const obj = await objectStorage.deleteObjectById(id);
FAQs
The official object-storage client
The npm package @elastic.io/maester-client receives a total of 329 weekly downloads. As such, @elastic.io/maester-client popularity was classified as not popular.
We found that @elastic.io/maester-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.