New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

clay-entity

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clay-entity

Entity class for ClayDB

latest
Source
npmnpm
Version
2.1.11
Version published
Maintainers
2
Created
Source

Title Banner

Build Status npm Version JS Standard

Entity class for ClayDB

Installation

$ npm install clay-entity --save

Usage

'use strict'

const clayEntity = require('clay-entity')

{
  let entity01 = clayEntity({
    title: 'Wonderful Banana'
  })
  console.log(entity01)
}

API

clay-entity@2.1.10

Entity class for ClayDB

Functions

create(args) -> Entity

Create a Entity instance

ParamTypeDescription
args*

decorate(decorate) -> DecoratedEntity

Decorate an entity

ParamTypeDescription
decorateEntity

isEntity(obj) -> boolean

Detect a instance is entity or not

ParamTypeDescription
obj*Object to check

DecoratedEntity Class

new DecoratedEntity(entity)

Constructor of DecoratedEntity class

ParamTypeDescription
entityEntityEntity to decorate

entity.get(name) -> *

Get entity attribute.

ParamTypeDescription
namestringName of attribute

entity.set(name, value) -> DecoratedEntity

Set value

ParamTypeDescription
namestringName of attribute to set
value*Value to set

entity.set(attributes, options) -> DecoratedEntity

Set values

ParamTypeDescription
attributesObjectAttributes to set
optionsObjectOptional settings
options.allowReservedbooleanAllow to set reserved

entity.at(at) -> DecoratedEntity

Set $$at attribute

ParamTypeDescription
atDateDate data set at

entity.at() -> Date

Get $$at attribute

entity.by(by) -> DecoratedEntity

Set $$by attribute

ParamTypeDescription
bystringLump id

entity.by() -> string

Get $$by attribute

entity.seal(privateKey) -> DecoratedEntity

Seal this entity

ParamTypeDescription
privateKeystringPrivate key to seal

entity.seal() -> string

Get seal

entity.as(as) -> DecoratedEntity

Set resource name as as

ParamTypeDescription
asstringAs

entity.as() -> string

Get as

entity.num(num) -> DecoratedEntity

Set entity number as num

ParamTypeDescription
numstringAs

entity.num() -> string

Get num

entity.verify(publicKey) -> boolean

Verify the entity with public key

ParamTypeDescription
publicKeystring

entity.toValues() -> Object

Convert into value object

License

This software is released under the Apache-2.0 License.

Keywords

ClayDB

FAQs

Package last updated on 18 Jun 2019

Did you know?

Socket

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.

Install

Related posts