From 9b7af514b55e97da3089377766b5d5b60d96357a Mon Sep 17 00:00:00 2001 From: Harold Cohen Date: Mon, 2 Oct 2023 14:01:46 +0200 Subject: [PATCH 1/7] feat: add postgres car rental read repository --- docker-compose.yaml | 12 + package.json | 6 +- .../database/typeorm/data-source.ts | 18 + .../repositories/{query => }/inMemory.ts | 10 +- .../containers/repositories/typeorm.ts | 11 + src/core/domain/car/dto.ts | 4 +- src/core/domain/car/model.ts | 2 +- .../repositories/inMemory/carRental/write.ts | 2 +- .../repositories/typeorm/carRental/read.ts | 32 ++ .../repositories/typeorm/entities/car.ts | 12 + .../repositories/typeorm/entities/carModel.ts | 10 + .../typeorm/entities/carRental.ts | 25 ++ .../repositories/typeorm/entities/customer.ts | 7 + .../repositories/typeorm/entities/index.ts | 4 + .../typeorm/carRental/query/read.test.ts | 109 ++++++ .../typeorm/seeding/factories/car.ts | 15 + .../typeorm/seeding/factories/carModel.ts | 16 + .../typeorm/seeding/factories/carRental.ts | 20 ++ .../typeorm/seeding/factories/customer.ts | 15 + tests/unit/carRental/command/rentACar.test.ts | 7 +- .../query/retrieveACarRental.test.ts | 10 +- yarn.lock | 315 +++++++++++++++++- 22 files changed, 641 insertions(+), 21 deletions(-) create mode 100644 docker-compose.yaml create mode 100644 src/configuration/database/typeorm/data-source.ts rename src/configuration/injection/containers/repositories/{query => }/inMemory.ts (66%) create mode 100644 src/configuration/injection/containers/repositories/typeorm.ts create mode 100644 src/driven/repositories/typeorm/carRental/read.ts create mode 100644 src/driven/repositories/typeorm/entities/car.ts create mode 100644 src/driven/repositories/typeorm/entities/carModel.ts create mode 100644 src/driven/repositories/typeorm/entities/carRental.ts create mode 100644 src/driven/repositories/typeorm/entities/customer.ts create mode 100644 src/driven/repositories/typeorm/entities/index.ts create mode 100644 tests/integration/typeorm/carRental/query/read.test.ts create mode 100644 tests/integration/typeorm/seeding/factories/car.ts create mode 100644 tests/integration/typeorm/seeding/factories/carModel.ts create mode 100644 tests/integration/typeorm/seeding/factories/carRental.ts create mode 100644 tests/integration/typeorm/seeding/factories/customer.ts diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..1b8f4bf --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +version: "2.4" +services: + db: + image: postgres:13.12 + ports: + - "5432:5432" + environment: + PGUSER: user + PGPASSWORD: password + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: megahertz diff --git a/package.json b/package.json index c140494..74630b9 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "index.js", "scripts": { "test": "jest", - "lint": "eslint src --ext ts,tsx" + "lint": "eslint src --ext ts,tsx", + "typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js" }, "author": "Harold Cohen ", "license": "ISC", @@ -26,15 +27,18 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.28.1", "lodash": "^4.17.21", + "pg": "^8.11.3", "ramda": "^0.29.0", "reflect-metadata": "^0.1.13", "ts-node": "^10.9.1", "tslib": "^2.6.2", "tsyringe": "^4.8.0", + "typeorm": "^0.3.17", "typescript": "^5.2.2", "uuid": "^9.0.1" }, "devDependencies": { + "@jorgebodega/typeorm-factory": "^1.4.0", "@thetribe/eslint-config-typescript": "^0.5.1", "@types/jest": "^29.5.5", "@typescript-eslint/eslint-plugin": "^6.7.3", diff --git a/src/configuration/database/typeorm/data-source.ts b/src/configuration/database/typeorm/data-source.ts new file mode 100644 index 0000000..04c6bc7 --- /dev/null +++ b/src/configuration/database/typeorm/data-source.ts @@ -0,0 +1,18 @@ +import {DataSource} from 'typeorm'; + +const AppDataSource = new DataSource({ + type: "postgres", + host: "localhost", + port: 5432, + username: "user", + password: "password", + database: "megahertz", + synchronize: true, + logging: true, + entities: ['src/driven/repositories/typeorm/entities/*.{ts,js}'], + subscribers: [], + migrations: ['src/driven/repositories/typeorm/migrations/*.{ts,js}'], +}); + + +export default AppDataSource; \ No newline at end of file diff --git a/src/configuration/injection/containers/repositories/query/inMemory.ts b/src/configuration/injection/containers/repositories/inMemory.ts similarity index 66% rename from src/configuration/injection/containers/repositories/query/inMemory.ts rename to src/configuration/injection/containers/repositories/inMemory.ts index 2625b0f..fd8efe9 100644 --- a/src/configuration/injection/containers/repositories/query/inMemory.ts +++ b/src/configuration/injection/containers/repositories/inMemory.ts @@ -1,9 +1,9 @@ import {container} from 'tsyringe'; -import InMemoryCarReadRepository from '../../../../../driven/repositories/inMemory/car/read'; -import UnitOfWork from '../../../../../driven/repositories/inMemory/common/unitOfWork'; -import InMemoryCarRentalReadRepository from '../../../../../driven/repositories/inMemory/carRental/read'; -import InMemoryCarRentalWriteRepository from '../../../../../driven/repositories/inMemory/carRental/write'; -import InMemoryTransactionManagerProxy from '../../../../../driven/repositories/inMemory/common/transactions/proxy'; +import InMemoryCarReadRepository from '../../../../driven/repositories/inMemory/car/read'; +import UnitOfWork from '../../../../driven/repositories/inMemory/common/unitOfWork'; +import InMemoryCarRentalReadRepository from '../../../../driven/repositories/inMemory/carRental/read'; +import InMemoryCarRentalWriteRepository from '../../../../driven/repositories/inMemory/carRental/write'; +import InMemoryTransactionManagerProxy from '../../../../driven/repositories/inMemory/common/transactions/proxy'; /** * Configures tsyringe to use inMemory repositories. diff --git a/src/configuration/injection/containers/repositories/typeorm.ts b/src/configuration/injection/containers/repositories/typeorm.ts new file mode 100644 index 0000000..a057ac5 --- /dev/null +++ b/src/configuration/injection/containers/repositories/typeorm.ts @@ -0,0 +1,11 @@ +import {container} from 'tsyringe'; +import TypeORMCarRentalReadRepository from '../../../../driven/repositories/typeorm/carRental/read'; + +/** + * Configures tsyringe to use typeORM repositories. + */ +const useTypeORMRepositories = (): void => { + container.register("CarRentalReadRepositoryInterface", {useClass: TypeORMCarRentalReadRepository}); +} + +export default useTypeORMRepositories; \ No newline at end of file diff --git a/src/core/domain/car/dto.ts b/src/core/domain/car/dto.ts index 54bd61d..ba46f21 100644 --- a/src/core/domain/car/dto.ts +++ b/src/core/domain/car/dto.ts @@ -1,6 +1,8 @@ +import CarModelDTO from '../carModel/dto'; + type CarDTO = { id: string; - modelId: string; + model: CarModelDTO; } export default CarDTO; \ No newline at end of file diff --git a/src/core/domain/car/model.ts b/src/core/domain/car/model.ts index 8ce0759..dfa977e 100644 --- a/src/core/domain/car/model.ts +++ b/src/core/domain/car/model.ts @@ -43,7 +43,7 @@ export default class Car { toDTO(): CarDTO { const carDTO = { id: this.id, - modelId: this.model.toDTO().id, + model: this.model.toDTO(), }; return Object.freeze(carDTO); diff --git a/src/driven/repositories/inMemory/carRental/write.ts b/src/driven/repositories/inMemory/carRental/write.ts index bc50c0b..28237aa 100644 --- a/src/driven/repositories/inMemory/carRental/write.ts +++ b/src/driven/repositories/inMemory/carRental/write.ts @@ -15,7 +15,7 @@ export default class InMemoryCarRentalWriteRepository implements CarRentalWriteR await this.unitOfWork.saveEntity("carRentals", { id: carRentalDTO.id, carId: carRentalDTO.car.id, - modelId: carRentalDTO.car.modelId, + modelId: carRentalDTO.car.model.id, dropOffDateTime: carRentalDTO.dropOffDateTime, pickupDateTime: carRentalDTO.pickupDateTime, customerId: carRentalDTO.customerId, diff --git a/src/driven/repositories/typeorm/carRental/read.ts b/src/driven/repositories/typeorm/carRental/read.ts new file mode 100644 index 0000000..34761cc --- /dev/null +++ b/src/driven/repositories/typeorm/carRental/read.ts @@ -0,0 +1,32 @@ +import CarRentalReadRepositoryInterface from '../../../../core/domain/carRental/interfaces/repositories/read'; +import CarRental from '../../../../core/domain/carRental/model'; +import Car from '../../../../core/domain/car/model'; +import CarModel from '../../../../core/domain/carModel/model'; +import {TypeORMCarRental} from '../entities'; +import AppDataSource from '../../../../configuration/database/typeorm/data-source'; + +export default class TypeORMCarRentalReadRepository implements CarRentalReadRepositoryInterface { + + async read(carRentalId: string): Promise { + const repository = AppDataSource.getRepository(TypeORMCarRental); + const retrievedCarRental = await repository.findOne({ + where: {id: carRentalId}, + relations: ['customer', 'car', 'car.model'] + }) as TypeORMCarRental; + + return new CarRental({ + id: carRentalId, + customerId: retrievedCarRental.customer.id, + totalPrice: retrievedCarRental.totalPrice, + pickupDateTime: retrievedCarRental.pickupDateTime, + dropOffDateTime: retrievedCarRental.dropOffDateTime, + car: new Car({ + id: retrievedCarRental.car.id, + model: new CarModel({ + id: retrievedCarRental.car.model.id, + dailyRate: retrievedCarRental.car.model.dailyRate, + }) + }) + }) + } +} \ No newline at end of file diff --git a/src/driven/repositories/typeorm/entities/car.ts b/src/driven/repositories/typeorm/entities/car.ts new file mode 100644 index 0000000..a85ac2a --- /dev/null +++ b/src/driven/repositories/typeorm/entities/car.ts @@ -0,0 +1,12 @@ +import {BaseEntity, Entity, OneToOne, PrimaryColumn, JoinColumn} from 'typeorm'; +import {TypeORMCarModel} from './index'; + +@Entity() +export default class TypeORMCar extends BaseEntity { + @PrimaryColumn() + public id!: string; + + @OneToOne(() => TypeORMCarModel) + @JoinColumn() + model!: TypeORMCarModel; +} \ No newline at end of file diff --git a/src/driven/repositories/typeorm/entities/carModel.ts b/src/driven/repositories/typeorm/entities/carModel.ts new file mode 100644 index 0000000..dd31f65 --- /dev/null +++ b/src/driven/repositories/typeorm/entities/carModel.ts @@ -0,0 +1,10 @@ +import {BaseEntity, Column, Entity, PrimaryColumn} from 'typeorm'; + +@Entity() +export default class TypeORMCarModel extends BaseEntity { + @PrimaryColumn() + public id!: string; + + @Column() + dailyRate!: number; +} \ No newline at end of file diff --git a/src/driven/repositories/typeorm/entities/carRental.ts b/src/driven/repositories/typeorm/entities/carRental.ts new file mode 100644 index 0000000..909fbde --- /dev/null +++ b/src/driven/repositories/typeorm/entities/carRental.ts @@ -0,0 +1,25 @@ +import {BaseEntity, Column, Entity, OneToOne, PrimaryColumn, JoinColumn} from 'typeorm'; +import {TypeORMCar, TypeORMCustomer} from "./index"; + +@Entity() +export default class TypeORMCarRental extends BaseEntity { + @PrimaryColumn() + public id!: string; + + @Column() + public totalPrice!: number; + + @Column() + public pickupDateTime!: Date; + + @Column() + public dropOffDateTime!: Date; + + @OneToOne(() => TypeORMCustomer) + @JoinColumn() + customer!: TypeORMCustomer; + + @OneToOne(() => TypeORMCar) + @JoinColumn() + car!: TypeORMCar; +} \ No newline at end of file diff --git a/src/driven/repositories/typeorm/entities/customer.ts b/src/driven/repositories/typeorm/entities/customer.ts new file mode 100644 index 0000000..7f38fc1 --- /dev/null +++ b/src/driven/repositories/typeorm/entities/customer.ts @@ -0,0 +1,7 @@ +import {BaseEntity, Column, Entity, PrimaryColumn} from 'typeorm'; + +@Entity() +export default class TypeORMCustomer { + @PrimaryColumn() + public id!: string; +} \ No newline at end of file diff --git a/src/driven/repositories/typeorm/entities/index.ts b/src/driven/repositories/typeorm/entities/index.ts new file mode 100644 index 0000000..eaf3571 --- /dev/null +++ b/src/driven/repositories/typeorm/entities/index.ts @@ -0,0 +1,4 @@ +export {default as TypeORMCarRental} from './carRental'; +export {default as TypeORMCustomer} from './customer'; +export {default as TypeORMCar} from './car'; +export {default as TypeORMCarModel} from './carModel'; \ No newline at end of file diff --git a/tests/integration/typeorm/carRental/query/read.test.ts b/tests/integration/typeorm/carRental/query/read.test.ts new file mode 100644 index 0000000..f48c5db --- /dev/null +++ b/tests/integration/typeorm/carRental/query/read.test.ts @@ -0,0 +1,109 @@ +import 'reflect-metadata'; +import {container} from 'tsyringe'; +import {v4} from 'uuid'; +import {advanceTo} from 'jest-date-mock'; +import DateParser from '../../../../utils/dateParser'; +import useTestingUtilities from '../../../../configuration/containers/utils'; +import TypeORMCarRentalReadRepository from '../../../../../src/driven/repositories/typeorm/carRental/read'; +import CarRentalDTO from '../../../../../src/core/domain/carRental/dto'; +import useTypeORMRepositories from '../../../../../src/configuration/injection/containers/repositories/typeorm'; +import AppDataSource from '../../../../../src/configuration/database/typeorm/data-source'; +import TypeORMCarRentalFactory from '../../seeding/factories/carRental'; +import TypeORMCustomerFactory from '../../seeding/factories/customer'; +import TypeORMCarFactory from '../../seeding/factories/car'; +import TypeORMCarModelFactory from '../../seeding/factories/carModel'; + +describe.each([ + { + rental: { + id: v4(), + customerId: v4(), + car: { + id: v4(), + model: { + id: '28837cd2-512c-4212-b934-c10d36ddfd7f', + dailyRate: 100, + } + }, + totalPrice: 100, + pickupDateTime: 'today', + dropOffDateTime: 'tomorrow', + } + }, + { + rental: { + id: v4(), + customerId: v4(), + car: { + id: v4(), + model: { + id: v4(), + dailyRate: 200, + } + }, + totalPrice: 200, + pickupDateTime: 'tomorrow', + dropOffDateTime: 'in 2 days', + } + }, +])("Integration tests to read car rentals from a postgres database using typeorm", (testCase) => { + let repository: TypeORMCarRentalReadRepository; + let expectedCarRental: Partial; + let dateParser: DateParser; + + beforeAll(async () => { + advanceTo(Date.now()); + useTestingUtilities(); + dateParser = container.resolve("DateParser"); + useTypeORMRepositories(); + repository = container.resolve("CarRentalReadRepositoryInterface"); + }) + + beforeEach(async () => { + await AppDataSource.initialize(); + await AppDataSource.synchronize(); + const customer = await new TypeORMCustomerFactory().create({ + id: testCase.rental.customerId, + }); + const model = await new TypeORMCarModelFactory().create({ + id: testCase.rental.car.model.id, + dailyRate: testCase.rental.car.model.dailyRate, + }); + const car = await new TypeORMCarFactory().create({ + id: testCase.rental.car.id, + model + }); + await new TypeORMCarRentalFactory().create({ + id: testCase.rental.id, + totalPrice: testCase.rental.totalPrice, + pickupDateTime: dateParser.parse(testCase.rental.pickupDateTime), + dropOffDateTime: dateParser.parse(testCase.rental.dropOffDateTime), + customer, + car, + }); + expectedCarRental = { + id: testCase.rental.id, + customerId: testCase.rental.customerId, + car: { + id: testCase.rental.car.id, + model: { + id: testCase.rental.car.model.id, + dailyRate: testCase.rental.car.model.dailyRate, + }, + }, + pickupDateTime: dateParser.parse(testCase.rental.pickupDateTime), + dropOffDateTime: dateParser.parse(testCase.rental.dropOffDateTime), + totalPrice: testCase.rental.totalPrice, + } + }) + + afterEach(async () => { + await AppDataSource.dropDatabase(); + await AppDataSource.destroy(); + }) + + test(`Read a car rental ${testCase.rental.id} should return one car rental`, async () => { + const retrievedCarRental = await repository.read(testCase.rental.id); + expect(retrievedCarRental.toDTO()).toEqual(expectedCarRental); + }) +}) \ No newline at end of file diff --git a/tests/integration/typeorm/seeding/factories/car.ts b/tests/integration/typeorm/seeding/factories/car.ts new file mode 100644 index 0000000..6f2b1d0 --- /dev/null +++ b/tests/integration/typeorm/seeding/factories/car.ts @@ -0,0 +1,15 @@ +import {v4} from 'uuid'; +import {FactorizedAttrs, Factory} from '@jorgebodega/typeorm-factory'; +import {TypeORMCar} from '../../../../../src/driven/repositories/typeorm/entities'; +import AppDataSource from '../../../../../src/configuration/database/typeorm/data-source'; + +export default class TypeORMCarFactory extends Factory { + protected entity = TypeORMCar; + protected dataSource = AppDataSource; + + protected attrs(): FactorizedAttrs { + return { + id: v4(), + }; + } +} \ No newline at end of file diff --git a/tests/integration/typeorm/seeding/factories/carModel.ts b/tests/integration/typeorm/seeding/factories/carModel.ts new file mode 100644 index 0000000..9e183d8 --- /dev/null +++ b/tests/integration/typeorm/seeding/factories/carModel.ts @@ -0,0 +1,16 @@ +import {v4} from 'uuid'; +import {FactorizedAttrs, Factory} from '@jorgebodega/typeorm-factory'; +import {TypeORMCarModel} from '../../../../../src/driven/repositories/typeorm/entities'; +import AppDataSource from '../../../../../src/configuration/database/typeorm/data-source'; + +export default class TypeORMCarModelFactory extends Factory { + protected entity = TypeORMCarModel; + protected dataSource = AppDataSource; + + protected attrs(): FactorizedAttrs { + return { + id: v4(), + dailyRate: 100, + }; + } +} \ No newline at end of file diff --git a/tests/integration/typeorm/seeding/factories/carRental.ts b/tests/integration/typeorm/seeding/factories/carRental.ts new file mode 100644 index 0000000..7982860 --- /dev/null +++ b/tests/integration/typeorm/seeding/factories/carRental.ts @@ -0,0 +1,20 @@ +import {v4} from 'uuid'; +import {FactorizedAttrs, Factory} from '@jorgebodega/typeorm-factory'; +import {TypeORMCar, TypeORMCarRental, TypeORMCustomer} from '../../../../../src/driven/repositories/typeorm/entities'; +import AppDataSource from '../../../../../src/configuration/database/typeorm/data-source'; + +export default class TypeORMCarRentalFactory extends Factory { + protected entity = TypeORMCarRental; + protected dataSource = AppDataSource; + + protected attrs(): FactorizedAttrs { + return { + id: v4(), + totalPrice: 0, + pickupDateTime: new Date(), + dropOffDateTime: new Date(), + customer: new TypeORMCustomer(), + car: new TypeORMCar(), + }; + } +} \ No newline at end of file diff --git a/tests/integration/typeorm/seeding/factories/customer.ts b/tests/integration/typeorm/seeding/factories/customer.ts new file mode 100644 index 0000000..54767e2 --- /dev/null +++ b/tests/integration/typeorm/seeding/factories/customer.ts @@ -0,0 +1,15 @@ +import {v4} from 'uuid'; +import {FactorizedAttrs, Factory} from '@jorgebodega/typeorm-factory'; +import {TypeORMCustomer} from '../../../../../src/driven/repositories/typeorm/entities'; +import AppDataSource from '../../../../../src/configuration/database/typeorm/data-source'; + +export default class TypeORMCustomerFactory extends Factory { + protected entity = TypeORMCustomer; + protected dataSource = AppDataSource; + + protected attrs(): FactorizedAttrs { + return { + id: v4(), + }; + } +} \ No newline at end of file diff --git a/tests/unit/carRental/command/rentACar.test.ts b/tests/unit/carRental/command/rentACar.test.ts index 40e74f8..a339a99 100644 --- a/tests/unit/carRental/command/rentACar.test.ts +++ b/tests/unit/carRental/command/rentACar.test.ts @@ -6,7 +6,7 @@ import DateParser from '../../../utils/dateParser'; import RentACar from '../../../../src/core/useCases/carRental/rentACar/handler'; import RentACarCommand from '../../../../src/core/useCases/carRental/rentACar/types/command'; import CarRentalDTO from '../../../../src/core/domain/carRental/dto'; -import useInMemoryRepositories from '../../../../src/configuration/injection/containers/repositories/query/inMemory'; +import useInMemoryRepositories from '../../../../src/configuration/injection/containers/repositories/inMemory'; import {convertToNumericPrice} from '../../../utils/misc'; import useTestingUtilities from '../../../configuration/containers/utils'; import {populateAvailableCarFromTestCase, populateCarsAndCarRentalsFromTestCase} from '../../utils/populateFromTestCase'; @@ -147,7 +147,10 @@ describe.each([ customerId: testCase.command.customer.id, car: { id: testCase.availableCar.id, - modelId: testCase.availableCar.model.id, + model: { + id: testCase.availableCar.model.id, + dailyRate: convertToNumericPrice(testCase.availableCar.model.dailyRate) + } }, totalPrice: convertToNumericPrice(testCase.expected.totalPrice), pickupDateTime: dateParser.parse(testCase.command.pickupDateTime), diff --git a/tests/unit/carRental/query/retrieveACarRental.test.ts b/tests/unit/carRental/query/retrieveACarRental.test.ts index 5a78669..16c8f2a 100644 --- a/tests/unit/carRental/query/retrieveACarRental.test.ts +++ b/tests/unit/carRental/query/retrieveACarRental.test.ts @@ -4,7 +4,7 @@ import {advanceTo} from 'jest-date-mock'; import useTestingUtilities from '../../../configuration/containers/utils'; import RetrieveACarRental from '../../../../src/core/useCases/carRental/retrieveACarRental/handler'; import DateParser from '../../../utils/dateParser'; -import useInMemoryRepositories from '../../../../src/configuration/injection/containers/repositories/query/inMemory'; +import useInMemoryRepositories from '../../../../src/configuration/injection/containers/repositories/inMemory'; import TransactionManagerInterface from '../../../../src/core/domain/common/interfaces/transactionManager'; import TransactionInterface from '../../../../src/core/domain/common/interfaces/transaction'; import CarRentalDTO from '../../../../src/core/domain/carRental/dto'; @@ -40,7 +40,6 @@ describe.each([ carRental: { id: '9cdf0321-1073-4c8c-99c6-a19ffaa987d4', customerId: '5b2287bb-b2e3-4378-a5d9-9285eb009506', - // customerId: '170f4869-7270-4f15-b931-2bfd8d5e6bb3', pickupDateTime: 'today', dropOffDateTime: 'tomorrow', car: { @@ -106,10 +105,13 @@ describe.each([ customerId: testCase.carRental.customerId, pickupDateTime: dateParser.parse(testCase.carRental.pickupDateTime), dropOffDateTime: dateParser.parse(testCase.carRental.dropOffDateTime), - totalPrice: totalPrice, + totalPrice, car: { id: testCase.carRental.car.id, - modelId: testCase.carRental.car.model.id, + model: { + id: testCase.carRental.car.model.id, + dailyRate: 0, + } } } }) diff --git a/yarn.lock b/yarn.lock index 10ca953..0a44de5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1275,6 +1275,13 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jorgebodega/typeorm-factory@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@jorgebodega/typeorm-factory/-/typeorm-factory-1.4.0.tgz#349f6d204754ef729eaccd7c3c39a1e385e5f7f5" + integrity sha512-c02QHz1FcR8w4Tzv2Ibf2SvxF4LYlna0DktNT9kfMFkMajcbP94KBN4EBpP4ECU/0baY1pflzhFhphlGErUamA== + dependencies: + tslib "2.4.1" + "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" @@ -1360,6 +1367,11 @@ dependencies: "@sinonjs/commons" "^3.0.0" +"@sqltools/formatter@^1.2.5": + version "1.2.5" + resolved "https://registry.yarnpkg.com/@sqltools/formatter/-/formatter-1.2.5.tgz#3abc203c79b8c3e90fd6c156a0c62d5403520e12" + integrity sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw== + "@thetribe/eslint-config-typescript@^0.5.1": version "0.5.1" resolved "https://registry.yarnpkg.com/@thetribe/eslint-config-typescript/-/eslint-config-typescript-0.5.1.tgz#855cc0827149b685ce8796e19256294b08fb3f73" @@ -1676,6 +1688,11 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== + anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" @@ -1684,6 +1701,11 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +app-root-path@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.1.0.tgz#5971a2fc12ba170369a7a1ef018c71e6e47c2e86" + integrity sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA== + arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" @@ -1973,6 +1995,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" @@ -1986,6 +2013,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -2022,6 +2056,19 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +buffer-writer@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/buffer-writer/-/buffer-writer-2.0.0.tgz#ce7eb81a38f7829db09c873f2fbb792c0c98ec04" + integrity sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw== + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -2070,7 +2117,7 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0: +chalk@^4.0.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2108,6 +2155,27 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== +cli-highlight@^2.1.11: + version "2.1.11" + resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.11.tgz#49736fa452f0aaf4fae580e30acb26828d2dc1bf" + integrity sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg== + dependencies: + chalk "^4.0.0" + highlight.js "^10.7.1" + mz "^2.4.0" + parse5 "^5.1.1" + parse5-htmlparser2-tree-adapter "^6.0.0" + yargs "^16.0.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -2234,7 +2302,7 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -date-fns@^2.30.0: +date-fns@^2.29.3, date-fns@^2.30.0: version "2.30.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== @@ -2336,6 +2404,11 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dotenv@^16.0.3: + version "16.3.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" + integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== + electron-to-chromium@^1.4.477: version "1.4.523" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.523.tgz#f82f99243c827df05c26776d49712cb284972df6" @@ -2838,6 +2911,17 @@ glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -2944,6 +3028,11 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +highlight.js@^10.7.1: + version "10.7.3" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" + integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== + homedir-polyfill@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" @@ -2961,6 +3050,11 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ignore-by-default@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" @@ -3000,7 +3094,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2: +inherits@2, inherits@^2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3828,11 +3922,23 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.0, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +mkdirp@^2.1.3: + version "2.1.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" + integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -3848,6 +3954,15 @@ ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +mz@^2.4.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -3906,6 +4021,11 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + object-inspect@^1.12.3, object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" @@ -4040,6 +4160,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +packet-reader@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/packet-reader/-/packet-reader-1.0.0.tgz#9238e5480dedabacfe1fe3f2771063f164157d74" + integrity sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -4062,6 +4187,23 @@ parse-passwd@^1.0.0: resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" integrity sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q== +parse5-htmlparser2-tree-adapter@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" + integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA== + dependencies: + parse5 "^6.0.1" + +parse5@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" + integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== + +parse5@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -4092,6 +4234,64 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pg-cloudflare@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz#e6d5833015b170e23ae819e8c5d7eaedb472ca98" + integrity sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q== + +pg-connection-string@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.6.2.tgz#713d82053de4e2bd166fab70cd4f26ad36aab475" + integrity sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA== + +pg-int8@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" + integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== + +pg-pool@^3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.6.1.tgz#5a902eda79a8d7e3c928b77abf776b3cb7d351f7" + integrity sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og== + +pg-protocol@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.6.0.tgz#4c91613c0315349363af2084608db843502f8833" + integrity sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q== + +pg-types@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" + integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA== + dependencies: + pg-int8 "1.0.1" + postgres-array "~2.0.0" + postgres-bytea "~1.0.0" + postgres-date "~1.0.4" + postgres-interval "^1.1.0" + +pg@^8.11.3: + version "8.11.3" + resolved "https://registry.yarnpkg.com/pg/-/pg-8.11.3.tgz#d7db6e3fe268fcedd65b8e4599cda0b8b4bf76cb" + integrity sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g== + dependencies: + buffer-writer "2.0.0" + packet-reader "1.0.0" + pg-connection-string "^2.6.2" + pg-pool "^3.6.1" + pg-protocol "^1.6.0" + pg-types "^2.1.0" + pgpass "1.x" + optionalDependencies: + pg-cloudflare "^1.1.1" + +pgpass@1.x: + version "1.0.5" + resolved "https://registry.yarnpkg.com/pgpass/-/pgpass-1.0.5.tgz#9b873e4a564bb10fa7a7dbd55312728d422a223d" + integrity sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug== + dependencies: + split2 "^4.1.0" + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -4126,6 +4326,28 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +postgres-array@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" + integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== + +postgres-bytea@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" + integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w== + +postgres-date@~1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8" + integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q== + +postgres-interval@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" + integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ== + dependencies: + xtend "^4.0.0" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -4312,6 +4534,11 @@ safe-array-concat@^1.0.0, safe-array-concat@^1.0.1: has-symbols "^1.0.3" isarray "^2.0.5" +safe-buffer@^5.0.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + safe-regex-test@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" @@ -4347,6 +4574,14 @@ set-function-name@^2.0.0: functions-have-names "^1.2.3" has-property-descriptors "^1.0.0" +sha.js@^2.4.11: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -4423,6 +4658,11 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +split2@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -4558,6 +4798,20 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" @@ -4640,12 +4894,17 @@ tsconfig-paths@^3.14.2: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" + integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== + tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.6.2: +tslib@^2.5.0, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -4718,6 +4977,27 @@ typed-array-length@^1.0.4: for-each "^0.3.3" is-typed-array "^1.1.9" +typeorm@^0.3.17: + version "0.3.17" + resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.3.17.tgz#a73c121a52e4fbe419b596b244777be4e4b57949" + integrity sha512-UDjUEwIQalO9tWw9O2A4GU+sT3oyoUXheHJy4ft+RFdnRdQctdQ34L9SqE2p7LdwzafHx1maxT+bqXON+Qnmig== + dependencies: + "@sqltools/formatter" "^1.2.5" + app-root-path "^3.1.0" + buffer "^6.0.3" + chalk "^4.1.2" + cli-highlight "^2.1.11" + date-fns "^2.29.3" + debug "^4.3.4" + dotenv "^16.0.3" + glob "^8.1.0" + mkdirp "^2.1.3" + reflect-metadata "^0.1.13" + sha.js "^2.4.11" + tslib "^2.5.0" + uuid "^9.0.0" + yargs "^17.6.2" + types-ramda@^0.29.4: version "0.29.4" resolved "https://registry.yarnpkg.com/types-ramda/-/types-ramda-0.29.4.tgz#8d9b51df2e550a05cedab541cc75dcd72972c625" @@ -4783,7 +5063,7 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -uuid@^9.0.1: +uuid@^9.0.0, uuid@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== @@ -4867,6 +5147,11 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" +xtend@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -4882,12 +5167,30 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs@^17.3.1: +yargs@^16.0.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yargs@^17.3.1, yargs@^17.6.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== From 0cdf7adc706f185f90bb86b94c724f04e5fc817a Mon Sep 17 00:00:00 2001 From: Harold Cohen Date: Mon, 2 Oct 2023 14:11:25 +0200 Subject: [PATCH 2/7] ci: add postgres container to run integration test --- .github/workflows/validate.yaml | 10 ++++++++++ src/driven/repositories/typeorm/entities/customer.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 7990d31..0bf65e4 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -19,6 +19,16 @@ jobs: - run: yarn lint test: runs-on: ubuntu-latest + services: + image: postgres:13.12 + ports: + - "5432:5432" + env: + PGUSER: user + PGPASSWORD: password + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: megahertz strategy: matrix: node-version: [20.x] diff --git a/src/driven/repositories/typeorm/entities/customer.ts b/src/driven/repositories/typeorm/entities/customer.ts index 7f38fc1..aaabfc0 100644 --- a/src/driven/repositories/typeorm/entities/customer.ts +++ b/src/driven/repositories/typeorm/entities/customer.ts @@ -1,4 +1,4 @@ -import {BaseEntity, Column, Entity, PrimaryColumn} from 'typeorm'; +import {Entity, PrimaryColumn} from 'typeorm'; @Entity() export default class TypeORMCustomer { From 9c49d6c7eefc9eb7ffe7cf9dc9517001907eb0ca Mon Sep 17 00:00:00 2001 From: Harold Cohen Date: Mon, 2 Oct 2023 14:13:21 +0200 Subject: [PATCH 3/7] ci: disable integration tests --- .github/workflows/validate.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 0bf65e4..05473af 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -19,16 +19,16 @@ jobs: - run: yarn lint test: runs-on: ubuntu-latest - services: - image: postgres:13.12 - ports: - - "5432:5432" - env: - PGUSER: user - PGPASSWORD: password - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: megahertz +# services: +# image: postgres:13.12 +# ports: +# - "5432:5432" +# env: +# PGUSER: user +# PGPASSWORD: password +# POSTGRES_USER: user +# POSTGRES_PASSWORD: password +# POSTGRES_DB: megahertz strategy: matrix: node-version: [20.x] @@ -39,4 +39,4 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: yarn install - - run: yarn test + - run: yarn test unit From 95a7cdf6e1fccf2321c04ed919b42649e2bd9710 Mon Sep 17 00:00:00 2001 From: Harold Cohen Date: Mon, 2 Oct 2023 14:14:39 +0200 Subject: [PATCH 4/7] ci: add postgres container to run integration tests --- .github/workflows/validate.yaml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 05473af..344e983 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -19,16 +19,14 @@ jobs: - run: yarn lint test: runs-on: ubuntu-latest -# services: -# image: postgres:13.12 -# ports: -# - "5432:5432" -# env: -# PGUSER: user -# PGPASSWORD: password -# POSTGRES_USER: user -# POSTGRES_PASSWORD: password -# POSTGRES_DB: megahertz + services: + image: postgres:13.12 + ports: + - "5432:5432" + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: megahertz strategy: matrix: node-version: [20.x] From b616083a5451a67493f4cecef2e9832d96527b86 Mon Sep 17 00:00:00 2001 From: Harold Cohen Date: Mon, 2 Oct 2023 14:17:44 +0200 Subject: [PATCH 5/7] ci: add postgres container to run integration tests --- .github/workflows/validate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 344e983..cd046a3 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -22,7 +22,7 @@ jobs: services: image: postgres:13.12 ports: - - "5432:5432" + - 5432:5432 env: POSTGRES_USER: user POSTGRES_PASSWORD: password From 0a0f2e03b3aa7e8e36797b95ab2c94b548157704 Mon Sep 17 00:00:00 2001 From: Harold Cohen Date: Mon, 2 Oct 2023 14:21:16 +0200 Subject: [PATCH 6/7] ci: add postgres container to run integration tests --- .github/workflows/validate.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index cd046a3..a8ad74b 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -19,17 +19,18 @@ jobs: - run: yarn lint test: runs-on: ubuntu-latest - services: - image: postgres:13.12 - ports: - - 5432:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: megahertz strategy: matrix: node-version: [20.x] + services: + postgres: + image: postgres:13.12 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: megahertz + ports: + - 5432:5432 steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -37,4 +38,4 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: yarn install - - run: yarn test unit + - run: yarn test From 1d37232286c2cdd57cc6225c8bc71ec340e5ef0a Mon Sep 17 00:00:00 2001 From: Harold Cohen Date: Mon, 2 Oct 2023 14:22:06 +0200 Subject: [PATCH 7/7] ci: add postgres container to run integration tests --- .github/workflows/validate.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index a8ad74b..5f33bc6 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -25,12 +25,12 @@ jobs: services: postgres: image: postgres:13.12 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: megahertz - ports: - - 5432:5432 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: megahertz + ports: + - 5432:5432 steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }}