New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pirate

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pirate - npm Package Compare versions

Comparing version 0.9.3 to 0.9.5

63

lib/elasticsearch-adapter.js

@@ -18,2 +18,8 @@ // Generated by CoffeeScript 1.6.3

Adapter = (function() {
Adapter.prototype.esVersion = {
major: 0,
minor: 0,
patch: 0
};
Adapter.make = function(configuration) {

@@ -35,3 +41,18 @@ return new this(configuration);

_this.client = new ElasticSearchClient(options);
return _this.events.emit("ready", _this);
return _this.client.createCall({
path: "",
method: "GET"
}, options).on("data", function(data) {
var versionString, versionTokens;
versionString = JSON.parse(data).version.number;
versionTokens = versionString.split(".");
_this.esVersion = {
major: parseInt(versionTokens[0]),
minor: parseInt(versionTokens[1]),
patch: parseInt(versionTokens[2])
};
return _this.events.emit("ready", _this);
}).on("error", function(err) {
return _this.events.emit("error", err);
}).exec();
});

@@ -74,7 +95,20 @@ }

return events.safely(function() {
return _this.adapter.client.count(_this.index, _this.type, {
terms: {
_id: keys
}
}).on("data", function(data) {
var countQueryJSON;
countQueryJSON = null;
if (_this.adapter.esVersion.major >= 1 && _this.adapter.esVersion.minor >= 0 && _this.adapter.esVersion.patch >= 1) {
countQueryJSON = {
query: {
terms: {
_id: keys
}
}
};
} else {
countQueryJSON = {
terms: {
_id: keys
}
};
}
return _this.adapter.client.count(_this.index, _this.type, countQueryJSON).on("data", function(data) {
var findEvents, jsonData;

@@ -297,5 +331,16 @@ jsonData = JSON.parse(data);

return this.events.source(function(events) {
return _this.adapter.client.count(_this.index, _this.type, {
match_all: {}
}).on("data", function(data) {
var countQueryJSON;
countQueryJSON = null;
if (_this.adapter.esVersion.major >= 1 && _this.adapter.esVersion.minor >= 0 && _this.adapter.esVersion.patch >= 1) {
countQueryJSON = {
query: {
match_all: {}
}
};
} else {
countQueryJSON = {
match_all: {}
};
}
return _this.adapter.client.count(_this.index, _this.type, countQueryJSON).on("data", function(data) {
var jsonData;

@@ -302,0 +347,0 @@ jsonData = JSON.parse(data);

2

package.json
{
"name": "pirate",
"version": "0.9.3",
"version": "0.9.5",
"description": "A simple storage interface with adapters for different storage systems",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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