Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@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 lookupObjectByQueryParameters(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.lookupObjectByQueryParameters([
{ key: 'somequeriablefieldkey', value: 'somequeriablefieldvalue' },
{ key: 'anotherqueriablefieldkey', value: 'anotherqueriablefieldvalue' }
]);
The method returns a JSON array. 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 244 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.