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

@elastic.io/oih-standard-library

Package Overview
Dependencies
Maintainers
17
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic.io/oih-standard-library - npm Package Compare versions

Comparing version 1.0.0-rc3 to 1.0.0-rc4

12

lib/actions/delete.d.ts

@@ -39,14 +39,2 @@ export declare abstract class Delete {

getId(msg: any, cfg: any): any;
/**
* Method must return structure with object to be deleted and number of found objects for provided id. In most cases you will need just id, type and cfg.
* @param id of object to be deleted.
* @param type of object to be deleted.
* @param cfg input configuration, for example with credentials.
* @param msg input message.
* @returns object to be deleted and number of found objects.
*/
abstract findObjectById(id: any, type: any, cfg: any, msg: any): Promise<{
object: any;
numberOfObjects: number;
}>;
}

@@ -53,0 +41,0 @@ export declare abstract class DeleteByUniqueCriteria extends Delete {

13

lib/actions/delete.js

@@ -31,14 +31,3 @@ "use strict";

this.logger.trace('Id: %j and type: %j of object to be deleted', id, type);
const foundObject = await this.findObjectById(id, type, cfg, msg);
if (foundObject.numberOfObjects > 1) {
throw new Error('Found more than 1 object for provided id: ' + JSON.stringify(id) + ' number of objects found: ' + JSON.stringify(foundObject.numberOfObjects));
}
if (foundObject.numberOfObjects === 0) {
this.logger.trace('No objects for id: %j and type: %j, were found returning empty object', id, type);
this.logger.info('Finished processing deleteById action');
return {};
}
const { object } = foundObject;
this.logger.trace('Start deleting object: %j', object);
const deletedId = await this.deleteObject(object, cfg, msg);
const deletedId = await this.deleteObject(id, cfg, msg);
if (deletedId === null) {

@@ -45,0 +34,0 @@ this.logger.trace('Object with ID: %j and type: %j was not deleted or not found. Returning empty object', id, type);

@@ -53,14 +53,3 @@ import { id, objectType, uniqueCriteria } from '../constants';

this.logger.trace('Id: %j and type: %j of object to be deleted', id, type);
const foundObject = await this.findObjectById(id, type, cfg, msg);
if (foundObject.numberOfObjects > 1) {
throw new Error('Found more than 1 object for provided id: ' + JSON.stringify(id) + ' number of objects found: ' + JSON.stringify(foundObject.numberOfObjects));
}
if (foundObject.numberOfObjects === 0) {
this.logger.trace('No objects for id: %j and type: %j, were found returning empty object', id, type);
this.logger.info('Finished processing deleteById action');
return {};
}
const { object } = foundObject;
this.logger.trace('Start deleting object: %j', object);
const deletedId = await this.deleteObject(object, cfg, msg);
const deletedId = await this.deleteObject(id, cfg, msg);
if (deletedId === null) {

@@ -92,17 +81,2 @@ this.logger.trace('Object with ID: %j and type: %j was not deleted or not found. Returning empty object', id, type);

}
/**
* Method must return structure with object to be deleted and number of found objects for provided id. In most cases you will need just id, type and cfg.
* @param id of object to be deleted.
* @param type of object to be deleted.
* @param cfg input configuration, for example with credentials.
* @param msg input message.
* @returns object to be deleted and number of found objects.
*/
public async abstract findObjectById(id: any, type: any, cfg: any, msg: any): Promise<{
object: any,
numberOfObjects: number,
}>;
}

@@ -109,0 +83,0 @@

2

package.json
{
"name": "@elastic.io/oih-standard-library",
"version": "1.0.0-rc3",
"version": "1.0.0-rc4",
"description": "Library for OIH standards implementation",

@@ -5,0 +5,0 @@ "author": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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