Clean up microservices package files and configurations

This commit is contained in:
SrGooglo 2025-04-24 10:37:51 +00:00
parent 681de1d5e7
commit 4f82ef46d0
15 changed files with 88 additions and 108 deletions

View File

@ -1,4 +1,3 @@
{ {
"name": "auth", "name": "auth"
"version": "1.0.0"
} }

View File

@ -1,4 +1,3 @@
{ {
"name": "chats", "name": "chats"
"version": "0.60.2"
} }

View File

@ -3,40 +3,42 @@ import nodemailer from "nodemailer"
import DbManager from "@shared-classes/DbManager" import DbManager from "@shared-classes/DbManager"
import SharedMiddlewares from "@shared-middlewares" import SharedMiddlewares from "@shared-middlewares"
export default class API extends Server { export default class API extends Server {
static refName = "ems" static refName = "ems"
static useEngine = "hyper-express" static useEngine = "hyper-express"
static routesPath = `${__dirname}/routes` static routesPath = `${__dirname}/routes`
static listen_port = process.env.HTTP_LISTEN_PORT ?? 3007 static listen_port = process.env.HTTP_LISTEN_PORT ?? 3007
middlewares = { middlewares = {
...SharedMiddlewares ...SharedMiddlewares,
} }
contexts = { contexts = {
db: new DbManager(), db: new DbManager(),
mailTransporter: nodemailer.createTransport({ mailTransporter: nodemailer.createTransport({
host: process.env.SMTP_HOSTNAME, host: process.env.SMTP_HOSTNAME,
port: process.env.SMTP_PORT ?? 587, port: process.env.SMTP_PORT ?? 587,
secure: ToBoolean(process.env.SMTP_SECURE) ?? false, secure: ToBoolean(process.env.SMTP_SECURE) ?? false,
auth: { auth: {
user: process.env.SMTP_USERNAME, user: process.env.SMTP_USERNAME,
pass: process.env.SMTP_PASSWORD, pass: process.env.SMTP_PASSWORD,
}, },
}), }),
} }
ipcEvents = { ipcEvents = {
"account:activation:send": require("./ipcEvents/accountActivation").default, "account:activation:send": require("./ipcEvents/accountActivation")
"new:login": require("./ipcEvents/newLogin").default, .default,
"mfa:send": require("./ipcEvents/mfaSend").default, "new:login": require("./ipcEvents/newLogin").default,
"apr:send": require("./ipcEvents/aprSend").default, "mfa:send": require("./ipcEvents/mfaSend").default,
"password:changed": require("./ipcEvents/passwordChanged").default, "apr:send": require("./ipcEvents/aprSend").default,
} "password:changed": require("./ipcEvents/passwordChanged").default,
}
async onInitialize() { async onInitialize() {
await this.contexts.db.initialize() await this.contexts.db.initialize()
} }
} }
Boot(API) Boot(API)

View File

@ -1,10 +1,7 @@
{ {
"name": "ems", "name": "ems",
"description": "External Messaging Service (SMS, EMAIL, PUSH)", "dependencies": {
"version": "0.1.0", "handlebars": "^4.7.8",
"dependencies": { "nodemailer": "^6.9.11"
"handlebars": "^4.7.8", }
"nodemailer": "^6.9.11",
"web-push": "^3.6.7"
}
} }

View File

@ -4,7 +4,6 @@
"file-type": "^20.4.1", "file-type": "^20.4.1",
"fluent-ffmpeg": "^2.1.2", "fluent-ffmpeg": "^2.1.2",
"mime-types": "^2.1.35", "mime-types": "^2.1.35",
"minio": "^7.0.32",
"p-map": "4", "p-map": "4",
"sharp": "0.32.6" "sharp": "0.32.6"
} }

View File

@ -7,9 +7,10 @@ import SharedMiddlewares from "@shared-middlewares"
export default class API extends Server { export default class API extends Server {
static refName = "main" static refName = "main"
static enableWebsockets = true static useEngine = "hyper-express-ng"
static routesPath = `${__dirname}/routes` static routesPath = `${__dirname}/routes`
static listen_port = process.env.HTTP_LISTEN_PORT || 3000 static listen_port = process.env.HTTP_LISTEN_PORT || 3000
static enableWebsockets = false
middlewares = { middlewares = {
...require("@middlewares").default, ...require("@middlewares").default,
@ -26,8 +27,6 @@ export default class API extends Server {
await this.contexts.db.initialize() await this.contexts.db.initialize()
await StartupDB() await StartupDB()
} }
handleWsAuth = require("@shared-lib/handleWsAuth").default
} }
Boot(API) Boot(API)

View File

@ -1,7 +1,6 @@
{ {
"name": "main", "name": "main",
"version": "0.60.2", "dependencies": {
"dependencies": { "@octokit/rest": "^20.0.2"
"@octokit/rest": "^20.0.2" }
}
} }

View File

@ -1,9 +1,3 @@
{ {
"name": "music", "name": "music"
"version": "0.60.2",
"dependencies": {
"ms": "^2.1.3",
"music-metadata": "^7.14.0",
"openai": "^4.47.2"
}
} }

View File

@ -1,4 +1,3 @@
{ {
"name": "notifications", "name": "notifications"
"version": "1.0.0"
} }

View File

@ -1,7 +1,7 @@
{ {
"name": "posts", "name": "posts",
"version": "1.0.0", "dependencies": {
"dependencies": { "linebridge": "^1.0.0-a3",
"moment-timezone": "^0.5.45" "moment-timezone": "^0.5.45"
} }
} }

View File

@ -1,5 +1,5 @@
import { Server } from "../../../../linebridge/server/src" //import { Server } from "../../../../linebridge/server/src"
//import { Server } from "linebridge" import { Server } from "linebridge"
import DbManager from "@shared-classes/DbManager" import DbManager from "@shared-classes/DbManager"
import RedisClient from "@shared-classes/RedisClient" import RedisClient from "@shared-classes/RedisClient"
@ -10,10 +10,9 @@ import SharedMiddlewares from "@shared-middlewares"
export default class API extends Server { export default class API extends Server {
static refName = "posts" static refName = "posts"
//static useEngine = "hyper-express-ng"
static websockets = true static websockets = true
static listenPort = process.env.HTTP_LISTEN_PORT ?? 3001 static listenPort = process.env.HTTP_LISTEN_PORT ?? 3001
// static useMiddlewares = ["logs"] static useMiddlewares = ["logs"]
static bypassCors = true static bypassCors = true
middlewares = { middlewares = {

View File

@ -1,6 +1,3 @@
{ {
"name": "search", "name": "search"
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
} }

View File

@ -6,24 +6,23 @@ import RedisClient from "@shared-classes/RedisClient"
import SharedMiddlewares from "@shared-middlewares" import SharedMiddlewares from "@shared-middlewares"
class API extends Server { class API extends Server {
static refName = "search" static refName = "search"
static wsRoutesPath = `${__dirname}/ws_routes` static routesPath = `${__dirname}/routes`
static routesPath = `${__dirname}/routes` static listen_port = process.env.HTTP_LISTEN_PORT ?? 3010
static listen_port = process.env.HTTP_LISTEN_PORT ?? 3010
middlewares = { middlewares = {
...SharedMiddlewares ...SharedMiddlewares,
} }
contexts = { contexts = {
db: new DbManager(), db: new DbManager(),
redis: RedisClient(), redis: RedisClient(),
} }
async onInitialize() { async onInitialize() {
await this.contexts.db.initialize() await this.contexts.db.initialize()
await this.contexts.redis.initialize() await this.contexts.redis.initialize()
} }
} }
Boot(API) Boot(API)

View File

@ -6,26 +6,24 @@ import RedisClient from "@shared-classes/RedisClient"
import SharedMiddlewares from "@shared-middlewares" import SharedMiddlewares from "@shared-middlewares"
export default class API extends Server { export default class API extends Server {
static refName = "users" static refName = "users"
static useEngine = "hyper-express" static useEngine = "hyper-express"
static routesPath = `${__dirname}/routes` static routesPath = `${__dirname}/routes`
static listen_port = process.env.HTTP_LISTEN_PORT ?? 3008 static listen_port = process.env.HTTP_LISTEN_PORT ?? 3008
middlewares = { middlewares = {
...SharedMiddlewares ...SharedMiddlewares,
} }
handleWsAuth = require("@shared-lib/handleWsAuth").default contexts = {
db: new DbManager(),
redis: RedisClient(),
}
contexts = { async onInitialize() {
db: new DbManager(), await this.contexts.db.initialize()
redis: RedisClient() await this.contexts.redis.initialize()
} }
async onInitialize() {
await this.contexts.db.initialize()
await this.contexts.redis.initialize()
}
} }
Boot(API) Boot(API)