Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
loopback-sdelete-mixin
Advanced tools
A mixin to automatically generate created and updated Date attributes for loopback Models
This is forked from gausie/loopback-softdelete-mixin
This module is designed for the Strongloop Loopback framework. It allows entities of any Model to be "soft deleted" by adding deletedAt
and _isDeleted
attributes. Queries following the standard format will no return these entities; they can only be accessed by adding { deleted: true }
to the query object (at the same level as where
, include
etc).
It is heavily inspired by loopback-ds-timestamp-mixin.
npm install --save loopback-sdelete-mixin
To use with your Models add the mixins
attribute to the definition object of your model config.
{
"name": "Widget",
"properties": {
"name": {
"type": "string",
},
},
"mixins": {
"SoftDelete" : true,
},
},
There are a number of configurable options to the mixin. You can specify alternative property names for deletedAt
and _isDeleted
, as well as configuring deletion to "scrub" the entity. If true, this sets all but the "id" fields to null. If an array, it will only scrub properties with those names.
"mixins": {
"SoftDelete": {
"deletedAt": "deletedOn",
"_isDeleted": "deleted",
"scrub": true,
},
},
To run queries that include deleted items in the response, add { deleted: true }
to the query object (at the same level as where
, include
etc).
FAQs
A mixin to automatically generate created and updated Date attributes for loopback Models
We found that loopback-sdelete-mixin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.