summary refs log tree commit diff
path: root/webrtc
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 18:24:21 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 23:35:18 +1000
commitf44f5d7ac2d24ff836c2e1d4b2fa58da04b13052 (patch)
treea6655c41bb3db79c30fd876b06ee60fe9cf70c9b /webrtc
parentAllow edited_timestamp to passthrough in handleMessage (diff)
downloadserver-f44f5d7ac2d24ff836c2e1d4b2fa58da04b13052.tar.xz
Refactor to mono-repo + upgrade packages
Diffstat (limited to 'webrtc')
-rw-r--r--webrtc/.DS_Storebin6148 -> 0 bytes
-rw-r--r--webrtc/.gitignore104
-rw-r--r--webrtc/.vscode/launch.json25
-rw-r--r--webrtc/README.md3
-rw-r--r--webrtc/package-lock.json859
-rw-r--r--webrtc/package.json31
-rw-r--r--webrtc/src/Server.ts56
-rw-r--r--webrtc/src/events/Close.ts9
-rw-r--r--webrtc/src/events/Connection.ts60
-rw-r--r--webrtc/src/events/Message.ts38
-rw-r--r--webrtc/src/index.ts2
-rw-r--r--webrtc/src/opcodes/BackendVersion.ts6
-rw-r--r--webrtc/src/opcodes/Heartbeat.ts9
-rw-r--r--webrtc/src/opcodes/Identify.ts60
-rw-r--r--webrtc/src/opcodes/SelectProtocol.ts46
-rw-r--r--webrtc/src/opcodes/Speaking.ts22
-rw-r--r--webrtc/src/opcodes/Video.ts118
-rw-r--r--webrtc/src/opcodes/index.ts19
-rw-r--r--webrtc/src/opcodes/sdp.json420
-rw-r--r--webrtc/src/start.ts13
-rw-r--r--webrtc/src/util/Constants.ts26
-rw-r--r--webrtc/src/util/MediaServer.ts51
-rw-r--r--webrtc/src/util/index.ts2
-rw-r--r--webrtc/tsconfig.json81
24 files changed, 0 insertions, 2060 deletions
diff --git a/webrtc/.DS_Store b/webrtc/.DS_Store
deleted file mode 100644

index bfb0a416..00000000 --- a/webrtc/.DS_Store +++ /dev/null
Binary files differdiff --git a/webrtc/.gitignore b/webrtc/.gitignore deleted file mode 100644
index 67045665..00000000 --- a/webrtc/.gitignore +++ /dev/null
@@ -1,104 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port diff --git a/webrtc/.vscode/launch.json b/webrtc/.vscode/launch.json deleted file mode 100644
index 49584172..00000000 --- a/webrtc/.vscode/launch.json +++ /dev/null
@@ -1,25 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "ts-node", - "type": "node", - "request": "launch", - "args": [ - "src/start.ts" - ], - "runtimeArgs": [ - "-r", - "ts-node/register" - ], - "cwd": "${workspaceRoot}", - "protocol": "inspector", - "internalConsoleOptions": "openOnSessionStart", - "sourceMaps": true, - "resolveSourceMapLocations": null, - } - ] -} \ No newline at end of file diff --git a/webrtc/README.md b/webrtc/README.md deleted file mode 100644
index c18ef54b..00000000 --- a/webrtc/README.md +++ /dev/null
@@ -1,3 +0,0 @@ -# fosscord-rtc-js - -A javascript fosscord webrtc server for voice and video communication diff --git a/webrtc/package-lock.json b/webrtc/package-lock.json deleted file mode 100644
index e27fbf3f..00000000 --- a/webrtc/package-lock.json +++ /dev/null
@@ -1,859 +0,0 @@ -{ - "name": "rtc", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "rtc", - "version": "1.0.0", - "license": "AGPL-3.0-only", - "dependencies": { - "@types/libsodium-wrappers": "^0.7.9", - "dotenv": "^12.0.4", - "libsodium": "^0.7.10", - "libsodium-wrappers": "^0.7.10", - "node-turn": "^0.0.6", - "tsconfig-paths": "^3.12.0", - "ws": "^7.5.8" - }, - "devDependencies": { - "@types/node": "^15.6.1", - "@types/sdp-transform": "^2.4.5", - "@types/ws": "^7.4.7", - "ts-node": "^10.4.0", - "typescript": "^4.3.2" - } - }, - "node_modules/@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-consumer": "0.8.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", - "dev": true - }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=" - }, - "node_modules/@types/libsodium-wrappers": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/@types/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz", - "integrity": "sha512-LisgKLlYQk19baQwjkBZZXdJL0KbeTpdEnrAfz5hQACbklCY0gVFnsKUyjfNWF1UQsCSjw93Sj5jSbiO8RPfdw==" - }, - "node_modules/@types/node": { - "version": "15.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.6.1.tgz", - "integrity": "sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA==", - "dev": true - }, - "node_modules/@types/sdp-transform": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@types/sdp-transform/-/sdp-transform-2.4.5.tgz", - "integrity": "sha512-GVO0gnmbyO3Oxm2HdPsYUNcyihZE3GyCY8ysMYHuQGfLhGZq89Nm4lSzULWTzZoyHtg+VO/IdrnxZHPnPSGnAg==", - "dev": true - }, - "node_modules/@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/crc": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", - "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", - "dependencies": { - "buffer": "^5.1.0" - } - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/date-format": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz", - "integrity": "sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/dotenv": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-12.0.4.tgz", - "integrity": "sha512-oWdqbSywffzH1l4WXKPHWA0TWYpqp7IyLfqjipT4upoIFS0HPMqtNotykQpD4iIg0BqtNmdgPCh2WMvMt7yTiw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==" - }, - "node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/libsodium": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", - "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" - }, - "node_modules/libsodium-wrappers": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", - "integrity": "sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==", - "dependencies": { - "libsodium": "^0.7.0" - } - }, - "node_modules/log4js": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.3.0.tgz", - "integrity": "sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw==", - "dependencies": { - "date-format": "^3.0.0", - "debug": "^4.1.1", - "flatted": "^2.0.1", - "rfdc": "^1.1.4", - "streamroller": "^2.2.4" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/node-turn": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/node-turn/-/node-turn-0.0.6.tgz", - "integrity": "sha512-HJRfWIADk5I61jZlrKHwx/A+IgusnN7Fs/M9wl0xuSxTynKnh4ZBLvvIeBH5w556bl2bFFkzHiCJFIZ3FR7fmA==", - "dependencies": { - "crc": "~3.8.0", - "js-yaml": "~3.14.0", - "log4js": "~6.3.0" - } - }, - "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" - }, - "node_modules/streamroller": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-2.2.4.tgz", - "integrity": "sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ==", - "dependencies": { - "date-format": "^2.1.0", - "debug": "^4.1.1", - "fs-extra": "^8.1.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/streamroller/node_modules/date-format": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", - "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "engines": { - "node": ">=4" - } - }, - "node_modules/ts-node": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", - "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "0.7.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/tsconfig-paths": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", - "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.0", - "strip-bom": "^3.0.0" - } - }, - "node_modules/typescript": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", - "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/ws": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", - "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - } - }, - "dependencies": { - "@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "dev": true - }, - "@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", - "dev": true, - "requires": { - "@cspotcode/source-map-consumer": "0.8.0" - } - }, - "@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true - }, - "@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", - "dev": true - }, - "@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true - }, - "@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", - "dev": true - }, - "@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=" - }, - "@types/libsodium-wrappers": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/@types/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz", - "integrity": "sha512-LisgKLlYQk19baQwjkBZZXdJL0KbeTpdEnrAfz5hQACbklCY0gVFnsKUyjfNWF1UQsCSjw93Sj5jSbiO8RPfdw==" - }, - "@types/node": { - "version": "15.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.6.1.tgz", - "integrity": "sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA==", - "dev": true - }, - "@types/sdp-transform": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@types/sdp-transform/-/sdp-transform-2.4.5.tgz", - "integrity": "sha512-GVO0gnmbyO3Oxm2HdPsYUNcyihZE3GyCY8ysMYHuQGfLhGZq89Nm4lSzULWTzZoyHtg+VO/IdrnxZHPnPSGnAg==", - "dev": true - }, - "@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true - }, - "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true - }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "crc": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", - "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", - "requires": { - "buffer": "^5.1.0" - } - }, - "create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "date-format": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz", - "integrity": "sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w==" - }, - "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "requires": { - "ms": "2.1.2" - } - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, - "dotenv": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-12.0.4.tgz", - "integrity": "sha512-oWdqbSywffzH1l4WXKPHWA0TWYpqp7IyLfqjipT4upoIFS0HPMqtNotykQpD4iIg0BqtNmdgPCh2WMvMt7yTiw==" - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, - "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==" - }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "requires": { - "minimist": "^1.2.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "libsodium": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz", - "integrity": "sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ==" - }, - "libsodium-wrappers": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz", - "integrity": "sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg==", - "requires": { - "libsodium": "^0.7.0" - } - }, - "log4js": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.3.0.tgz", - "integrity": "sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw==", - "requires": { - "date-format": "^3.0.0", - "debug": "^4.1.1", - "flatted": "^2.0.1", - "rfdc": "^1.1.4", - "streamroller": "^2.2.4" - } - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node-turn": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/node-turn/-/node-turn-0.0.6.tgz", - "integrity": "sha512-HJRfWIADk5I61jZlrKHwx/A+IgusnN7Fs/M9wl0xuSxTynKnh4ZBLvvIeBH5w556bl2bFFkzHiCJFIZ3FR7fmA==", - "requires": { - "crc": "~3.8.0", - "js-yaml": "~3.14.0", - "log4js": "~6.3.0" - } - }, - "rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" - }, - "streamroller": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-2.2.4.tgz", - "integrity": "sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ==", - "requires": { - "date-format": "^2.1.0", - "debug": "^4.1.1", - "fs-extra": "^8.1.0" - }, - "dependencies": { - "date-format": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", - "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==" - } - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" - }, - "ts-node": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", - "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", - "dev": true, - "requires": { - "@cspotcode/source-map-support": "0.7.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "yn": "3.1.1" - } - }, - "tsconfig-paths": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", - "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", - "requires": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", - "minimist": "^1.2.0", - "strip-bom": "^3.0.0" - } - }, - "typescript": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", - "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" - }, - "ws": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", - "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", - "requires": {} - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true - } - } -} diff --git a/webrtc/package.json b/webrtc/package.json deleted file mode 100644
index 1e333fb8..00000000 --- a/webrtc/package.json +++ /dev/null
@@ -1,31 +0,0 @@ -{ - "name": "rtc", - "version": "1.0.0", - "description": "A javascript fosscord webrtc server for voice and video communication", - "main": "dist/index.js", - "types": "src/index.ts", - "scripts": { - "test": "npm run build && node dist/test.js", - "build": "npx tsc -p .", - "start": "npm run build && node dist/start.js" - }, - "keywords": [], - "author": "Fosscord", - "license": "AGPL-3.0-only", - "devDependencies": { - "@types/node": "^15.6.1", - "@types/sdp-transform": "^2.4.5", - "@types/ws": "^7.4.7", - "ts-node": "^10.4.0", - "typescript": "^4.3.2" - }, - "dependencies": { - "@types/libsodium-wrappers": "^0.7.9", - "dotenv": "^12.0.4", - "libsodium": "^0.7.10", - "libsodium-wrappers": "^0.7.10", - "node-turn": "^0.0.6", - "tsconfig-paths": "^3.12.0", - "ws": "^7.5.8" - } -} diff --git a/webrtc/src/Server.ts b/webrtc/src/Server.ts deleted file mode 100644
index 32b795ea..00000000 --- a/webrtc/src/Server.ts +++ /dev/null
@@ -1,56 +0,0 @@ -import { closeDatabase, Config, initDatabase, initEvent } from "@fosscord/util"; -import dotenv from "dotenv"; -import http from "http"; -import ws from "ws"; -import { Connection } from "./events/Connection"; -dotenv.config(); - -export class Server { - public ws: ws.Server; - public port: number; - public server: http.Server; - public production: boolean; - - constructor({ port, server, production }: { port: number; server?: http.Server; production?: boolean }) { - this.port = port; - this.production = production || false; - - if (server) this.server = server; - else { - this.server = http.createServer(function (req, res) { - res.writeHead(200).end("Online"); - }); - } - - // this.server.on("upgrade", (request, socket, head) => { - // if (!request.url?.includes("voice")) return; - // this.ws.handleUpgrade(request, socket, head, (socket) => { - // // @ts-ignore - // socket.server = this; - // this.ws.emit("connection", socket, request); - // }); - // }); - - this.ws = new ws.Server({ - maxPayload: 1024 * 1024 * 100, - server: this.server, - }); - this.ws.on("connection", Connection); - this.ws.on("error", console.error); - } - - async start(): Promise<void> { - await initDatabase(); - await Config.init(); - await initEvent(); - if (!this.server.listening) { - this.server.listen(this.port); - console.log(`[WebRTC] online on 0.0.0.0:${this.port}`); - } - } - - async stop() { - closeDatabase(); - this.server.close(); - } -} \ No newline at end of file diff --git a/webrtc/src/events/Close.ts b/webrtc/src/events/Close.ts deleted file mode 100644
index 1c203653..00000000 --- a/webrtc/src/events/Close.ts +++ /dev/null
@@ -1,9 +0,0 @@ -import { WebSocket } from "@fosscord/gateway"; -import { Session } from "@fosscord/util"; - -export async function onClose(this: WebSocket, code: number, reason: string) { - console.log("[WebRTC] closed", code, reason.toString()); - - if (this.session_id) await Session.delete({ session_id: this.session_id }); - this.removeAllListeners(); -} \ No newline at end of file diff --git a/webrtc/src/events/Connection.ts b/webrtc/src/events/Connection.ts deleted file mode 100644
index bf228d64..00000000 --- a/webrtc/src/events/Connection.ts +++ /dev/null
@@ -1,60 +0,0 @@ -import { CLOSECODES, Send, setHeartbeat, WebSocket } from "@fosscord/gateway"; -import { IncomingMessage } from "http"; -import { URL } from "url"; -import WS from "ws"; -import { VoiceOPCodes } from "../util"; -import { onClose } from "./Close"; -import { onMessage } from "./Message"; -var erlpack: any; -try { - erlpack = require("@yukikaze-bot/erlpack"); -} catch (error) {} - -// TODO: check rate limit -// TODO: specify rate limit in config -// TODO: check msg max size - -export async function Connection(this: WS.Server, socket: WebSocket, request: IncomingMessage) { - try { - socket.on("close", onClose.bind(socket)); - socket.on("message", onMessage.bind(socket)); - console.log("[WebRTC] new connection", request.url); - - if (process.env.WS_LOGEVENTS) { - [ - "close", - "error", - "upgrade", - //"message", - "open", - "ping", - "pong", - "unexpected-response" - ].forEach((x) => { - socket.on(x, (y) => console.log("[WebRTC]", x, y)); - }); - } - - const { searchParams } = new URL(`http://localhost${request.url}`); - - socket.encoding = "json"; - socket.version = Number(searchParams.get("v")) || 5; - if (socket.version < 3) return socket.close(CLOSECODES.Unknown_error, "invalid version"); - - setHeartbeat(socket); - - socket.readyTimeout = setTimeout(() => { - return socket.close(CLOSECODES.Session_timed_out); - }, 1000 * 30); - - await Send(socket, { - op: VoiceOPCodes.HELLO, - d: { - heartbeat_interval: 1000 * 30 - } - }); - } catch (error) { - console.error("[WebRTC]", error); - return socket.close(CLOSECODES.Unknown_error); - } -} \ No newline at end of file diff --git a/webrtc/src/events/Message.ts b/webrtc/src/events/Message.ts deleted file mode 100644
index 8f75a815..00000000 --- a/webrtc/src/events/Message.ts +++ /dev/null
@@ -1,38 +0,0 @@ -import { CLOSECODES, Payload, WebSocket } from "@fosscord/gateway"; -import { Tuple } from "lambert-server"; -import OPCodeHandlers from "../opcodes"; -import { VoiceOPCodes } from "../util"; - -const PayloadSchema = { - op: Number, - $d: new Tuple(Object, Number), // or number for heartbeat sequence - $s: Number, - $t: String -}; - -export async function onMessage(this: WebSocket, buffer: Buffer) { - try { - var data: Payload = JSON.parse(buffer.toString()); - if (data.op !== VoiceOPCodes.IDENTIFY && !this.user_id) return this.close(CLOSECODES.Not_authenticated); - - // @ts-ignore - const OPCodeHandler = OPCodeHandlers[data.op]; - if (!OPCodeHandler) { - // @ts-ignore - console.error("[WebRTC] Unkown opcode " + VoiceOPCodes[data.op]); - // TODO: if all opcodes are implemented comment this out: - // this.close(CloseCodes.Unknown_opcode); - return; - } - - if (![VoiceOPCodes.HEARTBEAT, VoiceOPCodes.SPEAKING].includes(data.op as VoiceOPCodes)) { - // @ts-ignore - console.log("[WebRTC] Opcode " + VoiceOPCodes[data.op]); - } - - return await OPCodeHandler.call(this, data); - } catch (error) { - console.error("[WebRTC] error", error); - // if (!this.CLOSED && this.CLOSING) return this.close(CloseCodes.Unknown_error); - } -} \ No newline at end of file diff --git a/webrtc/src/index.ts b/webrtc/src/index.ts deleted file mode 100644
index 7cecc9b6..00000000 --- a/webrtc/src/index.ts +++ /dev/null
@@ -1,2 +0,0 @@ -export * from "./Server"; -export * from "./util/index"; \ No newline at end of file diff --git a/webrtc/src/opcodes/BackendVersion.ts b/webrtc/src/opcodes/BackendVersion.ts deleted file mode 100644
index b4b61c7d..00000000 --- a/webrtc/src/opcodes/BackendVersion.ts +++ /dev/null
@@ -1,6 +0,0 @@ -import { Payload, Send, WebSocket } from "@fosscord/gateway"; -import { VoiceOPCodes } from "../util"; - -export async function onBackendVersion(this: WebSocket, data: Payload) { - await Send(this, { op: VoiceOPCodes.VOICE_BACKEND_VERSION, d: { voice: "0.8.43", rtc_worker: "0.3.26" } }); -} \ No newline at end of file diff --git a/webrtc/src/opcodes/Heartbeat.ts b/webrtc/src/opcodes/Heartbeat.ts deleted file mode 100644
index 1b6c5bcd..00000000 --- a/webrtc/src/opcodes/Heartbeat.ts +++ /dev/null
@@ -1,9 +0,0 @@ -import { CLOSECODES, Payload, Send, setHeartbeat, WebSocket } from "@fosscord/gateway"; -import { VoiceOPCodes } from "../util"; - -export async function onHeartbeat(this: WebSocket, data: Payload) { - setHeartbeat(this); - if (isNaN(data.d)) return this.close(CLOSECODES.Decode_error); - - await Send(this, { op: VoiceOPCodes.HEARTBEAT_ACK, d: data.d }); -} \ No newline at end of file diff --git a/webrtc/src/opcodes/Identify.ts b/webrtc/src/opcodes/Identify.ts deleted file mode 100644
index 19a575ab..00000000 --- a/webrtc/src/opcodes/Identify.ts +++ /dev/null
@@ -1,60 +0,0 @@ -import { CLOSECODES, Payload, Send, WebSocket } from "@fosscord/gateway"; -import { validateSchema, VoiceIdentifySchema, VoiceState } from "@fosscord/util"; -import { endpoint, getClients, VoiceOPCodes, PublicIP } from "@fosscord/webrtc"; -import SemanticSDP from "semantic-sdp"; -const defaultSDP = require("./sdp.json"); - -export async function onIdentify(this: WebSocket, data: Payload) { - clearTimeout(this.readyTimeout); - const { server_id, user_id, session_id, token, streams, video } = validateSchema("VoiceIdentifySchema", data.d) as VoiceIdentifySchema; - - const voiceState = await VoiceState.findOne({ where: { guild_id: server_id, user_id, token, session_id } }); - if (!voiceState) return this.close(CLOSECODES.Authentication_failed); - - this.user_id = user_id; - this.session_id = session_id; - const sdp = SemanticSDP.SDPInfo.expand(defaultSDP); - sdp.setDTLS(SemanticSDP.DTLSInfo.expand({ setup: "actpass", hash: "sha-256", fingerprint: endpoint.getDTLSFingerprint() })); - - this.client = { - websocket: this, - out: { - tracks: new Map() - }, - in: { - audio_ssrc: 0, - video_ssrc: 0, - rtx_ssrc: 0 - }, - sdp, - channel_id: voiceState.channel_id - }; - - const clients = getClients(voiceState.channel_id)!; - clients.add(this.client); - - this.on("close", () => { - clients.delete(this.client!); - }); - - await Send(this, { - op: VoiceOPCodes.READY, - d: { - streams: [ - // { type: "video", ssrc: this.ssrc + 1, rtx_ssrc: this.ssrc + 2, rid: "100", quality: 100, active: false } - ], - ssrc: -1, - port: endpoint.getLocalPort(), - modes: [ - "aead_aes256_gcm_rtpsize", - "aead_aes256_gcm", - "xsalsa20_poly1305_lite_rtpsize", - "xsalsa20_poly1305_lite", - "xsalsa20_poly1305_suffix", - "xsalsa20_poly1305" - ], - ip: PublicIP, - experiments: [] - } - }); -} \ No newline at end of file diff --git a/webrtc/src/opcodes/SelectProtocol.ts b/webrtc/src/opcodes/SelectProtocol.ts deleted file mode 100644
index a3579b34..00000000 --- a/webrtc/src/opcodes/SelectProtocol.ts +++ /dev/null
@@ -1,46 +0,0 @@ -import { Payload, Send, WebSocket } from "@fosscord/gateway"; -import { SelectProtocolSchema, validateSchema } from "@fosscord/util"; -import { endpoint, PublicIP, VoiceOPCodes } from "@fosscord/webrtc"; -import SemanticSDP, { MediaInfo, SDPInfo } from "semantic-sdp"; - -export async function onSelectProtocol(this: WebSocket, payload: Payload) { - if (!this.client) return; - - const data = validateSchema("SelectProtocolSchema", payload.d) as SelectProtocolSchema; - - const offer = SemanticSDP.SDPInfo.parse("m=audio\n" + data.sdp!); - this.client.sdp!.setICE(offer.getICE()); - this.client.sdp!.setDTLS(offer.getDTLS()); - - const transport = endpoint.createTransport(this.client.sdp!); - this.client.transport = transport; - transport.setRemoteProperties(this.client.sdp!); - transport.setLocalProperties(this.client.sdp!); - - const dtls = transport.getLocalDTLSInfo(); - const ice = transport.getLocalICEInfo(); - const port = endpoint.getLocalPort(); - const fingerprint = dtls.getHash() + " " + dtls.getFingerprint(); - const candidates = transport.getLocalCandidates(); - const candidate = candidates[0]; - - const answer = - `m=audio ${port} ICE/SDP` - + `a=fingerprint:${fingerprint}` - + `c=IN IP4 ${PublicIP}` - + `a=rtcp:${port}` - + `a=ice-ufrag:${ice.getUfrag()}` - + `a=ice-pwd:${ice.getPwd()}` - + `a=fingerprint:${fingerprint}` - + `a=candidate:1 1 ${candidate.getTransport()} ${candidate.getFoundation()} ${candidate.getAddress()} ${candidate.getPort()} typ host`; - - await Send(this, { - op: VoiceOPCodes.SELECT_PROTOCOL_ACK, - d: { - video_codec: "H264", - sdp: answer, - media_session_id: this.session_id, - audio_codec: "opus" - } - }); -} \ No newline at end of file diff --git a/webrtc/src/opcodes/Speaking.ts b/webrtc/src/opcodes/Speaking.ts deleted file mode 100644
index e2227040..00000000 --- a/webrtc/src/opcodes/Speaking.ts +++ /dev/null
@@ -1,22 +0,0 @@ -import { Payload, Send, WebSocket } from "@fosscord/gateway"; -import { getClients, VoiceOPCodes } from "../util"; - -// {"speaking":1,"delay":5,"ssrc":2805246727} - -export async function onSpeaking(this: WebSocket, data: Payload) { - if (!this.client) return; - - getClients(this.client.channel_id).forEach((client) => { - if (client === this.client) return; - const ssrc = this.client!.out.tracks.get(client.websocket.user_id); - - Send(client.websocket, { - op: VoiceOPCodes.SPEAKING, - d: { - user_id: client.websocket.user_id, - speaking: data.d.speaking, - ssrc: ssrc?.audio_ssrc || 0 - } - }); - }); -} \ No newline at end of file diff --git a/webrtc/src/opcodes/Video.ts b/webrtc/src/opcodes/Video.ts deleted file mode 100644
index ff20d5a9..00000000 --- a/webrtc/src/opcodes/Video.ts +++ /dev/null
@@ -1,118 +0,0 @@ -import { Payload, Send, WebSocket } from "@fosscord/gateway"; -import { validateSchema, VoiceVideoSchema } from "@fosscord/util"; -import { channels, getClients, VoiceOPCodes } from "@fosscord/webrtc"; -import { IncomingStreamTrack, SSRCs } from "medooze-media-server"; -import SemanticSDP from "semantic-sdp"; - -export async function onVideo(this: WebSocket, payload: Payload) { - if (!this.client) return; - const { transport, channel_id } = this.client; - if (!transport) return; - const d = validateSchema("VoiceVideoSchema", payload.d) as VoiceVideoSchema; - - await Send(this, { op: VoiceOPCodes.MEDIA_SINK_WANTS, d: { any: 100 } }); - - const id = "stream" + this.user_id; - - var stream = this.client.in.stream!; - if (!stream) { - stream = this.client.transport!.createIncomingStream( - // @ts-ignore - SemanticSDP.StreamInfo.expand({ - id, - // @ts-ignore - tracks: [] - }) - ); - this.client.in.stream = stream; - - const interval = setInterval(() => { - for (const track of stream.getTracks()) { - for (const layer of Object.values(track.getStats())) { - console.log(track.getId(), layer.total); - } - } - }, 5000); - - stream.on("stopped", () => { - console.log("stream stopped"); - clearInterval(interval); - }); - this.on("close", () => { - transport!.stop(); - }); - const out = transport.createOutgoingStream( - // @ts-ignore - SemanticSDP.StreamInfo.expand({ - id: "out" + this.user_id, - // @ts-ignore - tracks: [] - }) - ); - this.client.out.stream = out; - - const clients = channels.get(channel_id)!; - - clients.forEach((client) => { - if (client.websocket.user_id === this.user_id) return; - if (!client.in.stream) return; - - client.in.stream?.getTracks().forEach((track) => { - attachTrack.call(this, track, client.websocket.user_id); - }); - }); - } - - if (d.audio_ssrc) { - handleSSRC.call(this, "audio", { media: d.audio_ssrc, rtx: d.audio_ssrc + 1 }); - } - if (d.video_ssrc && d.rtx_ssrc) { - handleSSRC.call(this, "video", { media: d.video_ssrc, rtx: d.rtx_ssrc }); - } -} - -function attachTrack(this: WebSocket, track: IncomingStreamTrack, user_id: string) { - if (!this.client) return; - const outTrack = this.client.transport!.createOutgoingStreamTrack(track.getMedia()); - outTrack.attachTo(track); - this.client.out.stream!.addTrack(outTrack); - var ssrcs = this.client.out.tracks.get(user_id)!; - if (!ssrcs) ssrcs = this.client.out.tracks.set(user_id, { audio_ssrc: 0, rtx_ssrc: 0, video_ssrc: 0 }).get(user_id)!; - - if (track.getMedia() === "audio") { - ssrcs.audio_ssrc = outTrack.getSSRCs().media!; - } else if (track.getMedia() === "video") { - ssrcs.video_ssrc = outTrack.getSSRCs().media!; - ssrcs.rtx_ssrc = outTrack.getSSRCs().rtx!; - } - - Send(this, { - op: VoiceOPCodes.VIDEO, - d: { - user_id: user_id, - ...ssrcs - } as VoiceVideoSchema - }); -} - -function handleSSRC(this: WebSocket, type: "audio" | "video", ssrcs: SSRCs) { - if (!this.client) return; - const stream = this.client.in.stream!; - const transport = this.client.transport!; - - const id = type + ssrcs.media; - var track = stream.getTrack(id); - if (!track) { - console.log("createIncomingStreamTrack", id); - track = transport.createIncomingStreamTrack(type, { id, ssrcs }); - stream.addTrack(track); - - const clients = getClients(this.client.channel_id)!; - clients.forEach((client) => { - if (client.websocket.user_id === this.user_id) return; - if (!client.out.stream) return; - - attachTrack.call(this, track, client.websocket.user_id); - }); - } -} \ No newline at end of file diff --git a/webrtc/src/opcodes/index.ts b/webrtc/src/opcodes/index.ts deleted file mode 100644
index 8c664cce..00000000 --- a/webrtc/src/opcodes/index.ts +++ /dev/null
@@ -1,19 +0,0 @@ -import { Payload, WebSocket } from "@fosscord/gateway"; -import { VoiceOPCodes } from "../util"; -import { onBackendVersion } from "./BackendVersion"; -import { onHeartbeat } from "./Heartbeat"; -import { onIdentify } from "./Identify"; -import { onSelectProtocol } from "./SelectProtocol"; -import { onSpeaking } from "./Speaking"; -import { onVideo } from "./Video"; - -export type OPCodeHandler = (this: WebSocket, data: Payload) => any; - -export default { - [VoiceOPCodes.HEARTBEAT]: onHeartbeat, - [VoiceOPCodes.IDENTIFY]: onIdentify, - [VoiceOPCodes.VOICE_BACKEND_VERSION]: onBackendVersion, - [VoiceOPCodes.VIDEO]: onVideo, - [VoiceOPCodes.SPEAKING]: onSpeaking, - [VoiceOPCodes.SELECT_PROTOCOL]: onSelectProtocol -}; \ No newline at end of file diff --git a/webrtc/src/opcodes/sdp.json b/webrtc/src/opcodes/sdp.json deleted file mode 100644
index 4867b9c7..00000000 --- a/webrtc/src/opcodes/sdp.json +++ /dev/null
@@ -1,420 +0,0 @@ -{ - "version": 0, - "streams": [], - "medias": [ - { - "id": "0", - "type": "audio", - "direction": "sendrecv", - "codecs": [ - { - "codec": "opus", - "type": 111, - "channels": 2, - "params": { - "minptime": "10", - "useinbandfec": "1" - }, - "rtcpfbs": [ - { - "id": "transport-cc" - } - ] - } - ], - "extensions": { - "1": "urn:ietf:params:rtp-hdrext:ssrc-audio-level", - "2": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", - "3": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", - "4": "urn:ietf:params:rtp-hdrext:sdes:mid" - } - }, - { - "id": "1", - "type": "video", - "direction": "sendrecv", - "codecs": [ - { - "codec": "VP8", - "type": 96, - "rtx": 97, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "VP9", - "type": 98, - "rtx": 99, - "params": { - "profile-id": "0" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "VP9", - "type": 100, - "rtx": 101, - "params": { - "profile-id": "2" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "VP9", - "type": 102, - "rtx": 122, - "params": { - "profile-id": "1" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 127, - "rtx": 121, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "1", - "profile-level-id": "42001f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 125, - "rtx": 107, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "0", - "profile-level-id": "42001f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 108, - "rtx": 109, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "1", - "profile-level-id": "42e01f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 124, - "rtx": 120, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "0", - "profile-level-id": "42e01f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 123, - "rtx": 119, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "1", - "profile-level-id": "4d001f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 35, - "rtx": 36, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "0", - "profile-level-id": "4d001f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 37, - "rtx": 38, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "1", - "profile-level-id": "f4001f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 39, - "rtx": 40, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "0", - "profile-level-id": "f4001f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - }, - { - "codec": "H264", - "type": 114, - "rtx": 115, - "params": { - "level-asymmetry-allowed": "1", - "packetization-mode": "1", - "profile-level-id": "64001f" - }, - "rtcpfbs": [ - { - "id": "goog-remb" - }, - { - "id": "transport-cc" - }, - { - "id": "ccm", - "params": ["fir"] - }, - { - "id": "nack" - }, - { - "id": "nack", - "params": ["pli"] - } - ] - } - ], - "extensions": { - "2": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", - "3": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", - "4": "urn:ietf:params:rtp-hdrext:sdes:mid", - "5": "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay", - "6": "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type", - "7": "http://www.webrtc.org/experiments/rtp-hdrext/video-timing", - "8": "http://www.webrtc.org/experiments/rtp-hdrext/color-space", - "10": "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", - "11": "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id", - "13": "urn:3gpp:video-orientation", - "14": "urn:ietf:params:rtp-hdrext:toffset" - } - } - ], - "candidates": [] -} \ No newline at end of file diff --git a/webrtc/src/start.ts b/webrtc/src/start.ts deleted file mode 100644
index 9a5f38ee..00000000 --- a/webrtc/src/start.ts +++ /dev/null
@@ -1,13 +0,0 @@ -process.on("uncaughtException", console.error); -process.on("unhandledRejection", console.error); - -import { config } from "dotenv"; -import { Server } from "./Server"; -config(); - -const port = Number(process.env.PORT) || 3004; - -const server = new Server({ - port -}); -server.start(); \ No newline at end of file diff --git a/webrtc/src/util/Constants.ts b/webrtc/src/util/Constants.ts deleted file mode 100644
index 64d78e22..00000000 --- a/webrtc/src/util/Constants.ts +++ /dev/null
@@ -1,26 +0,0 @@ -export enum VoiceStatus { - CONNECTED = 0, - CONNECTING = 1, - AUTHENTICATING = 2, - RECONNECTING = 3, - DISCONNECTED = 4 -} - -export enum VoiceOPCodes { - IDENTIFY = 0, - SELECT_PROTOCOL = 1, - READY = 2, - HEARTBEAT = 3, - SELECT_PROTOCOL_ACK = 4, - SPEAKING = 5, - HEARTBEAT_ACK = 6, - RESUME = 7, - HELLO = 8, - RESUMED = 9, - VIDEO = 12, - CLIENT_DISCONNECT = 13, - SESSION_UPDATE = 14, - MEDIA_SINK_WANTS = 15, - VOICE_BACKEND_VERSION = 16, - CHANNEL_OPTIONS_UPDATE = 17 -} \ No newline at end of file diff --git a/webrtc/src/util/MediaServer.ts b/webrtc/src/util/MediaServer.ts deleted file mode 100644
index 93230c91..00000000 --- a/webrtc/src/util/MediaServer.ts +++ /dev/null
@@ -1,51 +0,0 @@ -import { WebSocket } from "@fosscord/gateway"; -import MediaServer, { IncomingStream, OutgoingStream, Transport } from "medooze-media-server"; -import SemanticSDP from "semantic-sdp"; -MediaServer.enableLog(true); - -export const PublicIP = process.env.PUBLIC_IP || "127.0.0.1"; - -try { - const range = process.env.WEBRTC_PORT_RANGE || "4000"; - var ports = range.split("-"); - const min = Number(ports[0]); - const max = Number(ports[1]); - - MediaServer.setPortRange(min, max); -} catch (error) { - console.error("Invalid env var: WEBRTC_PORT_RANGE", process.env.WEBRTC_PORT_RANGE, error); - process.exit(1); -} - -export const endpoint = MediaServer.createEndpoint(PublicIP); - -export const channels = new Map<string, Set<Client>>(); - -export interface Client { - transport?: Transport; - websocket: WebSocket; - out: { - stream?: OutgoingStream; - tracks: Map< - string, - { - audio_ssrc: number; - video_ssrc: number; - rtx_ssrc: number; - } - >; - }; - in: { - stream?: IncomingStream; - audio_ssrc: number; - video_ssrc: number; - rtx_ssrc: number; - }; - sdp: SemanticSDP.SDPInfo; - channel_id: string; -} - -export function getClients(channel_id: string) { - if (!channels.has(channel_id)) channels.set(channel_id, new Set()); - return channels.get(channel_id)!; -} \ No newline at end of file diff --git a/webrtc/src/util/index.ts b/webrtc/src/util/index.ts deleted file mode 100644
index 2e09bc48..00000000 --- a/webrtc/src/util/index.ts +++ /dev/null
@@ -1,2 +0,0 @@ -export * from "./Constants"; -export * from "./MediaServer"; \ No newline at end of file diff --git a/webrtc/tsconfig.json b/webrtc/tsconfig.json deleted file mode 100644
index f45e0960..00000000 --- a/webrtc/tsconfig.json +++ /dev/null
@@ -1,81 +0,0 @@ -{ - "include": ["src/**/*.ts"], - "ts-node": { - "require": ["tsconfig-paths/register"], - }, - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "ESNext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "lib": [ - "ES2021" - ] /* Specify library files to be included in the compilation. */, - "allowJs": true /* Allow javascript files to be compiled. */, - "checkJs": true /* Report errors in .js files. */, - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true /* Generates corresponding '.d.ts' file. */, - "declarationMap": false /* Generates a sourcemap for each corresponding '.d.ts' file. */, - "sourceMap": true /* Generates corresponding '.map' file. */, - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist/" /* Redirect output structure to the directory. */, - "rootDir": "../" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, - "strictNullChecks": true /* Enable strict null checks. */, - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - "strictPropertyInitialization": false /* Enable strict checking of property initialization in classes. */, - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - "alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */, - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - "types": [ - "node" - ] /* Type declaration files to be included in compilation. */, - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - - /* Advanced Options */ - "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ - - "paths": { - "@fosscord/util": ["../util"], - "@fosscord/gateway": ["../gateway"], - "@fosscord/webrtc": ["."] - }, - } -}