Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@elastic.io/maester-client
Advanced tools
The official object-storage client for elasticio-sailor-nodejs.
const Client = require('@elasticio/maester-client');
const client = new Client('http://maester.local:3002', 'my-token');
Get bucket:
const bucket = await client.buckets.get(id);
List buckets:
const buckets = await client.buckets.list({
page: {
number: 1,
size: 25
}
});
List buckets by external ID:
const buckets = await client.buckets.list({
externalId: 'my-external-id'
});
Create bucket:
const bucket = await client.buckets.create({
objects: ['object-1', 'object-2', ..., 'object-N'],
extrenalId: 'my-external-id
});
Update bucket:
const bucket = await client.buckets.update(id, {
closed: true
});
Delete bucket:
await client.buckets.delete(id);
Get object:
const object = await client.objects.get(id);
console.log(object.data);
Object's property data
has value of type string
, object
, Buffer
or Stream
.
Get object as JSON:
const object = await client.objects.getJSON(id);
console.log(object.data);
Get object as buffer:
const object = await client.objects.getBuffer(id);
console.log(object.data.toString())
Get object as stream:
const object = await client.objects.getStream(id);
object.data.pipe(...)
Get object query:
const query = {
'x-query-foo': 'fooQuery',
'x-query-bar': 'barQuery',
};
const response = await this.client.objects.getObjectQuery(query);
Create read stream example:
client.objects.createReadStream(id).pipe(fs.createWriteStream('/foo/bar.jpg'));
Create object:
const response = await client.objects.create(data);
Where data
can be string
, Buffer
, Stream
or array of these values.
Create object with queryable parameters:
const params = {
objectFields: {
key1: {
Meta: 'someMeta',
Query: 'someQuery',
}
}
}
const response = await client.objects.create(data, params);
Create object with metadata:
const response = await client.objects.create(data, {
metadata: {
key: 'value'
}
});
Create object and override its content type:
const response = await client.objects.create({
data: 'hello world',
contentType: 'text/plain'
});
Create multiple objects at once:
const data = [
{
data: 'hello world'
},
{
data: JSON.stringify(json),
contentType: 'application/json'
},
fs.createReadStream('/foo/bar.jpg'),
Buffer.allocUnsafe(1024)
];
const response = await client.objects.create(data, {
bucket: 'bucket-id',
metadata: {
description: 'my stuff'
}
});
Writable stream example:
fs.createReadStream('/foo/bar.jpg').pipe(client.objects.createWriteStream());
Update object query:
const data = 'hello world';
const objectFields = {
foo: { Query: 'fooQuery', Meta: 'fooMeta' },
bar: { Query: 'barQuery', Meta: 'barMeta' }
};
const params = { id: 'some', objectFields };
const object = await this.client.objects.updateObjectQuery(data, params);
Delete object:
await client.objects.delete(id);
Delete object query:
const query = {
foo: 'a',
bar: 'b'
};
await client.objects.delete(query);
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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.