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

hklib

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hklib - npm Package Compare versions

Comparing version 2.2.0 to 2.2.3

13

connectorclass.js
/*
* Copyright (c) 2016-present, IBM Research
* Licensed under The MIT License [see LICENSE for details]
* copyright: IBM Confidential
* copyright: OCO Source Materials
* copyright: © IBM Corp. All Rights Reserved
* date: 2020
*
* IBM Certificate of Originality
*/
"use strict";

@@ -13,2 +16,4 @@

exports.CONSTRAINT = "c";
exports.CAUSAL = "C";
exports.CAUSAL = "C";
exports.POSSIBILITY = "p";
exports.POSSIBILITYRESOLVER = "P";

@@ -497,2 +497,67 @@ /*

/**
* Filter entities Ids using CSS pattern `(TODO: document it better)`
*
* Examples:
*
* `{"parent" : "bar"}` - filter entities ids from a context bar
*
* `{"type" : "node"}` - filter entities ids of type node
*
* `{"properties" : {"name" : "bar"}` - filter entities ids with property name which it is bar
*
* `{"parent":"parent_context", {"properties" : {"name" : "bar"}` - Combined filter
*
* @param {object} filter The CSS filter
* @param {GetEntitiesCallback} callback Callback with the entities ids
*/
HKDatasource.prototype.filterEntitiesLazy = function(filter, callback = () => {})
{
let url = this.url + "repository/" + this.graphName + "/entity/lazy";
let params = {}
if(typeof filter === "object")
{
params.headers = {"content-type": "application/json"};
params.body = JSON.stringify(filter);
}
else if(typeof filter === "string")
{
params.headers = {"content-type": "text/plain"};
params.body = filter;
}
Object.assign(params, this.options);
request.post(url, params, (err, res) =>
{
if(!err)
{
if(requestCompletedWithSuccess (res.statusCode))
{
try
{
callback(null, JSON.parse(res.body));
}
catch(exp)
{
callback(exp);
}
}
else
{
callback(`Server responded with ${res.statusCode}. ${res.body}`);
}
}
else
{
callback(err);
}
});
}
/**
* @callback QueryResultsCallback

@@ -499,0 +564,0 @@ * @param err An error object that indicate if the operation was succesful or not

/*
* Copyright (c) 2016-present, IBM Research
* Licensed under The MIT License [see LICENSE for details]
* copyright: IBM Confidential
* copyright: OCO Source Materials
* copyright: © IBM Corp. All Rights Reserved
* date: 2020
*
* IBM Certificate of Originality
*/
"use strict";

@@ -42,2 +45,4 @@

exports.CAUSAL = ConnectorClass.CAUSAL;
exports.POSSIBILITY = ConnectorClass.POSSIBILITY;
exports.POSSIBILITYRESOLVER = ConnectorClass.POSSIBILITYRESOLVER;

@@ -44,0 +49,0 @@

{
"name": "hklib",
"version": "2.2.0",
"version": "2.2.3",
"main": "index.js",

@@ -5,0 +5,0 @@ "author": "IBM Research",

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