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

@epip/crud

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@epip/crud - npm Package Compare versions

Comparing version 1.0.53 to 1.0.54

19

core/services/base.service.ts
import { to } from "await-to-js";
import { DeepPartial, IsNull, Repository } from "typeorm";
import { IResponse, IResponseAll } from "../types";
import { Request } from "express";

@@ -8,3 +9,3 @@ export class BaseService<T> {

public async getAll(): Promise<IResponseAll<T>> {
public async getAll(req: Request): Promise<IResponseAll<T>> {
const [err, results] = await to(this.repo.find({

@@ -29,3 +30,3 @@ where:{

public async get(id: number): Promise<IResponse<T>> {
public async get(req: Request, id: number): Promise<IResponse<T>> {
const [err, result] = await to(

@@ -53,3 +54,3 @@ this.repo.findOne({

public async post(entity: T): Promise<IResponse<T>> {
public async post(req: Request, entity: T): Promise<IResponse<T>> {
(entity as any).insertedAt=new Date()

@@ -71,5 +72,5 @@ const [err, result] = await to(this.repo.save(entity));

public async put(id: number, entity: T): Promise<IResponse<T>> {
public async put(req: Request, id: number, entity: T): Promise<IResponse<T>> {
(entity as any).insertedAt=new Date()
let [err, results] = await to(this.get(id));
let [err, results] = await to(this.get(req, id));
if (err) {

@@ -121,4 +122,4 @@ return {

public async patch(id: number, entity: T): Promise<IResponse<T>> {
let [err, results] = await to(this.get(id));
public async patch(req: Request, id: number, entity: T): Promise<IResponse<T>> {
let [err, results] = await to(this.get(req, id));
if (err) {

@@ -169,4 +170,4 @@ return {

public async delete(id: number): Promise<IResponse<T>> {
let [err, results] = await to(this.get(id));
public async delete(req: Request, id: number): Promise<IResponse<T>> {
let [err, results] = await to(this.get(req, id));
if (err) {

@@ -173,0 +174,0 @@ return {

{
"name": "@epip/crud",
"version": "1.0.53",
"version": "1.0.54",
"description": "",
"main": "index.js",
"dependencies": {},
"dependencies": {
"express": "^4.17.1"
},
"devDependencies": {
"@nestjs/common": "^8.0.6",
"@nestjs/swagger": "^5.0.9",
"@types/browserify": "latest",
"@types/express": "^4.17.13",
"await-to-js": "^3.0.0",
"browserify": "latest",
"typeorm": "^0.2.37",
"typescript": "^4.4.2",
"browserify": "latest",
"@types/browserify": "latest"
"typescript": "^4.4.2"
},

@@ -16,0 +19,0 @@ "scripts": {

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