diff --git a/.env b/.env index ba728fd..2283672 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -PORT=3001 +PORT=4000 MONGO_URI=mongodb://root:p62Z!ZatgY25@194.26.138.94:27017 \ No newline at end of file diff --git a/dist/config/db.js b/dist/config/db.js new file mode 100644 index 0000000..48f7f9c --- /dev/null +++ b/dist/config/db.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const mongoose_1 = require("mongoose"); +async function connectDB() { + try { + await (0, mongoose_1.connect)(process.env.MONGO_URI, { dbName: "pixel_streaming2" }); + console.log("MongoDB connected..."); + } + catch (error) { + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +exports.default = connectDB; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..b0bd900 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,194 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +require("dotenv/config"); +const db_1 = __importDefault(require("./config/db")); +const express_1 = __importStar(require("express")); +const cors_1 = __importDefault(require("cors")); +const SessionServer_1 = __importDefault(require("./models/SessionServer")); +const ActiveSession_1 = __importDefault(require("./models/ActiveSession")); +const got_cjs_1 = __importDefault(require("got-cjs")); +const Build_1 = __importDefault(require("./models/Build")); +const livekit_server_sdk_1 = require("livekit-server-sdk"); +const node_cron_1 = __importDefault(require("node-cron")); +const date_fns_1 = require("date-fns"); +(0, db_1.default)(); +const app = (0, express_1.default)(); +const port = process.env.PORT; +app.use((0, express_1.json)()); +app.use((0, cors_1.default)()); +async function getBuild(name) { + const build = await Build_1.default.findOne({ name }); + return build; +} +app.get("/active_sessions", async (req, res) => { + const activeSessions = await ActiveSession_1.default.find(); + res.json(activeSessions); +}); +app.get("/start", async (req, res) => { + const location = req.query.location; + const buildName = req.query.build; + const ownerIp = req.headers["x-real-ip"]; + let type = req.query.type; + console.log("location", location); + console.log("buildName", buildName); + if (!location || !buildName) { + return res.json({ error: 1 }); + } + if (type !== "prod") { + type = "demo"; + } + console.log("type", type); + const build = await getBuild(buildName); + if (!build) { + return res.json({ error: "Build not found" }); + } + console.log(build); + const activeSessionsWithBuild = await ActiveSession_1.default.find({ + location, + buildName, + type, + }); + console.log("type", type); + console.log("activeSessionsWithBuild", activeSessionsWithBuild); + if (type === "demo" && + build.demoLaunchLimit && + activeSessionsWithBuild.length >= build.demoLaunchLimit) { + return res.json({ error: "The demo build launch limit has been reached." }); + } + if (type === "prod" && + build.prodLaunchLimit && + activeSessionsWithBuild.length >= build.prodLaunchLimit) { + return res.json({ error: "The prod build launch limit has been reached." }); + } + const sessionServers = await SessionServer_1.default.find({ location, type }); + if (sessionServers.length === 0) { + console.log("sessionServers.length", sessionServers.length); + return res.json({ error: 2 }); + } + for (const sessionServer of sessionServers) { + const gpuMemoryFree = sessionServer.gpuMemoryFree; + if (gpuMemoryFree < build.gpuMemoryUsed) { + continue; + } + const sessionServerUrl = `https://${location}.sess.stream.graff.tech/${sessionServer.name}`; + // const sessionServerUrl = "http://localhost:3000"; + console.log(`${sessionServerUrl}/start`); + try { + const result = await got_cjs_1.default + .post(`${sessionServerUrl}/start`, { + json: { + buildName, + ownerIp, + }, + }) + .json(); + console.log("Result: ", result); + return res.json({ stream: result.id }); + } + catch (error) { + if (error instanceof Error) { + return res.json({ error: error.message }); + } + } + } + res.json({ + error: "There are no servers available to run the build. Please try again later.", + }); +}); +app.post("/end", async (req, res) => { + const activeSessionId = req.body.activeSessionId; + console.log("activeSessionId", activeSessionId); + const activeSession = await ActiveSession_1.default.findById(activeSessionId); + console.log("activeSession", activeSession); + if (!activeSession) { + return res.json({ error: "A session with this ID was not found" }); + } + const result = await got_cjs_1.default + .post(`https://${activeSession.location}.sess.stream.graff.tech/${activeSession.name}/end`, { json: { activeSessionId } }) + .json(); + res.json(result); +}); +const createToken = (roomName, participantName) => { + const at = new livekit_server_sdk_1.AccessToken("prodkey", "ZUwD12h0hsBfhgnYadHyHENaBGlFSVZJ", { + identity: participantName, + }); + at.addGrant({ roomJoin: true, room: roomName }); + return at.toJwt(); +}; +app.get("/getToken", (req, res) => { + if (!req.query.roomName && !req.query.participantName) { + return res.json({ error: "roomName or participantName is not defined" }); + } + try { + const token = createToken(req.query.roomName, req.query.participantName); + res.json({ token }); + } + catch (error) { + if (error instanceof Error) { + res.json({ error: error.message }); + } + } +}); +app.get("/session_servers", async (req, res) => { + try { + const sessionServers = await SessionServer_1.default.find(); + res.json(sessionServers); + } + catch (error) { + if (error instanceof Error) { + res.json({ error: error.message }); + } + } +}); +app.listen(port, () => { + console.log(`Server is listening on port ${port}`); +}); +async function checkActiveSessions() { + const activeSessions = await ActiveSession_1.default.find(); + for (const activeSession of activeSessions) { + if (!activeSession.connectedPlayersCount && + (0, date_fns_1.differenceInMinutes)(new Date(), activeSession.updatedAt) > 2) { + const activeSessionId = activeSession.id; + try { + const result = await got_cjs_1.default + .post(`https://${activeSession.location}.sess.stream.graff.tech/${activeSession.name}/end`, { json: { activeSessionId } }) + .json(); + console.log("Result:", result); + } + catch (error) { + if (error instanceof Error) { + console.log({ error }); + } + } + } + } +} +node_cron_1.default.schedule("* * * * *", () => { + checkActiveSessions(); +}); diff --git a/dist/models/ActiveSession.js b/dist/models/ActiveSession.js new file mode 100644 index 0000000..605cded --- /dev/null +++ b/dist/models/ActiveSession.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const mongoose_1 = require("mongoose"); +const activeSessionSchema = new mongoose_1.Schema({ + location: { + type: String, + }, + name: { + type: String, + }, + buildName: { + type: String, + }, + type: { + type: String, + }, + uePort: { + type: Number, + }, + cirrusPort: { + type: Number, + }, + ueProcessId: { + type: Number, + }, + cirrusProcessId: { + type: Number, + }, + ownerIp: { + type: String, + }, + connectedPlayersCount: { + type: Number, + }, +}, { + timestamps: true, + toJSON: { virtuals: true }, + toObject: { virtuals: true }, +}); +const ActiveSession = (0, mongoose_1.model)("Active_Session", activeSessionSchema); +exports.default = ActiveSession; diff --git a/dist/models/Build.js b/dist/models/Build.js new file mode 100644 index 0000000..5297a8f --- /dev/null +++ b/dist/models/Build.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const mongoose_1 = require("mongoose"); +const buildSchema = new mongoose_1.Schema({ + name: { + type: String, + }, + demoLaunchLimit: { + type: Number, + }, + prodLaunchLimit: { + type: Number, + }, + gpuMemoryUsed: { + type: Number, + }, +}, { + timestamps: true, + toJSON: { virtuals: true }, + toObject: { virtuals: true }, +}); +const Build = (0, mongoose_1.model)("Build", buildSchema); +exports.default = Build; diff --git a/dist/models/SessionServer.js b/dist/models/SessionServer.js new file mode 100644 index 0000000..57978a5 --- /dev/null +++ b/dist/models/SessionServer.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const mongoose_1 = require("mongoose"); +const sessionServerSchema = new mongoose_1.Schema({ + location: { + type: String, + }, + name: { + type: String, + }, + type: { + type: String, + }, + hostname: { + type: String, + unique: true, + }, + gpuMemoryFree: { + type: Number, + }, +}, { + timestamps: true, + toJSON: { virtuals: true }, + toObject: { virtuals: true }, +}); +const SessionServer = (0, mongoose_1.model)("Session_Server", sessionServerSchema); +exports.default = SessionServer; diff --git a/dist/routes/test.js b/dist/routes/test.js new file mode 100644 index 0000000..8f410d5 --- /dev/null +++ b/dist/routes/test.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const express_1 = require("express"); +const router = (0, express_1.Router)(); +router.get("/", async (req, res) => { + res.json({ ok: 1 }); +}); +const testRouter = router; +exports.default = testRouter; diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..4865dd8 --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,10 @@ +module.exports = { + apps: [ + { + name: "coord.graff.tech-server:4000", + exec_mode: "cluster", + script: "yarn", + args: "start", + }, + ], +}; diff --git a/package.json b/package.json index 363c0e5..998df39 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,15 @@ "dependencies": { "bcrypt": "^5.1.1", "cors": "^2.8.5", + "date-fns": "^3.6.0", "dotenv": "^16.4.5", "express": "^4.18.2", "got": "^14.2.0", "got-cjs": "^12.5.4", "jsonwebtoken": "^9.0.2", + "livekit-server-sdk": "^1.2.7", "mongoose": "^8.2.0", + "node-cron": "^3.0.3", "tree-kill": "^1.2.2" }, "devDependencies": { @@ -25,6 +28,7 @@ "@types/got": "^9.6.12", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^20.11.20", + "@types/node-cron": "^3.0.11", "nodemon": "^3.1.0", "ts-node": "^10.9.2", "typescript": "^5.3.3" diff --git a/src/index.ts b/src/index.ts index 70e0bb5..f71dd03 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,14 +2,13 @@ import "dotenv/config"; import connectDB from "./config/db"; import express, { json } from "express"; import cors from "cors"; -import os from "os"; -import util from "util"; -import { exec, execFile } from "child_process"; -import treeKill from "tree-kill"; import SessionServer from "./models/SessionServer"; import ActiveSession from "./models/ActiveSession"; import got from "got-cjs"; import Build from "./models/Build"; +import { AccessToken } from "livekit-server-sdk"; +import cron from "node-cron"; +import { differenceInMinutes } from "date-fns"; connectDB(); @@ -25,14 +24,31 @@ async function getBuild(name: string) { return build; } +app.get("/active_sessions", async (req, res) => { + const activeSessions = await ActiveSession.find(); + + res.json(activeSessions); +}); + app.get("/start", async (req, res) => { const location = req.query.location as string; const buildName = req.query.build as string; + const ownerIp = req.headers["x-real-ip"]; + let type = req.query.type as string; + + console.log("location", location); + console.log("buildName", buildName); if (!location || !buildName) { return res.json({ error: 1 }); } + if (type !== "prod") { + type = "demo"; + } + + console.log("type", type); + const build = await getBuild(buildName); if (!build) { @@ -41,18 +57,35 @@ app.get("/start", async (req, res) => { console.log(build); - const activeSessionsWithBuild = await ActiveSession.find({ buildName }); + const activeSessionsWithBuild = await ActiveSession.find({ + location, + buildName, + type, + }); + + console.log("type", type); + console.log("activeSessionsWithBuild", activeSessionsWithBuild); if ( - build.launchLimit && - activeSessionsWithBuild.length >= build.launchLimit + type === "demo" && + build.demoLaunchLimit && + activeSessionsWithBuild.length >= build.demoLaunchLimit ) { - return res.json({ error: "Build launch limit reached" }); + return res.json({ error: "The demo build launch limit has been reached." }); } - const sessionServers = await SessionServer.find({ location, type: "demo" }); + if ( + type === "prod" && + build.prodLaunchLimit && + activeSessionsWithBuild.length >= build.prodLaunchLimit + ) { + return res.json({ error: "The prod build launch limit has been reached." }); + } + + const sessionServers = await SessionServer.find({ location, type }); if (sessionServers.length === 0) { + console.log("sessionServers.length", sessionServers.length); return res.json({ error: 2 }); } @@ -62,21 +95,25 @@ app.get("/start", async (req, res) => { if (gpuMemoryFree < build.gpuMemoryUsed!) { continue; } - // const sessionServerUrl = `https://${location}.sess.stream.graff.tech/${sessionServer}`; - const sessionServerUrl = "http://localhost:3000"; + + const sessionServerUrl = `https://${location}.sess.stream.graff.tech/${sessionServer.name}`; + // const sessionServerUrl = "http://localhost:3000"; + + console.log(`${sessionServerUrl}/start`); try { - const result = await got + const result: any = await got .post(`${sessionServerUrl}/start`, { json: { buildName, + ownerIp, }, }) .json(); console.log("Result: ", result); - return res.json({ result }); + return res.json({ stream: result.id }); } catch (error) { if (error instanceof Error) { return res.json({ error: error.message }); @@ -90,6 +127,96 @@ app.get("/start", async (req, res) => { }); }); +app.post("/end", async (req, res) => { + const activeSessionId = req.body.activeSessionId; + console.log("activeSessionId", activeSessionId); + const activeSession = await ActiveSession.findById(activeSessionId); + console.log("activeSession", activeSession); + + if (!activeSession) { + return res.json({ error: "A session with this ID was not found" }); + } + + const result = await got + .post( + `https://${activeSession.location}.sess.stream.graff.tech/${activeSession.name}/end`, + { json: { activeSessionId } } + ) + .json(); + + res.json(result); +}); + +const createToken = (roomName: string, participantName: string) => { + const at = new AccessToken("prodkey", "ZUwD12h0hsBfhgnYadHyHENaBGlFSVZJ", { + identity: participantName, + }); + at.addGrant({ roomJoin: true, room: roomName }); + + return at.toJwt(); +}; + +app.get("/getToken", (req, res) => { + if (!req.query.roomName && !req.query.participantName) { + return res.json({ error: "roomName or participantName is not defined" }); + } + + try { + const token = createToken( + req.query.roomName as string, + req.query.participantName as string + ); + res.json({ token }); + } catch (error) { + if (error instanceof Error) { + res.json({ error: error.message }); + } + } +}); + +app.get("/session_servers", async (req, res) => { + try { + const sessionServers = await SessionServer.find(); + res.json(sessionServers); + } catch (error) { + if (error instanceof Error) { + res.json({ error: error.message }); + } + } +}); + app.listen(port, () => { console.log(`Server is listening on port ${port}`); }); + +async function checkActiveSessions() { + const activeSessions = await ActiveSession.find(); + + for (const activeSession of activeSessions) { + if ( + !activeSession.connectedPlayersCount && + differenceInMinutes(new Date(), activeSession.updatedAt) > 2 + ) { + const activeSessionId = activeSession.id; + + try { + const result = await got + .post( + `https://${activeSession.location}.sess.stream.graff.tech/${activeSession.name}/end`, + { json: { activeSessionId } } + ) + .json(); + + console.log("Result:", result); + } catch (error) { + if (error instanceof Error) { + console.log({ error }); + } + } + } + } +} + +cron.schedule("* * * * *", () => { + checkActiveSessions(); +}); diff --git a/src/models/ActiveSession.ts b/src/models/ActiveSession.ts index 78a15a7..507e5b1 100644 --- a/src/models/ActiveSession.ts +++ b/src/models/ActiveSession.ts @@ -11,6 +11,9 @@ const activeSessionSchema = new Schema( buildName: { type: String, }, + type: { + type: String, + }, uePort: { type: Number, }, @@ -23,6 +26,12 @@ const activeSessionSchema = new Schema( cirrusProcessId: { type: Number, }, + ownerIp: { + type: String, + }, + connectedPlayersCount: { + type: Number, + }, }, { timestamps: true, diff --git a/src/models/Build.ts b/src/models/Build.ts index 6a41cee..ac10f4d 100644 --- a/src/models/Build.ts +++ b/src/models/Build.ts @@ -5,7 +5,10 @@ const buildSchema = new Schema( name: { type: String, }, - launchLimit: { + demoLaunchLimit: { + type: Number, + }, + prodLaunchLimit: { type: Number, }, gpuMemoryUsed: { diff --git a/tsconfig.json b/tsconfig.json index 2ffd6f2..1ef4928 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,7 @@ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ - "module": "commonjs" /* Specify what module code is generated. */, + "module": "CommonJS" /* Specify what module code is generated. */, "rootDir": "./src" /* Specify the root folder within your source files. */, // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ @@ -106,5 +106,8 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "include": ["src"] + "include": ["src"], + "ts-node": { + "transpileOnly": true + } } diff --git a/yarn.lock b/yarn.lock index 90d0a5b..181e6ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,6 +49,59 @@ dependencies: sparse-bitfield "^3.0.3" +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + "@sindresorhus/is@4.6.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -178,6 +231,11 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== +"@types/node-cron@^3.0.11": + version "3.0.11" + resolved "https://registry.yarnpkg.com/@types/node-cron/-/node-cron-3.0.11.tgz#70b7131f65038ae63cfe841354c8aba363632344" + integrity sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg== + "@types/node@*", "@types/node@^20.11.20": version "20.11.24" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.24.tgz#cc207511104694e84e9fb17f9a0c4c42d4517792" @@ -185,6 +243,13 @@ dependencies: undici-types "~5.26.4" +"@types/node@>=13.7.0": + version "20.12.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.10.tgz#8f0c3f12b0f075eee1fe20c1afb417e9765bef76" + integrity sha512-Eem5pH9pmWBHoGAT8Dr5fdc5rYA+4NAovdM4EktRPVAAiJhmWWfQrA0cFhAbOsQdSfIHjAud6YdkbL69+zSKjw== + dependencies: + undici-types "~5.26.4" + "@types/qs@*": version "6.9.12" resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.12.tgz#afa96b383a3a6fdc859453a1892d41b607fc7756" @@ -307,6 +372,15 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== +axios@^1.3.6: + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -420,6 +494,21 @@ call-bind@^1.0.7: get-intrinsic "^1.2.4" set-function-length "^1.2.1" +camelcase-keys@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-7.0.2.tgz#d048d8c69448745bb0de6fc4c1c52a30dfbe7252" + integrity sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg== + dependencies: + camelcase "^6.3.0" + map-obj "^4.1.0" + quick-lru "^5.1.1" + type-fest "^1.2.1" + +camelcase@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + chokidar@^3.5.2: version "3.6.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" @@ -452,7 +541,7 @@ color-support@^1.1.2: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -combined-stream@^1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -504,6 +593,11 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +date-fns@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-3.6.0.tgz#f20ca4fe94f8b754951b24240676e8618c0206bf" + integrity sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww== + debug@2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -682,6 +776,11 @@ finalhandler@1.2.0: statuses "2.0.1" unpipe "~1.0.0" +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + form-data-encoder@1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" @@ -701,6 +800,15 @@ form-data@^2.5.0: combined-stream "^1.0.6" mime-types "^2.1.12" +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -967,7 +1075,7 @@ json-buffer@3.0.1: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== -jsonwebtoken@^9.0.2: +jsonwebtoken@^9.0.0, jsonwebtoken@^9.0.2: version "9.0.2" resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz#65ff91f4abef1784697d40952bb1998c504caaf3" integrity sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ== @@ -1012,6 +1120,17 @@ keyv@^4.0.0, keyv@^4.5.3: dependencies: json-buffer "3.0.1" +livekit-server-sdk@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/livekit-server-sdk/-/livekit-server-sdk-1.2.7.tgz#54fde18710bea6896741bccbf182ebe17c07632d" + integrity sha512-tOhRb0vz1wBzMpTkP4ixptlC9MFME24PvG8Z/R7vBbQ1VGd6EdNr56voBSr+RCalYxaQqx0E9Gg4l+57m/Nlmw== + dependencies: + axios "^1.3.6" + camelcase-keys "^7.0.0" + jsonwebtoken "^9.0.0" + long "^5.0.0" + protobufjs "^7.2.4" + lodash.includes@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" @@ -1047,6 +1166,11 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== +long@^5.0.0: + version "5.2.3" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== + lowercase-keys@2.0.0, lowercase-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" @@ -1076,6 +1200,11 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +map-obj@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" + integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -1227,6 +1356,13 @@ node-addon-api@^5.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== +node-cron@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/node-cron/-/node-cron-3.0.3.tgz#c4bc7173dd96d96c50bdb51122c64415458caff2" + integrity sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A== + dependencies: + uuid "8.3.2" + node-fetch@^2.6.7: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" @@ -1343,6 +1479,24 @@ picomatch@^2.0.4, picomatch@^2.2.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +protobufjs@^7.2.4: + version "7.2.6" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.6.tgz#4a0ccd79eb292717aacf07530a07e0ed20278215" + integrity sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/node" ">=13.7.0" + long "^5.0.0" + proxy-addr@~2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" @@ -1351,6 +1505,11 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + pstree.remy@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" @@ -1647,6 +1806,11 @@ ts-node@^10.9.2: v8-compile-cache-lib "^3.0.1" yn "3.1.1" +type-fest@^1.2.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" + integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== + type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -1685,6 +1849,11 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== +uuid@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"