Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@elastic.io/maester-client

Package Overview
Dependencies
Maintainers
15
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic.io/maester-client - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0-beta

.env

3

dist/package.json
{
"name": "@elastic.io/maester-client",
"version": "1.1.0",
"version": "1.2.0-beta",
"description": "The official object-storage client for sailor-nodejs.",

@@ -40,2 +40,3 @@ "main": "dist/src/index.js",

"chai": "4.2.0",
"dotenv": "8.2.0",
"eslint": "6.8.0",

@@ -42,0 +43,0 @@ "eslint-config-standard-with-typescript": "15.0.1",

@@ -0,0 +0,0 @@ import { AxiosInstance } from 'axios';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import BucketRepository from './bucket';

@@ -0,0 +0,0 @@ "use strict";

export * from './client';
export * from './bucket';
export * from './object';

@@ -0,0 +0,0 @@ "use strict";

@@ -5,2 +5,3 @@ /// <reference types="node" />

export declare const USER_META_HEADER_PREFIX = "x-meta-";
export declare const USER_QUERY_HEADER_PREFIX = "x-query-";
export declare const DEFAULT_CONTENT_TYPE = "application/octet-stream";

@@ -17,7 +18,9 @@ export declare type PlainOrArray<T> = T | T[];

export declare function headersToMeta(headers: Record<string, string>): ObjectMetadata;
export declare function headersToQuery(headers: Record<string, string>): ObjectMetadata;
export declare class GetObjectResponse {
readonly contentType: string;
readonly contentLength: number;
readonly metadata: ObjectMetadata;
readonly data: object | string | Buffer | Readable;
readonly contentType?: string;
readonly contentLength?: number;
readonly metadata?: ObjectMetadata;
readonly queriableFields?: QueriableField;
constructor(res: AxiosResponse);

@@ -58,4 +61,4 @@ }

readonly contentType: string;
readonly contentLength: number;
readonly md5: string;
readonly contentLength?: number;
readonly md5?: string;
readonly createdAt: Date | null;

@@ -62,0 +65,0 @@ readonly metadata: ObjectMetadata;

@@ -9,2 +9,3 @@ "use strict";

exports.USER_META_HEADER_PREFIX = 'x-meta-';
exports.USER_QUERY_HEADER_PREFIX = 'x-query-';
exports.DEFAULT_CONTENT_TYPE = 'application/octet-stream';

@@ -33,10 +34,30 @@ function isObjectData(data) {

exports.headersToMeta = headersToMeta;
function headersToQuery(headers) {
const meta = {};
for (const [key, value] of Object.entries(headers)) {
if (key.indexOf(exports.USER_QUERY_HEADER_PREFIX) === 0) {
meta[key.substr(exports.USER_QUERY_HEADER_PREFIX.length)] = value;
}
}
return meta;
}
exports.headersToQuery = headersToQuery;
class GetObjectResponse {
constructor(res) {
var _a, _b;
const { headers, data } = res;
this.contentType = (_a = headers['content-type']) !== null && _a !== void 0 ? _a : '';
this.contentLength = parseInt((_b = headers['content-length']) !== null && _b !== void 0 ? _b : 0);
this.metadata = headersToMeta(headers);
this.data = data;
if (headers['content-type']) {
this.contentType = headers['content-type'];
}
if (headers['content-length']) {
this.contentLength = parseInt(headers['content-length']);
}
const metadata = headersToMeta(headers);
if (Object.keys(metadata).length !== 0) {
this.metadata = metadata;
}
const queriableFields = headersToQuery(headers);
if (Object.keys(queriableFields).length !== 0) {
this.queriableFields = queriableFields;
}
}

@@ -50,4 +71,8 @@ }

this.contentType = contentType !== null && contentType !== void 0 ? contentType : '';
this.contentLength = contentLength !== null && contentLength !== void 0 ? contentLength : 0;
this.md5 = md5 !== null && md5 !== void 0 ? md5 : '';
if (contentLength) {
this.contentLength = contentLength;
}
if (md5) {
this.md5 = md5;
}
this.createdAt = createdAt ? new Date(createdAt) : null;

@@ -54,0 +79,0 @@ this.metadata = metadata !== null && metadata !== void 0 ? metadata : {};

{
"name": "@elastic.io/maester-client",
"version": "1.1.0",
"version": "1.2.0-beta",
"description": "The official object-storage client for sailor-nodejs.",

@@ -40,2 +40,3 @@ "main": "dist/src/index.js",

"chai": "4.2.0",
"dotenv": "8.2.0",
"eslint": "6.8.0",

@@ -42,0 +43,0 @@ "eslint-config-standard-with-typescript": "15.0.1",

@@ -9,3 +9,3 @@ # Maester Client

```
const Client = require('@elasticio/maester-client');
const { Client } = require('@elastic.io/maester-client');

@@ -15,3 +15,3 @@ const client = new Client('http://maester.local:3002', 'my-token');

### Buckets API
### Buckets API (deprecated)

@@ -18,0 +18,0 @@ Get bucket:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc