Refactor de las rutas para lanzarse con node (sin tsx)
This commit is contained in:
10
package.json
10
package.json
@@ -6,8 +6,9 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest watch",
|
"test": "vitest watch",
|
||||||
"build": "yarn workspaces foreach -A --exclude sim-consumidor-nos run build && cp .env dist/",
|
"build": "yarn workspaces foreach -A --exclude sim-consumidor-nos run build && cp .env dist/ && yarn setup:runtime",
|
||||||
"start": "yarn workspaces foreach -Apiv --exclude sim-consumidor-nos run start",
|
"setup:runtime": "mkdir -p dist/packages/node_modules && ln -sf ../sim-shared dist/packages/node_modules/sim-shared && ln -sf ../sim-consumidor-objenious dist/packages/node_modules/sim-consumidor-objenious && ln -sf ../sim-entrada-eventos dist/packages/node_modules/sim-entrada-eventos && ln -sf ../sim-objenious-cron dist/packages/node_modules/sim-objenious-cron",
|
||||||
|
"start": "yarn setup:runtime && yarn workspaces foreach -Apiv --exclude sim-consumidor-nos run start",
|
||||||
"typecheck": "npx tsc --noEmit",
|
"typecheck": "npx tsc --noEmit",
|
||||||
"dev": "yarn workspaces foreach -Apiv --exclude sim-consumidor-nos run dev ",
|
"dev": "yarn workspaces foreach -Apiv --exclude sim-consumidor-nos run dev ",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
@@ -41,8 +42,5 @@
|
|||||||
"tsc-alias": "^1.8.16",
|
"tsc-alias": "^1.8.16",
|
||||||
"tsx": "^4.21.0",
|
"tsx": "^4.21.0",
|
||||||
"vitest": "^4.0.16"
|
"vitest": "^4.0.16"
|
||||||
},
|
|
||||||
"imports": {
|
|
||||||
"#shared/*": "./dist/packages/shared/*.js"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,4 +63,4 @@
|
|||||||
"tsx": "*",
|
"tsx": "*",
|
||||||
"vitest": "*"
|
"vitest": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,24 @@
|
|||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist/sim-gestor-eventos",
|
"outDir": "../../dist/sim-gestor-eventos",
|
||||||
"baseUrl": "."
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"#config/*": [
|
||||||
|
"config/*"
|
||||||
|
],
|
||||||
|
"#adapters/*": [
|
||||||
|
"adapters/*"
|
||||||
|
],
|
||||||
|
"#domain/*": [
|
||||||
|
"domain/*"
|
||||||
|
],
|
||||||
|
"#ports/*": [
|
||||||
|
"ports/*"
|
||||||
|
],
|
||||||
|
"#tests/*": [
|
||||||
|
"__tests__/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
@@ -14,4 +31,4 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"index.ts"
|
"index.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../dist",
|
|
||||||
"baseUrl": "."
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
],
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"src/**/*.d.ts"
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import { startRMQClient } from "#config/eventBusConfig"
|
import { startRMQClient } from "#config/eventBusConfig"
|
||||||
import { SimNosController } from "aplication/SimNOS.controller"
|
import { SimNosController } from "./aplication/SimNOS.controller.js"
|
||||||
|
|
||||||
async function startWorker() {
|
async function startWorker() {
|
||||||
const rmqClient = await startRMQClient()
|
const rmqClient = await startRMQClient()
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"build": "yarn tsc --project tsconfig.json",
|
"build": "yarn tsc --project tsconfig.json && yarn tsc-alias && cp package.json ../../dist/packages/sim-consumidor-nos/",
|
||||||
|
"esbuild": "esbuild index.ts --platform=node",
|
||||||
"start": "node ../../dist/packages/sim-consumidor-nos/index.js"
|
"start": "node ../../dist/packages/sim-consumidor-nos/index.js"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
@@ -72,4 +73,4 @@
|
|||||||
"tsx": "*",
|
"tsx": "*",
|
||||||
"vitest": "*"
|
"vitest": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,36 @@
|
|||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist",
|
"outDir": "../../dist",
|
||||||
"baseUrl": "."
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"sim-shared/*": [
|
||||||
|
"../../packages/shared/*"
|
||||||
|
],
|
||||||
|
"sim-consumidor-objenious/*": [
|
||||||
|
"../../packages/sim-consumidor-objenious/*"
|
||||||
|
],
|
||||||
|
"sim-entrada-eventos/*": [
|
||||||
|
"../../packages/sim-entrada-eventos/*"
|
||||||
|
],
|
||||||
|
"sim-objenious-cron/*": [
|
||||||
|
"../../packages/sim-objenious-cron/*"
|
||||||
|
],
|
||||||
|
"#config/*": [
|
||||||
|
"config/*"
|
||||||
|
],
|
||||||
|
"#adapters/*": [
|
||||||
|
"adapters/*"
|
||||||
|
],
|
||||||
|
"#domain/*": [
|
||||||
|
"domain/*"
|
||||||
|
],
|
||||||
|
"#ports/*": [
|
||||||
|
"ports/*"
|
||||||
|
],
|
||||||
|
"#tests/*": [
|
||||||
|
"__tests__/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { startRMQClient } from "#config/eventBus.config.js"
|
|||||||
import { httpInstance } from "#config/httpClient.config.js"
|
import { httpInstance } from "#config/httpClient.config.js"
|
||||||
import { pgPool } from "#config/postgreConfig.js"
|
import { pgPool } from "#config/postgreConfig.js"
|
||||||
import { PgClient } from "sim-shared/infrastructure/PgClient.js"
|
import { PgClient } from "sim-shared/infrastructure/PgClient.js"
|
||||||
import { SimUseCases } from "aplication/Sim.usecases.js"
|
import { SimUseCases } from "./aplication/Sim.usecases.js"
|
||||||
import { SimController } from "./aplication/Sim.controller.js"
|
import { SimController } from "./aplication/Sim.controller.js"
|
||||||
import { SimRouter } from "./aplication/Sim.router.js"
|
import { SimRouter } from "./aplication/Sim.router.js"
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,6 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "consumidor generico de envetos de RMQ",
|
"description": "consumidor generico de envetos de RMQ",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
|
||||||
"dev": "tsx watch index.ts",
|
|
||||||
"build": "yarn tsc --project tsconfig.json && yarn tsc-alias && cp .env ../../dist/packages/sim-consumidor-objenious/",
|
|
||||||
"start": "node ../../dist/packages/sim-consumidor-objenious/index.js",
|
|
||||||
"type:test": "tsc --noEmit"
|
|
||||||
},
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"packageManager": "yarn@4.12.0",
|
|
||||||
"imports": {
|
"imports": {
|
||||||
"#config/*.js": {
|
"#config/*.js": {
|
||||||
"types": "./config/*.ts",
|
"types": "./config/*.ts",
|
||||||
@@ -23,6 +13,12 @@
|
|||||||
"types": "./config/*.ts",
|
"types": "./config/*.ts",
|
||||||
"default": "./config/*.js"
|
"default": "./config/*.js"
|
||||||
},
|
},
|
||||||
|
"#shared/*.js": {
|
||||||
|
"default": "../sim-shared/*.js"
|
||||||
|
},
|
||||||
|
"#shared/*": {
|
||||||
|
"default": "../sim-shared/*.js"
|
||||||
|
},
|
||||||
"#adapters/*.js": {
|
"#adapters/*.js": {
|
||||||
"types": "./infrastructure/*.ts",
|
"types": "./infrastructure/*.ts",
|
||||||
"default": "./infrastructure/*.js"
|
"default": "./infrastructure/*.js"
|
||||||
@@ -56,6 +52,16 @@
|
|||||||
"default": "./__tests__/*.js"
|
"default": "./__tests__/*.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"dev": "tsx watch index.ts",
|
||||||
|
"build": "tsc --build && yarn tsc-alias -p tsconfig.json && cp .env package.json ../../dist/packages/sim-consumidor-objenious/",
|
||||||
|
"start": "node ../../dist/packages/sim-consumidor-objenious/index.js",
|
||||||
|
"type:test": "tsc --noEmit"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"packageManager": "yarn@4.12.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tsconfig/node22": "*",
|
"@tsconfig/node22": "*",
|
||||||
"amqplib": "^0.10.9",
|
"amqplib": "^0.10.9",
|
||||||
|
|||||||
@@ -2,16 +2,37 @@
|
|||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist",
|
"outDir": "../../dist",
|
||||||
"baseUrl": "."
|
"rootDir": "../../",
|
||||||
|
"paths": {
|
||||||
|
"#config/*": [
|
||||||
|
"config/*"
|
||||||
|
],
|
||||||
|
"#shared/*": [
|
||||||
|
"../../packages/sim-shared/*"
|
||||||
|
],
|
||||||
|
"#adapters/*": [
|
||||||
|
"adapters/*",
|
||||||
|
"infrastructure/*"
|
||||||
|
],
|
||||||
|
"#domain/*": [
|
||||||
|
"domain/*"
|
||||||
|
],
|
||||||
|
"#ports/*": [
|
||||||
|
"ports/*"
|
||||||
|
],
|
||||||
|
"#tests/*": [
|
||||||
|
"__tests__/*"
|
||||||
|
],
|
||||||
|
"sim-shared/*": [
|
||||||
|
"../sim-shared/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
"src/**/*.d.ts"
|
"../../packages/sim-shared/**/*.ts"
|
||||||
],
|
|
||||||
"files": [
|
|
||||||
"index.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Request, Response } from "express"
|
import { Request, Response } from "express"
|
||||||
import { SimUsecases } from "aplication/Sim.usecases.js"
|
import { SimUsecases } from "./Sim.usecases.js"
|
||||||
import { error } from "node:console"
|
|
||||||
|
|
||||||
// Partiendo del caracter 3 2 de pais + 2 de compañia
|
// Partiendo del caracter 3 2 de pais + 2 de compañia
|
||||||
// Metiendolo a la BDD podria ser mas dinamico pero perderia
|
// Metiendolo a la BDD podria ser mas dinamico pero perderia
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { EventBus } from "../../shared/domain/EventBus.port";
|
import { EventBus } from "sim-shared/domain/EventBus.port";
|
||||||
import { SimEvents } from "../../shared/domain/SimEvents";
|
import { SimEvents } from "sim-shared/domain/SimEvents";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO:
|
* TODO:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { loadEnvFile } from "node:process";
|
import { loadEnvFile } from "node:process";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
loadEnvFile(path.join(__dirname, "../../../../.env"))
|
loadEnvFile(path.join(import.meta.dirname, "../../../../.env"))
|
||||||
|
|
||||||
export const env = {
|
export const env = {
|
||||||
ENVIRONMENT: process.env.ENVIORMENT,
|
ENVIRONMENT: process.env.ENVIORMENT,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { RabbitMQEventBus, RMQConnectionParams } from "sim-shared/infrastructure/RabbitMQEventBus.js"
|
import { RabbitMQEventBus, RMQConnectionParams } from "sim-shared/infrastructure/RabbitMQEventBus.js"
|
||||||
import { env } from "./env"
|
import { env } from "./env/index.js"
|
||||||
|
|
||||||
const rmqUser = env.RABBITMQ_USER
|
const rmqUser = env.RABBITMQ_USER
|
||||||
const rmqPass = env.RABBITMQ_PASSWORD
|
const rmqPass = env.RABBITMQ_PASSWORD
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import express from "express"
|
import express from "express"
|
||||||
import cors from 'cors';
|
import cors from 'cors';
|
||||||
import { simRoutes } from "./infrastructure/simRoutes.http.js"
|
import { simRoutes } from "./infrastructure/simRoutes.http.js"
|
||||||
import { rabbitmqEventBus } from '#config/eventBusConfig';
|
import { rabbitmqEventBus } from '#config/eventBusConfig.js';
|
||||||
import { env } from "#config/env/index.js"
|
import { env } from "#config/env/index.js"
|
||||||
|
|
||||||
const PORT = env.API_PORT
|
const PORT = env.API_PORT
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { rabbitmqEventBus } from '#config/eventBusConfig';
|
import { rabbitmqEventBus } from '#config/eventBusConfig.js';
|
||||||
import { SimUsecases } from '../aplication/Sim.usecases.js';
|
import { SimUsecases } from '../aplication/Sim.usecases.js';
|
||||||
import { SimController } from '../aplication/Sim.controller.js';
|
import { SimController } from '../aplication/Sim.controller.js';
|
||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
|
|||||||
@@ -1,17 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "sim-entrada-eventos",
|
"name": "sim-entrada-eventos",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"type": "module",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
|
||||||
"build": "yarn tsc --project tsconfig.json && yarn tsc-alias",
|
|
||||||
"dev": "tsx watch index.ts",
|
|
||||||
"start": "node ../../dist/packages/sim-entrada-eventos/index.js"
|
|
||||||
},
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"packageManager": "yarn@4.12.0",
|
|
||||||
"imports": {
|
"imports": {
|
||||||
"#config/*.js": {
|
"#config/*.js": {
|
||||||
"types": "./config/*.ts",
|
"types": "./config/*.ts",
|
||||||
@@ -21,13 +13,19 @@
|
|||||||
"types": "./config/*.ts",
|
"types": "./config/*.ts",
|
||||||
"default": "./config/*.js"
|
"default": "./config/*.js"
|
||||||
},
|
},
|
||||||
|
"#shared/*.js": {
|
||||||
|
"default": "../sim-shared/*.js"
|
||||||
|
},
|
||||||
|
"#shared/*": {
|
||||||
|
"default": "../sim-shared/*.js"
|
||||||
|
},
|
||||||
"#adapters/*.js": {
|
"#adapters/*.js": {
|
||||||
"types": "./adapters/*.ts",
|
"types": "./infrastructure/*.ts",
|
||||||
"default": "./adapters/*.js"
|
"default": "./infrastructure/*.js"
|
||||||
},
|
},
|
||||||
"#adapters/*": {
|
"#adapters/*": {
|
||||||
"types": "./adapters/*.ts",
|
"types": "./infrastructure/*.ts",
|
||||||
"default": "./adapters/*.js"
|
"default": "./infrastructure/*.js"
|
||||||
},
|
},
|
||||||
"#domain/*.js": {
|
"#domain/*.js": {
|
||||||
"types": "./domain/*.ts",
|
"types": "./domain/*.ts",
|
||||||
@@ -44,16 +42,17 @@
|
|||||||
"#ports/*": {
|
"#ports/*": {
|
||||||
"types": "./ports/*.ts",
|
"types": "./ports/*.ts",
|
||||||
"default": "./ports/*.js"
|
"default": "./ports/*.js"
|
||||||
},
|
|
||||||
"#tests/*.js": {
|
|
||||||
"types": "./__tests__/*.ts",
|
|
||||||
"default": "./__tests__/*.js"
|
|
||||||
},
|
|
||||||
"#tests/*": {
|
|
||||||
"types": "./__tests__/*.ts",
|
|
||||||
"default": "./__tests__/*.js"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"build": "tsc --build && tsc-alias -p tsconfig.json && cp package.json ../../dist/packages/sim-entrada-eventos/",
|
||||||
|
"dev": "tsx watch index.ts",
|
||||||
|
"start": "node ../../dist/packages/sim-entrada-eventos/index.js"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"packageManager": "yarn@4.12.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tsconfig/node22": "*",
|
"@tsconfig/node22": "*",
|
||||||
"amqplib": "^0.10.9",
|
"amqplib": "^0.10.9",
|
||||||
|
|||||||
@@ -2,14 +2,37 @@
|
|||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist",
|
"outDir": "../../dist",
|
||||||
"baseUrl": "."
|
"rootDir": "../../",
|
||||||
|
"paths": {
|
||||||
|
"#config/*": [
|
||||||
|
"config/*"
|
||||||
|
],
|
||||||
|
"#shared/*": [
|
||||||
|
"../sim-shared/*"
|
||||||
|
],
|
||||||
|
"#adapters/*": [
|
||||||
|
"adapters/*"
|
||||||
|
],
|
||||||
|
"#domain/*": [
|
||||||
|
"domain/*"
|
||||||
|
],
|
||||||
|
"#ports/*": [
|
||||||
|
"ports/*"
|
||||||
|
],
|
||||||
|
"#tests/*": [
|
||||||
|
"__tests__/*"
|
||||||
|
],
|
||||||
|
"sim-shared/*": [
|
||||||
|
"../sim-shared/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
"src/**/*.d.ts"
|
"../../packages/sim-shared/**/*.ts"
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
"index.ts"
|
"index.ts"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Pool, QueryResult } from 'pg';
|
import { Pool, QueryResult } from 'pg';
|
||||||
import { PgClient } from 'sim-shared/infrastructure/PgClient.js'
|
import { PgClient } from 'sim-shared/infrastructure/PgClient.js'
|
||||||
import { env } from 'config/env/index.js';
|
import { env } from './env/index.js';
|
||||||
|
|
||||||
// Configuracion de la conexion a la BDD, deberia ser la
|
// Configuracion de la conexion a la BDD, deberia ser la
|
||||||
// Misma para todos los servicios pero hasta que se unifique todo
|
// Misma para todos los servicios pero hasta que se unifique todo
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
import { pgPool } from "#config/postgreConfig.js"
|
import { pgPool } from "./config/postgreConfig.js"
|
||||||
import { PgClient } from "sim-shared/infrastructure/PgClient.js"
|
import { PgClient } from "sim-shared/infrastructure/PgClient.js"
|
||||||
import { OperationsRepository } from "sim-consumidor-objenious/infrastructure/OperationRepository.js"
|
import { OperationsRepository } from "../sim-consumidor-objenious/infrastructure/OperationRepository.js"
|
||||||
import cron from "node-cron"
|
import { httpInstance } from "./config/httpClient.config.js"
|
||||||
import { httpInstance } from "#config/httpClient.config.js"
|
import { CheckObjeniousRequests } from "./tasks/check_objenious_request.js"
|
||||||
import { CheckObjeniousRequests } from "tasks/check_objenious_request.js"
|
|
||||||
|
|
||||||
async function startCron() {
|
async function startCron() {
|
||||||
const commonSettings = {
|
const commonSettings = {
|
||||||
|
|||||||
@@ -4,15 +4,6 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
|
||||||
"build": "yarn tsc --project tsconfig.json && yarn tsc-alias",
|
|
||||||
"dev": "tsx watch index.ts",
|
|
||||||
"start": "node ../../dist/packages/sim-objenious-cron/index.js"
|
|
||||||
},
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"packageManager": "yarn@4.12.0",
|
|
||||||
"imports": {
|
"imports": {
|
||||||
"#config/*.js": {
|
"#config/*.js": {
|
||||||
"types": "./config/*.ts",
|
"types": "./config/*.ts",
|
||||||
@@ -22,13 +13,19 @@
|
|||||||
"types": "./config/*.ts",
|
"types": "./config/*.ts",
|
||||||
"default": "./config/*.js"
|
"default": "./config/*.js"
|
||||||
},
|
},
|
||||||
|
"#shared/*.js": {
|
||||||
|
"default": "../sim-shared/*.js"
|
||||||
|
},
|
||||||
|
"#shared/*": {
|
||||||
|
"default": "../sim-shared/*.js"
|
||||||
|
},
|
||||||
"#adapters/*.js": {
|
"#adapters/*.js": {
|
||||||
"types": "./adapters/*.ts",
|
"types": "./infrastructure/*.ts",
|
||||||
"default": "./adapters/*.js"
|
"default": "./infrastructure/*.js"
|
||||||
},
|
},
|
||||||
"#adapters/*": {
|
"#adapters/*": {
|
||||||
"types": "./adapters/*.ts",
|
"types": "./infrastructure/*.ts",
|
||||||
"default": "./adapters/*.js"
|
"default": "./infrastructure/*.js"
|
||||||
},
|
},
|
||||||
"#domain/*.js": {
|
"#domain/*.js": {
|
||||||
"types": "./domain/*.ts",
|
"types": "./domain/*.ts",
|
||||||
@@ -45,24 +42,23 @@
|
|||||||
"#ports/*": {
|
"#ports/*": {
|
||||||
"types": "./ports/*.ts",
|
"types": "./ports/*.ts",
|
||||||
"default": "./ports/*.js"
|
"default": "./ports/*.js"
|
||||||
},
|
|
||||||
"#tests/*.js": {
|
|
||||||
"types": "./__tests__/*.ts",
|
|
||||||
"default": "./__tests__/*.js"
|
|
||||||
},
|
|
||||||
"#tests/*": {
|
|
||||||
"types": "./__tests__/*.ts",
|
|
||||||
"default": "./__tests__/*.js"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"build": "tsc --build && tsc-alias -p tsconfig.json && cp package.json ../../dist/packages/sim-objenious-cron/",
|
||||||
|
"dev": "tsx watch index.ts",
|
||||||
|
"start": "node ../../dist/packages/sim-objenious-cron/index.js"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"packageManager": "yarn@4.12.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tsconfig/node22": "*",
|
"@tsconfig/node22": "*",
|
||||||
"cors": "*",
|
"cors": "*",
|
||||||
"dotenv": "*",
|
"dotenv": "*",
|
||||||
"express": "*",
|
"express": "*",
|
||||||
"node-cron": "^4.2.1",
|
"node-cron": "^4.2.1",
|
||||||
"sim-consumidor-objenious": "sim-consumidor-objenious:*",
|
|
||||||
"sim-shared": "sim-shared:*",
|
|
||||||
"typescript": "*"
|
"typescript": "*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -2,17 +2,40 @@
|
|||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist",
|
"outDir": "../../dist",
|
||||||
"baseUrl": "."
|
"rootDir": "../../",
|
||||||
|
"paths": {
|
||||||
|
"#config/*": [
|
||||||
|
"config/*"
|
||||||
|
],
|
||||||
|
"#shared/*": [
|
||||||
|
"../../packages/sim-shared/*"
|
||||||
|
],
|
||||||
|
"#adapters/*": [
|
||||||
|
"adapters/*"
|
||||||
|
],
|
||||||
|
"#domain/*": [
|
||||||
|
"domain/*"
|
||||||
|
],
|
||||||
|
"#ports/*": [
|
||||||
|
"ports/*"
|
||||||
|
],
|
||||||
|
"#tests/*": [
|
||||||
|
"__tests__/*"
|
||||||
|
],
|
||||||
|
"sim-shared/*": [
|
||||||
|
"../sim-shared/*"
|
||||||
|
],
|
||||||
|
"sim-consumidor-objenious/*": [
|
||||||
|
"../sim-consumidor-objenious/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
"src/**/*.d.ts",
|
"../../packages/sim-shared/**/*.ts",
|
||||||
"tasks/background1.js"
|
"../../packages/sim-consumidor-objenious/**/*.ts"
|
||||||
],
|
|
||||||
"files": [
|
|
||||||
"index.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -156,7 +156,7 @@ export class RabbitMQEventBus implements EventBus {
|
|||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async createChannel() {
|
protected async createChannel(): Promise<ChannelWrapper> {
|
||||||
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
|
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
|
||||||
if (this.connection == undefined) throw new Error("[RMQ] Intentando crear un canal sin una conexion")
|
if (this.connection == undefined) throw new Error("[RMQ] Intentando crear un canal sin una conexion")
|
||||||
@@ -195,6 +195,6 @@ export class RabbitMQEventBus implements EventBus {
|
|||||||
Promise.reject(error);
|
Promise.reject(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
return channel;
|
return channel as ChannelWrapper;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,64 +3,40 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"exports": {
|
||||||
|
"./infrastructure/*.js": {
|
||||||
|
"types": "./infrastructure/*.ts",
|
||||||
|
"default": "./infrastructure/*.js"
|
||||||
|
},
|
||||||
|
"./infrastructure/*": {
|
||||||
|
"types": "./infrastructure/*.ts",
|
||||||
|
"default": "./infrastructure/*.js"
|
||||||
|
},
|
||||||
|
"./domain/*.js": {
|
||||||
|
"types": "./domain/*.ts",
|
||||||
|
"default": "./domain/*.js"
|
||||||
|
},
|
||||||
|
"./domain/*": {
|
||||||
|
"types": "./domain/*.ts",
|
||||||
|
"default": "./domain/*.js"
|
||||||
|
},
|
||||||
|
"./ports/*.js": {
|
||||||
|
"types": "./ports/*.ts",
|
||||||
|
"default": "./ports/*.js"
|
||||||
|
},
|
||||||
|
"./ports/*": {
|
||||||
|
"types": "./ports/*.ts",
|
||||||
|
"default": "./ports/*.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" ",
|
||||||
"dev": "echo \" Shared no es un modulo ejecutable \" ",
|
"dev": "echo \" Shared no es un modulo ejecutable \" ",
|
||||||
"build": "tsc && yarn tsc-alias"
|
"build": "tsc --build && tsc-alias -p tsconfig.json && cp package.json ../../dist/packages/sim-shared/"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"packageManager": "yarn@4.12.0",
|
"packageManager": "yarn@4.12.0",
|
||||||
"imports": {
|
|
||||||
"#config/*.js": {
|
|
||||||
"types": "./config/*.ts",
|
|
||||||
"default": "./config/*.js"
|
|
||||||
},
|
|
||||||
"#config/*": {
|
|
||||||
"types": "./config/*.ts",
|
|
||||||
"default": "./config/*.js"
|
|
||||||
},
|
|
||||||
"#adapters/*.js": {
|
|
||||||
"types": "./adapters/*.ts",
|
|
||||||
"default": "./adapters/*.js"
|
|
||||||
},
|
|
||||||
"#adapters/*": {
|
|
||||||
"types": "./adapters/*.ts",
|
|
||||||
"default": "./adapters/*.js"
|
|
||||||
},
|
|
||||||
"#domain/*.js": {
|
|
||||||
"types": "./domain/*.ts",
|
|
||||||
"default": "./domain/*.js"
|
|
||||||
},
|
|
||||||
"#domain/*": {
|
|
||||||
"types": "./domain/*.ts",
|
|
||||||
"default": "./domain/*.js"
|
|
||||||
},
|
|
||||||
"#ports/*.js": {
|
|
||||||
"types": "./ports/*.ts",
|
|
||||||
"default": "./ports/*.js"
|
|
||||||
},
|
|
||||||
"#ports/*": {
|
|
||||||
"types": "./ports/*.ts",
|
|
||||||
"default": "./ports/*.js"
|
|
||||||
},
|
|
||||||
"#tests/*.js": {
|
|
||||||
"types": "./__tests__/*.ts",
|
|
||||||
"default": "./__tests__/*.js"
|
|
||||||
},
|
|
||||||
"#tests/*": {
|
|
||||||
"types": "./__tests__/*.ts",
|
|
||||||
"default": "./__tests__/*.js"
|
|
||||||
},
|
|
||||||
"#shared/*.js": {
|
|
||||||
"types": "./*.ts",
|
|
||||||
"default": "./*.js"
|
|
||||||
},
|
|
||||||
"#shared/*": {
|
|
||||||
"types": "./*.ts",
|
|
||||||
"default": "./*.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tsconfig/node22": "*",
|
"@tsconfig/node22": "*",
|
||||||
"amqplib": "^0.10.9",
|
"amqplib": "^0.10.9",
|
||||||
31
packages/sim-shared/tsconfig.json
Normal file
31
packages/sim-shared/tsconfig.json
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist",
|
||||||
|
"rootDir": "../../",
|
||||||
|
"paths": {
|
||||||
|
"#config/*": [
|
||||||
|
"config/*"
|
||||||
|
],
|
||||||
|
"#adapters/*": [
|
||||||
|
"adapters/*"
|
||||||
|
],
|
||||||
|
"#domain/*": [
|
||||||
|
"domain/*"
|
||||||
|
],
|
||||||
|
"#ports/*": [
|
||||||
|
"ports/*"
|
||||||
|
],
|
||||||
|
"#tests/*": [
|
||||||
|
"__tests__/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"**/*.ts",
|
||||||
|
"../../packages/sim-shared/**/*.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -3,19 +3,28 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"rootDir": "./",
|
"rootDir": "./",
|
||||||
"paths": {},
|
"baseUrl": "./",
|
||||||
|
"composite": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"inlineSources": true,
|
"inlineSources": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"module": "nodenext",
|
"module": "nodenext",
|
||||||
"moduleResolution": "nodenext"
|
"moduleResolution": "nodenext",
|
||||||
|
"paths": {
|
||||||
|
"sim-shared/*": [
|
||||||
|
"packages/sim-shared/*"
|
||||||
|
],
|
||||||
|
"sim-consumidor-objenious/*": [
|
||||||
|
"packages/sim-consumidor-objenious/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
"tsconfig.vitest.json",
|
"tsconfig.vitest.json",
|
||||||
"packages/sim-objenious-cron/tasks/background1.js"
|
"packages/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
Reference in New Issue
Block a user