@avelardelarosa/core-util 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/entities/Auditory.ts +4 -9
- package/src/app.controller.spec.ts +0 -22
- package/src/app.controller.ts +0 -12
- package/src/app.module.ts +0 -10
- package/src/app.service.ts +0 -8
- package/src/main.ts +0 -8
- package/test/app.e2e-spec.ts +0 -25
- package/test/jest-e2e.json +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avelardelarosa/core-util",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Librería de utilidades comunes para servicios backend desarrollados con NestJS",
|
|
5
5
|
"author": "Alexander Junior Velarde La Rosa <avelardelarosa@gmail.com>",
|
|
6
6
|
"private": false,
|
package/src/entities/Auditory.ts
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import { Column, Entity } from 'typeorm';
|
|
2
1
|
import { IsDate } from 'class-validator';
|
|
3
2
|
import { Type } from 'class-transformer';
|
|
3
|
+
import { CreateDateColumn, DeleteDateColumn } from 'typeorm';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
export class Auditory {
|
|
7
|
-
@Column({ nullable: false })
|
|
5
|
+
export abstract class Auditory {
|
|
8
6
|
createUser: string;
|
|
9
|
-
@
|
|
7
|
+
@CreateDateColumn({ name: 'created_at', type: 'timestamp' })
|
|
10
8
|
@IsDate()
|
|
11
9
|
@Type(() => Date)
|
|
12
10
|
createDate: Date;
|
|
13
|
-
@Column({ nullable: false })
|
|
14
11
|
updateUser: string;
|
|
15
|
-
@Column({ type: 'timestamp', nullable: false })
|
|
16
12
|
@IsDate()
|
|
17
13
|
@Type(() => Date)
|
|
18
14
|
updateDate: string;
|
|
19
|
-
@Column({ nullable: false })
|
|
20
15
|
deleteUser: string;
|
|
21
|
-
@
|
|
16
|
+
@DeleteDateColumn({ name: 'deleted_at', type: 'timestamp' })
|
|
22
17
|
@IsDate()
|
|
23
18
|
@Type(() => Date)
|
|
24
19
|
deleteDate: string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
-
import { AppController } from './app.controller';
|
|
3
|
-
import { AppService } from './app.service';
|
|
4
|
-
|
|
5
|
-
describe('AppController', () => {
|
|
6
|
-
let appController: AppController;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
const app: TestingModule = await Test.createTestingModule({
|
|
10
|
-
controllers: [AppController],
|
|
11
|
-
providers: [AppService],
|
|
12
|
-
}).compile();
|
|
13
|
-
|
|
14
|
-
appController = app.get<AppController>(AppController);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe('root', () => {
|
|
18
|
-
it('should return "Hello World!"', () => {
|
|
19
|
-
expect(appController.getHello()).toBe('Hello World!');
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
});
|
package/src/app.controller.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Controller, Get } from '@nestjs/common';
|
|
2
|
-
import { AppService } from './app.service';
|
|
3
|
-
|
|
4
|
-
@Controller()
|
|
5
|
-
export class AppController {
|
|
6
|
-
constructor(private readonly appService: AppService) {}
|
|
7
|
-
|
|
8
|
-
@Get()
|
|
9
|
-
getHello(): string {
|
|
10
|
-
return this.appService.getHello();
|
|
11
|
-
}
|
|
12
|
-
}
|
package/src/app.module.ts
DELETED
package/src/app.service.ts
DELETED
package/src/main.ts
DELETED
package/test/app.e2e-spec.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
-
import { INestApplication } from '@nestjs/common';
|
|
3
|
-
import * as request from 'supertest';
|
|
4
|
-
import { App } from 'supertest/types';
|
|
5
|
-
import { AppModule } from './../src/app.module';
|
|
6
|
-
|
|
7
|
-
describe('AppController (e2e)', () => {
|
|
8
|
-
let app: INestApplication<App>;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
12
|
-
imports: [AppModule],
|
|
13
|
-
}).compile();
|
|
14
|
-
|
|
15
|
-
app = moduleFixture.createNestApplication();
|
|
16
|
-
await app.init();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('/ (GET)', () => {
|
|
20
|
-
return request(app.getHttpServer())
|
|
21
|
-
.get('/')
|
|
22
|
-
.expect(200)
|
|
23
|
-
.expect('Hello World!');
|
|
24
|
-
});
|
|
25
|
-
});
|